0
\$\begingroup\$

I am using an Arduino on a breadboard setup with an ATMEGA328p MCU. The whole circuit is designed to work in a low-power state and is powered using a 3V (Nominal) voltage Coin Cell. The HC-SR04 is getting a stable Power Supply of 5V from another source (Grounds are already common). However, the issue is that triggering the sensor from the MCU gives no output reading and the distance is returned as 0. I checked the voltage level on the Trigger Pin and found it to be 2.5-2.6V

Since the battery I am using is a coin cell so I suspect that the voltage is being dropped from the nominal value of 3V to 2.5V and the HC-SR04 demands a TTL pulse on the Trigger Pin. Is it not working because it's not being properly triggered by the 2.5V level Pulse? I checked some resources and they mentioned that 2.5V is within the High Level Margin of the TTL signal, so 2.5V level pulse should be able to trigger the sensor or my assumption is wrong?

\$\endgroup\$
0
\$\begingroup\$

Like most CMOS except 74HCTxx series the input threshold is Vdd/2 +/- 40% over entire temp on some units.

This requires a level shifter.

You can choose many options :

  • an IC to levelshift inverting or not
  • an RC:R pullup network to shift from 1V to 4 V with some T=RC > pulse width using R’s between 100k and 10M to choose ratio for the “0” output level and C to boost the pulse by 3V thus shifted.
  • it depends on you power consumption specs

Added to prove my assumptions

Often many poor Chinese specs and others say TTL input to mean 5V TTL logic compatible, because the null current static CMOS load will increase the signal swing of TTL rated VOh,Vol limits. But 5V CMOS is what they actually have so the input bias threshold is Vdd/2 +/-6.7% nom 25'C upto 40% for -40 to 85'C (NXP)

So I looked for the schematic to confirm my assumptions and found they were valid. enter image description here

\$\endgroup\$
  • \$\begingroup\$ So you believe that the 2.5V voltage signal is not the correct High level for TTL. \$\endgroup\$ – Marry35 Jun 13 '18 at 20:30
  • \$\begingroup\$ The spec says 5V so I infer it is std CMOS logic \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Jun 13 '18 at 20:35
  • \$\begingroup\$ No, the sensor actually works on TTL Logic. \$\endgroup\$ – Marry35 Jun 13 '18 at 20:37
0
\$\begingroup\$

You seem to be sending the pulse signal to the HC-SR04 at acceptable levels for "high" at 2.5V, assuming you have measured that correctly, the range being 2 to 5V. That should have triggered the sensor as desired. Have you tried using a different HC-SR04. I have used this sensor with an ESP8266 running off 3V and it has been working fine. I see that the trigger pulse in my case is about 2.65 or 2.7V. If you haven't checked if this is a problem with the sensor, I would suggest you try checking it out with an HC-SR04 from a different source.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.