Saturday, February 18, 2017

Burglars invited

I am playing around with Thingspeak. Its a real nice IOT platform with loads of possibillities. I will delve in the setup and use in a future story but something urged me to publish this first.





Thingspeak is an IOT service to which you can send information from an ESP-8266 for example and have it published on a website that is publically accessible. For me it is ideal for testing purposes. The service takes the data I send to it, and puts it on a chart. This makes it possible for me to examine information from my home systems even when I am at work or abroad.

I made a simple thermometer setup using an ESP and a Dallas DS18B20 which sends my man-cave temperature to Thingspeak.




So I was monitoring the temperature in my work-room when I suddenly noticed something. Look at the graph above and try to see what I saw.



As you can see the temperature was dropping overnight until between 10.10 and 10.30 when the temperature had sharp risen.



At 11.40 hour the temperature started falling again.


And as you can see at around 16.40 the temperature started rising again. Neat huh ???

There goes the privacy

So when I got home from work and we sat at dinner I said to my girlfriend: 
" Hey you woke up late today. And I saw that you went out at about half past twelve and came back at around half past five."

First she was flabbergasted and then mad. It was a serious breach of her privacy.

But how did I know ??

Well easy. My girlfriend is kind of ECO aware. So at night she turns down the heating. When she wakes she turns it on and when she leaves the house turns it off again and naturally turns it on again when she gets back.

Well the temperature chart told me when she woke, left the house and entered it again.

Actually no harm done. And I promised her I would dismantle the system.

But it got me thinking.

So I looked again at the settings of Thingspeak. Next to your data you can display a chart with the location of the measurements !!!


So I made this test and indeed it displayed the location I filled in next to my temperature chart. Wow.

And rest assured I am not living below sea-level I deliberately gave false coordinates.

A bit of searching on Thingspeak showed me several channels where people actually displayed data publically next to their location like the picture above shows.





Look at the chart above. It is an actual public channel I found on Thingspeak.
I guess the guy leaves it home at about 7 o'clock (that's when the temperature starts dropping) and returns at around 20.00 hour because at that time temperature start rising again.

And be aware of this: the displayed map is a Google map so you can zoom in until you are at street level !!!


Naturally the displayed data is just data from a bit more as 24 hour. However someone with false intentions might come back everyday to have a look at the chart and see a pattern..........
 

Burglars invited !!!

So please be carefull on what information you make PUBLICALLY available on IOT platforms. If it is private information make sure you checked the private checkbox in Thingspeak. And do not blame Thingspeak for any privacy breaches the users have inflicted on theirselves.

In a future story I will delve deeper into Thingspeak as the service is easy to use, full of possibillities and very usefull.

Till next time
Be carefull but have fun

Luc Volders

Wednesday, February 1, 2017

Urban Farming and Technology


On saturday 18 february there will be a festival in Rotterdam. The festival is called Ergroeit. Roughly translated as "There grows"

This is the 5th time this anual festival is organised around Urban Farming in Rotterdam the Netherlands.





And it is organised by "Eetbaar Rotterdam" which means as much as Edible Rotterdam.

Part of the festival is a cross-over section. Where technology meets farming. The intention is to show how technology can be used by hobbyist and aid in Urban Farming.

And that is where I come in.
I have been asked to give a lecture/demonstration on how to build sensors that can aid in Urban Gardening.






I start with a bit of history about computers and how it evolved to the ESP-8266 chip that we as hobbyist can use to make all kind of sensors that can send information over wifi to your phone so you can monitor processes from where ever you are.

The sensors I am going to demonstrate are:
- Rain sensor
- Temperature sensor
- Moisture sensor that activates a waterpump.

Here is a link to the website where you will find the complete festival program and a list of all lectures (mine is on the 6th place).
http://www.eetbaarrotterdam.nl/ergroeit-2017-workshopoverzicht-programma/

So no high-tech project this time.
But next time.....
Till then
Have fun.

Luc Volders

Sunday, January 15, 2017

PIR Basics - Movement detection


A PIR is what we normally call a movement detection sensor. You can find it in all kinds of security devices but also in the lamp that switches automatically on when you approach it. The official name is Passive Infra-Red sensor.

