Welcome!!! To my humble world 2M project

Tuesday, November 29, 2016

DFS Final Project

Name: Tan Mui Hua
No: T7269239


1.0   Introduction


1.1   Rationale behind the design of the project

The basic requirement of the project is to include embedded electronics and at least one skill set which is either a 3D printing or a laser cutting skill infused into the project. I was more keen in doing laser cutting as our department does not have laser cutter and also I have neither the skill sets of using a laser cutter nor designing something to laser cut. Hence, on the 1st week of the lesson I have chosen laser cutting skill to be infused in my final project so that I can learn more and deeper about laser cutting through doing and using it.
We were not given a list of the items that we can use for our project until week 6 of the course. However, I was already brainstorming on the possible project that I can make by the 3rd- 4th week, partly is because I thought I could cut out part of the project during the 4th week when we have hands on for the laser cutting. Hence my final decision on the project that I am making for this course would be something that can still be functional without Arduino or any other expensive electronic components. This is because I do not need to fork out extra money to purchase other things for my project and keep to the items given to me. Without Arduino, this item must still be functional which I can bring back home. I have decided to make a coaster holder as it is useful as well as functional independent of arduino board or any other expensive electronic components. However, as it is compulsory to use embedded electronics as one of criterias for the final project, I can include programming the LEDs. The reason is simple; I can first programme the LEDs with the Arduino board for the final project according to the criteria of using embedded electronics. Should I need to return the arduino board, I can still use the components given to us for the 5th week assignment on connecting the NE555 timer circuit to shine through the coaster holder. Hence, in this manner, I would be able to fulfill the project requirements and follow the condition of being functional without the Arduino board or any expensive components. Since most likely the coasters would be placed in my home, I decided to personalize the coasters for my family members. Hence, I went home and asked each of my family members for their photo to be engraved on their personal coaster.
On the 5th week, we were told we can use acrylic, plywood and cardboad as the cutting materials for the project. As I would like to have LEDs shine through the coaster holder, a clear transparent acrylic would do justice to have light shine through. For the Arduino enclosure, where all the electronics and wires would be housed, I was thinking of using either an opaque acrylic or the plywood to hide the jumper wires and the not-so-nice looking Arduino board. As for the coasters, I was deciding between using plywood or clear transparent acrylic. Finally I decided on using clear transparent acrylic because plywood may not be a good material to use as it is not waterproof and may corrode as time passes by. 

(a)
                                                                     

(b) 



(c)
Fig 1 (a)-(c). Rough sketch of the possible dimensions for the arduino enclosure and the coaster holder (draft design).



1.2   Brief description of the final project

On the 6th week, we were told that the Arduino board as well as the various different input and output interfaces would be given to us.  The table below shows the components given to us.




Table 1. The various inputs and outputs given to us by the SP.


I have decided to add more features to the coaster holder and the Arduino enclosure box. LEDs and a short melody would be activated on waving to my “name”.

I named it the 2M project. It is named 2M because it is Multi-purpose and Modular.

It is modular because
  • Coaster holder can be functional without the Arduino enclosure box and is the same vice versa.

It is multi-purpose because the Arduino enclosure box can

  •  Be used as a stage light (LEDs and RGB LED) that can shine through various shapes and sizes;
  • House the ultrasonic sensor as well as the buzzer besides LEDs;
  • Run for any duration as it is designed such that the USB port can be extended from outside to the Arduino board;
  • Allow jumper wires to extend out if I want to use this with the arduino for any other project.

·        
(a)

(b)

Fig 2. (a) Coaster holder containing (b) coasters which have each of my family member’s favourite photo.


(a) 


(b)
.

 Fig 3(a)&(b). Arduino box enclosure that can house both the Arduino board and the breadboard.


(a)  

(b)   



Fig 4(a). Overall outlook of the project when sound and light are not activated. (b) Overall outlook of the project when sound and light are activated.


I did put in a lot of effort outside office hours to design and make the items while juggling with my community work. Along the way, I understand the limitations and learnt the mistakes that were make, especially when designing. One example is the using of inkscape and then import to coreldraw. After importing to coreldraw, the modified photos done in inkscape would be reverted to original image and the processing of the images have to be done on the coreldraw again.








2.0   Electronics design

2.1   The inputs and outputs interface for the project


Table 2. The various inputs and outputs used and their function in the 2M project. 


2.2   Schematic Diagram



Fig 5. The schematic diagram of the circuit used in the 2M project using Fritzing. It involves the wiring of the RGB LED, 4 LEDs (Red, Green and Yellow) as well as an ultrasonic sensor which acts as a switch.




Fig 6. The jumper wires are required to hide within a box while only the LEDs, the ultrasonic sensor should stick out of the Arduino enclosure box.


2.3   Arduino coding

