Show Posts
Pages: [1]
1  Topics / Interactive Art / Re: RGB LED issues HELP on: May 03, 2013, 12:07:49 pm
That wasn't really helpful Kirash. What do you want me to show? I study design so wouldnt know where to begin drawing you a circuit diagram.
2  Topics / Interactive Art / RGB LED issues HELP on: May 03, 2013, 11:18:36 am
Hey I have my system all setup and it half works, except my RGB LEDs are not working correctly. they are all wired in correctly, but the LEDs ONLY light up when wired in wrong? i.e when the ground is collected to one of the RGB cathodes. It should be RG(Grnd)B.

Anyone see a fault in my coding or know what this problem may be? Apologies if my code looks like a complete hack job, its because it is!







#include <dht11.h>

//
//   FILE:  dht11_test1.pde
// PURPOSE: DHT11 library test sketch for Arduino
//

//Celsius to Fahrenheit conversion
double Fahrenheit(double celsius)
{
   return 1.8 * celsius + 32;
}

// fast integer version with rounding
//int Celcius2Fahrenheit(int celcius)
//{
//  return (celsius * 18 + 5)/10 + 32;
//}


//Celsius to Kelvin conversion
double Kelvin(double celsius)
{
   return celsius + 273.15;
}

// dewPoint function NOAA
// reference: http://wahiduddin.net/calc/density_algorithms.htm
double dewPoint(double celsius, double humidity)
{
   double RATIO = 373.15 / (273.15 + celsius);  // RATIO was originally named A0, possibly confusing in Arduino context
   double SUM = -7.90298 * (RATIO - 1);
   SUM += 5.02808 * log10(RATIO);
   SUM += -1.3816e-7 * (pow(10, (11.344 * (1 - 1/RATIO ))) - 1) ;
   SUM += 8.1328e-3 * (pow(10, (-3.49149 * (RATIO - 1))) - 1) ;
   SUM += log10(1013.246);
   double VP = pow(10, SUM - 3) * humidity;
   double T = log(VP/0.61078);   // temp var
   return (241.88 * T) / (17.558 - T);
}

// delta max = 0.6544 wrt dewPoint()
// 5x faster than dewPoint()
// reference: http://en.wikipedia.org/wiki/Dew_point
double dewPointFast(double celsius, double humidity)
{
   double a = 17.271;
   double b = 237.7;
   double temp = (a * celsius) / (b + celsius) + log(humidity/100);
   double Td = (b * temp) / (a - temp);
   return Td;
}

int redpin = 11;
int greenpin = 10;
int bluepin = 9;

int redpin2 = 3;
int greenpin2 = 5;
int bluepin2 = 6;

int temperature;

#include <dht11.h>

dht11 DHT11;

#define DHT11PIN A0

void setup()
{
  Serial.begin(9600);
  Serial.println("DHT11 TEST PROGRAM ");
  Serial.print("LIBRARY VERSION: ");
  Serial.println(DHT11LIB_VERSION);
  Serial.println();
  pinMode(redpin, OUTPUT);
  pinMode(greenpin, OUTPUT);
  pinMode(bluepin, OUTPUT);
 
  pinMode(redpin2, OUTPUT);
  pinMode(greenpin2, OUTPUT);
  pinMode(bluepin2, OUTPUT);
}

