# isolated-switches

Small PCB that can be directly mounted onto the Raspberry Pi's pin header. Isolating GPIO 24 using an optocoupler.   
Included is a rust program to to switch on or off a PV inverter based on the voltage of the battery bank.

## hardware design

The hardware design was done using the open source EDA KiCAD 10.0 based on a 2.54mm prototype board.  
Used components:
- 2x20 pin socket header
- 200Ohm metal film resistor (2.5mmx6.3mm)
- optocoupler PC817
- output connector: 2-pin JST XH board connector
- 20x16 hole 2.54mm prototype board

## software

As a sample implementation, there is a rust program included that is switching a PV inverter on and off based on the voltage of the battery bank.  
The data is read from a database that is updated regularly using [VE.Direct-Text-Reader](https://git.schauaus.at/VE-Tools/VE.Direct-Text-Reader).  
The actual control the pin is done using the crate [rppal](https://github.com/golemparts/rppal).  
Developed and tested on a Raspberry Pi 5, with Raspberry Pi OS running rustc and cargo version 1.96.0.
