Sunday, July 29, 2012

Building the ELM329 CAN Device - Part IV

As mentioned previously my very first build failed because of a solder bridge under the USB Chip. I hadn't spotted that right away and I'm pretty sure applying power to it etc, totally fried it.
One (hard to see) solder bridge
 In looking for a way to fix it I found a standalone USB->CP2102 board on Ebay. It was designed to plug straight into the usb port, and then had headers on the end breaking out the TX/RX lines.
Obviously I did not really need the USB plug etc, so I decided to chop it out and a) solder a longer USB Cable to it, in place of the USB plug, and b) solder some wires from the header to the proper connection points on my original PCB. Luckily most of those had exposed VIAs so it would be an easy transplant.

First though I had to get the existing CP2102 off.. since it has a heat-sink like ground connection underneath that was soldered as well it was a real pain to get off. In the end I actually didn't care anymore about trying to get it off with heat and just stuck a sharpe razor blade underneath and practically sawed (and broke) it off.

The CP2102 removed.. Inset shows the 'remains' :)
 After that the rest was simple. I just soldered some wires from the vias to the new USB Board and soldered on the original USB Cable and that was that. I did wrap it in some electrical tape so it wouldn't be touching anything when squeezing it into the enclosure!

Success! Or was it?...
I had meanwhile made the other boards and sent one out to a friend to help test. While the HI-Speed Can side worked, the SWCan side kept giving issues. When rewiring the Hi-Speed can side to act like a SW Can connector (tying the Can-Lo pin on the MCP2551 to GND) it seemed to work so there was STILL something wrong with the SWCAN side of things. In my previous testing I thought it was working, but I had forgotten that after you issue a Reset command to the ELM it reset the switch to it's default state, so it was actually showing more Hi-Speed Data. *DOH*

After staring at the board , schematic, datasheet etc a long time I finally found a stupid mistake I made relating to the SW-Can sub-section. A certain supply line was tied to the wrong point and instead of now receiving 12-16V it was getting a measly 1-3V. I instantly fixed the schematic and ordered some new PCBs, however looking at the existing PCBs I was fortunate in my design that all it would take to fix this issue was cutting 1 track and soldering 1 extra jumper wire. After converting one of the boxes this proved to be the fix it needed and everything worked as expected! (Except for some LEDs, but that was simply because I put them in backwards... stupid inconsistent specs between different colors!)

The fixed also worked on my 'Revision 1.0' boards, so I decided to finish up one of those as well.


You can see the Cut Track Between VBAT and CANH. Just need to add the jumper wire now

While the Red is a nice Color, the Purple PCBs are really cool. Now that I have a solid design I should probably order a large batch and start cranking out some of these for sale.. I can stick with the Purple (5x the cost for just the bare PCB), or do Green (yuck), Red (OK), Blue (OK) but also stuff like White, Yellow or Black!.. Decisions, Decisions...

If you were to buy one of these,  What's your preference? Would you even Care?

p.s. I know this may not seem like these posts are 'car-related' anymore, but I guarantee you nothing is further from the truth. With these boards now complete the 'real' fun now starts as I'm starting to write software not to only see what's going on on the network, but also explore reprogramming of certain devices on the GMLAN network :) Long road ahead though before we get there, but at least the start is there!


Thursday, June 28, 2012

Building the ELM329 CAN Device - Part III

So After the first build had failed I determined that the problem was with the CP2102 USB Chip. If I looked closely I could see a solder bridge under one side. It'll take some time to fix it (if it's even possible at this time), so instead I decided to kick off another batch of boards as practice.

As I mentioned earlier I have 3 different revisions of the boards, the red 1.1, a purple 1.2 and purple 1.3. I figured I would try to make one of each for a comparison - between them the layout has a few slight changes and a few component differences. After going through the usual process of the stencil, paste, placement etc I baked all 3 PCBs at the same time.
After a nice baking session

