Logger Device Tracks Amp Hours (Part 2)

Lead ImageWachsmann

Alternative Energy Sources

In this follow on to Part 1 of his story, Bill describes putting to use the amp-hour logger that he built using a microcontroller and a clamp-on ammeter. This time he discusses modifying the amp-hour software so it can be used as an analog input logger to measure solar and wind power. A small solar cell and a homemade windmill are used..

By William Wachsmann

2017-11-012-Wachsmann-Fig1

FIGURE 1 Amp-hour log for the Office Circuit over 24 hours. It adds up to 14.728 A-hours and 1.767 kW-hours at 120 V.

In November and December 2016, I monitored all the circuits in my house. Some of the results were eye opening. We have a shed/workshop that is spray-foam insulated, where—among other things—we store paint cans. It’s heated by a 240-V baseboard heater and in the winter, we keep the temperature at around 10°C or about 50°F. The amp-hour logger showed that the heater was coming on about 3 times each hour and stayed on for 7 to 9 minutes each time. When it was on, it drew almost 7 A. The spreadsheet (file: SteelShed.xls) with the chart for these readings is included with the code—see Circuit Cellar article materials webpage for links.

Over a 24-hour period this amounted to an energy use of 12.5 kW-hours. At the rate we pay for electricity, it was costing around $3 per day or $90 dollars per month. Needless to say, we got rid of the old paint and turned the heater off. Now I only heat it if I need to work out there and it would otherwise be too cold. Figure 1 shows a chart of amp-hour usage in our office where my wife and I normally have three computers and two monitors running. Over a 24-hour period we use 1.767 kW-hours costing us about $0.50 per day. That’s not too bad but it’s actually more than the refrigerator at 1.357 kW-hours.

Table 1 (available in full article) shows the results from all the circuits in our house over a 24-hour period. (Not all on the same day!) I have since turned off the ‘Steel Shed Heater’ thus removing its 12.5297 kW-hours. The daily total is 31.39 kW-hours and monthly is 941.59 kW-hours. As a sanity check, that is quite close to our annual monthly average about 950 kW-hours. I have previously looked into going completely off grid, but it turns out to be too costly—mainly because the payback period would be 12 years or more. This also applies to “feed-in tariff” programs where solar or wind generated power is sent to the grid. The amount paid for this power is subsidized, and is higher than what we pay. But it requires an investment of $30,000 or more—for solar anyway—and wouldn’t be profitable for 8 to 10 years.

There is one exception to getting off grid cheaply. We have natural gas, which at current prices could be used to produce electricity at half the price we pay for power from the grid. The first problem here is that the type of small generators I would need are sold as backup systems and are just that. In other words, they are not designed to run continuously. If I tried to do that, I would void the warranty and the generator wouldn’t last anyway. There are larger ones designed to run continuously and are made to supply power in remote areas. They will run on either propane or natural gas, but are much larger than I need and much more expensive. Second, they are noisy and neither us nor our neighbors would be too happy. …

Read the full article in the November 328 issue of Circuit Cellar

Don’t miss out on upcoming issues of Circuit Cellar. Subscribe today!
Note: We’ve made the October 2017 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

Logger Device Tracks Amp Hours (Part 1)

Measuring Home Electricity

Setting out to monitor and log electricity usage in his house, Bill built an amp-hour
logger using a microcontroller and a clamp-on ammeter. He gets into the software
development details exploring solutions like mbed and Microsoft Visual Studio.

By William Wachsmann

Like many people I found that electricity costs have been increasing rapidly over the past few years. Where I live, we have smart meters that allow the power company to charge different rates for high usage, moderate usage and low usage times of the day. The bills show how much energy is used during the different periods but only for the dwelling as a whole.

For this project, I used an NXP-Freescale FRDM-KL25Z microcontroller board.

For this project, I used an NXP-Freescale FRDM-KL25Z microcontroller board.

I wanted to know which parts of my house use how much electricity and at what times of the day. With this information, I would be able to see what parts of the house are using how much energy, and I’d even be able to calculate how much it’s costing to run certain appliances. I could then look into the feasibility of supplementing my energy supply with solar or wind, or maybe use a battery storage system that is charged in the less expensive hours for use during peak periods. Or perhaps even some combination of all three.

