1 📖🌒Resistance - Potential Divider

Fundamental Circuit Tutorial
Potential Divider Circuit Tutorial

This is a standard circuit to measure resistance.

Light Dependent Resistor Thermistor IC
Datasheet Wharehouse
A2D
 
 
 
 
 

In this tutorial we will use a  Light Dependent Resistor as our input device. Since this is a standard circuit students may substitute for their own input device (e.g.Thermistor).

Theory

Schematic

Instructions

Schematic

Build the circuit below using a Light Dependant Resistor and a resistor that matches the LDR maximum resistance.

Light Dependant Resistor

Program Code

We can use programming command A2D (Analogue To Digital) to read values.

 Download the following example.

 

 

' Reading Analogue Devices
' Potentiometer.txt
' Kic8 

  ' Our example assumes your device is conncted to ADC1
  SYMBOL MyDevice = 1

DO

  ' Read Analogue into Variable W0
  ' at the end of the reading, the variable W0 
  ' will have a value in the range 0..1024 (decimal)

  A2D MyDevice , W0

LOOP