Thursday, April 30, 2009

Architectural Robotics on Youtube

Here is the three projects that I have with (PAUL, APOORVA, IVAN) on Youtube:

ET movie on Youtube: http://www.youtube.com/watch?v=s1E3AtnlS5g
YOU on Youtube: http://www.youtube.com/watch?v=oh8m83druO8
ITOI on Youtube:http://www.youtube.com/watch?v=IxaOsKu9oBE
or http://www.youtube.com/watch?v=BHXOtuksy0k

Wednesday, April 29, 2009

mKare



ARCH 879/ECE 893 - Architectural Robotics

mKare: The Mobile Care Unit


Abstract:- The mKare is an interactive mobile unit which is built to aid the physically challenged people in their daily lives. mKare can be controlled by a Wii remote to move in all directions. The sides have arms that rise up to provide an extension whenever necessary, thereby giving more workspace and at the same time keeping the overall size of the table compact. mKare is equipped with a smart lighting system which turns on when there is insufficient ambient light. Overall the mKare is a user-friendly mobile assistant which suits the needs and requirements of the physically challenged people.

Scenario:- Nick Papageorgerio recently suffered from a stroke, and from this, lost his ability to move his left side of his body. After Nick recovered from the initial stage, the doctors dismissed him from the hospital, prescribed him medicine, as well as a new device called the mKare to help him at home. When Nick arrived home and his immediate family left him, he soon realized how important having an assistant would be, and realized why the doctor prescribed the mKare unit along with medicine. In the morning, Nick turned on his favorite television show and then proceeded to get his daily coffee. He soon realized that controlling the wheelchair and holding a cup of hot coffee with one hand would be impossible. Nick grabbed his control for his mKare and quickly controlled it to where he was located. He placed his coffee in the built in cup holder, and went back to the living room to watch television, and controlled the mKare to follow him. After his television show was over, Nick decided to write a letter to his grandkids, however, his new wheelchair did not allow him to use the furniture currently in his house. He quickly remembered his mKare unit and aligned his wheelchair sensors to the new unit, and a table end emerged from the personal care unit and Nick was able to slide under the table and finish writing his letter.

After a long day, Nick decided it was time for bed and headed for bed. When he got to bed, he grabbed his favorite book and began reading, but his arm was getting tired from holding the book. Nick grabbed his remote and again controlled mKare to his bedside, were he activated a sensor to open the side table so he could have a reading surface for bed. Once the arm was, mKare detected low light in the room, and automatically turned on additional lights inside the form.

After Nick finished reading and went to bed, he woke up in the middle of the night to loud thunder and flashes of lighting. The next loud boom turned off the power in the house, and to Nick’s delight, the mKare unit automatically detected the dark light condition, and turned its own lights on to help Nick see.

Images


mKare is standing by ready to be used.

mKare ‘s arms have been activated by the user. Both sides are capable of being used if needed.


The inside of mKare.


Hardware requirements

4 RC servomotors

Wii Remote

IR Led’s (1)

IR Receivers (2)

PhotoResistor (1)

Resistors (1Kohm-3)

LED’s (6)

3 Arduino Boards

Omni directional Wheels (2)

Laser Cut Cardboard

Lego parts.


Code for WII Control

#include

#include "nunchuck_funcs1.h"

int loop_cnt=0;

byte accx,accy,zbut,cbut;

int servoPin1 = 9;

int servoPin2 = 10;

void setup()

{

Serial.begin(19200);

nunchuck_setpowerpins();

nunchuck_init(); // send the initilization handshake

Serial.print("WiiChuckDemo ready\n");

pinMode(servoPin1,OUTPUT);

pinMode(servoPin2,OUTPUT);

}

void loop()

