CAPACITIVE TOUCH SENSOR w/ DEBOUNCE - Arduino tutorial #28

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024

Комментарии • 55

  • @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!

  • @papendudas3834
    @papendudas3834 Месяц назад

    Thank You so much @BasonTech for the debounce code and the wonderful explanation.

    • @BasonTech
      @BasonTech  Месяц назад

      Great I could help! Have fun with your projects! 😃

  • @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

  • @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! 👍🏻

  • @Fasmaee
    @Fasmaee 9 месяцев назад

    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  8 месяцев назад

      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 😃

  • @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 :)

  • @markolengyel6254
    @markolengyel6254 Год назад

    Awesome, thank you.

    • @BasonTech
      @BasonTech  Год назад

      Thanks! My pleasure! 😃

  • @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.

  • @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: ruclips.net/video/unXU5m7EqaU/видео.html

  • @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?

  • @yusufyusuf7919
    @yusufyusuf7919 4 года назад

    Thanks man this helped

    • @BasonTech
      @BasonTech  4 года назад

      Glad I could help! 😃

  • @toritoxx129
    @toritoxx129 4 года назад +1

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

    • @BasonTech
      @BasonTech  4 года назад

      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 4 года назад

      Ok, thanks. This was really helpful

    • @BasonTech
      @BasonTech  4 года назад

      Great! Glad I could help 😃

  • @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.

  • @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.

  • @Shri-yf7yc
    @Shri-yf7yc 10 месяцев назад

    Can you list the components used

    • @BasonTech
      @BasonTech  10 месяцев назад

      It's listed in the video description 😃

  • @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.

  • @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

  • @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.

  • @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

  • @user-cb9tf8ll6s
    @user-cb9tf8ll6s 4 года назад

    What is that touch sensor's model name?

    • @BasonTech
      @BasonTech  4 года назад

      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 4 года назад

      @@BasonTech Oh thank you~

  • @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 😃