Tutorial [Guide] Basic Wiring Guide

Discussion in 'Starbound FAQs, Q&A, and General Help' started by SeaJay, Dec 27, 2013.

  1. SeaJay

    SeaJay Space Kumquat

    This is a basic wiring guide. If you're looking for the advanced wiring guide, you can find it here!

    The best way to learn wiring is to build things, play with them, change them and see what happens. Get a practical feel for how it works.

    If you feel that you learn better through a video format rather than reading text, I completely understand. Try watching this excellent guide on YouTube by forum member Eonwulf.

    The Basics
    • The Wiring Tool is available from S.A.I.L. after upgrading your ship to Sparrow class (on builds prior to Upbeat Giraffe, the Wiring Tool was crafted). You can press T to select it.
    • Craft a Wiring Station on a Robotic Crafting Table. On this, you can make buttons, switches, logic gates, and more!
    • Logic gates can be placed on a background wall. Purple nodes are inputs, and red nodes are outputs.
    • Left click two nodes to connect them. Right click a node to remove all wires connected to it. The Wiring Tool has a pretty short range, so make sure you're quite close to the node you want to connect. To make things easier, type /admin into the chat to activate admin mode, in which the Wiring Tool has infinite range.
    • Wires can be either on (1) or off (0). Wires glow bright red when on.
    • Gates glow blue when their output is on.
    • Unconnected inputs are treated as off.
    • You can generate one-second pulses using the various types of Buttons.
    • For toggle switches, craft Small or Tiny Wall Switches, craft tiered levers/consoles at the appropriate station, or loot dungeons for consoles, levers, switches, etc. I'll be using the "USCM Fingerprint Scanner" as a switch in this guide.
    • Proximity Sensors (pressure plates) output 1 when you step on them, and 0 when you step off.
    • There are more exotic triggers too, like liquid sensors, light sensors and proximity scanners. These are pretty self-explanatory.
    [​IMG]

    What is a logic gate?

    A logic gate is a machine that has one output and at least one input.

    The output of the logic gate is dependent on the input(s). The name of the logic gate tells you how the output and input(s) are related.

    Starbound only has 4 logic gates. There are more in real life, but Starbound has the most important ones. If you only learn one thing from this guide, make it this:
    NOT gate: The output is 1 when the input is 0, and 0 otherwise.

    AND gate: The output is 1 when both inputs are 1, and 0 otherwise.
    OR gate: The output is 1 when one or both inputs are 1, and 0 otherwise.
    XOR gate: The output is 1 when the inputs are different, and 0 otherwise.


    In this guide, I will be showing you examples of simple machines that demonstrate what each gate is useful for.

    You will notice that in the pictures, you will see some algebra and weird symbols being used. Ignore that for now, I address it at the end in the Boolean algebra section (which is optional reading!)


    NOT gate

    A NOT gate is the simplest gate and has only one input.

    A NOT gate outputs the opposite of its input. Literally, the output is not the same as the input. Also called an inverter.

    A NOT gate with nothing connected to its input always outputs 1. This is good if you want a door to be always open, a light to be always shining, etc.

    In this basic example, I use one to make sure the bulb is off when the switch is on, and vice versa. Build it and see how the NOT gate always outputs the opposite of what it's being given.

    [​IMG]


    AND gate

    The AND gate's output is on when both of its inputs are on. Literally, its output is only on when Input A AND Input B are on.

    Probably the most common usage of an AND gate is for locks and enabling circuits. Here is a basic example. Due to the AND gate, the door only opens when a button is on *and* the switch is on. Hence the switch acts as a door lock - when it's off, the door is unusable.

    [​IMG]

    What if you want an AND gate with 3 or more inputs? You can cascade AND gates to get more inputs. Multiple-input AND gates only output 1 when ALL of the inputs are 1. Pictures below are 3 and 4 input gates, it should be fairly obvious how to extend it to 5 and beyond.

    [​IMG]
    [​IMG]


    OR gate

    An OR gate's output is on when one or both of its inputs are on. Literally, its output is on when Output A OR Output B are on.

    An OR gate with one input disconnected acts as a repeater - a gate that outputs the same as its input.

    This is an almost-useless gate, as Starbound supports connecting multiple outputs to a single input. This achieves the same effect as using an OR gate.

    In pictures, this:

    [​IMG]

    can be replaced by this:

    [​IMG]

    Clearly, the obvious use for OR logic is to have multiple triggers for something. For example, if you place two pressure plates on either side of a door and wire them both to the door's input, you can open the door just by walking into it, and it will close behind you when you leave. Another example, if you want to activate a booby-trap if somebody steps on one of five pressure plates in a room, wire all the pressure plates to the trap, no gates needed.

    If, for some reason, you want to make multiple-input OR gates, they cascade just like AND gates. Multiple-input OR gates output 1 when ANY of its inputs are 1.


    XOR gate

    A XOR gate's output is on when one input is on, but not when both are on.

    What a XOR gate does, in other words, is output 1 when the inputs are different. This means you can have two switches that independently toggle something. When you toggle one of the switches, the two inputs toggle between being different and being the same. Hence, the overall output will toggle as well.

    This is good if you want to control something from two different points in your base - for example, if you want each door to have its own lock just next to it, but you also want a central control room with another set of door locks.

    This simple example is a "lightswitch", using either of the switches in the room will toggle the bulb. (Note: This isn't how real-life lightswitches work)

    [​IMG]

    Cascading XOR gates like we did with AND gates creates something called an odd function - it outputs 1 if an odd number of inputs is 1. Using cascaded XOR gates, you can control something from as many points as you like!



    Boolean Algebra: The Basics

    I have relocated all the math to this one section at the end. I think this will improve readability. Feel free to ignore this section if it doesn't interest you.

    Boolean algebra is just like normal algebra, except the variables (A, B, C, X, Y, whatever) can only have two possible values - 0 or 1, and there are a couple of extra operations tacked on. You can use Boolean algebra to describe how a logic gate or a series of logic gates operates.

    Generally, I label inputs as A and B, and the output as Y. You can label them whatever you want, though.

    NOT gate: If the input is A, then the output is A'. The apostrophe means negation - an operation that turns 1s into 0s, and 0s into 1s. You will also see a notation where a horizontal line is drawn over the thing being negated, but that doesn't lend itself nicely to plaintext.

    AND gate: If the inputs are A and B, then the output is AB, or A times B. If one or both of the inputs are 0, then AB is 0 because multiplying by zero always gives you zero. If both inputs are 1, then the output is 1 because 1 times 1 is 1.

    OR gate: If the inputs are A and B, then the output is A + B. So, if both inputs are 0, then the output is 0. If one is 0 and the other is 1, then the output is obviously 1. Now when both inputs are 1, things get a little strange. In Boolean algebra, 1+1 = 1. There is no such thing as 2. It's just convenient to define a new kind of addition like this.

    XOR gate: This is the most complicated one. If the inputs are A and B, then the output is A(B') + (A')B. That's pretty hard to remember, but if you think about it, all it says is "the case where A is 1 and B is 0, PLUS the case where A is 0 and B is 1". Thankfully we have a shorthand for the XOR operation, A B, which is much simpler to write.

    Now you've come to grips with how the different operations look in Boolean algebra, you can go back to the above examples and look at the algebra I've included in each picture, to get a feel for how it works.

    You definitely don't need to know Boolean algebra in order to do wiring in Starbound, but you may find it useful later on to describe complex systems in text rather than in picture form.

    If you want to learn more about Boolean algebra, Wikipedia does a pretty decent job. Like any math article on Wikipedia though, it gets a little heavy.


    Note: Reading Schematics

    Sometimes you might want to follow some schematic you find online or in a book, and rebuild it in Starbound. Starbound gates don't look exactly like the ones you might find in schematics, so you might find this a little tricky. This guide should help you convert between real schematics and Starbound gates.

    [​IMG]

    Fin

    I hope you liked this guide. Try wiring some stuff up yourself and seeing what happens! If you're feeling confident, try making a binary ripple carry adder. If you want to move on to more advanced stuff, check out the other thread!

    Have questions about anything in this guide?
    Have you noticed a mistake or erroneous/outdated info, or want to suggest additions?
    Feel free to post a reply!
     
    Last edited: Apr 21, 2018
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    Really love your guides - Just cause how you made your room and detailed it out
     
  3. colorfusion

    colorfusion Star Wrangler

    Awesome guide.

    Something to note for beginners is that you have to be pretty close to the nodes to wire them up, even though it shows the wire placing from further away.
     
  4. GewaltSam

    GewaltSam Big Damn Hero

    Great guide pal! I was just about to test all that things myself, but you wrote a good guide :)

    May be difficult for some who aren't that familiar with digital logic though, but i guess that would be the case without the guide anyway... Maybe you could write up a few more basics on general logic, like how to read logical equasions :) Just an idea. Sorry if I didn't use the right terms, I had my digital logic and whatnot in german language :p
     
  5. SeaJay

    SeaJay Space Kumquat

    Good point, added.

    I might add a little more math stuff later. What's most important to me is the practical info and worked examples, though. If I wrote a proper guide on Boolean algebra it would be long and boring.
     
  6. GewaltSam

    GewaltSam Big Damn Hero

    Yeah, that shouldn't be necessary. I just missed some of the explanations while i scanned your guide. Don't mind my comment before, but leave the "great guide!" :)
     
  7. backstabbeth

    backstabbeth Pangalactic Porcupine

    ....... Greatest... thread..... ever
     
  8. starboundluver4ever

    starboundluver4ever Space Hobo

    Lol reminds me of my computer technology classs.. :rofl: Just did a test on gates actually before the break :p
     
  9. Toxxi

    Toxxi Space Hobo

    this might be a daft question, but where do you get those switches with the hand symbols? I can't find them on the wiring station :[
     
  10. SeaJay

    SeaJay Space Kumquat

    You gotta nick them from USCM structures.
     
    Last edited: Jan 9, 2014
  11. Kromara

    Kromara Void-Bound Voyager

    Just figured I'd try out your challenge for making a binary ripple carry adder. I was successful. :D
    [​IMG]
    [​IMG]
     
    Ventcorpiangamer, Wolf1e and SeaJay like this.
  12. YiffyRaptor

    YiffyRaptor Void-Bound Voyager

    For some reason I don't appear to have Impervium Consoles listed as being craftable. No consoles or levers of any sort. Any of you guys run into this at all?
     
    Albert_The_Alpaca likes this.
  13. QShadow

    QShadow Scruffy Nerf-Herder

    Ahhhhhh, I love the smell of Boolean in the morning. I'm so glad Starbound uses actual logic gatters cause it was a little harder to built circuits in terraria.
    Ahh this brings back memories when I build an engineering project entirly with redstone in minecraft back in my student days. Luckily enough my Professor was impressed by my boldness and gave me an A ^^


    Really good beginners guide. I think the very basic things which are needed to know are there, KUDOS!
     
    Last edited: Jan 6, 2014
  14. CaptainDingo

    CaptainDingo 2.7182818284590...

    I need to caution users about one thing, and maybe you could add this as a footnote on your original post, but as of Angry Koala (and probably earlier), there are some serious bugs right now with wire connectivity across world chunks. Sometimes (but curiously not always) if everyone leaves a planet where there is some extensive wiring going on, then comes back, an odd anomaly can occur.

    Basically, let's say you have a door that is wired to a switch. The door is in the chunk where you teleport to the planet all the way to the right of the chunk (we'll say the door is in Chunk 1), and the switch is further right, a few blocks, but enough to be in the next chunk (Chunk 2).

    There seems to be the possibility that Chunk 1 will load, Chunk 2 is still loading, and the door will then go "Oops, looks like I don't have any connections" and its wire connection will sever between it and the button. But then Chunk 2 loads later (maybe less than a second later) but the end result is that the door and button are now totally unwired.

    From what I can see, this isn't fixable on our end, we will rely on Chucklefish to repair this problem. So I would just caution against getting too involved building giant wired monstrosities.
     
  15. SeaJay

    SeaJay Space Kumquat

    I whinged about this a bit here. I suspected it had to do with bad loading across chunks but I wasn't sure. If you could repost this explanation in that thread it'd be appreciated.

    Do you have Tier 10 unlocked? Can you craft the other Impervium stuff (beds, lights, etc)?


    Yeah, Terraria is awful for wiring, eh.

    I've considered doing assignments in Minecraft in the past but played the safe route.
     
    Last edited: Jan 9, 2014
  16. YiffyRaptor

    YiffyRaptor Void-Bound Voyager

    I can craft all other Impervium stuff, yes.
     
  17. Paragon123

    Paragon123 Subatomic Cosmonaut

    The timer gate oscillates 1 time per second. This is roughly equivalent to a chain of 25 not gates... so propagation delay is roughly 1/25th of a second.
     
  18. KewlOne

    KewlOne Intergalactic Tourist

    This guide helped me a lot! Thank you sooo much. I'm going to check out your advanced guide now. Thanks again!
     
  19. Zealotical

    Zealotical Yeah, You!

    Holy. I was messing with every switch for atleast an hour straight trying to figure out how to connect a door to turn on turrets when opened, But turn off when the door is closed. When i had the sudden Dawn upon me, that it is 0 when open. So the NOR combination. i'm just so happy. I love the guide. I might have to take more time and make something complex using this. if i can get off of rigging every door on this planet to a turret. God i love wiring.
     
  20. Corraidhín

    Corraidhín Supernova

    *reads guide....scratches head.... headbangs the keyboard*

    really awesome guide :O the pictures really helped the rusty cogs in my head move! (a bit)
     

Share This Page