Skip to content

andrewaarestad/fluid-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FLUID

Full-stack IoT platform for industrial flow measurement. Captures real-time flow data via custom FPGA hardware, processes it through a cloud backend, and presents it in mobile and web interfaces.

Architecture

FLUID Hardware (Particle P1 + Xilinx Artix-7 FPGA)
        | SPI
   FPGA captures flow data (ADC + signal processing)
        | FBSP (FLUID Binary Serial Protocol)
   Particle P1 reads FPGA data
        | HTTPS
   fluid-data API (ingestion + background jobs via Kue/Redis)
        | PostgreSQL
   fluid-api (business logic + auth)
        |
   Mobile App (Ionic)  &  Web Admin (React)

Repository Index

fluid-code/
├── app/                        # Mobile application
├── backend/                    # Cloud services
│   ├── fluid-api/              #   REST API server
│   ├── fluid-data/             #   Data ingestion & processing pipeline
│   └── fluid-web-admin/        #   Admin dashboard (React)
├── docs/                       # Protocol specs & reference docs
├── firmware/                   # Embedded software
│   ├── fbsp/                   #   FLUID Binary Serial Protocol library
│   ├── particle/               #   Particle P1 firmware
│   │   └── fpga-controller/    #     Main FPGA controller firmware
│   ├── programming/            #   Programming/bootloader utilities
│   └── webhooks/               #   Webhook integrations
├── fpga/                       # FPGA design
│   ├── fluid-fpga-software/    #   Vivado project (Artix-7)
│   ├── fluid-meter/            #   Meter-specific FPGA logic
│   └── ota-testing/            #   Over-the-air update testing
├── hardware/                   # PCB design (Altium Designer)
│   ├── fluid-hardware/         #   Board revisions (v1-v3)
│   └── fluid-hw-v3_4/          #   Current revision (v3.4)
└── manufacturing/              # Manufacturing & test
    ├── fluid-autotest/         #   Automated test suite (Python)
    ├── fluid-mfg-test/         #   Manufacturing test variants
    └── data-parsing/           #   Data parsing utilities

app/

Ionic (Angular) mobile application for iOS and Android. Provides the end-user interface for viewing flow data, managing devices, and configuring alerts.

Detail Value
Framework Ionic + Angular
Language TypeScript
Path app/fluid-ionic-app/

backend/

Three Node.js microservices:

fluid-api

Main REST API serving mobile and web clients. Handles authentication (Passport bearer tokens), user management, and business logic.

Detail Value
Framework Express.js
Language TypeScript
Database PostgreSQL (Knex + Bookshelf)
Auth Passport (bearer tokens)
Integrations AWS SDK, SendGrid

fluid-data

Data ingestion API with background job processing. Receives raw measurements from devices, runs alert algorithms, and manages time-series data.

Detail Value
Framework Express.js
Language TypeScript
Database PostgreSQL (Knex + Bookshelf)
Queue Kue (Redis-backed)
Integrations AWS SDK, Google APIs

fluid-web-admin

React-based admin dashboard for managing the platform, viewing device data, and monitoring system health.

Detail Value
Framework React 16 + Redux
Language JavaScript (JSX)
UI Library Material-UI
Charts Highcharts
Build Webpack 3

docs/

Protocol specifications and reference documentation.

Document Description
Binary Packet Spec FBSP binary protocol specification
NMEA Sentence Spec NMEA sentence format for flow meters

firmware/

Embedded software for the FLUID device.

fbsp/ (FLUID Binary Serial Protocol)

C library defining the packet format used for communication between the Particle P1 and cloud backend. Includes packet type definitions, encoding, and decoding.

particle/fpga-controller/

Main firmware running on the Particle P1 microcontroller. Controls the FPGA over SPI, reads flow measurement data, and uploads it to the cloud over HTTPS.

Detail Value
Platform Particle P1
Language C++
Build Makefile (DFU flashing)
Docs firmware/particle/fpga-controller/README.md

fpga/

FPGA design for digital signal processing of flow sensor data.

fluid-fpga-software/

Xilinx Vivado project targeting the Artix-7 FPGA. Custom IP cores handle ADC data capture, SPI communication, clock domain crossing, and power synchronization.

Detail Value
Tool Xilinx Vivado 2015.4
Target Artix-7
Platform Ubuntu 16.04
Build Makefile
Docs fpga/fluid-fpga-software/README.md

Custom IP cores:

  • Slave_SPI_interface - SPI communication with Particle P1
  • adc_packet_generator - ADC data serialization
  • adc_data_aligner - ADC data alignment
  • CDC - Clock domain crossing
  • power_sync_gen - Power synchronization
  • fluid_spi - FLUID-specific SPI protocol

hardware/

PCB designs in Altium Designer. Contains multiple board revisions from initial prototypes through the current v3.4 production design, along with component datasheets and manufacturing outputs.

Revision Path Notes
v1 hardware/fluid-hardware/fluid_0001/ First generation
v2 hardware/fluid-hardware/fluid_0002/ Second generation
v3 hardware/fluid-hardware/fluid_0003/ FPGA integration
v3.4 hardware/fluid-hw-v3_4/ Current production (17 schematic sheets)

manufacturing/

fluid-autotest/

Python-based automated test suite for manufacturing. Tests firmware on assembled units, analyzes measurement data, and generates visualizations.

Detail Value
Language Python
Visualization Matplotlib

Tech Stack Summary

Layer Technology
Mobile Ionic, Angular, TypeScript
Web Admin React, Redux, Material-UI
API Express.js, TypeScript, Passport
Data Pipeline Express.js, Kue, Redis
Database PostgreSQL
Cloud AWS
Firmware Particle P1, C++
FPGA Xilinx Vivado, Artix-7, Verilog
Hardware Altium Designer
Mfg Test Python

About

Entire ultrasonic water meter product open-sourced: hardware, firmware, apps, backend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors