Hand Assembling SMD Circuit Boards

At litehouse.io, we recently got our 1st prototype board. We decided to do hand assembly of the SMD circuit board instead of sending it to the fab!

This is my 1st circuit board assembly. Soldering the SMD components can be really daunting. But if you have proper tools and resources in hand, it is not all that bad.

Here is how our soldering area looks like


Soldering in progress …


Without further ado, lets list down the necessary tools and resources used to complete the hand assembly of the SMD circuit board.

X-Tronic Hot Air Rework & Soldering Station: This (or any other brand you like) is a keeper. The kit is a collection of a bunch of necessary tools that you will need. So instead of ordering them separately, you can save $$$ on this package.

Solder tip cleaner: More useful than the traditional spongy cleaner that comes with the soldering station.

Vacuum Pickup Station: Extremely useful for pick&place of the tiny resistors, capacitors etc. Although my 0603 size resistors were too small for the smallest vacuum suction tip that this kit has. It sucked up 3 of the resistor and I still can’t find them! So I ended up using the tweezer for the resistors (painful). I need to find smaller tip for vacuum suction.

Flux Paste: This is your best friend!

Wipers: Needed to cleanup after soldering.

Flux Brushes: Needed to cleanup after soldering.

How to SMD Soldering
Soldering QFN Components
How to use Vacuum Pickup Tool

My begineer soldering kits
Soldering Station
Helping Hand
Desoldering pump


Open Hardware Summit 2014

I attended Open Hardware Summit this September in Rome, Italy. It was a two day conference with great speakers – Adrian Bowyer, Eric Pan, Becky Stern, Jason Kridner, Micah ScottMadeline Gannon, Zack Jacobson-Weaver, JeromeAmmar Halabi, Yasmin Elayat, Liat Brix, Hagit Keysar, Allison Burtch, Jason Kridner  and more.

Addie starts the Day1 of the Summit

Madeline Gannon and Zack Jacobson-Weaver on open source industrial robots

Eric on Design from Manufacture

On day 2, Benjamin had the workshop on open hardware business model.
Eric had another interesting workshop  on design from manufacture.

I got the opportunity to co-chair the Summit along with Addie, Simone, Zach and Gabriella.


Mathilde from Making Society has published a great recap on the summit.
And checkout the Flickr photo stream of Open Hardware Summit 2014.


RaspberryPi: Reading I2C Inputs using C

Accessing Raspberry Pi GPIO pins with Python libraries is popular among hackers & makers. How about programming languages like C? C gives you flexibility to port code in embedded firmware/driver layer if necessary. That is why I was looking for a C library that exposes Raspberry Pi GPIO pins for application layer. I was specially interested in exploring the I2C pins and found the excellent wiringPi library.

In this post, I will show step by step on how I use wiringPi library to read from the I2C interface of a 3-axis Accelerometer+Gyroscope module. The module I used is GY521 (InvenSense MPU6050).

Hardware setup:

I have a Raspberry Pi Model B (Rev-1), GY521 (InvenSense MPU6050), breadboard & some male-female wire.

*Connect Raspberry Pi 3V3 to GY521 VCC
*Connect Raspberry Pi GND to GY521 GND
*Connect Raspberry Pi SCL to GY521 SCL
*Connect Raspberry Pi SDA to GY521 SDA

To find the Raspberry Pi GPIO pin maps, follow this guide


*Install I2C dev library. Under Raspbian, use

sudo apt-get install libi2c-dev

*Configure I2C pins using adafruit guide

*Install wiringPi using this link

*Make sure your Raspberry Pi can detect the device attached to the I2C interface. If detected, then you will see an address with below command. In my case, the address is 0x68 which is then used in the code.

i2cdetect -y 0 # Rev 1
i2cdetect -y 1 # Rev 2

*Use this sample code from my github

*Use the Makefile and type

$make i2ctest
$sudo ./i2ctest

You should now see the sensor data value in the screen.


Bluetooth Low Energy: Read-Write to Sensor Network from Raspberry Pi

In this tutorial, I am using a RedBearLab Bluetooth Low Energy (BLE) shield connected to Arduino UNO to demonstrate the BLE communication from Raspberry Pi.

  • Install hard-float Raspberryian OS using this link.
  • Install Bluez using step 1, 2, 3 of this link.
  • I used CSR 4.0 dongle in the Raspberry Pi for BLE connection.
  • Make sure you have gatttool in the path using
    $which gatttool
    If it is not in the path, copy it from bluez/bluez-5.11/attrib
    $cp bluez/bluez-5.11/attrib/gatttool /usr/local/bin/
  • Check if the Bluetooth dongle is up and running
    ~/bluez/bluez-5.11 $ tools/hciconfig
    If not (you will see DOWN written in the result), use below command to get it up
    ~/bluez/bluez-5.11 $ tools/hciconfig hci0 up
  • Now scan for BLE devices. The command below might continue scanning forever, so type CTRL+C when you have the device address
    $ sudo hcitool lescan
    Assume you get the BLE device address xx:xx:xx:xx:xx:xx
  • Now connect with the device using gatttool
    $ sudo gatttool -b xx:xx:xx:xx:xx:xx -t random –interactive
    You might not need to use -t random. Also if you get device busy error, remove the dongle and reconnect it.  You will see an interactive prompt. Type connect like below
    [xx:xx:xx:xx:xx:xx][LE]> connect
    Attempting to connect to xx:xx:xx:xx:xx:xx
    Connection successful

