1

I was hoping someone could assist me with a project. I have built a device which uses a potentiometer (analog) to control an audio filter (analog). I was looking to use the arduino dual ultrasonic sensor module (HC-SR04) to replace the potentiometer in this circuit to act almost like a proximity sensor; raising the filter cut off when a person gets close to the sensorenter image description here. Do you know anyone who might be able to help in coding this? and also, what needs to be connected to what?? Thank you for any help you can provide. The potentiometer I would like to replace with the sensor is circled in red. I don't use the 'Fine Tune' potentiometer next to this, so please ignore.

closed as too broad by per1234, user31481, MatsK, jose can u c, gre_gor Nov 27 '17 at 20:31

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Welcome to Arduino SE. Please realize that this is not a free design house, homework-answering service or an on-line technical encyclopedia, copied out to you on demand. People will help you take the next step if your question shows that you've done as much as you possibly could on your own - which your post doesn't. Please revise your question showing your work and findings so far. – user31481 Nov 26 '17 at 10:55
  • 1
    The ultrasonic sensors are not very accurate. With a good setup it might work. For example an empty room and the sensors attached to a flat wall. There are also ir distance sensors. Do you really want to use that circuit ? The potentiometer can be replaced by a digital potentiometer. The circuit uses 9V. I don't know if that will be a problem. Some make their own digital potentiometer with a ldr and a light bulb or led. There are also digital equilizer chips. And last but not least, some processors have dsp capabilities. – Jot Nov 26 '17 at 11:02
  • Thank you for that info. Is there any way to gradually increase the voltage, dependant on how close you get to the sensor? I have figured that an optocoupler could be used to convert the voltage to a resistance. It's just a case of coding the output of the sensor to have a gradual increase in voltage- not just a stepped voltage, as this would not have the desired effect. I definitely want to be able to control the filter using some kind of proximity sensor, not to have to rely on light. Thank you very much. – Circle3000 Nov 26 '17 at 11:09
  • With ir distance sensors I ment these: sparkfun.com/products/242 and adafruit.com/product/164 A normal optocoupler is for digital signals, but there are also linear analog opto-couplers. A digital potentiometer can have 256 steps. You will probably not notice those steps. By the way, if you want me to know that you replied, please use @Jot otherwise only the people with the top level questions and answers get notified. Therefor I don't have to use @ Circle3000 for you. – Jot Nov 26 '17 at 21:50
  • @Jot I have purchased the Sharp IR sensor and installed. How do I calibrate it so that the distance that is effected is around the mentioned maximum of 150cm. At the moment the range is only effecting up to 20cm. Thank you for any help you can give. – Circle3000 Dec 7 '17 at 9:29
1

The HCSR04 module is a digital proximity sensor, needing a microcontroller to read values from it. If you really want to use this then you will have to use a microcontroller as a digital to analog converter and map distance values from the HCSR04 to voltages.

However, a better solution would be to use some kind of analog distance sensor. I have used the Sharp IR distance sensors before (with Pololu carrier) and have had great success. This model also comes in a 3V flavor which might simplify your circuit design. You would now only need some analog circuitry to get the voltage values into the correct range.

  • Thank you @Alex Wulff Could you please advise on what kind of component set up could help me get the voltage values in the desired range? This sounds perfect... – Circle3000 Nov 27 '17 at 10:00
  • @Circle3000 a simple voltage divider may be sufficient depending upon your requirements. – Alex Wulff Nov 30 '17 at 1:13
  • I have purchased the Sharp IR sensor and installed. How do I calibrate it so that the distance that is effected is around the mentioned maximum of 150cm. At the moment the range is only effecting up to 20cm. Thank you for any help you can give. Truly very generous of you to lend me your time in this capacity. – Circle3000 Dec 7 '17 at 7:49
  • FYI I have the IR sensor Sharp GP2Y0A60SZLF with 5v carrier. – Circle3000 Dec 7 '17 at 7:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.