Welcome to Week 12

Networking and Communications


For this week I wanted to make it as relatable to my final project as possible. So I decided I wanted the Xiao ESP32-C3 to connect to my phone via BLE and control a stepper motor from that. So to start off I needed to design a new PCB to also be used for my final project. The design used one of Neil's as a reference from the HTMAA website. Unfortunately I messed up on the placement of a capacitor and fried the driver so I made a new board with the correct schematic and tried for a second time. The PCB schematic and board are shown here:


Next I ran over to the mill to cut this bad boy out and start sottering on some components.



I was using the DRV8428 Stepper Driver so it required me to learn how to actually use the hot air gun and sotter paste.


After everything was ready to go physically, my next task was to tackle to code. This is something I struggle woth very much so I wasn't looking forward to figuring this out. With help from ChatGPT, my amazing TAs, and some friends I was finally able to get it to work. First I tackled making the motor move.

Then I tried to get some BLE connectivity between the Xiao and my phone using nRF Connect. This was finally successful after many failed attempts. I was having a lot of issues assigning the inputs to the Rx values being that I was using UART. But finally I was able to get it so that when I entered low or high it either went forwards or backwards accordingly.
Code:



This shows how I connected and sent information using my mobile app:




And here's the motor moving: