Guide to Electrical: Difference between revisions

From Official Barotrauma Wiki
Jump to: navigation, search
m (another couple sentences)
Tag: visualeditor
(a little more on latches)
Tag: visualeditor
Line 4: Line 4:
==Generic Circuits==
==Generic Circuits==
===Pulse circuits===
===Pulse circuits===
Pulse circuits can be very useful for a situation where a specific timed pulse is needed in which a button is ineffective or insufficient.
Pulse circuits can be very useful for a situation where a specific timed pulse is needed in which a button is ineffective or insufficient. The [https://barotraumagame.com/wiki/Wiring_Components#Oscillator_Component oscillator component] has a pulse function which is a ''repeated'' pulse - that is, at a set interval the output pulses on for a brief (how long?) time.
====XOR/Delay Pulse====
====XOR/Delay Pulse====
Arguably the simplest, most reliable way to generate a pulse from a lever or switch (or any other 'settable' source) is this circuit.
Arguably the simplest, most reliable way to generate a pulse from a [[lever]] or [[switch]] (or any other 'settable' source) is this circuit.


Connect the input signal to one input of the [https://barotraumagame.com/wiki/Wiring_Components#Xor_Component XOR] and the [https://barotraumagame.com/wiki/Wiring_Components#Delay_Component delay] input. Set the delay to the amount of time required for your purposes, and connect the delay output to the other XOR input. The XOR output is your pulse.
Connect the input signal to one input of the [https://barotraumagame.com/wiki/Wiring_Components#Xor_Component XOR] and the [https://barotraumagame.com/wiki/Wiring_Components#Delay_Component delay] input. Set the delay to the amount of time required for your purposes, and connect the delay output to the other XOR input. The XOR output is your pulse.
Line 18: Line 18:
For a 'falling edge' detector, the NOT is moved from between the AND and the delay to be inverting the input signal that was going into the AND component.  
For a 'falling edge' detector, the NOT is moved from between the AND and the delay to be inverting the input signal that was going into the AND component.  
===Latches===
===Latches===
Latches are a convenient way of storing signals, superceded in many ways by the memory component but still find use in parts of more complex circuits.
Latches are a convenient way of storing signals, superceded in many ways by the memory component but still find use in parts of more complex circuits. The memory component stores the value at its input when the 'lock' signal is on (ie. 1), and constantly outputs the stored value. The stored value updates at a very rapid pace for as long as the 'lock' input is active.
 
==== Relay latch ====
The [https://barotraumagame.com/wiki/Wiring_Components#Relay_Component relay component] can be used as a single input latch - a button (or other short pulse) passed to the 'toggle state' of the relay will cause the 'state out' of the relay to alternate whenever a pulse is received, storing the state it was left in indefinitely. However, it should be noted that a constant 'on' signal to the 'toggle state' input will result in rapid flickering as the game sees an on signal at each tick, toggling the relay output in response.
 
==== Set/Reset latch ====
This latch differs from the first in that it provides

Revision as of 10:07, 28 March 2022

Electrical Components can be used to achieve a wide range of effects, automated systems and QoL improvements to a submarine. However they must typically be combined with each other to create circuits as a single component is unlikely to fufill a task on its own. These circuits can be built in the Submarine Editor or in-game.

This page is a collection of simple to complex circuits for novice electricians or those who want a brief refresher.

Generic Circuits

Pulse circuits

Pulse circuits can be very useful for a situation where a specific timed pulse is needed in which a button is ineffective or insufficient. The oscillator component has a pulse function which is a repeated pulse - that is, at a set interval the output pulses on for a brief (how long?) time.

XOR/Delay Pulse

Arguably the simplest, most reliable way to generate a pulse from a lever or switch (or any other 'settable' source) is this circuit.

Connect the input signal to one input of the XOR and the delay input. Set the delay to the amount of time required for your purposes, and connect the delay output to the other XOR input. The XOR output is your pulse.

However this configuration generates a pulse when the signal etc. is switched off as well as when it is switched on, which can be a problem in some situations.

Edge Detector - AND/NOT variant

An edge detector gives a pulsed output IF AND ONLY IF the input signal is changing state - this could be either 'on to off' or 'off to on'. Applications might include a signal being pulsed when a lever is enabled and then no output until the next time it is enabled.

Depending on whether you want a pulse when the input signal changes to on or to off the NOT component is positioned differently. In a circuit for a 'rising edge' the input signal is fed into one of the AND component's input and the delay component (set to the user's preferred time). The output of the delay then passes through the NOT component and into the other AND input.

For a 'falling edge' detector, the NOT is moved from between the AND and the delay to be inverting the input signal that was going into the AND component.

Latches

Latches are a convenient way of storing signals, superceded in many ways by the memory component but still find use in parts of more complex circuits. The memory component stores the value at its input when the 'lock' signal is on (ie. 1), and constantly outputs the stored value. The stored value updates at a very rapid pace for as long as the 'lock' input is active.

Relay latch

The relay component can be used as a single input latch - a button (or other short pulse) passed to the 'toggle state' of the relay will cause the 'state out' of the relay to alternate whenever a pulse is received, storing the state it was left in indefinitely. However, it should be noted that a constant 'on' signal to the 'toggle state' input will result in rapid flickering as the game sees an on signal at each tick, toggling the relay output in response.

Set/Reset latch

This latch differs from the first in that it provides