Close

2016-08-27 release version

A project log for Remote controlled LEGO DUPLO locomotive

Modifying a LEGO DUPLO locomotive to be able to go forward as well as backward, have some lighting, and be remotely controlled.

simon-fojtuSimon Fojtu 08/27/2016 at 11:270 Comments

After encountering many problems and reducing the specifications considerably, I've arrived at the release version, due to the deadline. But first things first.

I've verified that the motor controller works on the breadboard, as described in the previous post. What was then my surprise, when the PCB version did not work! First I suspected I am switching the pins wrong, but multimeter asserted that the pins are fine, switching the transistors as expected, but only without the load connected. Once I connected the motor, it only buzzed a little and did not move. Only when I turned it with my hand did it start to rotate, but then the transistors got considerably hot. For a long time I was at a loss, not knowing how to debug it. I've even built the circuit again on a protoboard (thinking I got the PCB wrong), where it did not work either. Then I thought maybe the current running through the motor is too high for the transistors. After checking datasheets, calculating the motor current I tried to put a 4.7 ohm (at hand) resistor in series and voila! The motor started turning happily again. It seems the breadboard has some nonnegligible internal resistance in the connection, which is what baffled me for so long.

With the motor problems out of the way, I continued with the remote control. I've found out that none of the IR transmitters and receivers were what I actually wanted. I've found and old IR receiver (TSOP38238), with which I played a little a long time ago, which required a 38kHz modulated IR light source. I've got some TV remotes, but I did not want to go and decode the messages without an oscilloscope or a logic analyzer, so I realized that the simplest message I need to transfer to the receiver is a long and short pulse, the same that are used to control the locomotive with a button. I've made a 555 based astable oscillator with a single button that powered the whole contraption, which would serve as the transmitter. Nevertheless, probably due to button debouncing or lack of thereof, I was not able to control the locomotive with it. So, due to the deadline I was forced to ommit the remote control.

Last part was to fit the control board (attiny85 and h-bridge) inside the locomotive. I've measured the outline of the board and the position of the front axle correctly, so it would fit. But only until I tried to put the top cover over it. The front axle was locked and I wasn't able to properly seat the two parts together. After a little wirebending, PCB cutting and plastic chopping I arrived at a nice fit, closed the locomotive, screwed the screws, checked its functionality and now it awaits to be thoroughly tested by my sons.

So, the goal was not met, but at least some improvement over the stock LEGO machine was made. I'll see how long it lasts and how will the boys like it and who knows, I might get back to it to add the remote control in the future. I've definitely learned many lessons in this small and easy project.

Discussions