Sunday, April 13, 2014

GPS reverse geocache backpack design

I've finalized the design of the GPS reverse geocache backpack.

The schematic

The heart of the system is the Adafruit Ultimate GPS module. It requires 3 volt power and logic, so it will have its own 3.3 volt regulator, and the TX serial line will be level shifted with a diode and resistor. In order to insure that the GPS module will warm-start when powered on, the backup pin will be connected directly to the battery pack.

The system is powered by two 1.5 volt alkaline batteries. Whether you go with AA, C or D depends on how long you need the box to be able to operate. The battery input is pushed up to 5 volts by an NCP1402. That 5 volts directly feeds the controller, but is switched by the controller to power both the GPS module and LCD panel (both at the same time - if the display is on, then so is GPS), as well as separately turning power on to the servo output. The battery voltage is also fed to one of the analog pins on the controller so that it can check the battery state. When the battery dips down close to 2 volts, then we'll have to warn the user or perhaps take failsafe action of some sort.

The intent of the design is that the controller will power down the accessories and then put itself to sleep, meaning that the only power drain from the batteries during sleep will be the 5 volt power supply, the backup power for the GPS and the very small power drain of the sleeping controller. The button will interrupt the controller, waking it up. It will then power up and reinitialize the display and GPS. The GPS should be able to warm-start quickly (Adafruit claims it can do so in seconds, provided it hasn't been off too long). The controller will do... whatever the firmware programs it to do with regards to the GPS position and/or time. If it decides to unlock the box, then it will turn the display and GPS off and operate the servo (the 5 volt supply can only give 200 mA, which isn't enough for everything).

All the rest is just deciding what the rules of the game are and providing a UI.

At the moment, what I have in mind is an "open" and "closed" mode. When the box is in the open mode, there's an editor to set the game parameters (GPS location, tolerance and whatever else). There will also be a way to set a "cheat code." If you hold the button down when waking it up, it will prompt for the cheat code, which will immediately open the box and revert to the "opened" mode. This is needed if the batteries get low or something else goes wrong.

As with all the backpacks, it's an 80x36 mm board sandwiched on the back of a 2x16 LCD display module.

Unfortunately, it's going to wind up being a little bit expensive - the GPS module alone is $30, the LCD is $12, the board is $7 and the controller is $3. It's probably going to cost $75 or so when it hits the store.

Checking your work

I thought it was worth blogging about this, because I'm pretty sure it just saved my bacon.

After you've made a few surface-mount board designs, you'll be used to the standard parts outlines. SOIC, SSOP, QFP/TQFP as well, of course, as your size-of-choice for passives (mine is 0805), and a few more.

But there is always a first time that you come across a part that doesn't come in a familiar footprint. Therein lies danger. Or, at least, danger of wasting money.

Case in point:

I've designed a version 3.0 Hydra logic/display board that replaces the inlet processing hardware for pilot and proximity with the OpenEVSE GFI circuit. This way, you'll be able to wire a Hydra directly to a 240 volt socket and use it as a straight-up double-headed EVSE. Doing that was no problem, and there were no surprises on the way. But when I was done, there was a big empty spot on the board, which represented an opportunity to add something on. But what?

Well, OpenEVSE optionally can come with a realtime clock and backup battery, which allows ToU charging. How about that? It requires a single 8-SOIC, a 0.1uF cap, a coin battery clip and a crystal. Where things get interesting is the crystal - it's not available in the same 4 pad 2.5x1.3mm form factor as the 16 MHz crystals I use for "Arduino-izing" ATMega328s, and the collection of possible parts in the various EAGLE libraries I have handy is fairly large.

What to do?

I go with picking the actual part first. I went through DigiKey, looking for SMD crystals with the correct frequency and capacitance and then just picked one based on a combination of price and availability. I chose this one. Now the hard part: I sat on my hands until the part actually arrived in the mail.

Back in Eagle, I laid out the additional parts on the schematic. When it came to the crystal, I took a guess. When I was done, I ripped-up both of the ground planes and then printed out the board, making sure to use a 1:1 scale.

Here's the part sitting on top of the printed board layout

Now, with the PCB effectively simulated in ink and paper, I attempted to actually pick and place the part to make sure the pads were going to line up properly.

Looks good at first blush

In this case, the actual electrical contacts are on the bottom of the part, so looking at it from the top isn't good enough. We have to flip the part over and make sure that it's going to work.

That does look good after all

With the part turned over and pushed slightly upwards, we can see that the pads on the board definitely overlap the pads on the part, and that they don't extend so far that they hit anything that shouldn't be connected (like that little gold dot in the middle). So that layout is going to be just fine.

Note that the coin battery clip is visible in the pictures as well. I had used that part before, but double-checked it anyway. No problems there.

What I left out of that story is that in actual fact, my first guess for the part was wrong. The part was too narrow for the real crystal, and $45 worth of PCB and two weeks of turnaround time would have been wasted (in actual fact, what I likely would have done was just not stuff the clock parts and sold the boards as a variant without the RTC, or hunted through DigiKey looking for a crystal with the correct electrical specs and physical size). Instead, now I can order the boards with confidence that they're not going to give me any surprises.

Tuesday, April 8, 2014

Next: Reverse Geocache backpack

What do you get when you stick an ATMega328, a GPS receiver, a servo control output and a button on a 2x16 LCD backpack with a battery powered step-up power supply?

Stay tuned...

Thursday, April 3, 2014

Apple Magic Trackpad plugger is a go!

I got the Magic Trackpad plugger boards back from OSHPark today. The only minor change required is that it turns out that the entire inside of the battery cavity is not conductive. You have to use a stiff piece of wire and sort of jam it in the threads near the outside edge that would mate with Apple's metal plug in order to make the negative contact. So I will revise the board, moving the negative output terminal into the back corner to make that more convenient. But apart from that, it couldn't have gone better. The boards are the perfect size to center them inside the battery cavity, insuring that the positive connection will work. And the plan at the moment is to wedge a rubber test tube cork into the end of the trackpad to keep it all together. The cork will hold the negative wire in place and provide strain relief on the USB cable.

The boards will go into the store immediately. They come with the surface mount components assembled, as well as the solid core 22 AWG contact wires. You just add the chopped-off USB cable of your choice and the cork. It'll pay for itself easily in less than a year's worth of batteries!

Wednesday, April 2, 2014

Turning the Hydra into a two-head EVSE

It's a subject that has been broached before... What would it take to replace the inlet on a Hydra with just a straight up power cord?

It turns out it's not quite as trivial as it sounds.

The big missing item that would be required is adding a GFI circuit. The Hydra doesn't have one because the host EVSE is assumed to provide one. But having one is required by the spec (as well as being just downright prudent).

OpenEVSE includes a GFi, of course, and stealing their circuit for it would certainly be an option. The hard part is finding room on the board. The v2.2 board isn't very tight in terms of the component density, but that's deceptive - the trace density is rather high.

I could design a board that replaced the inlet management circuitry with a GFI. You certainly don't need both. But then I have two different boards - two entirely separate products, effectively. Given that I've only sold four Hydra boards so far (and two of those went to my employer), is it worth the bother?

I often feel like I'm sort of blogging in a corner by myself, unfortunately. 

Sunday, March 23, 2014

SALE! Original Hydra version 1 boards in the store

I've decided to part with my old Hydra version 1 boards.

These boards were build with through-hole rather than surface mount components. All are assembled and tested. They differ from the v2 boards in that they lack a built-in display (an i2c RGB LCD display is needed for them to work and is sold separately) and they cannot perform on-demand inlet state switching like the V2 boards can.

They're on sale for half price ($50 for an assembled and tested board).

Get them while they last!

Friday, March 21, 2014

AdaFruit AD8495 breakout now available

AdaFruit now has an AD8495 breakout board now. Theirs is slightly nicer than mine, in that it has a 1.25 volt bias, meaning it can handle negative temperatures as well as positive (-250 to +750 °C for a 5 volt power supply).

It's a little bittersweet. My design wasn't novel, particularly - I took it straight from the datasheet. And they've certainly added value by adding the negative temperature range. It's also great to see a product that one championed make it into the marketplace in a (somewhat) big way, even if it's being done by someone more well heeled. But now I've got a pile of them, and nobody's going to find me once Google figures it out. C'est la vie.