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?

Top 80+ Final Year ECE/EEE Project Ideas You Can Build in 2026

Final-year projects are an excellent opportunity for Electronics and Communication Engineering (ECE) students to apply their theoretical knowledge to practical, real-world engineering problems. Choosing a final-year project can be challenging for ECE students. It is not just about selecting an interesting topic; the project should also allow you to apply what you have learned in electronics.

To help students and aspiring engineers develop hands-on skills, Circuit Digest provides a wide range of practical ECE/EEE Final-year project ideas with free GitHub source code and step-by-step guides. Established in 2015, Circuit Digest has grown into a strong community of engineers, electronics enthusiasts, and makers. The platform serves as a one-stop resource for students, hobbyists, and professionals looking to explore electronics projects, understand circuit design concepts, and build working prototypes.

Our projects cover a wide range of areas, including embedded systems, IoT, power electronics, analog and digital electronics, electric vehicles, and automation. With experience working across these domains, our team focuses on projects that are not only suitable for learning but also connected to practical engineering applications.

Here are the ECE Project Ideas That Go Beyond the Basics 

Many students choose familiar project topics because they’re easy to build and explain. But if you want your project to stand out, it helps to bring different skills together: sensors, embedded programming, communication, automation, and even AI. The projects in this list go beyond basic LED and buzzer circuits and explore ideas closer to real-world applications. Whether you want to make a strong impression during your project evaluation or build something you’re genuinely interested in, this collection has plenty of ideas to explore. Each project can also be a starting point for experimentation, allowing you to improve the design and add your own ideas to make the project your own.

AI Waste Sorting Robot

AI Waste Sorting Robot

This project aims to develop an intelligent robot that can automatically collect and sort waste using artificial intelligence and camera-based sensing. The robot uses the Adafruit Memento Camera, powered by the ESP32-S3 microcontroller, as the main vision and processing unit. 

Smart Helmet Using Arduino

Smart Helmet Using Arduino

In this project, we’re making an ordinary two-wheeler helmet smart using an RF Transmitter & Receiver. This Arduino-based smart helmet is simple to build and does not require advanced engineering knowledge or complex components.

IoT-based Weather Monitoring System

IoT-based Weather Monitoring System

This DIY IoT Weather Station project only requires a few environmental sensors and the versatile Arduino UNO R4 WiFi board. You can create a dynamic weather dashboard web page that displays all your environmental data in real-time without relying on third-party cloud services.

Blind Stick using Arduino Nano

Blind Stick using Arduino Nano

This DIY Blind Stick is an innovative yet simple solution that is designed to help users detect obstacles in their path. Using an Arduino Nano, ultrasonic sensor, and buzzer, it can sense objects in their way and provide an instant audible alert to them.

Maze Solving Robot

Maze Solving Robot 

This step-by-step guide will show you how to build your own maze-solving robot using Arduino UNO, three IR sensors, and basic components that you can easily find in your local electronics shop. It can intelligently navigate through complex mazes, making decisions at every turn. 

Smart Toll Tax System

Smart Toll Tax System

In the Smart Toll Tax System using RFID and Arduino, we aim to create a contactless, automated toll collection system using RFID technology. Toll booths often cause delays, especially during peak hours, and manual toll collection can result in human errors. 

Smart Home Energy Management

Smart Home Energy Management 

Smart Home Energy Management serves as the brain and central hub of this sophisticated energy management solution. This real-time data monitoring is essential for automating the inverter operation, ensuring that the home remains powered during outages without manual intervention.

Rugged Outdoor Fitness Tracker

Rugged Outdoor Fitness Tracker

This project aims to empower users to lead a healthier and safer lifestyle. The SHT21 sensor and OLED display use an I2C bus, the GPS sensor uses UART, and the accelerometer sensors use analog pins.

Drying Monitoring System for Coffee Beans

 Drying Monitoring System for Coffee Beans

This technology allows drying at lower temperatures and maintains the quality of the coffee beans. Heat pump drying is an efficient and environmentally friendly method because it reuses the heat generated to speed up drying.

Field Survey Rover

Field Survey Rover

FarmSight Field Survey Rover is a versatile, field-ready rover developed for field data collection and monitoring in agricultural environments. It is equipped with multi-sensor arrays, GUI-based remote control, and a servo arm with detachable attachments, making it adaptable to a wide range of tasks beyond basic surveying.

Smart Car Washing System

Smart Car Washing System

The Smart Car Washing System is an innovative project that combines cutting-edge AI technology and automation to revolutionise the traditional car washing process. This system ensures operational safety by identifying human presence, reducing the risk of accidents.

Raspberry Pi Internet Radio and Streaming Station

Raspberry Pi Internet Radio and Streaming Station

In this tutorial, we are going to set up a Raspberry Pi streaming station using DarkIce and Icecast. DarkIce and Icecast are two Raspberry Pi packages used for audio recording, encoding, and streaming.

Low-Cost Interactive Voice Response

Low-Cost Interactive Voice Response

To build an IVR system using Raspberry Pi, one has to make phone calls and send messages using Raspberry Pi, and when the receiver picks up the call, it should play a pre-recorded audio and get DTMF inputs as feedback.

