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 will attach here some photos and the code from sensors, separately this code work, i can get the data. i found here examples with rfm12b, but still can't transmit. Can help me anyone?

 

http://1drv.ms/1Jx5Y1A

p.s. sorry for bad english, i'm not native :d

 

Robert Wall's picture

Re: Transmit data from sensors

I cannot see your sketches. You should attach the files to your post here, use "File attachments".

For the transmitters, look at the sketch for the emonTx Shield on GitHub: https://github.com/openenergymonitor/emonTxFirmware/tree/master/emonTxSh...

This might help you, but you must change the I/O pins to match your sensors and your breadboard.

For the receiver, look at the sketch for the emonGLCD on GitHub: https://github.com/openenergymonitor/EmonGLCD/tree/master/HomeEnergyMonitor but ONLY look at the part of the sketch where the message is received and decoded.

Also read the pages in Building Blocks about the RFM12B.

Mawashy's picture

Re: Transmit data from sensors

Thanks, it helps a lot. I just put here the schetches made in fritzing, that's how my modules looks like and also i use rfm12b exemples

Robert Wall's picture

Re: Transmit data from sensors

We use the JeeLabs JeeLib library to handle the RFM12B radio modules. You will see from our sketches that in setup( ) you need to initialise the module, then in loop( ), for the transmitter you pack the data into a STRUCT and pass that into JeeLib to send the message, in the receiver you poll JeeLib each time around the loop and if there is a message, you then get it into an identical STRUCT and extract the data.

You will probably need to have the same data struct for both inside and outside sensors, with a flag to tell you which values are being used. Then decoding in the receiver is very simple.
e.g.

typedef struct { boolean inOut, float light, temperatureIn, temperatureOut, humidity, relPressure, absPressure; boolean pressureError } PayloadTX;

PayloadTX emontx;

If inOut is true, you only use the next two values, if inOut is false, you ignore the next two values and use the remainder.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.