dark sensor circuit using 8051 microcontroller
#1
Question 

Hi,
This is Sunita,Can u please send me schematic and block diagram of dark sensor using microcontroller.
Thank you
Reply
#2

Here we have explained a dark detector circuit by using 555 timer IC and a LDR (Light Dependent Resistor) which senses the light in surroundings and if it does not find the light, it triggers the IC and glows an LED attached with the circuit. In place of LED we can also use a buzzer or speaker to use it as dark detector alarm. The concept of this circuit is quite simple and based on the working of LDR. So lets first understand more about LDRs.
LDRs are a type resistors made from semiconductor materials to enable them to have their light sensitive properties. There are many types of LDRs but one of the most popular material used is cadmium sulphide (CdS). These LDRs or also known as photo resistors works on the principle of “Photo Conductivity”. Now what this principle says is , whenever light falls on the surface of the LDR (in this case) the conductance of the element increases or in other words the resistance of the LDR falls when the light falls on the surface of the LDR. This property of the decrease in resistance for the LDR is achieved because it is a property of semiconductor material used on the surface.
Here in this dark detecting LED circuit, LDR is configured with 555 timer IC in ASTABLE mode in such a way that 555 ASTABLE generates square wave when the light intensity goes below a certain level.

Circuit Components

555 Timer IC
LDR
Capacitors (100 nF, 100uf)
Resistors (1k, 4.7k, 47k Ohm)
LED
9V Battery

The dark detector circuit shown here can be used to produce an audible alarm when the light inside a room goes OFF. The circuit is build around timer IC NE555. A general purpose LDR is used for sensing the light. When proper light is falling on the LDR its resistance is very low. When there is no light the LDR resistance increases. At this time the IC is triggered and drives the buzzer to produce an alarm sound. If a transistor and relay is connected at the output (pin3) of IC1 instead of the buzzer, electrical appliances can be switched according to the light.