Automatic Toll Gate System Using Arduino

Autonomous UV Robot with SLAM

This tutorial can be followed by anyone who is new to ROS; all the instructions are mentioned so that you too can build an autonomous UV bot. UV-C in many parts of the globe to fight COVID-19. 

Automatic Library Book Management System

Automatic Library Book Management System

Through this project, students can easily Issue/Return books; they just have to wave their hand on the right/left side(IR sensors) of the project and place their book and library ID card, then the book will be issued/Return. 

Biometric Attendance with Temperature Recorder

Biometric Attendance with Temperature Recorder

The “automatic toll gate system project” shows how simple sensors and a microcontroller can automate a real-life process like toll collection, making it an ideal project for anyone just starting in electronics. 

RFID-Based Door Lock System

RFID-Based Door Lock System

This attendance register records the temperature of a registered user and dispenses sanitiser. This project abides by the current social distancing policies enforced by our government. The machine identifies a registered user via face recognition, measures temperature, and then dispenses sanitiser.

Getting Started with Sony Spresense Devkit

Getting Started with Sony Spresense Devkit

Sony has a solution for these problems, and it comes in the form of Sony’s Spresense development kit, which, according to me, is by far one of the most lucrative, versatile, and easy-to-use. These functions themselves make the devkit way more unique than any other microcontroller.

AI-Powered Auto Billing System

AI-Powered Auto Billing System

AutoBill is an AI-powered checkout system for retail stores that combines the power of computer vision and machine learning to provide an amazing shopping experience. AutoBill visually detect and instantly identifies the items placed, and the weight sensor measures the items placed on the countertop.

Tomato Sorting Machine using Edge Impulse

Tomato Sorting Machine using Edge Impulse

This Raspberry Pi-based Tomato Sorting system uses TensorFlow models that are trained using Edge Impulse to detect the tomatoes and sort them according to the colour. To know more about Raspberry Pi, you should check out our previously built Raspberry Pi projects. 

CovAID Electronic Door System

CovAID Electronic Door System

The CovAid is an electronic door lock for those who do not wear masks or are suffering from fever. This project is made using Raspberry Pi.  So, before entering, the CovAid door will check the body temperature and mask of people through infrared and object detection, respectively.

Wall Climbing Beetle Robot

Wall Climbing Beetle Robot

In this ESP32 wall-climbing robot project, we challenge ourselves to build a much smaller version. The goal is to create a lightweight wall-climbing robot that is small enough to fit in the palm of your hand while still generating sufficient suction to climb walls and crawl across ceilings.

AI-Based No Parking Alert System

AI-Based No Parking Alert System

In this project, we are going to build an AI-Based No Parking Alert System using ESP32-CAM, in which, if someone parks their vehicle in front of the gate, the ESP32-CAM recognizes it and sends an alert to our WhatsApp and also powers on a buzzer and indicator LED onboard as well.

Indian Currency Recognition

Indian Currency Recognition

We have developed a smart Indian currency recognition system using ESP32-CAM. The system captures the image of the Indian currency note, identifies the denomination within seconds using cloud processing, and announces the result through a speaker, helping visually impaired people handle money more confidently and independently.

Object Detection With ESP32-Cam

Object Detection With ESP32-Cam

This tutorial shows you how to build a real-time object detection system using the ESP32-CAM module and the CircuitDigest Cloud Object Detection API. The system captures an image on button press, sends it to the cloud via a wireless or internet connection, and retrieves the identified objects with their names.

AI-Based No Parking Alert System

AI-Based No Parking Alert System

In this project, we are going to build an AI-Based No Parking Alert System using ESP32-CAM, in which, if someone parks their vehicle in front of the gate, the ESP32-CAM recognizes it and sends an alert to our WhatsApp and also powers on a buzzer and indicator LED onboard as well.

Parcel Tracking System Using IoT

Parcel Tracking System Using IoT

In this project, we built a smart parcel tracking system using the GeoLinker board that continuously tracks the parcel's location, detects shocks and vibrations using an onboard accelerometer, uploads real-time data to the cloud, and instantly notifies the owner through SMS whenever a severe impact is detected.

ESP32 Offline Voice Recognition

ESP32 Offline Voice Recognition

We’ll build a mini yet expandable ESP32 voice assistant using Edge Impulse, with the ESP32 as the main microcontroller. ESP32 offline voice recognition systems often use a mix of edge and cloud computing, with some processing done directly on the device and the rest handled in the cloud.

ESP32 Thermal Printer

ESP32 Thermal Printer

This comprehensive ESP32 thermal printer tutorial covers how to interface popular thermal printers, such as the PNP-500, with ESP32 and Arduino microcontrollers. Whether you're building an ESP32 receipt printer, barcode printer, or QR code printing system, this guide provides complete circuit diagrams, Arduino code, and step-by-step instructions for your microcontroller projects.

UWB Indoor Positioning System

UWB Indoor Positioning System

This guide shows you how to build a complete UWB indoor positioning system using the Qorvo DWM3000 UWB module with ESP32, capable of tracking devices with 10cm precision for UWB asset tracking and real-time location applications. That's fine for identifying buildings, but inadequate for precise UWB indoor localisation or UWB location tracking.

