Home Energy Monitoring – Part 1: Babby’s first PCB

I’m a bit of a data nerd and have been gathering metrics from my local machines for sometime now. The ability to see trends is really powerful when diagnosing problems and tuning performance.

I’m using the TIG stack – Telegraf (data collection), InfluxDB (time series database), and Grafana (visuals and alerting).

Grafana dashboard – file server

I wanted to utilize these same tools for monitoring energy usage in my house. I set out a goal to be able to see energy usage in near real time, per circuit, using mostly free software and hardware.

I ran across an excellent post on boredman’s blog that describes the hardware side of a system that very closely matches my goal. I immediately went out and acquired the pieces to play with this for myself. It wasn’t long before I had something working on my bench.

Current transformer and AC-AC voltage inputs into Arduino Due

With a working proof of concept it was time to think about next steps. For me this was form factor, scaling. The Arduino Due supports 12 analog inputs. One will be consumed for Voltage measurements using an AC-AC transformer and the others will be for current measurements from current transformers on each circuit in my house. I have 22 circuits in my electrical panel — I will need two Arduinos or find better way to add analog inputs.

Input board 1.0

Fritzing is software for creating PCBs for newbies. Perfect. I was able to cobble together a board with CT (current transformer) and voltage inputs to a pin header thinking I could run a ribbon cable from the input board to Arduino. It wasn’t too hard to get going in Fritzing but I found it difficult to get something that looked nice and wasn’t even sure it would work. This board only has a burden resistor for each CT input.

Read more about CT burden resistors and home energy monitoring at the excellent Open Energy Monitor project

Fritzing – Input board 1.0

I was worried that I would be getting a lot of interference since I’m dealing with AC signals and overall felt I could do better. I iterated, this time using Eagle PCB design software. I extended to scope to capture the remaining components for each input and make it be able to plug directly into an Arduino Due.

There simple wasn’t enough room on the Arduino for 11 x 3.5mm TRS (audio jacks) inputs so I had to design the board with some margins to accommodate the inputs.

Version 1.1 was born

I followed this tutorial on Sparkfun for Eagle basics. You start by building your schematic in Eagle. You can pull in libraries of parts from places like Sparkfun which is really convenient. You then connect parts together using nets. Nets are like a virtual wire. Any wire/pin/whatever on Net1 will be connected.

After you’ve connected all your parts to nets, you then can switch to the PCB view. The PCB view will be a mess of parts all over but the important thing is that you can see how they’re connected by a yellow line. This is the virtual wire of the net. Organize your parts and click that ratnest button often. Don’t get too attached to one layout. I wish I had spent more time on one part of the board before moving on to duplicate my layout to the rest (ended up going back and changing all the things multiple times).

Here’s the most important thing I’ve learned when building boards: Take advantage of your copper layers!

I’m sure this is obvious to anyone but a newbie, but each layer of a PCB contains a copper plane. Most simple boards are dual layer, that means you have two planes of copper to work with. You will almost always need to connect many components to ground and power. Use one layer as a ground plane and another as power. Now components that need a ground or power connection get it almost for free, no need to route long traces!

In Eagle you choose the layer you want to work on and draw a polygon then click the ratnest button to connect components to that layer of copper. Note that for top layer components to connect to the bottom copper layer, you will need to use a via.

I submitted the board to OSH Park for fabrication and ordered all the parts off mouser. Excited to test out the board. Next post I will talk about how assembling the board using SMD components go (I have three boards on the way, bound to screw up :)). Fingers crossed.

Upcoming Events

Quick update on some upcoming events DC414 will be at.

First off the date of the next meeting has changed. It will be held on September 26th to create a buffer around BarCamp Milwaukee. That brings us to the next event:

BarCamp Milwaukee
October 4, 2014

BarCamp Milwaukee is the premier event for Milwaukeeans, by Milwaukeeans, to learn, teach and imagine anything you are interested in. The open format of BarCamp puts the participants in charge of what happens. Unlike a typical “conference” where the event is pre-determined, this revolutionary “unconference” allows participants to float from one session to another, and encourages the development of innovative ideas and spontaneous discussion. This event is open to anyone with an interest, an idea or a desire to learn and connect with other people. Since the first BarCamp in the US nine years ago, hundreds of BarCamps have been organized throughout the world.

