Sunday, February 26, 2017

Boards, boards, boards...but everything sure does look nice!

Things are moving along nicely for the energy monitor, and I've had a lot of fun designing boards for everything. As soon as I can get everything stuffed, I'll probably pull the old wireless sensors off the wall and put the new boxes in. 

The multivolt expansion boards came back from the manufacturer, and are ready to be stuffed. I have the jacks onboard, but nothing else - the LEDs, power conditioning, and input connectors will have to wait until I have more time.


Here's the family, in various states of assembly...

A couple of things to note, I decided to use some TO-92 heatsinks I'd collected over the years as a heat collector. That is, the DS18x20 in the upper left (sorry, black on black is hard to see...) now has a heatsink on it. Instead of getting rid of heat, it should get more surface area exposed to the air and hopefully provide a more accurate temperature measurement.

Second, and this is entirely my fault, the parts I ordered were not DS18S20, as claimed by the vendor, but DS18B20, which won't work at all if your device is expecting an older part. I ordered them, was told they were correct, and set them aside (without checking) until far too late. While some of the special-purpose embedded devices I use can't see them, I'm lucky that my chosen control board for this system has no problem with them. I learned my lesson: Always check your parts on arrival!

Last, but not least, as the loop expansion boards seem to work, I'm going to beef up the V+ tracks and send them off to have a production run made. I've seen a lot of board houses that can run 100 units for about $120, and use special color and masks to boot. Probably should order a  sample run first, though...

Tuesday, February 7, 2017

The one-wire-loop expansion board.

Yesterday evening, I received my generic expansion board (The One-Wire-Loop) back from OSHPark, and everything looks good. While I had originally planned this as a one-wire board, I figure it can work equally as well for any low-speed data, like serial or I2C.

The first example built up, sans the DS18X20 in the lower right corner, is ready to test in a live system.


With this board and the precision rectifier, I should be ready to start hooking up devices in their final configuration. Now, to just find the time...

Wednesday, January 25, 2017

Accessories and peripherals time!

Part of any good system is the amount of expansion that it offers. As I'm building my own components, I can build in as much expansion as I want.

As most of my components are going to run on 1-wire or powered I2C, I chose to go with the venerable modular jack for an expansion interface - in this case, the "5222" 6P6C style connector. They're common enough that you can buy them bulk for a few dollars on the web.

Since boards are so cheap, I've laid out my own board. 6 "5222" connectors, with the capability to add both power and a DS1820 sensor (if using 1-wire systems.) Otherwise, the DS1820 can be omitted. There's some minor power filtering on the board, and the 1-oz copper should handle 800mA or so with no issues. Anything more than that would be cabled direct anyway.



The top of the board offers the I/O connectors, an LED for any power that may be supplied, and a spot for a DS1820 sensor. Currently, I'm using AVTech Room Alert devices, and this board's DS1820 sensor is wired to follow their color code. That's completely optional for other devices. There's also a pullup resistor wired into the Data/VCC lines. There's a lot of discussion on the necessity of this, but it's there. Just in case...


The bottom has the filtering for the power and the resistors for the LED and pullup. A IPC-7351\Chip-CaseC capacitor for ripple smoothing and a single 0805 for high-frequency noise reduction. All mount holes are ground plane.

The boards are shared on OSHPark, feel free to use them.

There's not a whole lot going on, but I can make these by the dozen and drop them in where needed.


5222 "6P4C" connectors. Just remember the pin numbers are different than a 6P6C!

Wednesday, January 18, 2017

Testing the precision rectifier circuit...are those parts marked right?

My boards came back from OSHPark late yesterday afternoon, so I went ahead and built one up this morning. Most of the parts came from new stock or the shop's parts inventory, but the diodes did not - germanium diodes are easy to get if you buy packs of surplus Soviet parts on eBay, but buyer beware!

As with the other boards I've purchased from OSHPark, all the text was nice and clear, holes were clear, and the solderability of the board was excellent. It went together quickly and easily.

(In retrospect, I should have noticed the diodes weren't right, but I haven't worked with Ge diodes for so long...)

Some quick checks on the board revealed that I had made a stupid wiring error. The input voltage was reversed. I have no idea why, other than I just didn't run the traces correctly. That was a simple fix, cut a track and run a couple of jumpers. After that, it came right up, all LEDs lit and no smoke!

Second issue was the LEDs are drawing way too much current. While 20mA isn't much, I want to keep the total draw down as much as possible, so I'm going to increase the current limiting resistors to 4.7k. I need them lit, not lighting up the inside of the box.

So, those problems are taken care of, and I've got it hooked into the electrical system here at the shop for testing, but it's not acting like I think it should. Everything is floating around way too much, and the outputs are going negative...

That shouldn't happen. I immediately suspect the diodes.

Off to the bench, a quick meter check reveals that the bands on the diodes are actually on the anode! Looking closer, I can see the point contact to the Ge is under the bands. Go figure! (Someone mentioned that it was marked like a selenium device...)

Here's a closeup, and you can see the cup with the wire coming out, and just make out the semiconductor material under the bands. What I find odd about this whole thing is I've seen other examples of this diode, and they were marked correctly. Oh well, now I know.


