KiCad (latest dev version) does not work with Ubuntu 14.10

October 28th, 2014 No comments

I installed the latest dev version of KiCad but it seems to be problematic with the new Ubuntu 14.10. The problem is that some functions like ‘Place Component’ don’t work and freeze the application. I tried both using the PPA installation method and building from source (bzr version 5233). Have you also experienced this bug? Let me know in the comments. If I get to solve this I will update.

UPDATE 30/10/2014: So it seems that the problem occurs due to the Windows Manager (Unity). I installed GNOME and KiCad now works.

Categories: general Tags:

Currency Converter in Python

November 30th, 2013 No comments

Hello everyone! Well, many times I find myself converting between EURO, USD and GBP. So I though, why don’t write a small program to do that? Of course there are many other solutions out there like but what’s the fun in that if you don’t do it yourself, right, RIGHT?

As I always do, I search and learn as I go. So first things first, I wanted this to be a program with GUI. There are a lot of solutions for that but I decided to use wxPython. I skimmed over the documentation and it was obvious that I had to spent more time that I wanted in order to do something useful. I searched for a ‘designer’ and I found one, called wxGlade. After a quick ‘sudo apt-get install python-wxglade’ in my beloved Ubuntu I was up and running in no time. Within few minutes I created the minimalistic GUI I wanted.

For the currency conversion I found some good info here and I used part of that code. I also needed to learn about threads since I wanted to fetch the exchange rates without blocking the program and again after a quick google search this was solved as well.

The little program works well and its fast. The code is below. Let me know if you like it or improve it.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.5 on Thu Nov 28 12:44:35 2013
import wx
from threading import Thread
import time
import requests
# begin wxGlade: extracode
def myfunc(i):
    global EUR_USD
    global EUR_GBP
    global USD_GBP
    # For the following 3 commands credit goes to
    url = ''
    r = requests.get(url)
    EUR_USD = r.json()['v']
    url = ''
    r = requests.get(url)
    EUR_GBP = r.json()['v']
    url = ''
    r = requests.get(url)
    USD_GBP = r.json()['v']
