0

members

Easy Basics: Project 013c Photoresistor (Photocell), 5V relay module, LED - Magic Photoswitch

of Acoptex.com in UNO

Basics: Project 013c

Project name: Photoresistor (Photocell), 5V relay module, LED - Magic Photoswitch 

Tags: Arduino, Arduino Uno, Photoresistor (Photocell), 5V relay module, LED, Magic Photoswitch

Attachments: sketch

In this project, you needed these parts :

1.Aruduino Uno R3 (you can also use the other version of Arduino)

2.Arduino IDE ( you can download it from here  )

3.Jumper cables

4. Resistor 2 pcs (1pc 220 Om and 1 pc 10 KOm)

5. Breadboard

6. Photocell (Photoresistor) 1 pc

7. 5V relay module 1 pc

8. LED 1 pc (different color)

General

We will learn in this project how to make a photoswitch with photocell and 5V relay module.

Understanding 5V Relay module

See more information here.

Understanding Photocell (Photoresistor)

A photoresistor or photocell is a light-controlled variable resistor. The resistance of a photoresistor decreases with increasing incident light intensity; in other words, it exhibits photoconductivity. A photoresistor can be applied in light-sensitive detector circuits, and light- and darkness-activated switching circuits.

The resistance of a photoresistor changes with incident light intensity. If the light intensity gets higher, the resistance decreases; if it gets lower, the resistance increases.

Signals and connections of photocell

Attach one end of photoresistor to power. On the otherside, attach a 10-kilohm resistor to ground. This resistor is in series with the photoresistor, and together they form a voltage divider. The voltage at the point where they meet is proportionalto the ratio of their resistances, according to Ohm’s Law. 

Signals and connections of LED

The operating voltage of the LED is 1.8V and the operating current is 10mA-20mA. The Arduino Uno board can supply 5V or 3.3V power. We will use 5V for this project, so the minimum resistance of the current limiting resistor should be (5 V to 1.8 V)/20 = 160 Om. The 220 Om offered in the kit is suitable and you can also choose other resistors that meet the condition. The larger the resistance is, the dimmer the LED will get.

Signals and connections of 5V relay module

See more information here.

Build the circuit

A photoresistor or light-dependent resistor (LDR) or photocell is a light-controlled variable resistor. The resistance of a photoresistor decreases with increasing incident light intensity; in other words, it exhibits photoconductivity. A photoresistor can be applied in light-sensitive detector circuits, and light- and dark-activated switching circuits. In this project, hook up the photoresistor to A2 of the Arduino Uno board, and 5V relay module to pin 10. When the value reaches or even exceeds 400, the normally open contact of the 5V relay module is closed and the LED at pin 11 on the Arduino Uno board will light up; otherwise, it will be off. 

The following picture shows the needed connections with the Arduino Uno 

Step by Step instruction

  1. Plug your Adruino Uno board into your PC and select the correct board and com port
  2. Open up serial monitor and set your baud to 9600 baud
  3. Verify and upload the the sketch to your Adruino Uno board
  4. When the value reaches or even exceeds 400, the normally open contact of the 5V relay module is closed and the LED at pin 11 on the Arduino Uno board will light up; otherwise, it will be off. 

Summary

We have learned how to make a photoswitch.

Libraries:

  • No libraries required for this project

Sketch:

  • See attachment on the begining of this project description. 


Other projects of Acoptex.com

« Go back to category
Is this project fake? Report it!   
Recommend to a friend
Published at 22-07-2017
Viewed: 417 times