{

if( loop_cnt > 100 ) { // every 100 msecs get new data

loop_cnt = 0;

nunchuck_get_data();

accx = nunchuck_accelx(); // ranges from approx 70 – 182 in X direction

accy = nunchuck_accely(); // ranges from approx 65 – 173 in y direction

zbut = nunchuck_zbutton();

cbut = nunchuck_cbutton();

Serial.print("accx: "); Serial.print((byte)accx,DEC);

Serial.print("\taccy: "); Serial.print((byte)accy,DEC);

if(accy>=180){

int temp;

for (temp = 0; temp <=20; temp++)

{

digitalWrite(servoPin1,HIGH);

delayMicroseconds(1400);

digitalWrite(servoPin1,LOW);

delay(20);

}

}

if(accy<=100){

int temp;

for (temp = 0; temp <=20; temp++)

{

digitalWrite(servoPin1,HIGH);

delayMicroseconds(1600);

digitalWrite(servoPin1,LOW);

delay(20);

}

}

if(accx>=180){

int temp;

for (temp = 0; temp <=20; temp++)

{

digitalWrite(servoPin2,HIGH);

delayMicroseconds(1400);

digitalWrite(servoPin2,LOW);

delay(20);

}

}

if(accx<=80){

int temp;

for (temp = 0; temp <=20; temp++)

{

digitalWrite(servoPin2,HIGH);

delayMicroseconds(1600);

digitalWrite(servoPin2,LOW);

delay(20);

}

}

}

loop_cnt++;

delay(1);

}

Code for Side Arms of the table

#include

ServoTimer1 servo1;

ServoTimer1 servo2; // variable to store the servo position

int Action1 = 2;

int A1 = 0;

int Action2 = 4;

int A2 = 0;

int servopin1=9;

int servopin2=10;

void setup()

{

servo1.attach(servopin1) ; // attaches the servo on pin 9 to the servo object

servo2.attach(servopin2) ; // attaches the servo on pin 10 to the servo object

pinMode(Action1,INPUT);

pinMode(Action2,INPUT);

}

void loop()

{

A1 = digitalRead(Action1);

servo1.write(170);

if (A1==LOW) {

int pos=0;

for(pos = 0;pos<=90;pos++)

{ // in steps of 1 degree

servo1.write(pos); // tell servo to go to position in variable 'pos'

delay(100); // waits 200ms for the servo to reach the position

}

for(pos = 90; pos<=170; pos++)

{

servo1.write(pos);

delay(100);

}

}

A2 = digitalRead(Action2);

servo2.write(0);

if (A2==LOW) {

int pos = 0;

for(pos = 0;pos<=90;pos++)

{ // in steps of 1 degree

servo2.write(pos); // tell servo to go to position in variable 'pos'

delay(200); // waits 200 ms for the servo to reach the position

}

for(pos = 90; pos>=1; pos--)

{

servo2.write(pos);

delay(200);

}

}

}

Code for the Lights

int photoPin = 2; // select the input pin for the pHotoresistor

int ledPin1 = 11; // select the pin for the LED

int ledPin2 = 12;

int ledPin3 = 13;

int val = 0; // variable to store the value coming from the sensor

void setup() {

pinMode(ledPin1, OUTPUT);

pinMode(ledPin2, OUTPUT);

pinMode(ledPin3, OUTPUT); // declare the ledPin as an OUTPUT

Serial.begin (9600); // tells the Arduino to get ready to send data back to the computer

}

void loop() {

val = analogRead(photoPin); // read the value from the sensor

Serial.print ("Value = "); // report the text "Value = "

Serial.println (val);

if(val<=200){

digitalWrite(ledPin1, HIGH); // turn the ledPin on

digitalWrite(ledPin2, HIGH);

digitalWrite(ledPin3, HIGH);

} // stop the program for some time

else

{

digitalWrite(ledPin1, LOW); // turn the ledPine

digitalWrite(ledPin2, LOW);

digitalWrite(ledPin3, LOW);

//delay(val); // stop the program for some time

}

}

Problems Encountered

1) Balancing the weight of the table on only two wheels was a challenge as it compromised the smooth movements of the table. This problem can however be very easily solved if we used four wheels controlled by 4 RC servos.

2) Power supplied to the Arduino was not sufficient for the RC servos to lift the side arms to their fullest extent

Friday, April 24, 2009

Reminder

Hey,
While we're all basking in the glory of our final projects and still recovering from all the work put in to the class this semester, I just wanted to remind everyone that we are meeting this coming Wednesday at the regular time to tidy up the lab space we used.

There will be tour groups and visitors stopping by over the course of the semester and while having some level of chaos shows we're doing work, it's also not fun navigating through the stuff lying around.

See you all (hopefully) on Saturday.
-Apoorva

Thursday, April 23, 2009

Project CDs

Hi All.

I wanted to clarify the manner in which we are going to
submit the required CDs of our projects.

Some were saying that each individual would summit
a single CD with their three projects on it (thereby giving
Drs. Green and Walker 2 copies of each project).
Others mentioned 2 copies of a single disk with everyone's
work on it.

Dr. Walker, Dr. Green: what do you prefer?

Paul.

Wednesday, April 22, 2009

End of the semester cookout




Ok guys, as most of you know, I am defending my thesis tomorrow (Thursday), so I'd like to have all of you come to the Reserve, and eat something at the barbacue, play some pool, drink some beer...

I'm planning on doing it on Saturday since it seems to be the best day for everyone. 
The day is supposed to be beautiful, so bring your bathing suit, there are two pools there.

I'll be taking care of the food so I'd appreciate if each of you could bring some snacks, or drinks, beer or whatever you want.

I think 2pm is a good time to start. We don't want to get up early on Saturday. Especially after the last week of class.

Also, this might be the last opportunity to see some of you, since I will be going back to Spain soon after graduation.

I hope I'll see you all on saturday. It's gonna be fun ;)

PS: For those of you who don't know where the place is. It is called The Reserve at Clemson (where I live) and it's right after the grocery store Ingles, if you are coming from Clemson.
If you have any trouble finding it, give me a call 864-643-9536


Monday, April 20, 2009

Power Outlets/Power Strips for Final Presentation

We should take a count of how many outlets everyone will need so that we make sure we have enough outlets and power strips.

Apoorva/Joe
- 3 outlets - one ofr each arduino
- 2 outlets - one for each of our laptops

Ivan/Joe
- 2 outlets for NYC Particulate Localization model

Sunday, April 19, 2009

Invitation

Hi All,

I didn't get the invitation about our gallery in my email, could any one forward that to me. As I am trying to help to invite as many people as possible!

Tarek

Wednesday, April 15, 2009

Thanks

Hi Paul, Apoorva, and Ivan ,

I am happy to work with all of you guys in this class, especially those who respect my profession and work (Ivan and Paul) and also those who are not (Apoorva) I was happy working with you too!. I learned a lot from all of you guys and my hopes are to complete working together in the future.

Best,
Tarek

Tuesday, April 14, 2009

'ET' FREE PHOTOS DAY

Hi All,

It seems that you all like 'ET' to get you personal PHOTOS, okay that's fine!. But please prepare yourself emotionally and psychologically for tomorrow ET FREE PHOTOS DAY from 10am to 1pm.
ET is waiting for all of you tomorrow in Flour Daniel!.. Don't forget to get two free photos from ET before you leave the class....:)

Tarek, Paul and ET

Monday, April 13, 2009

Stepper Motor Notes

All,

Here are a few notes on use of the stepper motors.

1) When wiring the motors to the Motorshield, use the following
color order (at terminals left to right) for the wires:
Orange, Yellow, Red, Black, Brown.

2) These motors appear to be pretty weak. A few ideas to make
them stronger are (a) use DOUBLE stepping in your arduino code,
(b) reduce the friction seen by the motors in your model, and
(c) solder a second pair of L293D H-Bridge chips "piggy back"
onto the first pair - which doubles the current capacity. The
motors are still pretty weak, but these steps helped.

Paul.

Saturday, April 11, 2009

Final Architectural Robotics Presentation

All

This is a reminder to bring next class the material regarding our final presentation.
Have one group member burn a CD or bring on a jump drive with:

- Few of the Best JPEG Pictures of each project.
- Video of each project
- Word document with the project description.

Thanks

henrique

"ET" wants your photos


Hi all,
We have called our new project "ET": The Emotional-Together Robotic Room for people aging in place, ET has an important picture in his room!. ET wants all of you guys and teachers too to bring or send us two emotional photos for yourself that will be a part of that picture.

ET is still sleeping until Wednesday29,09, so please let him be happy by bringing these photos with you, or if you like ET team to get you a photo we are happy to do that in the next class on Wednesday (please wear the thing you like it to be in the picture and prepare yourself to get the emotional shot you like it to be (afraid, happy, sad, or angry)!:)))

here is a picture of what ET is expecting you to send:)
Tarek, Paul and ET

Sunday, April 5, 2009

Shelter in a Storm


Abstract:

This project presents a structure that is capable of morphing from a conventional building skin to a more aerodynamic shape that acts to dissipate the forces of high wind such as those that occur during a hurricane. A wind sensor detects the presence of wind gusts above a safe threshold. When such high wind is detected, the building self-adjusts two important components of its exterior surface: the parapet walls, and broad, flat wall surfaces. Each of these is flexed to project a curved (domed) surface toward oncoming wind. The curved surfaces act to dissipate the wind and thereby reduce the force on the underlying structure as has been shown to occur with domed buildings. After high winds have died down for a programmed period of time, the building reverts to its original, more conventional shape. Lighting is also used to outwardly express the current mode of the structure: yellow during times of normal (low) wind, and red during emergencies (high winds).



Scenario

The time before an impending hurricane making land fall in the city of Charleston, South Carolina had always been tense for its citizens. Many immediately take to the highways; seeking safety inland without knowing if they would have a home or business to return to. Many others, who would not travel due to infirmity, poverty, or misguided hubris, faced the even more worrisome specter of riding out the storm in the city.

Such was the case for Rhett and Scarlett Butler. As Rhett lay sedated in his second story room in the Hollings Cancer Center at the Medical College of South Carolina, Scarlett gazed with dread out her window at the now white capped waters of Charleston Harbor. As the winds increased, she saw the running lights of the building turn from amber to red indicating emergency status. She heard the gentle hum of motors slowly arching the building’s windward edges and face to deflect the fierce winds. She heard the outer panels lock into place as she watched emergency personnel guide people from the neighboring neighborhood into the building – a shelter in the storm.

Operation

A) Lights are amber during safe winds. Aerodynamic surfaces are relaxed to a conventional shape.



B) High winds are detected. The building building’s running lights change from yellow to red. Parapets morph to a aerodynamic convex shape.

C) An inflatable surface creates a convex protrusion to dissipate wind force on the flat faces of the building.


D) After winds abate, the structure returns to its original shape. The running lights turn back to amber.

List of Hardware:

• Arduino Duemilanove boards (2)
• Adafruit Motor/Stepper/Servo Shield for Arduino (1)
• Parallax servo motor (1)
• Model airplane propeller (1) (wind indicator)
• Fairchild QEC112 Infrared LED (1)
• Fairchild QSD122 Silicon Infrared Phototransistor (1) (propeller blade detector – See Figure 1)
• LEDs, Yellow (4)
• LEDs, Red (4)
• Pullup resistors (10 kΩ) (1)
• Pullup resistors (100 Ω) (9)
• Wiring
• Breadboard
• Lego Mindstorms components (for building mechanism and motor mount)
• Chipboard cutouts for outer skin
• Plastic for windows
• String



Source Code (Main Control Algorithm)

// -------------------------------------------------------
// Filename: ECE983_Proj2.txt
// Course: ECE893 - Architectural Robotics
// Team members: Adam James, Paul Yanik
//
// Description:
// This design activates aerodyamic building surfaces
// to move into place during hurricane force winds. The
// surfaces help to dissipate the wind energy so as to
// reduce the force experienced by the underlying structure;
// thereby reducing wind damage and debris.
// -------------------------------------------------------
#include
ServoTimer1 servo1;

