Introduction: Intro: IOT123 - D1M BLOCK - ARDPM+ Pin Extender Assembly
D1M BLOCKS add tactile cases, labels, polarity guides and breakouts for the popular Wemos D1 Mini SOC/Shields/Clones. One of the issues with the ESP8266 chip is it has only one analog IO pin and 9 dedicated Digital pins available.
This D1M BLOCK adds an additional 16 digital pins and 4 analog pins via I2C (only using 2 reusable I2C pins). This is an integrated extender (extra pins and breakouts combined) and exposes the 2 main rows of the Arduino Pro Mini. The initial footprint of the D1M BLOCKS is preserved and the Pro Mini is powered from the breakout pins.
Although the wiring is simpler (than the D1M ADS1115 BLOCK), there is the added overhead of flashing firmware on the Arduino Pro Mini. The extra pins and easy I2C interface may be just what you needed.
Step 1: Material and Tools
There is now a full Bill of Materials and Sources list.
- The Wemos D1 Mini Protoboard shield and long pin female headers
- 3D printed parts.
- A set of D1M BLOCK - Install Jigs
- Arduino Pro Mini 3.3V 8mHz.
- 1 off 40P female header (to be cut) or 2 off 12P female headers.
- Hookup wire.
- Solder and Iron.
- Strong Cyanoachrylate Adhesive (preferably brush on)
- Hot glue gun and hot glue sticks
- FT232RL USB to TTL converter
- Assorted vitamins for testing.
Step 2: Uploading the Sketch to the Arduino Pro Mini
The Arduino Pro Mini is conveniently flashed using a FTDI232 USB to TTL converter. If careful, you can insert the programmer pins into the through holes on the Arduino without soldering a header (this assumes that you will only be flashing the chip once).
Ensure the 3.3V setting is chosen on your FTDI232. Follow the instructions here using the code below (use link to GIST).
Step 3: Soldering the Header Pins (using the SOCKET JIG)
As the D1 Mini male pins will not be exposed on this D1M BLOCK, the socket jig can be used. As the excess male pins will be cut off, all the pins can be soldered in the initial position.
- Feed the header pins through bottom of the board (TX top-left on the top side).
- Feed jig over plastic header and level both surfaces.
- Turn jig and assembly over and firmly press header onto a hard flat surface.
- Press the board down firmly onto the jig.
- Solder the 4 corner pins using minimal solder (just temporary alignment of pins).
- Reheat and re position board/pins if needed (board or pins not aligned or plumb).
- Solder the rest of the pins.
Step 4: Soldering Connectors to the Arduino Pro Mini
The connections are simple: 4 hookup wires are soldered for later connection to the matching pin on the Wemos D1 Mini Shield later.
- Place a 30mmgreen hookup wire from underside to A4
- Solder A4 wire on topside
- Place a 30mmblue hookup wire from underside to A5
- Solder A5 wire on topside
- Solder a 20mmred hookup wire to pin VCC underside
- Solder a 30mmblack hookup wire to pin GND underside
Step 5: Connecting the Boards
The boards have spacers glued and the previous wires are matched and soldered.
- Glue the spacers onto the topside of the Wemos Shield.
- Pre-bend and place the red wire through the 3V3 hole on the topside.
- Solder the placed red wire on the underside.
- Place the green wire through the D2 hole on the topside.
- Solder the placed green wire on the underside.
- Place the blue wire through the D1 hole on the topside.
- Solder the placed blue wire on the underside.
- Place the black wire through the GND hole on the topside.
- Solder the placed black wire on the underside.
- Place a dob of glue on top of placed spacers.
- Joinboards together assuring bottom ends level and wires cleared.
Step 6: Gluing the Component to the Base
Not covered in the video, but recommended: put a large dob of hot glue in the emptybase before quickly inserting board and aligning - this will create compression keys on either side of the board. Please do a dry run in placing the shields in the base. If the gluing was not very accurate, you may need to do some light filing of the edge of the PCB.
- With the base casing bottom surface pointing down, place the soldered assembly plastic header through the holes in the base; the (TX pin will be on side with the central groove).
- Place the hot glue jig under the base with the plastic headers placed through its grooves.
- Sit the hot glue jig on a firm flat surface and carefully push the PCB down until the plastic headers hit the surface; this should have the pins positioned correctly.
- 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; allow seepage to both sides of the PCB if possible.
- On some PCBs where the board ends close to the pins, dob a large amount of glue onto the base to the height of the PCB; when this cools apply more glue on the top of the PCB bridging to the lower glue.
Step 7: 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 8: 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.
- Working off the diagrams above, apply the Arduino pinout stickers to the female headers
Step 9: Testing the Analog Pins
The analogRead uses the map() function on the raw values. It is expected that you will apply your own parameters to your particular use case.
- Upload the embedded script onto the D1M WIFI BLOCK.
- Disconnect the USB cable.
- Attach the D1M ARDPM+ BLOCK.
- Breaddboard the test circuit as above (analogRead with POT and analogWrite with LED).
- Attach the USB cable to the D1M WIFI BLOCK again.
- Open the serial console at the baud rate stated in the setup().
- The PINS available (14 to 17) can be tested for analogWrite (the LED) and analogRead (the pot).
- For analogWrite, connect the yellow wire to one of the pins, enter the serial input "3 1 127" (the second numeral being the pin, the third value being the intensity); also try input "3 1 200" brighten the LED.
- For analogRead, connect the yellow wire to one of the pins, enter the serial input "4 1 0" (the second numeral being the pin) to read the state of the pin to the console window. Change the value of the pot and enter the serial input "4 1 0" again.
Step 10: Testing the Digital Pins
The sketch is the same as the previous step (included in case you missed that step).
- Upload the embedded script onto the D1M WIFI BLOCK.
- Disconnect the USB cable.
- Attach the D1M
ARDPM
+ BLOCK.
- Breaddboard the test circuit as above.
- Attach the USB cable to the D1M WIFI BLOCK again.
- Open the serial console at the baud rate stated in the setup().
- The PINS available (2 to 17) can be tested for digitalWrite (the LED) and digitalRead (the switch).
- For digitalWrite, slide the switch to the far right, connect the yellow wire to one of the pins, enter the serial input "1 1 1" (the second numeral being the pin) and to turn the LED on; input "1 1 0" and to turn the LED off.
- For digitalRead, the circuit is in a normal closed state (INPUT_PULLUP), connect the yellow wire to one of the pins, enter the serial input "2 1 0" (the second numeral being the pin) to read the state of the pin to the console window. Change the state of the switch and enter the serial input "2 1 0" again. Take no notice of the state of the LED in this test.
Step 11: Next Steps
- Program your D1M BLOCK with D1M BLOCKLY
- Check out Thingiverse
- Ask a question at the ESP8266 Community Forum