Robotic Car Tutorials

How to program an bostacle avoidance robot with a Smartphone

How to Program the Ettronics Hightech Obstacle Following Robot

The Ettronics Hightech Robotic Car is an Arduino-based educational robot designed to introduce learners to Arduino programming, sensors, motor control, and autonomous robotics. The same robotic car can be programmed to perform different tasks, including obstacle avoidance, obstacle following, and remote-controlled operation. In our previous tutorial, we programmed the Ettronics Hightech Robotic Car to operate as an obstacle avoidance robot. In that mode, the robot detects an obstacle in front of it and then takes action to avoid it. In this tutorial, we are going to program the same robotic car to operate as an obstacle following robot. This time, instead of avoiding the object in front of it, the robot will use the HC-SR04 ultrasonic sensor to monitor the distance between itself and the object. Depending on that distance, it will either move forward, stop, or reverse. The robot is programmed using an Arduino Nano, an HC-SR04 ultrasonic sensor, and an L9110 motor driver. As with the previous tutorial, the Arduino Nano can be programmed using an Android smartphone and the ArduinoDroid app, so a computer is not required. Watch the Robotic Car Assembly and Wiring Tutorial First Before programming the robotic car, the components need to be properly assembled and connected. If you have not yet assembled your Ettronics Hightech Robotic Car, watch our robotic car assembly and wiring tutorial first. In that video, we demonstrate how to assemble the mechanical parts of the car and connect the Arduino Nano, L9110 motor driver, ultrasonic sensor, motors, and other components. Watch how to Program the Ettronics Hightech Obstacle Following Robot Ettronics Hightech Robotic Car Kit | Full Assembly & Connection Guide After completing the assembly and connections, you can proceed with this programming tutorial. If you are yet to get the Ettronics Hightech Robotic Car, you can click here to purchase it. BUY THE ETTRONICS HIGHTECH ROBOTIC CAR KIT Watch How to Program The Ettronics Hightech Obstacle Following Robot What You Need For this tutorial, you need: Your Android phone should be running Android 8.0 or later. How the Obstacle Following Robot Works The basic idea behind this project is simple. The HC-SR04 ultrasonic sensor measures the distance between the robotic car and the object in front of it. The Arduino Nano then uses that distance to decide what the car should do. There are several distance points programmed into the robot. The main stop limit is: This means that when the object is more than 55 cm away, the robot stops. When an object is detected at 55 cm or less, the robot starts applying the obstacle-following instructions. The programmed following range is: This means: So the robot does not simply chase an object from any distance. If the object is farther than 55 cm, the robot stops and waits for the object to come within its programmed detection range. The behavior can be summarized as: Object farther than 55 cm → STOP Object between 45 and 55 cm → MOVE FORWARD Object between 25 and 45 cm → MOVE FORWARD Object between 15 and 25 cm → STOP briefly, then MOVE FORWARD Object closer than 15 cm → REVERSE, then MOVE FORWARD Arduino Nano and the CH340 USB Interface The controller used in this robotic car is the Arduino Nano based on the ATmega328P. This particular Nano uses the CH340 USB-to-serial interface for communication between the Arduino and the USB port. This is important when programming the board from an Android phone because the phone needs to communicate with the Nano through its USB interface. Connecting the Android Phone to the Arduino Nano The first thing you need is a USB OTG adapter. Connect the components as follows: Android phone → OTG adapter → USB cable → Arduino Nano Once connected, Android may display a message asking whether you want to allow the ArduinoDroid application to access the connected USB device. Allow the connection. If ArduinoDroid does not detect the board immediately, check that: Install ArduinoDroid Install the ArduinoDroid application on your Android phone. The phone used for this tutorial should have Android 8.0 or newer. ArduinoDroid provides an Arduino development environment directly on an Android device, allowing you to write, compile, and upload Arduino programs without using a computer. Once the application is installed, connect the Arduino Nano to your phone through the USB OTG adapter. Arduino Nano Connections The Arduino Nano is connected to the L9110 motor driver through the Arduino-compatible extension board used in the Ettronics Hightech Robotic Car. The motor control connections are: Arduino Nano L9110 Motor Driver D5 A-1A D6 A-1B D9 B-1A D10 B-2B The HC-SR04 ultrasonic sensor is connected as follows: HC-SR04 Arduino Nano VCC 5V GND GND TRIG A4 ECHO A5 The Arduino uses these pins to control the two motors and communicate with the ultrasonic sensor. Setting Up ArduinoDroid After connecting the Nano to your Android phone, open ArduinoDroid. Create a new Arduino sketch and select the appropriate Arduino board. To do so: The Obstacle Following Program The following is the program used for the Ettronics Hightech Obstacle Following Robotic Car. The motor and ultrasonic sensor connections remain the same as in the previous project. The major change is the program logic. Instead of checking for an obstacle and then turning away from it, the Arduino continuously checks the measured distance and decides whether the robot should move forward, stop, or reverse. The robot uses a maximum forward speed of 255. Understanding the Important Parts of the Program You don’t need to understand every line before uploading the program. However, understanding the major sections will help you modify the robot later and develop your own robotic projects. 1. Defining the Motor Directions At the beginning of the program, we define four movement directions and a stop command: These names make the rest of the program easier to understand. Instead of writing complicated motor commands every time we want the robot to move, we can simply write: or: 2. Ultrasonic Sensor Connections The HC-SR04 uses two signal pins.

How to Program the Ettronics Hightech Obstacle Following Robot Read More »

How to program an bostacle avoidance robot with a phone