t = Thread(target=myfunc,args=(1,))
# end wxGlade
class MyFrame1(wx.Frame):
    def __init__(self, *args, **kwds):
        # begin wxGlade: MyFrame1.__init__
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.EUR = wx.StaticText(self, wx.ID_ANY, "EUR")
        self.tc_EUR = wx.TextCtrl(self, wx.ID_ANY, "")
        self.USD = wx.StaticText(self, wx.ID_ANY, "USD")
        self.tc_USD = wx.TextCtrl(self, wx.ID_ANY, "")
        self.GBP = wx.StaticText(self, wx.ID_ANY, "GBP")
        self.tc_GBP = wx.TextCtrl(self, wx.ID_ANY, "")
        self.Bind(wx.EVT_TEXT, self.eh_EUR, self.tc_EUR)
        self.Bind(wx.EVT_TEXT, self.eh_USD, self.tc_USD)
        self.Bind(wx.EVT_TEXT, self.eh_GBP, self.tc_GBP)
        # end wxGlade
    def __set_properties(self):
        # begin wxGlade: MyFrame1.__set_properties
        # end wxGlade
    def __do_layout(self):
        # begin wxGlade: MyFrame1.__do_layout
        grid_sizer_1 = wx.GridSizer(3, 2, 2, 2)
        grid_sizer_1.Add(self.EUR, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
        grid_sizer_1.Add(self.tc_EUR, 0, 0, 0)
        grid_sizer_1.Add(self.USD, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
        grid_sizer_1.Add(self.tc_USD, 0, 0, 0)
        grid_sizer_1.Add(self.GBP, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
        grid_sizer_1.Add(self.tc_GBP, 0, 0, 0)
        # end wxGlade
    def eh_EUR(self, event):  # wxGlade: MyFrame1.<event_handler>
        if self.tc_EUR.GetValue() != '':
    def eh_USD(self, event):  # wxGlade: MyFrame1.<event_handler>
        if self.tc_USD.GetValue() != '':
    def eh_GBP(self, event):  # wxGlade: MyFrame1.<event_handler>
        if self.tc_GBP.GetValue() != '':
# end of class MyFrame1
if __name__ == "__main__":
    app = wx.PySimpleApp(0)
    frame_2 = MyFrame1(None, -1, "")

Oh and here is a screenshot!

Categories: programming Tags:

Small spool holder for Mendel90

September 10th, 2013 2 comments

After I completed building my Mendel90 I was a bit disappointed when I found out that the spool I had (bought from ultimaker site) was smaller than the spool holder. So I placed the spool on my desk behind the printer and never really bothered to solve the problem. Every now and then during the printing I would manually unroll filament from the spool so I don’t stress the extruder motor.

Well a couple of days ago I was browsing the reprap forums and found a nice extension that solved (well sort of) my problem. Fellow reprapper GerdH created a neat extension design to support multiple spool holder sizes. I downloaded the .scad file, compiled it, sliced it with Cura with my settings and printed it. I had to run to the nearest hardware store and get a set of four screws with nuts. So within few hours I saw the post the spool holder was installed on my printer and its working perfectly. No more manual unrolling of filament!

During printing

During printing


The spool where it was meant to be from the beginning!

The spool where it was meant to be from the beginning!


Categories: 3D printing Tags: ,

3D printing my balancing robot

April 28th, 2013 No comments

3D Printing Fever!

Hello everyone. Did I tell you I am having a blast with the 3D printer? My god, this thing is wonderful. Is every engineer’s dream come true. Seriously. Anyway, in my last post I told you about putting together a Mendel90 reprap. Since then, I devoted some weekend time to calibrate the machine and I am really satisfied with the results.

As an engineer, my 3D printing time is focused on creating useful and functional parts, rather than something artistic like a complex shape or a small Yoda (even though I would like to print one some day). Anyway, its been some time since I decided to create a balancing robot, a project unfortunately I neglected for too long. So, this will be a nice opportunity to design my own parts and progress on the balancing robot project!

To do that, first I needed a CAD program to design my parts in. I never used a 3D CAD software before, so I went into the wild to see what is available. The features I was interested in are:

  • Run on Linux (Ubuntu)
  • Easy learning curve
  • Price below 50 Euros (or free!)

Let me tell you, there are not that many choices fulfilling the above. I ended up using FreeCAD and I really like it. Until now, it suits my needs, its free and works just fine on my Ubuntu. OK it is a little buggy sometimes but I don’t mind. At the beginning it was a bit difficult to understand how it works, but after I read about the Part Design and Constraints I quickly got the point. I have to admit, Constraints is something I didn’t know it existed in CAD software and after I discovered that I immediately loved it! When I get more experience with FreeCAD I will make a tutorial on the basics. I think it really deserves more visibility.

Designing the parts

When designing parts to be 3D printed on my machine, there are a few things that govern my design. First, the design must be compatible with the 3D extruding printing constraints. You must be careful of steep overhangs. Another thing are the holes. Most of the slicer software has some problem printing small holes accurate. My current calibration gives me hole accuracy 0.4mm(+/-) which is not that good but it hasn’t caused much trouble yet. However, my main concern when designing is the use of filament, for a few reasons. The most obvious one is cost. If you make a really big and heavy part, you could raise the cost to a level which 3D printing it out doesn’t make sense, if you can buy a similar part (robot chassis for example) much cheaper from the web. And keep in mind that you may make mistakes and need to reprint a part 2 or 3 times (even more?) before deciding its the one! What is more important for me though, is printing time. You see, more filament = more printing time! Most of the times I am anxious to try out my latest design and I hate to wait more than 10-15 minutes. So I tend to design, quick-to-print parts. At least for now.

Today’s print: Motor mount

Today, I designed a part used to mount the motors on the chassis. Took some specs from the motor datasheet, and designed the part so it can be screwed on the motor and hold it firmly. So I fired up FreeCAD and some time after, the result is this:

Freecad design

Freecad design

After exporting the .stl file and slicing it with Cura it was ready for printing. The pictures show the result.

Fresh out of the oven!

Fresh out of the oven!

Good alignment of the holes

Good alignment of the holes

Motor screwed on the mount

Motor screwed on the mount

Attached on the chassis

Attached on the chassis


Hopefully sometime within next month I will find some time to attach the motor controller and start working on the electronics of the robot.

Until next time…

Building my Mendel90

February 10th, 2013 No comments

In this post I will explain my experience building my first 3D printer. I should state that before buying this printer I knew nothing about building a 3D printer or any of the terminology. NOTHING. I was just fascinated by the technology and capabilities and followed the progress. The main reason I am writing this is to encourage complete beginners to overcome the initial doubts that they may have, as I had.
Lets start with the really basics, how it works. The first thing you need is a digital design of the object. This can be created by you through a cad software like openscad or blender, or you can download a design created by others. So after you have this file, a “slicer” software will prepare it for printing. This software will cut the object into multiple layers, slices, horizontally. The same way you slice a loaf of bread. This software generates a code that the printer understands. The printer works by laying down melted plastic tracking the outline of the object and then fills the areas need filling. The plastic cools down quickly and solidifies. Doing the same thing layer by layer, the object is formed.

Building the machine

There is a variety of machines you can buy. I did not do an exhaustive research on the capabilities and features. My requirements were simple, the printer should be:

  • Reliable
  • Cheap
  • and Europe based to avoid any taxes

People at the reprap forums suggested me Mendel90 that was designed by nohead, an experienced member of the community, and it was at the right price and it was in UK. It turned out that Mendel90 has another great feature, that of the support both pre and after sales. Both from Chris(nophead) and Mary  were kind enough to answer all my questions clearly and quickly. The kit arrived in about a week.

The parcel arrived!

The parcel arrived!

When I first opened the parcel I was overwhelmed by the amount of parts. I really wanted to start printing but there I was in front of hundreds of small bits and pieces. But don’t worry. The included instructions provided by nophead are really detailed and guide you through. I am not saying that is super easy to build the machine. I think you need some basic skills in putting things together and some soldering skills as well. There are some easy parts and some more challenging. I messed up a part or two but fortunately I was able to fix it.

It took me about two nights (from 10pm to 8am) to finish the machine. It was a great experience. I found it to be challenging and I learned a lot about how it works. After some tests and quick calibration I printed the small android figure you see in the picture.

My first 3D print!!!

My first 3D print!!!

The code was provided by nophead. After that, the second journey began. The journey of calibration. But let’s leave that for another time. I should say that this hobby requires time and patience. You will get frustrated and angry but when you manage to get the print as you intended, the accomplishment feeling is incredible. You can build your ideas into real objects… Just incredible.

I hope I gave you some basic idea what this is all about and I hope to see you in the reprap forums.

Categories: 3D printing Tags: ,

First steps in 3D printing

February 4th, 2013 No comments

Hello everyone.

About a month ago I was watching a video on youtube about a guy building a robot. At some point that guy set “…I printed these parts on my RepRap…”. Those words echoed in my head, again and again. …… and bam. That was it.

You see, I have watched the progress of 3D printers for some time now. From the moment I saw one online I was hooked. Unfortunately the price was too high for a “toy”. At least that what I was thinking then. I considered it as a “toy” since is something I don’t really need. I wanted it to satisfy my creativity itch. So I decided to bury my 3D printing desire to save some money. And I was good at it. Until it hit me when I watched that video.

Right there I decided I would buy one, no matter what. I agree that spending 600-700 Euros may seem like a lot at the beginning, but let me tell you that the rewarding you get from 3D printing is huge. Talking for myself, its been a long time since I felt that much satisfaction in my tech life experience.

So, I believe that 3D printing is going to be the new part of this blog. To get the ball rolling, my next post will describe the machine I bought and the assembling experience.

HOW TO: Make your own USB cable for HK-T6A calibration

April 27th, 2012 34 comments


About a month ago I managed to go ahead and buy my first quadcopter (split the cost with two of my colleagues :) ) and all the required equipment. I will do another post on that because it is really interesting!

I played around with RC airplanes some 10 years ago. There are some things changed now. Controllers are different. You are able to buy a 6 channel radio for under 30 Euros! Wow… Anyway, so I bought this controller from Hobbyking, named HK-T6A. However, I missed the fact that I needed a USB cable as well. To cut the story short, I had everything I needed to fly the brand new quad, but the controller needed calibration. Since the USB calibration cable was out of stock it would take some time to arrive. The cheap cables in ebay were shipped from China so it would take an additional month to get it. We had a problem!

Looking around in the internet, my attention was drawn to a picture of the transmitter communication socket. It was indicating TX/RX so I thought “wait a minute… could this be just serial comms?”. And so it was :)

What you need…

The only device you need is a simple USB-to-Serial (TTL) converter. If you are into digital electronics you should have a couple of them in your desk drawer. My personal favorite is CP2102. Take a look at my older post which I talk about this device. They cost only a couple of dollars including delivery from ebay. Check it out. You will also need 4 simple wires.

CP2102 USB-to-serial ttl module

The HK-T6 transmitter with the CP2102 and 4 wires. That is all you need!

Now take look at the trainer port of the controller.

The 4-pin din connection port of HK-T6

Connect everything together, really simple:


This is my temporary setup. It works!

Make sure your controller is switched off though. Then connect the CP2102 on your USB port of your PC. It could take some short time until your PC first finds the appropriate drivers and power the controller. You should see a red light on your transmitter. That means it is receiving power from the USB of your PC.

If something is not working, try switching the TX with RX lines. I mix them up all the time!!! You are now ready to calibrate your controller. Choose the software of your choice. I prefer Digital Radio. It is much better that T6Config. Note that this will work with FlySky CT6B since it is essentially the same controller.

Let me know if you need any help.

Categories: electronics Tags: , ,

Double Fine Adventure almost at $2,000,000

February 18th, 2012 No comments

If you haven’t already heard, this game already collected $1.9+ as a kickstarter project. WOW!!! I am also backing the project and I really hope it turns out well.

Those guys really deserve it. I have such great memories playing their games as a kid. Go Tim go!


I am a backer!!!

Categories: general Tags: ,

Using TMP100 temperature sensor with your PIC – PR5

January 31st, 2012 No comments

In this post I will describe how you can connect the TMP100 temperature sensor from TI to your PIC as well as receive temperature data. The sensor I am using is a generous sample from TI. Compared to the DS18S20 that I used before, this sensor is much faster, it takes 40ms to take a measurement with 0.5 degrees accuracy. The communication protocol is I2C. It could be a bit difficult connect it to your circuit since it is using a SOT-23-6 package.

For this project, I will be using my PIC prototyping board which carries a 18F4520. But you can pretty much use the C18 code in this post, with any PIC having a hardware I2C module.

Package problems!

Because SOT-23-6 is so small the first thing I needed was to create an adapter to make TMP100 compatible with my breadboard. This was a perfect excuse for improving my CNC skills :). So I created an adapter in EAGLE, cut it out using the CNC and then solder the sensor and 6 pins. The sensor is now breadboard ready!

