Video 22 Sep

Small update on the telemetry project.

Basically, the arduino takes some measurements from an ir sensor. Outputs it through the serial connection it has with the wireless router. A separate computer is connected to the router via ssh and has access to the serial output of the arduino.

Video 22 Sep

Got the serial communication half working.

The router sends startup info through the first serial port. I have the arduino reading it and outputing the information to the serial monitor.

Video 21 Sep

Well, got some parts today. One of them is a 16 x 2 Character LCD with LED Backlight.

I got that all wired up and runs smoothly with the example arduino sketch “Hello World”

I will be working on rewriting the code in C, hopefully it won’t take too long.

Text 20 Sep New project coming up…

I will be attempting to hack together a low cost data collecting telemetry system using an arduino, a wireless router (wrt54g v3) and a computer with a wireless card.

The idea behind this is to create a cost effect system that can capture data at relatively high speeds.

Because the system will be using two protocols, namely, IEEE 802.11 and USART I believe there will be a time delay between data sensor reading and data collection at the computer. Perhaps the delay is minuscule?

On this project I hope to learn more about programming the AVR chip in C, writing shell scripts for the router, programming a windows application in C++ for data collection and communication to the router and maybe if there is time have the router broadcast a web page which can output the data.

Right now I’m waiting on some parts that I ordered to be shipped.

The most anticipated component is the logic level convertor which allows the router and the arduino to talk to each other on the same level. <_<

The arduino’s digital out pins all work at 5V while the router was designed for up to 3.3V according to people online. I’ll verifying and find this out for myself with a multimeter once I get everything.

One step at a time..

While I’m waiting for the order to go through I’m reading Accelerated C++ Practical Programming by Example and an Ebook called linksys wrt54g ultimate hacking by syngress. Yeah, sounds corny but it’s got some good information like using a battery pack to power the router for projects and stuff. According to the author you can get a few days worth out of those spiffy lithium ion packs at the same weight as 8 AA batteries that will only last for maybe 4 hours..

Power/weight ratio yummy..

Text 22 Jul Final Project

Parts List:

1x Arduino Uno

12x 6-32 1.25” machine bolts & nuts

2x U bolts

6x General Purpose Snap Action Switch (S13-H)

2x Jameco ReliaPro DC Motors (25347)

2x H Bridge (LMD18200T)

4x 10nF Capacitors

4x 12k OHm resistor

2x 1200 uF Capacitors

9v Connection tab

8x Rechargeable batteries

Inspiration:

When people are lost they are predisposed to walk in circles after a long period of time. Is it because the human mind was programmed to turn right or left more often than the other?

What would happen if a robot were given instructions to react to a random obstacle, would there be a pattern behind its behavior in chaos that it would seemingly follow? 

Description:

This robot consisted of 2 layers. The first layer was the motor and motor mounts. The motors were driven by an H bridge via the arduino, in the second layer, which sent a pwm signal and a digital direction signal.

On the arduino, 6 relays were connected to a common ground and the positive end was connected to digital pins 2 through 7.

The robot was programmed to move forward until it activated one of the snap action switches and would then perform an action, such as moving out of the way of the obstacle or turning around. 

Through the repeated feats of bumping into an obstacle, turning around, and moving in a new direction the robot was suppose to trace a path that explored the room at random. With an LED attachment a long exposure picture could be taken to reveal a new perspective on visualizing the room.

Reflection:

The project was too technically sophisticated and was an unrealistic design in the given time constraint (total work time was two class days or about 20 man-hours). The bottleneck in the project was debugging the physical circuit. I would not know when it was working correctly or not but at times the system responded as predicted when a switch was activated.

Future Suggestions:

If I were to take the class again (which would give me more time to think about the mechatronics art and less about the industrial design of it) I would recommend building up to the final project after each minor project as my classmates did. At the beginning of each project you could use the code from the previous project and build on it.

My plan, which sort of failed depending on different perspectives, was to practice doing the labs and learning about every single piece of component that could be manipulated: solenoids, servos, dc motors, relays, LED’s. Then at the end I would decide on how I would put those things together to form a project. I feel like if the class was a full quarter rather than one term this plan would have worked. 

H-Bridge circuit diagram

Overview

Inner layer

Dual H bridge circuit

2 DC motors w/ Mounts


2 DC motors w/ Mounts

Code

