Archive for the ‘Guides’ Category

Full size DIY Balancing Robot

It has been quite a while since my last blog post, but I am finally ready to reveal what I have been working on the last months. Ever since I made my first balancing robot: and the Balanduino I wanted to build myself a full size version which I would be able to ride just like a regular Segway.

Finally I decided to make one together with a good friend of mine Mads Friis Bornebusch in a course at my university DTU (Danish Technical University/Technical University of Denmark).

Video demonstration

Mechanical construction
The main frame is an aluminium checker plate that is 500x360x7mm which the motors are bolted onto. This width was chosen, so it would be able to go through a normal door opening. The motors used are two MY1020Z 500W, 24V, 12.6Nm brushed DC motors.

I ordered them from Germany, as I needed them right away, but you should be able to get them much cheaper by ordering them directly from China.

Below is an image of the aluminium checker plate after we have drilled the holes for the 8mm steel bolts. Note that these are countersunk, so they are flush with the surface. I would recommend using lock nuts to ensure that the bolts will stay in place – you can also use Loctite instead.

Aluminium checker plate - ready to mount the motors

Aluminium checker plate – ready to mount the motors

Motor with hub

Motor with hub

Read more…

Color object tracking with STM32 + OV7725

This project uses STM32F103 microcontroller to track an object, it gets the image from an OV7725 camera + FIFO, it is configured as rgb565 QVGA(320×240).
In the touchscreen the target object can be selected, its color defines the thereshold to binarize an image. After the segmentation is done an algorithm recognizes the contour of the image and its center, once located a PI controller moves 2 servos (pan, tilt) in order to target the objective.
A video of the system doing real-time tracking can be seen in the bottom of the post. The source code and Keil project for the STM32F103VCT device can be downloaded here:

Designing an embedded system in a microprocessor for detection and targeting a colored object, without the need for externally processing system (PC)
Read more…

How to stream video and audio from a Raspberry Pi with no latency

I have finally finished my last exams, so now I have more time to focus on some of my own projects. It has been a while since our Kickstarter campaign was successfully funded, but we are still working on making the experience better for the final users.

After the campaign ended we sent out a survey to all our backers with several questions about there address, profession and so on, but we also asked them if they had any suggestions for improvements or extra features they would like to see added to the Balanduino. A lot of people asked if we could enable wireless streaming for it.
I was personally very excited about that since I have been playing with the thought for quite a while, so when the official camera module for the Raspberry Pi became available I bought it straight away.

Raspberry Pi camera module

Read more…

Drive LCD TFT displays with an FPGA

FPGA’s can be very advanced to get started using, especially if you are used to microcontrollers.
But when you first get the right feeling and the proper mindset you will soon see the endless possibilities with the programmable logic.

One of the great aspects of the logic is the speed and the full control of what happens at every single clock cycle.
With this full control it doesn’t takes many lines of code to generate a very time-critical signal such as a video signal.

In this short post I will walk thru our current test setup with an FPGA, the Spartan 3E, controlling a 18-bit 7″ 800×480 TFT display.

Spartan 3E controlling a 800×480 TFT LCD

Read more…

Categories: Development boards, FPGA, Guides Tags:

A practical approach to Kalman filter and how to implement it

September 10th, 2012 302 comments

I have for a long time been interrested in Kalman filers and how they work, I also used a Kalman filter for my Balancing robot, but I never explained how it actually was implemented. Actually I had never taken the time to sit down with a pen and a piece of paper and try to do the math by myself, so I actually did not know how it was implemented.
It turned out to be a good thing, as I actually discovered a mistake in the original code, but I will get back to that later.

I actually wrote about the Kalman filter as my master assignment in high school back in December 2011. But I only used the Kalman filter to calculate the true voltage of a DC signal modulated by known Gaussian white noise. My assignment can be found in the following zip file: It is in danish, but you can properly use google translate to translate some of it. If you got any specific questions regarding the assignment, then ask in the comments below.

Okay, but back to the subject. As I sad I had never taken the time to sit down and do the math regarding the Kalman filter based on an accelerometer and a gyroscope. It was not as hard as I expected, but I must confess that I still have not studied the deeper theory behind, on why it actually works. But for me, and most people out there, I am more interrested in implementing the filter, than in the deeper theory behind and why the equations works.
Read more…

Categories: Guides, TKJ Electronics Tags:

Raspberry Pi GPIO control

We have been working with the new Raspberry Pi board for a while but didn’t show it to you guys before now.
Many of you might already have seen and read plenty of videos and articles about it so I thought it would be more appropriate to make a tutorial on how to use the GPIO’s, and especially on how to speed up the GPIO’s.

In this video I walk you thru all the steps from installing the Raspbian image which is based upon Debian. This is by far the most complete and well working image I’ve discovered.
Together with a complete X-window system it also comes with many different developer tools preinstalled such as Python and GCC.

So go watch the video while to set up your own Raspberry Pi for GPIO control.

Read more…

QuadCopters – How to get started

I have been watching different videos of QuadCopters recently and I’ve been pretty amused. The way they fly and the way they control their movements is unbelievable – it almost looks like a bug.

If you don’t know what a QuadCopter is, you should definitely have a look at the video below where some advanced features of cooperating Quadcopters are displayed:

So I decided to start reading some more about the materials behind these QuadCopters and how they manage to stabilize in the air.

In this blog post I will try to describe the different steps I have been thru to plan, design and build the prototype of my QuadCopter. There will be coming some more blog posts later on describing how to get the QuadCopter running, programming it, tuning it etc.

This blog post is divided into 3 parts

  1. What is a QuadCopter

    1. Brushless motors
    2. Propellers
    3. Roll, Pitch and Yaw
    4. ESC – Electronic Speed Controller
    5. Battery
    6. The frame
    7. Frame configuration
    8. Inertial Measurement Unit
    9. Controller electronics
  2. Initial decisions
    1. Theoretical calculator
  3. Conclusion

Read more…

Categories: Guides, Multirotors, TKJ Electronics Tags:


I have previous thought about buying a universal remote like this one, as I was tired of grabbing my JVC remote for my stereo everytime I had to turn it on, off or turn the volume up or down. But then I discovered Ken Shirriff’s IR Library for the Arduino. Normally the library didn’t support neither the Panasonic or JVC protocol, but I discovered that somebody else had already added them. See the forked github library. At first I simple downloaded the library and tested whenever it could decode the Panasonic protocol and send commands to my JVC stereo. It had to tweak the library a bit, but then it worked just fine.
I thought it would be a bit overkill to use an Arduino and I didn’t want to rewrite the whole library, so I decided to use another AVR’s but in a much smaller package, the ATtiny85. Which is 8-pin AVR.
Read more…

Categories: Arduino, Guides, TKJ Electronics Tags:

NXT Shield Version 2

October 19th, 2011 31 comments

The NXT Shield is for sale in our shop: A easy to use library is also provided:
Three examples that demonstrates reading the encoders, turning the motors and using the ultrasonic sensor is found in the library as well:

More pictures of the NXT Shield can be found at the following blog post:

I finally made a new version of my NXT Shield. The big news is that it now supports the Lego Ultrasonic Sensor and it has NXT Compatible Sockets from mindsensors.

Read more…

FEZ Panda & PS3 Controller via Bluetooth

September 9th, 2011 37 comments

NB: The newest source code can now be found at github.

As you might have seen, I finally got the PS3 Controller working via Bluetooth. Before you read any further, you should read my previous post first and also see the wiki for more information.

Read more…

Categories: ARM, Bluetooth, Guides, USB Tags: