Archive

Author Archive

Face Recognition using Eigenfaces and Fisherfaces

July 10th, 2017 3 comments

In this project I developed an Android application with Jonathan Wang at UIUC demonstation face recognition using Eigenfaces and Fisherfaces.

I will not go into details on the theory about Eigenfaces and Fisherfaces in this blog post. Instead the reader should refer to the two reports written as part of the project: Eigenfaces for Recognition and Near-Real-Time Facial Recognition on an Android Tablet Using Fisherfaces. I would also recommend reading the original papers: Eigenfaces for Recognition and Eigenfaces vs. Fisherfaces: Recognition Using Class Specific Linear Projection.

The library is written in C++ where all the matrix operations are performed using Eigen. One of the advantages of using Eigen is that it can be used on any hardware platform (even microcontrollers), as it got no library dependencies. This allowed us to easily test the code on our laptops and then afterwards use it directly in the Android application by using the Android NDK toolset. As usual the code is available on Github: FaceRecognitionLib.

A few screenshots of the Android application can be seen below:

Google Play

The application is available on Google Play and the source code is provided at the following link.

If you have any questions leave them below or open up an issue on Github.

Categories: TKJ Electronics Tags:

Painting with drones

December 27th, 2016 No comments

The purpose of this project was to come up with an interactive demonstration for the Pygmalion Festival 2016 at UIUC. The end result was a demo where an Android device was given to the visitors, each visitor could then draw any continuous path on the Android device. The x,y-coordinates would then be uploaded to the cloud and a trajectory based on Bézier curves would be generated using a Python script. Finally ROS was used to control a small drone. Camera software was then used to highlight the brightest light in the scene, in this case a LED on the drone. This resulted in the path being visualised in 3D-space.

An overview of the project can be seen in figure below. The Android application is used as a simply user interface. The path drawn is then uploaded to Dropbox and a trajectory is generated using a Python script.

Project overview

Project overview

Finally the drone flies the trajectory. A short video of the project can be seen below:

Read more…

Raspberry Pi playing ZomBuster

August 23rd, 2016 No comments

Some time ago I had a course dealing with image analysis i.e. image segmentation, moments, colour detection, object recognition etc. As part of the course everyone had to make a project that showcased the theory we had been learning throughout the course. We were allowed to use OpenCV as the backbone for accessing the camera etc, but not allowed to use any of the built-in filters. Instead the goal was to implement the different algorithms ourself.

One day one of my friends was playing the Smartphone game ZomBuster. A screenshot of the gameplay can be seen below:

ZomBuster gameplay

ZomBuster gameplay

The goal of the game is to tap the lane with the zombie in it, in order to kill it. As the zombies are green and humans are blue I thought it would be a fun challenge to build a robot that could play the game autonomously for the course.

This also allowed me to use the 3D printer I had just bought at the time. For that reason I created a 3D model with all the needed components:

3D model

3D model

Read more…

Categories: ARM, Embedded Linux, OpenCV, Raspberry Pi Tags:

Bachelor's Thesis: LaunchPad Flight Controller

August 24th, 2015 5 comments

I recently got my bachelor’s degree in electrical engineering. As I wrote in an earlier blog post I decided to implement a custom flight controller on a Tiva C Series TM4C123G LaunchPad for my project.

Currently it supports several different modes including acro/rate mode, self level mode, heading hold and altitude hold. Below is a series of videos demonstrating the different modes:

The source is available on Github: https://github.com/Lauszus/LaunchPadFlightController as usual including the report I wrote.

I would really recommend anyone that is interested in this sort of thing to read through it for a deeper understanding on the fundamental theory and how it is implemented on a flight controller in practice.

It consists of three parts. The first part presents a theoretical model and the equations used to estimate the attitude and altitude of the quadcopter. The second part describes how the system is implemented on the microcontroller and lists the hardware used for the project.

The final part measures the performance of the flight controller by logging the data in real time. This data is then compared to the simulated results based on a theoretical model simulated using Simulink.

Flight modes

In total there are four different flight modes supported by the flight controller. The first one is acro/rate mode, which only uses the gyroscope to stabilise the quadcopter. This mode is mainly used for advanced pilots and acrobatic manoeuvres. In this mode the aileron and elevator stick inputs indicate the desired rotation rate of the quadcopter. Thus, if the user wants the quadcopter to rotate fast clockwise along its roll axis the aileron input can be put all the way to the right.

Read more…

IoT Arduino Vending Machine

February 7th, 2015 8 comments

In this blog post I will describe a IoT (Internet of Things) Vending Machine that I built quite some time ago with a friend of mine Sigurd Jervelund Hansen.
At Sigurd’s dorm room they got hold of an old vending machine free of charge, as it did not work. We quickly decided that we wanted to get it working and give it a overhaul as well. In the end we enabled it to take both RFID/NFC cards and coins and make funny twitter updates about it.

The video below gives a short overview on how it works.

As mentioned we reused some shift registers, relays and voltage regulators on the original mainboard. One Arduino Pro Mini is connected to the mainboard and takes care of reading and lighting up the buttons (lights up if the relevant slot is not empty), controls the 7-segment LED display, reading the output from the coin validator and returning money if the user requests it by pressing a dedicated button.

Read more…

Categories: Arduino, Raspberry Pi, TKJ Electronics Tags:

LaunchPad Flight Controller

January 23rd, 2015 8 comments

As some of you might know I have been studying in San Francisco the last semester at San Francisco State University. For that reason I have not done as much as development as I usually do, due to all my equipment being back in Denmark and also because I prioritised being social and not just sit behind my desk coding all night 😉

Anyway I did not fully stop working. I actually started working on my own flight controller written from scratch in one of by courses. Below is the result so far:

Read more…

Full size DIY Balancing Robot

July 6th, 2014 124 comments

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: http://blog.tkjelectronics.dk/2012/03/the-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

Motor with hub


Read more…

PS4 controller now supported by the USB Host library

January 12th, 2014 164 comments

I am very pleased to announce that I have now added support for the PS4 controller via Bluetooth. This will allow you to read all the buttons and joysticks with the same API as all the other libraries I have written for the USB Host library.

PS4 controller

To get started you should look at the provided example. It shows how to read the different buttons and joysticks. I still haven’t figured out how to control the light, rumble and read the accelerometer, gyroscope and touchpad, but hopefully I will figure that out soon.
Read more…

Categories: Arduino, Bluetooth, TKJ Electronics, USB Tags:

Bluetooth HID devices now supported by the USB Host library

December 1st, 2013 68 comments

I am glad to announce that Bluetooth HID devices are now supported by the USB Host library. The library already supports PS3 and Wiimote controllers, but now it also supports more general devices, like Bluetooth keyboard and mice.

An example is available at the following link: https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/BTHID/BTHID.ino.

First time you run the code, you will have to pair with your device, this is done by creating the instance like so:

BTHID bthid(&Btd, PAIR, "0000");

You can of course set the pin to anything you like.

Now you should enable discovery of your device and it should automatically detect any mouse or keyboard present and then connect to them. On Bluetooth mice there is no need to enter any pin, but on a keyboard you should enter the pin on the keyboard and then afterwards press enter.

So in this example you should press 0 four times on the keyboard and then press enter afterwards.

After you have paired with the device, you can simply create the instance like so:

BTHID bthid(&Btd);

When you press any button on your device it will automatically connect to the last paired device i.e. your Arduino.
Read more…

Categories: Arduino, Bluetooth, TKJ Electronics, USB Tags:

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

June 4th, 2013 62 comments

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…