OutoSoft

Odd Software for Odd Jobs

Grotto Time, part 4

The sensor data upload to this website now seems to be running quite smoothly - the 'clock' uploads its data every minute or so, and the page auto-refreshes every 30s.

http://outosoft.com.au/arduino/

I've also revised the shield I made with the sensors - I've removed the DHT22 temperature/humidity sensor as I thought it was probably too close to the WizNet chip on the Arduino board, thereby skewing the readings. I had another one lying around from my very early Arduino experimenting - it was already on a length of wire so was perfect. I could move the sensor away from the board and place it somewhere else.

GT1

With the space freed up by removing the sensor from the board, I added a light-dependent resistor. This would both give additional data to upload as well as controlling the LCD backlight. When it's dark in the garage (i.e. lights are off and I've gone to bed) then the backlight will automatically switch off - video testing it. I've also added an additional screen of information showing the RTC's battery level and the LDR/ambient light level.

2016-02-04 16.54.04

So, this project is pretty much complete - two-three days in total, both hardware and software! The Arduino code is a bit messy and not optimised, but it works! Cleaning it up will be the next step. But first, I just need to figure where I'm going to mount it in my workspace. And come winter time, I'll be able to check the temperature outside on my phone whilst still hiding under the covers!

Grotto Time, part 3

There's one small design flaw I can see already.

The AM2302/DHT22 temperature sensor (white one on the right below) is not far from the WizNet chip that handles the Ethernet connectivity on the Arduino.

GrottoTime shield

This chip generates a bit of heat, and so will probably be skewing the temperature measurements.

Not a big deal - I can move the sensor off the shield and place it a short distance away, connected via wires. This should give a more accurate reading. And it will free-up space on the shield for a light-dependent resistor, perhaps, to automatically switch the LCD backlight off when I've switched the lights off and gone to bed … ? At the moment I can toggle the backlight on/off with the keypad select button.

Before I sort that out though, I've incorporated the web upload code again … and it appears to be working … intermittently. Still need to iron the kinks out.

And I'm working on adding some automatic DST handling too - here in NSW, DST starts on the first Sunday in October and finishes on the first Sunday in April. So shouldn't be too hard to come up with a routine to decide whether it's on or not.

But you can check the current-ish weather in my garage, aka Nerd Grotto, by visiting the page here:

http://outosoft.com.au/arduino

Grotto Time, part 2

I started my GrottoTime project a few years ago - I wanted a clock for my "Nerd Grotto" (i.e. workspace in the garage). I figured it would be a good project to learn how to use a real-time clock (RTC) and Ethernet connectivity.

So I came up with something that would initially poll the time from an NTP server and store it to the battery-backed RTC. It would also check the current temperature/humidity/pressure. This would be displayed on the seven segment LED displays. Additionally, it would upload the sensor data to my website … the thinking was I could wake up in the morning during Winter and quickly check the outside temperature on my phone.

Anyway, the breadboard version worked. The harder part was coming up with a hardwired version.

This is what I settled on - I would use a Freetronics EtherTen board (Arduino Uno with Ethernet & SD card). I shaped a vero-strip board to fit around the Ethernet port of the EtherTen. This would be a shield that would have all the components.

Anyway - this was the result:

Grotto Time Mk. 1

Unfortunately, there appears to be a hardware. The DHT22 temperature sensor (the white thing) fails to start up. The connections look good for it look good.

So it looked like I'd have a lot of frustrating hours fault-finding.

But … as I'd recently figured out how to use LCDs (yeah, simple), I decided to start from scratch. The EtherTen had problems with a lack of memory - it just couldn't fit all the code I wanted it to do … polling the time via NTP, uploading the sensor data, etc.

Thus, here is Mark 2. Much better looking, yes?

  • Changed the EtherTen for an EtherMega (more code space),
  • Used a Freetronics LCD + keypad shield,
  • Used a prototyping shield sandwiched between for the sensors - RTC, barometric pressure, temp/humidity

GrottoTime Mk. 2

Here it is working - I've got a few screens of information working that can be scrolled through using the keypad buttons.

2016-02-02 21.56.04

I've been slowly bringing my original code across to a new sketch, replacing the LED code with LCD code.

The time is initially synched via NTP. This is stored to the RTC. Thus it can then run offline or online. Of course, to upload the data to my website it needs to be online. The idea is that it'll be on the wall in the garage connected to a cheap WiFi access point via an Ethernet cable.

The code is a bit of a mess at the moment, but it works. I'm currently working on adding some automatic DST setting.