Capacitive Touch Sensor

Capacitive Touch Sensor

In this project, we are building a Touch sensor for the ESP32, but the same can be used for Arduino as well. Also, we previously used touch-based input methods using capacitive touch pads with different microcontrollers, such as Touch Keypad Interfacing with ATmega32 Microcontroller and Capacitive TouchPad with Raspberry Pi.

Pick and Place Robotic Arm Car

Pick and Place Robotic Arm Car

This tutorial will serve as an illuminating guide on how to create an Arduino-powered Robotic Arm, replete with wireless control and programmability facilitated through a custom-built Android application. Within the application's interface, individual servos or axes of the robot arm can be manually manoeuvred using dedicated buttons.

Smart Robot Pet

Smart Robot Pet

A smart, cute, friendly, intelligent robot pet. Desk companion, helps you in almost everything - reminding you of medication, understanding behaviour and emotion, helping with loneliness and anxiety, etc. Fully remotely controllable, with a sense of environment with Camera and AI model as brain for making decisions.

Sentio- Companion Robot

Sentio- Companion Robot

Sentio is a project that reimagines the smart home assistant as an interactive digital pet rather than a lifeless tool. While most smart speakers look boring and static, Sentio is an emotive, privacy-focused robot that loves pets and interactions. This combines the engagement of a companion robot with the features of a secure, offline home automation hub.

Temperature Sensitive Fan Regulator

Temperature Sensitive Fan Regulator

We often feel uncomfortable while sleeping due to certain changes in room temperature, but we don’t want to get up from sleep and regulate the fan/AC due to lethargy. This hampers our sleep and may have a negative effect on our health. We will use the Arduino IDE to program the ESP32.

Smart Auto - Assist Home Safety System

Smart Auto-Assist Home Safety System

Smart Auto-Assist Home Safety System that simulates a real smart home using an ESP32 and an ESP32-S3-BOX3. The system automatically controls lighting and appliances based on ambient light and human motion, continuously monitors electrical energy usage, detects abnormal current faults, and predicts electricity consumption and billing using lightweight on-device analytics.

Gesture Controlled Robot

Gesture Controlled Robot

Let's build a cool hand gesture-controlled robot that'll amaze your friends and family—it's like magic! This step-by-step guide helps you build a hand gesture-controlled robot using simple components like Arduino, MPU6050 Accelerometer, nRF24L01 Transmitter-Receiver Pair, and L293D motor driver module.

Mars Rover Robot

Mars Rover Robot

In this project, we will delve into the exciting world of robotics and demonstrate how to build an Arduino-based Mars rover capable of traversing various terrains. So, fasten your seatbelt as we embark on this thrilling journey of constructing our very own Mars rover. In this article, our focus is on creating an Arduino Bluetooth-controlled Mars rover

Arduino Bluetooth Car

Arduino Bluetooth Car

This robot car can be controlled wirelessly with Bluetooth and an Android app, and other than that, we have placed RGB NeoPixel LEDs on the front, back, and bottom of the robot to make it look cool. We also build a custom Android app with the MIT App Inventor that can send commands directly via Bluetooth and control the robot's movements and also control the LEDs on the robot.

Quadruped Spider Robot

Quadruped Spider Robot

One such remarkable creation is the spider robot. It is also known as a quadruped robot due to its four legs. This innovative robotic project aims to emulate the locomotion and behaviour of spiders. Learn more using our previously built robotic projects.

How to Choose the Right Final-Year ECE Project

A successful electronics and communication final year project should demonstrate more than just a working circuit. Strong ECE final year major projects tend to combine a clear problem statement with a design that can be explained and defended confidently. The project should cover the overall system architecture, the reason behind selecting specific components, and the interaction between the hardware and software. It should also include measurable results, testing, and proper documentation to show how the design performs under practical conditions. Ideally, the ECE project ideas for final year should have enough scope for students to improve the design, add new features, or explore alternative approaches rather than stopping at a basic prototype.

Instead of simply listing project titles, Circuit Digest provides practical project resources that help students understand the complete development process. From circuit diagrams and component selection to assembly, programming, and system testing, these resources give aspiring engineers a better understanding of how different parts of an electronics project work together. A project built around a practical problem not only makes the work more meaningful but also provides valuable hands-on experience in designing, debugging, and improving real electronic systems. Circuit Digest offers a wide range of practical electronics resources, everything from basic circuits to advanced projects, that help students and engineers understand, build, test, and improve their designs.

Explore Related Project Hubs: Artificial Intelligence | Electronics | IoT | Robotics | ESP32 | Raspberry Pi | Arduino Projects | Drone Projects |  Electronic Circuit 

Get Help Along the Way

Circuit Digest’s community is active and always ready to help. If you get stuck while building a project or simply want feedback on your work, you can connect with us and get guidance from our community. Join us on our WhatsAppand Instagram channelto ask questions, share your projects, and get the support you need. 

Have any question related to this Article?

AI Can Speed Up Design, but Not Replace Engineers, Says TVS Electronics’ Vijaykumar Ramalingam

Vijaykumar Ramalingam, VP of Engineering at TVS Electronics with about three decades of product development experience, says simulation has been central to engineering decisions throughout that time, and that AI is the next step in the same line.

