Welcome to my site
made with love ❤️
Who I am:
My name is Peter von der Bey.
I was born in 1997 and grew up with a father and a grandfather who stood in the garage all day and built cool stuff.
So I got in contact with technology early and started to realize my own ideas.
Now I am a computer science student. Alongside my studies I work at "Arthur Grillo" as a system developer.
The Company is specialized of measuring and controlling systems.
My hobbies:
Riding and building motorcycles.
I do that all year long.
In the summer I go diving.
In the winter evenings I do electronic and computer stuff.
This website is using the Freelancer Bootstrap template as a foundation.
The template is licensed under the MIT License.
Furthermore I`m using the web-standards jquery and fonts from Google.
...is backend!
The first problem I encountered was
"How can I move data from one page to another?".
I chose JavaScript to implement a string parser,
which creates a crappy get-request similar to the ones made in Node.js.
This is the function I wrote:
function get(index){
var url = window.location.href;
var name_index_output = [];
var data_output = [];
var split_char = ["?","=","&"];
var empty = false;
var return_get = false;
try {
var get_meta_data = url.split(split_char[0])[1];
var name_index = get_meta_data.split(split_char[1]);
empty = true;
}catch(err){}
if(empty == true){
for (var i = name_index.length - 2; i >= 1; i--)
name_index[i] = name_index[i].split(split_char[2])[1];
var data = get_meta_data.split(split_char[1]);
for (var i = data.length - 1; i >= 1; i--)
data[i] = data[i].split(split_char[2])[0];
var c = 0;
for (var i = 0; i < name_index.length - 1; i++) {
name_index_output[c] = name_index[i];
c++;
};
c = 0;
for (var i = 1; i < data.length; i++) {
data_output[c] = data[i];
c++;
};
for (var i = 0; i < name_index_output.length; i++) {
if(name_index_output[i] == index){
return_get = data_output[i];
break;
}
};
}
return decodeURI(return_get);
}
I have written an .obj mtl viewer to display 3D objects on my website.
I used three.js, which is based on WebGL and almost completely written by Mr.Doob.
With the get function I can embed the viewer decentralized.
Via get the controller can be directly controlled via an url
The decentralized code for the example (1.0) is below:
<iframe src="obj/index.html?file=me&camera_z=1.5&mtl_loader=true&lock_Polar_rotation=true" scrolling="no"></iframe>
1.0 (example of the 3D viewer)
Below are all the commands that the viewer can understand:
?file={String} // inculde the file without file ending
?camera_x={float} // camera x
?camera_y={float} // camera y
?camera_z={float} // camera z
?rotation_x={float} // rotation x
?rotation_y={float} // rotation y
?rotation_z={float} // rotation z
?mtl_loader={bool} // mtl_loader with image or only color
?back_color={#FFFFFF} // back color
?lock_Polar_rotation={bool} // rotate Polar or online in x
Download the 3D viewer:
The new git structure, which was published this year,
resulted in a small hick-up for me.
On the main page of my Lap there's a drop down menu containing links to the
weekly assignments from every student.
Unfortunately we had no access to the main Lab repository to update those links.
So I wrote a XML HTTP Request (AJAX) to parse a .json-file into my repository for updating the link reference
on the main page.
This way I got full access to the link reference without getting any rights on the
main FabLab repository.
The HTML code to see the access structure:
<div class="btn-group">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">Peter's assignments<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li>
<p id="final"></p>
</li>
<li role="separator" class="divider"></li>
<p id="weeks"></p>
</ul>
</div>
The actual script:
var target_url = "students/peter-vonderbey/";
document.getElementById("final").innerHTML = `<a href="${target_url}#final">Final project</a>`;
function fetchJSONFile(path, callback) {
var httpRequest = new XMLHttpRequest();
httpRequest.onreadystatechange = function() {
if (httpRequest.readyState === 4) {
if (httpRequest.status === 200) {
var data = JSON.parse(httpRequest.responseText);
if(callback)callback(data);
}
}
};
httpRequest.open('GET', path);
httpRequest.send();
}
fetchJSONFile(target_url + 'json/weeks.json', function(data){
var array = $.map(data, function(value, index) {
return [value];
});
var innerHTML_tupel = "";
for (var i = 0; i < array.length; i++) {
innerHTML_tupel += `<li><a href="${target_url}?week=${array[i].link}">${array[i].label}</a></li>`;
};
document.getElementById("weeks").innerHTML = innerHTML_tupel;
});
The JSON file:
{
"week1": {
"link": "1",
"label": "Week 1: Git and HTML"
},
"week2": {
"link": "2",
"label": "Week 2: C.A.D"
},
"week3": {
"link": "3",
"label": "Week 3: C.C.C"
}
}
HTML stands for Hypertext Markup Language, which is a description language.
This can be extended by css (Cascading Style Sheets) to extend the description part.
Small animations can be done in css aswell.
With JavaScript you can do most other things followed by that.
You can dynamically change the website and execute your own code.
This is running surprisingly well on user devices.
The basic structure of a website:
<!DOCTYPE html>
<html>
<head>
<title>Title of the website</title>
<!-- further metadata -->
</head>
<body>
<p>contents of the website</p>
</body>
</html>
In addition, I would like to write something about javascript because I am very impressed by the possibilities and the performance of this language.
First, I want to look at the performance and the ease of use.
I wrote a very simple and basic script to calculate PI.
I made this in three languages: JavaScript, C and Java.
Then I stopped the time it took, to execute the programms.
The code for JavaScript:
var c=0;
function Cal_Pi(){
var c=prompt("Number of cycles:","100000");
if (c>0){
console.time("Calculated_PI_time");
var pi=0;
var n=1;
for (i=0;i<=c;i++){
pi=pi+(4/n)-(4/(n+2));
n=n+4;
}
console.timeEnd("Calculated_PI_time");
console.log(`Number of cycles: ${c}`);
console.log(`Calculated PI: ${pi}`);
}else{
alert("Input not in Range");
}
}
(look in the console)
The code for C:
#include <stdio.h>
#include <time.h>
int main() {
int c;
printf("Number of cycles:\n");
scanf("%d", &c);
if(c>0){
clock_t begin = clock();
double pi = 0.0;
double n = 1.0;
for(int i=0;i<=c;i++){
pi=pi+(4/n)-(4/(n+2));
n=n+4;
}
clock_t end = clock();
double time_spent = ((double)(end - begin) / CLOCKS_PER_SEC)*1000;
printf("Calculated PI time: %lf \n" , time_spent);
printf("Number of cycles: %d \n" , c);
printf("Calculated PI: %lf \n" , pi);
}else{
printf("Input not in Range\n");
}
}
The code for Java:
import java.util.Scanner;
public class calculate_PI {
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
System.out.println("Number of cycles:");
int c = input.nextInt();
if(c>0){
long startTime = System.currentTimeMillis();
double pi = 0.0;
double n = 1.0;
for(int i=0;i<=c;i++){
pi=pi+(4/n)-(4/(n+2));
n=n+4;
}
long stopTime = System.currentTimeMillis();
long elapsedTime = stopTime - startTime;
System.out.print("Calculated PI time: ");
System.out.println(elapsedTime);
System.out.print("Number of cycles: ");
System.out.println(c);
System.out.print("Calculated PI time: ");
System.out.println(pi);
}else{
System.out.println("Input not in Range");
}
}
}
The results:
First of all, this test is not fair.
The performance differences can not only be measured in terms of time since different functions perform differently in different languages.
But you can get a rough idea of the performance of those languages.
I ran all three tests on my machine with the same CPU utilization.
Number of cycles: 100000 JavaScript : 0.896728515625ms C : 0.459000ms Java : 0.6ms
The order seems obvious😂.
But it still amazes me.
C is twice as fast as JavaScript.
Anyhow, the speed of JavaScript is still impressive, considering
it is a language which gets interpreted right away.
Natively running C is one of the fastes high-level languages you can use.
So, I am very satisfied with half of the performance from C 🙂💪.
The huge advantage lies within the simplicity of writing JavaScript code.
You do not need a compiler, any special IDE or special knowledge about storage to get started.
“I’m an egotistical bastard, and I name all my projects after myself.
First ‘Linux’, now ‘Git’.”
– Linus Torvalds
(in british colloquial language Git = dumbass)
Git's design uses some ideas from Monotone as well as BitKeeper, but no actual source code from it.
It should explicitly be an independent version management system.
The structure of Git differs from Monotone in the fact that there is a separate database for each branch where Monotone has one database per developer.
To get started, "clone" or "init" a repo.
When you clone you are now done but if you init do that to fill the repo, add all the stuff with simply "add" with "add ." you add all files in the init directory.
Then you commit with "commit" comment the commit with "-m".
At this point would be a "diff" offer with "diff" you can see the changes you have made.
This can be very helpful if the subsequent push accesses a running system which has relevance.
Now you just have to push.
Here is a list of the just mentioned commands:
git init
git status
git add
git diff
git commit -m '<commit comment>'
If you want to learn Git:
Do yourself and others who you work with a favor.
Do not learn with my documentation and with no others that are still all existing on the Internet.
Go to the git-scm.com site, there you will find everything you need reasonable and complete explained in context.
The website
Try Git is a learning portal that addresses two learning target groups.
The Learn by reading charakter and the Learn by doing charakter.
If you like reading this is,
the right one for you.
Learn with videos😂
I have compared Fusion 360 and Solidworks in the category 3D programs with each other.
Fusion 360 is a product of Autodesk, which is cloud based.
For non commercial use, it remains free.
It comes with a lot of additional function which otherwise exists only in licensable CAD programs.
In my opinion, the Professional Cam Tool makes Fusion 360 so unique.
In Fusion, I drew a helical gear.
The result looks like this:
🖐drag and move🖐
I have decided to draw a gear because I am excited about the connections in the metric system. A metric gear can only be described by the module and the number of teeth. All other values are determined from those. I thought that this is a good example of parametric drawing. I completely underestimated the complexity. After spending many hours studying the mathematical aspects of gearwheels, I decided to derive my measurements from an existing skitz.
I then used this sketch:
I took the tooth shape of a)
In Fusion, I have once created all the parameters that describe my gear.
Then I have created a sketch, based on the parameters just created.
Then I extruded the inside of my gear.
I've drawn an angle in the middle.
This is the later helic angle.
Then I projected the angle with the tool on the surface projecting on the outer ring.
Now I have drawn the tooth shape and set this in dependence on the newly projected curve.
I used the elevation tool to connect both tooth sketches with each other.
I chose the projected curve as guide line.
With the round arrangement tool I added the neccessary number of teeth.
The rendered gear:
SolidWorks is a 3D CAD program. The manufacturer is the software company Dassault Systèmes SolidWorks Corp., a subsidiary of the French Dassault Systèmes.
I would call Solidworks a completely normal CAD program with many additional features all modularized.
My result:
🖐drag and move🖐
First, I made a sketch and drew a half tooth.
Then I flipped the half tooth with the mirror tool.
With the circular tool I have added all appropriate teeth
After that was still the outline of the previously drawn circle.
I then removed those with the trimming tool.
With the Linear Attachment Tool I made the gear three-dimensional.
The rendered gear:
A canvas element is an area described in the HTML language with height and width information on which can be drawn using JavaScript. Originally developed by the Apple company as part of the WebKit, it has later been standardized by the WHATWG working group as part of the HTML5 markup language.
My result:
Number of teeth:
Outher radius:
Inner radius:
Outer ramp:
Inner ramp:
When creating the algorithm, I was inspired by the solution of Ken Fyrstenberg. The algorithm is not working perfectly yet, it still has some small bugs.
- Do a test with the laser cutter
- Cut something on the vinyl cutter
- Design a press-fit construction parametrically
The laser cutter I've used is a 50W Co2 emitter from Epilog.
What is a CO2 laser and how does it work?
A carbon dioxide laser is a gas resonator that induces kinetic molecular vibration in a CO2-N2-He gas mixture.
The gas mixture is excited in the resonator with a DC or HF glow discharge.
If the N2 molecules are excited, they can oscillate only with two discrete amplitudes (ν and 2 ν).
Since the N2 molecule does not have a permanent dipole moment, transitions between the oscillation levels with the emission of photons (optical transitions) are forbidden and the N2 molecules can remain in this excited state for a very long time (order of magnitude: 1 ms).
Due to the long time in the excited state, there is a high probability that they stimulate CO2 molecules by collisions of the second kind to oscillate in one of their four normal vibrations (see molecular vibration) - this makes the N2 molecules a kind of energy storage.
CO2 molecules that have been excited to the 2ν3 level only have to fall by one energy level before spontaneously losing energy before they can release a photon.
In my test I have examined the frequency setting of the cutter.
In order to regulate the performance of the resonance tube one proceeds similarly as with an inductive system.
Two superimposed modulation types are used.
Once CW this is the actual resonance signal this is usually regulated by feed back to show a stable resonance behavior.
This signal is modulated by a pwm signal.
The base frequency of the pwm can be adjusted in the software.
I have tested three different frequencies on a piece of acrylic glass.
(1) 5kHz
(2) 500Hz
(3) 100Hz
The remaining settings are 100% Power and 25 Speed.
This was the test plate.
With the naked eye you can already see the difference.
The cut edges of the 100Hz cut are sharper and clearer.
Under the Microscope the difference became very clear.
5kHz cut.
100Hz cut.
As a result I would say that if you want to cut a precise part, you should take a low frequency if you want smooth edges and you should take a high frequency.
Why is that ?
When the duty cycle of the PWM is high, energy is constantly being brought into the material.
This is how the edges run in heat-sensitive materials.
When the duty cycle of the PWM is low, the spike discharge is high.
This way, the laser beats the material in a short burst of energy and thus brings little energy into the material.
I wrote a box designer in JavaScript.
I think that such box designers are very practical because it makes a lot of work to sign these boxes in a "normal" drawing program.
The program:
For the whole source code download the script.
Here are a few exciting points:
Here two parts of the box are created.
The code is not nice that is due to the circumstances that I had to think long about the actual shape of the recesses for a long time and came to the conclusion that they must be very asymmetrically.
function A(start_x,start_y){
ctx.beginPath();
start_x += material_thickness;
start_y += material_thickness;
var x = start_x;
var y = start_y;
ctx.moveTo(start_x,start_y);
x += height_join/2;
ctx.lineTo(x,y);
y -= material_thickness;
ctx.lineTo(x,y);
for (var i = 0; i < teeth_number; i++) {
if(i < teeth_number-1){
x += height_join;
ctx.lineTo(x,y);
y += material_thickness;
ctx.lineTo(x,y);
x += height_join;
ctx.lineTo(x,y);
y -= material_thickness;
ctx.lineTo(x,y);
}else{
x += height_join;
ctx.lineTo(x,y);
y += material_thickness;
ctx.lineTo(x,y);
x += height_join/2;
ctx.lineTo(x,y);
}
};
y += depth_join/2;
ctx.lineTo(x,y);
x += material_thickness;
ctx.lineTo(x,y);
for (var i = 0; i < teeth_number; i++) {
if(i < teeth_number-1){
y += depth_join;
ctx.lineTo(x,y);
x -= material_thickness;
ctx.lineTo(x,y);
y += depth_join;
ctx.lineTo(x,y);
x += material_thickness;
ctx.lineTo(x,y);
}else{
y += depth_join;
ctx.lineTo(x,y);
x -= material_thickness;
ctx.lineTo(x,y);
y += depth_join/2;
ctx.lineTo(x,y);
}
};
x -= height_join/2;
ctx.lineTo(x,y);
y += material_thickness;
ctx.lineTo(x,y);
for (var i = 0; i < teeth_number; i++) {
if(i < teeth_number-1){
x -= height_join;
ctx.lineTo(x,y);
y -= material_thickness;
ctx.lineTo(x,y);
x -= height_join;
ctx.lineTo(x,y);
y += material_thickness;
ctx.lineTo(x,y);
}else{
x -= height_join;
ctx.lineTo(x,y);
y -= material_thickness;
ctx.lineTo(x,y);
x -= height_join/2;
ctx.lineTo(x,y);
}
};
y -= depth_join/2;
ctx.lineTo(x,y);
x -= material_thickness;
ctx.lineTo(x,y);
for (var i = 0; i < teeth_number; i++) {
if(i < teeth_number-1){
y -= depth_join;
ctx.lineTo(x,y);
x += material_thickness;
ctx.lineTo(x,y);
y -= depth_join;
ctx.lineTo(x,y);
x -= material_thickness;
ctx.lineTo(x,y);
}else{
y -= depth_join;
ctx.lineTo(x,y);
x += material_thickness;
ctx.lineTo(x,y);
y -= depth_join/2;
ctx.lineTo(x,y);
}
};
ctx.lineWidth = 2;
ctx.stroke();
}
Here I create a Uri object in which I then encode the SVG object with utf-8.
This will create the SVG file which will be downloaded.
var svg_gear = ctx.getSerializedSvg(true);
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(svg_gear));
element.setAttribute('download', `box_${svg_width}x${svg_height}.svg`);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
The program takes all types of units and
scales the output in your cut program to the given dimensions.
Box height Box width Box depth
Materialthickness
Number of teeth
The actual cutten:
I used VisiCut to create the laser cutter path.
VisiCut is a part of a Bachelor's Thesis by Thomas Oster, supervised by René Bohne.
Visicut can be paired with inkscape.
Visicut is simple and self explanatory.
You can download it here:
First, I tested a SVG file I created using the gear maker I wrote last week.
The svg file had no errors, I could easily import and scale them in my cut software.
Then I set the cut for my cardboard, tested it. Then it turned out that I need to specify
more power than the standard setting.
The standard settings are: 25% Power , 80 Speed and 500Hz Frequency.
The new settings are: 35% Power , 80 Speed and 500Hz Frequency.
right with the right power left with too little power
After I found the right attitude,
I then started to cut out the box.
The whole cut
After that I built them together.
The connection is very strong, as you can even throw the box on the floor without it falling apart.
I've never used the cutter before, I have to say it was very hard for me to get a decent cut.
I took a SILHOUETTE cameo cutter.
Ande the SILHOUETTE Software.
The cutting Software
The cutting Layout
First of all, I took a piece of black vinyl out of the leftovers box, which I did not get cut even with the stubble setting.
But then I took a different piece and it finally worked.
The cutter
After I have finished cutting, I transferred the lettering on a piece of tape and removed the foil from between the rooms.
removed the foil
Then I transferred the text to my LapTop.
The finished lettering
I would find it very interesting to work with the cutter and I will keep on doing it anyway, because the type of production has potential for me personally.
I have reconstructed the ISP Programmer of
The first thing I did was create a board layout in eagel.
I took the schematic and drew it in Eagle. In order to import the necessary components, Google searches for the components name and eagel library.
Then include the library and use the components.
The redrawn circuit diagram
Then I went to the main task.
Create the board layout in Eagle.
When you start with the board layout, all components will lie random on the board.
First, arrange them so that they are arranged with purpose.
Now I would recommend you to create a Ratsnest.
To do this, use the Poligon sign tool and draw a rectangle around your layout.
Make sure you're in the right layer.
Use the name tool and click on the just created polygon.
Rename the polygon to GND.
Now click on create Ratsnest.
Now everything had to be in the color of your layer.
Then move a corner of the polygon with the move tool until the Ratsnest disappears, but all GND connected remain, so you just have to connect the other connections.
The routed layout without Ratsnest.
... and with Ratsnest.
After I created and exported the Eagle files.
I start milling.
In our lab we use a LPKF isolation cutter.
our electronics corner with the LPKF...
Basic setting of the PCB material in the LPKF.
Positioning device on the board.
Then I milled the board.
I cleaned the finished board and sprayed it with solder varnish.
...cleaned and sprayed with solder varnish..
Put out the matching parts.
Qty | Value | Device | Package | Parts | |
2 | LEDSMT1206 | 1206 | LED1, LED2 | ||
4 | R-EU_R1206 | R1206 | R1, R2, R4, R5 | ||
1 | SJW | SJW | J1 | ||
1 | 1.5k | R-EU_R1206 | R1206 | R3 | |
1 | 100nf | C-EUC1206 | C1206 | C1 | |
2 | 3.3 | DIODE-MINIMELF | MINIMELF | D1, D2 | |
1 | ATTINY45 | ATTINY45 | SOIC8 | ||
1 | Header 3X2 | PINHD-2X3SMT | 2X03_SMT | ISP | |
1 | MINI-USB-32005-201 | MINI-USB-32005-201 | 32005-201 | USB-AB |
Finished board first test on fused 5V.
Programming construction.
successful flashing...😅
I could also succesfully set the fuses.
So far everything worked out, but from now on a lot of problems appeared.
It was not recognized by my Mac on a Win PC it was recognized, but I was not able to address it.
Unfortunately, I can not continue at this point.
The recognized FabTinyISP couldn`t load the drivers.
I printed as a test ISO thread.
And wanted to test up to which slope you can print.
My test setup consisted of a plate with the common 6 ISO gradients all threads are M10.
And the matching six screws.
🖐drag and move🖐
The finished test.
The process of creating:
The head of the screw.
Extrude the screw.
Make thread on the screws.
Draw base plate.
finished test.
In order to have everything in a stl file, I combined all the bodies into one component with the Combine Tool.
The printed result surprised me a lot.
ISO threads are described by two values once by the diameter of this is given with M and the pitch this is written behind it (M10x1.5) that means that the tool has a diameter of 10mm and with one turn the screw moved 1.5mm into the thread.
In the test I evaluated the following thread pitches:
1) M10x1.5
2) M10x1.25
3) M10x1.12
4) M10x1.1
5) M10x0.75
6) M10x0.5
These are the common ISO pitches.
As a result, I could turn all six screws in.
All the screws were easy to turn in, only the last one was a bit heavy.
I drew and printed a whistle with a ball in it.
The creation process:
Create a sketch
Remove all lines that are not needed
Extrude the middle part
Extrude soil
Insert the ball
...and done 😀
🖐drag and move🖐
Unfortunately I had a little problem with
the slicer, it has skipped a complete layer.
But now, it works.
I did my scans with an xBox 360 Kinect camera.
This worked amazingly well.
I stuck the camera on a tripod.
The first scan with the software Scanect. (colourless)
...with color
This is a scan from a friend of mine using the software ReconstructME.
The use of Skanect is really easy.
Go to the website download the program install it.
After starting the program you will have on the top a bar this bar shows you the processing steps in the first tap go to settings and set the Xbox camera as input device then set the size of the bounding box.
After setting erveysing up you can go to the next tap in this can do the scan click at record and then turn slowly for the camera I used a spinning chair to record me.
In the next tap you can render the san.
Then you can process the scan, Skanect can do some stuff that also meschmixer can do.
At this point you are ready.
The result:
The tracking with Scanect is essentially better than with ReconstructME.
If using Scanect, it downscales the stl.
Skanect website
I`ve tried to write a scan software with Processing, unfortunately I didn`t have had enough time to get it done.
In any case, if the opportunity arises, I will pursue this idea further.
first try a 3d dots cloud in Processing.
UART stands for Universal Asynchronous Receiver/Transmitter,
commonly referred to as a serial port.
UART is a peripheral for point-to-point communication between two devices.
Communication occurs in SERIAL,which means one bit at a time.
UART has two communication PINs: RX and TX.
UART is asynchron, that means that no CLOCK line is needed.
Both devices are synchronized by time.
The devices show fix baud rates - it's the transaction speed measured in bit per second.
At the beginning of the transmission, the data line is set to logical '0'.
At the end of the transmission the data line will be set to logical '1'.
The data is transmitted in a normal byte block.
Transmission of a char “C” hexcode 43, binary 0100 0011
Pic controller with two connected oziloscope probes.
I have defined a trigger pin that I set to HIGH whenever the transfer starts and goes LOW when it ends.
I connected a probe of the Oziluscope to this pin and put the trigger on it.
I connected the other probe to the UART TX pin.
Yellow is the trigger pin, blue is the TX line.
I took an atmega 32u4 for my board.
All information I have about the microcontroller was retrieved from the data sheet.
The data sheet is linked here:
The chips...☺
I found it quite small to solder it by hand...
But after an hour it was done.
Then I built the first prototype of a breadboard.
And I flashed the bootloader with an ISP programmer.
After I had flashed the Arduino micro bootloader, I was able to import my programs from the Arduino IDE via the USB cable.
The serial connection also worked.☺
Then I took the construction of the breadboard on a prototype board.
The backside...
My next step was to create a circuit board.
The first thing I did was to create the circuit diagram in Eagel.
After making the circuit diagram I made the layout.
When you start with the board layout, all components will lie random on the board.
First, arrange them so that they are purposefully arranged.
Now I would recommend you to create a Ratsnest.
To do this use the Poligon sign tool and draw a rectangle around your layout.
Make sure you're in the right layer.
Use the name tool and click on the just created polygon.
Rename the polygon to GND.
Now click on create Ratsnest.
Now everything had to be in the color of your layer.
Then move a corner of the polygon with the move tool the Ratsnest disappears but all GND connected remain so you just have to connect the other connections.
After that I route the board.
The finished milled board...
The milled board...
The unsoldered controller with liquid solder on the pads.
The top of the ready equipped board.
The bottom of the board.
After my two boards based on the atmega 32u4 worked.
I built a third board based on the atmega 328p microcontroller.
I have built it again on a piece of perfboard.
I really enjoy working with perfboards.
When creating prototypes, I see a lot of advantages in perfboards.
Also, all information about the microcontroller I have is retrieved from the data sheet.
The data sheet is linked here:
First, I took an Arduino UNO and put in a new 328p.
Then I connected the UNO via ISP to my computer.
I use the Diamex AVR Programmer, this can supply the UNO directly with power.
Now I chose the Arduino Pro as a board.
Then I'm burning the bootloader.
It is important to make sure that the right programmer is selected.
After this I soldered the 328p with the Arduino bootloader and the most important parts on a piece of perfboard.
Important parts are:
- 16 MHz quartz
- 22pF load for the quartz
- 100nF DC Reset coupling
- 10KOhm Pulldown on Reset
- 10uF filter capacitor
- 6x Pinout for the FTDI
I took a copper enamel wire to connect the pins together.
After this step I played the UART echo program (see below) on the 328p via an FTDI cable.
That's how I checked if my board is functioning propper.
Then I soldered some unnecessary but useful things on the board:
- Header pins for all pins of the controller.
- 4x header pins for VCC and GND
- further 10uF filter capacitor to filter higher currents
- Reset button
- LED on Arduino pin 13
The Arduino code does the following:
He asks again and again when some serial data is available then it took the char
and compared it with an "|".
If the char is an "|" it printed out a new line.
If not, it just printed the incoming char.
char incomingByte = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
if (Serial.available() > 0) {
incomingByte = Serial.read();
if(incomingByte == '|'){
Serial.println("");
}else{
Serial.print(incomingByte);
}
}
}
I built a table cabinet.
The idea was to have a table in a loft bed.
Because it turns out to be difficult to order drinks successfully in a loft bed.
But if you want to sleep, it should be as small as possible.
This is how a folding table was created.
The drawn table.
The operations to set up the mill and the milling.
The remote to control the mill when setting up.
The first step was to lay wood down in the maschine and turn on the vacuum bed.
Then I zeroed the Work Z coordinate with the tool button.
After that, I zeroed the X and Y work coordinates.
The cam program I've used can stream the qcode right away.
Since the router is intended only for 2D applications, the cam program is much easier than a 3D cam program.
You just have to load a 2D vector file and set the cutlines and you're done.
Then I defined the inline and outline paths.
I used the following settings.
Then I generated the tool path and started streaming the code.
The milling process.
The milled parts.
With a little force, I was able to assemble it.
I needed two screws for the stock, but no more than that.
The finished cabinet in the unfolded state.
The cupboard in the closed state.
With this way you can use the Arduino products with Atmel Studio.
It is very interesting for me because I use a 32u4 on my board which I can program with the Arduino Bootloader directly via USB.
Therefore I can use this with Atmel Studio.
First step:
At first, you have to set the output to detailed output in the Arduino IDE under settings.
Second step:
Then you have to copy the blue highlighted line.
This line contains the destination information and settings of avrdude.
Paste the copied line into a text editor and put it in the format below.
Pay attention to the currently used COM port.
Example from my IDE:
A:\Programms\Arduino\hardware\tools\avr/bin/avrdude -CA:\Programms\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM17 -b57600 -D -Uflash:w:C:\Users\admin\AppData\Local\Temp\arduino_build_834149/sketch_mar20a.ino.hex:i
Convert a copied line to this format:
A:\Programms\Arduino\hardware\tools\avr/bin/avrdude.exe
-C"A:\Programms\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -patmega328p -carduino -PCOM17 -b57600 -D -Uflash:w:"$(ProjectDir)Debug\$(TargetName).hex":i
Third step:
Then open Atmel Studio and go to Tools and then External Tools.
Under Title you can give the programmer a name.
Under Command, insert the target path of avrdude (first line).
Under Arguments insert the arguments (second line).
Set the checkbox "Use Output Window" to checked to see the returs in the Promt out Console.
Then write your program and compile it.
Now your created programmer can be found under tools.
Click on it and avrdude then uploads the hex file from Atmel Studio.
In the Direction Register you can specify if a pin is an input or an output.
The Direction register for the Port B is called DDRB Register and is an 8 bit register.
When the Bit is HIGH the Pin is an Output, if it is set to LOW, then it is an input.
In the Port Data Register the Physical state of the Pin is stored.
The Regsiter is read- and writeabel, but write gets ignored if the Pin is in Input-Mode.
If the Bit is HIGH, the Pin is HIGH, which means if the Pin is in Input-Mode, the voltage on the Pin
is higher than 3V, the Pin is LOW if it is less than 1.5V.
It`s the same when the Pin is in Output-Mode, if the HIGH voltage is as the supply voltage. If it is LOW, the Pin is connected to GND.
Below I have written a flashing program which uses the port PCB5.
#define F_CPU 16000000UL
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRB |= 0B00100000;
while (1)
{
PORTB |= 0B00100000;
_delay_ms(1000);
PORTB &= 0B11011111;
_delay_ms(1000);
}
}
How does the Code work?
In the first three lines the microcontroller is basically set up. The quartz frequency is set, aswell as the avr libery and the delay header gets loaded.
Then the Direction Register is setup with "|", you can use the boolesche "OR" to bytes. This technique allows you to only manipulate one Bit in the Byte.
If you use OR, something HIGH is always dominant.
1010 | 0000 = 1010
1010 | 1111 = 1111
1010 | 0001 = 1011
1010 | 0010 = 1010
This means that the Register DDRB stays exactly the same as is, but only if the 6th Bit is set to HIGH.
The same technique is used to set the Output pin with the PORTB Register to HIGH.
All others Pins stay at the same sate, only the 6th Pin is set to HIGH.
To turn the Pin to LOW, you can use a "&" this means boolesche "AND".
With an "AND" LOW is dominant.
1010 & 1111 = 1010
1010 & 0000 = 0000
1010 & 1101 = 1000
1010 & 1110 = 1010
When using the digitalwrite function in the Arduino IDE.
It is easy and ready to use but, also quite inaccurate.
If you are using this function implemented in the library for a lot of operations, the output signal will be very much instable over time.
With a delay of 1ms, the output signal will fluctuate by almost 12ms.
With Plan C code, I could hardly measure the noise at the output.
I'm there in the ns area, where I can only see a slightly thickened falling flank on the scope.
I played a bit with the project of BITLUNI'S LAB, he 3D rendered on an ESP32 with Compesite Video Output.
I connected the composite video input from my TV directly to a DAC from the ESP32.
I do not have the entire dynamic space, but it was enough to have a total of 53 gray values available.
I took a low resolution 3D scan of mine.
For my final project, I would like to switch sockets to activate devices. I would like to know how much electricity this will pull. I have found very cheap WiFi sockets on Amazon, which can measure and switching current. Those have a very complex firmware on it to use them with conventional home automation apps. But I would like to have no second service in between, so I have to implement new firmware on it. It seems like the manufacturers use an expressif chip set, but unfortunately it is not so easy to find out which ones they are using, because they are not labeled. But after some time I have managed to create a serial connection with the chip and to read the current output of the firmware. I will continue trying to play my firmware on it.
The WLAN socket with external 3.3V supply and connected FTDI cable.
The received message from the outlet.
The first part of this weeks project was to mill out a positive mould of a self chosen object.
Second was pouring it out with silicone.
And in the end pouring a positive out of the negative.
The object i chose is the bust I created in another week for 3D modelling.
The complexity of the structure made it challenging to find out where the possibilities end.
For getting a modelling form I separated the object in two halfs by using a very, very small level
(0.0001mm) in Fusion 360.
Then I built a mold box around it.
Then I created the milling job in Fusion 360 I only used the HSC clearing procedure.
This is my milling construction, which was built from the not heated garage for this week in my kitchen.😂
The cutter I used had a shank diameter of 6mm and a pitch of 8 ° with two cut.
I control the mill with MACH3.
The milling took about 6 hours per side.
The finished forms.
The front.
The backside.
Then I weighed and mixed the silicone and the harder on a balance.
I have a 2.5% mixing ratio of silicone to harder.
I did a little bit of silicone in the mold and brushing it all in front of it.
I was hoping that there won`t be too many air bubbles on the model.
Afterwards I filled all the mills for the front I needed 470g Silicon.
Then I solved the silicone out of the mold, unfortunately the Silion stuck, that I had to destroy the mold.
The result surprised me very much, as it was transferring a lot of details into the silicone.
The result.
I totally miscalculated the amount of silicone I needed.
Besides the silicone being too expensive for my purposes.
So I decided to order a much cheaper filling material, as it was also available faster.
This was supplied as a powder which had to be mixed with water.
Using one part of powder and three parts of water turned out to be good.
Then I put the mass in the mold.
I was very surprised how fast the mass got hard, it did not take two minutes.
The result was pretty bad.
Then I made the mistake and dried it.
I would recommend working directly because the drier the mass, the riskier it gets.
The not so nice result with cracks and big air bubbles.
But then I went ahead anyway and got both forms together.
I then filled the same mass that I was using for the second negative form.
Next was to remove the edges with a kitchen knife.
The result
It had a very wobbly consistency,
but became stronger after a few hours passing by.
After a few days, the mass hardened completely and now had a similar consistency as plaster.
I did cut too deep into the material, so the Styrodur block has come off.
I was lucky that the cutter did not drive into the milling bed.
The result of the self-destructive drive.
I had previously milled a small test model that I wanted to pour out with plaster ...
The result was not exactly satisfying.
I let it dry for about 56 hours, but it still has not been decided.
The plaster I used was very old, it probably had water in it already.
After the failed experiment with the plaster, I filled in water and froze it ...
This did not prove to be very successful, because I did not get the ice out of the Mold.
I tried this week to solve the following problem:
Imagine that you want to do an online authentication that authenticates the physical presence.
You can do it like WhatsApp.
(WhatsApp asks to scan a QR code to make a callback)
WhatsApp requires hardware authorizations for the Camera.
This is a problem if you only have a web app.
With my solution, the data is transmitted via a web app without the need for this special entitlement.
The data is transmitted through a flickering of the screen and evaluated with a microcontroller by a photoresistor.
I wrote the website first.
The site asks for demonstration purposes for your name.
The data is then converted from ascii to binary and then printed out.
The left side of the screen then acts as a clock and the right one as a data line.
The first test on the back of the breadboard I attached an Uno with tape.
On the front side are two photo resistances.
My test construction proved to be awkward.
So I changed it in this construction.
Then I took the board I built in the electronics design week and connected my sensors to it.
After that, I cut out a case
and assembled it.
Demonstration of the web app
Demonstration of the whole process
The Website:
The input is transferred over my self written get function.
You can find the code for this function in the first Assessment.
The data is transferd to a Canvas element which splits in two halves.
Each Char of the String is converted to Binary
and then Bit for shift out.
At the beginning of each transmission both fields are flashing to initialize the
start form of a transmission.
At the end of each transmission the same happens.
The JS and HTML code for the transmission:
<html>
<head><title>Light TX</title></head>
<body>
<canvas id="canvas" width="500" height="500">
Your browser does not support HTML5 Canvas.
</canvas>
<script src="../js/js_get.js"></script>
<script type="text/javascript">
var C_width , C_height;
var _Bit_Array;
var TX_progress = 0;
var TX_speed = 50;
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
ctx.fillStyle="#000000";
canvas.width = document.body.clientWidth;
canvas.height = document.body.clientHeight;
convert();
function convert() {
var input = get("input");
var TX_Byte , TX_Byte_Buffer;
var TX_Byte_String = "";
for (i=0; i < input.length; i++) {
TX_Byte = input[i].charCodeAt(0).toString(2);
TX_Byte_Buffer = 8 - TX_Byte.length;
for (j=0; j < TX_Byte_Buffer; j++){
TX_Byte = '0' + TX_Byte;
}
TX_Byte_String += TX_Byte;
}
TX_Byte_String = '0' + TX_Byte_String ;
console.log("TX Byte String -> " + TX_Byte_String);
_Bit_Array = TX_Byte_String.split("");
ctx.fillRect(0, 0, canvas.width, canvas.height);
setTimeout(function(){
ctx.clearRect(0, 0, canvas.width, canvas.height);
setTimeout(function(){draw();}, 500);
}, 500);
}
function draw(){
ctx.clearRect(0, 0, canvas.width, canvas.height);
if(_Bit_Array[TX_progress] == '0'){
ctx.fillRect(canvas.width/2, 0, canvas.width/2, canvas.height);
ctx.stroke();
}
console.log("[" + _Bit_Array[TX_progress] + "] -> " + TX_progress + " von " + (_Bit_Array.length-1));
setTimeout(function(){
ctx.fillRect(0, 0, canvas.width, canvas.height);
if(TX_progress < _Bit_Array.length-1){
setTimeout(function(){draw();}, TX_speed);
}else{
TX_progress = 0;
ctx.clearRect(0, 0, canvas.width, canvas.height);
_Bit_Array = '';
setTimeout(function(){
ctx.fillRect(0, 0, canvas.width, canvas.height);
setTimeout(function(){location.href = `../index.html?callback=true`;}, 500);
}, 500);
}
TX_progress++;
}, TX_speed);
}
</script>
</body>
</html>
On the Microcontroller:
The Code on the controller reads the analog voltage from the photodiodes.
When this Voltage is above the threshold it`s interpreted as HIGH.
The code checks for the start transmission flashing and then shift Bit by Bit in.
Each Bit to a Byte when the Byte is full is send to the Computer over Serial.
I used the controller board that I create in the electronics design week.
The microcontroller on this board is a 32u4 chip, which supports full speed USB so
I dont need an FTDI cabel.
The code on the Controler :
int clockPin = A0;
int dataPin = A1;
int clockSensor = 0;
int dataSensor = 0;
boolean clockState = false;
boolean clockTick = true;
boolean dataState = false;
boolean TX_start = false;
char inputBuffer[8];
int inputBuffer_i = 0;
int threshold = 400;
int testH = 0;
int testL = 0;
boolean testH_bool = false;
boolean testL_bool = false;
boolean debug = true;
boolean debug1 = true;
boolean debug2 = true;
boolean debug3 = true;
unsigned long ready_time = 0;
void setup() {
Serial.begin(9600);
inputBuffer[0] = 0;
}
void loop() {
/*
Serial.print(analogRead(clockPin));
Serial.print(" - ");
Serial.println(analogRead(dataPin));
delay(100);
*/
clockSensor = analogRead(clockPin);
dataSensor = analogRead(dataPin);
if(clockSensor > threshold && dataSensor > threshold){
testH++;
delay(1);
if(testH > 100){
testH_bool = true;
//Serial.println("test H");
if(TX_start && debug1){
TX_Restet();
debug1 = false;
Serial.println("");
Serial.println("TX_stop");
}
}
}else{
testH = 0;
}
if(clockSensor < threshold && dataSensor < threshold && testH_bool){
testL++;
delay(1);
if(testL > 100){
testL_bool = true;
//Serial.println("test L");
}
}else{
testL = 0;
}
if(testH_bool && testL_bool && debug2)TX_start = true;
if(debug2 == false){
if(micros() - ready_time > 2000000){
Serial.println("ready");
TX_Restet();
debug2 = true;
}
}
if(TX_start){
if(debug)Serial.println("TX_start");
debug = false;
clockSensor = analogRead(clockPin);
//Serial.println(clockSensor);
if(clockSensor < threshold)clockState = true;
if(clockSensor > threshold)clockState = false;
if(clockState == true && clockTick == false){
clockTick = true;
delay(10);
dataSensor = analogRead(dataPin);
if(dataSensor < 400)dataState = true;
if(dataSensor > 400)dataState = false;
inputBuffer[inputBuffer_i] = dataState;
inputBuffer_i++;
//Serial.println(inputBuffer_i);
if(inputBuffer_i >= 8){
inputBuffer_i = 0;
/*
for(int i;i < 8;i++){
Serial.print(inputBuffer[i],DEC);
}
Serial.println("");
*/
int mask = 0x80;
char myVariable = 0;
for(int j = 0; j < 8; j++){
if(inputBuffer[j] == 1)myVariable |= mask;
mask = mask >> 1;
}
Serial.print(myVariable);
}
}else if (clockState == false){
clockTick = false;
}
}
}
void TX_Restet(){
TX_start = false;
clockState = false;
clockTick = true;
dataState = false;
inputBuffer_i = 0;
testH = 0;
testL = 0;
testH_bool = false;
testL_bool = false;
debug = true;
debug1 = true;
debug2 = false;
ready_time = micros();
}
When using the Code you may want to change the threshold...
Online Demo of the WebApp
I have written two versions.
Since I had problems with the scaling on different devices.
Mobile is better with a cell phone held vertically.
Responsive is better on a tablet or laptop.
It can cause epileptic seizures.
Downloads
This week, I've decided to build a servo.
I had a lot of setbacks to fix.
My first idea was to control a brushless motor with a commercial esc.
And track the motion with a light decoder.
That was my first approach:
I built a gear box with Makerbeams.
The top.
I used a laser cutter to cut out a decoder disk out of thin plastic with four shutters.
I wanted to evaluate it with a photoelectric module.
But that did not work out, I tried 5 different esc.
Esc extra developed for car models, helicopters esc with a backward function,
all of them had responses being too bad and too many security functions.
So I thought it would be easy to try DC.
I've recycled the engines from an old project of mine.
That once was an automatic cable cutting machine.
Then I chose a non-logarithmic potentiometer.
I simply attached it temporarily to the backside with hot glue.
Then connected the potentiometer to the motor.
Then I tried it with commercial controller, unfortunately I had only three to choose from.
But I had similar problems with long response times.
And changing from the forward gear to the reverse takes too long.
So I decided to build my own controller.
For this I have another old project of mine Recycled.
For this I stole a driver.
The drivers are L298n which are quite practical chips.
They have two full bridges included.
But I only used one full bridge.
My first idea was to transfer the pulse width via the Enabel pin, but I just decided to transfer the PWM via the input pins because it worked well.
I have connected one of the H-bridges of the chip as described in the picture with the supply voltage and the microcontroller.
I fed the PWM Signal via the output pins in the system.
L298 H-Bridge datasheet
Then I shot the engine at my "controller".
Then my next problem arise: The potentiometer broke down and I did not get a grip on making a good mechanical connection between the motor and the potentiometer.
Then I had no time and desire and have used Fischertechnik.
The potentiometer aws attached using a rubber band because potentiometers are very sensitive and if my control does not quite work that the motor does not destroy the potentiometer.
Then I connected my board and wrote the software.
I have implemented a very simple controller that has only a P quantity.
In the video, I turned the motor out of the rest position and the motor returned to the starting position.
Here I have tried the regulator,
to find out the effective direction.
I am not satisfied with the quality of my results.
Anyways, I learned a lot.
I was actually just to try out how hard it is to build a servo.
I came to the conclusion that it is possible, but that it depends on very good hardware on it.
I wrote a Chrome app.
This is pretty easy and you have many advantages. For example
the app runs platform independently on every system on which Chrome is installed.
And that's one of the biggest drawbacks as Chrome has to be installed all the time.
In order to build a Chrome app you have to turn on the developer mode under settings and to allow apps you can go to chrome://flags/ Just copy and paste into the url bar.
It can be started following the Chrome URl chrome://extensions/. You should see the following, on the right you can turn on the developer mode if this is active you can now load with the Button [Load unpacked extension] your app.
A Chrome APP is almost the same as a normal website except that it has a manifest.json.
This file defines the structure of the app.
It looks like this, for example:
{
"name": "Serial Arduino",
"version": "1.0",
"manifest_version": 2,
"minimum_chrome_version": "33",
"description": "Serial to Arduino",
"app": {
"background": {
"scripts": ["background.js"]
}
},
"icons": {
"128": "img/icon.png"
},
"permissions": [
"serial"
]
}
There are a few more special features:
- The index html is called main.html
- there is a background.js file that determines the window size of the app
Now if you have your app ready, you can integrate the unpacked extension as described above.
If everything went well, you should see something like that.
at chrome://apps/ you should now be able to see and start your app.
As a preparation for the machine week, I have written a program that simulates a 2D delta arm and calculates its values of the engine.
I built a small prototype out of Lego and Servos to test the functions of the program.
#include <Servo.h>
Servo motor1;
Servo motor2;
int incomingByte[10];
void setup() {
motor1.attach(9);
motor2.attach(10);
Serial.begin(115200);
}
int i,M1,M2,iii,dec;
bool first_last;
void loop(){
if (Serial.available() > 0) {
incomingByte[i] = Serial.read();
if(incomingByte[i] == 0x26 || incomingByte[i] == 0x21){
if(incomingByte[i] == 0x26)first_last = true, M1 = 0;
if(incomingByte[i] == 0x21)first_last = false, M2 = 0;
iii = i-1;
dec = 1;
for(int ii = 0;ii<i;ii++){
dec = 1;
for(int p = 0;p<iii;p++){
dec = dec * 10;
}
if(first_last == true)M1 = M1 + (incomingByte[ii]-48)* dec;
if(first_last == false)M2 = M2 + (incomingByte[ii]-48)* dec;
iii--;
}
motor1.write(M1);
motor2.write(M2);
i = 0;
}else{
i++;
}
}
}
That's the code on the Arduino.
It's a very simple byte input shifter, which uses & and a ! as a separator for end of line.
The test setup
As a test, I have drawn circles because you can adjust the proportions quite well. If the settings are wrong, the circle is oval.
Here you can see a live transfer from the mouse position to the pen.
Here's a test of how well straight lines can be drawn.
Download and examples
Sorry the demo is not responsive!
I tried this week to transfer data as chars via a Laiser beam.
First I tried it with the Wire Library that worked very well.
Then I decided to write my own protocol.
The protocol should be stable and easy to understand.
I took a laser diode from a sensor box and switched this high side.
I know that this is not the nicest way to do it...
As a sensor, I have taken a photodiode on an OPAMP, the module was actually titled as a flame sensor.
The nice thing about the module is, that it can call a stable Interupt.
As a first experimental setup, I glued the two modules in a glass tube.
The glass tube turned out to be bad because I wanted to interrupt the beam.
Then I switched to this test construction.
The protocol:
The basic idea is that the laser is always on but then gets interrupted for a fixed time.
The time between two pulses is measured and based on the time decisions are met.
There are four cases (times).
- LOW
- HIGH
- New character
- New line
New characters will be transmitted then followed by 8 bits (LOW/HIGH) from the character.
New Line is transmitted at the end of the line.
I've written for testing the RX and the TX part on the same controller.
You can find the complete code below.
In the loop () is the TX part in the interrupt function is the RX part.
boolean state = false;
boolean valid = false;
boolean new_ = false;
boolean newline = false;
unsigned long time_stop;
int pulse_time;
int time_pulse = 3;
int time_on = 10;
int time_off = 15;
int time_new = 20;
int time_newline = 25;
int time_diff = 2;
boolean RX_buffer[8];
char RX_char;
int buffer_counter;
//------TX------
const int message_len = 12;
char inputChar[message_len] = "Hello World!";
void setup() {
Serial.begin(9600);
pinMode(4, OUTPUT);
pinMode(2, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(2), stop_time, FALLING);
}
int x = 0;
void loop() {
digitalWrite(4, HIGH);
delay(time_new);
digitalWrite(4, LOW);
delay(time_pulse);
for ( uint8_t bitMask = 128; bitMask != 0; bitMask = bitMask >> 1 ) {
digitalWrite(4, HIGH);
if ( inputChar[x] & bitMask ) {
delay(time_on);
} else {
delay(time_off);
}
digitalWrite(4, LOW);
delay(time_pulse);
}
x++;
if(x > message_len){
x=0;
digitalWrite(4, HIGH);
delay(time_newline);
digitalWrite(4, LOW);
delay(time_pulse);
}
}
void stop_time(){
pulse_time = millis() - time_stop;
if(pulse_time > time_diff){
valid = false;
new_ = false;
newline = false;
if(pulse_time <= time_on + time_diff && pulse_time >= time_on - time_diff)state = true, valid = true;
if(pulse_time <= time_off + time_diff && pulse_time >= time_off - time_diff)state = false, valid = true;
if(pulse_time <= time_new + time_diff && pulse_time >= time_new - time_diff)new_ = true;
if(pulse_time <= time_newline + time_diff && pulse_time >= time_newline - time_diff)newline = true;
if(valid){
if(buffer_counter > 8)buffer_counter = 0;
RX_buffer[buffer_counter] = state;
buffer_counter++;
}
if(new_){
RX_char = 0;
for(int i = 0; i<8;i++){
RX_char |= RX_buffer[7-i] << i;
}
Serial.print(RX_char);
buffer_counter = 0;
}
if(newline){
Serial.println("");
}
}
time_stop = millis();
}
My first success was that I send a new character and then a test array with values.
In the test you can see how the command for a new character is send and then the character is transferred and represented as Binary and as ASCII.
Here you can see the finished transmission with all four commands.
During the transmission I interrupted the beam several times.
The damaged character will still be displayed.
To prevent this, a check sum could be added at this point.
In this test, I have tested that the maximum speed of this is very slow, the slowest link is the receiver because it filters too much through the OPAMP and has a too high capacity.
Here I have tested the sensitivity to light, if I shine on it with a bright flashlight, the communication extinguishes.
Here I have packed the TX part on one controller and the RX part on another.
I then distributed the two controllers in the room at a distance of about 3m.
In the video you can see how I send with my board (green) to the board of Lukas (copper Coloring).
Download:
I started writing a simulation program in interface and application programming week to better understand the mechanick.
(interface and application programming week)
This week, I also built the first prototype from Lego.
I then designed a second prototype of stepper motors.
This little difference was very important for the whole project.
I built the first prototype from servos.
Servos are very easy to control compared to steppers.
Because they have an absolute size you do not need a homing routine.
Another advantage of servos is that they proceed asynchronously to the program execution.
This means that the controller once describes the OCR1A and OCR1B registers to set the PWM and the servo moves asynchronously to the further program run to the set angle.
This allows the controller to receive the next value without waiting for the servo.
This is much more difficult with stepping because it blocks the program during its working time.
The test setup
As a test, I have drawn circles because you can adjust the proportions quite well. If the settings are wrong, the circle is oval.
Here you can see a live transfer from the mouse position to the pen.
Here's a test of how well straight lines can be drawn.
This is the second prototype, the elements are connected with M4 screws.
The design has the weakness that it can quickly builds mirrored together and thus greatly restricts the freedom of movement.
It is important that you build it exactly like in the picture.
The assembled second prototype.
Download and examples
Sorry the demo is not responsive!
The whole project was a group project, these were my records:
- Construction of the moving arm
- to wire the electronic components
- to write the software
The finished construction
I started with the construction of the arm but I used 3D printing parts, this took some time for the printing to be finished.
So my documentation starts with the wiring to keep the documentation chronological to the build-up process.
At the beginning of the wiring, I put all cables from the step motor to the controler.
In the same workstep, I connected the step motor.
When connecting a stepper motor, simply measure the resistances of the windings with an ohmmeter and connect the corresponding parres to a port of the drive.
When I had all cables on the back side together,
I then soldered on a prototyping shield for an UNO.
This was done to change the controller at any time.
To provide power to the system I added those connections.
I don't know how this connector is called in English, but in German we called it "Bananenstecker" (Banana connector).
The wiring from the Motor drivers.
The Arm is build from things that I had laying around in my garage.
The rod is an old push rod from a model helicopter.
Really lightweight and the material was made of an Aluminum lithium alloy, I guess.
The diameter of the rod is 10,85mm.
The bearings are normal DIN bearings, the small one is 8x22 and the big one is 20x32.
the white connectors are clamped down to the the rod with M3 screws.
the bearings are pressed fit in the 3d printed part, the rod is pressed fit and glued in with super glue.
In the pen holder the pen is clamped in.
The red part is screwed in the under white part and clamped the rotating part from the bearing.
The bearing is pressed fit in the upper white part, also the rod is glued in.
I have made three models in Fusion 360, first the connector from the motor rod to the arm, secondly the hinge between the two rods from the Arm and then the pen holder with the front hinge.
The front hinge and pen holder
The front hinge and pen holder consist of three parts, the actual pen holder, the upper bearing holder and the under base in which the pen holder is screwed in.
the pen holder
bearing holder
the base of the pen holder
connector from the motor rod to the arm
the clamping with two pair of screws and nuts
the middle hinge
hinge body
the front part of the hinge
The Software is really bad and not optimized for the given problem.
It wasn`t enough time to make it better.
The big problem at this software conclusion is, that it is written for Servos and not for Steppers.
I took the old software that I wrote in the Interface and Application week and used this with new Arduino code on the machine side.
My old software calculates the angles of the Motors to a given coordinate and streams the tow angles continuously.
The software doesn't wait for the Machine to reach the given angle.
With the servos, it was no big deal because the servos run asynchronous to the controller.
To set the stepper in position, the controller must do that actively and can not receive serial data at the same time.
So you have to synchronize the machine with the software.
You can change the time in the host software for the streaming interval or you can speed up the steppers so they can reach the given angel faster.
But when the timing is bad, the machine jerks.
And this is not good.
The Problem can be solved, if the machine tells the host Software when a command is finished.
The Code for the host programm can be found here: Week 12
The Arduino Code:
#define M1_DIR 4
#define M1_PUL 5
#define M1_ENA 3
#define M1_LIM 9
#define M2_DIR 7
#define M2_PUL 8
#define M2_ENA 6
#define M2_LIM 10
#define ON_PULSE 1
#define OFF_PULSE 5
#define OFF_PULSE_HOMING 600
#define STEPP_REV 50000
float one_deg = (STEPP_REV / 2) / 180.00;
int incomingByte[10];
void setup() {
Serial.begin(115200);
pinMode(M1_DIR, OUTPUT);
pinMode(M1_PUL, OUTPUT);
pinMode(M1_ENA, OUTPUT);
pinMode(M2_DIR, OUTPUT);
pinMode(M2_PUL, OUTPUT);
pinMode(M2_ENA, OUTPUT);
pinMode(M1_LIM, INPUT);
pinMode(M2_LIM, INPUT);
pinMode(11, OUTPUT);
}
int M1_stepp = 0;
int M2_stepp = 0;
long i,x,M1,M2,iii,dec,M1_stepp_diff,M2_stepp_diff;
bool first_last;
float M1_F,M2_F;
void loop(){
if (Serial.available() > 0) {
incomingByte[i] = Serial.read();
if(incomingByte[i] != 36){
if(incomingByte[i] == 0x26 || incomingByte[i] == 0x21){
if(incomingByte[i] == 0x26)first_last = true, M1 = 0;
if(incomingByte[i] == 0x21)first_last = false, M2 = 0;
iii = i-1;
dec = 1;
for(int ii = 0;ii<i;ii++){
dec = 1;
for(int p = 0;p<iii;p++){
dec = dec * 10;
}
if(first_last == true)M1 = M1 + (incomingByte[ii]-48)* dec;
if(first_last == false)M2 = M2 + (incomingByte[ii]-48)* dec;
iii--;
}
M1_F = (float)M2 / 1000.00;
M2_F = (float)M1 / 1000.00;
if(x >= 1){
float M1_stepp_diff_F = (M1_F * one_deg) - (float)M1_stepp;
M1_stepp_diff = M1_stepp_diff_F;
float M2_stepp_diff_F = (M2_F * one_deg) - (float)M2_stepp;
M2_stepp_diff = M2_stepp_diff_F;
Serial.print(M1_stepp_diff);
Serial.print(" - ");
Serial.println(M2_stepp_diff);
x = -1;
digitalWrite(11,HIGH);
moveStepper(M1_stepp_diff,M2_stepp_diff);
digitalWrite(11,LOW);
}
x++;
i = 0;
}else{
i++;
}
}else{
Serial.println("Homing");
homing();
}
}
}
int moveStepper(int M1_diff, int M2_diff){
boolean DIR_M1 = true;
boolean DIR_M2 = true;
if(M1_diff < 0)DIR_M1 = false , M1_diff = M1_diff * (-1);
if(M2_diff < 0)DIR_M2 = false , M2_diff = M2_diff * (-1);
digitalWrite(M1_DIR,DIR_M1);
digitalWrite(M2_DIR,DIR_M2);
int biggest_diff;
if(M1_diff >= M2_diff)biggest_diff = M1_diff;
if(M2_diff >= M1_diff)biggest_diff = M2_diff;
boolean dubbelSpeed = true;
boolean M1_Move = true;
boolean M2_Move = true;
for(int i = 0;i < biggest_diff;i++){
if(M1_diff >= i){
makeStepp(1,dubbelSpeed,false);
if(DIR_M1 == true)M1_stepp++;
if(DIR_M1 == false)M1_stepp--;
}else{
M1_Move = false;
}
if(M2_diff >= i){
makeStepp(2,dubbelSpeed,false);
if(DIR_M2 == true)M2_stepp++;
if(DIR_M2 == false)M2_stepp--;
}else{
M2_Move = false;
}
if(M1_Move == false || M2_Move == false)dubbelSpeed = false;
}
}
int makeStepp(int Motor, boolean dubbelSpeed, boolean homing){
int Stepp_OFF_PULSE = OFF_PULSE;
if(dubbelSpeed)Stepp_OFF_PULSE = Stepp_OFF_PULSE / 2;
if(homing)Stepp_OFF_PULSE = OFF_PULSE_HOMING;
if(Motor == 1)digitalWrite(M1_PUL,HIGH);
if(Motor == 2)digitalWrite(M2_PUL,HIGH);
delayMicroseconds(ON_PULSE);
if(Motor == 1)digitalWrite(M1_PUL,LOW);
if(Motor == 2)digitalWrite(M2_PUL,LOW);
delayMicroseconds(Stepp_OFF_PULSE);
}
void homing(){
boolean HomingMotor = true;
int i;
while(i < 2){
if(HomingMotor){
digitalWrite(M1_DIR,HIGH);
digitalWrite(M2_ENA,HIGH);
while(1){
makeStepp(1,false,true);
if(digitalRead(M1_LIM))break;
}
delay(200);
digitalWrite(M1_DIR,LOW);
while(1){
makeStepp(1,false,true);
if(digitalRead(M1_LIM) == false)break;
}
delay(200);
for(int i = 0; i <= STEPP_REV / 4;i++){
makeStepp(1,false,true);
}
M1_stepp = STEPP_REV / 4;
delay(1000);
digitalWrite(M2_ENA,LOW);
delay(1000);
HomingMotor = false;
}else{
digitalWrite(M2_DIR,LOW);
while(1){
makeStepp(2,false,true);
if(digitalRead(M2_LIM))break;
}
delay(200);
digitalWrite(M2_DIR,HIGH);
while(1){
makeStepp(2,false,true);
if(digitalRead(M2_LIM) == false)break;
}
M2_stepp = 0;
delay(200);
moveStepper((STEPP_REV / 8),(STEPP_REV / 8));
}
i++;
}
}
This week I've written a program that uses a pixel based image to create a vector graphic that consists of one common path.
The program then creates an SVG file that you can then download.
I would like to present a to create cool art using machines.
You could give the vector file to a drawbot, laser cutter, cnc mill, plotter, cnc embroidery machine and and ...
And create art!
With this program, I can establish a new production process in the field of image presentation in my laboratory.
Use my Live Editor to upload your own pictures.
I thought up the algorithm myself, it is very simple and probably already implemented by others in this form.
Basically, there are three main steps:
1. Convert image to gray value (0..255) and save it in a matrix.
2. Translate the new matrix to the middle point and go in a sin () / cos () function (spiral) out, while mapping to the other matrix and give the gray value as a deviation to the circle function.
3. Meanwhile, write the generated coordinates into a path function of a svg file.
The first thing I did was creating a matrix in JS, I think you can do that very well with the array constructor.
var pixels = new Array(can_width);
for(var i = 0;i < pixels.length;i++){
pixels[i] = new Array(can_height);
}
In this matrix I have then stored the gray values of the input image.
for (var i = 0, n = pix.length; i < n; i += 4) {
r = pix[i ];
g = pix[i+1];
b = pix[i+2];
gray = (r+g+b)/3;
pix[i ] = gray;
pix[i+1] = gray;
pix[i+2] = gray;
x_pixel = (i % (can_width * 4)) / 4;
pixels[x_pixel][y_pixel] = gray;
if(x_pixel == can_width -1)y_pixel++;
}
Then I went out in a spiral from the center of the picture to the outside and added the gray value as a deviation to the circle function.
At the same time, I saved the coordinates in order to export them later as SVG.
for(var i=0;i<(2*Math.PI)*rot;i+=int){
var x = (Math.sin(i)*(can_center_width/rot))*(i/(2*Math.PI));
var y = (Math.cos(i)*(can_center_height/rot))*(i/(2*Math.PI));
var x_img = can_center_width + (precisionRound(x, 0));
var y_img = can_center_height + (precisionRound(y, 0));
var line_Width = precisionRound((max - (scr_pixels[x_img][y_img] / 255) * max) + min ,2);
if(toggel == true){
toggel = false;
}else{
toggel = true;
line_Width = line_Width * (-1);
}
x = (Math.sin(i)*(can_center_width/rot))*(i/(2*Math.PI) + line_Width);
y = (Math.cos(i)*(can_center_height/rot))*(i/(2*Math.PI) + line_Width);
ctx.beginPath();
ctx.moveTo(x_old,y_old);
ctx.lineTo(x,y);
ctx.stroke();
var svgM_x = can_center_width + x_old;
var svgM_y = can_center_height + y_old;
var svgL_x = can_center_width + x;
var svgL_y = can_center_height + y;
if(!isNaN(svgM_x) && !isNaN(svgM_y))svg += `M${svgM_x} ${svgM_y} `;
if(!isNaN(svgL_x) && !isNaN(svgL_y))svg += `L${svgL_x} ${svgL_y} `;
x_old = x;
y_old = y;
}
When saving the SVG I had a small problem, because the data sizes were bigger than the encoder Blob Size, so I had to create an ObjectURL to encode the data over them.
saveData(svg, 'drawing.svg');
var saveData = (function () {
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
return function (data, fileName) {
var blob = new Blob([data], {type: "octet/stream"}),
url = window.URL.createObjectURL(blob);
a.href = url;
a.download = fileName;
a.click();
window.URL.revokeObjectURL(url);
};
}());
Pictures that were created while programming:
I use an cnc embroidery machine to stick my drawing that I created with my program.
To convert my svg in the format from the machine, I tried different online svg to embroidery file solutions.
Sadly, no program was able to convert my files, simply because they are too big.
As already mentioned, the web encoder Blob size is exceeded.
So I used SewArt, because I could not find any other freeware anymore.
To Sew Art, there is nothing to say on how it works, as it is simple and self-explanatory.
And unfortunately absolutely not suitable for my particular motive.
Anyways, it is the only program that takes my file.
The problem is that SewArt doen't take the SVG path, instead SewArt pixel rises the SVG and uses a nearest Neighbor Algorithm to find the path and this is crap.
In regards to that, I still took the file and tried it but it did not suffer the desired effect.
I then wanted to create the stick path myself and have decompiled a few files.
Additionaly, I found some interesting stuff on Github.
Link here:
libpes
In the future, if I have time I will deal with it more precisely.
But now this is my result.
I can not say much about the sticking process itself, it was very straightforward and you just have to do what's on the screen.
That's why I will not describe that.
More intereseting is to find out the other settings to optimize and increase the quality of the stick process.
But I did not do that, so I can not write anything about that either.
The embroidery took 87 minutes.
This week I answer the basic questions about my final project.
What will it do?
The FabLabManager is an organizing server-platform where users can be registered, set to statuses and given permissions. Moreover the FabLabManager is connected to several machines of the FabLab and - depending on the permissions of the user - starts given jobs.
Who's done what beforehand?
Fab manager provides an open source platform and custom made support services for fab labs and similar spaces.
Fabman simplifies all your day-to-day tasks, takes care of billing and payments and lets users book machines and rooms—so you can focus more on your community and growing your business.
What will you design?
There will be a basic server structure to cover all of the previous mentioned functionalities.
Additionally, I will implement two modules: One for the physical access control of doors, closets etc. and the other for a facebook bot. The facebook bot will inform about the current status of opening and also about contact information of collaborateurs.
What materials and components will be used?
Software
The software will be implemented in Node.js for server-side and C++ (arduino code) for client-side.
Physical access control module
The access controle module is made of 3D-printed parts and acryl laser-cutted parts for the casing.
The electronics are based on the ESP8266-12F and for the voltage regulation I used an LM to provide regulated power to the ESP.
Where will the materials come from?
All parts are manifactured and shipped from China.
How much will they cost?
The software part will be free due to the service of heroko, where you can host projects and have zero cost at runtime.
The 3D printed parts cost 45ct.
The laser cut part under 20ct.
The ESP8266 will cost 4,00€ on amazon with prime. Without prime, it would be cheaper to order it directly from China.
The electronic parts for the voltage regulation cost round about 30ct.
The PCB will cost under 50ct.
The whole modul will cost round about 4,14€.
What processes will be used?
(1) Software engineering in Node.js/C++
(2) 3D-Modelling in Autodesk Fusion 360
(3) 2D-Modelling in Inkscape
(4) 3D-Printing
(5) Laser Cutting and Engraving
(6) Electronics Design
(7) PCB Milling
(8) Soldering
What questions need to be answered?
Will it ease the work of participants at FabLabs?
Will the integration process be successful?
Will it optimize the workflow?
Will ot improve the clarity of organization processes?
Will it economize on cost, time and energy?
How will it be evaluated?
About how positive the previous questions will be answered.
My entire work is licensed under the CC license.
I chose the license because I consider it the fairest.
Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.
NonCommercial — You may not use the material for commercial purposes.
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
This is an overview of how the individual combinations are called.
what is the deadline? How much time do I have left?
The deadline is on 01.07.2018.
Not much.😂
what tasks have been completed, and what tasks remain?
The basic tasks are done.
I still have to fix the documentation.
how will I complete the remaining tasks in time?
There are many different techniques of how to time yourself and to work on your work.
You can find some technick on this site 10 Timeless Time Management Techniques
But I'm not the type of person that would be significantly faster with something like that.
My "time management" technique was that I start with the problematic parts.
This was in this case the board and the server callbacks.
If this did not work, I would have to redesign the whole project.
I also had the most problems there.
I then just systematically processed these.
During the whole project, I kept the work open as much as possible, so that I had a linear progress.
I'm used to other projects when a lot of work must be done that I work several days without sleeping.
In order to have a high productivity I need varied work.
So I've split the soft and hard-ware that I can always do a bit of all.
This is my personal way of organizing projects.😂
Evaluate project plan
In my opinion, I have fulfilled the core points of my plan.
That would be the callbacks on the server and the Facebook bot.
In the future i will continue my project and develop it further.
Summarise and communicate the essence of a project
The project went quite well.
I had little time but was able to estimate the workload and had a linear progress throughout the project.
Beforehand I had considered many alternatives to do the project.
But did not have to deviate significantly from my original plan.
The essence of the project was to develop and think for a system that helps Fablabs to grow larger.
So that they can do good public relations.
Without wasting resources to be exploited or broke.
I see that in my lab where I work.
Once a week we have an evening where everyone can come and use everything.
These are the most beautiful evenings the whole lab is full of people sharing the same interests.
But some people take advantage of the offer or do not know with raw materials to go.
With my system, I am trying to find a way to keep a non-commercial organization as free as possible and to limit the scope for wastefulness and exploitation.
what has worked?
It has all worked out what to see in the final video.
what hasn't?
Many things did not work.
At the beginning I would like to control 3D printers with commercial wifi sockets that can measure the consumer current.
I have completely reverse engineert and the characteristics the measuring amplifier of the shunt and linearized it.
I was also able to program the microcontroller on the socket.
But then came to the problem that I could not access the WIFI periphery of the chip.
That cost me a lot of time...
Due to this setback, my motivation was not so good to write a good backend, I started with one but this was not finished.
what have you learned?
I learned a lot.
I had the opportunity to try a lot of new things and did a lot of things I would not have done.
My idea is to develop a system that monitors and mangers the lab.
Similar systems are already commercially available but they have the
disadvantage that they are usually not modular enough to meet the respective requirements.
Moreover, they are very expensive, so many small labs cannot afford one of a kind.
My self-imposed demands on the system are as follows:
- low budget
- modular
- open source Software and Hardware
- easy to extend
- little to no cost in maintenance
- producable using common Fablab tools
For any 3D printer, laser cutter and cabinet door there is a device that is connected via WLAN.
It manages the respective accesses to the target devices.
Every user gets a personal RFID card or a code.
With these, the user can identify him-/herself in front of the respective device.
All accesses are managed by a central server that grants access rights or withdraws them.
In addition, all uses are logged.
There will be a currency system where users will get a certain sum every month.
Printing or cutting for example costs a certain sum per hour.
If a user runs out of money, he will not be able to use paid services the rest of the month.
Fab manager provides an open source platform and custom made support services for fab labs and similar spaces.
Fabman simplifies all your day-to-day tasks, takes care of billing and payments and lets users book machines and rooms—so you can focus more on your community and growing your business.
The team of a laboratory is implementing it.
And the visitors of the laboratory use it.
1. Create a website in which the whole project can grow even beyond the Fabacademy.
2. Implement the first four aspects:
1# Server structure in this user, machines, permissions can be created and managed.
2# Access control to physical access (door, cupboard, drawer).
3# Unlock machines (3D printer).
4# A Facebook messenger Bot that is informing about the opening status of the lab.
Software Part
I would host the server at heroku.
I have had good experiences with this service provider.
Besides, this one is free with only very small restrictions.
The restrictions are that the server, if not used, goes in a hibernate state and then needs 5 seconds to start up again.
This has never bothered me, so far it takes a long time before it goes to the hibernate state anyways.
As a language I will use JS Node.
I like JS and JS Node is sate of the art right now so I'll use it.
I will communicate via a rest interface and use asynchronoun callbacks, maybe I will use it in selected cases Promises.
As a database, I will use PostgreSQL it is not quite up to date but I like it quite well.
PostgreSQL is SQL based and very fast.
This makes them super easy and fast and you can use them with basic knowledge.
Hardware Part
As the heart of my device, I use an ESP8266.
Its advantages are that it is very fast, has an arm architecktur, is cheap, easy to procurement and easy to program.
And the important thing is that it has Wi-Fi, via Wi-Fi I will be communicating with my server.
You can get the chipset in two versions: As a surface mount and as a through hole. I took the SMD versions, because those have nearly the same cost and have a lot more pins on the outside.
The clients authenticate themselves in front of my devices with an RFID card.
There are finished modules that I will use, so everyone can simply rebuild my devices.
I have looked at two modules closer, once the well-known MFRC 522 board which operates in a frequency range of 13.56 MHz and the RDM6300 module which works at 125kHz.
Both have advantages and disadvantages.
The RDM6300 board is stable, because of its low frequency and it has a wider range, but it is slower and you can only use cards that are read only.
The cards are a bit cheaper than the 13.56MHz cards.
Unfortunately, the module is not very common, so the procurement is more difficult and the cost difference between the cards is not very high, so I decided to use the MFRC 522 board.
MFRC522
RDM6300
I built that:
The part with the door
I hold an RFID token in front of the sensor.
The MFRC522 reads the unique ID of the token and sends it over the network connection to the server.
The server checks if the user has the authority if he has this the esp opens the door.
The part with the Facebook Messenger Bot
When I put the token on the sensor, this reads out the unique ID and sends it to the server if the user has the authorization, he switches the state from the laboratory and sends a get call to the Facebook Messenger bot which sends a push message to all users who have subscribed to the event.
The event can be subscribed in the bot by asking for the status or for the opening times.
Write with my BOT 😃
At first I had to design the circuit diagram, which was done using Eagle. The board
is used to program an ESP 826 chip. The second task of the board is providing energy for the chip to work. This has been done using a linear voltage regulator, called LM833. To provide the other circuit with a power of 5 V, LM850 is used.
Now I began working on the layout of the board. The components had to be distributed in a useful way.
On this picture it can be seen how the parts are placed on the board.
The next step was to build a polygon around the circuit. This line of polygons is used to determine where the outer lines are, which later have to be cut off. Furthermore, this line represents the boundary for the Rastnest.
Along the last step, I now had to route the board.
This is the final board with the Rastnest
On this picture, it can be seen that the last step to complete the procedure wasn`t done properly. To get rid of this problem, I had to manually cut the board out.
This picture serves as an illustration of the process mentioned above.
Notably the board was cut out rough.
Speaking of rough edges, I now had to polish the edges of the board respectively.
Namely this is the fully cut out and polished board.
Additionally, the board had to be roughen to ensure that there is no major dirt on it.
After the last step was completed, I could start soldering. Therefore the power module was soldered on. After soldering, the power module was tested to ensure that it is working accurately.
Fruther, the chip had to be soldered on.
Making sure that the soldering in the last step went well, I had to test it. Unfortunately, it didn`t work as expected, so I began searching my mistake using a microscope. The picture shows that one of those contact points is connected to ground.
Respectively, this is the fully stocked board.
For the application in my door I now had to add a relay, which shifts the electricity to close or open the lock.
As a matter of fact, I had to glue the board on the door for it to be in place.
The two pictures above show the locks which are used to close and open the door. There is one mounted on the top and on on the bottom of the doorframe.
This is the button to open the door from the inside.
This is the RFID card reader in it`s 3D printed housing.
In Fusion 360 I was drawing the enclosure for the electronics.
Visicat was used to cut out the pieces with the laser cutter.
From the outside, you can unlock the door if the lock is not closed using this button.
This is the draw from the inside with the cover installed.
This is how the door looks from the outside with the green light symboling that the door is closed.
This is a closer look at the door, when the lock is closed.
This is the door when it`s not locked, ready to open it.
Again, this is the door from the inside.
To open it, simply hold the RFID chip in front of the red enclosure.
Now the terminal for the facebook bot had to be built.
In addition to that, this is the electronic used for the facebook bot.
A closer look at the inside of the terminal.
To install the bot go to the facebook developer page and add a new app.
choose something that fits best
create a page subscription callback
add the tokens to heroku
create the database
create your page access token in Facebook and add it to heroku
now add the token to heroku
choose your page and verify it with the callback
The software part will be free due to the service of heroko, where you can host projects and have zero cost at runtime.
The 3D printed parts cost 45ct.
The laser cut part under 20ct.
The ESP8266 will cost 4,00€ on amazon with prime. Without prime, it would be cheaper to order it directly from China.
The electronic parts for the voltage regulation cost round about 30ct.
The PCB will cost under 50ct.
The whole modul will cost round about 4,14€.
(1) Software engineering in Node.js/C++
(2) 3D-Modelling in Autodesk Fusion 360
(3) 2D-Modelling in Inkscape
(4) 3D-Printing
(5) Laser Cutting and Engraving
(6) Electronics Design
(7) PCB Milling
(8) Soldering
The Final Project and all others are under this license:
Dieses Werk ist lizenziert unter einer Creative Commons Namensnennung - Nicht-kommerziell - Weitergabe unter gleichen Bedingungen 4.0 International Lizenz.
The part with the door
I hold an RFID token in front of the sensor.
The MFRC522 reads the unique ID of the token and sends it over the network connection to the server.
The server checks if the user has the authority if he has this the esp opens the door.
The part with the Facebook Messenger Bot
When I put the token on the sensor, this reads out the unique ID and sends it to the server if the user has the authorization, he switches the state from the laboratory and sends a get call to the Facebook Messenger bot which sends a push message to all users who have subscribed to the event.
The event can be subscribed in the bot by asking for the status or for the opening times.
Write with my BOT 😃