1
\$\begingroup\$

A friend asked me for advice regarding a lock system based on iButtons as keys.

There are some doors, and a 1-wire bus along the way, connected to iButton readers and door locks. (let's skip the complexities of turning 1-wire command into physically opening a lock, that's for a different question...)

Users are issued iButtons - one per person - and the system authorizes given iButton to open a given set of doors. Except there's a caveat: if I insert the iButton into a reader, the system will know iButton[id] has been plugged in. No info which of the multiple readers. No info which of the authorized doors to open.

So - given a single 1-wire bus, what would be a practical way to determine, where (into which reader along the bus) the button has been plugged in?

\$\endgroup\$
1
\$\begingroup\$

You'll need to install a 1-wire GPIO chip at each reader, hooked up so that you get a contact closure when an iButton is physically inserted. Then, in addition to reading the iButton itself, you query the GPIO chips to determine which reader actually has an iButton present.

There may still be some confusion if two or more people insert their iButtons into different readers simultaneously — you won't know which one is which. But the window of opportunity for this kind of problem is small, and if it does occur, you can probably simply not unlock any doors, and let the users retry their buttons. It's unlikely that they would have the same timing two or three times in a row.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.