Introduction: IOT123 - D1M BLOCK - TP4056 Assembly
D1M BLOCKS add tactile cases, labels, polarity guides and breakouts for the popular Wemos D1 Mini SOC/Shields/Clones. This D1M BLOCK encapsulates a battery charger module. This D1M BLOCK was developed to test battery power for the D1M ESP12 BLOCK. This circuit will also warrant a PCB being developed.
The charging module was separated from the battery because I have 2 separate use cases at this stage: the coin cell battery (LIR2450) straddling an D1M ESP12 BLOCK and a standalone 18650 battery unit. This module was verified against the 18650 circuit as it could use the default 1A charging current. If using batteries with less capacity be sure to modify the RPROG resistor (chart above).
In developing this I tried using the D1 Mini protoboard and a standard universal PCB. The both incorrectly positioned the USB port to the casing, and the protoboard was missing footprint where needed. The 3D printed board is not an academic exercise; it solves several problems and simplifies the build.
NOTE: The pin contract has changed for this module. Subscribers (D1M BLOCKS) of this new contract are backward compatible with the standard pins, but this will only be able to used on blocks that conform to the new pin contract.
Step 1: Materials and Tools
There is a full Bill of Materials and Sources list.
- 3D printed parts (1)
- A set of D1M BLOCK - Install Jigs (1)
- A TP4056 module (1)
- Straight male headers (8)
- Right angle male headers (4)
- 1N5187 diode (4)
- 18650 Battery (1 for testing)
- 18650 Battery Holder (1 for testing)
- Hookup wire.
- Strong Cyanoachrylate Adhesive (preferably brush on)
- Hot glue gun and hot glue sticks
- Solder Flux
- Solder and Iron
Step 2: Preparing the Boards
- Cut up the male pins and place in breadboard, long end down, as shown
- Place the TP4056 on the pins and solder. The pin spacing is not the same but there is enough play in the though holes for the module to fit.
The 3D printed board (all gluing with Cyanoachrylate adhesive)
- On the topside of the 3D print, thread diodes through BLUE1 & BLUE2, BLUE3 & BLUE2, BLUE5 & BLUE6 and BLUE4 & BLUE6 as shown.
On the topside of the 3D print, glue pin pads on TP4056, thread into GREEN (1-6) and clamp flat.
When glue dry on the underside carefully bend TP4056 pins as shown.
- Glue pin pads on 4P right-angle pins and clamp to topside with oversize clamp plate on underside.
- For the 2 off 8P and 2 off 2P female headers:
- Glue area where pin meet plastic, including 5mm of pins
- Slide into underside holes on side rails
- Hold straight and tight until dry (approx. 10 seconds)
- When glue dry, on the topside bend pins at right-angles RED (1-4).
Step 3: Hooking Up the Circuit
- On underside, flux and solder pins GREEN (1-6)
On topside, flux and solder pins RED (1-4)
On topside, bend and solder wire from underside BLUE2 to RED4
On underside, bend solder and cut: BLUE6 to GREEN6, BLUE4 to YELLOW2, BLUE5 to YELLOW4, BLUE1 to GREEN3 and BLUE3 to GREEN4.
On underside, hookup and solder GREEN5 to YELLOW1 and GREEN5 to YELLOW3.
On underside, hookup and solder a black wire to GREEN1 and a red wire to GREEN3.
Route those wires as shown to topside and solder black wire to RED3 and red wire to RED2.
On underside, hookup and solder a black wire to GREEN2, route as shown to topside and solder to RED1.
Step 4: Gluing the Component to the Base
- With the base casing bottom surface pointing down put a 1cm blog of glue centrally.
- Place the soldered assembly plastic header through the holes in the base.
- Push board down until pins are 0.25mm under top of casing and even then cool.
- When using the hot glue keep it away from the header pins and at least 2mm from where the lid will be positioned.
- Apply glue to all 4 corners of the PCB ensuring contact with the base walls.
Step 5: Gluing the Lid to the Base
- Ensure the pins are free of glue and the top 2mm of the base is free of hot glue.
- Pre-fit the lid (dry run) making sure no print artifacts are in the way.
- Take appropriate precautions when using the Cyanoachrylate adhesive.
- Apply Cyanoachrylate to the bottom corners of the lid ensuring coverage of the adjacent ridge.
- Quickly fit the lid to the base; clamping shut the corners if possible.
- After the lid is dry manually bend each pin so it is central in the void if necessary (see video).
Step 6: Adding the Adhesive Labels
- Apply pinout label on underside of base, with RST pin on side with groove.
- Apply identifier label on flat non-grooved side, with the pins void being the top of the label.
- Press labels down firmly, with a flat tool if needed.
Step 7: Hooking Up the Circuit
To test the circuit we will connect it to a battery and D1M ESP12 BLOCK, then charge via USB.
The battery will normally use a 1000uF capacitor for this configuration; it wont be needed for this rudimentary test.
The new pin contract will be used for future designs; breadboard wires are used for this test.
NOTE: All the regular D1 Mini pins (2*8P) are floating, and act as a signal pass through for other D1M BLOCKS.
- Uploads a simple sketch (like blink using LED_BUILTIN) to the D1M ESP12 BLOCK using the D1M CH340G BLOCK.
- Connect 18650 battery to B+/B-
- Connect 5V /G pins on D1M ESP12 BLOCK to OUT+/OUT- (the sketch should function correctly)
- Connect the Micro USB on the TP4056 to a 5V power source (the sketch should function correctly)
Step 8: Next Steps
- Try adding Solar panels to the IN pins (5V - 6V, 250mA)
- Look for the new D1M BLOCKS that will conform to this pin standard: D1M 18650 BLOCK & D1M ESP12 (PCB with LIR2450)