Wiring assistance needed for 40x2, MAX7219, 4-digit 7-seg leds, and an alphanumeric

srsblake

New Member
First, my experience with Picaxe (or any microcontroller) is nill. I am absolutely brand new to this side of electronics. But I am a very curious person that likes to understand how things work and I like to design things myself, so this aught to prove interesting.

Second, what I am trying to do is create a display unit that will give me the current date (1st 4-digit display – MM:DD), the date in 1 week (2nd 4-digit display), the date in 2 weeks (3rd display) and the date in 4 weeks (4th display). At the base of the whole unit I want to have 5 buttons (1 for each work day).

At this point I am mainly concerned with the board layout/wiring. I am slightly (emphasis on that) confident that I could get the script part working. I have been reading a ton from this forum and many other sites and have not found any conclusive guidance on wiring my particular project.

Question 1: My first question is if anyone would be able to help me decide where and what size resistors to use on my board. Most of what I read says to put a 330k resistor (I think that's the size) between the LED and a microcontroller but I am not sure if that applies with these 7-segments (I assume it does) and at what rating I should use. **After finishing my schematic, which is attached, I noticed that there is no V+ on the LED displays. So then I take it power comes from the MAX7219s? If so, how to I limit the voltage down to the 3.4v and 2.1v that are allowed on the LEDs?**

My parts that I am planning to use are :
1 – Picaxe 40x2
2 – MAX7219’s
4 – 4-digit 7-segment displays from Sparkfun.com (com-09480, 81, 82, 83)
1 - Single digit Alphanumeric display
1 – Maxim DS1307 (for my current date)
1 – 32.768 khz crystal from Sparkfun.com (COM-00540)

I know my 4-digit displays are common anode and the MAX7219 is a common cathode but I have read many instances where I can reverse setup (connect display CA’s to MAX CC’s). I am also looking around to try and find a reasonably priced set of the displays in CC but have not had much luck since I want them in different colors. If you know of some, please let me know!

For my power I plan to use a DC wall jack, as it will be sitting on my desk. I know that my voltage ratings are varied among my parts because the blue led display uses 3.4V, the other three displays use around 2.1V, and the picaxe and MAX7219s can use 5v.

Question 2: Any suggestions on what voltage my DC should use (is there any benefit to going with a 9v or 12v verses my max 5.5v)? And can I just split off of this one DC supply to different voltage regulators?

I have attached a schematic from Eagle as a PDF to try to give a better idea of my project. If I left anything out let me know. At this point I am open to any wiring suggestions and advise.


View attachment work.pdf

Thank you beforehand to anyone that is able and willing to help!
Sean
 

nick12ab

Senior Member
Any suggestions on what voltage my DC should use (is there any benefit to going with a 9v or 12v verses my max 5.5v)? And can I just split off of this one DC supply to different voltage regulators?
9v or 12v will blow the components without the regulator. Your schematic shows that you do have regulators so you are using 5v so are you asking here if there is any benefit with not using the regulator?
 

srnet

Senior Member
You might want to fit a fuse, you will probably need it.

Have you checked the circuit diagram, you appear to have the power connections to the 7219 reversed ?
 

srsblake

New Member
9v or 12v will blow the components without the regulator. Your schematic shows that you do have regulators so you are using 5v so are you asking here if there is any benefit with not using the regulator?
Well my question is whether bringing in a 9 or 12v supply regulated down to what i would need would present any advantage over starting with say 6v or 5v? I realize that starting with a higher voltage means I need to fit my board with the regulators I just wasn't sure if the higher voltage would provide any benefits. I am new to this so I am not aware of the tricks and stuff.

You might want to fit a fuse, you will probably need it.

Have you checked the circuit diagram, you appear to have the power connections to the 7219 reversed ?
I hadn't considered the fuse, what rating would I use or how could I calculate the total rating? As for the the 7219, I thought I had them connected correctly. I have all the VSS's connected to positive and VCC/DD/GNDs hooked to what I had assumed was the negative. As I mentioned in my initial post, I am very new at this so it is not unlikely that I misread/misunderstood something.
 

John West

Senior Member
I'd suggest you start out with a 5 Volt power supply rated at about one amp or more, (You should do a power analysis to see how much you may need. I'm just guessing. Best to figure the power requirements with all segments driven,) as you have a lot of LED's to power. Normally we suggest new users begin wit a 3 cell AA battery pack. It helps keep things from blowing up, but it looks like your display would quickly kill off a battery pack. The reason I suggest you begin with a 5V wall-wart is simply that it requires no additional regulators, (or heat-sinks for them.) It's simply better to work with fewer parts when you are beginning, as long as you are using the correct parts.