// -------------------------------------------------------
// Pin Assignments and Variable Declarations
// -------------------------------------------------------
// Pin assignments
int servoPin1 = 10;
int propBlade = 14;
int resetButton = 15;
int highWindPin= 16;

// Variable Declarations
int loop_count = 0; // Count the number of loops during a time interval.
int blade_count = 0; // Count the number of blade passes during a time interval.
int last_reading = 0; // Last loop reading of the blade pass detector.
int curr_reading = 0; // Current loop reading of the blade pass detector.

int TIME_INTERVAL = 300; // Number of loops to execute while counting blade passes.
int SPEED_THOLD = 7; // Number of blade passes needed to determine high wind.
int high_wind = 0; // High wind indication variable.
int MAX_ANGLE = 90; // Angle to turn servo for actuation of surfaces.
int highWindPin = 0; // Indicator to second Arduino to actuate lighting

// -------------------------------------------------------
// IO Pin Setup
// -------------------------------------------------------
void setup()
{
servo1.attach(servoPin1);

pinMode(propBlade, INPUT);
pinMode(resetButton, INPUT);
pinMode(highWindPin, OUTPUT);

// Open a serial link for onscreen variable monitoring.
Serial.begin(9600);
}

// -------------------------------------------------------
// Loop for Runtime Operation
// -------------------------------------------------------
void loop()
{

// Indicate to second Arduino to turn on yellow (LEDs) - safe mode
digitalWrite(highWindPin, LOW);

// Watch for high wind until it is detected
while (high_wind == 0) {

// Read the sensor to see if the prop blade is present.
curr_reading = digitalRead(propBlade);



// Display the number of blade counts (for debug).
Serial.println(blade_count);

// Execute the loop TIME_INTERVAL times. Count the number of
// propeller blade passes that are detected during the interval.
if (loop_count < curr_reading ="=" last_reading ="=" loop_count =" 0;" blade_count =" 0;"> SPEED_THOLD) {
high_wind = 1;
blade_count = 0;
loop_count = 0;
digitalWrite(highWindPin, HIGH);
}

// Store the current reading as the last reading to compare
// with the blade pass detector on the next iteration. A blade
// pass has been detected whenever these two are different.
last_reading = curr_reading;
loop_count += 1;

// Serial.println(blade_count);

} // End while - high wind has been detected.


// Clear the high wind indication, wait for a new detection.
high_wind = 0;

// Activate the motors to move aero surfaces.
for (int r = MAX_ANGLE; r > 0; r--) {
servo1.write(r);
delay(40);
}

// Wait some amount of time before deactuating the surfaces.
delay(5000); // 5 seconds

// Deactuate the surfaces.
for (int r = 0; r <>
ServoTimer1 servo1;

// -------------------------------------------------------
// Pin Assignments and Variable Declarations
// -------------------------------------------------------
// Pin assignments
int highWindPin = 14;

int Red_ledPin1 = 13;
int Red_ledPin2 = 12;
int Red_ledPin3 = 11;
int Red_ledPin4 = 10;

int Yellow_ledPin1 = 7;
int Yellow_ledPin2 = 6;
int Yellow_ledPin3 = 5;
int Yellow_ledPin4 = 4;

int surfaces_actuated = 0;

// -------------------------------------------------------
// IO Pin Setup
// -------------------------------------------------------
void setup()
{
pinMode(highWindPin, INPUT);

pinMode(Red_ledPin1, OUTPUT);
pinMode(Red_ledPin2, OUTPUT);
pinMode(Red_ledPin3, OUTPUT);
pinMode(Red_ledPin4, OUTPUT);

pinMode(Yellow_ledPin1, OUTPUT);
pinMode(Yellow_ledPin2, OUTPUT);
pinMode(Yellow_ledPin3, OUTPUT);
pinMode(Yellow_ledPin4, OUTPUT);

// Open a serial link for onscreen variable monitoring.
Serial.begin(9600);
}

// -------------------------------------------------------
// Loop for Runtime Operation
// -------------------------------------------------------
void loop()
{
surfaces_actuated = digitalRead(highWindPin);

Serial.println(surfaces_actuated);

if (surfaces_actuated == 1) {
digitalWrite(Red_ledPin1, HIGH);
digitalWrite(Red_ledPin2, HIGH);
digitalWrite(Red_ledPin3, HIGH);
digitalWrite(Red_ledPin4, HIGH);
digitalWrite(Yellow_ledPin1, LOW);
digitalWrite(Yellow_ledPin2, LOW);
digitalWrite(Yellow_ledPin3, LOW);
digitalWrite(Yellow_ledPin4, LOW);
} else {
digitalWrite(Red_ledPin1, LOW);
digitalWrite(Red_ledPin2, LOW);
digitalWrite(Red_ledPin3, LOW);
digitalWrite(Red_ledPin4, LOW);
digitalWrite(Yellow_ledPin1, HIGH);
digitalWrite(Yellow_ledPin2, HIGH);
digitalWrite(Yellow_ledPin3, HIGH);
digitalWrite(Yellow_ledPin4, HIGH);
}

} // end
Discussion:

Examples in literature and qualitative simulations of curved structures under high wind show that these shapes effectively help dissipate the force of wind. Further, the structure need not be fully domed to take advantage of these benefits. Rounded surfaces on the crisp corners and flat surfaces of a building help to accomplish the same goals. Our building shows key instances of where this paradigm can be implemented: on the parapet walls and flat faces of a building. Given that one instance of our was an inflatable surface, an area of future work would be to explore possible materials for implementation of an inflatable surface.

Problems Encountered

A wind speed indicator was improvised using a propeller blade with sensors that detected the passing of a blade past a fixed point. The number of passes was counted to determine the spinning speed of the blade (which was used to reflect wind speed). The algorithm used to count blade passes was an effective and could be used generally as a sampling algorithm for any repetitive event.

A second Arduino board was used to control the lighting of the structure. An output from the first board was used as a signal for the lighting to change states. In order to accomplish this, it was necessary to unify the grounds between the two boards.

Future work on the general concept would include creation of curved surfaces that enclosed building corners at parapet walls. This shape posed a mechanical design challenge that was not addressed on this project. Also, the material that would be used to enclose the inflatable surface represents an unknown technology. Possible solutions include Kevlar fabric inflated with recyclable beads to produce a semi-rigid curved body. This concept could be extended to address the problem at building corners mentioned above.

Wednesday, April 1, 2009

Wii Nunchuck Demo code


This is the example I used to make the nunchuck work with Arduino.



Monday, March 30, 2009

International Trivia

Since this is International Awareness week, an International Trivia is being held at Mellow Mushroom on Thursday night at 8pm, so I was wondering if people are interested in forming an Architectural Robotics team.

Krishna and I could be the Indian specialists, Ivan the European expert, Henrique the South American guru, Tarek the Mid-East Master and Joe, Adam and Paul the token Americans.

Any takers? Feel free to ask others to join in, the more the merrier.
-Apoorva

Problem (possible) with new Arduinos

Hi All.

Here's a heads up to help you avoid a potential frustration...

It appears the new Arduino boards have a different microcontroller
from the ones we've all been using up to now.

To accommodate these (Atmega 328) microcontrollers, you must
download the latest version of the Arduino IDE software.
Then, set up your software by clicking:

Tools -> Board -> Duemilanove w/Atmega 328

I am assuming this pertains to all the new boards, although
I haven't checked each one. I examined two at random and both
had the new chip.

Best,
Paul.

Tuesday, March 24, 2009

Interactive Emergency System for Low Income Settlements

ARCH 879/ECE 893 - Architectural Robotics
Henrique Houayek
Krishna Teja

Interactive Emergency System for Low Income Settlements



Problem Statement


A recent Federal Census (IPP 2009) has estimated that today there are more than a thousand slums in Rio de Janeiro. These have spread rapidly in the past forty years and are now a constant part of this Brazilian city landscape. Despite their number they remain a marginalized part of the city with lack of important infrastructure and susceptible to emergency situations.




Design Proposition

To help improve the infrastructure of these spaces this group proposes the creation of a mobile interactive robot that could float around the slum in a cable, sensing diverse situations and reacting and communicating the population.

Emergency Situations would be communicated via color signals, these could be:


• At night: sense movement of the inhabitants, turn a light on and follow that specific person all the way to their house.

• Signal population if there is any police and criminal conflict.

• Possible fire

• Earth Slides/ Heavy Rain


• Health issues





Possible emergency situations







Robot would walk over cables suspended by poles in the area










(A) Yellow: Light to illuminate streets and pedestrians
(B) Green: Fire
(C) Blue: Conflict between police and criminal conflict
(D) Red: Heavy rain, Possible earth slides



Scenario


(A) It’s night in the neighborhood, Manuela needs to leave home to buy some medications in the pharmacy.

(B) While Manuela walks, the sensors embedded in the street sense her presence. This actuates the light and moves the robot in the direction of her movement.

(C) Every time Manuela walks, different sensors in the street sense and move the light according to her trajectory.


Diagram of parts




1- Sensor: transmitter/receiver
2- RC Servo motor connected to pulley

3- Suspended robot over two poles embedded with multiple lights


Possible scenario




Danger situation in the area, sensors embedded around the area would tell the robot that this could be a possible earth slide.
Robot senses the movement of people and sends a light signal: The space is dangerous to walk or the structure of the wood bridge can be damage.


Hardware used
:

Arduino Board RC-servos
(2)
IR Led’s
(3)
IR Receivers
(3)
Resistors (3-10k ohms, 3-100 ohms)
(2) Pulleys

Script

int servoPin1 = 9; int servoPin2 = 10; int Action1 = 2; // Action sensors (Digital Inputs 2-4) int Action2 = 3; int Action3 = 4; int Yellow = 12; int Action = 0; int A1 = 0; int A2 = 0; int A3 = 0; void setup() { pinMode(servoPin1,OUTPUT); pinMode(servoPin2,OUTPUT); pinMode(Yellow,OUTPUT); pinMode(Action1,INPUT); pinMode(Action2,INPUT); pinMode(Action3,INPUT); } void loop() { digitalWrite(Yellow,LOW); while (Action == 0) { A1 = digitalRead(Action1); //when motion is detected if (A1==HIGH) { Action = 1; } else { Action = 0; } } digitalWrite(Yellow,HIGH); //led turns on int temp; for (temp = 0; temp <=250; temp++) { digitalWrite(servoPin1,HIGH); delayMicroseconds(1600); digitalWrite(servoPin1,LOW); delayMicroseconds(20); digitalWrite(servoPin2,HIGH); delayMicroseconds(1600); digitalWrite(servoPin2,LOW); delayMicroseconds(20); } A2 = digitalRead(Action2); //when motion is detected if (A2==HIGH) { Action = 1; } else { Action = 0; } while (Action == 0) { A2 = digitalRead(Action2); if (A2==HIGH) { Action = 1; } else { Action = 0; } } for (temp = 0; temp <=250; temp++) { digitalWrite(servoPin1,HIGH); delayMicroseconds(1600); digitalWrite(servoPin1,LOW); delayMicroseconds(20); digitalWrite(servoPin2,HIGH); delayMicroseconds(1600); digitalWrite(servoPin2,LOW); delayMicroseconds(20); } A3 = digitalRead(Action3); if (A3==HIGH) { Action = 1; } else { Action = 0; } }

Problems encountered:


1) The number of sensors used was not enough to capture real time movement of pedestrians. 2) The cable used to support the movement of the robot was not rigid; better motion would been obtained by using different material for the string. 3) One Arduino board can only handle a limited number of inputs and outputs it was difficult to use more than 2 RC-servos which would have given a better directional control.