Do polypropylene float switches need power?

Thread Starter

Nem_navo

Joined Mar 8, 2022
4
Do pp float switches need power? I do not want to connect it to a pump, alarm or a valve but just to atmega32 mc (to give a signal when liquid level is low). What will be the voltage and current this circuit need? Can switching happen without a voltage?
 

Reloadron

Joined Jan 15, 2015
6,584
A model number and link to it would help. Generally speaking no the switch is only a switch. Some have Common with Normally Open and Normally closed terminals. You can power it with any voltage suitable for your uC using a pull up resistor and code the uC digital input accordingly. In some cases the uC has an internal pull up you can call out in code. It's a switch and only a switch.

Ron
 

MisterBill2

Joined Jan 23, 2018
11,876
If the float switch has three leads and it is not one with both a normally open and a normally closed side, then it probaby needs a power suppy. If it ony has two leads, then it may not require a power supply. You will need to examine the tags on the switch to know.
 
Last edited:

Thread Starter

Nem_navo

Joined Mar 8, 2022
4
A model number and link to it would help. Generally speaking no the switch is only a switch. Some have Common with Normally Open and Normally closed terminals. You can power it with any voltage suitable for your uC using a pull up resistor and code the uC digital input accordingly. In some cases the uC has an internal pull up you can call out in code. It's a switch and only a switch.

Ron
Thank you very much for the answer.
20220309_072116.jpgThis is the float switch. (Model num: MFS Vt 01 pp)
This has only 2 pins so I have to connect one pin to power (1V if possible) + resistor and the other pin to microcontroller. Is that right?
 

Thread Starter

Nem_navo

Joined Mar 8, 2022
4
If the foat switch has three leads and it is not one with both a normay open and a normally closed side, then it probaby needs a power suppy. If it ony has two leads, then it may not require a power supply. You will need to examine the tags on the switch to know.
Thank you for the answer.
This is a normally open or closed switch and has only 2 leads.
If I power this, how the connection happens with the microcontroller? Is it like, one lead to microcontroller and the other to power+ resistor? Will it be possible to use 1V?
 

Ian0

Joined Aug 7, 2020
5,082
Thank you very much for the answer.
View attachment 262342This is the float switch. (Model num: MFS Vt 01 pp)
This has only 2 pins so I have to connect one pin to power (1V if possible) + resistor and the other pin to microcontroller. Is that right?
Connect one pin to ground and the other to your microcontroller input. Then enable the pullup on the microcontroller input. That's all you need.
If your switch is at the end of a long cable, then your microcontroller might need some transient protection on the input.
If the switch is anything other than a reed switch, you might need more current through it to keep the contacts clean.
 

SgtWookie

Joined Jul 17, 2007
22,226
The switch contacts will likely "bounce" for a number of milliseconds while opening or closing, causing rapidly fluctuating voltages on your uC input pin. A small capacitor in the 10nF-100nF range from your uC input pin to ground/Vdd can help stabilize the fluctuations.

Searching for "switch debounce" will net lots of results.
 

Ya’akov

Joined Jan 27, 2019
5,656
The switch contacts will likely "bounce" for a number of milliseconds while opening or closing, causing rapidly fluctuating voltages on your uC input pin. A small capacitor in the 10nF-100nF range from your uC input pin to ground/Vdd can help stabilize the fluctuations.

Searching for "switch debounce" will net lots of results.
Utterly off-topic but that was your 22,222nd message.

1646823594578.png
 

MisterBill2

Joined Jan 23, 2018
11,876
I hope that your processor has some information about how to use digital inputs, such as if they have internal pull up or pull down resistors. Or did the micro-controller come with no information at all?
You can verify the operation of the float switch using an ohm meter, which will also tell you if it is actually functioning or not..
Most digital inputs have a defined open state, so you really do need to know a bit about how your controller works.

As for contact bounce, if the program is not simply stopped and waiting for an input to continue, but rather checking the state of that input each time through the loop, like on a PLC, then there will be no problems.
 

Reloadron

Joined Jan 15, 2015
6,584
Looking at the switch part number it looks to be a normally open typical float switch. I would just wire it like this:

Pull Up.png

The switch is normally open. The output between switch and resistor goes to your uC digital input. This assumes your uC digital in does not have internal pullup programmable. The resistor is a 10K pullup resistor. Even 1/8 watt resistor would be fine. When liquid level triggers the switch the normally high into the uC will go low. You write your code accordingly. You can also write your code to account for any switch bounce which for something like this with stable liquid level change I don't see as a problem but include it in your code. Level rises, switch closes, digital in to uC transitions High to Low. Rearrange the parts and you can have a Low to High transition. Depends on what you want .VCC can be your uC power. Ground is VCC Ground.

Ron
 
Top