Ben's Blog

self sustainability, solar power ben December 15, 2020

Compromises, Getting 70 Amps on Demand

We barely used our Champion generator these past 5 years, but it did come in handy on rare occasions. It sat for 2 years unused at one point and needed some TLC to get back going again, a fact we didn’t want another way. Working from home in the time of Covid, having upgraded our solar setup, and still not making enough power through very cloudy days, we had to compromise our values a bit more and get decent fossil based 🙁 regenerating capabilities.

I’m still gathering information on water and wind turbines to diversify down the road, but today we are not ready to pull that trigger and we need to work.

So we acquired a very nice Honda EU2200i, and a wonderful little device that plugs into it and produces 70A at 12VDC on demand.

The Honda generator is really nice and very quiet.

The AIMS Power CON120AC1224DC is very impressive, is can truly put out 70A on demand, it can be tuned to charge several battery types, and it decouples the load. I don’t need to switch the load to the generator, which means it’s always on the nice clean pure sine inverter.

The Honda generator comes with Bluetooth, a fact I was not happy about as it’s gimmicky, but I have to say it is nice to not have to go back outside to turn off the generator. The AIMS converter is definitely working it hard.

 

The results on the solar graph are, well, a bit absurd to look at :).

electronics, I.T. ben December 15, 2020

Driving a Bipolar Stepper Motor with an L298N and a Raspberry Pi

A few things to know about the L298N

This is a rudimentary way to drive a stepper motor. You are activating the motor’s coils in sequence yourself to have it take steps. There exist cheap stepper drivers which only require 1 signal from the Pi to be instructed to execute a full step sequence.

There are 2 coils on a bipolar stepper motor, each with a + and a – side. As such, this method requires 4 pins from your Pi to drive the Motor Vs only 1 pin with a more advanced stepper driver. Equally true is that a more advanced stepper driver will require at least another pin for direction and they’ll usually have other pins for micro-stepping.

This method does not allow for micro-stepping, only full steps. This is fine enough for most applications.

Lastly, while the L298N method might appear less appealing because of the above points, I find it to be extremely robust (advanced stepper drivers can be very finicky). You can power your Pi or Arduino with it thanks to a 5V port (warning, it can only provide so many amps and a Pi running heavy processing will crash).

It can be used to drive 2 DC motors instead of 2 stepper coils of a bipolar stepper motor, and has 2 PWM pins to adjust power given to the motors. It’s a very versatile and enabling device to master. You’ll also learn a lot about how stepper motors work.

Finding your stepper motor coils

Documentation for electronics is often inaccurate, disparate, when it’s even available. It’s good to find or verify what wires you think your coils are on. To do so you can put an LED on 2 motor pins and spin it until it lights up. When it does, induction powered your LED so you know you are holding the 2 wires of a coil. The other 2 wires are obviously the other coil.

There is no good way I could find to verify which of a coil’s wire is positive or negative. In my trials, I found that it doesn’t matter for a bipolar stepper motor on an L298N. The worst that will happen is that your motor may turn in the other direction which is easy enough to fix by flipping wires.

Circuit

Fritzing

Code

[python]#!/usr/bin/python3
import RPi.GPIO as GPIO
import time

out1 = 17
out2 = 18
out3 = 27
out4 = 22

# careful lowering this, at some point you run into the mechanical limitation of how quick your motor can move
step_sleep = 0.002

step_count = 200

# setting up
GPIO.setmode( GPIO.BCM )
GPIO.setup( out1, GPIO.OUT )
GPIO.setup( out2, GPIO.OUT )
GPIO.setup( out3, GPIO.OUT )
GPIO.setup( out4, GPIO.OUT )

# initializing
GPIO.output( out1, GPIO.LOW )
GPIO.output( out2, GPIO.LOW )
GPIO.output( out3, GPIO.LOW )
GPIO.output( out4, GPIO.LOW )

def cleanup():
GPIO.output( out1, GPIO.LOW )
GPIO.output( out2, GPIO.LOW )
GPIO.output( out3, GPIO.LOW )
GPIO.output( out4, GPIO.LOW )
GPIO.cleanup()

# the meat
try:
i = 0
for i in range(step_count):
if i%4==0:
GPIO.output( out4, GPIO.HIGH )
GPIO.output( out3, GPIO.LOW )
GPIO.output( out2, GPIO.LOW )
GPIO.output( out1, GPIO.LOW )
elif i%4==1:
GPIO.output( out4, GPIO.LOW )
GPIO.output( out3, GPIO.LOW )
GPIO.output( out2, GPIO.HIGH )
GPIO.output( out1, GPIO.LOW )
elif i%4==2:
GPIO.output( out4, GPIO.LOW )
GPIO.output( out3, GPIO.HIGH )
GPIO.output( out2, GPIO.LOW )
GPIO.output( out1, GPIO.LOW )
elif i%4==3:
GPIO.output( out4, GPIO.LOW )
GPIO.output( out3, GPIO.LOW )
GPIO.output( out2, GPIO.LOW )
GPIO.output( out1, GPIO.HIGH )

