Barotrauma

Barotrauma

View Stats:
Need Logic help. Trying to create battery output toggle switch.
Not sure if this is the right place to ask but as the title says I am trying to create a system where I can turn off the output for the battery. Basically I'll hook the generator to the rest of the electrical system and to the batteries and set up a switch to block the output of the batteries while they charge. And so in an emergency you can turn the output on in order to get emergency power. Does anybody have a solution for this?
Originally posted by kratos:
Yes. You'll need a relay, a button, and some wire. Put the relay down and wire your power through it like normal. Now connect the button to the toggle_state. Now the button turns the batteries on and off. You can also pull the state out of the relay to lets say a light. Which will indicate if the batteries are on or not.
< >
Showing 1-5 of 5 comments
The author of this thread has indicated that this post answers the original topic.
kratos Oct 26, 2022 @ 6:48pm 
Yes. You'll need a relay, a button, and some wire. Put the relay down and wire your power through it like normal. Now connect the button to the toggle_state. Now the button turns the batteries on and off. You can also pull the state out of the relay to lets say a light. Which will indicate if the batteries are on or not.
CodyProductions Oct 26, 2022 @ 10:17pm 
Ah I see, thank you!
DECAFBAD Oct 27, 2022 @ 3:41am 
You don't lose power in emergencies, you lose buoyancy.

You gain nothing by disconnecting the batteries.
AlienJesus Oct 27, 2022 @ 6:43am 
Originally posted by DECAFBAD:
You don't lose power in emergencies, you lose buoyancy.

You gain nothing by disconnecting the batteries.
Huh? Batteries should always be "disconnected" when not being used. If you use them to smooth power to entities like the engine its fine, but if you are using them as backup power they cannot be connected to the main grid that sends them charging and the batteries send charge into that circuit at the same time. That creates feedback damage and power pulsing.

All backup battery systems need to have relay switches that keep the batteries from sending power into the grid when not being used and then blocks receiving charge from the grid when they are sending power into the grid.

In general you should use junction -> relay -> entities system for your power grid as that enables you to cut power to anything on those relays and say have one relay with all ballast on it to cut off when you get flora. Or weapons all on relays to cut them off if you dont want bots to use the weapons in SP. Even enabling you to only send the exact amount of power the entities on that relay require. Preventing surges down that line.

Using a daisy chain junction box system you can have x3 relay on each junctions. That equals x15 power out lines instead of x3.

Just never do power -> relay -> relay.

For some reason you cannot put power through two relays connected. there has to be junction box in between them.
Last edited by AlienJesus; Oct 27, 2022 @ 6:50am
Quazy Oct 27, 2022 @ 12:24pm 
Charging Junction -> Relay1 out -> Bat1-4 Charge In -> Bat1-4 Out -> Relay1 In -> Power out Junction.

you can get up to 8 power in and outs from a single relay. power always goes In-Out-In
i call it a bypass relay. junction power is both In and Out so can go to either pin
so 4 bats can be linked to 1 relay and 2 juction.
-the relay can be off or on for signal splitting, but MUST TRANSFER 0 power so u dont x feed.

this gives you up to 16 links in and out for 4 relays and 2 junctions. (32 for 6)

this ignores the relay -> relay problem. as the lines are directly connected to the junction threw a split. not powering threw the relay, just the pins.

messier to link into on/off relays


you can use this tho for a excellent auxilary system.

junction power -> Charge Relay in to out -> bat1-4 charge in ->bat1-4 out-> power relay In--->out-> Charge Relay In.

Power Relay OUT will always be live! as Junction power->charge relay in->Power relay Out is a valid power flow connection.
turning ur auxilary power on will supply power to your whole system and you system will supply power to anything connected to the power relay out.

set the relays with a signal so when power is on charge is off.
< >
Showing 1-5 of 5 comments
Per page: 1530 50

Date Posted: Oct 26, 2022 @ 6:34pm
Posts: 5