Once it is connected, we want to write to a LED to turn in ON/OFF, and read the sensor data. We are using FSR as the sensor in this example. We will use gatttool to do the read & write.

Before we begin, we need to understand how this works fundamentally. You can go ahead and read this book or any other good tutorial that I am not aware of. But basically, you need to have some code on your Arduino that sets up a profile in the nRF8001 component on your RedBearLab shield that defines “pipes” which is the link between a characteristic exposed by the radio and a function from which you can read data or to which you can send data.

I am using SimpleControl sketch from RedBearLab as the code that runs on Arduino.  To do read-write, we need to know which address to write and what value to write.

Find the Address to Read & Write: 
I look at RedBearLab’s Android source code to figure out the TX, RX address.  In the RBLGattAttribute.java, you will see

public static String BLE_SHIELD_TX = “713d0003-503e-4c75-ba94-3148f18d941e”;
public static String BLE_SHIELD_RX = “713d0002-503e-4c75-ba94-3148f18d941e”;

Now, if you type below in the gatttool interactive prompt, you can figure our the address (handle) of those TX, RX

[xx:xx:xx:xx:xx:xx][LE]> char-desc
handle: 0x000b, uuid: 713d0003-503e-4c75-ba94-3148f18d941e
handle: 0x000c, uuid: 2803
handle: 0x000d, uuid: 713d0002-503e-4c75-ba94-3148f18d941e
handle: 0x000e, uuid: 2902

So you basically see that the handle of TX, RX are 0x000b and 0x000d respectively.

How to Turn ON/OFF the LED:
From the SimpleControl.java, you can see that you need to write 010100 to the TX handle to turn the LED ON and 010000 to turn it OFF.

digitalOutBtn.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) {
             byte buf[] = new byte[] { (byte) 0x01, (byte) 0x00, (byte) 0x00 };
             if (isChecked == true)
                  buf[1] = 0x01;
                  buf[1] = 0x00;

Now type below to turn the LED ON
[xx:xx:xx:xx:xx:xx][LE]>char-write-cmd 0x000b 010100

To Read Analog Data: 
Similarly from the SimpleControl.java, you can see that you need to write A00100 to the handle 0x000b to enable the analog reading capability through the RedBearLab shield. You also need to enable listening to the 0x000e handle. The 0x000e is the handle of the Client Characteristic Configuration (CCC) uuid 2902. You can find this 0x000e handle by typing char-read-uuid 2902 in the gatttool interactive prompt.

[xx:xx:xx:xx:xx:xx][LE]>char-write-cmd 0x000b A00100
[xx:xx:xx:xx:xx:xx][LE]>char-write-req 0x000e 0100 –listen

You will see sensor values in coming the the RX handle (0x000d)
Notification handle = 0x000d value: 0b 00 c0
Notification handle = 0x000d value: 0b 00 d0
Notification handle = 0x000d value: 0b 00 e4
Notification handle = 0x000d value: 0b 00 f0



How to Setup an openHAB Server at Raspberry Pi

The open Home Automation Bus (openHAB) project is an open source integration platform for home automation. I was working on setting up the openHAB server at Rasp Pi. The setup process seemed to be scattered around. So I decided to note down the steps below.

The setup below works on Raspberry Pi Rev-B board with hard-float Raspberryian OS.

  • To install hard-float Raspberryian OS, use this link.
  • JVM >=1.6 is needed. Use this link if not already present.
  • Download openhab-runtime. Unzip it in /opt/openhab
  • Download openhab-demo-configuration. Unzip and put the contents of this folder to /opt/openhab/configurations. Make sure you do not remove other files that were already existing in the /opt/openhab/configurations directory (openhab_default.cfg etc.)
  • Go to /opt/openhab. Run start.sh
  • Your openHAB server should be up and running now.
  • Test it in the browser http://localhost:8080/openhab.app?sitemap=demo
  • Or if you are doing SSH to Rasp-Pi like me, replace localhost with the IP-address of the Pi.

Using a Tilt Sensor

I was experimenting with tilt sensor this morning. The AdaFruit tutorial wasn’t clear enough and the Arduino tutorial seems incomplete. So I decided to publish one here.

I used below steps to build the circuit:

1. Connect one end of the tilt sensor to the +5V. Connect the other end to Arduino digital pin#5
2. Connect a 10K resistor in series with the digital pin#5. Connect the other end of the resistor to the GND.
3. Connect the negative leg (short) of the LED to the GND. Connect the positive leg (long) to Arduino digital pin#3
4. Connect a 330 ohm resistor in series with the digital pin#3. Connect the other end of the resistor to the GND.


You can use the sketch to test the tilt sensor. If everything goes fine, you should see the LED glow when the sensor is tilted. You can also check the print message in the Arduino serial monitor.


Web controlled Robot

We developed a web controlled robot. Using pusher, developed a desktop client that tells the robot to move forward, backward, turn left and right. We used Cherokey 4WD kit to build the robot. An Arduino Uno (thanks to the Make Robot Hacks Session), a Wifi/Wifly shield were connected to the kit that receives the control signals from the web. Based on the control signals, the motor controller is instructed to move. Here is a video.