Using Electromagnet to Detect Steel Door

In summary, Nidum is trying to figure out how to get a more sensitive reading while the electromagnet is under power, but he's not sure how his detector works. He has a picture of the circuit attached. He suspects his problem is the change in inductance as the core of his magnet saturates. If that's the problem, he might get by with a software fix.
  • #1
Michael P C
15
0
Hi guys,

I'm using an electromagnet to detect the presence of a steel door through analog pins on an Arduino. This works great if the magnet itself isn't under power, but once I'm running 12 volts through it, the sensitivity of the readings fall apart. I'm using a resistor based voltage divider to bring that signal back in.

Any ideas how I can get a more sensitive reading while the EM is under power?
 
Engineering news on Phys.org
  • #2
Just thinking through this, is there a module available that might sit between the EM and Arduino to amplify resolution?
 
  • #3
I'm not quite sure how your detector works ?
 
  • Like
Likes Hesch
  • #4
Nidum said:
I'm not quite sure how your detector works ?

I've got a picture of it attached. The battery sitting on top is representative of the door that it's holding.
 

Attachments

  • IMG_4386.JPG
    IMG_4386.JPG
    42.9 KB · Views: 408
  • #5
Does your detector need to be co-located with your electromagnet?

BTW, it's still not clear how the detector works. There are several possibilities, so ...

I suspect your problem is the change in inductance as the core of your magnet saturates. This could drop the inductance by 2-3 orders of magnitude. But it's hard to be sure without understanding the circuit.

If that's the problem, you might get by with a software fix. Simply use a different detection level when the core is saturated compared to when it isn't.
 
  • #6
Oh yes, the detector ideally needs to be on the electromagnet side of the equation, hence my trying to use it as the detector. The way it's wire up, I have 12 volts going to the electromagnet, with a line coming off it that goes to an analog IN pin on the Arduino. I have a voltage divider to take it down to 5 volts for the analog pin. That's the basic circuit. Without power to the electromagnet, the Arduino (with 1023 integers of value to read) picks up an easily readable difference of about 300 integers with the steel door present vs. away. With 12 volts powered, that 300 spread goes down to 2-3, which is so small that misreadings are common.

What do you mean different detection level? Perhaps using another analog pin with a different voltage division value?
 
  • #7
Well I'm truly puzzled now ! With no power going to the solenoid I can't see what the AD converter is finding to detect the level of .

Are we talking all DC in your circuits ?

Could you draw out the complete circuitry of everything to do with the electromagnet and post it for us to look at ?
 
  • #8
As Nidum is implying, you would usually use AC to detect nearby ferrous metal with your test coil. Does your Arduino have an analog output available? What frequency sine wave could you output with it?
 
  • #9
This is all DC. I can draw up a circuit but it will be a little crude. Give me a few.
 
  • #10
I am being persuaded that you are saturating your iron core.

When the iron core is saturated, it no longer multiplies the inductance by µiron(≈600). Instead it multiplies it by µ0(=1). If you can spare another tap and input pin, use it with a different voltage divider.

Of course there are other possibilities. As the other posters alluded, transformers don't work with DC. Are you checking (and adding a check current) less often when the magnet is energized? (I assume you do something like this many times a second to get any result at all.)
 
  • #11
Circuit attached.

What do you mean by tap? Do you mean a second voltage divider to operate in the EM's on state?
And yes, I believe the readings are occurring every 50 milliseconds.
 

Attachments

  • EM.png
    EM.png
    49 KB · Views: 409
  • #12
In addition to being a magnet and and inductor, a coil can also act as an autotransformer. I had assumed yours did, but I see I was wrong. (A very clever design, BTW. I would have guessed it wouldn't work at all.) To do this extra leads are "T'd" into the coil. These are called taps. Your coil doesn't have any.

If your only goal is knowing when the magnet is attached to metal, you might try the following:

1) Measure PC2. Store as PC2i. Check the real time clock.
2) Turn off the magnet.
3) Loop
3 a) Measure PC2 again
3 b) If PC2<(0.8)PC2i exit loop
4) Check the real time clock to see how long the loop took. (loop time)
5) Turn on the magnet. Return the loop time.

What this does is briefly weaken the magnet (by 20%) and measure the time it takes to drop by this amount. This time should vary depending on the state of the magnetic circuit formed by the magnet and either attached metal or air. My hypothesis is that these will be different. Test it and see.

This is a fairly ugly hack, but it might work.
Good luck.
 
  • #13
Michael P C said:
Circuit attached.

What do you mean by tap? Do you mean a second voltage divider to operate in the EM's on state?
And yes, I believe the readings are occurring every 50 milliseconds.
TBH, that's a strange way to try to make a ferrous metal detector. Is there a reason you used that circuit? Where did you find it?

(and again, does your Arduino have an analog output pin that you could use instead?) :smile:
 
  • #14
