How to reverse engineer a simple through-hole board - Page 1
Forum section: electronics / beginners

author: victor
author_rank: Regular Contributor
timestamp: August 29, 2013, 01:58:34 am
content: This is a simple guide that I made to reverse engineer simple circuits.Take the best pictures of both sides of the board that you can.You can use a scanner to scan the bottom side of the board, but not all scanners will be able to focus the top layer because of the height of the components.To this guide I used a 3MP camera of the iPhone 3GS without any special lighting or anything. You will almost always likely to have a picture taken with better equipment and conditions.Import then to a blank canvas on your favorite editing program. I'm usingAdobe Fireworks, you photoshop or almost any image editing software.The images must be in separated layers.Use thePolygon Lasso toolto crop the board from the rest of the picture. Do the same for the other side.Use CMD-X to cut and then CMD-V to paste. It will lift the selection from the background. And then just delete the background. Do the same for the other side.Use the Rotation CW/CCW and Flip Horizontal/Vertical to adjust the pictures to the correct position.* You will want the bottom of the board to be mirrored, so it matches the components side.Decrease the opacity of the top layer down to around 50%~75% so we can se through it.The 2 images are not in the same size, or angle. So we will use theDistortion toolto resize and straighten the corners of the top side so it match the bottom side.* Alignment is critical, so take your time, use the zoom/magnifier and check if everything is aligned. Look for the holes in the board, it is the easier way to check if the board is misaligned.BlendingThere are many methods that can be used toblendimages.Not all will work on all cases.But I will go through a few of methods that may work for the majority of people.The adjustments are subjective and will depend on your board color, illumination, exposure, etc... there are many variables, play around and find what values works best for you.Screen BlendDrag the bottom side to upwards the components side (copper side's layer on top of component side's layer).Darken the copper layer using Brightness/Contrast filter and set brightness to -50Select the copper layer and select blend mode to Screen/Interpolation or Average and set to 80Luminosity BlendDrag the bottom side to upwards the components side (copper side's layer on top of component side's layer).Increase the constrast of the copper layer usingLevelsfilter, drag the pins to twords the hill.Select the copper layer and select blend mode to Luminosity and set to 50Brush + ThresholdDrag the bottom side to upwards the components side (copper side's layer on top of component side's layer).Select the copper layer and use theBrushand draw lines connecting the solder pads/holes, you can also use the path/line tool to draw straight lines instead. Use a solid color that is not used by the solder mask. In this case the solder mask is green/yellowish, so I used blue.Apply aInvertfilter.Use theLevelsfilter orThresholdfilter to extract just the solid color.Drag the left pin all the way to the right.Apply the filterHue/Saturationand choose the color of the track of you preference rotating the Hue.Select the copper layer and select blend mode to Additive and set the opacity to around 70 to adjust the intensity of the track.Now we are ready to write down the values, and then transfer it to aCAD Software.

author: Fsck
author_rank: Super Contributor
timestamp: August 29, 2013, 02:03:47 am
content: that's pretty clever actually, but I'm not sure it's faster than the old school method. though I suppose this way is far less error-prone.

author: ablacon64
author_rank: Frequent Contributor
timestamp: August 29, 2013, 02:11:09 am
content: Very interesting! Thank you for the post!I agree it takes time but it's precise.

author: robrenz
author_rank: Super Contributor
timestamp: August 29, 2013, 02:18:29 am
content: Nice technique and nice quality post

author: c4757p
author_rank: Super Contributor
timestamp: August 29, 2013, 02:29:08 am
content: Do you mind if I claim I thought of this first? Because I'm kind of embarrassed that I didn't...Nice

author: marshallh
author_rank: Unknown
timestamp: August 29, 2013, 02:53:34 am
content: Used this to great effect for reversing smd boards, though only 2layer

author: victor
author_rank: Regular Contributor
timestamp: August 29, 2013, 03:13:38 am
content: Quote from: Fsck on August 29, 2013, 02:03:47 amIt don't take longer than 5 minutes, and if you take a decent picture you will be amazed how good it can look.I made a pretty rusty picture with a phone holding the board with my hand, to show how little effort it take.Actually it took me much longer to do this post than to do the thing itself.

author: victor
author_rank: Regular Contributor
timestamp: August 29, 2013, 03:18:29 am
content: Quote from: marshallh on August 29, 2013, 02:53:34 amI used this method to reverse engineer SMD as well. The good thing is you can use a scanner instead, the quality is much better.But if you have multi layer board there's no hope.

