Web access lab board (internet of things)

Description

Lab board to connect almost anything to the web. This low cost solution uses a 3$ PIC16F628 microprocessor and a 15$ OpenWRT router.

15$ TP-Link WR703N router

Features

  • 6 wire terminals for I/O and power/ gnd
  • IR receiver
  • 2 user defined switches
  • Up to 6 status/debug led’s
  • Mini USB connector for power
  • Single sided PCB
  • SMD microprocessor (PIC 16F628) with ICSP connector
  • Measure wires for VCC, GND, SDA & SCL

Development

I have developed a lab board that connects to the serial port of a router running OpenWRT. This means that I can have a tiny stand alone device that controls various devices thru a web interface over Ethernet or WLAN. The PCB is using the same form factor as the low cost and tiny TP-Link WR703N router. I have modified the router so that the serial communication is available thru the micro USB port (see this post for details). The PCB can be made either using toner transfer, UV mask or milled with a CNC mill. I used the last option, giving me a PCB with drilled holes in less than 10 minutes. It took less than an hour to solder the components. Please note that a lot of components are 0603 size, so I recommend a good solder station with microscope. I used 1k resistors for the LEDs and as current protection for some I/O. This is a little bit too big for high speed serial communication, but it works for 9600 baud. I was thinking about making a voltage level conversion for the serial interface, since the data to and from the router is 3.3V and the PIC is running 5V. But for me it works great with just the resistors and internal protection diodes.

The single sided web access lab board

My first application for this board is a web controlled home automation system using 433MHz RF. But I think it can be used to a lot more…

Bill of Materials (BOM)

1x single sided breakout board (etch, mill or order)
1x PIC 16F62X
1x 5×1 0.1” pin header (preferably angled)
2x 0805 0.1uF decoupling cap
1x mini USB SMD connector
1x USB SMD connector
3x screw terminal (5mm pitch)
1x 0805 green power led (optional)
1x 0805 1k resistor (if power led is used)
6x 0805 red debug led’s (optional)
6x 0805 1k resistors (if debug led’s are used)
4x 0805 1k current limitng resistors
2x SMD switch (5.1×5.1mm) (optional)
1x miniature 4/8 MHz crystal (4.86mm pitch) (optional)
2x 0805 1-68pF decoupling caps (if crystal is used)
1x IR reciever module

Specification

Dimensions [mm]: 48 x 48

Version tracker

0.1                     First version of PCB
Future               No updates planned…

Documents

Rhino project file (2D lines)
2D export (.svg)

See also

Licensing
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Using a Sony Ericsson dock as an USB2Serial adapter

Description

Getting serial connection (5v RS232) from a USB SEMC DSS-20 SyncStation

Features

  • Disassembly
  • Attaching serial communication cables
  • Remove serial EEPROM to avoid custom drivers
  • Stripping down the PCB for minimal size

Development

During my time as concept creator at Sony Ericsson I saved some SyncStations from being thrown away.

These docking stations were made to allow a modern computer with USB connector to be attached to phones that had the older serial interface on the system connector. The SyncStation is easy to open, just use a ph0 screwdriver to remove three screws.

On the main PCB the main component is a FTDI FT232BM. All you need to do is to attach RX and TX cables to pi 24 and 25 (the upper right corner). I connected the gnd to the black USB cable and Robert is your mother’s brother – you now have a USB to serial adapter. For this adapter you need to use special SEMC DSS-20 SEMC drivers. You can just google it and download them to get the virtual serial port to work. Another way is to cut off the lines to the serial EEPROM or simply remove the chip. This turns the SyncStation to a standard USB to serial bridge and you can use the drivers that are included in most operating systems.  To make the PCB more stable I de soldered the system connector and secured the USB cable with a zip tie.

Here is the Pinout for the common pins on the FT232BM chip:

Pin Function
25 TxD
24 RxD
9/17 GND
3/13/26 VCC
23 RTS
22 CTS

Documents

FT232 datasheet

Accelerometer and digital compass (BGA & LGA) breakout board


Description

Lab board for 3-axis accelerometer and 3-axis digital compass from mobile phone.

Features – accelerometer and compass breakout board

  • Breakout connector for important signals
  • Flip chip connection for BGA and LGA components
  • Single sided PCB

Features – microprocessor lab board (optional – same as above, but with microprocessor and LDO)

  • SMD microprocessor (PIC 16F628) with ICSP connector
  • On board 3v LDO
  • Measure wires for VCC, GND, SDA & SCL
  • Status LEDs

Development

