PeeGone - Bedwtting Alarm

by udubinsky in Living > Kids

653 Views, 5 Favorites, 0 Comments

PeeGone - Bedwtting Alarm

IMG_20160417_232424.jpg

The same product cost at the store about 100$ (!)
I made it using an arduino and few componets :

- Arduino pro mini
- 2 X 220ohm resistors
- Copper Tape
- Potentiometer
- Momentary push button
- Piezo Buzzer
- Toggle Switch
- Some Wires

- a Clip

The Built

peeGone_bb.jpg
IMG_20160417_232417.jpg
IMG_20160417_232449.jpg
arduino pro mini.jpg
piezzo buzzer.jpg
copper tape.jpg
on-off switch.jpg
momentary push button.jpg
220ohm resistor.jpg
potentiometer.jpg

Well, it is quite eazy, tape to peaces of copper tape very close to each othe but not tuching.
Connect one copper tape piece to the arduino analog pin 3 and to a 220ohm resistor connected to ground (pull down).
connect the other copper tape piece to vcc.

Folow the schematics for the rest of the componets.

The pee closes the cirquite between the two copper tape pieces and sends a signal to the arduino wich sound
an alarm to wake your kid up.

Why should you pay 100$ for it ?

Code

logo_arduino.jpg
const int sensor = A3;
const int button = 5;
const int buzz = 9;
int sensorValue;
boolean alarmDiss = false;
void setup() {
pinMode (button, INPUT);
pinMode (buzz, OUTPUT);
Serial.begin (9600);
}
void loop() {
sensorValue = analogRead (sensor);
Serial.println (sensorValue);
if (sensorValue >= 50 && !alarmDiss) {
while (!digitalRead (button)) {
tone (buzz, 800);
delay (200);
noTone (buzz);
delay (200);
}
alarmDiss = true;
}
if (digitalRead (button)) {
if (!alarmDiss){
tone (buzz, 800);
}
if (alarmDiss) {
alarmDiss = false;
noTone (buzz);
delay (1000);
}
Serial.print ("Alarm Dismiss = ");
Serial.println (alarmDiss);
} else {
noTone (buzz);
}
}