HC-SR04

Any bugs you encounter with Flowcode should be discussed here.
jgu1
Posts: 615
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 507 times
Been thanked: 132 times

Re: HC-SR04

Post by jgu1 »

well, well, ok I understand, I am stupid, :lol: :lol: FC has seen the new one as an old or different when I update, I suppose, so sorry Martin ;)

ELECTRONICA67
Posts: 83
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Re: HC-SR04

Post by ELECTRONICA67 »

Hi Martin,

An apology Martin, yesterday I was not able to do the tests, now I downloaded the component and saved it in Flowcode10, components, HC_SR04_Ultrasonic.fcpx, I opened Flowcode 10 and the program, and did the tests with both sensors, but they gave me the same data ( not correct) use a PIC16F887.

I will send you a photograph of the reading and the real distance.

Best Regards
Enrique
Attachments
physically measured HC-SR04 WATERPROOF
physically measured HC-SR04 WATERPROOF
Waterproof.jpg (51.86 KiB) Viewed 1083 times
physically measured HC-SR04
physically measured HC-SR04
Sensor clasic.jpg (51.95 KiB) Viewed 1083 times
Reading of 2 sensores same distance
Reading of 2 sensores same distance
Lectura.jpg (33.94 KiB) Viewed 1083 times

ELECTRONICA67
Posts: 83
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Re: HC-SR04

Post by ELECTRONICA67 »

I just uploaded a post, could you publish the post to continue with the topic, my username is electron67, my email is <removed by admin> I have published more than 310 posts from the Flowcode 3 forum. In the Flowcode 10 forum not It let me continue with my username, could you fix that detail ?

Enrique (electron67)
Thanks

medelec35
Matrix Staff
Posts: 1452
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: HC-SR04

Post by medelec35 »

Hi Enrique.
I will send an email to the appropriate member of staff and see if it can be done or not.
As for distance, do you have a logic analyser or a scope?
If you do, can you measure the pulse width on the echo pin and let me know what the duration of the width is and the distance reading you are expecting?

I have removed your email address so you don't get unwanted spam.
Martin

ELECTRONICA67
Posts: 83
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Flowcode v10 Re: HC-SR04

Post by ELECTRONICA67 »

Hi Martin,

I only have basic equipment, sources, multimeter and material (I am well stocked) but I do not have an oscilloscope or analyzers :cry: . Can I help in any other way ? :?:

Thank You
Enrique

medelec35
Matrix Staff
Posts: 1452
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: HC-SR04

Post by medelec35 »

The HC-SR04 update is now available via updates.
This is a great low-cost analyser. It can analyse I2C SPI UART , one wire and loads of other protocols.
https://www.amazon.co.uk/gp/product/B08 ... XLJG&psc=1
Martin

ELECTRONICA67
Posts: 83
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Re: HC-SR04

Post by ELECTRONICA67 »

Hi Martin,

I hope this information helps in some way; The program to download the new HC-SR04 component has just finished, the sensor did not work in port C, but in port B it did work, but it delivered the same erroneous data; but if you multiply the reading delivered by the sensor by 1.65 it approaches the correct distance 55x1.65=90.75 (correct distance 90 cm) with an acurrence of 1 cm. The other reading was 30 cm; 30x1.65=49.5 (correct distance 50 cm) another reading further away is 156 cm; 156x1.65=257.4 (correct distance 257) I send a photograph of the data taken.
Theoretically you would lengthen the measurement distance more.

What opinion do you have or what could be the solution :?:

Enrique
Attachments
farthest
farthest
lecNEW.jpg (40.87 KiB) Viewed 1043 times

ELECTRONICA67
Posts: 83
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Re: HC-SR04

Post by ELECTRONICA67 »

Logic Analyzer 24MHz 8CH with USB Cable for Arduino ARM FPGA M100 SCM
https://www.amazon.co.uk/gp/product/B08 ... XLJG&psc=1

I just ordered it on AMAZON MEXICO for USA $12 Dlls. Thanks just need to learn how to use it :D

Enrique

medelec35
Matrix Staff
Posts: 1452
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: HC-SR04

Post by medelec35 »

To be honest it's the best analyser I have used.
Not only is it easy but you have live mode for constant monitoring.
I use it a lot for decoding UART, I2C and SPI.
I will PM you a link for the drivers and software as it has a demo mode when no hardware attached.
I can help you with using it of course. :)
Edit: Link pm'd
Martin

chipfryer27
Valued Contributor
Posts: 1149
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 286 times
Been thanked: 412 times

Re: HC-SR04

Post by chipfryer27 »

Hi

Download PulseView (free) and you will probably find that the option for using "Salea" analysers is compatible. PulseView is pretty easy to use being quite intuitive.

Do note that 99% of problems with these modules are related to the supplied USB lead. Probably best to bin it and use a known good one.

Regards

Post Reply