Maybe this is a silly question, but…
I am am lost finishing my project for university. I am reading sensors values with arduino and arduino to max and putting those values on makenote. the problem is that these values flicker a lot, therefore I dont have a real constant sound. Is there a way to reduce this flickering? On a worst case scenario I would play only with a tone, where I change pitch and volume, but I didnt foound a way to manipulate volume on cycle~ . Can anyone help me?
1. What type(s) of sensor are you using?
2. What is the interaction modality? Touch, presence, breath, light, magnetic field…?
3. You haven’t posted your patch to let forum members see if the problem lies there.
4. Is the data also erratic in your Arduino sketch?
Posting a forum request that creates more questions is not a good idea; try to give us as much help as possible please.
I am using 2 distance sensors, from sharp. The sensor uses an IR led and a receiver – and calculates the distance between objects with that.
The interaction, therefore, is waving my hand over the sensor.
I cant show the patcher because of rules from university. Wish I could do that. The problem is not with my sensors – it also happens with potentiometers.
Have a look at this patch for methods on smoothing jittery data streams. Which University bans you from sharing your own work in order to benefit from our advice?
this seems to help me a lot! thank you!
helped a bit… one of the methods worked a bit, but it adds some delay. and the data is still flickering a lot, as you can see on the print screen. I saw that there is a average~ object, but I don't know how to connect it just for data. any help?
You are basically filtering the data, like a low-pass in the audio domain which is bound to add some sort of delay. Have a look at [lybl] from CNMAT which is a look-before-you-leap object to ignore jumps if they’re steeper than you desire. I can only suggest experimenting with the methods provided and trying to find one that fits as best you can, there is no perfect solution as sensor data is inherently jumpy.
It looks like you have quite a lot of jitter on that signal. Have you measured it? Have you tried adjusting the parameters that are available with the different filtering methods in that example patch?
Just curious if your circuit is well insulated. If you’re using a solderless breadboard, it could be introducing a fair amount of noise on its own. Have you successfully used this circuit elsewhere? Can you move it to another board? add some small caps to filter out any voltage irregularities?
As Chris mentioned, there’s a lot of noise there, and it’s probably easier to approach it from the source, not in the interpretation.
It’s also worth noting that unused analog inputs on the Arduino should be grounded.
I think it could be a problem with my hardware. I am not using a breadboard any more. I will try to ground the unused inputs, that might help. Thanks for the advice!