[Tinyos-help] About getting the battery of micaz
Michael Schippling
schip at santafe.edu
Wed Dec 10 10:58:57 PST 2008
The User Manual "Doc. # 7430-0021-07 Rev. B" has a formula for the
micas on page 19 (printed) or 25 (pdf), basically:
vBatt = 1.223 × 1024 / ADC_Count
If your 140 ADC_Count is in hex you are in the ballpark, or perhaps
you haven't converted two bytes to get the full 10 bit result.
MS
SHEN Zhong wrote:
> Hi Michael,
>
> i have two motes, one got a raw battery value 140, another is 148. But
> these two values didn't look like a real voltage value. i wanna know how
> to convert these to real value like 3v or 3000. Perhaps I got the wrong
> value from my program.
>
> Thank you
>
> Leo
>
>> I'm going to assume that the values you get are between 140 and 148
>> rather than being 148 thousand and change...
>>
>> In which case, look in the Getting Started Manuals or search this
>> list for a conversion formula. There's probably even a FAQ on
>> docs.tinyos.net
>>
>> MS
>>
>>
>> SHEN Zhong wrote:
>>> Hi, everyone
>>>
>>> I want to get the battery of micaz mote. I use the component Voltage.
>>> The
>>> following code is about getting battery.
>>>
>>> In configuration, i used following code:
>>>
>>> MYAPP.VoltageControl -> Voltage;
>>> MAAPP.ADCBATT -> Voltage;
>>>
>>> In module,
>>>
>>> interface StdControl as VoltageControl;
>>> interface ADC as ADCBATT;
>>>
>>> async event result_t ADCBATT.dataReady(uint16_t data)
>>> {
>>> atomic{
>>> battery = data;
>>> }
>>> return SUCCESS;
>>> }
>>>
>>> After i got the battery value, the program send packet to base. I found
>>> the raw data about battery is nearly 140,148. It looks strange.
>>>
>>> How could i convert the raw data to real battery voltage? micaz
>>>
>>> Thank you very much.
>>>
>>> Regards
>>>
>>> Leo
>>>
>>> _______________________________________________
>>> Tinyos-help mailing list
>>> Tinyos-help at millennium.berkeley.edu
>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>> --
>> Platform: WinXP/Cygwin
>> TinyOS version: 1.x, Boomerang
>> Programmer: MIB510
>> Device(s): Mica2, MicaZ, Tmote
>> Sensor board: homebrew
>>
>>
>
>
>
--
Platform: WinXP/Cygwin
TinyOS version: 1.x, Boomerang
Programmer: MIB510
Device(s): Mica2, MicaZ, Tmote
Sensor board: homebrew
More information about the Tinyos-help
mailing list