author: SeanB
author_rank: Super Contributor
timestamp: August 29, 2013, 04:11:11 am
content: Great tip there.

author: BravoV
author_rank: Super Contributor
timestamp: August 29, 2013, 04:48:34 am
content: Neat trick, thanks for sharing !

author: Kremmen
author_rank: Super Contributor
timestamp: August 29, 2013, 06:06:05 am
content: Quote from: c4757p on August 29, 2013, 02:29:08 amMe too. But i actually did think of it some time agoNice post however.

author: Kevin.D
author_rank: Frequent Contributor
timestamp: August 29, 2013, 08:23:57 am
content: Nice idea and post ,thanks .This method could be perhaps used to create a program that does the steps automtically working fromthe two photo's ,with some optical recognition algo's to allign the top and bottom and recognize the traces ,and possibly even automaticaly identify most of the components used ,you could automate the whole process and reconstruct a circuit diagram of the pcb. I dont know if there is any software currently available that could do this. ?

author: Jon Chandler
author_rank: Frequent Contributor
timestamp: August 29, 2013, 11:48:51 am
content: I used a scanner when I needed to figure out the connections on a flat-flex breakout adapter. It went from fine-pitch 50 pin connector to a couple connectors and a laser scanner in a hand held PocketPC with several transistors included. I needed to create an in-line circuit board to access one of the serial ports included in the cable.The connections were impossible to trace – too small to see without magnification but too difficult to follow across the 6" long piece if I had enough magnification to see it clearly. Scanner to the rescue. I put it right on the glass, scanned at max resolution and printed it out as large as possible on an 11 x 17 sheet. Much better...big enough to see! It was a little fuzzy around the 0603 components and transistor be still easy to make out the tracks.

author: rdl
author_rank: Super Contributor
timestamp: August 29, 2013, 12:03:05 pm
content: Reverse engineer? I was expecting to see a schematic. This is copying, more or less.Nice detailed post though.

author: Rerouter
author_rank: Super Contributor
timestamp: August 29, 2013, 12:17:38 pm
content: its one of the first steps to reverse engineering, work out the circuit connections and parts, then the functional blocks then profit

author: Rigby
author_rank: Super Contributor
timestamp: August 29, 2013, 12:27:07 pm
content: I need to do this, and this is an excellent method, looks like.There's a certain bit of electronics hardware that I want to redesign and/or reproduce for my own purposes. Reversing the physical working hardware (the schematics from the vendor don't match their production hardware) will go very far towards my goal. What I want to make isn't manufactured any longer, sadly, and it's a very niche bit of hardware. CRT Arcade monitor chassis.

author: envisionelec
author_rank: Frequent Contributor
timestamp: August 29, 2013, 12:54:09 pm
content: Ah - one of my (many) tricks to reverse engineering. I also use an electron microscope for multilayer boards. It helps to know the owner.

author: ablacon64
author_rank: Frequent Contributor
timestamp: August 29, 2013, 01:19:33 pm
content: Quote from: envisionelec on August 29, 2013, 12:54:09 pmThat's an expensive toy you have.

author: Mechatrommer
author_rank: Super Contributor
timestamp: August 29, 2013, 01:28:51 pm
content: Quote from: c4757p on August 29, 2013, 02:29:08 amdo you mind if i claim i've done this so many times since before i joined in? nice trick yesss! if somebody like to argue, this method will lead to a more organized reverse engineering. i drew tracks and components symbols like in normal schematic in photo editor sw, and then rearrange it in eda software later. though i dont (never did) usually reverse engineer all the circuit, usually my intention is only to understand some portion of circuit or to make repair job easier. i also agree pencil and paper can do the same, but i believe we may need many papers and pencils and erasers to do so.

author: MacAttak
author_rank: Unknown
timestamp: August 29, 2013, 02:55:27 pm
content: Beats the snot out of probing for continuity, resistance, and capacitance with a DMM for hours!

author: Rerouter
author_rank: Super Contributor
timestamp: August 29, 2013, 08:31:37 pm
content: also makes it far easier for dual layer boards, single layer is easy to pencil out, but even with 2 colours you loose your bearings on double sided stuff, even worse is when its heavily populated

author: victor
author_rank: Regular Contributor
timestamp: August 30, 2013, 04:42:32 am
content: Quote from: envisionelec on August 29, 2013, 12:54:09 pmAn electron microscope doesn't damage some chips? I never used one or had access to one.

