An LED You Can Blow Out Like a Candle!




About: Currently, I'm at a startup trying to change the world. In previous lives, I was an EE Prof., an Imagineer at Disney, and, according to Jay Leno, "a Japanese scientist" (I'm not Japanese, or a scientist). In...

LEDs are designed to emit light, but they also make surprisingly capable sensors. Using only an Arduino UNO, an LED and a resistor, we will build a hot LED anemometer that measures wind speed, and turns off the LED for 2 seconds when it detects you are blowing on it. You can use this to make breath controlled interfaces, or even an electronic candle that you can blow out!


An Arduino UNO (with USB cable to connect to your computer)

A 1/4W 220 ohm resistor (

A pre-wired, 0402 yellow LED (

Breakaway header (

You will also need:

A computer to run the Arduino environment

Basic soldering equipment/skills

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: How Does This Work?

When you run current through an LED, its temperature rises. The amount of rise depends on how effectively you are cooling it. When you blow on a hot LED, the extra cooling lowers the running temperature. We can detect this because the forward voltage drop of an LED increases as it gets cooler.

The circuit is very simple and looks much like driving an LED. The only difference is that we will add an extra wire to measure the voltage drop of the LED while it is on. To work well, you want to use a very small LED (I suggest using an 0402 surface mount LED) connected by the thinnest possible wires. This will allow the LED to heat and cool very quickly, and minimize the heat lost through the wires. The voltage changes we are looking for are just millivolts - at the very edge of what can be reliably detected via the UNOs analog pins. If the LED is resting on something that conducts heat away, it may not be able to get hot enough, so it works best if it is up in the air.

Step 2: Get the LED and Resistor Ready to Connect to Your Arduino UNO

Soldering extremely thin wires to very small surface mount LEDs takes a fair amount of skill. Fortunately, you can simply buy pre-wired, 0402 LEDs. These often come with a resistor (covered in heat shrink in the picture) that is sized for 12V operation. If that's what you get, you will need to cut off the resistor. If you cut through the heat shrink tubing next to the resistor bulge, you'll probably be able to pull off the remaining tubing leaving some exposed wire lead for soldering. If you just cut the wire, you will need to strip off a small amount of insulation so that you can solder, and given the thickness of the wire, this can be tricky.

The wires are much too skinny to make a good connection in an Arduino header, so we will need to solder them to something fatter. I used pins from a breakaway header to do the connections, but you can use just about any scrap of appropriate gauge wire. The back (cathode) wire from the LED is soldered to a single breakaway header pin. The red (anode) wire should be soldered to the bent resistor as shown. Trim the leads on the resistor to equal length and solder them to two adjacent header pins as shown in the figure.

Step 3: Connections

Connect the LED/resistor as shown in the figures. The side of the resistor connected to the red LED wire goes to A0. This will be where we measure the voltage on the LED using the analog input capability. The other side of the resistor goes to A1, which we will use as a digital output, setting it high to turn on the LED. The black wire must be connected to GND. Any of the Arduino GND pins can be used.

Step 4: Code

Download the code and open it in the Arduino IDE. You can then upload it to your Arduino.

The program first sets up the pin directions and lights the LED. It then measures the forward voltage drop of the LED via an analogRead on pin A0. To improve the accuracy of the measurement, we read the voltage 256 times in quick succession, and sum the result. (Oversampling like this can increase the effective resolution of the conversion so that we can see changes that are smaller than the smallest step on the converter.) If the data buffer sensedata[] is full, we compare the latest sum to the oldest we have stored in the buffer to see if a recent cooling has raised the LED voltage by at least MINJUMP. If it hasn't, we store sum in the buffer, update the buffer pointer, and start the next measurement. If it has, we turn off the LED for 2 seconds, reset the buffer and then start the process over again.

To better understand what's going on, we write the each sum out as serial data, and use the Arduino IDE's Serial Plotter (under the Tools menu) to graph the LED voltage as it changes over time. Remember to set the baud rate to 250000 to match the program. You will then be able to see how the voltage falls as the LED warms up after turn on. This will also show just how sensitive the system is. After the LED is triggered off, it will have cooled off somewhat by the time it turns back on, which you will see as a jump on the graph.

Step 5: Enjoy!

When the code is running, you should be able to blow out your LED with a quick puff of air. I have found that I can blow out my LED from over 1 meter away! In some rooms, air currents may cause false triggers. If this is a problem, you can lower the sensitivity of your system by increasing MINJUMP. The Serial Plotter can help you visualize what a proper value might be for your application.

You can replace the LED with one of a different color. White LEDs work particularly well. Because they have a higher voltage drop, you will need to change the resistance value to get the right current. Given the drive capability of the UNO, shoot for a current in the 10-15mA range. For a white LED, 100 ohms is a good starting point.

Because an UNO has 6 analog input pins, you can easily modify this code to support 6 independent, hot LED anemometers! This makes it possible to build simple interfaces that can recognize when you are blowing in different directions. This can be incredibly useful when building interfaces for the disabled, expressive controllers for musicians, or even for birthday cakes with many electronic candles!

Finally, if you ended up using this technique to do something cool, please leave a comment below!

Creative Misuse Contest

Participated in the
Creative Misuse Contest

3 People Made This Project!


  • Made with Math Contest

    Made with Math Contest
  • Multi-Discipline Contest

    Multi-Discipline Contest
  • Robotics Contest

    Robotics Contest

67 Discussions


Question 1 year ago

Can you this be made with and arduino nano or mini?

8 answers

Answer 1 year ago

Yes, I think it should work just fine. Apparently, the Due, Zero and MKR family Arduinos have 12 bit ADCs rather than 10, so you may not need to do any averaging with those...


Answer 1 year ago

I was successful with the arduino uno .. I then tried the pro mini and it is too "noisy" for me to detect when I blow on the led .. I soldered the led directly to the pins that did not help .. It is a great project .. I wish I knew how to damp down the "noise" on the pro mini. I even tried a plastic straw over the exposed led wires but that had no effect...


Reply 1 year ago

The noise might be coming from your power supply. Try using a cleaner supply (like a battery), and see if that helps...


Reply 1 year ago

Thanks so much for getting back to me! I tried the battery but that did not change anything...I’m going to attach a few photos that show my setup. I used the exact led you said to and I am using a 200 ohm resistor rather than 220 but it works on the adruino uno. I pulled the a0 and a1 pins and soldered the resistor directly to the unit. I program the pro mini with an inland ftdi usb connected to a Raspberry pi mod 3 using a raspberry pi power adapter 2.5 amps. The power should be good. The programming part is flawless..loads every time. With a minjump of 150 it basically blinks every 2 seconds. 250 did not help. A real stumper..


Reply 1 year ago

A few things to check come to mind. First, do you have the 3.3V or 5V version of the Pro Mini? If you have the 3.3V one, you will need to use a smaller resistor to get the requisite current. The 3.3V version is also slower, so you may need to change some of the timing. It looks like your LED is touching the table, which could steal heat away. You can always make MINJUMP so large that it never triggers. Then you can watch the plot to see exactly what's going on without the switching confusing things. Since you have a working UNO version, I'd compare the plots from the two versions. That might give you a better idea what's going on. Finally, I'd double check the resistor value to make sure it's 200 ohms and not 2k. (I couldn't tell from the pic)

Good luck!


Reply 1 year ago

Will purchase 220 resistors..misread the meter. So instead of 15.9 mA getting 1.75 mA and maybe that was my issue too low to measure? However, the other unit worked with the 2k resistor..This unit is a 5 volt setup. I will get another uno next week to run a check on the plot like you suggest..Thanks least I have some different things to try..

Great project ..and learning how to read resistors and use a meter!


10 months ago

Okay so I have a question maybe someone can answer , the difference is measured between A0 and A1 , is possible to reduce the amount of pins used if using multiple leds ? with each led using two Analog ports each the ports get used up quickly, maybe someone knows a way to use less ports for multiple leds?.

1 reply

Reply 8 months ago

Only A0 is being used as an analog port. You could use any output in place of A1. I only choose A1 so I wouldn't have to run a wire to the other side of the board. Given that you have more digital pins than analog ones, you could have as many LEDs as there are analog pins...


10 months ago

This is awesome. I like projects like this those use Arduino board and only small components. This is a new experiment for me.


Question 1 year ago

Do you mind if i use this the code from this instructable two make a birth day candle

intractable for the tips & tricks contest? cool if not would toltily understand. I will say that I got the code off your instructable and that you inspired me to make this intractable.

2 answers

Answer 1 year ago

Thanks for asking! I would appreciate the attribution and a pointer back to this original Instructable. But you should feel free to build on this - it's kind of the point of making it public! I'd also ask you to post a link to your Instructable here, so others looking for inspiration can find your work easily.

electron_plumberpower Bills

Reply 1 year ago

I haven't tried 1.8mm LEDs, but my guess is that they would not work well for this application. Because of the way these are molded, I would expect the thermal time constants to be annoyingly long.

Antzy Carmasaic

1 year ago

Great idea. Imagine the reverse. An LED that lights up when hit with wind. Then making lots of LED-Throwies with the circuit and putting them in trees. When the wind blows, the LEDs twinkle in the forest path.

1 reply
MikeA255Antzy Carmasaic

Reply 1 year ago

1) Turn LED on.

2) Wait 1s, measuring the temp (voltage) the whole time.

3) Did the temp vary outside a specific range during the wait?

4) If yes, it's gusty. Turn the LED off for maybe 250-2500ms and then back on. Then loop back to (1) and this time leave it on for a random value of 250-500ms (maybe the more it varied, the shorter both periods are.)

5) If no, leave it off for 5 seconds (plus maybe some random number of ms) and then loop back to (1) with the 1s delay back in step 2.

Something like that wouldn't leave them off completely with no wind but WOULD allow for some variability when the wind does blow. It'd need some calibration but would be workable. By adding a small randomness to (5) as well as step (4), you'd also keep them all from cycling in sequence..

Also using an ATTinyXX, you could easily run it at a lower voltage and that'd make the ADC have a larger range (if Vdd is 3V, for example, then the ADC has a resolution of 2.9mv, but at 5v, it's 4.9mv/step.)