I have some issues connecting my SQ-110 from apogee to an arduino mega. The sensor is self-powered, so it should just be connected to an analog input and ground. The specced output is 0-400 mV.
I've set the reference voltage to INTERNAL2V56, but keep getting readings >1.1V. This doesn't make sense based on the given specs. When I disconnect from my sensor, and just have bare cables, I get readings of >2V. Is there something I'm doing wrong?
See code below:
const int sensorPin = A0;
void setup() {
Serial.begin(9600);
analogReference(INTERNAL2V56); // Set reference voltage to internal 2.65V
}
void loop() {
int sensorValue = analogRead(sensorPin);
float voltage = sensorValue * (2.56 / 1023.0);
Serial.print("Sensor Value: ");
Serial.print(sensorValue);
Serial.print(", Voltage (V): ");
Serial.println(voltage);
delay(1000); // Add a delay to avoid rapid readings
}
Indeed, the open cable issue seems to be just random values.
I am currently testing the sensor under low output LED lights (lab), thus not expecting high values. The specs for the SQ-110 state that sunlight values fall between 0-500 mV. A value of 1.1V would make no sense. Also, the values keep strongly shifting up and down. When holding the cable the values sometimes shoot up.
I am quite new to Arduino, so it may be that I am missing something trivial.
I found the specs in the spec-sheet below. Unfortunately I can only find a method to connect it to a Campbell CR1000 datalogger, but that won't work for me in this case.
It seems that the ground connection is faulty or completely open. Black and shield wire both go to Arduino ground. Please post focused, close up photos of your test setup.
When that is fixed, you should use the 1.1V reference to obtain the best resolution. It will need to be calibrated for accuracy.