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
Arduino
  • Products
  • More
Arduino
Arduino Forum Gas sensors with pulse sensor,no serial output problem, PLEASE HELP!!!
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 4 replies
  • Subscribers 392 subscribers
  • Views 341 views
  • Users 0 members are here
  • sensors
  • arduino
Related

Gas sensors with pulse sensor,no serial output problem, PLEASE HELP!!!

Former Member
Former Member over 11 years ago

im new to arduino, can i please know that how use two analog gas sensors,

a temparature sensor with the pulse sensor (www.pulsesensor.com), pulse sensor having interrupts

so i cant get serial output of those all in once, anyone know how to do that, what i need to do?

how to get all sensors output and pass to serial (bluetooth device) ?

please HELP ME!!!

  • Sign in to reply
  • Cancel
Parents
  • nschreiber0813
    0 nschreiber0813 over 11 years ago

    Dear: Buddhima

    I am sorry but you weren't very specific. You need to tell us first of all what sensor you are using, the datasheet you are using, and what code you are using. Then that should be enough for us to help you.

    From: Noah

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • nschreiber0813
    0 nschreiber0813 over 11 years ago

    Dear: Buddhima

    I am sorry but you weren't very specific. You need to tell us first of all what sensor you are using, the datasheet you are using, and what code you are using. Then that should be enough for us to help you.

    From: Noah

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • Former Member
    0 Former Member over 11 years ago in reply to nschreiber0813

    #include <DHT11.h>

     

     

    int pin = 4;

     

     

    DHT11 dht11(pin);

     

     

    int coPin = A0; 

     

     

    int pulsePin = A1;

     

     

    int methanePin = A2;

                   

    int pulseRate = 0;               

     

     

    int sensorValue = 0;

     

     

    int tempValue = 0;

     

     

    int methaneValue = 0;

     

     

    int coValue = 0;

     

     

    int blinkPin = 13;                // pin to blink led at each beat

     

     

    int fadePin = 5;                  // pin to do fancy classy fading blink at each beat

     

     

    int fadeRate = 0;                 // used to fade LED on with PWM on fadePin

     

     

     

     

     

     

     

     

     

     

     

     

    // these variables are volatile because they are used during the interrupt service routine!

    volatile int BPM;                   // used to hold the pulse rate

    volatile int Signal;                // holds the incoming raw data

    volatile int IBI = 600;             // holds the time between beats, must be seeded!

    volatile boolean Pulse = false;     // true when pulse wave is high, false when it's low

    volatile boolean QS = false;        // becomes true when Arduoino finds a beat.

     

     

     

     

     

     

     

     

    void setup()

    {

       Serial.begin(9600);

      while (!Serial) {

          ; // wait for serial port to connect. Needed for Leonardo only

        }

        

    }

     

     

    void loop()

    {

     

     

      interruptSetup();

     

     

     

       sendDataToProcessing('S', Signal);     // send Processing the raw Pulse Sensor data

      if (QS == true){                       // Quantified Self flag is true when arduino finds a heartbeat

            fadeRate = 255;                  // Set 'fadeRate' Variable to 255 to fade LED with pulse

            sendDataToProcessing('B',BPM);   // send heart rate with a 'B' prefix

            sendDataToProcessing('Q',IBI);   // send time between beats with a 'Q' prefix

            QS = false;                      // reset the Quantified Self flag for next time   

         }

     

     

     

      delay(20);  

     

      get_co();

      get_methane();

      get_temp();

     

     

      delay(5000); 

      

    }

     

     

    int get_co()

     

     

    {

     

     

    coValue = analogRead(coPin);

    Serial.println(coValue);

     

    }

     

     

     

     

     

     

    int get_methane()

     

     

    {

     

     

      methaneValue = analogRead(methanePin);

      Serial.println(methaneValue);

     

     

    }

     

     

     

     

     

     

    void get_temp()

     

     

    {

    int err;

      float temp, humi;

      err=dht11.read(humi, temp);

     

      delay(DHT11_RETRY_DELAY); //delay for reread

     

     

     

     

      Serial.println(temp);

                           

      Serial.println(humi);

    }

     

     

     

     

     

     

    void sendDataToProcessing(char symbol, int data ){

                                               // symbol prefix tells Processing what type of data is coming

        Serial.println(BPM);                // the data to send culminating in a carriage return

      }

     

     

    //////// here is my code i think problem is with the code please help. thank you.///////

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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