Please refer to Appendix A for the codes. Generally, the code is run such that when a person/item is near to the ultrasonic sensor, the light and sound would be activated. 3 LEDs will blink while the red LED closest to “MUI HUA”, would brighten slowly. Afterwhich, all the 4 LEDs will remain light up while RGB LED light up and change to different color. All the 5 LEDs will stay lit up while a short melody is played.








3.0   Mechanical design

3.1   Materials used for 2M project


Table 3. Materials used in the 2M project. The materials provided by the SP are acrylic clear transparent (green, white), opaque (white, dark blue) and cardboard. 


3.2   Arduino enclosure box


Fig 7. The designs of the Arduino enclosure box is done in inkscape.


I wanted to give the flexibility of positioning the Arduino board either horizontally or vertically in the box and hence I have created the power adaptor holes on 2 of the planes of the box side by side. However, there is a problem in the design. After it was cut, I realise that because of the wrong positioning of the rectangular box (for wires) on top and the holes of the power adaptor is far from the edge, makes it impossible for the breadboard to be positioned flat and nicely in the box with arduino. Hence I shift the power adaptor holes closer to the edge and also to rotate the rectangular box so that at least in 1 position, both the Arduino and the breadboard can fit into the box nicely. Should I have retained the top plate, it is impossible to have both the Arduino and the breadboard fit nicely due to the dimension of the box that I have set.




Fig 8. The refined designs of the Arduino enclosure box done in inkscape.


Now, at certain position, the Arduino enclosure box is large enough to hide both the Arduino box and the breadboard. There are multiple LED holes at the side and top. This can serve as a stage to place anything non-opaque on top of the Arduino enclosure box and immediately it will become a lovely display with LEDs shining through at different position. The positioning of the LEDs is flexible and thus, would be able to shine through many shapes and sizes.

(a)


(b)


(c)


(d)

Fig 9. The final design of the Arduino enclosure box from the (a) top view, (b) back view and (c & d) side views. Front plane contains the cut-through name and the ultrasonic sensor. Back and one of the side planes contain the holes for the power adaptor and the holes for the sound to come out from the buzzer.


My name is cut-through in front to personalize the Arduino enclosure box and also to see the effect of the red LED slowly brightens (the red LED closest to my name is programmed to brighten slowly) through the cut-out name. There is a square hole to allow the RGB LED to shine through. There are also holes for the buzzer as well as the power adaptor and the ultrasonic sensor to pass through. As this is a multi-purpose box, I did not want to restrict it to just the features that I have used for this project. Hence, I have incorporated 2 rectangular holes for the jumper wires on the top plane to extend out so that this Arduino box would not be restricted to just being a stage light and music box.
I have engraved gudetama on one of the planes, can you spot it?



3.3   Coaster holder


Fig 10. The design of the coaster holder. There is 1 side pocket in each of the side planes. There are also some engraving (I have input my favourite anime character to be engraved) on the other 2 sides and a cut through name on the top plane of the coaster holder. 6 holes are designed at the bottom of the plane so that the LEDs that protrude out of the Arduino enclosure box can enter these holes.


I have made 1 side pocket on opposite side so that it is easier to get the coasters out of the coaster holder. I have also created 6 holes at the bottom of the coaster holder to fit the LEDs that protrude out from the Arduino enclosure box so that light can shine through the coasters in the coaster holder as well. This would also allow the coasters to lie flat and nicely inside the coaster holder even though the LEDs are protruding from the Arduino enclosure box.



Fig 11. The refined designs of the coaster holder done in inkscape.


There is a mistake in the previous design as although I took into account that the last piece of the coaster in the coaster holder can be retrived easily as the distance of the pocket (1.5mm-2mm) from the edge is less than the thickness of the coaster (3mm). However, after I have cut it and place in my bag, it broke. Hence, I realise the design makes the plane very fragile. Thus, I have to compromise this feature and increase the distance of the pocket from the edge.


(a)



(b)

(c)
 

(d)

 Fig 12. The refined designs of the coaster holder for the 2M project from (a) front view, (b) side view, (c) bottom view and (d) top view. There are engraving pictures at the front and back plane. There is 1 side pocket each at both of the side planes. There are 6 holes at the bottom plane for the LEDs to go through. The top plane acts as a cover for the coaster holder.








3.4   Coasters



Fig 13. Coasters design in inkscape.


Fig 14. Coasters design after laser cut.



Final overall design of the 2M project

(a)






(b)


(c)


(d)


(e)


Fig 15. Final overall design of the 2M project from (a) front view, (b) back view, (c&d) side views and (e) top view.



If you would like to take a look at the video of the 2M project, you may wish to click on the LINK .



Appendix A

//Codes for the 2M project

