#Mastro di chiavi - an Arduino Door Opener for OfficineNora# This system is designed to open automatically the door at Officine Nora Jewlerly workshop in Florence using this hardware:
- Arduino Uno r3
- Kysan 1124090 Nema 17 Stepper Motor
- Arduino Motor Shield Rev3
- Came RMB21 Access control unit
- NeoPixel Ring - 24 x WS2812 5050 RGB LED with Integrated Drivers
When I say automatically I mean using the stepper motor to phisically turn the key inside the keylock. The access control is ruled by the Came RBM21 with an RFID reader sensor placed near the entrance. For testing purpose I used a switch to emulate the signal coming from the RBM21 but due to voltage difference we can't connect the Came directly to the Arduino. We'll need a relay to separate the two circuits. Have a look here and here for reference.
###Basic functioning### The Arduino has a power switch and a switch sensor placed inside the keylock to detect if the lock is armed or not. The power switch is used to start the Arduino, if the power switch is off the Arduino will not be working and the door will be opened manually or via the RBM21. When you start the Arduino it will:
- Check the state of the switch sensor:
- Open => Wait ~40 seconds and then fire the Closing routine.
- Closed => Somebody had already closed the door mechanically. Do nothing.
####Closing Routine#### This is a function needed to let the Arduino wait ~40 seconds before closing the door. This is because we have a security system that has the same timer before getting armed. During this time it's funny to show some tricks on the led ring that's why timer_before_closing() has some random scenario to amuse you during the wait.
###Libraries Used### I tried to use official libraries when available:
- Adafruit NeoPixel library - Arduino library for controlling single-wire-based LED pixels and strip
- SMLib - A simple library for finite state machines
- Stepper - A stepper library to control control unipolar or bipolar stepper motors