kwartzlab makerspace

Posts Tagged ‘Arduino’

Dec
4
2012

Kwartzlab TON Timelapse December 4th 2012.

By » 1 Comment

Oct
24
2012

Beamer Show

By » 1 Comment

For the Kwartzlab third anniversary party I put on a “laser show” featuring some of the things I’ve been working on over the past few months.

The “laser” is an LCD Projector (thanks Don!) pointed at the audience. I wrote a program in Processing using the Minim library for beat detection. By applying filters to the input audio, you can extract the beat in real time and use that to control a number of variables, such as timers, colours, sizes, rotations, etc. This however proved unsatisfactory. The “show” it produced looked random and uninspired. I then recorded the output to video, made loops out of the animations, and then used a video editor to try to figure out what looks good and why. I ended up treating the video loops like breakbeat drum loops, chopping and slicing them up, laying them over each other, and keeping everything tight by quantizing to the audio channel. I also used some video effects to create transitions. This was eventually presented as the “laser show”, and now I’ll go back to Processing and see if this type of manipulation can be automated.
In order for this to work, the room has to be filled with smoke. A projector is much to bright to look at, even if projecting nothing but black. The smoke takes the glare off the projector, and gives the beams some volume. Smoke is generated by a small “Halloween” smoke machine (thanks Agnes!)


I also built a chipKit powered “dowser” to flip a flag over the lens with a servo whenever nothing was being shown, but this was unnecessary in practice. Eventually this as to tie into the VGA cable, and whenever the RGB lines went low the flag would flip down covering the lens. There’s provisions for two dowser flags, and one VGA control line, so that two projectors can be used for the show, but only one will project at at a time.

There was going to be another projector used for this show, in sync with the main projector using VLC’s network-sync feature. However Kwartzlab’s wifi was saturated and I wasn’t able to get a stable connection. Next time I will use a wired network. In hindsight I think this would have detracted from the show, so no loss by not having it.

  Thanks Karl for the pictures!

Jun
11
2011

Arduino-Compatible Multi-Threading Library v0.5 Released

By

It’s been a while since I’ve touched this project, but I’ve decided to re-visit the multi-threading library I wrote for the Arduino (largely because of the amount of consistent traffic those particular blog posts have generated… it’s satisfying to know that someone other than me seems to appreciate my work). Although, I’ve made some minor edits to the internals of the Thread class, the most important update has been the addition of the EventHandler class. As it’s name would suggest, it provides the framework for basic event-handling.


Read the rest of this entry »

Oct
30
2010

New and Improved Arduino Multi-Threading Library

By

So… I’ve been doing a little more work on the multi-threading library I blogged about earlier, and I decided that it would be a good idea to add some interrupt-like functionality to handle switches. Thus, the SwitchInput class was born. This class has several nice features that make working with switches easier.


Read the rest of this entry »

Sep
6
2010

Arduino Multi-Threading Library

By » 12 Comments

One of the things that I’ve always wished I could do with my Arduino is writing programs that can do multiple tasks independently of each other. Unfortunately, the Arduino doesn’t support multi-threading. Instead, I’ve written a library to provide crude multi-threading support.

Read the rest of this entry »

Feb
6
2010

Getting Started with Arduino Workshop

By » 5 Comments

Kwartzlab is hosting a getting started with Arduino workshop.

Fits in your hand

The Arduino is a micro controller that can read inputs such as push buttons, switches, sensors and control output devices such as motors, lights, buzzers and much more.

Some things you can do with the Arduino are:
infrared limit switches
hijack a remote control
analog needle gauge
reflective infrared detector
buzz a buzzer
twirly knobs, we call pots
drive an LCD
If you are wondering “can I do this with an Arduino?”, why don’t you ask us?

We will have computers with Arduinos already set up to demonstrate some of their many uses. If attendees wish to bring there laptops in we will help them get the software running.
There will be a $20 fee to cover cost of materials. We are getting some new boards in for the event for people to try out.

When: Saturday February 27, 1-4 PM

Where: Kwartzlab 283 Duke St. W, Unit 106, Kitchener, ON

Cost: $20

RSVP to events@kwartzlab.ca

Hosts: Andrew Mackie and Bevan Lantz



Read the rest of this entry »

Dec
12
2009

Remote debugging an Arduino

By » 1 Comment

I don’t have a fancy JTAG or ICE system for Arduino debugging. AVR simulators can only take you so far. So I’ve been working on creating a remote debugging stub, so you can use GDB (the GNU Debugger) and Insight (a graphical interface to GDB) on your PC to remotely debug code running on the Arduino board (or any AVR-based board.)

