Introduction: IOT123 - ASSIMILATE SENSOR HUB: ICOS10 CROUTON RESET NODE

About: The tension between novelty and familiarity...

Crouton. http://crouton.mybluemix.net/ Crouton is a dashboard that lets you visualize and control your IOT devices with minimal setup. Essentially, it is the easiest dashboard to setup for any IOT hardware enthusiast using only MQTT and JSON.

This build sends the deviceInfo required by Crouton to the MQTT broker, to bootstrap automatic dashboards. The ASSIM_VERSION needs to be 2 for the AssimilateBusSlaves (actors and sensors).

The previous HOUSING HEADERS have been modified slightly, with the D0 rail replacing the unused D6 rail.

A new daughter-board has been added that allows for hardware resets, waking under certain conditions and in future will be used for the low-side power switch (for power control of the slaves).

The flow chart above gives a description of the ASSIMILATE-CROUTON integration.

If you have not done so already, the generic outer shell will need to be assembled.

NOTE: the firmware for the ACTORS/SENSORS needs to be ASSIM_VERSION 2.

Step 1: Materials and Tools

ICOS10 (IDC) Shell Bill of Materials

  1. D1M BLOCK Pin Jig (1)
  2. D1M BLOCK base and housing (1)
  3. Wemos D1 Mini (1)
  4. Wemos D1 Mini Protoboard Shield (1)
  5. 40P Female Headers (8P, 8P, 9P, 9P)
  6. Male Header 90º (3P, 3P, 3P, 2P)

  7. 1" Double sided protoboard (2)
  8. 6 Pin Shrouded IDC Male Header (1)
  9. Hookup wire (~10)
  10. 0.5mm Tinned Wire (~4)
  11. 4G x 15mm Button head self tapping screws (2)
  12. 4G x 6mm self tapping countersunk screws (~20)

Step 2: MCU Preparation

In this build we are using the Wemos D1 Mini. If you have previously built a D1M WIFI BLOCK, you can use that for the modular hardware component. If not, as a bare minimum follow the next section.


SOLDERING THE HEADER PINS ON THE MCU (using the PIN JIG)

If you cant print a PIN JIG just follow the instructions and improvise: the height (offset) of the PIN JIG is 6.5mm.

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


UPLOADING THE FIRMWARE

The code repository can be found here (snapshot).

A ZIP of the library can be found here (snapshot).

Instructions for "Importing a ZIP Library" here.

Once the library is installed you can open the example "mqtt_crouton_esp8266".

Instructions for setting up Arduino for the Wemos D1 Mini here.

Dependencies: ArduinoJson, TimeLib, PubSubClient.

Once the code has been loaded into the Arduino IDE:

  1. Modify the value of _wifi_ssid with your WiFi SSID.
  2. Modify the value of _wifi_password with your WiFi Key.
  3. Modify the value of _mqtt_device_name with your preferred Device Identification (no joining needed).
  4. Modify the value of _mqtt_device_description with your preferred Device Description (in Crouton).

Step 3: MCU Housing Preparation

The MCU Housing exposes headers for the D1 Mini to plug into and headers for daughter-boards that communicate with the Socket (sensors and actors) circuit.

The HOUSING HEADERS on the original ICOS10 3V3 MQTT NODE needed to be modified to support a hardware reset when the I2C message sequence goes out of sync (a hard reset was the original strategy) and to come out of sleep. The D6 pin breakout that is being replaced was not assigned to anything at the time of the original design, and was designated as "some other digital pins just in case".


HOUSING HEADERS

This is based on a D1 Mini Protoboard, and breaks out:

  1. Pins for the D1M BLOCK/D1 Mini to connect to.
  2. Direct Breakouts of the 2 rows of contacts from the D1M BLOCK/D1 Mini. These are only available for convenience whilst prototyping. It is expected the daughter-boards will block all access to these headers.
  3. 4 Breakouts of the specific pins used by the daughter-boards. I considered only breaking out the I2C specific pins but I already had a use-case for use of another pin (low-side sleep power switch), so I broke out RST, A0, D0 and another digital pin just in case.


To add the D1M Contacts to the HOUSING HEADER:

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


To add the Daughter-board Breakouts:

  1. Cut 4 off 9P Female headers.
  2. On the top, insert the 9P Headers as shown, and solder off on bottom.


To add the Direct Breakouts:

  1. Cut 2 off 8P Female headers.
  2. On the top, insert the 8P Headers as shown, and solder off on bottom.


To connect the headers, on the bottom with the TX pin oriented up:

  1. Trace and solder from the RST pin across 4 pins.
  2. Trace and solder from the A0 pin across 4 pins.
  3. Trace and solder from the D1 pin across 4 pins.
  4. Trace and solder from the D2 pin across 4 pins.
  5. Trace and solder from the D0 pin down 2 rows and across 4 pins.
  6. Trace and solder from the D7 pin across 4 pins.
  7. Trace and solder from the GND pin across 4 pins.
  8. Trace and solder from the 5V pin across 4 pins.
  9. Trace and solder from the 3V3 pin down 45° across 4 pins.


ASSEMBLING THE FIXTURE

The HOUSING HEADERS is affixed to the MCU HOUSING and this is affixed to the BASE PLATE.

  1. With the long side of the HOUSING HEADERS pointed to the hole, insert the D1M CONTACTS into the openings in the MCU HOUSING and push down flush.
  2. Insert the MCU onto the MCU CONTACTS during affixing to ensure the correct alignment.
  3. Place the HEADER FRAME over the top of the assemble fixtures and affix with 2 of 4G x 16mm screws.
  4. Place the assembled fixtures with the hole pointed toward the short side and affix with the 4G x 6mm screws.

Step 4: Building the RESET Daughter-board

After the daughter-board is added to the greater assembly you will find any code changes will not upload with the complete assembly. The D1 WIFI BLOCK will need to be removed from the housing (just pulls out) for the upload, then replaced (just pushes in).

At this stage this board only ties the D0 to the reset pin.

  1. On the inside, insert the 9P 90° Male Header (1), and solder off on the outside.
  2. On the inside, trace a yellow wire from YELLOW1 to YELLOW2 and solder.

Step 5: Assembling the Major Components

  1. Ensure the SHELL has been built and the circuit tested (cable and sockets).
  2. Insert the 3V3 I2C DAUGHTER-BOARD, with the 3V3 pin on the ragged end of the headers (see pic).
  3. Insert the RESET DAUGHTER-BOARD, with the wire to the inside (see pic).
  4. Place a Jumper on the 2P Male Header on the 3V3 I2C DAUGHTER-BOARD.
  5. Insert the IDC Socket from the SHELL CABLE into the IDC Header on the 3V3 I2C DAUGHTER-BOARD.
  6. Carefully insert the DAUGHTER-BOARDS/HOUSING between the cables in the SHELL and align the base holes.
  7. Fasten the BASE ASSEMBLY to the SHELL with the 4G x 6mm screws.
  8. Attach any ASSIMILATE SENSORS you have made.

Step 6: Next Steps

  1. Point your browser at http://crouton.mybluemix.net/crouton/connections.
  2. Ensure the broker is test.mosquitto.org.
  3. Click Connect.
  4. Enter the Device name input as _mqtt_device_name in the firmware.
  5. Click Add Device.
  6. Click Auto-connect.
  7. Power up your ICOS10 (5V MicroUSB).
  8. Verify via the Crouton dashboard.

Check out these related builds.