I'm not sure if you can tell, but the center IC on the Red board (almost looks orange in the picture!) actually had couple of solder bridges, so I set that one aside so I could use some solderwick on it later. Also, while the backs are 99% the same between the different version, I noticed I had moved quite a few things around on the 1.2/1.3 revision, so the top stencil simply would not work with the 1.1 board. So it looks like they are either a) Coasters b) in need of a separate stencil, or c) I'll be doing a partial stencil job and do the rest by hand in the near future.

When I went to check the other 2 board, they both seemed fine. I did notice in testing though that for the USB to be seen on my computer I had to apply 12V to the circuit as well (used an old router power supply). That surely is a bit of an inconvenience for further testing, however when doing that my computer was successfully able to open the port and talk to the ELM329 chips.

Next we getting the PCB all connected and built into the housing. I re-used the housing from an existing ELM327 instead of a new one, since that already had some wires connected to the OBD connecter and had a 8 pin plug. After taking off any of the wires we didn't need, soldering a new one to pin 1 for SWCan, and moving the wires to their right spot in the 8pin connector it was ready to go in. I had meanwhile also made a usb cable to connect to the 4 pin connector on the PCB.
The final result looked pretty sharp!

Everything all connected

Yes the RED wire is Ground.... Crazy Chinese people... I didn't bother to change it

Ready to use! Now if only I had a snazzy sticker...
The device defaults to Hi-Speed CAN, and thereby lets you use whatever ELM327 Software you may have that supports CAN commands. A Quick test showed this to work, and when switching over to the SWCan chip, by issuing an 'AT C1' command, we were able to also see data using a terminal app, so it looked like a success!

Next, I will try to build a few more boards , but also perhaps write some software for it to easily interface with it since right now it's really more an 'advanced users only' tool.

Saturday, June 23, 2012

Building the ELM329 CAN Device - Part II

So I finally had (made) some time to finish the front side of the first ELM329 pcb. The process is basically identical to the back-side where I used a stencil to apply solder paste, then place the components (obviously making sure the polarity is correct for diodes/LEDs etc), and toss it into the toaster oven. This side was a little more work actually since it had a few more components, and it had some 'odd' components such as the USB Chip that has all the pins connected underneath etc.

Paste Applied and Components Placed
When it was time to put the pcb in the toaster oven I took two pieces of aluminum foil and roll them up to make little 'offsets' to place the board on. This way the rack wouldn't be touching the components that were on the bottom side and possibly disturb them.

Sitting on it's 'fancy' mount
The problem components were the 2 aluminum caps which you can see in the above picture being closest to the front. They were not very stable and one even fell off in the oven! While they may be a LOT cheaper than the Tantalum caps, I'm tempted to switch back to those since they don't seem to be that wobbly. You can even tell in the picture that they are leaning.

The baking seemed to take longer than last time, but keeping a keen eye on it, eventually the solder paste started to reflow. The voltage regulator took the longest, probably because it has a large heatsink area. At first glance everything seemed OK, But i'll have to take closer look with a magnifier to make sure everything flowed the way it was supposed to. Of course as soon as I turned off the oven and opened the door a little whisp of smoke came from 'somewhere' so who knows what I fried...


Fresh out of the oven - Hmmm tasty!
After letting it cool down I manually soldered the header pins in place (1x for OBD and 1x for USB). Now I just need to finish up the USB cable so I can test it out and see if I screwed up anything beyond repair. Also the bottom-side components stayed neatly in place so with some tweaking this method of making PCBs is definitely viable.

Lastly here are a few more pictures of the unique soldermask color.. depending on the light it looks either purple or blue-ish (mostly purple though)

It's Purple!
No it's Blue!

Friday, June 15, 2012

Building the ELM329 CAN Device - Part I

After a lot of digging I had finally found a supplier for the device enclosure that offered the exact enclosure I had based my design on. They were (of course) in China, but I decided to just go for it, since after doing some research they did appear like an official business. I had placed my order on a Thursday evening, and I had not heard anything by that Monday so I contacted them to see what the status was, fully expecting it would take another week or so before they'd even ship the product etc. To my surprise they did not only provide me with a valid tracking number right away, when checking the number on UPS it showed the package was already in California and making it's way up here so I would receive them the next day! Consider me impressed!

