Sunday, December 13, 2015

Antenna Pre-amp - Part 2 - Second Attempt

As I noted in my last post, I was fairly sure my pre-amp was not working correctly and I was going to try to recommended layouts from the designer (as indicated by another hobbyist who drew up the layout and posted it here). Here are the two layouts, side by side:

My layout (1st attempt)
Designer's layout (2nd attempt)
The big difference between the two designs is the amount of ground plane on the top layer. Both designs have the entire backplane acting as a ground and I mistakenly thought this would be enough. The designer's layout has most of the top layer also acting as ground. And as you might suspect, it made a world of difference. 80mA steady-state current (both with and without input and output termination) and cool to the touch with a nice, big heat-sink.



Its amazing to think that layout made that much difference but this is the world of RF where crazy things happen all the time.

Saturday, December 05, 2015

Rental Beast

I had a business trip last week to Seattle and due to my route cutting through the mountains in winter, I asked for an all-wheel drive rental car.  What I got was a beast.



Aside from needing to get over the mountains, this was exactly the wrong car to drive in a dense urban area, park in a garage with narrow spots, and try to make get back home through rush hour traffic.

But this is not a story about the mismatch between large vehicles and Seattle. This is a story about buttons.





I have never been a car with so many buttons. Quick, think of a feature a "fancy" car might have.

I'm not talking about things like powered seats, sunroof, and Sirrus/XM radio. Or even things like heated leather seats, built in GPS, back-up camera, push-button start or triple-zone climate control.

I'm talking about dynamic cylinder shut-down to increase fuel economy (we got over 19 MPG on the highway), cooled leather seats, and automatic windshield wipers that figured out how often they needed to swipe on their own.

And a vault hide your phone and connect to the media system while your in the store? It had that too.




Friday, November 20, 2015

Air Conditioner Measurement - Part 1 - First Cut


I was getting ready to update the hardware on my air-conditioner measurement system when I realized that I had never written about the initial set-up. So, several months after the fact, here's what I've been doing.

In my previous temperature measurement system, I was able to fairly easily measure the air-conditioner state by tapping into the relay that activated the central circulation fan. In this new house, that was not going to be so easy so I decided to try something more direct: measuring the condenser fan in the outdoor unit. I thought about tapping into the relay on that fan unit but that relay switches 240V and I didn't want to have to worry about making sure the wiring was properly protected for that higher voltage. Instead, I decided to measure the air pressure change caused by the fan turning on.

To do that I employed a BMP180 which measures both pressure and temperature.  I was able to get the sensor mounted on a little PCB and strap down an old milk jug to catch some of the air when the fan turns on, making a little pocket of slightly higher-pressure air. I wasn't sure if this was work but testing revealed the pressure increase was high enough for the sensor to clearly detect.


Air pressure capture for the fan. I've pulled the system for maintenance and it isn't shown.


I wanted to try to make correlations between outdoor temperature and air-conditioner run-time under the assumption that the air-conditioner would run longer when the outdoor temperature was higher. To do that, I employed one of the temperature sensors I previously used for indoor temperature measurement. Not being weather proof at all, I stuck it under the out-cropping on our house under, behind the air-conditioner. This is not ideal as it is very close to the ground (less than 6 inches of clearance) and natural air circulation is likely to not be very high. Its not great but it is out of the rain and is better than nothing. (I'm not able to use the BMP180's temperature sensor because the air blown by the air-conditioner fan will be hotter than ambient. The whole point of the outdoor half of an air-conditioner is to cool the hot coolant as a part of the thermal cycle.)

Since I don't have a real-time measurement system up and running to record the data collected, I decided to use an SD card logger commonly available for the Arduino platform. It is fairly easy to write specific values to the card and it includes a real-time clock to time-stamp each log entry. With this I measured the BMP180 pressure and temperature (the later just for fun), and the TMP36 outdoor temperature. I did this every 15 seconds and, through the use of an extension cord, was able to leave the unit plugged in, running indefinitely.

Here's the final schematic:

The two LEDs are diagnostic lights. The red one flashes every time the SD card is being written to and the green one is lit up when the system is powered.

