Arduino Sensor That Senses Humans/Animals Via Temprature?

Hi! I'm looking for a sensor that is similar to this one but that can be used with the Arduino.   I'm really new at this... so the less complicated, the better. I've got this sensor up and working:;=en-US but it can sense other objects (in my case, moving fabric) which will screw up what I'm doing. Right.  What I'm doing.   I'm making a giant Nylon inflatable piece that is run by constant air flow.  My goal:  when a person walks into this inflatable structure and encounters the sensor hanging in the center of the structure, the fan that is inflating the piece turns off.  When the person walks out of the sensor's range, the fan turns back on.   The setup that I currently have is attached. The code I am using is:   int analogPin=A0; int analogValue=0; void setup() {   Serial.begin(9600);   pinMode(12, OUTPUT); } void loop() {   analogValue = analogRead(analogPin);   Serial.println(analogValue);     if (analogValue > 250){      delay(3000);  //wait 3 seconds...     digitalWrite(12, LOW);  //turn fan off   } else if (analogValue <249){      delay(1000); //wait 1 second...     digitalWrite(12, HIGH);  //turn fan on }

Question by granule   |  last reply

Timer,Temprature & Humidity Based Relay Switching with Arduino Mega.? Answered

I am making a Climate Controler for my Green House. Please help me about Arduino code for Four Relay operation. relay1 will be high when Temp will rise higher then Temprature value defined and will low when reach under defined value. relay2 will be high when Humidity will rise higher then Humidity value defined and will low when reach under defined value  relay3 will be high for 10 Minutes in every 120 Minutes. relay4 will be high for 10 Minutes in every 120 Minutes.  I am Using DHT11 sensor with Mega2560 Board. Currently using this code. Its working for Temp & Humidty based Relay operation only. Need to add two relay with Timer based operation. System needs to check Humidity and Temprature value in every 10 minutes. Please Help.  I am very new for Arduino and making this for my personal use. #include #include #include /*-----( Declare objects )-----*/ // set the LCD address to 0x27 for a 20 chars 4 line display // Set the pins on the I2C chip used for LCD connections: //                    addr, en,rw,rs,d4,d5,d6,d7,bl,blpol LiquidCrystal lcd(20, 19, 18, 17, 16, 15); // Set the LCD I2C address dht11 DHT11; /*-----( Declare Constants, Pin Numbers )-----*/ #define DHT11PIN 22 #define RELAY1  6                        #define RELAY2  7                        #define RELAY3  4                        #define RELAY4  5 #define TempTarget 30 #define HUMTarget 50 void setup()   /*----( SETUP: RUNS ONCE )----*/ {   Serial.begin(9600); //(Remove all 'Serial' commands if not needed)   lcd.begin(20,2);         // initialize the lcd for 20 chars 4 lines, turn on backlight     // Print a message to the LCD.   //lcd.setCursor(0, 1);   lcd.print("SHOURYA's GARDEN");   // Initialise the Arduino data pins for OUTPUT   pinMode(RELAY1, OUTPUT);         pinMode(RELAY2, OUTPUT);   pinMode(RELAY3, OUTPUT);   pinMode(RELAY4, OUTPUT);   }/*--(end setup )---*/ void loop()   /*----( LOOP: RUNS CONSTANTLY )----*/ {   int chk =;   Serial.print   ("GARDEN DATA SENSING ");   switch (chk)   {     case 0: Serial.println(" OK"); break;     case -1: Serial.println("Checksum error"); break;     case -2: Serial.println("Time out error"); break;     default: Serial.println("Unknown error"); break;   }   lcd.setCursor(0, 1);   lcd.print("TempC=");   lcd.print((float)DHT11.temperature, 0);   Serial.print("Temperature (oC): ");   Serial.println((float)DHT11.temperature, 2);   //lcd.print(" F=");   //lcd.print(Fahrenheit(DHT11.temperature), 0);   //Serial.print("Temperature (oF): ");   //Serial.println(Fahrenheit(DHT11.temperature), 2);     lcd.print(" Hum=");   lcd.print((float)DHT11.humidity, 0);   lcd.print("%");   Serial.print("Humid(%): ");   Serial.println((float)DHT11.humidity, 2);    //Serial.print("Temperature (K): ");   //Serial.println(Kelvin(DHT11.temperature), 2);   //Serial.print("Dew Point (oC): ");   //Serial.println(dewPoint(DHT11.temperature, DHT11.humidity));   //Serial.print("Dew PointFast (oC): ");   //Serial.println(dewPointFast(DHT11.temperature, DHT11.humidity));        if (DHT11.temperature > TempTarget)       { Serial.println("Turning on Exaust Fan"); //lcd.print("Turning on Exaust Fan"); digitalWrite (RELAY1, HIGH); delay(1000);     }      if (DHT11.temperature < TempTarget)     { Serial.println("Turning Off Exaust Fan"); //lcd.print("Turning off Exaust Fan"); digitalWrite (RELAY1, LOW); delay(1000);     }       if (DHT11.humidity < HUMTarget)     { Serial.println("Turning on HUMIDIFIER"); //lcd.print("Turning on HUMIDIFIER"); digitalWrite (RELAY2, HIGH); delay(1000);     }      if (DHT11.humidity > HUMTarget)     { Serial.println("Turning Off HUMIDIFIER"); //lcd.print("Turning off HUMIDIFIER"); digitalWrite (RELAY2, LOW); delay(1000);     }       digitalWrite(RELAY3,HIGH);           // Turns ON Relays 3    digitalWrite(RELAY4,HIGH);           // Turns ON Relays 4    delay(10*1000);     digitalWrite(RELAY3,LOW);          // Turns Relay Off    digitalWrite(RELAY4,LOW);          // Turns Relay Off   }/* --(end main loop )-- */ /*-----( Declare User-written Functions )-----*/ // //Celsius to Fahrenheit conversion double Fahrenheit(double celsius) {         return 1.8 * celsius + 32; } //Celsius to Kelvin conversion double Kelvin(double celsius) {         return celsius + 273.15; } // dewPoint function NOAA // reference: double dewPoint(double celsius, double humidity) {         double A0= 373.15/(273.15 + celsius);         double SUM = -7.90298 * (A0-1);         SUM += 5.02808 * log10(A0);         SUM += -1.3816e-7 * (pow(10, (11.344*(1-1/A0)))-1) ;         SUM += 8.1328e-3 * (pow(10,(-3.49149*(A0-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: 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; } /* ( THE END ) */

Question by achauhan13   |  last reply

How to show 3 different temperatures using 3 LEDs connected to a ATtiny85?

Hi people I am trying to build a temperature sensor using 3 LEDs. The aim is to have them come on at specific temperatures. This is for my motorcycle ride to work this coming winter. I want to know when the temp goes below 8c down to 5c from 5c down to 0c then below. I have managed to do this via a arduino board & a LM35 sensor and 3 LEDs. But I cant get this to work on the ATtiny85 chip. Below is the code I wrote for this on the arduino. Any help or different program would be of great. *my first attempt at a temp warning light need it to come on when temp lower than 5deg celsius */ int tempPin = A1; int led01 = 8; int led02 = 9; int led03 = 10; int tempMax = 28; int tempMid = 27; int tempMin = 5; int temp; void setup() {   Serial.begin(9600);     pinMode (led01, OUTPUT);   pinMode (led02, OUTPUT);   pinMode (led03, OUTPUT);   pinMode (tempPin, INPUT); }     void loop() {      temp = analogRead(tempPin);      temp = temp * 0.48828125;     Serial.print("TEMPRATURE = ");   Serial.print(temp);   Serial.print("*C");   Serial.println();   delay(1000);   if (temp > tempMax){   digitalWrite(led01, HIGH);   digitalWrite(led02, LOW);   digitalWrite(led02, LOW);   } if (temp < tempMid){   digitalWrite(led01, LOW);   digitalWrite(led02, HIGH);   digitalWrite(led02, LOW);   } if (temp < tempMin){   digitalWrite(led01, LOW);   digitalWrite(led02, LOW);   digitalWrite(led02, LOW); }}

Question by minimadmalc   |  last reply

Using TEC chips and heatsinks for personal cooling - heating collars or pads

I've been toying with using TEC chips (facinating devices that are cheap - applying voltage make one side hot - the other cold, Inversely, appling any existing temprature differential to the sinks PRODUCES POWER). They are used most commonly by consumers in auto beverage coolers and heaters. It  started when a car ran me down on my bike, and I was wearing a neck brace for months. I thought about how misserable I'd be if it were summertime. I also thought of those poor people that always wore them... Anyway, there's a thousand different easy ways to do this - I took fluid-filled plastic sections of a beverage cooler and attached them to a belt, which hangs around my neck. applied the heat  sink of the TEC and there you go - just wrap it in something. Now if I were on a motorcycle in summer and stopped in traffic, the cool collar would be a lifesaver, as well as a myriad of other apps. I cannot figure out the best (inexpensive) way to control this. It's easy enough to turn on and off - you can hardly forget it! But if I allow the chip to get too much wattage it will get too hot and self-destruct. Also, if I limit the wattage correctly, it would just need adjusting, and could be left on most of the time. The idea here is there are many ways to do this but they are too expensive... I want everyone to be able to afford it. If you use a Pot or resistor, the excess goes to heat and ruins battery life, and other controllers of DC current are expensive. Any help? I am almost 60 and have earned the nickname Misc. Expert among my family and friends, and I must say I'm very impressed with what y'all do here in this newsletter - Congrats!

Topic by miscexpert   |  last reply