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.

Adc value to LCD using Arduino

Status
Not open for further replies.

saugat

Newbie level 2
Joined
Aug 13, 2015
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
41
I am trying to step down 40V dc supply using voltage divider circuit to 5 volts proportionally and the output voltage is to displayed on 16X2 lcd. I am always getting 0.0 on lcd, though i think my program is perfect.
I tried a lot but can not figure out what is the error in this circuit.
Please help me out.
Thanks in advance..
Here is my circuit

Capture.PNG

And here is my arduino code:

Code:
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
void setup()
{
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.print("ADC value");
}
void loop()
{
  lcd.setCursor(0,1);
  float value = analogRead(A0)*5.0/1024.0;
  lcd.print(value);
}
 
Last edited by a moderator:

did you connect 40VBattery Ground(-ve terminal) to arduino ground?
 

I've never used an Arduino and I can't read the MCU type in your diagram but I suspect you are not following it's manufacturers guidelines about the impedance at the ADC input. Possibly the board also has a resistor to ground/supply on it as well which would effectively be in parallel with your series resistor chain.

Most MCU require an input impedance of < 10K to give accurate results. The solution is to use a buffer amplifier to provide more output current to the ADC input.

Another thought: does the "lcd.print()" function accept floating point numbers as input or do you have to convert to text first?

Brian.
 

yep, AVRs common ADC has a recommended input impedance of no more than 10Kohm... that voltage divider seems a little to high...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top