See http://barcampmilwaukee.org/ for details.

And finally, a LAN party was announced on October 11th.

All events can always be found on the Meetings page.

May Meeting Roundup

First off, thanks again to the Meetupery for hosting us this month.

We had a couple new faces — I hope they learned something! We started off with intros and learned about what everyone is working on. Ryan was working on a car-puter which peaked my interest quite a bit. Hopefully soon he’ll have something to show off and give a demo on! Doppler radar, say what!?

Darkwind kicked off the demos with some video footage he captured with his hacked together drone. Very cool and extremely cost effective. He captured some amazing footage of deer in his backyard. TIL that deer are memorized by a quadcopter flying 10 feet away from them. Klaiviel immediately was thinking how great it would be for hunting. I’d have to agree, although, It seems like not much of a challenge when you have an aerial view.

DW5304 gave us an old school ARP poisoning demo and explored more mass-SNMP scanning results of some home brew tools that basicdays, Vaerulf, and himself created. Impressive software leveraging zmap to quickly scan the entire internet for insecure SNMP daemons. 1.5 million of them if I remember correctly.

I recapped heartbleed for everyone and described how I was able to obtain RSA private keys using the exploit.

And finally Mike had a chemistry experiment with him to explore the relationship of pressure and boiling points of liquid. I was fascinated by this as I have never seen it done before. The discussions surrounding it was fantastic thanks in part to Steve. We got into all sorts of topics including vacuums and blackholes. Thanks again to Mike for expanding the areas of expertise.

Much of the time was spent in smaller groups discussing everything under the sun. I could feel the information flowing. Very cool stuff! Hope to see more new faces next month.

Congrats to Larry, Basicdays, and DW5304 for winning this month’s free junk giveaway!

Uh Oh! TLS/SSL Heartbeat Vulnerability Time

TLS heartbeat read overrun (CVE-2014-0160)

Test using our online tool to see if your server is affected

A missing bounds check in the handling of the TLS heartbeat extension can be
used to reveal up to 64k of memory to a connected client or server.

Only 1.0.1 and 1.0.2-beta releases of OpenSSL are affected including
1.0.1f and 1.0.2-beta1.

Thanks for Neel Mehta of Google Security for discovering this bug and to
Adam Langley and Bodo Moeller for
preparing the fix.

Affected users should upgrade to OpenSSL 1.0.1g. Users unable to immediately
upgrade can alternatively recompile OpenSSL with -DOPENSSL_NO_HEARTBEATS.

1.0.2 will be fixed in 1.0.2-beta2.

A Question to Milwaukee, a Bucketworks Emergency

Bucketworks is a co-working, meetup, and practice space for creative professionals.  They’ve been gracious enough to host DC414 monthly meetings and many other events for hackers.

We’re all at risk of losing this space due to some recent financial problems they’re encountering.  I encourage anyone to give back to this awesome space and help them continue to help us.

DC414 as an organization is helping, you can too by donating to Bucketworks by following this link.

Please read Tim Syth’s (Director of Bucketworks) question to Milwaukee:

After being born and raised in rural Wisconsin, and spending nearly 5 years wandering the planet as a photographer and student, I came to Milwaukee about 18 months ago because the city intrigued me. It was gritty, blue-collar and raw. It did not offer the apparition of a polished facade. Its issues were displayed prominently on its sleeve. It felt real.

Perhaps naively, I also came to Milwaukee hoping I could make a difference. Here was a place I could come and actually have a name and face as I tried to leave a positive mark as the director of a project called Bucketworks. I still believe this.

Bucketworks, for those who don’t know, just celebrated its eleventh birthday. Eleven years ago this May it was started by James Carlson and a cadre of accomplices who wanted nothing more than to explore creatively in a way that only art in warehouses can provide. There was little method to the madness, but it was one of the first collaborative spaces in the country, and in Milwaukee of all places. It was a place all about making it happen (whatever “it” was) and giving people a reason to gather and work together. It was the spot in the city for the curious and motivated to gather and create art, businesses, theater, events and products.