Device Enclosure with USB Cable
Meanwhile I also ordered a handful of the ELM329 chips from ElmElectronics.com. At $21 a piece they're not cheap, but hopefully I can recoup some of the cost by selling a few devices after I've confirmed this design actually works OK etc. (For those of you leaving comments interested in the Eagle files etc - I haven't decided yet if I will - or when, but I may simply sell some ready-built devices on GRRRR8.net or Ebay)

Now it was time to start building the PCBs - I basically watched a bunch of tutorials and figured - how hard can it be? so I dove straight in. First I started with the bottom side of the board. Since I have 2 layer PCB with both the Top AND Bottom populated, I'll have to bake the board twice - once per each side. Based on this I figured I'd do the side with the smallest / lightest components first so that once it comes time for the 2nd bake I wouldn't have the large chip etc hanging upside down and possible re-flowing to the point of falling off. Supposedly the surface tension will hold on any of these components just fine, so that will be an interesting 2nd session.

Usually you want to put your board somewhere solid (desk/workbench/counter) and in a frame so that it doesn't move. Because I didn't bother making a custom frame I used the common trick of making two L-Shapes out of extra PCBs and taping those down to the work area. They are the same thickness so there are no weird bumps when it's time to apply the paste. Next I put a piece of tape on my bottom-side OharaRP Kaplan Stencil and secured it so that it lined up just right, and I could still lift it up on one side.

Frame out of Extra PCBs & Stencilon top of PCB - Ready for the paste!
I had purchased a small jar of Lead-Free solder paste which was thicker than I thought it would be. It roughly had the consistency of grout you use with ceramic tiles etc while I was expecting it to be runnier for some reason (perhaps I had seen too many videos of people using the syringe paste..). Now normally you need some kind of tool to spread the paste on - Some places sell a $50+ specialty solder paste applicator, while others use a $5 homedepot spackle/putty knife. I went super cheap and used an old plastic card much like a credit card. This actually worked beautifully: I scooped some paste out of the jar and basically smeared it over the area. Then I ran the edge of my 'tool'  at a shallow horizontal angle to work the paste into the openings in the stencil. A second run over it, but this time more vertical cleaned 98% of the paste right off the stencil and left the pads nicely coated and I simply scraped the excess back into the little jar.

Paste applied through the stencil

Stencil lifted away showing the gray solder paste on the pads
After this it was time to place the components. For my SWCan ELM327 I had used 1206 components which took some getting used to. This time we were down to 0805 size components - If I had to hand-solder this stuff I would probably stick with 1206, but since all I really had to do was place them on the board for the reflow they weren't that bad to work with at all. I did notice that I probably should've made my silkscreen font a LITTLE bit bigger because at times it was hard to tell what the component was supposed to be.. (Is it R8 or R9??). After some work with the tweezers I ended up with this:


All components placed and ready for baking

Next step was to actually bake the board. I had gotten a small 1000W toaster oven (cheapest I could find) that went up to 450 degrees Fahrenheit. I didn't bother with getting a special controller for reflow profiles etc since these things take a while to heat up anyway. So, Instead I went at it barebones like many others have done. Basically pop in the board, turn on the oven to 400-450 and simply wait for solder to reflow, wait a few seconds, then turn it off and pop open the door to let it cool off.

Baking away

Cookies are done!
The end result looked really good - I would never guess this was done by some amateur in their kitchen vs a professional PCB house. Now the wait is on for the mail to deliver the ELM329 chips so I can try the other side and hopefully not screw up :)

Monday, June 4, 2012

ELM329 PCBS have arrived

Not really of interest to most people, but I'm excited about it so I figured I'd post about it. As I mentioned in a previous post, I had been goofing off in Eagle and sketched up a PCB for the ELM329 chip and the end result looking somewhat like this:
It would be a direct replacement PCB for the Generic ELM327 Clone boxes you find on ebay as shown in another previous post.

