Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

HELP WITH LOGIC CIRCUIT

NCFC1950

New Member
Hi, pretty much a beginner with logic circuits and have had a crack at it but can only fullfill 3 of 4 conditions. I’ve attached a diagram so hoping someone can help me.

Basically I have 2 float switches at top and bottom of a container and need to switch a pump on when the level reaches the top switch and keep it on until the level falls below the bottom switch then turn the pump off. TIA.
 

Attachments

  • IMG_1676.jpeg
    IMG_1676.jpeg
    1.9 MB · Views: 13
Assuming you are implementing this using a controller, draw a State diagram. States are Empty, Filling, Full.
Initial state is Pump Off.
Empty to Filling event is B going to 1, nothing happens. State is now Filling.
Full State entered from Filling State when A=1, turn Pump On.
Empty State entered again when A=B=0, turn Pump Off.

See https://github.com/jrullan/StateMachine for a typical libray to build this with.

Inside the code where you monitor the switches, you need to track what state the system is in. Change state depending on condition of switches relative to the State.

Gerrit
 
Your case 2 and case 4 are the same. You are just describing them differently. If each switch (sensor) only has two states (on/off) and you have two switches (sensors), the most states you can have is 2 squared = 4.
 
I only listed 3 states, Empty, Filling and Full. I should have worded the first sentence as just initially pump is off.

Initially Pump is off, State is Empty.
When Switch B goes to 1, set State to Filling
When Switch A also goes to 1, set State to Full, turn on Pump.
When Switch A goes to 0, do nothing.
When Switch B also goes to 0, set State to Empty and turn off Pump. (code would be something like If State=Full and A=B=0, then set State to Empty, turn off Pump.)

gerrit
 

Latest threads

New Articles From Microcontroller Tips

Back
Top