1-Wire home automation tutorial from linux.conf.au 2019, part 3

This is the third in a set of posts about the home automation tutorial from linux.conf.au 2019. You should probably read part 1 and part 2 before this post. In the end Alistair decided that my home automation shield was defective, which is the cause of the errors from the past post. So I am instead running with the prototype shield that he handed me when I started helping with the tutorial preparation. That shield has some other bugs (misalignments of holes mainly), but is functional apart from that. I have also decided that I'm not super excited by hassos, and just want to run the orangepi with the OWFS to MQTT gateway into my existing home assistant setup if possible, so I am going to focus on getting that bare component working for now. To that end, the gateway can be found at https://github.com/InfernoEmbedded/OWFS-MQTT-Bridge, and is a perl script named ha-daemon.pl. I needed to install some dependancies, which in my case were for armbian: $ apt-get install perl libanyevent-perl cpanminus libdist-zilla-perl libfile-slurp-perl libdatetime-format-strptime-perl $ dzil listdeps | cpanm --sudo Then I needed to write a configuration file and put it at ha.toml in the same directory as the daemon.…

Continue Reading1-Wire home automation tutorial from linux.conf.au 2019, part 3

1-Wire home automation tutorial from linux.conf.au 2019, part 2

For the actual on-the-day work, delegates were handed a link to these instructions in github. If you're playing along at home, you should probably readĀ 1-Wire home automation tutorial from linux.conf.au 2019, part 1 before attempting the work described here. Its especially important that you know the IP address of your board for example. Relay tweaks The instructions are pretty self explanatory, although I did get confused about where to connect the relay as I couldn't find PC8 in my 40 pin header diagrams. That's because the shields for the tutorial have a separate header which is a bit more convenient: I was also a bit confused when the relay didn't work initially, but that turns out because I'd misunderstood the wiring. The relay needs to be powered from the 3.3v pin on the 40 pin header, as there is a PCB error which puts 5v on the pins labelled as 3.3v on the GPIO header. I ended up with jumper wires which looked like this: 1-Wire issues Following on the tutorial instructions worked well from then on until I tried to get 1-Wire setup. The owfs2mqtt bridge plugin was logging this: 2019-04-08 19:23:55.075: /opt/OWFS-MQTT-Bridge/lib/Daemon/OneWire.pm:148:Daemon::logError(): Connection to owserver failed: Can't connect…

Continue Reading1-Wire home automation tutorial from linux.conf.au 2019, part 2

1-Wire home automation tutorial from linux.conf.au 2019, part 1

I didn't get much of a chance to work through the home automation tutorial at linux.conf.au 2019 because I ended up helping others in the room get their Orange Pi is booting. Now that things have settled down after the conference, I've had a chance to actually do some of the tutorial myself. These are my notes so I can remember what I did later... Pre-tutorial setup You need to do the pre-tutorial setup first. I use Ubuntu, which means its important that I use 18.10 or greater so that st-link is packaged. Apart from that the instructions as written just worked. You also need to download the image for the SD card, which was provided on the day at the conference. The URL for that isĀ from github. Download that image, decompress it, and then flash it to an SD card using something like Balena Etcher. The tutorial used 32gb SD cards, but the image will fit on something smaller than that. hassos also doesn't put anything on the Orange Pi HDMI port when it boots, so your machine is going to look like it didn't boot. That's expected. For the tutorial we provided a mapping from board number (mac…

Continue Reading1-Wire home automation tutorial from linux.conf.au 2019, part 1

Thermostat (or, its happening again)

  • Post author:
  • Post category:Arduino

This is just a quick post at the moment because the project isn't done and I am distracted by other things... The thermostat for the central heater in my house became unreliable a week or two ago. My wife rang around and a new one from the manufacturer of the heater was going to be $450 AUD. So, it seemed obvious to make my own. I've just installed the 1.0 of it, with the board layout and manufacture being done by Doug once again. Other people seem to lack a PCB manufacturing back neighbour. I highly recommend you acquire one if possible.

Continue ReadingThermostat (or, its happening again)

Building a hygrometer with a HS1101

  • Post author:
  • Post category:Arduino

The next sensor I wanted to add to my home was a set of hygrometers. Specifically I wanted an exterior one, and a matching interior one. This would be useful as we have evaporative cooling, and if the humidity level outside is already high, then it doesn't make a lot of sense to put extra water into the air. Worse than that, it can also damage my books and make the house really clammy. So, adding some sensors was the first step in some form of alerting. I picked up two HS1101s from ebay quite cheaply (about $4 each IIRC). These devices are capacitors whose capacitance varies proportionally with relative humidity. You also need to provide a temperature at the sensor to correct the value, although the correction is pretty minor so I guess you could skip this if you really wanted to cut costs. Given I have plenty of code for Dallas 1820s now, I just dropped one of those onto the board too. I just used the circuit from the data sheet for my design, with a few simple tweaks (like the DS1820). Here's my surprisingly unprofessional circuit diagram: The DS1820 stuff that's not on the data sheet…

