George Kartsonas
Created February 2, 2020 © Apache-2.0

Smart Toilet

Toilets, we use them every day, they've been around for long time now, there one of the "items" in every house that's most prone to problems

BeginnerFull instructions provided2 hours21

Things used in this project

Hardware components

Proximity Sensor- Pyroelectric Infrared Sensor Module
KEMET Electronics Corporation Proximity Sensor- Pyroelectric Infrared Sensor Module
×1
JST Jumper Bundle for the BeagleBone Blue
Renaissance Robotics JST Jumper Bundle for the BeagleBone Blue
×1
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Solenoid Valve, 2 Way
Solenoid Valve, 2 Way
×1
Darlington High Power Transistor
Darlington High Power Transistor
×1
Resistor 1k ohm
Resistor 1k ohm
×1
1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Solenoid Valve Connection

Code

Solenoid Valve Control Code

Arduino
int Pyro = A1;
unsigned long PyroRead = 0;

unsigned long IR_threshold = 198000;

int Solenoid = 7;

int Detected = LOW;

int IR_sensed = 0;

void setup() {

pinMode (7, OUTPUT);

pinMode (A1,INPUT);

}

void loop() {

while ((IR_sensed < 2)){ 

PyroRead = pulseIn(A1, HIGH);

if(PyroRead > IR_threshold){ )

IR_sensed++; 

}

}

if (Detected == HIGH){ 

Detected = LOW;

digitalWrite(7, LOW);

}

else {

Detected = HIGH;

digitalWrite(7, HIGH);

}

PyroRead = 0;

IR_sensed = 0;

delay(1000); 

Credits

George Kartsonas

George Kartsonas

18 projects • 37 followers

Comments