In November 2023 my Campbell Scientific CR200 Datalogger died during a rare severe thunderstorm. It had worked valiantly since 2007 without a hitch.

I had to move up to a CR300 Datalogger which I managed to source, second hand, from Australia for about half the price of a new one.

The CR300 Datalogger required a new wiring setup, so I download the latest Loggernet Software from Campbell Sci and created a new program to upload to the logger. This also provided a wiring diagram for me to follow.

BIG PROBLEM.... I discovered that the new logger uses a Baud Rate of 115200 to communicate with the Raspberry Pi 4 I use for Logging. The old CR200 used a Baud Rate of 9600. Then I discovered that I had a problem caused by the 30 metre length of cable from the Logger to the Pi4. At 9600 Baud the maximum cable length is 50m but at 115200 Baud it is only 8m, well short of the required 30m or so. I had to have a good look at my options to allow the Serial ports to connect:

  • I could get two small Radios to connect Serial to Serial, but expensive!
  • I could get a Serial Signal booster between each end, also expensive!
  • Then I had a brainwave.......

The Solution.... I am a long standing Linux Geek, and very familiar with raspberry Pis of all sorts. I realised I could install a Pi-Zero in the CR300 Data Logger Enclosure and connect it to the CR300 using a USB - Serial Adaptor (Had to have the FTDI Chipset). Then have an Ethernet Cable from the Pi-Zero to the Network. The maximum wire length can be up to 100m or more, so no problem there.

I had to power the Pi-Zero + USB Serial Adaptor using a Buck Regulator Breakout - 5V from Cool Components because a simple L7805ACV Voltage Regulator did not have enough power.

I decided to install Tiny Core Linux on the Pi-Zero because it will cope with power outages with no problem. It runs in memory once started. So bit of a learning curve, but once installed with ser2net to convert Serial to Ethernet, it turned out to be a good solution. And low cost!!

I was now able to use the Python Module pycampbellcr1000 on the Pi4 Logger  with just one modification to the device.py file at line 108 to be this:
   diff = int(diff.total_seconds())
Also made sure that the datetime tuple was missing the milliseconds. And BINGO it worked!!!

So I created a Python Program using the modified pycampbellcr1000 module on the Pi4 Logging machine to access the CR300 Datalogger via the Pi-Zero using it's IP Address via port 8000 which is setup in the ser2net config file. Easy Peasy!! I could access the Pi-Zero from any machine on the network, so was able to test my program access and Data Logging from the comfort of my fancy Deskltop PC running Gentoo Linux.

I can now collect the data as per my tables on the CR300 Logger as before, and all my other scripts can process the Data without any modification