ni-c / heimcontrol.js

Home-Automation with node.js and Raspberry PI
MIT License
1.41k stars 297 forks source link

can I have arduino board technical specification to use it? #5

Closed kongaraju closed 10 years ago

kongaraju commented 11 years ago

I am new to hardware, I want to use this project. so I want to buy hardware , please provide me technical specification of Raspberry pi and arduino board.

links will be more helpful

Thanks in advance.

bkiss commented 11 years ago

Hi,

I use Raspberry pi model B,

http://cpcireland.farnell.com/jsp/search/productdetail.jsp?sku=SC12590

with Arduino Uno

http://arduino.cc/en/Main/arduinoBoardUno

and Relay Shield on the top of Arduino:

http://www.seeedstudio.com/wiki/Relay_Shield_V2.0

If you want to get temperature or humidity sensors, i recommend some digital sensors, I use DHT22, but you need to modify the arduino's software.

Best wishes, Barni

kongaraju commented 11 years ago

Thanks Barni,

please provide some more sensors information.

ni-c commented 11 years ago

Hi,

you can find some sensor examples on the Arduino page of the project:

http://ni-c.github.io/heimcontrol.js/plugins/arduino.html

Regards, ni-c

bkiss commented 11 years ago

Kongaraju:

if you want to use DHT22 or DHT11 sensors i will post here the arduino code i use, no problem.

Barni

cdizzel commented 10 years ago

I would really like to see the DHT22 code you use, Im having a few issues. Thanks.

CarlosCondor commented 10 years ago

@cdizzel http://learn.adafruit.com/dht/using-a-dhtxx-sensor

bkiss commented 10 years ago

Huh,

Everything went fine, until the arduino and duino library from raspberry(i think) crashed (?).

Here are the circumstances: i will post here one image showing my problem regarding the DHT22 readings. dht22

I will paste below the arduino code, made from duino and example from the dht22.


include

include

define DHTTYPE DHT22

define DHTPIN 2

define DHT2PIN 3

DHT dht(DHTPIN, DHTTYPE); DHT dht2(DHT2PIN, DHTTYPE);

bool debug = true;

int index = 0;

char messageBuffer[12]; char cmd[3]; char pin[3]; char val[4]; char aux[4];

Servo servo;

void setup() { Serial.begin(115200); dht.begin(); dht2.begin(); }

void loop() { while(Serial.available() > 0) { char x = Serial.read(); if (x == '!') index = 0; // start else if (x == '.') process(); // end else messageBuffer[index++] = x; } }

/*

/*

/*

/*

/*

/*

}

void aw(char pin, char val) { if(debug) Serial.println("aw"); int p = getPin(pin); pinMode(p, OUTPUT); if(p == -1) { if(debug) Serial.println("badpin"); return; } analogWrite(p,atoi(val)); }

int getPin(char *pin) { //Converts to A0-A5, and returns -1 on error int ret = -1; if(pin[0] == 'A' || pin[0] == 'a') { switch(pin[1]) { case '0': ret = A0; break; case '1': ret = A1; break; case '2': ret = A2; break; case '3': ret = A3; break; case '4': ret = A4; break; case '5': ret = A5; break; default: break; } } else { ret = atoi(pin); if(ret == 0 && (pin[0] != '0' || pin[1] != '0')) { ret = -1; } } return ret; }

/*

/*


The main idea is to set on the web interface arduino sensor A0 A1 A2 A3 , and on the arduino i have 2 dht22 sensors.

For one month everything goes well, but now i have many errors on reading, like you see on the picture. Maybe some sync problem, but i'm not shure yet.

I have tryed to solve this:

  1. Changed the code on the arduino, and use the original duino code, and set debug to true, to see the communication --- without success
  2. Clean install raspbian, recompile node, mongo, etc. so fresh install on another sdcard ---- same problem ----without success
  3. Removed every sensor on arduino --- no success
  4. Changed the usb cable, power supplyes ---- no success
  5. as diagnostic run example js code from duino library --- with success --- readings are OK

but something is wrong. :(

Barni

cdizzel commented 10 years ago

Thanks for the help, its much appreciated