Converting a HC-SRO4 Dstance Measurement into an Analog Output

Hi

I was wondering if anyone could help me. I'm trying to use a HC-SRO4 ultransonic sensor to measure liquid level and use the readings as an analog input into a PLC. Can anyone suggest how I may be able to do this? Im not a programmer so my coding skills are quite basic.

Many thanks

John Q

Hi!

Distance measurement works by computing the time difference between sending and receiving a pulse. Both signals are digital (LOW or HIGH). It is not possible to do this with just reading an analog pin.

It is possible to connect an arduino to the HC-SR04 and convert the distance to a analog value with the arduino. Then this value is send to the plc.

Use an MaxSonar from Maxbotix instead - some (all?) have an analogue output, in addition to serial and PWM outputs.

Hi JackStardust,

I am very interested in what you wrote:

It is possible to connect an arduino to the HC-SR04 and convert the distance to a analog value with the arduino. Then this value is send to the plc.

Can you please help me how to do that?

Best regards

/MaverickRF

This post is very similar.