The TMP100 adapter


The connection is really simple. Add two pull-up resistors to the SDA and SDL lines. I used 10kOhm. The datasheet also suggests an optional capacitor on the supply.

TMP100 pinout


TMP100 Schematic

As you can see from the schematic there are two pins called ADD1 and ADD0. Those pins determine the I2C address of the sensor. You can find more details in the datasheet. I connected those two lines to GND therefore the address of the sensor I am using is 0x90. That’s all on the hardware side.

TMP100 – Point Register

I2c is the language this sensor talks :). So we need to use your PICs I2C hardware capabilities. Initialize your communications using


This sensor has a Point Register (PR)which (guess what!) points to the address of the register you want  to read or write :) Before doing anything else we should point PR to the temperature register. To do that we have to initiate an I2C communication, send the address of the sensor and tell that sensor whether we like to write or read from it. This is done using a single byte. You see, the address is 7-bits starting from the MSB and bit 0 indicates whether is read or write operation (0=Write 1=Read). Let’s do an example. Our sensor’s address is 0x90. We wish to read something from the sensor so the byte should be 0x91. If we wish to write something to the sensors it should be 0x90. That’s it.

Therefore to write to point PR to the temperature register we should issue the following

WriteI2C(0x90); // Call the sensor with WRITE
WriteI2C(0x00); // Write Temp reg to point register;