#define NOTE_C6 1047
#define NOTE_D6 1157
#define NOTE_E6 1319
#define NOTE_F6 1397
#define NOTE_G6 1568
#define NOTE_A6 1760
#define NOTE_B6 1976
#define NOTE_C7 2093
#define NOTE_G 870

#include <avr/power.h>
#define echoPin 11 // Echo Pin
#define trigPin 12 // Trigger Pin

#define buzzerPin 5

#define LedRed1 2
#define LedRed2 3
#define LedGreen 4
#define LedYellow 7

int brightness = 0;    // how bright the LED is
int fadeAmount = 85;    // how many points to fade the LED by

const int RGBbluePin = 6;   
const int RGBredPin = 9;    
const int RGBgreenPin = 10;   

int distance, duration;

void setup() {
  // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket

  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);

  pinMode(buzzerPin, OUTPUT);
 
  pinMode(RGBgreenPin,OUTPUT);
  pinMode(RGBredPin,OUTPUT);
  pinMode(RGBbluePin,OUTPUT);
 
  pinMode(LedRed1,OUTPUT);
  pinMode(LedRed2,OUTPUT);
  pinMode(LedGreen,OUTPUT);
  pinMode(LedYellow,OUTPUT);
  Serial.begin(9600);
 }

void setColor(int red, int green, int blue)
{

    red = 255 - red;
    green = 255 - green;
    blue = 255 - blue;

  analogWrite(RGBredPin, red);
  analogWrite(RGBgreenPin, green);
  analogWrite(RGBbluePin, blue); 
}

void loop() {

      Serial.println(distance);
  //Delay 50ms before next reading.
  delay(50);


  /* The following trigPin/echoPin cycle is used to determine the
   distance of the nearest object by bouncing soundwaves off of it. */
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);

  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);

  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);

  //Calculate the distance (in cm) based on the speed of sound.
  distance = duration / 58.2;





 if (distance < 10)
  {
       for (int j=1; j<=12; j=j+1) {
    brightness = brightness + fadeAmount;
       
    digitalWrite(LedRed1, HIGH);
    digitalWrite(LedGreen, LOW);
    digitalWrite(LedYellow, HIGH);
    delay(500);
      
    analogWrite(LedRed2, brightness);
    delay(50);  
   
    digitalWrite(LedRed1, LOW);
    digitalWrite(LedGreen, HIGH);
    digitalWrite(LedYellow, LOW);
    analogWrite(LedRed2, brightness);
    delay(500);            }
     
    digitalWrite(LedRed1, HIGH);
    digitalWrite(LedGreen, HIGH);
    digitalWrite(LedYellow, HIGH);
    analogWrite(LedRed2, 255);

  delay(500);
   
 //RGB LED

    setColor(255, 0, 0);  // aqua
    delay(1000);
    setColor(0, 255, 0);  // purple
    delay(1000);
    setColor(0, 0, 255); // green
    delay(1000);
    setColor(255, 255, 0);  //blue
    delay(1000); 
    setColor(0, 255, 255);  //red
    delay(1000);
   
    setColor(255, 0, 0);  // aqua


  //tone(pin,frequency,duration)
     tone(buzzerPin, NOTE_A6, 500);
 delay(500);
 tone(buzzerPin, NOTE_A6, 500);
 delay(1000);
 tone(buzzerPin, NOTE_B6, 500);
 delay(500);
 tone(buzzerPin, NOTE_G6, 500);
 delay(500);
 tone(buzzerPin, NOTE_A6, 500);
 delay(500);
 tone(buzzerPin, NOTE_B6, 500);
 delay(200);
 tone(buzzerPin, NOTE_C7, 500);
 delay(300);
 tone(buzzerPin, NOTE_B6, 500);
 delay(500);
 tone(buzzerPin, NOTE_G6, 500);
 delay(500);
 tone(buzzerPin, NOTE_A6, 500);
 delay(500);
 tone(buzzerPin, NOTE_B6, 500);
 delay(200);
 tone(buzzerPin, NOTE_C7, 500);
 delay(300);
 tone(buzzerPin, NOTE_B6, 500);
 delay(500);
 tone(buzzerPin, NOTE_A6, 500);
 delay(500);
 tone(buzzerPin, NOTE_G6, 500);
 delay(500);
 tone(buzzerPin, NOTE_A6, 500);
 delay(500);
  tone(buzzerPin, NOTE_G, 1000);
 delay(1000);
    
  }
           
  


  else {
    delay(100);
   
    digitalWrite(LedRed1, LOW);
    digitalWrite(LedRed2, LOW);
    digitalWrite(LedGreen, LOW);
    digitalWrite(LedYellow, LOW);

    analogWrite(buzzerPin,0);

    analogWrite(RGBredPin, 0);
    analogWrite(RGBgreenPin, 0);
    analogWrite(RGBbluePin, 0); 
   
    delay(100);
 }

}