Getting Started with ESP32-P4X-EYE: ESP32-P4 Vision Development Board

Vision development boards are useful when an embedded project needs to combine image capture, local display, audio input, storage and wireless connectivity in a single platform. The ESP32-P4X-EYE takes this approach around the ESP32-P4, adding an ESP32-C6 wireless module, a 2MP MIPI-CSI camera, a 1.54-inch SPI LCD, a digital microphone, MicroSD storage, USB interfaces and a 2 × 10-pin expansion header.

Getting Started with M5Stack Tab5: ESP32-P4 Touchscreen Development Board

Large touchscreen development boards are useful when a project needs more than a microcontroller and a few expansion pins. A display, camera, audio system, wireless connectivity, storage and industrial interfaces can turn the development board itself into the starting point for a complete embedded product. The M5Stack Tab5 takes this approach with a 5-inch 1280 × 720 touchscreen and a dual-processor architecture built around the ESP32-P4 and ESP32-C6.

Getting Started With MAX32690 EV Kit

Submitted by Anand D on

The MAX32690 evaluation kit provides a solid foundation to explore the full capabilities of the MAX32690 microcontroller, which is an advanced system-on-chip (SoC). It features an ARM Cortex-M4F CPU for efficient computation of complex functions and algorithms. It features the latest-generation Bluetooth 5 Low Energy (Bluetooth LE) radio designed for wearable and hearable fitness devices, portable and wearable wireless medical devices, industrial sensors/networks, Internet of Things (IoT), and asset tracking.

Learn FPGA Design with the Microchip veryVerilog Kit: From Setup to Your First Design

Most engineers who work with microcontrollers eventually run into the same challenge. A project needs to respond faster than firmware can, or it requires several digital signals to be combined in hardware. While these tasks can often be handled with interrupt service routines or external logic ICs, the solution quickly becomes complex as the design grows. This is where FPGAs excel, offering highly flexible hardware that can process multiple signals in parallel. However, for many beginners, the steep learning curve and relatively expensive development boards make getting started with FPGAs intimidating. The Microchip veryVerilog Kit offers a different approach. Instead of using a dedicated FPGA, it is built around the PIC16F13145, an 8-bit PIC microcontroller that includes a powerful peripheral called the Configurable Logic Block (CLB). While it isn't a replacement for a full FPGA, the veryVerilog Kit makes it much easier to start with FPGAs and Verilog programming.

  Assembled Microchip veryVerilog Kit featuring the PIC16F13145 microcontroller and onboard programmer.

Developed in collaboration with DigiKey's Academic Program, the veryVerilog Kit is designed as an accessible introduction to digital hardware design. The board is supplied as a solder-it-yourself kit, making it an excellent learning platform from assembly through to programming. Once assembled, the onboard programmer allows the microcontroller to be programmed directly from a web browser, eliminating the need for an external programmer or complex software setup. In this article, we'll explore the fundamentals of FPGAs using the veryVerilog Kit. You'll learn what a Configurable Logic Block is, how it differs from a traditional FPGA, how the PIC16F13145 implements programmable hardware, and how to create basic digital circuits using the CLB. Starting with simple logic gates such as AND, OR, and NOT, we'll gradually combine them to build more complex digital logic while introducing key FPGA concepts including LUTs, flip-flops, routing, synthesis, and hardware configuration.

What is an FPGA?

Before diving into the veryVerilog Kit, it's helpful to understand the technology behind it. At the heart of the kit is a Configurable Logic Block (CLB), a peripheral designed to bring some of the flexibility of an FPGA into a microcontroller. To appreciate what makes the CLB special, let's first look at what an FPGA is and how it works.
FPGA stands for Field-Programmable Gate Array. Unlike a microcontroller, which executes instructions stored in memory one after another, an FPGA allows you to build custom digital hardware by configuring its internal logic resources. Instead of writing software that tells a processor what to do, you define the hardware itself, creating digital circuits that operate in parallel. A traditional microcontroller follows a familiar cycle: it reads an instruction, executes it, then moves on to the next one. Even with interrupts and multiple peripherals, there is still a central CPU making decisions. An FPGA works differently. Once configured, the hardware itself performs the required operations continuously, without relying on a processor to execute instructions.
For example, imagine you need an output to turn ON only when two input signals are HIGH. On a microcontroller, you would periodically read both input pins, compare their states in software, and update the output accordingly. On an FPGA, you simply create an AND gate in hardware. Whenever the inputs change, the output updates almost instantly, without any software involvement. This ability to execute multiple hardware functions simultaneously is what makes FPGAs well suited for high-speed digital signal processing, video interfaces, communication protocols, motor control, and other timing-critical applications. Although an FPGA may appear as a single chip from the outside, it is actually made up of thousands or even millions of tiny configurable logic resources connected through a programmable routing network. These resources can be combined in almost any way to create custom digital circuits.

Simplified FPGA architecture

To understand how an FPGA works, it helps to become familiar with a few basic building blocks.

Basic Logic Elements (BLEs)

