I am using an Arduino to read signals from 2 different devices. (This is an automotive project so all 3 are powered by the 12v battery of the car).
The signal from one of the devices is a digital High/Low - where Low is 0v and High is 5V (I've verified this with a meter).
The signal from the other device produces a 0v min, 8.4v max square wave. I am using a 1k and 1.5k resistor to drop the square wave to 0-5v in order to safely read the analog signal with the Arduino. I am using the FreqMeasure library to read the frequency of the square wave so since that library requires the input to be pin 8 of the Arduino, that's where the output of the voltage divider is going.
The "RADIO_INPUT" of the schematic is the analog signal via a 3.5mm jack. The "BACKUP_INPUT" is the digital signal also via a 3.5mm jack.
When only 1 of the inputs are connected (for example: just the digital signal, or just the analog signal) everything works exactly how I expect.
But when both of the inputs are connected I get results that I wasn't expecting. I plugged in an oscilloscope to Pin 8 and Ground of the Arduino and when the digital connection was plugged in the analog signal goes to a 2-5v range instead of 0-5v. As soon as I unplug the digital signal it goes back to the 0-5v range as expected.
On the other side, when I connect the oscilloscope to the digital input I read the same analog frequency as I see from the analog signal except in the 0-2v range. Again when I unplug the analog input the digital input works exactly as expected and I just see the 0v Low, 5v High signal.
What appears to be happening is that the signals are somehow contaminating each other but I don't understand why. I assume that there's a problem connecting the grounds but I'm not sure what to do to keep the signals separated.
So my question is: is there anything I need to do to somehow isolate these 2 different signals so that they don't effect each other? Or am I missing something fundamental with reading in these 2 different kinds of signals?