Here's the hardware, pulled out for maintenance:
From left to right: Interface PCB for LEDs and TMP36 module, BMP180 module, SD card logger on top of an Arduino Uno, and TMP36 module.

And here's the code. Not all of it is working at present, such as the time measurement, but the core measurement functionality has been working great.

Thursday, November 12, 2015

MIDI Controller


A nerdy friend of mine plays electronic keyboard at his church for Sunday morning services. He's expressed a desire to have some kind of controller he could use for the bulk switching of settings between or during songs. He knows that its very possible to do this with MIDI, the protocol designed for communication between electronic instrumentation. Lacking a convenient controller, though, it wasn't possible to actually make this happen.

For his birthday, I decided to make him an Arduino-based MIDI controller. Not knowing the exact use-case he had in mind, I tried to make it as generic as possible without getting caught up in feature creep. I decided to go with two foot pedal inputs, four LED outputs, a MIDI in, and a MIDI out.

Here's the schematic:


I spent a little bit of time putting in hardware switch debounce that ended up working pretty well. The foot pedal jacks had the extra contacts to indicate when the pedals are plugged in, allowing for some fancy software mode-switching if so desired.  Not having any MIDI equipment, I have blindly implemented online schematics; let's hope it works. Oh, and due to the MIDI and the Arduino USB port using the serial port for communication, a hardware switch is needed to move the Arduino over into programming mode and switched back to run mode when its time to use the box.

So about the software. For better or worse, I'm leaving that largely up to my friend.  I've stubbed in a lot of code to demonstrate functionality and I don't expect that he'll have any trouble making this do exactly what he wants but I feel a little bad that this isn't a fully-realized product. Thankfully he's a nerd and I expect he'll enjoy completing this last little step on his own. Plus he'll get to make it do exactly what he wants it to do. Nothing beats fully customized electronics.

Here's the assembled kit, all done up in a cheap enclosure I got off of eBay.








Saturday, November 07, 2015

Antenna Pre-amp - Part 1 - First Attempt

On the to-do list since we moved: get my amateur radio station set back up. We have a larger yard and a two-story house and I've been scheming of how to make best use of the space without running afoul of the wife, dogs, and neighbors. In the vein of taking baby steps first, I'm going to try putting in a shortwave listening antenna but rather than going up high like you might think antennas should, I'm going to be placing this one six feet or so off the ground along one of our fences. From what I've been reading, this style of antenna (something like a Beverage but not exactly) is very good and not picking up noise. It is also not very good at picking up radio signals but better at not picking up noise.

OK, let me try that again. The antenna reduces the amount of noise it picks up more than the amount of radio signals I might want to hear. This reduction in the signal-to-noise ratio is great but it has the side-effect that you need some way of boosting the signal back up to a useable level. To provide this boost I'm building a small amplifier called a "pre-amp" that will go in between my radio and the antenna.

The design I'm using  is one I've found with extensive documentation. The designer, Larry (call sign W7IUV),  has put a lot of time into building, testing, and documenting his work; this is very helpful for people like me who have not spent any time in building radio-frequency circuits before. In fact, I'm going to be copying an entire portion of his radio set-up by also building a few switchable attenuators like he has; I have no idea how effective the antenna and pre-amp will be.

After ordering the required parts and finding some cheap scrap PCB on eBay to use as the circuit board, I went to work making the cuts in the double-sided PCB to form the nodes in the circuit. The designer used a Dremel to make the cuts in his PCB but lacking such a tool, I used a utility knife. As you can see, mine didn't turn out super neat but it was good enough. (I took the picture after starting to populate a few of the capacitors.)




As you can see in the photo, the parts span the gaps in the copper, connecting the various nodes. The back side of the board is ground and I drilled a few vias to connect a few top-side ground pads to that larger ground plane. The RF-gurus say having a big ground plane helps reduce noise in the circuit; sounds good to me.

Here's what things looked like after I fully assembled the board:


(The components sticking out the sides are just resistors used in testing and not part of the pre-amp proper.)

