Sketching with Hardware

Day 2












GIF by Robin Davey, http://robindavey.co.uk/

Course Overview

1Monday Fundamentals, Keyboard Hacking, Experiments
2Tuesday Arduino, Project Topic
3Wednesday Brainstorming Day
4Thursday Own Project
5Friday Own Project
  Saturday
  Sunday
6Monday Own Project
7Tuesday Final Presentation, Wrap Up

Day 2

09:00 Arduino Introduction
10:00 Analog IO
11:00 Sketching Circuits
12:00 Break
13:00 More Sensors
14:00 Whatever you like
15:00 Introduction to our Topic
16:00 Brainstorming Ideas

"Hello, Computer!"

II



Quelle: UTEXAS

Arduino


Image Source: ArduinoArts

Arduino — Connected


Image Source: SirLeech

Arduino provides (some) power

Arduino provides (some) power

Arduino Basics

void setup() {
	// Execute these lines ONCE ON BOOT
}


void loop() {
	// Execute these lines ALL THE TIME
}

Serial Console

void setup() {
	Serial.begin(115200);
}

void loop() {
	Serial.println("Hello world!");
}

Digital Input/Output

Digital Output: LED

int LED_PIN = 12;

void setup() {
	pinMode(LED_PIN, OUTPUT);
}
void loop() {
	digitalWrite(LED_PIN, HIGH);
	delay(500);
	digitalWrite(LED_PIN, LOW);
	delay(500);
}

Digital Input: Button

int BUTTON_PIN = 2;
void setup() {
	Serial.begin(115200);
	pinMode(BUTTON_PIN, INPUT);	// Make pin an input
}
void loop() {
	int value = digitalRead(BUTTON_PIN);	// Read what's on that pin
	Serial.println(value);
}

Digital Input: Button

"It does not work!" ☹

→ Residual voltage keeps the pin HIGH!

→ We need to force it LOW somehow!

Digital Input: Pull Up/Down

Keep the Pin HIGH, drag it LOW with the button

int BUTTON_PIN = 2;
void setup() {
	Serial.begin(115200);
	pinMode(BUTTON_PIN, INPUT);	// Make pin an input
	digitalWrite(BUTTON_PIN, HIGH);	// Activate internal pull-up resistor
}
void loop() {
	int value = digitalRead(BUTTON_PIN);	// Read what's on that pin
	Serial.println(value);
}

Analog Input/Output

Arduino Analog Input

int potPin = A0;

void setup() {
	Serial.begin(115200);
}

void loop() {
	int value = analogRead(potPin);	// Read A0
	Serial.println(value);
}

Analog Output

PWM — Pulse Width Modulation

Analog Output

PWM — Pulse Width Modulation

Analog Output: RGB LED

photo credits © todbot.com

Pins: R G − − B B
GND = Cathode = −

Analog Output: Servo

  • PWM freq is 50 Hz (i.e. every 20 ms)
  • Pulse width ranges from 1 to 2 ms
  • 1 ms = full anti-clockwise position
  • 2 ms = full clockwise position

Analog Output: Servo

Analog Output: Servo

Servo Guide

Check out the Servo Guide (SwH 2017A)!

"Servos, Oida!"

Digital Output

High Load!

Digital Output

Transistor / MOSFET

Digital Output

Transistor / MOSFET

Digital Output

Transistor / MOSFET

Digital Output

Transistor / MOSFET



Tutorial: How to design a transistor circuit (Youtube)

More Sensors

  • Light
  • Temperature
  • Distance (Infra Red, Ultra Sonic)
  • Magnetic Sensors (Reed, Hall-Effect)

Actuators

  • Motors
  • Servos, Steppers
  • Speakers
  • Solenoids
  • LEDs (RGB)
  • Piezos

ICs and Shields

  • Motor Drivers (e.g. Pololu)
  • Displays (OLED, TFT etc.)
  • Sound Modules
  • WiFi Modules (e.g. ESP8266)
  • Bluetooth (e.g. HC05)

Topic ...

Topic:

Something Old,
Something New,
Something Powered,
Something Woo-hoo!







Tasks

  • Get hold of an old/obsolete object!
  • Give new life to it!
  • Make it interactive!
  • Connect it! (Phone, Bluetooth, Wifi, …)
  • Think Steampunk!




Some Inspiration

Enhance!

Re-Purpose!

Change Context!

Make Things Move!

Incorporate Toys!

Inspiration: Marble Machine

Components You May Use

  • Microcontroller: Arduino UNO/MEGA/MEGA ADK
  • Buttons, Sliders, Sensors
  • Motors, Servos, Speaker(s)
  • Smart phone, Bluetooth, WiFi, …

Recommended Search Terms

  • Upcycling
  • Arduino
  • DIY
  • Maker Scene
  • Internet of Things
  • "Shitty Robots" / "Internet of Sh!@#t"

Brainstorming!



















GIF by Robin Davey, http://robindavey.co.uk/

Brainstorming!




  • Project Name
  • Main Idea
  • Features
  • Sensors? Actuators?
  • Software? Complexity? Costs?
  • Plan B?


Raus an die frische Luft!

Image Source: Heinrich Kopp: Kinderreigen

Homework: Elaborate.


  • Present your final ideas tomorrow.
  • Don't forget to document everything!

End of Day 2