Słomkowski's technical musings

Playing with software, hardware and touching the sky with a paraglider.

Small three-wheel vehicle controlled by IR TV remote controller


An experimental gun, which uses magnetic field generated by the coil to accelerate the projectile.

This article is very old, from around 2006. It was originally published on my old website, flylab.ovh.org, now defunct. It’s unlikely to have much educational value. I’ve republished it mainly for sentimental reasons. Grammar and style were left “as is”.

I’d like to describe another one of my projects which I’ve been making during my school days (year of build — 2006), my first toy-robot. It’s a long time the robot was disassembled and it’s parts were used in other projects. Although construction is quite primitive, I am describing it here, mainly because of sentimental reasons.

General description

My first robot is based on popular three-wheel scheme (two driving wheels, one supporting wheel). The motion is provided by two four-phase stepper motors, taken from old floppy disk drives 5.25”. The chassis was made of steel sheet stripes. The robot does following things:

Mechanical construction

Chassis

My vehicle has three wheels - 2 driving and 1 rolling one. The entire construction’s base is made of steel sheet stripes. The overview schematic of chassis build is shown below.

Robot chassis mechanical schematic.
Robot chassis mechanical schematic.
↑ click to enlarge ↑

There’s a small supporting wheel at the backside of the robot. It has to have as small rotating resistance as possible. I used a small furniture castor, you can find them in any furniture or hobby shop. The motors are bolted to the chassis with 3 mm screws. In the photo below you can see the chassis parts dimensions in millimeters. The driving wheels are mounted directly on the motor’s axis. As I had said, I’ve used two four-phase unipolar stepper motors from the old 5.25” floppy disk drives. You can see this kind of motor in the picture below:

Four-phase unipolar stepper motor from floppy drive 5.25.

The mechanical schematic of the chassis:

Photo of the robot's chassis.

Touch sensors

Touch sensor idea was abandoned after some research. During the tests, it happened to vibrate too much and cause false measurements — the spring, taken from ball pen, was too elastic. Anyway, the touch sensor is still supported by the firmware.

Robot's touch sensor build schematic.

Electronics

Motors driver

The motor’s driver schematic was copied from the Polish electronics magazine EdW (Download article). the whole article and see the schematic. The driver was assembled on 73 x 73 mm PC universal board. The photo is below:

Motor driver board.

Main board

The AVR family microcontroller, ATMega8 to be exact, is the heart of the device. It has 8 kB program memory (ROM) and 512 bytes of RAM. It is enough to perform all the tasks needed. AVR family is well-known for its developer tools availability and especially easy firmware uploading, with ISP (In-System Programming). The microcontroller has got almost all needed subsystems inside. The schematic is below:

Main board schematic.
Main board schematic.
↑ click to enlarge ↑

The photo:

Main board photo with each part described.

The main board has identical dimensions with the motors driver board. As you can see, there are additional elements like microswitches and DIP-8 socket on the board. They were used during the experiments, the present firmware doesn’t support them. They aren’t shown in the schematic as well. All NPN transistors are BC546, PNP — BC516.

Power supply

Three standard 3R12 4.5 V batteries connected in series are used to power the device. The main board power is taken from the motors driver board, where the 5 V stabilizer is localized.

Light sensor and A/D converter

As light sensors two LDRs (Light Dependent Resistors) were used. They decrease their electrical resistance when exposed to light. Connected with 10 kΩ resistors, they made voltage dividers. The voltage from them is measured by the AVR built-in 10-bit analog-digital converter (numbers 0 - 1023). The stronger the light, the higher the result is. It’s important to connect the A/D converter’s power supply pins properly. The VCC pin is connected to the system supply through the simple lowpass filter made of capacitor and choke. The reference voltage was set by the software to the supply voltage. Then, the AREF pin is connected to the +5 V.

DS1621 temperature sensor

DS1621 is an integrated circuit digital thermometer with I²C bus. There’s only one I²C device on the main board, but I added external goldpins, so that it’s possible to connect additional IC’s. The line’s pull-up was made by the microcontroller itself.

RC5 receiver

I used an integrated infrared sensor TSOP1836, with native carrier frequency of 36 kHz — it’s widely used in common television remote controllers. Versions for other carrier frequencies are available too. The receiver’s output is connected to the hardware interrupt pin INT0. The low level on this pin triggers an interrupt.

RS232 interface

The microcontroller has an internal hardware serial communication port (UART). Only a simple two-transistor voltage converter is necessary to communicate with PC by serial port. The cable schematic is shown below.

RS232 serial cable.
RS232 serial cable.
↑ click to enlarge ↑

Microcontroller

The processor peripherals are the RESET button, ISP programmer connector and crystal oscillator. The RESET is active in low state, so a 10 kΩ resistor pull-ups it to the supply voltage. It’s not necessary, but useful with the ISP programmer. Quartz resonator has the operational frequency of 8 MHz, together with capacitors it’s wired in the standard way.

Firmware

The firmware was written in C, developed and tested using the AVR-GCC compiler. The firmware is distributed under the terms of the GNU GPL license. Nowadays, it’s not very useful because it won’t ever compile using modern versions of AVR-GCC.

The remote controller buttons and commands:

Communication via RS232

Commands to send through UART interface:

Compiling and uploading the firmware

To compile and run the firmware source code, AVR-GCC compiler and UISP programmer are needed. To make serial communication work stable, you need to switch the microcontroller clock signal source from internal RC oscillator to the external crystal one. By default, the internal one at 8 MHz is set up. Switching is done by so-called fuses. You have to set CKSEL4..0 in Fuse Low Byte. The best way is to use UISP. Here’s the proper command:

uisp -dprog=dapa --wr_fuse_l=0xef --wr_fuse_h=0xd9 --wr_fuse_e=0xff

You can download the source code here. In the source directory enter command make then make burn to send the compiled program to the microcontroller.