Your browser version is outdated. We recommend that you update your browser to the latest version.

Here is a code for Arduino, that works without the need of a Nextion library.

I tried to make it as simple as I could and as close to begginer - friendly as possible.

The project is now met with the terms of the open-source GNU General Public License, as all open-source projects should do.

Some information about the project:

A demonstration video on Youtube of the project:

You can control any relay, by pressing any button on the screen. The buttons are push buttons, in order to change the background picture < .picc > from Arduino, only when the state of the relay is changed, so as to have a real feedback of the actual relay condition-state.

Also, a function was added to detect if Nextion is alive, by turning on a LED on pin 12. You could put a buzzer if you like to. In order to do that, a timer component was added on Nextion that sends an "alive message" to Arduino every 4,9 seconds in combination with a timer on Arduino, that has been set to 10 seconds, and if the "alive message" isn't received in 10 seconds or less, the pin 12 goes HIGH.

In addition, the page on Nextion refreshes every minute with the real state of the relays.

Much more, at the comments inside the code.

For more on how to learn to code with Nextion and Arduino, visit our Nextion Tutorial.

To get the .HMI and .ino files,

for Nextion and Arduino,

go to our Download Section,