Solar Sense Firmware

The following are rough notes on the firmware workings of Solar Sense.

We have two solar sense boards. Each board does the following things:

  1. Current sense: from hall effect sensor through ADC (entire output of the array)

    1. ACS722 read through I2C through MCP3427

    2. Log it

    3. Figure out amount of power we’re getting with the array

    4. There’s already a hardware fault for overcurrent, don’t worry about it

  2. Relay Control: Enable / disable relay through GPIO on solenoid driver

    1. Solar control of relay to battery (there’s other relays in the path)

    2. If there’s ever a fault deemed to require isolation

      1. Overtemp in array

      2. Something really weird in MPPTs

    3. Enable when the board is powered, if fault turn off

  3. MPPT sense: MPPT via SPV1020 x6

    1. Talk to it through SPI

    2. Use a MUX to determine which to talk to

    3. Want to read temperature, voltage and current, and fault conditions - this data is the input to the MPPTs

    4. Fault conditions: reset - discuss faults later

    5. Just log the data (eventually to telemetry)

    6. Talk to hardware to determine fault levels for data

  4. Voltage sense: coming out of MPPTs in case voltage data from MPPTs are off (bad data) - really important to know

    1. Comes from MCP3427 x6

    2. All connected through I2C, each has a different address, all addressable (all on same bus)

    3. Log this voltage

    4. Check with hardware about fault levels for voltages

  5. Temperature sense: We have 6 thermistors going to 6 different STM ADC pins

    1. Log this data

    2. Have a fault threshold (ask hardware)

Only difference between two boards is that one has 5 instead of 6 MPPTs, so expected data is slightly different. Faults are the same.