Skip to content

triunai/microcontroller-learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

⚔️ Signed by — “Astra Mechanica” (Ai-Agent)

Everything is tightened, styled, and elevated without losing any technical detail.


Microcontroller Mastery Logbook

A living codex of everything I learn while bending silicon to my will.

Every folder = one self-contained experiment, one skill unlocked, one breadcrumb in the journey from “ESP32 newbie” → “embedded sorcerer.”


🔥 Current Build: local-led-site

Purpose: Turn an ESP32 into its own Wi-Fi access point with a micro-webserver to control the onboard LED, fire a quick pulse, and expose a JSON status feed (uptime + free heap).

Quickstart (Launch Sequence)

  1. ESP32 dev board + USB cable
  2. Arduino IDE or PlatformIO (ESP32 package installed)
  3. Open local-led-site.ino
  4. (Optional) Change AP credentials (ssid/password)
  5. Select board + COM port → Upload
  6. Connect to Wi-Fi: Khumerens ESP32
  7. Hit: http://192.168.4.1
  8. Watch Serial @ 115200 for heartbeats + HTTP traces

🧭 Roadmap: Skill Tree Unlocks

Track your ascent like a real RPG skill progression:

0 — System Boot

  • Flash LED blink
  • Stable serial logs
  • Note USB/power quirks

1 — GPIO Fundamentals

  • Debounced button input
  • Multi-LED patterns
  • PWM dimming
  • Analog read + noise handling

2 — Communication Wizardry

  • UART loopback
  • I2C sensor read (TMP102)
  • SPI device (display/flash)
  • Logic analyzer captures

3 — Connectivity Magic

  • Wi-Fi STA + MQTT publish
  • Captive portal (AP mode)
  • OTA updates
  • REST/WebSocket endpoint

4 — Sensors & Data Alchemy

  • Temp/humidity sampling
  • Moving averages + calibration
  • SPIFFS/SD logging
  • NTP time-sync

5 — Actuator Control

  • Servo sweeping
  • MOSFET driver (LED strip/motor)
  • Flyback + current protection

6 — Power & Reliability

  • Current profiling
  • Brown-out handling
  • Watchdog + safe recovery

7 — RTOS Structure

  • FreeRTOS task layout
  • Queues/timers
  • Unit-style tests

8 — UX & Tooling

  • Better web UI
  • Status JSON docs
  • Flash/build scripts
  • Pin map diagrams

9 — Production Habits

  • Versioned firmware
  • Release notes
  • Breadboard → perfboard checklist

💡 Project Parking Lot

  • MQTT door/window sensor
  • Battery-powered e-ink status tile
  • BLE beacon + phone app scanner
  • Room environment logger w/ SD backup

🧾 Notes to Future Me

  • Keep creds/tokens out of repo (secrets.h, build flags).
  • Add README updates whenever behavior changes.
  • When debugging: get power + serial logs before rewriting anything.

🛠️ Design Note — Phase 1: Manual-Control Water Rover

A rugged, LAN-only rover with strict safety rules. No AI. No cloud. Pure mechanical discipline.

🎯 Mission Scope

In:

  • Wi-Fi manual drive
  • Controlled spray (bounded duration)
  • Hard safety caps
  • Stop-all command
  • Clean, minimal web UI

Out:

  • Autonomy, CV, SLAM, cloud, sensors

🧱 Non-Negotiable Requirements

  • Access at: http://raspgarden.local:8000
  • Move: up/down/left/right + STOP
  • Spray: 1–3s max
  • Pump capped per command and by hard limit
  • Deadman timeout for motors if no commands
  • Pump on separate power supply
  • ≥ 30 minutes of reliable field use

🧩 Architecture Snapshot

  • Flask API (server.py)
  • Core services: movement_service, water_service, state_machine
  • Drivers: motors, pump (GPIO)
  • Config: YAML
  • Main entry: main.py loads config, boots services, runs server
  • UI: ui/index.html (simple control deck)

⚙️ Control Logic DNA

Movement:

  • Track last_command_time
  • tick() enforces deadman timeout

Water:

  • Clamp input to PUMP_MAX_DURATION_S
  • Maintain spray_end_time
  • tick() enforces end + hard limit

Controller:

  • Orchestrates motion/spray/stop
  • Maintains consistent state snapshots

🔐 Security

  • LAN-only
  • POST endpoints require X-ROVER-KEY (shared secret)

🛡️ Safety & Failure Modes

  • On boot/exceptions → motors/pump OFF
  • Systemd restarts main.py
  • GPIO safe-defaults
  • Network drop → deadman stops motion
  • Pump protected by timers + isolated supply
  • Proper MOSFET/relay with fuse

🧪 Testing Stages

  1. Motors off-ground (safe bench)
  2. Pump bench test (bucket)
  3. Dry garden run
  4. Live garden micro-trial

KPIs:

  • 0 stuck-on pumps
  • 0 >2s runaway motion
  • <300ms command latency
  • 20–30min runtime on field battery

🚀 Next Move

Ship this Phase 1 spec. Decide whether to add systemd service now or after first prototype.


About

what else do you think look at the name and readme

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages