switching 12V with arduino

http://store.qkits.com/moreinfo.cfm?Product_ID=321

That display is rated 12 volts, using 5 2.4V LED's on each segment in series.

How could I control it with an arduino? At 15mA per segment, can I simply use a regular transistor array to send 5V at the base and transmit 12V between collector/emitter?

Yes, but you should arrange for at least a 15V supply, 12V is the forward voltage across the forward-biased LEDs (in series): 15V -12V = 3V; 3V / 15mA = 200?

[Also, it's not transmitting, it's switching - turning a transistor on/off.

ULN2003 is the best way to drive such display, with +12V regulated power supply you don't need any external resistors (there are resistors already in module, you can see on picture).

I'd go with ULN2803, so the decimal point can be controlled also.

I don't see a schematic, the text seems to imply it can be connected as eithe common anode (where the ULN280x would sink current on the idividual segments) or common cathode (where you need something like the Allegro UDN2981 to drive the anodes).

Yes, it can be set up with either common. I plaan to set to common anode and switch cathodes. Each segment has resistors built into the board so no external neccesary. Just need to switch with arduino. Gonna be three of these so I'm gonna use a Mega. I'd rather use a mini/pro/uno ect with a mux board, but i can get the mega for $45 from mouser, which would be cheaper than uno ($25) and mux board ($15) and shipping.

magnethead794:
http://store.qkits.com/moreinfo.cfm?Product_ID=321

That display is rated 12 volts, using 5 2.4V LED's on each segment in series.

How could I control it with an arduino? At 15mA per segment, can I simply use a regular transistor array to send 5V at the base and transmit 12V between collector/emitter?

Red LEDs are about 1.9V or so, not 2.4V. There are series resistors already on the module, it is designed to run from 12V, shouldn't hurt too much to drive with darlington array (lose about 1V, will be dimmer). Can use discrete NPN transistors too (which won't drop that volt).

I just found this. Exactly what I needed (one extra digit, but it'll be handy to have): http://store.qkits.com/moreinfo.cfm?Product_ID=895

Control all 28 segments and 4 decimals off a mega.

They show this driver for the 4 digit board: http://store.qkits.com/moreinfo.cfm/MXA008

Can anybody tell what it is, exactly? Just a fancy darlington array?

Will the 2803 switch 12V on a 5V base? I thought it was a 5V chip? Or does that only apply to the base voltage?

ULN2803 has 8 channels that are turned on/off from arduino output pin.
Each channel can then can sink current from up to a 50V source I think, at up to 500mA. So 140mA from a 12V is not a problem.
You can find its datasheet at http://www.ti.com/lit/ds/symlink/uln2803a.pdf.

Connect all the anodes to 12V.
Connect the individual cathodes to 4 ULN203s.
Drive the ULN2803s from 28 Mega pins.

Or, 4 PNP transitors to control the 4 anodes
Connect 7 arduino outputs to 4 ULN2803s in parallel.
Drive the cathodes, and 1 PNP transistor at a time.
11 pins needed.
Should be able to fit that on a prototype shield

CrossRoads:
Connect all the anodes to 12V.
Connect the individual cathodes to 4 ULN203s.
Drive the ULN2803s from 28 Mega pins.

Or, 4 PNP transitors to control the 4 anodes
Connect 7 arduino outputs to 4 ULN2803s in parallel.
Drive the cathodes, and 1 PNP transistor at a time.
11 pins needed.
Should be able to fit that on a prototype shield

The multiplexing I found used 8 channel sourcers with 4 channel sinkers. You're saying if I use a 4 channel source and 8 channel sink, I can multiplex the same? Assuming that I use PNP source transistors that can withstand the 120mA of each digit+decimal? (I won't need the colon)

source digit 'd' and sink segments 'a', 'b', ect? Then go from digit to digit to digit?

All segments of same position would be commoned? Wouldn't I just need one 8203 then?

digit 1 high
digit 2 low
digit 3 low
digit 4 low
segment a high
segment b low
segment c high
segment d high
segment e low
segment f high
segment g high

