Simple and cheap microcontroller for RFID projet

Discussion in 'Embedded Systems and Microcontrollers' started by treythomas, Mar 2, 2010.

  1. treythomas

    Thread Starter New Member

    Mar 2, 2010
    6
    0
    I'm looking for a simple and cheap microcontroller to read serial output from an RFID reader and determine whether or not the tag scanned is "authorized" or not. It doesn't need much memory, just enough for a very basic program and some 10 digit numbers.

    I've already done this with my Arduino, but that's definitely overkill for such a simple job. I'm trying to get this project working as cheaply as possible (mostly for the challenge, not to save money).

    Can someone provide me with information about a microcontroller that would be a good fit for this project? I looked into the ATtiny13.. would this be a good chip for the job? Also, how would one go about loading programs onto one of these?

    Thanks in advance,
    Trey
     
    Last edited: Mar 3, 2010
  2. treythomas

    Thread Starter New Member

    Mar 2, 2010
    6
    0
    Sorry for the double post, but I forgot one part. I'm also trying to make this system as low-power as possible, since I'll be installing it in my car to operate the door locks/ignition. I don't want to have to worry about it running down the battery when the car isn't on.

    Trey
     
  3. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234

    The RFID reader will consume more power than most low power uc's... if the interrogator is constantly scanning for a tag anyway... are you going to place something to trigger the interrogator to read or is it always going to be scanning for a tag?? This would have to be quite a powerful RFID tag reader for it to be able to scan a tag outside the car...... Most require the tag to be within inches of the interrogator.... and away from metal structures than can cause interference (such as sheet metal on the cars body...)....

    [​IMG]

    I have used the same one in a couple of projects myself...

    My .02
     
  4. treythomas

    Thread Starter New Member

    Mar 2, 2010
    6
    0
    BMorse, thanks for your response.

    My plan is to put the reader in the small window on the rear seat driver side (my car is a coupe) - the window is tiny and it doesn't matter if it's blocked. I might be wrong, but I don't think the glass will affect the signal much. Mounting it in the window would allow me to get the tag less than an inch from the reader.

    I realize the reader will use more power than the microcontroller, but minimizing the microcontroller's power consumption will help. My plan is to turn on the reader every one or two seconds, so that it's not constantly scanning. The response wouldn't be instantaneous, but I don't mind having to hold the tag up to the reader for a second.

    But then again, I drive my car frequently so it wouldn't be left on for days at a time without the battery being recharged. I doubt the power consumption from this reader would be enough to run down my battery overnight or even a few days.

    My main question here pertains to the microcontroller - what microcontroller would you recommend for simple tasks like this?

    Thanks,
    Trey
     
  5. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    If you fancy a real challenge you could try a microchip PIC10F200...
    6 pins, 256 bytes program memory, 16 bytes ram, no eeprom which could be a dealbreaker.
    On the plus side it has an internal oscillator and 175uA operating current, 100nA sleep mode.
     
  6. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    You will need to choose a low power uc with a UART, since the tag reader uses the uart to communicate at 2400 baud serial TTL....

    B. Morse
     
  7. treythomas

    Thread Starter New Member

    Mar 2, 2010
    6
    0
    Haha I guess I'm not really looking for something difficult to build, I just want to see how cheaply I can make it happen. Does this chip have a UART? I didn't realize I needed one before BMorse's post:


    I'm glad you mentioned this, I wasn't really aware that microchips were made without UARTs I guess. Where is a good place to shop for these? I'm fairly new to this, the closest thing I've done to dealing with microcontrollers directly is an Arduino.

    Thanks for the help
    Trey
     
  8. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
  9. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    I would go for one a little cheaper, might have more I/O's than what you need right now but could always be useful for adding other devices later.....

    I would use the PIC16F628,
    and is also low power:

    the PIC16F628A-E/P is only $1.86

    Check it out here >>> http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010210

    And you can read up on Microchips NanoWattXLP technology here >> http://ww1.microchip.com/downloads/en/DeviceDoc/01146B_chapter%202.pdf

    My .02
     
  10. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    10F200 doesn't have a uart, the 16F628 is a popular and cheap chip that does.
    It's not really that hard to implement a uart in software especially just receiving.
    I'd be tempted to use a chip with a UART because it is one less thing to worry about.
    The levels expected by the uart are inverted compared to the rs232 standard. Presumably the tag reader is also inverted but worth checking. I couldn't figure it out from the datasheet.
     
  11. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234

    I have used the same tag reader on a previous project of mine with the PIC32MX uc, it works just fine with a pic.....

    here is part of the code I wrote for the Pic32 (in C) for reading the tag via the interrogator module...

    Code ( (Unknown Language)):
    1.  
    2. unsigned char Read_RFID()
    3. {//Must Open UART1 first!!
    4.     int counter=0;                   //what byte we are on
    5.     char strC;                         //compare result
    6.     UART1_Open();
    7.     mRFID_On();                     //Enable RFID Reader
    8.     Delayms2(100);                 //Wait for Module to power up all the way
    9.     while(rDATA!=13)               //wait for carriage return
    10.     {
    11.         while(!DataRdyUART1())
    12.         {                                 //Add timeout routine here
    13.         };//Wait for Data
    14.         rDATA=ReadUART1();      //Read Data from UART1 RX
    15.         if (rDATA!=10)
    16.         {//Append Data to buffer
    17.             CODE[counter]=rDATA;         //write data to buffer
    18.             RFID_CODE[counter]=CODE[counter];
    19.             counter++;                        //Increment buffer location
    20.         }//End If 10
    21.     };//End While(rDATA!=13)
    22.  
    23. //------------------------------------------------------------------------------
    24. EXITREAD:
    25.     mRFID_RXTX_Off();                //Disable RFID Reader
    26.     counter=0;                        //Reset data Buffer counter
    27.     CloseUART1();                    //Close Uart1
    28.     Delayms2(10);
    29.  
    30. }//End ENABLE_RFID
    31.  
    B. Morse
     
  12. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    We must have been typing at the same time bmorse, good call on the 628. The rfPIC12F675 sounds like an interesting option if the OP hasn't bought the tag reader already.
     
Loading...