Maker Pro
AT&T IoT Platform This is a fork of Surveillance robot

Fork of Surveillance robot

November 28, 2026 by Elizabeth Roddy
Share
banner

Idea for this project is to create a mini‑robot that acts as a surveillance device for apartments or closed indoor spaces when no person is present (for example, during vacations). There is a top screen, and a screen at the body top.

Important: this is an working progress project.

Introduction

The robot is built on a 3-wheeled platform, consisting of two motorized wheels and one caster wheel.

The platform used is a common one in the world of IoT and robotics for makers: Kit Robot cu 2 Motoare pentru Arduino / Raspberry PI DIY

The Renesas RA6T3 board is the "brain" of this robot: calculates wheel odometry, queries various sensors, communicates with the outside world, and performs many other specific tasks.

The IDE used to develop the software for this project is e2 Studio from Renesas.

The robot is powered by a single cell Samsung 18650 Li-Ion 3,7V -25R.

The project is divided into several steps:

Step 1 - motors and H bridge;

Step 2 - odometry;

Step 3 - ToF sensors;

Step 4 -


Step 1 - motors and H bridge

To drive the motors, I used an L9110S dual-bridge driver. The advantage of this driver lies in its simple control scheme and the ability to vary the motor speed, thereby adjusting the robot's velocity.

L9110S module:

Pins allocation:

RA6T3         L9110S

P212 (GPT0B) -------> A-IA PWM GPT0 -> GTIOC0B

P213 (GPIO)  -------> A-IB PWM GPT0 -> GTIOC0A

P104 (GPT1B) -------> B-IA PWM GPT1 -> GTIOC1B

P409 (GPIO) -------> B-IB PWM GPT1 -> GTIOC1A

This driver can be used in 2 ways: with Lo/Hi signals or Lo/Hi + PWM. I chose second option because I want to change the robor speed.

PWM signals are generated with two timers from RA6T3: GPT0 and GPT1. These timers are configured using FSP Configuration from IDE.

PWM is set at 20KHz and signal is square-wave.

In the main application I created to files that will drive the motors, called motor.c and motor.h. In these files I developed the specific functions that are used to c ommand the motors through the H-bridge driver L9110S:

void motor_init(void);

void motor_stop(void);

void motor_forward(uint8_t speed);

void motor_backward(uint8_t speed);

void motor_turn_left(uint8_t speed);

void motor_turn_right(uint8_t speed);

The parameter "speed" is actuallt the PWM value; Ex: speed = 75 --> the PWM will be 75%.


Step 2 - odometry

The robot platform features two drive wheels, powered by two TT-type geared motors. Mounted on the shaft of each TT motor is a 20-slot disc, paired with IR sensors used to determine the wheel's speed and direction of rotation.

To measure distance and direction, I mounted 2 IR sensors on each 20-slot disc.

OBS: The sensors used must be powered at 5V; the RA6T3 board features a number of 5V-tolerant pins, even though the board itself is powered at 3.3V.

So: there are 2 IR sensors on each wheel. I have assigned 2 pins to read these sensors, using the following configuration: one pin triggers an interrupt when a slot breaks the IR beam; within the interrupt routine, the state of both pins is read, thereby determining the direction of rotation.

Pins allocation:

LEFT_A --> P304 --> IRQ9

LEFT_B --> P113 --> GPIO

RIGHT_A --> P302 --> IRQ5

RIGHT_B --> P500 --> GPIO

In the main application I created two files that will handle the odometry: encoder.h and encoder.c. In these files I developed the specific files that will hamndle the encoders events; I set the also the pin interrupts callbacks where I count up and down the numbers of encoder windows that passed through the IR beam.

For pin interrups I set two external interrupts from FPS Configuration uwing New stack -> Input -> External IRQ (r_icu):

PINs used to read the directions, wirking toghether with PINs with interrupts are set as input:

Pictures with the robot in this stage:

To keep the robot moving in a straight line, I implemented a simple algorithm: I read the differences between the wheel-encoder slots, calculate the error, and then adjust the PWM value for each wheel. Using this simple approach, the robot travels in a roughly straight line.

For this, I configured a third timer, a General PWM Timer (r_gpt), set to trigger a callback function every 100ms. Within this callback function, I read the number of slots on each wheel and calculate the difference between them; this difference is then converted into a `pwm--` or `pwm++` adjustment, which is applied to the forward-motion command for the motors.

Step 3 - distance measurement

For distance measurement, I used the VL53L0X sensor from ST; I chose this option over the well-known HC-SR04 (ultrasonic sensor) because there are cats in the house, and I don’t want to disturb them with sound.

The VL53L0X sensor lacks a library that can be used directly within Renesas e2 studio; therefore, the open-source implementation by Pololu was analyzed for the purpose of integrating the sensor. The functions for accessing the I²C bus were re-implemented for the Renesas RA6T3 platform using the FSP SCI-I2C interface, while the initialization and configuration sequences were adapted and incrementally ported into a custom driver.

VL53L0X use MSB cor read/write 16/32 bits registers so, the implementation of read/write fiunctions over I2C use the same rule.





Related Content

Comments


You May Also Like