RE: Same Ole Game, Different Take/Seth

Hello,

I have another set of software that I picked up along the way, i.e. probably from that book, “Evil Genuis,” series from Mr. Rush. Anyway, here goes it. Oh but first, I know people are getting tired of seeing the same ole, same ole. This does not discourage me from posting.

var b = require(‘bonescript’);

var inputPin = “P9_40”;

getBeagleTemp();

function getBeagleTemp() {
var value = b.analogRead(“P9_40”);

var millivolts = value * 1800;
var x = (millivolts - 500)/10;
var z = (x * 9/5) - 32;
setTimeout(getBeagleTemp, 10000);

console.log(“x=” + x + “\tz=” + z);
}

Now,

I tried this software some and changed it a bit to suit my needs. As you all know, I am not 100% legit in the programming field, i.e. even though I try.

I am getting temperatures in the Fahrenheit of 201 and in Celsius of 129. This is not my temp. in the house.

Seth

P.S. If anyone has any other recommendations, please let me know. Please let me know what you think.

On Mon, 10 Jul 2017 16:10:50 -0700 (PDT), Mala Dies
<functt@gmail.com> declaimed the following:

I have another set of software that I picked up along the way, i.e.
probably from that book, "Evil Genuis," series from Mr. Rush. Anyway, here
goes it. Oh but first, I know people are getting tired of seeing the same
ole, same ole. This does not discourage me from posting.

  What is discouraging is the lack of any attempts to analyze/debug the
problem... Posting code samples from books, stating an invalid result, and
that is where the effort seems to end.

*var b = require('bonescript');*

*var inputPin = "P9_40";*

*getBeagleTemp();*

*function getBeagleTemp() {*
* var value = b.analogRead("P9_40");*

* var millivolts = value * 1800;*
* var x = (millivolts - 500)/10;*
* var z = (x * 9/5) - 32;*
* setTimeout(getBeagleTemp, 10000);*

* console.log("x=" + x + "\tz=" + z);*
*}*

I am getting temperatures in the Fahrenheit of 201 and in Celsius of 129.
This is not my temp. in the house.

  Again, work the results backwards to figure out the numbers (again,
ignore Fahrenheit).

x = 129

129 = (mV - 500) / 10
1290 = mV - 500
1790 = mV

{Not important, since it just converts the voltage back to the analogRead
0..1 range
mV = val * 1800
1790 = val * 1800
1790/1800 = val
0.9944 = val
}

  Before, the reported temperature was near -50, now it is near +130.

  -50 is GND (0.0V), +130 is maximum (safe) for BB (1.8V). The minor
differences could be capacitive coupling and cross-talk on the wiring.

  My only logical conclusion is that you have changed the wiring some,
and are not properly connected to the TMP36, instead somehow being
connected to either the GND or the ADC-Voltage source.

Hello Dennis,

Yep…I changed the wiring and changed a uEnv.txt file in the /boot directory. I have the P9_40/AIN1 pin connect now instead of the P9_39/AIN0. When I stated that I changed a file, I changed the file to enable BB-ADC1,BB-ADC2 instead of having it enabled at BB-AIN0, BB-AIN1.

The software is completely different too. I used this set of software to check the TMP36 just like the older software I used in a post not too long ago.

Seth

P.S. I will work backwards like you are discussing and I will keep trying. I know I should have some pins enabled with my Cape Universal disabled. I am probably way off base but this is what I have done so far. Sorry for not giving every detail. I will wait to hear from you again while attempt to work some magic.

Hello Again Mr. Dennis,

Seth here. I have done some small time work on what wiring I have concocted. Here goes:

TMP36:

Pin 1 is + Vs and it is connected to P9_34 or GNDA_ADC.

Pin 2 is Vout and it is connected to P9_40 or AIN1.

and…

Pin 3 is GND and it is connected to P9_03 or VDD_3V3.

Now…I have been wrong before and I am just listening to the info. from the book. I will do some extra research on this project from the schematic: http://www.analog.com/media/en/technical-documentation/data-sheets/TMP35_36_37.pdf. I got this link from Digi Key. They still sell these TMP36 sensors.

Seth

P.S. If you get bored, let me know what you think. Oh and I just changed the uEnv.txt file in the /boot directory to enable=BB-AIN1,BB-GNDA_ADC,VDD_3V3 and then I rebooted the machine. I am getting an exact read of the 130 C degrees and 201 F degrees. I think this will better suit your needs if you are choosing to still help me out. Thank you again, sir.

Why are you connecting +Vs to GND, and GND to Vdd?

