Showing posts with label LEDs. Show all posts
Showing posts with label LEDs. Show all posts

Progress indicator with addressable pixel ring

 Posted by:   Posted on:    No comments

Individually addressable pixel rings are WS2812 based RGB LED strips also known as NeoPixel strips. When interfaced with a microcontroller this strip can display any different RGB color on every LED it contains. They are versatile and can be used in a lot of projects. I bought a 24-LED LED ring which I originally intended to use to build a clock but until then I noticed it could make a nice progress indicator.

In the middle of the LED ring, I added a simple 4-digit 7-segment LED display with TM1637 controller. I opted for red display, yet you may use whatever color you like. Both display and LED ring, together with a buzzer are glued on a disc shaped piece of plastic. I could have 3D printed a better stand, yet the plastic disc does the job.

Progress indicator with addressable pixel ring

Bargraph timer, an unusual LM3914 application

 Posted by:   Posted on:    3 comments

LM3914 and LM3915 are dot/bar display drivers used to create basic displays of analog voltage levels. They are widely used in VU-meters and various voltage indicators (for batteries). The LM3914 senses an analog voltage and drives a number of LEDs depending on the level of this voltage. Knowing this, we can provide this voltage from a discharging capacitor. Depending on the resistive load which discharges the capacitor, the time required to turn off all LEDs can be set to specific intervals. This is how a timer is made using LM3914 (or LM3915).

This IC contains a constant current source for LEDs and an adjustable voltage reference. The following circuit uses LM3914 internal current source to charge the capacitor. To be able to modify countdown time, a potentiometer is used to discharge the capacitor. When the last LED is off two opamps drive a relay. The two opamps are part of the LM358 integrated circuit and one of them is used, in a similar manner, with a capacitor that is charged/discharged to provide an optional turn-off time for the relay. By setting a jumper you can choose between relay always on after time is up or relay on for an adjustable amount of time.

LM3914 countdown timer built on PCB

LM3914 countdown timer built on PCB

Drive the multiplexed 4 digit 7-segment display

 Posted by:   Posted on:    No comments

Seven segment displays are widely used in clocks, meters and other devices that need to display numerical information. The elements of the display, which are usually made from LEDs, are lit in different combinations to represent Arabic numerals. They have a limited ability to display some characters because there are only 7 elements that compose the shape of the displayed figure. Seven segment displays are very easy to find and are the cheapest display type.

In the previous post I talked about the electrical connections of such displays and how they should be interfaced to a microcontroller (MCU). A 7-segment display requires current limiting resistors on each segment and transistor drivers for each digit. This time I will identify the pins of an unmarked display device, I will wire it on the breadboard to an Arduino Nano compatible board and I’ll attempt to write the software to drive it.

Drive the multiplexed 4 digit 7-segment display

Proper wiring of a 4 digit 7-segment display

 Posted by:   Posted on:    4 comments

Seven segment displays are widely used in clocks, meters and other devices that need to display numerical information. The elements of the display, which are usually made from LEDs, are lit in different combinations to represent Arabic numerals. They have a limited ability to display some characters because there are only 7 elements that compose the shape of the displayed figure.

Seven segment displays are very easy to find and are the cheapest display type. Nowadays, modules with such displays do exist, where a display of 4, 8 and even more digits are driven by an integrated circuit. This driver gets the digits to be displayed from a microcontroller (MCU) via a serial bus. This saves a lot of pins and makes programming easy since all modern MCUs have support for the common serial protocols. Examples of such ICs are MAX7219, TM1637 and TM1638. The latter two come with support for keypad, therefore you can build front panels with buttons and display using such ICs.

Proper wiring of a 4 digit 7-segment display

Simple Text Menu for ST7920 Graphic LCD

 Posted by:   Posted on:    7 comments
Graphic LCD displays are a good addition for any project where you want to display some data. They look better than the old fashioned 7 segment displays and even alphanumeric LCDs, but more than that, you can use them to build user interfaces and menus. In a previous post, I wrote code for displaying text on a ST7920 128x64 graphic LCD. To save space, I wrote my code from scratch, instead of using a library that draws text in graphic mode and takes up a lot of memory on small microcontrollers. This time, I will continue to add features to the initial Arduino sketch in order to create a simple menu. This menu still uses text mode for displaying items. In this way, you are forced to display a maximum of four items at a time (the display has 4 rows of 16 characters). For highlighting menu items, we'll have to switch to graphics mode and draw rectangles on the screen. I will show you how the graphics RAM of ST7920 is organized and how you can set any pixel you want. The nice thing about ST7920 is that text pixels and graphics pixels are never at the same state. Therefore, if you have written text on a row and afterwards you fill the entire pixels on that row, the text pixels will be cleared ("RGB Controller" is written in text mode, then all pixels from that row are filled - see photo below).

Simple Text Menu for ST7920 Graphic LCD

Crossfade Bicolor LED with PS/2 Touchpad

 Posted by:   Posted on:    3 comments
Some while ago, I found a Processing example that would crossfade an Arduino connected bicolor LED depending on mouse position over a window with a gradient. Since I had a touchpad from an old netbook, I decided to use a hardware approach: interface this to Arduino and use it to change LED color by swiping left or right. Horizontal swiping will change the duty factor of PWM signals that light the LED.

This is a simple project that can be built with other kind of input devices like potentiometer or joystick. But, my purpose was to get that touchpad working. I had to use a logic analyzer to determine its pinout. Luckily, since it uses PS/2 protocol, it sends some bytes without connection to a host device. The PS/2 protocol is well documented and pretty easy. ATmega microcontrollers used by Arduino boards don't have hardware support for this protocol, therefore it must be implemented in software. Some searching revealed a lot of libraries for PS/2 devices, but not all worked for me. This may be because the touchpad I used is pretty old and may not support all protocol features.

Crossfade Bicolor LED with PS/2 Touchpad

CD4017 and NE555 Light Chaser Circuit

 Posted by:   Posted on:    No comments
This is the classic circuit that uses NE555 timer and CD4017 counter to generate a sequence of pulses. If these pulses drive LEDs, a chaser can be built (also known as water flowing light). It can be used for entertainment purposes or for various light signaling. The following circuit uses 10 LEDs that turn on in a regular sequence. This is the maximum number of outputs. If you need less than 10 output channels, CD4017 features a reset pin that is connected to ground. The following output pin after the last used pin can be rewired to reset (after disconnecting it from ground). Thus, once the pulses sequence reaches the reset pin, CD4017 will start over again, limiting the number of output channels.

NE555 is configured as an astable multivibrator. Oscillation frequency is rather low for this application. It is determined by R1, R2+RV1 and C2. With the values used for this circuit, it can be adjusted between 10 and 65 Hz. The duty cycle is close to 50%. If you want to calculate it yourself, use this tool.
CD4017 and NE555 Light Chaser Circuit

Computer PSU start circuit with bicolor LED

 Posted by:   Posted on:    1 comment
There are a lot of tutorials on the internet on how to turn a computer PSU into a bench top power supply. Most of them involve adding a load on the 5V line and turning the PSU on by grounding the PS_ON wire via a switch. Here is a nice indicator and turn on/off switch for computer PSUs.

ATX PSUs work well under rather constant loads. So if you power up the PSU with a small load of a few tens miliamps and then connect a greater load, for example a car light bulb which may require 3-4 A, the PSU may shut down. The same happens in case of an accidental shortcircuit. You may believe that the PSU got broken or its fuse got blown. That's not true. The PSU automatically shut itself off.
Computer PSU start circuit with bicolor LED