Introduction: Control a Vehicle With Your Hand
This project was for 'Creative Electronics', a BEng Electronics Engineering 4th year module at the University of Málaga, School of Telecommunications (uma.es/etsi-de-telecomunicacion/)
In this instructable we will see how to create a bracelet to drive a remote control car with our hand using Arduino. We have made the necessary software and the 3D desing of the bracelet. All this can be found in our GitHub repository:
This control can be used in any car controlled by Arduino and DC motors. To try this, we have used a tank design by Tim Clark:
What we need?
- 1 generic Arduino (we used an Arduino UNO board)
- 1 Arduino NANO board
- 1 MPU6050
- HC05 (Master) and HC06 (Slave) Bluetooth devices
- H-Bridge L298N
- 9V battery
- 12V battery
- x2 DC motors for Arduino
- 3D-Printer (we used an Anet A8 with Marlin firmware)
- Soldering iron
- BT_Transmitter.ino (Master) code
- BT_Receiver.ino (Slave) code
- Arduino IDE (version 1.8.8)
- Slic3r for G-Code generator
Step 1: 3D Printing
First of all, we must print all the pieces. The pieces of the bracelet (four in total) can be found in the 3Dmodels directory of our repository. The pieces of the tank can be found here. It is important to notice that we could need to sand some parts, specially the bracelet pieces for the assembling step.
To print the pieces we used an Anet A8 with Marlin firmware. We could use another instead, of course.
Step 2: Tank Assembly
Once all the pieces are printed, we are going to join them. In our case we use hot silicone, but other derivatives can be used.
Before starting the final assembly it is recommended to make a previous assembly without silicone to check the correct connection, friction and fit of the different parts. If any part does not fit as it should or does not slide, it is necessary to sand it so that it adapts perfectly. With all the pieces prepared, the pieces are assembled using silicone in the parts that join them. To join the pieces of the caterpillar, we have used copper filaments between each of them, they are all fixed except one that serves to assemble and disassemble the caterpillar of the tank. We have decided to paint the pieces to give realism to the tank. To do this we have used spray paint.
We obtained all the information from the following link.
Step 3: Bracelet Assembly
The full bracelet has four 3D models.
- MPU_holder: This is the part where the accelerometer sensor is integrated, it must be placed in the hand, with some ties.
- nano_holder: This is the main part of the nano holder, in this part will be set the 9V battery, the bluetooth module and the arduino nano.
- nano_holder_button: This is a button to hold the 9V battery connected with two docks to power the arduino.
- nano_holder_cover: This is the cover of the nano holder part.
Both holders (mpu and nano) can be attached to the arm with some ties.
The only thing to do here is to put the button on its place in the nano holder. Before that, we must stick a small string (we can use the string of an old pen, for example) on the button as it is shown in the picture. Once we are sure that button is in the right place, we have to put some piece behind it to prevent it from movin out of its site. We use a plastic piece and we sticked it with silicone. The final result must be similar to the final picture.
Step 4: Tank Electronics
In this step we connect the Arduino Uno to the H bridge to control the motors and the 12V power supply. The H bridge has a 5V output that we use to power the Arduino Uno board. First of all:
Connect the pin 5 of the Arduino to the pin IN1 of the H Bridge. Connect the pin 6 of the Arduino to the pin IN2 of the H Bridge. Connect the pin 9 of the Arduino to the pin IN3 of the H Bridge. Connect the pin 10 of the Arduino to the pin IN4 of the H Bridge. Connect the left outputs of the H bridge to the left motor and the right ones to the right motor. Connect the pin 2 of the Arduino to the pin TX of the HC-06. Connect the pin 3 of the Arduino to the pin TX of the HC-06.
Note that the all the Arduino pins that are connected to the H bridge are PWM capable.
Finally, connect the power supply to the 12V and GND inputs of the H bridge.
Step 5: Bracelet Electronics
In first place we have to assemble the MPU part. The MPU must be able to be inserted on the holder. To achieve that, female pin strips are placed in the holes as it is shown in the pictures. First of all we need to pass the wires through the hole and solder them to the pin strip. We can use heat shrink tubing in the joints. Then, we can introduce the strips in their holes so that they are fixed. Now we can insert and take out the MPU from its place. In this first part it is convenient to use flexible wires in order to facilitate the movement of the hand.
The bracelet design also allows to insert all the components (Arduino Nano, HC-06 and 9v battery). The procedure is similar to the one described above. We need also to pass the MPU wires to its corresponding hole. At the end, the electric scheme must be the shown in the first picture.
In second place we need to put two strings on the battery hole, so it can be connected to the other parts. We can do this using silicone but, before that, we have to solder the corresponding wires in each string, so that the battery is connected to Vin and GND.
Step 6: Bluetooth Pairing
Once the bluetooth devices are properly connected we are going to establish connection between them (pairing). We need to pair HC-05 and HC-06 modules. To achieve this, we used the next link:
Step 7: Accelerometer
The accelerometer that we use has a multitude of examples and libraries for its use available on the internet.
We have chosen some libraries (available in our repository) that improve the I2C communication protocol that the accelerometer uses, in addition to simplifying the process of data collection in a few functions.
We obtained all the information from the following link:
Step 8: Software
Finally we are going to integrate the software into the transmitter and the receiver. Load the BT_Transmitter.ino and the BT_Receiver.ino into the transmitter and the receiver respectively. To do this we must use Arduino IDE.
The operation of this software is simple: the transmitter get the data from accelerometer and send it to the receiver, that gets the data and move the tank. The data obtained from the accelerometer is always below 100, since we use the value 125 to start a transmision. After sends 125 the transmitters sends the x and y values (in degrees).