LEDs are inexpensive and provide a great way to display information from microcontrollers. This project provides the details for making a 4 digit 7 segment LED module using LEDs that have a height of 0.8 inches (see my other projects for other sizes). To make the module easy to use with Arduino, Particle and Raspberry Pi boards, software libraries are available for these microcontrollers.
This design uses the AMS AS1115 LED controller chip (datasheet). Only two pins are used to communicate between the microcontroller and the LED module (using the I²C interface). The board has I²C pullup resistors (enabled with solder jumpers) and jumpers to select the I²C address. The module will operate with either 3.3 volts or 5 volts and a pot is used to easily adjust the brightness of the LED (and your software can also control the brightness).
To make it easy to use this LED display, I wrote a software libraries for the Arduino, Particle and Raspberry Pi boards. The library consists of 12 functions, such as clear(), moveCursor(), and write() (for displaying ASCII characters).
Here are some related projects and posts that may also interest you.
- I love I²C
- Backpack Board for .36″ LEDs
- Backpack Board for .56″ LEDs
- Backpack Board for .8″ LEDs
- LED software library for Arduino, Particle, & Raspberry Pi
The schematic and pcb layout files (Eagle and pdf) are available at this Github repository.
This project does not require many parts, and most are available from Mouser. Bare PC Boards are available from OSH Park.
|2||J1,J2||4 pin||Grove SMD 90||Seeedstudio.com||320110032|
|1||J3||4 pins||.1 Header Pins||Mouser.com||855-M20-9990445|
|1||PC Board||OSH Park||Order Link|
|1||LED1||.8″ tall LED||12 pin||see table below||see table below|
The LEDs must be common cathode. The following chart shows some LEDs that are available. There are many others available on eBay, Digikey, and Mouser.
Bare pc boards are available from OSH Park.
As you probably noticed, this board uses surface mount components, so you will need some skill in dealing with these small parts. Sparkfun has an excellent series of tutorials if you want to brush up your knowledge on soldering these small parts.
If you are using Grove type connectors for your I2C connection then install J1 and J2. If you prefer you can install a 4 pin header connector in J3 and use this for the I2C connection.
IMPORTANT: Install the LED to the NON-COMPONENT side of the board and solder the leads on the COMPONENT side. The decimal points on the LED should be closest to pin 1 (square pad) on the board.
Using a 4 pin Grove type cable, attach the LED backpack board to a microcontroller that has a I²C Grove type connector on it. This will power the display and connect the SDA and SCL lines to the microcontroller. If you are using the 4 pin header connecter instead, follow the pin legend on the board to make the I2C and power connections to your microcontroller. See below for information about Grove cables that are available.
Current Setting Resistance
The board has two resistors and a pot (R3,R4,R5) to limit the amount of current that is fed to the LED segments. The LEDs have two specifications that should not be exceeded in order to protect the LED. Look the the data sheet for the LED you are using and find the forward voltage (typically around 2.0 volts) and the typical segment current for the LED (typically 10-20mA). Using the chart below (and the supply voltage that you are using for the board, 3.3 or 5 volts) find the value of RSET. For example, if your supply voltage is 5.0 volts, LED segment current is 20mA, and the LED forward voltage is 2.0 volts, then the value of RSET (from the table) is 23.1 k ohms. This table is from the AS1115 datasheet
To set this resistance on the board, disconnect power and put an ohmmeter across the two test points (labeled TP) on the board. Adjust the pot (F5) with a small screwdriver to match the RSET resistance determined from the table above. If you need to reduce the resistance more than you can by adjusting the pot, you can solder across the jumper SJ5, which will short out resistor R4 (which will reduce the resistance across the test point by 6.8 k ohms).
There are four solder jumpers on the component side of the board. To “close” a jumper, carefully solder a bridge across the two pads with a small amount of solder.
SJ3 and SJ4 control the I²C address of the board. The following table shows the possible I²C address combinations.
I don’t recommend using address 0 as it is sometimes used for other purposes on the I2C bus.
If you solder across SJ1 and SJ2 you can enable pull up resistors on the signals SDA and SCL (respectively). Only one pull up resistor is required on each of these 2 signals somewhere in your design (even if you have more than one I2C device attached to your microcontroller’s I2C bus).
For Arduino, Particle and Raspberry Pi users, the I2c7SegmentLed library provides functions the take advantage of the features of this display. An included demo program shows the usage of the functions. These links give the details.
- Information on using the Libraries
- Github repository for the Arduino software library
- Github repository for the Particle software library
- Github repository for the Raspberry Pi software library
Seeedstudio makes the Particle Photon Base Shield which is a board that allows you to plug in a Particle Photon module. It has the Grove type connectors on it for easy connection to this backpack board.
Grove cables in various lengths are available from Seeedstudio, Mouser, Amazon, and Digikey. You can get Grove cables with the 4 pin Grove connector on both ends, or you can get Grove cables with a Grove connector on one end and the other end has a female square pin connector on each of the four wires. This cable is useful if you controller board does not have a Grove connector on it.
This hardware project is Open Source. Our License Information is here.