Do you like my hacking? If so, please consider leaving something in the
Fediverse (Mastodon etc): @Sprite_tm@social. spritesmods.com
So, does it work? See for yourself:
As you can see, the homebrew sensor works fairly well. It seems to have a bit of a problem when I ground myself a bit differently, for example when I'm touching a radiator with my feet, but that may just be because the SVM isn't trained on that kind of data. I haven't tested it with the other scenarios the Disney people used it on (pinch sensor, water-based, table sensor, ...) but I'm fairly sure it ought to work OK there too. My sensor does return less data points than theirs, so it may be a tad less accurate... this can be improved by using a faster processor. Even the ATMega88 used here may be able to do better: I forego half the frequencies the PWM-module can spit out because the duty cycle at these frequencies isn't 50%. Even more improvement can be gained by using e.g. an ATTiny84, which has a PLL allowing the PWM-module to run at 64MHz instead of the 20MHz used here.
Some more improvement may be gotten from taking a hard look at the envelope detector: this one is chosen for low part count, and the resistor and capacitor values are calculated using back-of-the-envelope guesstimates. I think the sampling frequency can be a bit higher with some fiddling with part values here. All in all, for a project done in the span of an evening, I'm fairly happy with the results.
As usual, all the software I've used is licensed under the GPLv3. Grab it here.
14 commentsTol: No, I would say that you are the one who doesn't get it. The graph has a few curves for just a few discrete touches. If I would touch the thing in a similar way but in a different place, or if the humidity is slightly different, or if my fingers are somewhat wetter or..., the graph changes. The SVM is trained on a lot of samples, and the thing it does is take out the features that are unique to one way of touching: while the graph of touching the thing with your pinky and your middle finger may be different, the SVM 'knows' what to look for that actively distinguishes that touch from the other methods of touching it.
I saw your code, this is absolutely far from the original intention. Your graph shows the exact same respond for any frequency, so whats the point having all of them? any div point from your graph could represent the whole system. Moreover, you wait 40ms between swaps, this is why you get it all wrong. Each frequency(or div) should had give you a different respond for a different touch. You just get a flat respond for all f. So bottom line you did not show anything new (Arduino website already done the same, since you also dont have a real vector here). Disappointing .
The video doesn't embed for me. It's available at https://www.youtube.com/watch?v=Y9VPMiHnHFo
Two improvements. The detector could be replaced by a direct conversion stage (synchronous rectifier/detector), more frequencies can be output at once by clever PWM-waveforms. Then one can extract each one by clocking the synchronous detector with the one we are measuring. This might be simpler than to sweep the frequencies directly.
So cool! Has anyone pushed this project forward in the last couple years?
can this detect different finger placements on a slider?
Great job ! I will add this to News on my site www.CapSwitch.nl
Great! Looking forward that someone replicate this with an arduino!!
Very impressive. I expect Disney spend a few hundred thousand times more money on this than you did and you have 99% of the functionality already!
ooblahman: Sorry, you can\'t use _that_ pin for the PWM output: you need to adjust both the top the timer will count to and the output compare value for the PWM pin and for timer2 on that avr, they both map to the same register.
Hi there, I\'m currently trying to port this to an atMega2560 - and I\'m jiggered as to how to modify the pwmInit function to use PB4/pin 23/arduino pin 10 on the 2560. I\'m not very experienced with timer manipulation, and everywhere I looked uses a different implementation- and some even say that a 3.5mhz pulse isn\'t even possible. I\'d appreciate your feedback!
I can\'t believe you managed this already... I\'m still trying to get my head around the concept! Well done, Buddy.
awesome! congratulations :-)
Forget about the AI. If you show a simple frequency analysis, you must have some latch respond or a strong band pass filter according to the articles, means for one finger a max at 1Mhz and for 2 fingers a max at 2Mhz for instance. Your graph is flat for all frequencies (or maybe this is your AI graph and not a frequency respond)