06/21/2017 at 10:58 •
This project is now completed. The system has been working for 4 weeks without any problems.
I have been asked by a friend to build something similar to remotely control the heating in his holiday home, and I feel that a re-design is needed to make it more generic. Therefore, a more generic (and simpler) version of this project has been reborn as https://hackaday.io/project/25572-relay-controlled-by-phone-call
06/07/2017 at 10:54 •
Use Arduino Pro Mini instead of Arduino Nano.
- This solves the problem with communication to the A6 module at 115200 baud. The Pro Mini does not have anything connected to the hardware TX/RX pins, this means that there is no need to use any complex code for the serial interface to the A6 module.
- The Pro Mini is much smaller than the Nano. Therefore the Pro Mini could probably fit under the A6 module, reducing the size of the PCB.
Use a relay board to drive the external lines.
- This eliminates the need for transistors, resistors, capacitors, and terminals.
- This allows connection to multiple types of external equipment, for example directly to a remote control fob.
06/06/2017 at 12:41 •
The operation should be very robust.
- The system should be able to execute for several years without human intervention.
- The primary function is to listen for a ring signal. Everything else is optional. Therefore the code is designed around a loop that receives serial data and searches for the text "RING" in the data stream.
- No error condition should cause the main loop to stop executing.
- The main loop regularly requests the A6 module to report the network status and signal strength. This is to ensure that the serial connection does not time out.
The operation should be very predictable.
- Invocation of the operation is idempotent. No matter how many times the phone number is called, the end result will always be that the gate will be closed.
- No matter what is the starting state when the phone number is called, the end result will always be that the gate will be closed.
The system should be easy to maintain.
- In case of an unexpected fault, an untrained user can reset the system by turning the power supply off and on again.
The system should use whatever electrical power is available.
- The voltage available is unpredictable. Therefore, the system is designed to use a single 5-volt supply, and the conversion to 5-volt is left as an external component.
- I personally use dx.com/p/400209 to generate 5-volt, 2-amp from the 24v DC that is available from the NET230N gate controller.
- A capacitor is placed across the 5-volt supply because the supply from the gate controller may be noisy during gate operation.
The system must recover gracefully from a power failure.
- Pull-down resistors and capacitors are used on the transistor bases to prevent any accidental trigger of the gate before the Arduino Nano has time to reset.
The system must recover gracefully from a GSM network disconnection.
- The Arduino program does not depend on the state of the GSM network connection.
The PCB should be as small as possible, because space may be limited in the box for the gate electrics.
- The main modules (Arduino Nano and A6 module) are mounted on terminal strips to allow other components to use space underneath.