Thursday, May 21, 2015

Tiny Blinky user guide

If you were at MakerFair Bay Area 2015, you may have seen (or hopefully even purchased) a pair of little round blinking earrings from us.

I've finally gotten around to fulfilling the "open" part of "open hardware" - this page.

The circuit is simplicity itself: An Attiny84 with 8 LEDs, an SMD pushbutton and a CR1220 battery clip. The only other component is a 10k pull-up resistor on !RESET. The series resistors for the LEDs are present, but it turns out that 0 ohms is the best value to use.

Normally, it's always a good idea to add a 0.1 µF bypass cap close to the Vcc pin of any logic component. In this particular case, however, we can get away with omitting it because the ATTiny is the only load, and the battery is so physically close.

If you push the button briefly (<250 ms), it will change the pattern (remembering the selected one in EEPROM). If you push the button longer (>250 ms), it will power the blinky off. While it's powered off, the battery will last "indefinitely" (limited only by its own shelf life). While it's running, you can expect it to last for an evening or so (we had better luck at Maker Faire - they lasted the whole weekend, albeit powered off overnight).

There isn't a lot to say about how it works. The one thing of note is that the ISP programming pins should not be used for LEDs, since there are no series resistors. Programming could possibly wind up pushing too much current through them. MOSI and SCK are therefore connected only to the ISP header, and MISO is used only for the button (so don't push it while programming is in progress).

Schematic


The firmware is available on GitHub

OpenEVSE II update

OpenEVSE II is for sale, and the design is more or less finalized at this point.

The most recent fiddling I've been doing has related to the pilot generator. While the old one was operating within the J1772 specification for the slew rate, it was barely doing so. One thing I learned the hard way was that resistors slow things down. But more so, in the original design, there was a tension between the primary transistor pair base bias resistors and the pull-up. In order to insure that both transistors are always in either one state or the other, the pull-up resistor has to overcome the bias path from +5 through the -12V primary transistor, to its base, through its base bias resistor, through the +12 primary transistor's base bias resistor, and then through the base-emitter junction to ground. In order to make that work, the pull-up had to be one tenth of what the base bias resistors were. The latest design was 10k base biasing and 1k pull-ups, but again, that was barely fast enough. The only improvement would have been to use 4.7k base biasing and 560 or 470 ohm pull-ups. But with that, you'd be sinking way more current through the microcontroller when it's pilot output was low. It just wasn't reasonable.

The solution was to change out at least the primary pair for MOSFETs. MOSFETs don't have a conduction path from their gate to drain, as there is in BJTs from their base to emitter. So the base bias can be 0 ohms and the pull-up can be 10k. The secondary pair can either remain a pre-biased BJT pair (47k emitter to base and 10k base to input), or can be also swapped out for a MOSFET pair, but with source-to-gate biasing of 2.4k and gate-to-input biasing of 2.4k (this is only necessary to reduce the gate voltage swings. Otherwise the -12 secondary gate will see a gate voltage of 17 volts, which is quite a bit). Either way, the slew rate is around 1 µs, which is half of the spec maximum of 2 µs.

If there is a next thing in the design to tackle, it would be to attempt to further increase the sensitivity of the GCM. Right now, it's on the order of around 50k or so, but the spec demands a trip point of 100 ohms per volt (so 12k for L1 and 24k for L2). Figuring out how to achieve that reliably is going to be a tough tuning task, but it still shouldn't result in any incompatible design changes at this point.

The next step will be to update the design of the Hydra to include all of the lessons learned. Stay tuned.

Tuesday, May 19, 2015

Important safety update for Toast-R-Reflow controllers

Everyone who has a Toast-R-Reflow model I or model II controller should obtain the latest firmware from GitHub and install it. The latest version for model I is 0.5, and for model II it's 1.2.

The change adds support for the AVR watchdog. The Toast-R-Reflow installed at The Hacker Dojo had some unknown event happen that wedged the controller with one of the elements switched on. This is obviously an undesirable outcome. It's unknown whether the watchdog would have been effective or not, but it certainly isn't effective if it isn't used.

If you are unsure how to update the firmware or have any questions, please feel free to contact me and I'll be happy to help. If you have no other way to apply this update, you can mail your controller back to me and I will apply it for you.

Sunday, May 17, 2015

Bay Area Maker Faire 2015

Well, Bay Area Maker Faire 2015 is just wrapping up. I'd like to say a special thank you to the folks at Steamy Tech for partnering with us to make the blinky earring/pendants that we were selling. I'd also like to thank all of the people who stopped by. An awesome time was had by all.

Special thanks to the folks at OSHPark for supplying us the boards and Small Batch Assembly for their sponsorship.

If you got our business card and have landed here, then you can see our products in our Tindie store. If you need help or support with a product that you purchased there, you can contact me using the contact form on the right side of this page or at Tindie.

If you bought a blinky earring/pendant, I am going to put up a page soon with the schematics and a github link with the firmware source code - that will make it Open Hardware.

Thanks again, and hope to see you all again next year!

Saturday, May 9, 2015

Lessons learned: The dangers of hidden licensing requirements

There was quite a kerfuffle this morning, and I won't say that it wasn't at least partly my fault for escalating it before the true nature of the request that was being made was made clear.

The nice folks (and there is no sarcasm there - they really are nice) at AdaFruit wrote me this morning to request that I license the use of their USB VID/PID for the USB µISP. Their request caught me quite off guard, as I was using the source code not from AdaFruit's site, but from the original developer, Dick Streefland. I could never recall any mention anywhere on either AdaFruit's site, or on Dick's that said that the USB VID/PID was anything other than free. In fact, the license for the source code is the GPL 2. It seemed to me at the time as if what was going on was that this was a hidden licensing trap, and that put me very much on the defensive.

