Maybe the best advent calendar 2017

Hello together.

The advent season started now and what shouldn’t be missing? Exactly, an advent calendar. Usually kids get this calendar, filled with sweets and candies. But sometimes also the big ones :-)
This year I got also confronted with the subject ‘advent calendar’. The basic idea was to make a advent calendar. Fast the ambition came fast ‘If I make a advent calendar already, then the right way’. :-D

So, what exactly is or is needed for an advent calendar. 24 ‘doors’ of course. The best is some bags or boxes, to put all the small, sweet surprises in for the 24 days till xmas. But what, how, why?
The decision was quickly made that it should be a house. A wooden frame, for the boxes, which looks like a house.
Great, a good plan so far.

And everybody knows about the bad boys and girls, which can’t wait for the day to come. This has to be prohibit! :-D And then I am just on a ‘diy lamp’ trip… so the house has to have a lot of lights.
So far the rough plan. 

The final plan was made after a few detailed thoughts:
Every box will get a window (a house has windows, isn’t it), which lighted by an LED. To prevent the cheating, the calendar need to know which date it is and which box is removed. (I don’t need to mention that there is an arduino in the game. ;-) ). To be able to do that, every box need a ‘switch’, which is checking if the box is in the shelf or not. If someone removed the wrong box (a box from a date in the future), an alarm will be set off. However, if the box is pulled out of today, then a Christmas carol should be played.
Of course the house has to be a chimney with smoke… it is winter and people are heating. And of course the smoke has to be illuminated too.
And then we need a display, to show the current date (just in case the person is not really awake in the morning and don’t know the current date). 

And since we already put so much light in the house, then should be also install some gadgets, that the calendar can also be used as light/lamp. For example, I came up with the idea to illuminate the windows randomly. Just like in a real house … here is a light on and there is a light on. And then sometimes one goes on or off here and there. The imitation of a real house, so to speak.
(If I had known what will get into … I would have thought again !! :-))

And off we went with the crafting.

First, the house had to be built. The boxes are 6.5cm x 6.5cm. In order to leave a little space, I made the openings for the boxes 7x7cm. 7cm deep, however, is not very much. This would certainly overturn the house constantly. So I extended the depth to 20cm and got a bit ‘storage space’ for slightly larger surprises. I needed a partition anyway to accommodate the wiring for the switches.
In between, I also had to solder the LEDs. For this I drilled a hole in the wood in each shelf, for the SK6811. They are round and fit exactly in a 10mm hole. The nice thing about the SK6811 is that they are ‘smart’ and only need one pin on the Arduino. You always pass on the signal to the next LED. Thus, I always needed only 3 cables, from LED to LED. And not from every LED 3 cable to the Arduino. That is very convenient.
The LEDs then fixed with hot glue and that was done.
Then the roof ridge. Here I had to cut the two windows into the wood and saw out the opening for the display. Glued in front of the window openings then the ‘window paper’ and glued the display in the opening.
And install 3 more LEDs in the chimney and fix it to the house roof.

Most tricky was the subject with the box-switches. To accomplish this, I had to cut 28 slots into the partition to sink the cables there. But only to the extent that they are just in there. (24 data lines + 1x ground per row) I had the great idea to simply take self-adhesive copper foil. Seemed easiest to me. 2 strips under the box (1x data line, 1x ground) and another strip under the box. So this would close the circle once it’s in the drawer. Unfortunately, it didn’t worked out always. A little unevenness, a small curvature in the bottom of the cardboard box … and there is no contact. So I had to put half the strips on the cardboard box with a little bit of soldering tin, so that the contact – more or less sure – was made.
Definitely it was a pretty fumble. But at some point it was done.

