FYI -
I haven't looked into implementing this, but the CC2420 radio on the
MicaZ and Telos does offer battery monitor.
From
the CC2420 datasheet, page 53: "The on-chip
battery monitor enables monitoring the unregulated voltage on the VREG_IN
pin. It gives status information on the voltage being above or below a
programmable threshold."
Basically you enabled the battery monitor through the BATTMON control
register, set a 5-bit target voltage in the BATTMON.BATTMON_VOLTAGE register,
and then read the BATTMON_OK status bit to tell if the input voltage is
above or below your defined threshold. Seems pretty simple to
do. And the CC2420 battery monitor can be turned off when you don't need a
reading.
It
would be nice to have a component that would tell your application when the
battery voltage is running low... either by an event driven by a periodic
timer that samples the CC2420, or through your application explicitly polling
the battery monitor component.
-David
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of R Gartz
Sent: Friday, May 19, 2006 4:04 PM
To: Michael Schippling
Cc: [email protected]
Subject: Re: [Tinyos-help] battery voltage micaz
Yes I know they are very suspicious ;)
But I don't have any bit shift anywhere in my program(s)... Those are the actual values I'm getting
Michael, in your robocode you're getting the right values for mica2? But you're not using the VoltageM component.
So, I decided to try the same thing you did: not using VoltageM.
Although I know the Xbow MPR manual describes something about the mapping from ADC7 to the ADC channel 30, and by using VoltageM in micaz.
"RobotM.BVoltage -> ADCC.ADC[ROBOADC_BVOLTAGE];" (I tried both ROBOADC_BVOLTAGE = 7 and ROBOADC_BVOLTAGE=30) but the dataReady-event never fires (although like I said before, I was expecting something like that when not using VoltageM)
So, there remain 2 options:
-the VoltageM component contains an error (e.g. wrong mapping / reading of the ADC channel)
-Measuring Voltage in micaz is not possible? (although the xbow MPR manual claims it should be)
greetings and thanks,
R.
On 5/19/06, Michael Schippling <[EMAIL PROTECTED]> wrote:I don't remember the solution to the problem in the previous email you
reference, but I think they were reading the wrong ADC or getting
wrong values somehow...perhaps Gina Upperman is still online here and
can answer.
But your values look suspiciously like they have been divided by two.
Do you have an accidental bit shift someplace?
MS
R Gartz wrote:
> Hello,
>
> I'm trying to measure the voltage of the batteries of my micaz nodes.
>
> When using the VoltageM component, I'm always getting values like Vbat=
> 3901, 4638, 4892, 5261, 5398, 5351, 5445, 5398 .... -> So, 5,3 Volt for
> two AA batteries?? Seems very strange...
> When printing the raw 10-bit ADC value (so without the conversion (in
> the VoltageM component) Vbat = Vref * 1024/ADC_Count) the ADC_Count =
> 315, 258, 243, 230, 227, 229, 225,...
> So in order to get more realistic values like Vbat = 2900mV: the
> ADC_Count should be around 430...
> Everything is mapped right, I'm measuring the ADC-channel 30 for micaz...
>
> Anyone knows what is wrong? (the same problem has already been posted a
> month ago,
> http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2006-April/016227.html)
>
>
> Greetings,
>
> Robin
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