delay(200)

digit 1 low
digit 2 high
digit 3 low
digit 4 low
segment a high
segment b high
segment c high
segment d high
segment e high
segment f high
segment g high

delay(200)

digit 1 low
digit 2 low
digit 3 high
digit 4 low
segment a high
segment b high
segment c high
segment d high
segment e low
segment f high
segment g low

delay(200)


digit 1 low
digit 2 low
digit 3 low
digit 4 high
segment a high
segment b high
segment c high
segment d high
segment e low
segment f high
segment g high

Also, what would be the best way to multiplex an input? For 4 digits I'll need a way to set the value (0123456789) for each digit. Even with BCD coded switches, thats 4 wires per digit, 16 wires total.

I'm thinking have one coded switch, a 4 position digit selector, and each digit as a byte in EEPROM of the CPU? That would take 8 wires (4 for coded switch and 4 for digit selector). This (switch/control box) is going on a 4 foot cable, so fewer conductors the better. I'm using 4 conductor alarm wire.

elsewise, 4 switches with 4 pins each would equate to this: http://www.piclist.com/techref/microchip/4x4key4io8diode.htmBUT with so many combinations, I think the digit selector is a better idea? But 4 switches would be more user intuitive.

I could keep each switch discrete and use 2 cat-5 cables, but i think the twisted pairs would cause issues with false readings? But the ability to use a pair of 2m cables would be a big bonus.

This would be assuming I kept all 4 switches discrete and using 2 cat-5's would work. Mostly pseudo.
Mouser # 105-SR2511F-34FN with a single BCD switch and use one Cat5?

one{
segmenta LO
segmentb HI
segmentc HI
segmentd LO
segmente LO
segmentf LO
segmentg LO
}

two{
segmenta HI
segmentb HI
segmentc LO
segmentd HI
segmente HI
segmentf LO
segmentg HI
}

three{
segmenta HI
segmentb HI
segmentc HI
segmentd HI
segmente LO
segmentf LO
segmentg HI
}

four{
segmenta LO
segmentb HI
segmentc HI
segmentd LO
segmente LO
segmentf HI
segmentg HI
}

five{
segmenta HI
segmentb LO
segmentc HI
segmentd HI
segmente LO
segmentf HI
segmentg HI
}

six{
segmenta HI
segmentb LO
segmentc HI
segmentd HI
segmente HI
segmentf HI
segmentg HI
}

seven{
segmenta HI
segmentb HI
segmentc HI
segmentd LO
segmente LO
segmentf LO
segmentg LO
}

eight{
segmenta HI
segmentb HI
segmentc HI
segmentd HI
segmente HI
segmentf HI
segmentg HI
}

nine{
segmenta HI
segmentb HI
segmentc HI
segmentd HI
segmente LO
segmentf HI
segmentg HI
}

zero{
segmenta HI
segmentb HI
segmentc HI
segmentd HI
segmente HI
segmentf HI
segmentg LO
}

ay{
segmenta HI
segmentb HI
segmentc HI
segmentd LO
segmente HI
segmentf HI
segmentg HI
}

bee{
segmenta LO
segmentb LO
segmentc HI
segmentd HI
segmente HI
segmentf HI
segmentg HI
}

see{
segmenta HI
segmentb LO
segmentc LO
segmentd HI
segmente HI
segmentf HI
segmentg LO
}

ee{
segmenta HI
segmentb LO
segmentc LO
segmentd HI
segmente HI
segmentf HI
segmentg HI
}

ell{
segmenta LO
segmentb LO
segmentc LO
segmentd HI
segmente HI
segmentf HI
segmentg LO
}

enn{
segmenta LO
segmentb LO
segmentc HI
segmentd LO
segmente HI
segmentf LO
segmentg HI
}

oh{
segmenta LO
segmentb LO
segmentc HI
segmentd HI
segmente HI
segmentf LO
segmentg HI
}

