Digital Clock With Automatic Rotation of LED Display
by lagsilva in Circuits > Clocks
1680 Views, 4 Favorites, 0 Comments
Digital Clock With Automatic Rotation of LED Display
![IMG_0835.JPG](/proxy/?url=https://content.instructables.com/F9L/DR5Q/JJEJWKRO/F9LDR5QJJEJWKRO.jpg&filename=IMG_0835.JPG)
![IMG_0834.JPG](/proxy/?url=https://content.instructables.com/FAU/EZCL/JJEJWKRN/FAUEZCLJJEJWKRN.jpg&filename=IMG_0834.JPG)
![Digital Clock with Automatic Rotation Display](/proxy/?url=https://content.instructables.com/FSJ/VQWF/JJEJWL2J/FSJVQWFJJEJWL2J.jpg&filename=Digital Clock with Automatic Rotation Display)
This project is about a digital clock with automatic rotation of 7-Seg LED display.
This clock can be rotated in any position keeping the digits readable even upside down or in a mirror image!!
It is controlled by an Arduino and driven by accelerometers to find out the correct position in 3D coordinates.
Additionaly there is a feature to show the indoor ambient temperature in Celsius or in Fahrenheit degrees.
The assemble is very simple and I hope you have fun using it !!
Cheers,
LAGSILVA
Material List
![Arduino Uno R3.JPG](/proxy/?url=https://content.instructables.com/FWK/7OMJ/JDOUV2HV/FWK7OMJJDOUV2HV.jpg&filename=Arduino Uno R3.JPG)
![IMG_20171015_153202744.jpg](/proxy/?url=https://content.instructables.com/FFC/0PTL/J8QGOKK5/FFC0PTLJ8QGOKK5.jpg&filename=IMG_20171015_153202744.jpg)
![MPU-6050 - Acelerometro e Giroscopio 3 Eixox.jpg](/proxy/?url=https://content.instructables.com/F05/CTSG/J8QGCHKW/F05CTSGJ8QGCHKW.jpg&filename=MPU-6050 - Acelerometro e Giroscopio 3 Eixox.jpg)
![Female Jumpers.jpg](/proxy/?url=https://content.instructables.com/FRK/07OP/J8QGCHO7/FRK07OPJ8QGCHO7.jpg&filename=Female Jumpers.jpg)
- Arduino Uno R3
- MPU-6050 breakout
- Multi Funtion Shield for Arduino
- Female jumper wires
- MPU-6050 breakout:
The MPU-6050 breakout consists in a triple axis accelerometer and gyroscope plus a temperature sensor with following specifications:
- Chip: MPU-6050
- Input Voltage: 3-5V
- ADC: 16 bits
- I/O: standard I2C
- Gyroscope full-scale range: ±250, 500, 1000, 2000°/s
- Accelerometer full-scale range: ±2, ±4, ±8, ±16g
- Temperature sensor range: -40 to +85 ºC
- Multi Function Shield (MFD):
The MFD can simplify and speed up the prototype development.
Main features:
- 4 digit 7-segment LED display module driven by two serial 74HC595's
- 4 x surface mount LED's in a parallel configuration
- 10K adjustable precision potentiometer
- 3 x independent push buttons
- Piezo buzzer
- DS18B20 temperature sensor interface
- LM35 temperature sensor interface
- Infrared receiver interface
- Serial interface header for convenient connection to serial modules such as Bluetooth, wireless interface, voice module, a voice recognition module, etc.
Assembly
![IMG_20171015_153409998.jpg](/proxy/?url=https://content.instructables.com/FOC/MNHO/J8QGOMY1/FOCMNHOJ8QGOMY1.jpg&filename=IMG_20171015_153409998.jpg)
![IMG_20171015_153348390.jpg](/proxy/?url=https://content.instructables.com/FDP/HMTS/J8QGOM7E/FDPHMTSJ8QGOM7E.jpg&filename=IMG_20171015_153348390.jpg)
![IMG_20171015_153428978.jpg](/proxy/?url=https://content.instructables.com/FV0/TJ53/J8QGON95/FV0TJ53J8QGON95.jpg&filename=IMG_20171015_153428978.jpg)
![IMG_20171015_153238483.jpg](/proxy/?url=https://content.instructables.com/FOL/45QG/J8QGOP60/FOL45QGJ8QGOP60.jpg&filename=IMG_20171015_153238483.jpg)
The assembly is very simple and does not need any schematics:
- Insert the Multi Shield into the Arduino.
- Fasten the MPU-6050 breakout on the Arduino board using a tiny screw.
There only 04 jumper wires to be connected:
- Red wire: Vcc (+5V)
- Black wire: Gnd
- Green wire: SCL of MPU-6050 breakout to port #6 in the Multi Shield.
- Yellow wire: SDA of MPU-6050 breakout to port #5 in the Multi Shield.
Setup
![Multi Shield by Hackatronics.JPG](/proxy/?url=https://content.instructables.com/FKG/1Y15/J8QGCHKZ/FKG1Y15J8QGCHKZ.jpg&filename=Multi Shield by Hackatronics.JPG)
There are 3 buttons to setup the clock:
- Left button: Press to adjust the hours. Quickly press to set up step by step. Continuous press to advance the hours quickly.
- Center button: Set the minutes. Continuous press to advance the hours quickly.
- Right button: a quick press to move for temperature mode.
Note: In Temperature Mode is possible to change the status to Fahrenheit or Celsius pressing the Left button.
Code
![P24 - Arduino Code.PNG](/proxy/?url=https://content.instructables.com/FBE/2HK8/JJEJW5IL/FBE2HK8JJEJW5IL.png&filename=P24 - Arduino Code.PNG)
![Front Mirror.PNG](/proxy/?url=https://content.instructables.com/FUT/KHHN/JJEJW84G/FUTKHHNJJEJW84G.png&filename=Front Mirror.PNG)
![Front Upside Down.PNG](/proxy/?url=https://content.instructables.com/FMI/AU50/JJEJW84H/FMIAU50JJEJW84H.png&filename=Front Upside Down.PNG)
![Upside Down Mirror.PNG](/proxy/?url=https://content.instructables.com/FNI/GU6O/JJEJW84I/FNIGU6OJJEJW84I.png&filename=Upside Down Mirror.PNG)
The main functions of the code are:
- Reading of accelerometers inclination angles.
- Calculation of the transfer function for the 7-seg LED display (see pictures).
With the angles is possible to detect the spacial position of the clock and decide what routine will be released:
- Front View - Clock Stand Up
- Front View - Clock Upside Down
- Mirror View - Clock Stand Up
- Mirror View - Clock Upside Down