I had sent out for a batch of 10 PCBs and chose a Red Soldermask instead of the Blue depicted. Then, as I was waiting for these and being the eternal tinkerer, I kept playing with the schematic & layout and made another revision. It was a small change, but I wanted to get that board made too, so I send out to have 3 made through DorkBotPCB, which usually gives you a snazzy Dark-Purple with gold pads PCB. After I got that order in, I found that the Tantalum caps I was using (and were a few bucks EACH) could easily be replaced with an aluminum can cap that only costs 53 cents.. so Revision 1.3 followed soon after - and once again I ordered 3 boards of that revision. Of course incredible timing follows that I would receive all boards all at the same time!

All boards lined up - That's some groovy purple!
As you can see I have the 10 red revision 1.0 boards in the back,
then 3 revision 1.2 boards (yes I had an intermediate revision 1.1 I never had made), and in front the 3 latest revision 1.3 boards


I also ordered a Kapton SMD Stencil from OharaRP so I can try to bake these boards in a toaster oven instead of trying to hand solder all this tiny stuff.

The Silkscreen layer on all them is not the best since I did not really worry about Vias etc breaking up text (which it does XD ), since I would be doing the assembly most likely, but perhaps if I get to a revision 1.4 I'll tweak that a little bit too.

Original ELM327 Clone with the new PCB next to it
What's interesting is that this is the second clone I have of the generic ELM327s and the board is actually a bit different component wise than the first ( that one still has the SWCan mod in it).
Also if you have a keen eye you will spot something off.. The connecter for the USB on my board is actually smaller! Guess I'll have to redo the USB-Cables as well.. Apparently I used a standard 1.5mm pitch 4 pin connector, while the original board had a .1"/2.54mm pitch connector. Always something that goes wrong ;) At least it fits in the enclosure just right!

Fits just right!


Of course I have been looking at the new STN1170 chip which is looking pretty nice as well ( and cheaper than the ELM329) so perhaps a new batch will be a brand new design based on that chip instead. Meanwhile I have the actual board parts such as resistors, capacitors etc etc arriving tomorrow, so then I just need to get my hands on a toaster oven, and some time , which is usually the problem....

Sunday, May 6, 2012

Custom Hi-Speed CAN/ SWCAN Scanner (ELM329)

So after modifying an existing ELM327 Clone I read about the new ELM329 chip - it is specifically targeted for CAN Networks and sounded like a very interesting option. When I did some more research on it I ran across a post over on MP3Car.com where 'reinoso' showed off a board he developed. The cool thing about it was that he added a switching mechanism to select between Hi-Speed CAN or Single-Wire Can.

I figured it would be a fun exercise to try to design something similar. The ELM329 Datasheet provides the basic reference schematic so it was just a matter to add the switching mechanism and draw up the new schematic and PCB. Initially I started out in Altium Designer (which is GREAT) because Eagle is just too... shall we say 'quirky' (though some call it 'female' because it's illogical lol). Being a software engineer by trade, it has too many 'WTF were they thinking' issues - yes you can get used to them, but the fact they're even there just bugs me ;) . However as I got a little deeper into it I figured that if I ever wanted to release the schematic/pcb etc for public use, not too many people have Altium Designer, and thus would not be able to use it. so begrudgingly I went back to Eagle.

My goal for right now was to at least get the schematic going properly and then for a first build have the PCB fit inside the generic ELM327 device box I already have. I measured it's PCB and based my layout on that so that it would be a drop-in replacement. I kept both connectors (USB (4-pin) & OBD (original 8-pin) ) in the same place to make it as seamless a swap as possible.

For the actual soldering process I wanted to try out the reflow toaster over method, so for the main passive components I felt fine going to 0805 component size (yes I've heard of people doing 06 or 04 etc without problems, but I'm not the steadiest hand). The ELM329 comes in a SOIC28 (or DIP package) which is relatively large. Also for the USB connectivity I went with the SiLabs CP2102 - it only needs a few extra components, but it's definitely not a hand solder component being a 28-VFQFN component.


Top View of PCB
Bottom View of Board showing Both Can Transceivers and switch IC