pee{
segmenta HI
segmentb HI
segmentc LO
segmentd LO
segmente HI
segmentf HI
segmentg HI
}

arr{
segmenta LO
segmentb LO
segmentc LO
segmentd LO
segmente HI
segmentf LO
segmentg HI
}

ess{
segmenta HI
segmentb LO
segmentc HI
segmentd HI
segmente LO
segmentf HI
segmentg HI
}

tee{
segmenta LO
segmentb LO
segmentc LO
segmentd HI
segmente HI
segmentf HI
segmentg HI
}

LoYou{
segmenta LO
segmentb LO
segmentc HI
segmentd HI
segmente HI
segmentf LO
segmentg LO
}

upYou{
segmenta LO
segmentb HI
segmentc HI
segmentd HI
segmente HI
segmentf HI
segmentg LO
}

ex{
segmenta LO
segmentb LO
segmentc LO
segmentd LO
segmente LO
segmentf LO
segmentg LO
}

why{
segmenta LO
segmentb HI
segmentc HI
segmentd HI
segmente LO
segmentf HI
segmentg HI
}

if (text = LO){

if ((dig1_1 = HI) && (dig1_2 = LO) && (dig1_4 = LO) && (dig1_8 = LO)){
digit1 = 1
}
if ((dig1_1 = LO) && (dig1_2 = HI) && (dig1_4 = LO) && (dig1_8 = LO)){
digit1 = 2
}
if ((dig1_1 = HI) && (dig1_2 = HI) && (dig1_4 = LO) && (dig1_8 = LO)){
digit1 = 3
}
if ((dig1_1 = LO) && (dig1_2 = LO) && (dig1_4 = HI) && (dig1_8 = LO)){
digit1 = 4
}
if ((dig1_1 = HI) && (dig1_2 = LO) && (dig1_4 = HI) && (dig1_8 = LO)){
digit1 = 5
}
if ((dig1_1 = LO) && (dig1_2 = HI) && (dig1_4 = HI) && (dig1_8 = LO)){
digit1 = 6
}
if ((dig1_1 = HI) && (dig1_2 = HI) && (dig1_4 = HI) && (dig1_8 = LO)){
digit1 = 7
}
if ((dig1_1 = LO) && (dig1_2 = LO) && (dig1_4 = LO) && (dig1_8 = HI)){
digit1 = 8
}
if ((dig1_1 = HI) && (dig1_2 = LO) && (dig1_4 = LO) && (dig1_8 = HI)){
digit1 = 9
}
if ((dig1_1 = LO) && (dig1_2 = LO) && (dig1_4 = LO) && (dig1_8 = LO)){
digit1 = 0
}

if ((dig2_1 = HI) && (dig2_2 = LO) && (dig2_4 = LO) && (dig2_8 = LO)){
digit2 = 1
}
if ((dig2_1 = LO) && (dig2_2 = HI) && (dig2_4 = LO) && (dig2_8 = LO)){
digit2 = 2
}
if ((dig2_1 = HI) && (dig2_2 = HI) && (dig2_4 = LO) && (dig2_8 = LO)){
digit2 = 3
}
if ((dig2_1 = LO) && (dig2_2 = LO) && (dig2_4 = HI) && (dig2_8 = LO)){
digit2 = 4
}
if ((dig2_1 = HI) && (dig2_2 = LO) && (dig2_4 = HI) && (dig2_8 = LO)){
digit2 = 5
}
if ((dig2_1 = LO) && (dig2_2 = HI) && (dig2_4 = HI) && (dig2_8 = LO)){
digit2 = 6
}
if ((dig2_1 = HI) && (dig2_2 = HI) && (dig2_4 = HI) && (dig2_8 = LO)){
digit2 = 7
}
if ((dig2_1 = LO) && (dig2_2 = LO) && (dig2_4 = LO) && (dig2_8 = HI)){
digit2 = 8
}
if ((dig2_1 = HI) && (dig2_2 = LO) && (dig2_4 = LO) && (dig2_8 = HI)){
digit2 = 9
}
if ((dig2_1 = LO) && (dig2_2 = LO) && (dig2_4 = LO) && (dig2_8 = LO)){
digit2 = 0
}

if ((dig3_1 = HI) && (dig3_2 = LO) && (dig3_4 = LO) && (dig3_8 = LO)){
digit3 = 1
}
if ((dig3_1 = LO) && (dig3_2 = HI) && (dig3_4 = LO) && (dig3_8 = LO)){
digit3 = 2
}
if ((dig3_1 = HI) && (dig3_2 = HI) && (dig3_4 = LO) && (dig3_8 = LO)){
digit3 = 3
}
if ((dig3_1 = LO) && (dig3_2 = LO) && (dig3_4 = HI) && (dig3_8 = LO)){
digit3 = 4
}
if ((dig3_1 = HI) && (dig3_2 = LO) && (dig3_4 = HI) && (dig3_8 = LO)){
digit3 = 5
}
if ((dig3_1 = LO) && (dig3_2 = HI) && (dig3_4 = HI) && (dig3_8 = LO)){
digit3 = 6
}
if ((dig3_1 = HI) && (dig3_2 = HI) && (dig3_4 = HI) && (dig3_8 = LO)){
digit3 = 7
}
if ((dig3_1 = LO) && (dig3_2 = LO) && (dig3_4 = LO) && (dig3_8 = HI)){
digit3 = 8
}
if ((dig3_1 = HI) && (dig3_2 = LO) && (dig3_4 = LO) && (dig3_8 = HI)){
digit3 = 9
}
if ((dig3_1 = LO) && (dig3_2 = LO) && (dig3_4 = LO) && (dig3_8 = LO)){
digit3 = 0
}

if ((dig4_1 = HI) && (dig4_2 = LO) && (dig4_4 = LO) && (dig4_8 = LO)){
digit4 = 1
}
if ((dig4_1 = LO) && (dig4_2 = HI) && (dig4_4 = LO) && (dig4_8 = LO)){
digit4 = 2
}
if ((dig4_1 = HI) && (dig4_2 = HI) && (dig4_4 = LO) && (dig4_8 = LO)){
digit4 = 3
}
if ((dig4_1 = LO) && (dig4_2 = LO) && (dig4_4 = HI) && (dig4_8 = LO)){
digit4 = 4
}
if ((dig4_1 = HI) && (dig4_2 = LO) && (dig4_4 = HI) && (dig4_8 = LO)){
digit4 = 5
}
if ((dig4_1 = LO) && (dig4_2 = HI) && (dig4_4 = HI) && (dig4_8 = LO)){
digit4 = 6
}
if ((dig4_1 = HI) && (dig4_2 = HI) && (dig4_4 = HI) && (dig4_8 = LO)){
digit4 = 7
}
if ((dig4_1 = LO) && (dig4_2 = LO) && (dig4_4 = LO) && (dig4_8 = HI)){
digit4 = 8
}
if ((dig4_1 = HI) && (dig4_2 = LO) && (dig4_4 = LO) && (dig4_8 = HI)){
digit4 = 9
}
if ((dig4_1 = LO) && (dig4_2 = LO) && (dig4_4 = LO) && (dig4_8 = LO)){
digit4 = 0
}

}

