Uni Update

Life at university is going well, however lab sessions are insultingly easy. They comprise of simply measuring the resistance, voltage and current with different combinations of resistors. Having said that I do understand that they are partially there as a method of learning how to use the test equipment that each workstation is equipped with.
I have been nominated as the Foundation Year course rep which means that people on my course are supposed to go to me with their problems regarding the School of Engineering and Digital Arts.
As well as that, I have joined the Caving Club, the Shooting Society, and become the Treasurer of the TinkerSoc, the University’s Engineers Society.
With the TinkerSoc we have plans for several big projects that I look forward to updating everyone on!

My first Rapsberry Jam

Well last night, in preparation for getting myself a Raspberry Pi I attended the London Raspberry Pi Jam Night at the Mozilla space in London.
I won’t bore everyone with a full write up of the night and instead if you are interested, point you to my good friend The Scientific Moustache’s blog post on the night.

Instead I will be giving you my impression as a newbie at these events.

I arrived early with my friend as he is a co-organiser, and it seemed to be quite a quiet affair.
As people started turning up and getting to work with their projects and lending a hand to others with their own projects. I started to get into the spirit of the evening, lending my own advice and opinions, although very often I was proved wrong. Alas I was surrounded by new technology, and a new programming language, so I’m not surprised that I was no help.
So despite not being any help myself, I really was intrigued by some of the projects others were doing, from controlling a Lego NXT robot, to taking pictures using a webcam and controlling an Arduino Uno, to just trying to connect it to the internet.

I really can’t wait for my Model B RPi to arrive so I can start playing with it, and of course I’ll update on here with my progress.

The Raspberry Jam is in no way affliated with the Mozilla Space or the Rapsberry Pi Foundation. Raspberry Pi is a trademark of the Raspberry Pi Foundation.

Delivery!

So the MIC2941AWT‘s have arrived! These are the adjustable 1.2A Low dropout voltage regulators which I will be using to provide a variable voltage supply. I will only be using 1 in my project which means I will have 2 spares.
Image
To provide a readout of the supply voltage, current and power, I intend to buy a pre-packaged module off ebay. This module is sold in 3 different variations, the 5A module, 10A module, and the 20A module. The 10A module has the best current sensing resolution while still capable of sensing a large range and costs about £20.

Alternatively I can buy a Voltmeter and Ammeter module for £18 which also provides an adjustable output voltage and an aluminium heat sink.

We’ll wait and see which module I decide to go for.

After my mistake was pointed out that I needed fuses on my output terminals, here they are.

Image

Converting a old PC psu

Most decent workbench power supplies cost quite a lot, at least for a student. Whereas I have and old computer PSU lying around, so I figured I’d have a bit of fun converting it.

Taking inspiration from various other projects including the DIY Bench Supply from TG’s builds and the RepRap PCPowerSupply I’ve ordered a MIC2941AWT from Micrel, this is a 1.2A Low-Dropout Voltage Regulator that I’ll be using to supply a variable voltage. In addition to the variable supply I’ll be including terminals for the voltages supplied directly from the old psu.

Image

Decoding the Unique Identifiers

As I mentioned in my previous post, I am able to read the ID’s of both the cards that came in my kit, however these ID’s are raw. We can decode these into different formats.

By reading in the code byte by byte the code is read, by default, in decimal (DEC).

For those who haven’t met the different number base’s, in our normal day to day lives we use the decimal number system which is base 10, ie 10^0 = 1, 10^1 = 10, 10^2 = 100 . . . Base 10 only uses combinations of the numbers 0 to 9. Other common bases include:

Hexadecimal, base 16 ie 16^0 = 1, 16^1 = 16, 16^2 = 256 . . . Base 16 uses a combination of 0 to 9 and A to F to represent 16 digits.

Binary, base 2 ie 2^0 = 1, 2^1 = 2, 2^2 = 4 . . . Base 2 uses only two digits, 0 and 1.

