Now the train around your Christmas tree or your favorite remote controlled toy can be controllable from the web or any mobile device. Why would you do that if you already have a remote? You do this just because you can! I used a Red Car Trolley purchased at Disneyland, you can use their trolley, train or even their RF controlled Monorail for this project. The software is set up for the trolley but you can modify it at will. Not only can you remotely control the trolley but the software includes a randomized script that makes the car run routines on its own if your feeling extra lazy or want to simulate some Disney style magic.
Supplies needed (search around, these are random sites I found):
- One Red Car Trolley set from Disney or an online toy store
- I found mine at California Adventure, these are harder to get online
- One Raspberry Pi (I used Model B rev2)
- One SainSmart 8 or 4 channel Relay Module (or other)
- A package of Male to Female and Male to Male solder-less jumper cables
- One Edimax wireless USB dongle (optional)
Step 1: Setup your Rasberry Pi
You will need to install the Apache web server on your Raspberry Pi and get the Edimax wireless adapter working on your Raspberry PI. If you want you can use the built in Ethernet adapter. Those details are out of scope for this project but you can find loads of information on the internet for setting all that up. Click here for a link to setup Apache web server.
Basically you type the following to setup Apache:
sudo apt-get install apache2 -y
You will have to add www-data to the sudoers group.
Add the following to the end of the file:
www-data ALL=(ALL) NOPASSWD: ALL
Now Apache is ready to execute Python and Bash scripts from the web server.
Step 2: Solder leader wires to the remote control
Solder leader wires to the toy’s remote control buttons. I cut the male to female jumper wires and use the female ends so that when I don’t want to use the toy with the Raspberry Pi I can simply leave the wires tucked above the battery and when I do want to use the Raspberry Pi I can plug the male ends of the wires from the relay board into them.
For more detail: Raspberry Pi controlled Red Car Trolley