Pages: [1]   Go Down
Author Topic: Starting A Room Automation System.  (Read 2457 times)
0 Members and 1 Guest are viewing this topic.
Canada
Offline Offline
Jr. Member
**
Karma: 0
Posts: 80
young engineer of the future.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 51
Posts: 3438
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Canada
Offline Offline
Jr. Member
**
Karma: 0
Posts: 80
young engineer of the future.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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);
       
    }
  }
}

       
       
       
       
       
        

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8461
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Tesla Member
***
Karma: 118
Posts: 8967
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why w5100 and not a Ethernet shield?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: