HC-SR04 sensor reads 0 forever after changing boards

Hi everyone I am new to this forum,

I am working on a school project for a collision prevention system using an ultrasonic range sensor (HC-SR04). It works perfectly with a buzzer(5V Piezo) and led lights on Arduino UNO.
Link: https://www.hackster.io/Vijendra/arduino-based-collision-detection-warning-system-d1beec

I want to integrate this to the Tinyzero processor (ASM2021) with a proto board (ASD2009) as TinyDuino is somewhat the same as the UNO. The problem is the HC-SR04 stopped working entirely after connecting loosely on the proto board using male-to-male jumper wires. The buzzer and led lights works fine, but the reading from the HC-SR04 sensor is 0 on the serial monitor. It does not read anymore using the UNO board.

Integrating to TinyCircuits
(TinyZero - ASM2021):

(Proto board- ASD2009):

I checked the pins/ connections and tried resetting the HC-SR04 using GND and VCC but to no avail.
Link: https://forum.arduino.cc/index.php?topic=216079.0

Reasons I can think of that causes the sensor to malfunction is the voltage difference between the boards, or the codes for UNO cannot be used directly on TinyZero.

I am really new with building tinycircuits and arduino, so please type in simple terms.
Really grateful if there is any suggestions for a fix.

  • A lost soul

What is the voltage supplied to the HC-SR04 Vcc with the TinyZero board?

Hi there,

The proto board has a 5V port which I connected to the HC-SR04 sensor.

The TinyZero processor has a 2.7V to 5.5V operating voltage with built in 3.3V regulator.

Reasons I can think of that causes the sensor to malfunction is the voltage difference between the boards, or the codes for UNO cannot be used directly on TinyZero.

The proto board has a 5V port which I connected to the HC-SR04 sensor.

I would be concerned about the 5v tolerance of the input pin reading the echo. With the module powered with 5v, the HIGH level returned from the module, and read using pulseIn(), may damage the TinyZero.

The trigger signal at 3.3v will likely be high enough to trigger the module.

I think you would be best off to use a bidirectional level shifter, or a least a voltage divider, between the TinyZero and the HC-SR04.

Hi there,

Thanks for pointing me to the right direction, I had suspected that the voltage currents had caused the HC-SR04 to malfunction as the Echo pin sends a 5V pulse back to the TinyZero.

At the moment, the TinyZero is still working (have plenty of those), but not the ultrasonic sensor which I found odd.

Is it possible that the imbalanced current cause the signals to be disrupted and the component to hang?
I am not sure if it is possible to salvage my component or if it is dead.

At the moment, the TinyZero is still working (have plenty of those), but not the ultrasonic sensor which I found odd.
Is it possible that the imbalanced current cause the signals to be disrupted and the component to hang?
I am not sure if it is possible to salvage my component or if it is dead.

I have no direct experience, and I agree with you that the harmful impact should have been on the Tiny Zero.

You are probably going to need a scope to explore what is going on with the sensor, particularly if it does not work in a 5v environment any longer.