Solar Power SunAirPlus – INA3221 Python Raspberry Pi Library Released
SunAirPlus and SunAir are solar power controllers / sun tracker / power supply system developed by SwitchDoc Labs to power Arduino and Raspberry Pi based systems. We are now releasing the Python drivers for the INA3221 for the Raspberry Pi.
The INA3221 Triple Channel Current and Voltage Monitor on the SunAir Plus board is the subject of a new SwitchDoc Labs kickstarter “Really Useful Breakout Boards for Raspberry Pi/Arduino”. (33% funded in one day!)
SunAirPlus has three current/voltage sensors and an additional four channels of high quality A/D. SunAirPlus is in final debug and is scheduled to be shipped in March 2015.
INA3221 – I2C Triple Channel Voltage/Current Monitor
SwitchDoc Labs developed this INA3221 Raspberry library as part of the SunAirPlus product development and for the new INA3221 Breakout Board.
The INA3221 is Triple-Channel, High-SideMeasurement, Shunt and Bus Voltage Monitor with I2C Interface made by Texas Instruments. Here is the specification for the INA3221.
It is similar to using three INA219 High Side Current Monitors, but not quite. There are significant differences in the chip itself and especially in the software needed. In SunAirPlus, we want to measure the current and voltage for all three major subsystems: The LiPo Battery, Solar Panels and the Computer. You can see the INA3221 in the block diagram below.
We chose to use the INA3221 as it was much less expensive in board space and price compared to 3 INA219 sensors as we used in Project Curacao.
The software is located on the SwitchDoc Labs github under SDL_Pi_INA3221.
Arduino drivers here.
Here are some results from the SunAirPlus board using the onboard INA3221. You can see that the battery is almost fully charged and the solar cell voltage (actually a variable power supply on the test bench) is 5.19V and it is supplying 735mA. The Output voltage is 4.88V because we are fiddling with the board. The Library works like a champ.
Test SDL_Pi_INA3221 Version 1.0 - SwitchDoc Labs Sample uses 0x40 and SunAirPlus board INA3221 Will work with the INA3221 SwitchDoc Labs Breakout Board ------------------------------ LIPO_Battery Bus Voltage: 4.15 V LIPO_Battery Shunt Voltage: -9.12 mV LIPO_Battery Load Voltage: 4.14 V LIPO_Battery Current 1: 91.20 mA Solar Cell Bus Voltage 2: 5.19 V Solar Cell Shunt Voltage 2: -73.52 mV Solar Cell Load Voltage 2: 5.12 V Solar Cell Current 2: 735.20 mA Output Bus Voltage 3: 4.88 V Output Shunt Voltage 3: 48.68 mV Output Load Voltage 3: 4.93 V Output Current 3: 486.80 mA
RasPiConnect Control Panel for SunAirPlus
Here is a tutorial on how to build your own control panels for RasPiConnect.
The RasPiConnect/ArduinoConnect control panel for SunAirPlus is shown below.
Maybe this is a dumb question, but there is no polarity markings on the board to tell me the solar panel polarity… so will I damage the board if I connect the inputs reversed? I’d assume not, but want to be sure.
Not a dumb question at all. Yes, you will destroy the board.
And indeed, there are no polarity markings on the board! We will fix that in the next production run of the board going out next week.
The + is to the top of the board and the – is to the bottom of the board for J6. Same as for J5.
SDL
OK – glad I did not plug it in – two more questions:
1. since I do not know the top of the board, is R5 and R6 the positive or negative post?
2. do I need to put a diode in circuit to keep the current flowing from the solar panel to the battery and not vice versa?
Thanks for your fast reply
Not a problem!
1) The top of the board has the switch. That was an ambiguous answer from us! R5 and R6 are for connecting to photoresistors. Which have no polarity. Check the SunAirPlus spec on page 9. https://www.switchdoc.com/wp-content/uploads/2015/03/SunAirPlus_031215-V1.1.pdf
The Diode to keep the battery from charging the solar panel (that’s a joke – but it would) is already on the board. None needed. We will add that to the Spec.
SDL
thank you for that – It appears that the solar cell has one port, J6 solar – I assume positive is to the top of the board then, towards the switch side, as you say…. correct?
Thanks for this – I am beta testing this for an 8th grade class on electronics focusing on the raspberry pi. I’m pretty familiar with the pi and somewhat familiar with electronics so if this works out, we may couple this with a linino or yun which has the networking capabilities, off-grid…
Please let me know, and sorry for all the questions.
Questions are great. We use them to better prepare our documentation and website.
Switch side is top. Correct.
How cool to use this with an 8th grade class. Send us lots of pictures and we would love to publish (with due credit to you of course) your lesson plans for others to use.
We just released the block diagram for using SunAirPlus for a Raspberry Pi based Weather Station (which is being built as we speak). An Arduino (networked) is coming up next.
https://www.switchdoc.com/2015/03/solar-power-weather-and-the-raspberry-pi/
SDL
Thanks, and will do. This is our third year with the Pi’s… I read about them and got them in beta. We tethered some to helium balloons last spring and had the kids ssh into them to run python code, take pics, and download them sftp back to their laptops via wireless. I’m thinking that since lininos and yuns have wireless network management, we could do some cool stuff with your boards (sun air, and the auto shut-off and turn-on), out in the wilds. I supported the latter on kickstarter, and am hoping to get that soon. If all works out well, maybe I’ll be ordering a bunch towards fall.