Legoduino Clock

March 13th, 2012 No comments

I finally got a few days off work and could spend some time on finishing few hobby projects. I really needed it. I solved a problem with XBee modules that’s been bugging my brain for weeks (later post on that). But to the point. I finished my clock project.

The clock I built is based on Arduino Pro board for the brains, Sure Electronics LED matrix displays for … display, XBee series 2 for communication, and Chronodot for timekeeping. I built the enclosure out of black Lego blocks (I love pick-a-brick). It’s been fun and here is the end effect:

20120225-001
And the insides:
20120225-002
The clock is a simple black box without buttons that just displays time as I wanted a no-maintenance clock. The time is set remotely over the Xbee network. At the moment I run a Python script from on my Mac (talking to an Xbee on a Xbee Explorer), but later it will be scheduled to run on my ConnectPort X2 gateway. The script queries NTP server and sets the Chronodot, which in itself does not need many corrections as it’s very accurate and has a battery to keep the time in case of power loss.
The code is in my github repository and it’s using modified xbee-arduino and python-xbee libraries (I will place the modification in my repo soon).
Categories: DIY Tags:

Bigger iPod Mini

March 4th, 2012 2 comments

Going through my things I found my old iPod Mini and read that it’s one of the best in the line of iPods when it comes to audio quality. It is using a Wolfson audio chip, and not the inferior Cirrus used in newer iPods and iPhones (source).

I decided to give the guy a spin and it worked great. However, 4GB is not much for storage nowadays, so I ordered a 16GB compact flash card (CF/16GB-U2 by Kingston). I opened it up (ifixit is your friend), replaced the HD with the CF card and it’s got more space. I also installed Rockbox on it to be able to play more formats like FLAC.

20120303-001
Categories: Audio, DIY Tags:

New Headphone Amplifier

February 26th, 2012 No comments

I finally got my Schiit (pronounced just like you think), Schiit Valhalla headphone amplifier.

20120226-001
 The sound is awesome with my Beyerdynamic DT770 Pro 80 Ohm headphones, but I will be getting DT880 600 Ohm just for this one.
Categories: Audio Tags:

Under cabinet lights with BlinkM MaxM

January 14th, 2012 No comments

The lights in my kitchen are somehow inconvenient. There are two entrances and the light switch is only at one of them, on the outside wall. Whenever I walk in from the living room and want to do something quickly I have to walk around to turn on the light. To solve this, I got an idea to build a under-cabinet light controlled by a motion sensor.

My first idea was to get an LED strip (like this one) and build a controller with ATTiny, PIR sensor, and a transistor to drive the LED’s. But one day I saw a BlinkM MaxM. It can drive RGB LED’s (12V, 2A) and can be programmed with color sequences. It also has 4 inputs so connecting PIR sensor is possible. It is perfect for my kitchen lights, except that it’s RGB. So I got:

I used 20 sections of the LED strip (60 RGB LED’s). Each color draws 1.2A which is below the maximum MaxM can drive. PIR sensor is powered from the MaxM board and the data pin is connected to input number 3.
I programmed BlinkM with an Arduino. Here is the BlinkM script:
// set fade speed
{0, {'f', 2, 0, 0}},
// go to white when movement detected
{0, {'I', 3, 50, 4}},
// loop black
{60, {'n', 0, 0, 0}},
{0, {'j', -1, 0, 0}},
// fade to white and stay on
{60, {'c', 0xff, 0xff, 0xff}},
// 1 minute (7 * 255 * 0.03333ms)
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
// 1 minute
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
// 1 minute
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
// loop black
{60, {'c', 0, 0, 0}},
{0, {'j', -1, 0, 0}},

 

The light fades in when I walk in and fades out after 3 minutes of inactivity in the kitchen. When I keep moving in the kitchen, PIR sensor keeps triggering and the 3 minutes renew, so the light stays on as long as I’m in the kitchen.

001-20120114

There are a few problems with the setup, which I’ll have to address:

  • RGB strip produces a reddish color. To get a warm white I’ll have to experiment with different settings.
  • BlinkM fades are not linear. I might re-write the script in assembly and re-programm the BlinkM.
Update, Jan 27, 2012:
I just changed the power supply from 9V to 12V. The red is gone and I have a bright cool white color, that is much better.
Categories: BlinkM, DIY Tags:

iCufflinks on ATTiny85

December 31st, 2011 No comments

After playing with Arduino for a while I decided to go hardcore and experiment with bare ATTiny microprocessors. I ordered a couple of ATTiny85, ATMega328, and a AVRISP mkII programmer. I started with a simpler ATTiny85, a breadboard, couple of resistors, and power supply. What better project to start with as a blinking LED? But blinking is boring. I wanted pulsating. iCufflinks pulsating.

iCufflinks are cufflinks that pulsate to mimmic Apple laptop’s LED sleeping light pattern made by Adafruit. The design and software are open source. iCufflinks are based on ATTiny10 microprocessor which is way simpler than ATTiny85 I have. So I ported the assembly code and made it work on a breadboard. I never read almost entire data sheet for a microprocessor, but without that I would not be able to make the port. I was surprised to see that the instruction sets of similar microprocessors can be so different.

Blog post on programming ATTiny85 from Yet Another Hacker’s Blog was very helpful on connecting the programmer to the chip.

