NODEMCU LUA ESP8266 With 74HC595 LED and Matrix Driver

6,525

20

8

Introduction: NODEMCU LUA ESP8266 With 74HC595 LED and Matrix Driver

This is my attempt at driving the 595 shift register with an ESP8266.

I am using NodeMCU 0.9.5 build 20150318 powered by Lua 5.1.4 on ESPlora v0.2.0-rc2, which is standard stuff. Included are 2 examples of LUA code. Both programs are the same except there is an extra line needed in the dual program. The GPIO pins on the ESP8266 are set for SPI mode.

Step 1: ESP8266 Driving Single 595 With 8 LEDS

This is how to drive a 595 from an ESP8266. I am using an ESP12 to do this, but any with more than 3 I/Os will do the job. This set up works at 3.3 volts. I am using SN74HC595N ICs, don't know if it will work with other 595s.

Included is a circuit diagram of how to connect everything together. I am assuming you know how to connect up your ESP8266 and load code into it.

This is an image of my 595 set up (also works with the Arduino).

Some simple LUA code shows the basics.

Step 2: ESP8266 Driving Dual 595s With 8 X 8 Matrix

This is my dual 595 set up with an 8x8 Matrix.

The program is exactly the same as the single except that you need to load in 16 bits of data instead of 8.

This line goes to the 2nd 595.

spi.send(1,0)

Change the zero to any value between 0 and 255 to see result.

Changing the zero to any value between 0 and 255 gives different lines on the matrix. You can also alter the data in the programs to display different sequences.

This line goes to the 1st 595

spi.send(1,byte)

I have included a circuit diagram for this but there are plenty of examples for the Arduino out there. My board works with the Arduino as well as the ESP8266.

Be the First to Share

    Recommendations

    • Make it Glow Contest

      Make it Glow Contest
    • First Time Author Contest

      First Time Author Contest
    • PCB Challenge

      PCB Challenge

    8 Discussions

    0
    tvm389
    tvm389

    Question 8 months ago

    I struggle with 1uf capacitor you described, all leds always is on, removed the capacity it works. I don't know why? (I know a little but why you put the capacitor on ST_CP?)

    0
    JohnL142
    JohnL142

    Answer 8 months ago

    Sorry about that, I used someone else's diagram and missed the mistake. Corrected now.

    0
    BeachsideHank
    BeachsideHank

    4 years ago

    "I have not included a circuit diagram for this as there are plenty of examples for the Arduino out there".

    No doubt you are right, but the neophyte Arduino user may not be up to pairing the circuit you created with the proper Arduino sketch or circuit information, so a few links that you believe to be appropriate may be helpful to include in your posting. ☺

    0
    JohnL142
    JohnL142

    Reply 4 years ago

    I was new to all this once, when there was hardly anything out there and a lot of the stuff did not work either. I cannot do every instructable for all levels of readers as they would be so boring going over the simple stuff time and again. I will try and find a diagram or a link for you and others who are just learning.

    0
    BeachsideHank
    BeachsideHank

    Reply 4 years ago

    Not to be argumentative with you, or to impose an additional burden, but a simple link will suffice, it will no doubt spawn other avenues of information. Yours was a rather offbeat and unusual post which is why I read it. ☺

    0
    JohnL142
    JohnL142

    Reply 4 years ago

    Circuit diagram now included!

    0
    BeachsideHank
    BeachsideHank

    Reply 4 years ago

    On behalf of Noobs everywhere, I sincerly thank you! ☺

    0
    Droxz
    Droxz

    4 years ago

    nice one, have to try this.
    thanks and keep up the good work!