Pages: [1]   Go Down
Author Topic: pro mini 5v + tmp36  (Read 672 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 99
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a few tmp36 temperature sensors that I like, work well and cheap. However they were not usably reliable until I connected up the AREF pin and compensated sensor reads for voltage variation.

Now I want to use these with a pro mini 5v, which as far as i can tell, does not even have an AREF pin. Am I missing something, or is there another way to make these sensors usable on my smaller arduinos? I would rather not have to move all of these units to unos, but I suppose that would be better than getting crummy readings.
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4092
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The Pro Mini has an AREF pin, since it uses the same MCU as the Uno, just in a different package. It has a 100nF bypass capacitor connected to ground. But it's not brought out to a header pin.

What is the source of the voltage variation? Is the supply not regulated?
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Offline Offline
Jr. Member
**
Karma: 0
Posts: 99
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Honestly I am not sure where the variation comes from! I was complaining about the accuracy of the tmp36 before and someone kindly pointed me towards AREF, then the results were good enough.

It was a fairly simple little circuit, nothing more than an uno, photores, tmp36, and resistors to hold it all together.
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4092
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not understanding what you did with AREF to improve the results.
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Offline Offline
Jr. Member
**
Karma: 0
Posts: 99
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am not sure! I got some advice here -
http://forum.arduino.cc/index.php?topic=219977.0

Long story short my readings seemed bogus, then someone had me add a connection from voltageIN to AREF, add some code to init from AREF, and all was well. One would assume my readings were no good because my sensor input voltage was low, and the additions resulted in calibration, but that is still a little bit of a guess
« Last Edit: March 13, 2014, 03:39:33 pm by blah44 » Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4092
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds like the change was to make the analog reference 3.3V instead of 5V. While this will increase resolution a bit, it should have no effect on accuracy. I'd have to know more about the circuit, specifically how the Arduino (Uno?) was powered, to say much else.

PS: Changing the reference from 5V to 3.3V changes the resolution from 0.488°C to 0.322°C. That is, a difference of one in the value read from the ADC would correspond to those temperature increments.
« Last Edit: March 13, 2014, 06:56:21 pm by Jack Christensen » Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Offline Offline
Jr. Member
**
Karma: 0
Posts: 99
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, I was using 5.0v in my calculations from the reader, and I was under the impression that I was getting more like 4.6v from the arduino 5v pin. It seemed like using that external AREF trick was a good way to compensate for that. I suppose I should have factored out the switch to 3.3v to see if I got better results with only one change or the other.
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4092
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, I was using 5.0v in my calculations from the reader, and I was under the impression that I was getting more like 4.6v from the arduino 5v pin.

If the 5V pin was reading 4.6V that could account for the inaccuracy. Why were you under that impression? Did you actually measure the voltage at the 5V pin? (You should.) How was the Arduino powered, exactly?

Quote
It seemed like using that external AREF trick was a good way to compensate for that. I suppose I should have factored out the switch to 3.3v to see if I got better results with only one change or the other.

If indeed there was less than 5V present on the 5V pin, then using the 3.3V provided by the onboard regulator was responsible for the increased accuracy. The change to the code is required to reflect the fact that AREF is connected to 3.3V, so just doing one or the other would have made things worse, not better.

But, if there is a power problem (5V pin not reading 5V) I'd give that priority and get that fixed. Connecting AREF to 3.3V was in this case fixing the symptom, not the underlying problem.

And the Pro Mini has no 3.3V regulator on board so that fix is not available as an option.
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Pages: [1]   Go Up
Jump to: