Physics house wiring project

I don't really know much about this detailed computer stuff, but i need help. We have to make a model with a certain number of circuits for physics, and i want to use an arduino uno to control everything with a systematic activation of lights and maybe motors. How do i write a code (which i know nothing about) that will send a signal one after the other, to switch on lights after hitting a switch? I was considering making a fallout vault and having the entrance light turn on, then each level one after the other. The only problem is,
i have no clue how to write code, or wire anything electric for that matter. Thanks for any help, I am clueless.

Top of the page you should see "resources" and in it "getting started". Best place to start.

That helped a little bit, but i don't really know where to start. I have the Arduino Editor open and read through the getting started page. I'm currently requesting to get the Arduino Create Chrome addon unblocked at school. What is a simple code to get it started? Like, say I wanted to push a button and a light turns on after 3 seconds. How would that be put into code? And then how would I properly wire it so the code actually works?

After that, I just want to sequentially have light after light turn on, until all lights are on.

RadFallout100:
That helped a little bit,

As far as I can see less than 2 hours elapsed between Reply #1 and your response to it.

I would have expected someone who is a beginner to have needed between 2 days and 1 week to absorb enough of the stuff in the Reference section to enable him/her to envisage how to implement a project.

...R

Well, under the same "resources" link you will also see "tutorials". Go through each of the "built in examples" and try some out. Everything is explained in a very simple fashion so you just need to make the effort.

I kind of have a code going. I borrowed some code from some examples, so i currently have a switch that activates an LED after 3 seconds (i cant test it right now because i dont have my arduino uno right now, but i verified it with the verify button.) I just hope i wire it right. So, im going to use breadboard and long wires connected to the LEDs. I just don't want to burn out the LEDS or screw something up.

externalfile:drive-abc522d6e40a4f919a92f3a96d952b08a23dca14/root/Screenshot 2018-03-14 at 11.44.09 AM.png

Start with your sequence

light #1 goes on
delay of 3 seconds
light #2 goes on
delay of 5 seconds
fan #1 goes on.........

if the bathroom light is switched on
the light goes on
dleay for 3 seconds
fan is turend on

if the bathroom light is turned off, the fan is turned off at the same time

start with the sequence that you understand and want.

turning lights on and off and timing is all very easy. all beginner stuff.
no need to comlicate it right out of the gate.

but you also need to have a list of the switches (inputs) and lights, fans, etc (outputs)
a spreadsheet of those things might make it simpler.

I have created this. I verified it, but I want to ask you guys if it seems like it will do what I want it to.

/*
Press a switch/button, and after 3 seconds a red led begins blinking. 5 seconds later, a level turns on, and after every second, another level lights up. In order to add another light/motor, add a 'const int ledPin#' and set it = to the number of the pin it is in. Then, use pinMode to label it as an output. Finally, add it to the 'if' statement and the else statement.
*/
const int buttonPin = 1;     // the number of the pushbutton pin
const int ledPin =  2;      // the number of the LED pin
const int ledPin2 = 3;
const int ledPin3 = 4;
const int ledPin4 = 5;
const int ledPin5 = 6;
const int ledPin6 = 7;
const int ledPin7 = 8;
const int ledPin8 = 9;
const int ledPin9 = 10;
const int ledPin10 = 11;
const int ledPin11 = 12;
const int ledPin12 = 13;
const int ledPin13 = 14;
const int ledPin14 = 15;
const int ledPin15 = 16;
const int ledPin16 = 17;
const int ledPin17 = 18;

int buttonState = 0;         // variable for reading the pushbutton status

