PongSat in a project originally designed for TinyDuino in order to fit whole electronic part in ping pong ball size sphere(40mm diameter) to be able to store at least 4h of data on LiPo battery. You can run it on any Arduino-based boards after small changes in pin configuration.
PongSat uses Barometric Pressure Sensor - MPL115A1 to measure pressure and temperature. The measurements are saved on SD-card in DATALOG.TXT file.
Settings are stored in CONFIG.TXT file on SD-card. This mechanism allows us to configure device's behaviour in very convenient way.
###Hardware used in original project:
- Barometric Pressure Sensor - MPL115A1 Breakout
- TinyDuino Processor Board
- TinyShield USB & ICP
- Polymer Lithium Ion Battery - 110mAh
- TinyShield microSD
- TinyShield Proto Board 1
- TinyLily Push-button 3mm
- TinyLily LED 1206
This is a site containing very useful info about LiPo batteries - link Remember not to over-discharge the battery it's voltage shouldn't fall under 3V.
Push-button is used to force saving of all data and stopping measurement.
The diode communicates the state of the device:
- every measurement diode do short blink,
- when the data are saved to SD-card diode blinks twice,
- 4 slow blink - break -... at the begging means that Arduino cannot initiate SD-card
- after pressing push-button diode blinks constantly.
###Hardware connections:
Barometric Pressure Sensor - MPL115A1 hardware pin-configuration:
SDN ------------------- D9
CSN ------------------- D3
SDO ------------------- D12 *
SDI ------------------- D11 *
SCK ------------------- D13 *
GND ------------------- GND
VDD ------------------- VCC
*SPI - you cannot change them
Pin D9 has additional diode attached. Push-button is connected to pin D2 with pull-up resistor. The pin can be changed, but you will need to ensure that the new one can be used as interrupt.
###Configuration The parameters of measurement can be set in CONFIG.TXT file. Settings include:
- Approximate period between measurements specified in seconds - e.g. mP = 5
- whether measure pressure [0 or 1] - iPM = 1
- whether measure temperature [0 or 1] - iTM = 1
- how often write the results to SD card [0-100, 0-every measurement, 100- every 100 measurement] - SDWP = 5
- datalog comment included at the beginning of every set of measurements (keep it short, long strings may overload arduino's memory) - dC = "14-01-18, 17:06, Krakow"
Each key must be typed exactly like in examples above (case sensitive) and these are all currently parsed settings (mP, iPM, iTM, SDWP, dC). Each of them must be followed by "=". Each ones' value should follow specified convention:
- iPM, iTM - boolean value 0 or 1,
- mP, SDWP - integer; mP range = [0 - 37767], SDWP range = [0-100],
- dC - string within quotation marks e.g. "keep it short"
//The CONFIG.TXT file may include comments preceded by shlash like this line
Writing results to SD-file is energy consuming, so you can specify SDWP - the amount of measurements stored in Arduino memory before writing them to DATALOG.TXT file (not more than 100). The data stored in Arduino memory will be lost after power down or reset, but data in SD-card will be safe in such cases. The push-button has interrupt attached - it can force during Arduino sleeping time saving all remaining data to SD-card and stops measurement.
The time between each measurement (mP) also can be set (up to maximum ATMega integer range - 37767). Actual time may float - it depends on battery voltage. Between measurement Arduino is in sleep mode in order to save energy.
###Data interpretation
Data saved in DATALOG.TXT need to be processed. The MPL115A1 sensor returns two integer values representing pressure and temperature measurements. You should use following formula in order to convert this values. See MMPL115A1 documentation
#####Pressure Sensor range is is 50 to 115kPa and its output value varies from 0 to 1023. So to calculate pressure in kPa use following equation:
- pressure_kPa = (65.0/1024.0)*pressure_int + 50
#####Temperature Temperature resolution is -5.35 counts/Celcius and 472 ADC value is 25 Celcius, so:
- temperature_celcius = 25 + (temperature_int - 472) / -5.35
###Used open-source code: Part of this project was make on the basis of the following work: