Diana Khalipina
Published © GPL3+

Inclusive Environment Monitor

Making room parameters - like temperature, luminosity, CO2 level and sound level - accessible for all by both showing and pronouncing values

IntermediateFull instructions provided1 hour449
Inclusive Environment Monitor

Things used in this project

Hardware components

BBC micro:bit board
BBC micro:bit board
×1
Grove Shield for micro:bit v2.0
Seeed Studio Grove Shield for micro:bit v2.0
×1
Grove - Temperature Sensor
Seeed Studio Grove - Temperature Sensor
×1
Grove - Light Sensor
Seeed Studio Grove - Light Sensor
×1
SGP30 gas sensor
×1
Grove sound sensor
×1

Software apps and online services

Vittascience - micro:bit programming interface

Story

Read more

Schematics

Micro:bit with the grove shield and the sensors

Code

Detailed code of the project_inclusive environment monitor

Python
from microbit import *
from sgp30 import SGP30
import speech
import utime
import math

sgp30 = SGP30()
# Temperature Sensor on pin0
# Light Sensor on pin1
# Sound Sensor on pin2

def getGroveTemperature(pin, unit='celsius'):
  R = 1023.0/(pin.read_analog()+1e-3) - 1
  t = 1/(math.log(R)/4250+1/298.15) - 273.15 # celsius
  if unit == 'fahrenheit':
    t = t * 9/5 + 32
  elif unit == 'kelvin':
    t += 273.15
  return round(t, 2)

while True:
  if button_a.is_pressed():
    display.show(sgp30.eCO2())
    speech.say('Carbon dioxyde', speed=100, pitch=300)
    utime.sleep(1)
    speech.say(str(sgp30.eCO2()), speed=100, pitch=300)
  if button_b.is_pressed():
    display.show(getGroveTemperature(pin0))
    speech.say('Temperature', speed=100, pitch=300)
    utime.sleep(1)
    speech.say(str(getGroveTemperature(pin0)), speed=100, pitch=300)
  if pin_logo.is_touched():
    display.show(pin1.read_analog())
    speech.say('Luminosity', speed=100, pitch=300)
    utime.sleep(1)
    speech.say(str(pin1.read_analog()), speed=100, pitch=300)
  if pin2.is_touched():
    display.show(pin2.read_analog())
    speech.say('Sound level', speed=100, pitch=300)
    utime.sleep(1)
    speech.say(str(pin2.read_analog()), speed=100, pitch=300)

Credits

Diana Khalipina
23 projects • 97 followers
Integrating Web Accessibility in Healthcare Tech | Web Developer & Bioengineering Specialist in Paris | MSc in Biomedical Engineering
Contact

Comments

Please log in or sign up to comment.