EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / sir, my problem is that I am

sir, my problem is that I am

|

Microcontroller › PIC › help interfacing two lm35 pic16f877a and lcd › sir, my problem is that I am

November 19, 2012 at 6:02 am #8763
jefferson
Participant

sir,

 

my problem is that I am getting 2.5V and -2.5V in portD instead of 5V and 0V respectively. Is it possible to measure 5V and 0V in that port? Or do I need revision of my code? by the way I am using external reference voltage(+VREF and -VREF). There is a condition:

 

 

FOR FIRST SENSOR:

Ch0 = ADCRead(0); //Gets reading from channel 0
if (Ch0 < Temp35){        //if the temperature is less than 35 degrees RD0 gives 5V if not 0V.
RD0_bit = 1; //Turn on
}
else{
RD0_bit = 0; //Turn off 

if(Ch0 > Temp50){       // if the temperature is greater than 50 degrees RD1 gives 5V otherwise 0V
RD1_bit = 1; //Turn on 
}
else{
RD1_bit = 0; //Turn off 
}

 

 

FOR SECOND SENSOR:

 

Ch1 = ADCRead(1); //Gets reading from channel 0
if (Ch1 < Temp38){    //whenever second sensor reaches less than 38 degrees RD2 gives 5V and if not 0 V
RD2_bit = 1; //Turn on 
}
else{
RD2_bit = 0; //Turn off 
}
if(Ch1 > Temp55){  //if temperature is greater than 55 degrees RD3 gives 5v otherwise 0V
RD3_bit = 1; //Turn on
}
else{
RD3_bit = 0; //Turn off
}

 

 

Likewise the circuit is connected to LCD which displays the amount of temperature,.

 

hope you understand me..

 

thank you and more power.

RSS Recent Posts

  • AI algorithm for bots April 17, 2026
  • SDCC Array Access In Timer 0 Interrupt Handler April 16, 2026
  • EasyEda program has a major bug April 16, 2026
  • ANOTHER OLD PROJECT REDO April 16, 2026
  • How to set the OSCAL in a PIC 12F675 April 16, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise