Aurduino + Ethernet module ENC28J60 or WEB control relay (Arduino webserver)

Once I made control of GPIO outputs on Raspberry Pi. This control of was carried out through the web interface by setting a web server on raspberry pi and application framework webiopi. At that time I did control of 4 relay module over the internet (everything is still to be published).

So long ago was going to try something similar to Arduino. With the Raspberry Pi was no problem. This is not surprising: full ethernet interface + full multitasking OS. And what about the Arduino? It’s simple, use ethernet module ENC28J60.

Therefore made the following:

1) Ethernet module is connected to the Arduino:

VCC - 3.3V Arduino
GND - GND Arduino
SCK - Pin 13 Arduino
SO - Pin 12 Arduino
SI - Pin 11 Arduino
CS - Pin 10 Arduino

2) Downloaded required libraries here or here

3) The relay is connected to the Arduino so:

VCC - 5V Arduino
In1 - Pin 2 Arduino
In2 - Pin 3 Arduino
In3 - Pin 4 Arduino
In4 - Pin 5 Arduino
GND - GND Arduino

4) Slightly altered under my needs sketch: HERE
The program is well commented, so here I will not explain how it works.

5) Module ENC28J60 connected to my router via ethernet cable. My arduino automatically assigned IP address Seek Arduino can be entering this IP address in the browser tape. Before we open the Web page from which you can manage our relays 😉


У этой записи 10 комментариев

  1. first of all…..thankyou so much for your arduino webserver sketch,i looking for it a lot last two week and not work or not suitable for me,until your sketch show in the search result,
    i want to ask how can i change the font size show in the webpage server,too small when i connect with cell phone,
    and the following problem ………………….// ?????, ??? ?????? ????? ?? Web ????????, ??? ?????? ???????? ???????? ??????.

    thanks again

  2. ps how to change the font size and position in the webserver page,thankyou

  3. Hi,
    nice job, was searching a long time for an webinterface with eth and relay for the nano. But i got a problem. When i start the nano, the pin 9 is set to high, so the relay is on. How can i change it to low on start? And is it possible to start without an password and maybe to add some more relay?


  4. Hi,

    I have tried this code, but no matter what I do, I don’t seem to be able to get Relay 1 to switch on and off. The other relays all work.


    1. Hey.
      If you managed to do all three functional relays can you send a complete project archive?
      It would be good and some photos or a sketch of connecting and make some explanations on how the server or only interrogate Rooter?
      Thank you very much and I hope I have this beautiful project and I definitely want to add 8 relay functional.
      I share with you when I was able to make 8 relays functional but here it is clear because I do not speak English and are unable to understand the connection basket and the lack diagram.
      But congratulations creator that’s a great thing.
      My Email [email protected]

  5. Thank you very much for your code which allowed me to begin a EthernetRelay.

    I made a version of your optimized code (definition of the relay number at first, traces of debug, bigger font,etc)

  6. i want use this code to control my garage gate
    but my garage driver need just a 1 impulse,
    so its possible to change ON/OFF button to button which change state for a while?

  7. hi dude.
    This code working first code for enc28j60!!!!!!!!!!!!!!!!!! very very thanks!

    can u send 4 relay + dht11 and MQ2 sensors code.

    thanks dude.

Добавить комментарий

Этот сайт использует Akismet для борьбы со спамом. Узнайте как обрабатываются ваши данные комментариев.

Закрыть меню