Go Down

Topic: Starting A Room Automation System. (Read 2669 times) previous topic - next topic

Arduino02

Well today is the day I'm going to begin building and automation system for my room. I'm going to start by controlling some leds. I have a two pin thermistor and need to know how to use it with the arduino. the thermistor is out of an old power supply. I'm also going to create a gui on the computer to control the stuff manually if needed. I'm going to start purchasing more stuff as soon as possible. I'll keep you guys posted

wildbill

Search the forum for voltage divider - you should find examples you can use to wire up your thermister.

Arduino02

ok thanks. here's the code I wrote for controlling the led's over serial.
Quote

int incomingByte;

void setup(){
  Serial.begin(9600);
  
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(8, OUTPUT);
}

void loop(){
  if (Serial.available() > 0) {
     incomingByte = Serial.read();
     if (incomingByte == '1') {
      digitalWrite(13, HIGH);
    } 
    
    if (incomingByte == '2') {
      digitalWrite(13, LOW);
    
    if (Serial.available() > 0) {
      incomingByte = Serial.read();
      if (incomingByte == '3') {
      digitalWrite(12, HIGH);
    } 
    
  }
    
    
    if (incomingByte == '4') {
      digitalWrite(12, LOW);
      
      incomingByte = Serial.read();
      if (incomingByte =='5'){
        digitalWrite(11, HIGH);
        
      }
    }
    
    if (incomingByte == '6');
     digitalWrite(11, LOW);
     
      if (Serial.available() > 0) {
      incomingByte = Serial.read();
      if (incomingByte == '7') {
      digitalWrite(10, HIGH);
      
      }
      }
      
      if (incomingByte =='8');
       digitalWrite(10, LOW);
       
       
        if (Serial.available() > 0) {
      incomingByte = Serial.read();
      if (incomingByte == '9') {
      digitalWrite(9, HIGH);
      
      }
        }
      
      
      if (incomingByte =='10');
       digitalWrite(9, LOW);
       
       
        if (Serial.available() > 0) {
      incomingByte = Serial.read();
      if (incomingByte == '11') {
      digitalWrite(8, HIGH);
      
      }
        }
      
      
      if (incomingByte =='12');
       digitalWrite(8, LOW);
       
    }
  }
}

       
       
       
       
       
        


mafa

Dear bdragon123

I'm very interesting in arduino, and I just want to make a little project for the first time in arduino to control a few LED over local network, so
could you help me about:
1. what kind of arduino that I have to buy and other support thing to make my project run?
2. could you provide me information likes schematic and codes for my project?

note: I don't know everything about this project and I hope you give me some (hope more) information what kind of knowledge that I have to know . . .
thanks before 

Graynomad

The code is a bit of a dog's breakfast with too many nested ifs for me to follow. ALso if (incomingByte == '11') doesn't make much sense.

Can we go back to basics?

What exactly is coming down the serial line? ASCII from a human typing on a keyboard, binary from a GUI?

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

zoomkat

Quote
I'm very interesting in arduino, and I just want to make a little project for the first time in arduino to control a few LED over local network, so
could you help me about:
1. what kind of arduino that I have to buy and other support thing to make my project run?
2. could you provide me information likes schematic and codes for my project?


A basic starting point for an "ethernet" network would be to purchase an arduino and a wiznet w5100 based ethernet shield.
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

Gabeks

Why w5100 and not a Ethernet shield?

Targettio

He means you should get the official ethernet shield (which is based on the w5100 chip). Some of the other ethernet shields use a different chip and are (arguably) harder to program.

Go Up