CAPACITIVE TOUCH SENSOR w/ DEBOUNCE - Arduino tutorial #28

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 พ.ค. 2024
  • You can use a touch sensor for the same purpose as a tactile switch. The big difference between these is the touch sensor not having any moving parts. Arduino code arduino-tutorials.net/
    Another difference is the touch sensor being able to sense touch through thin non-conductive materials like paper of plastic.
    The Arduino for beginners tutorials series guides you through the world of Arduino. A video is around 10 minutes and shows you step-by-step how to build the circuit and write the code. The website contains the course material, circuit diagram, Arduino code and shopping list of all the components used in the tutorial.
    ⬇️ Arduino code, circuit diagram and part list arduino-tutorials.net/tutoria...
    👉 More tutorials and projects on arduino-tutorials.net
    🇳🇱 Deze tutorial is ook in het Nederlands beschikbaar • 🇳🇱 AANRAAK SENSOR - Ar...
    CHAPTERS:
    00:00 Introduction
    00:17 Components
    00:35 Building the circuit
    01:14 Arduino code - LED
    03:00 Arduino code - Debounce
    06:16 Conclusion
    COMPONENTS
    🇳🇱 Arduino Uno (clone) - Opencircuit
    arduino-tutorials.net/r/8237Hd
    🇨🇳 Arduino Uno (clone) with cable - AliExpress
    arduino-tutorials.net/r/Jd28hF
    🇳🇱 Arduino Uno SMD (original) - Opencircuit
    arduino-tutorials.net/r/Ud29dh
    🇳🇱 Arduino Uno Chip (original) - Opencircuit
    arduino-tutorials.net/r/Jd82ha
    🇨🇳 Jumper wire assortment (MM/MF/FF) - AliExpress
    arduino-tutorials.net/r/Fh378fg
    🇨🇳 Jumper wire male-female - AliExpress
    arduino-tutorials.net/r/sjf83h
    🇳🇱 Jumper wire male-female - Opencircuit
    arduino-tutorials.net/r/a7DH2g
    🇨🇳 Touch sensor - AliExpress
    arduino-tutorials.net/r/FJ8hgh
    🇳🇱 Touch sensor - Opencircuit
    arduino-tutorials.net/r/34Fj92
    #arduino #BasOnTech

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

  • @BasonTech
    @BasonTech  4 ปีที่แล้ว

    👉 Don't forget to check arduino-tutorials.net for more Arduino tutorials and projects.
    If you have questions, don't hesitate to ask them in de comments. Remember: There are no stupid questions 😃
    🔔 Want to stay up-to-date with the latest videos? Subscribe to the Bas on Tech channel!

  • @First.Last.99
    @First.Last.99 2 ปีที่แล้ว

    Amazing tutorial :) thank you a lot. Have 20 these similar touch sensors will do a work clock for me with pause :)

  • @yusufyusuf7919
    @yusufyusuf7919 3 ปีที่แล้ว

    Thanks man this helped

    • @BasonTech
      @BasonTech  3 ปีที่แล้ว

      Glad I could help! 😃

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

    Awesome, thank you.

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

      Thanks! My pleasure! 😃

  • @LuisLopez-cv5ew
    @LuisLopez-cv5ew 3 ปีที่แล้ว

    Thanks for sharing that nice example also the sensor alone can made the same and soldering pin 4, 5, 6 of the CMOs together acts as a toggle switch.

    • @BasonTech
      @BasonTech  3 ปีที่แล้ว

      Hi Luis, thanks for sharing! 👍🏻

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

    I have watched so many tutorials on Arduino but no one has ever talked about millis() function. I always wanted to use the concept of debounce in my project but I didn't know how to. Thank you so much for the help.

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

      Great to hear! This tutorial of mine also uses millis() so might be useful to check as well 😃 arduino-tutorials.net/tutorial/long-press-button-on-the-arduino-with-millis

  • @stephen285
    @stephen285 3 ปีที่แล้ว

    thnks for the vid ---- can they detect velocity, how hard you are touching?

    • @BasonTech
      @BasonTech  3 ปีที่แล้ว

      Not really, this is a digital sensor, not analog. You can of course detect how long it was pressed.

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

    Hi there,
    i have a question. I guess you know the game Tablesoccer. I am a professional player and it can get hard with speeds up to 80 km/h to recognize if the ball went into the goal or not. Sometimes it bounces out right away and it looks as if the goalie blocked the ball although it was a goal.
    This is a problem in tournaments.
    My thoughts were, if it is possible to have a soft sensor-mat which you can glue to the walls inside the goal.
    Do you think this would be possible in a way, that it is extremely accurate?
    Thank you :-)

    • @BasonTech
      @BasonTech  3 ปีที่แล้ว

      Hi, I don't think this is the best sensor to use. Speeds of 80 km/h will completely destroy the device, and besides it is a captive sensor so it does not work on a ball. My suggestion would be to use a laser on the goal boundary. I've found this video of people who already made such a system: th-cam.com/video/unXU5m7EqaU/w-d-xo.html

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

    Hi there! Can You attache this zensor to a glove .. so,when i press with the glove . I will like to show me o a screen the force with witch i press mesured in kilograms
    You think that could be posibile ?

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

      That would be a bit too much to ask of this basic sensor. I can't think of another sensor which can achieve this.

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

    can the sensor be activated by anything? (like you gat a pen or a toothpick, will it turn on?)

    • @BasonTech
      @BasonTech  3 ปีที่แล้ว

      Unfortunately not, this sensor is capacitive which means it needs to be touched by conductive materials which allow current to flow through like our finger.

    • @toritoxx129
      @toritoxx129 3 ปีที่แล้ว

      Ok, thanks. This was really helpful

    • @BasonTech
      @BasonTech  3 ปีที่แล้ว

      Great! Glad I could help 😃

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

    Any way I can wire up one of these to act as a PC power button?

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

      Sure! You'll then need a relay to switch the PC power. This relay is switched by the touch sensor.

  • @ahmedfayez4596
    @ahmedfayez4596 3 ปีที่แล้ว

    Hello Sir,
    I have this sensor and i need some help please. I need to control two LEDs with this sensor. 1 touch turn on or off LED1, while double touch turn on or off LED2. how can I do it?

    • @BasonTech
      @BasonTech  3 ปีที่แล้ว

      Hi Ahmed, what have you tried already and what issue did you ran into?

    • @ahmedfayez4596
      @ahmedfayez4596 3 ปีที่แล้ว

      @@BasonTech
      Acutally I didnt even try because i dont know how am going to write the code. If you can make a video it would be great
      Thanks for replying

    • @BasonTech
      @BasonTech  3 ปีที่แล้ว

      The videos are already there 😃 I've made tutorials on LED, long press and the touch sensor. Combine these and you should have what you want.

    • @ahmedfayez4596
      @ahmedfayez4596 3 ปีที่แล้ว

      @@BasonTech
      I watched the video and its really helpful but still i cant program double touch and single touch.
      What i want to do is, single touch turn on or off led1, double touch turn on or off led2, then long touch to turn on or off led1 and led2

    • @BasonTech
      @BasonTech  3 ปีที่แล้ว

      This is still the same as the longpress video with an extra state. You need to measure the time between taps to determine if it single, double or longpress.

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

    Hi, not sure why, i have included the simple code in IDE, yet when i compile it it gives me error codes
    This is the code, which i think is identical to yours. What am I missing?
    void setup()
    {
    // put your setup code here, to run once:
    pinMode(5, INPUT);
    pinMode(LED_BUILTIN, OUTPUT);
    digitalWrite(LED_BUILTIN; LOW);
    }
    void loop()
    {
    if(digitalRead(5) == HIGH)
    {
    digitalWrite(LED_BUILTIN, HIGH);
    } else {
    digitalWrite(LED_BUILTIN, LOW);
    }
    delay (100);
    }

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

      The compiler is right, there is a small typo in the code. Look very careful for all commas, semicolons etc. I am sure you can spot the typo 😃

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

    How would you use this on an added LED

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

      Sorry I don't understand your question. Add a LED to?

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

    5:50 so that means if you hold touching led will blink?

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

      It will not since the if is not triggered when the sensor is LOW.

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

    is there a touchless sensor ? am trying to find it

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

      Not that I know. There might be a sensor which can detect a certain resistance when something approaches the sensor. Maybe you can do something with a LDR or PIR?

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

      @@BasonTech thanks for your fast answer

  • @Shri-yf7yc
    @Shri-yf7yc 6 หลายเดือนก่อน

    Can you list the components used

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

      It's listed in the video description 😃

  • @user-cb9tf8ll6s
    @user-cb9tf8ll6s 3 ปีที่แล้ว

    What is that touch sensor's model name?

    • @BasonTech
      @BasonTech  3 ปีที่แล้ว

      Hi, in the description of the video you'll find all the parts used in the tutorials. The sensor is this one: arduino-tutorials.net/r/0cVKLS 😃

    • @user-cb9tf8ll6s
      @user-cb9tf8ll6s 3 ปีที่แล้ว

      @@BasonTech Oh thank you~

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

    Why my sensor LED turn red instead of green?

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

      As far as I can see there is only 1 LED on the PCB. Therefore I guess the manufacturer used a red LED instead of a green one.

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

      @@BasonTech Its green sir, mine is red. lately i just know that i burnt my sensor by plugging it onto 5V Pin.

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

      Interesting according to the specs it should be able to operate between 2V and 5.5V

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

      @@BasonTech In my opinion its better to use the 3.3V before continuing to higher volt like 5V etc to prevent burnt the sensor

  • @mohammedahzan7685
    @mohammedahzan7685 3 ปีที่แล้ว

    WHAT IS THE USE OF THIS SENSOR

    • @BasonTech
      @BasonTech  3 ปีที่แล้ว

      for example: you can use it a a button without having moving parts

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

    Where is the code?

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

      I cant find it on the website

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

      On the bottom of arduino-tutorials.net/tutorial/reading-touch-sensor-with-arduino you see a link to Github 😃