Sunday, 21 February 2016

Oak Power Board, Part 1

I've been meaning to do a small write-up on my latest project, and add-on board for DigiStump's Oak board; an ESP8266-ish-based mini board with an on-board LDO that is programmable with the Arduino IDE using Particle Cloud. The Oak was successfully funded using KickStarter and I got my board pretty fast! While the firmware is not yet finished I've been able to make a prototype and think about what I wanted to do with a cute Arduino-IDE-compatible-wifi-equipped-board like this. You can find the project on GitHub.

Creating a Power-consumption monitoring device

I've recently moved in with my girlfriend (who does awesome drawings, by the way!) and because this meant having to pay the electricity bills ourselves I wanted to know whether we would have to pay extra (for consuming more electricity and gas than anticipated) or that we'll receive money for consuming less of both. I was also interested in how much energy was consumed at a given time of day. This helps us decide which devices to keep plugged in in stand-by, and which devices to fully unplug. Because I'd heard of some Arduino-based projects using an TCRT5000 to do just this, I decided I wanted to design a board to do the same, but instead it would be cheaper, easier (both to use and to update, thanks to Particle OTA updates), and smaller than a regular Arduino.

Prototype

After some prototyping I decided on using an SSD1306 OLED display (128x64 pixels) that I has lying around at work. I hooked it up, and (fortunately!) someone had already written a library to use the SSD1306 on the ESP8266. As Particle handles WiFi connectivity that meant that the only thing I had to do was write code to calculate the time between pulses of the KWh-meter, and I should be good to go, right? So I decided to design a PCB to put the Oak, the TCRT5000 and the SSD1306 display on.



Designing the first board (also: the first mistake)

Because the prototype seemed to do what it should, I put a PCB design together and sent it to OSH-park. I received the boards pretty soon, and I was happy with them, until I tried to get measurements from the TCRT5000. I had forgotten to check whether we would be using the TCRT5000 input as analog or digital. Where the Arduino has a lot of ports to use (usually 6 or more analog, and a lot more of the digital kind), the Oak has only a single port that is able to do analogRead (port 0). Fortunately I had been using port 5, so I could add a bodge-wire and continue with my firmware.

 
The bodge-wire in question, redirecting the sense-pin connected
to the TCRT5000 to the only analog pin on the Oak

On a side note: I really like the board as it is. OSH-park is great and I would recommend it to anyone who wants to do a small prototype run. Compared to services I've used, the web-based interface is easy and shows renders of how the board will look. Every layer is separately rendered and I've been able to spot some mistakes before sending the board to fab. The purple color is funky, and of course that also counts for something, right?




Current stage of the project

The latest developments on the board have been that I'm currently not able to reliably attach the board to my KWh-meter. This means I can't write/test code at the moment, but I hope to be able to test this soon. If pulse detection works I can do some tests on other meters and find a way to semi-permanently attach the device to anyones (spinning disk type) KWh meter.

If you want to check it out, go to github. Both the board and the code files are there. I've opened a topic on the digistump boards for this project, so if you already have an account there, you can also contact me in the topic on the Projects board. If you have any suggestions, contact me or leave a message. Thanks for reading! 


Update on recent developments

Hi All! As you might (or might not) know, I have my own company (thisiswhytheinternetexists), but I also work at QwikSense, which is my other company that I co-founded. As QwikSense has some spare server capacity I'm able to use that for TIWTIE as hosting that doesn't need a lot of resources anyway. Unfortunately that is the reason that my site has been down for the past few days: QwikSense moved from Google Cloud to Microsoft Azure, and I didn't have the spare time to fix the site. Luckily, I found some time to do this today, and as you might be able to see, it's up and running again! Yay!

Monday, 7 September 2015

About productivity and mental health as a software dev

Hello World!

As an experiment I'll be posting stuff about my life, work, ideas and more. Depending on the responses I'll consider putting more effort in this. Expect nerd stuff, me bragging about the awesome hardware I purchased second hand and me raving about the next best thing to build your web service with.

I'm not usually someone who reads books often, but in the past few weeks I've made a change in the way I spend my day at work. The changes were minimal but allowed me to be a little more physically active and decrease the time I spend frustrated while trying to solve problems in our web service back-end. The changes I made were inspired by two books, The Blueprint for a Productive Programmer: How to Write Great Code Fast and Prevent Repetitive Strain Injuries by Moshfegh Hamedani and Becoming a better programmer by Pete Goodliffe. Links to the books in different stores will be at the bottom of this post. I didn't finish Becoming a better programmer yet but I'm plan on finishing it soon. 

As I usually don't really read any book at all (my work research is mostly on-line) I found it a really nice way to read a lot of stuff that wasn't necessarily something I was Googling for. Both books are meant for programmers that are passionate and are focused on making yourself function more optimal in situations where you need to deliver code fast and pressure is usually high. Small tips and tricks help you optimise the way you handle your work day and how you plan it. I recommend both books to anyone who feels that your work could be easier but doesn't know what he/she is currently doing wrong to prevent this. 

The Blueprint for a Productive Programmer

This book handles mostly concerns related to physical health (and the effects of long term physical strain on your ability to continue doing your job), managing your time more efficiently, minimise distractions, and improve your mental health. I feel that really any programmer should read this, the book is worth it's weight in gold! Very practical and easy to read. But as the author states in the book: 
“Reading this book is one thing, putting it into action is another. If you don’t practice what you learn in this book and continue with your bad habits, you’ll be just wasting your time. ”
Excerpt From: Moshfegh Hamedani. “The Blueprint for a Productive Programmer: How to Write Great Code Fast and Prevent Repetitive Strain Injuries.”

I guess the best thing is to do what I did, start reading and if you feel that you won't be able to implement change, just stop reading. I actually forgot about that until in finished the book :). 


I'll be writing about Becoming a better programmer in a next post. If you have any questions or comments, fire away!


Links to the books:

The Blueprint for a Productive Programmer by Moshfegh Hamedani:

Amazon ebook


Becoming a better programmer by Pete Goodliffe:

O'Reilly Store, Amazon (Kindle)