void loop()
{
 
  temperature = (float)DHT11.temperature, 2;
 
  if(temperature>=19){
    analogWrite(redpin, 255);
    analogWrite(greenpin, 255);
    analogWrite(bluepin, 255);
        analogWrite(redpin2, 255);
    analogWrite(greenpin2, 255);
     analogWrite(bluepin2, 255);
       
  }
  if(temperature>=20){
    analogWrite(redpin, 255);
    analogWrite(greenpin, 255);
    analogWrite(bluepin, 255);
        analogWrite(redpin2, 255);
    analogWrite(greenpin2, 255);
     analogWrite(bluepin2, 255);
  }
 
  if(temperature>=21){
    analogWrite(redpin, 255);
    analogWrite(greenpin, 255);
    analogWrite(bluepin, 225);
        analogWrite(redpin2, 255);
    analogWrite(greenpin2, 255);
     analogWrite(bluepin2, 255);
  } 
     if(temperature>=22){
    analogWrite(redpin, 255);
    analogWrite(greenpin, 255);
    analogWrite(bluepin, 255);
        analogWrite(redpin2, 255);
    analogWrite(greenpin2, 255);
     analogWrite(bluepin2, 255);
}
  if(temperature>=23){
    analogWrite(redpin, 255);
    analogWrite(greenpin, 255);
    analogWrite(bluepin, 255);
        analogWrite(redpin2, 255);
    analogWrite(greenpin2, 255);
     analogWrite(bluepin2, 255);
}
 
  if(temperature>=24){
    analogWrite(redpin, 112.5);
    analogWrite(greenpin, 255);
    analogWrite(bluepin, 112.5);
        analogWrite(redpin2, 112.5);
    analogWrite(greenpin2, 255);
     analogWrite(bluepin2, 112.5);
}
 
if(temperature>=25){
    analogWrite(redpin, 0);
    analogWrite(greenpin, 255);
    analogWrite(bluepin, 255);
        analogWrite(redpin2, 0);
    analogWrite(greenpin2, 255);
     analogWrite(bluepin2, 255);
  } 
 
 
  Serial.println("\n");

  int chk = DHT11.read(DHT11PIN);

  Serial.print("Read sensor: ");
  switch (chk)
  {
    case DHTLIB_OK:
      Serial.println("OK");
      break;
    case DHTLIB_ERROR_CHECKSUM:
      Serial.println("Checksum error");
      break;
    case DHTLIB_ERROR_TIMEOUT:
      Serial.println("Time out error");
      break;
    default:
      Serial.println("Unknown error");
      break;
  }

  Serial.print("Temperature (oC): ");
  Serial.println((float)DHT11.temperature, 2);
 

  delay(500);
}
3  Topics / Interactive Art / Re: Controlling a RGB LED via temperature HELP on: April 27, 2013, 02:36:04 pm
Giving your opinion of whether you think this is the right or wrong project for me to be doing isn't what I was asking and I don't need you to patronise me. And yes I can read a temperature from the DHT11 and I can adjust the brightness with the photocell. I am just unable to map a RGB colour to the temperature and blend the two scripts together.
4  Topics / Interactive Art / Controlling a RGB LED via temperature HELP on: April 27, 2013, 01:39:02 pm
Hi I have a DHT11 Temperature and humidity sensor, Single RGB LED and a Photocell.

I need to set up my board so that the RGB colour will match the room temperature (cold = blue hot - red) and with the photocell to control the brightness of the LED.

Could someone please help me here as I am completely new at this and have till monday to get it done!!!  smiley-sad

Thank you!
5  Topics / Home Automation and Networked Objects / Outputting Twitter Parse on: April 07, 2013, 02:23:10 pm
Can anyone help me with parsing data from twitter for a project im working on as I am a complete beginner here!!

What I want to do is get data (temperature) from hourly tweets from: https://twitter.com/WeatherBangkok

And then output the temperature via a RGB LED, so 30ยบ would be set to, fro example 100, 0, 0 etc.

Thank you smiley
6  Topics / Home Automation and Networked Objects / Two Arduino connected via wifi shield? on: March 14, 2013, 10:23:07 am
Hey,

One of my university modules (experiential design) involves creating an interactive system with Arduino. A concept I currently have would be set up as followed:

Arduino ONE:
Wifi Shield
Mic
LED Matrix

Arduino TWO:
Wifi Shield
Mic
LED Matrix

Arduino ONE would INPUT sound via mic and OUTPUT via the LED Matrix of Arduino TWO - This would work vice-versa with both units as a form of ambient communication.

I was wondering if anyone could help me by pointing me in the right direction to setting up two wifi linked/networked Arduino's.

Would this involve having a webpage where the data is uploaded and downloaded and each Arduino points to this page?

Any help would be greatly appreciated.

Thanks,
Nathan smiley
Pages: [1]