Tuesday, January 28, 2014

The Dojo Reflow oven button!

The one part of the reflow oven at the dojo that remained incomplete was the user interface. The start button was on the back of the board. You could sort of reach back and push it if you knew where it was, but that wasn't very satisfying.

I had the idea of getting a big "panic" style push button from Halted... But then I remembered lots of folks on the Internet seemingly have made effective and hilarious use of the Staples "Easy" button.

As it comes (for $5.99), it has a very loud tactile click mechanism inside and when you push it, a little voice says, "Well, that was easy."

Sad trombone.

If you take a more... holistic... look at what you get for your $6...
  • A 2x AAA battery holder
  • A speaker
  • A button
  • some weights to make the thing more stable in a table-top configuration
Not a bad set of capabilities.

But for this project, all I wanted was the button.

I had started down the road of getting it working, but was having trouble with getting the switch to actually work, so Mark McCrate came by and we collaborated to finish it.


But I don't want to leave it there.

The difficulty I had was in "editing" the PCB that was in the button to get access to the switch. I think for the good of hacker-dom, we need to make it easy to replace the entire PCB.

What I have in mind is an Eagle "easy button" library.

It would be similar to the Adafruit shield library - it would have the outline of the maximal round PCB that will fit in the allotted space, along with the conductive switch footprint for the button contacts, and with all of the holes required to mount the board in place of the original board. Add the part to your schematic, and you just get a switch. On the board layout, however, you get the whole shebang.

There ought to be plenty of room to even add a through-hole ATMega328 if you wanted to, though surface mount parts would be more apropos. And, of course, you've got 3 volts (or so) from the batteries and a speaker to play with. What more could you want?


Friday, January 24, 2014

EV Charge Controller

I've looked around on the Internet at some of the home-brew electric vehicle conversions out there. One thing that bothers me a little about them is that so far as I can tell none of them actually implement the entire J1772 specification. In particular, so far as I am aware, none of them actually attempt to detect the incoming pilot duty cycle and insure that their current draw is under what's allowed.

In fact, most of the true home-brew conversions I've seen use an 882 ohm resistor and a diode on the pilot pin. This will work in most cases, but there's a great deal of difference between what merely works and what is compliant with the specification.

In particular, simply jumping straight to state C will fail on a Hydra in sequential mode. After all, sequential mode's intent is to insure that the cars take their turn. The Hydra will not even offer a pilot until it's prepared to actually give power, and the specification requires a car to stay in state B when the pilot is not offering at least as much current as the minimum the car is prepared to draw.

In addition, there are a variety of EVSEs out there with various levels of available charge current. That's the entire purpose of the pilot signal to begin with - if a car draws more than is allowed, the best case scenario is a popped circuit breaker.

As if that weren't enough, most (though not all - the Modular EV Power EV controller gets this right) ignore the proximity signal. The intent of the proximity signal is to demand an immediate shutdown of the charger to insure that the current draw is zero when the plug is pulled from the inlet. This prevents arcing. The spec also demands that the car return to state B when the charge is completed.

With all of that in mind, I have a design for an EV charge controller for home-brew EV conversions. It connects to the proximity and pilot pins of a J1772 inlet; and on the car, it connects to +12v, ground and two charger interface signals - "charge request" and "charge enable."

Charge request is a signal from the car that indicates that if AC power were available, the car would want to charge the batteries. The intent is that when the charge cycle is completed, this signal will drop, and the charge controller will transition to state B. This is a very good thing, particularly for public charge stations, which can text you that your charge is done, and indicate to other nearby users that your plug is free for their use.

Charge Enable is a signal from the controller to the charger, and represents an enable for charging. The charger must not draw power unless this signal is asserted, and must stop drawing power when it is dropped. The controller will drop the charge enable signal a short time before transitioning the inlet from state C to state B. This will insure that no current is being drawn when the EVSE's contactor is opened, which prevents arcing there.

In the absolute worst case, the charge enable signal can be used to open and close an AC power relay to supply power to a dumb charger. That relay may potentially arc, but that's better than the alternatives.

The charge controller has two DIP switches and a rotary configuration switch. One of the DIP switches is "vent required." EVs that use lead-acid batteries should turn that switch on so that state D is used in place of state C. The other DIP switch inverts the sense of the charge request signal to be a charge inhibit signal. The rotary switch selects from a set of 8 choices the maximum current draw of the charger. If the J1772 pilot ever drops below the configured minimum, the charging cycle will be interrupted.

