Go Down

Topic: Connecting LM35 sensor to Xbee (Read 382 times) previous topic - next topic

along123

Hi everyone, hope you all have a great day.

Currently i am working on my project which is involving wireless sensor network. So i am using LM35 sensor, Xbee s2c, funduino v03 shield (Xbee shield) and arduino UNO. Before i proceed to integration part, I have tried AT command and API mode and all working just fine. Now is where the problem happen when i tried to connect my sensor to xbee shield.



1)Based on on this website https://www.tunnelsup.com/xbee-guide/, it used xbee explorer and connect to arduino for router part. The sensor part is connected to DI03 pin which i couldnt find on my xbee shield. Is it the circle pin between my xbee module and arduino pin same as my xbee pin?



2) I tried to assume the circle pin same as xbee pin and when i try to run on XCTU this is the result i obtained.



Router Set Up





((with sensor))


Coordinator

IO Data Sample RX Indicator (API 1)

7E 00 12 92 00 13 A2 00 41 76 DB 0F 23 0B 01 01 00 00 08 01 05 D9

Start delimiter: 7E
Length: 00 12 (18)
Frame type: 92 (IO Data Sample RX Indicator)
64-bit source address: 00 13 A2 00 41 76 DB 0F
16-bit source address: 23 0B
Receive options: 01
Number of samples: 01
Digital channel mask: 00 00
Analog channel mask: 08
DIO3/AD3 analog value: 01 05 (261)
Checksum: D9


((Without Sensor))



IO Data Sample RX Indicator (API 1)

7E 00 12 92 00 13 A2 00 41 76 DB 0F 23 0B 01 01 00 00 08 02 11 CC

Start delimiter: 7E
Length: 00 12 (18)
Frame type: 92 (IO Data Sample RX Indicator)
64-bit source address: 00 13 A2 00 41 76 DB 0F
16-bit source address: 23 0B
Receive options: 01
Number of samples: 01
Digital channel mask: 00 00
Analog channel mask: 08
DIO3/AD3 analog value: 02 11 (529)
Checksum: CC

3) Coding for my coordinator


Code: [Select]
#include <LM35.h>
float val;
void setup()
{
Serial.begin(9600);
};

void loop()
{
  if (Serial.available() >= 21) {
    if (Serial.read() == 0x7E)  {
      for (int i = 1; i < 19; i++) {
        byte discardByte = Serial.read ();
      }
     
       int analogMSB = Serial.read();
      int analogLSB = Serial.read();
      int analogReading = analogLSB + (analogMSB * 256);
       val = ( analogReading/1024.0)*5000;
       val = val/10;

Serial.print(val);
Serial.print("*C");

    }
  }

}


I obtained unknown symbol for my coordinator result. 

How can i get the readable result? Do i have to change my xbee shield to xbee explorer ?
I am really new to xbee and I am so sorry if my question sounds silly.  :o


PaulS

Why does the coordinator code include LM35.h? The router/end device code, which you completely failed to post, is the only code that needs to.
The art of getting good answers lies in asking good questions.

Go Up