Happy Week Indicator

by Arnov Sharma in Circuits > Microcontrollers

290 Views, 3 Favorites, 0 Comments

Happy Week Indicator

23.gif
IMG_20241111_234255.jpg
24.gif
IMG_20241111_233729.jpg
asassadds.jpg

Greeting everyone and welcome back.

The Happy Day Meter is a desk light that tracks the days of the week and the weekends using an XIAO ESP32 C3 that is connected to the internet.

This meter turns RED on weekdays and green on weekends, signaling the arrival of the weekend. Happy days are shown by green lights, whereas non-happy days, or weekdays, are indicated by red.

The idea for this project was straightforward: I wanted a desk light that reminded me that it was weekdays and that it would turn green to indicate the arrival of happy days as soon as the weekends arrived.

In order to keep track of the day and control the WS2812B LEDs, we are utilizing Seeed's XIAO ESP32 C3 microcontroller board, which is connected to the internet.

Three PCBs in all were layered together using PCB standoffs to create a sandwich-like framework for this project, which was entirely composed of PCBs. The microcontroller setup, power circuit, and WS2812B LED array are located in the middle layer. The front PCB has an appealing graphic and a power button, and the back PCB is merely there to cover the device from the back because it has an exposed lithium cell and microcontroller board.

We added a front PCB layer with the chemical structure of serotonin, also known as the happy hormone, to turn this project into a work of art.

This Instructables is about the whole construction process of this project; let's get started with the build.

Supplies

These were the materials used in this project.

  1. Custom PCBs
  2. Seeed XIAO ESP32 C3 Microcontroller
  3. WS2812B LEDs
  4. IP5306 Power Management IC
  5. 10uF 1206 Capacitors
  6. 1uH Inductor SMDs
  7. M3 PCB STANDOFFS
  8. M3 Bolts
  9. On Off Tactile Switch
  10. CON2 JST Connector
  11. CON8 Female Header Pins
  12. JST Wire harness
  13. SMD 18650 Lithium Cell holder
  14. 3.7V lithium ion cell

Circuit

SCH_page-0001.jpg
04.PNG
03.PNG
01.PNG
02.PNG
bitmap.bmp

For this project, we build two PCBs: the main circuit board, which houses the power management board, LED array, and microcontroller setup. The front layer board is an additional board that was included only for aesthetic purposes. It has a single switch that will be used to turn the device on and off and ultimately connect to the main circuit.

The Seeed XIAO ESP32 C3 Microcontroller, a small and powerful IoT development board developed by Seeed Studio, is the first of three components that make up the Main Circuit board. It has a 32-bit RISC-V processor, Wi-Fi and Bluetooth 5 (LE) connectivity, low power consumption, and multiple interfaces, making it perfect for our project.

The array of WS2812B LEDs in the second section is all linked in the standard way. The GPIO0 pin of the XIAO is linked to the Din of the first LED. The Dout of the first LED is connected to the Din of the second, the Dout of the second LED is connected to the Din of the third, and so on, all the way up to the sixteenth LED.

The IP5306 is utilized in the third section of the circuit, which is the power management circuit. It charges and discharges the lithium cell correctly, providing a steady 5V output from a 3.7V lithium cell source.

To prepare both boards, we use the same layout of 95x95mm board, which contains mounting holes at each corner of board. we use the same board outline for making both boards.

In order to give the front layer a more creative appearance, we also included images of the serotonin chemical structure and letters for happiness. To do this, we looked on Pinterest for an image, converted it to a BMP file, and then imported it as a vector in my PCB Cad software.

I remove all of the letters and lines of the chemical structure from the top and bottom of the solder mask so that light from the main board can pass through.

We exported the gerber data from both files after they were prepared, and we will share it with a PCB manufacturer for samples.

Downloads

Seeed Studio Fusion

IMG_20241102_134146.jpg
01.gif
02.gif

Following the completion of the Gerber data for both PCBs, we uploaded the files to Seeed Fusion's website and ordered two PCBs: one for the blue solder mask and one for the white solder mask.

PCBs were received in a week, and their quality was super good considering the rate, which was also pretty low.

Seeed Fusion PCB Service offers one-stop prototyping for PCB manufacture and PCB assembly, and as a result, they produce superior-quality PCBs and fast turnkey PCBAs within 7 working days.

Seeed Studio Fusion PCB Assembly Service takes care of the entire fabrication process, from Seeed Studio Fusion Agile manufacturing and hardware customization to parts sourcing, assembly, and testing services, so you can be sure that they are getting a quality product.

After gauging market interest and verifying a working prototype, Seeed Propagate Service can help you bring the product to market with professional guidance and a strong network of connections.

Main Circuit Assembly

