Arduino Forum

Using Arduino => Project Guidance => Topic started by: prash_21 on Sep 08, 2019, 04:04 pm

Title: Multiple Arduino on a machine
Post by: prash_21 on Sep 08, 2019, 04:04 pm
Hi,

I need help with a project, currently we are using Arduino to automate the card reader in our project. So basically the arduino soldered to the card reader and is connected to the desktop using the USB port.
So whenever our test website needs authentication, the arduino intercepts the request and inputs the pin or password (usually a 6 digit number) of the card to authenticate.

Now the plan is to take this a step forward, we want to have multiple such Arduinos connected to the machine via USB hub and at runtime based on a parameter i.e. a specific card to be used, the corresponding Arduino should be used to input the pin.

So if we have Card A, B and C we will have one USB hub connected to the machine and the arduinos will be connected to its USB ports and so would the card reader be and at run-time if I pass "A" it should input the pin for "A" and so on on for other Cards.

Is it possible and if yes, could you please help me with some pointers please?

Thanks.
Title: Re: Multiple Arduino on a machine
Post by: sterretje on Sep 08, 2019, 04:47 pm
How does your Arduino intercept a request?

Why do you think you need multiple card readers?
Title: Re: Multiple Arduino on a machine
Post by: DrDiettrich on Sep 08, 2019, 07:41 pm
You can build a master Arduino, that communicates via SPI or I2C with the input terminals, and via USB to the PC.
Title: Re: Multiple Arduino on a machine
Post by: wvmarle on Sep 08, 2019, 07:52 pm
What card reader?
What pin code?
Why does the Arduino have to "enter" the pin code?
What web site?
Where's the code running on that Arduino?

Just some questions that popped up reading your rather unintelligible rambling. Remember that you may know "everything" about your project, we know absolutely nothing about it. So without explanation what you're saying there is just gobbledygook.

Title: Re: Multiple Arduino on a machine
Post by: Paul_KD7HB on Sep 08, 2019, 08:46 pm
The quick answer is EACH Arduino will be a different serial port on the PC. Hope that helps.

Paul
Title: Re: Multiple Arduino on a machine
Post by: taterking on Sep 08, 2019, 10:20 pm
of course it is possible but I cant think of any reason why you would want do this.

first of all if you are only holding a bunch of 6 digit numbers you pry dont need SD cards at all.
arduino boards com with on board EEPROM that should be sufficient storage.

is there some reason why you would need more than one board?
is there some reason you need more than one card?

if so, another alternative would be letting the arduinos talk to each other and only having one connection to the PC.

if you really want to set this up how you are describing then the answer is "yes". just plug all your boards into your usb jacks and a PC will automatically recognize them. the program on the PC just needs to know what port name was assigned to each board to make the serial communication.
Title: Re: Multiple Arduino on a machine
Post by: prash_21 on Sep 10, 2019, 11:37 pm
if you really want to set this up how you are describing then the answer is "yes". just plug all your boards into your usb jacks and a PC will automatically recognize them. the program on the PC just needs to know what port name was assigned to each board to make the serial communication.

Hi,

Thanks for the replies guys! I really appreciate it.

I want to use multiple cards and card readers with with aurdino attached to it and the code to input the pin uploaded of it on a machine.

I also understand that if I connect them to a USB hub they would have different port numbers which would differentiate them from one another.

However my question is how do I write a program which would identify which aurdino or which com port to use? Basically how do I automate it?
Title: Re: Multiple Arduino on a machine
Post by: Delta_G on Sep 10, 2019, 11:44 pm
Probably the first question is why do you need multiple card readers?  You haven't answered that and it's confusing to me.  How should it choose which card reader to check?  Is it based on which website or what? 
Title: Re: Multiple Arduino on a machine
Post by: david_2018 on Sep 11, 2019, 12:21 am
However my question is how do I write a program which would identify which aurdino or which com port to use? Basically how do I automate it?
That is a question on how to program the computer, not how to write code for an arduino.  You could have the arduino send an identifying code to let the computer know which port it was on, but you would also need to be able to tell the card readers apart and associate each of those with the appropriate arduino.
[edit]If you are going to use a separate card reader for each card, then I don't really see why you even need the arduino, the computer itself should be able to send the correct PIN code once it sees which card reader is being used.

Quote
Probably the first question is why do you need multiple card readers? 
If the arduino can intercept the data from the card reader, then it should be able to look up the PIN code for the card that was swiped, unless there is some encryption being used that removes any identifying characteristics from the data stream.
Title: Re: Multiple Arduino on a machine
Post by: taterking on Sep 11, 2019, 04:57 am
if you are writing a program for windows then C# already has a .net library for serial communication. it's actually rather simple. with basic commands just like arduino's library.  by default a windows machine is going to assign a string name to each arduino. should be "COM1","COM2","COM3".. and so on. C# should easily be able to  page through each string name and see if there is a connection that exists for that name.

To distiguish the difference between the arduinos. you would need to have the arduino tell the pc which one it is through the serial connection after it is established.
Title: Re: Multiple Arduino on a machine
Post by: prash_21 on Sep 11, 2019, 06:44 am
if you are writing a program for windows then C# already has a .net library for serial communication. it's actually rather simple. with basic commands just like arduino's library.  by default a windows machine is going to assign a string name to each arduino. should be "COM1","COM2","COM3".. and so on. C# should easily be able to  page through each string name and see if there is a connection that exists for that name.

To distiguish the difference between the arduinos. you would need to have the arduino tell the pc which one it is through the serial connection after it is established.

Let me try this one. Thanks
Title: Re: Multiple Arduino on a machine
Post by: GoForSmoke on Sep 11, 2019, 09:54 am
How many card readers can one Arduino board support? Do you ~need~ a usb hub?

You could code it so that whatever reader has a card reads the card and signals having data ready to the rest of the sketch by setting a flag variable. Some code sees the flag and sends the PIN#. If more than one card is swiped, call it an error.

Title: Re: Multiple Arduino on a machine
Post by: Robin2 on Sep 11, 2019, 10:11 am
So whenever our test website needs authentication, the arduino intercepts the request and inputs the pin or password (usually a 6 digit number) of the card to authenticate.
How can we be sure this is not a project that is trying to do something illegal?

And multiple Arduinos are being considered to speed up the trials of different combinations in order to find the one that gives access to someone's bank account?

...R
Title: Re: Multiple Arduino on a machine
Post by: DrDiettrich on Sep 11, 2019, 10:41 am
The Arduinos do not know about the PIN. They sent to the PC what has been entered, the check occurs on the PC.
Title: Re: Multiple Arduino on a machine
Post by: prash_21 on Sep 11, 2019, 12:18 pm
How can we be sure this is not a project that is trying to do something illegal?

And multiple Arduinos are being considered to speed up the trials of different combinations in order to find the one that gives access to someone's bank account?

...R
hi Robin,

This is not any credit card or debit card reader that we are talking about. Apologies for not making it clear earlier. The cards install a certificate on our machine which is then used to authenticate a user to log in on the website. And requirement is that we sometimes need two levels of authorization which means two separate users need to login and authorize and as we currently have only one arduino setup for a single card we are unable to automate those scenarios.

So the objective is to connect two arduinos to two ports on a USB Hub and depending on which user logs in the respective card reader is triggered and the arduino inputs the default pin to simulate two users login.
Title: Re: Multiple Arduino on a machine
Post by: Delta_G on Sep 11, 2019, 02:07 pm
I still don't understand why you need multiple arduinos for that.  Or multiple card readers.  Just seems wasteful.   
Title: Re: Multiple Arduino on a machine
Post by: sterretje on Sep 11, 2019, 07:53 pm
I still don't understand why you need multiple arduinos for that.  Or multiple card readers.  Just seems wasteful.   
+1

@prash_21
Why not one arduino plus one reader. Tap first card, send data to PC. Tap second card, send data to PC.
Title: Re: Multiple Arduino on a machine
Post by: prash_21 on Sep 16, 2019, 11:10 am
+1

@prash_21
Why not one arduino plus one reader. Tap first card, send data to PC. Tap second card, send data to PC.
Hi Shannon,

I am a part of the Test Automation Team where we execute multiple test cases throughout the day without any manual intervention.

