Sunday, August 05, 2012

Long Range Wireless Sensor

Arduino + Pmr446 + RTTY = Long Range Wireless Sensor

Description

This is a simple project for remoted sensors.

Components used:
Software Rx:

Step by step
  1. Prepare a new sketch for Arduino to read the sensor LM35DZ follow this tutorial
  2. Donwload&Configure Arduino IDE with RTTY Library
  3. The library RTTY is configured to be used with the components RADIOMETRIX TX2 ... this library can not be used out of the box ... you must change to make it generate audio tones (contact me if you have problems)
  4. Modify the sketch to send sensor data via RTTY
  5. Connect components to arduino as shown in the diagrams


Demo Sketch

  1. #include <RTTY.h>
  2.  
  3. float tempC;
  4. int tempPin = 0;
  5. char buffer [50];
  6.  
  7. void setup()
  8. {
  9.   /*
  10.     My Library RTTY accepts
  11.     a single parameter in the
  12.     constructor (output audio tone)
  13.   */
  14.   RTTY.attach(8);
  15. }
  16.  
  17. void loop()
  18. {
  19.   tempC = analogRead(tempPin);
  20.   tempC = (5.0 * tempC * 100.0)/1024.0;
  21.  
  22.   RTTY.tx(" Remote Temperature Sensor ");
  23.   dtostrf(tempC, 2, 2, buffer);
  24.   RTTY.tx(buffer);
  25.   RTTY.tx("c\n");
  26. }



Diagram

Arduino + Pmr + RTTY = Remote Temperature Sensor


Photos

Remote Temperatore Sensor
Remote Temperatore Sensor
Remote Temperatore Sensor
Remote Temperatore Sensor
Remote Temperatore Sensor

Video receiving data

18 comments:

juampe said...

Hi!

How did you update the library to generate the audio tones? With the tone() function? How did you get it into the code?

Thanks in advance!

Emmanuel Granatello said...

Hi! I only changed the method "rtty_txbit" follow the link code . As you can see the code does not use the pin "pb"

charliec114 said...

first thank you very much for the tutorial, I followed him to think literally, change the library and follow the steps in the diagram.
but I have a problem when decode RTTY, herewith a video to see if I can help.
Carlos Greetings from Argentina.

video

Emmanuel Granatello said...

Hi Chatliec, can you record on wav file for this RTTY transmission? I tried to decode it by taking the audio from youtube videos without great success.
With this configuration:
* Baud Rate: 50
* Bits per character: 8
* Mark 2295
* Space 2125
On command line app "minimodem" I was able to decode this:
"U24.U24.90c
CHAU24.,..U2HAU24.90c
CHAU24.HAU24.90c"

charliec114 said...

This is a recording of the sound in wav click.

and here are some screenshots of the code img1
img2

Emmanuel Granatello said...

Hi charliec114,
on linux works with wav files that you gave me.
This is a video Linux/Minimodem:
video

This is a video Linux/Fldigi:
video

Sometimes on fldigi I had to increase "Receive Filter bandwidth" from 32 to 100.

PS:I don't remember why but in my RTTY Library_backup I modified this define:

#define BAUD_RATE 20150

test this change :)

Carlo Macillo said...
This comment has been removed by the author.
ik4hps said...

Potresti essere più chiaro ?? come posso fare per modificare la libreria RTTY.h ??
grazie
mirco - ik4hps -

yuthapong said...

I can't compile
because errer
sketch_oct19b.cpp: In function 'void setup()':
sketch_oct19b:14: error: no matching function for call to 'RTTY5::attach(int)'
C:\Users\Softworld\Desktop\arduino-0022\libraries\RTTY/RTTY.h:42: note: candidates are: void RTTY5::attach(int, int)

please help me

Pertti Kellomäki said...

Hi Emmanuel,

I had problems decoding audio from youtube videos, and after some help from the minimodem author it turned out that the problem was that the extracted audio file had two channels. The problems disappeared after I turned the audio to mono with sox remix.

Cheers, Pertti

Peppe.... said...

ciao potresti inviare il link della tua libreria?

luthfi ahmad said...

Hallo!
I need your help for found the rtty librarry, because I can't open the link, Can you give another link?
I have a problem about the code: RTTY.attach(8);
sketch_apr08b.ino: In function 'void setup()':
sketch_apr08b:14: error: expected unqualified-id before '.' token
sketch_apr08b.ino: In function 'void loop()':
sketch_apr08b:22: error: expected unqualified-id before '.' token
sketch_apr08b:24: error: expected unqualified-id before '.' token
sketch_apr08b:25: error: expected unqualified-id before '.' token

please help me...
Thanks before

athanasios kourpetis said...

hello emanuello it seems that RTTY.attach(8); doesn't work ! do you have any idea why ?

athanasios kourpetis said...

whell i found it ! you just change the : RTTY.attach(8); to RTTY.attach(8,0); and it works ! enjoy !

athanasios kourpetis said...

whell i found it ! you just change the : RTTY.attach(8); to RTTY.attach(8,0); and it works ! enjoy !

athanasios kourpetis said...

whell i found it ! you just change the : RTTY.attach(8); to RTTY.attach(8,0); and it works ! enjoy !

Nando said...

I tried this and seems to be working except for minicom reading propelly the data.

$ minimodem --rx 50 --mark 2295 --space 2120 -8 -q
+7'-��I�GQ�9=^M97'-��I�GQ�9=^M97'-��I�GQ�9=^M97'-��I�GQ�9=^M97'-��I�GQ�9=^M

I made the changes to the RTTY lib and all and looking at the data despite not readable it seems to be repeating it.
I'm not using the temp sensor instead I hardcoded a value for testing but that should work as well.

Any idea what might be happening?
Cheers.

sven016 said...

Hello, x years later i found this..
all good but..

in FLDIGI must under RTTY custom:
// Carrier Shift: 170
// Baudrate: 50
// Bits: 7
// Parity: none
// Stop bits: 1
then it works with the default.. :-)

many thanks..