HCSR04 Doesn't work

Discussion on both general simulation and Proteus VSM microcontroller simulation.
Post Reply
Marcus54
Unlicenced User
Posts: 10
Joined: Thu 2023-10-26 16:26

HCSR04 Doesn't work

Post by Marcus54 »

Hello
I'm trying to get the HCSR04 to work.
I send a pulse to the "trig" pin
I notice that the "echo" pin remains grey and no pulse comes out of it!
I don't understand what the problem is.
Thank you
https://i.postimg.cc/90ksXrnn/sr04.png
Release 8.15 SP1 Build 34318
David
Site Admin
Posts: 2263
Joined: Mon 2006-02-20 14:56
Location: Head Office
Contact:

Re: HCSR04 Doesn't work

Post by David »

Hi Marcus,

Please can you attached your project? Thanks.

Regards,
Dave.
Marcus54
Unlicenced User
Posts: 10
Joined: Thu 2023-10-26 16:26

Re: HCSR04 Doesn't work

Post by Marcus54 »

Hi Dave
the file as an attachment
Thank you
telemetreSR04.pdsprj
(34.76 KiB) Downloaded 599 times
Release 8.15 SP1 Build 34318
David
Site Admin
Posts: 2263
Joined: Mon 2006-02-20 14:56
Location: Head Office
Contact:

Re: HCSR04 Doesn't work

Post by David »

Hi Marcus,

Thanks, the issues here are to do the following:

1. Remove and replaced the HCSR04 component. It looks like some of its properties were corrupted.

2. Replace terminal connected to VCC pin of the HCSR04 with the generic power terminal. It doesn't work by some reason if it is connected to a different power rail. Possibly because there are no digital pins on it.

3. Set Horizontal to be 0.2mS.

4. In System - Set Animation Options... remove the tick on the "Show Wire Current With Arrows" option. It disrupts the mixed mode (digital + analog) circuit behaviour, as it is supposed to be used with very basic analog schematics.
HCSR04.png
HCSR04.png (193.95 KiB) Viewed 1013 times
Regards,
Dave.
Ettore
Labcenter Staff
Posts: 2931
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: HCSR04 Doesn't work

Post by Ettore »

I have fixed the HCSR04 model (and SRF04 as well) for such the odd behaviour. The fixed model will be in the next service pack.
Kind regards,
Ettore Arena - Labcenter Electronics.
Marcus54
Unlicenced User
Posts: 10
Joined: Thu 2023-10-26 16:26

Re: HCSR04 Doesn't work

Post by Marcus54 »

Thanks Dave, it works great!
Release 8.15 SP1 Build 34318
Post Reply