Controlling electromagnet with sound

Hello guys,

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?

Thank you so much for any answers.

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.

An Arduino could be used as the audio oscillator.

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 :slight_smile:

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?

Have you tried to contact the person who posted the video?
He/she could tell you more about the coil use and possible overheating.

Hi, I havent but it seems like he does not answer any questions. Anyway do you think that using the Arduino is a bad idea? I was thinking maybe I can built something similar to this (control 7 12v electromagnet from arduino. Switiching them ON/OFF one by one - YouTube) but the current would be controlled somehow.

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.

Google "Arduino relay circuit" for some examples.

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.

Magnetic levitation project might be inspiring?
e.g. - Magnetic levitation - Exhibition / Gallery - Arduino Forum -

google can provide some more

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.

DVDdoug
Would you please check the link to the solenoid driver.
Thanks,
Tom

Hi DVDdoug!

That was the perfect answer, thank you so much! I am not completely sure about the last part but I hope I will figure that out or ask if needed.

The last thing I would like to ask is what TKall is asking and if Arduino UNO is sufficient Arduino fot the project.

Thank you again.

EDIT: I found some instructions on the solenoid and it mostly says that it takes a lot of power and overheats quickly. Would a electromagnet like this
(12V DC 22 LB 10kg Electric Lifting Magnet Electromagnet Solenoid Lift Holding | eBay) be able to run a whole day (few hours) without overheating?