Home Creators Posts Import Register Favorites Logout

Content

Hi folks,

As we near the end of 2020, we're all back in lockdown again here in the UK and it's pretty unclear what things will look like when we eventually come out of it. The only thing that seems certain is that we can all expect to have to do things a bit differently for at least some time to come.... 

I'm trying to stay positive - while it's been an utterly heartbreaking year for so many people - especially small business owners and creative artists of all kinds - there have been glimmers of hope; for example, I've played some amazing remote/at-home escape room games that would never have been made were it not for the current situation. "Necessity is the mother of invention", after all! 

With that in mind, in this project I thought I'd take a look at some technical innovations for escape rooms in a post-Covid world, and one particular area I thought of was methods to reduce the amount of shared surfaces players touch, by replacing button inputs with "touch-free" alternatives instead. 

So, I've made a mini video series comparing 4 different alternative technologies: Infrared, Ultrasonic, Laser Time-of-Flight, and Capacitive sensors. You can find the playlist here: https://www.youtube.com/watch?v=Y6sGoqSujlQ&list=PLogiUurtMYtSXVFcHRQOWH4Iz2S-UrHoz

And here's a little summary table of some of the key differences:

I chose these particular sensors because they're all very popular and easy to get hold of from your favourite online supplier... e.g.:

FC-51 https://www.banggood.com/custlink/3KGdtHNjdu

HC SR-04 https://www.banggood.com/custlink/vDvdtPQLrg

CAP1188 https://www.banggood.com/custlink/3v3dtHzIyU

VL53L0X https://www.banggood.com/custlink/KvvhHITJAR

There are of course different similar boards based on these same technologies - some of which offer slightly different performance or features, but still broadly conform to the findings in the table above.

I don't think any of these sensors are quite "drop-in replacements" for buttons because, without the tactile sense of your finger touching a surface or hearing a button click, there's no built-in feedback to the player that their input has been detected. With correct calibration, I've found they are all pretty sensitive at detecting  intended input, but there is also an increased risk of additional accidental inputs. 

None of these problems are insurmountable, but it perhaps needs to have a little bit of additional  design work to consider the best way to incorporate them - something as simple as incorporating immediate audio/visual feedback (from a speaker, or LED) when a "no-touch" input is detected would help improve the input loop significantly, and all of the code examples I use demonstrate how to do that by adding whatever additional functionality you want to the inputDetected() or inputRemoved() functions.

Speaking of code, you can find the downloads for all the examples here: https://drive.google.com/drive/folders/1-aUHfJ0XQFbEXmXfRScu4jZvpoZwQORt?usp=sharing

In cases where I've used an external library, I've included that in the /src subfolder of the Arduino project too, so you shouldn't need to do any additional installation of managing libraries from the Arduino IDE - everything you need is included above.

I'd love to hear your comments, or if you've got suggestions for any further "touch-free" input modules that I should test out and add to this list!

Stay safe.

a.

Files

Infrared Obstacle Avoidance Sensor Tutorial for Arduino / ESP32

During the current Coronavirus pandemic we're all being encouraged to reduce the number of shared surfaces that we touch in order to reduce the risk of virus transmission. So, this is the first video in a new series in which I'll be considering various methods that can be used to replace a traditional Arduino button input with a touch-free interface instead, requiring no physical contact. This is just one possible consideration of how you can make an escape room (or any other public-facing Arduino interface) more "Covid-secure". In this first part I'll be looking at an FC-51 "Infrared Obstacle Avoidance Sensor" component, which can be easily purchased online for only a dollar or so. It's a cheap, readily-available module that's easy to wire and code on an Arduino, ESP32, or other Microprocessor, using only a single digital input pin, and it's capable of simulating when a button is pressed, held, or released. You can buy this sensor from, e.g. https://www.banggood.com/custlink/3KGdtHNjdu Timings --- 00:00:00-00:01:03 Introduction 00:01:04-00:06:45 Demonstration 00:06:46-00:07:11 Hardware Wiring 00:07:12-00:16:08 Arduino Code Listing 00:16:09-00:16:58 Summary Code & Wiring Downloads --- If you'd like to support me making more video tutorials explaining how to use tech in escape rooms and other playful settings, please check out my Patreon at https://www.patreon.com/playfultech, where you can also find code downloads, wiring diagrams, and additional resources for this and all my other tech projects.

Comments

Daniel S Vance

I am getting a error. fatal error: src/CAP1188.h: No such file or directory. did you move the library. will the GitHub adafruit work if chang the #include "src/CAP1188.h" statement to #include "Adafruit_CAP1188.h". I see in the comments on YouTube someone said you modified the library any help Thanks

Daniel S Vance

I just tried and it will not work. Other lines of code not define correctly do to the changes you made in the library

Daniel S Vance

I am still having a problem. I got the program to load now. I added a header file. Then copied and pasted the cap1188.h file in to it. then imported the cap1188.cpp. The LEDS do not turn on. If open the serial monitor i get /run/arduino/sketches/TouchFree_Cap1188/TouchFree_Cap1188.inoJan 24 2025 Product ID: 0x50 Manuf. ID: 0x5D Revision: 0x82 CAP1188 not found CAP1188 initialised if touch the pins no lights will change. watching the serial monitor touching c1 to c3 it will put touched and removed, I am using a Arduino uno not a mini like you did, I tried hooking SDA and SCL to A4 and A5 plus tried hooking it to the SDA and SCL pin on the Arduino. could it be that I am using a UNO not a mini?

Greg Pare

Yay! Something easy to implement. Thinking puzzle ideas. Let's say you want to trigger a relay, but only after the reader has been active say for 5 seconds. How/where would you write that?

Simon Robinson

Your timing is perfect. Just 3d printed some mounts and started playing with the ultrasonic sensor. Viewing your video makes me question putting a tone with distance. Greg started with arduinos and programming 3 weeks ago so I am no expert. But you can change a int from say 0 to 1 when the sensor hits the distance you want. Then use a currentmillis routine to cycle till 5 seconds have past, then trigger the relay. Google currentmillis arduino there are lots of examples. You could use a delay statement but it will limit everything you do from there on forward. Also please don’t forget these sensors bounce from what I can see in the video that’s while a change of an int state maybe best rather than reading the same signal for 5 seconds. If doing a constant read and time you would want to use a sensible range to be within.

Remi Grootscholte

Hi Alastair, Thank you for this great example video. I have tried it with my setup with base shield attached and it works. But in the serial monitor it prints 90% "removed" events and in the distance priniting it does not get any better then about 2 or max 3 readings. Even if i hold my hand still in front of the ultrasonic ranger. Do you have any more information on finetuning the reading accurateness. I have tried it with the base example code and there it works fine. But with the inputheld and removed setup it seams to be confused. Really looking for a solution here :)