Adding LEDs is a great way to spice up 3D printed models. In my next video I will use a simple circuit to automatically turn on LED when it is dark. Electronics are beyond scope of my youtube channel and I am not an expert so I won’t post a video on my youtbue channel about this circuit. However I can get my head around simple electronics and it can be useful to bring closer the topic.
The simplest LED circuit looks like this:
As a power source I use 2 AA batteries in series pack which is 3V. Green LED has forward voltage of about 2.2 V and forward current about 20 mA. To calculate resistor value you can use calculator:
In this example the calculated resistance is 47 ohms. It is possible to use greater values to limit the current and power consumption but it can affect the LED brightness.
Next step is to add a simple switch so we can manually turn on and off the LED:
Usually the switch is placed closer to the voltage source. The next step is to replace a switch with a transistor or as in my case with a MOSFET.
MOSFET as a switch
Here I replaced a switch with a 2N700 MOSFET. In this application it is treated as an electronic switch. Depending on your application and source voltage you will probably add a resistor before MOSFET gate (between SW2 and M1).
When switch SW2 connects MOSFET to +3v (up) the LED is on, when connected to ground (down) it acts as a open switch. It can be visually presented like this:
Ok great I replaced a switch with a MOSFET, but I still need to switch SW2 in order to turn the LED on or off. And this is exactly the next and last step.
Phototransistor as a switch controlling LED
Ok that’s it. I replaced switch SW2 with a 1 MΩ resistor and FT06-M phototransitor now the circuit is ready. When the phototransistor is lightened the MOSFET gate is connected to GND (LED goes off), otherwise to +3V via R2 resistor (LED goes on). You can change R2 value to change the LED switch threshold. By adding a potentiometer in series with R2 you can smoothly control it.
Why MOSFET and phototransitor
FT06-M is rated at max 40mA so you can use it without MOSFET to drive max 2 LED at 20mA each. 2N700 is rated at max 200mA. In my case I am using 5 LEDs which is 100mA and that’s enough to burn the phototransistor.
How long it will last
I use 2 AA batteries which is about 1000-2000 mAh. Let’s assume 1500 mAh. For 5 LEDs and 360 Ω limiting resistor I measured the current with a multimeter:
LED off: 0.003 mA
LEDs on: 0.7 mA
Assuming that every day for 12 hours the LED are on and for 12 hours are off. One day is equal to 12*0.003+12*0.7 ≈ 8.5 mAh power consumption. So about 176 days.
By the way I have no idea why I measured 0.7mA. With single 360 Ω resistor the current for LEDs should be 8.3 mA making the batteries last for about 15 days.
There are a lot of better sources about ‘MOSFET as a switch’ and phototransitors online where you can find more reliable and in depth information.
Be sure to check my next video were I will use this circuit and add LEDs to Swamp Dragon by Raffo San from My Mini Factory: