How peterjburke/nanostat works
Main Components
• Hardware Design & PCB Manufacturing:
• GerberFiles directory: Contains multiple subdirectories for different versions (v3.5, v3.5.1, v3.5.4) with Gerber files, BOMs, pick and place files, and schematic JSON files. These files represent the electrical design and manufacturing details of the NanoStat board.
• CAD and 3D Case Files: The “case” folder (with subdirectories like “nobattery” and “withbattery”) contains STL and Fusion 360 (.f3d) files for creating the physical enclosure.
• Firmware & Embedded Software:
• PlatformIO Integration: The presence of platformio.ini and the “src” directory (with main.cpp and wifi_credentials.h) indicate that the firmware is developed in C++ using PlatformIO for the ESP32.
• Test Infrastructure: The “test” folder and various README files in “include” and “lib” support a modularized firmware design.
• Web Interface / SPIFFS-based UI:
• “data” directory: Contains HTML, CSS, and JavaScript files for the configuration and control website. These files are transferred to the ESP32’s internal SPIFFS storage.
• External Tools & Resources:
• References to EasyEDA and JLCPCB: The README explains that the JSON files (schematic/layout) can be imported into EasyEDA or similar CAD tools, and then used to manufacture the board.
• YouTube tutorials and online gerber viewers provide context for both design and supply-chain steps.
Relationships and Interactions
• The PCB and Housekeeping:
• The Gerber/CAD files, BOMs, and pick and place files feed into the manufacturing process at vendors such as JLCPCB.
• Firmware Operation on the Hardware:
• The firmware code (from “src”) runs on the ESP32 microcontroller embedded on the board. It comprises the control logic for the potentiostat and interfaces with the analog front end (using the LMP91000 and other sensors).
• It also manages firmware updates (over USB initially, with later OTA updates via WiFi) and device configuration.
• Web UI & Network Connectivity:
• Website files in the “data” directory are uploaded into the onboard SPIFFS storage.
• The ESP32 first creates a WiFi hotspot (NanostatAP) for initial configuration, then reconfigures itself to join a local network, serving the UI (accessed via nanostat.local or an assigned IP).
• Development & Tools:
• The integration with PlatformIO (and VS Code) represents the development environment which builds the firmware and loads it onto the ESP32.
• The build and deployment process (compilation, flash erasure, filesystem upload) is central to how firmware changes propagate to the hardware.
Key Architectural Patterns/Design Principles
• Hardware-Software Co-Design:
• Separation of concerns: CAD files and PCB designs are segregated from firmware and UI code.
• Modular design: Different design versions are clearly versioned (v3.5, v3.5.1, v3.5.4) in separate directories; firmware is organized to support OTA updates and dynamic configuration.
• Embedded Web Server Pattern:
• The ESP32 acts as a combined embedded device and web server, handling both control interfacing and connectivity via its dual-mode (AP and client mode).
• Build Pipeline:
• The use of PlatformIO implies a build system that streams from source code to flashed firmware and filesystem data (website contents).