I ordered some PIR's from a chinese supplier just for testing purposes and maybe some fun projects. And I have this vague idea to incorporate it in my domotics system.

So before I start serious work with it I needed to test it to see how a PIR functions.










The above picture shows you first the actual sensor. But this is not how we see it. The sensor is incapsulated in a plastic lens. A so called fresnel lens. This is the familiar white bulb you can see in the first picture in this story. This plastic white bulb has, as you can see, several sections. These are designed in such a way that the sensor will get information from a very wide angle and range.

In reality there are 2 infra-red detectors (within the same sensor) placed next to each other. Placed in front of it is the lens. The two infra red sensors get the same information but when something in a room moves one sensor gets different information than the other one and that triggers the PIR.

The PIR has 3 connections Ground, VCC and Signal. It is recommended that tthe power supply does not exceed 6 volts. Your specifications might vary however. If there is no information available I suggest to hold on to this golden rule.

The PIR operates at 5 Volts. This is fine for Arduino projects but makes it a bit more difficult in ESP8266 projects. Naturally I tried to operate the PIR at 3 volts and you can really forget it. It just will not work.

First tests.

First lets look on how the PIR will be connected.

Well actually there are a few models PIR out in the wild and it seems that they have different connections.




If you look at the image above you can see that in my particular case the VCC is on the left connection, the SIGNAL in the middle (I isolated it with some tape) and the GND on the right connection. But please examine your PIR closely to see if your connections are likewise.

I have seen designs on which VCC and GND were exchanged and I even have seen a version on which the SIGNAL lead was on the left connection (seems to be the Parallax brand version). So please check your PIR closely.

Fortunately the PIR has a safety diode which prevents harmfull connections. Off course: CHECK yours might be different.

And there is an extra option for the really adventurous amongst us.





The PIR has an on-board voltage regulator of 3 volts.
So any of you feeling lucky you may surpass that controller and feed it with 3 Volts. This will make experimenting with an ESP8266 easier, however I am not advocating this and will not go into details about this. Do this on your own risk.

Take it slowly.

My first impression was that the PIR was not working. I could not get a meaningfull read-out.

What I did was to attach te PIR to a battery setup and used my Multimeter to read the signal. And all I got was gibberish.

Well in the end it occurred to me that the PIR has to settle first before you will get meaningfull results. And that settling takes with my version about a minute.
So when you Power up your PIR you'll have to wait a minute before you will get meaningfull results.

Sensitivity

Next step is to set the sensitivity.

The PIR has 2 potentiometers which you need to tweak for finding your optimum settings.

Looking at the top side of the PIR the right potmeter adjusts sensitivity, and the left potmeter duration. Again: this might be different with your version so test it.



Look at my settings. The right potmeter is turned to it atmost left position. This gives the highest sensitivity. This means that the PIR will detect movenment from a few centimeters away to a few meters.

You will have to determine that exact maximum distance in you particular case as it may vary. The specs I have found on the internet stated that the maximum distance can be as much as 6 meter. However do not take my word for it and experiment.

The left potmeter determines how long the SIGNAL line will be in the HIGH state when movement has been detected and how long it will be off.

As you can see I have turned it to the atmost right position.
When movement is detected the Signal will go HIGH for about 6 seconds, and then it will turn off again for about 6 seconds and then looks for movement again.
If the person in the room keeps moving the SIGNAL will remain HIGH and only gets LOW when no movement is detected again.

Simple setup.

In it's most simple form a setup for testing can be as the next breadboard setup and schematics show you.










Unfortunately I have not found a Fritzing part for just 3xAA batteries so I had to use the 4xAA version. But as you can see from my setup I just used 3AA batteries which supply about 4.5 Volts which is enough for the PIR to work.

As you can see I printed my own battery case. The connectors were made from paperclips just as described in this story (click here).

Those that want to print their own battery case can find the STL files in my Github repositry by clicking here.

So what happens is as follows.
As soon as the PIR notice some movement the led lights up ans stays on for about 6 seconds. After that, if no mevement is detected, the led goes out and satys out for another 6 seconds after which it will look for movement again.
If movement is detected and the person keeps moving the led stays on.

What can we do with it.

The easiest step is to attach a relay to the PIR and connect a lamp. This way the lamp will go on as soon as movement is detected. A very easy setup that can be bought in many DIY stores as a burglar alarm or just a device to make it easy to find your keyhole in the dark.