#include <Bounce.h>

const int ledPin =  13;      // the number of the LED pin

int buttonState = 0;         // variable for reading the pushbutton status

Bounce bouncer2 = Bounce(2,5);

Bounce bouncer3 = Bounce(3,5);

Bounce bouncer4 = Bounce(4,5);

Bounce bouncer5 = Bounce(5,5);

Bounce bouncer6 = Bounce(6,5);

Bounce bouncer7 = Bounce(7,5);

int last = 0;

void setup() {  

  Serial.begin(9600);

  pinMode(ledPin, OUTPUT);      

  pinMode(2, INPUT);     

  pinMode(3, INPUT);     

  pinMode(4, INPUT);     

  pinMode(5, INPUT);     

  pinMode(6, INPUT);     

  pinMode(7, INPUT);     

  pinMode(10, OUTPUT);     

  pinMode(12, OUTPUT);     

}

void loop(){

    Serial.println("main loop");

    digitalWrite(10, HIGH); // Forwards

    digitalWrite(12, LOW);  // Forwards

    analogWrite(9, 255);    // Full

    analogWrite(11, 255);   // Full

    bouncer2.update();

    bouncer3.update();

    bouncer4.update();

    bouncer5.update();

    bouncer6.update();

    bouncer7.update();

    if(bouncer2.read() && last != 2){

        last = 2;

        Serial.println("pin 2 debounced");

        digitalWrite(10, LOW);

        analogWrite(11, 127);    

        analogWrite(9, 127);    

        delay(5000); 

    } 

    if(bouncer3.read() && last != 3){

        last = 3;

        Serial.println("pin 3 debounced");

        digitalWrite(12, HIGH);

        analogWrite(11, 127);    

        analogWrite(9, 127);       

        delay(5000); 

    }

    if(bouncer4.read() && last != 4){

        last = 4;

        Serial.println("pin 4 debounced");

        digitalWrite(10, LOW);

        analogWrite(9, 127);    

        analogWrite(11, 127);       

        delay(5000); 

    }

   if(bouncer5.read() && last != 5){

        last = 5;   

        Serial.println("pin 5 debounced");

        digitalWrite(12, HIGH);

        analogWrite(11, 127);    

        analogWrite(9, 127);       

        delay(5000);

    }

   if(bouncer6.read() && last != 6){

        last = 6;    

        Serial.println("pin 6 debounced");

        digitalWrite(10, LOW);

        analogWrite(11, 127);    

        analogWrite(9, 127);       

        delay(5000); 

  }  

}

Text 19 Jul Final Project Update 1

The robot will consist of:

(1) Arduino Uno board

(2) Jameco ReliaPro DC Motors P/N 253447

(3) 6 Snap action switches 

(4) Sandwich panels made of acrylic or polycarbonate

Progress today:

Note that at the time of the laser cutting we did not know what the material was and was unaware of its toxicity.

I remembered the smell a little later in the day and figured that it was PVC which is fairly toxic. I’ll be re-cutting a new sandwich tomorrow.

Here are the parts that I will make tomorrow:

Front Motor mount

Rear Motor mount

Bottom sandwich panel (bolts to arduino)

Text 14 Jul Final Project Proposal

DESCRIPTION

The project will be a demonstration of emergent behaviors through interaction with its environment. Given an input, its control law will self-regulate how it will respond with outputs. Because of the inherent random nature of the project’s input, what will come out of it will also be random but structured.

My proposal is a machine that explores its surroundings and avoids obstacles by locating the heading that has the clearest path once its current path is blocked. As it is exploring it will start chirping a periodic tone, as decisions are made the tone will be modified depending on what was last decided (left turn, right turn, length of travel). Furthermore, as the robot is exploring it will either be marking its path throughout the entire process through the medium of pen on paper or wheel paths on sand.

The essential goal of the project is to create an object that will respond to its environment and to visualize the emergent behavior in this process. The control law will strictly be a decision making tool and will not artificially insert “randomness” to the system.

Some long exposure photos of what roombas have done.

Text 14 Jul Project 3 A randomly regulating machine

DESCRIPTION

This machine was made with a stepper motor, ir range finder, and some computer fans.

A random torrent of air is suppose to propel an object through a cylindrical chamber.

The behavior of the air depends on random positions of the stepper motor valve and how close the viewer is to the IR range finder.

