LEDs arrived

Today the LEDs I ordered finally arrived. A couple of days ago I stumbled upon a wiring technique called “charlieplexing”, which is explained quite thorough in this article. If my calculations are correct I’m going to need 12 pins on the Arduino to control the LEDs and another one for the DCF module, so I’ll be good with the regular 14 pins.

So, next I’ll start wiring up some LEDs for testing. As long as I don’t have the DCF module some dummy clock function will have to to.

New project: Wordclock

For some time now I was intrigued by wordclocks. Sadly, all clocks I found so far are quite pricy, so I decided to build my own, using an Arduino for the electronics. The clock is going to be a gift, so I’m going to keep these posts private until the gift is given, so all related posts are going to appear at once.

Yesterday I ordered the first parts for the project, an Arduino Mega 2560 along with a set of white LEDs. Originally I wanted to use an Arduino Nano, but while I was doing the concrete planning of the electronics I realized that would mean quite an excessive amount of soldering on my part. The Nano has only 14 digital pins, but for a minimal german word clock I need to control 19 individual lights, I’ll have 21. My first idea to use a logic gate fell short when I calculated the logic gate.

es ist fünf zehn viertel
zwanzig  nach  vor  halb
eins zwei drei vier fünf
sechs sieben  acht  neun
zehn   elf   zwölf   uhr

There are just too many things that can go wrong here, additionally this would be using quite an amount of space. So I’m going for the Arduino Mega, which has 54 digital pins. A little excessive, but way easier to build. I’m going to add an DCF77 radio clock module so I won’t have to bother with the functions to set the time. The module will reduce the available pins on the Arduino further when it’s connected. Integrating it shouldn’t be too hard, a library to access it from an Arduino already exists.

This is how I want to build it: The top is going to be a layer of acrylic glass, with the words being cut out somehow. I’m not sure yet how I’m going to do this, I have a couple of ideas to try. Below that I want to use a layer of diffuse acrylic, to spread the light from the LEDs more evenly. Maybe I can merge these two layes, I’ll have to try it.

Things to figure out: how to separate the LEDs from each other, how to build the case (probably thin PVC). But first things first, I’ll have to wait for the first parts to arrive. Then I’ll start playing with them.

Void

Not much happening here right now, I tried various combinations to get the motors running, but to no avail. I tried motors on M1 + M2, M3 + M4, just to make sure it’s not a bad soldering joint. I tried piggybacking both L293 ICs to allow for a higher current. I tried the motors on M1 + M3, to spread the current of the two motors evenly. The result is always the same, more or less. The motors turn for a couple of seconds, then they stop. The ICs are becoming very hot, adding a heat sink doesn’t really help.

From what I gathered by reading through the adafruit support forum my best guess is that the motors need too much current for the ICs to handle. I can’t confirm this right now because the motors are not marked in any way, so I have no idea about their specifications. I ordered a new multimeter, currently I’m waiting for it to arrive. I hope I can do some helpful measuring when it’s here.

Syntax highlighting for Arduino code [Update]

If anyone wants to post Arduino code with syntax highlighting on a WordPress site, that is quite easy to set up. You need only two things:

The plugin needs to get installed and activated. The language file needs to be placed in $WPROOT/wp-content/plugins/wp-syntax/geshi/geshi. After that the code can be easily marked as preformatted text with
<pre lang="Arduino">
// arduino code
</pre>

Update 15.11.2012

I just noticed that the language file was missing in the GeSHi directory of my installation. I assume that it got deleted when I updated the plugin. Something to keep in mind for future updates.

Current setup

Just to be thorough I thought it would be good to document the current setup I’m working with.

  • one Arduino Duemilanove
  • one Motor shield from adafruit
  • two DC motors
  • one 12V power supply from an old switch
The motor shield is stacked on top of the Arduino. The motors are connected to M1 and M2 on the motor shield. The motor shield draws power from the 12V PSU, for testing purposes it is configured not to share power with the Arduino. The Arduino draws power from the USB cable which connects it to my laptop.

It works … sort of

Okay, piggybacking the IC seems to improve the performance.

I’ve been trying to run this code:

#include <AFMotor.h>
 
AF_DCMotor motorR(1, MOTOR12_1KHZ);
AF_DCMotor motorL(2, MOTOR12_1KHZ);
 
void setup() {
motorR.setSpeed(200);
motorR.run(RELEASE);
 
motorL.setSpeed(200);
motorL.run(RELEASE);
}
 
void loop() {
motorR.setSpeed(200);
motorL.setSpeed(200);
motorR.run(BACKWARD);
motorL.run(BACKWARD);
}

The motors start turning enough to turn the screws as well. After about 5 seconds the screws stop, but I can still hear the motors trying to turn them. Currently I have no idea why they can’t.

The L293 ICs are becoming quite hot, so I grabbed the first heat dispenser I could find in my assortment, it may be oversized but it should suffice.

Heat dispenser for the L293 ICs, a little oversizedThat’s it for today, let’s see what I can do about it over the weekend.

Smartphone controlled boat at TU Delft

Looks like I’m not the first to have that idea.

Since it currently seems to be impossible to embed a YouTube video without it loading tracking scripts the video can only be viewed directly on YouTube.

I couldn’t find more information on that project, but it looks as if they are controlling the boat directly over a bluetooth link. I’m really curious how the range extension via XBee will work out.

Anyway, I’d love to have such a tank for testing … I guess my fishes will mind if I try it in their tank.

First tests for Android remote control

Over the last couple of days I worked on the basics to use my Android powered mobile phone as a remote control for my R/C boat. The first test covers reading the motion sensors of the phone (accelerometer specifically) and visualizing it. The result can be seen in this video:

Since it currently seems to be impossible to embed a YouTube video without it loading tracking scripts the video can only be viewed directly on YouTube.

I plan to steer the boat as one would control a vehicle in a game on the phone.

Some kind soul already mixed up an XBee module and a bluetooth module for Arduino to create a nice little module that can be used to control an Arduino from an Android device.

In other news, I ordered an motor control from Adafruit I want to use to control the motors of the boat. Can’t wait to start playing with it.

New Project: RC boat autopilot

Today I took the first step for a new project that kept returning to my mind for the last couple of days.

I bought a remote controlled boat on eBay. The boat is an Atlantic Yacht by Heng Long which is sold by the retailer as “defective” because it has been returned by a customer. No idea what’s wrong with it, I hope it’s just the control unit I’m going to replace anyway.

Currently I’m planning to equip it with an Arduino based ArduPilot that is modified for marine usage.