Notice the 0x00? That is the address of the temperature register. The sensor is now ready to give us some temperatures.

TMP100 – Read that temperature

To read the temperature off the sensor, we need to call it using its address and READ (what we said above, remember?) and the sensor will transmit two bytes of data back. We read that using the appropriate I2C commands shown below. We have to acknowledge the reception of the bytes to let TMP100 know that we are ready for the next byte. Temperature is read as follows

first_byte = ReadI2C();
second_byte = ReadI2C();

The temperature is made out of two bytes. If you don’t care about getting any decimals you can just use the first byte. The 4 most significant bits of the second byte contain information on the decimal value of the temperature.

TMP100 – C18 Library

I made a really simple library for tmp100 in C18. Just include the tmp100.h file to your project and make sure you initiate the I2C (the OpenI2C() command shown in this post) before calling any functions.


OK that is pretty much. You should be able to get some measurements out of that little sensor. If you need further help take a look at the example below

#pragma config OSC = HSPLL
#pragma config WDT = OFF
#pragma config PWRT = ON
#pragma config LVP = OFF
#pragma config PBADEN = OFF
#include <p18cxxx.h>
#include <i2c.h>
#include <usart.h>
#include <delays.h>
#include <p18f4520.h>
#include <stdio.h>
#include "tmp100.h"
void main(void) {
    unsigned int raw_tmpr;
    char str_tmpr[8];
              USART_RX_INT_OFF &
              USART_ASYNCH_MODE &
              USART_EIGHT_BIT &
              USART_CONT_RX &
    OpenI2C(MASTER,SLEW_OFF);   // Initialize I2C module
    tm_setconf(0x60);   // Set sensor to full sensitivity
        raw_tmpr = tm_gettemp();    // Get 2 bytes of temperature
        tm_tostr(raw_tmpr,str_tmpr);    // Convert the temperature to text
        printf("Temperature is %s\r",str_tmpr); // And output through USART

I connected the USART TX/RX line using my CP2102 and used the cutecom program on Ubuntu to read the output on my PC. The screenshot below shows the terminal

The terminal on Ubuntu

1-Wire (OneWire) C18 library

November 17th, 2011 3 comments

So yesterday I wanted to get some temperature measurements from a DS18S20 thermometer to my PIC prototyping board. This thermometer uses the 1-Wire communication protocol so I searched around to find a 1-Wire library for the C18 compiler I am using. Maybe I am wrong but I couldn’t find any. So I created one, hence this post.

I had a post about the 1-Wire protocol a while back so you can read that if you are not familiar with it. To implement this protocol we need to work with precision timing. Ideally this could be written in asm. However, for convenience reasons I wrote this in C. I don’t really mind the minor performance penalty :)

Just to be clear, this is a library for the 1-Wire protocol, not for any of the supported devices. The library contains 3 main functions:

  • 1-Wire Reset
  • 1-Wire Write
  • 1-Wire Read

Using these three operations we can have full communication with any 1-Wire device. Let me demonstrate first and then I will write about how you can use it in your project.

A brief demonstration

To demonstrate this operation, I connected a DS18S20 thermometer and connected the DQ line on my PIC’s Port C Pin 1. The procedure I will follow is:

  • Issue a Reset pulse and observe the Presence of the thermometer
  • Issue the Skip Rom command (0xCC)
  • Issue the Convert T command (0x44)
  • Wait for 1+ second
  • Issue a Reset pulse and observe the Presence of the thermometer
  • Issue the Skip Rom command (0xCC)
  • Issue the Read Scratchpad command (0xBE)
  • And read the next two bytes which represent the temperature

Lets see the C code I loaded on my board Read more…

Categories: electronics Tags: , ,