cancel
Showing results for 
Search instead for 
Did you mean: 

how to power a 24volts electromagnet

suhfi
Senior

i am using electromagnetic sensor which is 24volts. in that i only have the connections for power voltage(positive) and the signal. when i am trying to power it with my stm32f411re nucleo board i can see that the power isn't sufficient. so can i use a 24volts power supply to that and the negative to the stm32f411re nucleo board ground. 
so i was thinking the connections would be like,
power supply positive to the sensor positive, signal to the stm32 nucleo board. power supply negative to the ground of the stm32 board.  would these connections make sense, or would it fry my board?
is there any quick connections to power the sensor with 24volts. quickest answer is much appreciated. thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

@unsigned_char_array wrote:


If it is connected to the power it is on. If it is not connected it is off. In order to change if it is off or not you use a switch. A switch makes or breaks the connection of the magnet to the power. So a switch can turn the magnet on and off.


@suhfi this is shown on the page you linked - here, a battery supplies the power:

AndrewNeil_1-1728301305351.png

 


@unsigned_char_array wrote:

In the schematic that was provided, a MOSFET (a type of transistor) is wired as an electronic switch. This is a switch that can be turned on and off with an electronic signal. That signal comes from the MCU..


@suhfi  This is that schematic:

AndrewNeil_2-1728301456198.png

'M1' is the MOSFET - it performs the function of the switch;

'L1' is the electromagnet;

The '24V+' and '24V-GND' are the power supply - equivalent to the battery;

The 'cpu-out-pin' is the signal from your STM32 microcontroller which controls the "switch" - to turn it off or on.

 

View solution in original post

21 REPLIES 21
AScha.3
Chief III

You kill the cpu !

Most simple input:

AScha3_0-1728238601032.png

In industrial use standard is to use an opto-coupler ; to separate also the ground of the low level circuit/cpu from outside. If you have the same ground, just shown 2 resistors are fine.

If you feel a post has answered your question, please click "Accept as Solution".

i didn't get you. could you show me the schematic diagram of how to connect 24volts electromagnet sensor to the stm32f411re nucleo board. As i have to read the sensor values, and has to give the power to the sensor.

Which sensor ?

inductive/proximity or ...?

If you feel a post has answered your question, please click "Accept as Solution".

the sensor electromagnetic sensor which as input of 24volts(DC 24V, P40/20 30KG Lifting Solenoid Electromagnet). this i have to connect to stm32f411re nucleo board. for the electromagnet sensor i only have the positive power and signal as the connections. Can you show me the schematic.? 

P40/20 30KG Lifting Solenoid Electromagnet

But this is no sensor - its just a magnet !

 

->

Specifications

  • Holding/ Suction Force (KG): 30
  • Operating Voltage (VDC): 24
  • Max. Operating Current (mA): 34

So you need a transistor or mosfet to switch it : here with logic level mos :

 

AScha3_0-1728280861940.png

 

 

If you feel a post has answered your question, please click "Accept as Solution".

so, i am so sorry but i didn't get you. The cpu-out-pin and cpu-gnd. are these the pins in stm32f411re board.?
The project i am doing needs to be connected to the magnet which has the input of 24V. And stm32f411re gives up to only 5V. in my magnet connections, i only have positive( which is 24V) and the signal pin. the signal pin is connected to the nucleo board as to define the digital value to the electromagnet. But the biggest concern to me is 24V positive power to the magnet. How to connect it?
Can it be connected with the power supply of 24V and then where should i connect my negative of the power supply to. should it be connect to gnd.? can i common the gnd of all the wires coming output of 5V and 24V.

>And stm32f411re gives up to only 5V. 

NO ! its a 3V3 system !!!!

+

signal pin : on F411 : any free pin , you set in Cube as your "magnet-out" , set: lo .

 

AScha3_0-1728286242035.png

 

If you feel a post has answered your question, please click "Accept as Solution".

okay, i understand that stm32f411re gives upto 3V3. And, where is cpu-out-pin and cpu-gnd is located on my nucleo board stm32f411re. i connect stm32 nucleo board through usb port. 
i have another doubt as i have a magnet which is DC 24V P40/20. the output wires for these are positive and signal. Here is the link to the magnet
https://robu.in/product/dc-24v-p40-20-30kg-lifting-solenoid-electromagnet/
you can see here only 2 wires are there, and in the schematic which you shown has the connections of magnet to the diode which is not possible in my case. could you please be more detailed. thank you.

>as the connections of magnet to the diode which is not possible in my case. 

WHAT ?  2 wires from magnet -> to diode are not possible for you ???

If you feel a post has answered your question, please click "Accept as Solution".