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?

Lessons from Building a Hardware Startup with Yatin, Nosh Robotics

Submitted by Staff on

Our recent Community Webinar featured Yatin Varachhia, Co-founder & CEO at Nosh Robotics, a company that makes a robot that cooks food. He previously worked as a design engineer at Analog Devices and has co-founded two companies. The session was held on a Sunday, with more than thirty people watching live, and included a question and answer segment.

How AI Is Transforming Electronic Component Procurement | 1Buy.AI's Nitin Jain

Submitted by Staff on

At electronica India 2026, Nitin Jain, co-founder of 1Buy.AI, sat down with Aswinth Raj, editor of CircuitDigest, for an episode of electronica Xchange to discuss the role of artificial intelligence in procurement and its impact on India's supply chain.

CP PLUS on Building an Indigenous Surveillance Stack for India

Submitted by Staff on

CP PLUS, the surveillance brand under Aditya Infotech, traces its origins to 2007. That year, the company decided to enter the surveillance technology space, with a vision of CCTV cameras becoming commonplace across India. What was then considered a luxury item for select businesses has since become, as M.A. Johar, President of Strategic Business at CP PLUS, put it, "a necessity" for hotels, small shops, and large projects alike.

How to Build an IoT-Based Multi-Geofencing System for Smart Tracking

Submitted by Vedhathiri on

We're all familiar with live GPS tracking; it tells us where a vehicle or device is right now. But what if the system could do more than just show the location? That's where geofencing using IoT comes in.  Imagine receiving an instant alert the moment a vehicle leaves home, reaches college, enters the office, or moves into a restricted area. Instead of repeatedly checking a map, the system itself notifies you whenever something important happens. Think about it: if you're tracking a vehicle, do you really want to keep opening the app and checking its location every few minutes? Most of the time, you only care about specific places and important events.
For example, you might want to know when a vehicle reaches college, leaves the office, arrives home, or enters an area that is restricted. Rather than watching the location all day, it would be much easier if the system could automatically inform you whenever these events occur. In this project, we build a complete IoT geofencing system using the GeoLinker GL868_ESP32 board: an ESP32-S3 paired with a SIM868 GSM modem. That's exactly what geofencing helps us do. It allows us to create virtual boundaries around important locations and detect when a device enters or leaves them. By combining geofencing with live GPS tracking, we can build a smarter location-monitoring system that not only tracks a device but also keeps users informed at the right time. Let's dive in and see how to do that. Before that, visit the GeoLinker wikipage to learn about the full spec and get to know the full details of the GeoLinker.

How Multi-Geofencing Using IoT Works

The system begins by powering on the GeoLinker. Then the board will search for the SIM card and connect to the network, and then keep the board outside for a bit. This ensures the board connects to the satellite for the GPS.  Before deploying the code to the board, you should configure multiple geofences by specifying the latitude, longitude, and radius of each zone. In this project, four geofences are created: Home, College, Office, and Restricted Area. Once initialization is complete, the GPS module continuously acquires the current location of the device. The obtained coordinates are then compared with the boundaries of all the configured geofences to determine whether the device is inside or outside each zone.
The system continuously monitors the device's movement and checks for any change in geofence status. When the device enters a geofence area, the system detects the event and generates an alert. Similarly, when the device exits a geofence, another alert is generated. For normal zones such as Home, College, and Office, an SMS notification is sent to the registered mobile number whenever an entry or exit event occurs. These alerts help the user know the movement of the tracked device in real time.
A separate geofence is created for the Restricted Area. Whenever the device enters or exits this zone, the system sends an SMS notification and additionally triggers an automatic phone call. The phone call ensures that critical security-related alerts receive immediate attention and are not missed by the user.
The device periodically uploads its location and signal strength to the CircuitDigest Cloud every 30 seconds, enabling real-time tracking and remote monitoring through the dashboard. This allows the user to view the device's live location and status remotely through the cloud dashboard.

*Note: Not only these, but we also have several example codes like advanced tracking, call triggering, automatic sleep code, etc., which are available in the examples of the Arduino IDE. Spare some time and take a look at those worth exploring if you want to extend this IoT geofencing system project.

Component Requirements for IoT Geofencing System

The components below are the components which are essential ones used to make the geofencing alert system.

