Reference
Checkout the embedded simplified from ERC
Source Code References
If you made it till here, you a true G. Also, this was rather useful, check this out... ERC Embedded Simplified Official
Main Application
File | Purpose |
|---|---|
| Main entry point and sensor loop |
Sensor Drivers
Sensor | Header | Source |
|---|---|---|
GPS |
|
|
IMU |
|
|
pH |
|
|
Load Cell |
|
|
Pressure |
|
|
Utilities |
|
|
Protobuf Definitions
For detailed protobuf message format documentation, see: Sensor Board Protobuf
ERC-Protobufs/components/sensor_board/
├── diagnostics.proto - Board-level diagnostics and health status
├── sensor.proto - Aggregated sensor state message
├── gps_sensor.proto - GNSS positioning data
├── imu_sensor.proto - Inertial measurement (acceleration, gyro, mag)
├── ph_sensor.proto - Water quality pH measurement
├── load_cell.proto - Force measurement (gripper control)
└── pressure_sensor.proto - Pressure measurement (gripper control)
Build Configuration
File | Purpose |
|---|---|
| Build configuration for all boards |
| STM32 CubeMX configuration |
| CubeMX IOC file (device config) |
Test References
Test Suites
test/sensor_board/
├── test_gps_sensor/
├── test_imu_sensor/
├── test_load_sensor/
├── test_ph_sensor/
├── test_pressure_sensor/
└── test_sensor_basics/
Running Tests
// Build all tests
pio test -e sensor_board
// Run with verbose output
pio test -e sensor_board -v
// Build only (no run)
pio test -e sensor_board --no-run
Hardware References
Microcontroller
- STM32H753ZI - ARM Cortex-M7, 480 MHz, 1 MB Flash
- Datasheet: ST Microelectronics STM32H7 reference
Ethernet
- LAN8742 - Ethernet PHY
- Interface: RMII (Reduced Media Independent Interface)
- Link Speed: 10/100 Mbps auto-negotiation
Sensors
Sensor | Model | Protocol | Note |
|---|---|---|---|
GPS | GY-NEO6MV2 (NEO-6M) | UART 9600 | Default NMEA config |
IMU | Reference design TBD | I2C/SPI | Dual IMU planned |
pH | DFRobot SEN0161 | ADC Analog | 40-sample averaging |
Load Cell | Application specific | ADC | Dual cells (×2) |
Pressure | Application specific | ADC/I2C | Dual sensors (×2) |
Development Workflow
Building Firmware
// Build for sensor_board
pio run -e sensor_board
// Upload to board
pio run -e sensor_board --target upload
// Monitor serial output
pio device monitor -b 115200 -p COM4
Development Cycle
// 1. Edit source code
// 2. Build
pio run -e sensor_board
// 3. Upload
pio run -e sensor_board --target upload
// 4. Monitor
pio device monitor
// 5. Run tests
pio test -e sensor_board
Useful Commands
PlatformIO CLI
// List available boards
pio boards
// Show board info
pio boards nucleo_h753zi
// Clean build
pio run -e sensor_board --target clean
// Full rebuild
pio run -e sensor_board --target clean --target upload
Troubleshooting Guide
Serial Monitor No Output
- Check USB connection
- Verify COM port in platformio.ini
- Check baud rate (115200)
- Verify UART initialization succeeded
Sensor Shows IDLE
- Check physical connection (UART/I2C/SPI)
- Verify baud rate (for UART sensors)
- Check pull-up resistors (for I2C)
- Verify device address (for I2C/SPI)
Network Packets Not Received
- Check IP address configuration
- Verify MAC address filtering
- Check firewall settings
- Verify UDP port 7 not blocked
Low Heap Warning
- Check for memory leaks in sensor drivers
- Reduce buffer sizes
- Verify UDP queue sizes
- Check for recursive allocations
Quick Reference Checklist
Before Deployment
- All sensors connected and responding
- Network IP/MAC configured correctly
- Calibration parameters set for pH/load cells
- Serial monitor showing sensor data
- Heap usage monitored (>8KB free)
- UDP packets reaching destination
- Protobuf encoding verified
Monitoring in Production
- Check sensor status codes
- Monitor heap usage trend
- Verify data ranges match expectations
- Track error rates per sensor
- Review network packet statistics
Hope you had fun☮️
END OF DOCUMENTATION FOR SESOR BOARD☮️
Last Updated: April 14, 2026
No comments to display
No comments to display