Jump to content
  • 0

Connecting to a CO2 sensor using UART


altarace

Question

I have a CO2 sensor (SenseAir S8) that is onboard a CO2 measuring device (called upHere co2 meter). The device is only showing 0 as the CO2 level so I'd like to try and troubleshoot.

The S8 sensor supports UART communication. The protocol is a variant of MODBUS and is well documented. I made several attempts at using the AD2 to communicate with the device but was unsuccessful. Wondering if I can get some pointers at what I'm doing wrong. Here is what I tried. 

Setup 1 bare-bone:

4.7 v directly into the sensor G+ G0 pins.

Sensor TX connected to AD2 DIO6

Sensor RX connected to AD2 DIO7

AD2 in protocol mode, TX DIO7 , RX DIO6, 8Bit, 1 Stop Bit, 9600 Baud

When I powered up the S8 and hit  "Receive" I got endless  "noise" (even just by touching the AD2 leads when they are not connected to anything). Adding a 1uf capacitor between DIO6-7 and the AD2 ground and switching back and forth the polarity seems to quiet down the noise.  I then tried to send "{hFE}{h04}{h00}{h03}{h00}{h01}{hD5}{hC5}" which is the co2 read request format (page 19 on protocol doc) but got only {hFF}{hFF} back. Same response for a status request "{hFE}{h04}{h00}{h00}{h00}{h01}{h25}{hC5}"

Question on bare-bone setup:

1. Is noise from touching the digital leads generating UART output expected? Is using the capacitors the right way of eliminating the noise?

2. The sensor protocol calls for 1 stop bit on receive and 2 stop bit on send, how can I configure that in the UART protocol settings?

3. Is {hEF}{h04}... the correct syntax for sending hex data in UART? didn't find that in the docs

(I also tried an inline setup using the AD2 in logic mode and have questions on that as well, but would rather not make this topic too large)

Thank you in advance. 

References:

S8 Spec:http://www.senseair.com/wp-content/uploads/2012/06/PSP108-1.pdf

S8 Protocol Spec: http://www.warf.com/download/6337_6449_2.pdf

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Hi @altarace

1. On the AD and AD2 the digital IO pins use LVCMOS 3V3 standard. These are supplied at 3.3V and have 200 Ohm PTC and clamping diodes to GND and to 3.3V for protection.
It will drive the digital wires at 3.3V and connecting 5V signals directly, without series resistor, it will sink about 10mA through the PTC and 3v3 diode.
As for noise, make sure to have ground connection between the two devices.

2. The WF/Protocol/UART uses the Stop length option only for transmission, this is not relevant for reception.

3. The UART TX filed lets you type in characters, hexadecimal values are not supported here. 
Special chars you can copy/paste from other place or send from file.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...