Maker Pro
Maker Pro

Electromagnet with strength controlled by photoresistor

purj

Feb 14, 2016
47
Joined
Feb 14, 2016
Messages
47
I want to build a project where an array of electromagnets are activated and deactivated in response to an array of photoresistors. It should work with shade (blocked light) on the photoresistor causing more magnetic strength. The idea is to place a magnetic medium, either iron shavings or ferrofluid, in a bath above the magnets, with the photoresistors being placed underneath, facing down toward a light. There would be a space to wave your hand between the lights and the photoresistors. So it would look like:

~~~~~~~~ (fluid/shavings medium)
======== (electromagnets)
^^^^^^^^^^ (photoresistors)
— — — — (space for hand or other objects)
\/\/\/\/\/\/\/\/ (lights)

My desired result is that the medium (fluid/shavings) would respond to the individual magnets and the surface could be manipulated.

This is the first step in the project. The end game is to place a Raspberry Pi or an Arduino between the photoresistors and the electromagnets. This way, I would have input being processed digitally, so it could be transformed; the other advantage would be that I could "print" patterns in real time in the medium with the Pi/Arduino, bypassing the need for input.

For now, though, I feel the first step is learning how to work with the magnets and the photoresistors, and wiring them directly seems like a good idea. In fact, I just want to start with one.

I have a photoresistor and magnet wire, as well as some variable resistors (guitar-style potentiometers), switches, wires and a bread board, but I need to know how to make an electromagnet and wire these together. I've looked at some tutorials about making electromagnets, but what I've come across seems somewhat scatterbrained. I'm hoping someone can point me to a book or a website where the process of making an electromagnet is laid out clearly. Specifically, I need to know how to maximize the power (pull, attraction etc.) and shape the magnetic field, and I need to know about heat management and safety. It sounds like making a nail (for example) magnetic by just wiring a battery to a bunch of wire wrapped around it has the potential to blow up the battery, and of course I don't want that. Would it be a possible solution in this case to wire a resistor in series with the coil?

I hope this is enough information to get a conversation started. I believe the steps for this process will be something like:

1. Design the electromagnet
a) budget for current (let's say 5V. I'll run it off my breadboard wired to a 5VDC wall wart)
b) balance size and strength (Let's say 1" or so tall, and 1" or so wide)
2. Design the surrounding circuit
3. Build it out.

Any help, resources or pointers you can offer would be most appreciated. Thank you.
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
This sounds like a fun project! Welcome to Electronics Point, @purj. I am sure there will be many posts to this thread, some to help you and some to give you ideas. I will start off with a few ideas...

There was a toy (Magna Doodle) I bought many years ago for my young children to express their creativity and perhaps wonder how it worked. It had a screen with hexagonal cells. When you brought a magnetic "pencil" up against the screen the magnet would attract dark magnetic particles, confined to the boundaries of the cells, to the surface of the screen where they would remain until "erased" by moving another magnet, located at the bottom of the screen, sideways. This toy replaced an Etch-A-Sketch that I had previously purchased for the same reason, but unlike that toy the Magna Doodle did not require drawing a continuous line, it was "random access" to any part of the screen with the magnetic pencil. It's main limitation was the large size of the cells producing a broad line compared to the fine point traced by the Etch-A-Sketch.

Now the Magna Doodle sounds a lot like the effect you are trying to produce with electromagnets and magnetic particles suspended in a viscous medium or perhaps using ferrofluid for whatever effect that would produce. Some problems I see you having are confinement of the magnetic particles or ferrofluid to specific locations: without physical isolation, the first electromagnet you energize will attract all the particles within its magnetic field, rapidly depleting the stock of particles the other electromagnets have to work with. That is why the Magna Doodle used hexagonal cells to isolate the magnetic particles.

Another problem is producing a relatively confined magnetic field from each electromagnet while presenting a reasonably sized display surface. You may be able to control this with soft-iron wires attached to an array of electromagnets. The wires would act as "magnetic pipes" similar to optical light pipes to confine the field and direct it to points under your display surface. Unfortunately, this would work best if there were a return flux path for each iron wire and that might be more complication than you are looking for.

I would separate the hand-sensing or object sensing mechanism from the magnetic display, unless you have a strong reason to place it underneath the display. That would allow you to scale the size of the input to the size of the display.

Winding electromagnets would be a real PITA. You might try procuring a lot of small E-I laminated transformers (or transformer cores if you insist on winding your own) and remove the I laminations leaving just the E laminations exposed to air. This will wreck whatever inductance your transformers started with (lowering it considerably) but since the magnetic path will be in air anyway, this is probably acceptable, relatively inexpensive, and a quick way to explore the magnetic field properties. You will need to pulse-width modulate (PWM) the current through the electromagnets to obtain a strong field without burning up the electromagnets.

So, let us know how your project is going... lots of pictures are appreciated!

Hop
 

purj

Feb 14, 2016
47
Joined
Feb 14, 2016
Messages
47
Thanks @hevans1994. I've been working for the past few days on getting my bearings (no pun intended) with building these electromagnets, and now I'm at a point where I need to ask for some help in figuring out what values I need to look for in a resistor to regulate my circuit. Here's where I'm at so far.

Update
The first part of this update is that I started following online tutorials to make electromagnets. All in all, I wound 5 or 6, playing with different shapes and number of windings etc. Here is a picture of the two most successful I made. These work well, but they exhibit some issues which I'll describe below:

160218-a electromagnets.jpg

Two hand-made electromagnets, each wound once down and then once back (two layers of windings). The core on the left one is a stainless (I think) trailer hitch bolt. It's perforated along its length for cotter pins, which makes stringing the loose wires through the end a rather convenient operation. The core on the right is an iron (I think) bar, cut to ~ 3" length with a hacksaw. The wire is 24 gauge copper mag wire. The seal on the left is electrical tape, and the one on the right uses clear tape and heat shrink (which was left unshrunk in the middle for visual appeal).

The second part of this update is that I spoke with some advisers and they convinced me that the best way to proceed is to start with the Arduino in play. This is because I'm going to have to compensate for the properties of the electromagnets and figure out how to integrate them with other electronics either way. So with this in mind, I've put together this rough sketch of what I'm looking at. Here is my diagram (I know it's not a proper schematic):