Regards,

Hello,

The instructions on the book said to connect the pins of the TMP36 via jumper wires to the BBB/BBGW in that manner. I am using a BBGW instead of the BBB or BBBW for this project.

Seth

P.S. Should I have the jumper wires connecting to different pins on the BBGW?

Hello Again,

I read the schematic on the book. The book states via photo to wire things up this way.

Seth

Hello,

So,

TMP36:

  • Vs is now at VDD_3V3

GND is now at DGND

I did configure the old software to work but this is easier.

Seth

Hello Sir,

Supposedly, the GNDA_ADC pin on the BBGW makes less noise. This noise would create a higher fluctuation of distance from the actual temp. in the environment.

Seth

P.S. Now, the GND to VDD_3V3 had some idea behind it but was not listed in the book. I had to put value at 63 degrees Celsius but it was still off by about two degrees with the old software and old hook-up. Now, the temp. is still off by about 10 degrees in Fahrenheit with the correct hook-up and current software.

On Tue, 11 Jul 2017 16:58:24 -0700 (PDT), Mala Dies
<functt@gmail.com> declaimed the following:

The software is completely different too. I used this set of software to
check the TMP36 just like the older software I used in a post not too long
ago.

  This software, for the most part, only differs in the variable names
being used. All of the posted sample code consist of an analog read, a
conversion from 0..1 to 0..1.8 (or 0..1800 if mV), and a conversion from
voltage to temperature.

  Simple algebra will show you that all those equations are equivalent.

  The only unknown is the wiring of the TMP36 to the BBB pins. So far,
the only firm data points appear to be that you had (in the first cases)
GND shorted to the ADC input, and in the most recent case, 1.8V shorted to
the ADC input.

On Tue, 11 Jul 2017 17:23:17 -0700 (PDT), Mala Dies
<functt@gmail.com> declaimed the following:

Hello Again Mr. Dennis,

Seth here. I have done some small time work on what wiring I have
concocted. Here goes:

TMP36:

Pin 1 is + Vs and it is connected to P9_34 or GNDA_ADC.

Pin 2 is Vout and it is connected to P9_40 or AIN1.

and...

Pin 3 is GND and it is connected to P9_03 or VDD_3V3.

Now...I have been wrong before and I am just listening to the info. from
the book. I will do some extra research on this project from the

  Which book?

  [Monk]
    With the TMP36 oriented |) the top pin is connected to 3.3V, the
middle pin is connected to the ADC input, and the bottom pin is connected
to ADC GND.

  [Chavan]
    With the TMP36 oriented (|, the top pin is connected to ADC GND,
the middle pin is connected to the ADC input, and the bottom pin is
connected to 3.3V

  Doesn't matter what beagle you use... When looking at the flat side of
the TMP36, the middle pin goes to the ADC input, the left pin goes to the
+V and the right pin goes to the GND. While different beagles may put those
items on different sockets, the general description is the same -- GND is
ground [0V], +V is positive voltage (the TMP36 can be powered from around 3
to 6 volts, as I recall [didn't save the spec sheet]), and the desired
signal is the middle.

Hello,

I am using a couple different books. I am using the Programming the BeagleBone Black from Monk and another book called Evil Genius by Rush. It is a similar book on the BBB. I had some odd connections at first. You are right. I guess I am learning what I am doing.

Seth

P.S. I lost track of all the info. I have accumulated over the last year. I will try to keep better records. If you have any questions, let me know. I will look up some items on what I am discussing. I got the readings from the BBGW to list Celsius and Fahrenheit near what the house is listing on the dial. I am still about 10 degrees off, though.

On Tue, 11 Jul 2017 20:46:36 -0700 (PDT), Mala Dies
<functt@gmail.com> declaimed the following:

P.S. I lost track of all the info. I have accumulated over the last year. I
will try to keep better records. If you have any questions, let me know. I
will look up some items on what I am discussing. I got the readings from
the BBGW to list Celsius and Fahrenheit near what the house is listing on
the dial. I am still about 10 degrees off, though.

  Using a Ryobi IR001 reader, the thermostat reads 75degF, and I can read
near 80degF just a foot away from it. (it's worse in the winter -- the wall
a foot away will read low 60s when the thermostat reads 70; I think the hot
water pipe runs up just behind that part of the wall).

  Look at the spec sheet... As I recall, the TMP36 is specified for +/-
1degC at room temperature (and +/-2degC at the extremes). If looking at two
digital sensors, that means one could read +1 and the other -1 and still be
in spec. 2degC is 3.6degF variation alone.