Category Archives: Technology

powering yourself: water heaterS – Most efficient setup with no tradeoffs

In the “Rethinking the Smart home series“, I proposed that if you have a solar PV system (or any system that generates electrical power), no one uses your own produced power better than the you. To summarize the proposition, I claim that “selling back” to the grid is environmentally less ideal than using the produced power yourself. The concept needs a nickname -something I can use to expand and apply the concept later. Towards that end, I think “Powering Yourself” works. I’m open to suggestions if you can think of something more catchy. Let’s market this idea and spread it around! The more eyes and ears on the concept, the more solutions we can come up with to make distributed smart-grids a reality and ultimately make the world a more energy efficient place.

Water heater relative efficiency

Hot water is essential for our daily lives. Hot water kills many types of bacteria that can infect our bodies. It is more effective for cleaning with as it helps loosen up bonds. In US homes, hot water is typically produced in a centralized tank. This insulated tank is mostly heated by burning natural gas (CH4/methane).

Rheem Performance Platinum 50 Gal. Medium 12 Year 5500/5500-Watt Elements Mobile Alert Compatible Electric Tank Water Heater
courtesy Rheem

Tank water heaters are generally less efficient than tankless or “on-demand” water heaters. This is because the water in the tanks is maintained at a set temperature (between 49C-60C) even when you are on vacation or shower less frequently, etc. Running a tank water heater is estimated to cost about twice as much as a tankless.

Even more cheaper to run than tankless is a type of water heater called a “hybrid water heater” or “heat pump water heater”. Some of the manufacturers claim they take “energy from the air” to heat the water. This is misleading in my opinion. These are actually using the same technology as your AC unit: it uses mechanical energy to compress and decompress a phase-changing medium from liquid and gas states. The in the decompression state, the phase change from liquid to gas will actually suck thermal energy from the air to help facilitate the phase change. You can experience the same effect if you get a can of compressed air and spray it for a while. The can gets cold fast because the phase change going on inside is sucking thermal energy from the can and your hand (and the air, etc).

On the flip-side, during the compression stage, heat energy is actually released to facilitate the phase change from gas to liquid. This energy would go back into the air or in the case of the hybrid water heater: into your water. The process isn’t even zero-sum because the compressor itself gives off some heat.

Courtesy of Stiebel Eltron

Hybrid water heaters use electrical power to turn the motor in the compressor. They use less energy than traditional electric water heaters which run at sometimes run at 5kW. Further, they use drops compared to tankless electric… which can go higher than 36kW. Yikes!

Tankless comfort

Of all these different types, tankless are the most comfortable in my opinion. Tanks fill with cold water at the same time they are being drained of hot water. This results in fluctuating temperatures at the start and end of use. If you’ve ever showered right after someone else in your household, you know this reality. Tankless heaters don’t have that problem. They have constant temperature from start to finish. So if you have or want to use a tankless heater for the comfort and savings, how do we achieve this while still following the “powering yourself” principle? Tankless heaters are gas or electricity powered. Gas is a bit more difficult to power under your own means (not impossible, maybe more on that later). For electric tankless, the electrical consumption is so high that very few solar systems can keep up (36kW or more). To power ourselves, we are left with tank solutions and really only hybrids as they require less electrical power. But to go with a tank we must sacrifice all the pro’s of tankless… or do we? Can we have our cake and eat it too?

Smarter water heating

In the last article, I wrote about an automation approach that uses smart budgeting to maximize the usage of your own energy production and reduce usage of the grid. Could we add a hybrid water heater as a device to this system? Let’s calculate and see if we can power it with solar PV. We don’t need to power it all the time since the tanks are insulated and will maintain some thermal energy. At an R-value of 20, a 50 gallon tank of 60C will cool by about 3C over 9 hours assuming a surrounding temperature of 8C.

