Driving the HC-SR04 from a digital pin doesn't work. From a thread on avrfreaks, it appears it can draw up to 100 mA peak power, which is more than a digital pin can provide. Soldering a large cap across the VCC and GND pins lets it work when powered continuously, but causes it to return nonsense values when trying to turn it on and off. Need to put in a transistor as a switch.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.