I also used Atmel AVR Studio 5 running in VMWare Fusion to program the ATTiny.

My fork is in my Github.

 

Why did I do this? BlinkM is running on ATTiny85 :)

Categories: ATTiny, DIY Tags:

Animoto from Utah

September 27th, 2011 No comments

A friend of mine started working for Animoto and I decided to give their service a try. Here is a short slideshow video of some photos I took during my recent business trip to Utah.

More photos on my Photoblog.

 

Create your own video slideshow at animoto.com.

Categories: Photography, Utah Tags:

SaveTV script updates

September 4th, 2011 No comments

I got a code contribution from Andreas Horn a week ago to the save.tv download script. He made some speed and error checking improvements, as well as added a code to use the cut lists. He’s using the script on his QNAP TS-210 NAS-System. Good to know that it’s working on anything other than computers.

Thank you for your contribution Andreas!

I finally got to implementing a change I always wanted to add – timeout for the wget command in save_tv.py and for the mplayer in tv_polonia.py. And I fixed removing save.tv shows from the website after they are downloaded.

The code is already on github.

Categories: Save TV Tags:

Lego 8129 AT-AT Walker™

July 20th, 2011 No comments
20110720-001

The AT-AT is easier to build than the Falcon, but still took two evenings. The build is movable, but somehow fragile. When moving legs I have to hold them tightly to prevent some pieces from becoming detached.

This one will hopefully find a permanent place on my shelf, because it’s not too big :)

Categories: Lego Tags:

The story of atomic radio clock

February 20th, 2011 2 comments

This is a story why I’m not gonna add atomic radio synchronization to my Arduino clock project.

I started working on a clock based on Arduino and Chronodot that would synchronize with the WWVB radio signal and got the prototype working. But, yeah, there is a but.

The WWVB radio station that sends the time signal is in Fort Collins, Colorado. Its signal reaches New York without any problems but the interference in the city introduces errors in the time code sent by the station. Only at night it’s possible to read the time and set the clock.

So here is what I have:

  • Arduino
  • Chronodot (I2C)
  • Two 4-digit 7-segment LED displays
  • MAX7219 LED matrix driver (SPI)
  • CMMR-6P-60 receiver module (digikey: 561-1014-ND)
  • 100mm ferrite antenna (digikey: 561-1001-ND)
  • LCD and SD-card (and Ethernet) shield for debugging

I wrote a library to decode WWVB signal that can be found in my git repository. It’s an initial working copy but does not have any examples yet.

The Chronodot and display part of the clock project were easy. I had the prototype running in no time. Also, connecting CMMR-6 module to Arduino was not a big problem. I will have another post on that – it might jump-start a lot of folks doing the same thing.

The stairs began with getting rid of interference. I could get a signal when I run the clock from a 9V battery, but the battery cannot drive all debugging displays and logging that I have connected for a long time, so naturally I started using a 9V power supply. I quickly noticed that the 5V regulator on the Arduino got too hot; so hot, in fact, that I was unable to touch it, as well as the ethernet port just above it. I switched to iPhone charger that outputs a nice 5V DC on the USB port and I used a USB cable. All worked great without overheating.

Once the power situation has been cleared I left the clock running overnight to collect some data and see it the signal synchronizes the Chronodot. I got nothing over the first night. Well, a bad reception night, bad weather (we had a snow storm in the US at that time). But I got no data for the next few nights. That made me thinking that the reception is bad in New York City. Period. But I noticed that the signal appeared when I was touching the LCD screen. Soon I discovered that the signal was perfect when I was touching the ground wire. That leads me to believe that the switching power supply introduces some kind of interference and prevents the receiver from getting any usable signal.

How do I quickly ground an electronics circuit? I run a wire from the ground to the shield of the cable-TV connection. Signal appeared! I got multiple synchronizations over a single night for the first time after two weeks of prototyping and programming!

In the end I will not proceed with WWVB synchronization just because it’s too difficult to shield from all the interference and properly grounding the project. Additionally, the positioning of the ferrite antenna in relation to the transmitter in Colorado is very important. I don’t want to be forced to place the clock in the room in accordance to the radio transmitter.

My idea of clock synchronization is by employing XBee radios (which I use for lighting project already). The clock will listen for time signal commands and set the clock. The time reference can be sent by a PC from either local clock or by querying an NTP server. I’m also thinking about building a GPS receiver with an XBee radio that will sit at my window and send the time periodically to my PC and the clock. This way the project is more versatile and I get to build more fun devices :)

Update (2011-02-20):
I did some more testing last night and got very little signal. So grounding helped, but I guess there are good and bad reception days.

Categories: Arduino, DIY Tags:

Chronodot library for Arduino

January 16th, 2011 2 comments

I wrote a library to talk to Chronodot real time clock based on DS3231 chip by Maxim. It is also possible to talk to the chip using Time library but it does not fully support the chip’s abilities and replicates the clock internally in Arduino, only updating the time from DS1307.

The library is in my git repository.

At this moment, it has functions to read and set date and time returning both decimal and BCD representation. It also controls SQW pin output. The next step is to implement setting and using both alarms that the chip supports. Take a look at the .h file and included example sketch for more info.

Categories: Arduino, Chronodot Tags: