RGB LED Strip Clock Cody Montgomery Jordan Brown

advertisement
RGBLEDStripClock
Cody Montgomery
Jordan Brown
Overview
• The goal of this project is to create an analog clock • An RGB LED strip to display the time
• A DeadOn RTC to keep track of the time
• Includes an user interface that allows one to set the time and some display control
• An Arduino Mega2560 microcontroller at the heart
KeySubsystems
1. RGB LED Strip, 1m (SparkFun)
• 60 LEDs, one for each clock tick
• Full color spectrum
2. DeadOn RTC (SparkFun)
• Keeps track of time independent of the microcontroller
• Uses SPI for data transfer
3. User Interface
• Uses rotary encoder with built in push button and single RGB LED
• Allows user to set hours, minutes, color of hands, background color, and display style
RGBLEDStrip
• 60 RGB LED sections like the picture to the left
• Each section has a WS2812s
• RGB LED
• PWM on each LED
• Signal reshaping
https://dlnmh9ip6v2uc.cloudfront.net//images/products/1/2/0/2/5/12026_1.jpg
WS2812s
• Takes in 24 bits
• 8 bits each LED, 0‐255
• Signal reshaping
• After IC gets 24th bit everything else is pass through
• 50us delay restarts strip at first IC
• Interrupts disabled while setting display
http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Components/LED/WS2812.pdf
DeadOn RTC
• The actual timer, a DS3234 chip, is mounted on a breakout board to minimize the number of pins
• Uses SPI the flow of data to and from the Arduino
• Has 7 pins: Vcc, GND, SQW, CLK, MISO, MOSI, and SS
• Has the ability to track hour, minute, and second as well as month, day, and year
• Also has the ability to store two alarms (these alarms are not used for this project)
https://dlnmh9ip6v2uc.cloudfront.net/images/products/1/0/1/6/0/10160b‐01_i_ma.jpg
RTCWiring
• Since the Arduino has a built in SPI, we are able to use predetermined pins tied to the SPI system
•
•
•
•
PIN 50 (MISO)
PIN 51 (MOSI)
PIN 52 (CLK)
PIN 53 (SS)
UserInterface
User Interface Contents
• Rotary encoder with built in push button
• Dual encoders allows for rotation and direction detection
• Single RGB LED
• Used to display state of interface, i.e. different color sets different feature on clock
https://www.sparkfun.com/products/9117
RotaryEncoderTiming
• Two sequences
• One clockwise, one counter‐
clockwise
• Created with 90⁰ shift between encoders
• Clockwise
• (AB)‐>(A’B)‐>(A’B’)‐>(AB’)‐>(AB)…
• Counter‐clockwise
• (AB’)‐>(A’B’)‐>(A’B)‐>(AB)‐>(AB’)…
https://www.sparkfun.com/datasheets/Components/TW‐700198.pdf
StatusRGBLED
• Setting different pins on the RGB LED will make different color combinations
• White, Red, Green, Blue, Yellow, Purple. (blue‐green was not used)
• Each color corresponds to a different setting.
• The picture to the left shows the physical layout of the user interface and the color correspondence. F
l
o
w
c
h
a
r
t
Conclusion
• So to wrap things up, we have:
• The RGB LED strip for the display
• The DeadOn RTC to keep track of time
• The rotary encoder and single RGB LED for the user interface
• Given some more time, a few things could be done:
• The clock could be improved: add 7‐segements to display the date, improve the interface to set alarms
• Use the display for other routines: create a game, create some form of visual effects
Questions???
Download