Arduino Forum

Using Arduino => Sensors => Topic started by: emerson1308 on Jan 11, 2019, 02:31 am

Title: LDR - pull up / pull down
Post by: emerson1308 on Jan 11, 2019, 02:31 am
Boa noite pessoal , meu nome é Emerson e sou iniciante no arduino.

Fazendo um projeto usando um ldr , vi que precisa se usar um resistor em pull up ou pull down para que o circuito funcione.

A minha duvida é: PORQUE?

eu ja entendi o porque de usar pull up e pull down em botões. Mas não me fez sentido nenhum usar junto no resistr ldr. alguem pode me ajudar?
 
// FOR ENGLISH SPEAKERS

Hello everybody, my name is Emerson and I'm a beginner on Arduino.

By doing a project using an ldr resistor like a ilumination sensor, I saw that you need to use a resistor in pull up or pull down for the circuit to work.

My question is: WHY?
 
I already understand why to use pull up and pull down on buttons. But it made no sense to me to use together in ldr. Can someone help me?
Title: Re: LDR - pull up / pull down
Post by: jremington on Jan 11, 2019, 03:45 am
Pullup and pulldown do not apply in this case.

The resistor and the LDR make a voltage divider (http://hyperphysics.phy-astr.gsu.edu/hbase/electric/voldiv.html), which is used to calculate the resistance of the LDR. The LDR resistance is then an indication of the light level.

There are two ways to make the voltage divider, and the Arduino can be coded for either one. However, you must match the divider configuration to the code.
Title: Re: LDR - pull up / pull down
Post by: Willpatel_Kendmirez on Jan 11, 2019, 01:50 pm
You may find this tutorial at adafruit (https://learn.adafruit.com/photocells) helpful.