Go Down

Topic: Converting HC-SR04 output to Volage (Read 127 times) previous topic - next topic

dkmar

Hi All,

I am working with a HC-SR04 and Arduino. I am getting the sensor to work correctly and its creating an out put on the serial monitor but now I am trying to convert these cause to appropriate voltage values. I have no idea how to do this and I don't have much experience with this type of stuff. Could someone please give me some advice on how to do this?

The values given from the sensor on to the serial monitor are for example:

3cm
5cm
10cm
50cm
30cm
10cm
...

Any advice would be appreciated greatly.

TomGeorge

Hi,
What arduino are you using?

Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

UKHeliBob

Using the map() function you could turn the distances into a number between 0 and 255 and output a PWM signal or print the converted value.
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Go Up