Difference between revisions of "Megadoor"
(Oh boy, here I go making wiki pages again.) |
m (→Deployments: be more clear) |
||
(11 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{Project|Creator=hfuller | ||
+ | |Status=<onlyinclude>NFC Auth Implimented</onlyinclude> <!--LEAVE ONLYINCLUDES FOR STATUS HACK--> | ||
+ | |Born On=17:28, 23 February 2016 (CST) <!--DO NOT EDIT --> | ||
+ | |Last Updated={{#time: H:i, d F Y| {{REVISIONTIMESTAMP}} }} (CDT) <!--DO NOT EDIT --> | ||
+ | }} | ||
+ | [[Category:doors]] | ||
+ | [[Category:Microcontroller]] | ||
+ | [[Category:Automation]] | ||
== Overview == | == Overview == | ||
Line 5: | Line 13: | ||
We're making yet another door auth system. This one will use microcontrollers and NFC. | We're making yet another door auth system. This one will use microcontrollers and NFC. | ||
+ | |||
+ | == Deployments == | ||
+ | |||
+ | This is currently deployed on the front and back doors without the secondary CPU necessary for NFC interaction. The NFC component will eventually be reworked into a stand-alone unit that can trigger an arbitrary door backpack. Either deployment is controllable from makerbaker. | ||
== Hardware == | == Hardware == | ||
+ | |||
+ | === Portable Tester === | ||
+ | |||
+ | [[File:Megadoor tester 1.JPG|100px|frameless|right|Door lock tester]] | ||
+ | |||
+ | Has an LED wired in as the door lock. Opening the door blinks the LED. | ||
+ | |||
+ | === V2.0 === | ||
+ | |||
+ | Coming soon. | ||
+ | |||
+ | Features: | ||
+ | * Single/cleaner breadboard circuit | ||
+ | * 32KB external EEPROM for user credentials | ||
+ | * Lasercut wall mount | ||
+ | |||
+ | === V1.0 === | ||
+ | [[File:Megadoor hardware 1.JPG|100px|frameless|right| Original breadboarded system]] | ||
+ | |||
+ | Hacked together by hfuller and ctag during a two-day sprint. Reads the NFC antenna on the front door and unlocks when a valid card is present. USB authentication is patched through from the original Pi for now. | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 26: | Line 58: | ||
Oh boy. | Oh boy. | ||
+ | |||
+ | === Variable Sizes === | ||
+ | |||
+ | <nowiki> | ||
+ | int: 2 | ||
+ | uint8_t: 1 | ||
+ | uint16_t: 2 | ||
+ | uint32_t: 4 | ||
+ | uint64_t: 8 | ||
+ | </nowiki> | ||
+ | |||
+ | === EEPROM === | ||
+ | |||
+ | For reference: from EEPROM.h | ||
+ | |||
+ | <nowiki> | ||
+ | //Basic user access methods. | ||
+ | EERef operator[]( const int idx ) { return idx; } | ||
+ | uint8_t read( int idx ) { return EERef( idx ); } | ||
+ | void write( int idx, uint8_t val ) { (EERef( idx )) = val; } | ||
+ | void update( int idx, uint8_t val ) { EERef( idx ).update( val ); } | ||
+ | |||
+ | //STL and C++11 iteration capability. | ||
+ | EEPtr begin() { return 0x00; } | ||
+ | |||
+ | //Standards requires this to be the item after the last valid entry. | ||
+ | //The returned pointer is invalid. | ||
+ | EEPtr end() { return length(); } | ||
+ | |||
+ | uint16_t length() { return E2END + 1; } | ||
+ | </nowiki> | ||
+ | |||
+ | == NFC == | ||
+ | |||
+ | == USB == | ||
+ | |||
+ | === SIAM32 USB HC === | ||
+ | |||
+ | A fascinating [https://courses.cit.cornell.edu/ee476/FinalProjects/s2007/blh36_cdl28_dct23/blh36_cdl28_dct23/ student project] to implement USB Host Control for Atmega32 systems. | ||
+ | |||
+ | With some help from friends on IRC, the code compiles, but is in somewhat bad shape, and only targets ''atmega32'' and not ''atmega328p'' which is what we have. | ||
+ | |||
+ | === USB Host Shield === | ||
+ | |||
+ | We could buy a [https://www.sparkfun.com/products/9947 USB Shield]. It feels like cheating, but is also the most feasible option right now. Also kinda pricey. | ||
+ | |||
+ | [https://github.com/felis/USB_Host_Shield_2.0 https://github.com/felis/USB_Host_Shield_2.0] | ||
+ | |||
+ | [https://www.circuitsathome.com/products-page/arduino-shields https://www.circuitsathome.com/products-page/arduino-shields] | ||
+ | |||
+ | === USB Host Library === | ||
+ | |||
+ | We could try one of the USB software libraries for the ATmega328 line of controllers. These all seem to target the chip as the downstream device, rather than the Host Controller. | ||
+ | |||
+ | [https://www.obdev.at/products/vusb/index.html https://www.obdev.at/products/vusb/index.html] | ||
+ | |||
+ | [http://www.fourwalledcubicle.com/LUFA.php http://www.fourwalledcubicle.com/LUFA.php] | ||
+ | |||
+ | [https://dicks.home.xs4all.nl/avr/usbtiny/ https://dicks.home.xs4all.nl/avr/usbtiny/] | ||
+ | |||
+ | === AT90USBKEY2 === | ||
+ | |||
+ | We could [http://www.digikey.com/product-search/en/programmers-development-systems/evaluation-and-demonstration-boards-and-kits/2622039?k=AT90USB647 buy a board] specifically designed for USB Host development. Compatible with the [http://www.fourwalledcubicle.com/LUFA.php LUFA] library listed above. This could either replace the atmega328p, or work ancillary to it. | ||
+ | |||
+ | [http://www.digikey.com/product-search/en/programmers-development-systems/evaluation-and-demonstration-boards-and-kits/2622039?k=AT90USB647 http://www.digikey.com/product-search/en/programmers-development-systems/evaluation-and-demonstration-boards-and-kits/2622039?k=AT90USB647] |
Latest revision as of 09:48, 2 August 2021
Creator: |
Contents
[hide]Overview
"I don't even know how this happened." - ctag
We're making yet another door auth system. This one will use microcontrollers and NFC.
Deployments
This is currently deployed on the front and back doors without the secondary CPU necessary for NFC interaction. The NFC component will eventually be reworked into a stand-alone unit that can trigger an arbitrary door backpack. Either deployment is controllable from makerbaker.
Hardware
Portable Tester
Has an LED wired in as the door lock. Opening the door blinks the LED.
V2.0
Coming soon.
Features:
- Single/cleaner breadboard circuit
- 32KB external EEPROM for user credentials
- Lasercut wall mount
V1.0
Hacked together by hfuller and ctag during a two-day sprint. Reads the NFC antenna on the front door and unlocks when a valid card is present. USB authentication is patched through from the original Pi for now.
ATmega DIP Pin | Arduino Pin | Function/Connection |
---|---|---|
15 | D9 | Door Unlock Transistor |
28 | A5 | NFC -> SCL |
27 | A4 | NFC -> SDA |
12 | D6 | NFC -> IRQ |
11 | D5 | NFC -> RST |
Software
Oh boy.
Variable Sizes
int: 2 uint8_t: 1 uint16_t: 2 uint32_t: 4 uint64_t: 8
EEPROM
For reference: from EEPROM.h
//Basic user access methods. EERef operator[]( const int idx ) { return idx; } uint8_t read( int idx ) { return EERef( idx ); } void write( int idx, uint8_t val ) { (EERef( idx )) = val; } void update( int idx, uint8_t val ) { EERef( idx ).update( val ); } //STL and C++11 iteration capability. EEPtr begin() { return 0x00; } //Standards requires this to be the item after the last valid entry. //The returned pointer is invalid. EEPtr end() { return length(); } uint16_t length() { return E2END + 1; }
NFC
USB
SIAM32 USB HC
A fascinating student project to implement USB Host Control for Atmega32 systems.
With some help from friends on IRC, the code compiles, but is in somewhat bad shape, and only targets atmega32 and not atmega328p which is what we have.
USB Host Shield
We could buy a USB Shield. It feels like cheating, but is also the most feasible option right now. Also kinda pricey.
https://github.com/felis/USB_Host_Shield_2.0
https://www.circuitsathome.com/products-page/arduino-shields
USB Host Library
We could try one of the USB software libraries for the ATmega328 line of controllers. These all seem to target the chip as the downstream device, rather than the Host Controller.
https://www.obdev.at/products/vusb/index.html
http://www.fourwalledcubicle.com/LUFA.php
https://dicks.home.xs4all.nl/avr/usbtiny/
AT90USBKEY2
We could buy a board specifically designed for USB Host development. Compatible with the LUFA library listed above. This could either replace the atmega328p, or work ancillary to it.