Application Note AN 157: Arduino UART Interface to TelAire T6613 CO2 Sensor

Similar documents
Application Note AN 102: Arduino I2C Interface to K 30 Sensor

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

Arduino Setup & Flexing the ExBow

Arduino STEAM Academy Arduino STEM Academy Art without Engineering is dreaming. Engineering without Art is calculating. - Steven K.

EGG 101L INTRODUCTION TO ENGINEERING EXPERIENCE

TWEAK THE ARDUINO LOGO

Carbon Dioxide (Tiny CO2) Gas Sensor. Rev TG400 User Manual

Intelligent Infrared CO2 Module (Model: MH-Z19)

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

smraza Getting Start Guide Contents Arduino IDE (Integrated Development Environment)... 1 Introduction... 1 Install the Arduino Software (IDE)...

J. La Favre Using Arduino with Raspberry Pi February 7, 2018

Arduino Lesson 1. Blink. Created by Simon Monk

You'll create a lamp that turns a light on and off when you touch a piece of conductive material

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

Welcome to Arduino Day 2016

USER MANUAL SERIAL IR SENSOR ARRAY5

Coding with Arduino to operate the prosthetic arm

Application Note. Communication between arduino and IMU Software capturing the data

CPSC 226 Lab Four Spring 2018

Catalog

Lesson 3: Arduino. Goals

Arduino and Servo Motor

SV613 USB Interface Wireless Module SV613

Intelligent Infrared Carbon Dioxide Module (Model: MH-Z14)

Lab 2: Blinkie Lab. Objectives. Materials. Theory

EARTH PEOPLE TECHNOLOGY. EPT-200TMP-TS-U2 Temperature Sensor Docking Board User Manual

Grove - Infrared Receiver

Intelligent Infrared CO2 Module (Model: MH-Z19B)

Veyron Servo Driver (24 Channel) (SKU:DRI0029)

Practical Assignment 1: Arduino interface with Simulink

For this exercise, you will need a partner, an Arduino kit (in the plastic tub), and a laptop with the Arduino programming environment.

CURIE Academy, Summer 2014 Lab 2: Computer Engineering Software Perspective Sign-Off Sheet

ZX Distance and Gesture Sensor Hookup Guide

APDS-9960 RGB and Gesture Sensor Hookup Guide

Setup Download the Arduino library (link) for Processing and the Lab 12 sketches (link).

Training Schedule. Robotic System Design using Arduino Platform

AS726X NIR/VIS Spectral Sensor Hookup Guide

Security in a Radio Controlled Remote Switch

Experiment 1: Robot Moves in 3ft squared makes sound and

Arduino Digital Out_QUICK RECAP

Arduino: Sensors for Fun and Non Profit

URM37 V3.2 Ultrasonic Sensor (SKU:SEN0001)

Catalog

About New FT-SCServo (Smart Control Servo)

Catalog

The wiring is relatively simple. You should put the module on one of the compatible Arduinos. The following are compatible:

Catalogue

URM37 Ultrasonik Mesafe Sensörü - Arduino - Raspberry Pi - LattePanda Uyumlu - DFRobot

SV-MESH Mesh network series Catalogue

INTRODUCTION to MICRO-CONTROLLERS

CONSTRUCTION GUIDE IR Alarm. Robobox. Level I

Programming 2 Servos. Learn to connect and write code to control two servos.

FOD Transmitter User s Guide

Objectives: Learn what an Arduino is and what it can do Learn what an LED is and how to use it Be able to wire and program an LED to blink

Infrared Carbon Dioxide Sensor Module CM1108-Dual Beam

Analog Feedback Servos

keyestudio keyestudio Mini Tank Robot

Milli Developer Kit Reference Application Published on Silver Spring Networks STAGE (

USART Digital Compass Manual

HC-SR501 Passive Infrared (PIR) Motion Sensor

Arduino Platform Capabilities in Multitasking. environment.

Sten-Bot Robot Kit Stensat Group LLC, Copyright 2013

Lab 5: Arduino Uno Microcontroller Innovation Fellows Program Bootcamp Prof. Steven S. Saliterman

Servomotor Control with Arduino Integrated Development Environment. Application Notes. Bingyang Wu Mar 27, Introduction

Community College of Allegheny County Unit 4 Page #1. Timers and PWM Motor Control

INA169 Breakout Board Hookup Guide

Computational Crafting with Arduino. Christopher Michaud Marist School ECEP Programs, Georgia Tech

INTRODUCTION to MICRO-CONTROLLERS

Basics before Migtrating to Arduino

Monitoring Temperature using LM35 and Arduino UNO

INTRODUCTION to MICRO-CONTROLLERS

ASCOM EF Lens Controller

SEN Description. Features. MG-811 Specifications

itracker Arduino environment 1. Pin definition DNCX

Attribution Thank you to Arduino and SparkFun for open source access to reference materials.

HAW-Arduino. Sensors and Arduino F. Schubert HAW - Arduino 1

DFRduino Romeo All in one Controller V1.1(SKU:DFR0004)

isma-b-w0202 Modbus User Manual GC5 Sp. z o.o. Poland, Warsaw

2W UHF MHz Radio Transceiver

2F. No.25, Industry E. 9 th Rd., Science-Based Industrial Park, Hsinchu, Taiwan Application Note of OGM220, AN001 V1.8

Operating Mode: Serial; (PWM) passive control mode; Autonomous Mode; On/OFF Mode

FOD Transmitter User s Guide

DATASHEET. Amicrosystems AMI-AD1224 HIGH PRECISION CURRENT-TO-DIGITAL CONVERSION MODULE PRODUCT DESCRIPTION FEATURES

Catalog

Embedded Controls Final Project. Tom Hall EE /07/2011

CMPS11 - Tilt Compensated Compass Module

Trademarks & Copyright

Touch Potentiometer Hookup Guide

SC16A SERVO CONTROLLER

Capacitive Touch with Conductive Fabric & Flora

Lesson 13. The Big Idea: Lesson 13: Infrared Transmitters

Trinket Powered Analog Meter Clock

Airborne Innovations LLC

Portland State University MICROCONTROLLERS

EE 314 Spring 2003 Microprocessor Systems

Arduino Sensor Beginners Guide

Internet of Things Student STEM Project Jackson High School. Lesson 2: Arduino and LED

Montgomery Village Arduino Meetup Dec 10, 2016

LoRa Quick Start Guide

Transcription:

Application Note AN 157: Arduino UART Interface to TelAire T6613 CO2 Sensor Introduction The Arduino UNO, Mega and Mega 2560 are ideal microcontrollers for reading CO2 sensors. Arduino boards are useful for a beginner level project up to integration into a complete sensor product. The Arduino to sensor interface is via 19,200 BAUD serial TXD RXD connection. If you are new to Arduino, these low cost development boards are available from many sources. We recommend you start with authentic Arduino products. The Amphenol TelAire T6613 CO2 Sensor is a non dispersive infrared (NDIR) carbon dioxide sensor factory calibrated to measure CO2 levels up to 2,000ppm (0.2%). It is one of the most popular C02 sensors ever produced. The dual channel design eliminates the need for calibration in most applications. Its flexible interface is designed to be easily connected to an Arduino or similar microcontroller. The sensor requires 5VDC, 180mA peak current and 33mA average current. Run the Arduino Blink Example The best way to become familiar with the Arduino Graphical User s Interface (GIU) is to create an Arduino project and run the example Blink. This simple test program confirms that a number of connection details and that the GUI are working properly. Caution: Do not connect your Arduino board to your computer s USB port until the Arduino software is installed. Otherwise Windows would install a generic driver, not desired here. Step 1: Install Arduino software on your computer. From this page select the Windows Installer. https://www.arduino.cc/en/main/software Step 2: To run the Blink example follow these instructions: https://www.arduino.cc/en/tutorial/blink Note that the MEGA Arduinos have a LED on board. The Arduino UNO may require a LED and resistor be added as specified in the tutorial. Once Blink runs properly, you can connect the sensor. 16 March 2017 CO2Meter, Inc. All Rights Reserved 1

ConnectingtheT6613Sensor RefertothewiringdiagrambelowfortheArduinoUnoorArduinoMega. TheconnectionsfortheArduinoMEGAareidenticaltotheMega2560. 16March2017CO2Meter,Inc.AllRightsReserved 2

Creating an Arduino Project This Arduino project uses the Software.Serial driver which is built into the Arduino software. This statement SoftwareSerial T66_Serial(12,13) Sets up a virtual serial port using pin 12 for Rx and pin 13 for Tx on both UNO and MEGA boards. Demo file download instructions 1. Click on the following link or copy this URL to download the example code: http://co2meters.com/documentation/appnotes/an157-t6613-arduino-uart.zip 2. Save the example code to your hard drive. Inside the.zip file, navigate to the AN157 Arduno T6613 uart.ino file in the example folder. Extract it from the.zip file. 3. Double click the K30_basic.ino file to open it in the Arduino GUI. It will start and ask the following: 4. Click on OK. Observe the Arduino project code is displayed. 5. Click on Sketch >> Verify/Compile. The project should compile without errors. 6. Verify that your Arduino board is recognized correctly: a. Click on Tools. Set Board to Arduino Uno or MEGA. b. Confirm that Processor matches your Arduino: UNO, MEGA or MEGA 2560. 7. Click on Upload. When done uploading, your project is now running in the Arduino board. 8. To view program operation, click on Tools >> Serial Monitor. 9. Observe the following: 16 March 2017 CO2Meter, Inc. All Rights Reserved 3

Note Appendix A contains the.txt version of Arduino code. It is also available in the.zip file. 16 March 2017 CO2Meter, Inc. All Rights Reserved 4

Appendix A: Ardunio code runs on UNO, MEGA OR MEGA2560 /* AN-157 Demo of T-66 using Software Serial Arduino example for t6613 CO2 sensor 0-2000 PPM 19200 BPS 2/2017 by Marv Kausch @ Co2meter.com */ #include "SoftwareSerial.h" SoftwareSerial T66_Serial(12,13); //Sets up a virtual serial port //Using pin 12 for Rx and pin 13 for Tx byte readco2[] = 0xFF, 0XFE,2,2,3; //T66 read CO2 command: 5 bytes byte response[] = 0,0,0,0,0; //create an array to store the response void setup() // put your setup code here, to run once: Serial.begin(19200); //Opens the main serial port to communicate with the computer T66_Serial.begin(19200); //Opens the virtual serial port with a baud of 9600 Serial.println(" Demo of AN-157 Software Serial and T66 sensor"); Serial.print("\n"); void loop() sendrequest(readco2); function call //Locate the problem of program reset whduring this unsigned long valco2 = getvalue(response);// Request from sensor 5 bytes of data Serial.print("Sensor response: "); for(int i=0;i<5;i++) Serial.print(response[i],HEX); Serial.print(" "); Serial.print(" Co2 ppm = "); Serial.println(valCO2); delay(2000); //T6613 spec indicates signal update every 4 seconds void sendrequest(byte packet[]) while(!t66_serial.available()) //keep sending request until we start to get a response T66_Serial.write(readCO2,5);// Write to sensor 5 byte command delay(50); delay(1000); 16 March 2017 CO2Meter, Inc. All Rights Reserved 5

int timeout=0; //set a timeoute counter while(t66_serial.available() < 5 ) //Wait to get a 7 byte response timeout++; if(timeout > 10) //if it takes to long there was probably an error Serial.print("Timeout"); while(t66_serial.available()) //flush whatever we have T66_Serial.read(); break; //exit and try again delay(50); for (int i=0; i < 5; i++) response[i] = T66_Serial.read(); unsigned long getvalue(byte packet[]) int high = packet[3]; //high byte for value is 4th byte in packet in the packet int low = packet[4]; //low byte for value is 5th byte in the packet unsigned long val = high*256 + low; //Combine high byte and low byte with this formula to get value return val; 16 March 2017 CO2Meter, Inc. All Rights Reserved 6