Introduction: Clock and Sensor Box

About: Things made with crappy tools, an impatient maker and in an imperfect manner in a rush, but just done well enough to call projects

This is a simple multi purpose device using multiple sensors. It has a

  1. Alarm Clock, Stopwatch, Timer
  2. Temperature, Humidity and Heat Index Readings
  3. Ultrasonic Distance Sensor Readings
  4. IR Sensor Reading and Visualiser
  5. Music Keyboard

It is also portable, with a built in battery to power everything.

Step 1: Electronics

The Device includes

  1. Maker UNO (Arduino UNO Compatible Board)
  2. 1.8 inch ST7735 LCD Display
    • (SPI Bus, CS on pin 10, RST on pin 7, DC on pin 6)
  3. Adafruit 12-Key Capacitive Touch Sensor Breakout - MPR121
    • I2C Bus
  4. RTC_DS1307
    • I2C Bus
  5. Ultrasonic Distance Sensor HC-SR04
    • (Trigger on pin A0, Echo on pin A1)
  6. IR sensor (on pin 5) and IR LED (on pin 3)
    1. A normal LED connected in parallel to the IR LED to visualise the codes to be sent
  7. DHT11 Temperature and Humidity Sensor
    • (on pin 4)
  8. Buzzer (built into Maker UNO) and Headphone Jack connected to Potentialmeter (as a voltage divider)
    • (both on pin 8)
  9. 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.

Step 2: 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.

Step 3: Software

The Software has

  1. Alarm Clock, Stopwatch, Timer
  2. Temperature, Humidity and Heat Index Readings
  3. Ultrasonic Distance Sensor Readings
  4. IR Sensor Reading and Remote
  5. Music Keyboard

It uses the following additional ibraries

  1. Adafruit GFX and ST7735
  2. Adafruit MPR121
  3. IRremote
  4. DHT sensor library by Adafruit
  5. RTClib by Adafruit
  6. NewTone (cannot install from library manager)
    1. 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)

Step 4: Potential Flaws

  1. The built in battery may sometimes not have enough power to supply to the Ultrasonic Distance Sensor and Real Time Clock.
    1. The Battery Could be made bigger or the Power bank circuit could be changed to be more efficient
    2. Or you could just power it from a 5V charger
  2. I do not have a working IR LED with me now , so it cannot act as an IR remote yet
    1. This also means that the IR LED code may not work.
    2. 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
  3. The code has used up about 89% of the internal memory of the ATMega328 Chip in the Arduino
    1. 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.
    2. Could modify the code to be more compact and efficient
    3. 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)
  4. The case could be constructed better (Like using wood glue instead of hot glue, or making a better box with finger joints and such)
    1. 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.
    2. The pads may be too close to each other for the user to accidentaly press another pad, but this is another nitpick
    3. 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.

Step 5: 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).