-
Notifications
You must be signed in to change notification settings - Fork 0
Home
The following project uses a RaspberryPi, GreenBean and Makey Makey to dispense water from a GE Refrigerator in a dog's water bowl.
Node.js should be installed in the RaspberryPi as well as the following modules:gea-adapter-usb, gea-sdk, node-hid, and buffertools.
Three Makey Makey keys are used as sensors. The Up key is used to sense the maximum water level. The Down key is used to sense the low water level; and the Left key is used to sense the dog. Ground is connected to the bottom of the water bowl.
Water is dispensed if the low water level sensor is not active (water level is below the sensor level) and the dog is drinking water. Once the dispensing starts, it only stops once the maximum water level is reached. Dispensing is triggered by the dog's presence and will continue filling the bowl to the maximum level even if the dog has left. Water is not dispensed if the low sensor is active, indicating the water has not reached the low water level. This logic was implemented to reduce the number of on/off cycles in the water dispenser relays.
The Makey Makey keys are read as raw HID data. Six keys could be read at the same time by using this method; otherwise you can only get the last key press event.
- Connect Makey Makey to the RaspberryPi.
- Attach Makey Makey's Ground to the bottom of the dog's water dish.
- Attach Makey Makey's Up key to the dog's water dish. It will be the maximum water level sensor.
- Attach Makey Makey's Left key to a metallic tray (or aluminium foil). It is used to detect the dog presence. The dog should touch the metallic tray and the water in the bowl in order to start dispensing water.
- Attach Makey Makey's Down key to the dog's water dish. It will be the low water level sensor.
- Run script: sudo node DogWaterDispenserHid.js
- If there is an error connecting to the Makey Makey: "cannot open device with path xxxx:xxxx:xx"; then record the "path" value of the product "Arduino Leonardo" (Every HID device is listed when the application runs and the Makey Makey is listed as an Arduino device). In order to update the path, execute: sudo nano DogwaterDispenserHid.js and update the "path" variable in the source code with the right value.
- Steps to test the application:
- Press ground and Up key in the Makey Makey to test the software. The following messages will be displayed: WaterHighLevel Stop dispensing water. GEA2 message was sent.
- Press ground and Left key. The following messages will be displayed: WaterLowLevel and DogIsDrinkingWater Start dispensing water. GEA2 message was sent. (Messages are repeated until ground and Up key are pressed. Water is dispensed)
- Press ground and Up key. The following messages will be displayed: WaterHighLevel Stop dispensing water. GEA2 message was sent. (Water is not dispensed anymore)
- Congratulations! Everything is set for the dog!