THE BASICS

To measure AC current, you normally use a “Clamp on Ammeter” on either the live or neutral wire in the circuit of interest. These ammeters are readily available but they will only tell you the current at the particular point in time that you are using it. What I needed was one that I could leave connected over a 24-hour period and get a log of the current usage throughout the day and night. If such a device exists, I was unable to find one, so I needed to make my own.

The device would have to monitor currents in 120 V and 240 V AC circuits and be reasonably accurate over a range of 200 mA to 30 A. The price we pay for electricity is based on kilowatt-hours (kW-h) multiplied by the rate— usually specified in cents-per-kWh. In my case, in the fall of 2016 we were paying an average of about $ 0.27 / kWh after all extra charges such as delivery and taxes were included.

Using the data from the amp-hour logger would allow calculation of the number of kWh used in each circuit of my house. Since kWh is a measure of energy I also needed to know what the voltage is at the time that the current is being measured. Then, given that P = VI, I would get a measure of the power being used at a given time. Integrating this over a period of time gives me the energy in watt-hours or—dividing by 1,000—in kWh.

To be really accurate, I should measure the voltage as well as the current but I have found that whenever I check the voltage it is pretty constant at 120 V (+ or – a couple of volts). Therefore, using a nominal value of 120 V (or 240 V for some circuits) should be accurate enough for my purposes. If the amp-hour logger is designed to save current measurements for each minute, that should give a pretty good indication of load changes in the circuit that is being monitored. Also, just adding up the amp-hour/minute readings effectively integrates them and provides the total amp-hours used over a 24-hour period. Multiply this by the voltage and divide by 1,000 and I’ll get the number of kWh used in a day. Great. That’s the theory. Now to make something that will work.

Read the full article in the October 327 issue of Circuit Cellar

We’ve made the October 2017 issue of Circuit Cellar available as a sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.
Don’t miss out on upcoming issues of Circuit Cellar. Subscribe today!

Power Modules Offer Day/Night Functionality

Saelig has introduced the patented Sol Chip Pak (SCP-R2801) Power Modules which offer day/night non-stop functionality by combining state-of-the-art solar cells, a rechargeable battery and advanced power management circuitry. These power modules include all the components that are required to harvest energy from ambient light, charge a built-in Saelig scp-power-modulerechargeable battery, and deliver a stable voltage to a load. Sol Chip’s patented technology integrates solar energy conversion with very large-scale integration (VLSI) techniques to produce unique ambient light harvesting devices that can even extract energy from office lighting to provide 24/7power. These versatile boards, based on Sol Chip’s unique Saturn cells, provide power even in office light conditions.

The output voltage of these “everlasting solar batteries” is regulated to 3.6 V, but other voltages are available by request to suit alternate applications. Versions are available with 1, 2, 3, or 6 Saturn solar cells depending on the power needs. The 6-cell version provides an average output current of up to 750 µA from the integrated solar cells, with up to 1.5 A peak current. The capacity of the 3.6 V on-board rechargeable batteries in the series is 190 mAh to 1,100 mAh.

Saelig | www.saelig.com

Solar-Power the Circuit Cellar (Free Download)

In the spirit of DIY engineering and solar power innovation, we’re re-releasing Circuit Cellar founder Steve Ciaria’s three-part series, “Solar-Powering the Circuit Cellar.”

An excerpt from the first article in the series appears below. And for a limited time, you can download the entire series for free. Enjoy!

The photos show the roof-mounted solar panels that produce approximately 40% of the total PV power. I know it sounds like a joke that the first PV system consideration is walking around the house and looking for the sun, but you can’t generate much energy if your panels are always shaded. When you live in the middle of the woods, finding the sun is often easier said than done.

Approximately 4,200 W of PV power is generated from 20 roof-mounted SunPower SPR-210 solar panels. The other 6,560 W comes from pole-mounted arrays behind this area.

Approximately 4,200 W of PV power is generated from 20 roof-mounted SunPower SPR-210 solar panels. The other 6,560 W comes from pole-mounted arrays behind this area.

