Day 12 of 12 Days of Arduino! On the 12th day of Arduino, I present our final project of the series: Glorious Spambot! I printed out some wheels , and fashioned some wheels out of bottle caps, and an axle out of a spray tube, a paperclip and a ballpoint pen. I found the wheel model on Thingiverse. There are a ton of wheels on Thingiverse that will work great, or if you don’t have a 3d printer, I’ve found that plastic bottle caps will do the trick!
Watch Spambot on his first official voyage:
#include
#define rxPin 0
#define txPin 1
int motor = 3;
int fan = 5;
int incomingByte[2];
boolean motorBool = false;
boolean fanBool = false;
SoftwareSerial bluetooth(rxPin, txPin);
void setup() {
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
pinMode (motor, OUTPUT);
pinMode (fan, OUTPUT);
bluetooth.begin(9600);
analogWrite (motor, 0);
analogWrite (fan, 0);
}
void loop() {
if(bluetooth.available()>0){
while(bluetooth.peek() == 'A'){
//bluetooth.println(bluetooth.peek());
bluetooth.read();
incomingByte[0] = bluetooth.parseInt();
bluetooth.println(incomingByte[0], DEC);
if(incomingByte[0] == 1){
motorBool = true;
bluetooth.print("motor:");
bluetooth.println(motorBool, DEC);
}
else if(incomingByte[0] == 0){
motorBool = false;
}
else if(incomingByte[0] == 2){
fanBool = true;
bluetooth.print("fan:");
bluetooth.println(fanBool, DEC);
}
else if(incomingByte[0] == 3){
fanBool = false;
}
}
while(bluetooth.available()>0){
bluetooth.read();
}
}
if(motorBool == true){
analogWrite (motor, 255);
//bluetooth.print("motor:");
// bluetooth.println(motorBool, DEC);
}
else{
analogWrite (motor, 0);
//bluetooth.print("motor:");
//bluetooth.println(motorBool, DEC);
}
if(fanBool == true){
analogWrite (fan, 255);
//bluetooth.print("fan:");
//bluetooth.println(fanBool, DEC);
}
else{
analogWrite (fan, 0);
//bluetooth.print("fan:");
//bluetooth.println(fanBool, DEC);
}
delay(1000);
}
The code hasn’t changed much from yesterday’s I just commented out some of the debugging stuff.
The mission of GloriousSpambot.org is simple, to create one or many useful, fully functional, open-source designs utilizing recycled and used parts and affordable components such as a Spam can, and to spread the word about it! Most robots on the market are for entertainment purposes, I want to see future iterations of Spambot that can
- Detect Smoke/Fight Fires
- Vacuum/Sweep/Dust
- Monitor Pets/Children
- Home Security
- Elderly Care
- Home Automation
- Companion, Helper and Friend!
That might seem like quite a leap from the current iteration of Spambot, but you all saw what Spambot was 5 days ago: a pile of scraps! The possibilities are endless. By next month, the plan is to have Spambot doing tasks on the PC including making friends on social networks, and playing video games!
That wraps up my 12 Days of Arduino series but the project will continue at www.GloriousSpamBot.org Make sure you check it out and like/subscribe for updates also follow on Twitter @GloriousSpamBot
If you want to help out with the project, Tweet a message to @GloriousSpamBot and you will get a reply. For now it will be me, but in the near future Spambot will be in the beginning stages of automation including communicating with humans!
Edit: it’s only been a little while since the announcement of Spambot, and already quite the following from around the world, over 1500 followers @GloriousSpamBot! Awesome! Thanks for the support everyone 😀 You can also help by clicking over to Youtube in the video above and liking/subscribing! Also thanks to @Nick Gammon for the link to the alternative TIP120 datasheet and @Due_Unto for the expert advice, @JohnLincoln for the link to transistor heatsink mounting kit
Also to help out make sure you use this link to order components from ICStation. All proceeds will go directly back into development!
Pingback: Kevin Gulling- 12 Days of Arduino Day 11 - Robot Drive and Controls