Loading...
  Show Posts
Pages: 1 2 [3] 4
31  Community / Exhibition / Gallery / Re: Cheap UHF spectrum analyzer using RFM22 module on: April 21, 2012, 09:35:17 am
just few questions to clarify if what im seing is correct.
below is a picture of a test running currently running on the bench.


if you look at the picture with only the RF22 switched on that is working as the receiver it would appear that there is a very high signal detected in the UHF range where i stay ? or am I seing it wrong ?

also the labeling of the dBs on the left hand side would it not make more sence if it started form -120 at the top and -20 at the bottom? I arleady made the mistake at looking at the spike but in reality if i understand it correct is actually the lowest detected frequency that im looking at , can it be swapped ?

other question is , I have a 17cm antenna on my receiver this would offcourse make a differences for freq. in the 800 or 900 range . what then ? or is this meant to  be used with Rf probes only and not general area scanning ?

thanx for any advice , really keen on useing this more
32  Community / Exhibition / Gallery / Re: Cheap UHF spectrum analyzer using RFM22 module on: April 21, 2012, 09:20:27 am
yes im running a RF22 on a R3 UNO .
33  Community / Exhibition / Gallery / Re: Cheap UHF spectrum analyzer using RFM22 module on: April 21, 2012, 09:02:44 am
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
34  Community / Exhibition / Gallery / Re: Cheap UHF spectrum analyzer using RFM22 module on: April 21, 2012, 07:08:00 am
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
35  Using Arduino / Networking, Protocols, and Devices / Re: Does anyone have successful example for Arduino with RFM22B? Thanks on: April 21, 2012, 06:51:18 am
I have four RFM22 modules and they work perfectly with the Uno boards
36  Using Arduino / Project Guidance / General approach and Advice on GPS tracker/transmitter on: April 17, 2012, 02:38:36 pm
Hi Guys

I have started a new project and as usual the excitement got the better of me , I ordered all the parts soldered everything up and now im struggling with the code. be assured that next time the hardware will be planned around what is best for the solution and what i can do with the code but that said . lets get back to business.

I have bought the MediaTek GPS 3392 unit
RFM22B 433mhz transceivers
MiniSD card reader

what the main goal is behind the project is to create a GPS logger that logs two fixes a day to the SD card and when in range of the "base station" radio dump the complete log file to the basetation radio/SD card.

the RF22 radios is SPI, aswell as the SD card reader/writter. GPS  is serial coms.

I need advice on how i would be able to safe Latitudes and longitudes to SD card with the dot or comma separated values for example -27.456372 instead of -27456372 as what i currently get . Im using the TinyGPS library to get messages and encode them to readable messages but I cant get them to send the values with comma's to the SD card. long, float double nothing works as intended. any advice on how to do this ?

then the RF22 radios as great and brilliant as they are they are very tricky to use. i have the RF22 libraries working nicely but for some reason i cant even get a simple value variable sent across the comes , has anyone worked with these radios successfully?

then on a more general note of advice.
what would be the best Array/String to use to format these sort of information into a send able string ?
examples or references would be great!!!

thanx     
37  Using Arduino / Project Guidance / Re: MediaTek GPS and Datum time settings on: April 02, 2012, 10:00:29 am
Guys there must be a easier way to fix the time on the GPS unit ? does everday Garmins have its own realtime clock to get time then or do they get it from the GPS ?
38  Using Arduino / Networking, Protocols, and Devices / Re: MediaTek GPS accuracy. what is different on: March 27, 2012, 02:28:58 pm
Hi Paul thank you for that comment now i know what you are looking at .

I tried pumping it straight to to the SD as it came from GPS but the format that was printing to the SD card was unreadable . by doing this . it was the only why i could get actual Lats and Longs from the SD card .

I actaul dont know of other way how to send it straight to the SD card .?

Code:
//Break up float values into whole numbers(var) and decimals(var1) to be added to data
    int flat1 = (flat - (int)flat) * 10000;
    int flon1 = (flon - (int)flon) * 100000;