Another example is attaching the PIR to a photocam. Place the setup at a bird (fill in: deer, wild boar etc) feeding place to make pictures at the right moment.
Attach a PIR with a relay to your garden sprinkler installation to scare the shit out off cats/kids/mailmen trespassing your garden.

And by attaching the PIR to an ESP82566 a whole lot of projects come to mind. For example a burglar alarm which sends notice to your phone, or a mailbox alarm which notifies you if you got mail. And off course the obvious domotics application that turns on the lights in a room but only when it is dark AND a peron is in the room.

Just use your imagination.

In a follow up story I will be discussing the attachment of a PIR to an ESP8266.

Till then: Have fun

Luc Volders

Sunday, January 1, 2017

Happy 2017



The card says: A Good Year 2017
And so I hope it will be for all of us: Happy new Year.

This is my girlfriend and my new years card we send to all our friends and relatives. I will briefly tell you how I made it.



First I searched a suitable image of a bottle on the internet. I manipulated it in The Gimp (GNU Image Manipulation Program) to make sure that the background was uniformly white and that the bottle outline was totally black.

Next I converted it to an SVG image using this link: http://image.online-convert.com/convert-to-svg



When I had the SVG image ready I imported it into 123D

Now I had the basic 3D object I scaled it to the right dimensions and made it 1mm thick.


I saved it as an STL file, imported that in my Repetier printer software, sliced it and then printed many copies.


All in all just a few hours work from which printing in different colors took the most time.
And we had a real unique New years Card.

Till next time
have fun

Luc Volders

Thursday, December 15, 2016

Making custom keys / switches

My girlfriends son visits us regularly. We enjoy the visits and what makes it even more fun is that he is a tinkerer just like me. We really had some great fun playing with Oobleck and we made an infinity mirror in a table for his home.

This time he told me he was looking at making a Midi-controller. As we discussed the project talking about the hardware (Arduino) he told me that he was looking for special keys for the controller. He did not want the normal hard keys. He wanted the kind of soft keys most remote controls have. And he wanted keys in different shapes. As he had searched the internet he had not yet found anything to his liking.

My proposal was to make custom keys with Oogoo. Oogoo is a mix of silicon caulk and corn startch like I described in the story you can read by clicking here.

He thought it was a great idea because Oogoo had the right feel for the keys he was looking for. But how to make custom keys with it. Well we would need to make a kind of mold. Easy said. And yes indeed equally easily done. This is a perfect job for a 3D printer.



So I started designing a simple square key in 123D-Design.

123D-Design is just like Tinkercad another great free program from Autodesk. Tinkercad is web-based. 123D-Design is a program you download in your computer. All the designs you make with it can be stored on your computer or (like Tinkercad) on the web. 123D-Design has several advantages over Tinkercad. It is faster, as it is not internet dependend, and it has some really nice features that Tinkercad misses. 123D-Design has a bit more steep learning curve for first time users. Therefore I advise to start with Tinkercad until you know all the basics of 3D designing and then switch over to 123D-Design.

When I had finished the prototype key and downloaded the STL-files I set my Beagle 3D printer to work,In the mean time I started to work at the contra-part for the mold. I enlarged the key part a bit and left the base for what it was. I enlarged the key with 2 mm on all four sides. That way they actual key would get walls which would be 2mm thick.





Then drew a solid box. I rotated the key 180 degrees and put it on top of the box but so that the key was positioned in the box and the base on top. Then I subtracted they key from the box and that's all there is to it. The counter part for my mold was ready.






So in about an hour time I had designed AND printed my first prototype.

We mixed up some silicon-caulk and corn-starch until we had a nice thick paste and put it in the molds counterpart and then we pushed the keypart in.



If you look at it it looks like something edible, but believe me it is not !!!!
As it was a nice day, one of the first warm spring days, we took our girlfriends out for a walk and let the Oogoo set.

We were just afraid that we would not get the Oogoo key out of the mold. Maybe it would stick to it and tear apart if we were going to get it out.

But everything went even better as expected. The Oogoo key came niceley loose from the mold without any effort.





And the result is perfect. It is not yet the perfect key we were looking for but it is an ideal prototype. We know we are on the right path.






