Skip to content

16. Design a fully Integrated System

The challenge for this week was to design an Integrated System for my Final Project, with focus on Usability and Packaging.

This week's assignment:
Design and document the system integration for my final project

System integration

By this week, I had pivoted my Final Project to focus only on developing a test device for experimenting with different connectors (which is explained in Week 18 documentation). I set myself 3 goals for the Assignment;

  • First was to design a Shelf that is as versatile as possible for evaluating different connectors in many different scenarios.
  • Second was well-organised and secure wiring, that makes set-up and troubleshooting as simple as possible.
  • And lastly it was making sure that the Final product survives the “Shake Test”. I decided that the last one is a Nice-to-have because of the limited time.

1. The Architecture

This is the basic Architecture of my Final Project.
alt text

Since the exact dimensions and number of sockets are still arbitrary at this stage, I decided to keep my main Circuit Board small and simple, and allow tiny boards to be added on for each Attachable Sockets.

2. The Rough Sketch

I decided to design for 2 scenarios - plugging in from the side, and down from the top.
alt text

I decided the length to be 18cm, which can accommodate around 6-7 connector sockets of 2.5-3cm wide - enough to compare many options, but still relatively small and portable.

For the material, I chose Wood (MDF), so it can fit in naturally inside homes for User Testing.

3. The Electronics

This is the basic circuit before factoring in circuit protection measures (such as capacitors, Diodes and resistors, which are recommended to protect the Microcontroller).

alt text

3.1 Tiny Circuit Boards for Attachable Sockets

Since I had very limited access to the Milling Machines at Fablab Kamakura, I experimented with fabricating Voltage Divider circuits using standard Pin Headers.
I tried a few different prototypes.
alt text

In the end I settled on this prototype which is simple to fabricate and can attach securely onto a wire-rack.
alt text

This will keep the wiring organized and the circuits safe from accidental Short-Circuits.
They unexpectedly turned out looking quite cute, like little Ninjas!🥷
alt text

I later made a much simpler and integrated version of these boards, with additional components to protect my Microcontroller, such as Capacitors and Resistors.
But I didn’t have the time to follow through with calculating the appropriate values.
alt text

3.2 The Main Circuit Board

I used KiCad to design a PCB. My goal was to keep it as small as possible. Also, since I will be using the back-pad of the Xiao, I decided to flip the footprint so that the Xiao could be plugged in from the back of the PCB.
alt text

I milled it at FabLab Kamakura.
alt text

I should have also designed a protecting casing with Acrylic, to keep it secure and protect the pins from accidental Short Circuits, but didn’t have time in the end.

4. 3D Modelling

Since CNC machines are not easily accessible, I decided to Laser-cut MDF sheets and layer them up.

4.1 The Shelf design

I used Fusion360 to model the Shelf.
alt text

Then Laser-cut them, and assembled them. alt text

I spent unexpectedly long time working on the top board; I didn’t like how the different layers showed through, so I tried to smooth it with glue mixed with saw dust. But the MDF absorbed the glue which changed the color making it even more ugly! In the end, I fixed it by covering it with a thin pice of wood.
alt text

I also added a base for extra stability.
alt text

4.2 The Attachable Socket and Mystery Connector

For my first socket, I decided to go with standard off-the-shelf Type-A USB socket, so I can test that the System works as intended. I also designed a 3D printed case that fits around a Type-A USB connector and my mystery circuit.
alt text

alt text
Not visible here but I laser-engraved labels for programmable-LED pins.

alt text

5. Coding

I wrote and tested the Analog read part and LED part separately, and checked that they work, before integrating them into a final If/else code.
alt text

The Code for LED was written with the help of this guide on Akizuki and this guide on Hokuto Electronic.

[For future reference] RGB for 7 Rainbow colors:

R G B Color
255 0 0 Red
241 137 0 Orange
255 255 0 Yellow
0 255 0 Green
0 0 255 Blue
28 44 82 Dark Blue
92 42 134 Purple

The Final Code:

int DIN_H = 0;
int DIN_L = 1;
int LED_MAX = 1;//Number of LEDs connected

int Potentiometer[] = {D2, D3}; //InputTag
const int numTags = sizeof Potentiometer / sizeof Potentiometer[0];
int TagValue[numTags];

void setup() {                
  pinMode(DIN_H, OUTPUT);     
  pinMode(DIN_L, OUTPUT);     
  LED_Init();
  analogReadResolution(12);
  Serial.begin(9600);
}

void loop() {
  for (int j = 0; j < numTags; j++){
      TagValue[j] = analogRead(Potentiometer[j]);
      Serial.print(TagValue[j]);
      Serial.print(",");
      if(TagValue[j]<3500){
      LED_Color_RGB(0x00,0x7f,0x00); //緑
      LED_Set();
      }else{
        for(int n=0;n<LED_MAX;n++)
        LED_Color_RGB(0x00,0x00,0x7f);
        LED_Set();
      }
  }
}
//for(int n=0;n<LED_MAX;n++)
//LED_Color_RGB(0x7f,0x00,0x00); //赤
//LED_Set();
//delay(800); 
//=========================================================//
// LED Initialise
//=========================================================//
void LED_Init() {
  digitalWrite(DIN_H, LOW);
  digitalWrite(DIN_L, HIGH);
  delay(50); 
}
//=========================================================//
// Send Set signals
//=========================================================//
void LED_Set() {
  digitalWrite(DIN_H, LOW);
  digitalWrite(DIN_L, HIGH);
  delay(5); 
}

//=========================================================//
// H1 signal
//=========================================================//
void LED_Hi_Bit() {
  digitalWrite(DIN_H, HIGH);
  digitalWrite(DIN_L, HIGH);
  delayMicroseconds(5);
  digitalWrite(DIN_H, LOW);
  digitalWrite(DIN_L, HIGH);
  delayMicroseconds(5);
}
//=========================================================//
// L0 signal
//=========================================================//
void LED_Low_Bit() {
  digitalWrite(DIN_H, LOW);
  digitalWrite(DIN_L, LOW);
  delayMicroseconds(5);
  digitalWrite(DIN_H, LOW);
  digitalWrite(DIN_L, HIGH);
  delayMicroseconds(5);
}

//=========================================================//
// Formula for converting RGB color for LED
//=========================================================//
void LED_Color_RGB(byte led_r, byte led_g, byte led_b) {
  for (int k = 0; k <= 7; k++) {  //青
    if ((bitRead(led_b, 7 - k)) == 1) {
      LED_Hi_Bit();
    }
    else {
      LED_Low_Bit();
    }
  }
  for (int k = 0; k <= 7; k++) {  //緑
    if ((bitRead(led_g, 7 - k)) == 1) {
      LED_Hi_Bit();
    }
    else {
      LED_Low_Bit();
    }
  }
  for (int k = 0; k <= 7; k++) {  //赤
    if ((bitRead(led_r, 7 - k)) == 1) {
      LED_Hi_Bit();
    }
    else {
      LED_Low_Bit();
    }
  }
}

6. Assembly and Operation

I assembled and wired up all the components

alt text
alt text
alt text

Assignment Checklist:

  • Implemented methods of packaging
  • Designed my final project to look like a finished product
  • Documented system integration of your final project
  • Linked to my system integration documentation from my final project page