RFID Read Range (loop function vs for loop)

Hi Everyone,

I'm working on an RFID application. I've been struggling with the read range for a while, but it seems like I may have isolated the problem. In my main loop, I have two primary functions - one that looks for a valid tag and one that listens for a button press. If the valid tag is found, it opens a servo. If the button press is detected, it enters a for loop, again listening for a valid tag. The purpose of the button press is so that I can program the Arduino to a new tag.

What I've found is that the read range for the normal open-close operation is roughly 5 inches radially from the plane of the coil. However, when inside the for loop, the tag has to be within a few millimeters of the coil before it is picked up.

I'm honestly not quite sure what to make of this...is the for loop a lot slower than the loop function?

Thanks for the help,

Austin

void loop() 
{ 
    // Normal operation of food bowl
    if (readTag())
    {
        if (checkTag())
        {
            openServo();
            sampleTag();
            closeServo();
        }
    }
    
    // Operation if programming button is pressed
    if (digitalRead(programmingPin) == LOW)
    {
        openServo();
        analogWrite(programmingLED, 0); 
    
        for( ; ; )
        {    
            if (readTag())
            {
                openServo();
                sampleTag();
                closeServo();
        
            }
        }   
    }
}

What reader ? Do you poll it or does it use an interrupt.

Here's a link to the RFID reader:

http://www.priority1design.com.au/shopfront/index.php?main_page=product_info&cPath=1&products_id=37&zenid=gkcdcgcjkpj4jda8ctcgn3iov1

Also, I'm polling for the tag.

What I've found is that the read range for the normal open-close operation is roughly 5 inches radially from the plane of the coil.

Right that makes no sense at all.

You should check that the servo motor is not generating interference that is being picked up by the RFID reader and reducing the range. That sounds a more likely explanation. Proper decoupling should solve that.

Grumpy_Mike,

You got it. By removing the servo, and indicating the tag was read via the LED, the read range was as expected (5"). I'll just have to backtrack and implement this fix into the original code, but problem solved!