Re: [Tinyos-help] Adding precision to sensor data obtained

2011-06-14 Thread Mayank Gupta
Thanks again. I am sensing all the three sensors available i.e. temperature , light and humidity. I use the following formulas , temperature = (float)(-39.6 + 0.01*(float)val); humidity = (float)(-2.0468 + 0.0367*(float)val + 0.0159*(float)(val*val)); but when I use MsgReader tool to read

[Tinyos-help] Adding precision to sensor data obtained

2011-06-10 Thread Mayank Gupta
Hi all, I am sending sensor readings from telosb mote to the pc and storing the data in mysql database. The problem I am facing is that I want data to be precise upto at least 2 decimal places but data in my database always comes out to be as integer. I have modified the mig generated file to

Re: [Tinyos-help] Adding precision to sensor data obtained

2011-06-10 Thread Michael Schippling
Pretty much all sensors readings on TOS devices are integer values directly from the ADC -- some few, like Voltage, may be may be mangled for range and level but are probably also ints. IIRC the telosb has a 12 bit converter so you should have 0-4095 as your values, which is a resolution of about

Re: [Tinyos-help] Adding precision to sensor data obtained

2011-06-10 Thread Mayank Gupta
Thanks for the help Michael. But again I am not really sure how to do that. Can you refer me to some tutorial or reading where I can see how to actually code it.. Sorry but not really getting it. Regards, Mayank On Fri, Jun 10, 2011 at 5:13 PM, Michael Schippling sc...@santafe.edu wrote: Pretty

Re: [Tinyos-help] Adding precision to sensor data obtained

2011-06-10 Thread Michael Schippling
Assuming that the readings you are getting are, as I suggested, the raw ADC values from 0-4095 you can convert them to a voltage by multiplying by the ADC's reference voltage -- nominally 3.3v. So a 0 value is equal to 0 volts and a full scale 4095 value is equal to 3.3v. The reading you get is