IOT

Application, IOT, Programing

Valentine's Night Protocol

So it's 2018 and smart home products are flying off the shelves. It's time we use them to have some FUN. I currently have 1 Google home, 2 google home minis 3 Hue light bulbs, 3 Chomecasts, 4 chrome audios, and 4 Bluetooth speakers. What is wrong with me!?

smart_home_stuff.png
Maker.jpg

I don't know if you know about IFTTT (IF This Then That) it's "the free way to get all your apps and devices talking to each other. Not everything on the internet plays nice, so we're on a mission to build a more connected world."

They have a maker platform that allows you to make applets. But, the difference between the app and the maker platform is that you can add more "thats". This is significant because only having one "that" won't allow you to make this cool protocol.

The Valentines Night protocol is mean't to set the mood for you passionate people out there. Dim and change the Hue lights and play some sensual music. The app does not have you tube or Roku recipes (API integrations) but music and lights are enough the rest is up to you. 

 

 

Anyway I made it for download it and use it

Screenshot_20180212-010559.png

There was no glue!

But feel free to stock your home with smart devices.

IOT, Laser, 3d Printing

Urban/Suburban Hydroponics system

Hey there I currently live in Champaign-Urbana, and yes it is big on agriculture, one might even say massive. Anyway, I have always wanted a garden I can tend to and harvest when the time comes but unfortunately I live in an apartment. Yup I'm a millennial in college no money and no assets and yet I want to farm. So I decided to try, and here's what I came up with.

Problems

  1. No space
  2. Ugly carpet
  3. Low window count
  4. Rent to high
  5. Yard is a poop mine feild
  6. I have to pay for laundry
  7. Bus never ontime
  8. Sleep is a luxury not a necessity

etc...

Solution! Build a garden in a window!

I decided to build the garden in a window because I literally have no space and actual sunlight ha limited range in my space. After putting it together it worked until I added the wrong amount of nutrients but anyway let me show you how it all worked out.

Materials

 1/4 in birch plywood

8x1 in plywood

Glue

PVC pipe and couplers ( depends on your setup )

1 x Sump pump

1/4 in Vinyl tubing

90 degree angle brackets

Tools

3D printer

Hack saw

Lasercutter

Process/Explaination

Hydroponics: [hahy-druh-pon-iks] noun  the process of growing plants in sand, gravel, or liquid, with added nutrients but without soil.

The system:

hydroponics_diagram.png

The Reservoir:

Water enters the reservoir which is 2x the size of the Sub Grow beds reason for this is pressure equalizer. It acts as a water tower keeping the grow beds at the right level so not to flood plants the coupler/reducers block the water from going back and ensures the water stays in the pipe. evaporation is the only thing you need to worry about.

Sub Grow bed:

Hold plants and outputs water to next Sub Grow bed or bucket.

 

The build and fabrication process is very straight forward. so Here are pictures.

My favorite part is the k cup holders I 3D printed the lip on top holds a small k cup snugly and and grips the pipe without slipping.

 

Full Assembly

Well that's it took about 8 hours to build and it was very gratifying to see the plants grow until I added to much miracle grow. I was in the midst of adding automatic PH balances and sensors to make this an IOT project but when the plants died I got discouraged so I didn't, maybe it should have inspired me. 

Also, This song should play While The Glue Dries you won't regret it.

Laser, Electronics, IOT

DIY IOT Scoreboard

Ever wanted a scoreboard? Ever wanted a Internet connected scoreboard? I did so I made one.

Materials:

Neopixel strip

12x24x1/8 in black acrylic

12x24x1/8 in frosted acrylic

3 - 12x24x1/8 in birch plywood

particle photon WiFi board

5v 2-3 amp power supply

wire 

copper tape

DIY

First I designed the segments which ended up being elongated diamond shapes that i placed in a 7 segment display shape.

scoreboard.JPG

took that over to the laser cutter and cut it out twice, once in black acrylic and the second in plywood these would soon sandwich the frosted acrylic.

the chaise was made with the remaining plywood in which the segment panel set into. I used finger joints designed with the press-fit box generator Box Designer  after it was all cut out the chaise was about 21 3/8 long and 11 5/8 in tall.

scoreboard_neopixel.JPG

The hard part was cutting and re soldering the Neopixels behind the frosted acrylic, the wooden segments act as light blockers to reduce bleeding. 

 

Neopixel_wiring.JPG

After that catastrophe ad testing and rewiring I finally was able to connect the power supply and and photon. The Neopixels are pretty simple to wire up the data went to a digital pin and 5v line went to the positive 5v rail made with copper tape and GND goes to Ground.

I did that for each segment to make it easier to program. So, in the end i ended up wiring 3 digital pins, connected 4 grounds and 4 5v rails

And that was it for Hardware and Electronics here it is after its all done.

Scoreboard done.JPG

Programming Time

The code was pretty simple and nice. I used the particle build IDE to create and flash the code the interesting part was trial and error-ing the numbers display.

 

 

// This #include statement was automatically added by the Particle IDE.

