0

Question: How can I send a request to Switch1 that will first reliably turn Switch2 off before turning Switch1 on?

Context: For my rudimentary home PV battery charging installation I would like to switch on the battery charger when my net export to the grid exceeds a certain limit (i.e. when I have enough surplus power I would otherwise lose). When the surplus falls below a certain limit I want to switch the charger off again. At other times (e.g. during the night) I want to activate a power inverter supplying battery electricity to my home grid. Obviously, I do not want to charge the battery while it feeds power to the grid via the inverter. So I want to make really sure that the connection of the inverter to the home grid is off when the charger is switched on. And when the inverter gets connected, the charger shall be switched off before.

Solution Proposal: I was contemplating using two Tasmota plug switches. One for the charger, the other for the inverter. When my Raspberry Pi detects an overall export of more than the configured threshold, I could send an HTTP request to Switch2 (inverter) to turn it off and afterwards send a second request to Switch1 (charger) to turn it on. But the script handling this would need to wait until the Off status of Switch2 was confirmed and only then turn Switch1 on. This would block the script for some (timeout) time. So maybe placing this within the Tasmota switches would be better.

jsotola
  • 335
  • 1
  • 3
  • 10

2 Answers2

1

I have designed control systems for years. I would never rely on software to do hardware interlocking. Its a recipe for disaster.

I would use a multipole relay to do the interlocking. You need to ensure it is a break before make relay. Mechanical relays tend to be that.

Rohit Gupta
  • 507
  • 2
  • 3
  • 18
0

Avoid blocking issues by redesigning the software. Consider using a state machine with more then the "inverter active" and "charger active" states mentioned in the question. Consider at least 4 states:

  1. Inverter active.
  2. Delay after inverter switched to not-active.
  3. Charger active.
  4. Delay after charger switched to not-active.

Many state machine are complex and require visual diagrams. This state machine is simple and can be described in text:

  • When in state 1 we can only travel to state 2. So we only need to describe the rule to make the transition from 1 to 2. We make that transition when we go above the "overall export threshold". Otherwise we say in state 1.
  • Similarly, when in state 2, we only need to describe the rule to transition from 2 to 3. We make that transition after a certain amount of time has elapsed.
  • When in state 3, we transition to state 4 after we go below the "overall export threshold".
  • When in state 4, we transition to state 1 after a certain amount of time has elapsed.

Designing the control system in software adds a level of flexibility that is difficult to implement electrically or mechanically. Software designs can also adapt to changes such as detection of high battery pack temperatures.

That said, many engineers have added software, electrical and mechanical safeguards to software controlled systems. An extreme design might cut all power if both the charger and inverter were simultaneously activated.

st2000
  • 279
  • 1
  • 7