I wanted to play around with 3-axis accelerometer and 3-axis digital compass that can be found in mobile phones. I have quite good access to these components since they are used in mobile phones like Huawei 8300. The biggest problem with them is that they have quite small packages (LGA and QFN). I designed two circuit boards, one breakout board for various microprocessors, like Arduino and one board for a PIC microprocessor. The boards do not require solder mask or IR oven. This is how they were done:

  1. Design the PCB
    The PCB was designed and routed in Rhino, using this method.
  2. Make the PCB
    The PCB was prepared and milled using HTML CAM. 
  3. Desolder components
    I used a hot air soldering iron to remove the two sensor chips from a U8300 Android Smartphone.
  4. Solder the tricky components
    The accelerometer and digital compass was glued upside down on the PCB with a tiny drop of quick glue. Then they were bonded to the surrounding pads using thin copper wire and a soldering iron with a small tip under a microscope.
  5. Solder the rest of the components
    The other components are no match after the previous stage. All are SMD except the connectors.
  6. Write program
    I wrote a small test program in PIC assembler that communicates with the sensors over I2C (bit banging the protocol). The program is still at a very early stage (hello world level) use it at own risk…
  7. Upload program and test the board
    A pickit2 programmer was used to upload the compiled code. The board is powered thru the same programmer and the serial interface also connected to the ISCP, allowing debug data to be sent to a terminal window on the PC.

Specification

Dimensions [mm]: 50 x 35.6

Version tracker

0.1                       First version of PCB
0.2                       Fixed LDO routing
0.3                       added switch to select 3/5v for the PIC (see photo)
0.4                       rewired RX and TX lines with extra cables (see photo)
Future               Updated SW versions

Documents

Rhino project file (2D lines)
2D export (.svg) – breakout and lab board
Microprocessor program – PIC assembler (work in progress)
Datasheet ADXL345 (3-axis accelerometer)
Datasheet AK8973 (3-axis digital compass)

 

Licensing
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

8 PIC programming adapters

Description

Several programming adapters for PIC microprocessors

Features

  • PICKIT compatible pin spacing
  • Easy to build (even at home – single sided PCB)
  • Several versions to support different microprocessors
  • Both through hole and SMD versions
  • Perfect for breadboard, quick hacks or miniature builds

Development

Since not all PIC microprocessors are ICSP pin compatible I needed an adaptor to be able to program different processors. I started with one adaptor for each chip, but did another version with all chips available on one PBC. For the through hole versions I recommend using IC sockets to quickly change chips. For the SMD versions, it is actually possible to just press the chips in place during programming (make sure you have enabled verify option). To be extra sure the five programming pins can be soldered in place during programming and removed afterwards, but this is of course more time consuming. Today I add an ICSP connector on every PCB, but for quick hacks, breadboard and miniature builds I solder wires directly to the chip and then this adapter works great.

The adapter supports for example PIC 12F629, 16F628, PIC 16C/F84 & PIC 16F676.

Pin configuration:

All circuits with the following pin configuration can be used with this adapter.

Signal 8 pin 14 pin 16 pin
VPP 4 4 4
VCC/ VDD 1 1 14
GND/ VSS 8 14 5
DATA 7 13 13
CLK 6 12 12

Specification

Dimensions [mm]: 36.8 x 28.6 for the through hole multi version

Version tracker

0.1                       First version (through hole)
0.2                       Added SMD versions
0.3                       Added SMD and through hole combo
0.4                       Added all in one PCB
Future                 No updates planned…

Documents

Rhino project file (2D lines)
2D export (.svg)

See also

Arduino micro development shield

Licensing
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Repairing a broken Samsung TV


PCB with four damaged capacitors.

Description

Fix Samsung le40s71b that does not power up.

Steps

  • Open TV
  • Find problem
  • Fix problem
  • Close TV

Development

My parents have a 40 inch HD ready Samsung TV that started to take longer and longer time to boot. Eventually it didn’t start at all. You could hear a clicking relay, but the screen was black. They asked me if I could take a look at it. The TV was easy to open and after visually inspecting the PCBs I noticed that four capacitors had broken on the power supply board (the top was bulging and there were even a crack on some of them).

Broken capacitors removed

When I measured the voltage from the output on the 5.4v line, it was around 4volts. After disconnecting the load (main PCB) the voltage went up to 5.4v. I was a bit uncertain whether the broken caps were the root cause or a symptom of a different error. I thought about adding a separate power supply instead as a quick fix, but to get 5.4v I had to modify a 5v supply and then I figured it was easier just too just swap the caps and see what happened. I replaced four caps (one for 6,4v boot voltage, and three for the 5,4v) they were rated 1000uF 10v. I used 1000uF 25v to avoid the same problem from occurring again. Removing the old caps and solder new ones was done in less than five minutes. When I tested the TV everything worked fine!