Construction and testing of the circuit revealed a few problems:
  • The largest by-pass capacitor, a 4.7uF tantalum, shorted-out on me twice. I don't know why this is happening. The input voltage is ~13V and the capacitor is rated at 50V. I don't know if I got a bad lot or if I'm doing something wrong. It may be related to the other problem I'm having...
  • The amp draws ~110mA, documentation says it should be somewhere more along the lines of 75mA. The testing process suggests making a comparison in the amount of current drawn when the input and output are terminated (as shown in my picture) and unterminated. If the current goes up when it is unterminated, the designer says this is an indication that the tran-sistor is oscillating at a very high frequency. I don't see a difference terminated vs. unterminated; its just high all the time.
Maybe the two are related, maybe they aren't. Maybe my pre-amp is oscillating, maybe it isn't. The good news is that I found somebody (WD8DSB) who, based on the pictures the designer provided of his pre-amp, made up a diagram of showing how the designer laid out his board. I've got the components and now that I've built it once, the second time shouldn't take too long. I plan on building this second version following his plans and comparing the current draw to the first. Stay tuned....

Monday, November 02, 2015

Voicemail

Our phone system at work is set up to send us a text transcription of each voicemail we receive, called a "Voice Mail Preview". I guess they don't want to claim it is actually a transcription because of situations like this:


Hi it's your wife they bury in asleep please call back thank you bye.

Maybe somebody came to our house and buried my wife alive while she was taking a nap and she's kindly asking me to call her back.

Or maybe its something else.

Either way, I should probably give her a call and see what's going on.

Thursday, October 15, 2015

An Example of What I Do During the Day

My day job is at Pacific Northwest National Lab working in the Electricity Infrastructure group. Most of the time, best case, the conclusions from my weeks or months o work ends up as part of a report. A technical report full of terms most people don't need to understand and even those of us who care about such things resent having to read. A lot of times the report is public because it was funded with government dollars but when was the last time you went looking for a report by a government contractor on ANYTHING you were even slightly interested in? Let's just say, as a rough approximation, that a lot of what I write is not read by many. (Probably including this blog. Hi, Mom.)

But this project I just finished is different. I was part of a small team that made a website that estimates the emissions impacts of various smart grid project.  People more gifted than I did the actual website coding but I had a significant hand in the design of the analysis engine and wrote most of the code that performs those calculations. The site is called the Emissions Quantification Tool and there are people out there who are very excited about it.  It was even mentioned by the Secretary of Energy, Ernest Moniz. (Around here, we call him S-1.)

So go and enjoy; play around. The easiest project to start messing around with is solar PV; that's the one I go to when I wanted to verify some general functionality. Play around with the graph at the bottom of the page. If you really want to be surprised, check out the impact that energy storage has on emissions.

Its nice to have work you can take pride in be so publicly placed.

Monday, October 12, 2015

Hot Air Balloons

A few weeks ago we took an early morning trip to see a hot air balloon launch in a nearby town. I hadn't been to one since I was a kid and my wife had never been before.









Just as the balloons were due to launch, the wind picked up and gradually, the pilots concluded, each on his or her own, that they weren't going to fly that day. We were one of the last to leave, hoping that somebody might take the chance. The upside: we got to see how the balloons are deflated and repacked.










Wednesday, August 05, 2015

Washington Westside

Photos from a weekend trip we took a few months out to the west side of the state.  We live in the dry, desert half (as you can see from my Pallouse Falls photos); this part of the state is what people think of when we say we live in Washington.


The famous Skaggit Valley Tulip Festival. Abnormal spring weather this year meant by mid-April, when we took the trip, most of the flowers were gone.






 We spent that evening on Fidalgo Island.





Wednesday, June 10, 2015

Voltage on a Dying Car Battery

The battery on one of our cars is dying.  It has been since this past winter when my wife found herself unable to start the car, slightly upsetting her plans for the day. Being the data-nerd that I am, I wanted to see if I could capture the last gasps of this battery as the cold of the winter drove it to its end. I had a little flash memory chip I had never used and this seemed like a great opportunity to put it to use.  It was only 16 Mbit but recording binary value at a low data rate could stretch that out for at least a month.

Here were my design objectives:
  • Use the Atmel AT45DB161D 16 MBit flash memory I've had laying around unused.  This would involve writing my own serial interface code for hardware, something I had never done before.
  • Use a real-time clock (DS1307) to generate the timestamps for the data logging.
  • Log the temperature as well as the battery voltage to see what affects that may be having on the former.
  • If possible, figure out a way to log at high speeds while the car is starting to see how far the voltage depresses.

Below is the circuit I ended up implementing.

The blue PCB at the bottom is the DS1307 real-time clock module I purchased off of eBay.  The DS1307 is not the king of accurate time-keeping and over the month or so of data-logging the clock drifted ten or fifteen minutes.  This was completely acceptable for my work. There is some Arduino code out there designed to help compensate for this drift and maybe one day I'll try incorporating it.

On the left is the TMP36 temperature sensor, the workhorse of my previously implemented home temperature logging system.  Again, not super accurate and, again, close enough for my purposes.

Down in the right corner is the new flash memory chip I learned to use.  It took me too long and I made many, many mistakes trying to interface with it correctly. A logic analyzer would have saved me from hours of my mistakes and I may get something like the Bus Pirate before I undertake such a project again.

Part of my problem ended up being due to the Arduino clone I was using: the Ruggeduino. I don't know if there is something wrong with mine or if there is a design flaw but the SPI bus was not working with 100% accuracy.  Bits were getting flipped and as soon as I tested the circuit on a standard Arduino, it started working. I haven't dug into the problem so I have no definitely answers as to what exactly is wrong.  This is how superstitions get started.

The LED below the flash chip was used as a simple status light.  The switch next to that was used to trigger a high-speed-logging mode during engine starts.  I wanted to trigger this off the start relay but putting a lead on the relay prevented it from seating properly in its socket.  I messed with it for an hour with no luck so had to settle on the manual switch.  To trigger it, I would pop the hood, press the button, quickly close the hood and start the car.  Needless to say, there were only a few engine-start events that got logged.

Lastly, the voltage divider on the right was used to measure the battery voltage.


And now the results.

As you look at these graphs, note the time scale.  Each major division is one day and this is the car that my wife used for running errands.  The drive time hardly shows up at all; just a series of spikes in temperature and voltage (due to the alternator charging) followed by long decays in both.



There are a few points of interest to me.

  • The top graph shows a period when the car was unused for about three days.  You can see the temperature rise and fall a little each day following the ambient temperature in the garage.  The battery voltage on the car fell a few tenths of a volt over that time.  Since the car is unused, this is the open-circuit voltage of the battery which I think we would expect to be much closer to 13V, even in the cold.
  • The bottom two graphs do capture car start events (yeah!).  Both show battery voltage falling below 9V.  I don't have any idea how acceptable this is but it seems kind of low.  
My plan is to maybe do a little more testing, at least next winter and perhaps now in the hot summer to collect a bit more data.  Sometime this upcoming winter we'll replace the battery and I'll do more testing then to see how a fresh battery performs.

Friday, June 05, 2015

Mt.Rainer Camping Trip

Memorial Day weekend was our first camping trip since moving to Washington.  It was a west-side, wet-side trip, though the rain was mild and mostly overnight.  Compared to our friends who were camping with smaller children, our set-up was quaint and manageable.  One tent, cooking over the fire, dogs sleeping with us at night. Even with that, it filled our little SUV all the way up. If we do this again, we'll almost certainly have to use the car-top carrier.


A tree in our campground that looked like it had been felled very recently.




 Basil guarding the tent.



Volcanic-formed craziness seen near Mt. Rainer.



The best look at Mt. Rainer, as seen on the drive home.

Wednesday, June 03, 2015

Dragonfly

Hanging out on our fence, not too concerned about me getting VERY close for these pictures.




Friday, April 24, 2015

Front Yard Landscaping - Mostly Complete

The curbing is installed, the rock is in, and the plants have been planted.  Comparing to what we had last time, here's what things look like now:






We're still working on the lawn, trying to adjust the sprinkler system to water properly.  Its more or less done, though.