Arduino MetroPhones
The metropolitan in it's natural habitat; unaware, oblivious, purposefully deafened and subsequent prey. To increase perception thus safety, we wed an Arduino Nano and ultrasonic sensor to regulate volume to proximity to some one (thing) behind you; easily deactivated per environment (in-line slide switch) and rechargeable (3XCR2032). Beyond this proof of concept, intention for apparel or accessory (i.e. purse strap, back pack) embedding is ideal.


(Disclaimer) Vije Miller is NOT a metro-any-damn-thing!

This prototype of a prototype is a mono-version. A stereo version would merely require dual channels (pots). Aptly, imagine if you will, you plug your head phones in to your purse strap which is embedded with a Metrophone with bluetooth that streams to your smart phone...or or or you could PAY ATTENTION! Sorry not sorry.



Arduino Sketch McSketcherson
// MetroPhones
// Vije Miller

#include "SPI.h"

// Chip Select Pin
int csp = 10;

// Sensor Values
long dur, dis;
// Echo Pin
int echo = 4;
// Trigger Pin
int trig = 5;

// Position
int pos = 0;

// Centimeters
// Minimum Distance
int mindis = 0;
// Maximum Distance
int maxdis = 90; // 2.6FT

void setup() {

// Pot Com
SPI.begin();
pinMode(csp, OUTPUT);
// Set Chip Select LOW
digitalWrite(csp, LOW);

// Testing
Serial.begin (9600);

// Sensor Pins
pinMode(trig, OUTPUT);
pinMode(echo, INPUT);

}

void loop() {

// Poll Sensor
digitalWrite(trig, HIGH);
delay(10);
digitalWrite(trig, LOW);
dur = pulseIn(echo, HIGH);
// Convert to Centimeters
dis = dur / 58.2;

if (dis < maxdis) {
// Convert Distance to Pot (256 Steps)
pos = map(dis, mindis, maxdis, 0, 255);
// Alert Chip
SPI.transfer(0);
// Adjust Volume
SPI.transfer(pos);
} else if (dis > maxdis) {
pos = 255;
SPI.transfer(0);
SPI.transfer(pos);
}

// Testing
Serial.print(dis);
Serial.print(" ");
Serial.println(pos);

delay(100);
}

Archive
https://hackaday.io/project/11547-metrophones
https://blog.arduino.cc/2016/05/27/arduino-metrophones-will-help-keep-you-and-your-bag-safe/
http://hackaday.com/2016/05/31/hackaday-prize-entry-ears-on-the-back-of-your-head/

Add the HackADay Skull and Wrenches logo to your project...
https://hackaday.io/project/11709-hackaday-sketchup-logo

16:9:33 68-016

@pkvi
"...may not meet professional standards."
12,126 miters
0 miters today
202 tenons
Subscribe