It even gets better as the Oogoo is transparant. Therefore it not only possible to put a switch beneath it but we can also put a led beneath it. That way we can give the key an extra dimension. All colours give the key that nice extra finishing touch.





A few days after his visit I started experimenting further. And indeed it is possible to make all kinds of shapes for the keys. As the example demonstrates I can make round keys.




I even filled a box with Oogoo to see if that would work and yes I got a nice bar out of it.

What does this demonstrate.

It is obvious that Oogoo is a versatile material and suitable to make keys with for all kinds of projects. But this also demonstrates that it is really easy to design molds, print them in PLA and use them and re-use them. The Oogoo comes out of the mold easily and without damages.

I bet I even can make stamps and badges with Oogoo and someone suggested making anti vibration feet for a 3D printer. So go on, make your own christmass decorations or use your imagination and make ........

Have fun
Till next time

Luc Volders

Thursday, December 1, 2016

Check Check and Doublecheck !!!

One of my projects was nicely coming along. In reality it was just a stupid project being a portable thermometer using an ESP8266 that displays the temperature on a web-page. So nothing special. The breadboard version worked like a charm to I transferred it to some stripboard. And then disaster struck.

It just did not work. The dreaded blue smoke materialised and my ESP was fried !!! Damn what happened ???

So I checked my stripboard soldering over and over and I just couldn't find a fault. There was only one thing left to do: check the power supply.


 
My intention was getting power from a USB power source be it from a computer or a power bank.
For that reason I use cheap USB power cables from the dollar store. I cut the cable and strip the wires.




The wires are colored just like they need to be: Black for ground, Red for VCC Green and White for the USB data channels.




I hooked up a mulimeter and it looked allright. 4.9 volts is great. But hey look at that closely. It does not say 4.9 volt !!! It says - 4.9 volt.



So I took out my trusted polarity checker (find the sory on that by CLICKING HERE) and hooked it up. Black to Black and Red to Red. And then it was obvious. The red light was on. Polarity was reversed !!!!


And then I switched the power leads: Red on Black and Black on Red and there it was: the blue led went on: everyting. ok.

So there you have it: the color of the power leads from the USB cable were reversed. The GND was on the RED cable and the VCC on the black cable !!!! Some idiot in the factory switched the colors of the cable. Everything on the connector side was ok, just the colors of the cable had been switched.

So before you hook anything up:, NEVER TAKE ANYTHING FOR GRANTED and CHECK !!!! Check !!!! CHECK and DOUBLECHECK !!!

This is the first time I say in my web-log: this was no fun at all.

Till next time.

Luc Volders

P.S. Check and Doublecheck !!!

Sunday, November 13, 2016

Bubble level

At my job collegues use this bubble leveler. They had some spares and dropped them on my desk. They know I am a tinkerer and am always interested in all kinds of technical stuf.




This leveler is however small and I immediately had (as always) some wild (weird) ideas. For realising them I needed a larger leveler. So I started thinking on how I could make one myself. The general idea behind it is after all dead simple.






So my first stop (and only one) was at a DIY depot. There I found some clear plastic foodsafe tube. The outer diameter was 10mm and the inner diameter 8mm. So it was a thick tube with thin walls and therefore just what I needed.




I cut about 9 cm of the tube. Then I closed one side of the tube with my glue gun. Then I waited till the glue cooled down.


Next step was to fill the tube with water. I did not fill it totally as I obviously wanted a bubble. Then I  closed the other side with my glue gun.



And presto. It was done.

However the tube was not straight. As you can see it was bended. Now that is not really usefull for a bubble leveler.


To the rescue comes my faithfull Beagle 3D printer. So I printed a frame for it. Now it functioned it just like I wanted it to do.

So it works. But now what.

Well I have some ideas for projects for this. But to make it really usefull the contrast between the bubble and the water is not big enough. So I started experimenting with ink in stead of water. Well that was no success as the ink dried and I ended up with a tube with solid black walls.



So then I used syrup. A real dark syrup and that worked like a charm.

Just make sure that you test in a long term that the fluid you are using will not dry out and you'll have a cheap bubble-level.

Any of you have a clue on what I am going to make with this..........Hint: movement detection.

Till next time.
And have fun.

Luc