I'm building a parking sensor using the NewPin library, ultrasonic sensor, LED, and an arduino nano. Everything works fine when I have it attached to my laptop. The measurements are accurate and the LED turns on and off when the distance hits a certain point.
However, when I take it to the garage the LED just stays on the whole time. It blinks every once in a while but it's only suppose to turn on when the range is less than 30". I thought it was the usb adapter so I connected it to my fast charging usb adapter that I have in the kitchen and I got the same results.
I connected a volt meter to it and sure enough, the arduino is outputting 4.8ish volts and then drops to 0 briefly and then back up to 4.8ish. Why would it be doing this only when connected to a usb outlet? They both output 5v with plenty of amps to power this.