Skip to main content

Featured Post

Kerala's First 3D Printed Building

Created as a showcase project, AMAZE-28, the single-room summer house, was successfully constructed within 28 days on the grounds of the Kerala State Nirmithi Kendra. The 3D-printed building at the Kerala State Nirmithi Kendra in Thiruvananthapuram. (Photo: Shekunj)  The inauguration of Kerala's inaugural 3D-printed structure, a 380-square-foot single-room summer house, is scheduled to take place on October 10 at the Kerala State Nirmithi Kendra (Kesnik) campus located in PTP Nagar, Thiruvananthapuram.  Conceived as a showcase initiative, the summer house named AMAZE-28 was successfully finished within a mere 28 days. This impressive project was executed by Tvasta, a construction technology startup based in Chennai, founded by alumni of IIT-Madras, who have entered into a memorandum of understanding (MoU) with Kesnik.  AMAZE-28 is perched upon a concrete foundation atop a gentle elevation within the Kesnik campus. Febi Varghese, the Director and Chief Executive Officer of Kesnik, p

How to use an LDR with Arduino

 LDR/Photo-resister with Arduino: This articles aims to show the reader how to use an LDR, also known as a photo-resistor in their projects. 

How to use an LDR with Arduino

After reading this article, the reader will be able to connect and read a photo-resistor, and use the code in their future projects!

Components Needed

  • Arduino
  • Breadboard
  • Jumper Wires (Male to Male)
  • Photoresistor
  • 1x 220 Ohm resistor

Wire all the components as per the circuit diagram given below.

How do we measure resistance

The LDR varies its resistance based on light hitting it, and the Arduino technically only reads voltages, so how do we measure resistance? We are not REALLY measuring the resistance in this circuit, instead we are creating a resistor divider network between the LDR and the resistor, which will vary the voltage directly based on the LDRs value. We then read the voltage out of the divider network and print that value.

Code

//Variables
int inPin = A0; //Pin the sensor is connected to
int sensorVal = 0; //Variable to store sensor data
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("Serial Communication started...\n");
}
void loop() {
// put your main code here, to run repeatedly:
sensorVal = analogRead(inPin); //analogRead will read the voltage on the pin specified and return it as a value between 0 and 1024.
Serial.println(sensorVal); //Print the sensor reading to the serial window so we can view the data.
}

Comments

Popular posts from this blog

Controlling LEDs over WiFi using NodeMCU and Blynk App.

This article is the base on the Internet of things ( IoT ) . IoT describes the network of physical objects—“things” or objects—that are embedded with sensors, software, and other technologies for the purpose of connecting and exchanging data with other devices and systems over the Internet. In this article 3 LEDs will be controlled by an android application (made using Blynk) over a wifi connection. How to use NodeMCU with Blynk  If you want to start learn the Internet of Things (IoT) concept, then controlling a LED over the  internet is the " Hello World!" of the IoT journey. Performing the " Hello World" task will be easy using NodeMCU micro-controller as the first client and Blynk as the 'broker' or server and Blynk android application as the second client. Now communication between two clients will happen through broker over the internet. Now lets, make this happen.  Components Required For this activity we will need following components: Nod

Kerala's First 3D Printed Building

Created as a showcase project, AMAZE-28, the single-room summer house, was successfully constructed within 28 days on the grounds of the Kerala State Nirmithi Kendra. The 3D-printed building at the Kerala State Nirmithi Kendra in Thiruvananthapuram. (Photo: Shekunj)  The inauguration of Kerala's inaugural 3D-printed structure, a 380-square-foot single-room summer house, is scheduled to take place on October 10 at the Kerala State Nirmithi Kendra (Kesnik) campus located in PTP Nagar, Thiruvananthapuram.  Conceived as a showcase initiative, the summer house named AMAZE-28 was successfully finished within a mere 28 days. This impressive project was executed by Tvasta, a construction technology startup based in Chennai, founded by alumni of IIT-Madras, who have entered into a memorandum of understanding (MoU) with Kesnik.  AMAZE-28 is perched upon a concrete foundation atop a gentle elevation within the Kesnik campus. Febi Varghese, the Director and Chief Executive Officer of Kesnik, p

How to Know the NodeMCU IP Address for Your Next IoT Project

  NodeMCU IP Address: The NodeMCU is a popular development board for IoT projects. It’s small, affordable, and comes with built-in Wi-Fi connectivity, making it the perfect choice for creating connected devices. But before you can start building your NodeMCU projects, you need to know the IP address of your device. This IP address is essential for communicating with the NodeMCU from another device, such as a computer or smartphone. In this article, we’ll show you how to find the NodeMCU IP address, so you can get started with your next IoT project. Method 1: To Know the NodeMCU IP Address One of the easiest ways to find the NodeMCU IP address is by using the serial monitor in the Arduino IDE. First, connect your NodeMCU board to your computer using a micro-USB cable. Then, upload the following code to the NodeMCU: #include <ESP8266WiFi.h> void setup() { Serial.begin(115200); Serial.println(); Serial.print("Connecting to "); Serial.println("