Transmit data from sensors

Hi there, i have an arduino uno with a rfm12b connected and an arduino pro mini with a ftdi module attached. On 2 breadboards i attached 6 sensors(3 on each breadboard) and i want to transmit the data of this sensors wireless, but idk how. Arduino pro mini need to be tx and arduino uno rx. I worked on something but I stuck, I will attach here the code from sensors, separately this code work, i can get the data. i found here examples with rfm12b, but still can’t and dont know how to transmit. Can help me anyone?

Receiver.ino (1.51 KB)

Transmitter.ino (5.06 KB)

U only mention one RFM12b attached to the Uno. RFM12b if I recall correctly is a transceiver. But u need 2 of them for a wireless transmission.

Given your description of your setup vs what u want to do, I would suggest u post some photos so you can get more informed advice.

I mention just one rfm12b because the transmitters are arduino pro mini(tx) with a ftdi module and the receiver is rfm12b(rx) with arduino uno. i will add here the systemes and some sketches made in fritzing maybe it’ll help more. So, i want to transmit sensor data via arduino pro mini to arduino uno(rfm12b), i tried something but i stuck. Thanks!

i put this link cause i cant attach images here, content to long
http://1drv.ms/1Jx5Y1A

Receiver.ino (1.51 KB)

Transmitter.ino (5.06 KB)

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you please post a copy of your sketch, using code tags?
They are made with the </> icon in the reply Menu.
See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Tom…

// Receiver

#include <JeeLib.h>  
#include <Wire.h>
#include <BH1750FVI.h>
#include "Adafruit_SI1145.h"
#include "HTU21D.h"
#include <SFE_BMP180.h>

#define myNodeID 9          
#define RF_freq RF12_433MHZ   
#define ALTITUDE 80.0
 
int tmp102Address = 0x48;
BH1750FVI LightSensor;
Adafruit_SI1145 uv = Adafruit_SI1145();
HTU21D myHumidity;
SFE_BMP180 pressure;

typedef struct { float light, sound, temperatureIn, temperatureOut, humidity, relPressure, absPressure; } PayloadTX;
PayloadTX testtx;  

const int testTx_NodeID=9;            

void setup() {
  
  rf12_initialize(myNodeID,RF_freq);   
  Serial.begin(9600); 
  Serial.println("Receiver"); 
}
void loop() {
  
 if (rf12_recvDone()){    
  if (rf12_crc == 0 && (rf12_hdr & RF12_HDR_CTL) == 0) {
    
    int node_id = (rf12_hdr & 0x1F);  //extract nodeID from payload
        
    if (node_id == testTx_NodeID)  {             //check data is coming from node with the corrct ID
        testtx=*(PayloadTX*) rf12_data;            // Extract the data from the payload 
   Serial.print("light: "); Serial.println(testtx.light); 
   Serial.print("sound: "); Serial.println(testtx.sound); 
   Serial.print("temperatureIn: "); Serial.println(testtx.temperatureIn); 
   Serial.print("temperatureOut: "); Serial.println(testtx.temperatureOut); 
   Serial.print("humidity: "); Serial.println(testtx.humidity); 
   Serial.print("relPressure: "); Serial.println(testtx.relPressure); 
   Serial.print("absPressure: "); Serial.println(testtx.absPressure); 
   Serial.println("  ");  
  }
 }
}
}
// Trasmitter

#include <JeeLib.h>  
#include <Wire.h>
#include <BH1750FVI.h>
#include <Adafruit_SI1145.h>
#include <HTU21D.h>
#include <SFE_BMP180.h>

#define myNodeID 9          
#define RF_freq RF12_433MHZ   
#define ALTITUDE 80.0
 
int tmp102Address = 0x48;
BH1750FVI LightSensor;
Adafruit_SI1145 uv = Adafruit_SI1145();
HTU21D myHumidity;
SFE_BMP180 pressure;


typedef struct { float light, sound, temperatureIn, temperatureOut, humidity, relPressure, absPressure; } PayloadTX;   
PayloadTX testtx;  

