• Home
  • Archive
  • Tools
  • Contact Us

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
You are here: Home » 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 :

Advertisement

---

Create an Arduino LDR Module With Transistor

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 transistor with ldr , LDR TRANSISTOR ARDUINO , ldr transistor , ldr sensor circuit arduino transistor , ldr module ditambah transistor ke arduino , ldr module code , LDR module , ldr meten met servo without library , How to build an LDR module , bc 547 module for arduino

This Article Has Been Shared 526 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him 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 Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

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

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Proxy Server: Design Pattern in Programming January 30, 2023
  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023
  • What is Vehicular Ad-Hoc Network? January 24, 2023

About This Article

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

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

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

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

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT