I come from micro airplane RC background, I have assembled PIC-based Infrared receivers capable of driving a motor through FET and actuator coils directly from the PIC chip (the coils have resistance 100 -180 Ohm, they turn a small magnet enough to deflect a rudder).
Here is one of my smallest airplanes and the very light receiver I built for the plane : RC Micro Spitfire airplane build log please be aware that I did not write the program for the PIC chip, this is Koichi Tanaka's HEX files that I used (toko's Home Page ).
I want to do the same with Arduino now.
My question is what's the best way to do it if I want to drive the electromagnetic coil in two directions directly from Arduino?
Any code samples out there?
I have done some search but apparently nobody drives the 30-40mah coils with Arduino...
msurguy:
I have done some search but apparently nobody drives the 30-40mah coils with Arduino...
30-40 mA is too much current to draw from the Arduino directly, so you'd need to amplify the Arduino output somehow. If you need a reversible drive then I suppose you will need to find a suitable H-bridge driver, or make your own from discrete components.
I suppose in theory you might be able to get away with pairing up the Arduino outputs (each one is safe for around 20mA) but that seems like a very dodgy approach which would make it easy to accidentally overload one of the outputs.
Your 30-40mA load is just within the 40mA absolute maximum current rating of an Arduino pin. It would be better to restrict the load to 30mA if you can, for which the coil resistance needs to be at least 125 ohms (allowing for pin resistance of around 20 ohms). To drive a coil directly, connect it between two Arduino output pins. Also connect a Schottky diode between each pin and ground (anode to ground), and another between each pin and +5V (cathode to +5V).
Thank you, I will try it both ways, first without any protection (because the current will not be more than 35 mah) and if that doesn't work out too well I'll probably use a motor driver like DRV8830 data sheet, product information and support | TI.com or similar, the thing is that I cannot have too many components on my board, so need to remove all the extra parts just to make it work.
Ps, what is the purpose of connecting the Shottky diodes?