if (text = HI){

if ((dig1_1 = HI) && (dig1_2 = LO) && (dig1_4 = LO) && (dig1_8 = LO)){
digit1 = F
digit2 = U
digit3 = L
digit4 = L
}
if ((dig1_1 = LO) && (dig1_2 = HI) && (dig1_4 = LO) && (dig1_8 = LO)){
digit1 = P
digit2 = r
digit3 = o
digit4 = T
}
if ((dig1_1 = HI) && (dig1_2 = HI) && (dig1_4 = LO) && (dig1_8 = LO)){
digit1 = U
digit2 = S
digit3 = A
digit4 = x
}
if ((dig1_1 = LO) && (dig1_2 = LO) && (dig1_4 = HI) && (dig1_8 = LO)){
digit1 = F
digit2 = A
digit3 = S
digit4 = T
}
if ((dig1_1 = HI) && (dig1_2 = LO) && (dig1_4 = HI) && (dig1_8 = LO)){
digit1 = P
digit2 = T
digit3 = N
digit4 = T
}
if ((dig1_1 = LO) && (dig1_2 = HI) && (dig1_4 = HI) && (dig1_8 = LO)){
digit1 = F
digit2 = T
digit3 = N
digit4 = T
}
if ((dig1_1 = HI) && (dig1_2 = HI) && (dig1_4 = HI) && (dig1_8 = LO)){
digit1 = N
digit2 = T
digit3 = x
digit4 = x
}
if ((dig1_1 = LO) && (dig1_2 = LO) && (dig1_4 = LO) && (dig1_8 = HI)){
digit1 = B
digit2 = Y
digit3 = E
digit4 = x
}
if ((dig1_1 = HI) && (dig1_2 = LO) && (dig1_4 = LO) && (dig1_8 = HI)){
digit1 = C
digit2 = Y
digit3 = A
digit4 = x
}
if ((dig1_1 = LO) && (dig1_2 = LO) && (dig1_4 = LO) && (dig1_8 = LO)){
digit1 = x
digit2 = x
digit3 = x
digit4 = x
}

}

