I recently built an obstacle-sensing robot using the tutorial here, albeit with a few different parts. When I saw that in action, my 6-year old asked a fairly simple question, as their generation do –
Can I control it with the iPad?
That really got me thinking. I had purchased a 1Sheeld when it first launched on Kickstarter a while back, but never really did anything with it. The idea behind 1Sheeld is awesome – instead of buying different shields for the Arduino, you simply buy the 1Sheeld which interfaces with the your smartphone and makes it’s sensors, radios and IOs available to you on the Arduino.
This post is about this small little project. I have put a video together of the end result, and the instructions follow.
- An Arduino Uno, or equivalent.
- A motor chassis kit. I used this one.
- A stepper motor controller module, like this one
- The usuals – jumper wires (plug – plug and plug – socket), breadboard
Step 1: Assemble the chassis
I won’t detail the assembly of the chassis here. This is fairly straightforward, and for the particular model I used, the instructions were found here. You may want to consult the instructions for your particular model.
Step 2: Connections
- Connect the 1Sheeld first. This just sits on top of your Arduino. A very good tutorial from the makers of 1Sheeld can be found here, and I would strongly recommend reading it or watching that video if this is your first experience with 1Sheeld.
- Connect the stepper motor. I don’t have a Fritzing diagram for this one, but will try my best to explain for the part that I used.
Essentially, connect the 2 wires of each of the motor to the ‘blue’ Motor A and Motor B respectively.
Connect the blue VMS and 5V to the 5V Analog pin on the 1Sheeld, via the breadboard. Similarly, connect the yellow ‘ENA’ and ‘ENB’ pins to the 5V Analog pin on the 1Sheeld, via the breadboard. You’ll need the plug-socket type of jumper leads for this one.
Next, connect blue ‘GND’ to the ‘GND’ analog pin on the 1Sheeld.
Finally, connect the yellow IN1 & IN2 pins to the digital 2 and 3 pins and the IN3 & IN4 pins to digital 7 and 8 pins respectively on the 1Sheeld.
Step 3: The Code
I overlaid the original code from here on top of the sample GamePad file from the 1Sheeld library. The code now looks like this:
Thats it. Verify & Upload. Remember to switch the 1Sheeld button to upload mode before uploading.