Human Following Robot Using Arduino and Ultrasonic Sensor

Submitted by Gourav Tak on

Working of Human Following Robot Using Arduino

In recent years, robotics has witnessed significant advancements, enabling the creation of intelligent machines that can interact with the environment. One exciting application of robotics is the development of human-following robots. These robots can track and follow a person autonomously, making them useful in various scenarios like assistance in crowded areas, navigation support, or even as companions. In this article, we will explore in detail how to build a human following robot using Arduino and three ultrasonic sensors, complete with circuit diagrams and working code. Also, check all the Arduino-based Robotics projects by following the link.

The working of a human following robot using Arduino code and three ultrasonic sensors is an interesting project. What makes this project particularly interesting is the use of not just one, but three ultrasonic sensors. This adds a new dimension to the experience, as we typically see humans following a robot built with one ultrasonic, two IR, and one servo motor.  This servo motor has no role in the operation and also adds unnecessary complications. So I removed this servo and the IR sensors and used 3 ultrasonic sensors. With ultrasonic sensors, you can measure distance and use that information to navigate and follow a human target. Here’s a general outline of the steps involved in creating such a robot.

 

 

Components Needed for Human Following Robot Using Arduino

  • Arduino UNO board ×1

  • Ultrasonic sensor ×3

  • L298N motor driver ×1

  • Robot chassis

  • BO motors ×2

  • Wheels ×2

  • Li-ion battery 3.7V ×2

  • Battery holder ×1

  • Breadboard

  • Ultrasonic sensor holder ×3

  • Switch and jumper wires

Human Following Robot Using Arduino Circuit Diagram

Here is the schematic diagram of a Human-following robot circuit.

Arduino Human Following Robot Circuit Diagram

This design incorporates three ultrasonic sensors, allowing distance measurements in three directions front, right, and left. These sensors are connected to the Arduino board through their respective digital pins. Additionally, the circuit includes two DC motors for movement, which are connected to an L298N motor driver module. The motor driver module is, in turn, connected to the Arduino board using its corresponding digital pins. To power the entire setup, two 3.7V li-ion cells are employed, which are connected to the motor driver module via a switch.

Overall, this circuit diagram showcases the essential components and connections necessary for the Human-following robot to operate effectively.

arduino human following robot circuit

Circuit Connection:

Arduino and HC-SR04 Ultrasonic Sensor Module:

HC-SR04 Ultrasonic sensor Module

  • Connect the VCC pin of each ultrasonic sensor to the 5V pin on the Arduino board.

  • Connect the GND pin of each ultrasonic sensor to the GND pin on the Arduino board.

  • Connect the trigger pin (TRIG) of each ultrasonic sensor to separate digital pins (2,4, and 6) on the Arduino board.

  • Connect the echo pin (ECHO) of each ultrasonic to separate digital pins (3,5, and 7) on the Arduino board.

Arduino and Motor Driver Module:

  • Connect the digital output pins of the Arduino (digital pins 8, 9, 10, and 11) to the appropriate input pins (IN1, IN2, IN3, and IN4) on the motor driver module.

  • Connect the ENA and ENB pins of the motor driver module to the onboard High state pin with the help of a female header.

  • Connect the OUT1, OUT2, OUT3, and OUT4 pins of the motor driver module to the appropriate terminals of the motors.

  • Connect the VCC (+5V) and GND pins of the motor driver module to the appropriate power (Vin) and ground (GND) connections on the Arduino.

Power Supply:

  • Connect the positive terminal of the power supply to the +12V input of the motor driver module.

  • Connect the negative terminal of the power supply to the GND pin of the motor driver module.

  • Connect the GND pin of the Arduino to the GND pin of the motor driver module.

Human Following Robot Using Arduino Code

Here is a simple 3 Ultrasonic sensor-based Human following robot using Arduino Uno code that you can use for your project.

Ultrsonic Sensors on Robot

This code reads the distances from three ultrasonic sensors (‘frontDistance’, ‘leftDistance’, and ‘rightDistance’). It then compares these distances to determine the sensor with the smallest distance. If the smallest distance is below the threshold, it moves the car accordingly using the appropriate motor control function (‘moveForward()’, ‘turnLeft()’, ‘turnRight()’). If none of the distances are below the threshold, it stops the motor using ‘stop()’.

