Nerdy birthday cake

Who would think about using electronic device instead of real birthday cake. But who knows – there might be few nerds who would like such thing. Maksym thought it would be cool to create such device. It not only mimics birthday cake but also have piezo sensor which reacts to air flow. So it can be blow on to make it flicker and go out. Circuit is built around Attiny44 microcontroller with 9 LEDs attached to it. Cake is made of two PCBs where one is dedicated to control circuit while another carries LEDs with sensor in the middle. There are many things that can be improved here. First of all it needs random LED flickering for better candle mimic. There probably would be great to have varying number of LEDs to match the birthday age. Probably different Charliepelxing algorithm could do the trick. Some nice 3D printed case wouldn’t hurt also. Continue reading

Electronic LED dice with tilt sensor

There are many electronic LED dice projects around where you can choose the layout, triggering and circuit. This one has something a bit different from other. First of all PCB is round and LEDs are numbered instead of positioned to mimic physical dice. LEDs here are positioned in circular pattern that labeled from 1 to 6. When dice is rolled, LEDs display chasing effect and gradually slows down until it stops at one of LEDs. Dice is built around PIC12LF1822 microcontroller. LEDs are connected by using three wires (Charlieplexing). Dice can be triggered with tilt sensor by shaking the dice. It is powered with coin cell battery. There is a switch to turn on and off. If dice is left powered for long time, it automatically enters sleep mode to save battery from draining. Software relies on rand() function witch is not true random, but is enough for dice project. Continue reading

Using three pins to drive three LEDs and read three buttons

Sometimes in more complex projects it is a waste to dedicate a line for every LED or button. If you thinking of selecting bigger microcontroller because you need additional pin to drive LED, think of smart way out. Francois AUGER & Philippe Fretaud have shared their technique of interfacing three LEDs and three buttons with three I/O pins. They used special Charlieplexing method of connecting all together and then wrote code piece to drive LEDs and read buttons. Three additional diodes allow reading buttons without affecting other components. Using three additional diodes is way more efficient than expanding number of pins. See video bellow of live action. Continue reading

Driving LED matrix with single PIC16F688

This project is based on interfacing an 11×10 matrix of LED’s, i.e 110 LED’s with a PIC microcontroller which has only 11 pins. These are quite a number of LED’s to be interfaced. The easiest solution is to use charlieplexing multiplexing techniques, but the problem with charlieplexing is that for any two arbitrary LEDs, only one may be lit at a time. However certain combination of LED’s can be lit together but not all the combinations exist. The author doesn’t used charlieplexing but instead scanned every leds one by one and using persistence of vision he lighted up the leds, but also making sure that not all leds are lighted together. It seems that the author was little confused as to which PIC he has to use. Since one of them can be run at higher frequency, interrupts were easier to program, but the other PIC had twice the ram that the other one. This allows him to double-buffer the screen, providing a rather cool set of APIs to the drawing code. For those interested, the code is available on… Continue reading

Driving 11×10 LED matrix with better charlieplexing

Dmitry had a bunch of spare LEDs and decided to give them a purpose. So he built a LED matrix of 11×10 LEDs. He found spare PIC16F688 laying around – why not. It has 11 pins that can be used and coincidentally he found that using charlieplexing 11 pins is what he need. While building the matrix, Dmitry decided to improve the algorithm that drives charlieplexed LEDs. The problem is that normally scanning algorithm scans only those LEDs that has to be light. So more LEDs are ON the more dim image gets. He decided to scan through all LEDs and this way give same timing no matter how many of the mare ON. This way intensity is always same. He used a Timer0 interrupt that frees MCU from timing and also added double buffer for storing image – this prevents from flickering. Great ideas that can be used in any project! Continue reading

Tiny microcontrollers can drive even more LEDs

Sometimes for simple applications you need to drive several LEDs. You would love to stick with tiny microcontroller that actually has few I/Os available. One solution could be using port expander that adds some complexity to overall project. Better solution is to use charlieplexing, when using special technique out can drive more LEDs than there are I/Os available. Charlieplexing method allows driving N*(N-1) LEDs with N pins, so with 5 I/O pins of tiny microcontroller it is possible to control 20 LEDs. And you even need as many current limiting resistors as there are pins used. If you drive 20 LEDs with 5 pins then you need 5 resistors instead 20 when driving them directly. Probably main disadvantage of this method is a bit more complex program as it requires some encoding. So next time you need more LEDs in your project simply avoid grabbing bigger MCU and use this compromise. Continue reading