PlotBot: Building the Gondola

Next stage of the build is to work out how to hold the pen. Some people call this the gantry or holder, I’ll be calling mine the gondola.
I decided to use lollipop sticks for this, they have a similar length to whiteboard maker pens, reasonably light weight and at only 50p for a pack of 50 sticks and it was an obvious choice!

IMG_20140908_133959

Clamping the Sticks for drilling

Having cut a few sticks down to size I then clamped them together to drill a thread hole through them using my trusty dremel.

IMG_20140908_134639

Lining them up for gluing.

IMG_20140908_135225

First one clamped down.

With the first side clamped in place and the wood glue drying things are starting to take shape.

IMG_20140908_195723

Sides nearly finished.

IMG_20140909_110614

And the finished gondola! look forward to a video of the first test draw in a couple of days . . . things are a bit shaky!

PlotBot: Building the Machine

With the research all done, I started thinking about how I wanted to build my PlotBot.
Having looked at the other designs, I found they were either mounted on a wooden frame and then a piece of paper is taped onto the wooden panel, or they draw directly onto a surface like glass or a wall. Given that the aim is just to make something that catches peoples eye, rather than making posters or drawings for people, I think the best course of action would be to use a whiteboard. I can get one reasonably cheaply, and the mounting is pretty much already sorted.

the Mountings

The whiteboard and mountings.

Once I had bought a whiteboard (600mm x 450mm) I started lining up the parts I had as to how I would mount them.
I had also bought 2 Pololu 1204 Stepper Motors and an Adafruit Motorshield v2 (AFMSv2). I did have a few concerns with these parts combined together, in that the motors only draw 600mA and the motorshield provides 1.2A per channel, therefore the motors might get a little hot if they start drawing more than they should – but we’ll see how it goes!

rough positioning

Roughly lining up the parts on a sheet of acrylic.

To mount the acrylic sheet to the whiteboard I used two of the mounts supplied with the whiteboard secured on the top of the sheet. These then hook onto the edge of the whiteboard, and the mounts on the side are adjustable to “lock in” the sheet to the sides of the board. Finally I decided to neatly mount the arduino and AFMSv2 in the center of the acrylic sheet.
Drawing up where to cut

Whiteboard Mounting     Arduino Mountings

IMG_20140813_134431     IMG_20140813_110556_1

I picked up two remote control car wheels at a local hobby store, along with 50m of fishing line, which would form the basis for my reels.IMG_20140819_220854

I found some nuts in the garage that fitted the inside of the wheel, and used Araldite (metal glue) to fill the gap around the stepper motor shaft hoping that this wouldn’t go wrong.

IMG_20140819_181748IMG_20140820_180654

IMG_20140820_180634

Araldite’s in, I was a little bit messy dripping it everywhere!

 With the luck of the gods, after leaving it 24 hours to cure I was able to punch the stepper motor shaft out of the nut, leaving a nice shaped hole. The advantage of this method being that I can very easily remove the reels and use the steppers in other projects.  

IMG_20140819_220909

IMG_20140819_221038  IMG_20140819_221322

Now that I have the reels mounted on the steppers, I was able to complete the main build; mounting the steppers onto the acrylic sheet, and winding the fishing line onto the wheels – happy days!

IMG_20140903_141549

IMG_20140903_141638  IMG_20140903_141609

 

 

 

PlotBot: Brief

So as time draws on we are getting closer to the start of the new academic year, and of course that means Fresher’s Fair!
At Kent we have several creative societies including SpaceSoc and their “Build a Rocket” sessions, Engineering Soc  with their focus on robotics, and TinkerSoc who want to help people build without limits.
With TinkerSoc it has become somewhat of a tradition to build and showoff a project at the fresher’s fair. In previous years we have had a laser engraver making custom name tags and furbies singing bohemian rhapsody, basically something to grab peoples attention and imagination.
Having seen a number of vertical plotters online I have decided now is the time to build one.

The standard vertical plotter is made up of 2 stepper motors, a servo, a motor controller and a microcontroller. By providing a stream of polar coordinates to the robot, the two motors can be wound in and out to move a pen across the whiteboard. This produces drawings where the pen never leaves the surface however that does not limit the styles of drawings that can be produced. Drawings can be developed further by adding a server or linear actuator to the pen carriage in order to push the pen off the drawing surface, thus allowing mush more freedom to implement different drawing styles.