The charge controller is powered by an ATTiny84 and an LM393 comparator. It is wired to see the configuration options, the charge request signal and the state of the proximity and pilot pins. It can switch between state B and C/D and control the charge enable output.

I haven't gone ahead and actually built one of these, however. I don't have a use for one, and I don't know anyone who does. But I think it could be made and sold for around $20, and would greatly improve the compatibility and safety of home-brew EV conversions that have built-in chargers.

Tuesday, January 21, 2014

SMD lecture and demo 2/22 at Hacker Dojo

Come join me at the Hacker Dojo Feb 22 at 2:00 PM. I'll be sharing what I know about surface mount prototyping, reflow soldering and circuit design. And I don't claim to be an expert, so I am counting on this being more of a community knowledge exchange than just me giving a brain dump. I have high hopes of learning stuff too!

I'll be talking about the entire process - CAD-to-test. I will also stuff and reflow (and if necessary, rework) a complete device during the demo.

Hope to see you there!

Sunday, January 19, 2014

EV Simulator backpack

I've been selling the EV Sim Mark II for a few months now, and since I've been making a lot of "backpack" projects lately, and because so far as I know most folks who buy an EV Sim II hook it straight up to an RGB LCD backpack, I've decided to try and simplify the hardware for the most frequent use case, so I've come up with an ATTiny84 backpack.

I've built and tested the prototype, and it works perfectly. It's for sale in the store now.

Saturday, January 18, 2014

USB <-> RS-232 adapter

I designed a USB to RS-232 adapter this evening. There's no particular reason I did. It was just sort of "because I could." It was actually sort of tricky to route, since the RS-232 level converter chip wasn't conveniently laid out - like with RS-232 signals on one side and TTL/CMOS on the other.

My first cut wound up being a 2.08 x 1.25 inch board. It seemed like it could be smaller than that. Most of the space was taken up by the through-hole DB9 connector, so I swapped that out for an edge-mounted DB9. The only thing attaching the connector to the board will be the soldered pins, so it's quite a bit weaker, but in principle such a thing would be mounted in a plastic case designed to relieve any strain. I got the board down to 1.8 square inches. I used an SOIC RS-232 level converter instead of an SSOP one, so there probably are still gains to be made. In principle, it's conceivable that one could attempt to place two SSOP-28 packages on opposite sides of a much smaller board. That's probably how they achieve a USB-to-RS-232 adapter that fits entirely inside of a DB9 shell. I don't feel a need to go quite that far. Heck, I don't really have a particular use for this anyway. I'm not sure we have an RS-232 connected peripheral left in the house.

I'm not really sure why I set down the road to make one of these. But I've got 3 on order, and I can sell them for $15 each (case and micro USB cable not included), given the price of the boards and BOM.

Thursday, January 16, 2014

LCDuino is ready to go!

I built the latest prototype LCDuino this evening, and it worked perfectly. I'm ready to add LCDuino and the Arduino shield adapter into the store now.

To recap, LCDuino is a marriage of an Ardunio Uno with an AdaFruit RGB LCD shield, but as a "backpack" board for the LCD module. The LCDuino main board is 80x36 mm - the same size as the board for the LCD module itself. The board houses an ATMega328 in a TQFP package along with an FTDI USB-to-serial adapter chip and an MCP23017 i2c GPIO chip to interface to the LCD. The board also has a micro USB connector (used for getting power from a PC and uploading sketches), along with a DIP-26 connector to connect a ribbon cable to whatever else you want to play with, and a DIP-14 to carry the button signals from the MCP23017 off to a button board.

The ribbon cable is intended to terminate in a 28 pin .3" DIP plug for easy attachment to a breadboard. You can either power the LCDuino through the ribbon cable or power the breadboard from the LCDuino via the USB connector (there is a 500 mA self-resetting fuse to protect your computer).

You can also, alternatively, connect the ribbon cable up to the LCDuino shield adapter, which includes a 2.1mm barrel connector for a 7-12v power input, which is regulated down to 5 volts and 3.3 volts to provide power for standard Arduino shields. Of course, you still get the i2c RGB LCD display along with whatever shields you want.

JP1 is actually pins 17 and 18 on the RGB LCD, which provide the "green" and "blue" backlight control. The "K" pin is actually the red backlight.

JP2 and JP3 are actually extensions to the high digital and power connectors (like on an Uno rev 3), which add dedicated i2c pins and the IOREF pin.

The LCDuino as a "quick kit" is $30, and the shield adapter (also as a "quick kit") is $20.


RGB LCD backpack success

