Hi
I am working on a project with multiple RFID readers, and I heard from a guy I asked about this project that it would be wise to hook up each RFID with an Arduino Nano and then relay a signal back to a master(or is he in fact the slave) arduino to read all five states and then flip a relay.
Now, how can I hook up each nano to the uno? I read about I2C connection, but I don't really need anything this advanced. I just need to write a HIGH signal from the Nanos to the UNOs, and have the UNO check each pin in an if statement.
Sort of like:
if (pin1 == HIGH && pin2 == HIGH && pin3 == HIGH - and so on)
If I power all of the nanos with 5v from the Uno, and connect all of them to ground, would it work just connecting analog pins 1 from each Nano to analog in 1-5 on the UNO?
Would I need a resistor?
I would use digital pins. But remember, every analog pin can be used with digital reads and writes, if you're running out of digital pins.
const int FrontDoorSlavePin = A0;
const int SideDoorSlavePin = 13;
...
if(digitalRead(FrontDoorSlavePin) && digitalRead(SideDoorSlavePin)) {...
Note: If you find yourself numbering your variables, like Slave1, Slave2... then use an array instead of separate variables. The names I suggested above are only useful if those slaves have distinct, dedicated functions.
Ok so there is nothing wrong with hooking it up like I described?
With say powering all 5 of them from the 5v rail on the Uno, and connecting them all to the same GND on the Uno?
And then just interconnecting one of their output pin to an input on the Uno-master?
I am just afraid of frying the boards that's all.
It seems reasonable. Don't do anything silly like set two pins that are connected together to output simultaneously.
if all you are doing it watching one RFID and all you need to know is a high low signal, then one way is to just open or close a digital pin and have a remote read that pin.
ryuujin87:
With say powering all 5 of them from the 5v rail on the Uno,
That's asking a bit much of the voltage regulator on the Uno, I would suggest a separate power supply.
Do connect all the grounds together.
So if I understand you correctly:
Let's say I strip the insulation of a 6V adapter, right.
And then I hook the GND to a rail where I connect ALL the Arduinos GND contacts to.
I do the same with the + side of the adapter to all V-IN on the Arduinos (all 5).
(Then all Arduinos, Nanos as well as the UNO is connected to the same GND - yet not directly?).
Then I could hook each Nano to it's own RFID reader, and relay a digital signal back to the Uno and tell it to read all five inputs.
That should be sufficient right? Then I could send HIGH/LOW signal between arduinos, right?
Connect a diode between the 6v adapter and the arduino's to drop the voltage closer to 5v.
That should be fine as long as the adapter provides enough mA current, which was the problem with the Uno's regulator.
You should always know how much current each device uses, and the supply should be the total +20 % or more.
I have a 5v adapter handy if that would be better?
I supplies 2.0A.
I assume this would be more than enough, right?
Hutkikz:
Bingo
This is what I thought of when I read your reply haha.