Logo

Radio, WiFi, Bluetooth

This week, Manas and I tackled the networking assignment by creating an LED display to indicate the day of the week. We started by designing a display that had seven distinct slots, each representing a different day. Our design included pass-through holes for each slot, which allowed us to run wiring to connect the electronics from underneath. After finalizing the prototype design, we proceeded to 3D print it.

Website Image
Download the Grasshopper file

To ensure our display would show the correct day, we used an ESP32 board, which is a microcontroller with Wi-Fi capability. This board was programmed to retrieve the current day from an NTP server. An NTP server is a dedicated computer that uses the Network Time Protocol to provide devices with the precise time and date, ensuring our display would always be accurate.

Our code is designed to connect to a Wi-Fi network, synchronize time with an NTP server, and control a set of LEDs based on the day of the week. It defines a structure to associate GPIO pins with days of the week and initializes a Wi-Fi connection using specified credentials. Once connected, it retrieves the current time, disconnects from Wi-Fi to save power, and sets each pin to an output mode. In its main loop, the code continuously checks the current day and activates the corresponding LED for that day, turning on one LED each day of the week, while turning off all others. It has error handling for failure to obtain the time, and serial print statements for debugging and monitoring its status.

Here is what our code looked like:

Website ImageWebsite Image
Download the Ardunio code file

While the printing was underway, we focused on coding. We started by experimenting on a breadboard, connecting several LEDs to the ESP32 using resistors and tested our code. With the code working correctly, we moved on to constructing the final product. We soldered wires to the LEDs and carefully placed them into the designed slots of our display. After setting up the circuitry and initiating our code, the display came to life, with the green LED shining brightly to indicate that it was Thursday.

Website Image