BAsic Q's I guess

Hi, I'm trying to get three electromagnets controlled through an arduino board. They need 1,5 ampere a piece and need to be on 24V.

I have TIP 127 to get the electormagnets switching on and off.

Can someone point me in the direction how to hook these things up?

I know where to hook on the electromagnet but not how to get it on the arduino board.

Is 24V safe to use on the Arduino Board?

Best Regards,

Pieter

hi

the 24V doesn't go anywhere near the Arduino pins...

TIP 127 is PNP, which won't be good for this particular configuyration... get some NPN TIP102's instead.

Your basic circuit will be

Arduino digital pin> 1K resistor > TIP102 base

Power supply Gnd> Arduino Gnd> TIP102 emitter

+24 > electromagnet> TIP102 collector

note that you will also need a diode like an 1N4004 connnected across the electromagnet, to quench the back EMF.

Have a look at this diagram, which is pretty close (instead of led's you would have your electromagent)

You will also need to consider power dissipation (heat). Depending of how long your electromagnets stay on and at what rate they switch on and off. At 1.5A and 24v constant, that’s 36 watts of power to dissipate through the little heat sink in the back of the NPN Darlington (TIP102, TIP122) pair. You’ll want to either use a decent heatsink, use a fan, use a combination (specially if you have a few of them) or look into MOSFETs which have a much lower resistance (almost none for what I read, although I am no expert, at all).

HI I added a diagrams for driving Relays and Solenoids to the wiki, scorll down to "solenoids" on this page.

D

Hey Daniel,

I tried to take a look, but there was a link problem: on the wiki page you had Attach:solenoids.pdf, but the file you uploaded was called solenoid_driver.pdf. I went ahead and fixed the link in the Attach directive.

Very nice diagram, by the way!

You will also need to consider power dissipation (heat). Depending of how long your electromagnets stay on and at what rate they switch on and off. At 1.5A and 24v constant, that's 36 watts of power to dissipate through the little heat sink in the back of the NPN Darlington (TIP102, TIP122) pair.

very true, you could end up with a nice and hot transistor! Mostfets area good solution but I am not sure of a good and reliable part number... ususally something in the IRFZ20 line works, but they are a bit static sensitive. Anyone have a better MOSFET?

PS: the dissipation of a TIP102 switching an electromagnet is actually 1.5A X Vce(sat). Vce is the voltage dropped across the transistor junction at saturation. That would be about 1.5A X 2V = 3W or a little more, still mighty hot, as you have pointed out!

Hey Daniel, I went ahead and fixed the link in the Attach directive.

Thanks, you are the man! Or the cat, as it were.

the dissipation of a TIP102 switching an electromagnet is actually 1.5A X Vce(sat). Vce is the voltage dropped across the transistor junction at saturation. That would be about 1.5A X 2V = 3W or a little more, still mighty hot, as you have pointed out!

Thanks for correcting me :)

HI I added a diagrams for driving Relays and Solenoids to the wiki, scorll down to "solenoids" on this page.

Nice the playground is getting bigger and bigger, that's very cool :) I might add a few things soon if I stop being so lazy and spend some time in Eagle :P

I tried to take a look, but there was a link problem.

Works here...

hi

TIP 127 is PNP, which won't be good for this particular configuyration... get some NPN TIP102's instead.

Hi there,

Thx for the help and I'll figure it out now (have the board up and running also) Just one or two questions, out of curiousity why wouldn't PNP's not work and NPN would?

The electromagnets will be switched on and off very fast they are going to be used as drumming hammers on very very large drums and need to hit the drum as fast as possible (20ms on 10ms off x120s of time) or something like that. Would this make a difference regarding heatsink problems?

I'll add a fan to the circuitboard to cool them down anyway

grtz

pieter

To test things for durability, program the Arduino to turn the electromagnet on and off every second for an hour. Check in frequently to see if it has blown up, melted down or gone up in smoke. ;)

Re the PNP transistor, to turn the transistor on you need to bias the base-emitter junction.

In the 5V bias, NPN transistor version that's in the diagram, this is no problem: Arudino pin goes high, current flows through resistor into the B-E junction and back to Arduino ground.

