IOT123 - D1M BLOCK - GY521 Assembly

Introduction: IOT123 - D1M BLOCK - GY521 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. This D1M BLOCK gives a simple hookup between the Wemos D1 Mini and the GY-521 module (the Address and Interrupt pins can be hooked up to your own requirements).

My initial motivation for developing the D1M BLOCK was for independent verification of a solar tracking controller.

This Gysoscope/Accelerometer (GY-521 module) is touted as having these applications:

  1. Athletic games measurement
  2. Augmented reality
  3. Electron Image (EIS: Electronic Image Stabilization)
  4. Optical Image (OIS: Optical Image Stabilization)
  5. Pedestrians navigator
  6. The zero touch gestures user interface
  7. Posture shortcut 8. Intelligent mobile phone
  8. Tablet devices
  9. Handheld game products
  10. 3D remote control
  11. Portable navigation devices

This Instructable steps through the assembly of the block and then tests the Pitch, Roll and Yaw measurements using the D1M WIFI BLOCK.

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. A GY-521 module
    5. Hookup wire.
    6. Strong Cyanoachrylate Adhesive (preferably brush on)
    7. Hot glue gun and hot glue sticks
    8. Solder and Iron

    Step 2: Soldering the Header Pins (using the PIN JIG)

    There is a video above that runs through the solder process for the PIN JIG.

    1. Feed the header pins through bottom of the board (TX right-left) and into the solder jig.
    2. Press the pins down onto a hard flat surface.
    3. Press the board down firmly onto the jig.
    4. Solder the 4 corner pins.
    5. Reheat and re position board/pins if needed (board or pins not aligned or plumb).
    6. Solder the rest of the pins

    Step 3: Assembling the Shield

    As the GY-521 module will block you from soldering through holes on the top-side, the following strategy works: on the underside, solder over the through-hole, then remelt and push end of wire through the hole and remove heat.

    1. Solder 8P header that came with module onto GY-521.
    2. Place module onto shield and solder (ensuring equal side pin clearance).
    3. Bend 4 pins and cut the remaining pins.
    4. Place and solder 3V3 to VCC (red).
    5. Place and solder GND to GND (black).
    6. Place and solder D1 to SCL (blue).
    7. Place and solder D2 to SDA (green).

    If you are going to connect the Address and Interrupt pins, now's the time to do it.

    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

    For this test you will need:

    1. A D1M GY521 BLOCK


    1. In the Arduino IDE install the I2CDev and MPU6050 libraries (zips attached)
    2. Upload the the test sketch onto theD1M WIFI BLOCK.
    3. Disconnect the USB from the PC.
    4. Attach the D1M GY521 BLOCK to the D1M WIFI BLOCK

    The test:

    1. Connect the USB to the PC.
    2. Open the Arduino console window at the baud identified in the sketch.
    3. Move the BLOCKs around in space and check that the console values reflect the movements.

    A test sketch that logs basic PITCH/ROLL/YAW angle for the KY-521 module.

    #include "I2Cdev.h"
    #include "MPU6050_6Axis_MotionApps20.h"
    #include "Wire.h"
    MPU6050 mpu;
    uint8_t mpuIntStatus;
    uint16_t packetSize;
    uint16_t fifoCount;
    uint8_t fifoBuffer[64];
    Quaternion q;
    VectorFloat gravity;
    float ypr[3];
    volatile bool mpuInterrupt = false;
    void dmpDataReady() {mpuInterrupt = true;}
    void setup() {
    attachInterrupt(0, dmpDataReady, RISING);
    mpuIntStatus = mpu.getIntStatus();
    packetSize = mpu.dmpGetFIFOPacketSize();
    void loop() {
    while (!mpuInterrupt && fifoCount < packetSize) {}
    mpuInterrupt = false;
    mpuIntStatus = mpu.getIntStatus();
    fifoCount = mpu.getFIFOCount();
    if ((mpuIntStatus & 0x10) || fifoCount == 1024) {
    Serial.println(F("FIFO overflow!"));
    else if (mpuIntStatus & 0x02) {
    while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();
    mpu.getFIFOBytes(fifoBuffer, packetSize);
    fifoCount -= packetSize;
    mpu.dmpGetQuaternion(&q, fifoBuffer);
    mpu.dmpGetGravity(&gravity, &q);
    mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);

    Step 8: Next Steps

    Be the First to Share


      • Big and Small Contest

        Big and Small Contest
      • Game Design: Student Design Challenge

        Game Design: Student Design Challenge
      • For the Home Contest

        For the Home Contest