Overengineered Smart Pen Holder: A Comprehensive Guide

To not miss my updates, remember to check the public account in the upper right corner and set it as a star. Please give me a star!

Overengineered Smart Pen Holder: A Comprehensive Guide
Overengineered Smart Pen Holder: A Comprehensive Guide

This is a pen holder made entirely of PCBs and 3D printed parts, which is completely different from traditional pen holders. It has many functions, including temperature and humidity display, an aesthetically pleasing onboard LED light, and a USB port that provides 5V power. Without further ado, let’s watch the video; please understand it by yourself.

Here is the detailed production process. The schematic code and related files can be downloaded at the end of the article.

Required Hardware Components
  • ESP12F Module

  • SSD1306 OLEDAHT10 Sensor

  • 5mm Red LED

  • IP5306 Power Management IC

  • 1uF 0805 Package Capacitor

  • 18650 Lithium Ion Battery Holder

  • 3.7V 2900mAh Lithium Ion Battery

  • 3D Printed Parts

  • 10K Resistor

  • 5.6 Ohm 1206 Package Resistor

  • USB Type-C Port

➣ Design Concept

First, the 3D model is created in Fusion360, and the pen holder consists of four identical rectangular plates arranged in a cuboid shape. To secure these PCBs together, two internal brackets with screw mounting holes were designed, adding screws to keep the PCBs connected to the internal brackets.
Overengineered Smart Pen Holder: A Comprehensive Guide
The internal brackets are located at the top and bottom of the pen holder, with the bottom bracket serving as the cover.
The display, ESP configuration, and AHT10 sensor will be on the front PCB, while the lithium battery and power management IC arrangement will be on the bottom PCB.
PCBCAD software is used to generate the outline after exporting the PCB shape as a DWG file.

➣ Circuit Diagram PCB Design

The first step in PCB design is to create a total of three different boards: a power management board containing the IP5306 IC with a lithium battery, a side PCB that serves only as a connection board connecting the VCC-GND of the front PCB to the power management board, and a front board that includes the ESP10F setup with the SSD12 display and AHT1306 sensor.
The power management board consists of the IP5306 IC and all necessary components such as input and output capacitors, inductors, etc.
Overengineered Smart Pen Holder: A Comprehensive Guide
The battery increases the footprint of the 18650 SMD holder, using a Type-C connector for power input. Additionally, five red LEDs were added in parallel with four 10-ohm resistors and the IP5306, with a button switch between the 5V and the positive terminal of the LEDs.
Once the schematic for the power board is completed, we create the PCB outline using the DWG file exported from Fusion360 and add all components to the circuit board. The LEDs are placed on the bottom of the PCB, while the IP5306 IC components (including the battery holder) are added to the top of the PCB since the top will face outward. The LEDs will be placed inside the pen holder to illuminate the entire assembly from within.
Overengineered Smart Pen Holder: A Comprehensive Guide
Since the ESP12F is a 3.3V device, 5V would damage the MCU, so an AMS1117 voltage regulator setup was added to step down the 5V input to 3.3V for the ESP to function normally. Next, we prepare the front PCB, which connects to the SSD12 OLED and AHT1306 sensor with the ESP10F setup. The entire circuit board is powered by the 5V obtained from the power module board.
Overengineered Smart Pen Holder: A Comprehensive Guide
The display and AHT10 sensor are both powered by 5V.
The same DWG file is also used to create the outline for this board. An AHT is added on one side, with the ESP12F added in the middle below the display.
Overengineered Smart Pen Holder: A Comprehensive Guide
The third board, the side PCB, will be empty, with no ports or connection pads, but we added two CON1 ports, with PCB traces linking to them, extending 5V and GND from one side of the board to the other.
Aside from this purpose, both sides of the side PCB have patterns and solder mask holes allowing light from the LEDs to pass through.
Overengineered Smart Pen Holder: A Comprehensive Guide

➣ ComponentsSoldering

Starting from the front-end temperature/humidity PCB assembly, this requires using two soldering techniques as it involves both SMD and THT components.

1) First, use a solder paste dispenser to apply solder paste on each SMD component pad.
2) Next, we use ESD tweezers to pick up all SMD components and place them in the appropriate positions.
3) Following the pick and place procedure, carefully lift the PCB and place it on the SMT reflow soldering heating plate, which heats the PCB from below to the melting temperature of the solder paste, permanently soldering all components to their pads.
4) We collect all THT components, including the OLED display and AHT10 sensor module, place them on their pads, and then solder the pads with a standard soldering iron.