A 50 gallon hybrid water heater stores 183 l (or 183 kg) of water. Worst case for my area, the temperature of the water will be 9C. We need to heat that up to a minimum of 49C (to meet government standards) or 60C (most manufacturer defaults). Using 60C as the worst-case target, we need to put in 40.3 MegaJoules of energy into the water to heat it up from 9C to 60C (Q = mC△T). No heater supplies that amount of power all at once, so lets divide that energy requirement over time. To get kWh we divide by 3600 (number of seconds on 1 hr). We get 11.2kWh. That’s pretty reasonable production rates for even a small solar system. With my 3kW system, I can average 11kWh a day for 8 out of 12 months or 2/3rds of the year. With a 6kW system, you can do 11 of 12 months.

We can almost power our water heating needs under the Powering Yourself concept! To cover the last little bit, we could put a tankless heater in-line after the tank water heater. The tankless water heater would only be active if the incoming water is below the setpoint. We can get the benefits of Powering Yourself and tankless comfort!

Copyright 2018

Cost savings of the Hybrid Approach

In the above diagram, we are using a fairly large tankless heater. Heaters at this price range can do 9 or more gallons per minute of hot water. For reference, a typical US shower head is 2.1 gallons per minute. This is probably overkill for what is actually needed in most situations. Even the cheapest 5 gpm tankless option will be better in the worst-case scenario than just having a tank.

For the 9gpm tankless, the time to payoff with the savings is about 9 years with a 3kW solar PV system. It’s about 7 years with a 6kW system. With a 5gpm tankless heater, you are looking at 3-4 years.

This payoff period is only for the added cost of the tankless heater in this setup. It is assumed that this is either a new install or you are replacing the existing hot water tank with a hybrid. Hybrids save about $100/year over traditional gas tank heaters. The payoff for the hybrid upgrade over traditional is around 5-8 years.


First, there is no point in even trying this if you do not have your hybrid tank optimized for solar with some sort of home automation software. It needs to essentially turn off if there is no solar power being generated. Wifi enabled versions allow setting the temperature setpoint remotely. There’s even an open source python API for talking to some Rheem models. If the hybrid heater has this capability, we don’t have to turn it off. we can just turn the set-point down appropriately to stop it from running… or run less. Another option is a wifi relay outlet like those supplied by Wemo or TP-Link Kasa. Be careful! Many of these only support 15 or 20A loads and some hybrid water heaters require a 30A outlet.

If you are able to automate the hybrid tank to only (or mostly) use solar generated power, you should save money (up to $100/year in some cases). Adding a tankless heater in-line will add the comfort, and will pay for itself eventually.

What other devices can we bring under the “Power Yourself” umbrella? If you have any ideas, leave a comment below or tweet me. Good luck and happy powering!


In Part 1 of the Rethinking the Smart Home series, we looked at how we can using batteries to offset the electrical usage of certain devices.  We did not discuss how and when that battery system is charged.  We will do that now.

Batteries are just devices

There are a lot of “devices” in our homes.  Devices are things that use power.  This includes lights, displays, HVAC systems, and even battery chargers.  Over the last few years, the market has flooded with relatively inexpensive smart light bulbs, switches and outlets.  Many of these offer power and energy consumption monitoring.  Many of them have APIs either provided by the manufacturer or reverse engineered by the community that can be used to communicate with these devices.  I decided that I could use one of the smart outlets I have to control when the battery system charges.  Obeying the Law of Using Your Own Generated Power, I will only charge the batteries when there is enough solar power available.  I realized quickly that there are many devices I have in my house that I can turn on and off in this way.  I have several grow lights for indoor food plants that are already connected to Ubiquity mFi WiFi outlets.  I have them on a schedule, but I was interested to see how much I could save if I only had them run when there was enough available solar power. 

The use-cases after that kept growing.  What if I tell my smart light switches to dim when there isn’t enough available solar power?  What if I raised the setpoint of my thermostat by a degree if there isn’t enough solar power?  What if I only charge my robot vacuum on solar power? 

To see how much money I could save, I wrote some code to help manage the devices based on a “power budget” which was set by the output of the solar PV system.  For example, if the PV system was producing 2000 Watts of power, I would turn on “managed” devices until I either reached 2000 Watts or they were all powered.  If the solar PV output dropped to 1000W, I would need to turn off some devices.  To do this, I wrote some code I call the “Device Manager”.  The Device Manager would maintain the power budget and turn on and off devices as required.  It would also run device-specific rules (more on that later).


Some devices are more important to me to have powered than others.  For example, my phone charger is more important than the robot vacuum charger.  If the power budget is exceeded, Device Manager will first turn off the lower-priority devices.

Runtime Modes

 Many utilities offer variable rates depending on the “time of use” of your power.  For example, rates are often cheaper in the night when fewer people are using lights and appliances.  Rates can also be more expensive during “peak usage” when the grid is experiencing more load for example, at noon on a hot summer day when everyone’s air conditioning is running.

The Device Manager should be smart enough to take these time of use modes into account.  If I go over my local power budget, I may want some devices to remain running if it’s during off-peak hours of the day.

A perfect example of this is my greenhouse preemptive cooling system.  I run this system at night during off-peak hours for the cheapest rates.  It also runs more efficiently at night because it’s cooler.  Double-bonus.

Rules Engine

Turning on/off devices is powerful enough for many devices.  But what about devices you don’t necessarily want completely off?  For example, I need lights at night to see.  I can’t just have them turn off if there isn’t enough power.  I can have them dim, however.  There are lots of use cases from dimming lights to adjusting thermostat settings that calls for a rules engine.  I have written rules to turn off devices, or dim lights or even check occupancy.  Devices can have many different rules so rules can be combined in interesting ways.  My lights have occupancy rules and dimming rules.  I even have a rule that “links” devices to a master devices so that the on/off state mirrors the master device.

Batteries as a buffer

In the first part of this series, I built a battery system to help optimize when I charge my laptop and other devices.  That system really cannot work to peak efficiency without the Device Manager managing when the batteries charge.  I charge the battery banks when I am under budget with medium priority.  I found this works best for my usage.  I am able to charge all phones in the house and my laptop from this simple battery system.  While it doesn’t amount to huge savings (only $5/year), it does make a good proof of concept that we can use to power additional devices later.

In practice

With the system running and managing about 8 devices ranging from grow lights, to chargers to the thermostat, we observed considerable savings.  Our power usage is about 30-50% less year over year.  That’s much more than Not all of that can be attributed to the Device Manager system, but a lot of it can.  Most of the savings is probably in the thermostat automation, but the light management probably helps a lot.  I believe it also helps us get to sleep faster since the lights are not so bright at night.

In the next part, we will look at how using AI and machine learning makes this system even better.


Using the SCIO in gardening

Ages ago, I funded a kickstarter for a “consumer molecular scanner”.  It’s a pocket spectrometer of sorts that can be used with your smartphone to analyse the chemical composition of just about anything.  It works by spraying an object with photons from an LED on the device.  Different chemicals react differently with different wavelengths of photons.  On the device is a sensor, that analysis which photons bounce back.

The android app that you use with the device, communicates over bluetooth to read data.  Data is then sent to the cloud for analysis.  What comes back is a spectrum that represents the object.  Included in the app are a number of applets for doing things from estimating body fat to estimating the BRIX rating of a fruit product.  You can also create your own “mini-applet” to capture and analyze your own objects.

Tomato leaf deficiency mini-applet

I wanted to create a mini-applet to analyse tomato leaves and perhaps identify any deficiencies.  I started with some healthy leaves and took some scans.  Unfortunately, I need to produce leaves with known deficiencies, scan those leaves and name those scans after the deficiency for this to be really useful.  I did however, notice some strange leaf formation, took some scans and the results were different than the normal “healthy” leaf.  If I can identify this as a nutrient deficiency, I’ll have a good way of identifying it moving forward.

