In this project an RC car was created that could autonomously follow a black line, receive commands over WiFi that would control its movement, and display the command sent on an LCD screen.
The main microcontroller on this car was an MSP430. It controlled an LCD screen, the motors responsible for its movement, and sent and received commands from an ESP32 which was used as an IoT module. It used an IR sensor that was pointed towards the ground to differentiate between black and white.
The wheels on the car were controlled using pulse width modulation and it would read the information fed to it by the IR sensor through an Analog to Digital Converter. The software written for these two pieces of functionality come together to allow for line following. The car would move forward until it detect a black line, start turning until it detected the black line again in order to orient itself correctly on the line. Then it would start moving until it could no longer detect the black line, stop and turn until it could detect again on repeat in order to follow the line.
UART was used to communicate with the IoT module. The MSP430 would load a series of commands on startup that would be sent to the ESP32 in order to configure it and then start receiving strings from that ESP32 that would inform the MSP of what action it should take. A TCP protocol was used here and each command had to contain a specific series of character so ensure it was coming from the correct source.
The LCD screen was connected the the MSP430 through SPI communication and would display the command sent to it by the user.
This project did not utilize any RTOS and was bare metal. The software was centered around a main while loop that would get interrupted by timer and hardware interrupts for IR sensor readings, data being received from the IoT module, and button pressses alongside many others.