So using this we can adapt what is sent using the Serial.print command by writing the value or variable we want to send, followed by BIN for binary, DEC for decimal, HEX for hexadecimal, as well as others that I haven’t covered.

so using

int val = 0; // variable to store the data from the serial port

void setup() {
Serial.begin(9600); // connect to the serial port
}

void loop () {
// read the serial port
if(Serial.available() > 0) {
val = Serial.read();
Serial.println(val,DEC/HEX/BIN); //use one Base as appropriate.
}
}

We can read the value in any base system supported by Arduino.

DEC
2 53 49 48 48 55 66 69 65 52 50 56 50 13 10 3
2 53 48 48 48 56 70 65 52 66 56 67 51 13 10 3

HEX
2 35 31 30 30 37 42 45 41 34 32 38 32 D A 3
2 35 30 30 30 38 46 41 34 42 38 43 33 D A 3

BIN
10 110101 110001 110000 110000 110111 1000010 1000101 1000001 110100 110010 111000 110010 1101 1010 11
10 110101 110000 110000 110000 111000 1000110 1000001 110100 1000010 111000 1000011 110011 1101 1010 11

RFID and a LCD

After a long wait my delivery arrived with the new RFID kit and 16×2 LCD.
So first thing to work on was the LCD, and what better to start with than “Hello World”! Having not used the Arduino for some time I started with the LiquidCrystal HelloWorld example and then worked from there.

 

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print(“hello, world!”);
}

void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);// print the number of seconds since reset:
lcd.print(millis()/1000);
}

After checking that I had everything working correctly using HelloWorld, I started experimenting displaying variables and changing the location of the cursor.

Next to work on the RFID module.

Not having an example to start with, I did a little searching online to find an excellent Instructables post. From this post I learned that with the RFID tx pin connected to the arduino’s rx pin, you can you the Serial.read() command to read the unique identifier.

/* RFID ID12 */
//RFID tx pin –> arduino rx pin

char val = 0; // variable to store the data from the serial port

void setup() {
Serial.begin(9600); // connect to the serial port

}

void loop () {
// read the serial port
if(Serial.available() > 0) {
val = Serial.read();
Serial.write(val);
}
}

Now that I was able to display text on the LCD and also read the values of the RFID tags, the next logical step was to combine the two together!

Now working on my own code, I set out to get the LCD asking for the card to be scanned, and then displaying the number of the card.

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {

lcd.clear();

// put your setup code here, to run once:
Serial.begin(9600);
lcd.begin(16, 2);
lcd.print(“Please Scan Your”);
lcd.setCursor(0,1);
lcd.print(“Card:”);

}

void loop() {
// put your main code here, to run repeatedly:
if(Serial.available() > 0) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.clear();
lcd.print(“Your Card is”);

lcd.setCursor(0, 1);
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());

}
delay(1000);
lcd.clear();
}
}

Arduino goodness!!

Brought myself some new toys for my Arduino today.
I’m looking forward to using the LCD as an interface, and displaying data, maybe eventually a twitter feed display.
My second purchase was a RFID starter kit that the good people at Sparkfun produce. My University ID card has RFID in it so should be interesting to read the data off that, maybe use the LCD to then display that data.
I’ll update everyone when i’ve started working with them.

LCD Add-On for SIK

Looking forward to using an LCD with my arduino

Sparkfun RFID Starter Kit

Looking forward to this arriving

On the road to the Masters!

So I’ve started my time at university, studying Electronic & Communication Engineering. However I have a long way to go to get that Masters!
I am starting here at university doing a foundation year which I have to pass to get onto the real course, fingers crossed that all goes well!

Meanwhile I’ll be undertaking projects throughout the year myself, and with the various societies that I’ve joined. So far in my arsenal of electronics I have just my Arduino Uno R3 and a PICkit 2, as well as a handful of LED’s and various other components.

In terms of projects I want to achieve this year, I want to make a workbench power supply out of an old atx power supply, a USB accessory that displays the temperature of the CPU, and a twitter feed display.

Hopefully I can complete these three and more, and give me a good basis for more projects in the future!