Obviously we cannot draw above, or on either side of the motors, however the effectiveness of the plotter changes depending on the position of the pen carriage.
As such the most effective drawing area is a rectangle in the centre of the drawing surface with the tension on a cord being too low on either side, and the resolution is too low at the top due to the large angles. (http://2e5.com/plotter/V/design/

image

 

There have been a great many vertical plotters in the past, a great list can be found at plotterbot.com.
Overall there seem to be two different styles of drawing with vertical plotters.

Single line, where the pen never leaves the surface, is technically less challenging and can provide great results however you can be left with the odd scrawl across the surface that you didn’t want.

Multi line, where the pen can be lifted/pushed away from the surface, allows much more flexibility with regards to what can be drawn as the robot won’t scrawl connecting lines across the surface however does add the extra complexity of having a servo or linear actuator to push the pen carriage away from the surface.

Bearing in mind the saying, the more complex it is, the more likely it is to break.

 

Tinkerlog’s “Der Krizler” is definitely one of the more popular V-plotters out there, drawing on glass to amuse passers-by.

ATAT

 

Dan Royer’s Makelangelo is a very impressive V-plotter. Commercialised as a kit, it’s reliability has been tested extensively!

Makelangelo 2.5

 

And probably the oldest V-plotter around from 1988 developed at MIT using lego!

 

 

London Arduino

Tonight was my first time along at the London Arduino Meet Up.
The London Arduino Group is of a similar idea to the Raspberry Pi Jam events that I’ve been to
before. It is a group of people who want to share knowledge about the Arduino platform and start to
innovate across other platforms.

This month we had presentations including hobby electronics, internet controlled LED’s and 3D
printing.

Using an Ethernet shield, Christian, put together a set up where he was able to control the status
of an LED in his web browser. This was done on a local network (sorry guys who wanted to take
control of his little light) where he showed two methods of flicking the switch.
The first method he showed off was to use the arduino as a web server and construct the html on it
as well. Then it was a simple matter of connecting to the IP address that was defined on the
arduino and hey-presto it worked.
The second method that he demonstrated was a little more complicated involving node.JS, sockets and other technical jargon that I didn’t catch.

On a similar vein we had Liam demonstrating the use of a TP-Link Wireless N Nano Router (TL-WR702N) to connect an arduino to the internet. He argued that the use of WiFi shields is overly complicated compared to Ethernet shields, as well as being a lot more expensive  So if you are willing to have a slightly bigger package then you can connect the Ethernet shield to the nano router and leave that to sort out the complicated subtleties of wireless connections, allowing you to get on with innovating your wireless solution. Another thought is that a nano router is much more versatile than a WiFi shield because it can be plugged into a computer, games console, Raspberry Pi, or any other device that has an Ethernet socket.

In the realm of Hobby Electronics we had Danny, who was plugging his first ever kit robot. Orionrobots.co.uk is his creation and is where he is selling his first his own starter kit robot. In this kit you will find everything that you need to to construct a small chassis with 4 wheels controlled in pairs (left and right) by a L298n dual H-Bridge controller board which is interfaced to an Arduino Uno R3 (provided in the kit). With a easy fit design, you only need a screwdriver to put this kit together making it perfect for anyone who is; unsure with tools, in need for a robot chassis quickly, or just lazy.

The final talk of the evening was from Mark, on behalf of another London Tech Meet-up group, Future Manufacturing, who have a keen interest in 3D printing. They are really keen to see cross collaboration between our two groups on various projects including potentially the Luma Module Interactive Spaceship. The Luma Module is a KickStarter project where they want to build a spaceship that lights up when people interacts with it. This spaceship will then be shipped (no it won’t fly itself) to Nevada for the Burning Man art Festival at the end of August 2013.

So You’ve got yourself a Lilypad?

So as part of my involvement with TinkerSoc, we now have our new hoodies. These hoodies are designed so that a Lilypad Arduino can be sewn onto it and then components added to it. We will be wearing hoodies that we can literally tinker with.

Lilypad Arduino

For those that don’t know, the Arduino Lilypad is an Arduino development platform intended for clothing and e-textiles. Using conductive thread you can sew tracks and components onto any fabric and then programmed.
The Lilypad doesn’t have a USB plug like an ordinary Arduino Uno. This is because the Lilypad does not have a FTDI Chip (Future Technology Devices International Ltd) unlike the Uno and many other Arduino’s. The FTDI chip converts the USB to serial communication.

LilyPad Programming_bb

So because the Lilypad doesn’t have a USB connection we can use an Arduino Uno instead. To do this we need to remove the ATMega 328p from the Arduino Uno, then break out the header on the Lilypad. As per the diagram above from left to right, the pins connect to Gnd, Gnd, 5v, Rx, Tx and Reset. With these connections made, we can proceed to connect the Uno to a computer, and then start up the Arduino IDE. While in the IDE, make sure you change the board to the correct version of the Lilypad you are using. (If in doubt try to read the number on the Microcontroller on the centre of the board)

Arduino IDE
And with that done you are ready to start programming, I suggest loading up the example blink program first. Enjoy.

Starting a VU (Volume Unit) Meter

To keep myself busy at university, I decided to start on a big project. Well big for me anyway.
The end goad being a a VU (Volume Unit) meter, aka a sound level, that can be used either in-line with an audio cable, or used with a microphone.

I am to try to go through this project in a number of research stages, and main 3 test stages.
For the research I want to start with a Light Level Meter. This will just help me to refresh my arduino programming skills, and also just set myself up for when I get hold of a microphone.

Next I will take the same circuit and apply it to audio, using a microphone and using a line-in. In terms of analysing the audio I will first try using a simple analogRead, just the same as the Light Level Meter. I will also look into using FFT (fast Fourier transform) which is used to transform raw audio into a frequency spectrum, which in turn can be outputted to LED displays. This route could end up being very complicated so I will approach that with caution.

The next stage is to research multiplexing and charlieplexing LED’s. This is because I would like the end product to have a LED matrix display,  thus enabling me to potentially display a spectrum of frequency bands. However for the testing I will move back to the Light Level Meter and try to display that data on the LED display.

In terms of the test stages, I will be doing all initial research on breadboards, if all goes to well I will move onto designing an arduino shield, the hope is that this will also work as a Lol (Lots of Lights) Shield. Finally I want to take this to an end product, on its own PCB.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

So enough talking, time to refresh on the very basics.

The Light Level Meter.

This is a very simple circuit, but then that was not the purpose of it.
Each LED was connected to a pin on the arduino, and the central pin of a variable potentiometer is connected to an analogue in pin. I connected an LDR (Light Dependant Resistor) between the variable pot and 5v. The other pin of the variable pot is pulled down to 0v.

Light Level Vs Resistance over a LDR

As the light level decreases, the resistance over the LDR increases, combining this in a basic potential divider circuit means that as it gets darker, the value read in at the analogue pin of the arduino gets higher. This allows me to adjust the LED’s appropriately and also use the variable pot to calibrate the display.

The circuit seen below is the circuit used, with a 330 Ohm resistor in series with every LED as a current limiting resistor.

Light Meter Fritzing Circuit
To program the arduino I used the standard arduino IDE, available from arduino.cc, and I programmed the arduino with the below sketch.

// LED Light Level Meter

int led[10] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12};  // Array of pin numbers for                  the LED’s
int adjust = 5; // Adjustment Pot
int Light, i;

void setup()
{
for (i=0;i<10; i++) // A for loop which goes from 0 to 9, setting
pinMode(led[i], OUTPUT); // each value in the array as an output
Serial.begin(9600); // Turning on the serial output to troubleshoot
}

void loop()
{
Light = analogRead(adjust); // Reading the analogue value of the LDR
Serial.println(Light); // sending the value to the computer for troubleshooting
Light = Light / 100; //reducing the value down to between 0 and 10
Serial.println(Light); // sending the value to the computer again

if (Light == 0) // checking that all LED’s are off if there is no light
{
for(i = 0; i < 10; i++)
{
digitalWrite(led[i], LOW);
}
}

else
{
for(i = 0; i < Light; i++) // Turns on all LED’s between 0 and the light level
{
digitalWrite(led[i], HIGH);
}

for(i = i; i < 10; i++) // turn off the leds above the light level
{
digitalWrite(led[i], LOW);
}
}
delay(100);

}

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