Next, we start assembling the power management board, which follows the same process used to create the front PCB.
Overengineered Smart Pen Holder: A Comprehensive Guide
The entire system is powered by a 3.7V, 2900mAh 18650 lithium-ion battery, with the ESP12F OLED and LED powered reliably by the IP5306V power management IC.
We insert the 18650 battery into its holder, confirming the polarity, and then use a multimeter to measure the output voltage, which should be 5 volts; this will confirm that the installation is functioning.

Programming the Temperature/Humidity Board with NODEMCU

By using a NODEMCU board and connecting jumpers to its GND pin and EN pin, we put the onboard ESP8266 of the NODEMCU into sleep mode, allowing us to program the external ESP12F module with NODEMCU.
Overengineered Smart Pen Holder: A Comprehensive Guide
This allows us to connect the external ESP board to the NODEMCU. Essentially, we are shutting down the ESP board on the NODEMCU and connecting a second ESP board to several of its pins.
For more information on this process, you can read the article below.
https://www.hackster.io/Arnov_Sharma_makes/program-esp8266-with-nodemcu-7ea1bb
This code uses the AHT10 library to read temperature and humidity values from the AHT10 sensor and display them on the SSD1306 OLED display.
#include <Wire.h>#include <AHTxx.h>
#include <Adafruit_SSD1306.h>#include <Adafruit_GFX.h>
#define OLED_WIDTH 128#define OLED_HEIGHT 64
#define OLED_ADDR   0x3CAdafruit_SSD1306 display(OLED_WIDTH, OLED_HEIGHT);
float ahtValue;                               //to store T/RH result
AHTxx aht10(AHTXX_ADDRESS_X38, AHT1x_SENSOR); //sensor address, sensor type
void setup(){  #if defined(ESP8266)  WiFi.persistent(false);  //disable saving wifi config into SDK flash area  WiFi.forceSleepBegin();  //disable AP & station by calling "WiFi.mode(WIFI_OFF)" & put modem to sleep  #endif
  display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR);  display.clearDisplay();
  Serial.begin(115200);  Serial.println();    while (aht10.begin() != true) //for ESP-01 use aht10.begin(0, 2);  {    Serial.println(F("AHT1x not connected or fail to load calibration coefficient")); //(F()) save string to flash & keeps dynamic memory free    delay(5000);  }
  Serial.println(F("AHT10 OK"));  //Wire.setClock(400000); //experimental I2C speed! 400KHz, default 100KHz}
