smart hand sanitizer spray
This week’s assignment was to Design and program a smart device that perform a certain function or solve a problem, with more than one input and more than one output.
so i thought of making a smart hand sanitizer spray
*when detect someone crossing by "ultrasonic Sensor"
* plays sound "to take attention" "Buzzer"
* a red led will blink too
* "a poster shows you " to get your hands close to a spray bottle
* an "IR proximity sensor" will detect your hands
*a servo trigger a motion to spray a sanitizer on your hand
* a green led will blink
coding was my biggest challenge so when i finished coding i didn't car too much with the housing , but here is
i used mainly Arduino IDE for coding it uses C language which they say the easiest "eye rolling", i still get confused trying to write any thing with it
the Arduino process the code in parts :
First part defining used library's and used variables and pins numbers.
Second part is Void Setup the code included in this runes one time only.
here also you setup pin Mode on the Arduino for OUTPUT "action component" like a buzzer or a servo or even leds .... "digitalWrite ( pin number , HIGH/LOW) / analogWrite ( pin number , value from 0 to 1023)"
or INPUT like sensors and potentiometers and so on. " digitalRead(pin number) / analogRead(pin number) "
also if you want to rune any thing like resetting a servo position somthing that will play once at the beginning of the code
Third part:
Void loop its the part of the code where you want it to loop and repeat itself
until stopped by something in the code itself otherwise it will loop for ever.
here you can use conditions to update a variable to do action or to calculate more than one actions .
You can also creat a function outside the void loop and call it to execute from the Void loop itself.
don't forget the semicolon and the brackets,
used components
The brains
i drew a simple circuit diagram on paper first for the wiring
wiring on TinkerCad
voila! spaghetti :D
Void Loop - the action working part
i learned to make a function and call it back in the loop code :D
this void phrase plays a tone with a delay and led blinking
simulation done on TinkerCad
testing on the arduino
im just glade that it work :D
video demonstration
Title of Media
Title of Media
Title of Media
Title of Media
Title of Media