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.

21 REPLIES 21

There are two wires which are positive and the signal. you only told me to connect the signal wire to which i set as magnet out. so i have only one wire left with me which is the input 24V positive. And the schematic which you have given has two terminals to connected to the diode - 1N4007. Am i missing something here?

suhfi
Senior

I have another doubt with me also, which is:
i have LM2596 DC-DC converter which has Vin +,Vin -, Vout +, Vout -. which in the datasheet mentioned that the input voltage is from 4.5 - 40 V. and output voltage is from 3.3 - 37 V. can i connect this like the schematic i shown. Are there any changes to that.? i am a bit confused with the connections, it would me more helpful to understand how the connections would be. i have attached a picture of how i am thinking the schematic would be, is that making any sense, will the magnet and the board work if we connect like this?


@suhfi wrote:

There are two wires which are positive and the signal.


False. This magnet has no polarity. Just two wires for power. There is also no signal.

 


@suhfi wrote:

so i have only one wire left with me which is the input 24V positive. And the schematic which you have given has two terminals to connected to the diode - 1N4007. Am i missing something here?


You can connect multiple wires/traces to the same pin. It's called a junction. So the kathode of the diode connects to the positive power supply AND one wire of the electro-magnet.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

@suhfi wrote:

I have another doubt with me also, which is:
i have LM2596 DC-DC converter which has Vin +,Vin -, Vout +, Vout -. which in the datasheet mentioned that the input voltage is from 4.5 - 40 V. and output voltage is from 3.3 - 37 V. can i connect this like the schematic i shown.


That's not a schematic, but a block diagram. But the LM2596 should convert 24V to 5V and can be used to power the board. In fact you might be able to bypass the 5V-3.3V regulator on the board and to straight from 24V to 3.3V. But let's keep things simple and use to convert 24V to 5V. Since you lack knowledge of circuit diagrams I recommend you buy a complete and working 24V to 5V module instead of making your own DC-DC converter circuit, since the LM2596 requires external components.

 


@suhfi wrote:

i am a bit confused with the connections, it would me more helpful to understand how the connections would be. i have attached a picture of how i am thinking the schematic would be, is that making any sense, will the magnet and the board work if we connect like this?


@AScha.3already made a schematic for you. That one will work. Your block schematic shows two outputs of the magnet. One going to the 24V positive power and the other one, "signal", to the MCU. The magnet doesn't have outputs and no signals. And you cannot directly connect it to the MCU. Use the schematic provided to you.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

@suhfi wrote:

There are two wires which are positive and the signal.


Surely, the two wires are just the power supply - positive and ground?

From the page you linked:

AndrewNeil_0-1728295465236.png

https://robu.in/what-is-electromagnet/

i have read all the comments and okay incase, if we consider magnet has 2 terminals which are positive and gnd. okay i connected that to the power supply of 24V. then where can i configure the magnet has to pick or place to? i have used the same magnet with my clearcore board, i have connected that to positive and signal. so i am sure, it is signal which i had configured in my code. and to be again clear, my electromanget has only two termnials wires connected to it.
And in the schematic i have to have 3 wires coming from the magnet. but i have only two. once check the link which i shared earlier to see what magnet i am using.

Here when i want to use LM2596, the block diagram which i shared, converts vout+ to 3.3V. so can i use it with the stm32f411re by connecting with the power supply and the stm32 nucleo board.


@suhfi wrote:

if we consider magnet has 2 terminals which are positive and gnd. okay i connected that to the power supply of 24V. then where can i configure the magnet has to pick or place to?


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. 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 wrote:

i have used the same magnet with my clearcore board


I had to look up what clearcore is. It is a board with 24V IO. The STM32 has 3.3V IO. Internally the clearcore board also uses electronic switches for 24V IO since the CPU on that board is not 24V.

 


@suhfi wrote:

And in the schematic i have to have 3 wires coming from the magnet. but i have only two.


The magnet only has 2 wires/terminals. Multiple wires connect to those wires. Those are called junctions and are marked with a dot in the schematic.

 


@suhfi wrote:

Here when i want to use LM2596, the block diagram which i shared, converts vout+ to 3.3V. so can i use it with the stm32f411re by connecting with the power supply and the stm32 nucleo board.


I have no idea what you are trying to write here. Is this a question? Please use punctuation and capitalization.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

@suhfi wrote:

in the schematic i have to have 3 wires coming from the magnet. 


What schematic?

Why do you think you need 3 wires?

What do you think the 3rd wire would do?


@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.

 

okay, thank you so much. now i got the clarity of the schematic. and thank you once again for the patience.