Another Angle of the Top
I Made the above 3d previews using the EagleUp Plugin for Sketchup.Not all components were available so I had to get creative in making some of them myself (e.g. the 4 pin header block) & the MSOP 10 package for the switch (IC2) on the bottom.

Now it's off to finding a decent PCB Manufacturer who can build a few of these boards for a decent price.

Of course it will be interesting to apply this to the upcoming STN1117 chip and minimize the footprint even more.

Sunday, April 22, 2012

Radio Logos etc

So what's the point of getting more into the electronics side of things? Well, recently after digging through some folders on my old laptop I ran into a project I worked on last year.  Actually, over a year ago a certain someone (In Reservoir Dogs fashion as to not identify him, let's call him Mr. White, and since I drive a Black G8, I'll be Mr. Black ;) )  handed me a few binary files which were somehow dumps of the radio. After some digging I was able to figure out the file format for one of the files for about 99% and extract a bunch of graphics which I then turned into GIFs (obviously they are NOT in GIF format natively) for your viewing pleasure. In some of the other files I found the font graphics, and some other generic graphics like the 'MUTED' overlay, but this one file has the most fun stuff:

Look familiar? (You will probably have to click on them to see the animation)







Yes indeed - These are the available startup logo's (which are 362x145 natively) for the radio in the Pontiac G8 (& Holden commodores). While a lot of people know what byte to change to select which image on the EEPROM (which IIRC is 2kb) the actual image data obviously is located elsewhere. Mr. White , who dabbles in in-car electronics for a living, obviously/unfortunately was not willing to share how/where he got the memory dump, but having figured out the file-format of the dump file, I went ahead and wrote a tool to create a new file to insert custom logos into the binary file and provided this custom file to Mr.White to put back on a radio to try. However, since then no development has taken place, at least on my end, nor I believe on his end. A Sample of some custom logo's I made and dropped in (You may want to click on them to reload/replay them):




Irony of course is that figuring out the data was fairly easy for me (having done similar things years ago with e.g. the LithTech Game engine and writing a popular tool at the time called WinRez)  - but now figuring out how to get AT the data is the hard part. So at this point I'm on a little mini quest to see if I can figure out how to get at this data myself.

Hopefully this entry will someday have a nice part II/III etc with successful results - if not , then at least it will hopefully at least serve to show that if you have access to it the data can be deciphered (and possibly new images inserted)- I already wrote the specs to prove that ;).

Thursday, April 19, 2012

Adventures in SW-Can/GMLan Land - Part II

After reading Brads' blog over on GTOSoft about converting a generic ELM327 device to SWCan I figured I'd give it a shot myself using a cheapy ELM327 clone and document everything ( in what turned out to be this ridiculously long Blog post), including all the stupid mistakes I'd undoubtedly would be making.


Step 1 - Getting the Device
So I figured I would try out the SW-Can conversion on one of the cheapest most common ELM327 clones available. A quick look on EBay turns up hundreds of these. Since I figured I would always have my device connected to a computer, and at this point did not care about having a mobile app to display info etc etc I decided I would go with the standard USB Version. These can be had for less than $20 USD.