getDig1{

switch(digit1){

case 1
one

case 2 
two

case 3
three

case4
four

case 5
five

case 6
six

case 7
seven

case 8
eight

case 9 
nine

case 0
zero

case A
ay

case B
bee

case C
see

case E
ee

case F
eff

case L
ell

case N
enn

case O
oh

case P
pee

case R
arr

case S
ess

case T
tee

case U
you

case x
ex

case Y
why

}

}

getDig2{

switch(digit2){

case 1
one

case 2 
two

case 3
three

case4
four

case 5
five

case 6
six

case 7
seven

case 8
eight

case 9 
nine

case 0
zero

case A
ay

case B
bee

case C
see

case E
ee

case F
eff

case L
ell

case N
enn

case O
oh

case P
pee

case R
arr

case S
ess

case T
tee

case U
you

case x
ex

case Y
why

}

}

getDig3{

switch(digit3){

case 1
one

case 2 
two

case 3
three

case4
four

case 5
five

case 6
six

case 7
seven

case 8
eight

case 9 
nine

case 0
zero

case A
ay

case B
bee

case C
see

case E
ee

case F
eff

case L
ell

case N
enn

case O
oh

case P
pee

case R
arr

case S
ess

case T
tee

case U
you

case x
ex

case Y
why

}

}

getDig4{

switch(digit4){

case 1
one

case 2 
two

case 3
three

case4
four

case 5
five

case 6
six

case 7
seven

case 8
eight

case 9 
nine

case 0
zero

case A
ay

case B
bee

case C
see

case E
ee

case F
eff

case L
ell

case N
enn

case O
oh

case P
pee

case R
arr

case S
ess

case T
tee

case U
you

case x
ex

case Y
why

}

}

dig1 = HI
dig2 = LO
dig3 = LO
dig4 = LO
getDig1
delay(200)

dig1 = LO
dig2 = HI
dig3 = LO
dig4 = LO
getDig2
delay(200)

dig1 = LO
dig2 = LO
dig3 = HI
dig4 = LO
getDig3
delay(200)

dig1 = LO
dig2 = LO
dig3 = LO
dig4 = HI
getDig4
delay(200)

magnethead794:
The multiplexing I found used 8 channel sourcers with 4 channel sinkers. You're saying if I use a 4 channel source and 8 channel sink, I can multiplex the same? Assuming that I use PNP source transistors that can withstand the 120mA of each digit+decimal? (I won't need the colon)

You may need to swap the high/low logic levels, but basically you can multiplex the same.

