Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Peguino Climate Brick
#1
Peguino Climate Brick

This  unit houses and delivers a temperature and humidity sensor e.g. use in a weather station or a mini green house. It contains a high precision DHT22 Temperature and Humidity Sensor with a temperature range from -40ºC to +80ºC and relative humidity from 0 - 100%.

[Image: Brick_Climate_01b.png]


Examples for Peguino Uno Nano and ESP32 V1:

If you use the Climate Brick with a Peguino Uno Nano connect the Climate Brick on connector D3. The black wire must be on the lower bottom pin.
If you use the Climate Brick with a Peguino Uno ESP32 V1 connect the Climate Brick on connector D1. The black wire must be on the lower bottom pin.

1a. Example for Peguino Uno Nano:

To use the Climate Brick with the Arduino IDE and the Peguino Uno Brick using the Arduino Nano you have to include the correct DHT function library which can be done with this  simple steps:
  1. Press CTRL + SHIFT + I to open the Library Manager
  2. type SimpleDHT in the search field and then select "SimpleDHT", click Install and then Close the window.

1. Code example for the Peguino Uno Nano version:
Code:
/*
 Climate Brick
 (C) 2018 by Peguino LTD
 Connect the Climate Brick to port D3
 Version 1
 
 Note: Use the Serial Monitor or Plotter to see the values // Press Ctrl+Shift+L or // Press Ctrl+Shift+M
 The Climate Brick contains a DHT-22 sensor module

 Peguino Uno Nano Board Pinout
            ┌─╥─┐
    D_13  1 │     │ 30  D_12
   3.3 V  2 │     │ 29  D_11
    AREF  3 │     │ 28  D_10
D_14 A_0  4 │     │ 27  D_9
D_15 A_1  5 │     │ 26  D_8
D_16 A_2  6 │     │ 25  D_7
D_17 A_3  7 │     │ 24  D_6
D_18 A_4  8 │     │ 23  D_5
D_19 A_5  9 │     │ 22  D_4
     A_6 10 │     │ 21  D_3
     A_7 11 │     │ 20  D_2
      5V 12 │     │ 19  GND
   Reset 13 │     │ 18  Reset
     GND 14 │     │ 17  D_0 RX
Power In 15 │     │ 16  D_1 TX
            └───┘
 Visit https://www.peguino.com          
*/

#include <SimpleDHT.h>    // needed Library

SimpleDHT22 dht22(6);     // The sensor communicates via the Digital Pin 6 of the Arduino Nano / Connector D3

void setup()
{
 Serial.begin(115200);             // Press Ctrl+Shift+L and set the serial monitor to the same baud rate!
}

void loop()
{
 float temperature = 0;
 float humidity = 0;
 int err = SimpleDHTErrSuccess;
 if ((err = dht22.read2(&temperature, &humidity, NULL)) != SimpleDHTErrSuccess) {
   Serial.print("Read DHT22 failed, err="); Serial.println(err);delay(2000);
   return;
}
 Serial.print("Humidity: ");  
 Serial.print((float)humidity);
 Serial.print(" %, Temp: ");
 Serial.print((float)temperature);
 Serial.println(" Celsius");
 delay(1000);
}



2a. Example for Peguino Uno ESP32 V1:

To use the Climate Brick with the Arduino IDE and the Peguino Uno Brick using the ESP 32 Development Board you have to include the correct DHT function library which can be done with this  simple steps:
  1. Press CTRL + SHIFT + I to open the Library Manager
  2. type  DHT22 in the search field and then select "DHT sensor library for ESPx", click Install and then Close the window.

2b. Code example for the Peguino Uno ESP 32 version:
Code:
/*
  Climate Brick
  (C) 2018 by Peguino LTD
  Connect the Climate Brick to port D1
  Version 1
 
  Note: Use the Serial Monitor or Plotter to see the values Press Ctrl+Shift+L or press Ctrl+Shift+M
  The Climate Brick contains a DHT-22 sensor module

  Peguino Uno ESP 32 Development Board Pinout
            ┌─╥─┐
  3.3     1 │     │ 30  5V
  GND     2 │     │ 29  GND
  GPIO15  3 │     │ 28  GPIO13
  GPIO2   4 │     │ 27  GPIO12
  GPIO4   5 │     │ 26  GPIO14
  GPIO16  6 │     │ 25  GPIO27
  GPIO17  7 │     │ 24  GPIO26
  GPIO5   8 │     │ 23  GPIO25
  GPIO18  9 │     │ 22  GPIO33
  GPIO19 10 │     │ 21  GPIO32
  GPIO21 11 │     │ 20  GPIO35
  GPIO3  12 │     │ 19  GPIO34
  GPIO1  13 │     │ 18  GPIO39
  GPIO22 14 │     │ 17  GPIO36
  GPIO23 15 │     │ 16  Chip enable
            └───┘
  Visit https://www.peguino.com          
*/

#include "DHTesp.h"                 // needed Library
DHTesp dht;
 
void setup()
{
  Serial.begin(115200);             // Press Ctrl+Shift+L and set the serial monitor to the same baud rate!
  dht.setup(26, DHTesp::DHT22);     // The DHT22-sensor "Data" is connected to GPIO 26 which is physically located on Pin 24 and available on Port D1
}
 
void loop()
{
  float temp = dht.getTemperature();
  float hum = dht.getHumidity();
 
  Serial.print("Humidity: ");   
  Serial.print(hum);
  Serial.print(" %, Temp: ");
  Serial.print(temp);
  Serial.println(" Celsius");
  delay(1000);
}


Result:

Press Ctrl+Shift+L


[Image: Climatebrickchart_01.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)