Introduction: IOT123 - D1M BLOCK - RFTXRX Assembly

About: The tension between novelty and familiarity...

D1M BLOCKS add tactile cases, labels, polarity guides and breakouts for the popular Wemos D1 Mini SOC/Shields/Clones. RF Transmitters/Receivers allow the ESP8266 to access existing home/industrial automation. This casing provides break-outs for 433/315mHz Receiver and/or Transmitter.

The initial motivation for creating this D1M BLOCK was I needed a RF Sniffer for another project similar to this. Rather than bread-boarding it, I thought I would eat my own dog food. This presented an interesting problem: the D1M BLOCK needed to be used for the 433mHz modules and the 315mHz modules therefore the digital pins used for the breakouts could not be hard-wired. That is why both the transmitter and the receiver pins are select-able using the male headers and the jumpers. Some of the later shields (like this button shield) also allows select-able pins.

A 4th pin (Antenna) has been broken out for the transmitter; it is floating and only provided so that 4 pins are accomodated.

This Instructable steps through the assembly of the block and then tests the RF modules using the D1M WIFI BLOCKs.

Step 1: Materials and Tools

    There is now a full Bill of Materials and Sources list.

    1. The Wemos D1 Mini Protoboard shield and long pin female headers
    2. 3D printed parts.
    3. A set of D1M BLOCK - Install Jigs
    4. 2 off 4P female header
    5. 1 off 40P male header
    6. 2 off Jumper caps
    7. Hookup wire.
    8. Strong Cyanoachrylate Adhesive (preferably brush on)
    9. Hot glue gun and hot glue sticks
    10. Solder and Iron
    11. Tinned copper wire.

    Step 2: 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.

    1. Feed the header pins through bottom of the board (TX top-left on the top side).
    2. Feed jig over plastic header and level both surfaces.
    3. Turn jig and assembly over and firmly press header onto a hard flat surface.
    4. Press the board down firmly onto the jig.
    5. Solder the 4 corner pins using minimal solder (just temporary alignment of pins).
    6. Reheat and re position board/pins if needed (board or pins not aligned or plumb).
    7. Solder the rest of the pins.

    Step 3: Assembling the Shield

    1. The excess male pins from the headers can be cut off close to the solder.
    2. From the 40P male header cut 2 off 5P and 2 off 4P.
    3. Using a breadboard as a template, position and solder the male pins to the protoboard.
    4. Using a breadboard as a template, position temporary 4P male pins, 4P female pins on them and solder the female pins to the protoboard.
    5. Trace and solder the digital lines with tinned copper wire (yellow).
    6. Place two black wires into GND from underside and solder on topside.
    7. Trace and solder the GND lines on underside (black).

    8. Place two red wires into 5V and 3V3 from underside and solder on topside.

    9. Trace and solder the power lines on underside (red).

    Step 4: Gluing the Component to the Base

    Not covered in the video, but recommended: put a large dob of hot glue in the empty base 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.

    1. 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).
    2. Place the hot glue jig under the base with the plastic headers placed through its grooves.
    3. 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.
    4. When using the hot glue keep it away from the header pins and at least 2mm from where the lid will be positioned.
    5. 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.

    Step 5: Gluing the Lid to the Base

    1. Ensure the pins are free of glue and the top 2mm of the base is free of hot glue.
    2. Pre-fit the lid (dry run) making sure no print artifacts are in the way.
    3. Take appropriate precautions when using the Cyanoachrylate adhesive.
    4. Apply Cyanoachrylate to the bottom corners of the lid ensuring coverage of the adjacent ridge.
    5. Quickly fit the lid to the base; clamping shut the corners if possible (avoiding the lens).
    6. 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

    1. Apply pinout label on underside of base, with RST pin on side with groove.
    2. Apply identifier label on flat non-grooved side, with the pins void being the top of the label.
    3. Press labels down firmly, with a flat tool if needed.

    Step 7: Testing With the D1M WIFI BLOCK(s)

    For this test you will need:

    1. 2 off D1M RFTXRX BLOCKS
    2. 2 off D1M WIFI BLOCKS
    3. 1 off 433mHz transmitter with pinouts of Signal, VCC, GND (3.3V tolerant)
    4. 1 off 433mHz receiver with pinouts of VCC, Singal, Signal, GND (5V tolerant).

    I suggest getting multiple transmitters and receivers as there are occasional duds.

    Transmitter preparation:

    1. In the Arduino IDE install the rf-switch library (zip attached)
    2. Upload the the send sketch onto a D1M WIFI BLOCK.
    3. Disconnect the USB cable
    4. Attach a D1M RFTXRX BLOCK
    5. Add a transmitter to the central 4P female header as shown.
    6. Ensure a jumper is placed on the pin identified in the enableTransmit function in the sketch (D0 or D5 or D6 or D7 or D8)

    Receiver preparation:

    1. Upload the the receive sketch onto a D1M WIFI BLOCK.
    2. Disconnect the USB cable
    3. Attach a D1M RFTXRX BLOCK
    4. Add a receiver to the outer 4P female header as shown.
    5. Ensure a jumper is placedon the pin identified in the enableReceive function in the sketch (D1 or D2 or D3 or D4)

    Running the test:

    1. Attach the receiver assembly to a USB cable and plug in you DEV PC.
    2. Open the console window with the correct COM port and the sketch serial baud rate (was 9600).
    3. Attach the transmitter assembly to a USB cable and plug in you DEV PC (other USB port).
    4. You should start getting transmissions logged in your console window

    One of https://github.com/sui77/rc-switch/ demos with pins included for D1M RFTXRX BLOCK.

    /*
    Example for different sending methods
    https://github.com/sui77/rc-switch/
    modified fo D1M RFTXRX BLOCK pins
    */
    #include<RCSwitch.h>
    RCSwitch mySwitch = RCSwitch();
    voidsetup() {
    Serial.begin(9600);
    // Transmitter is connected to Arduino Pin #10
    mySwitch.enableTransmit(D0); // D0 or D5 or D6 or D7 or D8
    }
    voidloop() {
    /* See Example: TypeA_WithDIPSwitches */
    mySwitch.switchOn("11111", "00010");
    delay(1000);
    mySwitch.switchOff("11111", "00010");
    delay(1000);
    /* Same switch as above, but using decimal code */
    mySwitch.send(5393, 24);
    delay(1000);
    mySwitch.send(5396, 24);
    delay(1000);
    /* Same switch as above, but using binary code */
    mySwitch.send("000000000001010100010001");
    delay(1000);
    mySwitch.send("000000000001010100010100");
    delay(1000);
    /* Same switch as above, but tri-state code */
    mySwitch.sendTriState("00000FFF0F0F");
    delay(1000);
    mySwitch.sendTriState("00000FFF0FF0");
    delay(1000);
    delay(20000);
    }

    One of https://github.com/sui77/rc-switch/ demos with pins included for D1M RFTXRX BLOCK.

    /*
    Example for receiving
    https://github.com/sui77/rc-switch/
    If you want to visualize a telegram copy the raw data and
    paste it into http://test.sui.li/oszi/
    modified fo D1M RFTXRX BLOCK pins
    */
    #include<RCSwitch.h>
    RCSwitch mySwitch = RCSwitch();
    voidsetup() {
    Serial.begin(9600);
    mySwitch.enableReceive(D4); // D1 or D2 or D3 or D4
    }
    voidloop() {
    if (mySwitch.available()) {
    output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
    mySwitch.resetAvailable();
    }
    }

    Step 8: Next Steps

    1. Program your D1M BLOCK with D1M BLOCKLY
    2. Check out Thingiverse
    3. Ask a question at the ESP8266 Community Forum