Wroom 32 Matrix Clock

by Tinker_Tet in Circuits > Clocks

1033 Views, 4 Favorites, 0 Comments

Wroom 32 Matrix Clock

Full tutorial
IMG_7946.jpg

Hello! If you are looking for a project that involves using an ESP 32 to make a digital clock that not only tells time but can tell the date, humidity, and temperature while connecting to your WIFI then you have come to the right page! This project will show you how to build the circuit and show what to do with your code depending on where you are located in the world along with what code modifications you might need to do to apply to get your clock up and running. Also just a heads up we will be using the ESP-Wroom-32 for the base of the project. I have made a quick tutorial on how to build and code the clock, but I would also definitely read through the text still. The video is just to give an example of the circuit build and where to go in the code. I would also like to give a shout out and thank you to ZaNgAbY for doing the brunt of the work. Their Instructables project page can be found here: https://www.instructables.com/ESP32-LED-Matrix-Clock/

Supplies

ESP-32-ESP-32S-Wireless-WiFi-Bluetooth-Development-Board-2-4GHz-Micro-USB-CP2102-Dual-Core-1.jpg_q50-1.jpg
DHT22.jpg
MAX7219.jpg
Photoresistor.jpg
10k Resistor.jpg
Jumper Wires.jpg

For this project I had used:

  • ESP-Wroom-32
  • 2 bread boards
  • 4 8x8 MAX7219 LED Matrix
  • DHT22 Sensor
  • Micro USB plug
  • 1 Photoresistor
  • 1 10k resistor
  • (Optional: KY-018 and you don't have to worry about the 10k resistor and photoresistor then)
  • 5 male to female jumper wires
  • 6 male to male jumper wires

Building the Circuit

tempsnip.png

Fallow the circuit diagram and connect accordingly.

For the KY-018 part of the diagram, use your 10k resistor and photoresistor to to build the KY-018. First make a circuit loop with the VCC, GRND, and 10k resistor. Next have one end of the photoresistor connect somewhere on that loop, and the other end have it connect to the D34 port.

The ESP-Wroom-32 will be the piece that connects to the WIFI, The DHT22 will be the piece that reads temperature and humidity, the MAX7219's are the LED display, and the photoresistor 10k resistor combo (KY-018) is the piece the adjusts the led display's brightness.

Download the Code

Arduino IDE Logo Code.PNG

Download this pre-existing code for Arduino IDE.

Setting Up Arduino IDE

Screenshot (2).png
Screenshot (3).png
Screenshot (4).png
Screenshot (5).png
Screenshot (6).png
Screenshot (7).png
Screenshot (8).png

Now we will set up Arduino IDE to be able to be compatible with the ESP-Wroom-32.

We first open up Arduino IDE and go to the upper left corner to "File". Click on "File" and go down to "Preferences". Next go to "Additional Boards Manager URL's:" and past "http://arduino.esp8266.com/stable/package_esp8266com_index.json,https://dl.espressif.com/dl/package_esp32_index.json" into the white rectangle. Click "Ok".

Now we go to "Tools" up top and click on it. Go down to "Board" and then to "Boards Manager". Next search for "esp32" and install "esp32 by Espressif System". Once installed you can close out of that.

Now we will be able to select our board. Go back up to "Tools" and select "Board" again. Scroll through the list until you find "DOIT ESP32 DEVKIT V1". Select that board. Now you will be able to upload code to the ESP-Wroom-32.

Understanding Your Code

MD_MAX72xx.PNG
WIFI Cradentials.PNG
TimeZones.PNG
Number of MAX boards.PNG
OFF LINE TEXT.PNG

Now that you are able to upload to the ESP-Wroom-32, we will go through the code and set it up accordingly.

1) Starting with defining what kind of MAX7219, if you reference image 1, depending if you have "FC16_HW" or "GENARIC_HW" you will comment out one with a "//" and comment in the other by removing the "//".

2) Next we go to image 2 where we will be entering your WIFI name and password. Where there are "########" that is where you will put first your WIFI name and then below in the next "#########" your WIFI password.

3) Moving onto image 3, we will be going to the part of the code where you will be defining what Time Zone you are currently in. To find the different time zones code, scroll all the way to the bottom of the code. Find what time zone you are in and copy the code to the right of your listen time zone. For example, my current time zone is Central America so I copied the code "TZNameCST6CDT,M3.2.0,M11.1.0". I then went back up and wrote "'#define  TZName   "TZNameCST6CDT,M3.2.0,M11.1.0" // Centeral Time America'" under the "//Timezone-------------" section to define my time zone. Do not forget to comment out the other pre-existing time zones already there.

4) Now we will determine how many MAX7219 boards we have. Referencing image 4, we go to "#define anzMAX" and enter the number of MAX7219's you are using. In my case I am using 4 MAX7219's.

5) Lastly, in case your clock ever goes off line you will be able to decide what the off line message will scroll on your clock. Referring to image 5 is where you will go to to edit any text you so willingly would like to display. For example I have the text "OFF LINE. Please Connect to internet to get updated: TIME, DATE, HUMIDITY, and TEMPERATURE. Refer to your phone at this time for updates instead :)". Here is where you can write your message if you do not like mine.

Uploading Code

Uploading Code.png
ESP-32-ESP-32S-Wireless-WiFi-Bluetooth-Development-Board-2-4GHz-Micro-USB-CP2102-Dual-Core-1.jpg_q50-1.jpg

Now that everything is set up and ready to roll, it is time to upload the code. First start by plugging in the micro USB into the ESP-Wroom-32 and your computer. Once your computer has detected the ESP-Wroom-32, go to the top left and click on the green circle with the check mark on it. Allow the code to fully upload. Once fully uploaded successfully you must do a hard restart with the ESP-Wroom-32 by physically pressing the "EN" on the ESP-Wroom-32 board.

ALL DONE!

Congrats.jpg

This completes the project and you should now have a fully functioning working and scrolling clock! If you would like to see the functioning and WIFI connection of the ESP-Wroom-32 go up to "Tools" again, and then down to "Serial Monitor".

Demonstration

Full Demo

Helpful Websites

Helpful logo.PNG