Hi, I have a motion sensor, the “Sharp 2Y0A21”, and I would like to connect it to the daisyseed (to then manage a parameter of a patch in plug data). This sensor operates with a voltage of 5V, how do I connect it to a daisy ADC?
I recommend checking out this thread
I linked to a video that shows you how to connect a potentiometer to the Daisy and you can apply the info in that tutorial to that particular distance sensor.
Let us know how it goes ![]()
I missed this answer. The sensor doesn’t provide great feedback because it’s supposed to be powered by 5 volts. I’ve seen other sensors like the RCWL-1601 or the US-100 (from Adafruit) that only require a 3 volt power supply, but I don’t know how to connect them or how to compile the json file to use them in plug data in this case.
I would like to know more about this. For example, what does the sensor value look like when you display it on a serial monitor? Thanks!
It gives me values in a very low range, around 0.2. I was wondering, however, how I should compile the appropriate JSON file for the other types of sensors mentioned above, given that, for example, the RCWL-1601 communicates with I2C.
This IC is not supported in libDaisy and thus also not in json2daisy (the library used in the Heavy Compiler), so I’m not sure how you expect to use this.
Or does it not require I²C as well?
Ah sorry, I misunderstood. If this sensor indeed just gives an analog value then connecting it just like a potentiometer should work!
You can check how the Pod does it as an example: hvcc/hvcc/generators/c2daisy/json2daisy/resources/pod.json at develop · Wasted-Audio/hvcc · GitHub
Yes, but the problem is that it would require 5 volts. That’s why I’m thinking of getting a different sensor.
As dreamer mentioned, configuring the json file like you’re using a potentiometer will work.
Is the max value 0.2? And the value doesn’t change around when you move your hand back and forth in front of the sensor?
When I have nothing in front of the sensor, the values fluctuate around 0.39. When I bring my hand up to 10 cm away, they reach 0.6, but if I get closer, the values drop to 0.44.
Yeah, the range doesn’t seem that big. See how it actually sounds when you map a synth parameter to it (like pitch or filter).
The range I got from an accelerometer wasn’t that wide, but it sounded fine once I started mapping synth parameters to it. You should be able to apply what you see in this video to the distance sensor.