What was missing were the RTC (Real Time Clock, so that the Arduino knows what day it is and also rememberes when the power is gone), a receiver for the remote control (yes! Remote control for the Advent calendar! ;-) How should one otherwise switch through the light modes?) And the buzzer for the Christmas carol or the alarm.
I soldered the buzzer and the RTC to an Arduino Mega Prototyping Shield. There was already a DHT22 sensor (temperature and humidity) on it. … Well, if he’s already there, then it can be used. So the calendar also shows the temperature and humidity on the display. Why not? :-)
The receiver LED for the remote control I have installed behind the windows in the roof. So it is not visible from outside. But you have to do a bit of ‘aiming’.
In addition, I have installed a photodiode. Actually, I wanted the advent calendar to light up by itself when it gets dark. I later discarded that.

And then it was time for programming. Afterwards everything seems very logical and simple. But when you start, it’s not like that at all. You start and you always have some stumbling blocks in your way. Such as an Adruino only handles single-thread. Mostly that is not so tragic. But if you want to play a song and in the same time want to turn lights on and off, then that’s not possible.

But after many hours it was finally time. The good piece was finished … more or less.

And here is the whole thing in action:

And some more pictures

What is needed:

  • Arduino Mega 2560
  • RTC
  • Buzzer
  • SK6811 LED
  • Boxes
  • Remote control + receiver
  • Photodiode
  • Tools and wood
  • Cotton

Winter greetings
Gordon

What am I doing with Arduino and Raspberry Pi?

Hello.

My Facebook disciple know more already then my beloved blog reader. A few days ago I posted the following pictures in Facebook:

The description was:

Da bomb is in da house… and working quite fine :)
What is that, beside of a beautiful piece of art of colored wires and electric stuff.
Of course it is not exploding :) It is a small stand-alone measuring station. It contains:
1x Arduino Pro Mini -> The micro controller which is processing all the data
1x Power supply -> No cool e-stuff without a bit electricity
2x Photo resistor -> to measure the amount of light around (of course, both give different values… ^^)
1x DHT11 -> Measures temperature and humidity
1x DHT22 -> Measures temperature and humidity as well… the newer model of the DHT11
1x LM35 -> Measures temperature… I fucked it when I mistaken plus and minus :( It is still sending values… but useless ones.
1x MQ-2 -> Measures the amount of smoke/lpg/co gas in the air.
1x 1.8” TFT with SD card -> To display the values and it is also writing all data in a log file on a sd card for later processing.
So far… will be continued…  :)

So… why do I play around with it?

An Arduino is a micro controller. Actually a micro controller on a board with some more stuff, to make it easier to work with it for the people. It got invented from Massimo Banzi and David Cuartielles (and named after a pub… yeah yeah :) ). David Mellis developed the programming language for it. The whole system is open source. That means everybody can see the sources, how it works. That’s why there are also copies of the original Arduino available and even you could solder your own one. It’s a quite easy way to get in touch with the micro controller stuff.
But lets have a look to another kind. As I mentioned in the headline already, there is also a ‘Raspberry Pi’.

The Raspberry Pi is similar to Arduino, but also different. The Raspberry Pi is more a micro computer then a controller. He consist a 700MHz ARM processor (the same CPU architecture as in mobile phones), 512MB RAM, etc. As operating system is usually Linux installed. Here is one big difference, the Raspberry Pi have a operating system, the Arduino doesn’t.

So, what does it mean now?

Both boards have GPIO pins. That are connectors on which we can connect sensors and such sttuff. One sensor is for example the DHT22… a sensor which is measuring the temperature and humidity. I can connect this sensor now to the Arduino and the Raspberry Pi. A small program written and it will show me the values of the sensor.

So, one board is enough!?

In general yes. But it is always a question of what we want to do.
With the Raspberry Pi the possibilities are much bigger, because we can make a lot more with the board as just reading sensor values. We have much more storage available. We can install software and have even a GUI (graphic user interface). We can write emails, texts, we can program and much more. Its a full computer, just a bit limited in its resources. But therefore it consumes more electricity.

