Line Sensor Working Environment Tools: Enveronment: PlatformIO Framework: Arduino Code editor: Visual Studio Code Hardware: Mcu: STM32G030C8T6 Magnetic Sensor: QMC5883 How to build and Flash Setup Visual studio Code The VS code setup Instructions are available in Getting Started. Setup Visual studio code according to the Host operating system. Install PlatformIo extension inside VS code Install STM32 Platform in PlatformIo Install Board support packages for STM32G0C038T6 Select the board and Framework as Arduino Building and Flashing Application: To build the application, clone the affbotics_software repo and go to the folder Line_sensor Pull the repository locally Navigate to the directory affbotics_software/firmware/avg/Line_sensor/ Select the COM port Click Upload Program Flow Basic Workflow: Firmware is present in affbotics_software/firmware/avg/Line_sensor/src/main.cpp Line sensor communicates using Modbus over RS485 The Modbus I registers from address 0X1000 to 0X1003 can be read to obtain number of tracks, markers, Left track error and Right track error Am a Geek: Modbus Register address and SLAVE_ID can be changed by changing #define values Uncomment the line #define DEBUGMODE 1 to continuously print raw sensor readings in CSV format through serial. Track and marker threshold values can be tweaked by changing #define trackThreshold and #define markerThreshold Experiments Nov-25-2022 NFC tests We have tested the possibility of having some instructions flashed into the NFC tags so that the AGV can read and process the data on the fly, but it turns out that its only possible while the AGV is moving slowly otherwise it can't read the data reliably. image