Software apps and online services
This project shows us the use of a remote control via RF to control a micro-robot car. To achieve this goal, we divide the project into two parts: the transmitting part and the receiving part. In the transmitting part I use the "Infineon 3D Magnetic Sensor 2Go" board to capture and process the data that this sensor gave me and I use the "Mega 2560" board to send this data by “Radio Frequency”. In the receiving part I use the "Arduino UNO" board to execute the received orders. To make this prototype, I was inspired by my project:
We have to review the technical sheet ofour magnetic sensor. In the following image we can see the components of this board.
In the following image we can see the configuration of the pins of our board.
To program our board, we have to download and install the following software:
- Arduino IDE.
- 3D Magnetic Sensor 2 Go.
- USB Driver from SEGGER.
- Library: TLE493D-W2B6-3DMagnetic-Sensor
- Board: XMC Microcontroller by Infineon
The latest version of Arduino IDE is downloaded from:
3D Magnetic Sensor 2 Go, serves us to test with our device and download it from the official site of Infineon. This program only runs under Windows and has an old USB version of SEGGER. We have to download and install the latest version of SEGGER USB Driver so that our device works correctly.
The library TLE493D-W2B6-3DMagnetic-Sensor is downloaded from the official Infineon site on github. There we will find the instructions to follow for its correct installation.
The XMC Microcontroller board is downloaded from the official Infineon site on github. There we will find the instructions for its correct installation.
In my case, I installed version 1.1.0 since version 1.1.1 indicated an error. Later we added the url of the card and installed it:
The electrical diagram of the “RF Transmitter” is as follows:
The operation of the RF Transmitter is as follows:
We rotate the "Rotation Knob" of our magnetic sensor and we can execute four orders that are programmed by software and using the GPIO4 and GPIO5 pins as outputs:
- Stop: order to stop the car and send the code "00".
- Right: order to turn the car to the right and send the code "01".
- Forward: order to go forward and send the code "10".
- Left: order to turn the car to the left and send the code "11".
Each order has a range of 30 degrees and in the following image you can see this configuration in a visual way.
The "Mega 2560" board receives these four orders from the magnetic sensor, encodes them and sends them through the transmitter "TLP434A", which works at 433 MHz. These encodings are the following:
- Stop: we send the character "S".
- Right: we send the character "R".
- Forward: we send the character "F".
- Left: we send the character "L".
We can use several libraries to validate the data sent by Radio Frequency, in my case I have used the library "VirtualWire.h" and this library works very well. The codes of the boards "Infineon 3D Magnetic Sensor 2Go" and "Mega 2560" can be downloaded at the end of this tutorial.
The electrical diagram of the “RF Receiver” is as follows:
The operation of the RF Receiver is as follows:
The "Arduino UNO" board receives four orders from the RF Transmitter through the receiver "RLP434", which works at 433 MHz. These commands are decoded and executed in the following way:
- Stop: we receive the character "S" and the car stops.
- Right: we receive the character "R" and the car turns to the right.
- Forward: we receive the character "F" and the car moves forward.
- Left: we receive the character "L" and the car moves to the left.
Each time the car moves, we use the "L293B" driver and two reduction motors.
We can use several libraries to validate the data sent by Radio Frequency, in my case I have used the library "VirtualWire.h" and this library worksvery well. The code of the "Arduino UNO" board can be downloaded at the end of this tutorial.
In the following images we can see several tests done with this prototype.
In the following video you can see the whole process of development and operation of this project.
Here we can see that, I first tested the prototype with the devices connected to my PC to verify that the communication was being made and that the "RF Receiver" received the data that the"RF Transmitter" was sending. The serial port of the Arduino UNO board shows us this data that I was waiting for. In the second test I used a prototype of a "Microrobot Car" to demonstrate an application of this prototype.
The main goal was met. Using the "Infineon 3D Magnetic Sensor 2Go" board in a remote control is a good option to control a "Micro Robot Car", since it gives you the opportunity to maneuver your cart in a practical and efficient way. An important observation is the following one: When our remote control prototype has been blocked or stunned, it is convenient to reinitialize it from the beginning or to give it a "reset" and in this way it will continue working correctly.