Posts Tagged Arduino

The Fancy Lantern Stick

I’m not sure about other parts of the world, but back here in Germany we’ve got a tradition called Laternelaufen. It involves lanterns, preferably home-made from cardboard and colored paper, lantern sticks, and a bunch of happily singing children. And of course, it requires a way of lighting the lanterns. Traditionally, this is accomplished by the use of burning candles which are cheap and actually looking great, but will also ever so often result in the lanterns themselves catching fire. So, for many years there have been battery powered lantern sticks featuring a small light bulb on the upper end.

My daughter is very much looking forward to this year’s Laternelaufen events. What a great excuse for myself to get started on a small new project, the Fancy Lantern Stick! Here’s the list of major ingredients:

  • 20cm of PVC tubing 40mm in diameter, normally used for in-house plumbing
  • 50cm aluminum pipe, 6mm in diameter
  • 1 small piece of wooden board, roughly 15mm strong
  • Acrylic spray paint, the colors of your choice
  • Clear lacquer spray
  • 1 Arduino Pro Mini
  • 1 5V Step-up power converter
  • 1 Battery holder for 2 AA sized batteries
  • 8 WS2812B LEDs on separate tiny boards
  • 1 Switch
  • 1 Push-button
  • An assortment of wires, headers and connectors
  • Hot glue

When switched on, the Arduino will produce yellowish-white light from the 8 LEDs and simulate the moderate flickering of a candle flame. The red push-button on the handle triggers special light effects to show off.

The source code for the Arduino sketch is available on Github, and I’ll try to add a couple of photos showing the finished stick once I find the time and manage to borrow it back from my daughter.

Update:

I did manage to take a few photos of the finished stick today and added them to the gallery. Also, if there is enough interest I could supply more detailed information on how to build one of these, of course.

 

,

No Comments

Wireless Sensor Network, Part 2

Still trying to save my batteries

By now it is time for at least an intermediate update on this project. In the meantime I have indeed revised the sensor boards by adding a switching transistor controlled through one of the remaining digital pins on the ATmega. The firmware was modified, and it will now power down the attached sensors before entering sleep mode. Disappointingly, this resulted in a battery lifetime extended by no more than roughly 10%.

On a mostly unrelated note, the voltage graph now looks “stepped” when compared to the previous one. This seemed to be a direct result of switching from maniacbug’s original driver for the RF24 module to the one newly optimized by tmrh20. I’ve got absolutely no clue why this would affect the voltage measurement against the bandgap reference, but there it was. If you can shed some light on this, please leave me a comment.

The next thing I tried, somewhat desperately, was to reduce the number of data samples by increasing the sleep time from 1 minute to 5 minutes. This had no discernible effect on battery life-time. But at least it leads to the conclusion that I need to further investigate power consumption during sleep mode.

So, just assuming that it was the sensors that were draining the batteries in sleep mode turned out to be a bad idea. Now I really need to replace my crappy 7€ multimeter with something a little more precise that will allow me to actually measure which part of the circuit is drawing which amount of current.

, , , ,

No Comments

Wireless Sensor Network, Part 1

With all components finally having arrived from China, I built the first couple of wireless sensors a few months ago. They are using the cheap nRF24L01 transceiver modules for data transmission based on the RF24Network network layer. I’m using a Raspberry Pi with the transceiver module directly connected to its GPIO pins as the root node. The sensor nodes are controlled by an ATmega328 microcrontroller flashed with the Arduino firmware for convenience.

Each sensor node currently features a DHT11 humidity sensor, a DS18B20 digital thermometer, a BMP180 barometric pressures sensor and it’s powered by three AA cells. The controller spends most of its time in power-saving sleep mode, waking up to send a data packet about every minute. Each packet contains the readings from the three sensors as well as the battery voltage as determined against the bandgap reference.

The setup is far from final. For one, I’m still not sure how to store the data. Currently, it is just logged into a text file with an occasional and experimental import into OpenTSDB. I haven’t really come to trust OpenTSDB since I haven’t found a suitable and convincing way to backup the HBase data, yet.  Also, I might still replace the Raspberry Pi root node with an Arduino based MQTT relay.

First though, the power consumption of the sensor nodes needs improving. When I started out I was hoping for each node to run for close to a year on a single set of batteries. As you can see in the graph above, with the current design a set of three NiMH batteries with low self discharge lasts for no more than 6 weeks. What comes to mind in order to improve this, is to switch off the sensors and the transceiver in between samples. That is probably what I’ll try next. Please let me know if you’ve got any other ideas!

 

 

, , , ,

2 Comments

Wifi Enabled RGB Matrix Wall Light, Part 1

Inspired by the so called Lampduino and several other related projects I decided to build my own version of a RGB matrix wall light some time ago. During the last few weeks I finally managed to start out on this project.

Hardware

The matrix of 64 individual cells and the LED back-plane are made from 4mm thin plywood that I spray-painted with a silvery varnish. The outer frame is made from a stronger 14mm birch multiplex board, yielding a very solid construction. I also bought some thin, white PVC board intended as the material for the front cover, but I still have to figure out how to cut that nicely.

Lacking the ambition to create my own LED driver board I settled for the “Rainbowduino”, an Arduino compatible board developed and sold by Seeed Studio. In addition to that, I wanted the matrix to be controlled and programmed over the air. One of the cheapest, easiest, and most versatile ways to accomplish this was to modify an OpenWRT based router for this purpose.

Read the rest of this entry »

, ,

1 Comment

Serial Communication Between an Arduino and the TL-MR3220 Router

Last time, I installed OpenWRT on the TL-MR3220 router and added a connector for it’s serial interface. Today, I wanted to try and connect this interface to an Arduino to make the two communicate. The router’s interface operates at 3.3V while the Arduino’s UART operates at 5V, so we need to convert between those levels. The cheapest way to do this that I could find is described here. It involves using a 74LS04 hex inverter chip to convert the 3.3V signal up to 5V and two resistors for a simple voltage divider to convert the 5V signal down to 3.3V.

Read the rest of this entry »

, , ,

3 Comments

Seeeduino Stalker: Writing to the SD Card

After I managed to upload the first sketches to the Seeeduino Stalker last week, I was eager to try the special features offered by this special kind of Arduino platform. I decided to try writing to an SD card first and followed the example included in the Stalker’s documentation. Which turned out to not work at all.

A couple of hours later and looking for errors in all the wrong places, I finally managed to find out how to use the FileLogger library:

  1. The SD card needs to be FAT16 formatted.
  2. The file that the the Arduino is writing to must exist, the library does not create files.
  3. The file must not be empty, it must contain at least one byte of data.

If these conditions are met, the following tiny sketch will work just fine and append data to the file:

#include "FileLogger.h"

void setup(void)
{
 byte buffer[] = "Hello World!";
 FileLogger::append("data.txt", buffer, 12);
}

void loop(void) {}

Update 10/8/12: Please note that this example will work with version 1.0 of the Stalker, only. For newer versions of the board you should try sadfatlib.

, ,

6 Comments

Connecting to the Seeeduino Stalker

A few weeks ago, Seeed Studio were celebrating their anniversary with a bunch of limited offers. Among other things, I acquired a pair of Seeeduino Stalkers v1.0 with an Atmega 168. Unfortunately, the serial interface on those boards is not labeled. So it took me a while to figure out how to connect the FTDI breakout board. With a small adapter board, programming the Stalkers with the Arduino IDE now works like a charm. (Select board type “Duemilanove w/ 168”.)

,

2 Comments