vref value


Can someone please help me: which command is for acquiring the value of reference voltage or supply voltage?

For example, if currently supply voltage is 3.2 V, what command will allow me to acquire this value?

I need this command to predict the time to change battery.

Many thanks in advance.

Best regards,

There isn’t a command to do this directly. You’d need some external circuitry.

If you have Vref connected directly to VCC (the common case) you could for example connect a resistor and zener in series: resistor to VCC, resistor/zener to an anlog input, zener to ground. The zener voltage would remain constant, so you’d be measuring the ratio between that and the supply voltage as the supply voltage decreases.

Doing that just as described would obviously create an extra battery drain. So a transistor in series with the zener, driven from an output line, would enable you to turn the arrangement on for the measurement and then off again.

To make this work, you’d obviously need to arrange to send the necessary commands to the XBee to control the output line and take the reading.

That’s my best shot. Maybe someone can come up with something a bit more elegant?

you can send AT command through the X-CTU window or you can invoke AT-command through the python program.

to get the voltage level ‘%V’ is the particular AT- command
i hope it will solve ur problem

Assuming the original poster is using Series 1 XBees (this being the 802.15.4 forum) I’m afraid that won’t work because the %V command exists only on series 2 XBees. The series 2 XBees have an internal voltage reference, whereas the series 1 models don’t. That’s why there has to be some external circuitry if battery voltage is to be measured.

I did try this out: if I send the %V command as AT%V the response is ‘ERROR’. If I send the command as an API packet, the response has ‘Invalid command’ status.