2024-10-06 10:29 AM - last edited on 2024-10-07 02:35 AM by Andrew Neil
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.
Solved! Go to Solution.
2024-10-07 04:48 AM
@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:
@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:
'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.
2024-10-06 11:18 AM - edited 2024-10-06 11:20 AM
You kill the cpu !
Most simple input:
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.
2024-10-06 07:48 PM
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.
2024-10-06 08:33 PM
Which sensor ?
inductive/proximity or ...?
2024-10-06 09:40 PM - edited 2024-10-06 10:21 PM
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.?
2024-10-06 11:01 PM - edited 2024-10-06 11:01 PM
P40/20 30KG Lifting Solenoid Electromagnet
But this is no sensor - its just a magnet !
->
So you need a transistor or mosfet to switch it : here with logic level mos :
2024-10-07 12:07 AM
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.
2024-10-07 12:31 AM
>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 .
2024-10-07 01:16 AM
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.
2024-10-07 01:31 AM
>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 ???