Find Jobs
Hire Freelancers

A simple reading from serial interface

$30-250 USD

Completed
Posted about 14 years ago

$30-250 USD

Paid on delivery
I currently have a network of wireless 6 Zigbee modules sending temperature readings data to a central Zigbee coordinator. At present these temperatures are being read through serial monitor and as they are coming through very quickly and in vast amount they are difficult to follow. What I would like is an interface that looks like this [login to view URL];current=[login to view URL] basically i need 6 boxes that read the address of the sending zigbee and display the temperature also I would like this temperature saving to an output file. The zigbees are connected to arduino boards and here is the code that operate them Arduino code for Coordinator operating in API mode #include <XBee.h> // include library available at: [login to view URL] #include <NewSoftSerial.h> // include library available at: [login to view URL] uint8_t ssRX = 9; uint8_t ssTX = 10; NewSoftSerial nss(ssRX, ssTX); XBee xbee = XBee(); XBeeResponse response = XBeeResponse(); // create reusable response objects for responses we expect to handle ZBRxResponse rx = ZBRxResponse(); ModemStatusResponse msr = ModemStatusResponse(); int statusLed = 13; int errorLed = 13; int dataLed = 13; int B=4090; float T1 = 298.15; float RT1 = 33000; float RT2 = 0; float T2 = 0; void printDouble( double val, unsigned int precision){ /* This function prints val with number of decimal places determine by precision*/ [login to view URL] (int(val)); //prints the int part [login to view URL]("."); // print the decimal point unsigned int frac; if(val >= 0) frac = (val - int(val)) * precision; else frac = (int(val)- val ) * precision; [login to view URL](frac,DEC) ; } void setup() { pinMode(statusLed, OUTPUT); pinMode(errorLed, OUTPUT); pinMode(dataLed, OUTPUT); // start serial [login to view URL](9600); // start soft serial [login to view URL](9600); } void loop() { // keep on reading until it receives a packet [login to view URL](); if ([login to view URL]().isAvailable()) { // have picked up something if ([login to view URL]().getApiId() == ZB_RX_RESPONSE) { // got a zigbee rx packet // fills the zigbee rx class [login to view URL]().getZBRxResponse(rx); [login to view URL]("Received Packet From: "); //prints source address of the transmitting device [login to view URL]([login to view URL]().getMsb(), HEX); [login to view URL]([login to view URL]().getLsb(), HEX); [login to view URL](""); } byte dataByte1 = ([login to view URL]().getFrameData()[11]); byte dataByte2 = ([login to view URL]().getFrameData()[12]); unsigned int value = dataByte2; value = value | (dataByte1 << 8);// uses the endian to rejoin the 2 bytes into 1 float int Temp = value;//make the value a integer //same temperature calculations as AT mode RT2 = (RT1*(1024 - Temp))/Temp; T2 = (B*T1)/(B-(T1*log(RT1/RT2))); T2 = T2 - 273.15; [login to view URL]("Temperature is: "); printDouble(T2,100); [login to view URL]("°C"); [login to view URL](""); [login to view URL]("-------------------------------------"); [login to view URL](""); // set dataLed PWM to value of the first byte in the data analogWrite(dataLed, [login to view URL](0)); } else if ([login to view URL]().getApiId() == MODEM_STATUS_RESPONSE) { [login to view URL]().getModemStatusResponse(msr); // the local XBee sends this response on certain events, like association/dissociation } } End Device operating in API mode #include <XBee.h> // create the XBee object XBee xbee = XBee(); uint8_t payload[] = { 0, 0 }; // insert SH + SL Address of receiving XBee XBeeAddress64 addr64 = XBeeAddress64(0x0013a200, 0x40320721); ZBTxRequest zbTx = ZBTxRequest(addr64, payload, sizeof(payload)); ZBTxStatusResponse txStatus = ZBTxStatusResponse(); int pin5 = 0; int statusLed = 13; int errorLed = 13; void flashLed(int pin, int times, int wait) { for (int i = 0; i < times; i++) { digitalWrite(pin, HIGH); delay(wait); digitalWrite(pin, LOW); if (i + 1 < times) { delay(wait); } } } void setup() { pinMode(statusLed, OUTPUT); pinMode(errorLed, OUTPUT); [login to view URL](9600); } void loop() { // break down 10-bit reading into two bytes and place in payload pin5 = analogRead(5); payload[0] = pin5 >> 8 & 0xff; payload[1] = pin5 & 0xff; [login to view URL](zbTx); // flash TX indicator flashLed(statusLed, 1, 100); // after sending a tx request, we expect a status response // wait up to half second for the status response if ([login to view URL](500)) { // got a response! // should be a znet tx status if ([login to view URL]().getApiId() == ZB_TX_STATUS_RESPONSE) { [login to view URL]().getZBTxStatusResponse(txStatus); // get the delivery status, the fifth byte if ([login to view URL]() == SUCCESS) { // success. time to celebrate flashLed(statusLed, 5, 50); } else { // the remote XBee did not receive our packet. is it powered on? flashLed(errorLed, 3, 500); } } } else { // local XBee did not provide a timely TX Status Response -- should not happen flashLed(errorLed, 2, 50); } delay(10000); }
Project ID: 674481

About the project

10 proposals
Remote project
Active 14 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hello, I'm interested in your project, Please check PMB for more details.
$160 USD in 8 days
4.6 (18 reviews)
4.3
4.3
10 freelancers are bidding on average $189 USD for this job
User Avatar
Please check PMB
$200 USD in 5 days
4.9 (42 reviews)
6.2
6.2
User Avatar
Please chk ur PMB
$300 USD in 7 days
5.0 (2 reviews)
4.1
4.1
User Avatar
Sir, I am working in VB for the past 4 years and is very comfortable in doing such kind of project. Looking forward to hear from you. Thanks
$150 USD in 5 days
5.0 (3 reviews)
2.7
2.7
User Avatar
Please see my PMB. Regards.
$300 USD in 7 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Dear Sir, Mentor ICT is an Australian company based in Sydney-Australia We are specialized in ICT (Information & Communication Technology) services including Custom software, Website development and ICT project Management We have outstanding experience dealing with Serial/Parallel/LAN and Modem communications please read your PMB for more details Regards George Kerollos PMP Projects Manager Mentor ICT
$250 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
Please check your PMB. Thanks
$130 USD in 15 days
0.0 (0 reviews)
0.0
0.0
User Avatar
i am experienced programmer in a cad/cam company. I can do every project if the documentation is enough. I can do this project as a hobby.
$30 USD in 4 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Please, check your PM.
$170 USD in 3 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED KINGDOM
oxford, United Kingdom
5.0
2
Payment method verified
Member since Apr 30, 2010

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.