Example 1 - interfacing a carbon dioxide sensor to the Raspberry Pi

We will be making use of the K30 carbon dioxide sensor (its documentation is available here, http://co2meters.com/Documentation/Datasheets/DS30-01%20-%20K30.pdf). It has a range of 0-10,000 ppm, and the sensor provides it carbon dioxide concentration readings via serial port as a response to certain commands from the Raspberry Pi.

The following diagram shows the connections between the Raspberry Pi and the K30 carbon dioxide sensor:

K30 carbon dioxide sensor interfaced with the Raspberry Pi

The receiver (Rx) pin of the sensor is connected to the transmitter (Tx-GPIO 14 (UART_TXD) ...

Get Python Programming with Raspberry Pi now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.