How to send DHTsensors value to another Arduino

Hello from Bulgaria.
First sorry for my bad English ..
I have some issues with my project .. Smart home automation
My idea is this.
How to transfer data between to arduino boards with serial comunication.
1.Arduino nano read information from DHT sensors.
2.I wanna send this information to GENUINO MEGA 2560
3.Arduino mega send data again to my GSM over HC-06
Code for DHT sensor to NANO

// Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain

#include "DHT.h"

#define DHTPIN 2     // what digital pin we're connected to

// Uncomment whatever type you're using!
#define DHTTYPE DHT11   // DHT 11
//#define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321
//#define DHTTYPE DHT21   // DHT 21 (AM2301)


void setup() {
  Serial.println("Please Wait");


void loop() {
  // Wait a few seconds between measurements.

  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  float h = dht.readHumidity();
  // Read temperature as Celsius (the default)
  float t = dht.readTemperature();
  // Read temperature as Fahrenheit (isFahrenheit = true)
  float f = dht.readTemperature(true);
  // Check if any reads failed and exit early (to try again).
  if (isnan(h) || isnan(t) || isnan(f)) {
    Serial.println("Failed to read from DHT sensor!");
  Serial.print(" %\t");
  Serial.println(" *C ");

How i can read this data on mega 2560 and send it again to HC-06
What will be my Receiver code for mega 2560... Tnx a lot friends..

well you need to decide how to transfer the data between the 2 arduinos…

can you have a wire between them? then you can use different protocols over the wires Serial, I2C, SPI, RS485, …

can you use a radio signal? Then you need to choose which one: bluetooth, wifi, nrf24l01, 315/433 MHz Transmitter-receiver Module, …

Once you have decided both the media and protocol to transfer the data, then you can start coding that.

Plenty examples on line for connecting 2 arduinos

I know that. 10x
I will use cable for serial comunication between two arduinos..
TX on nano goes to RX to mega 2560. No radio signal .
I only need to transfer data from nano to mega..:slight_smile:
I new in Arduino programimng :confused:
I just wanna read information on DHT over nano to mega ..
Some simpe code for that will help me a lot... never mind what standart will be I2c SPI..:slight_smile:
Tnx again

Some simpe code for that will help me a lot.

It really doesn't get any simpler than Serial.print().

well then just write to Serial from the Nano and make sure your loop on the Mega waits for the information and captures it

You can read the good Tutorial on Serial by Robin2