controlling 24 6V electro magnets with a arduino Mega 2560 ...

Hello World,

we're building a computer controlled weaving loom.
Actually just upgrading one of those rare things: http://img1.classistatic.com/cps/bln/101221/253r6/5913d98_23.jpeg?set_id=2C4000 :slight_smile:

Everything is working out fine so far, as we already finished the mechanics and the software controlling the arduino board.

It's browser based using php to communicate with the board via the serial port.
if anyone is interested further - it's on github : GitHub - gherkins/weefsel: experiment trying to control a 24shaft loom from the browser.
The whole thing is about reading those so called .WIF files.

For me beeing a complete newbie to electronics the circuit thing is the tricky part.
I made a amateurs approach to drawing something like a circuit diagram
and would hereby kindly ask for your advice on it:

http://dl.dropbox.com/u/17442761/schaltplan.pdf

the things used so far are:
24 magnets ITS-LZ-1949-D-6VDC 6 V/DC with 7W
4 Power Adapters 6V DC with 2100 mA for 3 magnets each
6 Power Adapters 6V DC with 700 mA for 2 magnets each
3 ULN2803

Could it be done this way?
Or am i going to burn the whole thing? :astonished:

Thank you very much in advance!

cheers

Max

Are you going to use all those power supplies or is there just one?

You need a backwards diode across the magnets, this can be done by connecting pin 9 of the 2803s to the common + voltage driving the magnet. But only if you have one common supply otherwise you need a diode across each magnet to its supply.

Thanks for your reply!

I was going to use all of the power supplies.
Seemed like the cheapest way to get all of the magnets powered without the need for a huge supply.

So if i had one large power supply i would connect it like in this pictiure i found online?


While using the many single supplies, would i need a ULN2803 for each one of the magnets
or can i leave it like it is in the drawing in the first post and get the diodes seperately?

Thank you

cheers

Max

No leave it like it is and just add the diodes, it is just that you can't use the diodes inside the 2803 because all the anodes are common and so this requires the power to be common.

Just a point on the ULN2803, although the data sheet says it will switch half an amp you can't do this for all the drivers at the same time because the thing will over heat. See:-
http://www.thebox.myzen.co.uk/Tutorial/Power.html
For the background and
http://www.thebox.myzen.co.uk/Tutorial/Power_Examples.html
for the specifics of this chip.
The limit is about 650mA total current being switched at any one time.

max0:
we're building a computer controlled weaving loom.
Actually just upgrading one of those rare things: http://img1.classistatic.com/cps/bln/101221/253r6/5913d98_23.jpeg?set_id=2C4000 :slight_smile:

Max

I was looking at the ULN2803 for a different application. I don't think it would be good for your application because the datasheet says it can drive 500mA per output, but your diagram shows magnets which will take 700mA.

It may work but I think you need to look hard at the datasheet and find out if the electromagnets consume that much, or less or more. Anyway it looks on the limit to me, and you may end up burning out the ULN2803.

Ok, thanks a lot to both of you.

Do have any suggestion what kind of "switches" would be more suitable for this application?
Would be great if there was some solution, which won't require too much of assembly.

My first thought was to get 24 switches of some kind, which can be flicked on/off with the arduino signal,
switching the circuit from the magnet to the power supply.

Somehow i ended up with the ULN2803...

As i've been looking for such switches, i just found some expensive relays.
I don't even know, if those are what i need.

Is there any budget solution out there i'm missing?

cheers

Max

If your magnets are 6 V/DC with 7W then the current you are trying to switch is 7 / 6 = 1.16 Amps is it not?
This means your power supply figures are off so you need to look at them again.

To switch this current you are better off using a logic level FET. There are lots of them about but the IRLB8748PbF is good and not too expensive. Just put a 100R resistor in the gate and connect it to your arduino output. Then source to ground and drain to magnet and then to the +ve supply.

A web search seemed to suggest those solenoids are 4W rather than 7W, but still thats more current than the ULN2803's are comfortable with - my suggestion is to use 2 adjacent channels in parallel for each solenoid and get twice as many ULN2803's... FETs would be more expensive since they don't seem to sell them in arrays like darlingtons...

However I have a question: How fast do you want the solenoids to turn off? If you use straight backwards diodes across the coils they will switch off relatively slowly. The solution is to add a zener diode back-to-back with the regular diode so that the magnetic field collapses faster due to the higher back voltage. I'm thinking a weaving machine probably needs to do things fast?

Mark are you sure that is right? A zenner diode is a diode so there is no need for a regulator diode but the explanation doesn't sound right anyway. The back EMF is caused by the collapsing field so you need to short it out not maintain it at a higher voltage. Therefore you want the backwards load to be as big as possible. The high back voltage does not cause the field collapsing it is the result of it. And the forward zenner does absolutely nothing.

Now i'm a bit confused.

The power supplies are too weak, but they seem to work just fine.
We tested this quite a while with those power-supplies and no obvious problems.
Could it be that the magnets, carrying no weight (they are just used as bolts) consume less power, than stated on the datasheet?
The magnets are just switched on for a short time, btw.

An, yes switching should be as fast as possible, but as it's not a fully automatic weaving machine,
everything within a 2 second range would be fine.

It's the 7W type btw. It's bit confusing as the series has different kinds, looking all the same.

If the ULN2803 isn't suitable for switching such a current, i could try to get those FETs.
But in the german consumer online shops i wasn't able to find them.
And my local electronics store guy, whom i paid a visit today, didn't find this thing in his lists either (he said it might be too new?)

I'm afraid i know a bit to less about electronics to solve this.
But i really don't know how to put a 100R resistor in a gate...

Beeing a bit stuck here, my next attempt would have been to get as many ULN2803s as i have power supplies
so that i would be able to at least connect the things.

Assuming that will be too much current, what could happen in the worst case?
I'm willing to risk losing some ULN2803s, but dont want to burn the arduino board.

thanks for your help :slight_smile:

Could it be that the magnets, carrying no weight (they are just used as bolts) consume less power, than stated on the datasheet?

No it doesn't work like that, it's the same current no matter what is attached to it.

The power supplies are too weak, but they seem to work just fine.

How do you know, have you measured the on load voltage with a meter?
The only way to be sure of the current is to measure it, meters are very cheap you should get one.

(he said it might be too new?)

No but there are lots and lots of FETs ask him for a logic level n-channel FET.

I'm afraid i know a bit to less about electronics to solve this.
But i really don't know how to put a 100R resistor in a gate.

PIN -- resistor -- Gate

Assuming that will be too much current, what could happen in the worst case?

The 2803 will overheat and be destroyed. Don't use them as it will not work. There is not much chance of damaging the arduino but there is no guarantee that you won't.

Would a SUD30N03-30 work out?

http://www.google.de/url?sa=t&source=web&cd=2&ved=0CCoQFjAB&url=http%3A%2F%2Fwww.datasheetcatalog.org%2Fdatasheet%2Fvishay%2F70268.pdf&rct=j&q=SUD30N03-30&ei=LhH_Tem5PIaYOvnzhd8I&usg=AFQjCNG6ZPCnT4H4hKDllPvGO1LozX6ktQ&cad=rja

... and do i still need extra diodes in that case oder just the 100R resistors?

thanks!

Yes that FET looks like it will work. Yes you do need a diode across every coil.