A Basic Logic Element (BLE) is the smallest programmable building block inside an FPGA. It typically consists of a Lookup Table (LUT) for implementing combinational logic and a Flip-Flop (FF) for storing the output of that logic when sequential operation is required. The LUT can be programmed to perform a wide range of logic functions, while the flip-flop allows the circuit to retain state and synchronize its operation with a clock signal. Depending on the application, the LUT output can either be used directly or passed through the flip-flop before being routed to other parts of the FPGA.

Simplified BLE Architecture

Individually, a BLE can only implement a relatively small piece of logic. However, by connecting many BLEs through the FPGA's programmable routing network, much larger and more sophisticated digital circuits can be created. In most FPGA architectures, multiple BLEs are grouped to form a Configurable Logic Block (CLB). The CLB provides additional local routing and shared resources, allowing the BLEs within it to work together efficiently. An FPGA is then built by arranging hundreds or even thousands of these CLBs in a programmable array, enabling designers to implement everything from simple logic gates to complex processors and communication interfaces.

Lookup Tables (LUTs)

A Lookup Table, or LUT, is the fundamental logic element inside most FPGAs. Rather than being a fixed logic gate, a LUT can be programmed to implement almost any Boolean function. For example, the same LUT can behave as an AND gate, an OR gate, an XOR gate, a NAND gate, or even more complex combinational logic involving multiple inputs. This flexibility is one of the reasons FPGAs are so versatile.

Routing Fabric or Interconnect Fabric

Logic elements alone aren't enough-they also need to be connected. Inside an FPGA, a programmable routing fabric acts like a network of tiny wires and switches that connect LUTs, flip-flops, memory blocks, and I/O pins. During synthesis, the FPGA development tools determine how these resources should be interconnected to implement your design. You can think of the routing fabric as the wiring between thousands of digital building blocks.

Configuration Bitstream

Unlike fixed-function ICs, an FPGA doesn't permanently contain your design. Instead, it is configured using a bitstream, a binary configuration file that tells the FPGA how every LUT, flip-flop, and routing switch should be programmed. Each time the FPGA powers up, this configuration is loaded into the device, transforming it into the custom hardware circuit you designed.

What is a Configurable Logic Block (CLB)?

A Configurable Logic Block (CLB) is a programmable hardware peripheral that is made up of multiple BLEs. Instead of executing software like the CPU, the CLB implements digital logic directly in hardware, allowing it to respond to events with deterministic timing and without consuming processor cycles. Although much smaller than a dedicated FPGA, the CLB follows the same principles. It contains programmable logic resources that can be configured to implement custom digital circuits such as logic gates, combinational logic, counters, state machines, pulse generators, signal conditioners, and timing circuits.
 

Simplified illustration of a CLB inside PIC16F13xxx series MCU

The CLB operates independently of the CPU. Once configured, it continuously processes its input signals and updates its outputs in hardware. This means the CPU is free to handle other tasks while the CLB performs repetitive or timing-critical operations in parallel. On the PIC16F13145, the CLB can interact with GPIO pins as well as several internal peripherals, allowing it to become part of the overall hardware architecture rather than just another software-controlled peripheral.

Why Put a CLB Inside a Microcontroller?

At first glance, adding programmable hardware to a microcontroller might seem unnecessary. After all, a CPU can already read inputs, process data, and control outputs through software. However, software isn't always the most efficient solution. Consider a simple example where an LED should turn ON only when two switches are pressed simultaneously. A microcontroller can certainly perform this task by repeatedly reading the input pins and updating the output. However, every input change requires CPU attention, even though the underlying logic is nothing more than an AND gate.
With a CLB, the same function is implemented directly in hardware. The two inputs are connected to an AND gate inside the CLB, and the output drives the LED. Whenever either switch changes state, the hardware responds immediately, without interrupting the CPU or executing a single line of firmware. As the logic becomes more complex, the advantages become even more apparent. Tasks such as signal debouncing, pulse generation, frequency division, protocol decoding, quadrature decoding, PWM shaping, or implementing small state machines can all be offloaded to the CLB. This reduces CPU workload, improves timing accuracy, and often simplifies the application software. The result is a system where software and hardware work together. The microcontroller handles high-level application logic and communication, while the CLB takes care of repetitive, deterministic digital operations.

Microchip veryVerilog Kit

Now that we've covered the basics of FPGA architecture and Configurable Logic Blocks, it's time to look at the hardware we'll be using throughout this article. The Microchip veryVerilog Kit is an educational development platform designed to introduce FPGA-style digital design using Microchip's Configurable Logic Block (CLB) technology. Instead of requiring a dedicated FPGA and a complex development toolchain, the kit combines the familiarity of a microcontroller with the flexibility of programmable hardware, making it an excellent platform for learning digital logic.
Unlike traditional FPGA development boards, which often require external programmers and specialized software, the veryVerilog Kit has been designed with simplicity in mind. It is supplied as a solder-it-yourself kit, allowing users to gain hands-on experience while assembling the hardware. Once assembled, the onboard programmer makes it possible to program the target device directly from a web browser, eliminating the need for additional programming hardware or complicated software installation.

veryVerilog Kit PIC16F13145

