Power control board for SOLSTICE - have i gone too far? - Page 1
Forum section: electronics / projects

author: cavac
author_rank: Contributor
timestamp: January 03, 2021, 08:24:26 pm
content: I'm currently working on an upgrade on SOLSTICE (central solar station for my simulated mars missions in my garden). Here is a link to the current version i've used for a couple of months:https://nullisland.space/news/205The old system had a 4 channel switchboard to switch external devices using N channel MOSFETs. I decided that i wanted to do high side switching and have a common ground for everything. And change to 8 channels, 4 wasn't all that futureproof. I also disliked the fact that everything was directly controlled by the GPIO pins of the central Arduino (so everytime i changed something, i had to rewire and reprogram everything). So, let's switch the power board over to a Modbus slave using its own Arduino, since i'm already using that to communicate with the charge controller.Oh, and, while i'm at it, let's implement a proper Marsrover-style deep sleep mode where i can disconnect from the batteries and only wake up when the sun rises.And let's not bother designing a proper circuit board, gimp+hand drawn schematics are enough and this should all fit nicely on a hand-soldered perfboard with throughhole-components, right?And, oh, right, i want to visually check the output drivers with LEDs, but also check them electronically for telemetry download.How hard could that be?Here's the result (i'm still finishing up the software, that's why the Atmega socket is currently empty):Have i gone too far in abusing Perfboards? Or do some of your one-off projects look similar?(And before you ask, i always print out the diagrams of all components where i know i'm liable to confuse the polarity or the pinout, that's why for example the LED and the BC337 are on my "design" paper, even though by now i must have soldered hundreds of them).

author: Renate
author_rank: Super Contributor
timestamp: January 05, 2021, 12:11:32 pm
content: Quote from: cavac on January 03, 2021, 08:24:26 pmI see a few people going that same route.They interface to an EPEver over Modbus, then say, "Well, I might as well make everything Modbus."I did that too.Arduinos aren't bad but then you have to add the RS-485 transceiver.A few years ago I found a Tinkerkit DMX module on closeout sale for <$10.It has the RS-485 transceiver, an ATMega32u4 and 4 relays.They still sell the MOS version here:https://americas.rsdelivers.com/product/arduino/t020090/arduino-tinkerkit-dmx-receiver-mos/7798868I like your idea of hardcopy pinouts.I worked for a company that used to print out an enormous sheet with the pinouts of maybe two dozen cables.I always used to copy and print out a single small sheet with just the cable that I was working on.It's too easy to get distracted/confused when doing wiring.

author: cavac
author_rank: Contributor
timestamp: January 17, 2021, 09:31:47 am
content: The biggest problems with Atmega chips is their limit of only a single serial bus (SoftwareSerial is just as shite as Solar Freaking Roadways, so it doesn't count). Yes, some Atmega chips have more hardware serials, bot all of those or SMD, and that's too tiny for me to work on.Hardcopy pinouts: It makes documenting the hardware much easier. Just take a photo of your (inevitably-corrected-during-soldering) piece of paper and stick it into the version control alongside the source code.For RS-485 transcievers, i use the XY-017 modules. You pretty much just tack them on to your TX/RX lines plus power supply and you are done. And those things are quite cheap and reliable. So far, i haven't managed to blow one up, despite some Electroboom moments in other parts of my circuits. Modbus seems to be a nice solution for doing local bus stuff, so yes, why not use it for everything if i have to implement it anyway for my charge controllerThe "Arduino" is a very barebones Atmega328P with external quarz and the Arduino bootloader, so that's a nice compact setup. The one thing i'm going to change for future projects is the chip socket. ZIF sockets is the way to go, so it makes reprogramming the thing a lot easier. The big messy part of that i also have to somehow squeeze a ZIF socket on one of my spare UNOs.The really frustrating part of the project was, as always, the libraries provided by the community. Frankly, most of them are a pile of garbage. I've started to use my locally modified copies a long time ago and this project was no exception. The "official" ArduinoModbus library doesn't support callbacks, so that's the last time i'm going to use that. The ModbusMaster lib didn't support multiple slaves so i rewrote that thing. And now i'm in the process of testing and modifying some other Modbus slave libs that support callbacks to fit my needs...If anyone is interested in that stuff, it's all in mymercurial SCMFor wireless communication i'm using nRF24. Once you've gone through the usual "getting the library to actually work" process, those modules are quite nice. Well, as long as you buy the good ones with the shielded chip and the external antennas. I've designed my own protocol (complete with packet routing) and it's powering quite a lot of devices in and around my home these days.BTW, here is thereal time telemetry of my solar station.

author: Renate
author_rank: Super Contributor
timestamp: January 17, 2021, 12:57:52 pm
content: Quote from: cavac on January 17, 2021, 09:31:47 amOh, I just have a soldered-in part with a 6 pin ISP.Quote from: cavac on January 17, 2021, 09:31:47 amLots of info there. Your battery voltage seems kind of high.I live in the US, but fortunately at the latitude of Algeria.I like lots of pretty graphs.

author: cavac
author_rank: Contributor
timestamp: January 17, 2021, 02:22:25 pm
content: QuoteIt always looks somewhat high during charging, but that's normal for lead-acid depending on the charge mode.Some of the other voltages (5V bus in particular) always read a bit high, thanks to the shitty Arduino analog in and using 10% tolerance resistors in my voltage dividers. One of these days i'll implement proper sensors, but it's really not a priority. I don't worry about the absolute readings, i use them to watch for voltage drift to check if the regulators are doing their job and the power rails are stable.One of the most interesting voltages for me to watch (aside from the battery) is the (newly added) AUX voltage. This allows me to power the main Arduino (the modbus master that also has the nRF24 wireless link) with the charger output turned off (which also turns off the power distribution board). If the battery is running low, but before the charger detects a low voltage condition, i can remotely turn off the charger output to make sure the battery doesn't get depleted too much. I can still communicate with the system whenever the sun is up and we get enough power from the solar panel. It's a bit like the "Deep Sleep" mode of the Mars rovers.I doubt that i'll ever need that special mode unless the charger dies. It's a 120Ah battery and i'm using <0.2A and i have one panel perfectly vertical so it can't get covered by snow for. But hey, it was easy enough to implement using some diodes and a couple of resistors. And it's always nice to be able to claim that my fake space agency project has the some of the same cool features that Opportunity hadAs for "lots of data": Yeah, i learned the hard way that having engineering data you don't need is always better than needing some data and not having access to it. You can always implement more data points at a later date, but if you have to look into the past to check is something has changed it's already too late to ask yourself if you should log this data into your database...