Hi there. I want to build a running LED circuit, but I want to replace the LED's with electromagnets (about 4 of them). I will use an Arduino Uno for this project, but I'm not sure how to proceed as the circuit would require protection from feedback etc. The only video's I can find uses 1 solenoid in combination with a mossfet. Any help would be much appreciated. I'm just an electronics enthusiast, so the simpler the better.
You would need a power FET to control each electromagnet, rated for somewhat more current than you expect the magnets to take.
The FETs should be "logic level" types if you want to control them directly from the Arduino; otherwise you will need an extra drive circuit for each gate to boost the gate voltage to around 10 - 12V.
You also need a "flywheel diode" across each electromagnet coil.
This shows the outline circuit you would need for each electromagnet - it would connect in place of the relay coil:
That's good - as long as its only on-off control and you use a suitable logic level FET, as mentioned above.
It would probably be a good idea to add a low value resistor between the 10K connection and the FET gate, just to reduce the current surge when the MCU output switches on or off; eg. 470 or 330 Ohms.
Mine runs at 124KHz, so no whistling - and even I can hear 490Hz - however, back at school long ago, in Biology we got a frequency generator and a speaker (from the Physics lab). The teacher set it up, set too high to hear, and gradually would it down - and told us to put our hands up when you could hear it - needless to say, it was the girls who were the first to hear it.
Eventually he said, right now put your hand up if you CAN'T hear it - and I was the only one - winding it down further, I couldn't hear until it got to 13KHz.
You can of course easily alter the PWM on the Arduino, but it completely messes up the Delay() function, so you have to alter all the values.
Hi. I'm not using solenoids per say, only electromagnets. So there's no moving parts. When I say fast, I mean the following loop relating to the electromagnets (EM1 to EM4); EM1 On 100 milliseconds, Off -> EM2 on 100 milliseconds, Off -> EM3 ON 100 milliseconds, Off -> EM4 On 100 milliseconds, Off. The timing of 100 milliseconds is an example and will depend on the timing entered into the Arduino code.
Hi. I'm not using solenoids per say, only electromagnets. So there's no moving parts. When I say fast, I mean the following loop relating to the electromagnets (EM1 to EM4); EM1 On 100 milliseconds, Off -> EM2 on 100 milliseconds, Off -> EM3 ON 100 milliseconds, Off -> EM4 On 100 milliseconds, Off. The timing of 100 milliseconds is an example and will depend on the timing entered into the Arduino code.
As Pommie said, 100mS is VERY slow, so not an issue - 'fast' would be low uS or nS.
People seem to forget (or never understood?) that mechanical items are generally extremely slow, and processors extremely fast - the majority of microcontroller projects probably spend all their time waiting for some thing to happen.
An example I like to use is a motor turning at 10,000 RPM (very fast) is actually turning once every 6mS in which time a 1MHz (slow) processor can execute 6,000 instructions. Remember, your PC is probably running faster than 2GHz (2,000MHz) so could execute 12 million instructions in that time.
That's only a VERY old slow processor, my current PIC of choice runs at up to 64MHz - but as with most (all?) PIC's you have a bewildering array of clock options - basically you can sacrifice speed for low power consumption, and with modern devices you can change speed at will in the program. So for example your device could be in standby, with the processor only running at 32KHz (a common ultra low power clock for PIC's), and once it starts doing something it can be switched back to full speed.
Personally I've never had occasion to do that, I simply put the PIC to sleep, and allow it to be woken via interrupts.