Bzfuture Newsroom

Tech, Gaming and Software news

How to build DIY smart lights controlled by Alexa?

3 min read

Although there are not only some applications that would benefit from a motion detector connected to a light or an alarm, the dark corridor of my bathroom is my first priority.

This offering is a voice activated sensor, a voice configured PIR sensor based light that can illuminate a dark hallway and double for a security monitor or smart light for your garden or driveway.

This project includes activating and deactivating voice-activated Alexa, configuring the floor lighting time and activating the action modes for stop, lighting and / or messaging services.

There are two packing form factors. The former has been integrated into a Sonoff Basic 8266. The latter has less hardware, but uses an NMOS transistor to change the light. The two have a difference in their code, which is built into the supplied .ino program file and selected with Boolean flags. Differences are limited to the pin assignment changes offered by Sonoff and ESP-01.

It is coded so that features can be based on Alexa, voice and cell phone and that routine sync and custom Alexa sequences can be created through the app.

The hardware uses only the pins available on the module. The module resets on the card from +5 volts. A header must be installed to recode the processor and these pins. In this project, +5 volt plugs from the Sonoff module are also used.

The Sonoff basic module is connected to the printed circuit board. The relay on pin 12, the button, and the module LED control are on pin 15. In the installed header, the hardware uses the TX / RCV, which is connected to pins 1 and 3 with ground connection. The 3.3V and pin 14 are also available and are not validated. With minimal modifications, an ESP-01 module can be used for applications that do not require Sonoff Basic. The ESP-01 provides pins 0, 1, 2, and 3 to its header and does not provide power, buttons, LEDs, or relays.

The provided encrypted application provides the required SMTP protocol format and the specific message used in this project, including the time stamp based on “time.nist.gov”. It is part of the project recipe and can be seen as part of your toolbox. Basically the application sends a formatted SMTP message request to the server and the server forwards it to the requested destination. I discovered that there are various SMTP server services and other resources to meet your custom needs. I chose smtp2go.com to support this app. The free option offered what I was looking for on an SMTP server.

You can implement it without server service by using your own server in a Sonoff or ESP-01 module and modifying the destination name, inbound server address and port information from your service provider. Internet. You can also send an email directly to your mobile phone as an SMS. For AT&T users, you can send simple messages using your 10-digit phone number followed by @ txt.att.net. For Verizon, submit your phone number, followed by @ vtext.com, and be sure to use @ double symbols. For Sprint, email the number, followed by @ messaging.sprintpcs.com. And for T-Mobile, follow the number @ tmomail.net. Other telephone services may have account references in a similar format.

By including a messaging service in your app, Alexa-based apps can connect to hundreds of custom device-based IoT-enabled devices through IFTTT services using the messaging trigger.

Alexa can be used as an IFTTT trigger, but with some exceptions, it doesn’t allow connected smart devices to be used directly in the trigger criteria. An additional code that uses a webhook or Adafruit service can be an alternative option for emails. Voice-controlled and user-defined project data can be sent via an IFTTT email or webhook trigger, either to a service using a hash tag / value passed in the subject line, or directly or indirectly through IFTTT- through the MQTT broker io.adafruit MQTT. Service to send. The IFTTT connection, regardless of how you initiate it, can connect to compatible devices or another custom application.

In this way, the voice and phone based motion detector described here can be used with an IFTTT service action that is not available from Alexa via an Alexa based routine or an available Alexa based app. As a security sensor, IFTTT can also call 9-1-1 or another phone number, send an email, or turn on a light or camera with a simple “very” online applet. Maybe, there are several other ways to do this.

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © All rights reserved. | Newsphere by AF themes.