In this section, we define the pin connections for the ultrasonic sensors and motor control. The S1Trig, S2Trig, and S3Trig, variables represent the trigger pins of the three ultrasonic sensors, while S1Echo, S2Echo, and S3Echo, represent their respective echo pins.

The LEFT_MOTOR_PIN1, LEFT_MOTOR_PIN2, RIGHT_MOTOR_PIN1, and RIGHT_MOTOR_PIN2 variables define the pins for controlling the motors.

The MAX_DISTANCE and MIN_DISTANCE_BACK variables set the thresholds for obstacle detection.

// Ultrasonic sensor pins
#define S1Trig 2
#define S2Trig 4
#define S3Trig 6
#define S1Echo 3
#define S2Echo 5
#define S3Echo 7
// Motor control pins
#define LEFT_MOTOR_PIN1 8
#define LEFT_MOTOR_PIN2 9
#define RIGHT_MOTOR_PIN1 10
#define RIGHT_MOTOR_PIN2 11
// Distance thresholds for obstacle detection
#define MAX_DISTANCE 40
#define MIN_DISTANCE_BACK 5

Make sure to adjust the values of ‘MIN_DISTANCE_BACK’ and ‘MAX_DISTANCE’ according to your specific requirements and the characteristics of your robot.

The suitable values for ‘MIN_DISTANCE_BACK’ and ‘MAX_DISTANCE’ depend on the specific requirements and characteristics of your human-following robot. You will need to consider factors such as the speed of your robot, the response time of the sensors, and the desired safety margin

Here are some general guidelines to help you choose suitable values.

MIN_DISTANCE_BACK’ This value represents the distance at which the car should come to a stop when an obstacle or hand is detected directly in front. It should be set to a distance that allows the car to back safely without colliding with the obstacle or hand. A typical value could be around 5-10 cm.

MAX_DISTANCE’ This value represents the maximum distance at which the car considers the path ahead to be clear and can continue moving forward. It should be set to a distance that provides enough room for the car to move without colliding with any obstacles or hands. If your hand and obstacles are going out of this range, the robot should be stop. A typical value could be around 30-50 cm.

These values are just suggestions, and you may need to adjust them based on the specific characteristics of your robot and the environment in which it operates.

These lines set the motor speed limits. ‘MAX_SPEED’ denotes the upper limit for motor speed, while ‘MIN_SPEED’ is a lower value used for a slight left bias. The speed values are typically within the range of 0 to 255, and can be adjusted to suit our specific requirements.

// Maximum and minimum motor speeds
#define MAX_SPEED 150
#define MIN_SPEED 75

The ‘setup()’ function is called once at the start of the program. In the setup() function, we set the motor control pins (LEFT_MOTOR_PIN1, LEFT_MOTOR_PIN2, RIGHT_MOTOR_PIN1, RIGHT_MOTOR_PIN2) as output pins using ‘pinMode()’ . We also set the trigger pins (S1Trig, S2Trig, S3Trig) of the ultrasonic sensors as output pins and the echo pins (S1Echo, S2Echo, S3Echo) as input pins. Lastly, we initialize the serial communication at a baud rate of 9600 for debugging purposes.

void setup() {
  // Set motor control pins as outputs
  pinMode(LEFT_MOTOR_PIN1, OUTPUT);
  pinMode(LEFT_MOTOR_PIN2, OUTPUT);
  pinMode(RIGHT_MOTOR_PIN1, OUTPUT);
  pinMode(RIGHT_MOTOR_PIN2, OUTPUT);
  //Set the Trig pins as output pins
  pinMode(S1Trig, OUTPUT);
  pinMode(S2Trig, OUTPUT);
  pinMode(S3Trig, OUTPUT);
  //Set the Echo pins as input pins
  pinMode(S1Echo, INPUT);
  pinMode(S2Echo, INPUT);
  pinMode(S3Echo, INPUT);
  // Initialize the serial communication for debugging
  Serial.begin(9600);
}

This block of code consists of three functions (‘sensorOne()’, ‘sensorTwo()’, ‘sensorThree()’) responsible for measuring the distance using ultrasonic sensors.

The ‘sensorOne()’ function measures the distance using the first ultrasonic sensor. It's important to note that the conversion of the pulse duration to distance is based on the assumption that the speed of sound is approximately 343 meters per second. Dividing by 29 and halving the result provides an approximate conversion from microseconds to centimeters.

The ‘sensorTwo()’ and ‘sensorThree()’ functions work similarly, but for the second and third ultrasonic sensors, respectively.

