Introduction: Traffic Light Cufflinks
I do not wear much jewellery, apart from a wedding ring and some cufflinks. At lot of my cufflinks are Traffic Light themed. However I wanted something unique.
So I decided to build some real Traffic Light cufflinks. I would not be able to design, prototype and build this in previous years - without a BIG development budget . However with 3D printing available in metal - it is not possible for a hobby development like myself.
All the hardware and associated software is open sourced.
The cufflinks - do:-
- Normal UK Sequence. (Red, Red-Amber, Green, Amber, Red)
- Normal Pelican Sequence. (Red, Flashing Amber, Green, Amber, Red)
- Report the time (Series of encoded flashes)
- Report the date (Series of encoded flashes)
- Current Temperature in Celsius (..flashes)
- Stored number of up to 20 digits. (..flashes)
The case act as a touch sensor. Every four seconds the ATtiny wakes up to see if the case is being touched. This ensures that the coin cell isn’t drained by constantly driving the LEDs. Then displays one of the above based upon the number of touches.
Step 1: Early Prototypes
I started off making a plain Stainless Steel cufflink. Modelled in OpenSCAD. To get the hang of using 3d Printing services online. They look fantastic - so I started development of an electronic version.
OpenSCAD is wonderful, but even better - which I have now used for the latest prototypes is SolidPython. It allows python to generate the OpenSCAD file, which than can be used to generate the 3d "STL" file than can be sent off for printing (Shapeways, i.materialise, or Sculpteo)
Step 2: Arduino Within a Cufflink
Every electronics project needs an arduino. Joking aside, the arduino has been ported to the attiny45 - http://hlt.media.mit.edu/?p=1695. I picked the At tiny series - as they are very small, cheap and easy to develop via the Arduino library.
The attiny http://www.atmel.com/products/microcontrollers/avr/tinyavr.aspx are also great for power cosumption.
It is a CR927 battery running the ATTINY45 and the RV-8564-C2. On powerdown mode ~ 30 mAh / 11microA – http://wolfr.am/UlDHB4
Giving 2727 hours or 3 months, 22 days. But this is worst case for powerdown mode for the ATTINY45, but does the check for touch every 4 seconds or actual power used when the LEDs are turned on. Assuming these things cancel each other out 3 months is acceptable, I actually getting to nearer to 8 weeks, ebefore the voltage drop start to affect the green led.
I also built the wonderful HV Rescue Shield 2 from Mightohm.com. (http://mightyohm.com/blog/products/hv-rescue-shield-2-x/) to use pin 1 on an ATTINY as something other than the reset pin. Using the Rescue Shield to revert pin 1 back to reset pin, so the ATTINY can be re-flashed. My current working schematic, needs to use 6 pins of the ATTINY45
Step 3: PCB
The PCB development took a little work. Everything started on a breadboard. Then I had to try a few prototypes. The hardest part was getting developing code for the very, very small Real-Time-Clock chip, the RV-8564-C2. I could not find a development board - so I had to make a PCB just to be able to play with the chip. See the screenshot form KiCad.
I must say that the RV-8564-C2 is wonderful, an I2C interface and everything else you need is on board - including the micro crystal
Step 4: Software
The software and commit history is full available in git - http://cuffelink.com/code/?p=cuffelink.git;a=history;f=software/micro/arduino/tiny_rag.ino;
Hopefully the code is well documented. Hey - it even contain a recursive function to count the numebr of touches.
getTouches(byte touches, byte min_touch, byte max_touch, byte max_loops)
which can call...
getTouches(touches + 1, min_touch, max_touch, max_loops);
As the two parts of the case is not electrically connected, (plastic part in between the two parts - purple in diagram). Touching the front and back at the same time, lowers the capacitance - http://en.wikipedia.org/wiki/Capacitive_sensing.
Step 5: Final Photos
I like to enter the Jewelry Contest, as I want to order a pure Silver version. Please vote - as I will keep everything Open-source, both the hardware and software.
Also I want to work on cufflinks with different types of LED inside - something other than Traffic Lights. Would welcome suggestions....
Longer (more boring?) Build logs are available at http://cuffelink.com/
Below is a video of all the functions (but a older prototype - the latest is not as big)
The latest versions are thinner, (see blender video)
Wearing an old version ....
A pelican sequence....
We have a be nice policy.
Please be positive and constructive.