berkeman said:
TBH, that's a strange way to try to make a ferrous metal detector. Is there a reason you used that circuit? Where did you find it?

(and again, does your Arduino have an analog output pin that you could use instead?) :smile:
Well, it's primary function is as an electromagnetic catch, but I also need to detect the presence both with the magnet powered on and off. Just trying to use it for both before I use a secondary sensor.

What are you suggesting I use an analog output pin for? It does have a couple available.
 
Last edited:
  • #15
Jeff Rosenbury said:
In addition to being a magnet and and inductor, a coil can also act as an autotransformer. I had assumed yours did, but I see I was wrong. (A very clever design, BTW. I would have guessed it wouldn't work at all.) To do this extra leads are "T'd" into the coil. These are called taps. Your coil doesn't have any.

If your only goal is knowing when the magnet is attached to metal, you might try the following:

1) Measure PC2. Store as PC2i. Check the real time clock.
2) Turn off the magnet.
3) Loop
3 a) Measure PC2 again
3 b) If PC2<(0.8)PC2i exit loop
4) Check the real time clock to see how long the loop took. (loop time)
5) Turn on the magnet. Return the loop time.

What this does is briefly weaken the magnet (by 20%) and measure the time it takes to drop by this amount. This time should vary depending on the state of the magnetic circuit formed by the magnet and either attached metal or air. My hypothesis is that these will be different. Test it and see.
This is a fairly ugly hack, but it might work.
Good luck.

Still trying to absorb this solution. Does this require running this loop non stop until a hit is detected? I think I read this as changing my measurement from a voltage change to the time it takes for a voltage change of N amount. Is that right?
 
  • #16
Michael P C said:
Still trying to absorb this solution. Does this require running this loop non stop until a hit is detected? I think I read this as changing my measurement from a voltage change to the time it takes for a voltage change of N amount. Is that right?
It is changing from detecting a voltage to detecting the time needed for a voltage change.

I'm not sure how much time the loop will take. First, it will need to be run every time you want a detection. Second, it may need to be run continuously, but it may not. The key is to get the time of the voltage change. If you can figure out a way to do that while doing other things, that would be great. If not, sadness. A lot depends on how long the loop takes which I can't estimate because I'm lazy. :sleep:Since it will need to be measured anyway...
 
  • #17
From the attached picture in #1, it seems to me that not the iron core of the magnet will be saturated, but the steel door.

By the way: What is meant by "steel" in this context?
Remember that stainless steel will not react to a magnetic field.
Maybe a capacitive sensor should be considered?
 
  • #18
Hesch said:
From the attached picture in #1, it seems to me that not the iron core of the magnet will be saturated, but the steel door.

By the way: What is meant by "steel" in this context?
Remember that stainless steel will not react to a magnetic field.
Maybe a capacitive sensor should be considered?

The door is a ferrous alloy and the core is electrical steel. Do you think a capacitive sensor directly adjacent to the electromagnet be affected by the EM's fields?
 
  • #19
Michael P C said:
Do you think a capacitive sensor directly adjacent to the electromagnet be affected by the EM's fields?
Closing up a capacitive sensor, the change in capacitance will change the capacitive current, which can be measured. You must use AC-voltage, say 24V, 200 kHz.

You can sense an empty (wine)glass within a distance of 5 cm! And, well, with a steel door you must take care, that your capacitive sensor will not be "saturated".
 
  • #20
Hesch said:
Closing up a capacitive sensor, the change in capacitance will change the capacitive current, which can be measured. You must use AC-voltage, say 24V, 200 kHz.

You can sense an empty (wine)glass within a distance of 5 cm! And, well, with a steel door you must take care, that your capacitive sensor will not be "saturated".

How about an inductive proximity sensor? I'm kind of planning on this as a last resort as long as it's not affected by the adjacent field.
 
  • #21
Jeff Rosenbury said:
It is changing from detecting a voltage to detecting the time needed for a voltage change.

I'm not sure how much time the loop will take. First, it will need to be run every time you want a detection. Second, it may need to be run continuously, but it may not. The key is to get the time of the voltage change. If you can figure out a way to do that while doing other things, that would be great. If not, sadness. A lot depends on how long the loop takes which I can't estimate because I'm lazy. :sleep:Since it will need to be measured anyway...
OK! A new path to explore - and a creative one at that! Thanks for thinking through this with me Jeff.
 
  • #22
Michael P C said:
. . . as long as it's not affected by the adjacent field.
A capacitive sensor is not affected by any adjacent field.
See the attached.
You can "lock" the rectifier to the 200 kHz signal to refine the detection. What adjacent field at 200 kHz should affect the measurement. A 50/60 Hz disturbing signal can easily be filtered away.

The C1, C2 capacitors are the capacitances between the sensor plates and the door.
 

