0% found this document useful (0 votes)
191 views16 pages

Introduction Robot HAT

The Robot HAT is a board that connects to a Raspberry Pi and provides various interfaces to connect sensors, modules, and hardware to enable additional robot functions. It has interfaces for power input/output, GPIO pins, I2C, UART, servos, motors, ultrasonic sensors, line tracking modules, LEDs, and more. The document provides circuit diagrams and code examples to demonstrate how to use each interface to connect components and control them through the Raspberry Pi.

Uploaded by

Prasanth S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
191 views16 pages

Introduction Robot HAT

The Robot HAT is a board that connects to a Raspberry Pi and provides various interfaces to connect sensors, modules, and hardware to enable additional robot functions. It has interfaces for power input/output, GPIO pins, I2C, UART, servos, motors, ultrasonic sensors, line tracking modules, LEDs, and more. The document provides circuit diagrams and code examples to demonstrate how to use each interface to connect components and control them through the Raspberry Pi.

Uploaded by

Prasanth S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

1

Introduction of Robot HAT

Robot HAT

When you get the robot product, you will see a board with its name printed onside: Adeept
Robot HAT, which is an important part of the robot. There are many interfaces on the Robot HAT.
You can connect sensors and electronic hardware modules to the board by those interfaces to realize
more functions. This robot works on the Raspberry Pi. Let's first get to know the Robot HAT.

[Vin]: The vin interface is an interface for external power supply.

[Switch]: Switch is to turn the Robot HAT ON/OFF.

[Micro USB]: The Micro USB interface can connect the Robot HAT to a computer or other device,
and can also supply power for the Robot.

[Power LED]: Power LED is used to indicate the power status of Robot HAT. If the LED is on, it
means that the Robot HAT is powered on and can run; otherwise, the Robot HAT is off.

Support email:
2

[Tracking]: The pin interface of Tracking Module.

[WS2812]: The pin interface of WS2812 Module.

[3.3V-GND]: 3.3V power supply interface.

[Uart]: Uart interface.The upper pin is GPIO14, the lower pin is GPIO15.

[GPIO 40-PIN]: General Purpose Input Output (GPIO) is designed as a slot with two rows of pins on
the Robot HAT. GPIO can be used to connect various peripheral electronic devices and sensors and
control or monitor these devices with input/output level signals. In robot products, this GPIO
interface is connected to the GPIO pins on the Raspberry Pi.

[5V-GND]: 5V power supply interface.

[IIC]: IIC interface. It is also the interface of the OLED screen module.

[MPU6050]: The interface of MPU6050 sensor.

[Port]: Divided into Port 1, Port 2, and Port 3 interfaces, which are commonly used to connect small
LED lights.

[Servo port]: Servo interface.

[motor]: Divided into motor 1 and motor 2 interfaces.

[Ultrasonic]: Ultrasonic interface.

Interface Introduction

Servo port
PCA9685 chip, using I2C bus can control 16 steering gears.

Circuit schematic diagram:

Support email:
3

Raspberry Pi GPIO uses BCM encoding.

Servo port position:

Support email:
4

Port 0 refers to the three pins in the first column, which are black GND, red 5V, and yellow signal
pins. Port 1 represents the three ports in the second column. By analogy, a total of 16 servo ports can
be used.

Download the test code:

sudo git clone https://www.github.com/adeept/adeept_HAT.git


To test the servo code,

Robot HAT Interface Module Interface

GND GND

5V VCC

Signal pin Signal pin

Run on the Raspberry Pi command line:

sudo python3 adeept_HAT/RobotHAT/01_servo.py


The steering gear will rotate to 0°, 90°, and 180° every 1s.

Ultrasonic

Used to control the ultrasonic module, for example: HC-SR04.

Circuit schematic diagram:

Support email:
5

Ultrasonic interface location:

The ultrasonic interface pins from top to bottom are: GND, GPIO08, GPIO11, 5V.

To test the ultrasonic code,

Robot HAT Interface Module Interface

GND GND

GPIO08 Echo

GPIO11 Trig

5V VCC

Support email:
6

Run on the Raspberry Pi command line:

sudo python3 adeept_HAT/RobotHAT/02_ultra.py


You will see the distance of the ultrasonic detection printed out.

Tracking
Used to control the 3-way line patrol module.

Circuit schematic diagram:

Interface location:

Support email:
7

The pins of the three-way line inspection interface from top to bottom are: GND, GPIO19, GPIO16,
GPIO20, 3.3V.

Test the Raspberry Pi line module code,

Robot HAT Interface Module Interface

GND GND

GPIO19 Signal pin 1

GPIO16 Signal pin 2

GPIO20 Signal pin 3

3.3V VCC

run on the Raspberry Pi command line:

