What are in SolarMAX2 Solar Data Packets?

What are in SolarMAX2 Solar Data Packets?

This is an article showing what is being sent out by 433MHz radio from the SwitchDoc Labs SolarMAX2 solar power system and data collector.

What is SolarMAX2?

Most Raspberry Pi solar power systems shown on Instructables and other forums are seriously underpowered.  If you are building projects that require a significantly larger amount of power than small solar cells can provide, the SolarMAX2 is for you.   Open Source Software puts you in control.   We use SolarMAX2 in our SkyWeather2 projects.
NO SOLDERING!   SolarMAX2 is a SwitchDoc Labs designed system to charge batteries from Large Solar panels in order to provide more power to small computer systems. SolarMAX2 is designed to collect and return data about the solar panel system to the powered (or even other computers) computer via a 433MHz wireless link.  SolarMAX2 collects and transmits the following data via 433MHz Wireless Radio every 30 seconds.  No data cable needed! 
It transmits:
  • Battery Voltage
  • Battery Current
  • Solar Panel Voltage
  • Solar Panel Current
  • Load Voltage
  • Load Current (to your Raspberry Pi!)
It also supplies the following about the inside of the SolarMAX2 box:
  • Inbox Temperature
  • Inbox Humidity

 

Here is an example packet as received by an SDR (Software Defined Radio) on the Raspberry Pi using WeatherSense Software.

The SDR used:

WeatherSense Software Defined Radio (SDR) and Antenna

The Software used:

https://github.com/switchdoclabs/SDL_Pi_WeatherSense

Example Run of the WeatherSense Software

Step 1) Download the SolarMAX2 compatible WeatherSense Python3  library:

git clone  https://github.com/switchdoclabs/SDL_Pi_WeatherSense

Step 2) run the program WeatherSenseMonitor.py

pi@SwitchDocLabs:~/SDL_Pi_WeatherSense $ sudo python3 WeatherSenseMonitor.py
-----------------
WeatherSense Monitoring Software
Software Version  V012
-----------------
Pending jobs:
    readSensors (trigger: date[2021-09-18 14:33:13 PDT], pending)
    startMQTT (trigger: date[2021-09-18 14:33:13 PDT], pending)
    cleanPictures (trigger: cron[day='*', hour='3', minute='4'], pending)
    cleanTimeLapses (trigger: cron[day='*', hour='3', minute='10'], pending)
    buildTimeLapse (trigger: cron[day='*', hour='5', minute='30'], pending)
    readSensors (trigger: date[2021-09-18 14:33:13 PDT], pending)
-----------------
Scheduled Jobs
-----------------

######
Read Wireless Sensors
######
creating new MQTT instance

Jobstore default:
######
Read Wireless Sensors
    cleanPictures (trigger: cron[day='*', hour='3', minute='4'], next run at: 2021-09-19 03:04:00 PDT)
    cleanTimeLapses (trigger: cron[day='*', hour='3', minute='10'], next run at: 2021-09-19 03:10:00 PDT)
######
    buildTimeLapse (trigger: cron[day='*', hour='5', minute='30'], next run at: 2021-09-19 05:30:00 PDT)
connecting to broker
-----------------
starting 433MHz scanning
######
starting 433MHz scanning
######
Connected with result code 0

processing SolarMAX Data
This is the raw data: {"time" : "2021-09-18 14:33:19", "model" : "SwitchDoc Labs SolarMAX", "len" : 44, "messageid" : 448970, "deviceid" : 1, "protocolversion" : 1, "softwareversion" : 14, "weathersenseprotocol" : 10, "loadvoltage" : 5.168, "internaltemperature" : 12.378, "internalhumidity" : 87.164, "batteryvoltage" : 12.752, "batterycurrent" : -454.000, "loadcurrent" : 486.000, "solarpanelvoltage" : 17.752, "solarpanelcurrent" : 592.000, "auxa" : 4, "mic" : "CRC"}

What’s in the SolarMAX2 Packet?

{“time” : “2021-09-18 14:33:19”, “model” : “SwitchDoc Labs SolarMAX”, “len” : 44, “messageid” : 448970, “deviceid” : 1, “protocolversion” : 1, “softwareversion” : 14, “weathersenseprotocol” : 10, “loadvoltage” : 5.168, “internaltemperature” : 12.378, “internalhumidity” : 87.164, “batteryvoltage” : 12.752, “batterycurrent” : -454.000, “loadcurrent” : 486.000, “solarpanelvoltage” : 17.752, “solarpanelcurrent” : 592.000, “auxa” : 4, “mic” : “CRC”}

Note the messageid of 448, 970.   At a message rate of one every 30 seconds, SolarMAX2 has been running the Raspberry Pi based SkyWeather2 up on the roof for almost 170 days!

 

Here are the definitions of each one of the values in the packets:

  • timestamp: When the packet has been received
  • model: SwitchDoc Labs SolarMAX
  • len: Number of bytes in the packet
  • messageid:  Reset to 0 on bootup
  • deviceid:  1 – If you have more than one SolarMAX2, you can change this ID by recompiling the software for the MiniProPlus
  • protocolversion: Current protocol of the SolarMAX2
  • softwareversion: This shows the current version of the software on the Mini Pro Plus
  • weathersenseprotocol: 10 for SolarMAX2

The solar data collected by the device is:

  • loadvoltage: Voltage supplied to the Raspberry Pi or other Computer (V)
  • batteryvoltage: Voltage of the LiPo Battery (V) 
  • batterycurrent: Current being supplied by the battery (mA) 
  • loadcurrent: Current being supplied to the Raspberry Pi or other Computer (mA)
  • solarpanelvoltage: Voltage of the Solar Panel (V) 
  • solarpanelcurrent: Current being supplied by the Solar Panel (mA)

The AuxA variable contains state information about what is going on with the SolarMAX2 Controller.  See the values in the next section.

Power Management and Pi Protection in SolarMAX2

A standard solar power controller will not correctly protect your Pi and the SD Card.  One has to avoid brown out conditions and the power turn on and off rapidly.  This kills SD Cards.

 

pastedGraphic.png

 

There are three major components to the SolarMAX2 software power management system (these numbers are current as of Version 015 of the SolarMAX2 MiniProPlus Computer software:

  • HysteresisHysteresis is the first line of defense for your Pi and your SD Card. Basically, SolarMAX2 will turn the on the USB Power (to the Pi) at a higher voltage than it will turn on.  The criteria for turning on (subject to the timers below) is: battery voltage 11.8V and 100mA of solar current.   The criteria for turning off is: battery 10.86V or Pi Load Voltage of less than 4.76V.
  • First Time On Timer – Delays a turn on of the USB Power (to the Pi) when SolarMAX2 has determined that it is time to turn on the USB Power.   Doesn’t occur on power on to the SolarMAX2 computer, but only after the Hysteresis function has determined that it is time to turn on the USB Power
  • Ten Minute Timer – Used to prevent a quick turn off and turn on on a well discharged  battery.   If SolarMAX2 turns the USB Power off (to the Pi) then this timer prevents it from turning on again for 10 minutes.

The AuxA variable (which is on the Solar Voltages Graph) has the following meaning:

// AuxA has state information

// coded in the long integer

// 00000000 00000000 00000000 000X ABCD

// X – reserved (0)

// A = reserved (0)

// B = 5V Load Power state

// C = 1 – Ten Minute Power Off / On Timer

// D = 1 – First Time On Timer On, 0 First Time Timer Off