Author: Brandon Satrom / Source: Make: DIY Projects and Ideas for Makers

Make: Live on Friday March 22, 5pm ET/2pm PT on Youtube or Facebook.
Hacking a toy is a fun way to see how real-world electronics are designed and built, and to tinker freely without ruining expensive gear.
And cheap consumer electronics generally are a fantastic platform for learning and even building new, innovative solutions. So when Make: asked me for a DIY swarmbots project, I knew just where to go.Radio-controlled (R/C) vehicles are a common target for makers, and cars with the Thunder Tumbler name provide an affordable, accessible platform for R/C car hacking. The Tumbler has been hacked a number of times before, but I don’t think it’s ever been used in a mesh network. That is, until now. Using Particle’s new, mesh-ready hardware, I created a swarmbot network of Tumblers that move in synchronized fashion at my every command!
A Lesson About Meshin’
How does mesh networking work? Most connected solutions rely on Wi-Fi or cellular networks for connectivity. This typically means that each device maintains its own connection to the internet. While this is useful for accessing the cloud for data storage or processing, sometimes you just want your gizmos to connect with other devices locally, regardless of whether an internet connection exists.
Mesh networking enables these scenarios by allowing you to create local networks of connected devices. The bulk of the network consists of endpoints that sense or actuate, and repeaters that increase the size and reliability of the mesh by passing messages between devices. In addition, a small number of devices — often just one — serve as gateways to maintain a connection to the internet. Critically, these local networks of devices can still communicate with each other when the internet connection disappears. For jobs like this, the Argon, Boron, and Xenon microcontrollers from Particle all provide built-in mesh-networking capabilities.
For this build, I used the Particle Mesh platform to create a network of R/C cars, each controlled by a Particle Xenon. All of the Xenon R/C cars are endpoints, and are connected to a mesh network with a single Particle Argon as the gateway. Once the network is established, I can use local network messaging to send low-latency commands to all nodes on the network and make my R/C cars dance.
First, however, I needed to hack the off-the-shelf Tumblers to Particle-power them!
1. Hack the Thunder Tumbler
The first step is hacking the R/C car to add a Xenon. Whichever brand or style of R/C car you’re using, the objective is to crack open the car to reveal the PCB inside, determine how the device sends commands to the motors to rotate the wheels, and then connect pins from the Xenon to the corresponding motor driver pins on the car. Because these cars are inexpensive, you should expect to find some variation, even among those with the Thunder Tumbler name on the box.
Write-ups on Tumbler hacking can be found online going back over 9 years. That’s a lifetime in the electronics world, so be sure to test and verify the functionality of your cars as you follow these instructions. Grab your favorite multimeter and measure voltages across various pins on the R/C car’s PCB as you make the wheels spin with the remote control. Make sure to set your car somewhere where the wheels can rotate freely so that it doesn’t get away from you during testing.

Remove the two screws that hold the car body in place, then lift the shell to expose the PCB. You’ll see 8–10 wires that run from the car to the PCB, and a number of through-hole and surface-mount components.

The small surface-mount component on the top is a radio-control receiver chip, the RX-2B. Its pair, the TX-2B transceiver chip, sits in the remote control transmitter. These ICs are commonly used for R/C vehicles, and I was able to find their datasheets to determine which pins map to the forward, backward, left, and right commands from the remote. I also used the datasheet to establish a known ground pin; you’ll need this to determine which pins power the car motors and can be controlled by a Xenon.
This ended up being critical because the main IC on these boards, through-hole mounted on the bottom of the car PCB, is one for which I couldn’t find a datasheet, in spite of many hours of searching. While I’m still not 100% certain of all the features on this chip, it functions primarily as an H-bridge motor controller. Pulsing a signal into a certain pin on the IC results in a pulse out to one of the motor control pins, which makes a wheel spin forward or backward.

By reverse engineering, I found that there are four pins I care about on this unknown IC: one that spins the left wheel forward, one that spins it back; one that spins the right wheel forward, and one that spins it back. I soldered one wire to the top of each of these pins, and one to a ground pin (above). Even though the Xenon and car are powered separately, they need to share a ground for everything to work right.

2. Set up a mesh network
Your mesh will have one gateway (a Particle Argon or Boron) and one Xenon-based node for each R/C car. If you want to program your Xenons over-the-air without having to connect each to a computer, you’ll want to set up your network in advance. You can do this from the Particle mobile app (below), or follow the instructions at particle.io/start.

The post DIY Swarmbots appeared first on FeedBox.