Generic ELM327 Clone
 Most pictures on Ebay show this device coming with a mini-cd with drivers/software etc, but mine simply came with some instructions on where to download drivers (if needed - which they weren't) and get some free and/or trial software. Another interesting point is that ELM officially states their latest version is 1.4b, and there is NO version 1.5, however on Ebay people are selling version 1.5 units, which upon closer inspection apparently are more like official version 1.2. The one I purchased had a large 'version 1.4' in the image, but of course after hooking it up to my PC and getting the version string out it says: Version 1.5.. Ebay + clone made in China != truth in advertising!

I figured I would plug it in and see if it would at least work with the Hi-Speed CAN in my G8 (which it's supposed to), but surprise, surprise - it did not work! Well let's crack this thing open to see what the deal is.



Step 2 - Let's see what's inside
Looking at the device it's an integrated box/connector unit with a single USB cable coming out the back. I was hoping it wasn't a case that snaps closed with plastic tabs, but luckily after running my finger over the sticker I could feel where there were some screw holes to open it.

Sticker Removed, exposing the screw holes

Back Cover removed
It was nice to see that both the USB and OBD2 Connector plug into the PCB with a connector, which saves me from having to desolder a bunch of stuff. Obviously this is a generic board used for several models since there were a bunch of unused pads and other areas.

Both OBD2 and USB Plug into the board

Top of the PCB

Bottom of the PCB
 Looking at the board, I took an inventory of any large ICs - I found the following:
  • PIC18F25K80 - MCU
  • MCP2551 - Hi-Speed Can Transceiver
  • FT232RL - USB Uart Chip
 Wait a minute! Weren't we supposed to find an ELM327 here? The ELM327 is a product of 'Elm Electronics', but if you look at the actual data-sheet of an ELM327 on page 74 you will see that it is basically listed as being 18F2480 chip. It's the firmware & command set that makes it an ELM327.
Here we have a 18F25K80, which obviously is a chip from the same family.
 
Location of the Can Transceiver
The Can Transceiver which we will be replacing is the MCP2551 and can be found on the bottom of this particular board. Just like Brad's protoboard, we will be soldering our protoboard to pads 1-4 , and then solder the SW-Can wire to Pin 1 on the actual OBD2 connector.

Pin 1 is not connected - this is where we will connect the SWCan line


Step 3 - Why won't this %$#!#& thing work right now?
This is an interesting side-note I wanted to at least mention. While I did not really care that it did not function on the Hi-Speed CAN Bus, I was curious at least as to why it would not work. After some digging I ran across a Fiat Community of all places where there is a long thread (28 pages currently) about these devices and reasons for them not working on a high speed CAN Bus.

It appears that these clones simply put a 120 Ohm resistor between the Can-H and Can-L Pins. However looking at the ELM327 Datasheet again on page 67 where the default schematic is listed you can see that instead of a single terminating resistor you need a different setup all together.

120 Ohm resistor between pin 6 &7 on the MCP2551? Why, surely you jest!
People have reported having success finding that 120 Ohm resistor and taking it off the board, or people have actually taken the time not only remove that resistor but also added R32/C8 & R33/C9 to the board. If yours isn't working check out the FAULTY ELM 327 INTERFACES DE-MYSTIFIED (READ HERE) link to see how to possibly fix it for your particular clone.


Step 4 - Getting the components & designing a new schematic
Now that I had my ELM327 device it was time to whip up a prototype board and get the components needed to do this. I obviously could see what Brad's components were: 2x Resistors, an Inductor, a Capacitor and the TH8055. I soon found out that the TH8055 is no longer produced, but in it's place there is now a TH8056. Ok , so we use the new part and keep the rest the same right? Not so fast....

I decided to compare the TH8055 datasheet to the TH8056 datasheet and found some interesting differences in their suggested schematics.
TH8055 Reference Schematic

TH8056 Reference Schematic
The main points of change seem to be:
  1. The 220 pf Capacitor connecting the SWCAN line to ground, now is a 100pf value
  2. A 1K resistor now runs parallel to the 47 uH inductor on the SWCan line
  3. The Load resistor connecting pin 6 and 7 is now 6.4K instead of 9.1K (not used in Brad's design)
  4. VBat (pin 5) now connects to CanH (pin 7) through a 100pF capacitor.
  5. The Resistor connecting Pin 4 (RxD) to the 5V regulator is now 2.7k instead of 2.5k Ohm
Some of these changes may not be totally necessary and are more there for ESD protection etc, but I figured I would apply these changes to Brad's schematic and come up with a schematic for the TH8056 that 'should' work. Again - excuse the bad schematic drawing skills ;)



Next it was time to get the supporting parts to build this onto a little prototyping board. As I was searching Digi-Key (Mouser did not seem to carry the TH8056) I ran into a SMD Based protoboard called a 'surfboard' by a company called Capital Advanced. This particular board (the 9801) had a SOIC-8 layout which would fit the TH8056 just perfectly. I hadn't planned on using SMD components, but it was a perfect excuse to turn this into 'Adventures in SMD components' as well !

The Protoboard "Surfboard" 9801
Based on this I decided to order anywhere from 10-50 of each resistor/capacitor etc since a) They're super cheap and b) I figured with how tiny they are you never know if you're going to lose them and c) The fact my soldering skills are sub-par I figured I would probably need to build 5 boards at least before I had one that would be acceptable & functioning ! ;)



