हेलो दोस्तों में आज आपको इस ब्लॉग में TTP223 टच सेंसर का इस्तेमाल कर के कैसे एक मजेदार डिम्मर प्रोजेक्ट बना सकते है इसे बना कर बताने वाला हु ,इस प्रोजेक्ट में एक लाइट का प्रकास को कण्ट्रोल करने वाले है जिसमे हम Arduino का उपयोग करने वाले है इसमें हम एक टच सेंसर TTP223 का इस्तेमाल करेंगे जिसे लाइट का प्रकास कम और ज़्यदा होगा इसके लिए आपको इन कम्पोनेनेट की जरुरत होगी
Table of Contents
- Circuit Diagram of Touch Dimmer Switch Circuit
- Components Required for Touch Dimmer Switch Circuit
- Component Description
- How to Design Touch Dimmer Switch Circuit?
- Working of the Touch Dimmer Switch Circuit
- Code
- Applications
- Construction and Output Video
- Related Posts
Circuit Diagram of Touch Dimmer Switch Circuit
circuit diagram |
Breadboard Diagram of Touch Dimmer Switch Circuit
Components Required for Touch Dimmer Switch Circuit
- Arduino UNO
- Touch Sensor TTP223
- IRFZ44 MOSFET
- Led strip
- 12v Power supply
- Breadboard
- Connecting Wires
Code
const int brightnessUp = 10; // the number of the pushbutton pin
const int brightnessDown = 9; // the number of the pushbutton pin
const int ledPin = 11; // the number of the LED pin
const int maxBrightness = 25; //this can be any number - it's the number of steps between dimmest and brightest.
// variables will change:
int brightness = maxBrightness;
int interval=1;
void setup()
{
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pins as an input:
pinMode(brightnessUp, INPUT);
pinMode(brightnessDown, INPUT);
Serial.begin(9600);
}
void loop()
{
if (digitalRead(brightnessUp) == HIGH && brightness < maxBrightness)
{
brightness = brightness + interval;
//if the brightness Up button is pushed, add one degree of brightness to the current level
Serial.println(brightness); //for debugging purposes
}
if (digitalRead(brightnessDown) == HIGH && brightness > 1)
{
brightness = brightness - interval;
//if the brightness Down button is pushed, subtract one degree of brightness from the current level
Serial.println(brightness); //for debugging purposes
}
delay(300);
analogWrite(ledPin, map(brightness, 1, maxBrightness, 1, 255));
//this code maps the max brightness constant to the max LED brightness
}
Thanks I am thinking about this how I connect touch sensor to control led strip
ReplyDelete