The board provides everything needed to begin experimenting with programmable logic. It includes user LEDs, push buttons, a USB interface for power and programming, and the necessary support circuitry around the target microcontroller. These onboard peripherals make it easy to implement and test digital logic circuits without requiring any additional hardware.
The heart of the veryVerilog Kit is the PIC16F13145, a member of Microchip's latest 8-bit PIC microcontroller family that integrates a powerful Configurable Logic Block. While the device functions as a fully featured microcontroller, the addition of the CLB allows developers to implement custom hardware logic alongside their firmware, bringing many FPGA design concepts into a familiar embedded development environment. 

Microchip PIC16F13145 MCU

At first glance, the PIC16F13145 looks like any other member of Microchip's 8-bit PIC family. The PIC16F13145 combines a capable 8-bit CPU with 14 KB of Flash program memory and 1KB of RAM, with a clock of up to 32 MHz, providing ample resources for embedded control applications. It also integrates a wide range of digital and analog peripherals, including timers, PWM modules, communication interfaces, comparators, an ADC, and a DAC. Together with the CLB, these peripherals make the device suitable for applications ranging from sensor interfacing and motor control to custom digital logic and hardware acceleration.

One of the standout features of the PIC16F13145 is its Configurable Logic Block, which consists of 32 Basic Logic Elements (BLEs), each containing one 4-input LUT and one flip-flop. These programmable logic resources can be configured to implement custom combinational and sequential logic without consuming CPU cycles. The device also includes four Configurable Logic Cells (CLCs), which can be used independently or alongside the CLB to implement additional hardware-based logic functions. On the analog side, the PIC16F13145 features a 10-bit Analog-to-Digital Converter with Computation (ADCC) capable of sampling at up to 300 ksps, an 8-bit Digital-to-Analog Converter (DAC), and two high-speed comparators with response times as low as 50 ns. These peripherals enable efficient signal acquisition and analog processing without requiring additional external components. Apart from the other standard peripherals, the PIC16F13145 also features a Peripheral Pin Select (PPS), which allows many peripheral functions to be mapped to different I/O pins for greater design flexibility.

Microchip veryVerilog Kit Schematics

The complete schematic of the veryVerilog Kit is shown below. At the heart of the board is the PIC16F13145, which serves as the target microcontroller for implementing CLB based digital logic. An onboard PIC16F1455 functions as a USB programmer, communicating with the host computer over USB and programming the PIC16F13145 through the ICSP interface. The USB connector also powers the entire board, while an ICSP header is provided for users who wish to program or debug the target device using an external Microchip programmer.

veryVerilog Kit Schematics

To make experimenting with digital logic easier, the board includes four push buttons connected to pins RC4, RC5, RA4, and RC3, respectively. The board also contains three user LEDs connected to RC1, RC2, and RB4, providing convenient visual outputs for CLB designs, alongside the two RX and TX LEDs that can be used to visualise the serial communication. An 8-pin prototype area provides an option to solder our own SOP8 or SOIC-8 chips to the board for prototyping. Apart from the programming circuitry and a few supporting components, such as the reset pull-up resistor and power supply decoupling capacitors, the hardware is very minimal and easy to build. 

Assembling the veryVerilog Kit

Before getting started, you'll need to assemble the veryVerilog Kit. The kit uses only through-hole components, making it straightforward to solder using basic tools. 

Components inside the veryVerilog kit

If you have assembled development kits before, the process should be familiar. New users can simply follow the official assembly guide, which includes the component placement, assembly sequence, and reference images for each step. Here is the fully assembled PCB with all the main components marked.

veryVerilog kit parts marking

Once the assembly is complete, inspect the solder joints and verify that all components are installed in the correct orientation, particularly the LEDs, electrolytic capacitor, and the two DIP microcontrollers. After confirming there are no solder bridges or missing components, connect the board to your computer. The microcontroller comes preloaded with example code, which is an LED chaser. If everything was done right, the 3 user LEDs will start to flash in a pattern. The kit is now ready for software setup and programming. 

veryverilog kit factory demo

Setting Up the Development Environment

With the hardware assembled, the next step is to set up the software development environment. Unlike traditional FPGA development, which often requires large synthesis tools and vendor-specific IDEs, for the veryVerilog Kit we will use the familiar Visual Studio Code IDE together with the MPLAB Extension Pack and XC8 Compiler. This combination allows you to configure the PIC16F13145, design digital logic graphically, generate the required firmware, and program the device from a single development environment.

How to Install the MPLAB XC8 C Compiler

The MPLAB XC8 C Compiler is Microchip’s compiler for developing applications for supported 8-bit PIC and AVR microcontrollers. To install it, download the appropriate XC8 package for your operating system from Microchip and launch the installer. The setup wizard will guide you through the installation, starting with the welcome screen and license agreement. Accept the license terms and continue to the Device Family Packs information page. Recent versions of XC8 no longer bundle device-specific header files, linker scripts, and startup files with the compiler; these are provided through DFPs and are automatically managed by the MPLAB extension pack for VS Code.

XC8 Compiler installation

Continue through the installer, and on the installation directory selection page, keep the default location and continue. On the Compiler Settings screen, enable the option to add XC8 to the system PATH if you want to invoke the compiler directly from a terminal or command prompt. Proceed to the installation confirmation screen and start the installation. The installer will copy the compiler files and verify the installation before displaying the completion screen. Once finished, XC8 is ready to be selected as the compiler toolchain when creating or configuring a project in the MPLAB extension for VS Code. For more details about the setup, you can check out Microchip's Official training manual.

XC8 Compiler installation Completion

Install VS Code and MPLAB Extensions

Begin by downloading and installing Visual Studio Code from the official Visual Studio Code website. The application is available for Windows, Linux, and macOS, so download the installer appropriate for your operating system and complete the standard installation process. Once VS Code is installed, launch the application and open the Extensions view from the Activity Bar. Search for MPLAB Extensions Pack and install the package published by Microchip. The extension pack provides the MPLAB development features required for creating and building the veryVerilog project, including the integration required for MPLAB Code Configurator.

Visual Studio Code MPLAB Extensions Pack.

Create New Project

After installing the extensions, create a new MPLAB project from within VS Code. From the menu bar, select View → Command Palette, then search for MPLAB: Create New Project and select the command. The MPLAB project wizard will open and ask for the project details. Enter a suitable project name and accept the default location, or choose a different directory if required. When the device selection screen appears, search for PIC16F13145 and select it as the target device. This is the microcontroller used by the veryVerilog kit. When prompted for the compiler, select XC8 and complete the project creation process.

MPLAB project creation in VS code

With the project created, the next step is to launch MPLAB Code Configurator. From the VS Code menu, select View → Command Palette, then search for MPLAB MCC: Launch and select it. MCC will open within the VS Code environment. If it's the first time you are opening the nMCC for a new project, select Create New MCC Config and associate the configuration with the project that was just created. Proceed with the default configuration options until the MCC graphical interface is displayed. Depending on the installation, VS Code may restart its extensions when the MCC configuration is first created. If MCC closes during this process, launch it again using View → Command Palette → MPLAB MCC: Launch.

Once the MCC graphical interface is available, open the Device Resources section and locate the Libraries category. From the available libraries, select the CLB Synthesizer Library and add it to the project. The CLB Synthesizer is the part of the development environment used to create the configurable logic that will run inside the PIC16F13145. After adding the peripheral, select Blank Design to start with an empty CLB design.

MPLAB Code Configurator CLB Synthesizer

Although the CLB defaults to the HFINTOSC (32 MHz) clock source, Microchip recommends selecting LFINTOSC (31 kHz) when working through basic examples. The slower clock rate produces more stable and easier-to-follow output updates in the Try environment. This setting can be changed from the configuration panel on the right-hand side of the CLB Synthesizer.

CLB clock settings

Once the CLB clock is set, we will create a new design by selecting the Black design in the CLB Synthesizer Library tab. 

Creating a new design in CLB Synthesizer

For this tutorial, we will create a simple AND gate using the CLB, which we will then use to control a user LED using two user-defined switches available on the veryVerilog PCB. For that, first drag two inputs and one output, along with an AND gate block, to the canvas. When you add these blocks to the canvas, they are unconfigured. To use them, we need to configure the inputs and outputs. For that, click on the unconfigured element, and the property panel will show the options to configure it. For the inputs, select CLBIN0PPS and CLBIN1PPS. For the output, select PPS_OUT0. 

Configuring input and output blocks

Once the input and output blocks are configured, connect them to the AND gate block. After all the blocks are connected, the result will look like the image below. As you may have observed, the Synthesize button on the left side of the canvas is also now enabled. Clicking the Synthesize button will synthesize the design and generate the code.

Completed AND gate design

After generating the code, the total usage of the CLB will be shown as a bar graph under the Synthesize button. You might also notice that the pin grid view is updated. In the pin grid view, can assign the physical pins to the input and output blocks. For this example, we will use RC4 and RC5 as inputs and RC1 as output, since they are connected to the onboard switches and LED. To do so make a click on the lock icon on the pin grid array that corresponds to the correct pin. Make sure that the same pin is not assigned to different peripherals at the same time.

Physical pin assignment to the CLB digital elements

Compile the Design

With the CLB design synthesized and the pin assignments configured, the project can move to the code generation stage. In the MCC interface, select Generate Code. MCC will generate the source and configuration files required for the project based on the peripheral and CLB configuration. These generated files are added to the MPLAB project and are then used during the subsequent build process.

MCC Code Generation

Build Design

After generating the project code, build the design using the MPLAB CMake build command. From the VS Code menu, select View → Command Palette, search for MPLAB CMake: Build, and select it. The build process uses the generated project files and the XC8 compiler to create the final firmware image. Once the build completes successfully, the required output files, including the HEX file used for programming, will be available in the project's build output directory.

Compiling the veryVerilog project.

Once the build is successful, the HEX file will be created in the out folder.

MPLAB extension compilation output.

Flashing the Firmware to the veryVerilog Kit