The prototype for my version of the RGB LCD backpack came in, and worked just fine. I've placed an order for the second version, which will be available in the store just as soon as the boards come back from OSH Park.

There are a number of things out there to adapt a 2x16 LCD to an i2c bus. There's the OpenEVSE backpack (I will admit that my own design is inspired by Chris') and the AdaFruit RGB LCD shield. My own version aims to make maximal use of the LiquidTWI2 library that it's designed to use:

  • Instead of a single SELECT button, there will be a 5 way tactile switch mounted on the board. This will let you have UDLR directional inputs as well as select (by pushing down). The switch will be wired so that left and right are relative to the front of the board even though the switch itself is mounted on the back. That way, when you work the switch while looking at the display, you won't have to swap around left and right in your mind.
  • There will be a piezo speaker mounted, which will allow you to use the "buzz()" method in LiquidTWI2 to make noise. The speaker isn't terribly loud, and it's certainly not musical quality, but it works.
  • In parallel with the 5 way switch, there will be a 7 pin SIP header to bring out all of the button inputs, along with ground and +5 volts.
  • There will be three sets of two-way jumpers for each of the MCP23017 address lines. This will allow you to daisy chain up to 8 of these in parallel and address them separately from your code (the default will be all address lines grounded, which is compatible with the AdaFruit shield).
  • There will also be a set of two-way jumpers for the backlight common pin (pin 15), to allow selecting between common cathode and common anode backlit LCD modules (the default will be common anode, which is compatible with the AdaFruit shield).
This board will be usable with the EV Sim II and the Toast-R-Reflow "standalone" controller. The "quick kit" will be $30 (plus shipping) and will come with all surface-mount parts pre-assembled, and with the necessary remaining parts to complete assembly.

Tuesday, January 14, 2014

LCDuino pricing

We're getting quite close to a finalized design for the LCDuino system. I think the main LCDuino module is all set, and I have another idea for the button board, with a 5 way tactile joystick switch instead of the 5 buttons. The extra cost of the tactile switch is more than made up in reduced PCB area.

That design will wind up with a retail cost of $10. The shield adapter, unfortunately, is going to be expensive for what it is, given the size of the board. Those will retail for $20. The LCDuino module itself is going to be $30. So a whole kit will be $60. In large volumes, those prices could potentially come down, but that's hard to bootstrap when you're basically blogging to yourself. :)

Monday, January 13, 2014

Final prototype for LCDuino shield adapter


Tonight in the OSH Park batch I received the next LCDuino shield adapter prototype board. It differs from the first prototype only in that it includes a 3.3 volt power supply. I still need to get some 90 degree DIP header stock tomorrow from Halted before it's finished, but that shouldn't change much.

New TRR backpack controller

It was a big OSH Park day today. Among the arrivals were the latest design for the TRR controller+display backpack. This design replaces the ATTiny85 and the MCP23017 with an ATTiny84.



The initial cut at the firmware didn't work perfectly, but it wasn't hard to sort out. Unfortunately, unlike the ATTiny85, the 84 doesn't have a 2.56 volt analog reference built in, so far as I can tell. So instead, it must use Vcc (5 volts), which means that the full 10 bit range covers 1000 °C, which is way, way more than a reflow oven needs. The downside to that is a loss of resolution, but even 1 degree is fine for this application. In principle, this design could also be used to control lower temperature processes, like a sous-vide heater. If you do, then using the 1.1 volt analog reference would yield a maximum temperature of 220 °C (just short of what's necessary for a reflow oven, unfortunately), but with quarter degree resolution.

The alternative part is the MAX31855, but that part is twice as costly and requires a 3.3 volt power supply, as well as level shifting on its input pins. It does, however, offer 14 bit resolution - .25 °C - over an incredibly wide range, which even includes negative Celsius temperatures.

Anyway, I built two of them this evening - and the first built the second. One of them for me, the other for the Hacker Dojo oven. I'll install it sometime tomorrow evening.

Saturday, January 11, 2014

Hacker Dojo Reflow oven... take 2

Last week the new reflow oven at the Hacker Dojo took a bit of a turn as the controller board went missing. There has been a lot of searching, but it's still gone, so I brought in a second one just so the oven will get back to operational status.

This one is a standalone controller, with pin clips leading off to an AdaFruit RGB LCD shield. It's a bit of a hack.

In case the pin clips get disconnected, the four pins on the controller's 4 pin SIP header are (starting at the top) ground, +5v, SCL and SDA. On the AdaFruit shield, you need to connect ground to the second or third pin of the power section of headers. +5v is connected to the fourth pin. SDA is the second to last pin on the digital side of the shield, and SCL is the last pin. Note that these are the two "extension" pins of the Uno rev 3.

