ivan bingu
Member
Hi all,(am a new user here,so if there is any mistake pls do tell)
im currently connected my teensy board(2++) to my rain gauge (hydreon) and there's no output(serial monitor) for my arduino 1.8.5 whenever the hydreon (tipping bucket mode) activated. (i've tested with another standard coding(serial print example) and saw serial print in it )
im unsure whether this is correct cause im following this website (http://cactus.io/hookups/weather/rain/hydreon/hookup-arduino-to-hydreon-rg-11-rain-sensor) and i need help in term of the pin/coding whether it's correct ornt.
my pin is connect to f7 on the teensy board 2++ Which i have also wrote to LED to test and its fine.
this is my coding
if anyone could please kindly assist me ?? appreciate it alot & thanks a million!
im currently connected my teensy board(2++) to my rain gauge (hydreon) and there's no output(serial monitor) for my arduino 1.8.5 whenever the hydreon (tipping bucket mode) activated. (i've tested with another standard coding(serial print example) and saw serial print in it )
im unsure whether this is correct cause im following this website (http://cactus.io/hookups/weather/rain/hydreon/hookup-arduino-to-hydreon-rg-11-rain-sensor) and i need help in term of the pin/coding whether it's correct ornt.
my pin is connect to f7 on the teensy board 2++ Which i have also wrote to LED to test and its fine.
this is my coding
Code:
#define BOARD "Teensy++ 2.0"
#define RG11_Pin 45
#define Bucket_Size 0.01
volatile unsigned long tipCount; // bucket tip counter used in interrupt routine
volatile unsigned long ContactTime; // Timer to manage any contact bounce in interrupt routine
long lastCount;
float totalRainfall;
float AverageperTime;
void setup() {
lastCount = 0;
tipCount = 0;
totalRainfall = 0;
AverageperTime = 0;
Serial.begin(1200);
Serial.println("Hydreon RG-11 Rain Sensor");
Serial.print("Bucket Size: "); Serial.print(Bucket_Size); Serial.println(" mm");
pinMode(RG11_Pin, INPUT); // set the digital input pin to input for the RG-11 Sensor
// attach interrupt handler to input pin.
// we trigger the interrupt on the voltage falling from 5V to GND
sei(); //Enables interrupts
}
void loop() {
// we only display the tip count when it has been incremented by the sensor
cli(); //Disable interrupts
if(tipCount != lastCount) {
lastCount = tipCount;
totalRainfall = tipCount * Bucket_Size;
AverageperTime = totalRainfall / tipCount;
Serial.print("Tip Count: ");
Serial.print(tipCount);
Serial.print("\tTotal Rainfall: ");
Serial.println(totalRainfall);Serial.println("mm/hr"); Serial.println(AverageperTime);
}
sei(); //Enables interrupts
}
// Interrrupt handler routine that is triggered when the rg-11 detects rain
void rgisr () {
if ((millis() - ContactTime) > 15 ) { // debounce of sensor signal
tipCount++;
ContactTime = millis();
}
}
// end of rg-11 rain detection interrupt handler
if anyone could please kindly assist me ?? appreciate it alot & thanks a million!
Last edited: