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!

 

 

Glass Circuits

So one day I was bored and had a few things lying around:

  1.  Copper tape
  2. A pane of glass from a scanner
  3. 555 timer & passives
  4. soldering iron

There was really only one logical thing to do to assist in my procrastination, put together an astable 555 circuit on the glass!

P1010637_1Through my time learning about electronics, I have come to realise that the 555 timer circuit, astable or monostable, is one of the first circuits anyone should make.

However for those who don’t know about it here is a short explanation of the astable circuit.555astable

The 555 timer IC is a a circuit of over 40 components, including 25 transistors and 15 resistors, all printed on a silicone chip.

The circuit works by flipping the voltage states of different pins on the IC. Initially pin 7 is high and so the current flows though R1 & R2 to charge the capacitor. Pin 6 detects the high voltage build up on the capacitor and toggles pin 7 to be pulled low, this causes the capacitor to discharge through R2. While the capacitor is discharging, pin 3 is pulled low, turning off the output, however when pin 2 detects the low voltage on the capacitor, pin 7 is pulled high again, allowing the current to flow through R1 & R2 again.

555 Astable GIF

And ofcourse there is some maths to work out the length of each high and low pulse for given component values, and thus the frequency as well.

f = 1 / ( ln(2) * C * ( R1 + 2R2 ) )

High = ln(2) * C * ( R1 + R2 )

Low = ln(2) * C * R2

And so with values of 1000Ω for R1 and 10KΩ for R2, and 100μF for C1, we get a high pulse of 0.76 seconds, and a low pulse of 0.69 seconds and a frequency of 0.69Hz (687 mHz).

P1010632

P1010634


testing timer

Hameg 203-4

As usual you can find some great bargains on eBay!

A few weeks ago I brought my first oscilloscope, a Hameg HM203-4, on eBay for £14.51, quite a deal I think. It was sold as “For parts or not working” as the seller didn’t know anything about oscilloscopes  or how to use them.

The Hameg HM203-4

The Hameg HM203-4

P1010452

I do love that there is a warning about the X Ray dosage!

Although it was sold on eBay as good condition, one of the buttons was missing. Fortunately I was able to see it inside the casing and so wasn’t too worried.

P1010457

So its time to crack it open and see what’s inside . . . Just two screws on the back and the whole metal chassis slides off.

P1010453

just two screws on the back

With the metal chassis removed we get our first glimpse into the home of the magic smoke. Just as I had hoped the missing switch was just a case of the shaft having popped out of the holder, I wonder what happened. . .

P1010456

P1010459

P1010461

A nice easy fix =]

So now that is fixes, here are some specs. Its a dual channel scope with a bandwidth of 20 MHz its not the fastest beast out there but then its not the slowest either, backed up by a max input sensitivity of 2mV/cm. One feature I’m interested to try and think might be pretty good for me as a student is the component tester. to make matters even better its apparently recommended for the training of engineers, perfect.

P1010462

What a pretty board

P1010463

P1010470

Poles Poles Poles, and a little bodge 🙂

P1010466

I was amazed to find capacitors without venting on the top!

P1010474

At least the CRT was made in 1983.

Digibury Discussions

So the other day, for the first time, I went along to Digibury, a event for people interested in technology in the local area. At the monthly meetings you can normally expect to 3 different talks.

The Digibury Postcard

The Digibury Postcard (Slightly crumpled)

At this months meeting we heard from Joe Webb, a PhD researcher in Cultural Studies. He is conducting an ethnograph about how “computing professionals” have learnt to use computers. He has started to see some very interesting generational differences in how people learnt to use the computers.

Next up on the schedule was a talk from Deri Jones, from SciVisum.
At SciVisum they specialise in load testing websites and web applications. From the data that they collect and analyse they can advise a business’s technical team so that they can adjust the companies website to be more efficient and capable of coping with the expected load. It also means that SciVisum can advise the less technical directors as to if there is a something that the companies technical team can do when their website has a fault.

The final talk of the night was from Chris Atherton, a user experience architect. She was talking to us about the recognition rules that humans apply to the world around them, for example that a chair has 4 legs and a back, or that a wheel is circular and has spokes. She then asked that we apply these rules to showers and to microwaves, and we all came to realise that these products do not have any standard user interface. Eventually after some discussion we even decided that showers do not offer enough control for the temperature of the water, only cold or hot, whereas microwaves offer too much functionality above and beyond heating a dish for a set amount of time.

All in all I really enjoyed the evening of talks, and am looking forward to next months set of talks on interfaces.

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);

}

Prototyping Regulators

Following the mod of the cheap lamp, I had a 12v supply lying around. I figured a good use of it would be to make a supply board for my Raspberry Pi  and other devices I may want to attach to it.

12v AC supply - 2

The supply actually outputs around 13.4 v or so which can be attributed to the tolerances of components used. Regardless of output being greater than 12v, I can still use it with the two different regulators I ordered from Rapid, the L7805cv 5v 1A TO-220 package regulator, and the LM723 adjustable voltage regulator in a 14-DIP package.

7805

 

LM723

Both regulators have a maximum input voltage of 40v, so the 12v supply will be just fine. However the supply outputs an Alternating Current (AC) signal, this can be converted to Direct Current (DC), which is needed for most general electronics, by passing the supply through a device known as a Bridge Rectifier.

The Bridge Rectifier

Moving On . . .

On my breadboard I first built the circuit to output 5v in order to power my Raspberry Pi. 7805Circuit

This is a standard circuit found in the datasheet however C2 has a value of 100µF and C1 is equal to 10µF.

Oopps . . . Please do remember to put the capacitors the right way round, first time I’ve ever done it, but it turns out these capacitors don’t like 12v going in them the wrong way . . .

P1000519

7805 and Rectifier

So after connecting the capacitors in the right polarity, and attaching a 7W 75Ω power resistor across the regulator’s output to load it, I attached the voltmeter to measure the output.

Near Perfect

Using the 100µF and 10µF combination proved successful and outputted a solid 5.028v, however the datasheet recommends values of 0.33µF and 0.1µF. If anyone understands the reasons for the different values please do comment below because I am very curious as to why they both work.
Additionally I would be interested to know why the AC signal of the 12v supply distorts as seen below when the supply is under load.
Odd wave distortion

 

Solving Quadratics

So to start off a new area of discovery I have decided to start to learn Python.

To start off this undertaking I downloaded Python 2.7.3 from python/download and started to play around with IDLE, python’s Integrated DeveLopment Environment (IDE).

As a project to work on to learn this new language I decided to make a simple console application that try’s to calculates the value of X for a given quadratic.  To do this it will use the quadratic formula

Image

So to do this I first need the values of a, b, and c as per the formula.    Image

for example a = 1, b = -9, and c = 20.

The first step logical step was to cut the equation into 3 chunks:

  1. The Discriminant (Δ); b^2 – 4ac
    1. sqrB = pow(b, 2)
      AC = 4*a*c
      Delta = math.sqrt(sqrB – AC)
    2. the “pow(x,y)” function returns the first term to the power of the second, i.e. b^2
    3. the math.sqrt is a function of the math module which square roots the contents of the brackets, or to use the technical name, parentheses.
  2. The Numerator; -b +- √Δ
    1. NumeratorPlus = -b + Delta
      NumeratorMinus = -b – Delta
  3. The Denominator; 2a
    1. Denominator = 2*a

Then with the necessary components the values of X can then be calculated by:

XPlus = NumeratorPlus / Denominator
XMinus = NumeratorMinus / Denominator

and then be outputed on the screen using the print command:

print (“Your answer is, X = “), XPlus, (“Or X = “), XMinus

notice the comma’s after each component which are needed.

And so the final step was to allow the user to enter in values:

print (“Please separate the quadratic equation into aX^2 + bX + C = 0”)
a=input(“Please Enter the Value of a : “)
b=input(“Please Enter the Value of b : “)
c=input(“Please Enter the Value of c : “)

The “input” function is important as it prints the given prompt to the output and then reads in the data entered by the user and assigns it to the variable.

This is different to the “raw_input” function which is not syntax sensitive.

And so the final code looks like:

import math
from time import sleep

print (“Please seperate the quadratic equation into aX^2 + bX + C = 0”)
a=input(“Please Enter the Value of a : “)
b=input(“Please Enter the Value of b : “)
c=input(“Please Enter the Value of c : “)

sqrB = pow(b, 2)
AC = 4*a*c
Delta = math.sqrt(sqrB – AC)
NumeratorPlus = -b + Delta
NumeratorMinus = -b – Delta

Denominator = 2*a
XPlus = NumeratorPlus / Denominator
XMinus = NumeratorMinus / Denominator

print (“Your answer is, X = “), XPlus, (“Or X = “), XMinus

sleep(10)

Image