Home  >  Support  >  Support Forum  >  How to request a single pin status
Notice! We've recently migrated to using a new forum, we hope you enjoy it. If you are an existing member and this is your first time visiting our new forum, please reset your password to be able to sign in.

How to request a single pin status

0 votes
I have an xbee set up to remotely control an object outdoors. I have it connected to a battery and a solar panel. I want to monitor the charge of the battery and the simplest way I have come up with is to read the voltage of the battery.

I am using a voltage divider to reduce the voltage down to 0v - 3.3v from 0v to 20v. I plan on sending a command to turn pin 1 on to switch on a transistor which in turn will allow power to flow through the divider. I would then like to send a command to read the value of pin 3 which is hooked up to the divider. I will then turn pin 1 off.

I am doing this to save as much power as I can. I figure this is better then having the remote xbee use power to send multiple sensor packets when all I need is one at most in a day.

I cannot find a command to request single piece of sensor data.

Any ideas?

Thanks!
asked Jun 5, 2013 in RF Solutions and XBee by CodeMedic42 New to the Community (0 points)
Sounds like you want a remote AT command but they vary by radio... what model are you using?
Yeah I would have thought there would have been an AT command just to get the status of the pins rather than have to wait for the remote module to send out a packet on an interval. Plus on a large network that would get bulky having more than 10 modules constantly sending data.

I am using an "XBee 2mW PCB Antenna - Series 2 (ZigBee Mesh)" which I purchased from Spark Fun

I have been thinking about it and I might have a work around, but I have to test it to see if it will do what I want. But I consider it a hack.

I could set the module to only send pin data when one of them changes. First I would then turn pin 2 to monitor analog data. Then I turn pin 1 on to power the divider. Since the reading on pin 2 changed it should send me the pin data. Then after I get the pin data I set pin 2 to not monitor the data and turn pin 1 off.

I would also have to set the polling interval to 0, but that will be on setup.

So to prevent extra sensor data from being sent and to save battery power I would have to send 4 remote AT commands and the module would have to send back 4 remote at command responses and 1 sensor packet. Unless of course if I set my frame ID to 0. Then it should only send the one sensor packet. Which I guess is all I want to do is reduce the transmissions from the remote module. But I am a stickler and might want to make sure the divider is at least turned off so it's not dumping battery power. So that last packet I might have a frame ID for.

It should work but it seems overly complicated when there should be a simple AT command to say "Hey what are your current pin readings".
OK that plan failed. The AT command "IC" which I thought would send me a packet when a pins value changes only does that for pins set for digital input not for analog which is what I need to use. The only way I can see how to do what I want would be to send the commands to set up the pins and then wait for an IO sample packet. Then I turn everything off and then clear out the rest of the extra IO packets that were sent.

That sucks. There should be a command to just get one set of IO sensor data.

Any suggestions?

Please log in or register to answer this question.

1 Answer

0 votes
The AT command "IS" should take 1 sensor sample. I would send the ATIS command using a 'remote AT command' API frame as you need to be in API mode to recieve a sample anyway.
answered Aug 12, 2013 by jeremy Veteran of the Digi Community (426 points)
Your M2M Expert™for Businessfor Developers
Newsletter SignupYouTubeGoogle+FacebookCopyright © 1996-2013 Digi International Inc. All rights reserved. Legal
...