You are reading content from Scuttlebutt
@joeyh

I've ordered an AIMS 1500 watt pure sine inverter, which I'm gonna use to run a chest freezer.

My MPPT charge controller has a load terminal which I can turn on and off in software. And I have 1-wire temp probes. So, my current plan is to write a program that looks at the house's state of power and waits until batteries are well charged up (past bulk and well into absorption) before powering up the freezer. Or, if the freezer is getting too warm on a cloudy summer day, the program may decide to prioritize it over getting the batteries full. The main goal will be not to run the freezer from battery power, unless absolutely necessary.

This will also let me reconfigure the freezer to fridge mode, simply by changing the target temperature, and turning off power when it gets close to freezing in there.

Also, the inverter's fan turns on at 104F, so I'll also put a temp sensor on the inverter, and turn it off at 100F, and let it cool down for half an hour or so, since my house is a "no electronics noise" zone.

Anyway, this inverter has a "soft start" behavior, when it's first turned on the voltage rises from low to normal smoothly over about 3 seconds (video). What I don't know yet is how that will interact with the compressor spin up that'll be happening every time the inverter is powered on.

The inverter's manual seems to suggest this is ok, but dunno if I trust it (the typos don't help):

As for the large inductive loads, such as electric tools and capacitive loads, we
suggest turning on the switch of the appliance firstly and then the inverter's. The soft
start may be enough to power the high starup

#solar

@joeyh

Seems that motor soft starters are actually a good thing, since they reduce mechanical stress.

@nanomonkey

This is cool (pun not intended). I've been wanting to do something similar with my air compressor. While there are losses due to the compressed hot air loosing pressure as it cools down, it's still a big battery of sorts.

@joeyh

Drat, that load terminal is limited to 20 amps, probably not enough. Well, I can use the load terminal to control a 100 amp relay...

@joeyh

Got the inverter mounted and wired up. Was able to repurpose an existing 60 amp breaker for it.

Little snag.. After losing power, the inverter does not turn back on until the power button is pressed. So controlling it with a relay won't work.

Holding down the power button through a power cycle does not result in it coming back on either, so I probably can't simply short the power button. It may be possible to use its remote control port to power it on in a way I can computer control.

Or I suppose I could move the relay to the AC side, which would also let me use the inverter for other stuff without powering the freezer. But this inverter is rated to consume 16 watts when it has no load, which is kind of ridiculous -- my laptop only uses 5 watts. Not liking the idea of adding that phantom load to the power budget.

@joeyh

Found the pins in the remote control socket to short.. But they have to be sorted after power is applied for it to turn on.

So, I'll need two relays or something, how annoying.

@joeyh

Hmm, maybe the inverter won't use much power when off (just enough to power the switch's circuit); if so I can get by with 1 relay still..

Failed to measure the amps with my crappy multimeter, which only goes up to 0.2 DC amps anyway.

@interfect

Sounds like a cool project. :smirk:

@joeyh

Analysis of the AIMS's RJ9 control port:

Short pin 1 to pin 2 for 1 second to toggle power

Between pin 1 and pin 2 is 24V when inverter is off, 17.5V when inverter is on.

Between pin 2 and pin 3 is 17.5V when inverter is off, 0 when inverter is on. Probably the power LED.

Pin 4 must be fault LED.

@joeyh

So I'm thinking I'll connect pin 3 to a GPIO pin, with sufficient resistors to drop the voltage to 3.3V, and then my computer can detect when that has signal to know if the inverter is on or off. So, it won't get confused as to what triggering the relay will do.

@joeyh

An optocoupler seems the safest way, since I'm not sure about common ground between the GPIO and this control port, and nor do I know how many amps the GPIO might pull, or how noisy the signal is.

http://raspberrypihobbyist.blogspot.com/2012/09/gpio-input-circuit_19.html

Cheap too. https://www.sparkfun.com/products/9118

@joeyh

With a 4n35 optoisolator, which uses 1.5V and 10mA to power the led (50 mA max to avoid damaging it), to handle the 18V input needs a resistor of size (18V - 1.5V) / 10mA = 1.65Kohm

Thanks Mr Jones for teaching me Ohm's law in high school, but I actually had to re-learn it for this, oops.

@joeyh

but the manual only warned it was deadly if "opened randomly" yr honor..

Opened the inverter to disable the pizeo buzzer. Chirping every time the computer decides to turn it on or off would fray my nerves. Of course, I took every precaution, including draining the caps n coils first. It can power a kill-a-watt for half a minute when not connected to any power. No kill-a-joey.

Also checked the power switch, and it's a simple switch. The annoying press 1 second behavior must be implemented in its microprocessor, which was on a board big enough to be a full ARM computer and then some. Didn't get a good view of that board, but seems there's no easy hack inside the case to make it turn on whenever it's connected to power.

And the build quality is not great, some big puddles of glue, and a 1-inch high rubber foot that was meant to prop the main board up away from the case was loose inside so I wedged it back into place (although the main board is slotted into grooves in the case, can't imagine it going anywhere).

@joeyh

Mostly done with the control board for the inverter. Not tested yet.

To toggle the inverter's power, I used a 4n35. Connected GPIO pin PC20 to its input with a resistor in between. Everything I found online says to use a 1 kohm resistor there, so I did, even though my calculation says it needs only (3.3v-1.5v)/10mA = 180 ohm. I suppose that the infrared led will burn dimmer with this larger resistor, but still enough for the phototransistor to detect. If not, I'll switch resistors. The other side of the 4n35 connects right up to pin 1 and pin2 of the inverter's control port.

To detect if the inverter is powered on, another 4n35. Control port pin 3 connects to the 4n35 input with a total of 1.8Kohm of resistors in between to limit its 18v down to 1.5v, and then back to control port pin 2. The other side of that 4n35 I've not hooked up yet, but it'll essentially be simple switch connected to a GPIO pin.

So I'm planning a 10k pullup resistor between the 3.3v rail and GPIO pin PC19, and then to the 4n35's phototransitor, and then on to ground. (Don't know if the pullup is necessary; cubietruck may have an internal pullup. Hopefully it won't hurt.) I may also put a 1k protection resistor on that GPIO pin just in case.

@joeyh

Resources:

@joeyh

So the power control part works, as long as only AIMS pin 1 and 2 are connected to the board.

Connecting pin 3 breaks the power control; the UPS powers off briefly, but then back on.

Pin 3 is connected to pin 2 via the 4n35, so I think it must be pulling pin 2 down, the same as pin 1 does, and so the UPS thinks the power button has been pressed a second time.

Perhaps I should be measuring the voltage between pin 3 and pin 1 instead to detect when the inverter is on?

@joeyh

Measured 19v between pin 1 and pin 3 when the inverter is on, 0v when off. So yeah, measure that.

Also makes a lot more sense that a LED would be there, since it's not inverted like pin 2 to pin 3 was.

@joeyh

Tried pin1 to 2.2kohm resistor to 4n35 to pin2.. Doesn't work. Power control does nothing; I guess because pin1 is now effectively shorted to pin2. Perhaps it would work with a larger resistor?

@joeyh

Corrected analysis of the AIMS's RJ9 control port:

Short pin 1 to pin 2 for 1 second to toggle power. (control)

Between pin 3 and pin 4 is 19v when inverter is on, 0 when off. (led)

ARGH! When I was first measuring these, I was juggling tiny wires and the multimeter and must have mis-measured pin 4, assuming it was some kind of fault led since it never had power. But it does have power.

@Rick

Good choice. Pure sine is the only way to go. "modified sine wave" is just a square wave :smiley:

@joeyh

So with pin4 to 2.2kohm resistor to 4n35 to pin3, the power sensor works. And the power control works!

Only little problem... The inverter's scary red "protect" led comes on when the power control turns it on.
So.. It doesn't like something going on in the pin4 to pin3 circuit.

The inverter manual only mentions the red led in the context of under/over volt protection.

@joeyh

Ok, so shorting pin4 to pin3 lights up the protect led too, didn't notice before.

Curse you undocumented control port interface...

@joeyh

Oh rats, I said

Measured 19v between pin 1 and pin 3 when the inverter is on, 0v when off. So yeah, measure that.

And then I connected pin 1 to pin 2 instead. Doh.

Ok, tested that again, and it really does work and all functionality works, time for final PCB update! :)

@joeyh

Yay, 100% working. Finally.

@joeyh

Final schematic

schematic.png

Join Scuttlebutt now