To do the same thing with a PNP transistor, as in this diagram, we have to send the 24V supply current through the B-E junction, and into the Arduino pin. Goodbye pin.

You could add another small NPN trnasistor to get around this, something like in this diagram, but it is probably better and definitley more reliable to just get single NPN Darlingtons like the TIP102 or TIP122.

Great,

Ill go on and test it, if you say goen up in smoke you mean the transistors, not the arduino board?

I’m now trying to get things from max/msp into arduino board instead of reading the arduinoboard in max, hope I figure this out or it’s back to the forums.

best,

pieter

oh i just meant that there are two rough ways to design: - calculate thermal values and required heat sink sizes, find appropriate size heat sink, or - gues on heat sink size, watch and see what happens. I like this one. :) But sometimes it goes up in smoke if you guess too low!

Also, since electromagnets are essentially large inductors, they throw a lot of 'back EMF'-- essentially the force of the magnetic field collapsing when it turns off. This can create some really strange problems in the transistors and diodes switching the solenoid or electromagnet.. bizarre heating probelms etc. That is why it's a good idea to run it for a while and see if these probelms exist.

just one more question, the ground connected to the arduinoboard is that the GND of the 24V dc? I guess it is since all of them share the same ground but better to ask before I do something wrong.

the arduinoboard itself keeps powered from theUSB port right?

best regards

pieter

sure, you can power the Arudino from the USB port if you like.

Yes the Arduino Ground is shared with the Electromagnet ground... Bot the Arduino and the electromagnets are sharing the transistor's emitter, which ends up being a common ground.

D

THX for al the help.

I made the circuit (for one magnet will need to expand it to 5 or 6 magnets as soon as I get one working)

The problem now is that the electromagnet does move, but it's nowhere near the tempo I need, The first time it expands it's fast I send another pulse every 2s, the first 4 work, the 5th doesn't, it also goes slower after some time.

I need to use them to excite drums and need to have very fast rumbles (to mimic thunder on a really big drumlike thing) and want to get as fast as 100ms

I know it's possible but it seems like the solenoid keeps some of the energy

best

pieter

Could you post a pic of the circuit, and especially these 'electromagnets'? You know what they say about pictures. :)

I'll try to take a picture of the electromagnets or better solenoids later, the circuit is totally according to the circuit. The solenoids are 24V dc drawing 0.5 Ampere

hope to get it worked out soon, I'm getting nerveous.

On another topic, same arduino board though, what is the best way to read in wether there is current flowing through a led or not. I have build a heartsensor with a LED ( a green one) that blinks everytime my heart beats, how can I read this into the computer?

Best

Pieter

ok,

I think I figured it out (no tested yet) I'm adding a VARRISTOR S14K30 to the circuit (in series just behind the + of the diode)

This will probably heat up quite a lot, so I have a next question.

Since I can't use a bigger varristor (due to the transistor) can I make the same thing with a FET instead of the TIP? then I can use a bigger varristor.

I'll try with this setup, since I have some serious fans blowing cool winter air on the transistors anyway the varristor will heat up not that hard I hope

Any ideas on this guys.

Sorry for not ul'ing the pictures, my electromagnet is photoshy at the moment

Pieter

don't mean to jack your thread, but this would work on a 12V relay as well correct? (I'm having the arduino control something running off a car battery) tip102: http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail?Ref=474994&Row=819434&Site=US 12V relay: http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail?Ref=476593&Row=476982&Site=US

ok, I'm adding a VARRISTOR S14K30 to the circuit (in series just behind the + of the diode) ...Since I can't use a bigger varristor (due to the transistor) can I make the same thing with a FET instead of the TIP? then I can use a bigger varristor. Pieter

Hi Peter,

can you post at least a diagram of what you have wired up including the 'varistor'? What you are saying about varistors does not make sense electrically, so post a diagram so that we can have a look at what's going on.

Talking about complex citcuits in text is a bit like dancing about aarchitecture.... a schematic is much clearer.

D

PS yes relays would work but at a rate of a few times per second, they would burn out pretty quickly from the arcing on the contacts when the electromagnet's field colllapses.