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 ;).