how would you do it ?
39  Using Arduino / Networking, Protocols, and Devices / Re: MediaTek GPS accuracy. what is different on: March 27, 2012, 02:02:12 pm
Never mind I see what you mean . i changed it to float aswell now will see if it makes a difference. is there a way to print more of the decimal digits then the current 4 or 6 it does now ? accuracy for this sketch is a must have .
40  Using Arduino / Networking, Protocols, and Devices / Re: MediaTek GPS accuracy. what is different on: March 27, 2012, 01:43:55 pm
Hi Paul

 I have R2 uno board . I had trouble with the date format when the Buff size was 64. so I just went max to make sure i dont loose anything . i can make it smaller probably without trouble but would that cause GPS to be inaccurate ? since both sketchs run at 256?

Im not sure why im converting them . would thing be the reason for strange output ? this code is snippets of other example codes so it could have kreped in like that how would you state it?

thanx
 
41  Using Arduino / Networking, Protocols, and Devices / MediaTek GPS accuracy. what is different on: March 27, 2012, 12:40:30 pm
Hi Guys

Im working on two libraries of GPS code one just prints to terminal and the other savs to SD card , but i have a problem that i cant get solved.

the first sketch is the code I want to get working now but cant , and the second sketch is how I want it to work.

My problem is when running the first Sketch my GPS is accurate with in 10-14km ,when I runthe second sketch is accurate to with in a few feet . I have noticed that the first skecth does not have the same amount of decimals after the "." as the second skecth but i dont understand why since they are both set to floats and both Buff size set to 256.

help please ?
Code:
//Add the Mikal Hart Libraries
#include <SoftwareSerial.h>
#include <TinyGPS.h>

//Add the SdFat Libraries
#include <SdFat.h>
#include <SdFatUtil.h>



#include <ctype.h>

//Create the variables to be used by SdFat Library
Sd2Card card;
SdVolume volume;
SdFile root;
SdFile file;

#define BUFFSIZE 256
char buffer[BUFFSIZE]; //This will be a data buffer for writing contents to the file.
char in_char=0;
char filename[]="log.txt";

//Intialize TinyGPS and NewSoftSerial
TinyGPS gps;
SoftwareSerial nss(3, 2);

//Intialize GPS variables
float lat  , lon  ;
float flat  , flon  , falt;
unsigned long age, date, time, chars;
int year;
byte month, day, hour, minute, second, hundredths;
unsigned short sentences, failed;

bool newdata = false;
bool feedgps();

