3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

LoveBox - The box of love

Step 3Schematics & Software

Schematics & Software
Schematics
The schematics for this projects is rather simple.

There's the microcontroller , the digit "driver" and the display and some resistors to limit the current between the microcontroller and the display.

There are 14 anodes (positive)on the display, one for each segment on a digit, and 8 cathodes (negative), one for each digit.

The anodes are connected to 14 of the available ports on the microcontroller via 330 ohm resistors to reduce the current to a level that the display is not harmed by. U/R=I , that is Voltage divided by Resistance gives Current. The power supply is 6 volts and the display itself it dropping that by 1.8 volt so the resistor of 330 ohm will have 4.2 volts left to take care of. 4.8/330=0.012 (12 mA).

The datasheet for the displays says 2 mA per segment, and I choose to interpret that as as average figure. Since only one digit is lit at the same time each digit will only be lit for 1/8 of the total time. So to get 2 mA of average current is can be driven by 16 mA (2 mA times 8).

Even if this is not according to specs there are both safety margins and the display is only used intermittently and it if should break - who really cares? ;-)

The 74HTC138 that drives the anodes is really abused. If all segments on a digit is lit all of the 14 segment want to force 12 mA down through the poor '138. This would be a total current of 168 mA and that's far far far beyond what it can handle to sink.

Depending on the exact model of the chip the specified sink current is more like 5-10 mA. If I short circuit the output and measure it it can sink about 40 mA with an increased voltage level.

Now, all of the segments won't be lit at the same time, but the 40 mA limit will be reached quite often. Luckily enough the brightness of the display is rather constant whether it gets 4 mA or 15 mA, so it really doesn't matter that much.

It works, but it's a really sloppy and unprofessional design. It can be much better, but since I didn't have any better parts at hand I just used whats worked.

Software
The software is also really simple.

When the microcontroller starts is will read a seed for the random number generator from the non-volatile eeprom of it's memory, generate a new random number and then write back the new seed to the eeprom. Without keeping track of the seed that random number generator would generate the same number for each start. Hardly not any randomness in that ;-)

It then takes the generated random number and uses that for selecting one of several messages and scrolls that past the display.

When the entire message is displayed the microcontroller shuts itself down to a low power mode in order to save the batteries from draining too quickly if the lid inadvertently is left open.
« Previous StepDownload PDFView All StepsNext Step »
3 comments
Jan 24, 2010. 12:35 AMpsgarcha92 says:
how do we program this thing????
Jun 11, 2008. 2:34 PMMaarek says:
Could you explain the purpose of the 74HCT138 and how it works? Why couldn't you control the display with the uC? Thanks.
Sep 19, 2008. 7:27 AMAzayles says:
The 74HCT138 is used because there aren't enough output pins on the µC to control all the pins on the display. The 74HCT138 is able to individually address each of the 8 display sections using only 3 pins of the µC, instead of 8 µC pins.
Feb 1, 2008. 9:08 PMmpd-7000 says:
hii need help making this can you help ple i whant to make it for my gf

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
12
Followers
10
Author:matseng
Swedish expat living now living in Malaysia after spending some years working in Dubai.