Specifics - pmcontrolunit/pmcu-firmware GitHub Wiki
pmcu-firmware hosts the code that runs on the MSP430F5529
, that makes the PMCU actually work.
Components:
Device | Description |
---|---|
MSP430F5529 | The MCU used |
GY-GPS6MW2 | For GPS purposes |
SIM800L | For the communication over the GSM network |
DHT22 | For temperature and humidity measures |
SPS30 | For PM measures |
Firmware logic:
Setup phase:
- SPS30 is set to measurement mode.
- Waits 5 minutes in order to let modules setup (like SPS30).
Looping phase:
- Inits transferring buffer.
- Puts GPS data in it.
- Puts DHT22 temperature and humidity.
- Puts SPS30 data.
- Sends data through 2G network.
Those operations are repeated every 30 seconds.
SPS30 fan cleaning phase:
- Starts fan cleaning.
- Waits 15 seconds.
It's done every hour. When a fan cleaning occurs no measurement will be done (a looping phase frame is dropped).
Packet structure:
Size | Type | Name | Unit |
---|---|---|---|
2 bytes | String | Phone Number | |
? < 60 bytes | String | NMEA GSA sentence | |
? < 60 bytes | String | NMEA GGA sentence | |
2 bytes | Unsigned int | Temperature | °C x10 |
2 bytes | Unsigned int | Humidity | RF x10 |
4 bytes | Float | Mass concentration PM1.0 | ug/m^3 |
4 bytes | Float | Mass concentration PM2.5 | ug/m^3 |
4 bytes | Float | Mass concentration PM4.0 | ug/m^3 |
4 bytes | Float | Mass concentration PM10 | ug/m^3 |
4 bytes | Float | Number concentration PM0.5 | #/cm^3 |
4 bytes | Float | Number concentration PM1.0 | #/cm^3 |
4 bytes | Float | Number concentration PM2.5 | #/cm^3 |
4 bytes | Float | Number concentration PM4.0 | #/cm^3 |
4 bytes | Float | Number concentration PM10 | #/cm^3 |
4 bytes | Float | Typical particle size | um |
Networking
The packet is sent over the 2G network, via UDP, to an MQTT broker.