Go Down

Topic: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module (Read 53076 times) previous topic - next topic

Dfidalgo


No the RFM12BP (and lower power RFM12) uses a completely different RF chip. Although there are probably arduino code for it somewhere on the intarwebs since it's been around for a while.


Ok, will be easier to maintain rfm22 and when everything is operational, use the rf2126 booster mentioned by msev (datasheet says it is compatible with 433MHz).

msev

What would I have to modify in the circuit to use it for 433MHz? In regards to that example circuit for 2.4GHz?

Dfidalgo

Take a look in the attached file. 

msev

#48
Apr 15, 2012, 09:46 am Last Edit: Apr 15, 2012, 09:56 am by msev Reason: 1
Thanks, I must have had a "shortened" version of the datasheet... That looks great..hope these chips will still be available once I get to the stage of building a booster...Dfidalgo if you build it be sure to post some pics of it, a tell where you got the chip  :)

Dfidalgo

Today I received the Zitron PCB's, look much better in my hands than here in the pictures !   :D
Now just need to buy the RFM22.

Thanks Zitron ;)

Devonian

My PCB's are in the post as well :)

I ordered my HopeRF modules here
http://rf-store.com/index.php?s_phr=rfm&pv=search&view=2

Nigel.

Mauzer

What differences are between RFM22-S1 and RFM22-S2? Only the crystal size?

Devonian


What differences are between RFM22-S1 and RFM22-S2? Only the crystal size?


Yes, as far as I am aware, plus €0.50 better price !!

Nigel.

zitron


Today I received the Zitron PCB's, look much better in my hands than here in the pictures !   :D
Now just need to buy the RFM22.


Cool! Let me know how it goes!


What differences are between RFM22-S1 and RFM22-S2? Only the crystal size?


I heard someone mention that the bigger crystals have better frequency tolerances, but that could be just a rumour.

zitron

Hi guys,

For those of you building the board, here's a test code to make sure that the ATMEGA is working. It simply blinks the red and green LEDs:

Code: [Select]

#define OUTA 18
#define OUTB 19

unsigned int duration = 500;

void setup()
{
  pinMode(OUTA, OUTPUT);
  pinMode(OUTB, OUTPUT);
}

void loop()
{
    digitalWrite(OUTA,HIGH);
    digitalWrite(OUTB,LOW);
    delay(duration);
    digitalWrite(OUTB,HIGH);
    digitalWrite(OUTA,LOW);
    delay(duration);
}



Devonian

#55
Apr 20, 2012, 07:57 pm Last Edit: Apr 20, 2012, 10:41 pm by Devonian Reason: 1
I got my parts together now for a build of Zitrons latest board.

Works fine with the 'blink' test program.

When trying to compile the specan.pde - I get lots of errors due to missing files...
FastSerial.h
RF22.h
C++.h
Menu.h  -- and many more.

@ Zitron,
I guess you use other library files when making your specan & Tx/Rx firmwares.

Is there some single download I can get the required lib files or do I need to hunt them down individually?

EDIT
Tracked down a bunch of missing lib files and now the only remaining compile error is:

C:\Arduino\arduino-0023\libraries\RF22\RF22_Specan.cpp:379: error: prototype for 'boolean RF22::setFrequency(float)' does not match any in class 'RF22'
C:\Arduino\arduino-0023\libraries\RF22/RF22.h:813: error: candidate is: boolean RF22::setFrequency(float, float)


What do I need to change/add??

/EDIT


So close and yet so far !!

Nigel.

Rustie0125

Hi Great Find this Good work !!!!!!!

I downloaded the programs and Pde. but i get compilation errors almost so much that it looks like im missing a library , can some one please confirm this ? i have played with the RF22 modules alot so i have the RF22.h libraries but i cant get this source code to compile

any help would be great
He who does not try ,does not fail ,does not learn not to fail again http://powerduino.blogspot.com/

zitron

Hi,

I knew there would be problems!

Which version of arduino are you using? I'm using 0023, I have not tested it on version 1.0.

Try this version of the specscan without the fastserial stuff:

Code: [Select]
// rf22_specan
// A simple spectrum analyser for the RF22
// Uses the RSSI measurement to plot signal strength
// against frequency
// Specify the start and and requencies and the step size below.
// The output is suitable for a VT100 terminal emulator
// Note the baud rate is set to 115200 for better performance,
// but you can change this to suit your needs
//
// TO DO: add some interactivity
// Copyright Mike McCauley

// modified to work with PC program
// Zitron

#include <RF22.h>
#include <SPI.h>
#include<stdlib.h>

#define redLED 18
#define greenLED 19

char temp[51];
uint8_t rssi;
// Singleton instance of the radio
RF22 rf22;

void setup()
{
  pinMode(redLED, OUTPUT);
  pinMode(greenLED, OUTPUT);
 
  Serial.begin(115200);
  if (!rf22.init())
    Serial.println("RF22 init failed");

  rf22.setModemConfig(RF22::GFSK_Rb2Fd5);
  rf22.setModeRx();
  // Defaults after init are 434.0MHz, modulation GFSK_Rb2_4Fd36
  digitalWrite(greenLED, HIGH);
}

float Start = 430;
float End = 460;
float Step = 0.1;

float freq;

void loop()
{
  ProcessRx();
 
  for (freq = Start; freq < End; freq += Step)
  {
    rf22.setFrequency(freq);
    digitalWrite(redLED, LOW);
    delayMicroseconds(6000); // Let the freq settle
    digitalWrite(redLED, HIGH);
    rssi = rf22.rssiRead();
   
   
    Serial.print(rssi, DEC);
    Serial.print(",");
   
    //Serial.println(dtostrf(freq,0,3,temp));
  }
  Serial.println();
  //Serial.println("");
}

void ProcessRx() {
  byte n = 0;
  byte m = 0;
  char* sptr1;
  char* tempstr;

  if (Serial.available()) {
    temp[n] = Serial.read();
    while ((temp[n] != '\n')&&(n<50)) {
      if (Serial.available()) {
        n++;
        temp[n] = Serial.read();
      }
    }

    //Serial.println(temp);

    tempstr = strtok_r(temp,",\n",&sptr1);

    do
    {
      switch (m) {
      case 0:  // Wheel 1
        Start = atof(tempstr);
        break;
      case 1:  // Wheel 2
        End = atof(tempstr);
        break;
      case 2:  // Wheel 3
        Step = atof(tempstr);
        break;
     
      }
      m++;
    }
    while (tempstr = strtok_r(NULL, ",\n",&sptr1));
  }
}



I have also uploaded my modified version of the RF22 lib.

Rustie0125

Hi

I loaded both versions now and they seem to work great . thanx , one question , they PC application seem to very slow updating the graph
He who does not try ,does not fail ,does not learn not to fail again http://powerduino.blogspot.com/

zitron


Hi

I loaded both versions now and they seem to work great . thanx , one question , they PC application seem to very slow updating the graph


Update speed depends on how many steps you are scanning. By default it scans from 430-460MHz at 0.1MHz step (300 samples), which is a bit slow. You can make it faster by increasing the step size or reducing frequency range.

BTW are you using your own board??

Go Up