Analog Temperature Sensor - USB vs 9V power

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Re: Analog Temperature Sensor - USB vs 9V power

Postby bunger » Mon Mar 05, 2012 11:49 am

msymms wrote:Just a thought, but wouldn't be easy just to pull both off of the 7805?


On accounta I am new to most of this stuff, I have no idea what that means... ;-)
bunger
 
Posts: 86
Joined: Sun Apr 10, 2011 1:33 pm

Re: Analog Temperature Sensor - USB vs 9V power

Postby adafruit_support_bill » Mon Mar 05, 2012 12:32 pm

On accounta I am new to most of this stuff, I have no idea what that means.

What msymms was suggesting is that you do what you were doing originally: Use the on-board Arduino regulator. As we know, that is not stable enough when you are driving other loads such as LEDs.

A separate regulator (such as another 7805) for the voltage reference would be a reasonable hardware solution. But if you are more comfortable with the software end of it, Philba's suggestion looks like a good way to go.
User avatar
adafruit_support_bill
 
Posts: 15932
Joined: Sat Feb 07, 2009 9:11 am

Re: Analog Temperature Sensor - USB vs 9V power

Postby philba » Mon Mar 05, 2012 2:11 pm

msymms wrote:Just a thought, but wouldn't be easy just to pull both off of the 7805?


the original problem is that he gets different results when running from the regulator (iirc, it's not a 7805) or from USB. This is because USB doesn't feed the regulator so there are 2 different actual values for "5V". Since both probably have a tolerance of 5%, you could see as much as a 10% difference between the two (though it's likely to be smaller in reality). In addition, we take for granted that the regulator is going to maintain Vcc at 5V regardless of the load. The truth is that the regulated voltage varies depending on load, temperature and the phase of the moon. Not a huge amount but enough to worry about if you care about accuracy. So, something that is less variable is a good idea. The 3.3 Vreg is convenient and lightly loaded so it will be more stable. Even better would be a dedicated VRef but that's not necessary to get decent results.
philba
 
Posts: 387
Joined: Mon Dec 19, 2011 5:59 pm

Re: Analog Temperature Sensor - USB vs 9V power

Postby bowlofred » Tue Mar 06, 2012 3:42 pm

How stable is the INTERNAL (~1v) reference? Since it's a lower value, I presume it allows for greater precision, but I don't know if the reference itself is as stable as the 3.3.
bowlofred
 
Posts: 8
Joined: Thu Jan 19, 2012 7:01 pm


Re: Analog Temperature Sensor - USB vs 9V power

Postby bunger » Tue Mar 06, 2012 8:50 pm

I have been playing around with the setup in hopes of potentially modifying the TouchScreen.cpp library to adjusts the offsets that I am seeing based on the TFT using 3.3 instead of 5.

Unfortunately, it appears that the TFT is exhibiting different behavioral traits when using the 3.3v reference. Specifically, there is a region across the top of the screen that comprises the width of the screen and is roughly 1/4" high that will not respond to input. I set some serial print statements to allow me to see the x and y returns and when applying touch pressure in this region, nothing returns. If I run a touch from the bottom of the screen up, I get returns until I hit this "zone" and then serial print does not respond. It is almost as if this portion of the TFT is dead.

Has anyone seen anything like this?
bunger
 
Posts: 86
Joined: Sun Apr 10, 2011 1:33 pm

Re: Analog Temperature Sensor - USB vs 9V power

Postby msymms » Wed Mar 07, 2012 12:20 am

Ah, I see. Sorry, it seemed like a sensible solution, but I am no EE. I am interested in the final solution though, because a project I have in mind might involve this very scenario. I would like to see a hardware solution present itself. A dedicated 7805 directly off Vin?
msymms
 
Posts: 24
Joined: Fri Aug 20, 2010 9:50 am

Re: Analog Temperature Sensor - USB vs 9V power

Postby adafruit_support_bill » Wed Mar 07, 2012 6:18 am

A 7805 would work, but it is overkill. The whole point of having a dedicated reference voltage is that we don't want to be pulling current from it. Something like a zener-diode based voltage reference would be simpler and cheaper. http://www.allaboutcircuits.com/vol_3/chpt_3/11.html
User avatar
adafruit_support_bill
 
Posts: 15932
Joined: Sat Feb 07, 2009 9:11 am

Re: Analog Temperature Sensor - USB vs 9V power

Postby philba » Wed Mar 07, 2012 11:55 am

Just be aware that a plain zener is stable but not terribly accurate. Worse than 5%, I believe. Here's an example of a reasonable inexpensive (<$1) reference. It comes in 4 different accuracy grades (3% down to 1%). This is prototype friendly as it come in a to-92 package. http://www.onsemi.com/pub_link/Collateral/LM285-D.PDF There are, literally, 1000s of VRefs out there.
philba
 
Posts: 387
Joined: Mon Dec 19, 2011 5:59 pm

Re: Analog Temperature Sensor - USB vs 9V power

Postby bunger » Sat Mar 10, 2012 9:48 am

I appreciate all of the suggestions, but they are way beyond my abilities at this point.

I think I going to do 1 of 2 things:

- switch back to 5V and accept the temp variances

- ignore the "dead area" on the TFT and code around it

I am leaning toward the 2nd option as the temp variances are pretty wild on 5V....
bunger
 
Posts: 86
Joined: Sun Apr 10, 2011 1:33 pm

Re: Analog Temperature Sensor - USB vs 9V power

Postby bunger » Mon Mar 12, 2012 8:39 pm

Would the digital temp sensors provide less fluctuation? I have my project fully prototyped and even at 3.3v, the temp swings +/- 2 degrees when I am also lighting up a 12 led rgb strand...
bunger
 
Posts: 86
Joined: Sun Apr 10, 2011 1:33 pm

Re: Analog Temperature Sensor - USB vs 9V power

Postby philba » Mon Mar 12, 2012 9:36 pm

Are you powering the LEDs off the 5V rail of the arduino? If so, that's probably the cause of your noise. You could go for a separate PS for the lights.

You could also try an IIR filter. Something like this:
Code: Select all
tnew = getTemp();  // or how ever your read the temp
temp = tnew * f + temp * (1-f);
f is in the range of 0..1. The smaller the value of f, the slower the value of temp changes. Since temperature doesn't change very fast anyway, it's ok to make f really small - like .05 or even less. This will take out a lot of the noise you are seeing.
philba
 
Posts: 387
Joined: Mon Dec 19, 2011 5:59 pm

Re: Analog Temperature Sensor - USB vs 9V power

Postby bunger » Tue Mar 13, 2012 4:09 pm

Interesting thoughts and the IIR filter would be the easiest, unfortunately, the reason for the temp sensor is to detect large temperature swings and that filter would normalize the swings I am looking for.

Any suggestions on a very small, portable power option for the temp sensor?

Thanks again for all of the help!!
Bill
bunger
 
Posts: 86
Joined: Sun Apr 10, 2011 1:33 pm

Re: Analog Temperature Sensor - USB vs 9V power

Postby philba » Tue Mar 13, 2012 6:10 pm

How short lived are these swings? You can tune the IIR filter and maybe there is a happy medium. I'd at least try it - if you don't like the results, toss it.

You could try a simple low pass filter that drops out all the higher order frequencies.http://en.wikipedia.org/wiki/Low-pass_filter#Electronic_low-pass_filters just a cap and a resistor. You could also add a largish bypass cap close to the sensor.

For portable power, a battery is decent bet. Or you could get a small buck converter and set it to the proper voltage.
philba
 
Posts: 387
Joined: Mon Dec 19, 2011 5:59 pm

Previous

Return to Arduino

Who is online

Users browsing this forum: No registered users and 16 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [102]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[108]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[69]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]