160218-b schematic.png

A quick diagram of the planned approach to the circuit. As noted in the diagram, the two electromagnets will need to expand to a bank of nine. Note that while two electromagnets are shown here, and two are also pictured above, this is a coincidence. The magnets have only been hooked up individually, and the diagram includes multiple magnets only in order to show my plan for wiring the eventual nine in parallel. The questions in the diagram are somewhat outdated; please see below for current questions.

Test Results
So far I have tested each electromagnet (individually only; I haven't hooked up more than one) with three power supplies:
  • A standard 9-volt battery.
    • Produces a relatively weak magnetic force, capable of picking up only one or two 0.75" washers.
    • Barely any effect on ferrofluid.
  • A bank of 6 AA cells (so, 9 volts in total).
    • Stronger magnetic force, capable of picking up a few 0.75" washers.
    • Barely any effect on ferrofluid.
  • A power supply.
    • Class 2
    • Model SY-13180
    • Input: 120V AC
    • Output: 13.5V DC : 1800mA (measured at 15.9V DC)
    • Produced a very nice magnetic force, capable of picking up many washers, and more importantly...
    • Made a fat and spiky bump in the ferrofluid.
    • However, made the magnets warm after just a few seconds, and also
    • Got rather warm itself.
Also, I took some measurements with my multi-meter while running on the power supply and have these specs:
  • Circuit runs at 16 volts
  • Circuit draws ~ 5 – 6 amps
    • Note that this exceeds the PSU spec of 1800 mA.
  • I also measured the current while on 9V battery and was around 0.3 A.
  • Resistance across the electromagnet wires (measured unhooked from the circuit) is ~ 1.4 ohms
That's where I'm at so far.


Questions
What I need to know is what to look at when designing this circuit. What other components do I have to introduce and what specs do I need to look for in them?
  1. Can I use these numbers to calculate what voltage and amperage I'll need in the power supply?
    • How will the strength of the magnets be affected by having multiple magnets attached?
  2. How do I control this circuit so it doesn't get out of control and dangerous?
  3. How is it possible that I'm drawing ~ 5 – 6 amps from a 1800 mA PSU?
  4. How does wattage come into this?
    • Is it simply a matter of saying: (5 amps) x (16 volts) = 80 watts?
    • Do I therefore have an 80-watt electromagnet?
      • Can I then say that to wire up 9 of these would give me a 720 watt device?
        • Can I then say that drawing 720 watts on 16 volts will try to draw 45 amps (and 'splode my power supply)?
        • This seems like a lot. How can I change this?
          • Is the introduction of a resistor between the magnets and the power supply (not shown in the diagram above) the answer?
            • How would I calculate the values for such a resistor?
  5. Can I use larger wire (I have 16 gauge also) to help with the heat?
    • Is the magnetic force solely dependent on the # of turns?
      • Will I have to wrap the same number of times (more layers) to get the same magnetic force?
I was also messing around with resistors to see what would happen.
  • I hooked up some 300-400 Ω ones and the magnetism went away or dropped off very sharply.
    • The amps dropped to ~ 0.04 or thereabouts.
  • Am I on the right track? I also hooked up a 16 Ω one and burned it up immediately.
    • This was when I stopped and came on here to ask for guidance.
    • I'll also be reading about electronics (as I have been) but reading about general theory and getting real advice on an actual scenario are different things ;)
Over
And out. Thanks!
 

purj

Feb 14, 2016
47
Joined
Feb 14, 2016
Messages
47
This sounds like a fun project! Welcome...

Hop,

Thanks for responding. Can you tell me more about the possibility of controlling the field with the soft iron wires? What would that technique be known as (so I can google)?
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
The strength of the field will be proportional to the current times the number of turns.
The power required will be inversly proportional to the amount of copper. You can use a lot of thin wire and a high voltage with little current or thick wire with low voltage and high current.

The resistance of various gauges of wire is available in tables. Remember that the area of the wire is proportional to the square of the diameter.

You should match the load on the power supply so that it is not asked to supply more than it is designed for.
 

purj

Feb 14, 2016
47
Joined
Feb 14, 2016
Messages
47
Perhaps adapting one of these will be a better choice. You get the proper matched parts for a reasonable price :

----> https://duckduckgo.com/?q=suspended+globe+magnetic+toy&t=canonical&iax=1&ia=images

Hey that's very nice, I might go that route. But just for reference, in general how does one calculate the values for the parts necessary in a circuit? For instance, say I have a power supply that delivers 16 V, and a device which has 1.4 Ohms of resistance. Is it proper to say that pairing this device with this power supply, it will always try to pull:
(16 V) / (1.4 Ohms) = 11.43 Amps?​

Does it work this way? Is the Amps draw for a given device solely dependent on its resistance (a physical constant?) and the voltage supplied?

If so, would it also be true that if this same 16 V power supply is rated for 1800 mA then the minimum resistance any circuit attached to it would need is:
(16 V) / (1.8 A) = 8.89 Ohms?​

If so, would lowering the current in a circuit connected to this power supply to 1800 mA mean that the maximum watts of any circuit it powers would be:
(16 V) x (1.8 A) = 28.8 Watts?​

To sum it up, is it true that to make a 16 V / 1800 mA PSU drive a device with 1.4 Ohms of resistance, one would need to add an [8.89 Ohms - 1.4 Ohms] = 7.49 Ohm (or greater?) / 28.8 Watt (or greater?) resistor in series with the device?
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
Any resistors attached to the device either in series or parallel will waste power but might protect the power supply.
Say you have a 10V 5A supply, then you can use 50W. To do this a resistance of 2Ω is used.
Chose a wire diameter and calculate the length for 2Ω.
Calculate the number of turns with the circumference of the former.

Note that 50W will get the solenoid hot and may not be sustainable for long. A bare single layer winding will cool better than a multilayer.

You seem to be a winding expert.
 

purj

Feb 14, 2016
47
Joined
Feb 14, 2016
Messages
47
Any resistors attached to the device either in series or parallel will waste power but might protect the power supply.
Say you have a 10V 5A supply, then you can use 50W. To do this a resistance of 2Ω is used.
Chose a wire diameter and calculate the length for 2Ω.
Calculate the number of turns with the circumference of the former.

Note that 50W will get the solenoid hot and may not be sustainable for long. A bare single layer winding will cool better than a multilayer.

You seem to be a winding expert.

Hey thanks for the compliment on my winding. Actually this is the first time I've made anything like this, but I was careful (it took about 30 mins to do each). I've built a few guitar pedals from kits before, and I've replaced knobs and pickups, but that's my only experience with electronics, which explains my basic questions :cool:

So it sounds like my equations above are correct. But let me ask you about calculating the wire resistance. I checked this site and it says that it takes about 55 ft of 24-gauge wire to get 1.4 Ohms. But my physical electromagnet (the one on the right in the above pic) gives me 1.4 Ohms on the reader (I just checked it again to make sure) and it doesn't use anywhere near 55 ft of wire. I estimate that I have like 25 ft of wire on it by saying:

0.375" diameter (0.03125 ft.)
Circumference is thus ~ 0.098 ft.
I estimate that I have ~ 252 windings (6 wraps per 1/8 inch, and 2.625" of windings, wrapped twice)
so that's ~ 25 ft.
According to the same site, that should give me 0.642 ohms.

Any ideas about why I'm getting 1.4 Ohms on the meter? Is it because the wire is wound around a metal core and some of the resistance is from the magnetism?
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
Some comments on terminology.
Winding - you only have one winding.
Wraps - use turns.
Gauge - use AWG there are other gauges such as SWG.
Layers- the number of times you have traversed the former.

You may be right about your instrument reading incorrectly due to the inductance present. I have a digital meter which has a fizzy fit when trying to measure the resistance of a transformer winding. I use an old analog meter which uses a continuous current.

@Alec_t
The bar is what the wire is wound on, not the wire itself:)
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
What do you get when you join your meter wires together? Say 0.3 Ohms each wire will give you 0.6 Ohms + your resistor value.
Adam
 

purj

Feb 14, 2016
47
Joined
Feb 14, 2016
Messages
47
Some comments on terminology.
Winding - you only have one winding.
Wraps - use turns.
Gauge - use AWG there are other gauges such as SWG.
Layers- the number of times you have traversed the former.

You may be right about your instrument reading incorrectly due to the inductance present. I have a digital meter which has a fizzy fit when trying to measure the resistance of a transformer winding. I use an old analog meter which uses a continuous current.

Hey, thanks for the pointers on the terminology. I'm sure that's why Alec_t thought I was crazy!

How certain is the conclusion that the digital meter is reading incorrectly and that the real resistance is closer to 0.642 Ohms? You sound very knowledgeable about this subject, but are you sure the winding's (;)) resistance doesn't increase because of the work it's doing with the magnetism?

I realize that at this point I need to work with the information you gave me above about the relationship between the copper, the current, and the magnetism to come up with a more efficient design for the electromagnet, but as I get closer to ordering final parts the actual resistance of the individual magnets will become important.

I could also use some help in sourcing a variable resistor so I can test stuff in different configurations. Looking around, there are household rheostats available like this one which might be good, but I'm uncertain whether the 100 Ohm rating means that it will go from 0 to 100 Ohms... What do you think?
 

purj

Feb 14, 2016
47
Joined
Feb 14, 2016
Messages
47
What do you get when you join your meter wires together? Say 0.3 Ohms each wire will give you 0.6 Ohms + your resistor value.
Adam
Are you asking what the meter reads when I just touch the leads together in resistance-testing mode? I get 0.7 Ohms (wow)... does that mean the measured resistance of the component when I get 1.4 is actually 1.4 - 0.7 = 0.7?
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Are you asking what the meter reads when I just touch the leads together in resistance-testing mode? I get 0.7 Ohms (wow)... does that mean the measured resistance of the component when I get 1.4 is actually 1.4 - 0.7 = 0.7?
Yep!
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
The resistor you show goes from 0 to 100Ω. At 100W this means that it will be limited to 1A at any setting.

I would use a potentiometer with a much higher resistance and use it to control a fet which can be mounted on a heat sink.
 

purj

Feb 14, 2016
47
Joined
Feb 14, 2016
Messages
47
The resistor you show goes from 0 to 100Ω. At 100W this means that it will be limited to 1A at any setting.

I would use a potentiometer with a much higher resistance and use it to control a fet which can be mounted on a heat sink.

If I hooked it up to 16 V, wouldn't that mean it could handle up to [its wattage limit] / [volts applied], or
(100 W) / (16 V) = 6.25 Amps​
...just to avoid burning out the resistor, with the Amps limit on the PSU being another story?

Or am I thinking about it wrong here? Because wouldn't it also mean that on 16 V, if I hooked this resistor up alone, it would always need to be set above
(16 V) / (6.25 A) = 2.56 Ω?​

So if I set the resistor's resistance to 2 Ohms and I have a 0.7 Ohm load in series, then would the circuit be drawing
(16 V) / (2.7 Ω) = 5.93 Amps?
Would this mean that the power in the circuit would be
(16 V) x (5.93 A) = 94.88 Watts?​
...so would this be OK because it's below the 100-watt rating of the resistor?

And if I wanted to get the current in the circuit below 1800 mA, then would I only need to set the rheostat to
(16 V) / (1.8 A) - (0.7 Ω) = 8.19 Ω?​
 
Last edited:

purj

Feb 14, 2016
47
Joined
Feb 14, 2016
Messages
47
The strength of the field will be proportional to the current times the number of turns.
The power required will be inversely proportional to the amount of copper. You can use a lot of thin wire and a high voltage with little current or thick wire with low voltage and high current.

The resistance of various gauges of wire is available in tables. Remember that the area of the wire is proportional to the square of the diameter.

You should match the load on the power supply so that it is not asked to supply more than it is designed for.

Thanks, Duke37. Looking back at my post from last night, I can see that I'm starting to get an understanding of how these factors work together in design.

It sounds like what you're saying in the above quoted message is that the power (watts) can be held constant while adjusting the voltage and amperage in opposite directions. This seems reasonable since watts are potential multiplied by current. But does the strength of the field also follow the same pattern with regard to changing wire gauge? If I use a common size core, does lowering the resistance by using larger wire increase the current such that the strength of the field remains the same even though I make fewer turns (because of the larger wire) over the same length?

I'm also going to explore the idea of sourcing the electromagnets instead of building my own. I've ordered a couple which will arrive later today (being 1 am already... where did that time go?). If one of these works well, my consideration will be finding one that gives me the desired result in the ferrofluid and then planning out how to power an array of them. But in case they don't work out, I'd also like to continue thinking through the hand-made solution. Thanks!
 
Top