I wanted to learn how to use the 4 digit 7 segment from Adafruit. I decided to use the Chronodot as the Real Time Clock (RTC) to give me something to display. There are several excellent write ups out there but I could not find the basic introduction to putting all of this together, so I decided to write up my first tutorial. (Lord knows I have used a lot of others peoples write-ups)
So here goes.
First get your bill of materials:
Chronodot (adafruit.com and several other locations)
74HC595 (adafruit.com, digikey….)
4 digit 7 segment display (adafruit.com, $1.95, 16 pin)
Arduino of some flavor, I went with a Uno, Rev. 3.
You’ll need some resistor, I used 10 330ohm, ¼ watt.
When you see on forums, read the technical spec sheets on stuff, do it. A lot of questions can be answered by just reading the spec sheets.
There is a tremendous amount of information on everything in the BOM except the Max395. It is my new favorite chip. It is a 24 pin, serial 8 channel spst chip. You can use very similar to the 74HC595. The down side is, it cost about $8.
First, learn how to use the 74HC595. Get out the 8 LEDs and resistors and play with the serial communication, learn the difference between 10000000 and 00000001. (yes, 126 but how to use it) I suggest the Arduino shiftOut page.
Now you have some confidence on how to turn on and off 1 to 8 LEDs, cool.
Do the same with the Max395. This time, use the switches in the chip to turn on and off the LEDs.
Next, use the 74HC595 to turn on and off the anode with the resister in-line. Use the Max395 to turn on and off the cathodes.
Lets make the clock now.
We will only use 4 pins on the Chronodot, Ground, VCC, SCL and SDA.
VCC to +5 VDC on the Arduino
Ground to Ground on the Arduino
SCL to A5
SDA to A4
On the display: see the pdf attachment
4 digit 7 Segment
A to 300ohm resister to pin 15 on the 74HC595
B to 300ohm resister to pin 1 on the 74HC595
C to 300ohm resister to pin 2 on the 74HC595
D to 300ohm resister to pin 3 on the 74HC595
E to 300ohm resister to pin 4 on the 74HC595
F to 300ohm resister to pin 5 on the 74HC595
G to 300ohm resister to pin 6 on the 74HC595
Semicolon to 300ohm resister to pin 7 on the 74HC595
Digit 1 to pin 5 on the Max395
2 to pin 7 on the Max395
3 to pin 9 on the Max395
4 to pin 11 on the Max395
Semicolon to pin 13 on the Max395
Connect pin 6, 8, 10, 12 and 14 on the Max395 to ground.
On the 74HC595
8 to ground
9 not used
10 to +5 VDC
11 clock, to pin 3 on Arduino
12 latch, to pin 2 on Arduino
14 DataIn to pin 4 on Arduino
On the Max395
1 clock to pin 5 on Arduino
2 VCC to +5 VDC
3 Data to pin 6 on Arduino
4 to ground
21 to ground
22 Dout, not used
23 Reset to pin 7 on Arduino
24 CS to pin 8 on Arduino
Does it look like the attachment IMAG0166.jpg? ( I can’t figure out how to insert images, I’m a noob)
Before we get to the sketch, I need to say thanks to Manuael Gonzaleshttp://www.codingcolor.com/microcontrollers/an-arduino-lcd-clock-using-a-chronodot-rtc/, check out his site and tutorial with an LCD. And you’ll need some files from Github. Look at Stephanie Maks libraryhttps://github.com/Stephanie-Maks/Arduino-Chronodot/tree/master/examples. If you are not up on getting libraries, let me google that for youhttp://lmgtfy.com/?q=how+to+%20install+library+arduino.
Don’t judge me on this code, I’m a noob just trying to share.
It won’t let me insert the code so I will attach it.
4 digit 7 segment2.pdf (94.9 KB)
_12_04_26_4_digit_7_Segment_w_clock.ino (8.84 KB)