Power PCB with new 25v 1000uF caps

Repaired PCB mounted in working TV!

Caution

Don’t measure or solder on your TV unless you know what you are doing. Make sure you have disconnected the mains and make sure that all caps are discharged. I don’t take any responsibility for damages on equipment or any injuries.

Arduino micro development shield


Description
A tiny and ultra low cost development board for Arduino projects

Features

  • Ultra low cost (~1000mm2 board area – fit as many as possible on a single fr4 substrate)
  • Arduino compatible pin spacing
  • Easy to build (even at home – single sided PCB)
  • Extra VCC and GND tracks
  • Pinout (printed pin names)
  • Does not block LEDs and reset key on the Arduino shield

Development

For my first Arduino projects I just used pin headers and soldered wires and components directly. This works ok for early development, but gets messy quite fast. It is also difficult to switch and store different projects using nothing but pin headers since they are fragile and it is not always obvious where each pin header goes. One option is to use a complete development shield, but they are often overkill for smaller hacks.

I decided to create a smaller development shield. The solution was to use Occam’s razor and cut away everything in the middle of a standard development shield. The downside is that you have two PCBs instead of one. The advantage is that you can make several of them using the same board space. Another advantage is that the development board does not block LEDs, ICSP, switches, etc on the Arduino.

Less than an hour was spent on making the 2D lines in Rhino. Then a few minutes to set up the mill to produce 10 boards, engraved, drilled, cut and ready to use! Read more details about the process here.

Specification
Dimensions [mm]: 44.5×27 (WxD)

Version tracker
0.1        First version
0.2        added VCC and GND
0.3        added text
0.4        added cutting paths (current version)
Future     No updates planned…

Caution
The CNC files below for controlling the mill is for reference only. It is very unlikely that your mill is configured exactly like mine. Position of zero, cutting speeds, position of tools etc is most likely different. Running unknown code on expensive and powerful machines is not recommended. I do not take any responsibility if the machine damage itself or worse, someone.


Documents
Rhino project file (2D lines)
2D export (.svg)
Neutral drill file (drill positions)
Neutral engrave file (engrave paths)
Neutral release file (3mm cutter paths)

See also (coming soon…)
Arduino development board

Licensing
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Designing a PCB


I usually design a PCBs in a different way than most people do. The “normal” way is to use dedicated PCB cad software, like Eagle or gEDA. This has several advantages like schematic editors, auto routing, net lists etc. However, when I work on a project, it is usually a PCB that shall fit inside some casing or mechanical structure. I then need to export and import the PCB shape, component placement, housing etc between the 3D cad and the PCB cad. I think this limits the design freedom and it is quite annoying to spend a lot of time trying to synchronize the same design in two programs.

My solution is to use the 3D cad for everything, including PCB design. There are several advantages with this method:

  • Everything in one place (one file), both the PCB and the mechanics
  • No need to spend any time synchronizing files between programs
  • Very easy to tweak and optimize the complete project
  • Complete control over every single line
  • It is easy to export milling and drilling paths to produce the PCB
  • I work extremely fast in Rhino. The best programs are the ones that you know well and have access to…

The biggest downside is that you have to route the board manually, but personally, I think this is an advantage. If you are good at it – manual routing out ways the auto routing routines that exists in free software (especially on single sided boards). It is also a quite fun and challenging task. Try it and let me know if you agree ;)

Step by step:

  1. Place the components
    I start with creating an outline for the PCB and then reuse components from other projects. A component means a 2D vector image with component outline, pad outline and hole positions. I use different layers to separate the different parts of a component.
  2. Create components that are missing
    if a component is missing I just build a new. Using a caliper or datasheet this is done in just a matter of minutes.
  3. Route the traces
    It is now time to route the PCB. First I try to imagine the best position and rotation for the different components, and then I add traces to connect all the pins on the component. I have separate layers for VCC and GND which gives the traces a different colors. Routing is an iterative process and it usually takes a few iterations until I get a result that I am satisfied with.
  4. Optimize the board
    It is now time to optimize the board. This means that I tweak the positions of components and traces. I also add chamfers on traces and makes sure that the PCB is as dense optimized as possible.

Done – I have now designed a PCB! Usually I produce the board by milling (see this post), but I can also print a vector mask that can be used for direct toner transfer or UV exposure. If so I export the 2d vector to illustrator or inkscape and fill areas like traces and pads. Then the black and white image can be printed on toner transfer paper or OH sheet.

Milling a PCB