Produce Selector applet

This is a built-in applet that allows you to scan your favorite fruit and get a BRIX rating.  BRIX is basically the sugar content in a solution.  Unfortunately for this applet, it didn’t recognize any tomato I scanned :(.  I scanned my unripe fruit and the store bought roma tomato.  I provided feedback via the app to the developers.  I hope there will be an update soon.

Fruit and Vegetable applet

This applet lets you estimate the carb content in the fruit or vegetable.  I used this on my unripe tomato growing in my greenhouse.  It came up with 5% carbs.

I snapped a picture of the fruit and I’ll be able to check later for changes.  I’m exciting to see what happens over time with these readings.  Here’s the “spectral fingerprint” from my phone (5/10/17):

For comparison purposes, I scanned a store-bought roma tomato.  The readings were identical from what I can tell and I’m not sure exactly what that means yet, but another scan of my greenhouse fruit when its ripe might reveal something.


The SCIO is pretty fun.  I foresee it will be very useful moving forward to help identify plant and fruit quality.

Grow Lights 101: What kind of light matters

If you are following my youtube channel, you’ve probably already seen this.  If not, here it is again.  This is an introduction to grow lights where I cover what are the important aspects of light relevant to plants and compare a couple different types of grow lights (T5 vs LED).

To sum things up, T5’s are cheaper out of the gate.  But LEDs are more bang for the buck in the long run.

I am building LED grow lights for anyone interested.  Head on over to the new store.

10W Far Red LED Grow Floodlight

Far red (740nm) might be very beneficial to tomato production.  Studies have shown that it can help produce longer “hypocotyl” (the seedling shoot that becomes the stem) by just blasting the plant with 12 minutes of light at the end of the day (16hr photoperiod with T5 lights).  Other studies claim that far red can help reduce or eliminate sucker growth.


Total cost: $33


50W Blue grow light build for seeding

According to my research, blue light is primarily used in plants for vegetative growth.  It follows, therefore that blue light is best for seedlings and clones that you want to grow in size quickly.  Is this logic sound?  I’ll experiment, and report back.

This video is a live build video where I make a $54 dollar blue-only grow LED floodlight.  Note that at the time of posting, the floodlight price has already changed on Amazon.  You can typically find these on ebay for a reasonable price.


Total Cost: $54

LED Stair Lights

Stairs are pretty boring, but they don’t have to be.  I convinced my loving wife that she needed stair lights.  I put the project off for over 6 months while I’ve been greenhousing, but now that that project is more completed, I have time to get back to house projects.  Let’s get building.


First, we will use the APA102 lights.  These are individually controllable.  They are the same lights we’ve used in our ambilight project with the minnowboard max.

I came up with a simple light protocol that supports “instructions” rather than just raw pixel data so it’s fast and light.  I’ve published the library here on github (be sure to use it with my forked Adafruit_dotstar library which has the “driver” for the LightProtocol).  I loaded that onto a particle photon, combined with an level shifter, and powered the thing with a Drok DC-DC power supply and a 24V 5A AC-DC adapter.

To install the LED strips on the stairs, I picked up several aluminum channels from and the corresponding “frosted” covers.  To stick the channels on the stairs, I used 3M automotive double-sided tape.  The aluminum can be drilled and screws can be used to mount, but I didn’t do that.  I used a simple dremel to cut the channels where I needed to.

I’m hiding the photon and the power supply in the closet which is adjacent to the stairs.  I cut a small hole in the wall on the closet side and put a 4 wire, 14AWG cable through the wall.  This is low-voltage (5V), so you don’t need an electrician or a expensive permit to install inside the wall… at least in my area.  On the other side, I combined a 2 socket “keystone” faceplate with a couple two wire speaker jacks.  This doesn’t look half bad.


Using the same python library as the minnowboard max ambilight project, and adding a “driver” that can speak our “LightProtocol” that we’ve installed on the particle photon, we are able to to complex effects and themes on the desktop and change the lights over wifi.

I have three effects coded up: “Chase”, “Random Rainbow Transforms”, and “Rainbow”.  Check out the video for how these effects look on our lights.  What other cool effects can we do?


Smart Grow light

The first law of plant growth is light.  Typically this light comes from the sun at an incredible intensity of up to 100,000 lux (lm per square meter).  Different plants have different sunlight requirements.  Typically these are categorized as “full sun” or “partial sun” plants.  Full sun plants require at least 6 hours of direct sunlight per day (30,000 – 100,000lux).  Partial sun plants need about 3 – 6 hours.

Winters in the Oregon Portland area are dark.  So dark that humans suffer from the lack of light.  This condition is known as Seasonal Affective Disorder.  Most of this period is dominated by overcast clouds which reduces the light to about 1000 lux.  That’s 3% of the minimum  light required for full sun plants.  To grow food all year round, we are going to have to compensate for this lack of light.

There are many different types of artifical lighting.  The most power efficient of which are LEDs.  The problem with LEDs is that they typically have a very narrow range of light.  To make white, LED’s combine 3 diodes with some red, green and blue.  The human eye sees these three as white.  It cannot perceive the gaps in the spectrum that the LEDs do not transmit.
White LED from Cree (TM)

White LED from Cree (TM)

Other light sources cover a lot more of the light spectrum.

Example of a LED spectra

Given that lights light incandescent lights have a wider spectrum, why use anything else?  The answer is, plants don’t need all that light.  Plants use light in the blue and red spectrum and reflect the green and yellow spectra.  That means that any grow light that includes these wavelengths are wasting energy.

LEDs for growing

LEDs for growing do not have the green diodes.  This makes LEDs, which are already the most efficient artificial light source available even more efficient for growing.  While you can purchase may LED-based artificial light solutions, I set out to build my own in such a way that I can control the amount of light my plants get based on sunlight.  If there is full sun, I don’t need to activate the lights.  If there is less than full sun, I can adjust the brightness of the LEDs to compensate.

I found some grow LEDs on ebay for a decent price from the seller sungrowled.  These are 30W but I have also used the 50W variants.


To keep the LEDs cool, I picked up a 36 inch aluminum strip and mounted 6 LEDs evenly spaced on the surface.  I used thermal adhesive to mount them.


On the ends of the strip, I drilled a 3/8″ hole and attached something I could attach to some rope to hang.


I then wired up the LEDs in parallel.


The aluminum strip helps spread the heat, but probably will still get to hot.  To increase the surface area for cooling, I used the thermal adhesive to attach some aluminum heat sinks to the top of the strip opposite of the LEDs.  This unit will be passively cooled.



Six 30 Watt LEDs run at a total of 180W.  Amazon has a bunch of adjustable current/voltage power supplies from Drok.  Oddly, the power supply ratings seem to go from a few watts to 100W  and then jump to 300W and then to 600W.  Really?  No 200W?  Sigh.  I grabbed the 600W power supply version.  To supply the AC power, I picked up a 300W 24V AC to DC converter.

What’s nice about the Drok power supply, is that I can supply constant voltage AND constant current.  LEDs have an upward sloping current draw relative to the forward voltage.  This means if you oversupply voltage, it’ll draw enough current to burn out.

Typical ways to drive LEDs include supplying a constant current, so that you can safely over drive the voltage, a resistor which will also limit the current, or constant voltage.  If you never go over the volts, the current draw will be just fine.  With this Drok boost converter, I have POTs that I can dial both.  I started at 24V and slowly adjusted both the current and volt POTs until I read about 170 Watts on the kill-o-watt.  Waddayaknow!  It worked!  It’s really… really bright too!


To finish off the light power, I put both the Drok buck boost converter, the AC-DC power supply, a couple fans, and  Drok buck 12 power supply in a nice case and mounted it in the redhouse.



Light Controller

At the moment, our lights are dumb.  They turn on and off manually and do not care about sun.  We need a smart controller.  I used the Particle Photon, which is a cheap wifi-enabled MCU that’s only $20.  I’ve been using the photon a lot lately.  This is actually the third unit inside the Redhouse and I plan on using at least one more.  We also need a sensor to measure how much light we are getting from the sun.  I had an SI1145 sensor breakout from adafruit laying around so I used that.

To control the LED brightness, I use a MOSFET.  By modifying the signal’s pulse width on the MOSFET gate, I can control the voltage allowed to pass through the MOSFET.  I wired everything up, wrote a few lines of code using the Particle builder and this is what came out:


The light sensor won’t work without light, so I need a case with a clear lid.  I found a waterproof project case on amazon that had a clear lid.  Perfect.  I installed the board in the case, wired it up, and installed it in the Redhouse.



How much did this cost me?  I try not to think about it, because I’m not building to necessarily save (although, I believe I am).  Here’s a list of components and their costs:

LED Light:

  • 6 x 30W LEDs –  ebay seller sungrowled – $77
  • Aluminum strip and screws – home depot – $15
  • 24V AC-DC 350W converter – – $35
  • Drok 600W buck boost converter – – $21
  • 5 x aluminum heatsinks – – $25
  • Power enclosure – – $30
  • Grow light hanger – – $10


  • Particle Photon Wifi MCU – – $20
  • SI1145 visible light sensor – – $10
  • MOSFET n-channel – – $2

Total: $245

For comparison, you can get a nice (but dumb) 160W grow LED for about $350.  No wifi/internet control.  No smarts.

I think I saved some bucks and get more features.  Here’s the final product growing some nice Roma variety tomatoes:


Do they work?  Early indications suggest they do.  The plants under the light look more lively.  One plant NOT under the light has a livelier branch under the light where the other branches are not as lively.  So, pending future observation, I conclude, it works.  I only have 2 more of these to make :).

