Nullius in Verba

*/ I need a quote or something here that isn’t too long */

A nice little Arduino hack.

Here’s a nice little Arduino mod I came up with recently.

Firstly, we’re going to need an Arduino. I’ve used an Arduino Duemilanove, like so, but this is applicable to any Arduino with a compatible form factor, such as Arduino Diecimila.

Now, that spacing between the two headers, where pin 7 and pin 8 are, can be a source of frustration, can’t it?

If only it was a 100 thou (0.1″ or 2.54 mm) spacing, just like the spacing of all the other pin headers. Then you could make a quick and cheap “shield” board using 0.1″ matrix board or veroboard, and use all the digital IO pins, for example.

Well, what I did was to take a strip of female 0.1″ right-angle break-away PCB mount header sockets, like this. Finding a supplier for these can be tricky, but I got them from Altronics, in Australia.

Now, cut off a piece that is 8 pins long, and sit that against the existing DIO pin 8-13 header on the Arduino, so that the plastic bodies of the two pin headers are sitting right up against each other, and the right-angle pins stick down over the edge of the Arduino PCB.

I’m sure you can see where we’re going with this.

Now, we’re going to slide the new pin header across just a little bit, towards pin 13, so that the horizontal spacing between the first pin (next to pin 8 ) on the new header and the existing pin 7 on the other header is exactly 0.2 inches. Now we glue the two headers together, using a little cyanoacrylate superglue.

I found that the easiest way to make the assembly stay together in the right position while the glue cures is to first make up a little Arduino daughterboard “shield”, using a piece of 0.1″ matrix board and 0.1″ male header pins. Plug the Arduino (including the newly installed header) onto the daughterboard, and the new header will stay in place, without moving away from the correct 0.1″ spacing, while the glue cures.

Now, on the bottom of the Arduino PCB, we need to bend the pins on the bottom of the header across just a touch, so they align with the existing solder pads on the original female header. Then we simply solder them on, and there you go.