void setup() {
  rf12_initialize(myNodeID,RF_freq); 
Serial.begin(9600);
LightSensor.begin();

Serial.println("Transmitter");
  if (! uv.begin()) {
    Serial.println("Didn't find Si1145");
    while (1);
    myHumidity.begin();
}
{
  if (pressure.begin())
   Serial.println("BMP180 init success");
  else
  {
    Serial.println("BMP180 init fail\n\n");
    while(1); // Pause forever.

}
void loop() {
   uint16_t lux = LightSensor.GetLightIntensity();
   float celsius = getTemperature();
  testtx.light=testtx.light;
  testtx.sound=testtx.sound;
  testtx.temperatureIn=temperatureIn;
  testtx.temperatureOut=testtx.temperatureOut;
  testtx.humidity=testtx.humidity;
  testtx.relPressure=testtx.relPressure;
  testtx.absPressure=testtx.absPressure;

  
  Serial.println(celsius);
    
    rf12_sendNow(0, &testtx, sizeof testtx);                    
    rf12_sendWait(2);
    
   Serial.print("light: "); Serial.println(testtx.light); 
   Serial.print("sound: "); Serial.println(testtx.sound); 
   Serial.print("temperatureIn: "); Serial.println(testtx.temperatureIn); 
   Serial.print("temperatureOut: "); Serial.println(testtx.temperatureOut); 
   Serial.print("humidity: "); Serial.println(testtx.humidity); 
   Serial.print("relPressure: "); Serial.println(testtx.relPressure); 
   Serial.print("absPressure: "); Serial.println(testtx.absPressure); 
   Serial.println("  "); 
  
  delay(4000);

  float getTemperature(){
  Wire.requestFrom(tmp102Address,2); 

  byte MSB = Wire.read();
  byte LSB = Wire.read();

  int TemperatureSum = ((MSB << 8) | LSB) >> 4; 

  float celsius = TemperatureSum*0.0625;
  return celsius;
}

// Code from sensors, each module look like

// inside

/*void setup() {   
   Serial.begin(9600);
  LightSensor.begin();
  LightSensor.SetAddress(Device_Address_H);//Address 0x5C
  LightSensor.SetMode(Continuous_H_resolution_Mode);  
  Serial.println("Running...");  
  {
  Serial.begin(9600);
  Wire.begin();
}
 }

void loop() {
   uint16_t lux = LightSensor.GetLightIntensity();// Get Lux value
  Serial.print("Light: ");
  Serial.print(lux);
  Serial.println(" lux");
  Serial.println("==================");
  delay(3000);
{
    Serial.println(analogRead(A0));
    Serial.println("==================");
  }
  
  {
  float celsius = getTemperatureIn();
  Serial.print("Temperature is: ");
  Serial.println(celsius);
  Serial.println("==================");

  delay(3000); 
}
  }

float getTemperature(){
  Wire.requestFrom(tmp102Address,2); 

  byte MSB = Wire.read();
  byte LSB = Wire.read();

  int TemperatureSum = ((MSB << 8) | LSB) >> 4; 

  float celsius = TemperatureSum*0.0625;
  return celsius;
}
*/


// outside
/*void setup() {
  Serial.begin(9600);
 
    if (! uv.begin()) {
    Serial.println("Didn't find Si1145");
    while (1);
  }
  //Serial.println("OK!");  
  {
  myHumidity.begin();
}
{
  if (pressure.begin())
   Serial.println("BMP180 init success");
  else
  {
    Serial.println("BMP180 init fail\n\n");
    while(1); // Pause forever.
  }
}
}

void loop() {
  
  Serial.print("Vis: "); Serial.println(uv.readVisible());
  float UVindex = uv.readUV();
  // the index is multiplied by 100 so to get the
  // integer index, divide by 100!
  UVindex /= 100.0;  
  Serial.print("UV: ");  Serial.println(UVindex);
  delay(1000);
   {
  float humidity = myHumidity.readHumidity();
  float temperatureOut = myHumidity.readTemperature();
  Serial.print(" Temperature:");
  Serial.print(temp, 1);
  Serial.print("C");
  Serial.print(" Humidity:");
  Serial.print(humd, 1);
  Serial.print("%");

  Serial.println();
  delay(1000);
}
{
  char status;
  double T,P,p0,a;
  Serial.println();
  Serial.print("provided altitude: ");
  Serial.print(ALTITUDE,0);
  Serial.print(" meters, ");
  Serial.print(ALTITUDE*3.28084,0);
  Serial.println(" feet");
  
      status = pressure.startPressure(1);
      if (status != 0)
      {
             delay(status);
        status = pressure.getPressure(P,T);
        if (status != 0)
        {
         Serial.print("absolute pressure: ");
          Serial.print(P,2);
          Serial.print(" mb, ");
          Serial.print(P*0.0295333727,2);
          Serial.println(" inHg");
          p0 = pressure.sealevel(P,ALTITUDE); 
          Serial.print("relative (sea-level) pressure: ");
          Serial.print(p0,2);
          Serial.print(" mb, ");
          Serial.print(p0*0.0295333727,2);
          Serial.println(" inHg");
          Serial.println("===================");
        }
        else Serial.println("error retrieving pressure measurement\n");
      }
      else Serial.println("error starting pressure measurement\n");

  delay(5000);  // Pause for 5 seconds.
}
}
*/
 
 */

in the transmitter i forgot to delete the code from the modules inside and outside, the outside module need to be connected at a battery and the inside module connected at laptop

I believe your missing the network group in both the receiver and transmit, normally the network group is set to 210…

#define network 210 //network group (can be in the range 1-250).

in setup:
rf12_initialize(myNodeID, RF_freq, network);