Hard learning curve

For a software engineer like me, mostly working in a web-context and according environment it’s kinda hard to grasp all the concepts behind the whole “Arduino-thing”. Ok, I’ve done some C/C++ in my time, but having to cope with bootloaders and all the hardware stuff like which pin goes where and how to calculate resistance for component X are way out of my default comfort zone. Since I’ve found some purpose for a Raspberry Pi, I started to look around for some smart home cases, I could actually use. Imagine: In my house there aren’t that many things to “smart up”… no gas or oil heating, no solar panels and therfore a lot less to automate. So let’s start small: Monitor the in-house temperature and humidity, especially in the old vaulted cellar where I’ll store the turtles for winter. Maybe the outside temperature, too - and since I use up a lot of energy with electrical floor heating and a instantaneous water heater, I’d like to monitor at least the overall energy consumption in the house.

The project idea stands

So, basically we’ll do as follows:

  • Monitor indoor temp
  • Monitor vaulted cellar temp and humidity
  • Monitor outside temp
  • Read the analog electric meter

Challenges:

  • Build an openHAB 2 instance on RPi with ansible
  • Add influx DB as storage
  • Visualize the values with Grafana
  • Learn Arduino
  • Try to use 2.4GHz transceivers for submitting data via MQTT to the RPi

Ho to start

First, I ordered loads of stuff, I found on mysensors for building my own sensors - I like soldering :-D The idea of not having to buy vendor-locked stuff and to be able to have more influence on the details of my hardware and infrastructure, was too intriguing to let go. So I decideded to stick with mysensors and accept the harder learning curve that comes with “doing it all by yourself”.

Pitfalls

If you’ve never used a breadboard or even the whole power supply stuff before, like me, you’d have a lot to read. That’s what I did and even finding useful pinmaps for the different boards (arduino pro mini and nano e.g.) is no fun. Also the tutorials and sketches on mysensors are far from perfect. There’s a lot of reading their forums, too. Best advice I can give is: Don’t give up, use google and ask around. Another big question mark is: How to plan the infrastructure? There’s not much information on how to plan such a thing correctly and what components need to be integrated - how do they communicate? I’ll add a few sketches and Ideas in my next post.

Arduino programmers

Before you can start programming arduinos, you have to decide on which way you want to start. I bought a FTDI programmer (serial), which does not interfere with the bootloader and therefore is considered “more safe” to use. But I also ordererd an ISP programmer (uspasp), which is more versatile. The third option you have is to use an arduino nano or UNO and flash a programmer image.

My current setup looks like this:

This is a “programming platform” where I connect an ISP programmer to a board with two sockets, one for pro mini and one for nano, so I’m able to flash either without having to find the pinmaps and using loads of jumper cables. For debugging reasons (pro mini only), I use the FTDI programmer as a serial monitor. And don’t forget the arduino IDE ;-) That’s about all you need to start.

automationarduinoOpenHAB