Calling a C program from a Python script

This process is made simple with Python’s subprocess module. Continue reading


Cheap and nasty ‘powered’ usb cable

I was trying to connect a wifi adapter to a raspberry pi today but the pi’s usb ports could not supply enough current to the device. A powered USB hub would be the ideal solution to this problem but I didn’t have one handy. The workaround I used was cut open the cable, strip the insulation of the red and black power wires and attach separate wires so that a power supply could be connected.

Continue reading

Metal trolley experiment results

This post will contain the results of all experiment done with the metal trolley.
Cardboard test results
Plastic test results
Glass test results
Investigating how easily tags can be read outside of the trolley
Investigating the benefits of RFID tags oriented in two axes instead of just one
Measuring the field strength around the trolley

The project I am working on at the moment involves testing how well RFID tags can be read when they are placed in a metal trolley. There are several factors that influence whether a tag can be read or not. The most important ones for this test are orientation, the material of the product they are attached to and where the antenna is mounted on the trolley. Due to the number of different materials that I am going to be testing with RFID tags there will be a lot of data and graphs.
Continue reading

Bash script for avr-gcc and avrdude

This script will take a c file (named main.c), compile it into a main.o file, convert this to a .elf file and then convert the .elf to a .hex and finally flash the chip with this hex using avrdude.

First install avrdude by opening terminal and entering :

sudo apt-get install avrdude

Then install avr-gcc:

sudo apt-get install gcc-avr

Here is the bash script:

avr-gcc -g -Os -mmcu=atmega1281 -c main.c &&
avr-gcc -g -mmcu=atmega1281 -o main.elf main.o &&
avr-objcopy -j .text -j .data -O ihex main.elf out.hex &&
avrdude -p atmega1281 -c jtag2 -P usb  -U flash:w:out.hex

Plastic trolley experiment results

This post will be periodically updated with any experiments I do involving the plastic trolley. Here is a picture of the new trolley:
2014-04-22 13.43.37

It has two baskets in it. The bottom one contains the RFID reader, it will also hold a battery in the future. The top basket is used for holding products in. This set of experiments will be similer to the ones done with the metal trolley. It will be interesting to compare the results to see which type of trolley is more suitable to use for the Continue reading

Theory about plotting (x,y) co-ordinates using any kind of plotter

For a college project last year, I built a plotter using cd drives. It had two cd drives in it, one for x direction and one for y. Pretty quickly it was drawing basic shapes like circles and squares. This was done by creating a simple function that accepted two arguments : the x and y co-ordinates to move to. Every step of the stepper motors was counted. So the positon of the platform was known. Continue reading