NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Project Help and Ideas » Object Tracker

November 18, 2011
by vladarino
vladarino's Avatar

I would like to try and recreate a tracker device like the ones you see on nature shows where scientist tracks down a tagged animal with an antenna-like device. My version would be simpler and only work in short ranges (200 foot radius or so).

One part of the device would be very small and would simply omit a signal. The other part would be hand-held and would emit clicks or beeps at a rapid pace as I got closer the signal. What types of sensors would be required for this?

Also, I'd like a "locater" feature that causes the signal generator portion to beep loudly if I press a button on the hand-held unit. What would be required to get this communication going?

Thanks.

November 21, 2011
by Ralphxyz
Ralphxyz's Avatar

vladarino said about his idea:

One part of the device would be very small and would simply omit a signal.

So lets start there, first question how is the device powered?

Is it battery powered?

Is it a throwaway device or would you want to reuse it?

I've had an idea for a eye glasses locator for my wife, she is constantly miss placing her eye glasses so I thought a little locator device would be a fun project.

Instead of battery power I was going to use RF Energy Harvesting.

Using something like RFID.

So I'd like to hear more about your project.

Ralph

November 22, 2011
by vladarino
vladarino's Avatar

This would be a battery powered reusable device. I just glanced at your RF Energy link...seems pretty cool. May need to rethink the battery powered thing. I will spend some time reading the document in more detail. Is something like that cost effective? How much thought/research have you put into it.

I basically want to see if creating a device like this feasible (reasonable cost and not requiring a team of engineers). So posting on this board to get a feel for any potential gotchas even before going this route.

The transmitter would be some very small contraption, although I didn't think about creating one small enough to put on eyeglasses..that would be ideal. The hand held part would have a speaker or led to indicate proximity to the transmitter. Simple as that for phase one. Once this proof of concept is done there are lots of cool things you can do to expand on it.

November 22, 2011
by Ralphxyz
Ralphxyz's Avatar

I like the concept, and the eye glasses locator is similar to what you are proposing.

I am fascinated by the Energy Harvesting concept.

If you think about RFID you can see that this (locator) is feasible (at least to my thinking, maybe not to reality, but hey who knows).

I would really like to see further discussions.

Some of the Nerdkit people with electronics and rf experience should be able to add a lot to this discussion.

To me the handheld part is rather simple it is the locatee that is the hard part.

For you would a battery powered device be sufficient?

That would make the locatee (I need a better word/description) easier.

So how small do you need?

If you are trying to put a transmitter on a wasp then battery power is not feasible but RFID would work.

If you are trying to put the transmitter on your cat then battery power will work.

Of course then you (I) get into motion power generation, where just rattling a magnetic core inside of a coil generates power to charge a battery.

This is (for me ) a great topic and I hope leads to lots of discussion.

There is a great thread here on the Nerdkit forum on someone wanting to keep his two cats separated which actually might be related to your quest.

Ralph

November 24, 2011
by mongo
mongo's Avatar

A little trick I learned a long time ago was to use an AM radio for the receiver. CMOS circuits are really just high gain analog inputs and outputs and a crystal across an inverter makes for a very nice local oscillator. (Say a 1MHz crystal). By using the same negative feedback concepts of any other amplifier, you can tune down that high gain into something useful, like a sine wave instead of a square wave. From there, you just take that signal and feed it through an AND (or a NAND) gate and modulate it with another signal. Use one more gate as the final amplifier and a short lead attached through a tank circuit if you want and you have a modulated 1MHz RF signal. If you use one more AND section, you can toggle it on and off to make a beeping signal.

November 24, 2011
by mongo
mongo's Avatar

I have also used CMOS circuits in FM circuits too but they are a little more tricky.

November 25, 2011
by vladarino
vladarino's Avatar

Thanks for the tips. I'm not at the level yet where I can fully understand and implement what you wrote, but it's something I can aim for. Having a project you want to build is a great way to motivate yourself to go learn.

How would you make the beeps more rapid as the receiver gets closer to the source?

November 26, 2011
by Ralphxyz
Ralphxyz's Avatar

vladarino, how big would your transmitter be?

What are you going to locate?

If you were harvesting power then the more power the faster the signal would be a logical application.

Yup:

Having a project you want to build is a great way to motivate yourself to go learn.

I have spent years and probable thousands of dollars on books reading but never really learned anything until I actually put my hand and mind to a project.

Ralph

December 21, 2011
by vladarino
vladarino's Avatar

Ralphxyz,

Sorry for the delayed reply. For some reason I missed your response. Anyhow, I would like the transmitter to be a small square, say 2"x2". The receiver can be larger..something that fits nicely in the hand (it would have LEDs and possibly a speaker so larger is OK). I would clip or strap the transmitter to some object (obviously nothing small like eyeglasses as you've mentioned) then "find" with the receiver in my hand. The receiver would be able to assess how close it is to the transmitter and react accordingly (louder beeps or higher frequency flashing of LEDs). I want to create a low cost project. Once I build it and "get" wireless communications I can start thinking bigger.

I liked your RFID suggestion, however I did some Google searches on RFID circuits and gadgets and saw some pretty high prices. I don't know that RFID technology would be feasible for a low cost project. Am I right on that? All the parts for the transmitter and receiver need together should be $15 or less.

mongo,

Do you have any recommendations as to where I can go to learn how to design the circuit you mentioned? Or any tips in general to get started on implementing your suggestion?

All,

I noticed these products over at Sparkfun. They may be useful for prototyping my project. Any feedback on these? What are drawbacks vs mongo's idea or RFID?

RFM12B-S2 Wireless Transreceiver (transmitter and receiver in one): http://www.sparkfun.com/products/9582

or this pair

RF Link Receiver - 4800bps (434MHz) http://www.sparkfun.com/products/10532

RF Link Transmitter - 434MHz (to pair with RF Link Receiver above) http://www.sparkfun.com/products/10534

May 27, 2013
by vladarino
vladarino's Avatar

So I eventually got around to purchasing the wireless transmitter and receiver pair from sparkfun.com. As a starting point I was able to get two MCUs communicating with each other, each on their own breadboard, by connecting the UART transmit port (pin 2) on one MCU directly to the UART receive port (pin 3) on another with a wire. The test transmitter and receiver code is listed below. When I run it I see the numbers 0 to 255 cycling on the receiver. Cool. So that tells me my baud settings are fine (it works with 2400 or 4800 bps) and the MCU infrastructure is functioning.

When I remove the wire connection and instead hook up the wireless units on the breadboards, things break down. The receiver seems to only be receiving zeroes. When I remove power to the transmitter bread board but keep the receiver bread board running, it receives only 255. Not sure what's up. I made sure I wired the two rx/tx units as specified on pg. 2 here: https://www.sparkfun.com/datasheets/RF/KLP_Walkthrough.pdf.

Any ideas what could be going on or how I would debug this?

Thanks.

//////   TRANSMITTER CODE  ////////////

// transmitter.c
// for NerdKits with ATmega328p
//
// Coded for WRL-10534 434 MHZ 4,800 baud transmitter

#define F_CPU 14745600

#include <stdio.h>
#include <math.h>

#include <avr/io.h>
#include <avr/interrupt.h>
#include <inttypes.h>

#include "../../libnerdkits/io_328p.h"
#include "../../libnerdkits/delay.h"
#include "../../libnerdkits/lcd.h"

#include "../../libnerdkits/uart_2.h"

// Baud for WRL-10534 AND WRL-10532 434MH, 4800bps wireless transmitter and receiver
#define MY_BAUD 4800 
   //#define MY_BAUD 2400

// Set UBRRn to 191 (see pg. 97 in ATmega168 data sheet)
// (4800 baud, 14.7456MHZ, 0% error)
#define MY_UBRR 191
  //#define MY_UBRR 363

//////////////////////////////////////////////////////////////////////////

// Blink (on-off-on) PORTC pin4 (pin27 on ATMega 168/328p)
void blink_c4(uint16_t delayInMs){

    // turn on LED
    PORTC |= (1<<PC4);
    delay_ms(delayInMs);   
    PORTC &= ~(1<<PC4); 
    delay_ms(delayInMs);           
    PORTC |= (1<<PC4);
    delay_ms(delayInMs);

}

int main() {

    // SET UP LED OUTPUT
    DDRC |= (1<<PC4);

    // turn on LED
    blink_c4(250);

    // Set up the UART
    //uart_init_2(MY_UBRR);
          // set custom baud rate
          UBRR0H = (unsigned char)(MY_UBRR>>8);
          UBRR0L = (unsigned char)MY_UBRR;

          // enable uart TX
          UCSR0B = (1<<TXEN0);
          // Set data frame format: asynchronous mode,no parity, 1 stop bit, 8 bit size
          UCSR0C = (0<<UMSEL01)|(0<<UMSEL00)|(0<<UPM01)|(0<<UPM00)|(0<<USBS0)|(1<<UCSZ01)|(1<<UCSZ00);

          // set up STDIO handlers so you can use printf, etc
          fdevopen(&uart_putchar, &uart_getchar);

    // holder variables for data from receiver
    uint8_t this_char;

    // Continually transmit values via UART and increment the send character   
    while(1) {      
        // Write data
        uart_write(this_char);

        // Blink the LED (100ms delay between on/off)
        // (At this speed you can watch the receive numbers increase at the receiver.)
        blink_c4(100);

        // increment output value (range is 0-255)              
        this_char++;    
    }

    return 0;
}

//////   RECEIVER CODE  ////////////
// receiver.c
// for NerdKits with ATmega328p
//
// Coded for WRL-10532 434 MHZ 4,800 baud receiver

#define F_CPU 14745600

#include <stdio.h>
#include <math.h>

#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <inttypes.h>

#include "../../libnerdkits/delay.h"
#include "../../libnerdkits/lcd.h"
#include "../../libnerdkits/io_328p.h"
#include "../../libnerdkits/uart_2.h"

// Baud for WRL-10534 AND WRL-10532 434MH, 4800bps wireless transmitter and receiver
#define MY_BAUD 4800 
  //#define MY_BAUD 2400

// Set UBRRn to 191 (see pg. 97 in ATmega168 data sheet)
// (4800 baud, 14.7456MHZ, 0% error)
#define MY_UBRR 191 
  //#define MY_UBRR 363
//////////////////////////////////////////////////////////////////////////

// Blink (on-off-on) PORTC pin4 (pin27 on ATMega 168/328p)
void blink_c4(uint16_t delayInMs){

    // turn on LED
    PORTC |= (1<<PC4);
    delay_ms(delayInMs);   
    PORTC &= ~(1<<PC4); 
    delay_ms(delayInMs);           
    PORTC |= (1<<PC4);
    delay_ms(delayInMs);

}

int main() {

    // SET UP LED OUTPUT
    DDRC |= (1<<PC4);

    // blink the LED
    blink_c4(250);

    // Initialize the LCD for display received numbers
    lcd_init();
    FILE lcd_stream = FDEV_SETUP_STREAM(lcd_putchar, 0, _FDEV_SETUP_WRITE);
    lcd_home();

    // Set up the UART
    //uart_init_2(MY_UBRR);

    //uart_init_2(MY_UBRR);
          // set custom baud rate
          UBRR0H = (unsigned char)(MY_UBRR>>8);
          UBRR0L = (unsigned char)MY_UBRR;

          // enable uart RX
          UCSR0B = (1<<RXEN0);
          // Set data frame format: asynchronous mode,no parity, 1 stop bit, 8 bit size
          UCSR0C = (0<<UMSEL01)|(0<<UMSEL00)|(0<<UPM01)|(0<<UPM00)|(0<<USBS0)|(1<<UCSZ01)|(1<<UCSZ00);

          // set up STDIO handlers so you can use printf, etc
          fdevopen(&uart_putchar, &uart_getchar);

    // holder variables for data from receiver
    uint8_t this_char;

    lcd_clear_and_home();
    lcd_line_one();
    lcd_write_string(PSTR("Receiver running..."));
    lcd_line_two();

    // Continually receive values from the UART  
  while(1) {

        // blink the LED
        blink_c4(100);

        lcd_clear_and_home();
        lcd_write_string(PSTR("About to UART read.."));
        delay_ms(250);

        // Receive data
        this_char = uart_read();

        // Write the received data to the LCD
        lcd_clear_and_home();
        fprintf_P(&lcd_stream, PSTR("Received: %u!"), this_char);
      }

  return 0;
}

Post a Reply

Please log in to post a reply.

Did you know that an electroluminescent backlight for an LCD panel requires hundreds of volts AC to run? Learn more...