Bucketworks has had its issues, much like its home city, but through thick and thin and two floods Bucketworks has managed to persevere, and in that time, Milwaukee has started to blossom. We now have the Milwaukee Makerspace, ArtMKE, the Hudson, VETransfer, Gener8tor, MARN, the Creative Alliance, Open MiKE, just to name a few. As a relatively new transplant, the vibrancy of the creative culture in Milwaukee is a sorely told story—we are lucky to be in this time and place. But as each of these great efforts filled a niche, and as each of these efforts has been born, Bucketworks has adjusted and pushed ahead because it has always been the job of Bucketworks to be on the edge—to be that hard-to-explain place “where things start.”

Fast forward 18 months from my arrival in Milwaukee to today and some of that gritty, blue-collar and raw is weighing on me. Those of you I have had the pleasure of meeting know that I have been very open about the situation at Bucketworks. It has its issues and it wears its dirt on its sleeve. Specifically, we have not been been paying rent for 4 months. For the year I have been here prior to those four months, we paid $7000/mo for 6 months and $2500/mo for 6 months before that. We are not paying rent because we spent $2500 on a broken heating system we don’t own, but because we could not afford to fix the system completely, we still paid $2500/mo to heat the space in the winter. We patched a roof we don’t own with the gracious donation of time from a Milwaukee startup that helps veterans develop job skills. We repaired air conditioners. We spent $2000 on a sprinkler system we don’t own to get the building up to code. We replaced toilets that were broken, patched floors, and fixed lights, all while running the organization.

But why not just raise the prices to cover the bills? We don’t raise the prices because we feel it is important for there to be a place in our city where a person can explore projects without breaking the bank. We believe a lack of money should not stop people from trying. Bucketworks is home to 15+ businesses on any given month who pay on average less than $200 a month to operate. If you can get past the Commons, bang for your bucket it is the lowest-cost place in the city to start a business. Bucketworks is a place where teenagers from the city come to make art while learning important things like punctuality and responsibility. Bucketworks is a place where people gather to learn English and to learn about citizenship. Bucketworks is a place where people meet to talk about open data and to teach each other about technology and mysticism and financial planning. Bucketworks is a place to sword fight, practice aerial silks and to dance. Bucketworks is where people voluntarily work together on improving healthcare. Bucketworks is the place where bees are nurtured and celebrated. In short, Bucketworks is a living and breathing demonstration of functional, diverse community in a city that is known for its silos and segregation.

Please note this isn’t a blame game that falls on our landlord or others who are currently interested in the space. I have a good relationship with our landlord—we agree with a shake of our hands and then do the best we can. We operate like much of Milwaukee operates, and I think this is to be celebrated. Also note that this text represents solely my words and perspectives.

In closing, I want to say that Bucketworks is cleaning out its closets and washing the dirt from its sleeves. I will meet with anyone who is interested and let them know where we stand, what we need to do better and what our plan is to get there. We already have great partnerships that are interested in supporting and bringing stability to this wonderful project, but right now we need time, and in order to get that time, we need money. $18,000 would get us six months of runway on rent, $36,000 would get us twelve, and anything in between would be awesome.

As a recent transplant to this city who has seen Berlin, Tokyo, Hong Kong, Venice, New York, Mexico City, Riga, Paris and many others, I believe Milwaukee is a place to be right now. We have a city that can hide little and is full of people who want to do more. I am committed to making this a place where people have a real option when they want to try an idea. I am willing to do what it takes to bring long term stability to an awesome project in a city that is just rediscovering itself.

So the question I have is this:

Does Milwaukee want Bucketworks?

If it does, please donate what you can. If all you can do is forward this on, please do so. We have an opportunity to show that Milwaukee is a community together. We are not asking for much and we never have asked for much, but I am asking for Bucketworks now. If we reach our goal, the funds will be used for to cover rent. If we do not reach our goal, the funds will be used to find a new home. Our goal is to raise $18,000+ by the end of the business day today—please help.

Thank you,

Tim Syth
Director of Bucketworks