sudo python3 adeept_HAT/RobotHAT/03_findline.py

You will see the 3 test results of the line-following module printed out.

Support email:
8

WS2812
Used to control ws2812 lights.

Circuit schematic diagram:

Interface location:

Support email:
9

The ws2812 interface pins from top to bottom are: GND, 5V, and GPIO12.

To test the ws2812 code,

Robot HAT Interface Module Interface

GND GND

5V VCC

GPIO12 Signal pin

run on the Raspberry Pi command line:

sudo python3 adeept_HAT/RobotHAT/04_ws2812.py


You can see that the first three lights of the ws2812 light are on blue, green, and red, and turn off
every 1s.

Motor
Use the L298P chip to control the motor.

Circuit schematic diagram:

Support email:
10

Interface location:

For the motor interface pins, the upper end is connected to the positive pole of the motor, and the
lower end is connected to the negative pole of the motor.

To test the motor interface code, run on the Raspberry Pi command line:

sudo python3 adeept_HAT/RobotHAT/05_motor.py

Support email:
11

You can see that the motor rotates forward for 3 seconds and then pauses, then reverses for 3
seconds.

Port
Used to control single color LED or switch.

Circuit schematic diagram:

Interface location:

Support email:
12

There are 2 pins in each interface, the upper part is GND, and the lower part is the signal pin. The
signal pins from left to right are GPIO05, GPIO06, GPIO13. (Note: There are some problems with
port GPIO05 temporarily, please use the other two interfaces)

To test the LED interface code,

Robot HAT Interface Module Interface

GND GND

GPIO05/GPIO06/GPIO13 Signal pin

run on the Raspberry Pi command line:

sudo python3 adeept_HAT/RobotHAT/06_LED.py


You can see that the three LEDs on Robot HAT turn on and off regularly.

IIC
Used to control some modules that require IIC driver. For example: OLED screen.

Circuit schematic diagram:

Interface location:

Support email:
13

IIC interface pins from top to bottom are: 3.3V, GND, GPIO03 (SCL1), GPIO02 (SDA1).

Test the IIC interface code, take the OLED screen as an example, the OLED screen occupies the I2C
address 0x3C.

Robot HAT Interface Module Interface

3.3V VCC

GND GND

GPIO03(SCL1) SCL

GPIO02(SDA1) SDA

Run in the Raspberry Pi command line:

sudo python3 adeept_HAT/RobotHAT/07_OLED.py


If an OLED screen is installed, you can see 6 lines of text displayed on the screen.

MPU6050

Support email:
14

Used to control the MPU6050 acceleration sensor.

Circuit schematic diagram:

Interface location:

Only use the 4 pins below, from bottom to top: 3.3V, GND, GPIO03 (SCL1), GPIO02 (SDA1).

Test the MPU6050 interface code

Support email:
15

Robot HAT Interface Module Interface

3.3V VCC

GND GND

GPIO03(SCL1) SCL

GPIO02(SDA1) SDA

run it on the Raspberry Pi command line:

sudo python3 adeept_HAT/RobotHAT/08_MPU6050.py


If MPU6050 is installed, you can see that the acceleration values in the X, Y, and Z directions are
printed.

Precautions for Using the Robot HAT


When you are performing software installation, structural assembly or program debugging, you
can use a USB cable to power the Raspberry Pi. If the Raspberry Pi is installed with Robot HAT, you
can connect the USB cable to the USB port on the Robot HAT. Robot HAT will power the
Raspberry Pi by the GPIO interface.

Different Raspberry Pi models have specific requirements for current. For example, the
Raspberry Pi 3B needs at least 2A to boot up, yet the Raspberry Pi 4 needs 3A to boot normally.
When you use the power adapter to power the Raspberry Pi, you can check the specifications on your
power adapter.

When Robot HAT is connected to a load, such as a motor or a few servos, a high-current power
supply is required to connect to Vin on the Robot HAT. You can use two high-current 18650
batteries for power supply.

Support email:
16

When USB port on the Robot HAT is used as power supply, the switch of Robot HAT does not
control whether to power on or off, but only controls the power supply by Vin onside.Do not use
both the USB port and Vin on the Robot HAT to supply power at the same time.

If you need to debug the program for a long time and don’t want to remove the battery, you can set
the switch on the Robot HAT to OFF, so that when you connect the Robot HAT with a USB cable,
Robot HAT is powered by USB.

If your robot reboots automatically after booting, or disconnects and reboots at the moment it starts
to move after normal booting, it is likely that your power supply does not provide enough current.

It is recommended to choose the 18650 battery with the maximum continuous discharge current
exceeding 4A, or the 18650 battery with "high rate discharge".

You may also power the Robot HAT with high energy li-ion battery; Robot HAT can be supplied by
a power source under 15V.

Support email:

You might also like