olfactory notifications

23
Olfactory notifications Carles Pina, [email protected], June 2012

Upload: carles-pina-estany

Post on 07-Jul-2015

2.229 views

Category:

Technology


0 download

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.

TRANSCRIPT

Page 1: Olfactory notifications

Olfactory notifications

Carles Pina, [email protected], June 2012

Page 2: Olfactory notifications

Traditional senses and notifications

Hearing

Page 3: Olfactory notifications

Traditional senses and notifications

Hearing

The oldest church bell in the world [...] dated to 1211-1216

http://en.wikipedia.org/wiki/Church_bell

Page 4: Olfactory notifications

Traditional senses and notifications

Hearing

Sight

Smell

today

Touch

Taste

(or a vibrator!)

Page 5: Olfactory notifications

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

Page 6: Olfactory notifications

More senses

Balance and acceleration

Temperature

Kinesthetic sense

Pain

Other internal senses

http://en.wikipedia.org/wiki/Sense

Page 7: Olfactory notifications

Some time ago...

Use smell to notificate about... new emails

Page 8: Olfactory notifications

How it could be done

Arduino?

Something to warm up a scent?

Fan?

What else?

Page 9: Olfactory notifications

Olly the robot

Page 10: Olfactory notifications

http://ollyfactory.com/

Page 11: Olfactory notifications

Not Olly

Olly is too big

Too nice

Needs a 3D printer

I bought:

Page 12: Olfactory notifications

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

Page 13: Olfactory notifications

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

Page 14: Olfactory notifications

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

Page 15: Olfactory notifications

Demo

Page 16: Olfactory notifications

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!! :-)

Page 17: Olfactory notifications

smell.pyUSB relay

controls relay (on/off)

+5V

IMAP(mail server)

check-mail.py

IMAPClient.py

USB ports

Page 18: Olfactory notifications

check-mail.py (1/3)

from imapclient import IMAPClient

import smell

WHITELIST = ['[email protected]', '[email protected]']

HOST = 'pinux.info'

USERNAME = 'carles'

PASSWORD = 'my_password'

Page 19: Olfactory notifications

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']

Page 20: Olfactory notifications

check-mail.py (3/3)

    while True:        server.idle()

Page 21: Olfactory notifications

smell.py

import osimport time

usb_dev = "/dev/ttyUSB0"

Page 22: Olfactory notifications

Demo

Page 23: Olfactory notifications

Questions?

?Information (slides, code, etc.):

http://pintant.cat/2012/06/02/olfactory-notifications/