From a18970713da95c59d573a2da4b0975fc77334f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomislav=20Kopi=C4=87?= Date: Mon, 15 Sep 2025 10:34:16 +0000 Subject: [PATCH 1/6] Update Readme.md --- Readme.md | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/Readme.md b/Readme.md index 05bb390..6c5bdb9 100644 --- a/Readme.md +++ b/Readme.md @@ -17,23 +17,6 @@ show notifications, display the weather, monitor stuff, show a clock, serve a we --- -## Bill of Materials - -| **Component** | **Quantity** | **Description** | **Notes** | -|---------------------------|--------------|-------------------------------------------|---------------------------------------------| -| ESP8266 D1 Mini | 1 | Microcontroller module | | -| SSD1306 OLED Display | 1 | 128x64 resolution, I2C interface | | -| 14250 Rechargeable Battery| 1 | Lithium-ion battery | Make sure you get the rechargeable type, most 14250 are not | -| TP4056 Module | 1 | Charging and protection circuit | Does not need to have a USB connector | -| 6x6 Push Buttons | 3 or 4 | Tactile push buttons | | -| 20mm Piezo Buzzer | 1 | Caseless buzzer for audio | | -| Resistors (10kΩ) | 3 or 4 | Pull-down resistors for buttons | Not reqired if you are using ESP32 | -| Wires | Several | Thin wires for connections | | -| Enclosure | 1 | 3D-printed case | 3D printable STL files are in `hardware/case/` | -| 2x6mm screw | 12 | Small screws for seembling the case | Does not have to be exactly 6mm long | - ---- - ## Demo Code Explanation This repository contains a basic "Hello, World!" project for the SmartCube. @@ -82,10 +65,28 @@ This is meant to provide a minimal starting point for further development with t --- -## Assembly Instructions +## Bill of Materials + +| **Component** | **Quantity** | **Description** | **Notes** | +|---------------------------|--------------|-------------------------------------------|---------------------------------------------| +| ESP8266 D1 Mini | 1 | Microcontroller module | | +| SSD1306 OLED Display | 1 | 128x64 resolution, I2C interface | | +| 14250 Rechargeable Battery| 1 | Lithium-ion battery | Make sure you get the rechargeable type, most 14250 are not | +| TP4056 Module | 1 | Charging and protection circuit | Does not need to have a USB connector | +| 6x6 Push Buttons | 3 or 4 | Tactile push buttons | | +| 20mm Piezo Buzzer | 1 | Caseless buzzer for audio | | +| Resistors (10kΩ) | 3 or 4 | Pull-down resistors for buttons | Not reqired if you are using ESP32 | +| Wires | Several | Thin wires for connections | | +| Enclosure | 1 | 3D-printed case | 3D printable STL files are in `hardware/case/` | +| 2x6mm screw | 8 | Small screws for seembling the case | Does not have to be exactly 6mm long | +| 2x2mm screw | 4 | Small screws for the front | Mostly for cosmetic purposes | ![layout](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/layout.jpg) +--- + +## Assembly Instructions + 1. Push the ESP8266 microcontroller in the ledge on the bottom [the cube body](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/case/SmartCube_Body_3_button.stl) it sould 'click in' with the USB-C port facing the hole. Body with 3 or 4 button slots is available in the `hardware/case/` From 6e6355ae43a025403cec0eb3e28e49a25a9e3d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomislav=20Kopi=C4=87?= Date: Mon, 15 Sep 2025 10:45:41 +0000 Subject: [PATCH 2/6] Update Readme.md --- Readme.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Readme.md b/Readme.md index 6c5bdb9..137d12f 100644 --- a/Readme.md +++ b/Readme.md @@ -2,7 +2,7 @@ **SmartCube** is a tiny and customizable desk toy using the ESP8266 D1 Mini. Built entirely from cheap, easy-to-find parts, it can connect to Wi-Fi and can be programmed to do just about anything: -show notifications, display the weather, monitor stuff, show a clock, serve a web site, be a virtual pet or whatever else your caffeine-fueled brain can imagine. +show notifications, display the weather, monitor stuff, show a clock, serve a web site, mine crypto, be a virtual pet or whatever else your caffeine-fueled brain can imagine. ![SmartCube](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/cubez.jpg) @@ -75,7 +75,7 @@ This is meant to provide a minimal starting point for further development with t | TP4056 Module | 1 | Charging and protection circuit | Does not need to have a USB connector | | 6x6 Push Buttons | 3 or 4 | Tactile push buttons | | | 20mm Piezo Buzzer | 1 | Caseless buzzer for audio | | -| Resistors (10kΩ) | 3 or 4 | Pull-down resistors for buttons | Not reqired if you are using ESP32 | +| Resistors (10kΩ) | 3 or 4 | Pull-down resistors for buttons | | | Wires | Several | Thin wires for connections | | | Enclosure | 1 | 3D-printed case | 3D printable STL files are in `hardware/case/` | | 2x6mm screw | 8 | Small screws for seembling the case | Does not have to be exactly 6mm long | @@ -96,11 +96,11 @@ Body with 3 or 4 button slots is available in the `hardware/case/` ![Step2](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build2.jpg) -2. **Buttons**: You can glue in the buttons to the top slots at this step and solder the resistors to them +2. **Buttons**: You can glue in the buttons to the top slots at this step and solder the resistors to them. ![Step4](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build4.jpg) -Solder all of the buttons to the microcontroller: +Solder all of the button outputs to the microcontroller: Pin numbers for buttons and other stuff is defined in the [example config](https://git.kopic.hr/tomislav/SmartCubeV1/src/branch/main/src/example_config.h) and the schematic for the [D1 Mini is here](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/schematics/esp8266.png): You don't have to follow my pin definition exactly but I find this the easiest way to assemble and fit everything in. 3 Button variant is the standard. If you are gonna go with the 4 button variant you will need to define this yourself. @@ -108,16 +108,16 @@ You don't have to follow my pin definition exactly but I find this the easiest w - Button Middle (PIN_BTN_M): (D7) GPIO13 - Button Right (PIN_BTN_R): (D8) GPIO15 + You also need to solder the GND wire to the end of the resistors and 3.3V on the button inputs. + ![Step5](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build5.jpg) - -3. **OLED Display**: Crew in or glue the SSD1306 to the [front part of the cube](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/case/SmartCube_Front.stl) solder the 4 wires to the OLED display, make sure you have some extra lenght, 4-5cm sould be more than enough +3. **OLED Display**: Crew in the 2x2mm screws and glue the SSD1306 to the [front part of the cube](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/case/SmartCube_Front.stl) solder the 4 wires to the OLED display, make sure you have some extra lenght, 4-5cm sould be more than enough ![Step6](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build6.jpg) ![Step7](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build7.jpg) - The OLED display must to be connected via I2C on pins: - **SDA**: D2 (GPIO4) - **SCL**: D1 (GPIO5) @@ -131,7 +131,7 @@ The OLED display must to be connected via I2C on pins: ![Step9](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build9.jpg) 5. **Power Supply Setup**: - - Battery is not required and you can skip this step if you want to but it is much cuter when it's portable. A single 600mAh 14250 lasts about 24 hours. + - Battery is not required and you can skip this step if you want to but it is much cuter when it's portable. A single 700mAh 14250 lasts about 24 hours. - Solder the 14250 battery to the TP4056 module input pins. - Wire the output of the TP4056 to the **3.3V pin** on the D1 Mini to power the device. - Connect the **5V output pin** from the D1 Mini to the **input port** on the TP4056 module to allow charging trough the Data USB port on the ESP8266. From 4f670beed8055ce1665f2983467bc9db1788d887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomislav=20Kopi=C4=87?= Date: Mon, 15 Sep 2025 12:10:26 +0000 Subject: [PATCH 3/6] Fix typos in Readme.md --- Readme.md | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/Readme.md b/Readme.md index 137d12f..b15d51a 100644 --- a/Readme.md +++ b/Readme.md @@ -78,7 +78,7 @@ This is meant to provide a minimal starting point for further development with t | Resistors (10kΩ) | 3 or 4 | Pull-down resistors for buttons | | | Wires | Several | Thin wires for connections | | | Enclosure | 1 | 3D-printed case | 3D printable STL files are in `hardware/case/` | -| 2x6mm screw | 8 | Small screws for seembling the case | Does not have to be exactly 6mm long | +| 2x6mm screw | 8 | Small screws for assembling the case | Does not have to be exactly 6mm long | | 2x2mm screw | 4 | Small screws for the front | Mostly for cosmetic purposes | ![layout](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/layout.jpg) @@ -86,8 +86,11 @@ This is meant to provide a minimal starting point for further development with t --- ## Assembly Instructions +--- +1. **Body** + +Push the ESP8266 microcontroller in the ledge on the bottom [the cube body](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/case/SmartCube_Body_3_button.stl), it should 'click in' with the USB-C port facing the hole. -1. Push the ESP8266 microcontroller in the ledge on the bottom [the cube body](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/case/SmartCube_Body_3_button.stl) it sould 'click in' with the USB-C port facing the hole. Body with 3 or 4 button slots is available in the `hardware/case/` ![Step3](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build3.jpg) @@ -96,11 +99,15 @@ Body with 3 or 4 button slots is available in the `hardware/case/` ![Step2](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build2.jpg) -2. **Buttons**: You can glue in the buttons to the top slots at this step and solder the resistors to them. +--- +2. **Buttons** + +You can glue in the buttons to the top slots at this step and solder the resistors to them. ![Step4](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build4.jpg) Solder all of the button outputs to the microcontroller: + Pin numbers for buttons and other stuff is defined in the [example config](https://git.kopic.hr/tomislav/SmartCubeV1/src/branch/main/src/example_config.h) and the schematic for the [D1 Mini is here](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/schematics/esp8266.png): You don't have to follow my pin definition exactly but I find this the easiest way to assemble and fit everything in. 3 Button variant is the standard. If you are gonna go with the 4 button variant you will need to define this yourself. @@ -112,13 +119,16 @@ You don't have to follow my pin definition exactly but I find this the easiest w ![Step5](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build5.jpg) -3. **OLED Display**: Crew in the 2x2mm screws and glue the SSD1306 to the [front part of the cube](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/case/SmartCube_Front.stl) solder the 4 wires to the OLED display, make sure you have some extra lenght, 4-5cm sould be more than enough +--- +3. **OLED Display** + +Screw in the 2x2mm screws and hot glue the SSD1306 to the [front part of the cube](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/case/SmartCube_Front.stl) solder the 4 wires to the OLED display, make sure you have some extra length, 4-5cm should be more than enough ![Step6](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build6.jpg) ![Step7](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build7.jpg) -The OLED display must to be connected via I2C on pins: +The OLED display must be connected via I2C on pins: - **SDA**: D2 (GPIO4) - **SCL**: D1 (GPIO5) - **GND**: GND @@ -126,15 +136,24 @@ The OLED display must to be connected via I2C on pins: ![Step8](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build8.jpg) -4. **Buzzer**: Glue in the buzzer to the [back part of the cube](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/case/SmartCube_Back_Speaker_Side_Hole.stl) +--- +4. **Buzzer** + +Glue in the buzzer to the [back part of the cube](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/case/SmartCube_Back_Speaker_Side_Hole.stl) with superglue + +As defined in the [example config](https://git.kopic.hr/tomislav/SmartCubeV1/src/branch/main/src/example_config.h) connect: + - the positive wire of the buzzer to the 3.3V + - the negative wire to PIN_BUZZER (D3) GPIO0 ![Step9](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build9.jpg) - +--- 5. **Power Supply Setup**: - - Battery is not required and you can skip this step if you want to but it is much cuter when it's portable. A single 700mAh 14250 lasts about 24 hours. + + Battery is not required and you can skip this step if you want to but it is much cuter when it's portable. A single 700mAh 14250 lasts about 24 hours. + - Solder the 14250 battery to the TP4056 module input pins. - Wire the output of the TP4056 to the **3.3V pin** on the D1 Mini to power the device. - - Connect the **5V output pin** from the D1 Mini to the **input port** on the TP4056 module to allow charging trough the Data USB port on the ESP8266. + - Connect the **5V output pin** from the D1 Mini to the **input port** on the TP4056 module to allow charging through the Data USB port on the ESP8266. ![batt1](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/batt1.jpg) @@ -148,10 +167,11 @@ The OLED display must to be connected via I2C on pins: - This is still a work in progress - Everything is pretty tightly packed in there and it's a mess. But it's not as hard to make as it looks. + ![Packed](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/IMG_20241213_171725.jpg) -- Ensure all connections are secure. Hot glue is your friend. -- Test the circuit thoroughly before placing and glueing it in the enclosure. +- Ensure all connections are secure and isolated. Hot glue is your friend. +- Test the circuit thoroughly before placing and gluing it in the enclosure. - Battery is the trickiest part to fit in, it's best to glue the charging module directly to it and put it in the case last For questions or additional details, feel free to reach out! I would love to hear some feedback. From 4364b598b8140c2f90f22b184f255f8f27cc3024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomislav=20Kopi=C4=87?= Date: Mon, 15 Sep 2025 12:23:08 +0000 Subject: [PATCH 4/6] Update Readme.md --- Readme.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Readme.md b/Readme.md index b15d51a..7a735f9 100644 --- a/Readme.md +++ b/Readme.md @@ -100,22 +100,23 @@ Body with 3 or 4 button slots is available in the `hardware/case/` ![Step2](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build2.jpg) --- + 2. **Buttons** -You can glue in the buttons to the top slots at this step and solder the resistors to them. +At this step, glue the buttons into the top slots and solder resistors to their outputs. You can connect the resistor outputs together, and don't forget to attach an extra wire to the button inputs, this will later be used to connect them to the 3.3V line. ![Step4](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build4.jpg) -Solder all of the button outputs to the microcontroller: +Next, solder all of the button outputs to the microcontroller. -Pin numbers for buttons and other stuff is defined in the [example config](https://git.kopic.hr/tomislav/SmartCubeV1/src/branch/main/src/example_config.h) and the schematic for the [D1 Mini is here](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/schematics/esp8266.png): -You don't have to follow my pin definition exactly but I find this the easiest way to assemble and fit everything in. 3 Button variant is the standard. If you are gonna go with the 4 button variant you will need to define this yourself. +Pin numbers for the buttons (and other components) are defined in the [example config](https://git.kopic.hr/tomislav/SmartCubeV1/src/branch/main/src/example_config.h), and the schematic for the [D1 Mini is here](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/schematics/esp8266.png). +You don't have to follow my exact pin definitions, but I've found this setup to be the easiest way to assemble and fit everything in. The 3-button variant is the standard. If you decide to go with 4 buttons, you'll need to define the extra pin yourself in the code. -- Button Left (PIN_BTN_L): (D6) GPIO12 -- Button Middle (PIN_BTN_M): (D7) GPIO13 -- Button Right (PIN_BTN_R): (D8) GPIO15 +* Button Left (PIN_BTN_L): (D6) GPIO12 +* Button Middle (PIN_BTN_M): (D7) GPIO13 +* Button Right (PIN_BTN_R): (D8) GPIO15 - You also need to solder the GND wire to the end of the resistors and 3.3V on the button inputs. +Finally, solder the GND wire to the resistor outputs and connect 3.3V to the button inputs. ![Step5](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build5.jpg) From ffc1d774a92b07478b5fc336a21456a7efb4dd47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomislav=20Kopi=C4=87?= Date: Mon, 15 Sep 2025 12:36:08 +0000 Subject: [PATCH 5/6] Update Readme.md --- Readme.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Readme.md b/Readme.md index 7a735f9..9b68261 100644 --- a/Readme.md +++ b/Readme.md @@ -148,13 +148,22 @@ As defined in the [example config](https://git.kopic.hr/tomislav/SmartCubeV1/src ![Step9](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/build9.jpg) --- -5. **Power Supply Setup**: - Battery is not required and you can skip this step if you want to but it is much cuter when it's portable. A single 700mAh 14250 lasts about 24 hours. +**Battery Setup** - - Solder the 14250 battery to the TP4056 module input pins. - - Wire the output of the TP4056 to the **3.3V pin** on the D1 Mini to power the device. - - Connect the **5V output pin** from the D1 Mini to the **input port** on the TP4056 module to allow charging through the Data USB port on the ESP8266. +The battery is optional. Your SmartCube will work fine without it at this point; however, adding one makes it portable (and much cuter). + +A single 700 mAh 14250 battery lasts about 24 hours. Keep in mind there's currently no way to manually power the Cube off, it will continue running until the battery is depleted. The TP4056 prevents the cell from being completely drained and should protect it from damage. + +* Solder the 14250 battery to the **TP4056 input pins**. +* Wire the **TP4056 output** to the **3.3V pin** on the D1 Mini to power the device. +* Connect the **5V output pin** from the D1 Mini to the **TP4056 input port** to allow charging through the USB data port on the ESP8266. +* *(Optional)* Add a **voltage divider** to monitor battery level with the ESP8266 **A0 pin**. + + * **R1 = 220kΩ** (between battery positive and A0) + * **R2 = 56kΩ** (between A0 and GND) + + This safely scales 4.2V down to \~0.85V, allowing the software to read and estimate the battery’s charge level. ![batt1](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/batt1.jpg) From 6b116edbe1134e5d495e3480dfbbe6faa73b0f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomislav=20Kopi=C4=87?= Date: Mon, 15 Sep 2025 12:54:46 +0000 Subject: [PATCH 6/6] Update Readme.md --- Readme.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Readme.md b/Readme.md index 9b68261..a0591cc 100644 --- a/Readme.md +++ b/Readme.md @@ -75,8 +75,9 @@ This is meant to provide a minimal starting point for further development with t | TP4056 Module | 1 | Charging and protection circuit | Does not need to have a USB connector | | 6x6 Push Buttons | 3 or 4 | Tactile push buttons | | | 20mm Piezo Buzzer | 1 | Caseless buzzer for audio | | -| Resistors (10kΩ) | 3 or 4 | Pull-down resistors for buttons | | -| Wires | Several | Thin wires for connections | | +| Resistors (10kΩ) | 3 or 4 | Pull-down resistors for buttons | | +| Resistors (220kΩ and 56kΩ)| 1 | Voltage divider | For monitoring the battery charge level | +| Wires | Several | Thin wires for connections | I used wires from inside an old ethernet cable | | Enclosure | 1 | 3D-printed case | 3D printable STL files are in `hardware/case/` | | 2x6mm screw | 8 | Small screws for assembling the case | Does not have to be exactly 6mm long | | 2x2mm screw | 4 | Small screws for the front | Mostly for cosmetic purposes | @@ -151,19 +152,18 @@ As defined in the [example config](https://git.kopic.hr/tomislav/SmartCubeV1/src **Battery Setup** -The battery is optional. Your SmartCube will work fine without it at this point; however, adding one makes it portable (and much cuter). +The battery is optional. Your SmartCube will work fine when powered via USB; however, adding one makes it portable (and much cuter). A single 700 mAh 14250 battery lasts about 24 hours. Keep in mind there's currently no way to manually power the Cube off, it will continue running until the battery is depleted. The TP4056 prevents the cell from being completely drained and should protect it from damage. * Solder the 14250 battery to the **TP4056 input pins**. * Wire the **TP4056 output** to the **3.3V pin** on the D1 Mini to power the device. * Connect the **5V output pin** from the D1 Mini to the **TP4056 input port** to allow charging through the USB data port on the ESP8266. -* *(Optional)* Add a **voltage divider** to monitor battery level with the ESP8266 **A0 pin**. - +* *(Optional)* Add a **voltage divider** to monitor battery level on the ESP8266 **A0 pin**: * **R1 = 220kΩ** (between battery positive and A0) * **R2 = 56kΩ** (between A0 and GND) - This safely scales 4.2V down to \~0.85V, allowing the software to read and estimate the battery’s charge level. + This scales the battery voltage safely down for measurement (~0-0.85V). ![batt1](https://git.kopic.hr/tomislav/SmartCubeV1/raw/branch/main/hardware/pictures/batt1.jpg)