Serial.begin() question

Wow everything... Ok basically my project goes as such:
I'm building an automatic pet door system. So a pet wearing an RFID collar would be able to come in and out of the door anytime it wants to. I would need to mount 2 RFID readers, one inside the house and one outside the house. Then I need another serial port to mount an RF transmitter/receiver because I need it to communicate with another Arduino.... So that would be 3 ports gone. I'm trying to condense so it requires less serial ports

Then I need another serial port to mount an RF transmitter/receiver because I need it to communicate with another Arduino.... So that would be 3 ports gone. I'm trying to condense so it requires less serial ports

Well a mega board comes with 4 hardware serial ports all supported with the arduino Serial library. That's probably the simplest hardware/software solution, but as already mentioned there are other methods. It depends on your software skills, budget, and maybe on how many cats you have. :smiley:

Lefty

I have just installed the security system described here:

(At the time of writing it was just sitting on a benchtop, but now it is in operation).

It turned out I could use a single RFID reader for both entry and exit, by mounting the reader on the wood adjacent to the door. Since the reader has a range of a couple of inches, and the radio waves go through wood, and the wood isn't very thick, that lets you wave a card over it on either side, and it works.

Reader circled. Arduino in another location making the decisions.

So a similar system could work for you. Assuming you have a cat door cut into a bigger door (or piece of wall) then mounting the reader on that piece of wall would allow a single reader to do both sides. Of course you need to train the pets to get quite close for it to activate. That may not suit your situation, but it is a possibility. But if your reader is more like the bulky ones they use at shop doors, then I can understand needing one per side.

Even so, with a reader per side, and another serial port for the radio link, you have still only used 3/4 of the available serial ports on the Mega.

My RFID Reader has a very short range though (I'm using Innovation ID-20). The range is only a couple of centimeters. How does yours get such a long range? I don't know whether both the readers I have are spoilt but both my readers have the same range

I just tested again with the ID-12 shown in the photo. The range depends a bit on the type of card you present. I find the "orange button" shown in the photo on the web page has a lower range than the card, presumably because it is smaller.

However I found that, from the inside, I got a range of about 2.5 inches (around 6 cm) using the button and 3 inches (about 7.5 cm) using the card. The range is a bit less from the outside, but I'm not sure exactly how thick the wood is.

I would be looking at the exact type of cards you are using, and whether there is something metal nearby which might dissipate the radio signal.

Can you replace the inside RFID reader with an IR sensor? Why do you need to open the door from inside only to your own pet? XD

Or for that matter have the pet flap set up so it always pushes out (even if locked). So in-to-out is always possible, because the cat/dog just pushes the door open with its head. But out-to-in requires the reader to move a lug out of the way so it can be pushed back in the opposite direction.

touch or pressure sensor on the inside of the door?

A photo might make things clearer:

That is my cat flap. It has lugs on each side. Looking at them, the "A" lug is in the closed position, so the door cannot be pushed in from the outside. Thus, animals cannot enter. However the "B" lug is pushed aside, so the door can be pushed outwards, allowing the pet to leave.

So my suggestion is to have a the lock on one side (ie. the RFID causes a small bolt or lug to be pulled back). In the locked position (like in the photo) the door can still be pushed the other way. So the pet can always leave (no fancy sensors needed) but needs to activate the lock to return.

There is a small magnet at the bottom (the black lumps) which stops the door flapping in the breeze.

the range for my rfid is EXTREMELY short... about 5cm... although on the datasheet its stated much longer... but i don't understand why that is the case. there isn't anything metallic nearby tho, other than a few bolts and screws

I think the orientation is relevant. With my button tag (which is less effective than the card one) it activates at 5 cm held parallel to the reader, but only 2 cm when rotated 90 degrees and pointing at the reader. So you may want to orient the reader in such a way that it is parallel to the way the tag will be when the pet presents its credentials.

isn't 5 cm very short? the range stated as much longer than 5 cm =s

I measured 8 cm with the card (still short of the quoted range). The button being smaller I suppose has less "aerial" in it. The specs don't quote how big the activation device is for the quoted 12 cm range. Perhaps as large as a sheet of A4 paper?

i measured 7 cm with a card and 4 cm for a button.... I thought there was something wrong with my codes but guess not now :s any way to fix the range?

An external aerial?

I tried reading up on doing that by my mind turned to mush after a while. All that stuff about getting a coil the exact amount of microhenries and a capacitor too, I think, and then "tuning" it in the field with an oscilloscope etc. etc.

Probably the ones in shop doors have large aerials (the things you walk between) so no doubt it can be done, as the tags on the products aren't that big.

If someone wants to post a guide on how to connect the ID-12 / ID-20 to an aerial (with detail like coil size, number of turns, wire gauge etc.) that would be appreciated, I'm sure!