Final Project

Result


Interactive christmas crib.



Project Development

  • What is the deadline? How much time do I have left? The deadline is 11th of June, so today is 8th, so three days to go.
  • What tasks have been completed, and what tasks remain? All parts have been finished. I need to assemble them, then take a hero shot and work on the video.
  • What has worked? What hasn't? I wanted to include the option of playing christmas music. Sadly, due to time I could not add it into my final project.
  • What questions need to be resolved? What figures do I want to add? Maybe the three holy kings?
  • What have you learned? Whats the goal of this course: How to make almost anything. I think I now feel like that. Especially, in terms of electronics. Its great to be able to build my own boards now and that I got an understanding for electronics. Also I love that for designing I know have a range of tools to choose from.

Interactive Crib

I would like to build a crib for putting it underneath my Christmas tree. We used to have a really nice one, that we built ourselves at my parents house and now its time to have my own one. Material for the crib: I plan to use mostly wood for the laser cutting and PLA for the 3D printed figures. But it might also be possible to mold the figures. I haven’t molded before, so I would be very happy to hear what material to use for this best.

For the water pump I was planning I looked into some ideas, how to build it. Here are two links that provide information about a little water pump:

https://www.youtube.com/watch?v=-7bkJgjcnN0

http://www.instructables.com/id/Arduino-Automatic-Watering-System-For-Plants/

I have different ideas for what to use a PCB for: I want to have a the star on top of the crib. Another idea is a water pump for water for the cow etc.. Maybe it would also be possible to have a little interface screen at the crib, on which little messages can be shown (e.g. happy first Advent).


Components of Final Project

  • Christmas Crib Housing out of wood and cardboard
  • Morning Star with LED out of Silicone
  • 3D printed figures (Maria, Joseph etc.)
  • Trees out of cardboard
  • Electronical components:
    • WS2812 RGB stripe for crib light
    • 0.96 OLED display for text
    • Photoresistor as a light sensor to turn on/off the WS2812 stripe
    • Switch to turn on/off the morning star LED

In the different assignments in this FabAcademy cycle I used the time to build parts of my final project already, e.g. the trees with the pressfit-kit. Other parts developed over time like my final board to control the electronic parts of my project.
Underneath you find explanations to the different components of my christmas crib.

First Sketches for Final Project




Crib Housing

In week seven, where we were asked to built something big, I already built the christmas crib housing using the CNC milling machine. My final housing consists of the walls built in this assignment and the roof made out of cardboard using the lasercutter. As I already documented the walls (see link above), I will describe here only the process of fabricating the roof and the decoration of the outer walls.

Final walls of my crib.

Groundplate
Furthermore, I want my crib to be easily portable from one place to another. Therefore, I decided to put the crib on one big groundplate, that can be carried around with the crib on it.

Groundplate cutting and wrapping with a green tablecloth to pretend grass on the ground.

Wall Decoration
When I build my walls in the 'Make someting BIG' week I did leave out the detailed look of those walls. After I had planned which electronic parts I want to add to my crib, I modelled the walls to integrate these parts in a sensible way.
Additionally, I added a door, a window and decoration to the walls related to how I pictured my crib.

Producing space for integration of electronic parts (switch and rube for water).

Decoration of front wall and look inside the crib. The switch is assembled and the WS2812 stripe is attached to the inner of the walls.

Roof
I used cardboard to fabricate a roof for my crib. Using a special cut pattern I was able to make the cardboard bendable. This way it can be put on the crib an can adapt to the outer walls shape.

Roof out of cardboard with bendable pattern.



Morning Star with LED

For the morning star of my crib I made use of another technique to fabricate a mold. I used a Vacuum forming machine to form a mold from a real object. This machine is especially helpful, if one side of your real object is flat. The object will then lie with the flat side on the wooden platform of the machine. As a model for the mold I used the star cast out of concrete I made in the molding & casting assignment. I executed the following steps to get my silicone cast.
1. Set up the machine by following the steps of the enclosed guide.

2. Put the real object onto the wodden plate in the machine. Assure to place it on top of the whole.

2. Turn on the vacuum cleaner, heat up the plastic foil and when the foil starts to become bendable push the real object upwards using the handle on the machine.

3. Used heater in the front and handle of machine on the left.

4. If you are happy with the produced model lower the real object again using the handle and get it out of the plastic foil. You might need the foil to be a little warm for that. Otherwise, the real object might be stuck. Now you have your mold.

5. I decided to use silicone for my cast. I wanted a transparent star with a LED in the middle. I.e. after filling up the modl with silicone I put a LED in the middle of it to integrate it into the star directly.

6. After 20 hours the silicone war dry and I could take out my cast.

7. Finished cast: I am really happy with the result.



3D Printed Figures

