Olympus: Difference between revisions
Jump to navigation
Jump to search
(→Status: adding status) |
|||
| Line 45: | Line 45: | ||
* <code># journalctl -eu olympus[.service]</code> - looking at [e]nd of logs, freshest lines, show logs for [u]nit, immediately next argument must be unit name(s). | * <code># journalctl -eu olympus[.service]</code> - looking at [e]nd of logs, freshest lines, show logs for [u]nit, immediately next argument must be unit name(s). | ||
====Switching power / 2023-09-11+ ==== | |||
* Suggested "HiLetgo PN532 NFC/NXP/RFID Module, v3" ($9) for RFID, maybe better range, "less spooky". | |||
* We might be able to drive the solenoid with 3.3v and just the boost converter | |||
** 3.3 v gpio | |||
* https://www.electronics-tutorials.ws/transistor/tran_7.html | |||
** See MOSFET characteristic curves: https://www.electronics-tutorials.ws/wp-content/uploads/2018/05/transistor-tran56.gif | |||
***y intercept of the red line. I = V/R --> high R -> low I | |||
***https://electronics.stackexchange.com/a/195080/310501 | |||
****for door solenoid: falstad, n-MOSFET, beta->80 as suggested for power mosfet in beta info, 12V drain (src - gnd), 3.3 V, ---> shows 67mA of current. I wonder what the door solenoid needs | |||
{|class="wikitable" | |||
! sampling of amazon door lock solenoids | |||
! reqts | |||
|- | |||
|https://www.amazon.com/UHPPOTE-Standard-Electric-Strike-Control/dp/B00V49S418?th=1 | |||
|Working Voltage: DC12V / Current: 320mA | |||
|- | |||
|https://www.amazon.com/Seco-Larm-SD-995C-D3Q/dp/B07G58CS9F | |||
|Current Draw: 300mA@12VDC, 150nA@24VDC | |||
|- | |||
| https://www.amazon.com/UHPPOTE-Standard-Fail-Secure-Fail-Safe-Adjustable/dp/B00V49S2NI | |||
| Input Voltage: 12VDC; Current: 220mA | |||
|} | |||
* falstad simulation, with beta from above | |||
** oh, so 67mA is too low a current to switch it, by factor of 5 | |||
** the gate voltage ~3.8V to trigger, matches | |||
** err, sorry, too few mA, 12V, about half. it's a plausible range for some solenoid, idk which we have | |||
** it turns out more drain voltage has no effect on drain-source current, only gate voltage affects drain-source current --- as ..expected / desired | |||
** I calculated beta of 3 from the data sheet -- i think -- https://datasheetspdf.com/pdf-file/283681/FairchildSemiconductor/IRF520/1 | |||
** it shows over an amp at 3.3v -- we're clearly in the right range | |||
** maybe the <s>buck</s>boost* converter is current limited, from rpi 500mA limit | |||
*** but the boost converter halves current in exchange for doubling the voltage | |||
==Using== | ==Using== | ||
Revision as of 17:47, 14 September 2023
SHED grants access to the space when locked, entry for members when opening the space at the start of the day, or late at night.
Status
Done
- Prototype that scans rfid cards, stores in database, unlocks door.
- Allows adding new keycards
- Finish splitting the hardware into "brains" section--secured--and sensors section, lives outside--insecure.
- Installed.
Next steps
- Find way to deliver enough voltage and current to switch solenoid. Tried, not worked: voltage divider (high-resistance) and boost converter and signal-level converter (3.3V - 5V). More in #Rough notes
Intro to development
Keeping in mind User:Mcint/Project Derisking:
- Problem: Needs to fulfill a few purposes. First in the order people might think about them, or naturally state them, before we decompose them into functional requirements, or simple solutions that aim to satisfy multiple naive user specifications (in a creative and minimal way if possible, instead of via extensive requirments).
- Grant entry to members. When a valid key is presented, only when a valid key is presented, unlock. Grant entry to some users only during open hours.
- Make addition of new temporary members easy. Make auditing list of people (/keys) with access possible. Make revocation possible.
- (Possibly report (live)/record (for later review) entry attempts, failed (or also successful).)
- (no others named, challenge)
- Solution:
- Outside
- RFID Scanner: RFID-RC522. Vsrc, Gnd, 5 pins in use. (1 ethernet cable. 7/8 wires.)
- Screen. Vsrc, Gnd, +~2 pins in use.
- Switches, 2. 2 pins indicator, share Vsrc, Gnd. Switch "add user" mode, push-button "member" modifier.
- Inside
- RPi. 40 pin. https://pinout.xyz/
- Secured: in wall-mounted box, or in lockable mailbox "suite 1", or not locked, "suite 2".
- Connection: 2 ethernet cables.
- Serve power/ground over both (to support smaller standalone components for testing & debugging).
- Outside
Software
- Daniel wrote. https://github.com/tooPhatJones/NBCardreader (farley uploaded)
Rough Notes
Service Commands
# denotes root, so either prefix each command with $ sudo ..., or enter a rooted interactive shell with $ sudo -i before running the rest of the commands.
# systemctl status olympus[.service]- shows current status, and the last few lines of logs.
# systemctl [start|stop] olympus[.service]
# journalctl -eu olympus[.service]- looking at [e]nd of logs, freshest lines, show logs for [u]nit, immediately next argument must be unit name(s).
Switching power / 2023-09-11+
- Suggested "HiLetgo PN532 NFC/NXP/RFID Module, v3" ($9) for RFID, maybe better range, "less spooky".
- We might be able to drive the solenoid with 3.3v and just the boost converter
- 3.3 v gpio
- https://www.electronics-tutorials.ws/transistor/tran_7.html
- See MOSFET characteristic curves: https://www.electronics-tutorials.ws/wp-content/uploads/2018/05/transistor-tran56.gif
- y intercept of the red line. I = V/R --> high R -> low I
- https://electronics.stackexchange.com/a/195080/310501
- for door solenoid: falstad, n-MOSFET, beta->80 as suggested for power mosfet in beta info, 12V drain (src - gnd), 3.3 V, ---> shows 67mA of current. I wonder what the door solenoid needs
- See MOSFET characteristic curves: https://www.electronics-tutorials.ws/wp-content/uploads/2018/05/transistor-tran56.gif
| sampling of amazon door lock solenoids | reqts |
|---|---|
| https://www.amazon.com/UHPPOTE-Standard-Electric-Strike-Control/dp/B00V49S418?th=1 | Working Voltage: DC12V / Current: 320mA |
| https://www.amazon.com/Seco-Larm-SD-995C-D3Q/dp/B07G58CS9F | Current Draw: 300mA@12VDC, 150nA@24VDC |
| https://www.amazon.com/UHPPOTE-Standard-Fail-Secure-Fail-Safe-Adjustable/dp/B00V49S2NI | Input Voltage: 12VDC; Current: 220mA |
- falstad simulation, with beta from above
- oh, so 67mA is too low a current to switch it, by factor of 5
- the gate voltage ~3.8V to trigger, matches
- err, sorry, too few mA, 12V, about half. it's a plausible range for some solenoid, idk which we have
- it turns out more drain voltage has no effect on drain-source current, only gate voltage affects drain-source current --- as ..expected / desired
- I calculated beta of 3 from the data sheet -- i think -- https://datasheetspdf.com/pdf-file/283681/FairchildSemiconductor/IRF520/1
- it shows over an amp at 3.3v -- we're clearly in the right range
- maybe the
buckboost* converter is current limited, from rpi 500mA limit- but the boost converter halves current in exchange for doubling the voltage
Using
Instructions appear on the screen within 1-5 seconds, explains itself, mostly.
- Scan RFID, access granted (/denied), door unlocks.
- Add user: admin user enables "new user" switch, scans admin RFID, scans new user id (with or without "member" intensifier). Added users have immediate access.
- New members must scan QR code, add name/contact info to google form, and submit for approval.
Managing
- Firebase database manages the UID, raw from RFID.
- New users via google form. QR code link, with RFID UID, shown on screen for enrollment.
Wants & Future Directions
- Blind RFID values read, stored, & shared. Hash (with salt), or HMAC. In database, and uploaded in gForm. (Prevent snooping & spoofing "credentials" - RFID is just ID, no secret / password / challenge.
- Report additions (blinded / without UIDs) to Discord & Slack (via RSS?).
- Look into self-hosting database. https://nocodb.com, self-hosting (self-hosted ~Airtable + APIs. Auth handled.)
- Integrate User:Mcint/Projects/Member system.