author: MrAureliusR
author_rank: Unknown
timestamp: August 30, 2013, 05:31:30 am
content: I'd like to add a technique that I find makes this much, much easier.Mount your camera on a tripod, if you have one, and point it straight down at the table. Put a piece of paper down on the table, and put the board on top of the paper. Trace the shape of the board onto the paper. Now make sure the board is lined up (this works well with square/rectangular boards, obviously) and take your first picture. Now flip the board, line up with the trace, and take picture #2.If your board is a weird shape (assuming my brain is working properly right now) you could also trace with a heavy marker, and then flip the paper as well, and then line it up facing the other way. This might help when you go to mirror and line up the images. (Or am I doing this backwards? My spatial awareness is only good when something's right in front of me)The reason this works better is both pictures are the same aspect ratio and size, which makes it much easier to line up once you flip the images around. Then follow the rest of the instructions to blend the images together and you're all done!

author: pickle9000
author_rank: Super Contributor
timestamp: August 30, 2013, 06:42:33 am
content: When I was a lad (actually not a lad at the time) we used a flatbed scanner on a board component side down with a 200 watt incandescent above. The flatbed we had kept in focus up to almost 2 cm which covered most stuff. Cameras at the just didn't have the resolution. The beauty was you could see through most boards and the scanner light was bright enough to illuminate the components. No not perfect but this was a number of years ago.

author: victor
author_rank: Regular Contributor
timestamp: August 30, 2013, 03:06:05 pm
content: Quote from: pickle9000 on August 30, 2013, 06:42:33 amYeah I'm doing this for a long time, I used to have a old flat bed scanner, those with fluorescent light and it was able to focus like 1~3 cm above the glass, but I can't with my actual scanner.

author: victor
author_rank: Regular Contributor
timestamp: August 30, 2013, 03:33:29 pm
content: Just scanned something quickly to show how bad it turns out, but I know that some scanners do it pretty wellSo in that case a camera gives better results, even with a bad iPhone 3GS cameraIn sun light

author: Mechatrommer
author_rank: Super Contributor
timestamp: August 30, 2013, 04:13:30 pm
content: Quote from: MrAureliusR on August 30, 2013, 05:31:30 amtheoritically and ideally speaking... use the greatest focal length you have. anything greater than 50mm (eqv focal length to full size sensor) is acceptable, the greater the closer it is to ideal. to avoid perpective distortion to bigger bulging components. no offense but the tracing you mentioned is an extra and unnecessary work. any photo editor with "scale and distort" feature can align easily. just as in the OP procedure.i usually put a round brush or contrasty color on each corner, for each layer and make the alignment as in the OP, please note the green blobs in picture below, they are actually overlapped between bottom and top layer. it not only work for simple and square board. but also work with more complicated pcb shapes and bulgy components on each side that is hard to trace on paper.

