Proving that duct tape really can do anything, [StudentBuilds] uses it to make a workable controller out of a glove. To be fair, there are a few more bits too, including paper coated with pencil graphite and tin foil, which forms a variable resistor you can read with an Arduino analog input. You can see the entire thing in the video below.
The source code is simple at this point — eventually, he plans to control a robotic hand with the controller, but that’s later. However, there’s no promised link to the code in the description, so you’ll have to freeze frame and type. However, it is pretty simple — just read the analog pin values to determine the specific values for each finger.
There was a slight issue with the build. At first, all the sensors read the maximum (1023). That necessitated changing the fixed resistor to a much higher value. Also, be sure to read the notes on the screen as the original schematic has a small error corrected with a note. One end of the voltage divider needs to go to 5 V. The schematic shows both ends going to ground.
Is this going to be wildly accurate? No. It isn’t even going to be repeatable if you build multiples and the calibration will probably even change with age. Still, it is cool that you can take a few pieces of scrap material and do something with it. Also, the homemade sensor approach might spur your imagination to make other pencil-based sensors.