// This #include statement was automatically added by the Particle IDE.
#include <neopixel.h>
#include <Particle.h>
#define num_one_PIN    D6
#define num_two_PIN    D5
#define num_three_PIN  D4
#define NUMPIXELS      21

Adafruit_NeoPixel numOne = Adafruit_NeoPixel(NUMPIXELS, num_one_PIN, WS2812);
Adafruit_NeoPixel numTwo = Adafruit_NeoPixel(NUMPIXELS, num_two_PIN, WS2812);
Adafruit_NeoPixel numThree = Adafruit_NeoPixel(NUMPIXELS, num_three_PIN, WS2812);

int delayval = 1000;
uint32_t green = numOne.Color(0, 255, 0);
uint32_t red = numOne.Color(255, 0, 0);
uint32_t blue = numOne.Color(0, 0, 255);

int numberMap[10][21] = {
    {0,1,2,3,4,5,6,7,8,12,13,14,15,16,17,18,19,20,22,22,22}, //0
    {0,1,2,12,13,14,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22}, //1
    {0,1,2,3,4,5,9,10,11,15,16,17,18,19,20,22,22,22,22,22,22}, //2
    {0,1,2,3,4,5,9,10,11,12,13,14,15,16,17,22,22,22,22,22,22}, //3
    {0,1,2,6,7,8,9,10,11,12,13,14,22,22,22,22,22,22,22,22,22}, //4
    {5,4,3,6,7,8,11,10,9,12,13,14,15,16,17,22,22,22,22,22,22}, //5
    {3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,22,22}, //6
    {0,1,2,3,4,5,12,13,14,22,22,22,22,22,22,22,22,22,22,22,22}, //7
    {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}, //8
    {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,22,22,22}, //9
};

int numberMapOne[10][21] = {
    {0,1,2,3,4,5,6,7,8,12,13,14,15,16,17,18,19,20,22,22,22}, //0
    {18,19,20,6,7,8,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22}, //1
    {0,1,2,3,4,5,9,10,11,15,16,17,18,19,20,22,22,22,22,22,22}, //2
    {8,7,6,3,4,5,9,10,11,18,19,20,15,16,17,22,22,22,22,22,22}, //3
    {18,19,20,6,7,8,9,10,11,12,13,14,22,22,22,22,22,22,22,22,22}, //4
    {6,7,8,11,10,9,12,13,14,15,16,17,3,4,5,22,22,22,22,22,22}, //5
    {3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,0,1,2,22,22,22}, //6
    {8,7,6,18,19,20,15,16,17,22,22,22,22,22,22,22,22,22,22,22,22}, //7
    {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}, //8
    {18,19,20,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,22,22,22}, //9
};

int r_numOne(String val, String color);
int r_numTwo(String val, String color);
int r_numThree(String val, String color);
int clear(String num);

void setup() {
  Particle.function("num1", r_numOne);
  Particle.function("num2", r_numTwo);
  Particle.function("num3", r_numThree);
  Particle.function("clear", clear);
  numOne.begin();
  numTwo.begin();
  numThree.begin();

  numOne.show();
  numTwo.show();
  numThree.show();

}


int clear(String num) {
      if (num == "one"){
          for(int i=0;i<NUMPIXELS;i++){
            numOne.setPixelColor(i, 0);
          }
      }
      if (num == "two"){
          for(int i=0;i<NUMPIXELS;i++){
            numTwo.setPixelColor(i, 0);
          }
      }
      if (num == "three"){
          for(int i=0;i<NUMPIXELS;i++){
            numThree.setPixelColor(i, 0);
          }
      }
      if (num == "all"){
        for(int i=0;i<NUMPIXELS;i++){
            numOne.setPixelColor(i, 0);
            numTwo.setPixelColor(i, 0);
            numThree.setPixelColor(i, 0);
          }
      }
      numOne.show();
      numTwo.show();
      numThree.show();
      return 1;

}

int r_numTwo(String val) {
  numTwo.begin();
  //clear();
  for(int i=0;i<21;i++){
      if (numberMap[val.toInt()][i] != 22){
        numTwo.setPixelColor(numberMap[val.toInt()][i], green);
      }
  }
  numTwo.show();
  return 2;
}

int r_numThree(String val) {
  numThree.begin();
  //clear();
  for(int i=0;i<21;i++){
      if (numberMap[val.toInt()][i] != 22){
        numThree.setPixelColor(numberMap[val.toInt()][i], green);
      }
  }
  numThree.show();
  return 3;
}

int r_numOne(String val) {
  numOne.begin();
  //clear();
  for(int i=0;i<21;i++){
      if (numberMapOne[val.toInt()][i] != 22){
        numOne.setPixelColor(numberMapOne[val.toInt()][i], red);
      }

  }
  numOne.show();
  return 1;
}

void loop() {

}

In the large arrays you see a lot of 22's these equal off lights in a string of 20 lights in each segment.

After I flashed this I used the particle console to send numbers as strings and the code interprets which segment to show which number.

INSTANT IOT Scoreboard done.

iot scoreboard.JPG

Final

Using the app I can now keep score in a smash bros tournament slash massacre.

This has been While The Glue Dries.

DSC_0829.JPG