void setup() {
  
  pinMode(buttonPin, INPUT);            // initialize the pushbutton pin as an input:
  pinMode(ledPin, OUTPUT);             // initialize the LED pin as an output:
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(ledPin4, OUTPUT);
pinMode(ledPin5, OUTPUT);
pinMode(ledPin6, OUTPUT);
pinMode(ledPin7, OUTPUT);
pinMode(ledPin8, OUTPUT);
pinMode(ledPin9, OUTPUT);
pinMode(ledPin10, OUTPUT);
pinMode(ledPin11, OUTPUT);
pinMode(ledPin12, OUTPUT);
pinMode(ledPin13, OUTPUT);
pinMode(ledPin14, OUTPUT);
pinMode(ledPin15, OUTPUT);
pinMode(ledPin16, OUTPUT);
pinMode(ledPin17, OUTPUT);

  buttonState = digitalRead(buttonPin);        // read the state of the pushbutton value:

  if (buttonState == HIGH)            // check if the pushbutton is pressed. If it is, the buttonState is HIGH:

  {
    
    delay(3000);                       // wait 3 seconds
    
    digitalWrite(ledPin, HIGH);      // turn on LED
    
    delay(5000);
    
    digitalWrite(ledPin2, HIGH);      //Floor 1, 2 rooms, 2 LEDs per room.
    digitalWrite(ledPin3, HIGH);
    digitalWrite(ledPin4, HIGH);
    digitalWrite(ledPin5, HIGH);
    
    delay(1000);
    
    digitalWrite(ledPin6, HIGH);       //Floor 2
    digitalWrite(ledPin7, HIGH);
    digitalWrite(ledPin8, HIGH);
    digitalWrite(ledPin9, HIGH);

    delay(1000);
    
    digitalWrite(ledPin10, HIGH);          //Floor 3
    digitalWrite(ledPin11, HIGH);
    digitalWrite(ledPin12, HIGH);
    digitalWrite(ledPin13, HIGH);

    delay(1000);
    
    digitalWrite(ledPin14, HIGH);        //Floor 4
    digitalWrite(ledPin15, HIGH);
    digitalWrite(ledPin16, HIGH);
    digitalWrite(ledPin17, HIGH);
    
  } else {
    
    digitalWrite(ledPin, LOW);        // turn off LEDs
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin3, LOW);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, LOW);
    digitalWrite(ledPin6, LOW);
    digitalWrite(ledPin7, LOW);
    digitalWrite(ledPin8, LOW);
    digitalWrite(ledPin9, LOW);
    digitalWrite(ledPin10, LOW);
    digitalWrite(ledPin11, LOW);
    digitalWrite(ledPin12, LOW);
    digitalWrite(ledPin13, LOW);
    digitalWrite(ledPin14, LOW);
    digitalWrite(ledPin15, LOW);
    digitalWrite(ledPin16, LOW);
    digitalWrite(ledPin17, LOW);
    
  }
}

void loop() {

}

If I wanted to add other things, would I just place them between wherever I would want it? If it is this easy, then i was wondering how different it would be to add motors or speakers that play something, or maybe even some kind of display.

Now the next problem is wiring. Breadboard confuses me, as do what resistors to use, how to use them, what order they need to be in, ect. The most wiring I've ever done is working with my gaming PC, one time I made a weak electromagnet, and one time I used a computer charger to power a CB Radio.

I just noticed there are only 13 regular numbered pins on the UNO. How do I get the rest of the stuff I wanted in there? It isn't possible to wire multiple LEDs on one pin, is it?

You haven't given us any hint what "the rest of the stuff" is? How many and what type of LEDs, switches and other components do you want?

Without knowing any of that how are we supposed to guess what Arduino might suit you or how you might go about connecting your unknown number of unknown components?

Steve

I don't quite know yet myself. I was planning on maybe implementing a motor somewhere, but I'm not sure yet. But right now, it SEEMS like I have too much for the UNO to handle (I don't know,) currently I'm looking for insight and consultation from people who understand this stuff way better. I figured using the UNO to control the whole thing precisely how I see fit and make adjustments easier would be a better plan. Now I want to know if what I have now WILL or WILL NOT work. If it will work (which I would have to change the pins 14-17) then I plan to add a motor, and If I do, I want to know if I can implement it the same way I added LED's.

But you haven't even told us what you have now. If it's just one switch and some LEDs a Uno will be fine. The analog pins can be used as digital pins if you don't need them for analog input. But you don't want the button on Pin1 because that will interfere with using the Serial Monitor for debugging.

A Mega2560 has a lot more pins than a Uno so if you're going to need a lot more "stuff" it might be better for your purposes. Luckily if you write working programs on a Uno it is extremely easy to transfer them to a Mega.

Motors take a lot more current than LEDs so need to be driven differently. If you ever decide what motor you need and what exactly you want to do with it then we can provide more details.

Steve

RadFallout100:
I kind of have a code going. I borrowed some code from some examples, so i currently have a switch that activates an LED after 3 seconds (i cant test it right now because i dont have my arduino uno right now, but i verified it with the verify button.) I just hope i wire it right. So, im going to use breadboard and long wires connected to the LEDs. I just don't want to burn out the LEDS or screw something up.

I saw your code. You have more to learn before you waste your time and keyboard.

In section 5 of the Examples you will find out about arrays, loops and indexes. You will find out about if-else and switch-case.

In the Foundations section under that RESOURCES->TUTORIALS link are links to info on variables and Arduino programing as well as AVR chip info.

Try and get the C basics down just so you don't end up inventing poor work-arounds for what you skipped or have not seen yet, C has some simple but powerful means to save keyboards and fingers from too much abuse.

will i need to use resistors, or can i connect the LED's directly? (I uploaded the program after clearing out 14-17)

RadFallout100:
We have to make a model with a certain number of circuits for physics,

What do you mean by "for physics"?

I have been assuming that you mean a University level physics course. But your Reply #17 seems to contradict that because my physics textbook has a section about semi-conductors and other sections about resistance.

...R

High school. He's teaching some stuff on electricity now, but I don't know anything about resistance, or really how to apply what he's teaching to the project.