Arduino UNO-Based Humidity-Controlled Camera Defogging System with DHT11 and OV7670
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to control a defogging system for a camera lens. It uses a DHT11 humidity sensor to monitor humidity levels near the lens. When the humidity surpasses a threshold, a buzzer sounds and a relay is activated to turn on a fan. The camera module (OV7670) captures images which can be viewed using the serial port reader. The circuit is controlled by an Arduino UNO microcontroller.
Component List
120 Fan 12V
- Pins: 12V+, GND
- Description: A 12V fan used for defogging the camera lens.
- Properties: None
Resistor (4700 Ohms)
- Pins: pin1, pin2
- Description: A resistor with a resistance of 4700 Ohms.
- Properties: Resistance: 4700 Ohms
Resistor (200 Ohms)
- Pins: pin1, pin2
- Description: A resistor with a resistance of 200 Ohms.
- Properties: Resistance: 200 Ohms
Arduino UNO
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
- Description: A microcontroller board based on the ATmega328P.
- Properties: None
KY-015 DHT11
- Pins: 5V, S, GND
- Description: A humidity and temperature sensor.
- Properties: None
OV7670
- Pins: RET, PWDN, D1, D0, D3, D2, D4, D5, D6, PLK, XLK, D7, VS, HS, SCL, SDA, 3.3V, DGND
- Description: A camera module for capturing images.
- Properties: None
Resistor (10000 Ohms)
- Pins: pin1, pin2
- Description: A resistor with a resistance of 10000 Ohms.
- Properties: Resistance: 10000 Ohms
12V Battery
- Pins: -, +
- Description: A 12V battery used to power the fan and other components.
- Properties: None
5V Relay
- Pins: Normally Open, Common terminal, Normally Closed, In, GND, VCC
- Description: A relay used to control the fan.
- Properties: None
LM340T5 7805
- Pins: Vout, Vin, GND
- Description: A voltage regulator to convert 12V to 5V.
- Properties: None
Buzzer
- Pins: PIN, GND
- Description: A buzzer used to alert when the humidity surpasses the threshold.
- Properties: None
Wiring Details
120 Fan 12V
- 12V+ connected to 12V Battery +
- GND connected to 12V Battery -
Resistor (4700 Ohms)
- pin1 connected to OV7670 DGND
- pin2 connected to OV7670 XLK
Resistor (200 Ohms)
- pin1 connected to Arduino UNO D11
- pin2 connected to Arduino UNO D11
Arduino UNO
- 3.3V connected to OV7670 3.3V
- 5V connected to KY-015 DHT11 5V
- GND connected to OV7670 DGND, KY-015 DHT11 GND, 5V Relay GND, LM340T5 7805 GND, Resistor (4700 Ohms) pin1, Buzzer GND
- A0 connected to OV7670 D0
- A1 connected to OV7670 D1
- A2 connected to OV7670 D2
- A3 connected to OV7670 D3
- A4 connected to Resistor (10000 Ohms) pin2, OV7670 SDA
- A5 connected to Resistor (10000 Ohms) pin2, OV7670 SCL
- D13 connected to Buzzer PIN
- D12 connected to 5V Relay In
- D8 connected to OV7670 HS
- D7 connected to OV7670 D7
- D6 connected to OV7670 D6
- D5 connected to OV7670 D5
- D4 connected to OV7670 D4
- D3 connected to OV7670 VS
- D2 connected to OV7670 PLK
- D1 connected to KY-015 DHT11 S
KY-015 DHT11
- 5V connected to Arduino UNO 5V
- S connected to Arduino UNO D1
- GND connected to Arduino UNO GND
OV7670
- RET connected to OV7670 PWDN, OV7670 DGND, LM340T5 7805 GND, Resistor (4700 Ohms) pin1, Buzzer GND, 5V Relay GND, Arduino UNO GND
- PWDN connected to OV7670 RET
- D0 connected to Arduino UNO A0
- D1 connected to Arduino UNO A1
- D2 connected to Arduino UNO A2
- D3 connected to Arduino UNO A3
- D4 connected to Arduino UNO D4
- D5 connected to Arduino UNO D5
- D6 connected to Arduino UNO D6
- D7 connected to Arduino UNO D7
- PLK connected to Arduino UNO D2
- XLK connected to Resistor (4700 Ohms) pin2
- VS connected to Arduino UNO D3
- HS connected to Arduino UNO D8
- SCL connected to Resistor (10000 Ohms) pin2, Arduino UNO A5
- SDA connected to Resistor (10000 Ohms) pin2, Arduino UNO A4
- 3.3V connected to Arduino UNO 3.3V
- DGND connected to OV7670 RET
Resistor (10000 Ohms)
- pin1 connected to Resistor (10000 Ohms) pin1, OV7670 3.3V, Arduino UNO 3.3V
- pin2 connected to Arduino UNO A4, OV7670 SDA
- pin2 connected to Arduino UNO A5, OV7670 SCL
12V Battery
- + connected to LM340T5 7805 Vin, 120 Fan 12V 12V+, 5V Relay Normally Open, 5V Relay Common terminal
- - connected to 120 Fan 12V GND
5V Relay
- Normally Open connected to 12V Battery +
- Common terminal connected to 12V Battery +
- Normally Closed not connected
- In connected to Arduino UNO D12
- GND connected to Arduino UNO GND
- VCC connected to LM340T5 7805 Vout
LM340T5 7805
- Vout connected to 5V Relay VCC
- Vin connected to 12V Battery +
- GND connected to OV7670 RET
Buzzer
- PIN connected to Arduino UNO D13
- GND connected to OV7670 RET
Code Documentation
/*
* This Arduino Sketch controls a defogging system for a camera lens.
* It uses a DHT11 humidity sensor to monitor humidity levels near the lens.
* When the humidity surpasses a threshold, a buzzer sounds and a relay is
* activated to turn on a fan. The