FT232h plus HC-Sr04

Has anyone managed to get an HC-SR04 working with an FT232H type C version board via PC with python. I am getting mixed results and i think its the timing out so i cant get the requested 10ms sent out correctly. I am assuming i would have to use Arduino for the ultrasonic and request the distance from maybe rs485 connection from the PC. Does that sound my only option if i want to use python on my PC as this is only part of the project which requires my Pc to be the master..?

Slow down.
Tell us what you are doing, what your expectations are and how they differ from what you observe.
Post your code and simple schematics.

Hello xtraaccess

By reading the text some questions arose:

  1. What is python?
  2. What interface type, physicaly, logical and timing constrains characteristic , is used between the unknown Arduino and the mentionend PC?

Have a nice day and enjoy coding in C++.

I am currently using the sparkfun ft232h breakout board connected to my Pc via type C USB, i currently have it working with the Pca9685a I2c servo board controlling pan tilt head camera, i have the HC-SR04 ultrasonic sensor on the pan tilt head which i was hope to control with the digital pins on the sparkfun ft232h breakout board. It controls the sensor fine but due to the sparkfun ft232h breakout board only being a link from Pc to the sensor and no microcontroller i cannot get a reliable 10us delay for the trigger pin. The commands are sent from VS code on the Pc and sent to the sparkfun ft232h breakout board that is connected to the correct pins on the Ultrasonic sensor, if i use an arduino instead its fine but it seems sending the command delay from the Pc to Trig low to Trig High, the transmission down the comport takes varying times and stops me getting a true 10us pulse sent out from the HC-Sr04. The code is the simple std hcsr04 code that everyone uses.

See previous reply.

The trigger pulse length is not (in my experience) critical.

I'd be more worried about the echo pulse timing.

Some line breaks and punctuation maybe, next time?

1 Like

Yes it could turn out to be the return pulse duration timing, but either way it has to be one or the other. I guess my whole question is should i have to use an Arduino Nano for instance and poll for the distance when i need it via 2 x rs485 from Pc to Arduino as relying on the USB transmitting timed commands doesn't seem to be reliable enough.

Yes, absolutely. Or some other MCU, because ECHO pin signal timing is critical.

Ok thanks all, just wanted to confirm i need an MCU to talk to the ultrasonic side of things directly. I will place a Nano in there to sort it out.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.