Go Down

Topic: A shield with 70 outputs for LEDs, etc (Read 3974 times) previous topic - next topic

vxir

Feb 28, 2009, 05:31 am Last Edit: Feb 28, 2009, 03:59 pm by vxir Reason: 1
Well, I felt that the Arduino has a few too few outputs, so I started looking into the M5451 35 output constant current chip as an output expander.  The cool thing about this as opposed to the LED matrix drivers is that it is not strobed, so in theory you should be able to drive anything off it, not just LEDs.

Here's my blog about breadboarding it: http://effluviaofascatteredmind.blogspot.com/2009/02/arduino-and-m5451-control-35-leds.html

And it turned out that I could cram TWO of them onto an Arduino shield.  So I stuck'em on with IDE cable connectors extending out the sides so that you can stack something else on top and still get at the cables.

Then I added the option to have independent power so you could drive the outputs with higher or lower voltage than the base Arduino and also added the option to use a PWM bin to control the brightness.

So basically, with 3 pins (clock, and 2 data) you can turn on/off 70 outputs, and use a fourth (PWM) to control the current.

One issue I had was to figure out how to let the person choose which arduino pins to use.  I settled on making some SMT pads, and the idea was to put a solder blob across the pads to connect a pin.  But the SMT pads are so small, its actually pretty difficult to make the connection.  Does anyone have any ideas about how to do this better?

Unfortunately, I can't figure out how to put pictures in the forum, so you'll have follow this link to my blog:

http://effluviaofascatteredmind.blogspot.com/2009/02/my-first-arduino-shield-arrived.html

Doing "img URL /img" (with brackets around the "img" word) on some of the pics in the blog isn't working for me...

darudude

This is exactly what I needed a couple weeks ago! I was pulling hair trying to work multiple MAX7219s with no success. i wish I had known of this solutino earlier cause ti would be my first choice.

Unfortuantelt I already bought 100 RGB common CATHODE LEDs, which don't work with your solution  :'(

If I can't get the Max7219s working soon, I might have to bite the bullet and pick up some common anode leds to work wth your solution

Thomas S

So you basically have a chip with 35 constant-current outputs, and you can "dim" all the outputs at once with a PWM pin from the Arduino?

Also, you created some code that creates a PWM-like signal on an output port, so you can even dim all the outputs independently?

That's seems like a very good idea!


Also, on your blog you wrote that you don't need to worry about inline resistors for a series of LEDs (because of the constant current output), and I read that you added external power. Does this mean that you can use say 12V, and power a series string of 6 red LEDs (1,9V*6) on one output and a series string of 3 blue LEDs (3,3V*3) on another? If I want 20mA and up to 12V from each pin, that'd mean about 8W going through the chip!

Excuse my ignorance; my knowledge of electronics is very limited (but I'm eager to learn)! :-[

vxir

Darudude -- actually I accidently bought some common cathode RGB LEDs too.  So I used a PNP transistor -- this one: http://en.wikipedia.org/wiki/2N2907 -- to drive common cathode RGB leds.  If you look at the breadboard in the first picture in my blog here http://effluviaofascatteredmind.blogspot.com/2009/02/arduino-and-m5451-control-35-leds.html then just to the right of the M5451 you'll see 2 transistors (I didn't bother to drive the red), a resistor and the common cathode RGB LED.

But of course, it requires an extra transistor per color.  So I finally just decided to buy some common anode ones... they are about $35 for 100 on ebay.  

Thomas S -- I'm no great stuff at hardware myself frankly -- check my blog in a few days for a posting about hacking hardware for non-electrical engineers... I think it will help you alot.

Yes, all outputs are dimmable at once using a PWM pin.  Yes, I wrote PWM-like code so the outputs are independently dimmable -- since the Arduino is driving the voltage up and down explicitly a person can perceive blinking at the dimmest setting (on only 1/256 of the time).  However, the rest of the time it looks quite good!

Yes, you can power a bunch of LEDs in series, which is why I added a separate power input.  Thomas, 8W (.020*12*35) is the TOTAL power dissipation in your example.  But most of that is being dissipated in the LEDS.  The chip itself is only dissipating what the LEDs do not.  Since the LEDs are consuming (1.9v*6) and 3.3*3 volts, the voltage across the chip would be 12-(1.9*6) and 12-(3.3*3).  Multiply these by 20mA and say 16 chains of red and 19 blue you get the power dissipation of .99 watts.  BTW, the M5451 can dissipate 1 watt (without a heatsink), so we just made it!  Of course, you could always put a resistor on each blue chain to dissipate a bit more power since the blue chain is 2.1v under the 12v source.  For this chip, the rule of thumb is if all 35 outputs are on 100% of the time at 15mA, dissipate <1volt per pin.

But in summary serial LEDs work great!  

As an aside, just fooling around on the breadboard with 12V input (what I have) and only 1 LED its doesn't work so well since the voltage across the chip is ~10V -- I've gotten in the habit of resting my fingers on the M5451 as I run my tests, you can REALLY feel it get hot when there's a problem :-).


If either of you do decide to fool around with this keep me informed -- I'll give you schematics etc (needs cleanup before publicly posted).  Or you can buy a board from me at cost -- I had 10 prototypes made which is more than I need.  That will cost about $10 (without chips) because it was low volume -- and I don't know, probably a bit over twice that with everything soldered on.

I plan to post a simple, no frills youtube video tomorrow or the next day showing the LEDs blinking, LEDs in series, and it controlling a stepper motor, so check back in this thread.

darudude

#4
Mar 03, 2009, 05:43 am Last Edit: Mar 03, 2009, 05:43 am by darudude Reason: 1
haha a transistor was my guess but for some stupid reason I was working with NPN and couldn't get it to work (was trying to emulate the behaviour with the Arduino).

slapped my head when you said PNP, replace the transistor and circuit and voila it works.

You are right however, common anode is prob the way to go, prob try to recoup the cost by selling the cathode ones on ebay

By the way, where are you situtated? and did you do the protos on BatchPCB?

jezuz

i must confess i was atheist before i read this post, but now i knw there is a god... and u must be jesus... thank u, u just saved my numerous projects from extinction....

vxir

I'm in the US, Northeast.  I did the protos using OurPCB.  www.ourpcb.com.  There is an instructable www.instructables.com on how to take a PCB in Eagle and generate files for them.  I got 10 boards for $50 setup + $1.40 per board (so $64), and then unfortunately $30 shipping.  But still ~$100 was a pretty good price.  Great customer support.  It was much better than all the other places, except maybe expressPCB which have that 3 for $51 deal if your board is their exact size.  But that is actually more per board.  Also ourpcb does soldermask and silkscreen.

I didn't use batchPCB because I didn't want to wait and I wanted to try a "real" fabricator, as a test for future orders.  I think that this board is pretty generally useful and so if people on the web buy up my prototypes then I'll get 100 made.

jezuz -- Wow, no one even replied to my post for 2 days and now I'm a savior!  What part of my Message(TM) appealed to your heathen ears and saved your projects?  Did you run out of output pins?

BTW, www.futureelectronics.com has a good supply of M5451s.  Search for MM5451YN.  Its ~$3.50 for the DIP-40 part.  Make sure you don't accidently buy the surface mount!  

I have no relationship with either ourpcb or futureelectronics except as a customer.

liudr

I like it. I use 595 shift registers to drive LED's. The way you're demonstrating has a certain advantage - 1 chip with ~34 outputs and no need for resistors. Thanks for sharing! :o

vxir

Here is a video of the Arduino driving a lot of LEDs through the board and a stepper motor through a L298N driver chip.  Please forgive my terrible video production!  I recorded this very quickly and in one take.

http://www.youtube.com/watch?v=E0D8hDt2M60


jezuz

hehe, i am working on a robotic arm controlled by a glove with a accelerometer + lillypad setup, and my project involves controlling a bunch of (like 6 or so) high torque 24 v motors, along with a few led's, segmented displays, etc... the point is il be needing lots of outputs, and from what i understand, thats exactly what u created... unless i misunderstood?

vxir

Yes that's basically what I have made.  My first project with this board is going to be a lot of glowing blinking LEDs inset into a hardwood sculpture and my second is going to be a robotic snake-arm.  Both need lots of outputs...  So it looks like you're sort of doing both of my projects at the same time.

Just like I showed in the video, this shield can be used as the motor controller.  Like in the video, your motors will need to be "driven" by another chip; one that can take a lot more current.  It is very common to have a 2 chip solution to run motors; for example the L297/L298 pair.  This shield takes the place of the L297, except that it can act as a LOT of them.

If you (or anyone reading this) wants a shield (I had 10 prototypes made -- they are not perfect but as you can see, they work!), the eagle files, code, etc. send me a private message.  Its all going to be open source/open hardware, but the files (eagle schematic especially) are NOT pretty right now.   If there's enough interest I'll clean them up and set up a site.

What are the motors you are using & where did you get them?  I have a bunch of steppers I got out of old printers, but I am looking for a good deal on some small high-torque servo motors.


jezuz

thx, il look further into it...

the motors are from an old RHINO robotic arm system, and there are actually two kinds, currently i am trying to figure out how to use the smaller ones, so i havent looked at the stats for the larger ones yet...

atm, here is wat i knw about the smaller ones:

PITTMAN

GM8712E188

24 VDC

96:1 ratio (it has a gearbox attached)

5-12-86


i dont knw how useful that is, but thats all i knw...

vxir

I've been getting about 1 query every week or so about the Arduino and M5451 chip, so I put all the hardware design files and software libraries (I made an Arduino library to drive 2 M5451 chip simultaneously) up on google code.  And there's also some info in the wiki about how to hook up the M5451 (wiki page is under construction).

http://code.google.com/p/arduino-m5451-current-driver/


vic

Very interesting. Looks like you're about to get another query  ;)
Thanks for the post.

vxir

Here are some photos of a triple stack that I'm building up.  2 CCShield boards and 1 Duemolovo:


 


This one shows it powered up & controlling a bunch of LEDs


 


Go Up