« Back to “Remote controlled sphere”

Electronics

The receiver electronics are based on STM32L151 processor and LSM303DLHC magnetometer/accelerometer sensor. To control the motor, there is a simple H-bridge. There is also a quadrature encoder composed of IR led and two phototransistors, to detect the rotation speed of the shell.

Schematic and pcb

The schematic is basic microcontroller stuff, mostly just stuff hooked directly to pins with little external components. There is a nice small H-bridge for motor control. It is implemented using IRF5851 (discontinued, FDC6420 is a reasonable alternative). The motor and servo run directly from li-ion voltage (3.7 ~ 4.2V). For processor and sensor supply, there is S-1167 low-power 3.0 V LDO.

You may have noticed that the LSM303DLHC comes in a QFN package, which is a bit tricky to solder without hot air tool. I ruined the first one, but by tinning both the pads on the chip and the pads on the PCB, I managed to solder them without further trouble. It helps to have a bit longer pads on the footprint so that you can easily heat them.

Hacks

Kludged capacitor pump for RF supply voltage.

There were a couple of things that didn't work right. The RF module is specified for 5V operating voltage, and it barely works at 4V. When the li-ion voltage drops to 3.7V, it started receiving garbage. I hacked together a capacitor pump to generate 5V @ 5mA for it, using a timer pin on the microcontroller to drive it.

Speed sensor

For proper control of the movements, it proved absolutely necessary to have measurements of the shell rotation speed. To achieve this, I painted an encoder track inside the sphere, and added a small PCB with quadrature encoder to track it. The STM32L151 has built-in quadrature encoder inputs, but I didn't have the necessary pins free. Therefore I just used interrupts to implement the same thing.

This quadrature encoder might be useful in some future projects as well. It is a very simple circuit based on BSH105 phototransistor and LM358 dual opamp, configured to act as a schmitt trigger. Nothing special, but it simply works and gives out a clean signal.

Design files

If you find some use for these, here are the Eagle design files: sphererx.sch, sphererx.brd, speedsensor.sch, speedsensor.brd.

– Petteri Aimonen on 28.10.2012

Comment on this page (no comments so far)