« The Operational Amplifier.Intro to Circuitry: Symbols and beyond »

Intro to Circuitry - Light Sensor and an Introduction to EAGLE

06/23/09

Intro to Circuitry - Light Sensor and an Introduction to EAGLE

Permalink 09:12:22 pm by anthony, Categories: Schematic, Eagle

I would like to demonstrate a very simple yet powerful circuit, a light sensor using an LDR.

A LDR is a Light Dependent Resistor, this circuit element varies its resistance based upon the amount of light that hits the device.

When we hook up this element in a voltage divider configuration, we can make a high and low signal based upon how much light hits the sensor. This is further filtered by using an NPN transistor in an inverter configuration to generate a purely digital signal.

This circuit allows you to produce a 1 or a 0 that correlates to whether the sensor is subjected to light or is in shadow. The amount of light that triggers the sensor is based on resistor R. (the resistor hooked up in the voltage divider with the LDR)

The circuit:


The schematic above was drawn with EAGLE, a CAD software for designing electric circuits as well as Printed Circuit Boards(PCBs)

Eagle is a very powerful tool and can make designing complicated circuits a breeze. Its much easier to draw a circuit out on eagle than to fumble around with a breadboard guessing and checking along the way.

The first thing you want to do is to create a new project file and make a new schematic.

The Blank Eagle Screen:

This is what comes up once you create a new schematic. Your first job is to start adding devices to your circuit. This is done by pressing the add devices button.

Once you do that the following screen comes up:

You can begin typing what part you need, first thing we're going to do is assemble the power supply so we have a steady potential across our circuit. We want a positive voltage regulator in a TO-220 package. A TO-220 package is fairly common package as its cheap and very easy to work with and we don't have to worry about overheating too much because the package can handle a lot of heat. Most of the time as well the package has a mounting hole for a heat sink a swell.

Once we select the part we want we can add it to our circuit. For the power supply were going to need two capacitors and a voltage regulator as well as inputs for our voltage from our source.

Once we place all the parts we have to hook everything up. For this, we use the wire hookup tool. We link all the parts like we normally would in a circuit with wire. We have to take one more step however, we have to use the node tool at any junction where two devices connect. Just because a wire and a device touch, doesn't mean they're linked. We must use the node tool to link the devices and make a connection. This is very important as unlinked nodes will produce an improper PCB design when we eventually get to that stage.

One thing you'll notice is the GND and VCC "devices." These are symbols we use to note common points in the circuit. We use a GND symbol to denote the ground. Therefore, any point in the circuit that connects the ground, connects to this symbol. This way of designing our schematic makes things look cleaner and allows us to separate functioning parts of our circuit into blocks that can be modified separately.

What the power supply does:

The power supply provides us with a known potential. When building this circuit we are going to use a 5 volt positive voltage regulator, which on the output gives us a steady 5 volts irregardless of the input voltage (assuming its DC and within specs).

The two capacitors act as filters, filtering out noise that might be introduced on our line. The capacitors in that configuration are called decoupling/bypass capacitors and are a type of low pass filter.

The LSP1/2 devices are nothing more than pads to attach our voltage source.

Once we have a steady source of power we can begin doing analysis.

The voltage divider.

The first part of our circuit is a voltage divider.

This allows us to output a voltage that is proportional to the voltage source.

Since

And

Thus

And

Then

From that relationship, we see how the voltage is proportional to the resistor R we choose and the resistance the LDR provides.

Using a multimeter we can find that the LDR puts out a resistance of about 200 ohms when in light and around 5Kohms in the dark.

We want to have a system where the change in V is the greatest for on an off conditions.

Assume we use a 1Kohm resistor for R, That gives us:

And for the off state:

This gives us a nice kick to switch our NPN transistor to solid on/off states.

The Inverter.

BiJunction Transistors are a type of "switch" they amplify current by allowing a large amount of current to flow via a small trigger.

The most important character of a BJT is its current gain, which is how much the BJT will amplify current before it reaches its limit.

For this setup we are going to be using the TIP120 NPN BJT.

Data sheet: http://www.learn-c.com/tip120.pdf

BJT usually have 3 leads; a base, collector and emitter.

The way a NPN BJT works is that a small current on the base will amplify a current from the collector to the emitter.

Now, in reality, the BJT is much more complicated than that, but for this post, that information should suffice.

The way our transistor is hooked up, is in an inverter configuration, which means when the transistor is OFF the device receives power, when the power is turned on, the transistor passes the load to ground, giving the device a 0 potential.

When our LDR is ON, there is a large amount of current going into the NPN transistor, this saturates the gate, and the LED doesn't light. When the LDR is off however, there is very little current going into the base of the transistor, thus there is very little voltage drop across the transistor and the LED gets power just as if it were hooked up to the resistor alone.

Operating Pictures:

We setup the project on a breadboard, which allows us to prototype the circuit. Instead of permanently soldering components to a PCB, we can just insert the leads of the components into the breadboard and use the internal network to connect our circuit.

The parts list for this circuit are:
2X - 2.2Kohm Resistors
1X - Blue LED
1X - TIP120 NPN Transistor.
2X - 15uf 50V electrolytic capacitors
1X - LM7805 5v pos Voltage regulator
1X - Diode
1X - 9v (or any DC voltage source)
- Some hookup wire.

The LED is off, which means the voltage divider is high, and the NPN transistor is ON. Current is being drained to ground, instead through the LED.

In the next setup, we cover the LDR, producing a low on the voltage divider, turning the transistor off, allowing current to flow to the LED.

Conclusion:

This is a very useful circuit and allows you to understand basic circuit elements. Light sensors are very useful in robotics in object detection and any other circuit where your application is sensitive to light.

- Alternative designs using op amps!

No feedback yet

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
This is a captcha-picture. It is used to prevent mass-access by robots.

Please enter the characters from the image above. (case insensitive)

Array
May 2012
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Ads By Google

This blog is an extension of Microcontrollers and You! This blog focuses more on the hardware part of design rather than software. This blog will be covering topics such as analog hardware, digital hardware,schematic and printed circuit board design and tons of other things. Topics may overlap for convenience sake.

Search

XML Feeds

blogsoft