Introducing the “ijunk” – the junk mail iphone / ipod dock
“the best thing to happen to iphone since iphone 5”
When an iphone or ipod is docked it activates a junk mail delivery mechanisim. This was a really project with no apparent purpose but gave me the opportunity to use a physical imput to create a digital action in the ardino code and then return a physical output. The physical circuit uses a tip120 transistor which acts as a electronically controlled switch allowing the motor to draw power from an independent power supply. This is important as if the motor were to be connected directly to the arduino it could fry the arduino’s chip. The code i used was a version of the button example featured in the continue reading section of this post. Ideally if I had more time I would have better integrated the iPhone charging into the arduino and have it actually recognized when it was being docked, rather than just using the phones casing to connect the circuit via contacts.
Some of the tutorials and useful sites I found and used are here:
- http://hacknmod.com/hack/arduino-based-snail-mail-alert-for-your-smartphone/
- https://www.paperkarma.com/
- http://j4mie.org/blog/how-to-make-a-physical-gmail-notifier/
- http://bildr.org/2011/03/high-power-control-with-arduino-and-tip120/
Junk Mail Phone Dock from Richard Clarkson on Vimeo.
Code:
/*
Button
Turns on and off a light emitting diode(LED) connected to digital
pin 13, when pressing a pushbutton attached to pin 2.
The circuit:
* LED attached from pin 13 to ground
* pushbutton attached to pin 2 from +5V
* 10K resistor attached to pin 2 from ground
* Note: on most Arduinos there is already an LED on the board
attached to pin 13.
created 2005
by DojoDave <http://www.0j0.org>
modified 30 Aug 2011
by Tom Igoe
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/Button
*/
// constants won’t change. They’re used here to
// set pin numbers:
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}
I like the disclaimer on the bottom of the ad. Ha.