Step 5 - Building a Protoboard
Once I had all the parts I figured I'd try my hand at getting some of these small components on the board. I opted for 1206 size (which according to a lot of SMD fans is still 'large' - hilarious - most people brag online about how 'large' things are, but in EE forums people brag about the smallest components they can hand solder...LOL), because that is what the Surfboard was made for. Also I didn't really want to go smaller because this was my first time dealing with surface mount components. As you can see from the picture these things are TINY!
1206 size Resistor - This is a LARGE one??
The datasheet for the 9081 Surfboard has a nice black & white image of the pad layout so I decided to print a few of these on a sheet of paper together with the schematic so I could draw up a decent way of layout the board without having to redo it everything.

Don't mind the wrinkles - this piece of paper has been places!

This didn't really work out too well for revision 1 since I tried to cram 3 components (+ a wire) onto 1 mid length pad. I realized this wasn't going to work after getting them on there and it looked like this (check top right):

Hey look it's amateur hour! BOOOH You Suck!
Another problem I had was that as I was trying to solder the components they kept moving. Even with me soldering on 1 side first and then trying to do the other they kept sliding about. It really makes me want to try the 'toaster oven' soldering method if I keep working with these SMD components. I read up on a few things and some people (and even the SurfBoard site) mention sticking the components down first with 'something' first (tack, super glue etc).

For my 2nd try I figured I'd use some (NON-CONDUCTIVE! ;) ) superglue with a needle to get the components in place first - and THEN solder them. Just sticking them on with glue gave a much nicer & neat result

Tacking the components with a little drop of Superglue
Next up I had several connections I need to make using 'jumper wires', or at least connect adjacent pads. In my list Digi-Key Order I had actually included some 0 Ohm resistors since I figured that would be a clean way to make some of these connections. (probably not what die-hard electronics people would use so apologies for this blasphemy, but it works for me!) E.g. in the previous picture you can see 2 0-Ohm resistors near the bottom of the SOIC pads, and one connection the top right 'pin 8' to what will be the ground connection.

For other parts though it still seemed a bit tricky if not impossible to use these 0-Ohm resistors to connect some pads. For instance - looking at the far right in the previous picture you can see a resistors, inductor and capacitor , and they all needed to interconnect, but squeezing in two more 0-Ohm resistors would simply not be possible. Looking around my desk I found a paperclip which had some kind of serration pattern on it. It matched the distance of the pads quite well, so I straightened it out and cut off little segments and soldered these in place to connect the pads!


Ah Paperclip - you come to the rescue once again!
Now we're getting somewhere! Includes Paperclip pieces ;)
After soldering on all components, connecting pieces and wiring it was ready to connect this to the main board and the OBD2 Connector. As mentioned previously the SWCan line would go to Pin 1 on the OBD2 Plug, while the Rest (+5V,GND, CANTx and CANRx) would connect to the pads where the now removed MCP2551 chip had resided.