(The Russian D9E, or so the package says!)

With the diodes in correctly, it goes back to the test rig. Now, everything is working just as it should!


Perfect. The output jumps when my device activates!

The current transformers are just clipped on to the input to the box. I'm not worried about how much, just the absence or presence of current in this case. Calibration will come when the devices are secured and can't move around.


This test is successful. Time to button up the panel and get ready to build one for myself, and think about where things are going to be installed.

Wednesday, January 4, 2017

The energy monitor begins to take shape.

One of the interesting things the CAI board offers is some analog 10V inputs - DC of course, but this is perfect for getting some sort of data back into the system. It just so happens the clips I purchased for the energy monitor work in this range, so...we're back on!

First thing is to wrap up the board necessary to get the voltage off the current clip and into the system. Since I'm also designing a similar project for my employer, that was easy enough, and an order from OSHPark later, I have a board getting ready to be spun up (and partially paid for by said employer!)


This is the same precision rectifier circuit that I was working with last month, except the board is now laid out, a power converter chosen ( the EC3SA-12D05N from mouser.com ) and other parts ordered.

Other than the power converter, it's pretty old-school. TL084 op-amps and germanium diodes, chosen for their low voltage drop. If you want to order a set of boards for yourself, the project is shared on OSHPark's website, but I would suggest waiting until I can verify I didn't do something stupid, and can get a parts list together.

I should have them in about 2 weeks. Until then...

Tuesday, December 27, 2016

Upgrading the sensor pods: Boxing the boards.

Now that I've confirmed that the CAI board works, it's time to put it in a box. For this project, I used one of the boxes I'd originally purchased for the energy monitor project.



This was a wired alarm housing when purchased, although I discarded the alarm board after removing some of the more interesting parts, like nice screw-terminal connectors. (They have the same footprint as the ones I used on the purple alarm relay board.) I didn't need the built-in board, and most alarm manufacturers won't talk to you unless you have a license. Into the recycle bin it goes.

I've made some minor modification to the box, which includes drilling some new holes inside (the original push-lock standoffs were kept and re-used) and putting a meter on the front. Since this box will be talking to the leak detector box, I decided to add the meter to this one. As this will sit on the wall as you open the closet door, you can immediately see the meter without peering around the corner. It's currently displaying 13.5, which is being provided by a power supply.


Inside is still pretty sparse. I've placed the terminal strip for the incoming power, mounted the CAI board, and wired it and the meter in place and tied everything down. There will be another board under the terminal strip, probably a rectifier and supply board as I'd like to add a current monitor to the unit, but I'm not sure. Since I'm keeping the same form factor for everything, I went ahead and punched the pilots for possible mounts.

The CAI board is connected to the local network via a wireless adapter, aka a repurposed WRT54GL, that will probably follow it into the closet. Both units are perfectly happy running at 13.6V, so no other regulator is needed save the battery. (From what I can tell, the WRT54GL is good up to about 18V or so, and is probably good to around 10V on the other end. I have not verified this, so YMMV.)

Something I've read in a few places is these boards like to lock up after a few days when running with multiple DS1820s. I've placed a solderless breadboard in the bottom for now with 4 sensors on it to see what happens. So far, nothing other than good solid temps. As the CAI board is capable of reading I2C units, I also have a BMP280 pressure sensor mounted, although this isn't hooked up as of yet. That, and possibly an I2C RTC board are projects for another day.

Thursday, December 22, 2016

Thinking more about the energy monitor...

I had kind of given up on the energy monitor project for the simple reason that getting data into some useful form would be beyond what I have available to me at the moment.

However, opportunities present themselves in odd places. My employer needed something similar to monitor the lines of an air compressor to determine when the compressors are on or off. They didn't want to break the lines, so a non-invasive method of collecting data was needed.

Well, I had these clip-on current sensors from Seeed Studios left from my attempt, so I brought them in and measured the output to see if it would work. Yes, but the output of the clip is AC, and every device we have only measures a DC input.

Easy enough to solve, I pulled out an old design I had from the audio days, a precision full-wave rectifier circuit located on Page 234 of a book called "Encyclopedia of Electronic Circuits, Vol. 1" by Rudolf Graf. While some of the circuits in the book are less than useful due to age, incompleteness, or simply by being reference block diagrams instead of circuits, there are a few gems.

(This image is presented as a reference only.)

While I've made some changes to the circuit, using TL08x Op-Amps and germanium point contact diodes, output buffers and some minor output filtering, the circuit presented is doing the dirty work.

Since I have access to circuit board tools, I've decided to lay it out on a new board, give it it's own filtered power supplies, and add some easy-to-use connectors to it. What's amazing is how much bigger the diodes are as compared to almost everything else on the board, save the input connectors.

Then again, what's cooler than a 1N34A point-contact germanium diode in a glass case?


(image from https://www.banzaimusic.com/image.php?id=5047&type=D)

The board layout is the same form factor as my power supply and alarm monitor board, a size I've adopted for a lot of different things. Right now, I've completed the schematic (save the power converter, which I have not chosen yet) and am getting ready to see how well everything fits. Here's hoping I can get everything on this board!



Once it's all done, I'm going to work the design a little and begin the energy monitor project again.