Author Topic: Using the Rainguage with the RS232 serial  (Read 19455 times)

0 Members and 1 Guest are viewing this topic.

Offline Fika

  • Member
  • *
  • Posts: 4
Using the Rainguage with the RS232 serial
« on: November 23, 2011, 10:04:32 AM »
Hey , I recently bought the rainguage and was wondering if anyone got it working using serial out.

I am currently trying to use a USB to serial cable (http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm) hooked up to my PC and using coolterm (simple serial port terminal application) to read the data out from the rainguage but dont seem to be getting any data.

Just wondering if anyone has had any luck getting the serial communication working.

Offline SLOweather

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 3456
    • Weatherelement Moline IL
Re: Using the Rainguage with the RS232 serial
« Reply #1 on: November 23, 2011, 12:35:10 PM »
Where did you find info on the RG-11 having serial output?

Offline Weather Display

  • Forecaster
  • *****
  • Posts: 2611
    • West Coast Road Weather Data
Re: Using the Rainguage with the RS232 serial
« Reply #2 on: November 23, 2011, 12:39:49 PM »
if you were interested, WD supports this rain gauge via the drop count mode, via a 1 wire counter
(for setting that its raining (i,e before the normal rain gauge gets enough rain to tip)
Brian
info@weather-display.com
http://www.weather-display.com

Offline Fika

  • Member
  • *
  • Posts: 4
Re: Using the Rainguage with the RS232 serial
« Reply #3 on: November 23, 2011, 12:55:17 PM »
Well on their website second picture down you see the dip switches , screw terminal and the third 6 male pins section, bottom right of the third pin section you can see it says RS232. Also we emailed them and asked and they said yes you can read data from the sensor via a serial connection.

I'm trying to hook up the gauge to an ARM board so I cant use your software WD. I've managed to power it using the pins but cant seem to be able to read data from them.


Offline johnd

  • Forecaster
  • *****
  • Posts: 4823
    • www.weatherstations.co.uk
Re: Using the Rainguage with the RS232 serial
« Reply #4 on: November 23, 2011, 01:31:50 PM »
if you were interested, WD supports this rain gauge via the drop count mode, via a 1 wire counter

And, presumably, WD also supports any weather station that uses a TBR for which the RG-11 can substitute, eg a VP2. No need of a separate counter in this situation.
Prodata Weather Systems
Prodata's FAQ/support site for Davis stations
Includes many details on 6313 Weatherlink console.
UK Davis Premier Dealer - All Davis stations, accessories and spares
Cambridge UK

Sorry, but I don't usually have time to help with individual issues by email unless you are a Prodata customer. Please post your issue in the relevant forum section here & I will comment there if I have anything useful to add.

Offline Weather Display

  • Forecaster
  • *****
  • Posts: 2611
    • West Coast Road Weather Data
Re: Using the Rainguage with the RS232 serial
« Reply #5 on: November 23, 2011, 01:44:18 PM »
for this use in WD, its like an early warning of rain indicator....when set to very small resolution (0.1 or 0.001mm tip)
but yes it could easily become the rain guage to use (with the correct rain gauge resolution set), when set to bucket tip mode

what format is the serial data in?
NMEA?
maybe you could just hook it up to the CTS signal on the serial connection and monitor the state of that?
(which could be done as a way in WD come to think of it (as that is used for the vortex anenometer))
Brian
info@weather-display.com
http://www.weather-display.com

Offline iisfaq

  • Christchurch Weather Live
  • Senior Contributor
  • ****
  • Posts: 216
    • Christchurch Weather Live
Re: Using the Rainguage with the RS232 serial
« Reply #6 on: November 23, 2011, 03:22:42 PM »
I would be interested if you have any luck in the serial port option as well.

Chris

Offline SLOweather

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 3456
    • Weatherelement Moline IL
Re: Using the Rainguage with the RS232 serial
« Reply #7 on: November 23, 2011, 03:29:23 PM »
Would you please post more info on the serial port? Pin-out, commands etc?

Offline Fika

  • Member
  • *
  • Posts: 4
Re: Using the Rainguage with the RS232 serial
« Reply #8 on: November 23, 2011, 03:46:52 PM »
Sure , i have the following setup right now
Pins on RG-11                  Pins on TTL232R-5V (usb to 6 pin serial)
Gnd    1 ---------------------- 1 GND      
Vcc    2 ---------------------- 3 Vcc    
MC     3
SPD    4
SPC    5        |----------------- 5 RXD (recieve data)
RS232 6 -----|--(2K Resistor)--- 4 TXD (transmit data)

Pin 6 is connected to both RXD and TXD is what the lines show above , you can power and ground another way if you want to.

And you get CoolTerm , a free serial port monitor program, which you can use to listen to whatever com port the TTL is connected to.

If you want to look at the TTL232 pins in details check out figure 4.1 here http://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_TTL-232R_CABLES.pdf

Checking the CTS status was a good idea but I cant do it using coolterm , so I might try with software , but I dont see any reason why the hardware setup shouldnt work as it is.
« Last Edit: November 23, 2011, 03:48:54 PM by Fika »

Offline JimLill

  • Member
  • *
  • Posts: 6
    • WX
Re: Using the Rainguage with the RS232 serial
« Reply #9 on: November 25, 2011, 08:09:48 AM »

I use a Argent Data System WS-1 weather station and have the RG-11 on it. It has RS-232 output

see http://wiki.argentdata.com/index.php?title=ADS-WS1

I feed CWOP and create this page with that  http://www.jimlill.com/weather.html

Offline iisfaq

  • Christchurch Weather Live
  • Senior Contributor
  • ****
  • Posts: 216
    • Christchurch Weather Live
Re: Using the Rainguage with the RS232 serial
« Reply #10 on: November 25, 2011, 01:56:09 PM »


I use a Argent Data System WS-1 weather station and have the RG-11 on it. It has RS-232 output

see http://wiki.argentdata.com/index.php?title=ADS-WS1

I feed CWOP and create this page with that  http://www.jimlill.com/weather.html


How have you connected the RG-11 to the Argent?

What mode is the RG-11 configured for?

Chris

Offline Weather Display

  • Forecaster
  • *****
  • Posts: 2611
    • West Coast Road Weather Data
Brian
info@weather-display.com
http://www.weather-display.com

Offline iisfaq

  • Christchurch Weather Live
  • Senior Contributor
  • ****
  • Posts: 216
    • Christchurch Weather Live
Re: Using the Rainguage with the RS232 serial
« Reply #12 on: November 25, 2011, 09:24:57 PM »
I have followed the instructions on http://www.weather-above.com/usbnontiprain.html and have got it working in a simple test connected from the relay to a Serial Port via Serial To USB adapter.

I have written this simple test application in c#

Code: [Select]
using System;
using System.IO.Ports;
using System.Diagnostics;

namespace SerialTrigger
{
    class Program
    {
        static bool on = false;
        static Stopwatch st;

        static void Main(string[] args)
        {
            st = new Stopwatch();

            SerialPort sp = new SerialPort("COM3", 19200, Parity.None, 8, StopBits.One);
            sp.DtrEnable = true;
            sp.PinChanged += new SerialPinChangedEventHandler(sp_PinChanged);
            sp.Open();
            Console.Write("Waiting....");
            while (Console.KeyAvailable == false)
            {
                System.Threading.Thread.Sleep(500);
            }
            sp.Close();
        }

        static void sp_PinChanged(object sender, SerialPinChangedEventArgs e)
        {
            if ((sender as SerialPort).DsrHolding == true)
            {
                on = true;
                st.Reset();
                st.Start();

            }
            else if ((sender as SerialPort).DsrHolding == false)
            {
                st.Stop();
                on = false;
                Console.WriteLine("Elapsed = {0}", st.Elapsed.ToString());

            }
            Console.WriteLine(String.Format("{0} - Pin changed : {1} - State = {2}", DateTime.Now, e.EventType, (sender as SerialPort).DsrHolding));
        }
    }
}

So this program produces the following when I place drops on the acrylic dome using a syringe.

Code: [Select]
26/11/2011 3:21:29 p.m. - Pin changed : DsrChanged - State = True
Elapsed = 00:00:00.1946935
26/11/2011 3:21:29 p.m. - Pin changed : DsrChanged - State = False
26/11/2011 3:21:33 p.m. - Pin changed : DsrChanged - State = True
Elapsed = 00:00:00.6140709
26/11/2011 3:21:34 p.m. - Pin changed : DsrChanged - State = False
26/11/2011 3:21:34 p.m. - Pin changed : DsrChanged - State = True
Elapsed = 00:00:01.0220083
26/11/2011 3:21:35 p.m. - Pin changed : DsrChanged - State = False
26/11/2011 3:21:35 p.m. - Pin changed : DsrChanged - State = True
Elapsed = 00:00:00.0009336
26/11/2011 3:21:35 p.m. - Pin changed : DsrChanged - State = False
26/11/2011 3:21:35 p.m. - Pin changed : DsrChanged - State = True
Elapsed = 00:00:00.4080836
26/11/2011 3:21:36 p.m. - Pin changed : DsrChanged - State = False
26/11/2011 3:21:38 p.m. - Pin changed : DsrChanged - State = True
Elapsed = 00:00:00.4100449
26/11/2011 3:21:38 p.m. - Pin changed : DsrChanged - State = False

The state goes to TRUE when there is a drop detected and stays high until the drop clears.

Thanks everyone for the help...  Now to put it to test in a live envrionment.


Chris

Offline SLOweather

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 3456
    • Weatherelement Moline IL
Re: Using the Rainguage with the RS232 serial
« Reply #13 on: November 28, 2011, 12:51:23 PM »
Ok, we kinda got off track of the actual use of the "serial" port on the RG-11 board. I received the docs from Ben at Hydreon this morning, and permission to post them

Here's the PDF and the referenced .ser file.
« Last Edit: November 28, 2011, 01:17:07 PM by SLOweather »

Offline iisfaq

  • Christchurch Weather Live
  • Senior Contributor
  • ****
  • Posts: 216
    • Christchurch Weather Live
Re: Using the Rainguage with the RS232 serial
« Reply #14 on: November 28, 2011, 01:10:58 PM »
Ok, we kinda got off track of the actual use of the "serial" port on the RG-11 board. I received the docs from Ben at Hydreon this morning, and permission to post them

Here's the PDF and the referenced .ser file.

PDF if not a link at all.

Chris

Offline SLOweather

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 3456
    • Weatherelement Moline IL
Re: Using the Rainguage with the RS232 serial
« Reply #15 on: November 28, 2011, 01:18:35 PM »
Thanks for the heads-up. I fixed it in the original post. It worked when I previewed it. I must have fat-fingered it somehow.


PDF if not a link at all.

Chris


Offline Weather Display

  • Forecaster
  • *****
  • Posts: 2611
    • West Coast Road Weather Data
Re: Using the Rainguage with the RS232 serial
« Reply #16 on: November 28, 2011, 01:41:59 PM »
I see they have a sense of humour
Quote
Open this file with your favorite text
editor. (Or, for that matter, your least favorite, it makes no difference.)
Brian
info@weather-display.com
http://www.weather-display.com

Offline SLOweather

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 3456
    • Weatherelement Moline IL
Re: Using the Rainguage with the RS232 serial
« Reply #17 on: November 28, 2011, 01:48:04 PM »
Yeah, I chuckled when I saw that, too.

Offline JimLill

  • Member
  • *
  • Posts: 6
    • WX
Re: Using the Rainguage with the RS232 serial
« Reply #18 on: November 28, 2011, 03:41:37 PM »


I use a Argent Data System WS-1 weather station and have the RG-11 on it. It has RS-232 output

see http://wiki.argentdata.com/index.php?title=ADS-WS1

I feed CWOP and create this page with that  http://www.jimlill.com/weather.html


How have you connected the RG-11 to the Argent?

What mode is the RG-11 configured for?

Chris

I put it 0.01" bucket mode and hooked it up in place on the Argent T-B. Via post processing, I factor out the 0.011 bucket of the WS-1. However, I think the RG-11 accuracy may be poor

Offline Fika

  • Member
  • *
  • Posts: 4
Re: Using the Rainguage with the RS232 serial
« Reply #19 on: December 01, 2011, 09:36:28 AM »
Just incase anyone eles is having trouble also getting the rs232 output working , I used Terminal to read what the RG11 was sending and it turns out that the bits are inverted , so in the beginning instead of a start bit it sends a stop bit. Also we were having problems with the voltage level so we need to get an inverter and a level converter.

Offline freaklabs

  • Member
  • *
  • Posts: 6
Re: Using the Rainguage with the RS232 serial
« Reply #20 on: June 21, 2012, 06:58:59 AM »
I'm working on a project with the RG-11 and needed to use the serial output. I played around with it today and got the serial output working. It's a bit finicky but basically, you need a pulldown on the serial output pin and you'll need to set your terminal to 1200 bps. The timing accuracy/stability is not very good and I suspect it's because they're bit-banging the output. I could only get it to read properly using my PC's built-in hardware UART rather than the USB/serial converters I normally use. I also wrote a short Processing sketch to parse the data. I did a writeup on it in my development log here.

Also, even though I parsed the output, I don't fully understand what the fields mean. Does anyone have any idea what the meaning of these fields are? Here's my parsed output:

PeakRS =  00
SPeakRS = 00
RainAD8 = 83
LRA = 00
TransRat = 16
AmbLNoise = 00
RGBits = 10
Slow Reg Index = 0d
Slow Reg Value = 00
« Last Edit: June 21, 2012, 07:01:42 AM by freaklabs »

Offline SLOweather

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 3456
    • Weatherelement Moline IL
Re: Using the Rainguage with the RS232 serial
« Reply #21 on: June 21, 2012, 10:52:35 AM »
I'm working on a project with the RG-11 and needed to use the serial output. I played around with it today and got the serial output working.

(etc...)

I'm curious about your choice of the RG-11 for a rain gauge, and about the project in general. The RG-11, by the admission of the mfr, and in anecdotal evidence of my own and others here, is not a very good rain gauge if you are looking for accurate rain fall readings across differing intensities of rain.

Also, as you have seen, the thing is a relative power hog, especially compared to a reed switch/tipping bucket.

I'd be happy to continue on a conversation with you about this, either here on WxForum, or in email, or in comments on the Freaklab site. There are lots of off-the-shelf stations that already seem to do most of what you need, and in fact, I've developed something very similar based around Davis Instruments stations, my own interface box, and a cellular router. See http://www.weatherelement.com/condorlookout. This unit runs on solar power, updates once a minute to the server, and runs on about 7 AH/day at 12 VDC on a solar power system.

Offline nellyt

  • Member
  • *
  • Posts: 3
Re: Using the Rainguage with the RS232 serial
« Reply #22 on: August 02, 2015, 05:06:09 AM »
Renewing an old thread......anyone make a progress on rs232 decoding of this device.
I've just got mine wired up, sorted out the inverted bus polarity and have some python code decoding all the data including the slow changing bits.
So I am now starting to reverse engineer which bits of data are useful.
Anyone done this already?

 

anything