Once the project has been compiled successfully, the generated HEX file needs to be programmed into the PIC16F13145 on the veryVerilog Kit. Unlike most microcontroller development boards, the veryVerilog Kit includes an onboard programmer and a browser-based programming interface, so no additional software is required for flashing the firmware.
Begin by connecting the veryVerilog Kit to your computer using a USB cable. Once connected, open the veryVerilog Web Programmer by navigating to the WEB ICSP Programmer tool page. Click the Connect to Programmer button and select the miniFPGA programmer from the list of available USB devices. If multiple programmers are connected to your computer, you can click Identify Programmer to blink the LEDs on the selected board for a few seconds, making it easy to identify the correct device. Once connected, the webpage will display information about the detected microcontroller along with the User ID of the firmware currently programmed on the device.

Flashing firmware to veryVerilog Kit

To program the board, simply drag and drop the generated HEX file onto the Drag and Drop area of the webpage. The programming process starts automatically and only takes a few seconds to complete. Alternatively, click the Browse for HEX File button and select the HEX file manually from your computer. Once programming is complete, the new firmware is immediately written to the PIC16F13145, and the board is ready to run your design. And here is the output. The LED will turn on only when we press both switches together.
 

veryverilog kit Example

Exploring the Demo Design

The factory-programmed firmware included with the veryVerilog Kit demonstrates how multiple hardware functions can be combined into a single CLB design. Rather than implementing a single logic circuit, it combines counters, logic gates, and PWM to create different LED patterns based on the state of the four onboard push buttons. Depending on which button is pressed, the LEDs can count in sequence, stop the counter, enable multiple counters simultaneously, illuminate at reduced brightness using PWM, or combine multiple functions. 

veryVerilog Kit demo design

Each of the four onboard tactile switches modifies the behaviour differently. Pressing the RC4 switch overrides the counter and turns on all three LEDs simultaneously using OR logic. Pressing the RC5 switch pauses the running LED sequence and forces the first LED to remain ON. When the button is released, the counter resumes operation from where it stopped. The RA4 switch enables a second counter that is slightly phase-shifted from the first, creating a different LED pattern. Finally, pressing the RC3 switch uses PWM to dim all three LEDs, demonstrating how the CLB can work together with other peripherals to produce different output effects.

veryverilog kit Example

The demo also supports multiple button combinations. For example, pressing the RC5 and RC3 switches together keeps the first LED fully illuminated while dimming the other two LEDs using PWM. Pressing the RC4 and RA3 switches together disables all three LEDs. The complete source code and PCB design files can be found in the official veryVerilog GitHub repository.

Resources

This article covers the basics of using the veryVerilog Kit and the PIC16F13145 CLB. Once you're comfortable with these concepts, you can explore more digital logic examples and advanced designs using Microchip's online resources.

  • Logic Circuit Design 101 – An interactive course that introduces both basic and advanced digital logic concepts using the CLB.

  •   Microchip veryVerilog Kit - Microchip veryVerilog Kit DigiKey product page.

     

    These resources are a great way to continue learning and experimenting with the Configurable Logic Block beyond the examples covered in this article.

Have any question related to this Article?

From Consumption to Creation: Arrow Electronics' Raphael Salmi on India's Place in the Electronics Ecosystem

Submitted by Staff on

India used to be a market that consumed electronics. Now it designs, builds and ships them. That was the main message from Dr. Raphael Salmi, President of Arrow Electronics' semiconductor business for South Asia, Korea and Japan, when he sat down with Circuit Digest's Soundarya Lakshmi Narayanan on the electronicaXchange podcast at electronica India in Bengaluru.

How ROHM Components Power a Smart Electric Three-Wheeler

Submitted by Vishnu S on

What if the rear-view mirror in an electric three-wheeler was actually a screen showing live video from cameras around the vehicle? That was one of the interesting features we spotted at ROHM Semiconductor's booth at electronica India 2026. The smart EV demo included a motor controller rated at approximately 5-8 kW, a battery management system (BMS), and a dedicated board for controlling lighting and other vehicle peripherals. By integrating its components across these systems, ROHM demonstrated how semiconductor technology can support various functions in electric vehicles, from power control to auxiliary electronics.

EV Battery Management Board Using ROHM Components

One of the interesting features of the vehicle was its camera-based vision system, which used four cameras positioned around the vehicle: two near the side mirrors, one at the front, and one at the rear. The camera feeds were connected to a central smart cluster subsystem, which processed the video and displayed the footage on a digital rear-view display. This setup provides the driver with camera views of the vehicle's surroundings without relying solely on conventional mirrors.

Embedded Vision Processing Cluster for EVs

The demonstration highlights how modern EVs combine power electronics, battery monitoring, peripheral control, and embedded vision systems within a single platform. While the motor controller manages the electric drive and the BMS monitors the battery, the smart cluster subsystem handles the camera feeds and display. Together, these systems showcase the role of semiconductor components in enabling both essential vehicle functions and digital driver interfaces.

ROHM also showcased semiconductor solutions for automotive electronics and data centres, alongside technologies for EV charging, solar inverters, and industrial power conversion.
 

Have any question related to this Article?

Generative AI Shouldn’t Be Your First Instinct: A Conversation With Qualcomm’s Kartikey Rawat

Kartikey Rawat, senior AI and ML engineer and developer advocate at Qualcomm, talks about what to consider when building for Edge AI, from quantization and hardware to local versus cloud processing, and whether generative AI needs to run on edge devices at all.