|
Arduino UNO R3 development sensor expansion board |
x 1 | |
|
Ldr Module |
x 1 | |
|
DHT22AMAZON
|
x 1 | |
|
1 Channel Relay Module 5V with optocoupler Support High and Low Level Trigger |
x 1 |
|
arduino IDEArduino
|
Ldr and DHT22 Home-Automation
DHT temperature & humidity sensors. These sensors are very basic and slow, but are great for hobbyists who want to do some basic data logging. The DHT sensors are made of two parts, a capacitive humidity sensor and a thermistor. There is also a very basic chip inside that does some analog to digital conversion and spits out a digital signal with the temperature and humidity. The digital signal is fairly easy to read using any microcontroller.
DHT11 vs DHT22
We have two versions of the DHT sensor, they look a bit similar and have the same pinout, but have different characteristics. Here are the specs:
DHT11
Ultra low cost
3 to 5V power and I/O
2.5mA max current use during conversion (while requesting data)
Good for 20-80% humidity readings with 5% accuracy
Good for 0-50°C temperature readings ±2°C accuracy
No more than 1 Hz sampling rate (once every second)
Body size 15.5mm x 12mm x 5.5mm
4 pins with 0.1" spacing
DHT22 / AM2302 (Wired version)
Low cost
3 to 5V power and I/O
2.5mA max current use during conversion (while requesting data)
Good for 0-100% humidity readings with 2-5% accuracy
Good for -40 to 80°C temperature readings ±0.5°C accuracy
No more than 0.5 Hz sampling rate (once every 2 seconds)
Body size 15.1mm x 25mm x 7.7mm
4 pins with 0.1" spacing
Working Principle
The schematic diagram is shown below.
As you can see, the DHT22 / AM2302 is a little more accurate and good over a slightly larger range. Both use a single digital pin and are 'sluggish' in that you can't query them more than once every second or two.
The AM2302 uses the simplified single-bus technology for communication, in which only one data line is applied for data exchange and data control in the system. In applications, an external pull-up resistor, about 5.1kΩ, is usually required. When the bus is idle, its status will switch to HIGH. The SDA is used for the data communication and synchronization between the microprocessor and the AM2302. It adopts a single-bus data format, 40 bits of data in one transmission, high bit first out. The corresponding timing diagram is shown below.
Single-bus communication timing
When the host (MCU) sends out a start signal (the SDA is set to LOW for at least 800μs), AM2302 will switch from the Sleep mode to the High-speed mode. After the signal is ended, the AM2302 sends a response signal, and then outputs a string of 40 bits data via the SDA, high bit first; the outputted data is in the format of Humidity high, Humidity low, Temperature high, Temperature low, and a Parity bit. Information collection starts once the data sending ends. After the collection finished, the sensor will switch to the Sleep mode automatically, waiting for the next communication. (Notes: The data format of DHT22 (AM2302) is different from that of DHT11.)
Example of Peripherals reading
We will present the steps for data reading in the communication between the host and the sensor.
Step 1
After the AM2302 is powered up (please wait 2s for AM2302 to become stable. In this period, no command will be sent out on device reading.), the sensor tests the environment temperature and humility and records relative data. When finished, the sensor enters the Sleep mode automatically. And the SDA data line of AM2302 is pulled up and remains HIGH as the effect of the pull-up resistor. At this moment, the pin SDA of AM2302 is in the INPUT state, detecting any possible external signal.
Step 2
The Microprocessor I/O is set to OUTPUT and outputs a LOW level for more than 800us (The typical hold time is 1ms). Then, the microprocessor I/O is set to INPUT and the bus will be released. At this moment, the microprocessor I/O (the SDA data line of AM2302) goes HIGH as the effect of the pull-up resistor. After the host released the bus, AM2302 sends out a response, a LOW level of 80ms, and then outputs a HIGH level of 80ms to inform the peripheral to receive data. The signal transmission is shown as below:
Step 3
After the AM2302 sends the response, the SDA outputs a string of 40 bits serial data continuously and the microprocessor receives the data according to the changes of I/O level.
Bit data "0" signal: the level is LOW for 50ms and HIGH for 26-28ms;
Bit data "1" signal: the level is LOW for 50ms and HIGH for 70ms;
After the SDA of AM2302 outputted the 40 bits of data, it remains LOW level for 50ms, and then switches to INPUT state and goes HIGH as the effect of the pull-up resistor. At the same time, the AM2302 internally re-tests the environmental temperature and humidity and records the relative data. When finished, the MCU will enter the Sleep mode automatically. Only when the MCU receives the new start signal from the host, the sensor will wake up and enter the working state.
A photoresistor (also known as a Photocell, or light-dependent resistor, LDR, or photo-conductive cell) is a passive component that decreases resistance with respect to receiving luminosity (light) on the component's sensitive surface. The resistance of a photoresistor decreases with increase in incident l intensity; in other words,
it exhibits photoconductivity. A photoresistor can be applied in light-sensitive detector circuits and light-activated and dark-activated switching circuits acting as a resistance semiconductor. In the dark, a photoresistor can have a resistance as high as several megaohms (MΩ), while in the light, a photoresistor can have a resistance as low as a few hundred ohms.
If incident light on a photoresistor exceeds a certain frequency, photons absorbed by the semiconductor give bound electrons enough energy to jump into the conduction band. The resulting free electrons (and their hole partners) conduct electricity, thereby lowering resistance. The resistance range and sensitivity of a photoresistor can substantially differ among dissimilar devices. Moreover, unique photoresistors may react substantially differently to photons within certain wavelength bands.
A photoelectric device can be either intrinsic or extrinsic. An intrinsic semiconductor has its own charge carriers and is not an efficient semiconductor, for example, silicon. In intrinsic devices, the only available electrons are in the valence band, and hence the photon must have enough energy to excite the electron across the entire bandgap. Extrinsic devices have impurities, also called dopants, added whose ground state energy is closer to the conduction band; since the electrons do not have as far to jump, lower energy photons (that is, longer wavelengths and lower frequencies) are sufficient to trigger the device.
If a sample of silicon has some of its atoms replaced by phosphorus atoms (impurities), there will be extra electrons available for conduction. This is an example of an extrinsic semiconductor.
Design considerations
Three photoresistors with scale in mm
Large CdS Photocell from a street light.
A photoresistor is less light-sensitive than a photodiode or a phototransistor. The latter two components are true semiconductor devices, while a photoresistor is a passive component that does not have a PN-junction. The photoresistivity of any photoresistor may vary widely depending on ambient temperature, making them unsuitable for applications requiring precise measurement of or sensitivity to light photons.
Photoresistors also exhibit a certain degree of latency between exposure to light and the subsequent decrease in resistance, usually around 10 milliseconds. The lag time when going from lit to dark environments is even greater, often as long as one second. This property makes them unsuitable for sensing rapidly flashing lights, but is sometimes used to smooth the response of audio signal compression.
Applications
The internal components of a photoelectric control for a typical American streetlight. The photoresistor is facing rightwards and controls whether current flows through the heater which opens the main power contacts. At night, the heater cools, closing the power contacts, energizing the street light.
Photoresistors come in many types. Inexpensive cadmium sulfide (CdS) cells can be found in many consumer items such as camera light meters, clock radios, alarm devices (as the detector for a light beam), nightlights, outdoor clocks, solar street lamps, and solar road studs, etc.
Photoresistors can be placed in streetlights to control when the light is on. Ambient light falling on the photoresistor causes the streetlight to turn off. Thus energy is saved by ensuring the light is only on during hours of darkness.
Photoresistors or LDRs are also used in laser-based security systems to detect the change in the light intensity when a person/object passes through the laser beam.
They are also used in some dynamic compressors together with a small incandescent or neon lamp, or light-emitting diode to control gain reduction. A common usage of this application can be found in many guitar amplifiers that incorporate an onboard tremolo effect, as the oscillating light patterns control the level of signal running through the amplifier circuit.
The use of CdS and CdSe photoresistors is severely restricted in Europe due to the RoHS ban on cadmium.
Lead sulfide (PbS) and indium antimonide (InSb) LDRs (light-dependent resistors) are used for the mid-infrared spectral region. Ge:Cu photoconductors are among the best far-infrared detectors available, and are used for infrared astronomy and infrared spectroscopy.
Home automation or domotics is building automation for a home, called a smart home or smart house. A home automation system will monitor and/or control home attributes such as lighting, climate, entertainment systems, and appliances. It may also include home security such as access control and alarm systems. When connected with the Internet, home devices are an important constituent of the Internet of Things ("IoT").
A home automation system typically connects controlled devices to a central smart home hub (sometimes called a "gateway"). The user interface for control of the system uses either wall-mounted terminals, tablet or desktop computers, a mobile phone application, or a Web interface that may also be accessible off-site through the Internet.
While there are many competing vendors, there are increasing efforts towards open source systems. However, there are issues with the current state of home automation including a lack of standardized security measures and deprecation of older devices without backwards compatibility.
Home automation has high potential for sharing data between family members or trusted individuals for personal security and could lead to energy saving measures with a positive environmental impact in the future.
Ldr and DHT22 Home-Automation
- Comments(0)
- Likes(1)
- Engineer Apr 18,2022
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Sreeram.zeno
- Esp12-F Cluster V1.0 The ESP8266 is a low-cost Wi-Fi microchip, with built-in TCP/IP networking software, and microcontro...
- TB6612FNG Motor Driver The TB6612FNG Motor Driver can control up to two DC motors at a constant current of 1.2A (3.2A peak)...
- Sunny Buddy Solar Charger v1.0 This is the Sunny Buddy, a maximum power point tracking (MPPT) solar charger for single-cell LiPo ba...
- Diy 74HC4051 8 Channel Mux Breakout Pcb The 74HC4051; 74HCT4051 is a single-pole octal-throw analog switch (SP8T) suitable for use in analog...
- Diy RFM97CW Breakout Pcb IntroductionLoRa? (standing for Long Range) is a LPWAN technology, characterized by a long range ass...
- ProMicro-RP2040 Pcb The RP2040 is a 32-bit dual ARM Cortex-M0+ microcontroller integrated circuit by Raspberry Pi Founda...
- Serial Basic CH340G Pcb A USB adapter is a type of protocol converter that is used for converting USB data signals to and fr...
- Mp3 Shield For Arduino Hardware OverviewThe centerpiece of the MP3 Player Shield is a VS1053B Audio Codec IC. The VS1053B i...
- MRK CAN Shield Arduino The CAN-BUS Shield provides your Arduino or Redboard with CAN-BUS capabilities and allows you to hac...
- AVR ISP Programmer AVR is a family of microcontrollers developed since 1996 by Atmel, acquired by Microchip Technology ...
- Diy Arduino mega Pcb The Arduino Mega 2560 is a microcontroller board based on the ATmega2560. It has 54 digital input/ou...
- Max3232 Breakout Board MAX3232 IC is extensively used for serial communication in between Microcontroller and a computer fo...
- Line Follower Pcb The Line Follower Array is a long board consisting of eight IR sensors that have been configured to ...
- HMC6343 Accelerometer Module The HMC6343 is a solid-state compass module with tilt compensation from Honeywell. The HMC6343 has t...
- RTK2 GPS Module For Arduino USBThe USB C connector makes it easy to connect the ZED-F9P to u-center for configuration and quick ...
- Arduino Explora Pcb The Arduino Esplora is a microcontroller board derived from the Arduino Leonardo. The Esplora differ...
- Diy Stepper Motor Easy Driver A motor controller is a device or group of devices that can coordinate in a predetermined manner the...
- Diy Arduino Pro Mini The Arduino Pro Mini is a microcontroller board based on the ATmega168 . It has 14 digital input/out...
-
-
Helium IoT Network Sensor Development board | H2S-Dev V1.2
97 0 0 -
-
-
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
178 1 1