Array orientation determines how much energy you can produce. Solar panels are typically aimed due south at a specific tilt angle that optimizes the incidence angle of the sunlight striking the panel. Maximum energy is produced when this tilt angle is equal to the latitude of the location (reduced by a location correction factor). Typically, the optimal tilt angle during the summer is the latitude minus 15°, and the optimal angle for the winter is the latitude plus 15°. Hartford, CT, is located at 42° latitude and the optimum tilt angle (minus an 8° correction factor) ranges from 19° in the summer (34° – 15°) to 49° in the winter (34° + 15°). The Connecticut rebate program suggests that if a fixed tilt is used, it be set at 35°. Of course, these are computer-generated optimizations that don’t necessarily accommodate real-world conditions. While it requires some nontrivial computer calculations to show authenticity, it is my understanding that as long as the non-optimal differences in azimuth and tilt are less than 20°, the loss in maximum power production is typically only about 5%. It is exactly for that reason that the most cost-effective PV installation is typically a fixed-pitch roof-mounted array.

Team installing solar panels on Steve Ciarcia's roof

Team installing solar panels on Steve Ciarcia’s roof

My system includes both variable and fixed-pitch arrays. The roof-mounted panels are located on the solarium roof and oriented at a fixed pitch of 17.5° facing SSW (see Photo 1). According to Sunlight Solar Energy’s calculations, efficiency is still about 92% of the desired maximum because the 17.5° roof angle actually allows higher efficiency during longer summer hours even though it isn’t the optimum tilt for winter.

Pole-mounted arrays are more efficient than a fixed-pitch roof array by design. My configuration is single-axis adjustable. The pole-mounted arrays are oriented due south and enable seasonal adjustment in the tilt angle to optimize the incidence angle of the sun. For everyone ready to e-mail me asking why I didn’t put in a tracking solar array since this is a pole mount, let me just say that you can also send me financial contributions for doing it via the magazine.—Steve Ciarcia, “Solar-Powering the Circuit Cellar (Part 1: Preparing the Site),” Circuit Cellar 209, 2007.

Check out some of Circuit Cellar’s other solar power-related articles and projects:

July Issue Offers Data-Gathering Designs and More

The concept of the wireless body-area network (WBAN), a network of wireless wearable computing devices, holds great promise in health-care applications.

Such a network could integrate implanted or wearable sensors that provide continuous mobile health (mHealth) monitoring of a person’s most important “vitals”—from calorie intake to step count, insulin to oxygen levels, and heart rate to blood pressure. It could also provide real-time updates to medical records through the Internet and alert rescue or health-care workers to emergencies such as heart failures or seizures.

Data Gathering DesignsConceivably, the WBAN would need some sort of controller, a wearable computational “hub” that would track the data being collected by all the sensors, limit and authorize access to that information, and securely transmit it to other devices or medical providers.

Circuit Cellar’s July issue (now available online for membership download or single-issue purchase)  features an essay by Clemson University researcher Vivian Genaro Motti, who discusses her participation in the federally funded Amulet project.

Amulet’s Clemson and Dartmouth College research team is prototyping pieces of “computational jewelry” that can serve as a body-area network’s mHealth hub while being discreetly worn as a bracelet or pendant. Motti’s essay elaborates on Amulet’s hardware and software architecture.

Motti isn’t the only one aware of the keen interest in WBANs and mHealth. In an interview in the July issue, Shiyan Hu, a professor whose expertise includes very-large-scale integration (VLSI), says that many of his students are exploring “portable or wearable electronics targeting health-care applications.”

This bracelet-style Amulet developer prototype has an easily accessible board.

This bracelet-style Amulet developer prototype has an easily accessible board.

Today’s mHealth market is evident in the variety of health and fitness apps available for your smartphone. But the most sophisticated mHealth technologies are not yet accessible to embedded electronics enthusiasts. (However, Amulet has created a developer prototype with an easily accessible board for tests.)

But market demand tends to increase access to new technologies. A BCC Research report predicts the mHealth market, which hit $1.5 billion in 2012, will increase to $21.5 billion by 2018. Evolving smartphones, better wireless coverage, and demands for remote patient monitoring are fueling the growth. So you can anticipate more designers and developers will be exploring this area of wearable electronics.