The button to push to start the oven is the "SELECT" button on the LCD shield. It's the one that's immediately to the right of the pod of "directional" buttons (four arranged in a "+" for up, down, left and right).

The display is a bit difficult to read, but you can see gross status by looking at the color of the backlight. Yellow is "waiting" state, and green means that the oven is running through a cycle. You could just load the oven, push the button, and wait for the display to turn yellow again.

The next batch of boards from OSH Park will contain the new design of the backpack controller. I'll put one of those together and set that up as soon as I can. That design should be similar to the missing controller - a simple white backlit LCD module with a start button on the back. Hopefully before too long someone will be able to use the 3D printer to make a nice box for it.

Friday, January 10, 2014

Price reduction!

Well, despite the fact that no one has yet actually bought one, I've decided to get a bulk order of Toast-R-Reflow parts. This bulk ordering has allowed me to drop the price 20% on the power board. So if you don't mind doing a little soldering (none of it surface-mount), you can get a complete TRR kit (consisting of a power board kit and a backpack controller "quick kit") for just $50. All you need to add is a 7-12 volt @ 250 mA power supply, a K type thermocouple and a toaster oven.

Wednesday, January 8, 2014

Step right up, don't be shy!

The Toast-R-Reflow boards and kits are available if you want to convert your own toaster oven into a reflow oven. It's not that hard. I've even written a nice instruction manual you can peruse before you take the plunge. Assembling the power board is just about the easiest through-hole soldering I've ever done, and the controller comes with all surface mount parts pre-assembled and the controller pre-programed. All you need to do to finish the "quick kit" is attach the through-hole connectors and mount the LCD. And all you need after that is a K type thermocouple and a toaster oven.

Who'll be the first?

Tuesday, January 7, 2014

RGB LCD Backpack

I'm a little torn about this.

I've been buying my RGB LCD backpacks from Chris over at the OpenEVSE store. The downside of this is that when people want an EV Sim or a reflow oven standalone controller, they can't just do one-stop shopping. Additionally, if I had an absolutely free hand, there are a couple of tweaks I'd make to the design:

  1. LiquidTWI2 supports a piezo element on the last unused pin of the MCP23017. It'd be nice if there was a spot on the backpack for that.
  2. There's probably a simpler layout for the button pin connections.
  3. I want to include a 2 way solder jumper for the backlight common pin to accommodate both common cathode and common anode backlit modules.
  4. Since I happen to have a pile of them, I'd use the SSOP derivative of the MCP23017 instead of the SOIC one. That leaves more room (should it be desired) to add stuff down the road (for example, Chris added a Dallas Semi i2c RTC chip to his).

So I've posted a design for my own version of the i2c RGB backpack. It feels slightly, I dunno, mean to steal his thunder like this. I'm not really trying to take food from his mouth or anything like that. My own latest trend has been to replace ATTiny85 + MCP23017 designs with ATTiny84s directly wired to the LCD. It saves quite a bit of firmware space, and about a dollar off the price, and for most of the designs to which I've applied this, the RGB backlighting hasn't been needed anyway.

But once the prototype comes and the design is validated, I'll add my version of the backpack to my square-up store just so folks won't have to buy from two different places. The i2c connection will be pin-compatible with the OpenEVSE backpack, and it'll work with the LiquidTWI2 library. If you want to take a look at the board, the design is in my OSH Park profile.

Saturday, January 4, 2014

Toast-R-Reflow schematic round-up

So here are the schematics for the Toast-R-Reflow project so far. For the Eagle .brd files, you can go to my OSH Park profile.

First, the power board:


This has remained, more or less, constant throughout the whole project. The design is quite simple, and taken straight from one of the data sheets (for either the BTA-20 triac or the MOC-3020 optoisolator. I forget which). The only possibly controversial aspect is the inclusion of a snubber (the .01 uF cap and 39 ohm resistor on each output). The loads are not particularly inductive, and the triacs are billed as being "snubberless," but I included it anyway. It doesn't do any harm, and it's not like the components are pricy.

But once that's done, to what do you connect it?


That's the first controller design. It was intended to connect to an OpenEVSE style RGB LCD backpack or to an AdaFruit RGB LCD shield. It works perfectly, but I imagined folks railing against the need to buy two pieces of kit. So I came up with...


