Se afișează postările cu eticheta 1602A. Afișați toate postările
Se afișează postările cu eticheta 1602A. Afișați toate postările

miercuri, 16 octombrie 2013

Termometru dublu cu LM335Z si un afisaj LCD cu 16 coloane si 2 randuri (II)

   Mi-am adus aminte de placuta (brick-u') cu LED-ul RGB, de l-am prezentat in articolul Arduino si un LED multicolor (RGB):
si m-am gandit sa fac un "indicator de confort", sa zic asa, adica voi aprinde LED-ul albastru cand este temperatura mai scazuta decat 19 grade Celsius, pe cel verde cand este intre 19 si 26 grade, iar cel rosu daca temperatura este mai mare de 26 grade Celsius.

   Schema de conectare este simpla, combinatia celei de masurare:

 cu cea de afisare cu LED multicolor (RGB):

   Sketch-ul deriva din cel de masurare a 2 temperaturi:
/*
original sketch by niq_ro (Nicu FLORICA) from http://nicuflorica.blogspot.com
version 1.6
program original scris de mine (niq_ro) versiunea 1.6
..............................................................*/

#include <LiquidCrystal.h>
// folosesc libraria pentru afisaje LCD simple
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
// indic modul de legare, vezi mai jos:
/*                                    -------------------
                                      |  LCD  | Arduino |
                                      -------------------
 LCD RS pin to digital pin 7          |  RS   |   D7    |
 LCD Enable pin to digital pin 6      |  E    |   D6    |
 LCD D4 pin to digital pin 5          |  D4   |   D5    |
 LCD D5 pin to digital pin 4          |  D5   |   D4    |
 LCD D6 pin to digital pin 3          |  D6   |   D3    |
 LCD D7 pin to digital pin 2          |  D7   |   D2    |
 LCD R/W pin to ground                |  R/W  |   GND   |
                                      -------------------
*/
// http://arduino.cc/en/Reference/LiquidCrystalCreateChar

byte home13[8] = {
  B00011,
  B00100,
  B01000,
  B11111,
  B01000,
  B01000,
  B01111,
};

byte home23[8] = {
  B00000,
  B10110,
  B01110,
  B11111,
  B00100,
  B00100,
  B11100,
};

byte home33[8] = {
  B00011,
  B10110,
  B01110,
  B11111,
  B00100,
  B00100,
  B11100,
};

byte home03[8] = {
  B11111,
  B00000,
  B00000,
  B11111,
  B00000,
  B00000,
  B11111,
};

byte grad[8] = {
  B01100,
  B10010,
  B10010,
  B01100,
  B00000,
  B00000,
  B00000,
};

byte copac12[8] = {
  B00111,
  B01000,
  B10101,
  B10010,
  B01000,
  B00111,
  B00001,
  B00001,
};

byte copac22[8] = {
  B11000,
  B00110,
  B10101,
  B01001,
  B00010,
  B11100,
  B10000,
  B10000,
};



// variables 
// variabile 
int t1, t2;
float t10, t20;
float t11, t21;
float t12, t22;

int temperaturePin1 = A0; // output from first LM335 is put at analog input no.0
int temperaturePin2 = A1; // output from second LM335 is put at analog input no.1
// cei 2 senzori de temperaturia LM335 sunt legati la pinii A0 si A1

// other  
int led = 13; //pin for LED
int ledr = 11; //pin for red LED
int leda = 10; //pin for blue LED
int ledv = 9; //pin for green LED

void setup() {
  lcd.createChar(0, grad);
  lcd.createChar(1, home13);
  lcd.createChar(2, home23);
  lcd.createChar(3, home33);
  lcd.createChar(4, home03);
  lcd.createChar(5, copac12);
  lcd.createChar(6, copac22);
   
  lcd.begin(16, 2); // set up the LCD's number of columns and rows: 
 

pinMode(led, OUTPUT); 
 lcd.clear(); // clear the screen
 lcd.setCursor(0, 0); // put cursor at colon 2 and row 0 = left/up
 lcd.print("dual thermometer"); // print a text
 lcd.setCursor(1, 1); // put cursor at colon 0 and row 0 = left/down
 lcd.print("1.6 by niq_ro"); // print a text
 delay (2000);
 lcd.clear(); // clear the screen
 

} // END void setup
  
void loop(){

  digitalWrite(led, HIGH);  

  // Read and store Sensor Data
t11=0;
t21=0;
//lcd.clear(); // clear the screen

for (int x=1; x <= 5; x++)
  {
// calculate the value  
t1 = analogRead(temperaturePin1); // read value from temperature from first sensor (LM335);
 t10 = 100.0*(5.0*t1/1023-2.980)+25.0;
 t11 = t10 + t11;

t2 = analogRead(temperaturePin2); // read value from temperature from second sensor (LM335);
 t20 = 100.0*(5.0*t2/1023-2.980)+25.0;
 t21 = t20 + t21;

delay (500);
  }   

t12 = t11/5.0 -2.0 ; // average and corrected temperature  
t22 = t21/5.0 -1.0; // average and corrected temperature  

/*
t1 = analogRead(temperaturePin1); // read value from temperature from first sensor (LM335);
t2 = analogRead(temperaturePin2); // read value from temperature from first sensor (LM335);
t10 = (100.0*(5.0*t1/1023.0-2.980)+25.0)-1.0;
t20 = (100.0*(5.0*t2/1023.0-2.980)+25.0);
*/

analogWrite(ledr, 0); 
analogWrite(leda, 0); 
analogWrite(ledv, 0); 


    lcd.setCursor(3, 0);
    lcd.write(byte(1));
  //  lcd.write(byte(4));
    lcd.write(byte(3));
    lcd.print(":");
  //  lcd.print("t1="); 
    if (t12<10) lcd.print(" "); 
    if (t12>0.0) lcd.print("+"); 
    lcd.print(t12,1);
  //  lcd.write(0b11011111);
  lcd.write(byte(0));
    lcd.print("C");
      
    lcd.setCursor(3, 1);
  //  lcd.print("ext:");
    lcd.write(byte(5));
    lcd.write(byte(6));
    lcd.print(":");
  //  lcd.print("t2="); 
    if (t22<10) lcd.print(" "); 
    if (t22>0.0) lcd.print("+"); 
    lcd.print(t22,1);
   // lcd.write(0b11011111);
   lcd.write(byte(0));
    lcd.print("C");
    
digitalWrite(led, LOW); 

// temperature leds indicator
if (t12<=19.0) analogWrite(leda, 255);
if ((t12>19.0) and (t12<26.0)) analogWrite(ledv, 255);
if (t12>=26.0) analogWrite(ledr, 255);

delay(500);
lcd.setCursor(4, 0);
lcd.write(byte(2));

}
   
   Am realizat si un filmulet numit home vs outside temperature with LM335 and Arduino (IV), care explica mai bine cum se comporta montajul:
Schema completa este:

luni, 14 octombrie 2013

Termometru dublu cu LM335Z si un afisaj LCD cu 16 coloane si 2 randuri

   Fata de articolele precedente cand am folosit trasmiterea prin unde radio a valorilor citite de 2 senzori LM335 (vezi articolul Senzorul de temperatura LM335) si afisarea pe un afisaj LCD cu 16 coloane si 2 randuri conectat la un alt Arduino, acum o sa simplific problema, in sensul ca voi conecta senzorii direct la o placa Arduino, care va afisa valorile pe ecranul LCD1602.
   Schema de conectare a senzorilor si a afisajului este:
   Am facut niste teste, inclusiv un simbol grafic de casa:
si chiar o casa cu un cos de fum:
 
dupa cum se vede in filmuletul numit home vs outside temperature with LM335 and Arduino
   Prima varianta de sketch, in care am folosit si crearea unui simbol (de fapt 2 pentru casuta), dupa cum este prezentat la http://arduino.cc/en/Reference/LiquidCrystalCreateChar:

/*
original sketch by niq_ro (Nicu FLORICA) from http://nicuflorica.blogspot.com
version 1.1
program original scris de mine (niq_ro) versiounea 1.1
..............................................................*/

#include <LiquidCrystal.h>
// folosesc libraria pentru afisaje LCD simple
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
// indic modul de legare, vezi mai jos:
/*                                    -------------------
                                      |  LCD  | Arduino |
                                      -------------------
 LCD RS pin to digital pin 7          |  RS   |   D7    |
 LCD Enable pin to digital pin 6      |  E    |   D6    |
 LCD D4 pin to digital pin 5          |  D4   |   D5    |
 LCD D5 pin to digital pin 4          |  D5   |   D4    |
 LCD D6 pin to digital pin 3          |  D6   |   D3    |
 LCD D7 pin to digital pin 2          |  D7   |   D2    |
 LCD R/W pin to ground                |  R/W  |   GND   |
                                      -------------------
*/
// http://arduino.cc/en/Reference/LiquidCrystalCreateChar
byte smiley[8] = {
  B00000,
  B10001,
  B00000,
  B00000,
  B10001,
  B01110,
  B00000,
};

byte home12[8] = {
  B00001,
  B00110,
  B11000,
  B00111,
  B00100,
  B00100,
  B00111,
};

byte home22[8] = {
  B10000,
  B01100,
  B00011,
  B11100,
  B00100,
  B00100,
  B11100,
};



// variables 
// variabile 
int t1, t2;
float t10, t20;
float t11, t21;
float t12, t22;

int temperaturePin1 = A0; // output from first LM335 is put at analog input no.0
int temperaturePin2 = A1; // output from second LM335 is put at analog input no.1
// cei 2 senzori de temperaturia LM335 sunt legati la pinii A0 si A1

// other  
int led = 13; //pin for LED


void setup() {
  lcd.createChar(0, smiley);
  lcd.createChar(1, home12);
  lcd.createChar(2, home22);
  lcd.begin(16, 2); // set up the LCD's number of columns and rows: 
 

pinMode(led, OUTPUT); 
 lcd.clear(); // clear the screen
 lcd.setCursor(0, 0); // put cursor at colon 2 and row 0 = left/up
 lcd.print("dual thermometer"); // print a text
 lcd.setCursor(0, 1); // put cursor at colon 0 and row 0 = left/down
 lcd.print("1.1 by niq_ro "); // print a text
 lcd.write(byte(0));
 delay (2000);
 lcd.clear(); // clear the screen
 

} // END void setup
  
void loop(){

  digitalWrite(led, HIGH);  

  // Read and store Sensor Data
t11=0;
t21=0;
//lcd.clear(); // clear the screen

for (int x=1; x <= 5; x++)
  {
// calculate the value  
t1 = analogRead(temperaturePin1); // read value from temperature from first sensor (LM335);
 t10 = 100.0*(5.0*t1/1023-2.980)+25.0;
 t11 = t10 + t11;

t2 = analogRead(temperaturePin2); // read value from temperature from second sensor (LM335);
 t20 = 100.0*(5.0*t2/1023-2.980)+25.0;
 t21 = t20 + t21;

delay (500);
  }   

t12 = t11/5.0 -2.0 ; // average and corrected temperature  
t22 = t21/5.0 -1.0; // average and corrected temperature  

/*
t1 = analogRead(temperaturePin1); // read value from temperature from first sensor (LM335);
t2 = analogRead(temperaturePin2); // read value from temperature from first sensor (LM335);
t10 = (100.0*(5.0*t1/1023.0-2.980)+25.0)-1.0; // 
t20 = (100.0*(5.0*t2/1023.0-2.980)+25.0);
*/
lcd.setCursor(14, 0);
lcd.write(byte(1));
lcd.write(byte(2));

    lcd.setCursor(3, 0);
    lcd.print("t1="); 
    if (t12<10) lcd.print(" "); 
    if (t12>0.0) lcd.print("+"); 
    lcd.print(t12,1);
    lcd.write(0b11011111);
    lcd.print("C");
    lcd.setCursor(3, 1);
    lcd.print("t2="); 
    if (t22<10) lcd.print(" "); 
    if (t22>0.0) lcd.print("+"); 
    lcd.print(t22,1);
    lcd.write(0b11011111);
    lcd.print("C");
    
digitalWrite(led, LOW); 
delay(1000);
}
   Pentru a crea casuta, mi-am desenat casuta:
si, dupa cum am scris si inainte, m-am folosit de un exemplu de la Arduino de pe site:
// http://arduino.cc/en/Reference/LiquidCrystalCreateChar
#include 
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

byte smiley[8] = {
  B00000,
  B10001,
  B00000,
  B00000,
  B10001,
  B01110,
  B00000,
};

void setup() {
  lcd.createChar(0, smiley);
  lcd.begin(16, 2);  
  lcd.write(byte(0));
}

void loop() {}
   La mine partea de definitie este:
// partea din stanga
byte home12[8] = {
  B00001,
  B00110,
  B11000,
  B00111,
  B00100,
  B00100,
  B00111,
};
// partea din dreapta
byte home22[8] = {
  B10000,
  B01100,
  B00011,
  B11100,
  B00100,
  B00100,
  B11100,
};
respectiv in partea de setari:
void setup() {
  lcd.createChar(1, home12);
  lcd.createChar(2, home22);

  Ulterior, am modificat "casa" si am schimbat modul de afisare:
- casuta cu animatie, din 2 caractere:
- casuta cu animatie, din 3 caractere:
 - simbolul de grad, mai rotiunjit decat cel original:

Sketch-ul devine:
/*
original sketch by niq_ro (Nicu FLORICA) from http://nicuflorica.blogspot.com
version 1.4
program original scris de mine (niq_ro) versiounea 1.4
..............................................................*/

#include <LiquidCrystal.h>
// folosesc libraria pentru afisaje LCD simple
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
// indic modul de legare, vezi mai jos:
/*                                    -------------------
                                      |  LCD  | Arduino |
                                      -------------------
 LCD RS pin to digital pin 7          |  RS   |   D7    |
 LCD Enable pin to digital pin 6      |  E    |   D6    |
 LCD D4 pin to digital pin 5          |  D4   |   D5    |
 LCD D5 pin to digital pin 4          |  D5   |   D4    |
 LCD D6 pin to digital pin 3          |  D6   |   D3    |
 LCD D7 pin to digital pin 2          |  D7   |   D2    |
 LCD R/W pin to ground                |  R/W  |   GND   |
                                      -------------------
*/
// http://arduino.cc/en/Reference/LiquidCrystalCreateChar

byte home13[8] = {
  B00011,
  B00100,
  B01000,
  B11111,
  B01000,
  B01000,
  B01111,
};

byte home23[8] = {
  B00000,
  B10110,
  B01110,
  B11111,
  B00100,
  B00100,
  B11100,
};

byte home33[8] = {
  B00011,
  B10110,
  B01110,
  B11111,
  B00100,
  B00100,
  B11100,
};

byte home03[8] = {
  B11111,
  B00000,
  B00000,
  B11111,
  B00000,
  B00000,
  B11111,
};

byte grad[8] = {
  B00100,
  B01010,
  B00100,
  B00000,
  B00000,
  B00000,
  B00000,
};


// variables 
// variabile 
int t1, t2;
float t10, t20;
float t11, t21;
float t12, t22;

int temperaturePin1 = A0; // output from first LM335 is put at analog input no.0
int temperaturePin2 = A1; // output from second LM335 is put at analog input no.1
// cei 2 senzori de temperaturia LM335 sunt legati la pinii A0 si A1

// other  
int led = 13; //pin for LED

void setup() {
  lcd.createChar(0, grad);
  lcd.createChar(1, home13);
  lcd.createChar(2, home23);
  lcd.createChar(3, home33);
  lcd.createChar(4, home03);
   
  lcd.begin(16, 2); // set up the LCD's number of columns and rows: 
 

pinMode(led, OUTPUT); 
 lcd.clear(); // clear the screen
 lcd.setCursor(0, 0); // put cursor at colon 2 and row 0 = left/up
 lcd.print("dual thermometer"); // print a text
 lcd.setCursor(1, 1); // put cursor at colon 0 and row 0 = left/down
 lcd.print("1.4 by niq_ro"); // print a text
 delay (2000);
 lcd.clear(); // clear the screen
 

} // END void setup
  
void loop(){

  digitalWrite(led, HIGH);  

  // Read and store Sensor Data
t11=0;
t21=0;
//lcd.clear(); // clear the screen

for (int x=1; x <= 5; x++)
  {
// calculate the value  
t1 = analogRead(temperaturePin1); // read value from temperature from first sensor (LM335);
 t10 = 100.0*(5.0*t1/1023-2.980)+25.0;
 t11 = t10 + t11;

t2 = analogRead(temperaturePin2); // read value from temperature from second sensor (LM335);
 t20 = 100.0*(5.0*t2/1023-2.980)+25.0;
 t21 = t20 + t21;

delay (500);
  }   

t12 = t11/5.0 -2.0 ; // average and corrected temperature  
t22 = t21/5.0 -1.0; // average and corrected temperature  

/*
t1 = analogRead(temperaturePin1); // read value from temperature from first sensor (LM335);
t2 = analogRead(temperaturePin2); // read value from temperature from first sensor (LM335);
t10 = (100.0*(5.0*t1/1023.0-2.980)+25.0)-1.0;
t20 = (100.0*(5.0*t2/1023.0-2.980)+25.0);
*/

    lcd.setCursor(2, 0);
    lcd.write(byte(1));
    lcd.write(byte(4));
    lcd.write(byte(3));
    lcd.print(":");
  //  lcd.print("t1="); 
    if (t12<10) lcd.print(" "); 
    if (t12>0.0) lcd.print("+"); 
    lcd.print(t12,1);
  //  lcd.write(0b11011111);
  lcd.write(byte(0));
    lcd.print("C");
  
  
    lcd.setCursor(2, 1);
    lcd.print("ext:");
  //  lcd.print("t2="); 
    if (t22<10) lcd.print(" "); 
    if (t22>0.0) lcd.print("+"); 
    lcd.print(t22,1);
   // lcd.write(0b11011111);
   lcd.write(byte(0));
    lcd.print("C");
    
digitalWrite(led, LOW); 
delay(500);
lcd.setCursor(4, 0);
lcd.write(byte(2));
}
   Am facut un filmulet, numit home vs outside temperature with LM335 and Arduino (II):
15.10.2013
   M-am gandit sa fac un simbol pentru exterior si am facut un copac din 2 bucati (5 coloane si 8 randuri, anterior faceam cu 7 randuri), apoi am micsorat casuta ca parea hala...
   Dupa ce am (re)vazut articolul LM335 + Arduino temperature sensor de la Legwinskij's Gadgets am refacut si eu simbolul de la grad:
   Ultima varianta este prezentata in filmuletul home vs outside temperature with LM335 and Arduino (III):

joi, 3 octombrie 2013

Module de transmisie/receptie radio si... Arduino (III)

date transmise prin radio la un afisaj LCD cu 16 coloane si 2 randuri conectat prin modul i2c la Arduino

   In continuarea celor 2 parti, voi arata valorile primite de la emitator pe un afisaj LCD 16x2 (1602 = 16 coloane si 2 randuri, care este conectat la placa Arduino prin intermediul modului i2c.
   Schema de conectare este:
   Vreau sa afisez cele 4 valori numerice, numarul pachetului de date si timpul dintre pachetul de date si pana apare urmatorul... pentru a stii daca-s probleme de receptie:
   Am adaptat si scris urmatorul sketch pentru receptor:
/*.............................................................
Sending Multiple Variables Using VirtualWire. Receiver
Author: Rodrigo Mompo Redoli
For http://controlrobotics.rodrigomompo.com
adapted sketch by niq_ro (Nicu FLORICA) from http://nicuflorica.blogspot.com
..............................................................*/

#include <Wire.h> // use Wire library for protocol i2c (A4 = SDA & A5 = SCL)
#include <LiquidCrystal_I2C.h> // use LiquidCrystal_I2C library for control LCD on i2c protocol
LiquidCrystal_I2C lcd(0x20,16,2); // 0x20 is adresss for LCC 16x2

#include <VirtualWire.h> // use Virtual library for decode signal from Rx module
#include <Time.h> // use Time library for control the time between data from receiver

// Sensors 
int Sensor1Data;
int Sensor2Data;
int Sensor3Data;
int Sensor4Data;
  
char StringReceived[22]; 

// other  
int led = 13; //pin for LED
int j=1; // count the messages
int timp1, timp2, dt; // times  

void setup() {
  lcd.init(); // initialing the LCD display
  lcd.backlight(); //backlight is now ON
  lcd.begin(16, 2); // set up the LCD's number of columns and rows: 
  
   // set the time for record time and value
   setTime(0,0,0,25,9,13); // set time to Saturday 8:29:00am Jan 1 2011

pinMode(led, OUTPUT); 

// VirtualWire 
    // Bits per sec
    vw_setup(2000);
    // set pin for connect receiver module 
    vw_set_rx_pin(7);  
    // Start the receiver PLL running
    vw_rx_start();       

 lcd.setCursor(1, 0); // put cursor at colon 2 and row 0 = left/up
 lcd.print("niq_ro's rx is"); // print a text
 lcd.setCursor(1, 1); // put cursor at colon 0 and row 0 = left/down
 lcd.print("ready on 433MHz"); // print a text
 delay (2000);
 lcd.clear(); // clear the screen
 lcd.print(14, 0); 
 lcd.print("0/");
timp2 = 0; 
} // END void setup
  
void loop(){
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;
      
//Taking the data from the control base
    if (vw_get_message(buf, &buflen)) 
    {
      digitalWrite(led, HIGH);
// put the data number from begin
   lcd.clear(); // clear the screen
 if (j<10) lcd.setCursor(14, 0); // put cursor at colon 14 and row 1
if ((j>=10) and (j<100)) lcd.setCursor(13, 0); // put cursor at colon 13 and row 1
if ((j>=100) and (j<1000)) lcd.setCursor(12, 0); // put cursor at colon 12 and row 1
if ((j>=1000) and (j<10000)) lcd.setCursor(11, 0); // put cursor at colon 11 and row 1  
   lcd.print(j);
   lcd.print("/");
   
 int i;
        // Message with a good checksum received, dump it. 
        for (i = 0; i < buflen; i++)
 {            
          // Fill Sensor1CharMsg Char array with corresponding 
          // chars from buffer.   
          StringReceived[i] = char(buf[i]);
     //     Serial.print(StringReceived[i]);
 }
  
      sscanf(StringReceived, "%d,%d,%d,%d,%d,%d",&Sensor1Data, &Sensor2Data,&Sensor3Data,&Sensor4Data); // Converts a string to an array
digitalWrite(led, LOW);        


lcd.setCursor(0, 0);
lcd.print(Sensor1Data);
lcd.print("&");
lcd.print(Sensor2Data);
lcd.print("&");
lcd.setCursor(0, 1);
lcd.print(Sensor3Data);
lcd.print("&");
lcd.print(Sensor3Data);

timp2 = timp1; // new time replace olt time;
j=j++; // count the message         

 memset( StringReceived, 0, sizeof( StringReceived));// This line is for reset the StringReceived

}

// calculate time from last data received
timp1 = hour()*3600 + minute()*60 + second();
dt = timp1-timp2;

if (dt<10) lcd.setCursor(14, 1); // put cursor at colon 14 and row 1
if ((dt>=10) and (dt<100)) lcd.setCursor(13, 1); // put cursor at colon 13 and row 1
if ((dt>=100) and (dt<1000)) lcd.setCursor(12, 1); // put cursor at colon 12 and row 1
if ((dt>=1000) and (dt<10000)) lcd.setCursor(11, 1); // put cursor at colon 11 and row 1
  lcd.print(dt);
  lcd.print("s");
}
   Pentru emitator am folosit tot sketch-ul prezentat la finalul primei parti.
 
   Pentru a fi mai explicit, am facut un mic filmulet cu telefonul (de asta e calitatea foarte scazuta), care se numeste Tx/Rx on 433MHz, 4 value send and displayed on 16x2 LCD:
   Daca tot am ajuns sa folosesc LCD-ul, am mers mai departe si am conectat la emitator senzorul DHT11 care masoara temperatura si umiditatea, similar cu articolul Ministatie meteo cu senzorul DHT11 si.. Arduino, doar ca acum o sa fie "uairles" (wireless), adica fara fir...



   Filmuletul demonstrativ (tot de o calitatea indoielnica) se numeste temperature and humidity from DTH11 send on 433Mhz to another Arduino with i2c LCD1602
   Pentru ca-s "baiat bun" pun si cele 2 sketch-uri: - pentru emitator:
/*.............................................................
Sending Multiple Variables Using VirtualWire. Transmitter
Author: Rodrigo Mompo Redoli
For controlrobotics.rodrigomompo.com
adapted sketch by niq_ro (Nicu FLORICA) from http://nicuflorica.blogspot.com  
..............................................................*/
#include <VirtualWire.h>

#include "DHT.h"
#define DHTPIN A2     // what pin we're connected to
#define DHTTYPE DHT11   // DHT 11 
DHT dht(DHTPIN, DHTTYPE);

int ledPin = 13;
char Sensor1CharMsg[21];// The string that we are going to send trought rf 
 
void setup() {
  dht.begin();  // initialing the DHT sensor
 
 // LED 
 pinMode(ledPin,OUTPUT);
  
 
 // VirtualWire setup
 vw_setup(2000); // Bits per sec
 vw_set_tx_pin(12);// Set the Tx pin. Default is 12
 
}
 
void loop() {
  digitalWrite(ledPin, HIGH);  
  // Read and store Sensor Data
  int Sensor1Data = dht.readHumidity();
  int Sensor2Data = dht.readTemperature();;
   
  sprintf(Sensor1CharMsg, "%d,%d", Sensor1Data, Sensor2Data);
  
 // Turn on a light to show transmitting
 vw_send((uint8_t *)Sensor1CharMsg, strlen(Sensor1CharMsg));
 vw_wait_tx(); // Wait until the whole message is gone
 // Turn off a light after transmission
 delay(100);
 digitalWrite(ledPin, LOW); 
 delay(3000);
}
- pentru receptor:
/*.............................................................
Sending Multiple Variables Using VirtualWire. Receiver
Author: Rodrigo Mompo Redoli
For http://controlrobotics.rodrigomompo.com
adapted sketch by niq_ro (Nicu FLORICA) from http://nicuflorica.blogspot.com
..............................................................*/

#include <Wire.h> // use Wire library for protocol i2c (A4 = SDA & A5 = SCL)
#include <LiquidCrystal_I2C.h> // use LiquidCrystal_I2C library for control LCD on i2c protocol
LiquidCrystal_I2C lcd(0x20,16,2); // 0x20 is adresss for LCC 16x2

#include <VirtualWire.h> // use Virtual library for decode signal from Rx module
#include <Time.h> // use Time library for control the time between data from receiver

// Sensors 
int Sensor1Data;
int Sensor2Data;
int h, t;
 
char StringReceived[21]; 

// other  
int led = 13; //pin for LED
int j=1; // count the messages
int timp1, timp2, dt; // times  

void setup() {
  lcd.init(); // initialing the LCD display
  lcd.backlight(); //backlight is now ON
  lcd.begin(16, 2); // set up the LCD's number of columns and rows: 
  
   // set the time for record time and value
   setTime(0,0,0,25,9,13); // set time to Saturday 8:29:00am Jan 1 2011

pinMode(led, OUTPUT); 

// VirtualWire 
    // Bits per sec
    vw_setup(2000);
    // set pin for connect receiver module 
    vw_set_rx_pin(7);  
    // Start the receiver PLL running
    vw_rx_start();       

 lcd.setCursor(1, 0); // put cursor at colon 2 and row 0 = left/up
 lcd.print("niq_ro's rx is"); // print a text
 lcd.setCursor(1, 1); // put cursor at colon 0 and row 0 = left/down
 lcd.print("ready on 433MHz"); // print a text
 delay (2000);
 lcd.clear(); // clear the screen
 lcd.setCursor(14, 0); 
 lcd.print("0/");
timp2 = 0; 
} // END void setup
  
void loop(){
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;
      
//Taking the data from the control base
    if (vw_get_message(buf, &buflen)) 
    {
      digitalWrite(led, HIGH);
// put the data number from begin
   lcd.clear(); // clear the screen
if (j<10) lcd.setCursor(14, 0); // put cursor at colon 14 and row 1
if ((j>=10) and (j<100)) lcd.setCursor(13, 0); // put cursor at colon 13 and row 1
if ((j>=100) and (j<1000)) lcd.setCursor(12, 0); // put cursor at colon 12 and row 1
if ((j>=1000) and (j<10000)) lcd.setCursor(11, 0); // put cursor at colon 11 and row 1  
   lcd.print(j);
   lcd.print("/");
   
 int i;
        // Message with a good checksum received, dump it. 
        for (i = 0; i < buflen; i++)
 {            
          // Fill Sensor1CharMsg Char array with corresponding 
          // chars from buffer.   
          StringReceived[i] = char(buf[i]);
     //     Serial.print(StringReceived[i]);
 }
  
      sscanf(StringReceived, "%d,%d",&Sensor1Data, &Sensor2Data); // Converts a string to an array
digitalWrite(led, LOW);        
h = Sensor1Data;
t = Sensor2Data;

/*
lcd.setCursor(0, 0);
lcd.print(Sensor1Data);
lcd.print("&");
lcd.print(Sensor2Data);
lcd.print("&");
lcd.setCursor(0, 1);
//lcd.print(Sensor3Data);
//lcd.print("&");
//lcd.print(Sensor3Data);
*/
    lcd.setCursor(0, 0);
    lcd.print("temp="); 
    lcd.print(t);
    lcd.write(0b11011111);
    lcd.print("C");
    lcd.setCursor(0, 1);
    lcd.print("umid="); 
    lcd.print(h);
    lcd.print("%");

timp2 = timp1; // new time replace olt time;
j=j++; // count the message         

 memset( StringReceived, 0, sizeof( StringReceived));// This line is for reset the StringReceived
}


// calculate time from last data received
timp1 = hour()*3600 + minute()*60 + second();
dt = timp1-timp2;

if (dt<10) lcd.setCursor(14, 1); // put cursor at colon 14 and row 1
if ((dt>=10) and (dt<100)) lcd.setCursor(13, 1); // put cursor at colon 13 and row 1
if ((dt>=100) and (dt<1000)) lcd.setCursor(12, 1); // put cursor at colon 12 and row 1
if ((dt>=1000) and (dt<10000)) lcd.setCursor(11, 1); // put cursor at colon 11 and row 1
  lcd.print(dt);
  lcd.print("s");
}

4.10.2013
    Un filmulet de o calitate mai buna, se numeste temperature and humidity from DHT11 send on 433MHz to another Arduino with i2c LCD1602 (II)
8.10.2013
    Am inlocuit placuta mea Arduiniq (Arduino de casa) cu placa primita de la Nelu:
apoi am schimbat rolurile:
iar senzorul DHT11 masoara temperatura si umiditatea de afara...
   Dupa cum se constata e cam frig si cam umed afara:
   Am facut un filmulet cu noua configuratie, care se numeste temperature and humidity from DHT11 send on 433MHz to another Arduino with i2c LCD1602 (III):