IntroductionThe wireless (GSM) home security alarms have two main drawbacks:
- The system requires the timely battery replacement.
- The wireless signal can be jammed.
The hardwareThe hardware is very simple, and it is based on the W5100S-EVB-Pico board. The figure below describes the hardware in details: Hardware descriptionAs you see above, the hardware does not require any additional electronics components. The alarm sensors outputs connect to GP14 and GP15 pins of the W5100S-EVB-Pico board. The firmware configures the internal pull-up resistors in RP2040 for the GP14 and GP15 pins: Pull-up resistorsSo we do not need the external resistors for our sensors.
Amazon AWS servicesBefore using this project, you should have the Amazon AWS account and create the resources in AWS IoT. The WIZnet website has the good manual for this: Getting Started with AWS IoT Core.
FirmwareThe firmware is simple. It is based on the sample project aws_iot_mqtt which is available on the WIZnet website:https://github.com/Wiznet/RP2040-HAT-AWS-C/tree/main/examples/aws_iot_mqttThe modified firmware is attached in the DOCUMENTS files section below.
How to use the attached firmwareThe firmware configures GPIO pins for sensors, the network and DHCP protocol, setups the certificate, initializes the MQTT transport. Then it makes the connection to the MQTT broker and subscribes to the MQTT topic.After that, the code in while() loop reads the sensors and publish sensors data to the MQTT topic on the AWS cloud. Additionally, I have configured the LED on the W5100S-EVB-Pico board to blink. This LED is also useful for debug purposes.Note, you should replace the root certificate, client certificate and private key in the mqtt_certificate.h file. You should have them when you created resources in AWS IoT. Also modify MQTT_DOMAIN, MQTT_PUB_TOPIC, MQTT_SUB_TOPIC and MQTT_CLIENT_ID.
Mobile applicationThe Mobile application connects to the AWS cloud and subscribes to the topic on the MQTT broker, where data from alarm sensors is available. It shows the status of each sensor. The Android Studio project is attached. Mobile phone applicationIt is based on the Android Studio project from there: https://github.com/felipemeriga/aws-sdk-android-samples. I used the AndroidPubSub project and modified it for my purposes. You need to download Android Studio to modify this project.