Tag: Seeed

  • 10 Segment Display

    10 Segment LED Bar Graph Display

    10 Segment LED

     

    You may have seen these sweet looking LED bar graphs on armor like Boba Fett’s chest piece (those ones are all red). They make them in a few colors and in a rainbow of sorts, those are the ones I like. They can be easily integrated into armor and objects to add a little something extra.

    Here I will help you out with how to wire them and give you some code. The wiring is up to you, and yes it requires a bit of soldering. If you do not know how to solder I would honestly push you to get some supplies and give it a whirl. Once you’ve got soldering down you can create so many things.

     

    What does it do?

    This project will make the LED bar graph light up a single bar and pulse it back and forth like a Cylon, or Kit from Knight Rider. A flip of the switch changes the mode to make the bar graph light up and blink randomly.

     

    What you will need

    • (1) 10 Segment LED display
    • (10) 220 Ohm resistors
    • Wire
    • Solder and soldering iron
    • (1) microprocessor of your choosing
    • (1) small switch
    • Computer with Arduino-IDE installed

     

    You will need a (1) 10 segment display, (1) switch small enough for your use case, (10) 220Ohm resistors (one per pin), some solder and a microprocessor board to drive it all. In the clip above I am using a Raspberry Pi Pico, and the code below is written for the RPi Pico, but you can change the pins used to accommodate other microprocessors. It is just what I had on hand. You can use almost any chip that is Arduio-IDE compatible and has enough pins to use. ESP32C3, Arduino Pro Micro, and many other ESP/Arduino boards should work just fine.

    Here’s a list and links of what you will need (affiliate links):

    10 Segment LEDs (Red)

    10 Segment LEDs (multi-color)

    Raspberry Pi Pico

    RPi Pico RP2040-Zero

    220 Ohm Resistors

    Small switch

    More 10 segment colors available at Adafruit.com. Yellow, blue, green, amber, yellow-green.

     

    The LED

    The 10 segment display has 20 pins. 10 on the top, one pin per LED bar, and a negative pin (the entire bottom row) per each bar segment. Give voltage to the pins and the segment will light up for you. Feed it 3-5v DC with a 220 ohm resistor inline (per pin). Your microprocessor pins will give the bar graph the juice it needs, you do not need to wire them to power/V+. The board you choose will give out 3-5v DC to the gpio pins attached to the LED.

     

    Wiring

    You need to solder one 220 ohm resistor to each LED pin. If you are using a Pico like I did then that’s pins 2-11. The switch wires to pin 1 and ground.

    The bottom row is all negative pins, ground. You can wire all of the negative pins together and attach that to one ground pin on your microprocessor board. The pins with the 220 ohm resistors wire to pins on the microprocessor. One pin per wire/pin of the 10 segment display. Once you have all 10 of the LED segments wired up and the grounds wired up we can move on to the coding part.

     

    RPi Pico Pinout
    Raspberry Pi Pico Pinout

     

    The Arduino IDE

    I will not go over the Arduino IDE, or how to set it up for boards and libraries. There are a lot of great resources out there already for learning how to setup ESP and Pico boards with Arduino.

     

    The Code

    Fire up the Arduino-IDE and paste the following into a new sketch.

    This code was written for a Raspberry Pi Pico, adjust the pins for use with a different microprocessor.

    There are two sections of editable code:

    This section is where you can change the pins used for the LED display and the switch.

    This section is where you can adjust the speed of the pulse, and the blinking.

     

    The Full code below:

     

    Verify and then upload the code and you should be good to go!