This design combines the backpack's circuit with the controller. That worked too, but it occurred to me shortly after I finished it that the price of an ATTiny84 was going to be less than the price of the 85 and the MCP13027 GPIO chip. And that led to...


That's what's in at OSH Park right now being fabbed as we speak.



LCDuino update

The LCDuino shield adapter prototype boards arrived. With them, I got the LCDuino prototype to take over the GPS clock duties using the GPS shield


The Shield Adapter board worked perfectly on the first attempt. The prototype lacks a 3.3 volt power supply, so the 3.3 volt shield pin is NC, but the GPS module doesn't care.

It did point out a second wiring error in the prototype - the blue and green backlight control lines are reversed. I worked around that too in software for now, so the v0.3 LCDuino board will be the keeper.

The LCDuino ribbon cable mating into its plug on the Shield Adapter rides just a bit high - so the first shield in the stack winds up hitting it. I will probably use a right angle DIP header to work around that for the next one.

But LCDuino is well on track. I just hope it winds up being useful to more than just me.

The Hacker Dojo reflow oven

The oven is complete and operational. In case folks want more information, I'll put up this page as a clearing house.

While I was there, I ran through a cycle while someone took a video. When that video gets posted somewhere, I'll link to it here.

The gist of it is that you need to supply the oven itself with 120vac (just like its makers intended), and the controller board (with the LCD) needs 7-12 VDC @ 200 mA, 2.1mm center positive.

The normal waiting state will show "Waiting" and the thermocouple temperature on the left side of the display.

The thermocouple is the brownish wire-looking thing snaking up from the bottom of the oven. You want to put your boards as close to the end of that wire as practicable, but you want the thermocouple in air, not touching your board or any other part of the oven.

There is a button on the back left (when viewed from the front) side of the controller. Press it to start a cycle. The display will show four pieces of information. Top left is the name of the current step in the cycle. The steps are "Pre-Heat," "Soak," "Reflow," and "Cool." The bottom left will show the current temperature and the bottom right will show the current set point (target temperature) of the oven. The top right will show the elapsed time from the start of the cycle.

The way the firmware works is best illustrated with the concept of a graph. The axes of the graph are time and temperature. The beginning and end of each step represent points on that graph. The end of one step is the same as the beginning of the next. The set point of the oven will gradually move along the graph described by line segments joining each of the points.

The points are:
  1. The beginning of pre-heat starts at 0 seconds, 25 ºC. Pre-heat lasts 90 seconds and ends at 150 ºC.
  2. Soak lasts 60 seconds, and ends at 180 ºC.
  3. At the end of Soak, the line has a discontinuity. It breaks and immediately snaps to a set point of 225 ºC.
  4. The Reflow step stays steady at 225 ºC for the duration, which is 75 seconds.
  5. The Cool step goes downwards from 225 ºC to 150 ºC for 60 seconds. In reality, the oven will cool slower than this left on its own. Impatient users may wish to open the door a crack to speed cooling, but there is a danger of thermal shock if the cooling proceeds too quickly. The cool stage will attempt to prevent this by heating the oven further if cooling is proceeding too quickly.
This profile is appropriate for Sn-Pb solder paste. I have not attempted RoHS soldering with this oven. I am skeptical that it can make it up to 260 ºC in a reasonable amount of time, but I'd be happy to be proven wrong.

The low voltage cable coming out of the oven to the controller is directly connected to a pair of optoisolators with a common cathode (the green wire). There are no series resistors - you must add them yourself. The target is 20 mA of current. Do not exceed 50 mA or you'll damage the optoisolators. If you want to experiment with alternate control systems, the optoisolators are MOC-3020s. The thermocouple is a K type. Note that the K type thermocouple lead color code is yellow for positive and (perversely enough) red for negative.

The controller board that's there is a prototype for the backpack controller design. There is a wiring error in the LCD wiring that was worked-around in software. You must modify the LiquidTWI2 library to reverse the order of the LCD data bus lines for this particular board. I have an order into OSH park for corrected boards and will bring one in when they arrive.

Thursday, January 2, 2014

See you Saturday

I will be at Hacker Dojo this Saturday at noon. I'll be there to do the Toast-R-Reflow conversion operation in person. I'll leave the completed oven there for folks to use too. I'm not a member, so I can't reserve a room or create an event or anything like that. But I visited (for the first time) this evening and met some folks there who dug it and they said that Saturday at noon-ish was a good time, so that's the plan.

I've already set aside most of the parts. I'll be using the standalone controller and an LCD backpack, but I will eventually replace that with the ATTiny84 backpack design as soon as the boards arrive from OSH park.