I've been trying to figure this out for quite some time but I am hopeless when it comes to these sort of things so I hope somebody here will be able to help me.
I would like to be able to control intensity of electromagnet with sound signal (no signal - no magnetism, loud signal - strong field) a basically achieve something like this Ferrofluid moving to the sound on Vimeo .
It seems like one option is to get super strong sound system and work with AC current but mostly people would tell me thats not the right thing.
Second option would be changing the signal into DC, amplifi it and then feed it to the magnet but I have no idea how to do such a thing when it comes to working with the audio signal.
And last option seems to be controlling it all digitally with Arduino but honestly I have no idea where to start with this project.
So if I was coherent enough could someone please help me figure this out - is Arduino a good solution?
I think the person who made the video simply used a coil removed from a high power loudspeaker, with an audio oscillator and audio amplifier to drive it.
No specialized knowledge of electronics necessary.
Hi, thank you for the response. I know that he did it this way but I heard that it overheats very quickly and cannot be used for more then few minutes. Thats why I would like to go with a DC current (12V electromagnet maybe) and try trhough Arduino.
From what I have gathered, the main problem woudl be the voltage but I saw an old computer power source being used and it worked great but I have no idea where to bring the source in, what to use and so on.
I know, I have no idea what Im doing but any pointers would be great
No , you can't make it with DC. Wind a coil, it's visible in a movie, author used about 2 mm copper enamel wire. Than you need power source, I'd estimate in 5A, could be 10A, old PC power supply is good choice.
Arduino would work as generator, I don't think you need a sinewave, rectangular 'd be sufficient. Last thing is amplifier, audio high power 100 Watts or so, or better motor driver H-bridge, you can find 30A for decent price. https://www.sparkfun.com/search/results?term=motor+driver https://www.sparkfun.com/search/results?term=motor+driver
Hi, thank you but generator of what? The sound? Also, as I stated above I was told that system like in the video would overheat quite soon. Is that through?
If you just want to control an electromagnet, then in addition you will need a magnet power supply, a suitable logic level MOSFET transistor and a flyback diode.
Well, I want to control the intensity with sound as I said before. I thought maybe I could use digital sound signal and somehow use some information from the signal to control the intensity.
Let's take it in two parts - If you simply want to vary the magnetic strength, you can do that with PWM just like dimming an LED. Take a look at the [u]Fade Example[/u].
With an electromagnet, you will need a DC power supply and a transistor or MOSFET driver. [u]Here[/u] is a schematic for driving a solenoid coil and the exact same circuit can be used to drive an electromagnetic (which is basically a solenoid with no moving parts). PWM will work fine with that circuit.
On the audio input side the Arduino can't accept the negative half of an AC audio waveform, so you need to [u]bias the input[/u] at 2.5V (two resistors and a capacitor). You can then subtract-out the bias in software (which should be a reading of ~512 from the ADC).
With that bias, the Arduino can accept a line-level or headphone-level audio signal.
Use the serial monitor to "look at" your ADC values before deciding how to apply a factor to get your PWM output. Note that PWM is 8-bits (0-255) and the ADC is 10-bits (0-1023). But, you may not get the full 0-1023 range, depending on your audio signal.
Generally, you read the input in a short loop that runs for about 1/10th or 1/20th of a second. Take the peak value and use that to set the PWM output, then repeat.
An alternative to biasing the input is a [u]Peak Detector Circuit[/u], which is what I use for my sound activated lighting effects. That makes the software a little "easier" because you can read the "volume" about 10 times per second instead of reading the actual audio waveform thousands of times per second. But, I'd recommend starting with the simpler hardware.
A "trick" I use with my sound activated lighting effects is to keep a 20-second moving average ([u]Smoothing Example[/u]). By using the average as a reference in software, the effect automatically adjusts to volume control changes or loud or quiet songs.