I am working on reading the voltage from a car backup sensor system. The backup control box sends voltages between about 1-4.2v depending on whether the sonic sensor detects an object.
I am reading this voltage with digitalRead() and using the tone() command with a speaker connected to my Arduino Uno to create a beep when the sensor detects an object.
All of this works perfectly when I am powering the Arduino from my computer's 5v usb cable but as soon as I use a 12v power source (from the 12v DC cigarette lighter of the car) the digitalRead() always returns HIGH.
What do I need to do to get the digital read to work the same way as when I power the Arduino through the 5v USB port?
Thanks for your time.