Together We Can Do It!

This page is ad-free, instead of donating to me please consider supporting the Ukraine.

United24.ua

Home About my QRZ.com YouTube

Robot that avoids obstacles based on STM32 and FreeRTOS

Description

This robot is supposed to resemble the miniature toy version of Johnny 5 robot from the movie "Short Circuit 2". Learning STM32 I have decided to migrate this robot from Arduino to STM32F411 and FreeRTOS. It is amazing how much you can do with the power of Cortex M4 in STM32F411, FreeRTOS is in particular interesting because it allows you to use the kernel's scheduler to manage execution of tasks. Each task implements specific code that is executed in an infinite loop, so we don't have to manage what is executed in sequence, the scheduler does that for us based on tasks priorities. This allows for implementation of code that for the user gives immersion as if the robot was performing few things at the same time.

This project has a long history and I have made it before I acquired a 3D printer. Originally it was based on Arduino which is very limited when it comes to interrupt or methods of communication with peripherals. Now this project uses three timers. One is for counting the time in which a signal from an ultrasonic sensor returns. This sensor also uses interrupt so that the robot is not waiting for the signal in a hot loop but can actually execute something else. Second timer is used for control of servo motors of arms and neck. The neck is important because it moves ultrasonic sensor around. Angle of servo motors is controlled by the duty cycle of PWM signal generated by the timer. Third timer is also used to generate the PWM but for the motors so that speed can be controlled.

 

Basic specification

  • Based on STM32F411 (Discovery board)
  • HC-SR04 ultrasonic distance sensor mounted on servo
  • Two motors with PWM control
  • 360mm high
  • Three LEDs as a mouth
  • Powered by two 18650 cells
 

 

Used libraries

In this project I have used a driver that is not part of Cube IDE. I have also used code for the HC-SR04 from a great tutorial that I will link below.
  1. Firebull's driver for HD4478 Display

  2. Controllers tech tutorial on HCSR04 sensor

GitHub Cube IDE project

You can visit my GitHub repository to download the whole project. Link (sorry, not quite ready to publish it, email me if you need something)
Radios

Contact me

sp6gk 'at' protonmail.com

Restored tube radio

Here is demonstration of restored radio from 1938.

Band conditions

Flag counter

Flag Counter