Continue ReadingBuilding a hygrometer with a HS1101

The Beer Fridge saga continues

  • Post author:
  • Post category:Arduino

Since the last update on the beer fridge, we've had to do some murdering of the original PCB to get it to fit in a case. In addition, we'd failed to take into account the startup power draw for the compressor (5 amps), and had to upgrade the relay we're using from a 3 amp solid state relay. Luckily Doug had the beefier relay just sitting around in his shed. That means we've lost our opto-isolation because the new relay is a simple mechanical one, but we have a relay coil doing the same thing now. A new PCB will make the world a lot neater, which will be nice. Oh, we've also been mentioned on Hack a Day, which has generated some interesting comments on their site. I've observed that sometimes the relay doesn't turn on, even though the arduino thinks it has done so. An example can be seen here: (Note that graph is a Google chart server image, generated by a simple visualization program I wrote in python. If you're that way inclined, the visualization software is in my public SVN repository). At first we thought this was a software problem with comparing ints to floats, but…

Continue ReadingThe Beer Fridge saga continues

Beer fridge controller 0.3

  • Post author:
  • Post category:Arduino

Last night Doug made up the first cut of the PCB for the beer fridge controller mentioned in previous posts, and we fitted the arduino to it. There wasn't much in the way of software changes, apart from changing the pin that the compressor runs on. You can see here that we've mounted both the arduino and the Ethernet shield onto the PCB -- this is just temporary until we get the PCB right. The black rectangle at the front right is a 240 volt capable relay, and the thing behind it is a 240 volt transformer which is capable of powering all the electronics on the boards. In the final PCB we wont need the arduino at all -- just the Ethernet shield and the atmega 328 from the arduino. However, that didn't work out this time around because of problems getting the Ethernet socket to fit nicely. Its clearer on this picture of the other side of the board: See how we had to cut a hole in the PCB for the socket? That took out some of the pin holes for the atmega, and a few tracks. Its not a big problem because we're going to iterate…

Continue ReadingBeer fridge controller 0.3

Beer fridge controller 0.2

  • Post author:
  • Post category:Arduino

Further to yesterday's post about the beer fridge thermostat replacement, I've been hacking on ethernet support for the controller. This is handy because I'd like to log the temperature and compressor state over the network, because I'm hoping that can be used to make calculations about the thermal mass of the contents of the fridge, and therefore derive how much beer is actually in the fridge at any given time. Because the controller also supports more than one temperature probe, I'll also add more 1-Wire temperature sensors around the house so I can determine important things like if its hot in the outside world. The code is currently experiencing some bloat in the binary size, mainly because the ethernet library and the sprintf implementation are quite large. I'll have to think more about that. Here's the current code: #include <enc28j60.h> #include <etherShield.h> #include <ip_arp_udp_tcp.h> #include <ip_config.h> #include <net.h> #include <websrv_help_functions.h> #include <OneWire.h> #include <DallasTemperature.h> // Temperature sensor and compressor setup #define COMPRESSOR 9 #define ONEWIRE 3 #define HIGHTEMP 4 #define LOWTEMP 3.6 // 220L Kelvinator is 85 watts #define COMPRESSOR_WATTAGE 85.0 #define SLEEP_SEC 10 OneWire oneWire(ONEWIRE); DallasTemperature sensors(&oneWire); unsigned long runtime = 0, chilltime = 0, last_checked = 0, this_check…

Continue ReadingBeer fridge controller 0.2

Beer fridge controller 0.1

  • Post author:
  • Post category:Arduino

On the weekend I picked up a 220 liter beer fridge for $20. Its in really good condition (ignoring some minor rust in the freezer section), and the only real problem with it is that the thermostat doesn't work leaving the compressor on the whole time. Doug suggested that instead of just buying a new thermostat, we should build an arduino fridge controller. I'm not really a hardware guy, but once Doug had pointed me at the Dallas 1820 1-Wire temperature sensor, and lent me some resistors, it was pretty easy to pull the software side together. Note that this version doesn't actually do any of the compressor control -- it simulates that by turning a LED on. The compressor stuff has been delegated to Doug and will be mentioned later. You can see that the circuit is in fact really simple. There is a LED to simulate the compressor (with a resistor), and then the 1-Wire temperature sensor (with another resistor). The code is pretty simple too. Here's my latest fancy version: #include <OneWire.h> #include <DallasTemperature.h> #define COMPRESSOR 13 #define ONEWIRE 2 #define HIGHTEMP 4 #define LOWTEMP 3 #define SLEEP_SEC 10 // 220L Kelvinator is 85 watts #define COMPRESSOR_WATTAGE…

Continue ReadingBeer fridge controller 0.1

End of content

No more pages to load