03.gif
04.gif
05.gif
06.gif
07.gif
08.gif
09.gif
  1. Utilizing a solder paste dispensing syringe, we apply solder paste to each component pad to begin the Main Circuit Assembly process. Here, we are utilizing Sn/Pb 63/37 solder paste, which has a melting temperature of 190 °C.
  2. Next, we pick each SMD component and place them in their correct locations.
  3. All of the components are then permanently bound to their pads when the entire circuit is set on the reflow hotplate, which heats the PCB to the solder paste melting temperature.
  4. After placing all of the THT components on the bottom side of the board, including the header pins for the XIAO placement, USB Micro port, and CON2 JST connector, we use a soldering iron to attach their pads from the top side.
  5. To put a lithium cell holder, we first solder some solder wire on one side of the holder's pad, then link the terminal of the cell holder to the pad to secure it in place. Finally, we solder the other side of the holder to secure it in place.

Front Layer Assembly

10.gif
11.gif
12.gif
  1. In order to assemble the front PCB, we install a tactile switch and use a soldering iron to connect its pads from the back of the PCB.
  2. For the future coupling of this board with the power board, we then connected a CON2 Wire harness to the switch's terminals.

Power Board Testing

13.gif
14.gif
15.gif
  1. A 3.7V 2000mAh Li-ion battery (18650) first goes into the lithium cell holder in the proper orientation to begin the power board testing process.
  2. The CON2 wire harness was then connected to the power board's CON2 connector.
  3. The power board turns on when we press the switch once. Next, we measured the 5V voltage across the IP5306's output terminals.
  4. This indicates that our circuit is operational.

FINAL ASSEMBLY

16.gif
17.gif
18.gif
19.gif
20.gif
21.gif
22.gif
  1. Using PCB standoffs, the Main Circuit Board and the Front Layer Board are connected to start the final assembly. Here, we connect two boards using four M3 22mm Long Standoffs. On the rear side of the main circuit, we also installed four more M3 standoffs, which we want to add a third layer to.
  2. After removing the adhesive patch off the antenna and positioning the antenna on the back of the PCB, we insert the XIAO ESP32 C3 Microcontroller in its place and push it into position on the header pins.
  3. We use a bare main circuit PCB for the third layer, further referred to as the rear layer, and attach it to the device's back side using four M3 bolts.
  4. The third layer is only there to protect the lithium cell and XIAO from the rear.
  5. The PCB has now been assembled.

CODE

Here's the code we used in this build and its a simple one.

#include <WiFi.h>
#include <NTPClient.h>
#include <WiFiUdp.h>
#include <Adafruit_NeoPixel.h>
#define LED_PIN D0 // GPIO pin connected to the NeoPixel
#define NUM_LEDS 16 // Number of NeoPixels
// WiFi credentials
const char* ssid = "UR SSID";
const char* password = "UR PASS";
// Define NeoPixel strip object
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);
// Define NTP Client to get time
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, "pool.ntp.org", 19800, 60000); // IST timezone offset (19800 seconds)
unsigned long lastChange = 0;
bool isWeekend = false;
// Function to connect to Wi-Fi
void connectToWiFi() {
Serial.print("Connecting to WiFi...");
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED && millis() < 20000) { // Limit connection attempt to 20 seconds
delay(500);
Serial.print(".");
}
if (WiFi.status() == WL_CONNECTED) {
Serial.println("Connected to WiFi");
} else {
Serial.println("Failed to connect to WiFi");
}
}
void setup() {
Serial.begin(115200);
strip.begin();
strip.show(); // Initialize all pixels to 'off'
connectToWiFi();
timeClient.begin();
}
void loop() {
if (WiFi.status() == WL_CONNECTED) {
timeClient.update();
int dayOfWeek = timeClient.getDay();
isWeekend = (dayOfWeek == 0 || dayOfWeek == 6);
} else {
// Default behavior to alternate colors if not connected to Wi-Fi
if (millis() - lastChange > 10000) { // Change color every 10 seconds
isWeekend = !isWeekend;
lastChange = millis();
}
}
if (isWeekend) {
strip.fill(strip.Color(0, 255, 0), 0, NUM_LEDS); // Green for weekends
} else {
strip.fill(strip.Color(255, 0, 0), 0, NUM_LEDS); // Red for weekdays
}
strip.show();
delay(1000); // Update every second
}

This code connects the XIAO ESP32 C3 microcontroller to a Wi-Fi network, retrieves the current day from an NTP (Network Time Protocol) server, and controls a strip of NeoPixel LEDs to display different colors based on whether it's a weekday or weekend, even if the device loses its Wi-Fi connection.

RESULT

05.jpg
06.jpg

Here's the result of this small build, the Happy Week Indicator, a FUN little desk light that glows RED Throughout the weekdays, during weekends it changes color to green, which indicates that its weekends. Green here means happy.

This idea was designed only for amusement; it does have the very little function of showing the days of the week and the weekend, but that can be accomplished with ease by simply checking a calendar or using our phones. That is too boring, which is why we made the device.

For now, this project is finished and needs no further revision.

All the details regarding this project, including files, are attached, which you can download.

Leave a comment if you need any help regarding this project. This is it for today, folks.

And I'll be back with a new project pretty soon!