Category Archives: PCB
Designing a simple and cheap temperature logger. Part 5: New prototype PCB.
It has options to be powered by a Li-Ion battery (rechargeable via the USB port, with a MCP73831), as well as by a CR2032 coin cell. There’s an other option for the 1,8V EEPROM SDO line pull-up voltage adaptation.
All the options are selectable by fitting or not 0 Ohm resistors and adding the dedicated components.
In the Li-Ion version, it’s supposed to fit into a case like that (but with a hole for a button and a LED). It’s 19mm x 40mm.
The blue connector is the ICSP program port. I designed it to be “off-snappable”, as it’s connected only by three bits of PCB, where the signals pass.
NB: Some of my 3D models aren’t exact (like the battery socket, the 3D model is SMT instead of the through hole I have)
Here, an other PCB, Li-Ion only. Just for fun, I wanted to see how small the PCB (19mm x 38mm) can be routed with the components on the same face. On the bottom, there’s only a contact-style connector for ICSP:
The components names couldn’t fit on the top side, so I put them on the bottom.
The PCB could maybe get even smaller with a smaller 3,3V regulator, in a SOT23 package instead of the SOT223. The 32,768KHz crystal could also use a smaller package. But here, I hit the limits of the 2 layers, 6mil/6mil routing and I’m not sure some tracks won’t interfere each other.
The prototype on the first two images is the one I’ll be using to continue the software development.
Some news about ordering at iTeadStudio.com
A short update, hoping it could answer some questions people are asking themselves. This time, I ordered two different boards. One 15x10cm and one 5x5cm. I placed the order and uploaded my gerbers the 4/11/2011. As I had two different boards, I named the zips containing the gerbers with the size of the board (“10x15cm” and “5x5cm”). The shipment mail came the 11/11/2011 and the package the 18/11/2011. This time, it was sent with HK post registered airmail with a tracking number. Unfortunately, the tracking isn’t as good as the one with Chinapost (at least, with France as destination. I only had “the item left HK”). But it was fast. Also cheap, because they put the two board sets in the same box, so I only paid one dollar more (same price as one batch of 5×5 PCBs)
The small PCB had twice the same design. It seems to be OK, as long as you don’t put anything that eases the board cut (slots, holes line or V-groove):
As usual (so far) the fabrication quality is excellent for the price.
You’ll notice the slots for the USB plug. I’m using Altium and when a board has slots, it generates a separate drill file for them. I included the two files (round holes and slots) in my zip and apparently the fab managed to figure out what to do with them. Cool.
I used 0,15mm lines for some silkscreen (the rectangle around the tiny temperature sensor package). I see I should rather use 0,2mm lines instead, like for the other lines. The tracks, vias and separations have the same size like before (see my previous notes about iTeadStudio). I soldered the components, everything worked fine (at least mechanically). Except that one of the regulator packages is wrong, should be SOT233. Argh. Stupid me. (Well, better too big than too small.)
The 10x15cm PCB is a 16 input, SNMP state output board. You can configure each input to be pull-up, pull-down or current loop —active. Each input is opto-isolated, plus MOV and fuse protected. A web page allows you to configure the board (IP,SNMP and inputs), display the inputs state and the embedded temperature sensor reading. Then, you get the inputs state by SNMP polling or traps. I’ve been working on this for quite some time and it’s really cool.
I had one board extra (cool, especially I’ll use all of them this time) and I took the 100% e-test option. One board has a small offset in the holes, but still within the specs.
I’ll try to make a separate post about this board if I have time.
Canon EF-S Protocol and Electronic Follow Focus
Two years ago, I spoke with a film maker who told me about the problem of manual focusing with the video enabled Canon DSLRs. As the focusing sensor works only when the camera’s mirror is down, when in video mode, with the mirror up, the camera switches into manual focusing mode, via the lens focusing ring. Several solutions exist on the market, but they mainly use mechanical links to deport the focus ring to more accessible place on the camera rig.
Some electronic solutions exist, but they use the Camera’s USB input and the focusing speed is quite low.
I decided to dig into the communication protocol between the camera body and the lens.
Canon EFS lenses are connected to the body via a 7 pin connector. Three for the power supply and four for a standard SPI serial interface (including digital ground).
Then, I bought a lens extender to be able to probe the communications on the bus. First only in parallel, dumping the data and then, I interfaced a microcontroller between the camera body and the lens:
The communication is always initiated by the camera. The lens can send a busy state by pulling the Dclk pin down (what it does after every received command as an acknowledge sign). The clock frequency is approx. 80kHz. One byte length, including the busy state from the lens, is 113us.
The camera reads the Din line state on rising edges of the Dclk line it generates. If there’s no ack from the lens, the camera will display an error after two or three tries.
The Dout line is held down when the camera generates the Dclk to read a byte from the lens on the Din line.
Being (also) a photographer myself, I had several camera bodies and lenses to test and I was able to find out some of the basic commands:
I started by making my microcontroller to repeat the commands and answers, including the busy flag management. Then, I implemented a small function that allowed me to turn the focus ring using a digital encoder. It worked ok. The problem is, every lens has different number of steps for the whole focusing range. Some have like 800, for others, it’s more 2500. It’s clear I had to increase the number of steps of the focusing ring for each of the encoder’s steps. That’s where the problems started to appear. The only solution I could come up with was to calibrate each lens at power-up by making it go across the full range of focus, counting the steps so I could use this number in my firmware.
Another problem was to make the camera generate the power supply for the lens motor when I was sending commands to it with my microcontroller, as the motor power is only generated by the camera when it has to send focus commands.
The protocol data speed is quite fast, so a powerful micro must be used, as it has to translate the commands on the fly and transmit the correct answers to the camera body (if not, the camera displays an error and stops filming). But the biggest problem was to figure out how to fit and connect my circuit to the lens. There must be an input for the command (digital encoder or potentiometer). The power supply can be external. Adding a lens extender is the easiest solution, but it changes the lens parameters (depending on its focal length, it becomes more or less a macro lens)
I settled on two cables coming from the lens, one from the camera side connector, the other from the lens circuit side. For still pictures mode, the two cables would connect together, without the interface circuit. For video shooting, the interface circuit containing the microcontroller, user input and probably a battery for lens motor drive would be connected. Each lens has to be modified to be plugged to the Follow Focus circuit.
Unfortunately, I had to stop working on this project. It was taking me too much time and I didn’t have the appropriate measurement equipment (a good digital oscilloscope with a big memory). It’s obviously a big project, especially if the result is supposed to be sold to video makers, with rugged and bug-free design. Canon could change its protocol, or increase the data speed, making the new lenses or cameras incompatible. The development requires a lot of testing, with all the possible lens/camera combinations. (whereas the price don’t come so much into account, the mechanical follow focus systems are extremely expensive and this electronic follow focus would be for the professional market).
Even if this project left me a bit disappointed, it was still interesting to try to reverse engineer the protocol and understand how the Canon lenses work. If you’re interested in taking it over, just leave a comment and I’ll be glad to help you.
MDO4000 RF “Reverse Engineering”
After Dave’s Tektronix MDO 4000 teardown I decided to try to reverse-engineer its spectrum analyzer PCB. I used Dave’s high resolution photos (from his Flickr), my general RF knowledge and one of Dave’s post comment, by “Carlos” (helpful, thanks!).
My last work consisted of RF maintenance and design, with a large range of frequencies, so the block diagram I made shouldn’t be too off from the reality.
I think I got the most of the PCB. A lot of parts are from Hittite (RF switches, amps, VCOs and Log detector). I omitted some minor parts (DC and AC blocking for example). Unfortunately, I wasn’t able to find the I/Q analog-to-digital converter. Maybe it’s under one of the shielded cans or on an other PCB. As it’s a 10GSpS, it must have direct access to a memory of any sort, so it could be close to the main processor/FPGA.
Schematics (pdf):
Photo with the numbers matching the schematics (pdf, 6Mb):
MDO4000 Photo with numbers for the Block Schematics
Block schematics with PCB components thumbnails (pdf, 9Mb):
MDO4000 RF Block Diagram with Thumbnails
If you find any error or want to add comments to the schematics I made, don’t hesitate to comment!!
Altium DRC settings for iTeadStudio PCB service
Just a quick informative note with my Design Rules settings for the iTead Studio PCB service, with Altium.
Electrical Minimum Clearance: 0.2mm
Routing Width: 0.2mm
Routing Corners: 2,54, 45° (not really relevant)
Routing Vias: Minimum Diameter: 0.5mm; Minimum Via Hole Size: 0.3mm Preferred: 0.35mm
Solder Mask Expansion: 0.1mm
Power Plane Connect: Conductor Width: 0.3mm Air-Gap:0.3mm Expansion: 0.5mm
Power Plane Clearance: 0.5mm
Polygon Connect: Conductor Width: 0.3mm
Manufacturing Hole Size: Minimum: 0.3mm
Hole to Hole Clearance: 0.2mm
Minimum Solder Mask Sliver: 0.1mm
Silkscreen over Component Pads: 0.15mm (actually, should be rather 0, as the silkscreen isn’t (or shouldn’t be) printed on pads)
Silk To Silk Clearance: 0.1mm
Also, don’t forget the minimum Soldermask line width is 0.1mm (for text and drawings)
Sorry for the metrical system impaired people. As you can see, these settings are a little bit tighter than the ones specified by iTeadStudio, to go along with their “6mil (recommended >8mil)” funny sentence. Well, not really, as 0.2mm are equivalent to 7.87mils but it worked for me. Maybe the 0.35mm/0.5mm vias are borderline. If you want to be sure about the results (and not get the Fab people angry), you should make it more 0.35mm/0.6mm or 0.3mm/0.7mm, as there’s a 0.09mm tolerance in the hole registration and diameter.
For Gerber generation, I use the default settings, with the 2:3 and inches option. Don’t forget to select only the layers you use (top/bottom, Silk top/Silk bottom, Solder top/Solder bottom) and the RS274X format.
If my second batch of boards have a problem, I’ll update this post.
As last advice, I’d say to not rely on your power plane connections (if you poor a power plane on your board), but to make connections with tracks first and only then poor the power plane, so you’re sure that you’re within the minimum width/spacing specs.
iTeadStudio PCB test: Populating the board
After I received the PCB ordered form iTeadStudio last week, I soldered the components today.
So far, everything related to the quality of the PCB looks fine. The footprints match, the FR4 substrate handles the temperature well (1 mm thick option) and the HASL finish is ok and easy to solder on. It changes from my hand-etched PCBs.
I successfully programmed the PIC with Microchip’s USB device example firmware.
Unfortunately, the board wasn’t recognized once plugged. The LEDs were blinking, but nothing in the USB device list. After some investigation and noticing that the LEDs were brighter when the board was powered by USB than with the external power supply jack, I found the problem: I have dyslexia.
Or rather, let’s say: “Don’t name you schematic nets with names that one could mix up” Indeed, in the schematics I inspired myself from, there were two different nets with very close names. One called “Vbus” and the other “Vusb” all written with caps / small caps. And of course, I connected the Vbus to the Vusb and when powered with USB cable, the 3,3V regulator was by-passed and the PIC was fed +5V directly to its “VUSB” pin.
Luckily, the PIC didn’t die, even if +5V is over its maximum voltage rating. The PCB was easy to fix by cutting a track, adding a wire and de-soldering a diode. Unfortunately now I have to be careful to not plug an external power supply when my board is plugged to a computer (no more protection preventing back feeding of current to the USB cable). Well, I should live with it.
This board is inspired form Microchip’s FS USB plug-in board. I added a Texas Instrument’s RS232 transceiver (MAX3221), three LEDs, three push buttons and connectors with the six GPIO ports from the PIC.
I’ll play with it now to see what I can do with USB and all those GPIOs.
Testing iTead Studio PCB service.
Few months ago, iteadstudio.com opened one of the cheapest PCB making service of the web. They claim a 6/6mil and 0,3mm hole size specs. Two layers with top and bottom silkscreen, soldermask for everyone, Woohoo! Their prices start at $12 for ten pieces of a 5x5cm PCB plus $4 shipping (in my case, to France). They even have a special offer right now at $9.90 for 10 pieces of 5x5cm PCB. And for $10 more, you get all the boards e-tested (“only” half of them are e-tested for free).
It seems like it’s not worth any more to bother with home made etching for small boards, for that price! (I pay something like 9 Euros for a 120×150 blank FR4 board (w/o shipping) and I have to make vias myself and of course, no silkscreen, no soldermask)
I needed to make a 120×150 PCB with features impossible to achieve without real vias, so I decided to test iTead Studio with a small 5x5cm board. For a long time, I also wanted to learn USB programming with PICs and to use Altium designer. Three good reasons to try the Chinese fab.
I adapted Microchip’s USB demo board schematics, the one with a 18f87J50 microcontroller and threw the components on the board (after some nights spent with Altium tutorials. Argh, libraries.)
I used the following design rules: track width: 0,2mm. Vias diam:0,5mm. Vias holes: 0,35mm. Solder mask extension:0,1mm. Minimum soldermask sliver: 0,1mm. Silk/Silk: 0,1mm. iTeadStudio advises to not go as low as 6/6mil, but try to use 8/8mil rules. Some people (like Dave Jones from EEVblog.com) had a bad experience with the fab changing his gerbers, but it was before they updated their fab rules.
After checking and double checking my gerbers (it was the first time I sent something to a fab), I ordered and paid for the 5x5x10 PCB service the 24/08/2011 @1:50pm (local times). My order was confirmed ten minutes later, with the address to send my gerbers to, what I did @ 2pm ; the two copper layers, two silk layers, two soldermask layers and the drill file, all zipped and labelled as instructed on the website. I received an answer the 25/08 @4am, saying they submitted my files to the fab and that they’ll keep me updated if there’s a problem. Apparently, my files were all right, because the next iTeadStudio mail was on the 30/08/2011 @3:30pm with a tracking number for my PCBs (I took the air mail shipping, for $4).
The tracking number worked two days later:
Actually, you only get the tracking inside China (at least in my case with France as for destination)
The package was delivered to me on the 09/09/2011. That’s one week shipping, which is really fast! As the value was small, I apparently didn’t have any trouble with French customs.
I got twelve PCB. Six of them have a mark on the side meaning they passed the e-test:
After a quick visual inspection, I noticed a suspicious track on one of the e-tested boards but I checked it myself and it’s ok. An other e-tested board has its silkscreen erased on a 1cm wide band.
e-tested board (top):
(I didn’t take the time to tidy my routing as I usually do. I also forgot to configure the GND poor to integrate all the GND tracks). The board edges could be better, but maybe the rounded corners I defined were too small. I tried tenting on some vias (to see if they would make it). It worked, they’re on the extreme right side and one under the S1 switch. I didn’t try NPTH, I’ll do it next time (but I don’t see why it wouldn’t work, they’re offering to drill slots)
Here, the board with superposed picture from Altium:
As you can see, there’s a tiny offset in the silk printing and the soldermask is a bit strange (it overlaps on the vias). Apart from that, it’s perfect.
Gif animation (click to open):
View of a non e-tested PCB:
You’ll notice the shorts on the upper left corner and under S1. If it’s the only errors, it will be easy to fix. An other non e-tested board has a line of shorts on the big chip footprint (un-fixable). Actually, it looks like a hair on the photomask 🙂
Except these two PCBs, the other non-tested ones look quite OK. I’ll check them if I have time.
Conclusion:
Is it worth it?
I’d say YES! Even if you need only one or two boards, it’s still less pain than to etch them yourself. And you’ll have a real silkscreen, a real soldermask and real vias! Even for larger boards, it’s still worth it, in my opinion. You should maybe consider buying the $10 100% e-test when you start to exceed the 10x10cm dimensions. If you’re a hobbyist or even an advanced hobbyist, you’ll be able to have enough-quality PCBs for very cheap. If you’re a professional, maybe you should consider a fab closer from your country, one you can directly talk with, but I’d say iTeadStudio could even be used for the first prototypes. If you have time to wait for the shipping.
All in all, the fabrication and shipping took 16 days, including two weekends. It’s really not bad, but maybe I was lucky. More expensive or bigger orders could be checked more carefully by your country’s customs.
So, where’s the catch?
Well, if I look at the boards, I don’t see any catch. You get what you pay for, even a little more. There’s also SeeedStudio offering the same PCB services and some people were saying iTeadStudio and Seeed use the same fab (makes sense, same price, same options, same DRC rules). It’s the first service for proto boards with such small prices I ever see. I suspect the fab is making those PCBs at the same time as other more legit orders and uses the available room on the boards to process the prototypes. Also, they seem to print as many boards as it takes to reach the 50% OK e-test (I got 12 boards).
But once again, I base my thoughts on the only order I passed and the first one. I’ll update this article when I order more boards. And also when I’ll solder the components on the boards I just got.
Jean.
[UPDATE]: See then new post about fitting components on the board.