The Light Sensor
Light sensors are one of the most common types of sensors. They are used in night lights, street lights, alarms, toys, cameras, etc. We are using a CDS (Cadmium Sulfide) Photocell to detect light. The resistance of the sensor varies based on the amount of light that hits it. The resistance can vary from 300K in the dark to 1K in the light. Our goal is to convert this into a digital value. We have to convert the variable resistance into a voltage and then the voltage into a digital value. To convert the resistance into a voltage, we use a second resistor Rb. Then assuming that no current goes into pin 13, you can find V1. To find V1 you can use Ohms Law. With Vcc = 5, Ohms Law gives you
(5 - V1) / Rpc = V1 / Rb
where Rpc is the resistance of the sensor (photocell).
Then you can solve for V1 = 5*Rb / (Rpc + Rb)
Then the maximum voltage is when Rpc is at its minimum, 1K. Then V1max = 5*Rb / (1k + Rb)
The minimum voltage is when Rpc = 300K. V1min = 5*Rb / (300k + Rb).
Using the equations for V1 max and min you can determine that 5.1K is a good value for Rb. 5.1K gives you a wide voltage range from minimum to maximum. 5.1K works well for general light to dark situations. If you are only interested in bright environments (are you making an outside robot?) then use a larger value of Rb to shift the light sensitivity range towards bright lights (Perhaps 50K). Or if you are interested in dark environments (are you making a robotic vampire dog that barks at the moon and hides from bright lights?) then use a smaller value of Rb (perhaps 510).
Now we have a sensor voltage, V1, that varies from about 0.1 volts to 4.2 volts. If you want to take the easy route you can use the hardware set up in the Data Collection tutorial to convert this voltage to an eight bit digital value.
Analog to Digital Conversion using the 2051
The Data Collection Tutorial shows how to use a ready made Analog to Digital converter chip to get data from an analog source. This tutorial shows a different method. This method is not as accurate as the ADC0804 but it is less expensive, uses less power, and is easily modified to suit specific needs.
This method uses the built in analog comparator on the 2051 (not a normal feature of 8051 based chips). The voltage generated by the sensor circuit is connected to the negative input of the comparator (P1.1) and we will generate a voltage to connect to the positive input of the comparator (P1.0). The output of the comparator goes to P3.6. P3.6 is not an external pin on the 2051. It can only be accessed by the internal software. If the voltage at P1.0 is higher than P1.1 then P3.6 will be a 1. If the voltage at P1.0 is lower than P1.1 then P3.6 will be a 0.
By using the other 6 Port 1 pins (P1.2 through P1.7) we can generate a voltage using a resistor network connected to those pins. By changing the values of the Port 1 pins we will get as close as possible to matching the voltage from the sensor circuit. Then we will have a 6 bit digital value that is a reflection of the sensor voltage at P1.1.
Each of the 6 Port 1 pins is connected to V0 through a resistor. Setting a pin to 0 or 1 subtracts from the voltage at V0 or doesn't. The value of the resistor determines how much voltage is subtracted. If all 6 pins are set to 1 then no current is flowing through the resistor network and V0 = 5V. The small resistor on P1.7 (240 ohms) can subtract the most voltage. When we set it to 0 current flows through Ra and the voltage at V0 goes down. The exact amount depends on the value of Ra. The resistors are chosen so they are roughly twice the value of the resistor connected to the next higher pin. (Ideally they would be exactly double the other value but it is difficult to get resistors that have exactly the right values.) By doubling the resistance, the pin can subtract half as much voltage. When you get to P1.2 with the 10K resistor, it only has a small effect on the voltage at V0 when you set P1.2 to 0 or 1.
The actual voltage at V0 is determined by the resister Ra. To find a good value for Ra look at what happens when our digital output is about at the half way point 011111. P1.7 is the only pin that is drawing current. Starting at Vcc, the current goes through Ra and then through the 240 ohm resistor to ground (P1.7 = 0). To make the voltage at V0 equal to 2.5 volts (half of Vcc), make Ra 240 ohms. But since we know the sensor voltage V1 only goes up to 4.2 volts you may want to make the halfway point by 2.1 volts. Use 330 ohms for Ra to get 2.1 volts for the halfway digital output of 011111.
Now we can control the voltage at V0 fairly accurately with P1.2 through P1.7. To make a small change in voltage, change the lower pins and to make a large change in voltage change the higher pins. By starting with P1.7 through P1.2 set to 000000 (P1.7 is on the left and P1.2 is on the right) and counting up to 111111 you can get 64 different voltages!
To find the right digital output to create the right voltage to match the voltage at P1.1 (V1), we start at 000000 and count up until the comparator output at P3.6 switches to 1 to tell us our generated voltage is higher than the sensor voltage. Then we can "track" the voltage by adjusting the value up and down depending on the output of the comparator. Since the comparator only tells us high or low (it can not tell you if you have an exact match) then one possibly annoying aspect of this approach is that the P1.2 bit is constantly switching from 0 to 1 to 0 to 1... as the comparator output tells us we are low, then high, then low. To avoid having to watch the 6 bit value oscillate (also called jitter) we just use the top 5 digits as our answer. Look at the documentation in the software for the 2051 in light.asm for more details on the tracking routine.
The details of communicating with the PC are covered in the Data Collection Tutorial. For this project we are sending the upper 5 digit value (P1.3 through P1.7) to the PC. This can be displayed on the screen using the sample light program. After downloading, double click it to extract the files and then run setup.exe to install it.
The Software
The basic process of compiling an assembly language program and loading it into the microcontroller was covered in the first microcontroller project. The 2051 assembly language program for this project is light.asm. You will need a device programmer such as the PG302 to reprogram the 2051.
Make sure the power is off to the circuit you have built. Connect the circuit to the PC's serial port, Comm1. Connect the power to the breadboard. The circuit should send a continuous stream of values to the PC. To see the values on the PC, try this sample light program. After downloading, double click it to extract the files and then run setup.exe to install it. The source code for the sample program (written in VB 5.0) is on the CD included with the kit.
The parts for this project are included in the Sensor Kit. The Sensor Kit also includes the parts needed to do the temperature sensor project and the data collection project. The kit includes:
1 - AT89C2051-24PC Microcontroller (unprogrammed)
1 - 11.0592 MHz Crystal
2 - 33pF Capacitors
1 - 150pF Capacitor
1 - 10 uF Capacitor
1 - 220 uF Capacitor
1 - 8.2k Resistor
5 - 240 Ohm Resistors
5 - 510 Ohm Resistors
5 - 1k Resistors
5 - 2.2k Resistors
5 - 5.1k Resistors
5 - 10k Resistors
5 - 15k Resistors
1 - MAX232
1 - ADC0804 (Analog to Digital Converter IC)
5 - 1 uF capacitors
1 - DB9 connector
1 - CDS Photocell Light Sensor
1 - DS1620 Temperature Sensor
Jumper Wires
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: advantages and disadvantages of dark sensor, example of a dark sensor circuit, dark sensor information, ldr dark sensor ied**ppt, ds1620 pic16f887, c rpc, lm324 dark sensor pdf,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  Lm35 Temperature Sensor using Microprocessor 8086 0 784 23-06-2021, 02:59 PM
Last Post:
  traffic alert system circuit for blind tums 0 661 04-11-2018, 02:42 PM
Last Post: Guest
  electric iron circuit diagram free 0 682 18-10-2018, 06:40 PM
Last Post: Guest
  download ajay deshmukh microcontroller 8051 pdf 0 706 13-10-2018, 02:02 AM
Last Post: Guest
  project on door lock system using 8085 microcontroller 0 754 04-10-2018, 10:39 PM
Last Post: Guest
  advantages and disadvantages mains failure alarm circuit in pdf 0 785 01-10-2018, 11:48 PM
Last Post: Guest
  training report on embedded system 8051 pdf 0 1,724 28-09-2018, 08:01 AM
Last Post: Guest
  attendance monitoring intelligent classroom circuit diagram 0 586 26-09-2018, 07:05 PM
Last Post: Guest
  led 720 emergency light circuit diagram 0 650 22-09-2018, 01:48 AM
Last Post: Guest
  led 720 emergency light circuit diagram 0 659 19-09-2018, 09:10 PM
Last Post: Guest

Forum Jump: