Code and documentation for an Arduino-based Dobson meter and sun photometer.
NOTE: This project is in early development, and the code is released as-is. It should be cleaned up and leaned up.
The instrument uses an Adafruit TCS34725 RGB color sensor to measure aerosol optical thickness (AOT) and Adafruit GUVA-S12SD UV sensors to measure column ozone thickness. Both sensors are connected to an Arduino, which is controlled by issuing commands via the serial port.
This code requires the TCS34725 library from Adafruit.
Serial commands can be an action or query command. Query commands are distinguished by a question mark ("?") at the end, while action commands contain a period at the end followed by command options. To issue a command, type the command followed by the new line character ("\n").
-
displayMeas
: reads saved measurements from memory locations0
throughaddr
and prints to serial port. -
echo.X
: specifies whether or not the sensor should return a messeage after completing a command. WhenX = 1
echo is turned on; whenX = 0
it is off. -
getMeas.X
: averagesX
readings and saves average to memory at memory locationsaddr
throughaddr + 24
. -
intTime.X
: sets the integration time of the TCS34725 RGB sensor.X
is the integration time in milliseconds. Available options are:2.5
, actual time = 2.4 ms, 1 cycle, max count = 102425
, actual time = 24 ms, 10 cycles, max count = 1024050
, actual time = 50 ms, 20 cycles, max count = 20480100
, actual time = 101 ms, 42 cycles, max count = 43008150
, actual time = 154 ms, 64 cycles, max count = 65535700
, actual time = 700 ms, 256 cycles, max count = 65535
For more information, see the Adafruit library reference.
-
memAddr.X
: sets the current save location to EEPROM addressX
. Address0
is reserved; available options are1
--487
(because 24 bytes are needed to save one measurement).
*IDN?
: returns the identification string of the sensor.intTime?
: Returns the integration time of the TCS34725 RGB sensor in milliseconds.memAddr?
: Returns the current EEPROM save location.