Extend AeroAlign with mixed CoG planning and telemetry base
This commit is contained in:
+19
-51
@@ -1,51 +1,19 @@
|
||||
Component,Description,Quantity per Node,Amazon ASIN (US),AliExpress Link,Unit Price (USD),Total Price (2 nodes),Notes,Alternatives
|
||||
ESP32-C3 DevKit,ESP32-C3 development board (RISC-V 160MHz WiFi/BLE),1,B09FK6F3JH,https://s.click.aliexpress.com/e/_DFKZXXX,$6.50,$13.00,"USB-C flashing ESP32-C3-DevKitM-1 or similar","ESP32-S3 (B0B6FF8K2M $12) for more power"
|
||||
MPU6050 IMU,6-axis IMU (gyro + accel I2C),1,B08F7PZHVT,https://s.click.aliexpress.com/e/_DEYYYY,$4.50,$9.00,"GY-521 module with voltage regulator","BNO055 (B08M3P1KQZ $12) for better accuracy"
|
||||
LiPo Battery 1S,250-400mAh 1S LiPo battery with JST connector,1,B0BKP6Y3XZ,https://s.click.aliexpress.com/e/_DFZZZZZ,$8.00,$16.00,"400mAh for Master 250mAh for Slave","500mAh (B08R3KZZZZ $9) for extended runtime"
|
||||
TP4056 Charger,USB-C LiPo charging module with protection,1,B09KGGZZZZ,https://s.click.aliexpress.com/e/_DKZZZZZ,$1.50,$3.00,"Type-C USB includes overcharge/discharge protection","Micro-USB version (B07KZZZZ $1.20)"
|
||||
HT7333 LDO,3.3V LDO voltage regulator (250mA),1,B07P6RZZZZ,https://s.click.aliexpress.com/e/_DLZZZZ,$0.80,$1.60,"SOT-89 package","AMS1117-3.3 (B01GZZZZ $0.50) if using through-hole"
|
||||
Neodymium Magnets,N52 10mm diameter × 2mm thick magnets (optional magnetic mount),2,B08LZZZZ,https://s.click.aliexpress.com/e/_DMZZZZ,$5.00,$10.00,"For magnetic quick-mount sensor housing","Adhesive Velcro strips (B07KZZZZ $4) alternative"
|
||||
3M VHB Tape,Double-sided adhesive tape for magnetic mount base,1 roll,B01MZZZZ,https://s.click.aliexpress.com/e/_DNZZZZ,$8.00,$8.00,"5m roll lasts for 50+ sensors","Gorilla tape (B06XZZZZ $6) cheaper alternative"
|
||||
Rubber Pads,Silicone anti-slip pads for clips (6mm diameter),6,B07TZZZZ,https://s.click.aliexpress.com/e/_DOZZZ,$3.00,$6.00,"Self-adhesive prevent surface scratches","EVA foam pads (B08KZZZZ $2.50)"
|
||||
M2 Screws,M2×6mm screws for housing assembly,4,B01MZZZZ (assortment),https://s.click.aliexpress.com/e/_DPZZZZ,$0.10,$0.40,"Stainless steel kit (500pcs)","M3 (B07ZZZZ) if using larger standoffs"
|
||||
JST Connector,JST-PH 2.0mm 2-pin connector for battery,1,B07QZZZZ,https://s.click.aliexpress.com/e/_DQZZZZ,$0.30,$0.60,"Male + female pair comes with most LiPos","XH2.54 (B08ZZZZ $0.40) if battery uses different connector"
|
||||
22AWG Wire,Silicone wire for battery/charging connections,0.5m,B07RZZZZ,https://s.click.aliexpress.com/e/_DRZZZZ,$0.50,$0.50,"Red + black stranded","24AWG (B06ZZZZ $0.40) also acceptable"
|
||||
Heat Shrink Tubing,Heat shrink tubing assortment,5cm,B08SZZZZ (assortment),https://s.click.aliexpress.com/e/_DSZZZZ,$0.10,$0.10,"3mm diameter for wire insulation","Electrical tape (B07ZZZZ $2) if no heat gun"
|
||||
10kΩ Resistor,10kΩ resistor for voltage divider (battery ADC),2,B08FZZZZ (assortment),https://s.click.aliexpress.com/e/_DTZZZZ,$0.05,$0.10,"1/4W through-hole carbon film","Resistor kit (B016ZZZZ $8) for 1000pcs"
|
||||
USB-C Cable,USB-C to USB-A cable for charging/flashing,1,B0BYZZZZ,https://s.click.aliexpress.com/e/_DUZZZZ,$4.00,$4.00,"1m length sufficient","USB-C to USB-C (B09ZZZZ $5) for newer laptops"
|
||||
,,,,,,,
|
||||
,,,,TOTAL (2 Sensors):,,$72.30,
|
||||
,,,,Master Node Only:,,$36.15,
|
||||
,,,,Slave Node Only:,,$36.15,
|
||||
,,,,,,
|
||||
,,,,4-Sensor System:,,$144.60,
|
||||
,,,,6-Sensor System:,,$216.90,
|
||||
,,,,8-Sensor System:,,$289.20,
|
||||
,,,,,,,
|
||||
Optional Upgrades,,,,,,,
|
||||
BNO055 IMU,9-axis IMU with sensor fusion (I2C),1,B08M3P1KQZ,https://s.click.aliexpress.com/e/_DVZZZZ,$12.00,$24.00,"±0.1° accuracy vs MPU6050 ±0.5°","MPU9250 (B07ZZZZ $8) if 9-axis needed"
|
||||
ESP32-S3 DevKit,ESP32-S3 dual-core 240MHz (8MB flash),1,B0B6FF8K2M,https://s.click.aliexpress.com/e/_DWZZZZ,$12.00,$24.00,"Faster web server response","ESP32-C3 sufficient for most users"
|
||||
500mAh LiPo,Larger battery for 6+ hour runtime,1,B08R3KZZZZ,https://s.click.aliexpress.com/e/_DXZZZZ,$9.00,$18.00,"Extends Master runtime to 6h","400mAh (default) provides 4h"
|
||||
,,,,,,,
|
||||
3D Printing Materials,,,,,,,
|
||||
PLA Filament,PLA filament for sensor housing (1kg),0.02kg,B07PZZZZ,https://s.click.aliexpress.com/e/_DYZZZZ,$20.00,$0.40,"~20g per node Black recommended","PETG (B08ZZZZ $25) for heat resistance"
|
||||
PETG Filament,PETG filament for flexible clips (1kg),0.01kg,B08ZZZZZ,https://s.click.aliexpress.com/e/_DAZZZZ,$25.00,$0.25,"~10g for 6 clips","TPU (B09ZZZZ $30) for maximum flexibility"
|
||||
,,,,,,,
|
||||
Tools Required (One-Time Purchase),,,,,,,
|
||||
Soldering Iron,Temperature-controlled soldering station,1,B08RZZZZ,https://s.click.aliexpress.com/e/_DBZZZZ,$25.00,$25.00,"Hakko FX-888D or similar","Basic iron (B06ZZZZ $15) acceptable"
|
||||
Solder Wire,60/40 tin-lead solder (0.8mm),1 roll,B07SZZZZ,https://s.click.aliexpress.com/e/_DCZZZZ,$8.00,$8.00,"Lead-free (B08ZZZZ $10) for EU compliance",
|
||||
Heat Gun,Heat gun for heat shrink tubing,1,B08TZZZZ,https://s.click.aliexpress.com/e/_DDZZZZ,$12.00,$12.00,"Or use lighter carefully","Mini heat gun (B07ZZZZ $8)"
|
||||
Wire Strippers,Wire stripper/cutter tool,1,B08UZZZZ,https://s.click.aliexpress.com/e/_DEZZZZ,$10.00,$10.00,"Automatic recommended","Manual (B06ZZZZ $6)"
|
||||
3D Printer,FDM 3D printer (200mm build volume),1,See notes,,,$200-500,"Ender 3 ($200) Prusa Mini ($400) Bambu P1P ($500)","Print service (3D Hubs) $10-20 per set"
|
||||
,,,,,,,
|
||||
TOTAL BOM (2-Sensor System):,,,,,$72.30,,"Competitive: GliderThrow $600 (8 sensors) SkyRC $80 (2 sensors)"
|
||||
TOTAL BOM (8-Sensor System):,,,,,$289.20,,"Our 8-sensor: $289 vs GliderThrow $600 (52% savings)"
|
||||
,,,,,,,
|
||||
Notes:,,,,,,,
|
||||
- ASIN codes are placeholders (B0XXXXXX format) - verify current Amazon listings,,,,,,,
|
||||
- Prices fluctuate ±20% based on seller and shipping,,,,,,,
|
||||
- AliExpress links typically 30-50% cheaper but 2-4 week shipping,,,,,,,
|
||||
- Total includes all components for 2 complete sensor nodes (Master + Slave),,,,,,,
|
||||
- 3D printing materials cost negligible (~$0.65 per system),,,,,,,
|
||||
- Tools are one-time purchase shared across projects,,,,,,,
|
||||
- Multi-sensor systems (4/6/8 nodes) use same components multiplied,,,,,,,
|
||||
Category,Component,Description,Typical Qty,Used In,Notes
|
||||
Core MCU,ESP32-C3 DevKit,Low-cost main board,1 per node,"Master, IMU Slave, CoG Scale","Default low-cost choice"
|
||||
Core MCU,ESP32-S3 DevKit,Higher headroom alternative,1 per node,"Master, IMU Slave, CoG Scale","Useful for USB and future UI/diagnostics"
|
||||
IMU,MPU6050,GY-521 style 6-axis IMU,1 per IMU node,"Master, IMU Slave","Current robust driver implemented"
|
||||
Power,LiPo 1S,Portable battery pack,1 per portable node,"Master, IMU Slave, CoG Scale","Capacity depends on runtime target"
|
||||
Power,TP4056 USB-C,LiPo charger/protection board,1 per portable node,"Master, IMU Slave, CoG Scale","Optional for bench-powered scale jig"
|
||||
Power,3.3V regulator,Clean 3.3V supply,1 per portable node,"Master, IMU Slave, CoG Scale","Avoid noisy supply rails"
|
||||
Battery ADC,10k resistor,Voltage divider top resistor,1 per monitored node,"Master, IMU Slave","Use only where ADC monitoring is actually wired"
|
||||
Battery ADC,10k resistor,Voltage divider bottom resistor,1 per monitored node,"Master, IMU Slave","Master S3 currently optional"
|
||||
CoG Sensor,HX711,24-bit load cell ADC,2 per CoG scale,"CoG Scale","One per support recommended"
|
||||
CoG Sensor,Load cell,Single-point or suitable existing load cell,2 per CoG scale,"CoG Scale","Choose range for aircraft mass"
|
||||
Assembly,JST-PH 2.0,Battery connector,1 per battery node,"Master, IMU Slave, CoG Scale","Often already fitted to LiPo"
|
||||
Assembly,Wire,Signal and power wiring,as needed,"All","Keep I2C runs short"
|
||||
Assembly,Heat shrink,Insulation and strain relief,as needed,"All","Recommended for portable nodes"
|
||||
Mechanical,Sensor housing,3D printed IMU enclosure,1 per IMU node,"Master, IMU Slave","Existing AeroAlign style"
|
||||
Mechanical,Control surface clip,3D printed clip,1 per IMU node,"Master, IMU Slave","3 mm / 5 mm / 8 mm variants"
|
||||
Mechanical,Scale support cradle,3D printed support fixture,2 per CoG scale,"CoG Scale","To be designed"
|
||||
Mechanical,Scale base,3D printed baseplate,1 per CoG scale,"CoG Scale","To be designed"
|
||||
Reference,Known calibration mass,Weight for HX711 calibration,1 set,"CoG Scale","Needed for repeatable scale factors"
|
||||
|
||||
|
@@ -0,0 +1,131 @@
|
||||
# SkyLogic AeroAlign - CoG Scale Wiring
|
||||
|
||||
**Version**: 0.1.0
|
||||
**Date**: 2026-03-11
|
||||
**Scope**: planned CoG scale node that shares the same Master and ESP-NOW fabric
|
||||
|
||||
## Overview
|
||||
|
||||
The CoG extension is based on two supports:
|
||||
|
||||
- front support load cell
|
||||
- rear support load cell
|
||||
|
||||
The recommended first implementation uses:
|
||||
|
||||
- `1x ESP32-C3` or `1x ESP32-S3`
|
||||
- `2x HX711`
|
||||
- `2x single-point load cells` or your existing suitable load cells
|
||||
|
||||
One HX711 per support keeps calibration and diagnostics simple.
|
||||
|
||||
## Functional Model
|
||||
|
||||
The CoG node reports three live values to the Master:
|
||||
|
||||
- `front_weight_g`
|
||||
- `rear_weight_g`
|
||||
- `cog_position_mm`
|
||||
|
||||
These values already fit the shared telemetry packet used by the current Master firmware.
|
||||
|
||||
## Recommended Electronics
|
||||
|
||||
| Part | Qty | Notes |
|
||||
|------|-----|-------|
|
||||
| ESP32-C3 or ESP32-S3 | 1 | same ecosystem as AeroAlign |
|
||||
| HX711 amplifier | 2 | one per support |
|
||||
| Load cell | 2 | typically 3 kg to 10 kg depending on model size |
|
||||
| LiPo or bench supply | 1 | portable or fixed jig |
|
||||
| TP4056 + regulator | optional | only for portable scale |
|
||||
|
||||
## Wiring Strategy
|
||||
|
||||
### HX711 #1: Front support
|
||||
|
||||
| HX711 pin | Connection |
|
||||
|-----------|------------|
|
||||
| `VCC` | `3V3` |
|
||||
| `GND` | `GND` |
|
||||
| `DT` | `GPIO6` |
|
||||
| `SCK` | `GPIO7` |
|
||||
|
||||
### HX711 #2: Rear support
|
||||
|
||||
| HX711 pin | Connection |
|
||||
|-----------|------------|
|
||||
| `VCC` | `3V3` |
|
||||
| `GND` | `GND` |
|
||||
| `DT` | `GPIO8` |
|
||||
| `SCK` | `GPIO9` |
|
||||
|
||||
These GPIOs are recommendations for the future CoG firmware. They are not yet hard-coded in the repo.
|
||||
|
||||
## Load Cell Wiring
|
||||
|
||||
Most 4-wire load cells expose:
|
||||
|
||||
| Wire | Meaning |
|
||||
|------|---------|
|
||||
| Red | `E+` |
|
||||
| Black | `E-` |
|
||||
| Green | `A+` |
|
||||
| White | `A-` |
|
||||
|
||||
Connect each load cell directly to one HX711.
|
||||
|
||||
### Important
|
||||
|
||||
Wire colors are not universal. Validate your load cells with the supplier datasheet or a multimeter before soldering.
|
||||
|
||||
## Mechanical Layout
|
||||
|
||||
```
|
||||
aircraft
|
||||
|
|
||||
+--> front support --> load cell #1 --> HX711 #1
|
||||
|
|
||||
+--> rear support --> load cell #2 --> HX711 #2
|
||||
```
|
||||
|
||||
The support spacing `L` must be known and entered into the system profile.
|
||||
|
||||
## CoG Formula
|
||||
|
||||
With front support at `x = 0` and rear support at `x = L`:
|
||||
|
||||
`x_cog_from_front_support = rear_weight / (front_weight + rear_weight) * L`
|
||||
|
||||
If you measure relative to the wing leading edge:
|
||||
|
||||
`x_cog_from_leading_edge = support_offset_from_leading_edge + x_cog_from_front_support`
|
||||
|
||||
## Calibration Plan
|
||||
|
||||
Each support needs:
|
||||
|
||||
1. zero / tare
|
||||
2. scale factor from known weight
|
||||
|
||||
Recommended workflow:
|
||||
|
||||
1. tare both supports empty
|
||||
2. place known weight on front support only
|
||||
3. save front factor
|
||||
4. repeat for rear support
|
||||
5. validate with known total weight centered between supports
|
||||
|
||||
## Current Repo Status
|
||||
|
||||
- shared protocol support exists in [telemetry_protocol.h](/Users/florianklaner/Github/AeroAlign/firmware/common/telemetry_protocol.h)
|
||||
- Master can already display CoG-style nodes in the existing UI
|
||||
- dedicated HX711 firmware is not implemented yet
|
||||
|
||||
## Next Firmware Target
|
||||
|
||||
Create a new node type, likely `firmware/cog_slave`, with:
|
||||
|
||||
- HX711 reading
|
||||
- tare and scale calibration
|
||||
- CoG computation
|
||||
- ESP-NOW transmission using `DEVICE_TYPE_COG_SCALE`
|
||||
@@ -1,360 +1,140 @@
|
||||
# SkyLogic AeroAlign - Sensor Node Wiring Diagram
|
||||
# SkyLogic AeroAlign - IMU Node Wiring
|
||||
|
||||
**Version**: 1.0.0
|
||||
**Date**: 2026-01-22
|
||||
**Target Hardware**: ESP32-C3/ESP32-S3 + MPU6050 + LiPo + TP4056
|
||||
|
||||
---
|
||||
**Version**: 2.0.0
|
||||
**Date**: 2026-03-11
|
||||
**Scope**: Master and IMU slave nodes for the combined AeroAlign + CoG platform
|
||||
|
||||
## Overview
|
||||
|
||||
This document describes the complete wiring schematic for both Master and Slave sensor nodes. Both nodes use identical wiring (Master additionally runs WiFi AP + web server in firmware).
|
||||
This document covers the current wiring for the angle-measurement nodes:
|
||||
|
||||
---
|
||||
- `Master`: ESP32-C3 or ESP32-S3, WiFi AP, web UI, ESP-NOW receiver, local IMU
|
||||
- `IMU Slave`: ESP32-C3 or ESP32-S3, remote MPU6050 node over ESP-NOW
|
||||
|
||||
## Component List (Per Node)
|
||||
The Master and IMU Slave share the same MPU6050 wiring. The main difference is firmware role.
|
||||
CoG-specific hardware is documented separately in [cog_scale_wiring.md](/Users/florianklaner/Github/AeroAlign/hardware/schematics/cog_scale_wiring.md).
|
||||
|
||||
| Component | Part Number | Quantity | Function |
|
||||
|-----------|-------------|----------|----------|
|
||||
| ESP32-C3 DevKit | ESP32-C3-DevKitM-1 | 1 | Microcontroller |
|
||||
| MPU6050 IMU | GY-521 module | 1 | 6-axis motion sensor |
|
||||
| LiPo Battery | 1S 3.7V 250-400mAh | 1 | Power source |
|
||||
| TP4056 Charger | USB-C variant | 1 | Battery charging |
|
||||
| HT7333 LDO | 3.3V 250mA | 1 | Voltage regulator |
|
||||
| 10kΩ Resistor | 1/4W carbon film | 2 | Voltage divider for battery ADC |
|
||||
| JST Connector | 2-pin PH2.0 | 1 | Battery connector |
|
||||
| USB-C Cable | 1m | 1 | Charging/flashing |
|
||||
## Supported ESP32 Pin Maps
|
||||
|
||||
---
|
||||
### ESP32-C3
|
||||
|
||||
## Power Supply Wiring
|
||||
| Signal | GPIO | Notes |
|
||||
|--------|------|-------|
|
||||
| `SDA` | `GPIO4` | MPU6050 I2C data |
|
||||
| `SCL` | `GPIO5` | MPU6050 I2C clock |
|
||||
| `BATTERY_ADC` | `GPIO0` | Battery divider midpoint |
|
||||
| `STATUS_LED` | `GPIO10` | Optional |
|
||||
|
||||
### ESP32-S3
|
||||
|
||||
| Signal | GPIO | Notes |
|
||||
|--------|------|-------|
|
||||
| `SDA` | `GPIO4` | MPU6050 I2C data |
|
||||
| `SCL` | `GPIO5` | MPU6050 I2C clock |
|
||||
| `BATTERY_ADC` | `GPIO1` | Only if divider is actually fitted |
|
||||
| `STATUS_LED` | disabled | Board-dependent, firmware keeps it off by default |
|
||||
|
||||
## Power Topology
|
||||
|
||||
```
|
||||
LiPo Battery (3.7V nominal, 4.2V max, 3.0V min)
|
||||
│
|
||||
├─► [+] TP4056 IN+ (Battery charging input)
|
||||
│ TP4056 IN- [GND]
|
||||
│ TP4056 USB-C (for charging only)
|
||||
│
|
||||
└─► [+] HT7333 VIN (3.0V - 4.2V input)
|
||||
HT7333 GND [GND]
|
||||
HT7333 VOUT [3.3V] ─► ESP32-C3 3.3V pin
|
||||
MPU6050 VCC
|
||||
LiPo 1S
|
||||
|
|
||||
+--> TP4056 BAT+/BAT-
|
||||
|
|
||||
+--> LDO VIN
|
||||
|
|
||||
+--> 3.3V rail --> ESP32 3V3
|
||||
--> MPU6050 VCC
|
||||
```
|
||||
|
||||
**Notes**:
|
||||
- TP4056 charges LiPo when USB-C connected (red LED: charging, blue LED: full)
|
||||
- HT7333 regulates LiPo voltage to stable 3.3V for ESP32 and IMU
|
||||
- ESP32-C3 DevKit has built-in USB-C for programming (separate from TP4056 charging USB-C)
|
||||
### Notes
|
||||
|
||||
---
|
||||
- A dedicated 3.3V regulator is still recommended for clean IMU behavior.
|
||||
- The Master S3 configuration currently assumes battery monitoring may be absent.
|
||||
- If no ADC divider is wired on the Master, leave `BATTERY_MONITOR_ENABLED` disabled in [config.h](/Users/florianklaner/Github/AeroAlign/firmware/master/src/config.h).
|
||||
|
||||
## ESP32-C3 to MPU6050 (I2C) Wiring
|
||||
## MPU6050 Wiring
|
||||
|
||||
| ESP32 | MPU6050 | Notes |
|
||||
|-------|---------|-------|
|
||||
| `GPIO4` | `SDA` | I2C |
|
||||
| `GPIO5` | `SCL` | I2C |
|
||||
| `3V3` | `VCC` | Use 3.3V |
|
||||
| `GND` | `GND` | Common ground |
|
||||
| `GND` | `AD0` | Sets address `0x68` |
|
||||
|
||||
### Bus Settings
|
||||
|
||||
- ESP32-C3 default: `400 kHz`
|
||||
- ESP32-S3 default: `100 kHz`
|
||||
|
||||
The lower S3 bus speed is intentional and matches the current robust MPU6050 access code.
|
||||
|
||||
## Battery Divider
|
||||
|
||||
Use the divider only on nodes that really need local battery reporting.
|
||||
|
||||
```
|
||||
ESP32-C3 MPU6050 (GY-521)
|
||||
--------- ----------------
|
||||
GPIO4 (SDA) ───────► SDA (I2C Data)
|
||||
GPIO5 (SCL) ───────► SCL (I2C Clock)
|
||||
3.3V ───────► VCC
|
||||
GND ───────► GND
|
||||
INT (not connected)
|
||||
AD0 (GND for 0x68 address)
|
||||
LiPo+
|
||||
|
|
||||
[10k]
|
||||
|
|
||||
+----> BATTERY_ADC
|
||||
|
|
||||
[10k]
|
||||
|
|
||||
GND
|
||||
```
|
||||
|
||||
**I2C Configuration**:
|
||||
- **Address**: 0x68 (default, AD0 pulled low)
|
||||
- **Frequency**: 400kHz (fast mode)
|
||||
- **Pull-ups**: Internal ESP32 pull-ups enabled (no external resistors needed)
|
||||
### Current firmware assumptions
|
||||
|
||||
**Alternative**: BNO055 IMU (for ±0.1° accuracy upgrade)
|
||||
```
|
||||
ESP32-C3 BNO055
|
||||
--------- ------
|
||||
GPIO4 (SDA) ───────► SDA
|
||||
GPIO5 (SCL) ───────► SCL
|
||||
3.3V ───────► VIN
|
||||
GND ───────► GND
|
||||
PS0 (GND for I2C mode)
|
||||
PS1 (3.3V)
|
||||
```
|
||||
- IMU slaves: divider enabled in firmware
|
||||
- Master C3: divider enabled
|
||||
- Master S3: divider disabled by default until the ADC path is actually wired
|
||||
|
||||
---
|
||||
## Master Node Wiring Summary
|
||||
|
||||
## Battery Monitoring (Voltage Divider)
|
||||
| Block | Required | Notes |
|
||||
|-------|----------|-------|
|
||||
| ESP32-C3 or ESP32-S3 | yes | `master` firmware |
|
||||
| MPU6050 | yes | local reference IMU |
|
||||
| LiPo + charger + regulator | yes | portable operation |
|
||||
| Battery divider | optional | hidden in UI if absent |
|
||||
|
||||
```
|
||||
LiPo+ (3.0V - 4.2V)
|
||||
│
|
||||
▼
|
||||
10kΩ Resistor (R1)
|
||||
│
|
||||
├────► ESP32-C3 GPIO0 (ADC1_CH0)
|
||||
│
|
||||
▼
|
||||
10kΩ Resistor (R2)
|
||||
│
|
||||
└────► GND
|
||||
## IMU Slave Wiring Summary
|
||||
|
||||
Output Voltage = (LiPo Voltage) / 2
|
||||
ESP32 ADC reads 0-1650mV (half of LiPo voltage)
|
||||
```
|
||||
| Block | Required | Notes |
|
||||
|-------|----------|-------|
|
||||
| ESP32-C3 or ESP32-S3 | yes | `slave` firmware |
|
||||
| MPU6050 | yes | same robust driver as Master |
|
||||
| LiPo + charger + regulator | yes | remote node |
|
||||
| Battery divider | recommended | transmitted to Master |
|
||||
|
||||
**Calculation**:
|
||||
```cpp
|
||||
float adc_value = analogRead(GPIO0); // 0-4095 (12-bit)
|
||||
float voltage_at_adc = (adc_value / 4095.0) * 3.3; // Convert to volts
|
||||
float battery_voltage = voltage_at_adc * 2.0; // Multiply by voltage divider ratio
|
||||
uint8_t battery_percent = ((battery_voltage - 3.0) / (4.2 - 3.0)) * 100.0;
|
||||
```
|
||||
## Bring-Up Checklist
|
||||
|
||||
**Important**:
|
||||
- R1 and R2 must be equal (10kΩ each) for 2:1 division
|
||||
- ESP32-C3 ADC max input: 3.3V (do NOT exceed)
|
||||
- LiPo max voltage 4.2V / 2 = 2.1V (safe margin)
|
||||
|
||||
---
|
||||
|
||||
## Status LED (Optional)
|
||||
|
||||
```
|
||||
ESP32-C3 GPIO10 ───► [+] LED [-] ───► 220Ω Resistor ───► GND
|
||||
```
|
||||
|
||||
**LED Indicators**:
|
||||
- **Solid Blue**: WiFi AP active (Master only)
|
||||
- **Slow Blink (1Hz)**: Normal operation, connected
|
||||
- **Fast Blink (5Hz)**: Searching for Master (Slave only)
|
||||
- **Red Blink (3×)**: Low battery (<20%)
|
||||
|
||||
---
|
||||
|
||||
## Complete Schematic (ASCII Art)
|
||||
|
||||
```
|
||||
+──────────────────────────────────────+
|
||||
│ LiPo Battery (1S 3.7V) │
|
||||
│ 250-400mAh │
|
||||
+──────────────────────────────────────+
|
||||
│ │
|
||||
│+ │-
|
||||
│ │
|
||||
┌────────┴────────┐ │
|
||||
│ TP4056 Charger │ │
|
||||
USB-C Charge ───────┤ (USB-C input) │ │
|
||||
│ OUT+ OUT-│ │
|
||||
└─────┬────────────┴─────────┤
|
||||
│+ -│
|
||||
│ │
|
||||
┌─────┴──────────────────────┴─────┐
|
||||
│ HT7333 LDO Regulator │
|
||||
│ VIN GND VOUT │
|
||||
└──────────────┬───────────┬───────┘
|
||||
│ │ 3.3V
|
||||
│ │
|
||||
┌─────────────┴───────────┴────────┐
|
||||
│ ESP32-C3 DevKit │
|
||||
│ │
|
||||
USB-C Flash ────┤ USB-C │
|
||||
│ │
|
||||
│ GPIO4 (SDA) ──────┐ │
|
||||
│ GPIO5 (SCL) ──────┤ │
|
||||
│ GPIO0 (ADC) ──────┤ │
|
||||
│ GPIO10 (LED) ─────┤ │
|
||||
│ 3.3V ─────────────┤ │
|
||||
│ GND ──────────────┤ │
|
||||
└────────────────────┼─────────────┘
|
||||
│
|
||||
│
|
||||
┌────────────────────┴─────────────┐
|
||||
│ MPU6050 IMU (GY-521) │
|
||||
│ │
|
||||
│ SDA ◄──────────────────────────┤
|
||||
│ SCL ◄──────────────────────────┤
|
||||
│ VCC ◄───── 3.3V ───────────────┤
|
||||
│ GND ◄───── GND ────────────────┤
|
||||
│ INT (not connected) │
|
||||
│ AD0 ◄───── GND (0x68 address) │
|
||||
└──────────────────────────────────┘
|
||||
|
||||
Battery Monitor (Voltage Divider)
|
||||
|
||||
LiPo+ ──┬── 10kΩ ──┬── 10kΩ ── GND
|
||||
│ │
|
||||
│ └──► GPIO0 (ADC)
|
||||
│
|
||||
(Read half voltage)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Pin Assignment Summary
|
||||
|
||||
### ESP32-C3 GPIO Mapping
|
||||
|
||||
| GPIO Pin | Function | Connection | Notes |
|
||||
|----------|----------|------------|-------|
|
||||
| GPIO0 | ADC1_CH0 | Battery voltage divider midpoint | Read battery level |
|
||||
| GPIO4 | I2C SDA | MPU6050 SDA | IMU data line |
|
||||
| GPIO5 | I2C SCL | MPU6050 SCL | IMU clock line |
|
||||
| GPIO10 | Digital Out | Status LED (optional) | Connection indicator |
|
||||
| 3.3V | Power | HT7333 VOUT, MPU6050 VCC | Regulated power rail |
|
||||
| GND | Ground | Common ground | All components share |
|
||||
| USB-C | USB Serial | Flashing/debugging | Built-in on DevKit |
|
||||
|
||||
### MPU6050 (GY-521) Pinout
|
||||
|
||||
| Pin | Function | Connection | Notes |
|
||||
|-----|----------|------------|-------|
|
||||
| VCC | Power | ESP32 3.3V | 3.3V or 5V compatible |
|
||||
| GND | Ground | Common GND | - |
|
||||
| SDA | I2C Data | GPIO4 | Pull-up enabled internally |
|
||||
| SCL | I2C Clock | GPIO5 | Pull-up enabled internally |
|
||||
| INT | Interrupt | Not used | Future: motion detection |
|
||||
| AD0 | Address Select | GND | Sets I2C address to 0x68 |
|
||||
|
||||
---
|
||||
|
||||
## Assembly Instructions
|
||||
|
||||
### Step 1: Solder HT7333 LDO
|
||||
|
||||
1. **Identify pins**: HT7333 (SOT-89 package)
|
||||
```
|
||||
┌───────┐
|
||||
│ HT7333│
|
||||
└┬─┬─┬──┘
|
||||
│ │ └── VOUT (3.3V output)
|
||||
│ └──── GND
|
||||
└────── VIN (3.0V-6.0V input)
|
||||
```
|
||||
|
||||
2. Solder to TP4056 OUT+ (VIN) and OUT- (GND)
|
||||
3. Connect VOUT to ESP32-C3 3.3V rail
|
||||
|
||||
### Step 2: Connect Battery
|
||||
|
||||
1. Solder JST connector to LiPo (red = +, black = -)
|
||||
2. Connect to TP4056 BAT+ and BAT-
|
||||
3. **Important**: Check polarity before connecting!
|
||||
|
||||
### Step 3: Wire I2C to MPU6050
|
||||
|
||||
1. Solder 4 wires (SDA, SCL, VCC, GND) from ESP32-C3 to MPU6050
|
||||
2. Use 22AWG silicone wire (flexible, ~10cm length)
|
||||
3. Test continuity with multimeter
|
||||
|
||||
### Step 4: Install Voltage Divider
|
||||
|
||||
1. Solder two 10kΩ resistors in series
|
||||
2. Connect high end to LiPo+ (or TP4056 OUT+)
|
||||
3. Connect midpoint to ESP32-C3 GPIO0
|
||||
4. Connect low end to GND
|
||||
5. Cover with heat shrink tubing
|
||||
|
||||
### Step 5: Test Power Supply
|
||||
|
||||
1. **Without ESP32 connected**: Measure HT7333 VOUT with multimeter
|
||||
2. Expected: 3.25V-3.35V (3.3V ±50mV)
|
||||
3. If correct, connect ESP32-C3 3.3V pin
|
||||
|
||||
### Step 6: Flash Firmware
|
||||
|
||||
1. Connect ESP32-C3 USB-C to computer
|
||||
2. Flash Master or Slave firmware via PlatformIO
|
||||
3. Open serial monitor (115200 baud)
|
||||
4. Verify IMU initialization: "MPU6050 initialized (0x68)"
|
||||
|
||||
### Step 7: Calibrate IMU
|
||||
|
||||
1. Place sensor on flat, level surface
|
||||
2. Power on, wait 10 seconds for stabilization
|
||||
3. Web UI (Master) or serial output (Slave) should show ~0.0° pitch/roll
|
||||
|
||||
---
|
||||
1. Verify `3.3V` rail before plugging the ESP32 in.
|
||||
2. Confirm MPU6050 address `0x68` with `AD0` tied low.
|
||||
3. Keep SDA/SCL leads short on S3 builds.
|
||||
4. On the Slave, set the Master MAC in [config.cpp](/Users/florianklaner/Github/AeroAlign/firmware/slave/src/config.cpp).
|
||||
5. Build and flash:
|
||||
- `cd firmware/master && pio run`
|
||||
- `cd firmware/slave && pio run -e esp32-s3`
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Problem: ESP32 won't power on
|
||||
### No MPU6050 detected
|
||||
|
||||
**Check**:
|
||||
- LiPo voltage (should be 3.7V-4.2V)
|
||||
- HT7333 VOUT (should be 3.3V)
|
||||
- TP4056 protection (may shut down if overcharged/over-discharged)
|
||||
- Check `GPIO4` and `GPIO5`
|
||||
- Check `AD0 -> GND`
|
||||
- Reduce wire length
|
||||
- Prefer the S3 default `100 kHz`
|
||||
|
||||
**Solution**: Charge LiPo via TP4056 USB-C
|
||||
### Battery percentage missing on Master
|
||||
|
||||
### Problem: I2C not detected (MPU6050 not found)
|
||||
- Expected on S3 unless the divider is fitted and `BATTERY_MONITOR_ENABLED` is enabled
|
||||
- The web UI now hides the metric when unavailable
|
||||
|
||||
**Check**:
|
||||
- Wiring: SDA to GPIO4, SCL to GPIO5
|
||||
- I2C address: Run I2C scanner (should show 0x68)
|
||||
- Pull-ups: Enable internal pull-ups in firmware
|
||||
### Slave does not show up
|
||||
|
||||
**Solution**: Verify connections, re-solder if cold joints
|
||||
|
||||
### Problem: Battery percentage reads 0% or 255%
|
||||
|
||||
**Check**:
|
||||
- Voltage divider wiring (two 10kΩ resistors in series)
|
||||
- ADC pin (GPIO0) connection to midpoint
|
||||
- ADC code calibration (3.3V ADC reference)
|
||||
|
||||
**Solution**: Measure voltage at GPIO0 with multimeter (should be LiPo voltage / 2)
|
||||
|
||||
### Problem: IMU angles drift over time
|
||||
|
||||
**Check**:
|
||||
- Complementary filter alpha (should be 0.98)
|
||||
- IMU temperature (MPU6050 sensitive to >15°C delta from calibration)
|
||||
- Vibration isolation (sensor should be firmly mounted)
|
||||
|
||||
**Solution**: Recalibrate at operating temperature, increase filter alpha to 0.99
|
||||
|
||||
---
|
||||
|
||||
## Safety Warnings
|
||||
|
||||
⚠️ **LiPo Battery Safety**:
|
||||
- Never short-circuit LiPo terminals (fire/explosion risk)
|
||||
- Do not charge above 4.2V (TP4056 prevents this)
|
||||
- Do not discharge below 3.0V (TP4056 prevents this)
|
||||
- Store at 50-60% charge (3.7V-3.8V) if unused >1 week
|
||||
- Dispose of damaged/swollen batteries at hazardous waste facility
|
||||
|
||||
⚠️ **Soldering Safety**:
|
||||
- Use 300-350°C iron temperature (too hot damages components)
|
||||
- Solder in ventilated area (avoid flux fumes)
|
||||
- Do not touch soldering iron tip (obvious, but critical)
|
||||
|
||||
⚠️ **ESD Protection**:
|
||||
- ESP32-C3 and MPU6050 are ESD-sensitive
|
||||
- Touch grounded metal before handling (discharge static)
|
||||
- Avoid working on carpets or synthetic fabrics
|
||||
|
||||
---
|
||||
|
||||
## Bill of Materials (Per Node)
|
||||
|
||||
See `hardware/schematics/bom.csv` for complete BOM with Amazon ASINs and pricing.
|
||||
|
||||
**Quick Summary**:
|
||||
- ESP32-C3 DevKit: $6.50
|
||||
- MPU6050 IMU: $4.50
|
||||
- LiPo Battery (400mAh): $8.00
|
||||
- TP4056 Charger: $1.50
|
||||
- HT7333 LDO: $0.80
|
||||
- Resistors, wire, connectors: $2.00
|
||||
- **Total per node**: ~$23.30
|
||||
|
||||
---
|
||||
|
||||
## Revision History
|
||||
|
||||
| Version | Date | Changes |
|
||||
|---------|------|---------|
|
||||
| 1.0.0 | 2026-01-22 | Initial wiring diagram for MVP |
|
||||
|
||||
---
|
||||
|
||||
*SkyLogic AeroAlign - Precision Grounded.*
|
||||
- Recheck Master MAC in [config.cpp](/Users/florianklaner/Github/AeroAlign/firmware/slave/src/config.cpp)
|
||||
- Ensure Master AP channel and ESP-NOW channel match
|
||||
|
||||
Reference in New Issue
Block a user