[English version at the bottom]
Rellotge Lineal amb Arduino + DS1307 + Neopixel
Pel festival FADE de la Cellera de Ter del 2015 juntament amb els companys del Tecnoateneu de Vilablareix vam fer un projecte consistent en una «dutxa sensorial» consistent en un espai fosc en el qual una persona s’introdueix, i que només està il·luminat per unes tires de LED i un sò ambiental. Inicialment el patró de llums i la música eren relaxants però en un moment determinat es feien caòtics i induïen a la persona de l’interior a experimentar incomoditat, que justament era el que es pretenia: experimentar com la tecnologia pot arribar a influïr en les persones.
TIRES NEOPIXEL
Aquesta instal·lació es va fer utilitzant unes tires de LED anomenades Neopixel, i consisteixen en un circui imprès flexible amb 60 LEDs multicolor. La característica principal és que aquestes és que cada LED és adreçable i configurable, de manera que podem indicar cada LED individualment amb una barreja única de 3 colors, combinació de components RYB. Cada LED té associat un petit integrat el qual descodifica el senyal que s’envia pel port. Només és 1 bit que es va propagant en seqüència.
Aquest és el producte de Adafruit: https://www.adafruit.com/products/1138. És extremadament senzill de programar amb un Arduino qualsevol. Heu d’importar la llibreria «Adafruit_Neopixel.h» a la carpeta Library de Arduino, i incloure-la al codi.
Precisament perque aquesta tira té 60 LEDs, vaig pensar en utilitzar-ne una per fer un rellotge. De fet una tira d’aquesta mena dona molt de joc perque es pot tallar en tires més petites de qualsevol mida, i fins i tot es pot fer una matriu de LEDs personalitzada.
DS1307
Donat que les targes de la familia Arduino no tenen un rellotge de temps real (RTC) integrat, s’han desenvolupat algunes plaques amb aquesta funcionalitat, com la DS1307. Consisteix en un integrat, el qual es comunica amb Arduino mitjançant el port I2C. Té 2 pins per alimentació a 5V, 1 pin per SCA i 1 pin per SCL. Porta incorporada una pila botó que mante´l’hora i la data fins a 3 anys segons la documentació, sempre que no estigui alimentada externament.
Aqui en teniu la referència: https://www.adafruit.com/product/264
L’hora i data es pot programar i també llegir des del mateix Arduino. Penseu en incloure les llibreries «RTClib.h» i «Wire.h» a la carpeta corresponent Arduino. Les instruccions són molt intuïtives, però aqui en teniu més documentació: https://learn.adafruit.com/ds1307-real-time-clock-breakout-board-kit/understanding-the-code
Arduino Uno
No hi ha cap misteri aqui: disposava d’una placa clònica sense usar i vaig pensar en fer-la servir per aquest muntatge.
Breadboard
Una petita placa de prototipatge serveix com a suport del RTC, 2 resistències i 2 botos amb l’Arduino per canviar l’hora i el minut sense haver de connectar-ho a l’ordinador.
Una fusta…
… reciclada d’un palet per enganxar tot el conjunt amb brides.
Codi
Només queda progamar l’arduino i posar en hora amb els botons corresponents. Heus ací el codi: https://github.com/Giroair/Linear-Clock-Arduino/blob/master/Linear_Clock___RTC__inverted_.ino
Si necessiteu més detalls, a la web d’Instructables teniu tota la informació necessària ordenada pas a pas.
I aquest és el resulat: després de 6 mesos funcionant de forma contínua només ha tingut una desviació de 2 minuts.
De moment tot això se’n va cap al Festival d’Art Digital i Electrònica (FADE) que es celebra a la Cellera de Ter del 29 de juny al 2 de juliol. Si no el coneixeu, us recomano que hi aneu amb tota la familia.
I després pensaré com millorar el rellotge, que d’idees no en falten. Si teniu cap suggeriment, serà benvingut.
Linear clock using Arduino + DS1307 + Neopixel
Jointly with the colleagues of the Tecnoateneu de Vilablareix, a project named «sensoring shower» was made for the 2015 FADE festival at La Cellera de Ter, consisting of a dark space where a person is surrounded by strips of LED lights and ambient sound. The pattern of lights and the music are relaxing but suddenly became caotic, inducing uncomfortable sensations to the person, just as was intended.
NEOPIXEL STRIPS
This project was implemented using LED lights strips called Neopixel, consisting of a flexible printed circuit board with 60 multicolor LED diodes. The most important feature is that every single LED is addressable and configurable, so we can address every LED individually with a unique combination of Red, Yellow and Blue colors. Every LED has a tiny integrated to control it, decoding the signal of only 1 bit running through the port.
This is the Adafruit reference: https://www.adafruit.com/products/1138. It is extremely simple to program using any Arduino or basic microcontroller. The «Adafruit_neopixel.h» library has to be imported in order to include it to the code.
Just because this strip has 60 LEDs, I thought that could be uses to implement a clock. In fact, this configurations is very versatile as far as can be cut in shorter strips of any size, and even a matrix of LEDs can be made.
DS1307
As long as the Arduino microcontrollers does not have an internal Real Time Clock (RTC), some boards have been developed, as the DS1307. Consisting of an integrated circuit which communicates with the Arduino using a I2C port and protocol. It has 2 pins to suply 5Vdc, 1 pin for SCA and 1 pin for SCL. When not powered from the Arduino, the button battery keeps the time and data up to 3 years according to the datasheet.
Here is the reference: https://www.adafruit.com/product/264
The data and hour can be programmed and read from the Arduino Uno. Think of include «RTClib.h» and «Wire.h» libraries. The instructions are very intuitive:
https://learn.adafruit.com/ds1307-real-time-clock-breakout-board-kit/understanding-the-code
Arduino Uno
No misteriy here: had an unused clonic board and thought to use in this project.
Breadboard
A tiny prototiping board is used to hold the RTC, 2 resistors and 2 buttons in place. The two buttons are used to change the hour and minute without connecting the board to the computer.
A wooden board…
… refurbished from a pallet, just to keep the elements in place using plastic ties.
Code
Only programming the Arduino and setting the hour and minute using the buttons are left. Here you have the code: https://github.com/Giroair/Linear-Clock-Arduino/blob/master/Linear_Clock___RTC__inverted_.ino
If further information is needed, here at Instructables web have all the information step by step.
And this is the result: after 6 month of continuous operation, only a 2 minutes delay is noticed.
I will take this prototype to the Festival d’Art Digital i Electrònica (FADE) to be celebrated at la Cellera de Ter from june the 29th until july the 2nd. I strongly recommend visiting it.
After that, I will think how to improve the clock. Any suggestion?