Attachments

  • scan0028.pdf
    51.5 KB · Views: 182
  • #23
Hesch said:
A capacitive sensor is not affected by any adjacent field.
See the attached.
You can "lock" the rectifier to the 200 kHz signal to refine the detection. What adjacent field at 200 kHz should affect the measurement. A 50/60 Hz disturbing signal can easily be filtered away.

The C1, C2 capacitors are the capacitances between the sensor plates and the door.

I'm using DC only, but I may have an AC version need so it's good to know this solution! Thanks again.
 
  • #24
Michael P C said:
I'm using DC only, but I may have an AC version need so it's good to know this solution! Thanks again.
There's a similar software hack.
 
  • #25
Jeff Rosenbury said:
There's a similar software hack.

Interesting!
 
  • #26
If I'm reading post #6 correctly, it sounds like with the door not present, the un-powered electromagnet is picking up the background magnetic field (power line hum). When the door is present the magnetic circuit is shorted and doesn't register the background field.

Perhaps measuring the change in inductance would work to detect the door presence. That's basically what Jeff suggested in post #12.
He is measuring the voltage decay rate (which depends on the circuit inductance, capacitance, and resistance) to detect a change in coil inductance.

A variation on Jeff's approach could be to inject an AC current in the coil and measure how much current flows in it.
This could be done by rapidly switching the power on and off to the coil and measuring the voltage drop across a low value resistor in series with the coil.
 
  • Like
Likes rbelli1
  • #27
If you want to stay with an all DC system you could try a Hall effect sensor which detects the change in magnetic field around the solenoid when door is open or closed .

With system on standby energise the solenoid for a short time every second or so and test the output from the sensor to detect whether door is open or closed .

With door closed and solenoid permanently energised test the output from the sensor at the same rate to detect whether door has been forced open .
 
  • #28
Nidum said:
If you want to stay with an all DC system you could try a Hall effect sensor which detects the change in magnetic field around the solenoid when door is open or closed .

With system on standby energise the solenoid for a short time every second or so and test the output from the sensor to detect whether door is open or closed .

With door closed and solenoid permanently energised test the output from the sensor at the same rate to detect whether door has been forced open .

You know, that might work too. I'll pick one up for a test.
 
  • #29
Tom.G said:
If I'm reading post #6 correctly, it sounds like with the door not present, the un-powered electromagnet is picking up the background magnetic field (power line hum). When the door is present the magnetic circuit is shorted and doesn't register the background field.

Perhaps measuring the change in inductance would work to detect the door presence. That's basically what Jeff suggested in post #12.
He is measuring the voltage decay rate (which depends on the circuit inductance, capacitance, and resistance) to detect a change in coil inductance.

A variation on Jeff's approach could be to inject an AC current in the coil and measure how much current flows in it.
This could be done by rapidly switching the power on and off to the coil and measuring the voltage drop across a low value resistor in series with the coil.

6 might have been confusing the way I wrote it out.. the detector IS the electromagnet at the moment, and if not, needs to stay on that side.
That variation sounds really interesting! Hopefully I've solve it before having to test my skills on that idea :)
 

What is an electromagnet?

An electromagnet is a type of magnet that is created by running an electrical current through a wire. The magnetic field produced by the current is what makes it different from a permanent magnet.

How does an electromagnet work?

An electromagnet works by having an electrical current run through a wire, which creates a magnetic field around the wire. This magnetic field attracts magnetic materials such as steel, allowing it to detect steel doors.

How does an electromagnet detect a steel door?

The magnetic field produced by the electromagnet will interact with the iron in the steel door, causing the door to become magnetized and creating a force between the door and the electromagnet. This force can be detected and measured, allowing the presence of the steel door to be detected.

What are the advantages of using an electromagnet to detect steel doors?

One advantage is that it can detect steel doors without needing physical contact, making it a non-intrusive method. Another advantage is that the strength of the magnetic field can be adjusted, allowing for more accurate detection. Additionally, it can be used in a variety of environments, including ones with obstacles or barriers.

Are there any limitations to using an electromagnet to detect steel doors?

Yes, there are some limitations to this method. The strength of the magnetic field can be affected by other magnetic materials or objects in the vicinity, which can interfere with the accuracy of the detection. Additionally, the distance between the electromagnet and the steel door can also affect the strength of the magnetic field and the accuracy of the detection.

Similar threads

  • Electrical Engineering
Replies
6
Views
1K
  • Electrical Engineering
Replies
32
Views
2K
  • Electrical Engineering
Replies
2
Views
1K
Replies
11
Views
1K
  • Electrical Engineering
2
Replies
38
Views
3K
Replies
6
Views
2K
Replies
8
Views
985
  • Electromagnetism
Replies
25
Views
1K
  • Electrical Engineering
Replies
1
Views
2K
Replies
4
Views
2K
Back
Top