time.sleep( step_sleep )

except KeyboardInterrupt:
cleanup()
exit( 1 )

cleanup()
exit( 0 )[/python]

Stuff you might need for this to run:

[bash]sudo apt-get update –fix-missing && sudo apt-get install python3-rpi.gpio[/bash]

 

This stepper motor is rated for rotating by 1.8° per step. This means that it takes 100 steps to rotate 180 degrees:

and 200 to do a full 360:

Power the Pi from the L298N?

As I alluded to earlier, the L298N comes with a 5V power output that is most convenient to power Pis and Arduinos as it allows you to eliminate one of the 2 power supplies to your system. Be advised that while it provides the right voltage, it does not provide enough amps to power a standard Raspberry Pi, and while it can power a Pi Zero, the later will not get enough power and crash if it works hard enough (having a camera and a live streaming server pushed it over the edge in my testing). It will power a Pi Zero on Wifi running Python which is enough for a lot of applications.

Here’s the circuit if you want to do this:

Fritzing

miscellaneous ben December 07, 2020

Protected: Esther the Cat Herder

This content is password-protected. To view it, please enter the password below.

aesthetics, plots ben December 07, 2020

6 and 1/2 hour job

Someone in Brazil drew this on Mandalagaba years ago and I’ve used it to stress test plotters since :). I wish I could get in touch to show them.

https://ben.akrin.com/wp-content/uploads/2020/12/6andahalf.mp4

self sustainability, solar power ben November 30, 2020

Chasing the Dip

As Murphy’s law would have it, our solar upgrade coincided with a strange phenomenon which affected us for the whole month of November. Our batteries voltage took a sudden drop every night around 9:00PM going to well bellow any usable voltage and leaving us scrambling for power through the nights.

Because of this unfortunate timing, and my lack of understanding of all things battery related. I ended up chasing this dip for weeks, trying everything under the sun isolate it. Long story short, all our AGM batteries are shot.

Years ago I bought AGM batteries because they are more self contained and don’t require maintenance (no off gazing, no re-filling them). A choice that made sense when everything was new and too much to think about. Today, I’m realizing that the flip side of this is that AGM batteries have a shorter lifetime and that there is nothing you can do about it. Sure they were no maintenance for a few years, but today they are between 3 and 5 years old and we have to replace them all (all $1600 worth of them).

I reevaluated our battery situation, and with a much better grasp of all things solar, I decided to go with regular flooded lead acid batteries, they are deep cycle, they have 65Ah, they have a port to maintain the chemicals in them.

It does mean I’ll be poking at them every couple of months to better quantify their state and not let a slow boiling voltage dip sneak up on me. And I’ll be maintaining the chemicals (mostly adding distilled water on occasion).

This conclusion was confirmed by chatting with a couple of old timers who have been off-grid for decades. One gets 6 to 8 years out of his batteries which are allowed to freeze (our situation today), the other gets 10 to 13 in a controlled environment and a water turbine providing constant power 24h a day. This helps the batteries not cycle so much.

It was a real education talking to people who have been doing this for decades. As I build my own experience, I make mistakes and sub-optimal decisions. For today though, I’ve eliminated a blind spot of our solar setup. I can recognize the phenomenon for what it is, the data I collect was really helpful and I have ideas for algorithms to interpret them automatically and get a health measure of the battery array.

So I bought only 3 new batteries, giving us 195Ah to get through night and cloud. It turns out it’s a thousand times better than where we were with our theoretical 775Ah as it had slow boiled down to pretty much nothing :). I’ll get in the habit of maintaining these batteries properly.

building, self sustainability, water ben November 25, 2020

Mild Winter Bathroom

It’s late November and the ground isn’t frozen, it’s a perfect opportunity to work on water evacuation to the septic tank as we get ready to create our bathroom. If we don’t do it now we’ll have to wait another 4 months. We unearthed the existing line to split it into another one for the bathroom.

I.T., plotters ben November 15, 2020

The Plot Thickens

Covid and 3D printer mishaps have seriously hindered my ability to iterate on the plotter design which I was hoping would be behind me last March :\. Oh well, I’m getting close to finally being able to release it into the world.

self sustainability, solar power ben November 11, 2020

Double the Amps :)

November 9th 2019

 

November 9th 2020

 

And just for fun, here is November 9th 2015

We’ve come a long way 🙂 It’s supposed to be cloudy tomorrow. This will be a good test of the strategy that is trying to squeeze more amps with more panels from a non-optimal day.

self sustainability, solar power ben November 08, 2020

Double Measures

Our demand for electricity surpasses our ability to produce it often these days. Between the fridge, working from home,  kids growing up, and soon a water pump, we’ve expanded drastically but our solar setup has not. With Winter looming, it was time for an upgrade.

We can pick 2 strategies for an upgrade:

  • Beef up storage by buying batteries which can carry us through more cloudy days.
  • Beef up our panels to milk more amps out of cloudy days.

