Square Thoughts

an engineering student's blog

Archive for the category “Designs Ideas”

Blow, Blow, Blown!

Remember how you tried endlessly to blow off the last candle on your birthday cake? I do. And it was a daunting task with everyone around me waiting for the candle to blow off and finally eat the cake.

This design idea lets you measure the intensity of your blow.

The design is simple, connect the thermistor and supporting resistors and make the micro controller read analog values. The magic lies in the algorithm used in the code. It is the one of the best I have written so far and the maybe the fastest algorithm(in terms of time spent to think) I have written, less than an hour with the client over my head.

R1 is used to heat the thermistor TR1. Resistor R2 and the thermistor TR1 form a resistor divider network used to monitor the temperature variations. Typical values of resistors are, R1 = 47 ohms, R2 = 100 ohms. When air blows over the thermistor, it cools the thermistor, increasing the voltage at the junction. The voltage at this junction is monitored continuously by the MCU’s ADC channel.

In my design, I use the thermistor to measure the pressure/force of my blow. So when somebody blows on the sensor, I serially output the intensity of the blow on a scale from 0 to 200 (values less than 20-30 are ignored as they are caused by ambient changes).

Potential applications include use in breath sensor technologies with use of high quality thermistors and regulating air flow in instrumentation applications.

Click here to get a copy of the code. It was written for the Arduino but can be used with any micro controller. The comments make the code self explanatory.

Update: – An application of this blow sensor made by me and my friend Shanjit, is on display at Ambience Mall, Gurgaon, India starting this Saturday, October 22, 2011 in collaboration with Saurabh Arora, Prabhat Saraswat, Rishabh Verma, Intel and Hindustan Times. Blow on the sensor to launch a virtual Diwali rocket on a huge LED screen. If your blow is powerful enough, the rocket would be fired else, keep on trying. It could win you prizes too. Be there to experience it. 

Have a safe and cracker free Diwali.

MOSFETs as Current Drivers

A few weeks back, in one of my projects, what I required was to drive 8 RGB LEDs using the minimum number of pins on a 8bit AVR ATTiny micro-controller. Laying put the schematic was easy, as I knew what I had to do. I was aware I had to employ methods for current sinking and sourcing to make the LEDs glow.  The conventional method would have been use of PNP and NPN transistors with lots and lots of resistors at their bases and use them as switches so that the least amount of current reaches the micro-controller pins. However, due to size limitations of my PCB, I could not use that many resistors.

Using MOSFETs was the other option as their gate current is negligible. I had read on the internet about current sourcing using P Channel MOSFETs. No one talked about current sinking using MOSFETs as such. So trivially accepting that if a P Channel sources current, an N channel would sink it. This is right to some extent but wouldn’t work if some conditions are overlooked. That prime condition being threshold voltage of the NMOS and PMOS. PMOS have higher threshold voltages compared to NMOS and hence cannot be ignored. For those who don’t know what threshold voltage, it is the minimum voltage between the the gate and source of the transistor required for switching operations. Threshold voltage for the NMOS I was using was 2V(NDS355AN) and for the PMOS was -2.5V(NDS356AP).

So getting my concepts straight about using MOSFETs as switches, I started building a daughter board for driving a single LED using a PMOS and NMOS. The schematic for which is given at the bottom of this post. It failed. Not because I had got my concepts wrong, rather I had soldered it wrong or the transistor was faulty.

The next time with immense help from my professor and guide, I was successful. We were successful.

This design concept is not just limited to driving LEDs. It can sink and source high value currents of over 2 amperes and send current in micro-amperes to the controller(current flow into the controller would be higher when using BJTs). It can be used to drive motors, LCD displays etc.

Some points to be remembered:-

  1. Use a supply of 5V or more for switching states. 3.3V would work, but may pose a serious problem in the presences of voltages being developed across any stray resistances which would make it very hard to debug.
  2. Use a current limiter resistor between the transistors, always.
  3. A high on the gate of the NMOS, turns on the transistor and vice versa.
  4. A low on the gate of the PMOS, turns on the transistor and vice versa.
  5. Last, as FETs can be depicted in several ways, recheck your connections before applying any voltages.
Components I used:-
  1. NDS355AN N-Channel Logic Level Enhancements FET.(perfect when using logic levels of 5V)
  2. NDS356AP P-Channel Logic Level Enhancements FET.(perfect when using logic levels of 5V)
  3. 3MM LED.
  4. 220ohm current limiting resistor.

Post Navigation