What the resistors do is limit the current to the LED segments in the display. (LED's are controlled by the current being supplied to them, not so much the voltage.) The LED's will want to operate on a certain amount of current, 10 to 20 mA, or so. The voltage drop of the resistor in conjunction with the voltage dropped by the diode itself will add up to the 5 V of the circuit power supply. The PICAXE chip output pins will be able to supply enough current to drive the LED segments through the resistors without overheating.

If you get uneven brightness between the different color devices you might want to play with the resistor values a bit, but before you do, it's a very good idea to learn Ohm's Law for voltage, current and resistance, and do the current calculations for the LED's. There's info and online calculators for it all over the web. Very handy for calculating LED resistor values if you aren't yet experienced at it.

I didn't look at the specs on the MAX chip, but it appears its output current is selectable via a single resistor. If that's the case, follow the device data sheet specs to select that resistor value correctly. Again, you are probably looking in the 10 to 20 mA current range.
 
Last edited:

MartinM57

Moderator
MAX7219 is for CC displays and sources current for the individual segments from the SEGx pins and sinks the current for each digit into the DIG pins. The current through each segment is constant (and set by Rset) so no "LED resistors" are required at all. However, it does assume matched segments, so having different coloured displays on the same MAX is unlikely to succeed.

I don't believe MAX7219 can be made to use common anode displays (which need sourced digit current and sunk segment current) without extensive external hardware and maybe even some very clever software driving. For your first project, I think you have chosen a set of incompatible components :(

However, common anode multi-digit drivers are available - you might want to read the datasheet of the following for example:
http://uk.farnell.com/nxp/saa1064-n2-112/ic-led-driver-4dgt-i2c-24dip/dp/1627002?Ntt=SAA1064
...but this requires external components (2x transistors) just to drive 4 CA displays - and you will need 2x as many driver chips (since MAX7219 does 8 displays per chip). However that does mean that you will probably have more flexibility to set different currents through the different colour LEDs to make uniform brightness.

I don't really understand U4 - 330K resistors will mean that the segment current is so small that they will not light at all and putting realistic values in (270R or thereabouts) will exceed the max current capacity of the PICAXE when a lot of the segments are lit.

What does REG-3 do?
 

nick12ab

Senior Member
Well my question is whether bringing in a 9 or 12v supply regulated down to what i would need would present any advantage over starting with say 6v or 5v?
How else are you going to get 5v except through a regulator? I've never seen 5v batteries.
 

vshortt

Senior Member
There are 5V batteries out there but they are expensive and wouldn't last long in this scenario. I also don't think they will provide enough amperage without several of them. For the cost of the batteries you would need, you could make severa 5V regulated suppled to do this.

The MAX7219 will NOT work reversed (trust me, I know from experience) but they make several other common anode drivers that work very well. I've used a number of them just to play around with. I can tell that the easiest way to do this is to use an i2c version since you're already going to be using the i2c bus. the MAX6956 would be a good choice, but will require a little more programming. It will be able to handle your mix of displays.

In all honesty, working with a common cathode display would be far easier. They're more common and much easier to program for (though the circuit can be a little more complicated) - Kingbright makes some nice 7 segment displays in various colors and counts.
 

nick12ab

Senior Member
I did a Google Shopping search for '5v battery' and '5v batteries' and the sort of stuff that came up were those 4.5v zinc chloride battery packs and expensive low capacity (1Ah, quoted as 1000mAh to make it sound better) rechargeable portable gadget chargers but as the voltage of batteries drops as the battery gets used up, that would probably be using a boost regulator with a 3.7v Li-Po battery. I'm not denying the existence of 5v batteries but they are probably incredibly unpopular due to the reasons you have stated and because most semiconductors can work well off 3(.3) volts so can use a 3.3v LDO regulator with a Li-Po or 2xAA batteries.
 

srsblake

New Member
I don't really understand U4 - 330K resistors will mean that the segment current is so small that they will not light at all and putting realistic values in (270R or thereabouts) will exceed the max current capacity of the PICAXE when a lot of the segments are lit.

What does REG-3 do?
Reg-3 and Reg-2 where regulators I thought I would need but didn't end up hooking them up. I took out the Reg-2 but forgot to delete the Reg-3. As for the value of the U4 Resistor, I only put what I I had read at one point. I am not sure what ratings to use where and so need a little help here. I still need to read up on Ohm's Law.

The MAX7219 will NOT work reversed (trust me, I know from experience) but they make several other common anode drivers that work very well. I've used a number of them just to play around with. I can tell that the easiest way to do this is to use an i2c version since you're already going to be using the i2c bus. the MAX6956 would be a good choice, but will require a little more programming. It will be able to handle your mix of displays.

In all honesty, working with a common cathode display would be far easier. They're more common and much easier to program for (though the circuit can be a little more complicated) - Kingbright makes some nice 7 segment displays in various colors and counts.
First, thanks for the heads up on the experience w/ CA displays on the 7219. I'd like to stay with the CC displays primarily because I have already bought the 7219s! lol Do you have any suggestions for CC 4-digit diplays? I have looked at Kingbright displays but would like a blue display (I may have to change, but not too willingly lol) and they only have 2 digit displays in the blue... would two of these look ok next to each other to make the 4-digit appearance? or would they be noticeably separate?

BTW - Thanks to everyone that has made some input!

As for the incoming power supply, what I meant about the incoming voltage what I could use a 5v wall plug.
 

MartinM57

Moderator
Side by side single digit displays generally look identical to the multi digit displays - careful study of the datasheets will show whether the segment spacings are the same. I've put two single digits next to a 4-digit display and you can't tell which end they are at.

Some multi digit "clock" displays have colon separators between pairs of digits - you can't reproduce that with side-by-side single digit displays. So extending a 4 digit display that easily shows HH:MM into one that shows HH:MM:SS is more difficult. The common trick is to use smaller single digits displays for the seconds (yes, you can also use 3 set of 2-digit displays separated by pairs of 2mm normal LEDs, but absolutely perfect alignment is tricky)

UK-based supplier, but there's plenty of options here http://www.rapidonline.com/Electronic-Components/Optoelectronics/LED-Displays , including 4 digit CC displays
 

RexLan

Senior Member
Some multi digit "clock" displays have colon separators between pairs of digits - you can't reproduce that with side-by-side single digit displays.
Most of them are set up such that you flip one upside down and put the DP on the top ... they are clever parts.
PC270001.JPGPC270004.JPG
 

MartinM57

Moderator
...and IMHO that looks absolutely carp - it's like someone's tried to make a colon out of a pair of decimal points :D
 

nick12ab

Senior Member
...and IMHO that looks absolutely carp - it's like someone's tried to make a colon out of a pair of decimal points :D
...and IMHO it doesn't look bad at all - I've seen this attempted in commercial products and it's been much worse in them and for a hobbyist to do that well with it is pretty amazing.

My preference for when colons are unavailable is to just use the decimal point as shown in the attached picture of a clock. This way, the decimal point can be moved in between any two characters if the display's purpose needs that (e.g.a stopwatch where you can choose between (at any time, for the display) range and precision (showing most significant digits and no divisions of seconds or losing most significant digit and showing divisions of seconds).
 

Attachments

srsblake

New Member
Ok, i read up on Ohm's Law and have a quick question.. Obviously, V = R * I. So is the V my supply voltage or the necessary voltage drop? For example, if my max and picaxe need 5v and the displays need 2.1-2.5, would "V" be 5 or 2.5-2.9 (5-2.1/2.5)? Sorry if this seems like a super stupid question, just want to make sure I understand it all right. Thanks!
 

srsblake

New Member
First, I ordered some Kingbright CC displays... just wanted to put it out there because my OP said I was looking at sparkfun's CA displays... as it turns out they are much smaller than I thought (.39" i think) and I wanted atleast 1/2"...

But remember for a MAX7219 you should not use ANY dropping resistors - the MAX7219 controls the current through the LEDs itself
Well i have a slight issue there with the MAX7219 because I will have 2 7219's, each with two 4-digit displays. One of them will have 2-2.1-2.5v displays and the other will have a 3.3-4v and a 2.1-2.5v display... so I was thinking I could attempt to set the resistor between Iset and V+ on the 7219 to work for the higher voltage and then will just have to put resistors were necessary for the lower voltage display... which would also beg the question of which lines would I need to put the resistors on to make this work on the lower voltage display, the cathodes or the anodes?
 

john2051

New Member
Hi, I think if I were you I would forget using maxims drivers, and go for a serial display. Sparkfun sell them, and byvac here in the uk for about ten pounds. I saw their displays
at an amateur radio rally, and they do red green blue and yellow, all serially driven. I bought two, and they are real easy to use. With a serial lcd module, it considerably reduces
the number of ports you need.

Hope this helps, regards john
 

srsblake

New Member
Hi, I think if I were you I would forget using maxims drivers, and go for a serial display. Sparkfun sell them, and byvac here in the uk for about ten pounds. I saw their displays
at an amateur radio rally, and they do red green blue and yellow, all serially driven. I bought two, and they are real easy to use. With a serial lcd module, it considerably reduces
the number of ports you need.

Hope this helps, regards john
I'd consider it if I hadn't already purchased the displays and the maxims.... lol at this point I guess I am slightly confused about the current necessary to run the displays... the data sheets all say 30-40mA but the max7219's datasheet is basing its chart of Iset resistors off of 150mA+... is the current rating for the display the 40mA or is that just of one of the 7 segments? Sorry for all the n00b questions... i just dont have any resistors and don't really wanna buy a huge collection if I am only going to need a select few... (maybe some day down the road i'll invest in a stock of such items...
 

MartinM57

Moderator
Well the bottom line is that the MAX7219 isn't designed for mis-matched Vrefs for the LEDs or designed for CA LEDs. You might get some luck, but you're a bit on your own I'm afraid.

I don't think that putting resistors in some of the LEDs will work anyway as the MAX7219 drives a constant current through the LEDs so, within reason, adding R's in series with the LEDs won't make any difference to the brightness.

Also, you may find that the same current through the different colour LEDs will produce different apparent brightnesses, so you may not want the same constant current through each colour of LEDs either.

I suggest you try just the displays with no resistors (notwithstanding the CA/CC problem, which is would be a showstopper for me anyway, and get me looking for a different solution) - nothing bad will happen I suspect (no guarantees). You might get something to work....
 

vshortt

Senior Member
I agree with MartinM57, give it a shot, but realize that you're mixing the wrong IC with the wrong 7seg display and will most likely end up banging your head against the wall here. You might head over the the maxim website and poke around a little, find the right IC for your displays and then request a sample or two. The fine people at Maxim are usually happy to send a couple of engineering samples out free of charge (depending on your location, of course). Just an idea.
 
Top