Of course, a christmas crib does include the figures of Maria, Jospeh, Jesus. In many cribs also a cow, sheep and shepherd are present. For those not familiar of the story. The shepherd were told by an angel that Jesus were born. That's why they went to Betlehem to see him in real.
For my christmas crib I designed some 3D models myself (e.g. the watering place and the crib of Jesus). To design both models I used TinkerCAD. As both models included basic shapes, which TinkerCAD offers his users the design was quite straight forward.

Watering place 3D model in TinkerCAD.

Using the 'Group-tool' of TinkerCAD to form Jesus' crib out of three single parts.

Printed watering place.

Printed crib for Jesus.


For the others I had a look on thingiverse. There I was able to find really pretty models, that I was allowed to print. Especially, the sheep do look really cute. You will see them on the pictures underneath.

In terms of fabricating the 3D prints I used the Ultimakers in our lab. How to use them is documented on our group page related to 3D printing.

Left: Shepherd / Right:Sheep

Left: Mary & Joseph/ Right: Cow

Shepherd



Trees

In week three - Computer-controlled cutting - we were asked to built a press-fit kit model. I chose to build a prototype of a tree that I can also use in my final project. Here the link to this assignment.

Press-fit kit tree.


Final Board

The following pictures give an overview of the features I thought about during the phase of brainstorming for my final project. The basic elements I kept until the end but some features changed in terms of how you can interact with them and what electronic features they have.



What I changed: E.g. the second board does not feature a water level sensor know, as I decided that water should just flow if I actively decide that I want it. The big board does include a WS2812 stripe for my crib light which is turned on/off according to the light that surrounds it. The morning star features a button now.





Fabrication of Final Board

Pin Layout Sketch Final Board



Christmas Crib Light
My crib includes a photoresistor to sense light. If it is dark in where the crib is, the crib light (a WS2812 RGB stripe) should turn on. This effect will give the crib a nice look in the evening. If there is sufficient light, the WS2812 stripe will turn off again.
To hide the LED's a little I built a little tube out of acrylic and cardboard that surrounds the stripe and makes the light look a little more diffuse.



Morning Star
The morning star contains a LED and can be turned on/off using a switch.


Display
I am using an 0.96 OLED display from Adafruit as a display for my final project. This display only needs four pins to be connected to show content: VCC/GND/SCK/SDA. This fact makes it really handy and neat to use.



Programming
For programming I used the Arduino IDE. Here is the code:
            
#include 
#include 
#include 
#include 
#include 
#ifdef __AVR__
  #include 
#endif
#include 
#include 


//OLED Display
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2
#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH  16
#if (SSD1306_LCDHEIGHT != 32)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif


//Crib Light
#define PIN 17
#define NUM_LEDS 38
#define BRIGHTNESS 50
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRBW + NEO_KHZ800);
int photoresistorPin = 16;
int sensorValuePhotoresistor = 0;


//Morning Star
int lEDStarPin = 14;
int buttonPin = 15;
int buttonState = 0;


//Bluetooth
int bluetoothRXPin = 0;
int bluetoothTXPin = 1;

void setup()   {
  Serial.begin(9600);

  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x32)
  // init done

  // Show image buffer on the display hardware.
  // Since the buffer is intialized with an Adafruit splashscreen
  // internally, this will display the splashscreen.
  display.display();
  delay(2000);
  // Clear the buffer.
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(10,5);
  display.print("Merry Christmas");

  //Christmas Tree
  display.drawPixel(50, 15, WHITE);
  display.drawPixel(51, 16, WHITE);
  display.drawPixel(49, 16, WHITE);
  display.drawPixel(52, 17, WHITE);
  display.drawPixel(48, 17, WHITE);
  display.drawPixel(53, 18, WHITE);
  display.drawPixel(47, 18, WHITE);

  display.drawPixel(48, 18, WHITE);
  display.drawPixel(52, 18, WHITE);
  display.drawPixel(49, 18, WHITE);
  display.drawPixel(51, 18, WHITE);
  display.drawPixel(49, 19, WHITE);
  display.drawPixel(51, 19, WHITE);
  display.drawPixel(52, 20, WHITE);
  display.drawPixel(48, 20, WHITE);
  display.drawPixel(53, 21, WHITE);
  display.drawPixel(47, 21, WHITE);
  display.drawPixel(54, 22, WHITE);
  display.drawPixel(46, 22, WHITE);
  display.drawPixel(55, 23, WHITE);
  display.drawPixel(45, 23, WHITE);

  display.drawPixel(54, 23, WHITE);
  display.drawPixel(46, 23, WHITE);
  display.drawPixel(53, 23, WHITE);
  display.drawPixel(47, 23, WHITE);
  display.drawPixel(52, 23, WHITE);
  display.drawPixel(48, 23, WHITE);
  display.drawPixel(52, 24, WHITE);
  display.drawPixel(48, 24, WHITE);
  display.drawPixel(53, 25, WHITE);
  display.drawPixel(47, 25, WHITE);
  display.drawPixel(54, 26, WHITE);
  display.drawPixel(46, 26, WHITE);
  display.drawPixel(55, 27, WHITE);
  display.drawPixel(45, 27, WHITE);
  display.drawPixel(56, 28, WHITE);
  display.drawPixel(44, 28, WHITE);
  display.drawPixel(57, 29, WHITE);
  display.drawPixel(43, 29, WHITE);

  display.drawPixel(56, 29, WHITE);
  display.drawPixel(44, 29, WHITE);
  display.drawPixel(55, 29, WHITE);
  display.drawPixel(45, 29, WHITE);
  display.drawPixel(54, 29, WHITE);
  display.drawPixel(46, 29, WHITE);
  display.drawPixel(53, 29, WHITE);
  display.drawPixel(47, 29, WHITE);
  display.drawPixel(53, 30, WHITE);
  display.drawPixel(47, 30, WHITE);
  display.drawPixel(53, 31, WHITE);
  display.drawPixel(47, 31, WHITE);
  display.display();

 //Crib Light
// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
  pinMode(photoresistorPin, INPUT);
  //pinMode(LEDPin, OUTPUT);
  #if defined (__AVR_ATtiny85__)
    if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
  #endif
  // End of trinket special code
  strip.setBrightness(BRIGHTNESS);
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'


 //Morning Star & Bluetooth
 pinMode(buttonPin, INPUT_PULLUP);
 pinMode(lEDStarPin, OUTPUT);

}


void loop() {
  //OLED display
   display.startscrollright(0x00, 0x0F);
  delay(2000);
  display.stopscroll();
  delay(1000);
  display.startscrollleft(0x00, 0x0F);
  delay(2000);
  display.stopscroll();
  delay(1000);
  display.startscrolldiagright(0x00, 0x07);
  delay(2000);
  display.startscrolldiagleft(0x00, 0x07);
  delay(2000);
  display.stopscroll();


  //Crib Light
  sensorValuePhotoresistor = analogRead(photoresistorPin); // read the value from the sensor
  Serial.println(sensorValuePhotoresistor);
  sensorValuePhotoresistor = map(sensorValuePhotoresistor,0,1023,0,255);
   Serial.println(sensorValuePhotoresistor);
    if (sensorValuePhotoresistor < 125) {
    Serial.println("Not enough light");
   for(int i=0;i < NUM_LEDS;i++){
    strip.setPixelColor(i, 255, 0, 255);
    strip.show();
   }

  }
  else{
   Serial.println("Enough light");
  for(int i=0;i < NUM_LEDS;i++){
    strip.setPixelColor(i, 0, 0, 0);
    strip.show();
   }
  }

   // Morning Star Light
   buttonState = digitalRead(buttonPin);
   //Serial.println(buttonState);
   if (buttonState == 0){
     digitalWrite(lEDStarPin, HIGH);// turn the LED on
  }
  else {
     digitalWrite(lEDStarPin, LOW); //turn the LED off
  }

  //Bluetooth
  while(Serial.available()) {
  int command = Serial.read();

  Serial.print(command);

  if (command == 49){
       On();
  }
   else {
     if(command == 48) {
    Off();
        }
     }
  }

  delay(100);

 }


  void On(){
   digitalWrite(lEDStarPin, HIGH);
   }

  void Off(){
  digitalWrite(lEDStarPin, LOW);
                     // delay(15);
  }


            
            


Assembling everything

1. Lasercut box, in which I can carry my figures for transporting the crib from one place to the other or to house them during the year until christmas.

2. Selfmade cables to connect electronic components to board.

3. OLED display attached to the crib walls.

4. Right wall of the crib with integrated switch and space for waterpump pipe or the power supply. I decided it to use it for the power supply in the end.

5. WS2812 RGB stripe covered with acrylic to make it more diffuse.

6. Packaging the cables and the PCB nice and tidy was challenging. All cables were covered using heat shrink tube.

7. I added a small stand that holds the PCB. The PCB can be covered using another small wooden cover that holds space for the cables to get through.

8. The PCB is standing right behind the hole and the PCB fits into the lower part of the box to have the right position for the power supply to be plugged in.

9. The power supply can be plugged in from the outside through a provided hole. The PCB is standing right behind the hole.

10. Fully box from the front.

11. All cables were connected to the PCB.

12. Finished PCB box and cables connected.

11. Backside of the crib.

12. Placing the figures in the crib.

13. Lightning morning star.

14. Fully assembled christmas crib.