Read the rest of this entry »

Nov
19
2009

Arduino XBee communication

By » 2 Comments

This past week, i finally got 2 Arduinos (Arduini?) to communicate with the XBee shield. I wasn’t happy with the tutorials online, because these didn’t seem to tell you what you needed while at the same time included a lot of unnecessary info. Using ZNet 2.5 (Series 2) involves only one extra step.

The following parts were used:

Quantity Part Cost ea (CAD)
2 Arduino Duemilanove 33
2 Arduino XBee Shield v1.1 (includes XBee Series 2 module) 87
1 USB A B cable (salvaged) 0
1 Power adapter (salvaged) 0
Total 240

PFZ20-09781 Arduino with XBee shield


Basic Setup

The menu Tools –> Board –> Arduino Deumilanove w/ ATmega328 was selected.
The menu Tools –> Serial Post –> (appropriate port) was selected. Note the port needs to be selected each time a different Arduino is connected to USB. One automatically binds to COM3 and the other to COM4; there is most likely a setting somewhere to have these on the same COM port, but that would later preclude connecting both at the same time.


Testing the XBee

The shield and wireless module were assembled onto the Arduino. The jumpers on the XBee shield were put into the outward position. The Arduino was plugged into USB. The following sketch was uploaded:

Sketch: XBee_diagnostics

void setup()
{
    Serial.begin(9600);
}

void loop()
{
    Serial.println("+++");
    delay(2000);
    echo();
    Serial.println("ATID");
    echo();
}

void echo() {
    byte incomingByte;

    // see if there's incoming serial data:
    delay(50);
    while (Serial.available() > 0) {
        // read the oldest byte in the serial buffer:
        incomingByte = Serial.read();
        Serial.write(incomingByte);
        if(incomingByte != '\r') {
            Serial.write(' ');
        }
        delay(100);
    }
}

The Arduino was unplugged from USB, the jumpers switched to the inward position, then the serial monitor activated. The XBee should be responding with 234 as the ID (for Series 2).


Configuring

Use X-CTU to configure. Alternatively, any serial terminal will do. Note that the ATmega328 must be removed and the XBee shield pins placed in the outward position for this to work.

It may be preferred to configure the XBee module as part of a sketch and avoid removing the processor or finding a terminal program. The diagnostic sketch may be modified to with the following:

void loop()
{
    delay(2000);
    Serial.println("+++");
    delay(2000);
    echo();
    Serial.println("ATDL FFFF");
    echo();
    Serial.println("ATWR");
    echo();
    delay(10000);
}

After configuring, the Arduino was unplugged fro USB.


Transmitter

The jumpers on the XBee shield were put into the outward position. The Arduino was plugged into USB. The following sketch was uploaded:

Sketch: Send_physical_pixel

const int ledPin = 13;

void setup()
{
    Serial.begin(9600);
    pinMode(ledPin, OUTPUT);
}

void loop()
{
    digitalWrite(ledPin, HIGH);
    Serial.print('H');
    delay(1000);

    digitalWrite(ledPin, LOW);
    Serial.print('L');
    delay(1000);
}

The Arduino was unplugged from USB, the jumpers switched to the inward position. Then the Arduino was plugged into USB and the serial monitor activated. The serial monitor showed a string of HLHL… The LED was flashing at 0.5 Hz.

The Arduino was unplugged from USB, and the plugged this into the power adapter. The LED continued to flash at 0.5 Hz.


Receiver

Now for the second Arduino with XBee shield. The jumpers on the XBee shield were put into the outward position. The Arduino was plugged into USB and the following sketch Sketchbook –> Examples –> Communication –> PhysicalPixel was uploaded (unchanged).

The LED on the receiver is observed going on and off. However, not at regular 1 second intervals – the XBee sometimes groups the H and L sends together so these will be read at irregular intervals.


More Details

Note if you are in an area with ore XBee modules, then more configuration will be required to prevent all pairs from interfering with others.

Jumper meanings

When loading the Arduino while the XBee shield is attached, ensure the pins are in the USB position. Here’s a table of the explanation of jumper settings:

Position Meaning Connections Connections
Inward XBee Xbee.DOUT = Micro.RX = FTDI.TX Xbee.DIN = Micro.TX = FTDI.RX
Outward USB Xbee.DOUT = FTDI.RX Xbee.DIN = FTDI.TX

PFZ20-09787 XBee shield jumpers XBee

PFZ20-09786 XBee shield jumpers USB