AND THAT’S NOT ALL…
In addition to giving you a glimpse of technology on the horizon, the July issue provides our staple of interesting projects and DIY tips you can adapt at your own workbench. For example, this issue includes articles about microcontroller-based strobe photography; a thermal monitoring system using ANT+ wireless technology; a home solar-power setup; and reconfiguring and serial backpacking to enhance LCD user interfaces.

We’re also improving on an “old” idea. Some readers may recall contributor Tom Struzik’s 2010 article about his design for a Bluetooth audio adapter for his car (“Wireless Data Exchange: Build a 2,700-lb. Bluetooth Headset,” Circuit Cellar 240).

In the July issue, Struzik writes about how he solved one problem with his design: how to implement a power supply to keep the phone and the Bluetooth adapter charged.

“To run both, I needed a clean, quiet, 5-V USB-compatible power supply,” Struzik says. “It needed to be capable of providing almost 2 A of peak current, most of which would be used for the smartphone. In addition, having an in-car, high-current USB power supply would be good for charging other devices (e.g., an iPhone or iPad).”

Struzik’s July article describes how he built a 5-V/2-A automotive isolated switching power supply. The first step was using a SPICE program to model the power supply before constructing and testing an actual circuit. Struzik provides something extra with his article: a video tutorial explaining how to use Linear Technology’s LTspice simulator program for switching design. It may help you design your own circuit.

This is Tom Struzik's initial test circuit board, post hacking. A Zener diode is shown in the upper right, a multi-turn trimmer for feedback resistor is in the center, a snubber capacitor and “stacked” surface-mount design (SMD) resistors are on the center left, USB D+/D– voltage adjust trimmers are on top center, and a “test point” is shown in the far lower left. If you’re looking for the 5-V low dropout (LDO) regulator, it’s on the underside of the board in this design.

This is Tom Struzik’s initial test circuit board, post hacking. A Zener diode is shown in the upper right, a multi-turn trimmer for feedback resistor is in the center, a snubber capacitor and “stacked” surface-mount design (SMD) resistors are on the center left, USB D+/D– voltage adjust trimmers are on top center, and a “test point” is shown in the far lower left. If you’re looking for the 5-V low dropout (LDO) regulator, it’s on the underside of the board in this design.

 

Electronics Workspace: Pure Function, Minimal Form

Engineering consultant Steve Hendrix of Sagamore Hills, OH, says the “corporate headquarters” of Hx Engineering, LLC, pictured below, “is pure function, minimal form, and barely fits.”

This basement workspace reflects Steven's diverse projects and clients.

This basement workspace reflects Steve’s diverse projects and clients.

It’s a home basement workspace that reflects a variety of projects and clients. “I do a range of design work, from transistor-level hardware design through microcontrollers and FPGAs, as well as the embedded firmware and PC-side software to run the products,” Hendrix says. “Most of my clients are small to medium businesses in northeast Ohio, although I’ve done designs for companies as far west as New Mexico, as far south as Florida, and as far east as Cypress.”

Hendrix describes a workspace layout that stresses utility and a certain attention to thriftiness:

As I look through my equipment, probably the central theme is cost-effective solid equipment, without necessarily being the ‘first kid on the block.’ I learned long ago to be the second kid on the block with the newest toy… er… TOOL. The early bird gets the worm, but the second mouse gets the cheese.

He provides the following detailed description of his equipment and desk, which is a very large, solid-core door purchased cheaply from a lumberyard because it had been damaged:

Being natural wood and not plastic, it makes an inherently anti-static workstation. I used a router to round the front edge to be a bit friendlier to elbows, and carefully trimmed it and wedged it between the wall on the right and the utility room wall on the left, supported by vertical plywood against the walls. My PCs are in the adjacent utility room so I don’t have to listen to fans all day and they’re up on custom brackets on the wall so I don’t have to shinny under the desk to get to them. All the wires pass through plumbing fittings in the wall. The main work computer runs the lower dual monitors. The next-older work computer is still used for some specialized hardware, via the monitor above and an extra mouse. Under the left monitor is an all-band receiver that I sometimes use to monitor equipment under development, but also listen to broadcast music.

