Hello Dennis,

Seth here. Thank you for all that info. I will look further into the 
specification sheet on this particular product. Now, I know this is not 
your issue but here goes...

I try to finish each book I get, i.e. no matter the changes in the kernel, 
image, and/or software I use. It is just a hobby for me as of now. I get 
the V and mV difference. I get basic math but I was unaware of the offset. 
The book, Programming the BeagleBone Black (Monk), stated something 
different. I was not expecting to see my readings as similar values. I 
understand a little more now.

The book had the readings at various temperatures, e.g. Fahrenheit was a 
completely different value compared to Celsius. This is the only reason I 
am in awe. I thought it was as easy as software, hardware, book, and 
understandings. I know now that I will need to delve deeper into learning 
before asking anything.

Seth

P.S. Sometimes I take time out to try out new books and software on the BBB 
and the other variations of that specific board. I am far from a "real 
McCoy" programmer that knows everything. I really do appreciate you helping 
me to better understand. 

On Friday, July 7, 2017 at 10:04:37 PM UTC-5, Dennis Lee Bieber wrote:
>
> On Fri, 7 Jul 2017 17:52:25 -0700 (PDT), Mala Dies 
> <[email protected] <javascript:>> declaimed the following: 
>
> >Hello Rob, 
> > 
> >Seth here, again. I tried out the *(reading.value / 4096.0) * 1800;* in 
> the 
> >software. It tells me that I have a temperature of -49.99 degrees in 
> >Celsius. I am trying to make believe my calculations from the software 
> are 
> >correct with the inside/climate controlled temp. in this house. 
> > 
>         So, what value are you getting for "reading.value" and does it 
> make 
> sense? 
>
>         Working backwards (with the above correction) 
>
>         function displayTemp(reading) 
>         {         
>                 var millivolts = reading.value * 1800; 
>                 var tempC = (millivolts - 500) / 10; 
>
> for a temperature of -49.99 
>
> -49.99 = (mv - 500) / 10 
> -499.9 = (mv - 500) 
> 0.1 = mv 
>
> 0.1 = (rv / 4096) * 1800 
> 5.555E-5 = rv / 4096 
> 0.227 = rv 
>
>         For all practical purposes, your -49.99 is what would be expected 
> if 
> you were reading ground (actual ground would result in -50degC). 
>
>         Comparing the same circuit and (similar) code between (Monk) 
> Programming the Beaglebone Black and (Chavan) Programming the 
> BeagleBone... 
>
> Neither use the 4096 divisor; apparently bonescript is supposed to already 
> scale the ADC value to 0.0-1.0; the 4096 would be needed if you were 
> getting the actual ADC counter (12-bit). They differ on the temperature 
> equation (beyond the difference between mV and V) 
>
>         v = rv * 1.8 
> vs 
>         mv = rv * 1800 
>
>         degC = (100 * v) - 50 
> vs 
>         degC = (mv - 500) / 10 
>
>         If "rv" were 0.5, then 
>
> v = 0.9                                        mv = 900 
> degC = 40.0                                degC = 40.0 
>
> ... so the two formulation will display the same value. Now, if rv were 
> 0.0 
> it gives 
>
> v = 0.0                                        mv = 0 
> degC = -50                                degC = -50 
>
>         Note that the sensor is rated for a minimum of -40degC, so there 
> must 
> be some residual voltage on the ADC at all times -- equivalent to 0.1v (or 
> 0.055 from the ADC) 
>
>
>         According to the spec sheet, the TMP36 has an offset of 0.5v, and 
> produces 0.75v at 25degC. 
>
>         degC = (v - 0.5) * 100 
>
> is the direct translation, and again, an ADC value of 0.0 gives a -50degC. 
> -- 
>         Wulfraed                 Dennis Lee Bieber         AF6VN 
>     [email protected] <javascript:>    HTTP://wlfraed.home.netcom.com/ 
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/255bc639-0f83-4903-a570-b2cf80a8f254%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to