They have done it again: the students of the electronics course of the ITS Fondazione Biotecnologie of Bergamo (Flavia Calabrese, Davide Conzon, Guglielmo Ferrari and Artica Giussani, in strict alphabetical order) have created, as an end-of-course project, a web-controlled radio-command system for a scale car, entirely based on the new Arduino UNO R4.
Let's leave the word to them.
Description of the projectThe objective of the experience is to create a machine controlled via smartphone using the Arduino IoT and Cloud software. To allow the sending and receiving of commands, the new version of Arduino UNO R4 was used, which incorporates several sensors and a Wi-Fi transmission system into a single board.
RealizationThe project was divided into different modules: electronic design, software design, space design and 3D printing, budget and marketing, orders and warehouse, assembly, testing, QA. The team created a Gantt of the jobs to try to parallelize the activities as much as possible and reduce production times and costs.
The battery power cables (7.4V and GND) were connected to an H bridge (L298N); the following ports were used: enA (PWM port pin 10) which controls the rotation speed of the motor, in1 (pin 9) which allows clockwise rotation, in2 (pin 8) which allows anti-clockwise rotation.
The 5V output of the H bridge is connected to the Vin port of the Arduino for its power supply. L298N is placed on the back of the car.
The DC motor is connected to the OUT1 and OUT2 ports of the H Bridge.
At the front, a high-speed stepper motor (DM996) is mounted, which precisely and quickly controls the steering movement of the car. The operating voltage is 6V.
The headlight support was made through a 3D printing process; four yellow LEDs soldered in parallel are mounted on it (pin 2) which are in turn connected to a photoresistor in the analogue port A0. Thus it is possible to detect the change in state of the photoresistor: when it recognizes a certain level of lighting (see datasheet) the headlight LEDs are turned on. Furthermore, 9 red LEDs connected in parallel have been added on the back of the frame, which light up when the machine proceeds in reverse. Finally, the last implementation was to position two green LEDs (pins 3, 4) placed on the sides of the bodywork in order to simulate the directional signs. The green LEDs will light on when the car turns left or right. The servo-motor is controlled via software to always return to the center position.
The commands for starting, stopping and turning left and right are set via smartphone, connected to the Arduino cloud, which receives, interrupts and retransmits them in "quasi-real" time. The signal transmission delays formed an integral part of the source code: appropriate weights were defined to prevent the car from turning too much or too quickly, and to implement an engine brake in the event of a stop. In any case, the car must be driven with an eye on the future position of the vehicle... a bit like real racing cars!
Source codeThe code relating to the project has been released to the public domain and is present on Github.
There are also tables and graphs used for the calibration and optimization of the controls.
Problems encountered and solutions adoptedThe initial idea was to drive the machine via IR remote control, which was later abandoned due to a conflict with another component. In fact, the IR sensor picked up the signals emanating from the proximity sensor, which would have stopped the engine in case of proximity to obstacles.
The proximity sensor was removed because, having too wide a detection range, it would have interrupted the motion of the motors at any obstacle present not only frontally but also laterally, preventing the car from starting.
Another difficulty encountered concerns the development of the Servo: the 5V output of the Arduino did not provide sufficient current to power it, to solve the problem the power supply was therefore connected to the Vcc and Gnd pins of the H bridge thus providing 7.4V.
Equally problematic was the DC motor which suddenly stopped working. Not sure of the reason, the entire rear part of the car dismantled until they discovered it. This made it possible to understand that the problem lay in the engine cables which, due to wear, had become detached. A complete cable replacement and re-welding was carried out, the engine started working properly again and the machine was reassembled.
A team of 4 young people fresh from a computer course, 50% of whom had no previous knowledge of electronics, developed a project of medium-high complexity from scratch: just think of the management of the servo-controls in parallel, the calculation of the delay of commands sent via smartphone.
The objective of the project was concluded successfully, managing to implement all the expected functions.
The following documentation was also collected:
Comments