I mean ‘consuming more electricity’ is relative here. 3.5 Watt is usually not worth a word! But if you want to create (for example) a stand alone weather which have a battery as power supply, then is 3.5 watt a very bad consumption and the weather station will not even run 1 day. Here is a solution needed which is running with as less power as possible. And here comes the Arduino in the game. That is his strength. Doing a job (like reading sensor values) and consume almost no electricity.

Why do I get in touch with this strange stuff?

Don’t worry, I didn’t went to become a bomb builder;) (Hello NSA… and again a match with a keyword… congratulation! ;) )
Well, some know that I have a new project in my head. I want to travel around with a camper. To do so, I need to take my work with me. That means internet and electricity in the camper. But power will be very limited and my current computer have a consumption of approx 200 watt. So, this one is out of the game. I need a more battery-saving alternative is needed. Then I ‘met’ the Raspberry Pi. It was clear that this small computer can not replace a working station, but it can be used to do at least some of the job. 3.5 watt is a good number for a 24h server. Even 3.5 * 24 is also 84 watt per day – in the theory – but I hope in praxis it will be a bit less, as the RPi is slowing down in times of not usage. I just testing it with a 10.400 mAh battery.

ArduinoBut I guess the RPi will be quite busy with all the task I have in mind for it :) As following:

  • NAS with external SSD
  • Local web server for development
  • Automatic connection control system for internet sources (Sat-DSL, WLAN, GPRS, etc.)
  • Desktop for internet, watching movies, programming, etc.
  • Central data processing unit for decentralized Arduinos with their sensors (weather sation (somewhere outside), camera modul in the front of the camper, motor sensor, gas sensro, etc.)

The are the rough tasks which the poor little guy needs to do.

I also need to note that I am testing the little PRi already and I need to mention that I am absolutely positive surprised. The little guy is not that weak as I thought. (Always with the consumption of 3.5 watt in mind… CPU without cooling!). The GUI is running properly. Also movies running with VLC. Icedove (the Linux version of Mozilla Thunderbird) needs a few more seconds, until its loading my several thousand emails. But then its ready for use. LibreOffice (like MS Office) the same. There are even games for the Raspberry Pi. I tried Mindcraft for a while and it is running smoothly.
As I said, with the hardware in mind, is this little computer a technical marvel.

And the Arduino joint my ‘tool box’ when my play instinct got activated. :) This stuff is so awesome for me now, that I can’t stop playing with it :) Real addiction factor! When you made your first circuit, the first script is written and transferred to the Arduino and the LED really starts to blink… then you feel a bit like god… ‘This LED is blinking now because I wanted it!’ :D
And then further… measuring temperatures, lighting up LEDs, reading light intensity (is it night, how strong is the sun shining, etc.), reading GPS coordinates and showing on a map, flame sensor (is it burning?), noise sensor, displays to show information, … and much more. The possibilities are almost endless. With a bit of creativitiy is it possible to make some really cool projects.

And in MY endless creativity (*cough*) I have the following projects in mind (in the camper).

      • Weather station with sensor for temperatur, humidity, air pressure, light intensitiy, Geiger-Müller tube, GPS, etc.
      • Camera module in front of the camper, which is making a picture every hour and is uploading it when internet connection is online)
      • Gas sensor at the gas bottles, in the kitchen and at the heating. Also gas sensor for the gas which the thieves like to use.
      • Connction to the engine electronic. For example to read the error buffer of the engine computer. Its not with every car possible… will see.

I think to remove the doorhandles and use instead a key card / fingerprint reader to open the doors. Instead of a key. The would confuse some thieves. ;)

 

Of all this data I want to make my own little black-box. But primarily I want to store this data in a database and put it online that everybody (who is interested) can see the data. (GPS data for security reasons with a time delay, of course ;) ) But that is all still up in the air. At the moment I still play around with both boards and try to build some stable systems. To test and get experience with it.

So, if you want to have a look at the micro controller world, then check out Arduino and / or the Raspberry Pi. I can highly recommend both systems. Is fun like hell and not hard to learn at all.

Best wishes
Gordon