(Note that I’ve added a 100 k pull-down resistor on the Rx line (pin 0). I haven’t tested this yet, but hopefully it will let the Arduino boot up successfully without the USB interface connected, without it getting confused due to the line floating.

We now have an Arduino with headers that are all accessible on an 0.1″ grid spacing. Of course, we can still plug “real” Arduino shields, with the annoyingly nonstandard spacing, into the original headers as well.

(Also note that I’ve added header pins onto the normally unpopulated pads on the PCB near the FTDI chip, bringing out the spare UART lines. I’m not sure what this is good for right now, but I thought I might as well do it while I was attacking the Arduino with a soldering iron.

May 6, 2009 Posted by Luke Weston | Arduino, electronics, hacking, hardware | , , , | No Comments Yet

Hacking up some Arduino-derivative hardware.

I was having a chat with some people the other day at linux.conf.au – I’m sorry, but I’m terrible at learning and remembering new names and faces, and I can’t remember who – about the idea of a future LCA workshop on the subject of the Arduino platform, where delegates are actually given their own kit that they can solder together – getting a little more hands-on with the hardware than using (the admittedly good) pre-assembled Arduino reference-design dev boards.

I mentioned the notion of having such a kit based exclusively on through-hole components, so that it’s easy to assemble by people with minimal experience with SMD soldering. However, the FTDI USB UART devices aren’t available as through-hole devices, only as SMD, so you’re going to need at least one SMD component. That is, unless you want to use RS232 as the interface to the PC, not USB. However, compared to RS232, USB is kick ass.

So, I thought, why not use a Arduino-style dev board that includes both RS232 and USB as well – so, you can have a fully functional board with USB interface if you’re brave enough to solder the SMD – but if you don’t, that’s OK, but you will need to use RS-232 as well as an external power supply.

That’s a pretty good idea, I thought. The people I mentioned it to agreed.
But no such hardware platform is available off the shelf anywhere.

So I created it.

This has been occupying my free time in between free moments this week at LCA :)
Doesn’t LCA just totally put you in a hacking groove? It does for me. Of course, I’m a hardware, more so than software, hacker.

Please feel free to download and check out the schematic file and the PCB layout files.

Hardware IP released under the TAPR Open Hardware License (http://www.tapr.org/OHL).

These are CADsoft EAGLE files; they’re also sufficiently small such that the freeware licensed version of EAGLE is perfectly fine to work with them. Yeah, I know, I know, it’s proprietary software. I’ll have to learn gEDA and re-do the designs for extra FOSS satisfaction.

So, what hardware do we have?

The hardware is extremely close to the Arduino Duemilanove reference board schematic design, which it is based on. I’ve just added the MAX232A and D9 port for RS232, really. The UART connections are bought out to a 2×3-pin header block, so that jumpers can be used to patch the ATMega into either the FT232RL USB UART chip or the MAX232A level translator for RS232.

In theory, if you wanted to, for some strange reason, and you’ve populated both sets of interface components, you could have Tx routed to the USB UART, and Rx routed to the RS232 interface, or vice versa, if you wanted to. Also, you can, in theory, put the jumpers in to connect the hardware UART in the AVR to the USB port, and then code up a secondary UART in software using other DIO pins on the microcontroller, and then patch those DIO pins onto the UART select jumper block so that they’re connected to the MAX232, then you can plug the Arduino into the PC via USB, and then plug some completely separate RS232 peripheral into the microcontroller, too!
(Anyone for an OpenWRT router under microcontroller control?)

Additionally, all components are through-hole, except the FT232RL chip. Because through-hole components are used throughout, it’s a bit bigger than ordinary Arduino boards, and is physically not compatible in terms of form factor; that is, it is not (as the PCB currently stands) presently compatible with Arduino-compatible “shield” plug-in daughterboards. Perhaps somebody with elite PCB-routing skills could overcome that with a revised board layout?

The PCB as it currently stands maybe isn’t perfect. Perhaps it could be better. Perhaps you could make it better.
I’ve routed tracks on both layers so that there are no vias, instead, component leads are used as vias by soldering them to both layers – this can be difficult for certain types of components, and can affect the best component choices – eg. machined-pin IC sockets are easier to use. I find this method faster and easier when using home-fabbed PCBs, but if you can get professional PCBs fabbed inexpensively in China, then it might not be as important because you can get plated through-holes done at fab time for cheaper than you might think.

Unfortunately, I had to cave in in the end and include two conventional vias, near the FT232 chip, in order to route everything. Putting in manual vias with a bit of wire isn’t a big deal for just a couple of vias, anyway.

Some notes:
* You must use a MAX232A, not a MAX232, since the charge-pump capacitors are only 100 nF.
* Power input autodetection is implemented exactly as it is on the Arduino Duemilanove reference design.
* Most components are standard off-the-shelf things available from the workbench of the well-stocked hardware geek or the local Jaycar, with very few exceptions.
* Those exceptions include the ATMega168 itself, the FT232RL, the voltage regulator IC (If your input voltage is high enough I suppose you could use ye olde 7805 instead of the more exotic LDO regulator, but remember that it has a different pinout.) The FT232RL is available from DonTronics, in Australia.
* I wasn’t sure which P-channel MOSFET to use to switch the USB power rail – it probably doesn’t need to be a big honking TO-220 device, but I couldn’t find a more compact TO-92 device that I could confirm easy availability for (that is, from Jaycar or Altronics or whatever, in Australia). Finding a TO-92 packaged device that takes less board real estate would be nice.
* If you’re using the board as it stands now with the TO220 FET, don’t get the FET and the regulator swapped around! Also, all the capacitors are just identical 100 nF, with the exceptions of the two 22 pF crystal load capacitors and the two large electrolytics in the power supply.
* Also, there is the little fuse included in series with the USB power rail. The Duemilanove reference board includes some sort of little resettable polyswitch-style circuit breaker. I’m not sure where you could source one.

In any case, I hope you like it, I hope you find it useful, and I’d love you hear your comments.

January 23, 2009 Posted by Luke Weston | Arduino, LCA, electronics, geeky stuff, linux.conf.au, microcontrollers, open hardware | , , , , , , | 2 Comments