Redhouse – System Test 1

I may have built up my own excitement, but the redhouse (geo-thermal “smart” greenhouse) is really coming together.  In theory, I can put my overgrown bathtub tomato plants tomorrow.  This makes me extremely excited.  On to the test.

This test will see if the pump, the piping in the beds and the irrigation system all work.  These are the questions this test was hopefully going to answer:

  • Will the pump have enough pressure to water both beds?
  • Will the holes drilled in the irrigation PVC spray acceptable water?
  • Are there water leaks?
  • How much can I water with a 7 gallon reservoir?

Most of the answers can be found in this video:

The short version of the test is:

  • Enough pressure? Yes
  • Holes? Acceptable
  • Leaks?  Yes.  Around the valves and in the pump box
  • 7 gallon enough?  Maybe not.

The reservoir is the biggest disappointment.  I quickly ran out of water in the 7 gallon barrel during this test.  Further, it fills up slower from the rain water store than I can put into the soil beds.  This will likely limit my watering to only a couple minutes at a time.  I will also have to be careful not to run out of rainwater.  If I need 14 gallons per day of water, I’ll only have 7 days in the store (two 55 gallon tanks).  It is possible to use my brothers two barrels.  That will give me a couple weeks and worse case I can fill up the tanks with house water.

Next test should be hooking up the controller.  We should be able to start getting some measurements to see the benefits of the geothermal system.

Geek Home Theater Update – Minnowboard Max and lights in action

Quick update to the home theater system.  I installed the max with silverjaw lure (adds mpci-e and msata).  To attach the lights, I also required a level shifter to take the 3.3V up to 5V required by the Apa102’s.  Adafruit had just the component for the job: The 74AHCT125.

Here’s the panel with the max in there:

The results are pretty awesome.  The APA102’s peform much better than the WS2801’s.  No flicker.  Fast, and most of all, more lights!

Next up is to add some buttons to turn the thing off when needed and add USB capabilities and a remote.