0% found this document useful (0 votes)
7 views

Arduino: Session 4 (Week 2)

Content: 1-DC motors 2- Motor driver 3- DHT 11 Sensor. 4- Introduction to the world of Serial communication protocols.

Uploaded by

hamdhwas6
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Arduino: Session 4 (Week 2)

Content: 1-DC motors 2- Motor driver 3- DHT 11 Sensor. 4- Introduction to the world of Serial communication protocols.

Uploaded by

hamdhwas6
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 42

Mansoura

Robotics
About Me
Mohamed Hamed :
►Computers and control systems
department.

► Mansoura robotics team


member.

► Arduino subteam.
Hackathon
7.0 ►
Arduino
Session 4
Mansoura Robotics
► agenda
① DC motor
⇛ LAB
② Motor Driver 1
③ DHT11 ⇛ LAB
2
④ Intro to serial communication
◐ DC Motor

⇛ What Is a DC Motor?
◐ DC Motor
A DC motor (Direct Current motor) is an electric
motor that converts direct electrical energy into
mechanical energy. It operates using the
interaction of magnetic fields generated by the
current passing through its coils.
◐ DC Motor

small brushed DC motor DC geared motor


◐DC Motor
⇛Operating Data :
◉ Operating Voltage:
◉ Recommended Voltage :
◉ No-load Speed:
◉ Stall Torque:
◉ Current Consumption:
◉ Torque:
◉ Speed :
⇛Examples:
◐DC Motor
⇛Operating Data :
◉ Operating Voltage: 3V to 12V
◉ Recommended Voltage : 6V
◉ No-load Speed: 6V
◉ Stall Torque: ~1.5 kg·cm (at 6V)
◉ Current Consumption: 100-150 mA (no-load), 500-800 mA (stall)
◉ Torque: Higher, due to the internal gear reduction
◉ Speed : Low speed (due to gear reduction, ~200 RPM at 6V)
⇛Examples:

2WD 4WD
Car Car
◐DC Motor
⇛Operating Data :
◉ Operating Voltage:
◉ Recommended Voltage :
◉ No-load Speed:
◉ Stall Torque:
◉ Current Consumption:
◉ Torque:
◉ Speed :
⇛Examples:

Robo Tank ⇛
◔ Motor driver

⇛ What Is a Motor driver?


◔ Motor driver

◉ The motor driver is an integrated circuit designed for controlling the


speed and direction of DC motors. It is widely used in robotics and
automation projects.
◔ Motor driver

L298N module ⇛
5V regulator
Enable
jumper
5V
regulator
Motor(A) output Motor(B) output

Enable
Pin(B)
Power Input
pins pins
Enable
Pin(A)
◔ Motor driver
◉ Control Inputs: The driver has control pins (IN1, IN2, IN3, IN4) that are
used to set the direction of the motors. By toggling these inputs, you can
reverse the motor's direction.

◉ Enable Pins: (ENA and ENB) for each motor, allowing you to turn them
on or off and control speed using pulse width modulation (PWM).
◔ Motor driver
◔ CODE :
▶ LAB 1
◔ LAB 1

◉ You have a DC motor rotate it for 5 seconds in


one side then stop for 2 seconds then rotate it
in the other side for 5 seconds.
DHT11 ?
DHT11 ⇛
Digital Humidity and
Temperature sensor.
◕ DHT 11
◉ The DHT11 is a widely used sensor for measuring
temperature and humidity. It is inexpensive, easy to use,
and commonly found in DIY electronics and IoT projects.

◉ The DHT11 has a built-in thermistor and a capacitive humidity


sensor. When powered, it sends a signal via the data pin that
contains the temperature and humidity data. It uses a proprietary
digital protocol, but many libraries especially for Arduino simplify
reading the data from the sensor.
VC
C GN
DAT N pin
D s
A C
◕ DHT 11
⇛ Key features:
◉ Temperature Range: 0°C to 50°C with an accuracy of ±2°C.
◉ Humidity Range: 20% to 90% relative humidity with an
accuracy of ±5%.

◉ Single-wire Communication: It uses a single digital pin for


communication, reducing the number of connections
required.
◕ DHT 11
⇛ Pinout:
◉ VCC: Power supply pin (3.3V or 5V).
◉ Data: Digital output for transmitting temperature and
humidity data.

◉ NC: Not connected.


◉ GND: Ground pin.
◕ DHT 11
⇛ Applications :
◉ Weather Stations: Used in weather-monitoring systems.
◉ Home Automation: Integrated into home automation systems
to monitor and control environmental conditions.
◉ Greenhouses: to maintain optimal plant-growing conditions.
◉ IoT Devices: Widely used in IoT projects for environmental
sensing.
◕ CODE :
Serial commnication
● What is Serial
communication?
⇛ Serial
commnication
◉ The word serial comes from the way data is transmitted;
serial devices send bits on at a time on single wire

⇛ Communication protocol :

◉ UART ◉ I²C ◉ SPI


⇛ UART Protocol

◉ Data is sent on one wire, the transmit


wire (TX), and received on another,
receive wire (RX). On the other side of
the cable, it is connected to another
computer with a TX pin and an RX pin.
Inside the cable itself, the TX and RX
wires are inverted. The TX pin on one
side is connected to the RX pin on the
other side.
◕ CODE :
⇛ start a serial
connection:

⇛ Sending
text:
⇛ Serial communication
between computer and
Arduino:
▶ LAB 2
◔ LAB 2
◉ Using DHT11 sensor if the
temperature is more than 30 and humidity more than 70% turn on the
turn on fan and pump in one direction
and if the temperature is less than 30 and humidity less than 70% turn
on the fan and pump on the other direction.
▶ Search
⇛ Reading :

◉ LM35 ( temperature sensor).


◉ Moisture sensor
◉ Servo Motor
⇛ Next Session :

Blutooth Module and other


Sensors
Thank you

You might also like