Hi
I'm having a problem with my project that uses a HC-SR04 ultrasonic rangefinder. Using the Ultrasonic.h library and an Arduino Nano I read the distance measured and print it to the serial monitor.
This works fine with accurate readings when using USB power, but when switching to battery it starts giving garbage values that make no sense at all. The battery is a 2S 7.4V 1000mAh LiPo. I connect the battery to vin and gnd on the board. It is my understanding that the Nano has an on-board voltage regulator, but when measuring the voltage it gives me 6.4V when connected to the battery (This was measured when the battery was at 7.8V, almost full so there is at least SOME stepdown). I'm not sure wheter this is even the cause of the problem with the sensor.
I would really appreciate any advice because it used to work fine and now it doesn't, which is extremely frustrating.