Since you're running the LEDs from +12v, to switch them with PNP transistors you'll also need some NPN transistors to level-shift the base drive to the PNP transistors. Alternatively, you can get source driver ICs such as the UDN2981A which do the level shifting and switching for you and give you 8 drivers in a single package. They drop about 1.6v at 125mA, so when you add on about 1v drop for the ULN2803A cathode drivers, you need about 14.6v total. So go for a 15v regulated supply if using this solution.

Yes, one ULN2803 and then 4x NPN driving PNP as dc42 said.
What's with the switche all of a sudden? Your original post said you wanted to control from an Arduino.
And you posted driving all 28 segments from a mega.

You''re really bouncing around here.

I'm surprised it took this long, but that's really why I recommended the 15V supply (there's always more to come. :smiley: )

CrossRoads:
Yes, one ULN2803 and then 4x NPN driving PNP as dc42 said.
What's with the switche all of a sudden? Your original post said you wanted to control from an Arduino.
And you posted driving all 28 segments from a mega.

You''re really bouncing around here.

Trying to find the best/easiest/most economical way to do this without making a rats nest of wire. Sounds like I'm better off not multiplexing at all and just using quad darlington arrays.

That makes the coding easier, no multiplexing needed, just put out the data you want displayed.
Just make sure your 12/15V source is up to it.
7 segments * 0.15mA* 4 = 0.42A, not all that much after all.

examples
http://www.dipmicro.com/store/DCA-1210
http://www.mpja.com/12VDC-2A-Regulated-Plug-Supply-Jasper/productinfo/18776+PS/
http://www.mpja.com/15VDC-16A-Regulated-Plug-Supply-GME/productinfo/18724+PS/

I think I can make my own "shield" for this....

4 wire input from the 4 coded switches (one per digit) plus 4 auxiliary switches- 1 of which would be the text-enable switch.

Route the 4 grounds all to main ground and it'll be set.

And ignore that one plugs into D21. I can make that not happen via shield.

So I have a plan of attack.

break this at the indentation, and use the big side. Mega pins straddle 2 of the disconnected columns, DIP-18 sockets right next (using the solder pad to connect), dip-18 covers 2 columns of holes, then allows wire connection on last row.

Have switch leads come into an 18 position barrier strip as the 24 gauge alarm wire (or Cat-5 wire), then come out as 20 gauge hookup wire, which locks into the arduino sockets firmly.

My version of the Mega has a 0.35 x 0.30 solder pad heatsink on the regulator. Running off 12 volts, it should be fine, right? I read that the uno's get warm on 12V.

Also on 12 volts, with ~1.2V drop across the darlingtons, the LED's should get ~10.8 volts.

The resistors in this picture appear to be red red black or red red brown- 22 or 220 ohm.

R = V/I = (12-9.5)/0.015 = 2.5/.015 = 167 ohm resistor so I'm going to guess they're 220 ohm resistors?

I = V/R = (10.8-9.5)/220 = 1.3/220 = 6mA

If I don't regulate down to 12V,

I = V/R = (16-9.5)/220 = 6.5/220 = 29mA

Can't tell for the decimal points. but (12-1.9)/.015 = 673 ohm = blue violet red or blue gray red

Either way, I somehow need to get 12V or something close to 12V going to the panels for peak brightness :confused: Doesn't seem to be such thing as a 13 volt regulator in a TO package (and the mega's regulator would get questionable). I guess worse case, I can unsolder the provided resistors and put (10.8-9.5)/0.015 = 90 ohm resistors in place.

Something like this.

Total cost:

Display: $32.95 + shipping (for the ultra-bright mxa-006)
Mega 2560: 46.55 ea
4x ULN2803A: $0.93 ea
shield pc board: $4.10
4x BCD switches: $5.67 ea
Shield pins: $0.93
control board: $3.99
control enclosure: $6.20
processor enclosure: $4.84

Total: $125.95

Got the shield made. The headers I bought were dual row, so I didn't do the 4 rows containing grounds (I'm going to have inverted pins on the ground pins). Gonna get some single row headers tomorrow. The ones I bought were marked single row, i thought...