I am using an Arduino UNO board with an ESP8266 interfaced with it. And i am also using a solenoid lock that is connected to a relay. This is my first time handling these devices so i want to get some help. The relay on activation seems to be working but it does not communicate with the button on my Blynk.Cloud dashboard after the program has initialized. I want to make it so that when the button on the app is pressed. The relay will trigger and so does the solenoid lock.
Is there a particular reason why you’ve chosen this setup?
It’s far from ideal and will cause you some issues.
The Uno doesn’t have enough processing power to emulate a hardware serial port using the SoftwareSerial library at this baud rate. As a result, you’ll suffer disconnections and other issues when communicating with Blynk.
Read this for more info…
These functions aren’t being called, so are redundant…
Thar also means that this function is redundant as well…
In addition, you’ll have no functionality without an internet connection using this code, as you are using Blynk.begin, which is a blocking function. All code execution will stop at the Blynk.begin command if the ESP can’t make a connection with the internet or the Blynk server.
It would be useful to see what your serial monitor shows, and it would help you with debugging if you added some serial print commands to your various functions to allow you to track program flow and variable values.
Thank you for the swift reply. As to answer your question as to why I am using an Arduino is that I was actually testing a simple solenoid lock circuit on 3 devices (Arduino, NodeMCU and Raspberry Pi) in just a simple system where a solenoid lock will lock and unlock from a button press on the app and record their response time. So i was setting up a lock code for every device. But cannot seem to get a working code that can be applied to the 3 devices.
I understand and thank you for your insight. In terms of this particular Arduino code. Are there any specific codes that i may use or change so that it may successfully communicate with the circuit? Any feedback or suggestion is greatly appreciated.
Your first issue is to reconfigure the ESP-01 to communicate at 9600 baud, and then change your sketch to suit. How you do that will depend on the hardware you have available to you.