Archive for January, 2010
Friday Night Robotics – MLK Day Preparations
Warning: This FNR does not contain any robots at all, but it’s still REALLY amazing!
A while ago I put my name on a list that wanted to help out with MLK day, 2010. I originally thought I would be doing a website, not really thinking about the intractability portion. When the Fall 2009 semester began, the group of us met, and ideas were tossed around. MLK Day in 2010 had to be different.
We came up with the idea of having a Twitter aspect of the performance. People would be able to tweet from laptops and then see it displayed on the screen! We are going to be using 5 laptops throughout the dinner, each with a different theme:
- Inspiration
- Dedication
- Culture
- Leadership
- Performance
When a person goes to send a tweet, this is what the webpage looks like:

It’s very user-friendly in the way that… once a person reads the theme and the question, they’ll understand to type in the box and press the button. I designed it to be simple, hopefully people will think it is simple too.
Being projected onto the display will be the Processing application that I’ve spent the better part of 4 months coding! :O It displays three twitter accounts at a time, and they are refreshed every 10 seconds and cycled upwards. The background changes very slowly over time as well, it’s almost not noticeable. Here is a screenshot:

The best part about this is… it will be open source… in about 1 month. I just need to take some time to document it before I release it to the wild. Since it wasn’t a project for grades, I didn’t comment it (I find comments get in the way), so I will have to do that. Hopefully people will pick it up and improve it, since there’s some parts in the code that it’s obvious that I had no idea what I was doing.
So that is the MLK Twitter portion of the dinner. I’m really amazed how well this is all going to work together, it will be a very special moment for sure. I had the privilege of seeing the performance being rehearsed, it is extraordinary! If it is going to be recorded, I will be sure to post a video.
I hope everyone has a wonderful MLK day! =)
Arduino to Matlab – Read in sensor data!
Matlab is by far the best software I have ever seen when it comes to plotting data and showing it in a visual format. I figured it would be awesome if I could get Arduino and Matlab to work together!
EDIT JULY 4, 2011: Apparently if you add
as the very first line, it handles the serial object deletion issue! WOOT!
Here’s the code that I came up with that works reasonably fast. It doesn’t wait for the buffer to be filled to then store it to a variable. Here, it is asynchronous communication. ^_^
This is a basic screenshot of what you will get, minus the green stars.
Here is the code. Let me know if you use, it would be neat to see what everyone would come up with!
*Note: The code highlighting for Matlab was buggy, so the below is using C code highlighting. Once you paste it into Matlab, it will be fine.
-
% Basic Arduino and Matlab
-
% Communication with an external hardware device
-
% ———————————————-
-
%
-
% Erin Kennedy
-
% Jan. 18, 2010
-
%
-
-
-
clear all; clc; close all;
-
-
-
% Try-catch is to prevent Matlab from crashing when the program is finished
-
try
-
-
-
% Initialize serial port
-
s = serial(‘/dev/tty.usbserial-A4001lVG’);
-
%set(s, ‘ Terminator’, ‘LF’); % Default terminator is \n
-
set(s,‘BaudRate’, 9600);
-
set(s,‘DataBits’, 8);
-
set(s,‘StopBits’, 1);
-
fopen(s);
-
s.ReadAsyncMode = ‘continuous’;
-
-
-
% Various variables
-
numberOfDatas = 50;
-
data = zeros(1, numberOfDatas);
-
i = 1;
-
-
-
% Main graph figure
-
figure(1);
-
hold on;
-
title(‘Incomming Data from External Device’);
-
xlabel(‘Data Number’);
-
ylabel(‘Analog Voltage (0-1023)’);
-
-
-
% Start asynchronous reading
-
readasync(s);
-
-
-
while(i<=numberOfDatas)
-
-
-
% Get the data from the serial object
-
data(i) = fscanf(s, ‘%d’);
-
-
% Plot the data
-
figure(1);
-
plot(i, data(i), ‘m*’);
-
-
% Ensure there are always 10 tick marks on the graph
-
if(i>10)
-
xlim([i-10 i]);
-
set(gca,‘xtick’,[i-10 i-9 i-8 i-7 i-6 i-5 i-4 i-3 i-2 i-1 i])
-
end
-
-
% Draw and flush
-
drawnow;
-
-
%Increment the counter
-
i=i+1;
-
-
-
end
-
-
-
% Give the external device some time…
-
pause(3);
-
-
return;
-
-
catch
-
-
% Some of these crash the program – it depends. The serial port is left
-
% open, which is not good.
-
stopasync(s);
-
fclose(s); % bad
-
%delete(s);
-
%clear s;
-
-
fprintf(1, ‘Sorry, you"re going to have to close out of Matlab to close the serial port\n‘);
-
-
return
-
-
end
The code for the Arduino is this:
-
//
-
// BubbleBoy -> Matlab
-
// ——————-
-
//
-
// Read LDR data, print them to Serial (where Matlab will receive them)
-
//
-
-
int LDRpin = 0;
-
-
void setup() {
-
-
Serial.begin(9600);
-
pinMode(LDRpin, INPUT);
-
-
}
-
-
void loop() {
-
-
int photocellReading = analogRead(LDRpin);
-
-
Serial.println(photocellReading, DEC);
-
delay(200);
-
-
}
Enjoy, happy matlabbing!
MANOI in 2010 and beyond +
2009 was a pretty good year in terms of getting MANOI to do stuff! I figured out how to make MANOI write, walk, and dance around and be on TV. I have a pretty good template for programming MANOI too, and it seems quite rugged. 2009 also gave me the chance to learn the limitations of this robot, that being the knee servos.
I was always under the impression that “great” humanoid robots can walk, run, and kick very well, basically being the best robots in RoboCup. MANOI will never be a RoboCup robot, since the knees are too weak and the stronger knees cost $300 a piece. I realized this a few months ago, admitting it is sort of harder
But, MANOI can be an interactive robot and do funny things… so in 2010, I’m going to focus more on the appearance and movements of MANOI. I want it so that the person interacting with MANOI can become attached to it, feeling that it exhibits an actual persona, instead of a programmed robot. I really feel that this was evident in MANOI’s Holiday Xtravaganza, but it still needs some improvements.
The first few steps would be to decorate MANOI’s head with two ears and two eyebrows. I’m considering antennae instead of eyebrows, because I don’t really want MANOI to come off as an uncanny human, but rather a friendly alien. I already have the two servos needed for the ears, so I’ll probably do those first.
Getting various sensor data will also be key in making MANOI more sociable. Currently there are three sensors on MANOI- the IR sensor, the gyro, and a LDR which is used for shaking hands. I’m thinking that those sensors alone are going to useful enough, for the time being.
It might be cool to have MANOI communicate back to a Mac so that the computer could produce audible results (like my Robbie the Robot science fair project).
There’s lots of possibilities out there, so this is pretty much a blog post of my scrambled thoughts.
2010 will be interesting, for sure!






