How to Make (Almost) Anything


Week 12
Task1: Write and application that interfaces a user with an input & output device that you made.
In this week’s assignment I used XiaoRP2040 [1] and a pressure resistive sensor [2] to read data from analog port (A3) from XiaoRp2040 and read this COM16 port data with python [3] to create dynamic plots and charts. First, I designed the PCB in KiCAD [4], below is the schematic and PCB view of the board (edge cut is filled with white color and traces are black and white). I used 5.5 kΩ resistor in the circuit and read the sensor data via A3 analog pin.
PCB design
After that I used Roland SRM20 [5] and Mods [6] interface to machine the PCB, I used single sided copper-FR4. In order not to waste material, I used already machined copper-FR4 sheet from a previous user and stored it on the shelf we have in the makerspace. Lastly, I soldered the microcontroller, resistor, and resistive pressure sensor on to the PCB.
PCb fabrication
To program the board, I used Arduino IDE [7] and python to visualize the dynamic data to interact with the user. Below are the code snippets. To read serial port data via python, I used ‘serial’ library and accessed the COM16 port which is the port XiaoRP2040 that is connected to and stream data. Second, I used ‘matplotlib’ library to visualize the data and rest of the code is just processing the data and plotting live stream.
PCB coding
Below is the video that shows data reading and dynamic plot.


PCB files: https://drive.google.com/drive/folders/1suKXt11-wpwLFogxVBIXyoULJ2yLH54Q
References:
[1] https://wiki.seeedstudio.com/XIAO-RP2040/
[2] https://www.digikey.com/en/products/detail/dfrobot/SEN0295/10136550
[3] https://www.python.org/
[4] https://www.kicad.org/
[5] https://www.rolanddga.com/products/3d/srm-20-fresadora-compacta
[6] https://modsproject.org/
[7] https://www.arduino.cc/

Umut Civici