Since then, things have become much more clear. AdaFruit has put a prominent notice on their site that while the source code for the USBTiny is open source, that does not convey a license to use their VID/PID without permission. And, at the present (and at the risk of speaking for them), it appears that their permission is relatively easy to get. And I do believe that those who have been allocated USB VIDs (and IEEE MAC address blocks, PCI vendor IDs and similar allocated identifiers) do and should have the right to govern how their identifier space is used.

For my own part, the lesson is that even code under an open source license can have licensing surprises in it. I think it's particularly incumbent on both rights holders to make their requirements clear to everyone so that there are no surprises, and on those who release open source software to insure that everything in their source code is covered by the rights their license grant implies.

Friday, April 17, 2015

EVSE Tester user guide

EVSE Tester on the Geppetto Electronics Tindie store

This page is the permanent home for the EVSE Tester users' guide.

The EVSE Tester allows you to exercise an electric vehicle charging station (EVSE) in various ways, and will display the state of the pilot signal, including the J1772 ampacity indication.

The EVSE Tester requires 6-12 VDC @ 200 mA supplied via a center-positive 2.1mm barrel connector. The power supply is required for the display only. Using the DIP switches to simulate the states of an electric vehicle alone does not require power.

The two pin screw terminal at the bottom center of the back connects to the ground and pilot terminal of a J1772 EVSE plug. The ground terminal is the large connector at the bottom. The pilot is immediately to the right of the ground, when looking into the plug.

WARNING

Do not attempt to connect anything to the J1772 connector hot lines, which are the two large pins at the top (opposite end from the ground) of the plug. You must assume that 240 VAC power may appear on those pins at any time - possibly as a result of a malfunction. Contact with the hot lines while energized may result in serious injury or death.

Before attempting to connect the EVSE tester to a J1772 plug, switch the four DIP switches to their off position.

Connect the pilot and ground terminals to the EVSE using 22 gauge stranded wire. On the J1772 end, strip about a half inch and twist the strands tightly to avoid frayed endings. Bend the ground wire back on itself where the bare strands emerge from the insulation and insert into the ground pin. Insert the pilot line into its pin without bending. Some electrical tape can be used to secure the leads if necessary.

At this point, the EVSE should be in an idle state, with no indication that a vehicle is present. The tester display should show 0 Hz and a +, indicating that the pilot is pinned to a continuous +12 volts. If the display shows - instead, then it is possible that the EVSE is in an error state (with a -12 volt pilot signal) or is not connected properly.

Flip the "A" DIP switch on. The EVSE should indicate that a vehicle is present, but is not requesting charging. The display should change to show 1000 Hz (possibly +/- 20 Hz) along with a duty cycle and amp rating that corresponds with the expected value from the EVSE in question.

Flip the "B" DIP switch on. The EVSE should indicate that the vehicle is requesting charging, and will energize the hot lines. WARNING - As stated above, the J1772 plug is in a potentially hazardous state when the power is turned on, but the plug is not inserted into a vehicle. Do not attempt this function in inclement weather conditions or with anything inserted into the hot line pins at all. The display should not change.

Flip the "C" DIP switch on. The EVSE should react as appropriate for a ventilation request. What this means will depend on the EVSE. Most will indicate an error. Some will do nothing differently at all (particularly if they're intended to be mounted only outdoors).

Note that it is incorrect to ever have the "C" switch on if "A" and "B" are not also on. Similarly, it is incorrect to have "B" on if "A" is not also on. Always turn on the A-C switches in order and turn them off in reverse order. Doing otherwise won't damage anything, but will expose your EVSE to out-of-spec state transitions.

At any time (other than when all of the A-C switches are off), you may flip on the "D" switch to simulate a "missing" pilot diode. The pilot diode is a safety feature that allows the EVSE to distinguish between a vehicle and simply dropping the plug into a bucket of salt water. Flipping the "D" switch on should result in an immediate error condition on the EVSE. If it was supplying power, it will stop.

Troubleshooting

If the display is dim, adjust the contrast knob with a small screwdriver. The correct setting should be near, but just short of one end of its rotational range. If that doesn't fix it, check that the input DC voltage is between 6 and 12 volts. While the EVSE tester runs internally on 5 volts, the power supply is dropped to that level by an LDO on the input which requires 6 volts or more to function properly.

Theory of operation

The pilot terminal is connected to the A-C DIP switches and then to the three state resistors. The three state resistors are then connected to a diode and then to ground. The D switch connects across the diode, to short it out, removing it from the circuit.

The incoming pilot signal also is fed through a second diode with a 100K pull-down resistor into a LM393 comparator. The diode is necessary to protect the comparator from the negative excursions of the pilot signal. The incoming pilot signal is compared to a 1 volt reference from a voltage divider. The comparator output is fed into the controller.

The controller is an ATTiny84 clocked at 16 MHz (it is crystal controlled not because it needs to be fast, but for maximum measurement accuracy). It is connected up to 6 pins of the LCD display and the comparator. Three of the display pins are shared with the AVR ISP programming interface. There are 1K protection resistors in front of the display to insure it cannot interfere with programming.

Schematic


Wednesday, April 15, 2015

See you at Bay Area Maker Faire

I'll have a table at the Bay Area Maker Faire May 15-17. I'll be giving live demos of hobbyist reflow with my own Toast-R-Reflow oven. I'll be making little 1" round earring/pendants with blinking LEDs in your choice of color (red, green, blue or white). If you wish, you'll be able to take those over to the SteamyTech booth and get a laser-cut enclosure for them. I'll also be making and selling Toast-R-Reflow controllers and power board kits and will have crazy clock and USB µISPs and Pi Powers on hand for sale as well.

I've got Square, so credit cards and cash will be accepted.