The former doesn’t make sense for us right now, battery lifetimes wouldn’t be in sync, and they freeze on the really cold days which is not advisable for their long term performance. Batteries are very expensive and we know that whatever we get will take a beating. In a few years, when we have a root cellar, we’ll also have an ideal place for batteries which won’t be subject to drastic temperature swings, then it will make sense to upgrade those. In the meantime, the only strategy left to to milk the cloudy days for more by buying more panels.

I couldn’t find the exact same panels so I bought some similar, and well, I had to get 9 for things to look symmetrical

I went vertical because I like where everything is now, I didn’t want to increase the panels’ footprint on the land.

I expanded on the existing frames made of pressure treated 2x4s. It looks a little eclectic and that’s ok, it works well :). We do get very high winds here so I have to build sturdy or I’ll be picking panels off the ground after a storm.

Now this is starting to be a serious array. I don’t think we’ll ever need more panels than this. Note that the top row looks a little different, as I said they aren’t the exact same panels.

Because we have more panels, everything downstream also needed to be upgraded. Truth be told, it needed to be upgraded a while back. I was definitely pushing the gauge of the wiring, and a lot of things I had done poorly as I was learning. I rewired everything with better gear, better knowledge, and dare I say better skills.

I started work on the control panel of my dreams inside. I’ve gotten to appreciate just how much time, and how much skill proper wiring takes.

Each solar panel now gets its own wiring, with an on/off switch and a diode to prevent electricity feedback. The panels have their own diode locally to prevent feedback damage, but between they and the control panel, there’s a lot of wire one could make mistakes with. Working together,  they can produce 100 Amps and so you really don’t want feedback. I soldered heavily (and uglily) any connection I could.

The solar on/off button casing is an fork from the previous on/off switch casing but with room for a diode and made so they can stack.

Download links here:
solar_on_off_button_casing.stl
solar_on_off_button_casing.dae
solar_on_off_button_casing.skp

I’m also making the control panel fully detachable, anything connected to it has a plug. It’ll make it easier to work on down the road.

Now we’re talking!

Long story short, it took several days of work to rewire all 18 solar panels and create this awesome control panel. There are still a few things I need to polish or position better. I “reverse-engineered” what powers our fiber ONT so I wouldn’t have to rely on an inverter to power a UPS to power it (ouch for efficiency). Turns out it just needs 12V, guess what I have plenty of in this solar shed? I got a 12V power cleaner (the aluminum radiator looking square to the right) to at least give it a very clean 12V, the other pins are optional signal pins to take various UPS actions based on power scenarios. It really didn’t make sense to jump through all these hoops to have a 12V battery backup when my whole system is essentially a 12V battery backup. We’ll see if anyone comes knocking on my door :).

The smarts for monitoring and hosting this very blog are mostly untouched but I did re-arrange them a bit. I tried to fit everything on the control panel but it made sense to separate by function.

Robin enjoyed playing with the switches, including the big catchunking one. We experimented with various scenarios, compared panel outputs et cetera. This was a nice unforeseen side effect this design.

All in all I still have a bit of work, but I knew exactly what I was doing and didn’t make a single wiring mistake which is really nice. I used to be way more puzzled by how to wire something much more basic than this. The charge controller stopped working mid-day, that’s because it stops at 80 Amps and the panels had reached this. Fortunately, it was very easy to turn off 4 panels and the system worked again. It’ll be just as easy to re-add them on a cloudy day. The real solution will be to upgrade the charge controller, this will be left for another time. With the Sun almost gone well behind the tree line, we were still making 2Amps, this is now definitely a nice setup :). “Legit Brah” as Robin would say.

nature encounters ben November 02, 2020

Thanksgiving Chickens

Posts pagination

← Previous 1 … 41 42 43 … 119 Next →

Recent Posts

  • Red Shouldered Hawk
  • Protected: 2026 Fireflies
  • Gondola PlottyBot v2
  • Corkscrew Sounds a Mystery no Longer
  • Copper

Recent Comments

  1. ben on PlottyBot
  2. Selmo B on PlottyBot
  3. santry on Gondola PlottyBot v2
  4. santry on Built Me Another
  5. ben on Built Me Another

Archives

  • June 2026
  • May 2026
  • April 2026
  • March 2026
  • February 2026
  • January 2026
  • December 2025
  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • May 2011
  • April 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • March 2010
  • December 2009
  • October 2009
  • September 2009
  • August 2009
  • June 2009
  • May 2009

Categories

  • 3D modeling / printing
  • aesthetics
  • agriculture
  • AI
  • all out geekery
  • apiculture
  • apple
  • Books
  • building
  • canning
  • crochet
  • electronics
  • foraging
  • homestead automation
  • hunting
  • I.T.
  • Lego / Duplo
  • life in the U.S.
  • maniacal paranoia
  • maple syrup
  • miscellaneous
  • nature encounters
  • old vinyls
  • organs
  • plots
  • plotters
  • poultry
  • preserving
  • self sustainability
  • solar power
  • specular holography
  • trip to a new life
  • unix / linux
  • video games
  • water
  • web development
  • web games
  • wood
Theme by Bloompixel. Proudly Powered by WordPress