• Home
  • Archive
  • Tools
  • Contact Us
  • Forum

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
The Customize Windows > Computer and Internet > Hardware > Create an Arduino LDR Module With Transistor

By Abhishek Ghosh May 13, 2018 2:59 pm Updated on May 13, 2018

Create an Arduino LDR Module With Transistor

Advertisement

In our previously published guides, we listed commonly used transistors with Arduino and How to Turn on LED with LDR. In that turning LED on, we needed no transistor. We Can Create an Arduino LDR Module With Transistor in Easy Way to Print Response as Either Zero or One. We will use a BC 547 as transistor, which is an NPN transistor. After testing this diagram on breadboard, you can make it permanent on any prototype board to make it a LDR Module.

 

Create an Arduino LDR Module With Transistor

 

For this project, we need :

  1. One 10K Ohm resistor
  2. Two 1K Ohm resistors
  3. One LDR
  4. Few Jumper Wires
  5. Breadboard
  6. Arduino UNO or similar board

 

We have drawn the circuit diagram using Fritzing in easy to understand way for the beginners :

Create an Arduino LDR Module With Transistor
Advertisement

---

In the circuit, we are supplying 5V to two 1 K Ohm resistors. One of those 1K Ohm resistor, one is connecting to collector pin of transistor. This is a current limiting resistor which will help the transistor to switch between ON and OFF states. The same pin of transistor is also connected to Arduino’s digital pin. Another 1K Ohm resistor is connected to one leg of LDR. It is a pull down resistor. Another leg of LDR is connected to base pin of transistor and 10K Ohm resistor. End of the 10K Ohm resistor is going to emitter of transistor and GND of Arduino. Current flowing through collector to emitter is directly proportional to the current applied at the base of the transistor.

This is the code to test :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
int ldr_pin = 2;
 
void setup() {
  // serial communication t0 debug
  Serial.begin(9600);
  // collector pin of transistor
  pinMode(ldr_pin, INPUT);
}
 
void loop() {
  // read
  int light_ldr = digitalRead(ldr_pin);
  // 1 for Dark and 0 for Light
  Serial.println(light_ldr);
  // adjust looking at serial monitor
  delay(500);      
}

After uploading the code, you can open the serial monitor of Arduino IDE. When there will be light, the response will be printed as 0. When there will be dark, the response will be printed as 1.

Obviously, you can connect the wire to A0 instead of Pin 2 and use this snippet with analogRead function of Arduino to get values printed from 0 to 1023 :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
int sensorPin = A0;
int sensorValue = 0;
 
void setup() {
  Serial.begin(9600);
}
 
void loop() {
  sensorValue = analogRead(sensorPin);
  Serial.println(sensorValue);
  delay(100);                
}

Do you know that this circuit without Arduino board actually can switch on a LED on dark? If we put a LED between collector and emitter pin of transistor, power with 5V from battery source, without Arduino, that LED will light up on dark.

Tagged With arduino modul ldr digital , bc 547 module for arduino , LDR module , ldr module ditambah transistor ke arduino

This Article Has Been Shared 397 Times!

Facebook Twitter Google+ Pinterest

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic Surgeon, Author and Blogger. You can keep touch with him on Google Plus - Abhishek Ghosh1 and on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Create an Arduino LDR Module With Transistor

  • 7 Segment LED Display Tutorial For Dummies

    Here is Step By Step 7 Segment LED Display Tutorial For Dummies On How To Light Up With Battery To Control With Arduino Without Library.

  • Arduino TEMT6000 Ambient Light Sensor : Basics & Setup

    Here is Basics, Setup & Code for Arduino TEMT6000 Ambient Light Sensor. Ambient Light Sensor is used in electronic devices. SI Unit of ambient light is Luminance (lux).

  • Arduino 2 Push Button One LED : Switch On/Off

    Here is Circuit Diagram and Code For Arduino 2 Push Button One LED to Switch On/Off Project. It is Very Easy Yet Important Basic Behind Using Sensors to Switch On/Off an Event.

  • Arduino : LED Switch On By Push Button Switch Off By IR Obstacle Sensor

    Here is Circuit Diagram and Code To Make LED Switch On By Push Button Switch Off By IR Obstacle Sensor and Arduino Board.

  • Arduino Stepper Motor Buying Guide (Driver IC Included)

    Here is Arduino Stepper Motor Buying Guide Including Needed Basics on Driver IC. Stepper Motor is Much More Complicated From Buying Point Than Servo Motor.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Google+ or Twitter to join the conversation right now!

If you want to Advertise on our Article or want Business Partnership, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Google+ (13.7k Followers)
  • Pinterest (11.4K Followers)
  • Twitter (4.7k Followers)
  • Facebook (4.9k Followers)
  • LinkedIn (3.2k Followers)
  • YouTube (1.5k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Getting Started With IBM Cloud IoT (Watson IoT Platform) February 22, 2019
  • ESP WROOM 32 : How To Setup ESP32 NodeMCU With Arduino IDE February 21, 2019
  • Arduino, NodeMCU ECG : AD8232 Single Lead ECG Module February 21, 2019
  • WiFi With Arduino For IoT : ESP8266, ESP32, NodeMCU, Adafruit Feather February 20, 2019
  • Wearables and Internet of Things : Part II February 13, 2019

About This Article

Title: Create an Arduino LDR Module With Transistor
2018-05-13

Author: Abhishek Ghosh
Subjects: Computer and Internet

Is Part Of:


TheCustomizeWindows,

Sunday, May 13th, 2018,
Vol.1(01),
p.1–57050 [IoT Ready Journal]


Source:The Customize Windows
ISSN: 0019-5847 ;
E-ISSN: 0019-5847 ;
Publisher:
jima.in

Cite this article as: Abhishek Ghosh, "Create an Arduino LDR Module With Transistor," in The Customize Windows, May 13, 2018, February 22, 2019, https://thecustomizewindows.com/2018/05/create-an-arduino-ldr-module-with-transistor/.

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.


PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

web analysis

Copyright © 2019 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy