Balance Smart Car

Balance Smart Car #

  * @file  getGasPPM.ino
  * @brief Reading Gas concentration, A concentration of one part per million (PPM).
  * @n When using IIC device, select I2C address, set the dialing switch A0, A1 (Address_0 is [0 0]), (Address_1 is [1 0]), (Address_2 is [0 1]), (Address_3 is [1 1]).
  * @n When using the Breakout version, connect the adcPin and PowerPin
  * @copyright   Copyright (c) 2010 DFRobot Co.Ltd (
  * @licence     The MIT License (MIT)
  * @author      ZhixinLiu(
  * @version     V1.1
  * @date        2021-04-19
  * @get         from
  * @url
#include "DFRobot_MICS.h"

#define CALIBRATION_TIME   3                      // Default calibration time is three minutes

// When using the Breakout version, use the following program to construct an object from DFRobot_MICS_ADC
  adcPin is A0~A5
  powerPin is General IO
#define ADC_PIN   A0
#define POWER_PIN 10
DFRobot_MICS_ADC mics(/*adcPin*/ADC_PIN, /*powerPin*/POWER_PIN);

void setup() 
    Serial.println("NO Deivces !");
  } Serial.println("Device connected successfully !");

    Gets the power mode of the sensor
    The sensor is in sleep mode when power is on,so it needs to wake up the sensor. 
    The data obtained in sleep mode is wrong
  uint8_t mode = mics.getPowerState();
  if(mode == SLEEP_MODE){
    Serial.println("wake up sensor success!");
    Serial.println("The sensor is wake up mode");

     Do not touch the sensor probe when preheating the sensor.
     Place the sensor in clean air.
     The default calibration time is 3 minutes.
    Serial.println("Please wait until the warm-up time is over!");

void loop() 
    Gas type:
    MICS-4514 You can get all gas concentration
    MICS-5524 You can get the concentration of CH4, C2H5OH, H2, NH3, CO
    MICS-2714 You can get the concentration of NO2
      Methane          (CH4)    (1000 - 25000)PPM
      Ethanol          (C2H5OH) (10   - 500)PPM
      Hydrogen         (H2)     (1    - 1000)PPM
      Ammonia          (NH3)    (1    - 500)PPM
      Carbon Monoxide  (CO)     (1    - 1000)PPM
      Nitrogen Dioxide (NO2)    (0.1  - 10)PPM
  float gasdata = mics.getGasData(CO);
  Serial.println(" PPM");

Balance Smart Car Wiring #

Sample Code Balance Smart Car #

Powered by BetterDocs

Leave a Reply

Your email address will not be published. Required fields are marked *

Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
Click outside to hide the comparison bar
What are you looking for in Partdo?
× How can I help you?