[Tinyos-help] Battery Voltage measurement

Razvan Musaloiu-E. razvanm at cs.jhu.edu
Mon Oct 20 14:10:00 PDT 2008


Hi!

On Mon, 20 Oct 2008, fhg07 at c3sl.ufpr.br wrote:

> But from which channel does it read?

The VoltageC component is turning the reference voltage off and 
then samples the internal channel corresponding to the 1.23V. The code that 
picks this values is this one:
 	http://tinyos.cvs.sourceforge.net/viewvc/tinyos/tinyos-2.x/tos/platforms/mica/VoltageP.nc?view=markup

More details about the channels you can pick are in table 98 on page 243 
in here:
 	http://www.atmel.com/dyn/resources/prod_documents/doc2467.pdf  (6MB)
The settings for the reference voltage are in table 97 on page 242.

I hope this helps! :D
Razvan ME

> I mean, there are seven ! And I must get a reading from both channel seven
> and channel one, in different events. Do you know how do I do that?
>
>
>
> Thanks,
> Fernando.
>
>> Hi!
>>
>> On Mon, 20 Oct 2008, fhg07 at c3sl.ufpr.br wrote:
>>
>>> According to "MPR-MIB Users Manual":
>>> "To compute the battery voltage:
>>>   1. Set the BAT_MON processor pin (PA5/AD5) to HI.
>>>   2. Program the application code to measure ADC Channel 7.
>>>   3. Compute battery voltage, Vbatt, from Channel 7?s data by:
>>>      Vbatt = Vref × ADC _ FS ADC _ Count
>>>      where:
>>>      Vbatt = Battery voltage
>>>      ADC_FS = 1024
>>>      Vref = External voltage reference = 1.223 V
>>>      ADC_Count = Data from the ADC measurement of Channel 7"
>>>
>>> (This is for MICA2)
>>>
>>>
>>> But how do I get this ADC_Count? Would that be what VoltageRead of
>>> VoltageC returns? I am not sure about that, but the veracity of this
>>> information is really  important. If anyone can affirm this or correct
>>> me,
>>> please answer.
>>
>> In tinyos-2.x the ADC_Count is what the Read.readDone from VoltageC
>> returns. I attached a program that I use to verify this. When the MicaZ is
>> plugged in the USB the value returned was 405 which corresponds to about
>> 3V which seems reasonable.
>>
>> --
>> Razvan ME
>
>


More information about the Tinyos-help mailing list