Posts

How does an Italian cafetiere works and how can I use it?

Image
So, how does an Italian cafetiere work? Well the water in the water container is heated until near ebullition, increasing the volume and pushing the very hot water up  the funnel. At the end of the funnel the first filter will help spreading the water trough the coffee holder, where the water will be emerged with the coffee powder creating the coffee liquid. Now the water will keep pushing from the water container and pressing the coffee liquid trough a second filter that prevents the coffee powder from coming out with the coffee. The schematics of all of this can be seen in this image:  How can I use this to make my alarm clock with a coffee maker? Well, the theory is that all the parts to make this kind of cafetiere are easily available. Now, by adding a weight sensor to make sure that there is water in the water holder before activating the heating plate and some isolation elements to make sure the heating doesn't burn the rest of the components it shouldn't be supe...

C weird behaviour

Not really weird but interesting. The fact is, when we declare a function in C we can use "..." in the arguments to be able to get any number of any type of variable. In fact it is used in printf() and scanf(), and this gives bird to some interesting behaviour, for instance the code: int main()    {    int a,b;    printf("\nEnter two integers numbers:\n",&a,&b);    scanf("%d %d");    printf("%d %d\n",a,b);    return 0;    } will print something like: Enter two integers numbers: 1 2 1 2 but how does scanf() knows I want to get those number at a and b? Those the printf() tells it to? I mean, I did sent the addresses of a and b to the printf() function so maybe it can tell the scanf() about it, right? Well, wrong, the truth is much simpler. The way a function in C works is by first transferring the values of the arguments into a special memory place and then jumps in to the function code itself. So first ...

The struggle continue

Image
So, while I was making schematics for the possible coffee machine I noticed that I don't have the necessary tool to machine the necessary parts here. As so the idea of buying a second hand coffee machine and work from there gets stronger. The thing is... I'm short on cash right now. So yeh... anyway I'm going to leave here a couple of schematics.The first one is here: In this one a water pump pulls water from the reservoir a push it trough a heated pipe to the coffee holder. I like this one because of the relative low pressure, on the other hand the coffee won't be as strong. Then there is this one: In this one a water pump pulls some water from the main reservoir to a smaller reservoir, then the water is heater until almost ebullition and pressured trough the coffee holder ending in a nice cup of espresso coffee! Now, the objective of this project is to create an alarm clock that can wake me up with a nice cup of coffee, not a face full of steam so I ...

The planning continue!

So, yesterday I spoke about the possibility of creating my own alarm clock coffee maker. Well, after some careful planing (not really) I advanced the idea a bit further! First and for most, what platform will I use? I have and Arduino duemilanove and a Raspberry Pi 2B and of this two I believe the Raspberry Pi would be somewhat of a over kill, it already as a internal clock, which would make that part easy, but it also have lot's of stuff that is unnecessary. I could also use the Raspberry Pi to let me manage my alarm clock trough the internet but on the other hand I really don't want a 12 year old russian hacker to control my coffee maker. So the Arduino should get this one! Now, we need to figure out 2 thinks, first what kind of coffee we want and second how to turn a Arduino in to alarm clock that can control a coffee machine. So, to make coffee I will need a water reservoir and a way to heat the water to make the coffee. Now, this is where the coffee type is important, sin...

New think about project!

Today I was speaking with a friend of mine about mornings when she said something like "I need a coffee before I can make my morning coffee!". This made me think if could I make a coffee machine with a alarm clock that would made a coffee when it ringed? Well, this shouldn't be hard, the simplest way would be to wire a micro controller or mini computer to the coffee machine buttons so as when the time comes it will produce a coffee. But this have a major flaw, I would have to connect to the micro controller every time I would which to change the alarm time. Not very practical! So a better option needs to be found. I could try to wire a alarm clock so instead of ringing I would send a signal to the micro controller and the micro controller would control the coffee machine. Simple enough, easily to control but, a Frankenstein of a monster! What if a build the coffee machine with all I want it self? From what I understand of coffee machines first some water is pull from the ...

Playing with C

Since I was introduced to programming I have been fascinated by the small trick that can improve a program. Some of them are related with shortening the size others are related to improve the speed of the program. In C the for loops are usually used to interact trough vectors, it's made to be easily readable on that function. For example, when we want to use a for loop to run we normally would write something like: int i; for( i = 0 ; i < MaxNumber ; i++)    {       something();    } this will set the variable i to zero and after that enter in a loop. This loop will start by checking if i is less than MaxNumber , if it is it will do what is inside the brackets (in this case is just the something() function), if it isn't it will break out of the circle and by the end of the cycle increase the value of i by one. This seems pretty strait forward and effective, but by writing it as: int i; for(i = MaxNumber ; i-- ; )     { ...

First

Hello! I decided to create this blog to publish some of the stuff I think about. Mainly stuff related to C programming. Not sure how often I will be posting but we will see!