Previous Articles »
« Recent Articles


Generic tech stuff
Electronics | Jabber | Google Talk | Apple | Security | IPv6 | 6LoWPAN

Amateur Radio

Friday, September 9, 2011 by darco

The home automation project that I've discussed a lot on this blog got me interested in how radios work. When I started it all seemed a bit magical.

Then I went ahead and built the IM-Me Spectrum Analyzer, and I was fascinated. I could now see how the radio spectrum was being used in real-time. I started to wonder, what were those blips around 430-460MHz? It turned out a large chunk of it was an amateur radio band. My curiosity piqued, and I knew what had to happen next.

I got my amateur radio license (Callsign: N6DRC) a few weeks ago, and I love it. I highly recommend anyone even remotely interested in electronics, radio, or public safety to go out and get at least the technician-class license. Best twelve bucks I ever spent.

From the public safety perspective, when TSHTF and your power is out and your cell phone doesn't work the hams are the only ones who can communicate easily. I don't want to be just another casualty who is at the mercy of others when the big one hits. I want to know what's going on around me in an emergency situation, and be able to let others know when I or someone I care about needs help.

From the curious engineer perspective, the deeper I dive into this stuff the more parallels I see with the world around me and the projects I've been working on. For example, a new approach for the soil moisture sensor might be to treat the length of the sensor as an unterminated transmission line. My measuring the time and magnitude of the reflections I should be able to calculate the dielectric constant of the soil and thus determine its moisture content. Maybe.

Square One

Thursday, September 8, 2011 by darco

bad-sensors/DSC_2389 It has been a few weeks since I have updated this blog about how the whole soil moisture sensor project is going. I've had lots of ups and downs along the way, and I've learned quite a bit more about electrical engineering and materials science that I didn't have a firm grasp of before I started this project. Unfortunately, I've encountered a significant technical setback which necessitates abandoning my current approach and all but starting over.

Read the rest of this entry »

Hackable Christmas Lights at Costco?

Thursday, September 1, 2011 by darco

I've heard that the hackable RGB christmas lights I blogged about are once again available at Costco. I haven't had a chance to run by Costco in the past few days, but when I head over to pick that up I'll be sure to grab a string and see if it uses the same protocol. Who knows what other sorts of hackable holiday cheer they might have.

I've run out of Tazo Chai Latté mix, so a Costco run is imminent. *twitch*

Capacitance Sensing

Thursday, August 4, 2011 by darco

Update: After building out a few more boards and doing some additional testing, it seems as though things aren't quite as bad as I originally portrayed them in this post—the boards I made may still be usable as designed, albeit with a few quirks. However, I will be incorporating the design changes outlined below into the project for future devices to improve the consistency and performance.

After building out a few of the soil moisture sensor boards, I'm starting to think I may have been a bit hasty in ordering forty of them. The biggest problem I'm running into is noise. Lots of noise. Practically unfilterable noise, the nature of which is entirely dependent on material the sensor is embedded in. It is as if the sensing plane is acting like a large antenna, picking up all sorts of crap.

Some noise is actually a good thing, because it acts as a dither. allows me to super sample the capacitance and get a filtered result that is of a higher resolution than that of a single sample. Without any noise supersampling would not yield any better results.

But this kind of noise is on a whole different level. About the only thing these sensors (as currently designed) are good for at the moment is as a touch sensor... Which happens to be exactly what the capacitive circuit I borrowed from the QTouch guidelines was originally intended for.


QTouch capacitive sensing channel schematic from the Atmel QTouch Library User Guide.

I am not an electrical engineer, so when the QTouch sensor design guide said on page 2-1 that the measurement circuit was capable of measuring capacitance down to a few femto-farads, I believed it—even though the circuit made no sense to me (See figure above). Initial testing seemed to indicate that the method did work to some degree, so I went with it. I now see that was a mistake; I should have trusted my instincts more.

This is not to say that my original capacitance sensing circuit (which simply discharged a capacitor thru a known resistance) was any better. Looking back at it, I think that it would likely be just as susceptible to noise as the QTouch design.

In order to keep moving forward with this project, I've come up with an entirely different circuit that should hopefully prove to be far less noisy than the previous methods:


New low-noise capacitive sensing circuit.

The circuit actually works in the way that I originally imagined how the QTouch sensing circuit would work. What we do is charge up the capacitor we want to measure using a pulse, and then wait a little bit for this charge to distribute to the holding capacitor. We calculate the capacitance of the target by counting the number of pulses it takes before the sensing pin goes high.