Using a CNC-mill to create a PCB has several advantages:

  • Fast
  • High accuracy
  • Holes are drilled for you directly
  • No chemicals
  • No need for UV exposure or direct toner transfer

This is how it is done:

When the PCB is designed (see this post) it’s time to prepare the board for manufacturing. I start by creating new layers for the mill paths.
1. Create mill paths

  1. Offset pads and traces to create closed loops for the PCB. These loops are used to control the engraving tool to cut out the copper areas to save.
  2. When the loops are done I offset them in order to create paths for removing excess copper outside the traces. This is not always necessary, but it is easier to solder a PCB without any excess copper. Don’t forget to make sure that you trim away offsets that intersect other copper traces.
  3. Make sure I have points in each hole that needs to be drilled. (used by CAM to define drill positions)
  4. Offset the contour of the PCB in order to create the release path for the PCB. I usually use a router with 3mm diameter for this -> the path is 1.5mm outside the PCB contour.
  5. Export all mill data. As preparation I convert all paths to polylines and make sure that they are connected. I have written two Rrhino scripts for the export. The first one exports each control point on the polylines into a comma separated file. This file is then used to create the engraving and cutting paths as CNC code for the mill. The second script exports each point to another comma separated file, this time to create the CNC code for the drilling operations.

2. Create CNC code
The comma separated files does not contain any information about for spindle speed or federate so they need a little more preparation before they can be uploaded to the mill. What is needed is a program that parses the data and converts it to standard G-code. The program also needs a user interface that would allows you to select cutting method, add data about federate and cutting depth etc. I wrote the whole script as an html file with embedded JavaScript. The good thing with JavaScript and html is that it runs on all platforms, does not need to be compiled, html it gives you the a user interface and it is fast enough, even for bigger jobs. This is what you need to do:

  1. Select cutting operation (2D cut for the PCB engraving)
  2. Paste the comma separated data in one text field and press sort to reduce travel distance
  3. Adjust the cutting values and press convert to generate the G-code
  4. Copy the generated code from the text field and paste it in a text document.

3. Check the g-code
It is a good habit to briefly go thru the g-code before you execute it. Make sure the right tool is selected, that all coordinates are positive and that the cutting depth is correct.

4. Load the mill
Insert an empty fr4 substrate into the mill. My current mill does not have a vacuum plate, so I use double sided adhesive to attach the PCB to the plate. It it very important that the top surface is completely flat and in level with the mill x-y axis. If you planar the area first with a router the result will be better.

5. Press play to continue
Upload the g-code to the mill, press “start” and watch the mill produce a the PCB. If the mill does not have an automated tool change, you need to run each operation separately and manually switch tool and measure the tool length. If tool change is automatic you can create a single file with all the operations and just lean back and enjoy.

Scripts

Rhinoscript for polyline export (control points):

 _-NoEcho
 _-RunScript (
	'Export all control points at curves as neutral file format
	Dim strObject, arrObjects, lineCount, pointCount
	lineCount=0
	pointCount=0
	strText = ""
	arrObjects = Rhino.GetObjects("Select lines to export")
	If IsArray(arrObjects) Then
		For Each strObject In arrObjects
			lineCount = lineCount+1	

			' Get the curve's control points
			Dim arrPoints
			arrPoints = Rhino.CurvePoints(strObject)

			' Write each point as text to the file
			Dim strPoint, strText
			For Each strPoint In arrPoints
				pointCount = pointCount+1
				strText = strText + Rhino.Pt2Str(strPoint) + ";"
			Next
			strText=Left(strText,Len(strText)-1)
			strText = strText & vbCr & vbLf
		Next
		Rhino.ClipboardText(strText)
		If Not IsNull(strText) Then
			MsgBox CStr(lineCount) + " paths, " + CStr(pointCount) +" points copied to clipboard", 0, "Clipboard Text"
		End If
	End If
}

Rhinoscript for point export:

 _-NoEcho
 _-RunScript (
	'Export all points as neutral file format
	Dim pt, strObject, arrObjects, pointCount
	pointCount = 0
	strText = ""
	arrObjects = Rhino.GetObjects("Select points to export")
	If IsArray(arrObjects) Then
		For Each strObject In arrObjects
			' Write point as text to the file
			pointCount = pointCount+1
			pt = Rhino.PointCoordinates(strObject)
			strText = strText + Rhino.Pt2Str(pt) + ";"
			strText = Left(strText,Len(strText)-1)
			strText = strText & vbCr & vbLf
		Next
		Rhino.ClipboardText(strText)
		If Not IsNull(strText) Then
			MsgBox CStr(pointCount) +" points copied to clipboard", 0, "Clipboard Text"
		End If
	End If
}

 See also

CAM processing in HTML