I have been playing with my Arduino boards lately, and I wanted to try out the servo control. I didn't have any spare servos laying around, but I did have a Traxxas Slash R/C truck with a servo mounted in it. I decided to play around with the steering servo, and then I got ideas of how to control it using some of the 1Sheeld capabilities.
I decided that I wanted to use my smartphone to control the truck just by tilting the phone (left/right for steering, forward/back for power). After some time playing around with the code and hardware, I had a rough working setup.
Main components I used (full list is on the Hackster.io project page):
- DIYmall Arduino compatible UNO R3
- 1Sheeld
- Traxxas Slash (2wd)
For the software, I just played around with samples for Servo control and the 1Sheeld orientation sensors until I got a good understanding of how everything operated.
To prepare the Traxxas Slash, I removed the waterproof cover from the receiver and disconnected the two cables (steering servo and electronic speed control). It was very simple, and I can return it back to R/C mode very easily once I am done. I then mounted the breadboard with the breadboard power supply on the Slash chassis, and also put the UNO + 1Sheeld on the breadboard using a rubber band to keep things in place. After that, I just had to connect my setup.
WARNING: For normal servos, you would connect the red cable from the servo to your + voltage however with an Electronic Speed Control the unit typically does not need power (since it is connected to the battery). In fact, on my unit the ESC was providing 6V on the red wire so if you did connect that to your 5V supply bad things could happen.
Close up of breadboard with components |
R/C receiver with one of the servo cables removed |
Shot of the entire setup |
After I confirmed everything was working, I did a quick test inside the house and then took it outside to play around. It was pretty neat being able to just tilt the phone to control the truck.
Here is video of the truck running:
Here is a simple wiring diagram:
Click to enlarge |
Check out the project at Hackster.io to see the code/diagram:
https://www.hackster.io/bigboystoys13/rc-traxxas-slash-with-arduino-and-1sheeld