void setup()
{
  Serial.begin(9600);
  nss.begin(38400); //GPS's Buad Rate
  pinMode(3, INPUT);
  pinMode(2, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(8, OUTPUT); //LED Pin
 
  digitalWrite(8, LOW); // Ensure LED starts as off
 
  card.init();            //Initialize the SD card and configure the I/O pins.
  volume.init(card);      //Initialize a volume on the SD card.
  root.openRoot(volume);  //Open the root directory in the volume.
 
  //Create file with defined filename
  file.open(root, filename, O_CREAT | O_APPEND | O_WRITE);    //Open or create the file 'name' in 'root' for writing to the end of the file
  file.println("yr,mth,day,     hr,min,sec,     lat,    long,   alt\n");    //Write the header array to the end of the file.
  file.close(); //Close the file.
 
  // flash LED 5 times when setup is finished
  for (int i=0; i<4; i++){   
    digitalWrite(8, HIGH);   // set the LED on
    delay(1000);              // wait for a second
    digitalWrite(8, LOW);    // set the LED off
  }   
}

void loop()
{
  bool newdata = false; // check if data is coming in
    if (feedgps())
      newdata = true;
      Serial.println(newdata);
  if (newdata)
  {
    //Pull gps data
    gps.f_get_position(&flat  , &flon  , &age);
    feedgps(); //used to keep gps "awake"
    gps.crack_datetime(&year,&month,&day,   &hour,&minute,&second,  &hundredths, &age);
    feedgps();
    falt = gps.f_altitude();
    feedgps();
   
    //Break up float values into whole numbers(var) and decimals(var1) to be added to data
    int flat1 = (flat - (int)flat) * 10000;
    int flon1 = (flon - (int)flon) * 100000;
    int alt1 = 0;
    if (falt >= 10000000.00){ //when gps cant get altitude
      falt = 0; //set to 0         
    }else{
      falt = falt * 1; //cm to feet
      alt1 = (falt - (int)falt) * 1;
    }
   
    //Create then write the char array "buffer" to the end of the file
    file.open(root, filename, O_WRITE | O_APPEND);  //Open the file in write mode and append the data to the end of the file.
    sprintf(buffer, "%d,%d,%d,   %d,%d,%d,   %0d.%d   ,    %0d.%d   ,    %0d.%d\n", year,month,day,hour,minute,second,(int)flat,abs(flat1),(int)flon,abs(flon1),(int)falt,abs(alt1));
    file.println(buffer); //Write the 'contents' array to the end of the file.
    file.close();  //Close the file
   
    //flash LED
    digitalWrite(8, HIGH);   // set the LED on
    delay(500);
    digitalWrite(8, LOW);    // set the LED off     
    delay(5000); // wait 10 sec before writing next data point
  }
}

bool feedgps()
{
  while (nss.available())
  {
    if (gps.encode(nss.read()))
      return true;
  }
  return false;
}




second sketch.

Code:
#include <SoftwareSerial.h>
#include <TinyGPS.h>

#define RXPIN 2
#define TXPIN 3
//Set this value equal to the baud rate of your GPS
#define GPSBAUD 38400
// Create an instance of the TinyGPS object
TinyGPS gps;
// Initialize the NewSoftSerial library to the pins you defined above
SoftwareSerial uart_gps(RXPIN, TXPIN);
// This is where you declare prototypes for the functions that will be
// using the TinyGPS library.
void getgps(TinyGPS &gps);
#include <LiquidCrystal.h> // we need this library for the LCD commands // initialize the library with the numbers of the interface pins
LiquidCrystal lcd(4,5,6,7,8,9); // define our LCD and which pins to user
/*
 * setup() - this function runs once when you turn your Arduino on
 * We initialize the serial connection with the computer
 */
void setup()
{
  Serial.begin(115200);  //Start the serial connection with the computer
                       //to view the result open the serial monitor
                       lcd.begin(16, 2); // need to specify how many columns and rows are in the LCD unit
lcd.clear();      // this clears the LCD. You can use this at any time
 uart_gps.begin(GPSBAUD);
   Serial.println("");
  Serial.println("GPS in acquisition");
  Serial.println("...waiting for lock...");
  Serial.println("");
}
 
void loop()                     // run over and over again
{
while(uart_gps.available())     // While there is data on the RX pin...
  {
      int c = uart_gps.read();    // load the data into a variable...
      if(gps.encode(c))      // if there is a new valid sentence...
      {
        getgps(gps);         // then grab the data.
      }
  }
}

// The getgps function will get and print the values we want.
void getgps(TinyGPS &gps)
{
  // To get all of the data into varialbes that you can use in your code,
  // all you need to do is define variables and query the object for the
  // data. To see the complete list of functions see keywords.txt file in
  // the TinyGPS and NewSoftSerial libs.
 
  // Define the variables that will be used
  float latitude, longitude;
  // Then call this function
  gps.f_get_position(&latitude, &longitude);
  // You can now print variables latitude and longitude
  Serial.print("Lat/Long: ");
  Serial.print(latitude,5);
  Serial.print(", ");
  Serial.println(longitude,5);
 
  // Same goes for date and time
  int year;
  byte month, day, hour, minute, second, hundredths;
  gps.crack_datetime(&year,&month,&day,&hour,&minute,&second,&hundredths);
  // Print data and time
  Serial.print("Date: "); Serial.print(month, DEC); Serial.print("/");
  Serial.print(day, DEC); Serial.print("/"); Serial.print(year);
  Serial.print("  Time: "); Serial.print(hour, DEC); Serial.print(":");
  Serial.print(minute, DEC); Serial.print(":"); Serial.print(second, DEC);
  Serial.print("."); Serial.println(hundredths, DEC);
  //Since month, day, hour, minute, second, and hundr
 
  // Here you can print the altitude and course values directly since
  // there is only one value for the function
  Serial.print("Altitude (meters): "); Serial.println(gps.f_altitude()); 
  /* Same goes for course
  Serial.print("Course (degrees): "); Serial.println(gps.f_course());
  // And same goes for speed
  Serial.print("Speed(kmph): "); Serial.println(gps.f_speed_kmph()); */
  Serial.println();
 
  // Here you can print statistics on the sentences.
  unsigned long chars;
  unsigned short sentences, failed_checksum;
  gps.stats(&chars, &sentences, &failed_checksum);
  //Serial.print("Failed Checksums: ");Serial.print(failed_checksum);
  //Serial.println(); Serial.println();
 
 lcd.clear();


lcd.setCursor(0,0);
//lcd.print("Lat/Long: ");
lcd.print(latitude,4);
  lcd.print(", ");
  lcd.println(longitude,4);

 

lcd.setCursor(0,1);
//lcd.print("Date: "); lcd.print(month, DEC); lcd.print("/");
//  lcd.print(day, DEC); lcd.print("/"); lcd.print(year);
  //lcd.print("  Time: ");
  lcd.print(hour, DEC); lcd.print(":");
  lcd.print(minute, DEC); lcd.print(":"); lcd.print(second, DEC);
  lcd.print("."); lcd.print(hundredths, DEC);


}


thank you for any advice
42  Using Arduino / Project Guidance / Re: MediaTek GPS and Datum time settings on: March 27, 2012, 09:20:37 am
Hi Thank you for the Reply

I have MediaTek 3329 gps module with DIYD Adapter board.

yes i and two hours ahead but my day light saving never changes . we are always two hours ahead. is there anything i can do to change this ?

maybe read the hour and just add to hours before Serial.print(time);?
43  Using Arduino / Networking, Protocols, and Devices / Re: double up on SPI library on: March 27, 2012, 07:13:32 am
Hi Paul

Yes thank you for you comment , I didnt know SPI was hardware based only thought might work as softwareSerial library.

I assume the best way forward is to setup the functions like you called them. then Read from the SD card save to buffer switch to Radio program and read from buffer to transmit yes?
44  Using Arduino / Networking, Protocols, and Devices / Re: double up on SPI library on: March 27, 2012, 07:06:42 am
Hi Nick wasnt planning on rewriting the new library only copy and past and change pin layouts in that library . I have been reading up on how to use two devices now on one bus , and I agree its straight forward . im just a bit sceptically of how to make it work , my two SPI devices is a SD card and a Data radio that has to send information from the SD card which means I need to talk to both at the same time ...? or am i mistaken

how must I go about it ?

Thanx in advance 
45  Using Arduino / Networking, Protocols, and Devices / double up on SPI library on: March 27, 2012, 03:05:22 am
Hi Guys hope someone can shed some light on this subject.


I have a UNO that i want to connect to a Data radio and SD card

problem is both the SD card and data Radio works on SPI bus. I know you can use two devices on the smae SPI bus but im not fimilar with the Shift out functions. i wantted to you if it was possible if i created my own clown of the SPI.h file and changed the pin outs to lets say. 7,8,9 and inlcuded into my program under name

#include SPI2.h 

will that work ? seems alot easier then trying to figure out master and slaves on the same line.

all thoughts and comments are welcome
Pages: 1 2 [3] 4