View
2.229
Download
0
Category
Preview:
DESCRIPTION
How to setup a system (a bit hacky :-) ) to switch a USB relay when there are new mails in order to have olfactory notifications.
Citation preview
Traditional senses and notifications
Hearing
Traditional senses and notifications
Hearing
The oldest church bell in the world [...] dated to 1211-1216
http://en.wikipedia.org/wiki/Church_bell
Traditional senses and notifications
Hearing
Sight
Smell
today
Touch
Taste
(or a vibrator!)
Previous research
Wasabi fire alarm scoops Ig Nobel prize for Japanese scientists
Friday 30 September 2011
http://www.guardian.co.uk/science/2011/sep/30/wasabi-fire-alarm-ig-nobel-prize
More senses
Balance and acceleration
Temperature
Kinesthetic sense
Pain
Other internal senses
http://en.wikipedia.org/wiki/Sense
Some time ago...
Use smell to notificate about... new emails
How it could be done
Arduino?
Something to warm up a scent?
Fan?
What else?
Olly the robot
Not Olly
Olly is too big
Too nice
Needs a 3D printer
I bought:
Problem
2 £ device
It's dumb. Cannot be controlled
(you can connect in the wrong way!)
I had to do something to switch on/off the device or the USB port
What it does? Just gets hot
Power off USB port
Hardware limitation on common controllers: not possible (some USB hubs could do...)
You can switch off the port, not power off
(USB memory sticks stops blinking, but still has 5 V)
See: http://marc.info/?l=linux-usb&m=127162615232234&w=2
I had the USB relay
2 years ago I bought and didn't use a USB relay
I “adapted” a USB cable (red cable is +5V)
Connected the USB relé and switch on and off using a small script:
stty -F /dev/ttyUSB0 9600
On: echo -e '\xff\x01\x01' > /dev/ttyUSB0
Off: echo -e '\xff\x01\x00' > /dev/ttyUSB0
Demo
IMAP checker
IMAPClient Python module
IDLE support:
Waits updates from the server, keeps an open TCP connection
If some email is in the whitelist:
smelling email!! :-)
smell.pyUSB relay
controls relay (on/off)
+5V
IMAP(mail server)
check-mail.py
IMAPClient.py
USB ports
check-mail.py (1/3)
from imapclient import IMAPClient
import smell
WHITELIST = ['friend1@gmail.com', 'friend2@gmail.com']
HOST = 'pinux.info'
USERNAME = 'carles'
PASSWORD = 'my_password'
check-mail.py (2/3)
def check_wait_imap():
server = IMAPClient(HOST, use_uid=True, ssl=ssl)
server.login(USERNAME, PASSWORD)
select_info = server.select_folder('INBOX')
print '%d messages in INBOX' % select_info['EXISTS']
check-mail.py (3/3)
while True: server.idle()
smell.py
import osimport time
usb_dev = "/dev/ttyUSB0"
Demo
Questions?
?Information (slides, code, etc.):
http://pintant.cat/2012/06/02/olfactory-notifications/
Recommended