Capacitive Touch Sensor with Arduino use as a Toggle Switch

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ค. 2024
  • In this small project, I have demonstrated, How you can use a capacitive touch sensor with an Arduino to make a toggle touch switch.
    For more details and code you can visit the project page link at circuitmagic.com
    Project Page link: coming soon
    I have used:
    1. Arduino UNO
    2. TTP22301 Touch Sensor
    3. Jumper Wires
    4. LED
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 17

  • @adambeedle
    @adambeedle 2 ปีที่แล้ว +2

    Nice work!

  • @MrAzalali
    @MrAzalali 2 ปีที่แล้ว +1

    جميل جدا احسنتم العمل

  • @MrAzalali
    @MrAzalali 2 ปีที่แล้ว

    NICE

  • @talokareng489
    @talokareng489 2 ปีที่แล้ว

    Good

  • @vijaysutagatti6772
    @vijaysutagatti6772 ปีที่แล้ว +1

    Please share the code link

  • @hitesh4339
    @hitesh4339 2 ปีที่แล้ว

    Where is the code link plz share

  • @nongvillanueva2921
    @nongvillanueva2921 2 ปีที่แล้ว

    Hi ! what are the components used to make a portatree

  • @amarjyoth
    @amarjyoth หลายเดือนก่อน

    It work in nano

  • @vijaysutagatti6772
    @vijaysutagatti6772 ปีที่แล้ว

    Code link plz

  • @lint2023
    @lint2023 2 ปีที่แล้ว

    Please add project page link.

    • @Circuitmagic
      @Circuitmagic  2 ปีที่แล้ว

      tomorrow I will add the link

  • @realitybro7
    @realitybro7 3 หลายเดือนก่อน

    Here is the code --
    int LEDState = 0;
    int touchInput = 2;
    int inputState;
    int lastInputState = 1;
    int LEDPin = 13; // Define the LED pin
    void setup() {
    Serial.begin(9600);
    pinMode(LEDPin, OUTPUT);
    pinMode(touchInput, INPUT);
    }
    void loop() {
    inputState = digitalRead(touchInput);
    if (lastInputState == 0 && inputState == 1) {
    if (LEDState == 0) {
    digitalWrite(LEDPin, HIGH);
    LEDState = 1;
    Serial.println("Touch detected. LED turned ON.");
    } else {
    digitalWrite(LEDPin, LOW);
    LEDState = 0;
    Serial.println("Touch detected. LED turned OFF.");
    }
    }
    lastInputState = inputState;
    delay(100); // Adjust the delay as needed
    }

  • @chennairobotist
    @chennairobotist ปีที่แล้ว

    I dont think your code is right.. lastprevioustate=0

  • @haziqhazizul8604
    @haziqhazizul8604 ปีที่แล้ว

    Where is the coding

  • @raalab737
    @raalab737 ปีที่แล้ว

    what the fuck?
    where is coding??????