Internet of dusty things

Preview:

DESCRIPTION

Building Air Purifier and Pollution Sensors with the help of Ruby in Beijing. Talk was given at eurucamp 2014 in Berlin.

Citation preview

Internet of

Dusty Thingsby Daniel Bovensiepen

Building Metros

mruby core committer

<3 3D Printer

– Objective

“My kid is the youngest attendee @eurucamp 2014. I want him to be the oldest @eurucamp 2114.”

Airpocalypse

~2

Masksself-protection outside

Bad Air Good Air

MAGIC(TM)

Bad Air Good Air

MAGIC(TM)

airflow

1. Version

• Dual-use of dorm room fan

• HEPA filter (80RMB)

• Tape and cardboard

~7

–Dylos Serial reading

port = ARGV[0] logfile = ARGV[1] ser = SerialPort.new(port, 9600, 8, 1, SerialPort::NONE)   loop do line = '' loop do char = ser.getc # .. normalize line format .. sleep 0.1 end File.open(logfile, "a+") do |f| txt = "#{DateTime.now.strftime("%Y-%m-%d--%H-%M-%S")} #{line.strip}" f.puts txt end end

Dylos

Dylos

Dylos

expensive

–Cross Compile mruby configuration to ARM http://blog.mruby.sh/201305310507.html

–SHINYEI TECHNOLOGY Co., Ltd.

“Thank you for your inquiry of Shinyei Particle Sensor. We usually do not disclose the information you have inquired.”

expensive

–SAMYOUNG S&C Co., Ltd.

–SAMYOUNG S&C Co., Ltd.

–flank Algorithm

# .. mcu loop ..   if digitalRead(pin) == LOW unless was_low? # just changed to low; lets save the start start_low = millis was_low? = true end else if was_low? # Low pulse complete   # Calculate the duration of the low pulse duration = millis - start_low # Valid low pulses are only 10ms to 90ms long low_sum += duration if duration >= 10 && duration <= 90 not_low_anymore end end

–flank Algorithm

# .. mcu loop ..   if digitalRead(pin) == LOW unless was_low? # just changed to low; lets save the start start_low = millis was_low? = true end else if was_low? # Low pulse complete   # Calculate the duration of the low pulse duration = millis - start_low # Valid low pulses are only 10ms to 90ms long low_sum += duration if duration >= 10 && duration <= 90 not_low_anymore end end

Low Flank

High Flank

Dylos

DSM501a

Dylos

DSM501a

DIY Air Purifier

~17

airflow

airflow

airflow

under pressure

Potsdam Air Good Air

airflow

Beijing Air Good Air

airflow

–PWM based on low pulse ratio

# .. mcu loop ..   # acquire ratio (usually between 0% to 10%) ratio = lowpulseoccupancy_ratio(sensor_pin) # map 0-10% to full PWM range and # re-use this ratio as duty cycle analogWrite(fan_pin, 255 / 100 * ratio * 10)

2. Version

• using suction for air flow

• fan speed based on air quality

Internet of Dusty Things

• contains WIFI and ETH

• stable Linux support

• 4MB Flash

• 16MB RAM

mruby ARM

MIPS4k

Cross Compile

mruby ARM

MIPS4kmruby

Cross Compile

Cross Compile

http://blog.mruby.sh/201405051415.html

Port mruby to everything

mruby OpenWRTMIPS4k

i.e. PS3Cross Compile

Cross Compile

pack

Feature Wish ListCloud Storage of Pollution

Remote Control

Time Scheduler

Automatic Filter Exchange Notification

History Graph of PollutionSoftware Upgrade

3. Version

• remote control via wlan

• air sensing and filter check

• data graphing and collection

I see particles

Portable Counting

Sum-Up

Recommended