author: PA4TIM
author_rank: Super Contributor
timestamp: August 30, 2013, 05:45:35 pm
content: Something I do a lot: with complex repairs/alignments. I make a picture of the pcb and scan the page from the manual . Much more easy to find adjustment , measure points or components.This is the drawing from the tek manual projected over a picture of the board. (not the best one but the most are full resolution so not handy to show.But the trick the TS does is indeed handy, I heard it from a friend and used it a few years ago for the first time while reparing a HP 5326

author: pickle9000
author_rank: Super Contributor
timestamp: August 30, 2013, 05:50:59 pm
content: That is very nice PA4TIM! if you have it of course.

author: envisionelec
author_rank: Frequent Contributor
timestamp: August 30, 2013, 10:10:06 pm
content: Quote from: victor on August 30, 2013, 04:42:32 amI don't scan board with parts on them. Never tried that, but I can only assume damage.I don't own the SEM - it belongs to the company for which I work.

author: jahonen
author_rank: Super Contributor
timestamp: August 31, 2013, 01:27:13 pm
content: Quote from: envisionelec on August 30, 2013, 10:10:06 pmI have always thought that SEM can only "see" surface structures due to the principle and even thin coating blocks the view. Can you elaborate how you can look inside with it?Regards,Janne

author: dds
author_rank: Contributor
timestamp: September 06, 2013, 11:49:39 am
content: "Import then to a blank canvas on your favorite editing program. I'm using Adobe Fireworks, you photoshop or almost any image editing software. The images must be in separated layers"How to put images in separated layers in GIMP? Have no money for fancy Adobe products, and I'm pretty inexperienced in picture editingThanks for any help!

author: redben
author_rank: Contributor
timestamp: September 06, 2013, 01:04:36 pm
content: Hi nice tutorial.Just to satisfy my curiosity.What is the board in the example used for ?Thanks to share your knowleges with us

author: Legit-Design
author_rank: Frequent Contributor
timestamp: September 06, 2013, 01:16:27 pm
content: Quote from: dds on September 06, 2013, 11:49:39 amFile -> Open as Layers... Ctrl+Alt+OFirst you need to download gimp and install it.

author: ablacon64
author_rank: Frequent Contributor
timestamp: September 06, 2013, 02:28:46 pm
content: Quote from: dds on September 06, 2013, 11:49:39 amQuestion answered by Legit-Design. Just a comment, it's not the cost that makes a good software, Gimp is a very powerful and fully featured image editing software. as good as photoshop is. You just need to learn how to use it. Like Photoshop, it has lots of advanced features to be mastered.

author: dds
author_rank: Contributor
timestamp: September 06, 2013, 04:08:17 pm
content: Quote from: Legit-Design on September 06, 2013, 01:16:27 pmThanks for the tip. I've installed GIMP and tried it. But I'am again stuck in point 7 of tutorial:7. "The 2 images are not in the same size, or angle. So we will use the Distortion tool to resize and straighten the corners of the top side so it match the bottom side"What's equivalent for 'Distortion tool' in GIMP? I've found this manual page:http://docs.gimp.org/2.4/en/filters-distort.htmland there's menu Filters --> Distorts, but I'm bit confused what and how to do this in GIMPThanks for any help.

author: Legit-Design
author_rank: Frequent Contributor
timestamp: September 06, 2013, 04:25:49 pm
content: Quote from: dds on September 06, 2013, 04:08:17 pmTools -> Transform tools -> pick your toolNo need to do everything by the book, I here by give you the right to improvise.

author: victor
author_rank: Regular Contributor
timestamp: September 06, 2013, 05:57:37 pm
content: Quote from: redben on September 06, 2013, 01:04:36 pmIt's used on a ancient inversor to generate a square wave, actually is a pretty bad design (not mine).Quote from: Legit-Design on September 06, 2013, 04:25:49 pmI'm not familiar with GIMP but I'm pretty sure it can be done.as I said on the first post, some things will be slightly different on other softwares."The adjustments are subjective and will depend on your board color, illumination, exposure, etc... there are many variables, play around and find what values works best for you."

author: victor
author_rank: Regular Contributor
timestamp: May 23, 2015, 05:32:18 am
content: http://extrazoom.com/image-35217.html

author: dom0
author_rank: Super Contributor
timestamp: May 23, 2015, 03:09:30 pm
content: Quote from: victor on August 30, 2013, 03:06:05 pmFlatbed CCD vs flatbed CIS. CIS ones are cheaper and have about 1 mm of focus depth. Those with a CCD line usually have 2-4 cm focus depth.

author: victor
author_rank: Regular Contributor
timestamp: May 23, 2015, 03:22:23 pm
content: CCD Scanners have actual optics inside then instead of just a blob of acrylic that they call contact lens somethin-something.Nowadays digital cameras are more accessible than ccd flatbeds

author: albert22
author_rank: Regular Contributor
timestamp: May 23, 2015, 04:07:41 pm
content: Victor, nice work. Thank you for the post!As a contribution here is what I posted in another thread:Quote

author: ez24
author_rank: Super Contributor
timestamp: May 23, 2015, 07:37:02 pm
content: To VictorI like the original post's layout. I think it is better than attaching pictures via the "options". Did you do it with html? I saw that one picture is posted at"i.stack.imgur.com"I really liked the animation. Was it a gif?Since no one has complained about linking in pictures from another site, I would like to learn how. Maybe this is common on this forum but yours is the first I have seen.If html can you show (if possible) a few lines of code to link in a photo to get me started.thanks

author: victor
author_rank: Regular Contributor
timestamp: May 23, 2015, 08:00:23 pm
content: Quote from: ez24 on May 23, 2015, 07:37:02 pmMost forums I participated don't allow html, just BB code.to attach pictures I host the pictures on a image hosting service like imgurCode:http://i.stack.imgur.com/uRkHO.jpgto limit it to the max width of the forum for large images.Code:[img width=700]http://i.stack.imgur.com/uRkHO.jpgfor clickable picturesCode:[url=http://linkofthefullpicture]http://thumbnail.jpgThe animation I used the same software (Adobe Fireworks) to combine multiple screenshots into a GIF.Attachments are good, only if you could inline then in the post would be great, and you can't view then when not logged on most forums.

author: ez24
author_rank: Super Contributor
timestamp: May 23, 2015, 09:40:14 pm
content: thanks