Fairly new to Arduino, however I can't find any reason online why my setup shouldn't be working:
We have a light sensor amplifier outputting between 0 and 10mV DC that changes according to the PAR sensor signal connected to it. We know this because we can check the signal with a multimeter. Is the ADC on the analog pins not capable of picking up this signal, say 5mV for example? We're just getting 0. Any help would be greatly appreciated
Other sensors work on this pin. Three wires from amp: 1) Voltage in from arduino 5v, (2)Signal to A0, (3) Ground to Analog ground.
Heres the code we're using. You can pretty much ignore the multiplier and gain part of the function as the issue is we're not getting any signal in from analogRead(). Just 0.
#include <SPI.h>Â Â // serial peripheral interface.
const int UTA_PIN=A0; // reads the LiCOR through the UTA using analog pin 0
// constants for converting the raw signal to a PAR value
const float REFERENCE_VOLTS = 5; // create variable (floating number) for the max
                 // voltage on the Arduino's analog-to-digital (ADC)
                 // converter.
// PAR Calibration to apply after signal in
const float LICOR_CAL_MULTIPLIER = 148.27;
const float UTA_GAIN_FACTOR = 0.350;
// variables for sampling data:
float measuredPAR;Â Â Â Â Â Â // create variable (floating number) that holds the PAR
               // measurement.
void setup(void)
{
 //start serial connection
 Serial.begin(115200);
}
void loop()
{
   measuredPAR = acquirePAR();     // calls function that reads voltage on Analog
                     // pin 0 and converts it to PAR level.
   Serial.println(measuredPAR);
   delay(3000);
  }
float acquirePAR(void)Â // this function captures data from the LI-COR Sensor.
{
 int val = analogRead(UTA_PIN); // read the value from the sensor
                 // should be int between 0 and 1023
                 // (2^10 is a 10 bit ADC)
 float volts = val * REFERENCE_VOLTS / 1023; // order of operations is important here,
                       // otherwise integer division takes place.
 float PAR_Level = volts * LICOR_CAL_MULTIPLIER / UTA_GAIN_FACTOR; // calculate PAR
                                  // umol s^-1 m^-2
 return PAR_Level;       // sends the measured PAR level back to the part of
                 // the main program that called this function.
}Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // end bracket for the acquirePAR function.
Boardburner2:
The spec you linked to shows amp output between -2.5 and 5 v. not 0 to 5.
With ADC of 1024bits thats approx 5 mv per bit change using a reference of 5 V.
So at 10 mv only 0ne or two LSB bits are able to change.
I would normally expect to see one bit change with 10 mV input but the circuit layout may prevent this.
If you use a lower reference voltage you should get a better span.
The default reference voltage is 5V or 3.3V depending on arduino used.
This can be changed using analogReference().
Using internal ref should give approx 1 mV per bit change.
Ah great, thank you for the explanation (quite new to electronics). We've tried analogReference(INTERNAL1V1) as we're using the arduino ATmega2560 with no joy. I just realised the mega recommended input voltage is 7-12 volts. We're just powering it with a raspberry pi (5v). Could this be an issue?
This would indicate your code is working, although i have not checked it.
What you are trying to do (read millivolts) requires some care in the design of the hardware.
We're also measuring pH which seems to be outputting again between 0-10mV while connected. That is separate code though. We just want to get this working on its own first. Just mentioned other sensors to prove the pins works.
Still getting zero even with a 12v power source and analog reference 1.1v.
These guys have done something similar although I don't expect you to go through it all
Boardburner2:
Correct.
I followed the link.
The amplifier they are using has a selectable output of 1,2,5 or 10 volts.
I would expect to see some change in signal but if this is on a breadboard possibly not.
Can you post a Photo of the amp you are using,
Ye however, they only used the .2 gain factor and we only need to use the .350 or .375 gain factor depending on whether we use the arduino 5v to power it or an external 6v. Theres an equation you fill in according to your PAR sensor calibration to know what gain to use.
But ye the amp is definitely not doing what its supposed to be if we're only getting microvolts, despite going directly from the amp to the analog in. We'll get in touch with support for it, see if they can help out.
Excuse messy wires, we were troubleshooting the wires.
Bottom right goes to sensor. We were getting a negative voltage first and it was suggested to swap + and - to get positive voltage. I think thats the issue. The amp doesn't account for the swap we have made.
Excuse messy wires, we were troubleshooting the wires.
Bottom right goes to sensor. We were getting a negative voltage first and it was suggested to swap + and - to get positive voltage. Its a bad picture but the jumpers are all up which is .375 which is closest to what the equation provided in the manual for both sensor and amp when using an external 6v power source Separate to the adruino). That however is certainly not being outputted...