Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

interfacing pickit 2 with LM 35 sensors

Status
Not open for further replies.

masoodpatel

Junior Member level 3
Joined
Aug 4, 2010
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
uk
Activity points
1,489
hello

i want to develop an electronic borad by using microchip pickit 2 and its supporting borad DV164120 and the temperature sensor LM 35 so can u plzz help me in its interfacing , connecting and it's programing

i ll be thankful to you all
 

Hi,

Well its quiet easy with that set up, the board has a trimmer fitted which is read in by Lesson 4 - ADC.
You simply need to fit and read the LM35 in a similar way.

You will need either 4 more leds to read off the temperature in binary / hex or fit a lcd if you want a proper display.

Are you using the Microchip Assembler lessons ?
 
yes i have 7 lessons of LOW pin Count Demo Board u mean to say the 4th lesson frm this are the different one yes iam using microchip assembler lessons so please can u help me the circuit design and as well as programing using MPLAB IDE for this sensor measurement
 

Hi,

Well the LowPin count user guide and lessons on the Microchip site have 12 lessons - not sure what you have got.

You can download the latest ones here -

**broken link removed**

You need to run the first lessons yourself so you learn how to use mplab and get a led flashing on your demo board.
Follow that with the ADC example using the onboard trimmer and leds.

When you have got to that stage then you will be ready to try the LM35, how will you be wanting to disply the temperature on a row of leds or a lcd ?

You should find those lessons work well so try and follow them - shout if you are stuck.
 
ok but i was asking about the hardware which pin must connect to pin of microcontroller and it is analogue so it myt be easier in connecting and i want to connect 3 to 4 sensors and fine the average of all the the sensorss ok thanks once again for ur help
 

Hi,

I assume you are talking about using the 16F690 chip on the starter board.

If so then you will probably be best connecting your 4 sensors to PortC 0,1,2 & 3
These can be used for Analogue or Digital, depending on how you configure them

RA0,RA1 and RA3 are used by the Pickit2 to program the chip, so to keep things simple its better to keep them free for programing.

Are you aware that you can buy different grades of the LM35 - typically the CA and D types which have different accuracy specifications.
 

Hi,

As I said earlier, if you do those first few tutorials with the Pickit2 including the ADC one, then you will see how easy it is to add in a LM35.

If you don't want to do it yourself just search this forum and the web , there are loads of pic based projects using the LM34 and LM35 where the design and code are free.
 
how to program fr the measurement of temperature

if you want others to do the work for you, you can forget about it.

if you want to learn to do the work by yourself, we can help you.
 
i dnt mean to say u that someone must do my work bcz im confusing in hardware part as i got 3 pins of LM35 VS,VOUT,GND so i can coonect grnd and vss to pwersupply and i dnt knw to connect vout to which pin and im concerned about many sensors so shal i join all together r shal i connect on bredboard and connect to my demo board ok thank you
 

go through a quick thought process with me.

1) in the datasheet for LM35, what does it say about the Vout pin? what does it signify?

2) what do you want to achieve with this combo (LM35 + mcu)? how do you plan to do that?
 

i want to measure the temperature of diff locations in the room and get average of all

i cant find the configuration of lm 35 just it indicates the specifications of sensors and applications like low output impedence, linear output, small size and it is ocnnected with different resistors and capacitance to mkae different circuits for different applications
 

again, two simple questions, and you can answer them one at a time:

1) in the datasheet for LM35, what does it say about the Vout pin? what does it signify?

2) what do you want to achieve with this combo (LM35 + mcu)? how do you plan to do that?
 

ok i got to connect this lm 35 to LPC BOARD tht i ll connect one pin to VDD and the third pin to ground and the VOUT pin to RA0 but hw cn i connect the multiple sensors shall i use the same connection in the same jack r else somewhere just can u brief me about this port 0,1,2,3 please and i want to record the temperature by this combo
 

hw cn i connect the multiple sensors

OK, let's get back to the basics, one step at a time:

1) in the datasheet for LM35, what does it say about the Vout pin?
 

LM 35 output pin indicates that the output voltage is converted to temparature by a simple conversion factor The sensor has a sensitivity of 10mV / oC.
Using a conversion factor that is the reciprocal, that is 100 oC/V. The general equation used to convert output voltage to temperature is:
Temperature ( oC) = Vout * (100 oC/V)
So if Vout is 1V , then, Temperature = 100 oC
The output voltage varies linearly with temperature.

The LM35 is connected to analogue input AN0 which is also the data input line for programming the 16F690 using ICSP so i need a way of connecting the sensor and the programming input at the same time with the programming input overriding the sensor output (and not damaging the sensor!).

is it fine r shal i know more about this LM 35
 

LM 35 output pin indicates...

that's beautiful. see, everytime you look at the datasheet, good things happen.

so the datasheet establishes that
The output voltage varies linearly with temperature.

so in order to read the temperature sensed by the chip, you will need to read the (analog) voltage output on the Vout pin from that chip, right?

that means you need to perform an analog / digital conversion since your chip doesn't handle analog natively.

now, two simple questions:

1) look at your board's datasheet, which pin is configured already to read analog voltage?

2) what does this mean about connecting multiple LM35's Vout pins together?

the 2nd question is simpler.
 

The PIC16F690 has an on board Analog-to-Digital Converter (ADC) with 10 bits of resolution on any of 11 channels. The converter can be referenced to the device’s VDD or an external voltage reference. The LPC Demo Board references it to VDD as provided by the USB cable. The answer from the ADC is represented by a ratio of the
voltage to the reference.
ADC = V/VREF * 1023
Converting the answer from the ADC back to voltage requires solving for V.
V = ADC/1023 * VREF
Two of the three factors on the right side of the equation are constants and may be calculated in advance. This eliminates the need to actually divide, but still requires fixed or floating point multiply to solve the equation

configure PORT A as analogue input,TRISA<0>=1,ANSEL<0>=1

1) RA0 pin is configured to read the anlogue volatge and at the same time it ll program the MCU as well

2)yes i understood the second question that all the Vout pins must be configured thru one analogue pin so by which programing may be easier
 

you are correct.

so if you utilize the RA0 pin for ADC, you should connect the Vout pin from the LM35 to RA0 (make sure that the pot is not connected to RA0). That way, you can reuse the code or at least its framework to measure the temperature.

As to the math, fixed point math is going to be quite convenient here.

instead of using Vref=5v, you can use Vref=5000mv so that the voltage measurement is in mv, not v. and V=3000 would signal a Vout=3v, and corresponding temperature of 300C, for example.
 

ok i got about the use of volatge but

(make sure that the pot is not connected to RA0) but what is this pot and shall i connect all of the vout pins from breadboard to RA0 and can use that ADC program by modification and shall i use the LCD for display of temperature
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top