Final Project: Electronics & Control

01—Hardware

Further Research: Electrical

Diode for back current

V1 PCB testing Regime

v1 PCB Fixes

  • Properly desolder 5V on both buck converters
  • Design 3D printed standoff for HUSB
  • 5v breakout on Send

v2 Running Change List

  • Sort out how UART could be changed to I2C
  • lower profile screw terminals
  • Add Xiao pin number to all GPIO / communication silk names
  • GPIO ports have the GND side swapped
  • I2C_3 need to be connected
  • Remap GPIO to not use pin 1

V1 PCB Physical Testing

Basic Testing

PCB PWR

  • T: GND is GND
  • B: GND is GND
  • T: 3V3 lines are 3V3
  • B: 3V3 lines are 3V3
  • T: 5V lines are 5V
  • B: 5V lines are 5V

HUSB in

  • T: confirm +5V Out off board
  • B: confirm +5V Out off board

Buck Converter

  • T: 3V3 output from buck
  • B: 3V3 output from buck

Xiao ESP32 C3

  • T: Xiao Powers on
  • ⁉️PWR light seems to be blinking rapidly, confirmed that 1 of these Xiaos (labelled Xiao 2) exhibits this behavior while the other does not
  • B: Xiao Powers on
  • T: Confirm all Xiao Pin mapping
  • B: Confirm all Xiao Pin mapping

PWR Switch

  • T: PWR switch functioning
  • B: PWR switch functioning

External Spotlight

  • Disassemble and measure V+ input of external spotlight

Shottkey Diodes (optional)

  • B: board PWR IN and XIAO toggle PWR in
  • T: board PWR IN and XIAO toggle PWR in

Advanced Testing

PUMP GPIO

  • T: Test 1-4 GPIO for pump functioning
  • Pump not working
    • tested alternate pump
    • tested alternate Xiao
    • fixed ground / signal mix up in wiring for PCB female connectors
    • ChatGPT when asked to simplify the code and generate PPM from basic PWM was defualting to old syntax for the esspresif boards for the LEDC functions
    • I switched over to the Xiao ESP32 c6 as I had suspicions that the arbitrary switch to the c3 could have been causing the new issues
    • New pumps seem to have initial resistance and take several minutes of running to “loosen up”
    • GPIO pins are being called out (not digital IE d8) so when you change the pin it coresponds to the GPIO assignment not its digital or analog number
    • GPIO 19, 2, 21 are confirmed to work to send pump control PPM, and all 3 can run separately but running all 3 requires different implementation
    • T: All pumps working simultaneously on GPIO 19, 2, 21

I2C Bus

  • T+B: Test I2C with grove display
    • Grove display works with both T+B I2C_1 and I2C_2 Power must be cycled for it to be operational. I2C_3 is confirmed to be disconnected from SDA and SCL
  • B: Test all I2C grove ports with all MM_wave (1-3)
  • B: Run DFR encoder (SEN0502) with test code on I2C bus

UART COMMS

  • B: confirm serial send and receive communication
  • T: confirm serial send and receive communication
  • T+B: Test board to board UART comms
  • T+B: Test board to board UART with long cable
  • Test continuity on long cable

Electronics BOM [ ]

BOM: v1_Design (SENDER + RECEIVER)

QuantityFiles & mediaName$Product Link
2CleanShot 2025-04-01 at 15.57.16@2x.jpgAdafruit USB Type C Power Delivery Dummy Breakout - I2C or Fixed - HUSB238$5.95https://www.adafruit.com/product/5807
4CleanShot 2025-04-01 at 21.41.06@2x.jpgDC-DC Multi-output Buck Converter (3.3V/5V/9V/12V)[DFR1015]$5.00https://www.dfrobot.com/product-2599.html
3CleanShot 2025-04-01 at 15.44.33@2x.jpgGravity: Digital Peristaltic Pump $24.00https://www.dfrobot.com/product-1698.html
1CleanShot 2025-04-01 at 15.44.26@2x.jpgGravity: 360 Degree Rotary Encoder Module$9.90https://www.dfrobot.com/product-2575.html
1CleanShot 2025-04-01 at 15.44.00@2x.jpgGrove - OLED Display 0.96" (SSD1315) I2C Interface Compatible with Arduino$6.00https://www.seeedstudio.com/Grove-OLED-Display-0-96-SSD1315-p-4294.html
3CleanShot 2025-04-02 at 16.15.30@2x.jpgGravity: MAX30102 PPG Heart Rate and Oximeter Sensor (I2C/UART)$21.90Link
3CleanShot 2025-04-01 at 15.44.19@2x.jpgXIAO 60GHz mmWave Human Breathing and Heartbeat Sensor -[MR60BHA2]$29.90link
4R0566046-06.webp4.7 kOhms ±1% 0.25W, 1/4W Resistencia en microprocesador 1206 (3216 métrico) Resistente a la humedad Película gruesa [CR1206-FX-4701ELF] (100)$1.18Link
4R0566046-06.webpRES SMD 1K OHM 1% 1/4W 1206 [CR1206-FX-1001ELF] (100)$1.66Link
2CleanShot 2025-04-01 at 15.52.51@2x.jpgDIODE SCHOTTKY 40V 1A DO214AC [SS14]$0.29Link
2CleanShot 2025-04-01 at 15.44.09@2x.jpgRocker Switch SPST 10A (AC) 125 V Panel Mount, Snap-In [RD11131121]$0.90https://www.digikey.es/en/products/detail/e-switch/RD11131121/4029076
4CleanShot 2025-04-02 at 17.42.47@2x.jpg7 Posiciones Cabecera Conector 0.100" (2.54mm) Orificio pasante Oro [S7040-ND]$0.53Link
1CleanShot 2025-04-01 at 22.54.09@2x.jpgBUSOHE Cat 8 Ethernet Cable 10M, Flat Network Cable RJ45 Gigabit $16.00link
2CleanShot 2025-04-01 at 15.45.08@2x.jpg2 Position Wire to Board Terminal Block Horizontal with Board 0.197" (5.00mm) Through Hole [691137710002]$2.16Link
4CleanShot 2025-04-01 at 22.01.58@2x.jpgGROVE CABLE 4POS 50CM 2PACK [A034-C]$1.95
4CleanShot 2025-04-06 at 22.08.02@2x.jpgGravity: Digital Sensor Cable for Arduino - 50cm (10 Pack)$6.50Link
4CleanShot 2025-04-01 at 16.09.34@2x.jpg CONN HEADER VERT 3POS 2.54MM$0.10link
11CleanShot 2025-04-06 at 21.54.54@2x.jpgCONN HEADER R/A 3POS 2MM [S3B-PH-SM4-TB]$0.60Link
CleanShot 2025-04-06 at 22.02.34@2x.jpgGROVE FEMALE HEADER R/A 20PACK$2.80Link


Initial Component Research

Peristaltic Pumps

DFRobot — PPM Peristaltic Pump

  • I am currently evaluating the DFR peristaltic pump. It seems to be quite responsive I would prefer if it were a bit quieter though.
  • PPM control is important whatever pump I use it needs to be easy to actuate precisely.

Atlas Scientific — EZ Pump

  • Looks very promising and has an I2C interface which making IO management on the Xiao much easier. 4 times the cost as the DFR pump.
  • Noise seems to be the same as DFR
  • Easier communication and calibration compared to the DFR Peristaltic

Solenoid Valves

Air solenoid valves

  • I think the air valves are more appropriate because the seem to come in smaller sizes. I am not sure quality is so relevant here. Similarly, I am not sure if it should matter that it is made for preasurized air and not water as the use case is pretty light.
  • Sound and dosing accuracy are a big concern and I am not sure if solenoids are an improvement over the peristaltic pump approach.

High Performance Cartridge Style Valves

  • There is a lot of product differentiation in this space and I don’t know the first thing about these. This cartridge style seems to be common in industrial automation. I have also seen them used on high end large format printers.

Component Specification Reference

Xiao C6

At a glance:

  • Bootloader mode
    • Step 1. Press and hold the BOOT button on the XIAO ESP32C6 without releasing it.
    • Step 2. Keep the BOOT button pressed and then connect to the computer via the data cable. Release the BOOT button after connecting to the computer.
    • Step 3. Upload the Blink program to check the operation of the XIAO ESP32C6.

Xiao C3

At a glance

  • Connection type Grove I2C 3.3 or 5V
  • vcc = 3.3V or 5V
  • Max W = .5 (for 4) = 2 W

Key Specs

  • Human Static Presence Detection: up to 6 Meters
  • Breathing and Heartbeat Detection: 1.5 Meters
  • WS2812 RGB LED (neopixel) onboard
  • Sensor will get best reading pointed at chest

DFR Peristaltic Pump

Seeed MR60BHA2 MM Wave [60 Ghz]

DFR I2C Heart Rate Sensor

DC-DC Multi-output Buck Converter (3.3V/5V/9V/12V)[DFR1015]

Process Documentation

KiCAD library to Flux Library

I am writing this for posterity. The process of importing components in flux is very complicated and convoluted. There are more details, but here are the broad strokes. So I don’t forget how to do this.

  1. Upload your KiCAD sym into the main hub (before you make a project)
  1. This will automatically import details and symbol.
  1. Add your footprint and step in the asset manager panel.
  1. You now need to link them in the footprint panel mode. You do this by selecting the footprint object in the objects panel adding an asset rule and selecting the footprint .mods file for the component.
  1. The same approach is taken for the 3D step model, but by creating a new 3D model object in the ‘objects panel’ adding asset selector and then your 3D model.
  1. Last step is publishing the part.
  1. Part needs to be reopened in a fresh document to view the custom symbol.

How to smooth sensor data

03— Software DEV

Roadmap

Goal: A limited version of the full program with a single DFR pulse sensor to reduce complexity of the system. It should be able to pass processed sensor data from the Sender to the receiver to actuate a pump at the specified rate.

  1. Receiver: Pump multi_pulse_control over serial
  1. Sender: I2C bus to read single and print to console dfr_heart_sensor
  1. Sender/Receiver: send_and_receive code
  1. Sender/Receiver: (dfr_heart_sensor_send) + (pulse_control_receive)

Program descriptions

Phase 1

Phase 2

Goal: Get all 3 SEED mm wave sensors working.

  1. Sender: mm_wave_heart_sensor
  1. Sender: multi_mm_wave_heart_sensor
  1. Heart rate input sampling + Arduino Cloud
    • Heart and Breath rate per minute are read from 1 R60BHA2 mm wave sensor and can be displayed in the serial console for debugging. Code is written to easily distinguish sensors from each other when all 3 are added later.
    • MR60BHA2 Program
      • I have a hardware setup where I am reading data from 3 MR60BHA2 mm wave sensors. Each of these MR60BHA2 sensors include a Xiao ESP32 C6. These 3 Xiao ESP32 C6’s are then connected to an I2C bus through the pins D10 [SDA] and D0 [SCL]. A library called Seeed_Arduino_mmWave.h exists to read data from these sensors and should be used.
      • The generated code should read sensor data from the Xiao ESP32 C6 and send the information to be read by the Xiao ESP32 C3 to be read from the I2C bus every 2 seconds.
        • Human detection feature written in console as “Human [yes] or [no]”
        • Beats per minute written as “BPM [#]”
        • Breath rate written as “BR [#]
      • Since 3 sensors will share the bus it is important that the code includes the names Heartsense_1, Heartsense_2, or Heartsense_3 as an identifier. Similarly, each sensor will need its own unique I2C address. Please choose an I2C address in code comments provide 3 additional I2C addresses that could be used.
      • The code should also include the ability to connect the board to a computer directly (not using the I2C) bus so that the information above could be read in the serial console for debugging.
    • SENDER Code
      • Earlier I generated code that is loaded onto a Xiao ESP32 C6 that reads information from the MR60BHA2 mm wave sensors. What I need to do now is create code for a Xiao ESP32 C3 that reads these sensors from its connected I2C bus. Object names for the 3 sensors inputs are Heartsense_1, Heartsense_2, and Hearsense_3. The code should parse the following items for all 3 sensors on a single line as the data comes in and should be viewable in the serial console for debugging
        • Human detection feature written in console as “Human [yes] or [no]”
        • Beats per minute written as “BPM [#]”
        • Breath rate written as “BR [#]
      • SENDER with Arduino Cloud to view all of the incoming data graphs
        • The Arduino code previously written should be integrated into this Arduino Cloud control. The cloud control code is intended to read the sensor data from Heartsense_1, Heartsense_2, and Hearsense_3 and publish each of their attributes list below seperately so that the information can be displayed in the arduino cloud dashboard.
          • Human detection feature written in console as “Human [yes] or [no]”
          • Beats per minute written as “BPM [#]”
          • Breath rate written as “BR [#]
        • Hear sensor I2C addresses
          • Heartsense_1 → 0x10
          • Heartsense_2 → 0x11
          • Heartsense_3 →0x12