I'm looking for a method of identifying any connected components. The idea is as follows: I'm going to 3D print a few objects and I want some way being able to check if they are currently connected in some way (magnet, screw, usb, don't know yet) to a larger hub with an Arduino in it.
However I have no idea how make a cheap implementation for this. I was hoping someone could point me in a a direction. Ideally I'd be able to store some data on the components and have to hub read it.
I'm looking for a method of identifying any connected components. The idea is as follows: I'm going to 3D print a few objects and I want some way being able to check if they are currently connected in some way (magnet, screw, usb, don't know yet) to a larger hub with an Arduino in it.
However I have no idea how make a cheap implementation for this. I was hoping someone could point me in a a direction. Ideally I'd be able to store some data on the components and have to hub read it.
Perhaps you can proof read what you wrote before posting it. If you are going to 3D print an object, it doesn't exist, yet, so cannot be connected to anything! Are these metallic objects, so they can be detected electrically?
You have to think more about the "connections". A mechanical connection (by screw or magnet) requires different detection than an electrical (USB) connection.
@Wice, you need to provide a lot more information - a diagram of the system with the things attached would help.
What sort of objects do you want to attach and why do you want to detect their attachment states? This information will be important for figuring out a suitable solution.
On the basis of your description so far I reckon there is no simple or cheap method of doing it.
As a general rule an Arduino detects electricity - but even a system of electrical connections may not be simple to implement.
Thanks for the answers so far guys and sorry I was being vague. Currently this is just a concept in my head and I haven't worked anything out, that's why I asked.
My basic idea is what I described above. I want to make a hub and then comunicate with smaller objects that could be attached to it. Imagine a keychain for my carkeys. I connect the keychain to the hub via some method. The hub detects that its my keychain via some sort of ID. So next, if I wonder if I left my keys at home, can just login to some page and check if it's connected to the hub.
The reason I'm asking this so early in the process is that I have no idea what to use for the connection/identification.
Hi,
Simplest and cheapest would be to put a jack plug on each item, you plug the jack into sockets which are on the hub.
In the jack plug you fit a resistor, different value for each item.
You then scan the HUB sockets and measure the resistances, use a lookup table and display or send to wifi etc etc what keys are connected.
Or a bit more effort , use RFID tags on each item, but not sure if one RFID detector would be happy with multiple tags in range.
May need an RFID detector for each hub socket.
If you have ordinary keys that still have a piece of metal, the key can be used as a 'switch'. You're 3D device (I think that comes in here) will have two metal contacts that are wired to the Arduino (e.g. one to ground and one to a pin). When you stick the key in the 3D device, it will short the contacts and the Arduino will be able to 'see' that.
This does not work for stuff that is not conduction; e.g. a cell phone with a rubber cover. You can use conducting paint or a microswitch in your 3D device that makes contact when it's pressed under the weight of the cell phone. In both cases the Arduino can detect it.
You will also need a means of communication. E.g. an ethernet shield connected to the Arduino, and some code to make the arduino behave like a simple webserver; this will require that your ISP allows you to run a webserver.
Do you need to differentiate the order of these objects in a chain or just the presence of an object in the chain.
The answer makes a lot of difference to what you need to do to implement this. Just the presence is easy, the order is a lot harder.
Wice:
I want to make a hub and then comunicate with smaller objects that could be attached to it. Imagine a keychain for my carkeys. I connect the keychain to the hub via some method. The hub detects that its my keychain via some sort of ID. So next, if I wonder if I left my keys at home, can just login to some page and check if it's connected to the hub.
The reason I'm asking this so early in the process is that I have no idea what to use for the connection/identification.
I still think we are being presented with an XY problem
Do you really mean that you want a system to check whether your keys are attached to something (to what?) or is it really about something else entirely.
Be specific and then maybe you will get useful advice.
...R
PS. The way I make sure I don't leave my keys at home is by having a lock on the door which requires the keys when I want to lock the door. (And this is why I suspect your project has nothing to do with keys)
Grumpy_Mike:
Do you need to differentiate the order of these objects in a chain or just the presence of an object in the chain.
The answer makes a lot of difference to what you need to do to implement this. Just the presence is easy, the order is a lot harder.
It won't be a chain. I'm thinking of something like a USB hub that you can attach multiple keychains to. It will have multiple identical slots and the order and position, though nice to know, isn't essential.
Robin2:
PS. The way I make sure I don't leave my keys at home is by having a lock on the door which requires the keys when I want to lock the door. (And this is why I suspect your project has nothing to do with keys)
Well we have two cars, multiple bikes, we go out seperatly and together. Sometimes we lose a pair of keys and we wonder if we brought them or not. I want to be able to check my phone and see that a certain set of keys is still at home.
Well, in that case a jack plug sounds like a plan; see reply #5.
If you can find the ones for cellphones, you can even built in identiy (up to 8). There are three signal pins (mic, left and right) and a GND; that can give you 8 combinations if you short the pins differently to GND.
One combination needs to be used to identify that there is nothing inserted in the slot.
If you have 7 devices, you need 21 pins plus shared GND. Not necessarily Arduino pins; you can use e.g. a shift register (parallel in, serial out) or I2C /SPI port expanders.
Wice:
Well we have two cars, multiple bikes, we go out seperatly and together. Sometimes we lose a pair of keys and we wonder if we brought them or not. I want to be able to check my phone and see that a certain set of keys is still at home.
That makes things a lot clearer.
How much intelligence are you prepared to build into each key-chain. For example you could have an Attiny attached to it which is programmed with an ID code that it sends every 5 seconds. It need not have any battery because the power could be provided by the hub when you plug it in.
With RFID all that may be needed to would be to throw the keys in a bowl that has an Arduino with RFID reader beside it.
However no system will work if the users are not sufficiently disciplined ALWAYS to attach the key chain to the hub.
Wice:
It won't be a chain. I'm thinking of something like a USB hub that you can attach multiple keychains to. It will have multiple identical slots and the order and position, though nice to know, isn't essential.
Well we have two cars, multiple bikes, we go out seperatly and together. Sometimes we lose a pair of keys and we wonder if we brought them or not. I want to be able to check my phone and see that a certain set of keys is still at home.
Sounds like a pretty cool project. If you have a 3D printer, an option could be to have a key cabinet with a hook designated to each key. The hooks are just slightly spring loaded and have an electrical connection on each side, so when you put the keys on it, it will sink just a quarter inch or so and make the connection, then the arduino gets electrical input into the designated pin. You could also use an RFID chip like others have mentioned, but to me that seems like overkill for your needs. Another suggestion that may be a bit more advanced, though not quite as complex as the RFID would be to use some simple laser break beams, or even just a $0.95 light sensor behind each key chain, have an enclosed cabinet with a tiny LED strip constantly on. Just think about your programming experience, what you have, and what you have to spend (and how extravagant you need it to be) and you will be good. Good luck, happy to answer questions if you have any.
tyler_newcomb:
If you have a 3D printer, an option could be to have a key cabinet with a hook designated to each key.
Your idea sounds awesome but part of my idea is that it doesn't matter where you put the key. That's why I'm trying to figure out a way to make some sort of identifiable keychain.
TomGeorge:
Hi,
Wice did you read my post? #5, the first suggestion, cheap, easy to build, readily available components.
Tom...
Yeah, I'm actually considering it, though a jackplug sounds a bit larger than I had in mind
Robin2:
How much intelligence are you prepared to build into each key-chain. For example you could have an Attiny attached to it which is programmed with an ID code that it sends every 5 seconds. It need not have any battery because the power could be provided by the hub when you plug it in.
The more intelligence the better, in case I ever think of any extra functionality in the future. I'll look into the Attiny, thanks!
Is a simple .txt file on a USB stick that is read by a raspberryPi not a simple approach?
The Pi already has internet connectivity, a simply python script can check for all USB devices attached to a hub, read the .txt contents and then use upload the info to a mySQL database online somewhere on your hosting.
Either way, the extra arduino/ATTiny bits etc. just seem to add bulk to the problem.
PS: Even simply formatting each USB with a different volume label could make this as the "ID".
Johnny010:
Is a simple .txt file on a USB stick that is read by a raspberryPi not a simple approach?
PS: Even simply formatting each USB with a different volume label could make this as the "ID".
In theory yes, but I'd prefer the data to be inaccesible by simply plugging it into a usb port and changing the values.
sterretje:
Those small plugs that are used for the earphones/microphone for cell phones are too big?