|
|
View previous topic :: View next topic |
Author |
Message |
wahid
Joined: 02 May 2013 Posts: 5
|
ADC |
Posted: Thu May 02, 2013 11:00 am |
|
|
Hi to all, my project measure the temperature of fridges and give a audible alarm when the temperature passes a set point.
I should use 3 LM35 sensors. How to configure to use 3 ports, AN0, AN1 and AN2 ? And also how to set VREF+ VREF- voltage to convert negative value to negative temperature eg -55 ° C --->-550mV ? |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Thu May 02, 2013 12:31 pm |
|
|
You should always post which PIC you're going to use.
Also using LM35s requires a buffer opamp for signal conditioning,along with 'level shifting' to get -ve temps(well, that's one way....). You should use shielded cable to the LM35s, though runs under say 100 ft., you'll be ok.
Given the option, I'd use the DS18b20 series of temp sensors. Easier to use (just 2 wires) and though cost more that LM35s, by the time you add up opamps,resistors,caps,etc. (plus YOUR time !) they are cheaper/better in the long run.
Your project could be implemented with an 8 pin PIC....
This from a guy who's used LM35s for the past 20 years !
hth
jay |
|
|
wahid
Joined: 02 May 2013 Posts: 5
|
|
Posted: Thu May 02, 2013 5:12 pm |
|
|
PIC16F877, and my problem is configuring A/D converter with digital vref+ and vref- and port number to use. In this case is using 3 A/D pins with PIC compiler. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Fri May 03, 2013 12:58 am |
|
|
There is no 'digital Vref'.
Pin Vref inputs are analog inputs into which you can external circuitry to feed a voltage to set the working range of the ADC.
However there are limitations on the voltages you can use. Vref+ cannot be more than 0.3v above AVdd, or 2.5v below Avdd. Vref- cannot for more than 0.3v below AVss, or 2v above it, and there must be a minimum of 2v between Vref- and Vref+.
You have to build your hardware to input the voltage required...
However for a low accuracy application, and assuming you have a well regulated supply, most people would just use the supply rails as Vref+, and Vref-, and then scale the reading from the ADC to give the required value. However all of this involves +ve voltages into the PIC, which is all it can handle.
Temtronic has already pointed out the biggest problem. You are not going to read -ve temperatures with an LM35, without quite a bit of external circuitry. First you are going to need a -ve supply rail. Second a buffer amplifier and level shifter.
You can run the LM335 (note the extra digit - important....). to measure temperature with a PIC, without external circuitry (except a resistor). Using 5v as Vref+, and 0v as Vref-. Or the AD590, can make it really easy, allowing you to choose the resistor to give the count required. There are literally dozens of other temperature sensors, all of which are better/easier with the PIC, for the range of temperatures you require (the LM35, is relatively easy for _positive_ temperatures only). The DS18B20, is particularly easy to use (library here in the group), and gives easy connection, less noise, and covers the temperature range you want....
Best Wishes |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Fri May 03, 2013 7:43 am |
|
|
I wrote this "driver" some time ago:
http://www.ccsinfo.com/forum/viewtopic.php?t=48525
it might help you.
How ever I agree with others, there are simpler sensors out there.
They cost more but, unless you are mass producing, it really does not amout to more than 1 or 2 dollars more.
G. _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|