// Function to measure the distance using an ultrasonic sensor
int sensorOne() {
  //pulse output
  digitalWrite(S1Trig, LOW);
  delayMicroseconds(2);
  digitalWrite(S1Trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(S1Trig, LOW);
  long t = pulseIn(S1Echo, HIGH);//Get the pulse
  int cm = t / 29 / 2; //Convert time to the distance
  return cm; // Return the values from the sensor
}
//Get the sensor values
int sensorTwo() {
  //pulse output
  digitalWrite(S2Trig, LOW);
  delayMicroseconds(2);
  digitalWrite(S2Trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(S2Trig, LOW);
  long t = pulseIn(S2Echo, HIGH);//Get the pulse
  int cm = t / 29 / 2; //Convert time to the distance
  return cm; // Return the values from the sensor
}
//Get the sensor values
int sensorThree() {
  //pulse output
  digitalWrite(S3Trig, LOW);
  delayMicroseconds(2);
  digitalWrite(S3Trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(S3Trig, LOW);
  long t = pulseIn(S3Echo, HIGH);//Get the pulse
  int cm = t / 29 / 2; //Convert time to the distance
  return cm; // Return the values from the sensor
}

In this section, the ‘loop()’ function begins by calling the ‘sensorOne()’, ‘sensorTwo()’, and ‘sensorThree()’ functions to measure the distances from the ultrasonic sensors. The distances are then stored in the variables ‘frontDistance’, ‘leftDistance’, and ‘rightDistance’.

Next, the code utilizes the ‘Serial’ object to print the distance values to the serial monitor for debugging and monitoring purposes.

void loop() {
  int frontDistance = sensorOne();
  int leftDistance = sensorTwo();
  int rightDistance = sensorThree();
  Serial.print("Front: ");
  Serial.print(frontDistance);
  Serial.print(" cm, Left: ");
  Serial.print(leftDistance);
  Serial.print(" cm, Right: ");
  Serial.print(rightDistance);
  Serial.println(" cm");

In this section of code condition checks if the front distance is less than a threshold value ‘MIN_DISTANCE_BACK’ that indicates a very low distance. If this condition is true, it means that the front distance is very low, and the robot should move backward to avoid a collision. In this case, the ‘moveBackward()’ function is called.

if (frontDistance < MIN_DISTANCE_BACK) {
    moveBackward();
    Serial.println("backward");

If the previous condition is false, this condition is checked. if the front distance is less than the left distance, less than the right distance, and less than the ‘MAX_DISTANCE’ threshold. If this condition is true, it means that the front distance is the smallest among the three distances, and it is also below the maximum distance threshold. In this case, the ‘moveForward()’ function is called to make the car move forward.

else if (frontDistance < leftDistance && frontDistance < rightDistance && frontDistance < MAX_DISTANCE) {
    moveForward();
    Serial.println("forward");

If the previous condition is false, this condition is checked. It verifies if the left distance is less than the right distance and less than the ‘MAX_DISTANCE’ threshold. This condition indicates that the left distance is the smallest among the three distances, and it is also below the minimum distance threshold. Therefore, the ‘turnLeft()’ function is called to make the car turn left.

else if (leftDistance < rightDistance && leftDistance < MAX_DISTANCE) {
    turnLeft();
    Serial.println("left");

If neither of the previous conditions is met, this condition is checked. It ensures that the right distance is less than the ‘MAX_DISTANCE’ threshold. This condition suggests that the right distance is the smallest among the three distances, and it is below the minimum distance threshold. The ‘turnRight()’ function is called to make the car turn right.

else if (rightDistance < MAX_DISTANCE) {
    turnRight();
    Serial.println("right");

If none of the previous conditions are true, it means that none of the distances satisfy the conditions for movement. Therefore, the ‘stop()’ function is called to stop the car.

 else {
    stop();
    Serial.println("stop");

In summary, the code checks the distances from the three ultrasonic sensors and determines the direction in which the car should move based on the 3 ultrasonic sensors with the smallest distance.

 

Important aspects of this Arduino-powered human-following robot project include:

  • Three-sensor setup for 360-degree human identification
  • Distance measurement and decision-making in real-time
  • Navigation that operates automatically without human assistance
  • Avoiding collisions and maintaining a safe following distance

 

 

Technical Summary and GitHub Repository 

Using three HC-SR04 ultrasonic sensors and an L298N motor driver for precise directional control, this Arduino project shows off the robot's ability to track itself. For simple replication and modification, the full source code, circuit schematics, and assembly guidelines are accessible in our GitHub repository. To download the Arduino code, view comprehensive wiring schematics, and participate in the open-source robotics community, visit our GitHub page.

Code Schematics Download Icon

 

Frequently Asked Questions

⇥ How does an Arduino-powered human-following robot operate?
Three ultrasonic sensors are used by the Arduino-powered human following robot to determine a person's distance and presence. After processing this data, the Arduino manages motors to follow the identified individual while keeping a safe distance.

⇥ Which motor driver is ideal for an Arduino human-following robot?
The most widely used motor driver for Arduino human-following robots is the L298N. Additionally, some builders use the L293D motor driver shield, which connects to the Arduino Uno directly. Both can supply enough current for small robot applications and manage 2-4 DC motors.

⇥ Is it possible to create a human-following robot without soldering?
Yes, you can use motor driver shields that connect straight to an Arduino, breadboards, and jumper wires to construct a human-following robot. For novices and prototyping, this method is ideal.

⇥ What uses do human-following robots have in the real world?
Shopping cart robots in malls, luggage-carrying robots in airports, security patrol robots, elderly care assistance robots, educational demonstration robots, and companion robots that behave like pets are a few examples of applications.

 

Conclusion

This human following robot using Arduino project and three ultrasonic sensors is an exciting and rewarding project that combines programming, electronics, and mechanics. With Arduino’s versatility and the availability of affordable components, creating your own human-following robot is within reach.

Human-following robots have a wide range of applications in various fields, such as retail stores, malls, and hotels, to provide personalized assistance to customers. Human-following robots can be employed in security and surveillance systems to track and monitor individuals in public spaces. They can be used in Entertainment and events, elderly care, guided tours, research and development, education and research, and personal robotics.

They are just a few examples of the applications of human-following robots. As technology advances and robotics continues to evolve, we can expect even more diverse and innovative applications in the future.

Explore Practical Projects Similar To Robots Using Arduino

Explore a range of hands-on robotics projects powered by Arduino, from line-following bots to obstacle-avoiding vehicles. These practical builds help you understand sensor integration, motor control, and real-world automation techniques. Ideal for beginners and hobbyists, these projects bring theory to life through interactive learning.

 Simple Light Following Robot using Arduino UNO

Simple Light Following Robot using Arduino UNO

Today, we are building a simple Arduino-based project: a light-following robot. This project is perfect for beginners, and we'll use LDR sensor modules to detect light and an MX1508 motor driver module for control. By building this simple light following robot you will learn the basics of robotics and how to use a microcontroller like Arduino to read sensor data and control motors.

Line Follower Robot using Arduino UNO: How to Build (Step-by-Step Guide)

Line Follower Robot using Arduino UNO: How to Build (Step-by-Step Guide)

This step-by-step guide will show you how to build a professional-grade line follower robot using Arduino UNO, with complete code explanations and troubleshooting tips. Perfect for beginners and intermediate makers alike, this project combines hardware interfacing, sensor calibration, and motor control fundamentals.

Have any question related to this Article?

GST Council’s 56th Meeting: What the ELCINA Webinar Revealed for the Electronics Industry

Submitted by Abhishek on

The GST is a framework that was specifically introduced to harmonize taxation across India. However, over the years, it has somehow evolved into a complex system that businesses, particularly small and medium-sized ones, struggle to navigate. We are now about to witness one of the most drastic changes GST has seen since its inception as the government attempts to rationalize tax slabs and make compliance less of a burden, while not compromising on revenue generation.

ELCINA, India's oldest electronics industry association, brought in Shashank Shekhar Gupta, Founding Partner at Marg Tax Advisors, as the speaker for its webinar on the 56th meeting of the GST Council. The expert shared his analysis, breaking down GST rate rationalization and the implications that it has on businesses at a granular level. The webinar was moderated by Rajoo Goel, Secretary General at ELCINA, and Sasikumar Gendham, President of the organization, delivered the opening remarks

Sasikumar expressed his appreciation for the council’s progressive efforts under the GST 2.0 reforms. He called attention to India’s ambition of achieving electronics manufacturing worth $500 billion by 2030 and also highlighted how the move promoted digital inclusion and quality of life. A washing machine or TV costing roughly ₹3000 to ₹5000 less is a noticeable difference that can really drive demand through sheer affordability. 

56th GST Council Meeting Overview

The meeting was chaired by Union Finance Minister Nirmala Sitharaman and largely focused on the common man. The council has approved Next-Gen GST reforms to make doing business easy for all citizens, as stated by Prime Minister Narendra Modi in his Independence Day speech. He said, “The government will bring Next-Generation GST reforms, which will bring down the tax burden on the common man. It will be a Diwali gift for you.” Aligning with his aspirations, the council proposed a reform package that put forward a relatively painless two-slab structure. The council reached this proposal through consensus. This change will take effect on September 22, 2025.

 

Expert Analysis: Key Changes and Industry Impact

The GST Council’s proposed changes are set to take effect from September 22, 2025. While these changes are significant, it is important to note that these reforms have not been notified yet. Meaning, they are still subject to official notification by the government. Shashank illustrated the changes using a slide deck presentation, and I have a table below that is reproduced from that.

GST Rate Applicability During the Transition Period (Not Yet Notified)

Goods/Services Supplied Before 22.09.2025

Invoice DatePayment DateGST Rate Applicability
Before 22.09.2025Before 22.09.2025Old Rate
After 22.09.2025After 22.09.2025New Rate
Before 22.09.2025After 22.09.2025Old Rate
After 22.09.2025Before 22.09.2025Old Rate

 

Goods/Services Supplied After 22.09.2025

Invoice DatePayment DateGST Rate Applicability
Before 22.09.2025Before 22.09.2025Old Rate
After 22.09.2025After 22.09.2025New Rate
Before 22.09.2025After 22.09.2025New Rate
After 22.09.2025Before 22.09.2025New Rate

 

Slab Changes

At the time of writing this article, there are primarily four tax slabs in GST: 5%, 12%, 18%, and 28% respectively. Coming September 22nd, this will be simplified to just 5%  and 18%, setting the focus on efficiency and making compliance easy. To speak of the electronics industry, this almost creates an even distribution between 5% and 18% slabs, with 18% taking the edge. The speaker touched on the journey from the complex pre-GST era, when there were numerous taxes, including central excise, service tax, VAT, and entry tax.

Note: A separate 40% rate will apply to luxury and sin goods.

 

Mid-Month Timing Concerns

While Shashank welcomed the reforms, he voiced his concerns about the implementation timelines. He believed that September 22 being the effective date would cause compliance challenges, and ideally, the change should have been planned at the beginning of a month. The current timing creates complications for businesses that are to deal with transactions that span the changeover date. An example would be when a business raises an invoice before the 22nd and receives the payment after. Looking back at the opening, Sasikumar did acknowledge temporary challenges. He said, “I’m sure we'll face a little bit of challenges in the interim period, both before and after. But I think that is just a pass through. It would just be there for few days. But if you really look at the long-term impact, I'm sure this is going to be one of the biggest beneficiaries to our industry.”

 

The Inverted Duty Structure Dilemma

The most contentious issues to come from the reforms will involve the companies that are currently operating under an inverted duty structure. It is when the tax rate on inputs exceeds that on output. A lot of electronics manufacturers have accumulated a good amount of input tax credits under the structure. So the dilemma is whether eventual refunds can still be expected. Transitioning out of the inverted duty bracket due to the new rate structure, Shashank clarified that there would be no refunds in such a scenario based on government FAQs. 

"Industry at large, especially where they were already under inverted duty structure, but are coming out of it going forward, are very displeased because for the past period, they are sitting on an accumulated input tax credit, and they have no clear visibility that whether they will be able to liquidate this input tax credit," he explained. This is a significant challenge for the companies that are affected, as accumulated credits may become stranded without a clear path of recovery except through constitutional remedies like approaching high courts.

 

Credit Protection and Transition Rules

Shashank confirmed that existing input tax credits will stay protected during the transition. "The credit, once availed, remains indefeasible, and that credit would continue with you. You can utilize that credit towards payment of your any outward tax liability," he assured attendees. This protection applies to scenarios where tax rates have been reduced, but some tax remains applicable, as opposed to cases where goods have become entirely exempt.

 

Faster Refunds

We are to see some significant procedural improvements that should benefit the electronics industry. For exports, the government has proposed an implementation of automatic release of 90% of refund claims within set timeframes, provided the exporter has not been classified as high-risk. Similar provisions will also apply to refunds under inverted structured duty for the industries that continue to qualify. Only 10% is to be withheld pending detailed scrutiny.

 

GST Appellate Tribunal

After eight years of delays, the GST Appellate Tribunal is set to become operational. In the same way as industries, the speaker noted that this is something that even GST consultants, practitioners, and lawyers have been eagerly waiting for. The announced timeline includes accepting appeals before the end of September 2025. Hearings should begin before December 2025, and the limitation period for filing appeals is extended to June 30, 2026. This is a development that should significantly reduce litigation uncertainty and offer quicker resolution of tax disputes.

 

Intermediary Services

The government has announced that they are eliminating the “intermediary” category from the GST law. This addresses a long-standing source of litigation dating back to the service tax era. This is a change that will greatly benefit Indian service exporters who were previously denied export benefits due to the complexity of place-of-supply rules.

 

Market Impact and Industry Outlook

As far as the electronics industry is concerned, these reforms fundamentally align with India’s manufacturing ambitions.  Through these changes, increased affordability should support the country’s digital inclusion objectives while potentially boosting domestic manufacturing. One of the stumbling blocks is that some electronic components will continue to attract 18% GST while their finished products will move to lower rates, and this could create a new inverted duty situation.

While broadly welcoming the reforms, ELCINA has urged the GST Council to provide “practical transition support and correction of any anomalies.” The timing concerns highlight the need for better coordination in future policy implementations. As businesses prepare for the September 22 changeover, many are calling for clearer guidelines and more generous transition provisions for all the companies caught between the old and new regimes.

As the electronics industry prepares for this landmark shift in India’s tax landscape, complete focus is set on managing short-term transition challenges while positioning for the long-term benefits of a simplified, more competitive tax structure. The success of these reforms certainly cannot be measured by revenue collection, but by their ability to boost manufacturing, increase exports, and make electronics more affordable for Indian customers.

Have any question related to this Article?

LiteWing-ESP32 Drone gets New Mobile App

Last year we built a drone using ESP32 and our community loved it. Since then the project has evolved and the drone is now called LiteWing - think of LiteWing as a low cost development platform for Drones using which you can not only easily build and fly a mini drone but can also control it using python, add your own sensors or even write the entire drone firmware using Arduino making it perfect for STEAM education and other fields.

Download the Latest Version of LiteWing Mobile App

LiteWing is an open source project based on ESP-Drone project from Espressif and it initially used the same ESP-Drone mobile App to control the drone, but this App only covers the basic flight capabilities and no longer seems to be actively maintained Espressif. So we at CircuitDigest have built a new mobile control drone App for LiteWing. In this article let’s understand what is new in this app and explore its features to understand how it can enhance your LiteWing experience.

Old and New App LiteWing UI

What's New with LiteWing ESP32 Drone App

The LiteWing mobile app supports all basic features to quickly pair and fly your drone, but we have also added few extra features which was not originally available in the ESP-Drone mobile app.

LiteWing ESP32 Drone App

Few key features are mentioned below

Height-Hold:You can enable height hold mode right from your mobile app, this feature was previously limited to cfclient and cflib.
Battery Voltage Monitoring:You can read and monitor battery voltage of your drone right from your mobile app, it also shows warning when battery voltage is low.  
Console Logging:The console box shows any warnings or error that the drone pilot should know about.
 
Emergency Stop:If the drone losses control the emergency stop button can be used to turn off all motors immediately.  
Connection Monitoring:The app constantly monitors the connection with drone and provide audio and visual feedback when connection is lost with drone.
Landing Sequence:Both height hold and normal flight mode has gradual Landing allowing you to land the drones and touch the ground smoothly, implemented using throttle decay
Drift Prevention:The pitch and roll joystick uses a exponential response curve and also provide more fine tuned trim control which helps in calibrating the drone and minimizing drift. 
ID Monitoring:The mobile app shows the ID of the drone to which it is connected to, which is very useful when working with multiple drones in a classroom environment.  
Android & iPhone Support: This latest app is developed using Flutter, meaning it works both on Android and iPhone devices.

And the best part is, this LiteWing Mobile App is based on the same Crazyflie 2.0 protocol so the app not only supports LiteWing Drone, but also other mini drones that works using the crazyflie protocol.

How to Fly LiteWing Drone using LiteWing Mobile App

Flying LiteWing Drones using the LiteWing mobile app is pretty straight forward, but if you are an absolute beginner then this guide will help you get started and along with some tips and debugging techniques.

Before start flying let’s make sure your Drone is ready, if you have built LiteWing by yourself or have purchased it as a DIY kit then check out how to assemble LiteWing Drone, pay attention to the propeller marking and orientation. Also make sure you are using the right battery for Drone and the battery is fully charged.

Power up the Drone

Once your LiteWing drone is ready, power it on and wait for the powering sequence to complete. During this sequence you should notice that each of the four motors spin momentarily for second and after that your green LED blinks every 500ms like shown in the image below. This ensures that all motors are working and the MPU6050 (on board IMU) is calibrated and ready for flight.

Litewing Drone Powering Sequence working demonstration

Connect and Fly

At this point you can use your phone to connect to the drone, open the WiFi settings and look for something like “LiteWing_xxxxxxxxxxxx” the x’s represents the unique MAC ID of your Drone. You can connect to this WiFi network using the password “12345678”. Now you can launch the LiteWing App and use the link button on the top left corner to connect to you drone. If connecting is successful you will notice the blue LED on the drone blinking and your app will also indicate the connection status. You can also see the debug information, the drone MAC ID and the battery status on the mobile app as shown below

LED blink  Link button working demonstration

Now your LiteWing Drone is ready to fly, use the left joystick for throttle and the right joystick to control the pitch and roll of the drone. By default the yaw control will be disabled, after you have learnt the basic control you can enable yaw control using the top left toggle button.

Important: During testing we noticed that few android devices were not able to connect to drone when data was enabled. If you connection keeps disconnecting or if the drone shows no response. Turn on airplane mode and then connect to drone, this will solve the problem.

LiteWing Drone App Drone Flying

Trim Settings for Drift Correction

After take-off if you notice your drone to drift automatically on the pitch and roll axis you can change the trim settings for pitch and roll. Use the Trim and sensitivity settings button on the bottom right, if the drone is drifting towards to left increase the value of Roll Trim, if its drifting towards right decrease the value of Roll Trim. Similarly if the drone is drifting forward, decrease the Pitch Trim value and if the drone is drifting backward increase the Pitch Trim value. 

Drift DirectionAxisTrim Adjustment
Drifting LeftRollIncrease Roll Trim
Drifting RightRollDecrease Roll Trim
Drifting ForwardPitchDecrease Pitch Trim
Drifting BackwardPitchIncrease Pitch Trim

Note: By default LiteWing does not support position hold, so minor drift during flight is expected. Position hold can be achieved by external position hold sensors.

Trim Sensitivity Adjustment Drone App

Apart from normal flight mode, the LiteWing mobile app also supports height hold mode. Meaning you can set a specific height and the drone will automatically take off and maintain that height, after which the pilot can just control the pitch and roll (X and Y) using the right joystick.

Height Hold mode

In order to fly the drone in height hold mode, you should add a height hold sensor to the sensor. The basic version of LiteWing drones does not get shipped with a height hold sensor, you have to purchase the VL53L1 sensor module separately and solder it to the backside of the drone like shown below.

Height Hold Sensor

If you are not sure how to connect this sensor you can check out the tutorial on how to use height hold mode in LiteWing. Once you have the drone ready with height hold sensor added, you can power on the drone and connect to it like we did earlier. But now, instead of using the left joystick to provide throttle you can use the 'height hold button' on the bottom left of your app. Clicking this button will prompt a pop up box enabling you to set the height at which your drone should fly like shown in the image below.

Height Hold Mode App

After selecting your preferred height you can click on 'start'. The debug dialog box will begin count down and after that your drone will take off automatically and maintain the set height. You can use the right joystick to control the drone pitch and roll axis like always but your left joystick will remain inactive. To land the drone just tap the height hold button again and your drone will begin landing slowly.

Other New Features on LiteWing ESP32 Drone App

Apart from basic flight, height hold mode and trim corrections the app supports few more key features like an emergency stop button, battery voltage monitoring, audio feedback for connection status, sensitivity control etc. The below image show few key buttons and their position on the app.

UI Interface Drone App

If you have faced any problem in using the app or if you would like to add any new features please use the comment section below to share your thoughts. We will surely write back to each comment. LiteWing is an active open source community project maintained by circuitdigest, and this app aims to get one step close in making LiteWing the most cost effective educational drones for makers and hobbyists. If you need more info please check our official LiteWing Documentation

Have any question related to this Article?