Skip to content

ashp0/Accelerometer

Repository files navigation

Arduino Intermediate

Arduino UNO R4 WiFi firmware and a SwiftUI companion app for streaming MPU6050 accelerometer telemetry over UDP.

What is included

  • PlatformIO firmware for the Arduino UNO R4 WiFi.
  • UDP discovery and listener subscription support on port 12345.
  • MPU6050 calibration and accelerometer streaming in t, ax, ay, and az fields.
  • SwiftUI app for discovery, subscription, live charting, and 3D acceleration viewing.
  • Python/typing requirements for local helper tooling.

Hardware

  • Arduino UNO R4 WiFi
  • MPU6050 accelerometer module
  • A Wi-Fi network shared by the Arduino and the companion app device

Firmware Setup

  1. Install PlatformIO.

  2. Copy the Wi-Fi template and fill in your local credentials:

    cp src/wifi_secrets.example.h src/wifi_secrets.h
  3. Build the firmware:

    pio run
  4. Upload to the Arduino:

    pio run --target upload
  5. Open the serial monitor if you want to watch connection, discovery, and telemetry logs:

    pio device monitor

Companion App

Open src/ArduinoGUI/ArduinoGUI.xcodeproj in Xcode, then run the ArduinoGUI scheme on macOS or iOS.

The app can discover Arduino broadcasts on UDP 12345, subscribe with listen:12345, and plot incoming accelerometer packets.

UDP Packet Format

The Arduino broadcasts discovery packets like:

arduino:ip:192.168.1.50,port:12345,listeners:1

Telemetry packets look like:

t:1.20,ax:0.012,ay:-0.004,az:0.981

Repository Notes

src/wifi_secrets.h is intentionally ignored so real Wi-Fi credentials stay local. Use src/wifi_secrets.example.h as the starting point for your own copy.

About

Arduino UNO R4 WiFi firmware and a SwiftUI companion app for streaming MPU6050 accelerometer telemetry over UDP.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors