You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are _abbreviated_ instructions on how to add a new sensor to the OLA firmware. It's more of an aide-memoire really... Sorry about that.
4
+
5
+
Caveat: this is _currently_ how a new sensor is added, for version v1.n of the OLA firmware using v1.2.n of the Apollo3 boards (the OLA code is compiled using the SparkFun RedBoard Artemis ATP (All The Pins) board). This will change, dramatically, when we upgrade to v2 of Apollo3 and integrate BLE support.
6
+
7
+
## Use The Release Candidate Branch
8
+
9
+
First up, please target any commits at the _**release_candidate**_ branch, so they can be tested before being merged into the _master_ branch.
-[Add the new sensor to the comments at the start of the file](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-7d096a133c17fd6db382abb9a3c6ea7b42ec505961876cecf404a55be5945347R71)
16
+
17
+
-[#include the library .h file remembering to include the library manager helper link](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-7d096a133c17fd6db382abb9a3c6ea7b42ec505961876cecf404a55be5945347R203)
18
+
19
+
## Sensors.ino
20
+
21
+
### gatherDeviceValues
22
+
23
+
- This is where the sensor readings are actually read. [Add a case for the new sensor](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-fba25af49a58a7a24fb75cb34321e25dd4a94a9d3515ac051fcaa4502e444f7fR725-R798)
24
+
25
+
### printHelperText
26
+
27
+
-[Add helper text for the sensor readings](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-fba25af49a58a7a24fb75cb34321e25dd4a94a9d3515ac051fcaa4502e444f7fR1132-R1165)
28
+
29
+
## autoDetect.ino
30
+
31
+
### addDevice
32
+
33
+
- This code is called to add the discovered device to the linked list of active devices. [Add a case for the new sensor](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-68cc245ab0d3c1bed2bfc22b403edc3ed73d347a35a21179b3a6ec27a458803bR234-R239). The class name comes from the library. The config struct is defined in settings.h.
34
+
35
+
### beginQwiicDevices
36
+
37
+
- This is the code that is called to start (begin) the device. [Add a case for the new sensor](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-68cc245ab0d3c1bed2bfc22b403edc3ed73d347a35a21179b3a6ec27a458803bR453-R461). Update _qwiicPowerOnDelayMillis_ if this device needs extra time to get its act together on power-up.
38
+
39
+
### configureDevice
40
+
41
+
- If the sensor needs to be configured before use, that gets done here. [Add a case for the new sensor, even if it doesn't need to be configured.](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-68cc245ab0d3c1bed2bfc22b403edc3ed73d347a35a21179b3a6ec27a458803bR705-R707)
42
+
43
+
### getConfigFunctionPtr
44
+
45
+
-[Add a pointer to the sensor menu function (defined in menuAttachedDevices.ino)](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-68cc245ab0d3c1bed2bfc22b403edc3ed73d347a35a21179b3a6ec27a458803bR795-R797)
46
+
47
+
### swap
48
+
49
+
-[Add the device's I2C address(es) here - just for reference (we don't use these #defines any longer)](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-68cc245ab0d3c1bed2bfc22b403edc3ed73d347a35a21179b3a6ec27a458803bR929)
50
+
51
+
### testDevice
52
+
53
+
- This is the code used to detect the sensor. [Add a case for the new sensor](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-68cc245ab0d3c1bed2bfc22b403edc3ed73d347a35a21179b3a6ec27a458803bR987-R994). Provide some indication of how robust the detection is. Confidence would be high if the .begin writes and reads unique data to/from the sensor. Confidence is low if .begin only uses the standard _isConnected_ I2C address test.
54
+
55
+
### getDeviceName
56
+
57
+
- This is where the sensor name is defined as text. [Add a case for the new sensor](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-68cc245ab0d3c1bed2bfc22b403edc3ed73d347a35a21179b3a6ec27a458803bR1423-R1425). Keep it brief and follow the same format as the other sensors: usually _TYPE_ (PRESSURE, TEMPERATURE etc.) followed by the abbreviated manufacturer's part number
58
+
59
+
## menuAttachedDevices.ino
60
+
61
+
### menuAttachedDevices
62
+
63
+
- This is the code which lists all the attached devices as a menu. [Add a case for the new sensor](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-6174875faf8039f2627c16aaf48e4db57f5a2c8c883061ac97202d74e9a46ef8R309-R311)
64
+
65
+
### menuConfigure_
66
+
67
+
-[Add a new menuConfigure_ for the new sensor](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-6174875faf8039f2627c16aaf48e4db57f5a2c8c883061ac97202d74e9a46ef8R2026-R2141)
68
+
- Boolean settings are simple to toggle. [Make them exclusive if you need to](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-6174875faf8039f2627c16aaf48e4db57f5a2c8c883061ac97202d74e9a46ef8R1942-R1948)
69
+
-_int64_t_ values are requested using _getNumber_ (defined in support.ino)
70
+
-_double_ values are requested using _getDouble_ (defined in support.ino)
71
+
72
+
## nvm.ino
73
+
74
+
### recordDeviceSettingsToFile
75
+
76
+
- This function gets called to write the device settings to file. [Add a case for the new sensor](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-629ae89c3c660583493d544d3a7902728f4a8eefb65800c3acb64aea37d5d88dR611-R629). Include all of the sensor settings.
77
+
78
+
### parseDeviceLine
79
+
80
+
- This function gets called when the device settings are read back from file. [Add a case for the new sensor](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-629ae89c3c660583493d544d3a7902728f4a8eefb65800c3acb64aea37d5d88dR1116-R1150)
81
+
82
+
## settings.h
83
+
84
+
### enum
85
+
86
+
-[Add the device to the enumerated sensors](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-c853eddd04f78093fed5ec20b822c3c224bfa5f268738ce4c479b45667f86fe9R25). Insert the new one above _DEVICE_TOTAL_DEVICES_
87
+
88
+
### settings struct
89
+
90
+
-[Add a settings struct for the new sensor](https://github.com/sparkfun/OpenLog_Artemis/commit/2a26acd279fa93cfe84f1bc518c0e7a041b3bc44#diff-c853eddd04f78093fed5ec20b822c3c224bfa5f268738ce4c479b45667f86fe9R265-R281). Include both _log_ and _powerOnDelayMillis_
91
+
92
+
## README.md
93
+
94
+
- Add the new sensor to the list in [README.md](./README.md). Include a link to the product page
95
+
- Update the OLA product page on Sparkle - add the new sensor to the list
96
+
97
+
## CHANGELOG.md
98
+
99
+
- Update [CHANGELOG.md](./CHANGELOG.md). Start a new version if you need to. Add the new sensor to the change notes
Copy file name to clipboardExpand all lines: Firmware/OpenLog_Artemis/OpenLog_Artemis.ino
+42-8Lines changed: 42 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -32,9 +32,9 @@
32
32
Find way to store device configs into EEPROM
33
33
Log four pressure sensors and graph them on plotter
34
34
(checked) Test GPS - not sure about %d with int32s. Does lat, long, and alt look correct?
35
-
Test NAU7802s
36
-
Test SCD30s
37
-
Add a 'does not like to be powered cycled' setting for each device type.
35
+
(done) Test NAU7802s
36
+
(done) Test SCD30s (Add an extended delay for the SCD30. (Issue #5))
37
+
(won't do?) Add a 'does not like to be powered cycled' setting for each device type. I think this has been superceded by "Add individual power-on delays for each sensor type?.
38
38
(done) Add support for logging VIN
39
39
(done) Investigate error in time between logs (https://github.com/sparkfun/OpenLog_Artemis/issues/13)
(done) Add a fix so that the MS8607 does not also appear as an MS5637
45
45
(done) Add "set RTC from GPS" functionality
46
46
(done) Add UTCoffset functionality (including support for negative numbers)
47
-
Figure out how to give the u-blox time to establish a fix if it has been powered down between log intervals.
48
-
Maybe add a waitForValidFix feature? Or maybe we can work around using a big value for "Set Qwiic bus power up delay"?
47
+
(done) Figure out how to give the u-blox time to establish a fix if it has been powered down between log intervals. The user can specify up to 60s for the Qwiic power-on delay.
49
48
Add support for VREG_ENABLE
50
49
(done) Add support for PWR_LED
51
50
(done) Use the WDT to reset the Artemis when power is reconnected (previously the Artemis would have stayed in deep sleep)
@@ -65,10 +64,15 @@
65
64
(done) Correct the measurement count misbehaviour (Issue #31)
66
65
(done) Use the corrected IMU temperature calculation (Issue #28)
67
66
(done) Add individual power-on delays for each sensor type. Add an extended delay for the SCD30. (Issue #5)
67
+
(done) v1.7: Fix readVin after sleep bug: https://github.com/sparkfun/OpenLog_Artemis/issues/39
68
+
(done) Change detectQwiicDevices so that the MCP9600 (Qwiic Thermocouple) is detected correctly
69
+
(done) Add support for the MPRLS0025PA micro pressure sensor
70
+
(done) Add support for the SN-GCJA5 particle sensor
71
+
(done) Add IMU accelerometer and gyro full scale and digital low pass filter settings to menuIMU
68
72
*/
69
73
70
74
constint FIRMWARE_VERSION_MAJOR = 1;
71
-
constint FIRMWARE_VERSION_MINOR = 6;
75
+
constint FIRMWARE_VERSION_MINOR = 7;
72
76
73
77
//Define the OLA board identifier:
74
78
// This is an int which is unique to this variant of the OLA and which allows us
@@ -78,7 +82,7 @@ const int FIRMWARE_VERSION_MINOR = 6;
#defineOLA_IDENTIFIER0x117// Stored as 279 decimal in OLA_settings.txt
82
86
83
87
#include"settings.h"
84
88
@@ -195,6 +199,8 @@ ICM_20948_SPI myICM;
195
199
#include"SparkFun_Qwiic_Humidity_AHT20.h"//Click here to get the library: http://librarymanager/All#Qwiic_Humidity_AHT20 by SparkFun
196
200
#include"SparkFun_SHTC3.h"// Click here to get the library: http://librarymanager/All#SparkFun_SHTC3
197
201
#include"SparkFun_ADS122C04_ADC_Arduino_Library.h"// Click here to get the library: http://librarymanager/All#SparkFun_ADS122C04
202
+
#include"SparkFun_MicroPressure.h"// Click here to get the library: http://librarymanager/All#SparkFun_MicroPressure
203
+
#include"SparkFun_Particle_Sensor_SN-GCJA5_Arduino_Library.h"// Click here to get the library: http://librarymanager/All#SparkFun_Particle_Sensor_SN-GCJA5
0 commit comments