element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
In the Air Design Challenge
  • Challenges & Projects
  • Design Challenges
  • In the Air Design Challenge
  • More
  • Cancel
In the Air Design Challenge
Blog AirMobile - 9 - CO sensor
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: amgalbu
  • Date Created: 27 Nov 2014 12:36 PM Date Created
  • Views 510 views
  • Likes 1 like
  • Comments 2 comments
  • iot_distributed
  • msp-exp430fr5969
  • tgs2442
  • msp_430
  • in_the_air
Related
Recommended

AirMobile - 9 - CO sensor

amgalbu
amgalbu
27 Nov 2014

CO sensor Figaro TGS2442

As CO sensor, I'm going to use the Figaro TGS2442.

 

Hardware considerations

Connecting the Figaro TGS2442 is relatively simple (the difficult part is drive its inputs properly!)

 

   image

 

The sensor requires application of a 1 second heating cycle which is used in connection with a circuit. voltage cycle of 1 second. Each VH cycle is comprised by 4.8V being applied to the heater for the first 14ms, followed by 0V pulse for the remaining 986ms. The Vc cycle consists of 0V applied for 995ms, followed by 5.0V for 5ms. For achieving optimal sensing characteristics, the sensor's signal should be measured after the midpoint of the 5ms Vc pulse of 5.0V.

The only component to dimension is the load resistance RL. Datasheet states that RL needs to be greater than 10k. I think a 39k resistor is a good trade-off

As usual, I added a buffer and a voltage divider to get a voltage between 0 and 2.0 V


  image

 

Software implementation

Using the same functions I already talked about in my previous post, I can write a the function to read out the output value provided by the TGS2442 sensor

 

#define SENSORS_NO2_HEATHER_PORT   3

#define SENSORS_NO2_HEATHER_PIN    0

#define SENSORS_NO2_OUTPUT_PORT    3

#define SENSORS_NO2_OUTPUT_PIN     1

 

void SENSORS_ReadCO()

{

      GPIO_setOutputLowOnPin(SENSORS_NO2_OUTPUT_PORT,

                  SENSORS_NO2_OUTPUT_PIN);

 

      // generate pulse on heather pin

      GPIO_setOutputHighOnPin(SENSORS_NO2_HEATHER_PORT,

                  SENSORS_NO2_HEATHER_PIN);

 

      delay(14);

 

      GPIO_setOutputLowOnPin(SENSORS_NO2_HEATHER_PORT,

                  SENSORS_NO2_HEATHER_PIN);

 

      delay(981);

 

      // generate output to measure NO2 level

      GPIO_setOutputHighOnPin(SENSORS_NO2_OUTPUT_PORT,

                  SENSORS_NO2_OUTPUT_PIN);

 

      delay(3);

 

      float val = SENSORS_AnalogRead(ADC12_B_MEMORY_3);

      SENSORS_Data.CO = SENSORS_Map(val, 0 , 1023, 0, 100);

}

 

Currently the delay function is implemented as a simple loop. I'm trying to devise a more energy-efficient implementation

  • Sign in to reply

Top Comments

  • amgalbu
    amgalbu over 10 years ago in reply to ipv1 +1
    Hi I got the Figaro and the MiCS from RS components. On RS I also bought a sharp dust sensor I didn't buy the MiCS sensor because I found a sample at work, but I think it comes from cdiweb.com (it was…
  • amgalbu
    amgalbu over 10 years ago in reply to ipv1

    Hi

    I got the Figaro and the MiCS from RS components. On RS I also bought a sharp dust sensor

    I didn't buy  the MiCS sensor because I found a sample at work, but I think it comes from cdiweb.com (it was in a box with that logo)

     

    Hope it helps!

    Ambrogio

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ipv1
    ipv1 over 10 years ago

    May I ask where you got the sensors from? Both the figrao and the mics?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube