Hi, I was testing the hc-sr04 sonic sensor using the example published on wiki, by compiling the program in the Pic and testing the correct operation of the distance detected by the sensor, it gives a fixed reading of distance=504 cm and it does not change.
Can you check it please
Thanks
Enrique
HC-SR04
-
- Posts: 83
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 3:59 pm
- Has thanked: 20 times
- Been thanked: 6 times
-
- Matrix Staff
- Posts: 1452
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 512 times
- Been thanked: 472 times
Re: HC-SR04
Hello Enrique.
I have just tested with an HC-SR04 and it does show distance changes for me.
Could you have a connection issue?
Are you using the BL0011 Eblocks2?
Can you describe what hardware you are using?
I have just tested with an HC-SR04 and it does show distance changes for me.
Could you have a connection issue?
Are you using the BL0011 Eblocks2?
Can you describe what hardware you are using?
Martin
-
- Posts: 83
- Joined: Wed Dec 02, 2020 3:59 pm
- Has thanked: 20 times
- Been thanked: 6 times
Re: HC-SR04
Hello Martin,
I am using the AJ-SR04M model (waterproof), in fact I have this sensor working with a program that you developed in Flowcode 5.
Thanks
Enrique
I am using the AJ-SR04M model (waterproof), in fact I have this sensor working with a program that you developed in Flowcode 5.
Thanks
Enrique
-
- Matrix Staff
- Posts: 1452
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 512 times
- Been thanked: 472 times
Re: HC-SR04
They should be compatible so I'm surprised it's not working
Do you have the link to the post with the Flowcode v5 help, or the v5 project file?
Also, do you have a voltage analyser, A dual scope, or a Matrix Eblock2 upstream board with ghost, e.g. BL0011?
Do you have the link to the post with the Flowcode v5 help, or the v5 project file?
Also, do you have a voltage analyser, A dual scope, or a Matrix Eblock2 upstream board with ghost, e.g. BL0011?
Martin
-
- Posts: 83
- Joined: Wed Dec 02, 2020 3:59 pm
- Has thanked: 20 times
- Been thanked: 6 times
Re: HC-SR04
Hello Martin,
I'm going to buy another sensor, maybe it's damaged and I'll do the test again.
Thanks
Enrique
I'm going to buy another sensor, maybe it's damaged and I'll do the test again.
Thanks
Enrique
-
- Matrix Staff
- Posts: 1452
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 512 times
- Been thanked: 472 times
Re: HC-SR04
Now you have ordered one we could test that when it arrives, so you will know for the future.
Assuming you have any of the above of course.
This might be the topic you were referring to.
Assuming you have any of the above of course.
This might be the topic you were referring to.
Martin
-
- Posts: 83
- Joined: Wed Dec 02, 2020 3:59 pm
- Has thanked: 20 times
- Been thanked: 6 times
-
- Posts: 615
- Joined: Thu Dec 03, 2020 8:25 pm
- Location: Denmark
- Has thanked: 507 times
- Been thanked: 132 times
Re: HC-SR04
Hi Both!
I think the sensor Enriko use is this model: https://www.aliexpress.com/item/1005005 ... ainProduct
@martin. I remember from a previus test that the Trig duration for the HCR04 is 10uS, for the waterproof model it work with duration on 20uS
I have played with both model and if I change the trig duration to 20uS for the waterproof model, and it work, the att, testprogram I think it is yours tesprogram Martin, For loong time ago, when I played with it, I change the device to an Arduino Mega, change the trigtiming to 20uS. Futhermore in this waterproof device is more setting for communication.
Here is a very good explanation here by Droonebot: https://dronebotworkshop.com/waterproof-ultrasonic/
Maybe an idea to update the component for HC-SR04 and inplement more features in the component for more different kind of type in your component so it (as always from you) would be more flexibel
****By the way Martin, have you seen this: viewtopic.php?f=3&t=2091&start=10 at the end *****
Hope it´s ok I interfered
Br jorgen
I think the sensor Enriko use is this model: https://www.aliexpress.com/item/1005005 ... ainProduct
@martin. I remember from a previus test that the Trig duration for the HCR04 is 10uS, for the waterproof model it work with duration on 20uS
I have played with both model and if I change the trig duration to 20uS for the waterproof model, and it work, the att, testprogram I think it is yours tesprogram Martin, For loong time ago, when I played with it, I change the device to an Arduino Mega, change the trigtiming to 20uS. Futhermore in this waterproof device is more setting for communication.
Here is a very good explanation here by Droonebot: https://dronebotworkshop.com/waterproof-ultrasonic/
Maybe an idea to update the component for HC-SR04 and inplement more features in the component for more different kind of type in your component so it (as always from you) would be more flexibel
****By the way Martin, have you seen this: viewtopic.php?f=3&t=2091&start=10 at the end *****
Hope it´s ok I interfered
Br jorgen
- Attachments
-
- Distance Sensor Mega - Temp Compensation_v8_God.fcfx
- (24.71 KiB) Downloaded 48 times
-
- Matrix Staff
- Posts: 1452
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 512 times
- Been thanked: 472 times
Re: HC-SR04
Thank you, Jorgen.
We like it when other forum members have their say on a topic.
With your information, I can modify the HC-SR04 component to work with both types, assuming the waterproof version is not faulty.
It's totally OK as what you have stated is useful information and thank you for the links.
We like it when other forum members have their say on a topic.
With your information, I can modify the HC-SR04 component to work with both types, assuming the waterproof version is not faulty.
Martin
-
- Posts: 615
- Joined: Thu Dec 03, 2020 8:25 pm
- Location: Denmark
- Has thanked: 507 times
- Been thanked: 132 times
Re: HC-SR04
Glad if I can help. Look forward to see if you can modify the component with some option in Properties, let me know if I can do something, tests or so.
****By the way Martin, have you seen this: viewtopic.php?f=3&t=2091&start=10 at the end *****
Br Jorgen
****By the way Martin, have you seen this: viewtopic.php?f=3&t=2091&start=10 at the end *****
Br Jorgen