This project demonstrates how to create a simple door alarm using Digi-Key's IoT studio and components from Digi-Key.
Connect the PWM pin on the AVR-IoT to one wire of the Littelfuse reed sensor.
Connect the other wire from the Littelfuse reed sensor to one leg of the resistor.
Connect the other leg of the resistor to the negative leg of the LED.
Connect the positive leg of the LED to the 3.3V pin on the AVR-IoT.
DK IoT Studio Software
DK Iot Studio is a cloud based programming software that allows the user to develop a prototype in minutes. No code needs to be written as this is a drag and drop system. If this is your first time using DK IoT studio, see we have an intro to DK IoT Studio blog available.
The first step is to add interval and GPIO blocks.
Next, click on the interval element. Make sure the GPIO ability is set to toggle.
Choose the GPIOPin element. Make sure the variables look the same as the picture below.
Compile the program.
Make sure your board is plugged into your computers USB port and the AVR-IoT micro USB port.
Click program firmware.
It will download as a .hex file.
Drag and drop this to your board, which will show up as curiosity.
Wait for the program to finish downloading.
Your project should now be operable. When you put the magnet next to the Littelfuse sensor, the LED should blink (this is the door closed). When you remove the magnet the light will stop blinking. A sound device could be used instead of, or with the light, but being in an office building I elected to stick with just the light.