void loop(){  /* DEMO - 1, every temperature or humidity call will read 6-bytes over I2C, total 12-bytes */  Serial.println();  Serial.println(F("DEMO 1: read 12-bytes"));
  ahtValue = aht10.readTemperature(); //read 6-bytes via I2C, takes 80 milliseconds
  display.clearDisplay();  display.setTextSize(2);  display.setTextColor(WHITE);  display.setCursor(30, 0);  display.println(F("Temp-"));//  Serial.print(F("Temperature...: "));  if (ahtValue != AHTXX_ERROR) //AHTXX_ERROR = 255, library returns 255 if error occurs  {  display.setTextSize(2);  display.setTextColor(WHITE);  display.setCursor(35, 25);  display.println(ahtValue);  display.display();//    Serial.print(ahtValue);  }  else  {    printStatus(); //print temperature command status
    if   (aht10.softReset() == true) Serial.println(F("reset success")); //as the last chance to make it alive    else                             Serial.println(F("reset failed"));  }
  delay(2000); //measurement with high frequency leads to heating of the sensor, see NOTE
ahtalue = aht10.readHumidity(); //read another 6-bytes via I2C, takes 80 milliseconds
  display.clearDisplay();  display.setTextSize(2);  display.setTextColor(WHITE);  display.setCursor(30, 0);  display.println(F("Humd-"));//  Serial.print(F("Humd-"));  if (ahtValue != AHTXX_ERROR) //AHTXX_ERROR = 255, library returns 255 if error occurs  {  display.setTextSize(2);  display.setTextColor(WHITE);  display.setCursor(35, 25);  display.println(ahtValue);  display.display();  //   Serial.println(F(" +-2%"));  }  else  {    printStatus(); //print humidity command status  }
  delay(2000); //measurement with high frequency leads to heating of the sensor, see NOTE  /* DEMO - 2, temperature call will read 6-bytes via I2C, humidity will use same 6-bytes */  Serial.println();  Serial.println(F("DEMO 2: read 6-byte"));
ahtValue = aht10.readTemperature(); //read 6-bytes via I2C, takes 80 milliseconds
  Serial.print(F("Temperature: "));    if (ahtValue != AHTXX_ERROR) //AHTXX_ERROR = 255, library returns 255 if error occurs  {    Serial.print(ahtValue);    Serial.println(F(" +-0.3C"));  }  else  {    printStatus(); //print temperature command status  }
ahtValue = aht10.readHumidity(AHTXX_USE_READ_DATA); //use 6-bytes from temperature reading, takes zero milliseconds!!!
  Serial.print(F("Humidity...: "));    if (ahtValue != AHTXX_ERROR) //AHTXX_ERROR = 255, library returns 255 if error occurs  {    Serial.print(ahtValue);    Serial.println(F(" +-2%"));  }  else  {    printStatus(); //print temperature command status not humidity!!! RH measurement use same 6-bytes from T measurement  }
delay(10000); //recommended polling frequency 8sec..30sec}
void printStatus(){  switch (aht10.getStatus())  {    case AHTXX_NO_ERROR:      Serial.println(F("no error"));      break;
    case AHTXX_BUSY_ERROR:      Serial.println(F("sensor busy, increase polling time"));      break;
    case AHTXX_ACK_ERROR:      Serial.println(F("sensor didn't return ACK, not connected, broken, long wires (reduce speed), bus locked by slave (increase stretch limit)"));      break;
    case AHTXX_DATA_ERROR:      Serial.println(F("received data smaller than expected, not connected, broken, long wires (reduce speed), bus locked by slave (increase stretch limit)"));      break;
    case AHTXX_CRC8_ERROR:      Serial.println(F("computed CRC8 not match received CRC8, this feature supported only by AHT2x sensors"));      break;
    default:      Serial.println(F("unknown status"));          break;  }}
Finally, assemble the four boards, the bottom cover, and the 3D printed bracket together.
First, use M2 screws to connect the front PCB to the 3D printed cover, then add the back PCB and 3D bracket on top.
Next, we use the same M2 screws to install the side panel.
After completing the mechanical assembly, we connect the positive and negative terminals of the power management board to the side PCB using jumpers.Then, the positive and negative terminals of the side PCB are connected to the front PCB using the same jumpers.
At this point, the smart pen holder is complete.

Original link:

https://www.hackster.io/Arnov_Sharma_makes/overengineered-pen-holder-2-0-5c0daf

Copyright belongs to: Arnov Sharma
Download materials:
Darwin said to reply on WeChat: smart pen holder
END
Overengineered Smart Pen Holder: A Comprehensive Guide
More Practical Project Recommendations:

<<< STM32 Project Summary >>>

<<< Raspberry Pi Project Summary >>>

<<< ESP32 Project Summary >>>

<<< ESP8266 Project Summary >>>

<<< Arduino Project Summary >>>

<<< Darwin Project Sharing Full Series >>>

Recommended Reading:
Project Sharing | Electronic Competition Series | Artificial Intelligence | Postgraduate Entrance Examination
Essential Knowledge Points | Graduation Design | Switching Power Supply | Job Hunting
We are Nimo, the founder of Darwin, a girl who only talks about technology and does not flirt. The Darwin online education platform aims to serve professionals in the electronics industry, providing skill training videos covering popular topics in various subfields, such as embedded systems, FPGA, artificial intelligence, etc., and tailoring hierarchical learning content for different groups, such as common knowledge points, disassembly evaluations, electronic competitions/intelligent vehicles/postgraduate entrance examinations, etc. Welcome to follow us.
Official website: www.darwinlearns.com
Bilibili: Darwin
QQ Group: Group 1: 786258064 (full)
Group 2: 1057755357 (full)
Group 3: 871373286Overengineered Smart Pen Holder: A Comprehensive Guide

Leave a Comment

Your email address will not be published. Required fields are marked *