Everything all hooked up and ready to go!
Step 6 - The (smelly & smokey) results
It was a bit of a struggle to get everything back in the case, but I managed to route the wiring that wraps around the board along the side to make it fit.. The plain backside of the proto board faces down so there's no worried about shorting anything, but I stuck a piece of plastic in between anyway just in case. I'll probably shrinkwrap the whole board to avoid any kind of problems. (In fact I may make another board and try to clean up a few messy areas, use some better wiring etc). The housing actually closes again (though it's tight) so you are left with a stock looking unit that now does SWCAN... technically that is, if I haven't screwed anything up, and of course you need to kick it into the right mode to start talking to your car.


Ready to test!

Ok lets hook up the USB Port and see if we didn't blow anything up:
  • Plug cable into PCB *check*
  • Plug USB Cable into PC *check*
  • Smell something burning *check* 
  • See smoke coming from proto-pcb *check*
  • Let expletives fly while yanking the cord out *check!*
WHAT THE?!?  ooookay.. so depending on how keen your eye is in the second to last picture above you may spot a stupid Pre-Electronics 101 mistake.. I was in rush to get the wiring done before going home for the day and unlike my schematic where +voltage is usually on top, and Ground on the bottom, on the actual PCB Board the GROUND was on the top right, and the +5 supply bottom right... Dumbass IDIOT me hooked up the wiring reverse and *poof* buh-bye TH8056..  and THAT boys & girls is why it's always best to get some spare parts! lol (of course I basically bought enough to build probably about 10 boards minus the TH8056s.. only got 2 of those - and now one ;) )

Step 7 - Try again!

Ok let's do this again....Besides hooking things up wrong, having to make another protoboard was a nice excuse for some more soldering practice and changing a few things I wasn't 100% happy with. For one the paperclip leads I made just didn't fit right. Instead now I snipped off the legs of a transistor I found 'somewhere' which worked much better. Also instead of rushing things and only tacking half my components down, I pre-placed EVERYTHING (instead of only half the components) with little dots of glue which gave a much neater result. Again I used the 0-Ohm resistors as jumps where I could to clean up the connectors and make it easier to connect the wiring to the board (using the longer pads)

Board #3 - super neat , let's hope I don't ruin it soldering!

Not Half Bad...if I may say so myself

Oh hey look - Correct polarity XD
A quick plug in to the PC showed the power on sequence on the LEDS without any dramatic visual or smelly effects. Excellent! Next was trying to connect it to the car and getting it to communicate.
I used realterm for now and set the connection rate to 38400. Based on comments I know this is too slow and will cause a buffer overflow unless you filter for a specific header, but for an initial test I didn't care. The ELM327 (& clones) doesn't officially support the 33.3kbps canbus, but it does support a 'user-mode' where you can force these settings. Based on Brad's findings he uses the following commands to initiate communication:

  • AT WS - Quick Reset of device
  • AT L1 - Turn on LineFeeds after each line
  • AT H1 - Show Complete message including headers
  • AT PP 2C SV 40 - Set Programmable Parameter '2C' to value 0x40
  • AT PP 2C ON - Turn Programmable Parameter '2C' ON
  • AT PP 2D SV 0F - Set Programmable Parameter '2D' to value 0x0F
  • AT PP 2D ON - Turn Programmable Parameter '2D' ON
  • AT PP 2A OFF - Turn Programmable Parameters '2A' OFF
  • AT WS - Quick Reset to restart with the above settings
  • AT SP B - use 'User Protocol B'
  • AT R0 - Do not wait for responses when sending commands
  • AT CAF 0 - Turn off CAN AutoFormatting
  • AT L1 - Turn on LineFeeds after each line
  • AT H1 - Show Complete message including headers
  • ATMA - Enter Bus Monitoring mode
A closer look at the programmable parameters in the ELM327 datasheet we can see exactly what is being set:
'2A' - Can Error Checking - Turned Off
'2C' - Protocol B Options : 0x40 = 1000000 binary, so bit 6 is 'data length' and the ELM327 sheet shows a value of '1' means we are dealing with a variable data length
'2D' - Protocol B Baud Rate: 0x0F ; The baud rate is calculated as 500/value = target kbps. So in this case we have 500/15 = 33.3333 kbps

This time when I hooked up the device to the OBD Port and followed the above steps.. SUCCESS! Glorious data streamed across my terminal screen, until of course the expected buffer error occurred. However that's an easy fix with some baud rate tweaks on the computer side etc.

So if you're interested in making your own SWCan device out of a generic clone for less than $10 it's definitely do-able! I may actually make a few more protoboards, or even a few whole devices if anyone's interested in buying them - especially since I've got spare-parts a plenty!

Now the interesting part comes with either talking to the car, or figuring out what certain button presses are. If you are interested to see what people have already figured out about this , check out the carmodder site here where a bunch of smart people hang out ;)