WL125 RFID Pet feeder help

Hello! I am very new to using Arduino in ways where I need to come up with code from scratch so I am very in need of some assistance.
The project is simple, I am looking to create a very simple version of the Surepet Feeder Surepet Microchip Feeder

Backstory: I have two fat cats that need to not eat each-others food.
Therefore, I have:

2x WL125 readers READER
2x tags - The small blue ones that are compatible with the reader
2x Arduino pro Micro
2x Servo SG90's

What needs to happen is;
When CatA comes in contact with CatA bowl, it must rotate the servo 120~ degrees
CatB has no effect
When CatB comes in contact with CatB bowl it must rotate ~120 degrees
CatA has no effect

I am going to implement a proximity sensor later on but I do not have that yet.
I know I could just buy a feeder but it is not financially feasible

I have gotten far enough for the reader to read the tag correctly.
I have no idea how to implement a "if tag = tagcode then rotate servo delay for 1 minute then rotate servo."

Help?

Post the code you have so far.

What if they both arrive at the same time?

Nothing of course but the project sounds pretty cool

Im glad that you think the project sounds cool Dave!

regarding the "arriving at the same time" the bowls are on opposite sides of the room so thats never really been a problem as they dont always decide to eat at the same time.

Regarding the code I have:

#include <Wiegand.h>

WIEGAND Wiegand;

//Declaration of pins
#define WiegandData0 0
#define WiegandData1 1

void setup() {
Serial.begin(9600);

//define the Wiegand Pins in the begin
Wiegand.begin(WiegandData1, WiegandData0);
}

void loop() {
if (Wiegand.available())
{
Serial.print("Tag Detected: 00");
Serial.print(Wiegand.getCode());
}

Wiegand.begin();
}

My next task would be adding a check to see if "Tag A matches reader A"

I thought you had one station with a 3 position feeder.
Rotate +120 for cat A
Rotate -120 for catB

Since i feed outdoor cats and i don't want to feed the squirrels ground hogs and racoons i do find this interesting

In the Wiegand library I looked at, the getCode function returns an unsigned long, so you can use your existing code to find the numbers for the tags you have and hardcode them into your program.

Then it's just a matter of an if statement to compare what getCode returns with the single tag that this feeder is supposed to respond to.

@wildbill I have the tag codes, they were inscribed on the tags for me, so I know what the tag id is.
I just have no idea how to get this information in a useable way
As I mentioned before though, pulling code out of my noggin doesnt work too well. I can modify code alright though.

Can you post the serial output you get when the reader sees one of your tags.

Please read how to post code using code tags.
Then post your code regardless how basic it is.
We'll give you the bits we nred to get your code to dump the othrt bots we neeed.

Do you have a datalogger?
Im curious how long a cat stays at a bowl. Or how long your sensor sees yhe tag

Please forgive my newness, learning as I go here.

Here is the code that is in the sketch;

#include <Wiegand.h>

WIEGAND Wiegand;


//Declaration of pins
#define WiegandData0 0
#define WiegandData1 1


void setup() {
  Serial.begin(9600);

//define the Wiegand Pins in the begin
  Wiegand.begin(WiegandData1, WiegandData0);
}

void loop()
{
  if (Wiegand.available())
  {
    Serial.print("Tag Detected: 00");
    Serial.print(Wiegand.getCode());
  }
}

When running, and the tag is seen, the output is;

Here is an image of the tag I am using for examples - I have 2 of these tags, each with a different code so no worries about the same tag being used for both cats.

I do appreciate you guys assisting me!

@dave-in-nj I do not have a datalogger sorry, But just watching my cat at dinner time, they are at the bowl for about 3 minutes, but for a snack they are they are there for about 1.5 minutes.
If you can assist me in getting more information over to you, I will do what I can.
PS: Here is a link to the Wiegand library I am using that is not overcomplicated for me:

What is the numerical difference between the two tags?
And do you have more in case one gets lost?

If both are less than about 35,000 different then an int can be used

Add these lines after the other serial print lines

Unsigned long catA = wiegand.getCode();

Serial.println(catA);

What prints on the serial monitor?

Is your skill level up to writing some if() statements?

Adding that produces this:


If I comment out the other printlines

Tag1 - 0014070465
Tag2 - 0014909682
Shop down the road sells tons of these exact tags so can replace if one gets lost.

I am alright at writing if statements, nothing to brag about but I can probably manage it.

So can you add an if that checks the tag number you got against what you want and print a message to Serial if they are the same?

It turns out using this has no effect on the scanning of tags, either tag will give me its code regardless of this

I do know this RFID reader has option for TTL level serial however I cannot get it to work in any way.

That was the point really. Now you have the tag number in a variable that you can use in an if statement.

So you're saying I should be able to use the catA to create an if?

Is this if still in the wiegand.available()?

Step1 identify result of test

Step 2 use results fron step 1

#include <Wiegand.h>

WIEGAND Wiegand;


//Declaration of pins
#define WiegandData0 0
#define WiegandData1 1
unsigned long Watson = 14909682;

void setup() {
  Serial.begin(9600);
  //define the Wiegand Pins in the begin
  Wiegand.begin(WiegandData1, WiegandData0);
}

void loop()
{
  if (Wiegand.available())
  {
    unsigned long sherTag = Wiegand.getCode();
    Serial.println(sherTag);
  }
  if (Wiegand.available())
  {
    Wiegand.getCode()!=(sherTag);
    Serial.println("Not Sherlock");
  }
}

this is how bad my code creation is. I've been staring at this for hours.