Failsafe IoT Light Switch with ESP32, ESP8266 OR Arduino for Home Automation - Baba Awesam

  Рет қаралды 23,826

Samir Sogay

Samir Sogay

Күн бұрын

In this video I show you how to achieve failsafe when implementing IoT light switch using ESP32, ESP8266 or Arduino such that even if the Microcontroller fails or wifi goes down, you will be still able to turn ON or OFF the lights. Since you can control your lights with web interface, you can integrate it with Openhab and subsequently with Amazon Echo or Google Home using voice commands.
Code for the project which uses web requests
github.com/samirsogay/esp-ip-...

Пікірлер: 66
@Dave_889
@Dave_889 Жыл бұрын
Great video. I have been thinking of doing something like this , that way it wont require internet and it also have a fail safe
@timchan1783
@timchan1783 3 жыл бұрын
Is it possible to do this with 12v setup? I want to be able to control my interior van lights with Alexa but also have a failsafe wall switch. Thank you!
@SiddheshBagade
@SiddheshBagade 2 жыл бұрын
Hello sir, I just learned about latching relays - also called as bistable or impulse relays. Can you cover this topic on 2 way or 3 way switches as it will not keep taking current as normal relays to keep it on.
@leventelikhanecz2258
@leventelikhanecz2258 5 жыл бұрын
hi Samir, do you use a simple relay? mean not self latching one? imagine you have your relay in the NO (normally open) position. once the esp fails it falls back itself to NC (normally closed) state, toggling the lamp state. improve failsafe with self latching relay (regardless 1 coil or 2 coil type). there you just give a short pulse (pulsetime) on the coil/s to toggle state of relay. if the esp dies silently the relay will keep its present state. (imagine you wake up in the middle of night due to a lamp start burning into your face upon esp death) or the opposite.
@SamirSogay
@SamirSogay 5 жыл бұрын
I use a simple relay. I never knew there were self latching relay. My lights do toggle if I reboot the microcontroller when it hangs. Thanks for the input.
@leventelikhanecz2258
@leventelikhanecz2258 5 жыл бұрын
@@SamirSogay there are 2 types, single coil and 2 coil. the single coil you have to reverse polarization to toggle, while on 2 coil type you have to drive both coil same polarization and pulse them accordingly to toggle. may require little tricky programming depends on firmware / control OS.
@leventelikhanecz2258
@leventelikhanecz2258 5 жыл бұрын
by the way, in between your 2 endpoint (in this case the 3 pin switch and the esp relay - which acts as a 3 pin) you still can put endless number of so called "cross switch". 3pin - X - X - X - 3pin. the cross switch has 4 pins. on toggle it change routing between the upper line and the lower line. where you have several entry point ( a lobby ) each switches will do the light. | | | | / \ | |. | |
@NEWBI3GAM1NG
@NEWBI3GAM1NG 4 жыл бұрын
nice video, hope their is a clear and complete wiring diagram with the conventional and the relay switch module. thanks in advance.
@SamirSogay
@SamirSogay 4 жыл бұрын
If you see the video, there are some diagrams which should clarify the setup. It is important for you to understand 2 way switches. This will help in understanding this setup.
@bespired
@bespired 5 жыл бұрын
Smart. I'm looking for a physical switch to turn the lights on via wifi. So I don't need to pull a wire.
@SamirSogay
@SamirSogay 5 жыл бұрын
There maybe a way by which both places will have esp8266. One will have a physical button and the other will have a relay. They will both communicate with wifi.
@SiddheshBagade
@SiddheshBagade 4 жыл бұрын
To have the privilege to be so lazy, You have to work hard once. - Samir Sogay, 2018. 0:31
@nicolassuarez144
@nicolassuarez144 5 жыл бұрын
Hi! Very good tutorials! There is an alternative to hi-link 3.3v to power supply the esp board?
@awesamphotography7688
@awesamphotography7688 5 жыл бұрын
Hi, there is hlk-pm03 for 3v output
@codingspace1143
@codingspace1143 4 жыл бұрын
OK..but with failsafe can you update the status of light in ALexa?
@SamirSogay
@SamirSogay 4 жыл бұрын
No, you can't.
@mohammedsikandar6056
@mohammedsikandar6056 4 жыл бұрын
Is it possible to switch-on from conventional switch and switch-off from the esp-relay board? If so, does the UI in the app update accordingly?
@SamirSogay
@SamirSogay 4 жыл бұрын
Yes but ui does not update
@mosikud
@mosikud 4 жыл бұрын
Thanks for the reply.. I am almost done with this project.. I have all the setup, I only need to connect esp32.. Any suggestions on how to update the UI?
@SamirSogay
@SamirSogay 4 жыл бұрын
@@mosikud Probably have a light sensor in the room which will update the switch status based on light level in the room.
@aliasaad1347
@aliasaad1347 3 жыл бұрын
can this method used with bylnk and give correct stateus of lamp
@SamirSogay
@SamirSogay 3 жыл бұрын
Unfortunately there is no way to track the current status of the lights. If you can have a light sensor in the room, you can use that to update the status.
@hycron1234
@hycron1234 3 жыл бұрын
@@SamirSogay - Hall Effect Current Sensor, then you would know if it was on or off.
@SamirSogay
@SamirSogay 3 жыл бұрын
@@hycron1234 Nice option for the people who want status change in Openhab.
@tahabutt474
@tahabutt474 Жыл бұрын
hey can you provide the circuit diagram of this circuit
@CATips
@CATips 4 жыл бұрын
Sir I have using water tank level transmitter for measuring the tank level. The transmitter output is 1 to 5 V variable Means 1V need to set 0% 2V need to set 25% 3V need to set 50% 4V need to set 75% 5V need to set 100% Can you make gauging display via blynk app with modemcu Please make code for me
@UmeshKumar-vu9uz
@UmeshKumar-vu9uz 3 жыл бұрын
Can you demonstrate with One way button or normal button as well
@SamirSogay
@SamirSogay 3 жыл бұрын
It cannot be done with 1 way button
@tirthrajgandhakwala6201
@tirthrajgandhakwala6201 3 жыл бұрын
I have made automation system for home which toggles for both manual and esp32 command over LAN. But the issue is that I cannot change the status of online Switch GUI to ON or OFF when manually state of output is changed. Any way I can change online status of switches when I change them manually?
@SamirSogay
@SamirSogay 3 жыл бұрын
Unfortunately no. You may have to rely on a light sensor which could toggle status based on ambient brightness.
@mogilogi1956
@mogilogi1956 Жыл бұрын
you can use current sensor, to sense the current going to the light to know if it's on or off
@Defaultgamingyt
@Defaultgamingyt 5 жыл бұрын
hi bro i have only one way switch can i do it? and if yes can you give me diagram for it?
@SamirSogay
@SamirSogay 5 жыл бұрын
Hi. The only necessary requirement is having a 2 way switch with 3 terminals. Other than that you need a relay and a micro controller to control the relay. Connectivity is pretty simple if you follow the video.
@RajveerSingh-yb6zq
@RajveerSingh-yb6zq 4 жыл бұрын
I have the Similarsetup in my house and I want to Upgrade it, Problem is if I Turn the "ON" the Device using Micro Controller in My Phone Display it will say its On, But if I Turn the device off Using the conventional switch, Microcontroller has no means to know that the Device is off Now, So in My Phone, it will still say its on, And If I click it again to off in UI, It will Turn the Device ON but on Phone's Display it will say it's off. Do you have any solution to this problem Bro?
@SamirSogay
@SamirSogay 4 жыл бұрын
This is the most common question I get on this video but unfortunately there is no easy answer. One way of maintaining the status of the Web button could be through light dependant resistor. If light is above a certain brightness, it could turn status of button on and vice versa.
@shahidmustafa7768
@shahidmustafa7768 5 жыл бұрын
Hi Samir, would it possible if you can share the code or project folder.. it would be great.. thanks in advance
@SamirSogay
@SamirSogay 5 жыл бұрын
I have added the code in the video description.
@proFFGaming2
@proFFGaming2 3 жыл бұрын
What will happen in power cut will switches remember their on off state or they will all off when power comes again?
@hycron1234
@hycron1234 3 жыл бұрын
They would remember their state. 🙂
@proFFGaming2
@proFFGaming2 3 жыл бұрын
@@hycron1234 thanks bro
@mani4812
@mani4812 4 жыл бұрын
Sir how get return feed back indicating Which light is on or off condition plz tell sir
@mani4812
@mani4812 4 жыл бұрын
When switch on the light by manual which indicates in app light is on
@brunoleonmexico7767
@brunoleonmexico7767 4 жыл бұрын
You can't.
@SamirSogay
@SamirSogay 4 жыл бұрын
There is no way of feedback. You might have to rely on light sensors.
@SaturnAR
@SaturnAR 4 жыл бұрын
@@SamirSogay or you could just add a current sensor at the output power cable, and use this info to update the status accordingly.
@Roaming_with_akshay
@Roaming_with_akshay 5 жыл бұрын
How it will work with Google assistant?
@SamirSogay
@SamirSogay 5 жыл бұрын
This esp8266 integrates with openhab and openhab has Google binding.
@aliasaad1347
@aliasaad1347 3 жыл бұрын
current statues is appeared correct on application ?
@SamirSogay
@SamirSogay 3 жыл бұрын
No, there is no way of knowing current status
@harjaskaran
@harjaskaran 4 жыл бұрын
How to modify the code add additional switches
@SamirSogay
@SamirSogay 4 жыл бұрын
I think if you go through the code, you will be able to alter it for your requirement.
@ahmadimamadyan1396
@ahmadimamadyan1396 4 жыл бұрын
How to setup the setting of openHAB app?
@SamirSogay
@SamirSogay 4 жыл бұрын
Openhab app depends upon openhab server which you must run on Raspberry Pi
@unbreakabledesire14
@unbreakabledesire14 2 жыл бұрын
Bhaiya mera Manual switch bina hotspot connect kiye kaam nhi kr raha hai ek baar hotspot connect krne ke baad switch kaam kr raha or hotspot band kr raha phir bhi switch kaam kr raha lekin stating me mujhe ek baar hotspot connect krna pad raha phir switch kaam kr raha , Mtlb switch ko Initialise krne ke liye hotspot connect krna pad raha jo ki acha nhi hai if phone nhi raha to switch kaam nhi krega PLZZ SOLVE THIS PROBLEM..🙏🙏
@nu199ds
@nu199ds 4 жыл бұрын
There is one problem in this system. Suppose you have powered on the light by triggering the relay by the web server and you switched it off by the wall switch. You go on a pleasure trip for 2 days. Few minutes later, your area gets a power cut for 5 minutes. Heres what happens when the power comes back on.... you relay will start at the N/C configuration. The wall switch will supply power across the relay to your bulb until you have returned home.
@SamirSogay
@SamirSogay 4 жыл бұрын
I didn't even have to take a trip to know this. Anytime power fluctuates, the light toggles when the relay is energised. Didn't take into consideration while designing this setup.
@carlosgarcialalicata
@carlosgarcialalicata 2 жыл бұрын
@@SamirSogay you can use a latching relay instead
@mgscyber
@mgscyber 3 жыл бұрын
Pls show the full diagram next time
@Dennis-iz4lm
@Dennis-iz4lm 3 жыл бұрын
"espipswitchtoggle.h" i can't find the library on the web...heeeeelp me plsss
@SamirSogay
@SamirSogay 3 жыл бұрын
The files are linked in the video description
@jaipranesh6660
@jaipranesh6660 5 жыл бұрын
Will u give me a circuit diagram
@mani5004
@mani5004 Жыл бұрын
u wont get feed back and need to tell alexa the opposite of on and off
@harshanimataraarachchige4040
@harshanimataraarachchige4040 4 жыл бұрын
Industrial ESP32 PLC NORVI IIOT Features : Industrial Arduino ESP32 : IIOT with ESP32 Watch the video kzbin.info/www/bejne/hIfdhoqajtilfJY #esp32 #esp8266 #Arduino #IIoT #PLC #automation #Robotics
@johnjeremih
@johnjeremih 4 жыл бұрын
Share the diagram
@SamirSogay
@SamirSogay 4 жыл бұрын
There is a diagram in the video
You’ve Never Seen WiFi Like This
20:43
Data Slayer
Рет қаралды 617 М.
КАРМАНЧИК 2 СЕЗОН 7 СЕРИЯ ФИНАЛ
21:37
Inter Production
Рет қаралды 547 М.
Survival skills: A great idea with duct tape #survival #lifehacks #camping
00:27
Мы никогда не были так напуганы!
00:15
Аришнев
Рет қаралды 6 МЛН
孩子多的烦恼?#火影忍者 #家庭 #佐助
00:31
火影忍者一家
Рет қаралды 51 МЛН
Try these 16 Brilliant ESP32 projects!!!
11:18
ToP Projects Compilation
Рет қаралды 551 М.
Using smart relays in your home
8:43
Home Automation Guy
Рет қаралды 155 М.
25 Home Automation Ideas: Ultimate Smart Home Tour!
7:18
Smart Home Solver
Рет қаралды 2,6 МЛН
Blynk Home Automation Physical Button Feedback Status
8:34
Viral Science - The home of Creativity
Рет қаралды 77 М.
This Chip can Control Anything with ALEXA
6:26
Grensom
Рет қаралды 233 М.
WiFiManager with ESP32 - Stop Hard-coding WiFi Credentials!
54:58
DroneBot Workshop
Рет қаралды 582 М.
Отдых для геймера? 😮‍💨 Hiper Engine B50
1:00
Мой инст: denkiselef. Как забрать телефон через экран.
0:54
Choose a phone for your mom
0:20
ChooseGift
Рет қаралды 7 МЛН
Todos os modelos de smartphone
0:20
Spider Slack
Рет қаралды 14 МЛН
Как распознать поддельный iPhone
0:44
PEREKUPILO
Рет қаралды 1,7 МЛН
iPhone 16 с инновационным аккумулятором
0:45
ÉЖИ АКСЁНОВ
Рет қаралды 8 МЛН
Опыт использования Мини ПК от TECNO
1:00
Андронет
Рет қаралды 788 М.