Clock and Sensor Box
This is a simple multi purpose device using multiple sensors. It has a
- Alarm Clock, Stopwatch, Timer
- Temperature, Humidity and Heat Index Readings
- Ultrasonic Distance Sensor Readings
- IR Sensor Reading and Visualiser
- Music Keyboard
It is also portable, with a built in battery to power everything.
Electronics
The Device includes
- Maker UNO (Arduino UNO Compatible Board)
- 1.8 inch ST7735 LCD Display
- (SPI Bus, CS on pin 10, RST on pin 7, DC on pin 6)
- Adafruit 12-Key Capacitive Touch Sensor Breakout - MPR121
- I2C Bus
- RTC_DS1307
- I2C Bus
- Ultrasonic Distance Sensor HC-SR04
- (Trigger on pin A0, Echo on pin A1)
- IR sensor (on pin 5) and IR LED (on pin 3)
- A normal LED connected in parallel to the IR LED to visualise the codes to be sent
- DHT11 Temperature and Humidity Sensor
- (on pin 4)
- Buzzer (built into Maker UNO) and Headphone Jack connected to Potentialmeter (as a voltage divider)
- (both on pin 8)
-
1200mah (From a Samsung Phone) Battery and
Power Bank Circuit (Extracted from spare Power Bank)
- Connected in series with a Switch (turn it on and off) to the 5V and GNC pins on the Arduino
I used jumper wires to connect the components together (with the help of a DIY prototyping shield). I also soldered the Power Bank Circuit, Battery and switch together, and added headers to connect to the 5V and GND pins of the Arduino (to power it). Occasionally, I soldered wires directly to the components (Like IR LED and Sensor) to the Arduino.
Case
The Case is mainly made up of MDF.
Holes are drilled and cut into the top piece to make room for the arcade button and wires. There are also cutouts in the side piece for a micro USB connector (to reprogram the Maker UNO inside), and a switch to turn the built in buzzer in the Maker UNO on or off.
The touch pads are cut out from a piece of aluminium (using scissors). An exposed copper jumper wire (connected to the capacitive touch sensor) is placed under each touch pad/shape.
The front would just be covered by a piece of clear plastic (Book Wrapping Plastic)
The whole case would be Hot Glued shut.
Software
The Software has
- Alarm Clock, Stopwatch, Timer
- Temperature, Humidity and Heat Index Readings
- Ultrasonic Distance Sensor Readings
- IR Sensor Reading and Remote
- Music Keyboard
It uses the following additional ibraries
- Adafruit GFX and ST7735
- Adafruit MPR121
- IRremote
- DHT sensor library by Adafruit
- RTClib by Adafruit
- NewTone (cannot install from library manager)
- Used instead of the built in tone library to prevent conflict with IRremote library (something to do with Timers)
This is all coded in the Arduino IDE. The code is on Github Gists. (It already takes up about 89% of memory so no additional features could be added)
Potential Flaws
- The built in battery may sometimes not have enough power to supply to the Ultrasonic Distance Sensor and Real Time Clock.
- The Battery Could be made bigger or the Power bank circuit could be changed to be more efficient
- Or you could just power it from a 5V charger
- I do not have a working IR LED with me now , so it cannot act as an IR remote yet
- This also means that the IR LED code may not work.
- For now, even if the IR remote code does not work, the normal LED means that it is still useful to visualise the IR remote codes sent
- The code has used up about 89% of the internal memory of the ATMega328 Chip in the Arduino
- If the code used up too much internal memory, there would be stability issues. The DHT11 Sensor may not be read properly by the arduino. Some other programs like the Music Keyboard could also be affected.
- Could modify the code to be more compact and efficient
- I had to remove a spamgame program I was planning to include, just to make sure most of the other functions of the code work properly. (With the spamgame, about 95-96% of the arduino memory is used up)
- The case could be constructed better (Like using wood glue instead of hot glue, or making a better box with finger joints and such)
- This may also cause the touch pads to not be sensitive sometimes. The aluminium pad could not be soldered to the wires, and so the wires and the pads may not be in great contact (sometimes). However, this is a nitpick, as most of the times, the pads do work properly.
- The pads may be too close to each other for the user to accidentaly press another pad, but this is another nitpick
- The case could be covered (in veneer or something else) or painted to look nicer.
Overall, this project was done to use up some of my excess sensors and microcontrollers. Considering that I finished this in about a week (actually 9 days), with little to no planning, I am quite satisfied with the result.
Making It Look Nicer
Basically, get some Wood Wallpaper / Covering / Veneer and cut it to size. Moreover, make some cutouts for the (Micro USB) ports, and components (like the distance sensor). Finally, glue it on the wood (I used superglue).