While we end up operating this circuit in close to the same way as the QTouch method, the results are interpreted a bit differently. For example with the previous capacitance measurement fewer pulses meant less capacitance and more pulses meant more capacitance. In this circuit however the opposite is true: fewer pulses means more capacitance, and more pulses means less.

There are three things I really like about this circuit:

  1. It effectively has a built-in low-pass filter, so it should be less prone to noise.
  2. It doesn't increase the part count.
  3. There are upper and lower bounds on the capacitance reading, whereas with the previous method there was no upper bound on the number of pulses required to measure a capacitance.

Unfortunately the resulting pulse count does not have a linear relationship with the actual capacitance. This means that some sort of compensation (via a look-up table or other methods) will have to be performed to get a linear output.

New sensor orientation

Since I'm going to be re-designing the board yet again, I might as well make a few more radical changes, right?

One of the problems with this sensor is the fact that the electrodes are not only parallel, but they are also co-linear to each other. Ideally a capacitor is made like a sandwich: two electrodes with a dielectric between them.

While the "ideal" case might not be such a good idea in this case, I think I may have come up with a compromise: have two circuit boards that slide together so that the electrodes are oriented 90° from each other. I took a Dremel to two of the boards to start to put together a prototype:


Dual-board moisture sensor prototype. Work in progress.

As an added bonus, this sensor should be significantly more sturdy than the previous single-board design, while being more sensitive. Of course, it could just not work at all. We'll see.

Read the rest of this entry »

Moisture Sensors Arrive

Wednesday, July 20, 2011 by darco

The circuit boards for my soil moisture sensors arrived yesterday. I ordered four panels with ten sensors each, for a total of forty sensors. I ended up receiving five panels—25% more than I ordered—at no additional cost.


I populated one sensor last night and put it thru a quick smoke test this morning. No smoke, and it seems to be working fine. Unfortunately I won't have time to populate any more until next week.

The carefully observant will notice that despite my previous claim that I had created the "final" layout weeks ago, the layout has indeed changed once again. It turned out the edge connector wasn't the best idea, so I've settled on a shrouded locking 3x2 right-angle header for the connector.

Strange Oscillations

Tuesday, July 5, 2011 by darco

I stuck one of my soil moisture sensors in a potted plant last Friday before I left for a weekend trip. It was working fantastically. I watched as the soil moisture reading increased as I added water to the plant—working exactly as expected. However, when I returned Monday evening, I noticed that the values were all over the place. I took some samples on 100ms intervals and plotted the results:


Oh my. It's oscillating with an amplitude of around 10% of the capacitance reading. Not only that, my readings are an order of magnitude larger than what I was getting on Friday—when if anything they should be smaller.

I'm wondering if the 60Hz mains frequency is somehow affecting my readings, which would imply that what I'm looking at is the alias of 60Hz sampled at whatever interval I'm polling sensor. The power company regularly adjusts the frequency by ±1Hz or so, which could explain why I didn't notice the ripple earlier (Slight changes in the mains frequency would yield large changes in the alias frequency). This doesn't explain the large increase in the reading, however.

I also noticed some interesting behavior back on Friday. Whenever I grasped the stem of the plant, it caused the moisture level to increase. This makes sense, now that I think about it, but the implications are that each soil moisture sensor may have to be individually calibrated for differences in soil type, amount of soil in potted plants, etc. Not ideal, but not a show-stopper either.

Obviously, still some kinks to work out.

I hope to have the wire protocol solidified this week, at which point I'll actually deploy a few of these things in the yard to see what kind of readings I get. Should be interesting.

Final Soil Moisture Sensor Design

Tuesday, June 28, 2011 by darco

I think this is the final re-design of the soil moisture sensor that I will be sending off to Gold Phoenix for panelization and a small production run.



Just seven parts: two capacitors, three resistors, one ATTiny25 and a circuit board. I switched over to largish surface-mount parts and an edge connector instead of a standard 3x2 header. This board will be able to temperature-compensate using the on-board temperature sensor on the ATTiny25. I've also increased the length of the sensor to nine inches. Here is the schematic:


By my calculations I should get back around twenty to thirty boards. Should be more than enough to cover the front and back lawns and the garden. Now to just work out how to wire them all up...

Soil Moisture Sensor Update

Friday, June 24, 2011 by darco

I've heard a lot of feedback on my soil moisture sensor project, and I wanted to update everyone on how it is going.

Last weekend I did a lot of work on these devices and I've made some significant progress. I now have the firmware to a point where I can remotely communicate with the sensor, perform readings, etc. I've also made a few observations after working with the most recent board layout.

Read the rest of this entry »
Previous Articles »
« Recent Articles