Tagged: LEDs

3-LED flip-flop circuit

I made this circuit sometime back and I am still unsure of how it works. I saw a 2-LED version from Talking Electronics and tried this 3-LED version. All the explanations I found online are confusing. Apparently, one of the capacitors drains charge from its side of the circuit and switches off its transistor. The resistor connected to it ensures that it accumulates charge slowly. While this happens, it turns on the transistor on another side of the circuit. When that transistor turns on, the its LED lights up. When the first capacitor is fully charged, it stops supplying charge to this transistor and its LED turns off. By this time, its capacitor is accumulating charge and turning on another transistor and the LED connected to it turns on. This repeats one after another. At least, that is my understanding. It could be wrong. The flip-flop delay is controlled by the capacitor and resistor values. The voltage supplied to the circuit should be just enough to light up one LED.


Electronic Dice circuit using Arduino Uno

A re-creation of a e-Dice found in a children’s book

Some years ago, I went to a book exhibition where they literally sold imported books by the kilo. I am not speaking metaphorically. They sold books by weight. One of the books I bought was a children’s book. It had a circle-shaped plastic electronic toy stuck to the cover. It was an electronic dice. It cut through all pages and you could play a different board game on each of the pages in the book using the dice.

The dice construction was simple. Several LEDs were placed in a circle. When you pressed the center button, the LEDs lit up one after another along the circle. The dice also had a clear-plastic membrane speaker. The whole thing was powered using button-cell batteries. I saved the speaker and threw the dice away after the batteries ran out.

Silly me! I was then only interested in speaker circuits. Now that I am learning to play with Uno, I decided to re-create the dice. I have a ATtiny85 chip with which I will make this a self-contained toy. The ATtiny85 has 6 pins to connect the LEDs (I will hack the reset pin) and that leaves nothing for the speaker. I gave it a direct connection to power.

The circuit is simple. Connect the positive leads of the LEDs to the digital out pins marked for analog use (~). Connect the negative leads to a 220-ohm resistor. Connect the other end of the resistor to the ground pin on the Arduino. Connect the speaker parallel to the resistor. Add a 1uF capacitor to speaker terminals if the sound is weak.

Almost all dice circuits online are dumb. Not this one. It has sound and will be fun for kids to play with. I will order a circle-shaped sticker with numbers so that the dice is fully functional like the original toy.

An easy “Joule Thief” inverter circuit to power an electric torch with two LEDs using only one 1.2 or 1.5 volt (dead) battery

My handmade torch with a Joule Thief inverter design. The missing piece of the ferrite core can be found at the top of the battery. That’s the coil. The rubber band is used to hold down a momentary switch on the plastic tubing so that this photo could be taken.

These days, electric torches (flashlights) use LED bulbs. An LED bulb typically requires a minimum 1.85 volts to power on. Usually, a battery of two 1.5 volt cells (providing 3 volts) is used in torches to power them. If the voltage supplied by the cells in the battery falls below 1.85 volts, the LED will not light up. The “dead” cells in the battery will have to be replaced even though they still have considerable energy in them.

A “Joule thief” can be used to power an LED bulb using just one 1.5 (non-rechargeable) or 1.2 (rechargeable) cell. A “Joule thief” is so named because it can use just one cell. It can also power an LED with a cell that is deemed dead. The Joule thief circuit accomplishes this by using a coil to store energy and then generating spikes of voltages to turn the LED on and off several times a second. For human eyes, the LED appears to be lit up.

A Fritzing version of a Joule thief circuit

There are many videos on the Internet on how to build one. There are a number of misleading ideas of what is required to make it work. No need a circular ferrite core. I used a broken piece of ferrite core piece from a transformer salvaged from a failed phone charger. The number of windings on the coil does not increase the voltage. Instead, it affects the frequency of the voltage spikes. The voltage output is determined by the base voltage supplied by the battery and saturation level of the ferrite core. The windings need not be evenly spaced or anything like that. However, they need to be close to the ferrite core.

Parts required:

  • Two white LEDs
  • One non-polarized 0.1 uF capacitor
  • NPN transistor
  • 220 ohm resistor
  • jumper wire
  • ferrite core piece
  • winding (enameled) wire or any insulated wire


  1. Take two strands of equal-length enameled wire and wind it around a piece of ferrite core, say 20 to 40 times. Remove the enamel from the four ends of the coil. Twist/solder two ends of different wires. Use a multimeter continuity test to ensure that you are not tying the ends of the same wire. You can also use a LED+button cell combo to do the continuity test. Connect this tied end to the battery’s positive terminal.
  2. Now, you have two ends of coil that are free. Connect one end to a resistor and the other end to the collector of the transistor.
  3. Connect the other end of the resistor to the base of the transistor.
  4. Connect the LEDs and capacitor parallel to the emitter and collector of the transistor. The emitter is on the negative side.
  5. Connect the negative lead from the emitter of the transistor to the negative terminal of the cell.

Sound-activated LED lights using NPN transistor

What is wrong with the multi-colored LED light? Is it real?

I have started experimenting with transistors. The amplified AC sound signal forked from the speaker (connected to the base) is enough to turn the transistor on.  The supply voltage is connected to the LED onwards to the collector and a resistor  is connected to emitter (connected to ground).

I had some strange clear transparent LEDs. They turned on when on of the signal was connected to the collector but they did not react to the speaker signal. Stragely, one of the LEDs started glowing in all sorts of colors.

UPDATE: The clear LEDs are RGB LEDs. They follow their own (color) switching rhythm and are unsuitable for being sound-reactive.

How to create a cheap DIY backlit keyboard

Well, it is not really backlit. It is rather “overlit”. I took a clear-plastic-and-cardboard case, added a few LED bulbs and a transistor and connected them to 5 volts from a USB port. It is a cheap solution but far less expensive than a real backlit keyboard.

A cheap DIY solution for lighting up your computer keyboard.

How to power 12v LED strip using 5v USB port – add a step-up transformer

USB ports supply 5 volts. The 12v LED strip requires at least 9 volts. I bought a step-up DC-to-DC boost transformer circuit which can step up from 1.5v and up it up 24 or 32 volts. It took 5 volts from the USB port and boosted it up to 12 volts to the LED strip.

WARNING: Before connecting the output to any equipment, measure the output. The output voltage can vary widely depending on the input voltage. I fried an MP3 player module with 24 volts. So be careful. The circuit has a nut in the three-prong resistor which changes the output voltage. You can turn it several times in either direction to fine-tune the output voltage.

12v LED strip is powered by USB port using a step-up transformer circuit

Plastic box housing the transformer circuit has 2.1 mm plug (12 v) and socket (5v). I also added a 2.1 mm socket to the LED strip and a plug to a USB cable. (The USB port on the cable from the power bank was custom-built. I use it for electronic testing.) The power bank is also a custom-built one from 18650 batteries salvaged from a laptop battery.

Low-cost DIY portable emergency light using LED strips & 9-volt rechargeable batteries

The white LED strips operate at 12 volts. They will light up even at at 9 volts but will be less brighter.

The multi-colored LEDs are not really an emergency lighting option but are good enough to help you find your way to the white ones. They also work with 9v batteries, which cost 40 rupees each. Sealed 12v batteries will cost over 800 rupees, unless you can salvage old ones from vehicles or UPSs.


It is better to use a rechargeable 9-volt batteries, which cost over 150 rupees each. They will also need a special charger. This one is called a battery multi-charger.


The LED strips come with an adhesive-coated side & a transparent plastic side. They can be cut with a knife anywhere along its length or twisted to suit your design. A slide switch or a push button and 9 volt batter clip connector may be needed.