Skip to main content
Visitor II
October 6, 2024
Solved

how to power a 24volts electromagnet

  • October 6, 2024
  • 2 replies
  • 6499 views

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.

    This topic has been closed for replies.
    Best answer by Andrew Neil

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

     

    2 replies

    Super User
    October 6, 2024

    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.

    suhfiAuthor
    Visitor II
    October 7, 2024

    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.

    Super User
    October 7, 2024

    Which sensor ?

    inductive/proximity or ...?

    suhfiAuthor
    Visitor II
    October 7, 2024

    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?

    Graduate II
    October 7, 2024

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

    suhfiAuthor
    Visitor II
    October 7, 2024

    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.