/////////////////////////////////////////////////////////// // Stepper Motor skecth for use with the EasyDriver v4.2 // /////////////////////////////////////////////////////////// ////// ED_v4 Step Mode Chart ////// // // // MS1 MS2 Resolution // // L L Full step (2 phase) // // H L Half step // // L H Quarter step // // H H Eighth step // // // //////////////////////////////////// int DIR = 3; // PIN 3 = DIR int STEP = 2; // PIN 2 = STEP int MS1 = 13; // PIN 13 = MS int MS2 = 9; // PIN 9 = MS2 int SLEEP = 12; // PIN 12 = SLP int PWM = 6; // PIN 6 = FAN CONTROLLER int pos = 400; // Current Position // Left open position (pos = 0) // Closed position (pos = 400) // Right open position (800) void setup() { Serial.begin(9600); // open the serial connection at 9600bps pinMode(DIR, OUTPUT); // set pin 3 to output pinMode(STEP, OUTPUT); // set pin 2 to output pinMode(MS1, OUTPUT); // set pin 13 to output pinMode(MS2, OUTPUT); // set pin 9 to output pinMode(SLEEP, OUTPUT); // set pin 12 to output pinMode(PWM, OUTPUT); // set pin 6 to output analogWrite(PWM, 255); } void loop(){ int modeType = 1;  

while (modeType<=8){ digitalWrite(MS1, 1); digitalWrite(MS2, 1); digitalWrite(SLEEP, HIGH); // Set the Sleep mode to AWAKE. int i = 0; // Set the counter variable. int next = random(100,700); int pow = analogRead(1); Serial.println(pow); if (next > pos){ digitalWrite(DIR, HIGH); // CCW = LOW CW = HIGH }else { digitalWrite(DIR, LOW); } int w = abs(next - pos); pos = next; while(i < w){ digitalWrite(STEP, LOW); // This LOW to HIGH change is what creates the.. digitalWrite(STEP, HIGH); // .."Rising Edge" so the easydriver knows to when to step. delayMicroseconds(200); // This delay time determines the speed of the stepper motor. i++; } delay(pow* 10); } }

Link 3 Jul Project 2 IR Sensor + Sweeping Servo»

DESCRIPTION

This project has an IR range finder attached to the top of a servo motor. The motor will sweep from 0 to 180 degrees and then back, only stopping when an object is within a set tolerance of the range finder.

NOTES

Open with arduino environment:

/*********************************************** David Li HW 3 dxarts 470 Servo IR sensor system sweeps from 0 to 180 when an object is 350 units away or more. The servo has a set direction. 0 or 180 degrees that it heads towards. It will move towards that heading whenever something is within threshold at set increments. ************************************************/ #include <Servo.h> #include <LiquidCrystal.h> //#define BAUDRATE 9600 #define IRPIN 0 //analog pin for reading the IR sensor #define WAIT 100 //milliseconds to delay int val = 0; // variable to store the value coming from the sensor int pos = 0; // variable to store the servo position int heading = 180; // variable to store heading int threshold = 300; // threshold value for distance to avoid Servo myservo; // create servo object to control a servo // a maximum of eight servo objects can be created LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { //Serial.begin(BAUDRATE); // For debugging purposes myservo.attach(9); // attaches the servo on pin 9 to the servo object lcd.begin(16, 2); // set up the LCD's number of columns and rows } void loop() { if (pos == 180){ // Swap heading when pos is at 180 heading = 0; } if (pos == 0){ // Swap heading when pos is at 0 heading = 180; } lcd.clear(); myservo.write(pos); // tell servo to go to position in variable 'pos' val = analogRead(IRPIN); // read the value from the sensor lcd.print(val); if (val > 450) { if (heading == 180){ pos += 10; } else { pos -= 10; } } //Serial.println(val); // print the raw analog value to serial port delay(WAIT); // stop the program for some time }

Link 27 Jun Project 1 Closed Loop Audio Feedback Source Code»

DESCRIPTION

The script will record sound clips at set intervals and plays them back through the computer’s speakers with slight modification though sound arithmetic. The sound clip is multiplied with a random sine wave mask.

While it plays it back another sound clip records on top of it which includes the previous clip. This process will repeat indefinitely until a complex indiscernible noise is created. 


Design crafted by Prashanth Kamalakanthan. Powered by Tumblr.