diff --git a/categories.list.md b/categories.list.md new file mode 100644 index 0000000..7170c8b --- /dev/null +++ b/categories.list.md @@ -0,0 +1,11 @@ +# Categories + +A list of categories used in the blog + + +| category | What it does | +| ------------ | -------------------------------------------------------- | +| blog | random blog stuff | +| IOT | anything to do with IOT | +| Homelab | anything to do with my homelab (including smart home...) | +| Development | anything to do with regular development | diff --git a/content/posts/2015/tektree-part-1-a-christmas-surprise/media/new.jpg b/content/posts/2015/tektree-part-1-a-christmas-surprise/media/new.jpg new file mode 100644 index 0000000..53f6963 Binary files /dev/null and b/content/posts/2015/tektree-part-1-a-christmas-surprise/media/new.jpg differ diff --git a/content/posts/2015/tektree-part-1-a-christmas-surprise/media/old.jpg b/content/posts/2015/tektree-part-1-a-christmas-surprise/media/old.jpg new file mode 100644 index 0000000..32e4245 Binary files /dev/null and b/content/posts/2015/tektree-part-1-a-christmas-surprise/media/old.jpg differ diff --git a/content/posts/2015/tektree-part-1-a-christmas-surprise/tektree-part-1-a-christmas-surprise.md b/content/posts/2015/tektree-part-1-a-christmas-surprise/tektree-part-1-a-christmas-surprise.md new file mode 100644 index 0000000..e14f61a --- /dev/null +++ b/content/posts/2015/tektree-part-1-a-christmas-surprise/tektree-part-1-a-christmas-surprise.md @@ -0,0 +1,43 @@ +--- +title: "TekTree part 1 - TekTree - a christmassy surprise project" +date: "2015-12-19" +template: "post" +category: "IOT" +tags: + - "tektree" + - "christmas" +description: "A new maker project based on a big piece of lumber that my parents erected 🤔" +disqusId: "15" +--- + +I'm very excited to announce a new maker project to you guys ! It will be simple, and thus reproducible, yet fun and quite possibly even useful. (oh, and a tad crazy) + +## So? What is it? + +Well.... basically I'm going to assemble and program a little christmas tree thing. + +I got the idea after my parents put up their christmas tree. My mom opted for a more "modern" (so I've been told) kind of tree. This "modern" tree is basically a home made christmastree-y looking thing bolted together with a few screws. (picture below) At first I didn't like the idea of a more modern, less authentic, christmas tree but once it was actually up it didn't look half bad. There were some things missing though. It just didn't make sense to me to create something new yet be limited by old stuff. For example: my parents put a string of lights **around** the wooden boards, why not integrate them? Or why not add a dimmer? Or make it follow some flashy patterns? As you might expect by now I am basically going to recreate, with a bit more finesse, my parent's christmas tree. + +![a picture of my parents' new christmas tree](./media/old.jpg "a picture of my parents' new christmas tree") + +## Open source? + +Of course! All code will be open source! All other stuff (drawings etc.) will also be opened up to the public. Everything can be found on [Github](https://github.com/Mastermindzh/TekTree) once again. + +## Step 1 - Design! + +I've thought long and hard about what kind of "controller" I wanted to use. And of course I immediately wanted to use a Raspberry pi. But I asked myself, why a pi? Why not use something simpler (like an arduino) to control the lights and switches. After some serious brainstorming I decided to go with an arduino in the end. I figured the Raspberry pi zero would be too cumbersome to work with for a simple christmas tree. Besides, I have a lot more uses for a pi zero than I have for an arduino, and I got more arduino's laying around than pi zero's at the moment. + +## Digital drawing + +After deciding to use an arduino I had another big decision to make. Should I follow my parents' example? Or go a different route? In the end I decided my way was better (kids...) and so I decided to laser cut my wooden designs. One of the other big changes I made is to the base. Whereas my parents opted for something rugged I'm going for a slightly more "finished" look. This means that my base is nice and round with a few fun shapes on it and I even speculated about making the circle sit flush with the ground.(which would mean creating bendable wood! A challenge in and of itself.) + +After that came my struggle with the drawing software. I tried creating a drawing in Coreldraw Pro.... that was... a painful experience to say the least. Then I tried drawing with a program called InkScape, while better it still didn't yield any results. Finally I decided to give up and ask for help from a friend. + +Luckily my friend [Ron Nabuurs](http://www.ronnabuurs.nl) is brilliant when it comes to designing a drawing which can be lasercut. So after explaining my idea to [Ron](http://www.ronnabuurs.nl) he decided to help me out. A picture of what we ended up with can be found below. The source file we used can be found on git. + +![Designs for the laser cutter, from left to right: a circular base plate with snow characters. A foldable box cutout and a tree shape](./media/new.jpg "Designs for the laser cutter") + +## So what now ? + +Well.... now I have to actually laser cut the pieces and assemble the tree. If we haven't made any mistakes (or I conveniently forget to mention them to you guys) I should be able to put out another blog this weekend showing you guys both the laser cutting and a test build of the TekTree. diff --git a/content/posts/2015/tektree-part-2-lasercutting/media/back.jpg b/content/posts/2015/tektree-part-2-lasercutting/media/back.jpg new file mode 100644 index 0000000..eca71c7 Binary files /dev/null and b/content/posts/2015/tektree-part-2-lasercutting/media/back.jpg differ diff --git a/content/posts/2015/tektree-part-2-lasercutting/media/back2.jpg b/content/posts/2015/tektree-part-2-lasercutting/media/back2.jpg new file mode 100644 index 0000000..e71f563 Binary files /dev/null and b/content/posts/2015/tektree-part-2-lasercutting/media/back2.jpg differ diff --git a/content/posts/2015/tektree-part-2-lasercutting/media/bottom.jpg b/content/posts/2015/tektree-part-2-lasercutting/media/bottom.jpg new file mode 100644 index 0000000..a7f7bb5 Binary files /dev/null and b/content/posts/2015/tektree-part-2-lasercutting/media/bottom.jpg differ diff --git a/content/posts/2015/tektree-part-2-lasercutting/media/bottom2.jpg b/content/posts/2015/tektree-part-2-lasercutting/media/bottom2.jpg new file mode 100644 index 0000000..05f35c3 Binary files /dev/null and b/content/posts/2015/tektree-part-2-lasercutting/media/bottom2.jpg differ diff --git a/content/posts/2015/tektree-part-2-lasercutting/media/bottom3.jpg b/content/posts/2015/tektree-part-2-lasercutting/media/bottom3.jpg new file mode 100644 index 0000000..fcde290 Binary files /dev/null and b/content/posts/2015/tektree-part-2-lasercutting/media/bottom3.jpg differ diff --git a/content/posts/2015/tektree-part-2-lasercutting/media/plate.jpg b/content/posts/2015/tektree-part-2-lasercutting/media/plate.jpg new file mode 100644 index 0000000..ec125ad Binary files /dev/null and b/content/posts/2015/tektree-part-2-lasercutting/media/plate.jpg differ diff --git a/content/posts/2015/tektree-part-2-lasercutting/media/star.jpg b/content/posts/2015/tektree-part-2-lasercutting/media/star.jpg new file mode 100644 index 0000000..cdd716b Binary files /dev/null and b/content/posts/2015/tektree-part-2-lasercutting/media/star.jpg differ diff --git a/content/posts/2015/tektree-part-2-lasercutting/media/tree.jpg b/content/posts/2015/tektree-part-2-lasercutting/media/tree.jpg new file mode 100644 index 0000000..e590e3b Binary files /dev/null and b/content/posts/2015/tektree-part-2-lasercutting/media/tree.jpg differ diff --git a/content/posts/2015/tektree-part-2-lasercutting/tektree-part-2-lasercutting.md b/content/posts/2015/tektree-part-2-lasercutting/tektree-part-2-lasercutting.md new file mode 100644 index 0000000..9726f5c --- /dev/null +++ b/content/posts/2015/tektree-part-2-lasercutting/tektree-part-2-lasercutting.md @@ -0,0 +1,35 @@ +--- +title: "TekTree part 2 - Lasercutting" +date: "2015-12-19:23:00" +template: "post" +category: "IOT" +tags: + - "tektree" + - "christmas" +description: "Dangerous things involving lasers and christmassy figures. Fun!" +disqusId: "16" +--- + +Last friday I actually got to cut the parts for my TekTree! So excited! This is by far the biggest "piece" I have ever laser cut but luckily everything went well. This in part is thanks to my brilliant friend [Ron](http://www.ronnabuurs.nl) who helped me create the sketches for the laser cutter. Thanks again [Ron](http://www.ronnabuurs.nl)! + +**Top tip!** You don't have to laser cut the designs. Just print the designs with a regular printer and stick it on some wood. Then just use something like a bandsaw to cut the pieces! + +## Laser cutting video + +I've gotten so much positive feedback on my last laser cutting video that I decided to make another one. This one is a little different though. It's a compilation of a few different cuts. + + + +## TekTree assembly + +Below you'll find a series of pictures I took while assembling the TekTree. + +![plate](./media/plate.jpg "the baseplate") + +![bottom](./media/bottom.jpg "bottom of the assembly") + +![bottom2](./media/bottom2.jpg "bottom with box closed") + +![tree](./media/tree.jpg "the tree inserted into the base") + +![back2](./media/back2.jpg "the arduino and breadboard will just be hanging in the back") diff --git a/content/posts/2015/tektree-part-3-wiring/media/wiring1.jpg b/content/posts/2015/tektree-part-3-wiring/media/wiring1.jpg new file mode 100644 index 0000000..e68cfa8 Binary files /dev/null and b/content/posts/2015/tektree-part-3-wiring/media/wiring1.jpg differ diff --git a/content/posts/2015/tektree-part-3-wiring/media/wiring2.jpg b/content/posts/2015/tektree-part-3-wiring/media/wiring2.jpg new file mode 100644 index 0000000..88e3288 Binary files /dev/null and b/content/posts/2015/tektree-part-3-wiring/media/wiring2.jpg differ diff --git a/content/posts/2015/tektree-part-3-wiring/tektree-part-3-wiring.md b/content/posts/2015/tektree-part-3-wiring/tektree-part-3-wiring.md new file mode 100644 index 0000000..5078663 --- /dev/null +++ b/content/posts/2015/tektree-part-3-wiring/tektree-part-3-wiring.md @@ -0,0 +1,39 @@ +--- +title: "TekTree part 3 - Wiring" +date: "2015-12-24" +template: "post" +category: "IOT" +tags: + - "tektree" + - "christmas" +description: "Read about me being tangled with wires and generally just making a mess of things" +disqusId: "17" +--- + +In the 3rd part of my TekTree project I'll show you guys how to wire everything. This time I even used separate colours for the power,ground and signal wires. So no more complaining ! ^\_^ All in all I think the result looks absolutely wicked. Even without the arduino case which has yet to come in the mail. (and probably won't fit) + +## Wiring part 1 - schematics + +Before I started to jam wires in every nook and cranny I could find I had to come up with a plan. Most of that plan has been put into a "Fritzing" sketch which can be found below and on [Github](https://github.com/Mastermindzh/TekTree). The only thing I couldn't figure out how to model on fritzing is the actual christmas tree and the power cord for the arduino. + +The arduino will get power from a regular adaptor. The only modification I did to the adapter is putting a button on one of the wires. And the only reason I did that is because I'm too lazy to unplug the TekTree when I want to turn it off :) + +![Wiring of the back of the Tektree. You can see a lot of jumper wires sticking out and connecting to LEDs](./media/wiring1.jpg) + +## Why so many wires? + +I want the project to be "manageable" for everyone. To do this I kept the wiring as simple as possible. Every LED has 2 prongs, 1 goes to ground 1 goes to the arduino. Simple. Same goes for the potentiometers, 3 legs, 1 power 1 ground 1 signal. The only led's I did bundle together (in terms of wiring) is the star. I did this to create a single star instead of multiple led's. + +## Well you could've made it way prettier... and.... + +Well yes, as all of us know I'm perfectly capable of designing a [refined build](/images/blogs/han4pi/Front_thumb.png). I didn't want to go with a pcb this time however because that would make the barrier to entry way higher on this project. And that is something I definitely **don't** want. + +I also didn't "group" all my ground wires together. (led -> led -> led -> board) This would've made the project a lot neater but it wouldn't be anywhere near as service friendly. (which was kinda the idea...) + +Well then, I feel like I prepared you guys enough to show the (complicated looking, but very simple) wiring. Check it out below! + +## Wiring part 2 - Actual wiring + +Below you'll find the pictures I took while I was wiring the TekTree. + +![Wiring of the back of the Tektree. You can see a lot of jumper wires sticking out and connecting to LEDs](./media/wiring2.jpg) diff --git a/content/posts/2015/tektree-part-4-programming/tektree-part-4-programming.md b/content/posts/2015/tektree-part-4-programming/tektree-part-4-programming.md new file mode 100644 index 0000000..f922e84 --- /dev/null +++ b/content/posts/2015/tektree-part-4-programming/tektree-part-4-programming.md @@ -0,0 +1,209 @@ +--- +title: "TekTree part 4 - programming" +date: "2015-12-24:23:00" +template: "post" +category: "IOT" +tags: + - "tektree" + - "christmas" +description: "I finally get to the juicy code of my home-made christmas tree shambles!" +disqusId: "18" +--- + +In the last installment of the series I show you how to program the arduino to work with the TekTree we built. I would advise each and every one of you to download my sketch and try it but after that start experimenting with your own designs! + +## Testing + +Before we start writing complicated code we first need to design a very simple test sketch for the leds. The script I used can be found below or at [Github](https://github.com/Mastermindzh/TekTree) under the following directory: Testing -> LedTest + +The code is quite simple. It sets all led's as output and runs through them. back and forth + +```ino + /* + Rick van Lieshout + 24-12-2015 + LICENSE: MIT + */ + + const int DELAYTIME = 100; + const int NUMBEROFPINS = 11; + const int pinArray[NUMBEROFPINS] = {0,1,2,3,4,5,6,7,8,9,10}; + + void setup() { + //initiate pins + for (int thisPin = 0; thisPin < NUMBEROFPINS; thisPin++) { + pinMode(pinArray[thisPin], OUTPUT); + } + } + + void loop() { + // loop from the lowest pin to the highest: + for (int thisPin = 0; thisPin < NUMBEROFPINS; thisPin++) { + // turn the led on: + digitalWrite(pinArray[thisPin], HIGH); + // wait for a bit + delay(DELAYTIME); + // turn the led off: + digitalWrite(pinArray[thisPin], LOW); + } + // loop from the highest pin to the lowest: + for (int thisPin = NUMBEROFPINS - 1; thisPin >= 0; thisPin--) { + // turn the led on: + digitalWrite(pinArray[thisPin], HIGH); + // wait for a bit + delay(DELAYTIME); + // turn the led off: + digitalWrite(pinArray[thisPin], LOW); + } + } +``` + +Assuming all went well you should now see the led's come on 1 by 1 and create a little wave effect (first pattern down!) + +Now that we know it all works let's clean up the code and add some pattern handling. + +## The finished code / result + +The complete code can once again be found on github or directly below the video. +That's it for now. **Merry christmas and a happy new year folks!** + + + +## The code that makes it work + +```ino +/* + Rick van Lieshout + 24-12-2015 + LICENSE: MIT +*/ + +/** Constant value's, these have to be changed manually **/ +const int MAXSEQUENCES= 20; // number of steps in the largest sequence. Could make it 999 but that would affect performance +const int NUMBEROFPINS = 11; // number of leds +const int NUMBEROFPATTERNS = 5; // number of patterns specified +const int DELAYPOT = 0; // number of pin that pot is connected to +const int BUTTONPIN = 12; // number of pin that button is connected to +const int pinArray[NUMBEROFPINS] = {0,1,2,3,4,5,6,7,8,9,10}; // pins where leds are connected + +/** Regular variables, program can alter these **/ +int previousbuttonstate = 0; // used to detect whether button is pressed +int buttonstate = 0; // used to detect whether button is pressed +int pattern = 0; // pattern to start with + +/** massive array which holds the patterns **/ +const byte LEDsequence [NUMBEROFPATTERNS][MAXSEQUENCES][NUMBEROFPINS] = { + { + {0,0,0,0,0,0,0,0,0,0,0}, + }, + { + {1,1,1,1,1,1,1,1,1,1,1}, + }, + { + {1,0,0,0,0,0,0,0,0,0,1}, + {0,1,0,0,0,0,0,0,0,0,1}, + {0,0,1,0,0,0,0,0,0,0,1}, + {0,0,0,1,0,0,0,0,0,0,1}, + {0,0,0,0,1,0,0,0,0,0,1}, + {0,0,0,0,0,1,0,0,0,0,1}, + {0,0,0,0,0,0,1,0,0,0,1}, + {0,0,0,0,0,0,0,1,0,0,1}, + {0,0,0,0,0,0,0,0,1,0,1}, + {0,0,0,0,0,0,0,0,0,1,1} + }, + { + {1,0,0,0,0,0,0,0,0,0,1}, + {0,1,0,0,0,0,0,0,0,0,1}, + {0,0,1,0,0,0,0,0,0,0,1}, + {0,0,0,1,0,0,0,0,0,0,1}, + {0,0,0,0,1,0,0,0,0,0,1}, + {0,0,0,0,0,1,0,0,0,0,1}, + {0,0,0,0,0,0,1,0,0,0,1}, + {0,0,0,0,0,0,0,1,0,0,1}, + {0,0,0,0,0,0,0,0,1,0,1}, + {0,0,0,0,0,0,0,0,0,1,1}, + {0,0,0,0,0,0,0,0,1,0,1}, + {0,0,0,0,0,0,0,1,0,0,1}, + {0,0,0,0,0,0,1,0,0,0,1}, + {0,0,0,0,0,1,0,0,0,0,1}, + {0,0,0,0,1,0,0,0,0,0,1}, + {0,0,0,1,0,0,0,0,0,0,1}, + {0,0,1,0,0,0,0,0,0,0,1}, + {0,1,0,0,0,0,0,0,0,0,1} + }, + { + {1,0,0,0,0,0,0,0,0,1,1}, + {0,1,0,0,0,0,0,0,1,0,1}, + {0,0,1,0,0,0,0,1,0,0,1}, + {0,0,0,1,0,0,1,0,0,0,1}, + {0,0,0,0,1,1,0,0,0,0,1}, + {0,0,0,1,0,0,1,0,0,0,1}, + {0,0,1,0,0,0,0,1,0,0,1}, + {0,1,0,0,0,0,0,0,1,0,1}, + {1,0,0,0,0,0,0,0,0,1,1} + } +}; + +/** Setup only gets run once **/ +void setup(){ + //set all pins as input/output + initializePins(); +} + +/** Loop is constantly running **/ +void loop() { + // read button state + buttonstate = digitalRead(BUTTONPIN); + // if button state changed + if(buttonstate != previousbuttonstate){ + previousbuttonstate = buttonstate; + // check value and add to pattern + if(buttonstate == HIGH){ + if(pattern +1 == NUMBEROFPATTERNS){ + pattern = 0; + }else{ + pattern++; + } + } + } + + // Loop through all the arrays and toggle pins on or off. + for (int sequence=0;sequence0){ + amount++; + } + } + return amount; +} + +/** get value of pot **/ +int getDelay(int potnr){ + return analogRead(potnr); +} + +/** Set all pins as either output or input **/ +void initializePins(){ + pinMode(BUTTONPIN, INPUT); + for (int pin=0;pin= 0.6" } }, + "node_modules/medium-zoom": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/medium-zoom/-/medium-zoom-1.0.6.tgz", + "integrity": "sha512-UdiUWfvz9fZMg1pzf4dcuqA0W079o0mpqbTnOz5ip4VGYX96QjmbM+OgOU/0uOzAytxC0Ny4z+VcYQnhdifimg==" + }, "node_modules/mem": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/mem/-/mem-8.1.1.tgz", @@ -35846,6 +35866,11 @@ } } }, + "@fastly/performance-observer-polyfill": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@fastly/performance-observer-polyfill/-/performance-observer-polyfill-1.1.1.tgz", + "integrity": "sha512-hmXJBYhIs77KPyg/IcPM5sDeQSPLrTzD6DqGfSUUtvEUoQxbW6nxHYCYJE8CP+Ay+OUqLZlTpW+w1OEOZWckzQ==" + }, "@fortawesome/fontawesome-common-types": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.2.0.tgz", @@ -45653,6 +45678,15 @@ } } }, + "gatsby-remark-images-medium-zoom": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/gatsby-remark-images-medium-zoom/-/gatsby-remark-images-medium-zoom-1.7.0.tgz", + "integrity": "sha512-TLaq+ua+nO2CX/B/FnWB0OvJiLdplzbRCXrgCxYoZs3RkN5IfUu9BJYKEFjzx6J3uhwLvBA7XqE5cFOZ2cu4AQ==", + "requires": { + "@fastly/performance-observer-polyfill": "^1.1.1", + "medium-zoom": "^1.0.4" + } + }, "gatsby-remark-prismjs": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/gatsby-remark-prismjs/-/gatsby-remark-prismjs-6.23.0.tgz", @@ -50972,6 +51006,11 @@ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" }, + "medium-zoom": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/medium-zoom/-/medium-zoom-1.0.6.tgz", + "integrity": "sha512-UdiUWfvz9fZMg1pzf4dcuqA0W079o0mpqbTnOz5ip4VGYX96QjmbM+OgOU/0uOzAytxC0Ny4z+VcYQnhdifimg==" + }, "mem": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/mem/-/mem-8.1.1.tgz", diff --git a/package.json b/package.json index 122d7de..afd1091 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "gatsby-remark-copy-linked-files": "^5.23.0", "gatsby-remark-external-links": "0.0.4", "gatsby-remark-images": "^6.23.0", + "gatsby-remark-images-medium-zoom": "^1.7.0", "gatsby-remark-prismjs": "^6.23.0", "gatsby-remark-responsive-iframe": "^5.23.0", "gatsby-remark-smartypants": "^5.23.0", @@ -88,8 +89,8 @@ "@swc/core": "^1.3.1", "@swc/jest": "^0.2.22", "@types/gatsby-transformer-remark": "^2.9.1", - "@types/node": "^18.7.3", "@types/jest": "^29.0.3", + "@types/node": "^18.7.3", "@types/react": "^18.0.20", "@types/react-dom": "^18.0.6", "@types/react-helmet": "^6.1.5",