I am familiar with sensors like the DS18B20 that have a positive and negative wire, as well as a data wire. This makes sense, since no matter whether the current goes through the data or ground wire, it always ends up at the same point (ground) in the same circuit. However, I now have a sunshine sensor that operates on its own 12V power supply, and has a single data wire that is outputs either 5V to indicate sunny or 0V to indicate not sunny. I wish to read that output on a Raspberry Pi, and it has confused me thinking about it.
I know about common ground, where all circuits paths will eventually return to the same ground at some point. I have started by connecting the single data/output wire to an arduino (since I do not yet have the resistors for a voltage divider to make the 5V readable by the 3.3V RPi pins), setting that pin to input and reading it. This did not work, and flicked lots 0s and 1s (not just 0s, since there was no sun) on the serial output.
Am I approaching this the right way? I was also confused with how common ground would work with an arduino, which is battery powered, so therefore never reaches the same ground as the separate 12V supply for the sensor. Any advice is greatly appreciated.