AquaticTechTank.net
http://aquatictechtank.net/

DIY Arduino meter for Apogee SQ-120 Sensor
http://aquatictechtank.net/viewtopic.php?f=11&t=202
Page 1 of 1

Author:  mistergreen [ Wed Jan 25, 2017 1:23 pm ]
Post subject:  DIY Arduino meter for Apogee SQ-120 Sensor

You can use a voltmeter to get the mV output of the sensor and * 5 to the reading to get the PAR value.
I realized you can use an Arduino to read mV so I made a meter for the sensor.
I had a spare CEP meter I can mod.

First, I needed to break the VCC connection. It's easier to heat the area with a soldering iron then scrape with a x-acto knife until the connection is broken.

Image


Then connect it to Ground

Image


Remove these resistor and Pot

Image

Image

And then connect the sensor into the meter.

Image

Code:
// get PAR for apogee SQ-120
// black & clear go to ground
// red go to A0
// Code also includes provision for seial output of PAR values to a PC.


#include <LiquidCrystal.h>

float average = 0;    // gets average of PAR(photons) / second - give more stable readings
unsigned long time_sec;
int counter = 0;

                         
// create the LCD
LiquidCrystal lcd(8, 7, 5, 4, 16, 2);
// set up backlight
int bkl = 6; // backlight pin

void setup() {

  time_sec = millis();
 
  // set up the LCD's number of rows and columns:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("SQ-120 PAR Meter");
  pinMode(bkl, OUTPUT);
  digitalWrite(bkl, HIGH);
  // initialize the serial communication:
  Serial.begin(115200); // Max for Arduino Uno

   analogReference(INTERNAL); //UNO
  //analogReference(INTERNAL1V1) // mega
 
}

void loop() {

  int sensorValue = analogRead(A0);
  // Convert the analog reading (which goes from 0 - 1023) * 1.1V reference for Volt * convert to mV * 5 to get PAR
  float par = sensorValue * (1.1 / 1023.0) * 1000 * 5;
     
  average += par;
  counter++;

  //every second or 1000 millis
  if(millis() > time_sec+1000) {
      average = average/counter;

      // set the cursor to column 0, line 1
      // (note: line 1 is the second row, since counting begins with 0):
      lcd.setCursor(0, 1);
      // print the number of seconds since reset:
      lcd.print(average);
      lcd.print("   ");
     
     
      // send PAR data to the Serial output.
      Serial.print(average);

      //reset timer & counter to get ready for the next second.
      time_sec = millis();
      counter = 0;
  }

 
  delay(5);

}

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/