How to Program the Ettronics Hightech Obstacle Avoidance Robotic Car

The Ettronics Hightech Robotic Car is an Arduino-based educational robot designed to introduce learners to Arduino programming, sensors, motor control, and autonomous robotics. It can be programmed to operate as an obstacle avoidance robot, obsatcle following robot and remote controlled robot. In this tutorial, we will program the robotic car to oprate as an obsatcle avoidance robot using an Android smartphone and the ArduinoDroid app. You do not need a computer to upload the program to the Arduino Nano. The robotic car uses an Arduino Nano ATmega328P with the CH340 USB interface, an L9110 motor driver, and an HC-SR04 ultrasonic sensor. Once programmed, the robot can detect obstacles in front of it, stop, reverse, choose a new direction, and continue navigating autonomously. Watch the Robotic Car Assembly and Wiring Tutorial First Before programming the robotic car, the components need to be properly assembled and connected. If you have not yet assembled your Ettronics Hightech Robotic Car, watch our robotic car assembly and wiring tutorial first. In that video, we demonstrate how to assemble the mechanical parts of the car and connect the Arduino Nano, L9110 motor driver, ultrasonic sensor, motors, and other components. After completing the assembly and connections, you can proceed with this programming tutorial. and if you are yeet to get the Ettronics Hightech Robotic car, you can click here to purchase it now. BUY THE ETTRONICS HIGHTECH ROBOTIC CAR KIT Watch How to Program the Ettronics Hightech Obstacle Avoidance Robot What You Need For this tutorial, you need: Your Android phone should be running Android 8.0 or later. How the Robotic Car Works The basic principle behind the robot is quite simple. The HC-SR04 ultrasonic sensor continuously measures the distance between the car and objects in front of it. When the path is clear, the Arduino commands the motors to move the car forward. When an obstacle is detected within the programmed detection distance, the Arduino: The program also uses filtered ultrasonic readings. This is particularly useful when the car is operated on rough surfaces such as interlocking pavement, where vibration can sometimes cause unstable ultrasonic readings. Arduino Nano and the CH340 USB Interface The controller used in this robotic car is the Arduino Nano based on the ATmega328P. This particular Nano uses the CH340 USB-to-serial interface for communication between the Arduino and the USB port. This is important when programming the board from an Android phone because the phone needs to communicate with the Nano through its USB interface. Connecting the Android Phone to the Arduino Nano The first thing you need is a USB OTG adapter. BUY THE ETTRONICS HIGHTECH ARDUINO KIT Connect the components as follows: Android phone → OTG adapter → USB cable → Arduino Nano Once connected, Android may display a message asking whether you want to allow the ArduinoDroid application to access the connected USB device. Allow the connection. If the ArduinoDroid application does not detect the board immediately, check that: Install ArduinoDroid Install the ArduinoDroid application on your Android phone. The phone used for this tutorial should have Android 8.0 or newer. ArduinoDroid provides an Arduino development environment directly on an Android device, allowing you to write, compile, and upload Arduino programs without using a computer. Once the application is installed, connect the Arduino Nano to your phone through the USB OTG adapter. Arduino Nano Connections The Arduino Nano is connected to the L9110 motor driver through the Arduino-compatible extension board used in the Ettronics Hightech Robotic Car. The motor control connections are: Arduino Nano L9110 Motor Driver D5 A-1A D6 A-1B D9 B-1A D10 B-2B The HC-SR04 ultrasonic sensor is connected as follows: HC-SR04 Arduino Nano VCC 5V GND GND TRIG A4 ECHO A5 The Arduino uses these pins to control the two motors and communicate with the ultrasonic sensor. Setting Up ArduinoDroid After connecting the Nano to your Android phone, open ArduinoDroid. Create a new Arduino sketch and select the appropriate Arduino board. To do so, The Obstacle Avoidance Program The following is the program used for the Ettronics Hightech Obstacle Avoidance Robotic Car. The program has been designed to provide stable operation even when the robot is driven on relatively rough surfaces. Compiling and uploading the code Once the code is uploaded, the car wheels will start moving automatically. At this point, unplug the robotic car from the phone, put the car on the floor and turn on the battery switch, the car will start moving on its own while avoiding obstacles. Please note that the Android App used (ArduinoDroid) is a Freemium App, hence, if you want to remove ads from the app when using it, you can pay to purchase it, however, you can use the free version but with ads and limited use each time the app is opened. Understanding the Important Parts of the Program You don’t need to understand every line before uploading the program. However, understanding the major sections will help you modify the robot later and develop your own robotic projects. 1. Defining the Motor Directions At the beginning of the program, we define four movement directions and a stop command: These names make the rest of the program easier to understand. Instead of writing complicated motor commands every time we want the robot to move, we can simply write: or: 2. Ultrasonic Sensor Connections The HC-SR04 uses two signal pins. The TRIG pin sends the ultrasonic pulse, while the ECHO pin receives the reflected signal. In our robot: Therefore: The sensor is powered from the Arduino’s 5 V and GND connections. 3. Controlling the Motors The L9110 motor driver allows the Arduino to control the direction and speed of the two motors. The connections are: Arduino Nano L9110 D5 A-1A D6 A-1B D9 B-1A D10 B-2B The Arduino uses PWM signals on these pins to control the motor speed. For example: commands both motors to move the robot forward at maximum speed. 4. Starting Slowly and Accelerating We don’t immediately start the robot at maximum speed. The program

How to Program the Ettronics Hightech Obstacle Avoidance Robotic Car Read More »

Scroll to Top