S.NoComponents                                               PurposeAlternatives
1.Geolinker BoardGeoLinker GL868_ESP32 is a production-ready, open-source development board that combines an ESP32-S3 and SIM868 GSM modem, used for tracking purposes.        - 
2.IoT / Normal Nano SIM CardAirtel M2M IoT SIM recommended (3 months free data with board purchase). Any 2G-compatible SIM works.Regular 2G SIM
3.3.7V Li-Ion / LiPo BatteryUsed for powering the boardLiPo pouch battery
4.USB-C CableProgramming, testing & charging        -

Hardware Configuration of Geofencing Using IoT

The hardware requirements for this system are minimal. Only the GeoLinker board and a battery are required for operation. The enclosure is optional and is used only for protection and improved appearance. Once the battery is connected to the GeoLinker board, the system automatically powers up and begins the initialisation process.

GeoLinker GL868_ESP32 board hardware setup for IoT geofencing system

Code Explanation for the Multi-Geofencing System Using IoT

The code is written with the required libraries for GeoLinker and GPS. It also contains the sections where the coordinates need to be modified to ensure that geofencing works correctly according to the requirements. Different alerts are triggered based on the location. Additionally, the data is sent to the CircuitDigest Cloud at a specified interval.

#define DEVICE_ID            "YourDeviceID"
#define API_KEY              "YourAPIKey"
#define ALERT_NUMBER         "Yournumber"
#define GPS_TIMEOUT          30000UL
#define GPS_MAX_RETRIES      3
#define GPS_POLL_INTERVAL    5000UL
#define CLOUD_SEND_INTERVAL  30

This section contains all the important configuration settings used throughout the program. It defines the device ID, cloud API key, alert phone number, GPS timeout period, polling interval, and cloud upload interval. Keeping these values in one place makes the system easier to configure and maintain without modifying the main logic.

struct GeofenceZone {
const char *name;
double latitude;
double longitude;
double radiusMeters;
bool restricted;
bool insideNow;
};
GeofenceZone zones[] = {
{ "Home", 12.971600, 77.594600, 150.0, false, false },
{ "College", 12.934500, 77.626000, 200.0, false, false },
{ "Office", 12.958000, 77.650000, 200.0, false, false },
{ "Restricted Area", 11.011158, 77.013307, 200.0, true, false },
};

This section defines all the geofences used in the system. Each geofence contains a name, centre coordinates, radius, and alert type. The radius determines the size of the virtual boundary, while the restricted flag specifies whether the zone should generate only SMS alerts or both SMS and phone call alerts. All geofences are stored in an array, allowing the system to monitor multiple zones simultaneously. You should change the long and lat in the GeofenceZone zones[] section in the code for your requirements.

static bool getValidLocation(GPSData *gps) {
for (int retry = 0; retry < GPS_MAX_RETRIES; retry++) {
uint32_t start = millis();
while (millis() - start < GPS_TIMEOUT) {
GeoLinker.update();
if (GeoLinker.getLocationNow(gps) && gps->valid) {
return true;
}
delay(25);
}
}
return false;
}

This function is responsible for obtaining the current GPS location from the GeoLinker module. The system continuously attempts to acquire a valid GPS fix within a specified timeout period. Multiple retries are performed to improve reliability in areas where satellite signals may be weak. Once a valid location is obtained, the coordinates are passed to the geofencing logic for further processing.

double dist = haversineDistance(
  gps->latitude,
  gps->longitude,
  zones[i].latitude,
  zones[i].longitude);
bool nowInside = zones[i].insideNow ?
               (dist <= exitThresh) :
               (dist <= enterThresh);
