C9 : Water Tank full code
Electricity bases
C9 : Water Tank full code
Electricity bases
A special think about LOGIC GATES
https://en.wikipedia.org/wiki/Logic_gate
Why is LOGIC GATES interesting? our system might be only a logic gates circuit
CONTEXT
high sensor
low sensor
Pump
Ground Reserve
Motion sensor
low sensor
Water tank ALGORYTHMIC VIEW
MAIN PROCESS
GOAL = Maintien water level on the water tank
We have 3 CASE to manage : -CASE 1 : water full everywhere
-CASE 2 : water in reserve but water tank is empty
-CASE 3 : Reserve is empty
Water tank
MAIN CODE STRUCTURE
WHILE (lowSensor==True && hightSensor==True)
WAIT…
ELIF (lowSensor== True && hightSensor==False)
PumpWater ON
ELSE
Print Alert Level Notification
Water tank
WHAT WE DO DURING WAIT TIME ????
We are waiting for orders, check the system on, give notifications, etc
Your client is rich… he wants to … his friends!
His wishes are now:
-Have a control
Wants to be notified if empty reserve
Mesure consomation
Send an email to order a water Truck
Detect any intrusion
Make a log on file recorded everyday, and tap in his hand to shut on the light!! :))
Water tank
Wich libraries do we need?
We are waiting for orders, check the system on, give notifications, etc
You have to think about those things and make an inventory about all libraries you needs.
-manage GPIO LIB = ….
manage motionDetector LIB = ….
-send emails LIB = ….
make and write data on a file LIB = ….
use an external microphone LIB = …
Speak if possible LIB = ….
Water tank
Create a code by yourself
Get informed about libraries
Make test on functions you want to use
keep your boots code (only once working)
Write the MAIN algorithm on paper or note
Detail your lines using each boot code you kept..
Water tank
Create a code by yourself
Make tests by runnings during all your composition
you will have many disapointments
many breaks
And sometines will take an important step
Water tank
Create a code by yourself
Mind to record regularly your code on the disk
Each step when it works as well
And create versions, like myCode1.1
Then myCode1.2
Etc…
Water tank
Create a code by yourself
Using internet you can find many examples
Inside lessons, forum topics, but most in library banks
When you are blocked
You can copy and paste your error into a google search
It’s a good way to resolve everything
SUGGESTS LINKS :
https://www.w3schools.com/python/python_modules.asp (the best for you at the moment)
https://gpiozero.readthedocs.io/en/latest/
https://stackoverflow.com/search?q=pyhton+if+else (forum to find issues)
https://en.wikipedia.org/wiki/Logic_gate (course)