My late father-in-law was always extremely thrifty, and salvaged the flatbed scanner at the top left from a dumpster. It’s turned out to be the best scanner I’ve seen, and I used it to scan their family pictures. There’s also an HP Photosmart scanner that’s excellent on slides and negatives.

The middle stack has a parts cabinet that I really should retire, holding mainly SN74 series dual in-line packages (DIPs) that I very rarely use these days. Below that is an Ethernet-enabled power switch that controls various equipment. Next down is my trusty old Tektronix TDS-220 oscilloscope

I was pleased to note that past contributors to [Circuit Cellar’s Workspace feature] also use that same scope. It was the first digital scope I ever encountered that wouldn’t fib to me about aliasing, and it’s still a real workhorse. The ability to do screen captures with the free PC software helps a lot in documenting a finished product and in discussing problems remotely. Below that is a very solid bench multimeter. If it just had a capacitance function, I could abandon my Fluke 12! Then there’s a basic analog function generator, and some manual switches for AC.

Over on the far right are some more parts cabinets, several power supplies (including the ±5V/±12V supply my dad helped me build during my very first excursions into the then-new SN74 series of logic), an RF signal generator, and a good old boat-anchor Hewlett-Packard (HP) spectrum analyzer. I got that one off eBay, and spent as much again to get it repaired and calibrated. It’s in many ways better than the newer instruments. If it had a synthesized local oscillator and a computer interface, it would do it all. Actually, I have on occasion faked a computer interface by connecting the video outputs on its front panel to my TDS-220, and then capturing the resulting waveform.

In front of that is my solder station and stereo zoom microscope. Sitting on its stage is a backup prototype identical to the one currently controlling 4,800 W of my total 6,800 W of installed solar capacity. I routinely do prototypes using 0603 parts and recently more 0402 parts, with occasional 0201 parts. Don’t sneeze around those! The cabinets on the right wall are mainly connectors and surface-mount parts.

I needed some more bench space for a project, so I added a “temporary” shelf between the right end of my bench and the bookshelves on the wall to the right. As you can imagine, the “temporary” part of that wasn’t. So now it holds a voltage standard, on which sits my solder station and a ham radio. The latter is powered directly by 12-V solar power. At the extreme right are an inverter connected to the same solar batteries and the side of a breaker panel that allows me to safely connect to those same batteries when I need a heavy-duty 12-V power supply.

The whole office is lighted by strips of white LEDs run directly by 12-V solar power. The self-adhesive strips are just stuck to the drop-ceiling rails on each side of the standard florescent fixture. The standard fixture is still present and functional as a backup, but the solar lights are actually brighter and don’t flicker like a florescent. The 12-V solar is also wired to the rear jacks of the HP multimeter, so I can get an instant reading on the battery charge state. I have future plans to move some or all of my office circuits to the 120 VAC solar power that runs a portion of our home.

To the right and out of the picture is a solid wall of bookshelves that I built to hold databooks when I first set up this office over 20 years ago. The Internet and PDFs have pretty much made that obsolete, so those shelves now hold various supplies, projects in various states of completion, and some archival data. Behind me as I take this picture is a long table, made of another big door sitting atop filing cabinets. My original intent was for the desk to be for software/firmware, and the long table to be for hardware. Indeed, there are still a couple of RS-232 lines up through the ceiling and down to the table. However, now it serves as an assembly area when I have contractors doing assembly, as well as for storage and general workspace. But there’s Ethernet available on both the desk and the bench, for connecting Ethernet-enabled prototypes.

The biggest drawback to this office comes on a clear, cold, sunny day. The upstairs has lots of glass, so it absorbs lots of free solar heat. However, that means the furnace doesn’t run at all (even near zero outside), so the office and the rest of the basement get really cold. But since the furnace blower is on solar power, which is abundant under those conditions, I just force the blower on to share some of that heat!

If you’re interested in learning more about Hendrix’s work, check out our member profile posted last year. Also, be sure to pick up Circuit Cellar‘s upcoming July and August issues, which will include Hendrix’s two-part series on his personal solar-power setup.

These solar panels are mounted on Steve's east-facing roof.

These solar panels are mounted on Steve’s east-facing roof.