Automation and Robotics Trainer Kit Programming Manual
Automation and Robotics Trainer Kit Programming Manual
(2024-25)
Arduino Uno
Arduino is an open-source platform used for building electronics projects. Arduino consists of both a
physical programmable circuit board (often referred to as a microcontroller) and a piece of software, or
IDE (Integrated Development Environment) that runs on your computer, used to write and upload
computer code to the physical board.
The Arduino platform has become quite popular with people just starting out with electronics, and
for good reason. Unlike most previous programmable circuit boards, the Arduino does not need a
separate piece of hardware (called a programmer) in order to load new code onto the board -- you
can simply use a USB cable. Additionally, the Arduino IDE uses a simplified version of C++,
making it easier to learn to program. Finally, Arduino provides a standard form factor that breaks
out the functions of the micro-controller into a more accessible package.
Programming
The Arduino UNO can be programmed with the (Arduino Software (IDE)). Select "Arduino UNO
from the Tools > Board menu (according to the microcontroller on your board). For details, see
the reference and tutorials.
The ATmega328 on the Arduino UNO comes preprogrammed with a bootloader that allows you
to upload new code to it without the use of an external hardware programmer. It communicates
using the original STK500 protocol (reference, C header files).
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available in the
Arduino repository. The ATmega16U2/8U2 is loaded with a DFU bootloader, which can be
activated by:
Warnings
The Arduino UNO has a resettable polyfuse that protects your computer's USB ports from shorts
and overcurrent. Although most computers provide their own internal protection, the fuse
provides an extra layer of protection. If more than 500 mA is applied to the USB port, the fuse
will automatically break the connection until the short or overload is removed.
Differences with other boards : The UNO differs from all preceding boards in that it does not
use the FTDI USB-to-serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to
version R2) programmed as a USB-to-serial converter.
Power: The Arduino UNO board can be powered via the USB connection or with an external
power supply. The power source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The
adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack.
Leads from a battery can be inserted in the GND and Vin pin headers of the POWER connector.
Vin. The input voltage to the Arduino board when it's using an external power source (as opposed to 5
volts from the USB connection or other regulated power source). You can supply voltage through this pin,
or, if supplying voltage via the power jack, access it through this pin.
3.3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
IOREF. This pin on the Arduino board provides the voltage reference with which the microcontroller
operates. A properly configured shield can read the IOREF pin voltage and select the appropriate power
source or enable voltage translators on the outputs to work with the 5V or 3.3V.
Memory: The ATmega328 has 32 KB (with 0.5 KB occupied by the bootloader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).
See the mapping between Arduino pins and ATmega328P ports. The mapping for the Atmega8, 168, and
328 is identical.
Microcontroller ATmega328P
Operating Voltage 5V
SRAM 2 KB (ATmega328P)
EEPROM 1 KB (ATmega328P)
1. Blinking LED
Aim: To create a simple circuit that makes an LED blink on and off at regular intervals.
Components
Procedure
Block daigram:
Theory : A light-emitting diode (LED) is a semiconductor device that emits light when an
electric current passes through it. The basic operation of an LED relies on its forward voltage,
typically around 2-3V for standard LEDs, which is crucial for ensuring proper functionality
without damage. To limit the current flowing through the LED and protect it, a resistor is often
used in series with the LED. When a pin is set to HIGH, current flows through the LED, causing
it to light up; conversely, setting the pin to LOW stops the current, turning the LED off. The
timing of the LED's blinking is controlled using functions like delay(), which allows for precise
management of how long the LED remains lit or unlit.
Code
void setup( ) {
void loop( ) {
Result
The LED blinks on for 1 second and then off for 1 second repeatedly. This demonstrates basic
LED control and timing.
Aim: To create a circuit that makes a tricolor LED (RGB LED) blink in different colors.
Components
1 x RGB LED
3 x Resistors (220Ω for each color)
1 x Breadboard
1 x Arduino or microcontroller
Jumper wires
Power supply (e.g., battery or USB for Arduino)
Procedure
Block daigram
Theory : A tricolor LED, or RGB LED, comprises three individual LEDs (red, green, and blue)
housed within a single package, enabling the production of a wide spectrum of colors through
additive color mixing. This principle allows for combinations of different intensities of red, green,
and blue light to create various hues; for example, mixing red and green produces yellow, while
combining all three colors results in white. RGB LEDs can be either common anode or common
cathode, affecting how they are controlled: in common anode configurations, the anode connects
to a positive voltage, requiring the corresponding pins to be set LOW to activate the colors,
whereas in common cathode types, the pins are set HIGH.
Code
void setup( ) {
void loop( ) {
delay(1000);
digitalWrite(9, LOW);
delay(1000);
digitalWrite(10, LOW);
delay(1000);
delay(1000);
Result: The RGB LED cycles through red, green, and blue colors, each blinking for 1 second. This
demonstrates how to control an RGB LED and use multiple outputs.
AIM : To conduct an experiment to interface the lcd display with Arduino board
APPARATUS REQUIRED:
Arduino UNO
lcd display
USB cable & Jumper Wires
LED
Desktop.
Procedure:
1. Code Preparation: Write or obtain the Arduino code for controlling the LCD. Ensure the code
includes the necessary library, such as LiquidCrystal.h.
2. Compile the Code: Verify that the code compiles without errors in the Arduino IDE.
6. Upload the Program: Upload the code to the Arduino board using the IDE.
7. Monitor Output: Open the Serial Monitor in the Arduino IDE to observe the output from the
LCD.
Theory : The LCD (Liquid Crystal Display) is an essential output device used for visually
representing data. It operates based on liquid crystal technology, which modulates light to create
images or text. Communication between the Arduino and the LCD is facilitated through various
pins, including the Register Select (RS) pin, which distinguishes between command and data
modes; the Enable (E) pin, which triggers the reading of data; and the data pins (D4 to D7), used
for transmitting information in 4-bit mode.
The LCD requires a power supply (VCC) and a ground connection (GND) for stable operation.
By utilizing the LiquidCrystal library in the Arduino IDE, users can send commands and display
text with ease, allowing for real-time data visualization in a variety of projects. Properly
interfacing the LCD with the Arduino enables quick and effective communication, making it an
invaluable tool for displaying information in embedded systems.
Block diagram
Code :
#include<LiquidCrystal.h>
void setup( )
lcd.begin(16,2);
lcd.print(“hello world”);
void loop( )
lcd.setCursor(5,1);
lcd.print(“lcd display”);
RESULT:-
Aim :To develop a system that accurately measures and displays temperature using the LM34
temperature sensor and an Arduino, addressing the need for reliable temperature monitoring in
various applications.
Components Required
1. Arduino Board
2. LM34 Temperature Sensor
3. 12V 2A Power Supply
4. USB Cable for Programming
5. Jumper Wires (2-line connector
Procedure
Follow the code section mentioned bellow make sure the code doesn’t have error
at compilation
Power on the kit by using 12v 2A adaptor
Connect the programmer USB cable to kit and PC
Kit connection
1. Use 2-line connector, connect the connector head to
LM35TEMPERATURE SENSOR module of pinheader [LM35,OUT]
2. Connect the LM35 pin to 5v power supply section
3. Connect the OUT pin to pin no.A0 of Arduino
4. Done with connections
Load the program to Kit
Theory :The LM35 temperature sensor is a highly precise device used for measuring
temperature in various applications, including environmental monitoring and industrial processes.
It provides an analog output that is directly proportional to the temperature in degrees Celsius,
with a sensitivity of 10 mV/°C. This means that at 25°C, the output voltage will be 250 mV. The
sensor connects to the Arduino through its output pin, which can be read using an analog input pin
on the Arduino board. The system allows users to easily capture and display real-time temperature
readings, making it suitable for applications that require reliable temperature monitoring, such as
weather stations or HVAC systems. By interfacing the LM35 with an Arduino, users can develop
projects that automatically adjust to temperature changes, enhancing automation and control.
Bock Diagram
Code section
#define sensorPin A0
float value=0;
float voltage;
float temp;
void setup( ) {
Serial.begin(9600);
void loop( ) {
Serial.print("Temperature:");
Serial.println(Fahrenhiet);
Result: The implementation of a temperature sensor interface using an LM34 and Arduino is
done and verified, successfully demonstrating accurate temperature readings based on the sensor's
output.
Aim: To develop a system that accurately measures and displays temperature and humidity using
the DHT11 temperature sensor and an Arduino, addressing the need for reliable environmental
monitoring in various applications.
Components Required
Arduino Board
DHT11 Temperature and Humidity Sensor
12V 2A Power Supply
USB Cable for Programming
Jumper Wires (2-line connector)
Procedure
1. Follow the code section mentioned bellow make sure the code doesn’t have
error at compilation
2. Power on the kit by using 12v 2A adaptor
3. Connect the programmer USB cable to kit and PC
4. Kit connection
1. Use 4-line connector, connect the connector head toDHT11
TEMPERATURE SENSOR module of pinheader [DHT11,OUT]
2. Connect theDHT11 pin to 5v power supply section
3. Connect the OUT pin to pin no.A0 of Arduino
4. Done with connections
5. Load the program to Kit
Theory : The DHT11 temperature and humidity sensor is a popular choice for environmental
monitoring due to its affordability and ease of use. It provides both temperature and humidity
readings, making it versatile for various applications such as home automation, weather
monitoring, and greenhouse control. The DHT11 operates using a digital signal, simplifying the
interfacing process with an Arduino. It typically measures temperatures from 0 to 50°C with an
accuracy of ±2°C and humidity from 20% to 90% with an accuracy of ±5%. The sensor
communicates with the Arduino using a single-wire protocol, allowing for straightforward data
collection.
Block diagram
Code Section:
#include <DFRobot_DHT11.h>
#define DHT11_PIN 2
DFRobot_DHT11 mydht;
void setup( )
{
Serial.begin(9600);
}
void loop( )
{
mydht.read(DHT11_PIN); // mydht(DHT11_PIN);
//int mydht.read();
Serial.print("Temperature:");
Serial.print(mydht.temperature);
Serial.print("Humidity:");
Serial.print(mydht.humidity);
Serial.println("%");
delay(2000);
}
Result: The implementation of a temperature and humidity sensor interface using the DHT11
and Arduino is done and verified, successfully demonstrating accurate readings of temperature
and humidity based on the sensor's output.
APPARATUS REQUIRED:-
Arduino board
MQ-3 Alcohol sensor module
buzzer
USB cable and jumper wires
Desktop
PROCEDURE:
Make sure that the code doesn't have error at the time of Compilation
Connect one terminal of buzzer to digital pin 7 pin of arduino and other pin to GND pin.
Load the program to kit & observe the output in serial monitor.
Theory :
The MQ-3 alcohol sensor is designed to detect the presence of alcohol in the environment and is
commonly used in breathalyzer applications. It operates by measuring the concentration of
alcohol vapors in the air and providing an analog output that correlates with the alcohol level. The
sensor consists of a sensing layer that changes resistance based on the concentration of alcohol,
allowing the Arduino to read this change through its analog input. In addition to detecting alcohol,
the MQ-3 sensor can also detect other gases, making it versatile for various applications. When
the sensor detects alcohol, it can trigger a response, such as activating a buzzer or sending a
notification. This capability is essential for safety applications, including vehicle ignition locks
and personal breathalyzers.
Block Daigram
CODE SECTION:
void setup( )
Serial.begin(9600);
pinMode(9,INPUT);
pinMode(A0,INPUT);
pinMode(7,OUTPUT);
void loop( )
int x=digitalRead(9);
if(x==1) {
digitalWrite(buz,HIGH);
Serial.println("Alcohol detected");
else {
digitalWrite(buz,LOW);
int y=analogRead(A0);
Serial.print("Quantity of Alcohol:");
Serial.println(y);
RESULT:
Hence, the interfacing MQ-3 alcohol sensor to detect the alcohol using Arduino board is verified.
Aim: To develop a system that accurately detects sound levels using a sound sensor and an
Arduino, addressing the need for effective sound monitoring in various applications.
Components Required
1. Arduino Board
2. Sound Sensor Module
3. 12V 2A Power Supply
4. USB Cable for Programming
5. Jumper Wires (4-line connector)
Procedure
Follow the code section mentioned below make sure the code doesn’t have error at
compilation Power on the kit by using 12v 2A adaptor.
Connect the programmer USB cable to kit and PC Kit connection
Use 4-line connector connect the connector head to sound sensor module of pin header
[VCC, GND, D0]
Connect the VCC pin to 5v power supply section
Connect the GND pin to GND power supply section
Connect the OUT pin to pin no. A0 of Arduino
VCC VCC
GND GND
A0 A_out
Arduino Sound
Sensor
Theory :The sound sensor interface using an Arduino controller is an effective way to monitor
sound levels in various environments, enhancing applications like noise monitoring,
environmental studies, and safety systems. The sound sensor module detects sound waves and
converts them into an electrical signal, which is then processed by the Arduino board. The
Arduino, a versatile microcontroller platform, allows for easy programming and integration with
various sensors and modules.
Code
const int analog=A0;
void setup( ) {
pinMode(A0,INPUT);
pinMode(7,OUTPUT);
void loop( ) {
int value=analogRead(A0);
if(value>200) {
digitalWrite (led,HIGH);
else {
digitalWrite(led,LOW);
Result
The implementation of a sound sensor interface using an Arduino is done and verified,
successfully demonstrating the detection of sound levels based on the sensor's output.
Aim: To develop a system that accurately measures and monitors current using a current
sensor and an Arduino, addressing the need for reliable current measurement in various
electronic applications.
Components Required
Arduino Board
Current Sensor Module
12V 2A Power Supply
USB Cable for Programming
Jumper Wires (3-line or 4-line connector)
Procedure
Follow the code section mentioned below; make sure the code doesn’t have error at
compilation.
Power on the kit by using 12v 2A adaptor.
Connect the programmer USB cable to kit and PC.
Kit connection:
Use 3-line, 4-line connector; connect the connector head to current sensor module
of pin header [signal, VCC, GND].
Connect the VCC pin to 5v power supply section.
Connect the GND pin to GND power supply section.
Connect the signal pin to GPIO A0 of Arduino PIN.
Load the program to Kit.
Theory: Current sensors are critical components for monitoring electrical current in circuits,
enabling users to measure the flow of electricity accurately. These sensors typically output an
analog signal that correlates with the current passing through a conductor. By connecting the
current sensor to an Arduino, users can read the current values through the analog input pins,
allowing for real-time monitoring and data logging. This capability is essential in various
applications, including power management systems, battery monitoring, and load monitoring in
electrical appliances. The system can be designed to trigger alerts or actions based on specific
current thresholds, enhancing safety and efficiency in electrical systems.
Code
const int sensor = A0;
void setup( )
{
Serial.begin(9600);
}
void loop( )
{
int temp = analogRead(senor);
Serial.print("data:");
Serial.println(temp);
delay(1500);
}
Result
The implementation of a current sensor interface using an Arduino is done and verified,
successfully demonstrating accurate current measurements based on the sensor's output.
Aim:To interface a voltage sensor with an Arduino for measuring voltage levels,
enabling real-time monitoring and feedback through an LED indicator.
Components Required
Procedure
Follow the code section
Power on the kit by using 12v 2A adaptor.
Connect the programmer USB cable to kit and PC.
Kit connection:
Use 3-line, 4-line connector; connect the connector head to voltage sensor module of pin
header [signal, VCC, GND].
Connect the VCC pin to 5v power supply section.
Connect the GND pin to GND power supply section.
Connect the signal pin to GPIO A0 of Arduino PIN.
Load the program to Kit.
VCC VCC
GND GND
A0 A_out
Arduino Voltage
Sensor
Theory : The sound sensor module is designed to detect sound levels in the environment and is
useful in various applications, including sound level monitoring and voice-activated systems. The
module typically features a microphone that converts sound waves into an electrical signal. This
signal is processed to determine sound intensity, which can be read as a digital output or an
analog voltage by the Arduino. By connecting the sound sensor to the Arduino, users can create
systems that respond to sound levels, such as activating alarms or controlling devices based on
noise detection. The ability to monitor sound in real time makes this sensor valuable for
applications in home automation, security systems, and environmental monitoring.
Code
Result:
The implementation of a voltage sensor interface using an Arduino has been completed and verified,
successfully demonstrating accurate voltage measurements based on the sensor's output, with real-time
feedback provided through the LED indicator.
Aim: To interface a proximity sensor with an Arduino to detect the presence of objects and control an
LED based on the sensor's output, facilitating applications in automation and remote sensin g.
Components Required.
Procedure
Follow the code section mentioned below to make sure the code doesn’t have error at
compilation.
Kit connection.
Use 3-line, 4-line connector, connect the connector head to proximity sensor module of
pin header [signal, VCC, GND].
Connect the VCC pin to 5V power supply section & GND pin to GND power supply
section.
Theory : Proximity sensors are devices used to detect the presence of nearby objects without
physical contact. They are widely utilized in automation, robotics, and safety applications. One
common type of proximity sensor is the ultrasonic sensor, which emits sound waves at a
VCC VCC
GND GND
8 SIG
Arduino Proximity
Sensor
10
LED
Gnd
void setup() {
Serial.begin(9600);
pinMode(sensor,INPUT);
}
voidloop(){
int temp=digitalRead(sensor);
if(temp ==HIGH)
{
Serial.println("metal object found");
digitalWrite(LED, HIGH);
delay(1500);
}
else
{
digitalWrite(LED, LOW);
delay(1500);
}
}
Result:
The implementation of a proximity sensor interface using an Arduino has been completed and
verified.
Aim :To develop a system that interfaces a relay with an Arduino, enabling control of high-
voltage devices through low-voltage signals for automation and control applications.
Appartus Required
Arduino Board (e.g., Arduino Uno)
Procedure
Follow the code section mentioned below to make sure the code doesn’t have error at
compilation.
Power on the kit by using 12V 2A adaptor.
Connect the programmer USB cable to kit and PC.
Kit connection.
Use 2-line connector, connect the connector head to relay module of pin header [signal,
VCC, SIG].
Connect the VCC pin to 5V power supply section.
Connect the GND pin to GND power supply section.
Connect the signal pin to GPIO of 8 Arduino PIN.
Connect motor terminal to relay output.
Load the program to Kit.
Theory :
A relay typically consists of an electromagnet, a movable armature, and a set of contacts. When a
current flows through the electromagnet, it generates a magnetic field that pulls the armature,
closing or opening the contacts. This action allows the relay to control a high-voltage circuit
based on the input from the Arduino.A relay module usually includes three main pins: VCC, GND,
and a signal pin. The VCC pin connects to the power supply (typically 5V), while the GND pin is
connected to the ground. The signal pin is connected to a GPIO pin on the Arduino. By sending a
HIGH signal to the relay's signal pin, the Arduino activates the relay, allowing current to flow
through the connected load.
Block Diagram
Code
void setup( )
Serial.begin(9600);
pinMode(relay,OUTPUT);
}
void loop( )
{
digitalWrite(relay, HIGH);
delay(3500);
digitalWrite(relay, LOW);
delay(3500);
}
Result:The relay was successfully verified to activate and deactivate the connected load as per
the Arduino control signals.
Aim : To develop a motor control system using a relay interface with an Arduino, allowing for
the automation of motor operations in various applications, such as robotics and home
automation.
Appartus Required
Arduino Board (e.g., Arduino Uno)
Procedure
Follow the code section mentioned below to make sure the code doesn’t have error at
compilation.Power on the kit by using 12V 2A adaptor.
Connect the programmer USB cable to kit and PC.
Kit connection.
Use 2-line connector, connect the connector head to relay module of pin header [signal, VCC,
SIG].
Connect the signal pin to GPIO of 8 Arduino PIN.
Load the program to Kit
VCC VCC
GND GND
8 SIG
Arduino Relay
Theory :The motor control system using a relay and Arduino leverages the ability of relays to
control high-power devices like motors with low-power signals from the microcontroller. A relay
acts as an electrically operated switch that can open or close a circuit, enabling or disabling the
flow of electricity to the motor. The Arduino sends a signal to the relay module's signal pin,
activating or deactivating the relay based on the programmed conditions. This setup typically
involves connecting the relay's VCC and GND pins to the Arduino's power supply, ensuring
MOTOR
proper operation. The use of relays is crucial for isolating the Arduino from high voltage, thereby
protecting the microcontroller while still allowing it to control the motor. By programming the
Arduino to toggle the relay, the motor can be turned on or off based on user-defined conditions or
inputs, facilitating automated processes in various applications.
Code
void setup( )
Serial.begin(9600);
pinMode(relay,OUTPUT);
}
void loop( )
{
digitalWrite(relay, HIGH);
delay(3500);
digitalWrite(relay, LOW);
delay(3500);
}
Result: The motor successfully operates via relay control when activated by the Arduino.
Components Required
Arduino Board
Servo Motor
12V 2A Power Supply
USB Cable for Programming
Jumper Wires (3-line connector)
Procedure
Follow the code section mentioned below makes sure the code doesn't have error at
compilation
Power on the kit by using 12v 2A adaptor
Connect the programmer USB cable to kit and PC
Kit connection
Use 3-line connector, connect the connector head to servo module of pin header [5v, PWM,
GND]
Connect the 5v pin to 5v power supply section
Connect the GND pin to GND power supply section
Connect the PWM pin to PWM of Arduino pin No 9
Done with connections
Load the program to Kit
Open the serial monitor in ARDUINO IDE
Block Diagram
VCC VCC
GND GND
IO9 PWM
Arduino SERVO
MOTOR
Theory : Servo motors are crucial components in applications that require precise control over
angular positioning, such as robotics and automation. Unlike standard DC motors, servos include
built-in feedback mechanisms that ensure accurate positioning. The motor typically connects to
the Arduino via a power supply (VCC), a ground (GND), and a PWM (Pulse Width Modulation)
pin, which receives the control signal from the Arduino. The duration of the PWM signal dictates
the position of the servo arm, allowing for a range of movement, often between 0° and 180°. The
operation of a servo motor involves the Arduino sending a PWM signal, which the servo
interprets to adjust its position accordingly. This feedback system allows for precise movements,
making servo motors ideal for tasks such as controlling robotic arms or camera gimbals, where
accuracy is paramount.
Code section
#include<Servo.h>
Servo myservo;
int i=0;
void setup( )
{
myservo.attach(9);
}
void loop( )
{
Result: The implementation of a servo motor control system using an Arduino is done and
verified, successfully demonstrating accurate position control of the servo motor based on PWM
signals.
Aim: To develop a system that accurately controls the speed and direction of a DC motor using
an Arduino, addressing the need for reliable motor control in various automation and robotics
applications.
Components Required
1. Arduino Board
2. DC Motor
3. 12V 2A Power Supply
4. USB Cable for Programming
5. Jumper Wires (5-line connector)
6. Motor Driver Module (if applicable)
Procedure
Follow the code section mentioned bellow make sure the code doesn’t have error
at compilation
Power on the kit by using 12v 2A adaptor
Theory : DC motors play a vital role in converting electrical energy into mechanical energy,
facilitating rotational motion through electromagnetic principles. They are widely used in various
mechanical systems and applications, including fans and robotics. The DC motor connects to the
Arduino via a power supply (V+) and control pins (IN1 and IN2), which dictate the motor's
rotational direction. By setting these pins high or low, the Arduino can reverse the motor's
direction. Additionally, the speed of the motor can be controlled using PWM signals; by varying
the duty cycle, the average voltage supplied to the motor is adjusted, enabling precise speed
Mr.Sucheth S and Mrs.Shobharani H.N, Dept.of ECE, RPT (2024-25) Page 35
Automation And Robotics (20EC53I)
control. This versatility allows DC motors to be employed in numerous applications requiring
reliable motor control, making them essential components in automation and robotics.
Block Diagram
VCC
VCC
GND
GND
IO8
IN1I
IO9
N2
Arduino L293DDR
IVER
MOTOROUT
DC MOTOR
Code Section:
const int IN1 = 8;
void setup( )
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
void loop( )
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
delay(1500); }
Result: The implementation of a DC motor control system using an Arduino is done and
verified, successfully demonstrating control of the motor’s direction and speed based on
input signals.
Aim: To develop a system that accurately controls the position and rotation of a stepper motor
using an Arduino, addressing the need for precise control in applications such as 3D printing and
robotics.
Components Required
Arduino Board
Stepper Motor
12V 2A Power Supply
USB Cable for Programming
Jumper Wires (8-line connector)
Motor Driver Module (if applicable)
Procedure
Follow the code section mentioned bellow make sure the code doesn’t have error
at compilation
Power on the kit by using 12v 2A adaptor
Connect the programmer USB cable to kit and PC
Kit connection
Use 8 lineconnector, connect the connector head to stepper module
of pinheader[ST1,ST2,ST3,ST4]
Connect the ST1,ST2,ST3,ST4 pin to pin no.8,9,10,11 of Arduino
Load the program to Kit
Observe the output
Theory : Stepper motors are specialized devices that move in discrete steps, providing high
precision in positioning and control, making them ideal for applications such as CNC machines
and 3D printers. They typically have multiple coils that must be energized in a specific sequence
to achieve rotation. Each pulse sent to the motor advances it by a fixed angle, allowing for
accurate control of its position. Stepper motors require a power supply that may exceed that of
standard components, often ranging from 5V to 12V. The precise control offered by stepper
motors is essential in tasks requiring repeatability and accuracy, as they can be programmed to
move to specific positions reliably. This capability makes stepper motors invaluable in
automation, robotics, and any application where controlled movement is necessary.
Code Section.
#include<Stepper.h>
const int stepsPerRevolution = 50; //change this to fit the no of steps perrevolution
SteppermyStepper(stepsPerRevolution,8,9,10,11);
void setup( ){
myStepper.setSpeed(60); // set the speed at 60 rpm:
Serial.begin(9600);//initializetheserialport:
}
void loop( ){
// step one revolutionin one direction:
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(500);
// step one revolution in the other direction:
Serial.println("counterclockwise");
myStepper.step(-stepsPerRevolution);
delay(500);
}
Result: The implementation of a stepper motor control system using an Arduino is done and
verified, successfully demonstrating precise control over the motor's position and rotation based
on input signals.
Components Required
Procedure
1. Connect the segments of the 7-segment display to the Arduino pins using resistors.
2. If using a common cathode display, connect the common pin to GND. For a common
anode display, connect the common pin to VCC (5V).
3. Example pin connections for a common anode display:
1. Segment A to Arduino pin 2
2. Segment B to Arduino pin 3
3. Segment C to Arduino pin 4
4. Segment D to Arduino pin 5
5. Segment E to Arduino pin 6
6. Segment F to Arduino pin 7
7. Segment G to Arduino pin 8
8. Decimal Point (optional) to Arduino pin 9
Block diagram
Theory : A 7-segment display is an electronic component used to display decimal numbers and
some letters through the illumination of its seven individual segments. Each segment is typically
an LED that can be turned on or off to form various digits and characters. These displays come in
two main types: common cathode, where all segments share a ground connection, and common
anode, where they share a positive voltage. When specific segments are activated, they combine
to create numbers like 0-9, making 7-segment displays ideal for applications in digital clocks,
measurement devices, and counters due to their simplicity and clarity.
Code Section:
digitalWrite(A,1);
digitalWrite(B,0);
digitalWrite(C,1);
digitalWrite(D,1);
digitalWrite(E,1);
digitalWrite(F,1);
digitalWrite(G,1);
delay(1000);
}
Result: The 7-segment display successfully illuminated the numbers, demonstrating proper
functionality and accurate representation of decimal digits, confirming successful interfacing with
the Arduino.
Aim: To develop a Bluetooth communication interface using an Arduino, enabling wireless data
transmission and control between the Arduino and a smartphone, addressing the need for remote
monitoring and control in various applications.
Components Required
Arduino Board
Bluetooth Module (e.g., HC-05)
12V 2A Power Supply
USB Cable for Programming
Jumper Wires (4-line connector)
Procedure
Follow the code section mentioned below; make sure the code doesn’t have error at
compilation.
Power on the kit by using 12v 2A adaptor.
Connect the programmer USB cable to kit and PC.
Kit connection:
1. Use 4-line connector; connect the connector head to BLUETOOTH module of pin
header [STATE, RXD, TXD, GND, VCC, EN].
2. Connect the VCC pin to 5v power supply section.
3. Connect the GND pin to GND power supply section.
4. Connect the RXD pin to pin no. 1 (TX) of Arduino.
5. Connect the TXD pin to pin no. 0 (RX) of Arduino.
6. Done with connections.
Tricolor LED:
1. Connect the red pin of the tricolor LED to pin No. 2 of the Arduino.
2. Connect the green pin of the tricolor LED to pin No. 3 of the Arduino.
3. Connect the blue pin of the tricolor LED to pin No. 4 of the Arduino.
4. Connect the common cathode or anode of the LED to the power.
5. Load the program to Kit:
o NOTE: While loading the program to kit, REMOVE the connection pin 0, 1 in
Arduino. After uploading, connect it to the same pin no.
6. Pair the BLUETOOTH device HC-05 to smartphone (password: 1234).
7. Open the application, select the HC-05 device, click on connect.
8. Now live data is streamed to smartphone.
VCC VCC
GND GND
Rx0 Tx
Tx 1 Rx
Red 2
blue 3 HC05
Green 4 Arduino
RGB
Theory: The Bluetooth module (such as the HC-05) facilitates wireless communication between
the Arduino and other Bluetooth-enabled devices, such as smartphones. This interface allows for
remote data transmission and control, which is particularly useful in applications requiring
mobility or distance from the control unit. The HC-05 module operates using a serial
communication protocol, connecting to the Arduino through designated pins for power (VCC),
ground (GND), and data transmission (RX and TX). Users can create applications that allow them
to send commands or receive data wirelessly, enhancing user interaction with their projects. By
pairing the Bluetooth module with a smartphone app, users can monitor and control their Arduino
projects in real time, expanding the capabilities of their systems and making them more versatile
in various applications, including home automation and remote monitoring.
Code section
#include<SoftwareSerial.h>
mybluetooth. begin(9600);
void loop ( ) {
if (mybluetooth.available( )) {
char x = mybluetooth.read( );
if (x =='R'){
digitalWrite(2, 1);
digitalWrite (3,0);
else if (x == 'G')
digitalWrite (2,0);
digitalWrite (3,1);
digitalWrite (4.0);
else if (x == 'B'){
digitalWrite (2,0);
else
digitalWrite (2,0);
Result:
The implementation of a current sensor interface using an Arduino is done and verified,
successfully demonstrating accurate current measurements based on the sensor's output.
Apparatus Required
Procedure
Follow the code section mentioned below to make sure the code doesn’t have error at
compilation.
Use 3-line connector, connect the connector head to IR module of pin header [signal,
VCC, SIG].
Connect the VCC pin to 5V power supply section.
Use 3-line connector, connect the connector head to LCD module of pin header [RS, VCC,
EN].
Use 2-line connector, connect the connector head to buzzer module of pin header [VCC,
SIG].
Connect the VCC pin to 5V power supply section.
Use 8-line connector, connect the connector head to LED module of pin header.
Connect the SIG pin to GPIO of 7 Arduino PIN.
Code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(14, 15, 16, 17, 18, 19);
const int LED = 7;
const int buzzer = 11;
const int in1 = 8; // IR sensor
const int pir = 10; // PIR sensor
int entryCount = 0;
void setup()
{
lcd.begin(16, 2);
pinMode(LED, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(in1, INPUT);
pinMode(pir, INPUT);
}
void loop()
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Count: ");
lcd.print(entryCount);
int x=digitalRead(in1);
// Check if someone enters using the IR sensor
if (x == HIGH)
{
entryCount= entryCount+1 ;
digitalWrite(buzzer, HIGH); // Activate buzzer
delay(500);
digitalWrite(buzzer, LOW);
}
// Check if the PIR sensor detects motion
Result
The system successfully counts the number of students entering the classroom, with the LCD
displaying the count, the buzzer sounding upon entry, and the LED lighting up when motion is
detected.
Aim: To develop a street light controller using a Light Dependent Resistor (LDR) and an
Arduino, enabling automatic control of street lighting based on ambient light levels.
Components Required
Buzzer Module
Procedure
Follow the code section mentioned below to make sure the code doesn’t have error at
compilation.
Kit connection.
Use 8-line connector, connect the connector head to LED module of pin header [8-bit
LED].
Use 2-line connector, connect the connector head to buzzer module of pin header [VCC,
SIG].
Code Section
int temp=0;
voidsetup()
{
Serial.begin(9600);
pinMode(LED,OUTPUT);
}
voidloop()
{
temp = analogRead(LDR);
Serial.print("INTENSITY:");Seri
al.println(temp);
if(temp<= 500)
{
digitalWrite(LED, HIGH);
delay(2000);
}
else
{
digitalWrite(LED, LOW);
Mr.Sucheth S and Mrs.Shobharani H.N, Dept.of ECE, RPT (2024-25) Page 51
Automation And Robotics (20EC53I)
delay(2000);
}
}
Result
The implementation of a street light controller using an LDR and Arduino has been completed
and verified, successfully demonstrating automatic activation and deactivation of street lights
based on ambient light conditions, with sound feedback from the buzzer.
Components Required
Procedure
Follow the code section mentioned below to make sure the code doesn’t have error at
compilation.
Kit connection.
Use 8-line connector, connect the connector head to LED module of pin header [8 BIT
LED].
Use 3-line connector, connect the connector head to IR module of pin header [GND, VCC,
SIG].
Use 3-line connector, connect the connector head to LCD module of pin header [RS, VCC,
EN].
Code:
#include<LiquidCrystal.h>
LiquidCrystal lcd(14,15,16,17,18,19);
Serial.begin(9600);
lcd.begin(16, 2);
pinMode(slot1, OUTPUT);
}
voidloop( )
{
lcd.setCursor(0,0);
lcd.print("P1:RP2:RP3:R");
if(digitalRead(slot1_in)==LOW)
{
lcd.setCursor(0,1);
lcd.print("P4:R");
lcd.print(" TP:4");
digitalWrite(slot1,HIGH);
}
else
{
lcd.setCursor(0,1);
lcd.print("P4:G");
lcd.print(" TP:3");
digitalWrite(slot1,LOW);
}
delay(2000);
}
Result
The implementation of a parking system to identify available slots using an IR sensor and
Arduino has been completed and verified, successfully demonstrating the detection of parking
space occupancy. The system provides real-time visual feedback through an LED module and
displays availability status on the LCD.
Aim: To implement a home automation system using an Arduino that integrates multiple
sensors, enabling automated control of devices based on temperature and motion detection,
with real-time feedback displayed on an LCD.
Components Required
Procedure
Follow the code section mentioned below to make sure the code doesn’t have error at
compilation.
Power on the kit by using 12V 2A adaptor.
Connect the programmer USB cable to kit and PC.
Kit connection.
Use 8-line connector, connect the connector head to LED module of pin header [8 BIT
LED].
Connect the LED pin to pin no. 2, 3 of Arduino.
Use 2-line connector, connect the connector head to LM35 temperature sensor module of
pin header [LM35, OUT].
Connect the LM35 pin to 5V power supply section.
Connect the OUT pin to pin no. A0 of Arduino.
Done with connections.
Use 3-line connector, connect the connector head to PIR module of pin header [GND,
VCC, SIG].
Connect the VCC pin to 5V power supply section.
Connect the GND pin to GND power supply section.
Block diagram
lcd.clear( );
}
void loop() {
float temp = 0;
int ppl=0;
temp = analogRead(lm35);
temp = temp/2.62;
lcd.setCursor(0,0);
lcd.print("temp=");
lcd.print(temp);
if(temp >= 30)
{
digitalWrite(m2, HIGH);
digitalWrite(m3,LOW);
}
else
delay(1500);
}
delay(1000);
}
Result: The implementation of a home automation system using sensors and Arduino has been
successfully completed and verified.
Aim: To develop an obstacle avoidance robot using an Arduino and an ultrasonic sensor, enabling
the robot to navigate around obstacles autonomously.
Components Required
DC Motors
Jumper Wires
Procedure
Follow the code section mentioned below to make sure the code doesn’t have error at
compilation.
Kit connection.
Mr. Sucheth S and Mrs.Shobharani H.N, Dept.of ECE, RPT (2024-25) Page 60
Automation And Robotics (20EC53I)
Code Section
void setup() {
Serial.begin(9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motorPin3, OUTPUT);
pinMode(motorPin4, OUTPUT);
void loop() {
Mr. Sucheth S and Mrs.Shobharani H.N, Dept.of ECE, RPT (2024-25) Page 61
Automation And Robotics (20EC53I)
Serial.print("Distance: ");
Serial.println(distance);
stopMotors( );
} else {
moveForward();
long measureDistance( )
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
void moveForward( )
Mr. Sucheth S and Mrs.Shobharani H.N, Dept.of ECE, RPT (2024-25) Page 62
Automation And Robotics (20EC53I)
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, HIGH);
void stopMotors() {
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
Mr. Sucheth S and Mrs.Shobharani H.N, Dept.of ECE, RPT (2024-25) Page 63
Automation And Robotics (20EC53I)
Components Required
Arduino Uno
IR Line Sensors (2 pcs)
DC Motors (2 pcs)
Motor Driver (L298N or similar)
Chassis (robot body)
Wheels (2 pcs)
Caster Wheel (1 pc)
Battery Pack (6V or suitable for motors)
Jumper Wires
Breadboard (optional)
Procedure
Chassis Assembly
Sensor Setup
Mount the IR sensors on the front of the robot, positioned to detect the line on
the ground.
Wiring Connections
Mr. Sucheth S and Mrs. Shobharani H.N, Dept.of ECE, RPT (2024-25) Page 64
Automation And Robotics (20EC53I)
Truth Table
LOW LOW Move Forward Both sensors on the black line (centered).
LOW HIGH Turn Right Left sensor on the line, right sensor off the line.
HIGH LOW Turn Left Right sensor on the line, left sensor off the line.
HIGH HIGH Stop or Reverse Both sensors off the line (lost the track).
Code:
void setup() {
pinMode(leftSensor, INPUT);
pinMode(rightSensor, INPUT);
pinMode(motorA1, OUTPUT);
Mr. Sucheth S and Mrs. Shobharani H.N, Dept.of ECE, RPT (2024-25) Page 65
Automation And Robotics (20EC53I)
pinMode(motorA2, OUTPUT);
pinMode(motorB1, OUTPUT);
pinMode(motorB2, OUTPUT);
void loop( ) {
{ digitalWrite(motorA1, HIGH);
digitalWrite(motorA2, LOW);
digitalWrite(motorB1, HIGH);
digitalWrite(motorB2, LOW);
digitalWrite(motorA1, HIGH);
digitalWrite(motorA2, LOW);
digitalWrite(motorB1, LOW);
digitalWrite(motorB2, LOW);
Mr. Sucheth S and Mrs. Shobharani H.N, Dept.of ECE, RPT (2024-25) Page 66
Automation And Robotics (20EC53I)
digitalWrite(motorA1, LOW);
digitalWrite(motorA2, LOW);
digitalWrite(motorB1, HIGH);
digitalWrite(motorB2, LOW);
digitalWrite(motorA1, LOW);
digitalWrite(motorA2, LOW);
digitalWrite(motorB1, LOW);
digitalWrite(motorB2, LOW); }
Resut: Upon uploading the code and powering the robot, it should be able to follow a
black line on a white surface. The robot will move forward when both sensors detect the
line and will turn accordingly when one sensor is off the line.
Mr. Sucheth S and Mrs. Shobharani H.N, Dept.of ECE, RPT (2024-25) Page 67
Automation And Robotics (20EC53I)
Aim:To control a stepper motor using an Arduino to demonstrate how to interface and control
stepper motors for precise movements.
Apparatus Required
Theory
A stepper motor divides a full rotation into a series of discrete steps, allowing for precise control
of position and speed. The Arduino can control the stepper motor's movements by sending a
series of pulses to the motor driver, which energizes the motor coils in a specific sequence. The
two common types of stepper motors are bipolar and unipolar, and the control method will vary
slightly based on the motor type and driver used.
Procedure
Connect the stepper motor to the motor driver according to the driver’s datasheet.
Connect the motor driver to the Arduino:
IN1, IN2, IN3, IN4 (or similar) pins to Arduino digital pins.
Power and ground connections for the driver and motor.
If using a bipolar motor, ensure to connect the coils correctly.
Install the Required Libraries:
Open the Arduino IDE and install the AccelStepper library for more advanced control.
Programming the Arduino: Use the following sample code to control the stepper motor.
Mr. Sucheth S and Mrs. Shobharani H.N, Dept.of ECE, RPT (2024-25) Page 68
Automation And Robotics (20EC53I)
Block Diagram
Code:
#include <Stepper.h>
void setup( ) {
void loop( ) {
Mr. Sucheth S and Mrs. Shobharani H.N, Dept.of ECE, RPT (2024-25) Page 69
Automation And Robotics (20EC53I)
myStepper.step(stepsPerRevolution);
myStepper.step(-stepsPerRevolution);
Result: Upon running the program, the stepper motor will rotate 200 steps in one direction and
then return to the starting position.
Mr. Sucheth S and Mrs. Shobharani H.N, Dept.of ECE, RPT (2024-25) Page 70