In order to test the scenario where there are multiple users we need two arduinos connected to the machine and each one will play its part i.e. A "Maker" with less rights can create a request and a "Checker" will check and authorize it. All this should happen without any manual intervention.
To be precise not manually inserting the card in the card reader and then validating it arduino would automatically input the pin for us.
Title: Re: Multiple Arduino on a machine
Post by: Delta_G on Sep 16, 2019, 05:06 pm
I still don't understand why you think that requires multiple card readers.  Are they physically very far apart?  Like in different buildings or something? 
Title: Re: Multiple Arduino on a machine
Post by: DrDiettrich on Sep 16, 2019, 09:38 pm
A hotel has a card reader on each door, perhaps also each machine or station in the fabric has its own card reader?
Title: Re: Multiple Arduino on a machine
Post by: Robin2 on Sep 16, 2019, 11:09 pm
A hotel has a card reader on each door, perhaps also each machine or station in the fabric has its own card reader?
That's so you can't go into your best friend's wife's room by accident :)

We still have not been given a clear and simple explanation of what the OP is trying to do. Does he know himself?

...R
Title: Re: Multiple Arduino on a machine
Post by: dave-in-nj on Sep 17, 2019, 02:37 am
I am trying to follow this, but it is rather elusive.

say, a building has an entry door and a security guard.
the person comes up to the building, swipes their card.
the security guard leaves their desk goes outside an then authorizes entry by swiping their authorization card on the same reader.

Is there some way that the security guard could authorize this without exiting the building ?


Title: Re: Multiple Arduino on a machine
Post by: Delta_G on Sep 17, 2019, 03:43 am
I am trying to follow this, but it is rather elusive.

say, a building has an entry door and a security guard.
the person comes up to the building, swipes their card.
the security guard leaves their desk goes outside an then authorizes entry by swiping their authorization card on the same reader.

Is there some way that the security guard could authorize this without exiting the building ?



What has any of that to do with what the OP is asking?  He's talking about multiple people being able to swipe into the same computer from the same place.  There's no reason that they can't use the same card reader. 
Title: Re: Multiple Arduino on a machine
Post by: GoForSmoke on Sep 17, 2019, 07:40 am
It's clear to me that the second card reader is behind a freaking barrier (window/door/wall), not within reach of the first.

Wherever this is, this is how they want it to work. If it doesn't fit your ideas then maybe it's outside of your experience which does not make it wrong just different to what you know.
Title: Re: Multiple Arduino on a machine
Post by: Delta_G on Sep 17, 2019, 07:49 am
Wherever this is, this is how they want it to work. If it doesn't fit your ideas then maybe it's outside of your experience which does not make it wrong just different to what you know.

You're absolutely right.  I just wonder why the OP can't just say as much.  Thing is, sometimes they need two readers because there's a barrier.  Sometimes it is because the example code they copied only compared against one card and they can't figure how they'd ever use it to read more than one.  I mean how many times do we see the thread about how to read something back from the serial monitor because that's where the example code for the sensor sent it.  Sometimes the why do you want to do that is important.  And if it isn't then it certainly isn't any skin off a poster's back to enlighten us. 
Title: Re: Multiple Arduino on a machine
Post by: GoForSmoke on Sep 17, 2019, 07:58 am
Possibly the OP can better explain in the OP's native language. That wasn't American Millennial in the first post, too many words were not 1337-spelled.
Title: Re: Multiple Arduino on a machine
Post by: dave-in-nj on Sep 17, 2019, 12:10 pm
Possibly the OP can better explain in the OP's native language. That wasn't American Millennial in the first post, too many words were not 1337-spelled.
it is a shame, we just love to play the pronoun with adjectives game.
I wonder if there is some point in one's life when they become enlightened and learn to ask proper question and to think rationally.
In my humble view, any post that selects parts before stating a goal, has one foot solidly in an X/Y Problem.
It would seem that thinking the problem through once requires experience.  and experience comes with failure.
like the old chicken and the egg delima.
... and to run a bit off... there was a Halloween party at the college frat house.  a young lad was dressed as a chicken.
and a young lass was  costumed as an egg.  they laughed and hung out for a bit, then they hooked up...
and well, there were able to answer that age old quandary.
Title: Re: Multiple Arduino on a machine
Post by: Robin2 on Sep 17, 2019, 01:56 pm
say, a building has an entry door and a security guard. .....

The problem I have with your suggestion is that it is so straightforward and the OP has not described his problem in such simple terms that I suspect the OP is trying to do something very strange or very secret.

And if it is very secret then it makes me wonder is it something we should be helping with.

...R