Hackster is hosting Hackster Holidays, Finale: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Tuesday!Stream Hackster Holidays, Finale on Tuesday!
IshanShastri
Published © GPL3+

Automated Water Pourer/Refiller

This contraption refills water in any container to a certain level, detected by a water level sensor module.

BeginnerShowcase (no instructions)906
Automated Water Pourer/Refiller

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Servos (Tower Pro MG996R)
×1
Water level sensor
×1

Software apps and online services

Arduino IDE
Arduino IDE
Arduino Web Editor
Arduino Web Editor

Story

Read more

Schematics

Water pouring device, multipurpose

This device can be used to pour liquids of multiple kinds, and it can be used for multiple purposes that include replenishing containers, filling cups, watering plants, and more. It is a truly useful product that does all the work in its field without any assistance.

Code

Water pourer

C/C++
This useful device uses the water level detection module to detect the liquid level in a container, and replenishes it depending on its status. It can be used to refill containers, fill cups, or even water your cups.
/*
Water replenisher contraption code. Written by Ishan Shastri, 
in Ajax, Canada, L1T3S8, on 10/02/2018
language = c/c++
*/

#include <Servo.h>
Servo servo;
int button = 10;    // Button can be used to allow contraption to function(optional)
void setup() {   
  // put your setup code here, to run once:

servo.attach(8);
servo.write(0);
delay(3000);            
pinMode(button, INPUT_PULLUP);
pinMode(A5, INPUT);
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
Serial.print("Water sensor = ");
Serial.println(analogRead(A5));
delay(2000);

if(digitalRead(button) == LOW){
  if(analogRead(A5) < 330){
    servo.write(90);
      
    digitalWrite(LED_BUILTIN, HIGH);
  }else{
    servo.write(0);
    
    digitalWrite(LED_BUILTIN, LOW);
    
  }
}
}

Credits

IshanShastri
0 projects • 0 followers

Comments