if (nowInside != zones[i].insideNow) {
  zones[i].insideNow = nowInside;

This section forms the core of the project. The system calculates the distance between the current GPS location and each geofence using the Haversine distance formula. The calculated distance is then compared with the geofence radius to determine whether the device is inside or outside the zone. Whenever the status changes, the system identifies it as an entry or exit event and prepares the corresponding alert.

static void sendGeofenceAlert(
 const char *zoneName,
 bool entered,
 bool restricted,
 GPSData *gps,
 bool hasLoc) {
buildAlertMessage(msg,
                 sizeof(msg),
                 verb,
                 zoneName,
                 gps,
                 hasLoc);
sendReliableSMS(ALERT_NUMBER, msg);
if (restricted) {
 pendingCall = true;
}
}

This function is responsible for generating notifications whenever a geofence event occurs. A detailed alert message containing the event type and location information is first created and sent via SMS. If the geofence is marked as a restricted area, the system additionally schedules a phone call to the registered number.

*Note: A spoof code is also available in the GitHub repository, so you can go through it and test the system while sitting in one place.

Troubleshooting the GPS Geofence Alert System

The following are the problems that were faced while building the system and the different solutions that were used to overcome them. You can take a look at them and use these solutions if you encounter similar problems. 

Problem                   Cause                               Solution
SMS alerts are not receivedSIM card not registered on the GSM network or insufficient SMS balance Check network registration status and ensure the SIM card has sufficient SMS balance and signal strength.
Phone call alert is not triggered for the Restricted Area Incorrect phone number configuration or call service unavailable Verify the alert phone number in the code and ensure the SIM card supports voice calling. 
No GPS location is obtained Weak GPS signal or indoor operation Move the device outdoors with a clear view of the sky and wait for GPS satellites to lock. 
Continuous false entry/exit alerts GPS drift or geofence radius set too small Increase the geofence radius and ensure GPS accuracy is sufficient for the application 
System resets unexpectedly Insufficient power supply during GSM transmission Use a fully charged 3.7V Li-ion battery capable of supplying peak GSM current requirements 
Device shows incorrect geofence status after restart Previous geofence state not stored correctly Verify NVS memory operation and ensure geofence states are saved properly before power loss.
The call is triggered, but not getting sms or vice versaMaybe your number is not whitelisted.Make sure to whitelist your registered number for the call and sms too.

Output Demo of the GPS Tracking System Using IoT

The live tracking of the GeoLinker board is shown below. The board continuously acquires its current GPS coordinates and transmits the location data to the Circuit Digest Cloud at intervals of 30 seconds.

Live GPS tracking map on CircuitDigest Cloud dashboard for IoT geofencing system

The figure below shows the virtual boundaries (geofences) that have been created for the system. The coordinates corresponding to these geofence areas are defined in the program code that was flashed into the GeoLinker board. These geofences represent specific locations, such as Home, College, Office, and Restricted Areas. Whenever the system enters or exits any of these predefined boundaries, the corresponding alerts are triggered automatically

Virtual geofence boundaries for Home College Office and Restricted Area zones


This screen displays the live tracking information received from the GeoLinker board. It includes important parameters such as the current date and time, latitude, longitude, speed, and battery percentage (when a battery is connected to the system). Additionally, the payload section contains further details transmitted by the device, providing comprehensive information about its status and location.

GeoLinker device location history and telemetry dashboard

The figure below shows the entry and exit alerts generated for the different geofencing areas. Whenever the device enters or exits a predefined geofence, the system automatically sends an SMS notification to the registered user. The alert message includes the type of event (entry or exit), the name of the geofence area, and the live GPS coordinates of the device at that moment.

SMS geofence entry and exit alerts from GPS geofence alert system

Additionally, if the device enters or exits a Restricted Area, the system generates an SMS alert similar to the alerts used for normal geofence zones. However, to ensure that critical notifications are not missed, the system also automatically places a phone call to the registered user. This dual-alert mechanism provides an additional layer of security by immediately drawing the user's attention to important events occurring within restricted zones. As a result, the user is informed through both SMS and voice call notifications whenever the device crosses the boundary of a Restricted Area. We also built an ESP32-based Interactive Voice Response (IVR) System using our GeoLinker board. Take a moment to see how it brings voice interaction and remote connectivity together

Restricted area SMS and phone call alert from IoT geofencing system

 

Live Working Demo of the Multi-Geofencing IoT System

Watch the Multi-Geofencing System in action as it detects and monitors multiple predefined geographic zones in real time using IoT technology. This live demo showcases accurate location tracking, instant geofence event detection, and seamless system performance.

Applications and Limitations of the Multi-Geofencing System Using IoT

The table below summarises the different applications of the proposed system and its limitations. Understanding these applications helps identify potential use cases, while the limitations provide insight into the factors that may affect the system's performance and reliability.  

S.No                           Applications                                             Limitations 
1.Fleet management for logistics and delivery services Requires GPS signal availability for accurate location tracking
2.Monitoring entry and exit of vehicles from homes, offices, and campuses GPS performance may be affected in tunnels, underground areas, or dense urban environments 
3.Personal vehicle safety and anti-theft monitoring SMS and call delivery may be delayed if network connectivity is poor 
4.Real-time location-based notification systems Continuous GPS and GSM operation increases power consumption 
5.Restricted area monitoring and security applications Requires periodic maintenance of the SIM card and data services

Conclusion for the IoT Geofencing System Project

In conclusion, this project shows how GPS tracking can be made more useful by adding geofencing capabilities. Instead of simply displaying the current location of a device, the system is able to recognise important location-based events and notify the user automatically. By creating multiple virtual boundaries and monitoring them continuously,  this multi-geofencing system using IoT can detect when a device enters or exits specific zones and respond immediately. This system demonstrates the effective integration of GPS, GSM, cloud connectivity, and geofencing into a single system. It also highlights how automated alerts can reduce the need for constant manual monitoring. We also did an interesting project on parcel tracking. Feel free to check out our How to Build a Smart Parcel Tracking System Using IoT project.

IoT Geofencing System GitHub

 Download the complete source code, circuit schematics, and project files to build your own IoT-based Multi-Geofencing System.

IoT Geofencing System GitHub RepoIoT Geofencing System Download Zip

Frequently Asked Questions

⇥ How does the system know when a device enters or leaves a zone?
The GPS location of the device is continuously compared with the coordinates and radius of each geofence. When the device crosses the boundary, an entry or exit event is detected.

⇥ Why is geofencing useful?
Geofencing helps users receive automatic notifications based on location events instead of constantly checking the device's location on a map.

⇥ What happens when a geofence is crossed?
The system automatically generates alerts. In this project, SMS notifications are sent for normal zones, while SMS and phone call alerts are generated for restricted areas.

⇥ Why is a phone call used in the restricted area?
A phone call provides immediate attention and reduces the chance of missing an important security-related alert.

⇥ Can multiple geofences be created?
Yes. The system supports multiple geofences such as Home, College, Office, and Restricted Area, and can monitor all of them simultaneously.

⇥ What technology is used to determine the location?
The system uses GPS technology to obtain the real-time location of the device.

⇥ How often is location data uploaded to the cloud?
The device uploads location data to the cloud every 30 seconds under normal operating conditions.

Looking for more Raspberry Pi AI projects? Explore our CircuitDigest Cloud tutorials on Face Detection, Object Detection, and Helmet Detection. Each project includes detailed instructions, source code, hardware setup, and cloud-based AI implementation.

How to Build a Face Detection System Using a Raspberry Pi and CircuitDigest Cloud

How to Build a Face Detection System Using a Raspberry Pi and CircuitDigest Cloud

This project is based on the same concept, in which we have built a Raspberry Pi face detection system without any complex setup. We only need a Raspberry Pi, a USB camera, and an account in CircuitDigest Cloud. 

How to do Object Detection with Raspberry Pi Using CircuitDigest Cloud

How to do Object Detection with Raspberry Pi Using CircuitDigest Cloud

That is exactly what this Raspberry Pi object detection project demonstrates. You can build a fully working object detection system on a Raspberry Pi without collecting a dataset, labelling images, or training any machine learning model. 

How to Build Helmet Detection with Raspberry Pi Using CircuitDigest Cloud

How to Build Helmet Detection with Raspberry Pi Using CircuitDigest Cloud

So, what if there were a compact system that could make this task easier, provide accurate results, and reduce the burden on traffic police? That's exactly what this system does; here we used the Raspberry Pi, a powerful controller that can process data, analyse the images, and give the results instantly.

Have any question related to this Article?

Amphenol's Interconnect Solutions: A Technical Overview of ExaMAX, HD Express, AirMax VS, and XCede

Submitted by Staff on

Modern server and data center design places increasing demands on the physical interconnect layer. At 112 Gbps and beyond, connectors are no longer treated as simple passive components; their design has a direct impact on crosstalk, impedance continuity, and mechanical integrity across the system. The following provides a technical overview of four Amphenol interconnect product families designed for high-speed data center and networking applications.

ExaMAX High-Speed Interconnect System

ExaMAX covers the 25 Gb/s to 56 Gb/s range, making it relevant for current-generation data center and AI infrastructure. Its beam-on-beam contact geometry is notable for two reasons: it avoids pin damage during mating, and it brings mating force down by 65% relative to blade-and-beam designs. The latter has practical consequences in dense backplanes where aggregate insertion force across hundreds of pins becomes a real mechanical concern.

Pitch options are 2 mm for density-constrained layouts and 3 mm where quad routing is preferred. The 3 mm option allows high-speed, low-speed, and power to share the same connector, which reduces PCB complexity and cost. The system spans a wide range of board architectures, including backplane, midplane, orthogonal, cabled, coplanar, and mezzanine, and is qualified against OIF, PCIe, SATA, Fibre Channel, InfiniBand, Ethernet, SAS, IBTA, and IEEE standards.

HD Express Interconnect System

Where ExaMAX is a general-purpose high-speed platform, HD Express is built around a specific target: PCIe Gen 6. The connector is optimized for 85-ohm systems and surrounds each differential pair's mating beams with ground shielding on all four sides. At Gen 6 signal speeds, that level of per-pair isolation is necessary to maintain acceptable crosstalk margins.

The modular single-wafer construction keeps costs manageable while making incremental system scaling straightforward. Press-fit termination is used throughout, which simplifies board assembly in server, storage, and supercomputer designs where soldering at this connector density would introduce process complexity.

AirMax VS Connectors

AirMax VS takes a different approach to isolation. Rather than surrounding differential pairs with metal shielding, it relies on air as the dielectric between adjacent conductors. The absence of metallic shields brings weight and cost down while the design still maintains signal integrity across the 12.5 Gb/s to 25 Gb/s range.

The family covers three generations: VS, VS2, and VSe. The VSe is the current performance tier, supporting 25 Gb/s with an open pin field design. Importantly, VSe is backward compatible with VS and VS2 footprints, so existing PCB layouts can be retained when upgrading. This makes the family practical for telecom, industrial, and storage applications where hardware longevity and multi-generation support are requirements rather than nice-to-haves.

XCede Backplane Connectors

XCede is designed for flexibility across both impedance and scale. It supports 85-ohm and 100-ohm configurations on the same mating interface with backward mate compatibility, and is available in 2, 3, 4, 5, and 6-pair variants supporting up to 82 differential pairs. That range accommodates deployments from small switching hardware up to large wireless infrastructure and external storage systems.

One cost-reduction feature worth noting is the availability of embedded capacitors within the connector body itself, which lowers overall system cost. The design also incorporates integrated power and guidance modules and is built for mechanical longevity in field-deployed hardware.

Availability 

The above families represent four distinct approaches to high-speed interconnect design, each targeting different performance requirements, architectures, and application lifecycles. Detailed specifications, datasheets, and ordering information are available via the Mouser product links below.

Have any question related to this Article?

DIY ESP32 WLED Controller: Step-by-Step Guide

This DIY tutorial is all about making our home lighting smart and fun without any complicated steps. We can connect a standard 12V LED strip to a tiny wi-fi chip and build our own ESP32 WLED controller custom smart lighting system, which can be completely controlled from a smartphone or computer.

This DIY ESP32 based WLED controller guide skips the days of writing complex coding lines to program the light patterns and goes with a ready-made, open-source software called WLED. Once we power on our physical build, the system automatically connects to our home Wi-Fi network; it's a DIY ESP32-WLED Controller Setup. You can also check out similar ESP32 Projects and IoT projects done previously here at Circuit Digest.

Quick answer: An ESP32 WLED controller is a DIY smart lighting driver that pairs an ESP32 microcontroller with the open-source WLED firmware to control addressable RGB (WS281X/CX2811A) LED strips over Wi-Fi,  no coding required, controllable from a phone, browser, or Home Assistant.

  • Build type: ESP32-based WLED controller, no custom firmware coding needed
  • Control method: Wi-Fi (HTTP/JSON API), phone app, or web dashboard
  • LED protocol: WS281X / CX2811A addressable RGB (also supports APA102, WS2801, PWM RGB)
  • Setup time: Under 15 minutes from flashing to first light output
  • Best for: Smart home ambient lighting, retail displays, gaming/desk setups

How Does the ESP32 Based WLED Controller Work?

In this project, we can send commands from a smartphone or the web dashboard of WLED to control the colours in addressable RGB lighting. When a user slides their fingers across the colour wheel, it sends the HTTP or JSON request over local Wi-Fi, which is intercepted by ESP32. Inside the ESP32, these Network packets are decoded and converted to digital data. WLED organises these data sequentially, 24 bits (red – 8 bits, green – 8 bits, blue – 8 bits) for every pixel in the group.

The ESP32 pushes this data out in 3.3V Digital Logic; the internal logical level shifter in the addressable RGB light converts the 3.3V logic to 5V logic. The first 24 bits received are stripped off to control the 3 physical LEDs connected by PWM (Pulse Width Modulation) to control their brightness. It also has a timer feature to turn off the addressable LED after an hour. The successive bits are regenerated and sent to the next chip. Here is the Voice-Controlled Smart Home Assistant project, where we showcased how voice recognition is incorporated with the RGB light.

Components Required for the ESP32 WLED Controller DIY Build

Below is the list of components required to build this ESP32 WLED controller project, with their descriptio

S.no    Components        SpecificationQuantity
1.MicrocontrollerESP32 Dev Kit1
2.Resistor330Ω1
3.Capacitor(100μF-1000μF) Electrolytic1
4.Power Supply12V1
5.Addressable RGB LEDsWS281X / CX2811A1

ESP32 WLED Controller Wiring Diagram and Schematic

The schematic illustrates all the essential connections required to build the ESP32-powered WLED smart LED controller. Follow the wiring carefully to ensure stable power delivery and reliable wireless control of your addressable LED strip.

ESP32 WLED controller wiring diagram and schematic showing GPIO 16 connection to addressable RGB LED strip

The ESP32 WLED controller Schematic setup is quite simple. From GPIO 16(RX2) 330Ω resistor is connected; the other end of the resistor is connected to the DIN of the CX2811A driver addressable RGB LEDs. The 100μF capacitor is placed between GND and +12V, and GND and +12V are given to CX2811A, addressing RGB LEDs. The GND of the ESP32 and the power supply are commonly grounded. You can also check out the Smart WLED Clock with RTC, PIR, Audio feedback and Environmental Monitoring project in CircuitDigest, which integrates addressable RGB LEDs with clock setup.

Step-by-Step ESP32 WLED Controller Setup Guide

The ESP32 WLED Controller setup process, step-by-step configuration, is listed below. This makes an unprogrammed ESP32 a fully automated smart lighting system.

Step 1⇒ Flash the WLED Firmware

Connect the ESP32 to the PC, open the https://install.wled.me/ website, click install, it shows many COM ports, select the CP2102 USB to UART bridge Controller (COM3) and click install. It will be installed. It will display a flash option to erase the ESP32 memory. Click erase, and it will be flashed and programmed for WLED.

Installing WLED firmware on ESP32 using install.wled.me web installer

 Step 2⇒ Configure the Wi-Fi Network

Then the Configure Wi-Fi menu opens, where you give your local Wi-Fi name and password and click Connect. The ESP32 will be connected to the Wi-Fi Network you entered. Double-check the network name and password. If it is not connected.

Assigning home Wi-Fi network credentials to ESP32 WLED controller during setup

Step 3⇒ Access the WLED Web Dashboard

If the Wi-Fi is connected, the menu will open like Device connected to the network and click Visit Device to open the WLED Web Dash.

SP32 WLED controller successfully paired to home network confirmation screen

WLED Web Dash opens and shows menus to customise the RGB light, change Wi-Fi, adjust the Colour palette, set timer options, and sync with your Home Assistant, etc.

LED web dashboard interface for controlling ESP32 based addressable RGB LED strip

Step 4⇒ Open the Configuration Hub

Click the config tab at the top of the screen; it opens a menu from which we can able to change Wi-Fi, change hardware and software parameters, sync, and timer, etc.

WLED configuration hub menu on ESP32 controller dashboard

Step 5⇒ Set the mDNS Address

Click the Wi-Fi and Network tab. From there, we can change the mDNS address to any name you want to access the website, for example, the name it is set to is wledmohammed. From there, we can access our WLED through the name we set previously.

Setting custom mDNS network name for ESP32 WLED controller access

Step 6⇒ Configure LED and Hardware Settings

Click the LED and Hardware setup tab. Here, we need to change the type to WS281X, uncheck the Enable automatic brightness limiter, select the GPIO to 16 and select the number of LEDs you need to turn ON.  These setups can also be done by Mobile Phone using the WLED application. If the strip light has 4 pins (V+, GND, DATA, CLK), choose APA102 or WS2801. If the strip has 5 pins (V+, R, G, B, W), choose PWM RGB. We can also able to choose the number of LEDs to glow.

Setting custom mDNS network name for ESP32 WLED controller access

Output

The Final physical circuit successfully powers the 12V addressable LED strip using the ESP32. When the ESP32 is turned ON, it hosts a WLED Web page. Where we can control the lighting of the strip using a colour Palette disc on a webpage, also by setting a timer function, we can be able to turn it OFF and ON at a preset time.

Completed ESP32 WLED controller DIY build powering addressable RGB LED strip

Live Demo: Smart Wi-Fi LED Controller with ESP32

Experience the real-time performance of the ESP32 WLED controller, showcasing wireless LED control, smooth animations, and smart lighting features.

ESP32 WLED Controller Manual: Troubleshooting Common Issues

              Issue                                                               Fix
How to properly ground the circuit?The GND terminal of the RGB light and the 12V supply ground need to be connected to a common ground.
What power rating does the addressable RGB light need?The CX2811A IC drives 3 Red, 3 Green, and 3 Blue LEDs together. Each LED draws 3.2V, totalling 9.6V; the remaining 2.4V is dropped internally/externally.
Selected colour doesn't match the strip's actual colour?Change the colour order in the dashboard/app — try GBR, BGR, RBG, or BRG. BRG is the correct setting for most CX2811A strips.
ESP32 connects to the app, but the strip won't respond?If using a phone hotspot for Wi-Fi credentials, turn off mobile data while the hotspot is on.

Real World Application:

∗ Smart Home Ambient Lighting: Integrated cove lighting for living rooms, false ceilings, and under-cabinet kitchen lights. 
∗ Commercial Display Branding: Dynamic lighting for storefront windows, product display shelves, and digital signage boards in retail outlets. 
∗ Gaming Setups and Entertainment Zone: Immersive PC desk backlighting, home theatre setups, or studio backgrounds. 

Frequently Asked Questions About ESP32 WLED Controller

⇥ Why are the strip colours not changing?
It will happen due to the missing GPIO connection to the strip, and also make sure the ESP32 GND and Power Supply GND are common-grounded.

⇥ Do we need to connect the GNDBreaker Pin to the Power Jack?
There is no need to connect the GNDBreaker Pin in the Power Jack because it is used only in case of Battery is used.

⇥ Which WLED setting needs to be used for the CX2811A strip?
Set the LED type to WS281X, as it uses the same protocol. The only difference is that you set the colour order to BRG

⇥ Why is the web page not opening?
If the Power is not supplied to the ESP32 will not host the Webpage; you need to be connected to the same network as the ESP32 is connected.

⇥ Why is the WLED Controller not working even after giving all the connections?
Check the arrows of the strip light; it is needed to be pointed away from the ESP32. 

⇥ Are the PIN in Web Page and the physical connection needed to be same?
The pins should match; if it doesn’t match, the data will not be sent to the strip light.

Explore More LED Projects

Discover a collection of DIY LED projects using Arduino, ESP8266, NeoPixel, and WS2811 addressable LED strips. Learn LED interfacing, interactive lighting effects, and IoT-based RGB lighting through practical maker projects.

Interfacing WS2812B Neopixel LED Strip with Arduino

Interfacing WS2812B Neopixel LED Strip with Arduino

So, in this Arduino interfacing tutorial series, we are going to look at how to interface such LEDs with Arduino. We will be interfacing the WS2812B LEDs, which are also known as NeoPixel. 

 How to make an Interactive 2 player Arcade Game using WS2811 LED Strip and Arduino Nano

How to make an Interactive 2-player Arcade Game using WS2811 LED Strip and Arduino Nano

In this blog, we will learn how to create this fun 2-player game made using Arduino. We will learn about the WS2811 LED strip, and then we will learn about the design, electronics, as well as coding of this game.

 ESP8266 and Neopixel LED Strips Based RGB Night Lamp Controlled By Blynk App

ESP8266 and Neopixel LED Strips Based RGB Night Lamp Controlled By Blynk App

So, today we have a great project for you people that is a Wi-Fi-controlled Ironman mask. So, today we have a great project for you people that is a Wi-Fi-controlled Ironman mask. 

Have any question related to this Article?