chiajiayiCassandra
Published © GPL3+

Sightline

Sightline is a smart walking stick meant to give the visually impaired more independence in their daily lives in a sustainable way.

BeginnerShowcase (no instructions)10 hours90
Sightline

Things used in this project

Hardware components

M5Stack FIRE IoT Development Kit (PSRAM 2.0)
M5Stack FIRE IoT Development Kit (PSRAM 2.0)
×2
Light Unit with Photo-resistance
M5Stack Light Unit with Photo-resistance
×1
ENV III Unit with Temperature Humidity Air Pressure Sensor (SHT30+QMP6988)
M5Stack ENV III Unit with Temperature Humidity Air Pressure Sensor (SHT30+QMP6988)
×1
Time-of-Flight (ToF) VL53L0X Laser Ranging Unit (MCP4725/)
M5Stack Time-of-Flight (ToF) VL53L0X Laser Ranging Unit (MCP4725/)
×1

Hand tools and fabrication machines

Tape, Clear
Tape, Clear
Tape the M5Stack on the cane/stick.
Tape, Double Sided
Tape, Double Sided
Tape the sensors on the M5Stack.

Story

Read more

Schematics

Main M5Stack - ToF

Secondary M5Stack - Light and ENVII

Code

sightline-main

Python
Sightline Main M5Stack: Using Time-of-Flight (ToF) Unit
from m5stack import *
from m5ui import *
from uiflow import *
import time
import unit

setScreenColor(0x222222)
# Edit tof name and port accordingly
tof_0 = unit.get(unit.TOF, unit.PORTA)


on = None
distances = None
intervals = None
distance = None
interval = None



label0 = M5TextBox(37, 50, "Distance", lcd.FONT_DejaVu56, 0xFFFFFF, rotate=0)
label1 = M5TextBox(53, 132, "Interval", lcd.FONT_DejaVu56, 0xFFFFFF, rotate=0)




on = 1
while on == 1:
  distance = tof_0.distance
  label0.setText(str(distance))
  interval = int((distance * 0.0002))
  label1.setText(str(interval))
  # if statements to determine interval length (can be done using lists as well)
  if distance > 140:
    interval = 1.5
  elif distance > 110:
      interval = 1.25
  elif distance > 90:
      interval = 1
  elif distance > 60:
      interval = 0.75
  else:
    interval = 0.5
  speaker.tone(220, 10)
  wait(interval)

sightline-secondary

Python
Sightline Secondary M5Stack: Using ENV II unit and Light Unit
from m5stack import *
from m5ui import *
from uiflow import *
import time
import unit

setScreenColor(0x000000)
light0 = unit.get(unit.LIGHT, unit.PORTB)
env2_0 = unit.get(unit.ENV2, unit.PORTA)


humidity = None







lcd.setBrightness(100)
setScreenColor(0x000000)
humidity = env2_0.humidity
while True:
  if humidity > 90:
    speaker.sing(392, 2)
    speaker.sing(330, 2)
    speaker.sing(392, 1)
    wait(0.1)
    speaker.sing(392, 1)
    speaker.sing(330, 2)
    speaker.sing(392, 1)
    wait(0.1)
    speaker.sing(392, 1)
    speaker.sing(330, 2)
    speaker.sing(448, 1)
    wait(0.1)
    speaker.sing(392, 1)
    wait(0.1)
    speaker.sing(392, 1)
    speaker.sing(330, 2)
    wait(1)
    break
  else:
    speaker.sing(587, 1/4)
    speaker.sing(784, 1/2)
    speaker.sing(932, 1/2)
    break
while True:
  if (light0.analogValue) < 400:
    rgb.setColorAll(0xffffff)
    setScreenColor(0xffffff)
  else:
    rgb.setColorAll(0x000000)
    setScreenColor(0x000000)
  wait_ms(2)

Credits

chiajiayi
1 project • 2 followers
Contact
Cassandra
1 project • 2 followers
Contact

Comments

Please log in or sign up to comment.