|
Post by dizzeesatchel on Jul 26, 2022 0:02:02 GMT
Inspired by discussion in the Future module wishlist thread...
I had a Pi Pico and a bunch of random bits & bobs already, so i was looking into LDRs and the like, with the thinking to sketch out a gestural control module. The Sharp Distance sensor was mentioned, which looks interesting, and can possibly be used directly without a microcontroller, but it seems a bit big for ideally a 1U module (could potentially strip the innards from the bulky plastic housing?)
I came across the adafruit VCNL4010 which is super-tiny and seems ready-made to hook up to a Pico. With a bit of trial and error, being fairly inexperienced at both electronics and Python, i was getting readings from the sensor (there's two on this board, proximity and ambient light level, but i focused on the proximity only for now). Sent the readings back out as smoothed PWM and used it to a) light an LED, woooo, b) drive some of the cv inputs on a Roundabout which bravely volunteered to be guinea pig.
modulating clock speed:
modulating speed, pitch, and filter cutoff:
Issues:
i'm not entirely sure i'm doing the RC filter on the PWM correctly, so might be better off using a microcontroller with native analogue out??
the sensor has a really tiny range - only a few cm. I thought this might be good for precise control but it's way too small in practice
the Sharp sensor has a better range, maybe it could be mounted vertically to fit nicely in a standard module space?
I tried transposing the output voltage up from max 3.3 to 5v using a level shifter chip, but reading into the theory more i think what i really need is an op-amp, not a level shifter?
I'm bad at maths, and would like to generate a less linear response curve - ie. movements further from the sensor have a greater impact, and response slows down as you approach the sensor up close - but i can't figure out how to make that happen.
the biggest hurdle of all is that I don't really know what i'm doing, but it's quite fun making something which vaguely works
|
|
pol
Wiki Editors
Posts: 1,349
|
Post by pol on Jul 26, 2022 18:41:17 GMT
Issues:
i'm not entirely sure i'm doing the RC filter on the PWM correctly, so might be better off using a microcontroller with native analogue out??
the sensor has a really tiny range - only a few cm. I thought this might be good for precise control but it's way too small in practice
the Sharp sensor has a better range, maybe it could be mounted vertically to fit nicely in a standard module space?
I tried transposing the output voltage up from max 3.3 to 5v using a level shifter chip, but reading into the theory more i think what i really need is an op-amp, not a level shifter?
I'm bad at maths, and would like to generate a less linear response curve - ie. movements further from the sensor have a greater impact, and response slows down as you approach the sensor up close - but i can't figure out how to make that happen.
the biggest hurdle of all is that I don't really know what i'm doing, but it's quite fun making something which vaguely works First of all, Kudos for just having a go, let alone making soemthing that works! I can't help with any of your electronics problemd as I know so little myself, up to the heady heights of 4 working kits now, The maths bit I may be able to help, you need to multiply the distance by itself to get a logrhythmic (non-linear) curve, you can always divide the whole equation by a number if too big to fit your required area.
|
|
|
Post by pt3r on Jul 27, 2022 7:11:35 GMT
Great work dizzeesatchel If I find the time I will cook up some LDR voltage divider to see how that performs, one thing is for sure that the part count will be significantly less
|
|
|
Post by dizzeesatchel on Jul 27, 2022 10:58:28 GMT
I got a theremin for my birthday recently so I'm all about gestural control at the moment
|
|
|
Post by dizzeesatchel on Aug 6, 2022 10:17:15 GMT
Sharp sensor is much better:
Analogue out means no pico or code required, much simpler! And the range is actually usable this time.
What i'm struggling with now is getting that output voltage up from 3.3 > 5v. I think an op-amp is supposed to be pretty basic stuff but I can't get it right, either i've misunderstood how to wire it or I just have the wrong value resistors because it keeps coming out the other side at about the same voltage (maybe a bit lower) The sensor is a bit smaller than I thought, would probably fit ok even in 1U if you solder directly to the pins rather than using the little JST connector.
Edit: woop, actually I think i've figured out the voltage
|
|
pol
Wiki Editors
Posts: 1,349
|
Post by pol on Aug 6, 2022 12:14:33 GMT
Sharp sensor is much better:
Analogue out means no pico or code required, much simpler! And the range is actually usable this time.
What i'm struggling with now is getting that output voltage up from 3.3 > 5v. I think an op-amp is supposed to be pretty basic stuff but I can't get it right, either i've misunderstood how to wire it or I just have the wrong value resistors because it keeps coming out the other side at about the same voltage (maybe a bit lower) The sensor is a bit smaller than I thought, would probably fit ok even in 1U if you solder directly to the pins rather than using the little JST connector.
Makes me want to play with one!
|
|
|
Post by dizzeesatchel on Aug 6, 2022 15:41:23 GMT
Small improvements - now going up to 5v, added a pot for adjusting the resistance/response, and a push button which kills the signal when released (avoid accidentally causing chaos when you’re just trying to reach another module!) A single straight response is fairly limited though, would be nice to get some LDRs involved to make some varied but related signals. Next steps! Ive progressed to testing it on a Volca - not confident enough to send it to AE just yet, although i’ve never measured more than 5v coming out of it.
|
|
pol
Wiki Editors
Posts: 1,349
|
Post by pol on Aug 8, 2022 20:38:27 GMT
View AttachmentSmall improvements - now going up to 5v, added a pot for adjusting the resistance/response, and a push button which kills the signal when released (avoid accidentally causing chaos when you’re just trying to reach another module!) A single straight response is fairly limited though, would be nice to get some LDRs involved to make some varied but related signals. Next steps! Ive progressed to testing it on a Volca - not confident enough to send it to AE just yet, although i’ve never measured more than 5v coming out of it. Apologies if youy know, but the 4 I/O is designed to make sure more than 5 Volts, or negatiev voltages don't get through to the AE system itself, so you could patch through that and not worry, Pol.
|
|