ZMOD4510 Module Commands
The PCB Artists ZMOD4510 Module commands give you the flexibility needed for using the ZMOD4510 gas sensor in your application without having to worry about all the algorithms involved. All you need is UART for using our module.
Now available for ordering
You can buy the UART ZMOD4510 module directly from us if you need to use the sensor with an MCU that cannot handle the sensor by itself.
Renesas (IDT) provides libraries for data processing that can be used for interpreting the raw data received from the ZMOD4510 OAQ sensor and the host MCU must use these libraries to then calculate the gas concentrations and OAQ value.
This sounds easy and rather simple. But it is not, the primary reason being that the algorithm is several KBs large and will not fit into most MCUs used in simple applications. The algorithm also involves a lot of floating point computations which are best done on a 32-bit platform with floating point support of some kind. Our module packs a powerful, very low power ARM Cortex M0+ core to get the job done so you don’t have to!
In this article, we have a look at all the ZMOD4510 module commands supported by the latest firmware version. The commands are listed in the order in which they will usually be used in an application.
Note that this documentation is subject to change and there will be a changelog added to the end of this article when that happens.
"ID\n": Read ZMOD4510 module ID
This is the first ZMOD4510 module command that you should issue to check whether it is powered up and ready to work. The host can repeatedly poll this command to get a valid response.
- This command can be used at any time as a diagnostics command to check if the module is responding.
#Command: "ID\n" #Response: "1234ABCD\n" on success "F\n" on failure
"VR\n": Read ZMOD4510 module firmware version
This command can be issued to the module to check the version of the current firmware that the module is running. This helps confirm what command set is supported by the module.
- This command should be used before issuing any other configuration or data related commands to ensure that the current module firmware supports those commands.
#Command: "VR\n" #Response: "V.x.xx\n" on success "F\n" on failure
"CI\n": Clear ZMOD4510 module interrupt
This command can be issued to the module to clear the interrupt on the module INT pin. The INT pin goes low when there is new set of data available for reading.
- This command should be used when the host does not want to read all the sensor parameters after a measurement is finished, but just wants to keep track of how many measurements have been performed.
- The INT line is automatically cleared when the host reads new AQI, conc (O3) and conc(NO2) data from the ZMOD4510 module. There is no need to call this command in that case.
#Command: "CI\n" #Response: "S\n" on success "F\n" on failure
"RS\n": Re-start the ZMOD4510 module
This ZMOD4510 Module command can be issued to completely reset or reboot the module. Issuing this command is similar to cycling the physical reset pin on the module Cortex-M0+ MCU and the ZMOD4510 sensor. All configuration settings and stabilization data is lost.
- Restart command should not be required under normal circumstances, however, if you would like to reset any “initialization command” parameters, you need to re-start the module and then change the “initialization command” parameters.
- Please allow the module about 100 ms to re-start after receiving a “success” response.
#Command: "RS\n" #Response: "S\n" on success "F\n" on failure
"SSxx\n": Set stabilization sample count (Default: 10)
Because of the nature of chemiresistors, the ZMOD4510 must ignore some initial samples in order for the readings to stabilize. It is generally recommended to set the module to ignore 10 to 60 initial readings.
Default value for this parameter is 10.
- The AQI and gas concentration measurements are not performed while the sensor stabilizes. The sensor might read AQI = conc(O3) = conc(NO2) = 0 and prob(NO2) = 0.5 when stabilization is in progress.
- INT pin is lowered after every dummy measurement when stabilization is in progress. This is done so that the host can keep track of how many dummy measurement cycles have been completed. The host should ignore AQI and concentration data available during stabilization cycles.
- This command is only allowed once after a module power-up or after a re-start command is issued. Issuing this command more than once will result in a command failure.
#Command: "SSxx\n" #Response: "S\n" on success "F\n" on failure #Examples: "SS05\n" "SS10\n"
"OPx\n": Algorithm optimization option (Default: AUTO)
The ZMOD4510 detects both O3 and NO2 using the same chemiresistor element. While both gases affect the chemiresistor slightly differently – they do both affect it. If you already know whether you are exposing the sensor to O3 or NO2 specifically, it is helpful to set the algorithm appropriately for obtaining more accurate results. For general AQI evalution purposes, leaving the algorithm as default is the best option.
- The AQI is calculated after every measurement cycle. If you change this option, the AQI output uses this new setting for all upcoming measurement cycles.
- It is recommended to configure it initially after a module re-start or power-up.
#Command: "OPN\n" optimize for NO2 "OPO\n" optimize for O3 "OPA\n" auto #Response: "S\n" on success "F\n" on failure
"PU\n": Power up sensor and start measurements
Issue this command to power up the ZMOD4510 and start measurements. Each measurement cycle is 30 seconds long. The initial set number of measurements are considered “stabilization samples” and are not used for evaluating the AQI.
- The module will keep performing measurements once powered up. INT will be pulled low to indicate the availability of a new measurement.
- Host can poll for availability of a new reading by using the NR (check for new reading) command. Polling every 10 seconds is adequate if INT line cannot be monitored by the host.
#Command: "PU\n" #Response: "S\n" on success "F\n" on failure
"PD\n": Power down the sensor and stop measurements
Issue this command to power down the ZMOD4510 and stop measurements.
PU command re-starts the sampling process again.
- Resuming measurements using PU command does not require stabilization samples again.
- For accuracy of measurements, it is recommended to use the RS (restart) command if the module has been idle for a long time.
#Command: "PD\n" #Response: "S\n" on success "F\n" on failure
"AQ\n": Read AQI value
This command returns the calculated AQI value calculated from O3 and NO2 concentrations as determined by the sensor.
The format of the returned AQI value is xxxx.x
- The AQI values are not defined during stabilization. AQI will usually be 0 during stabilization.
#Command: "AQ\n" #Response: "xxxx.x\n" on success "F\n" on failure #Examples: "0046.1\n" "0110.0\n"
"NO\n": Read NO2 concentration (ppb)
This command returns the calculated concentration of NO2 in parts per billion (ppb).
The format of the returned concentration value is xxxx.x
- NO2 concentration values are not defined during stabilization. It will usually be 0 during stabilization.
#Command: "NO\n" #Response: "xxxx.x\n" on success "F\n" on failure #Examples: "0046.1\n" "0110.0\n"
"O3\n": Read O3 concentration (ppb)
This command returns the calculated concentration of O3 in parts per billion (ppb).
The format of the returned concentration value is xxxx.x
- O3 concentration values are not defined during stabilization. It will usually be 0 during stabilization.
#Command: "O3\n" #Response: "xxxx.x\n" on success "F\n" on failure #Examples: "0046.1\n" "0110.0\n"
"PN\n": Probability of NO2
Because of how the chemiresistor sensing element inside the ZMOD4510 responds to gases, the probability of NO2 affecting the measurements needs to be measured by processing raw data.
This probability value can be read using this command and the result is multiplied by 100. The format of the returned probability value is xxx
- The probability value will be zero-padded and always will be 3 digits long as specified in the format and examples below.
#Command: "PN\n" #Response: "xxx\n" on success "F\n" on failure #Examples: "020\n" P=0.2 "003\n" P=0.03
"NR\n": Check for availability of new readings
Issue this command to get the current measurement status of the module. The host can simply wait for the INT line to go low to indicate the availability of a new data set rather than polling the ZMOD4510 module using this command repeatedly.
- The host can poll the ZMOD4510 module every 10 seconds or 5 seconds to check for new readings. Because each measurement cycle is 30 seconds long, it will always take 30 seconds for new readings to be available to the host.
#Command: "PN\n" #Response: "S\n" New data available "F\n" Sensor is powered off "W\n" Wait (sampling in progress)
These are all the ZMOD4510 Module commands that you need to use to utilize all features of the sensor via the UART interface without having to use a powerful MCU for obtaining accurate results.
- Initial Release: 16 Sepember 2020