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.

[SOLVED] LDR and ADC of ATmega8

Status
Not open for further replies.

jaguar10

Newbie level 4
Joined
Nov 11, 2011
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Lima (Perú)
Activity points
1,341
Hello everyone, good day;


I am developing a proyect where a little part of it is to sense the intensity of the daylight. I am using of course using LDRs.

The regular circuit would be a voltage division between a resistance and the LDR, next would be an opamp buffer to separate impedances between circuits so that it can finally go into the ADC pins of the ATmega8.

The problem is that my physical space is pretty much limited. And since I am using 6 LDRs, i would need 6 buffers, and that is quite a lot of space in my circuit board.
So i was checking the ATmega8 datasheet and there no information about the internal impedance of the ADCs...

I know its not wise to make this connection:
foroselectronica.png

but its the best i can do right now...

So my question is:

Does anyone know how much ohms does the ADC of the ATmega8 has?
And the rough connection i am proposing would work?

PD: Sorry about the circuit image, i did it on paint in 5 seconds... im not a child
 

Page 202 of the mega8 datasheet

Analog Input Circuitry

The ADC is optimized for analog signals with an output impedance of approximately
10kΩ or less
. If such a source is used, the sampling time will be negligible. If a source
with higher impedance is used, the sampling time will depend on how long time the
source needs to charge the S/H capacitor, with can vary widely. The user is recom-
mended to only use low impedant sources with slowly varying signals, since this
minimizes the required charge transfer to the S/H capacitor.

Since you don't have any fast changing signal you can use a capacitor (like 100nF) in parallel with the adc input, the capacitor charges with the voltage value of the divider and presents a low impedance source to the internal circuit.
What happens is that the internal sample and hold circuit will be charged almost instantly from the external capacitor instead of the high impedance divider.

Alex
 
Do you think the circuit I drew would work? And i mean without the capacitor?
 

Yes I think it will work even without the capacitor.

Alex
 
  • Like
Reactions: nanock

    nanock

    Points: 2
    Helpful Answer Positive Rating
Alright.

Since the robot I am building is very limited on space for circuit that is good news.
I will post the results when i test it if you like, with and without the capacitor.
 

There are chances that if you select a LDR with higher value of resistance (much greater than 10K) under normal illumination, the range of values from ADC between Dark and illuminated conditions would be limited. You may need to go for a different LDR or change the 10K or both. The circuit should work, in the event of problem check the code or the rest of the connections.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top