Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

Solar Radiation

Home Forums Environmental Sensors Solar Radiation

Viewing 7 reply threads
  • Author
    Posts
    • #2265
      TheoJass
      Participant

      I am looking to use a Mayfly with a solar radiation sensor. It’s a simple, 3-wire analog sensor and I think it’s standard in weather station equipment. Does anyone have experience doing this, or a sketch to share?

    • #2267
      Shannon Hicks
      Keymaster

      I have used several solar radiation sensors with my Mayfly boards, so it’s possible, however it really depends on what the excitation voltage of the sensor is, and what the analog signal’s output voltage is. Can you tell me the make and model of the sensor, or at least what are the power requirements and output voltage?

    • #2269
      TheoJass
      Participant

      Thanks for the response. We’re using an Apogee SP-110, which is self-powered (doesn’t draw from the battery) and provides output in the range of 0-250 mV. The 3 wires go to a positive and negative signal from the sensor and a ground.

    • #2271
      Shannon Hicks
      Keymaster

      The Apogee SP-110 will work fine with the Mayfly. Just connect the signal wires to AA0 and AA1 (the aux analog inputs) and do a differential measurement. You’ll need to use the Adafruit_ADS1x15 library and look at the example for differential measurements.

      We always use the amplified output versions of Apogee’s solar sensors instead of the self-powered ones because they have much better sensitivity. There’s an order of magnitude improvement in the sensitivity by using the amplified ones, and it results in a much cleaner signal too. The SP-212 is the amplified (2.5v) equivalent of the SP-110, so I would recommend that instead if you haven’t already purchased the sensor.

    • #2272
      TheoJass
      Participant

      Thanks again. We’ll probably stick with the SP-110 since we have a few already in the lab. I found in a datalogger manual that they recommend using it as a single-ended analog sensor, where the positive wire is the signal and the negative wire is an additional ground. I saw in the ADS1x15 library that there is a folder for singleended. Would I just follow that example and keep the wiring the same? Or would I wire both “ground” wires to the ground pin (black wire on the starter kit)?

    • #2273
      Shannon Hicks
      Keymaster

      Sure, if the manual says it’s okay to ground the sensor’s negative signal wire, then you can just connect the sensor’s ground and negative signal wires to a “GROUND” pin on the Mayfly, and then connect the sensor’s positive signal wire to one of the Mayfly’s auxiliary analog pins. The easiest way to do this is with one of these Grove-to-screw-terminal boards:

      https://www.robotmesh.com/grove-screw-terminal

      If you’re using aux analog pin 0, then the following code will work for reading your SP-110 sensor. I put the correct conversion factor in the sketch for your particular sensor. If anyone tries to use this sketch with other sensors with different conversion factors, they will need to change that part of the sketch.

    • #2352
      mamun3471
      Participant

      I own a SP-212 sensor. Could you please share the code for SP-212 to work with arduino mega 2560 and also arduino uno? I’m not using Mayfly.

    • #2354
      Shannon Hicks
      Keymaster

      The code I posted above is for when you use a ADS1115 16-bit ADC. If you’re using a standard Uno or Mega board, you’ll have to use the regular 10-bit ADC, unless you’re planning to use a separate ADS1115 breakout. But assuming you’re okay with the lower resolution of the 10-bit ADC, just use the standard analogRead command and then convert the result to voltage. And because the output of the SP-212 is 1mv = 1 PAR, the measured voltage (in millivolts) is the PAR. The 10-bit resolution of the ADC means you’ll get steps of around 5 PAR (4.89 actually).

Viewing 7 reply threads
  • You must be logged in to reply to this topic.