mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Mon May 04, 2015 3:43 am

Gents,

I have written the routine for the ultrasonic rangefinder, tied to PWM modulation of a vibration motor. I have verified the PWM output using piscope.

I ended up using a slightly different ultrasonic sensor than the one I originally ordered.

I ordered this one:

https://www.adafruit.com/products/172

I used this one (I had it onhand from my water level indicator) :

https://www.adafruit.com/products/983

I did this because the LVEZ1 does not put out ttl by default which is what the pi needs. I tried building the inversion circuit, but for whatever reason that didn't work. I didn't have the exact right transistor, but it was a signal level pnp, so it should have worked.
In any case, the one I used can be made to output ttl without building the inversion circuit.

Code: Select all

import time
import RPi.GPIO as GPIO
import serial

GPIO.setmode(GPIO.BOARD)  #setup for PWM
GPIO.setup(12, GPIO.OUT)   #Define pin 12 as output
p = GPIO.PWM(12, 25)  #channel = 12 , frequency = 25 hz
p.start(50) #50% duty cycle to start. should immediately change as the rangefinder reads

upperdistance = 5000 #distance from sensor to max distance
lowerdistance = 1000 # The distance to critical threshold indicating imminent collision


maxbotix = serial.Serial("/dev/ttyAMA0",baudrate=9600,timeout=5) # other examples that didnt specify baudrate and timeout did not work for me
while 1:
    maxbotix.flushInput() #clear buffer to get fresh values if you don't do this, you won't get responsive readings
    currdistance = maxbotix.readline(10) #Take ten characters worth of the serial buffer that accumulates since the flush
    stripstart = currdistance.find("R") #Look for the character "R", find out where it occurs in the string first
    stripend = stripstart + 5 #Define the end of the character length we need to grab the numeric info
    currdistance = currdistance[stripstart+1:stripend] #strip out the numeric info
    #print currdistance #comment this out after debugging
    currmm = float(currdistance) #Now make the info a number instead of a string
    # print currmm #comment this out after debugging
    percentmax = (upperdistance-(currmm-lowerdistance))/upperdistance*100 #calculate the percentage between 1000-5000mm to calculate duty cycle
    percentmax = int(percentmax) #convert to integer because rpi.gpio doesn't like duty cycle with more precision than 10ths of a percent. for this routine, precision of single percentages is fine
    if percentmax <0:
        p.ChangeFrequency(25) #The change frequency here is to revert from the near collision conditions when the frequency is changed to 1
        p.ChangeDutyCycle(10)#This should never occur based on the math, but lets check our random errors
    if percentmax > 100:
        p.ChangeFrequency(1) #percentmax >100 happens when currmm is less than 1000 This indicates imminent collision.
        p.ChangeDutyCycle(50)# Frequency and duty cycle are changed to an alert mode rather than feathering the vibration
    if percentmax <100:
        p.ChangeFrequency(25) #The changefrequency here is to revert from near collision conditions when the frequency is changed to 1
        p.ChangeDutyCycle(percentmax) #change duty cycle to percentage distance calculation
    #print percentmax #comment this out after debugging
I checked system usage of this routine, and it showed 0.7% cpu and 0.7% memory. So it should hum along in the background without impacting Ares' code.

I haven't tested it with the vibration motor, but with this complete, I just need to build the case and assemble things. Unfortunately, I also look like I'm stuck needing to put a power switch in as well.

Once I do the final assembly, I will put together an electrical schematic of the configuration and post here.

I'm about to enter a work cycle and will be somewhat sidelined for some time. Be assured that as time permits, I will continue to continue.

edit: For everyones reference, I have done some investigation into estimated power consumption.
The rpi 2 can be expected to consume 350 ma, the vibration motor up to 90 ma, and the rangefinder less than 5 ma. This means the battery will be good for only a few hours using a 1200 mah battery.

The bright side to all of this is that the recharging circuit can deliver 500ma. This means that the user can take the device out for a spin with the built in battery, or get an auxillary battery and go for a full day at a time easily.
Last edited by mikey11 on Mon May 04, 2015 7:32 pm, edited 2 times in total.

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Mon May 04, 2015 7:26 pm

As it appears that this project may well come to fruition, I'm just going to go through the basics behind of an order of 100 sets in two versions.

I will use USD (although this hurts me a lot if I go forward as my CAD's are hurting in the foreign exchange department lately)

1st version:

Raspberry pi 2: $35 each, $3500 @100 units (no bulk discount found)
2 gb micro SD: $5.99 each, $599 @ 100 units (no bulk discount found)
Camera module: $29.99 each, $2990 @ 100 units (no bulk discount found)
rotary encoder: $4.50, @ 50+ units $3.60, $360 @ 100 units
lipo charger board: $14.95, @ 100+ units $11.95, $1195 @ 100 units
lipo battery 1200 mAh (opting for a smaller battery due to costs): $9.95 each, $7.96 @ 100+, $796 @ 100 units
Power Switch: $1.88 each, @ 100 units $1.50, $150 @ 100

Unit price @ 100 units: $95.99

We can assume a few separate shipping charges associated with receiving will push the price to within a hair of the $100 mark.

This doesn't include the 3D printed case, which will add cost, but my hope would be that for an item like this, people could find a local maker to do it for them. For instance, where I live the public library runs 3 printers continuously for people, and the only cost is plastic by the gram. making the case cost just a few dollars.

This also doesn't include headphones, I will assume the user can supply those.

Version 2: The extended version of the first to include the rangefinder and vibration motor:

rangefinder (ttl built in model) $37.95 each, @100+ units $23.21 each, @100 units $2321
vibration motor $3.99 each, no bulk discount, $399 @ 100
Power Transistor for vibe motor: est $0.25, $25 @ 100 units
electrolytic cap for rangefinder power filter: est $0.25, $25 @ 100 units
resistor for rangefinder power filter: est $0.25, $25 @ 100 units

Version 2 cost: base cost $95.99 + $28.70 = $124.69

As the cost is only incremental to the total, if it came time to pull the trigger on ordering, I would strongly favour pursuing the second version. It sucks that it is over $100, but having a secondary set of information that helps indicate collision detection seems like a really good idea.

The major consideration that Pranav has brought up on numerous occasions is the camera cable/mount strategy. The ideal placement is near the eyes if I remember his objections correctly.

This subject deserves extended discussion, as there are many pro/con factors involved.

For instance, using the camera module, the default cable is short, and would require the camera and pi to be co-located.
You can order longer cables, but the flat ribbon type seem like a pretty big hassle at longer distances due to twisting and kinking.

One thought I had that I didn't totally dislike in this regard was to get a slightly longer flat ribbon cable (30cm) and mount the pi on the back of a hat, and have the camera module come to the front of the hat. It's not exactly right at the eye level, but it's close.

Second, mount the pi and camera module together on a chest strap. This places the camera much lower than the eye level, but avoids extra costs associated with cabling, and can definitely be built as an adjunct to the case itself easily. Pranav did not like this option.

There are a few methods to do an easier cable extension using round cables, but they either require small hdmi adaptors and an hdmi cable, (costs for adapter plus cables ran up to about $40 which is quite high in my opinion), or a build your own shielded cable which required desoldering the CSI adapter from the PI (I am 100% not interested in this).

Other things to consider are that with the rpi 2, that the processing bottlenecks that led to using the camera module might be irrelevant. If the USB system and a webcam can provide the result, then this opens doors in the design area, but it also opens pandoras box in the webcam driver implementation area.

If Pranav knows of a good usb webcam that is glasses mounted, this is a great place to start, but we would want to find something that would have a persistent supply chain, and not become obsoleted. Also, easy driver integration would be key. I once wanted to blow my brains out trying to do some kind of wrapper around a driver for the PI, and would want someone else to do the figuring out of this problem. Picking one webcam and sticking to it would be best. This has the potential to keep even with the overall cost as the camera module represents $29.99 of the total cost.

The nice thing about the webcams is that it solves the cable distance problem immediately, and renders camera placement more in the hands of the user. ie. They can figure out how to mount it near their eyes independent of the involvement of the rest of the product design.

I would appreciate input in this area, especially if people have been testing Ares code with usb cameras. Are you getting the 1/sec performance? can you speed it up to 0.5/sec without bogging the system? Has anyone gotten a head mounted USB camera to work with the code?

I have only been using the camera module so I can't answer these questions currently.

If the consensus is that the raspberry pi camera module is the wrong way to go, then lets figure out what it would mean to switch to a USB solution in terms of both performance, driver implementation, and quite importantly; economics.

Ares
Posts: 12
Joined: Sun Apr 19, 2015 7:57 pm

Re: Sight for the Blind for <100$

Mon May 04, 2015 9:17 pm

I have tested with some USB webcams, the performance drop seems to be noticable, but still reasonable, i.e. much less than 1 sec betweeen sounds.
There is still a lot of room for improvement software-side. Apparently the linux camera driver does not give the most recent camera image, but seems to cache them and delivers old images. Right now a workaround is that raspivoice can ask for several images and discard all except the last. Command line arguments --image_source=2 --read-frames=7 work reasonably well for the webcams I tested, but once in a while it still seems to be one image behind. Overall, it looks very usable though.

Thanks to the prize money I was also able to get some camera glasses that have a working linux webcam driver (Technaxx TX-25, http://www.amazon.co.uk/Technaxx-1080p- ... B00KUORH0M), but they are too expensive for this project and probably hard to obtain outside europe. Also, despite the price, hardware reliability seems to be a problem, i.e. sometime everything freezes. Otherwise, they do work with raspivoice.

In case someone finds cheap camera glasses (there are some around for ~$30 from china) that have a working windows driver, but no linux driver, I could try to reverse-engineer one... but bad hardware reliability might still render it unusable.

User avatar
seeingwithsound
Posts: 165
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Tue May 05, 2015 7:12 am

mikey11 wrote:I would appreciate input in this area, especially if people have been testing Ares code with usb cameras. Are you getting the 1/sec performance? can you speed it up to 0.5/sec without bogging the system?
Hi mikey11,

You can set the sample_freq_Hz to 22050 instead of the default 44100 to gain some speed with negligible loss of audio quality.
The Android version of The vOICe uses that too by default.

Regards,

Peter Meijer


The vOICe for Android
http://www.seeingwithsound.com/android.htm

User avatar
seeingwithsound
Posts: 165
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Tue May 05, 2015 7:20 am

Ares wrote:Thanks to the prize money I was also able to get some camera glasses that have a working linux webcam driver (Technaxx TX-25, http://www.amazon.co.uk/Technaxx-1080p- ... B00KUORH0M) [...] In case someone finds cheap camera glasses (there are some around for ~$30 from china) that have a working windows driver, but no linux driver, I could try to reverse-engineer one.
Hi Ares,

The Windows-based glasses that we have been using for the past few years with the Windows version of The vOICe are described on my web page USB Camera Glasses for the Blind. The wide-angle view is very nice, but I do not know of any Linux drivers for these glasses. Your Technaxx TX-25 sounds very interesting. Does it have a UVC compliant camera?

Regards,

Peter Meijer


Seeing with Sound - The vOICe
http://www.seeingwithsound.com

Ares
Posts: 12
Joined: Sun Apr 19, 2015 7:57 pm

Re: Sight for the Blind for <100$

Tue May 05, 2015 5:57 pm

Yes, the TX-25 camera is UVC compliant according to the raspberry pi operating system, and worked right out of the box (at least I do not remember having to install any drivers):
Bus 001 Device 006: ID 0603:8612 Novatek Microelectronics Corp.
uvcvideo: Found UVC 1.00 device USB PC Camera (0603:8612)
The $50 ebay camera glasses on your web page seem to have the same casing, but apparently have another video chip built in...

User avatar
seeingwithsound
Posts: 165
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Tue May 05, 2015 8:24 pm

Ares wrote:uvcvideo: Found UVC 1.00 device USB PC Camera
Amazing, I had searched high and low for UVC-compliant camera glasses, in my case for experimental use with Android devices, and indeed this manufacturer manages to hide its main selling point (UVC compliance) quite well. I just ordered a pair for testing purposes from Amazon in Germany at http://www.amazon.de/gp/product/B00KUOR ... B00KUORH0M

Thanks,

Peter


USB Camera Glasses for the Blind
http://www.seeingwithsound.com/camera_glasses.htm

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Wed May 06, 2015 1:01 am

The only thing is that I'm a little allergic to subbing a $30 camera module for $50 usb glasses. Especially as it breaks the $100 mark.

Of course, there is the chance that once working prototypes are put together, I may be able to use them to convince some of the parts suppliers of the possibility of further price reductions. for instance if the USB camera folks were willing to do $30 on volume of 100 or more, the problem would have already solved itself. :D

The major issue is that 100 units isn't enough to have a lot of pull in looking at reductions. You would need to be getting 1000 to have that kind of influence on price. Of course, 1000 units is pushing the total comittment over $100k. It's not that I'm afraid of the big value, but I'm a little concerned that I don't have enough personal connections to fundraise that much. I think with the connections I have now, I could probably fundraise enough for 100 units even if the price point ended up at the $125-150 mark. It doesn't have as nice of a ring to it as $100 though.

If people want to track down suppliers and post their info here, I will start laying the groundwork for trying to get price reductions on an order of 100.

I have already contacted maxbotix about their rangefinder, but they already heavily discount the bulk orders, so they didn't seem to have a lot of room. I'm waiting to hear back, as I pitched them a marginal additional reduction to their already discounted price.

At this time, I am trying to print existing cases to start case redesign to house all the components. Unfortunately, my printer is having issues with head clogging, so I haven't got a case done yet.

One thing that I forsee being part of a potential solution is another PCB that ties the components together better, and can host resistors, capacitors, and transistors required for the vibration motor and power filter for the rangefinder. It could also host connection pads for a power switch. I am envisioning something similar to some of the rpi gpio breakout boards, but one custom made for this project.

This will add to the cost, but I don't expect it to be very expensive.

In the meantime, I will make prototypes with a ratsnest of wires and hope for the best. I will probably use silicone to organize and hold wires as a temporary measure.

Coming nearer to completion also opens a host of issues that can't be avoided easily. The topmost being liability. I won't accept personal liability for these devices, and how they perform in the wild. While I do want this device to help people, there could be unforseen circumstances that cause malfunctions of all kinds. From the rangefinder sensor failing, to old video frames being interpreted as current, to exposure to moisture...

To that end, when money gets involved, I have a corporation set up already that could deal with the liability issue.

There would have to be a terms of use contract that the user agrees to. I imagine it would have to be read over the audio channel each time the device is turned on, and the rotary encoder would be used to click to agree with it.

Unfortunately I have had to consult lawyers far more than I wanted to in the past year for other reasons, so I have some in mind who could help me with that. I would have to focus on requirements for Canada and maybe the USA for practical reasons.

Peter, have you ever run into liability issues with your algorithm? How have you dealt with them?

Having witnessed a few previous kickstarter campaigns (and this doesn't have to be one), I have seen many of the liability issues solved by distributing all the components for the product as an electronics kit for assembly by the user. This avoids localization and standards requirements by placing the product at the status of hobbyist electronics. A much more 'free' area.

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Wed May 06, 2015 5:45 pm

I am currently playing with this model for a case:

http://www.thingiverse.com/thing:552193

I managed to get my print head unclogged, and got one done.

I find the mount columns are all just a little too large, and I had to shave sections off with a knife. I may also look at extending the size in the X and Z axis slightly to accomodate the power management board, battery, wires for the sensor and rotary encoder.

I really like the friction semicircles and holes used for closing the case lid. It fits really well, and the connection once in place is robust.

I am wanted to test the vibration motor, but will be unable to do so for a few weeks. I *should* be able to make a wearable voice device in the meantime though.

User avatar
seeingwithsound
Posts: 165
Joined: Sun Aug 28, 2011 6:07 am
Contact: Website

Re: Sight for the Blind for <100$

Wed May 06, 2015 6:41 pm

mikey11 wrote:Peter, have you ever run into liability issues with your algorithm? How have you dealt with them?
No. I do not provide hardware setups. Thus far blind people or their friends or relatives assemble their own mobile setups based on commercially widely available hardware. It is good that you seek legal advice on these matters. Be clear that you do not provide any cure or treatment for blindness, and include appropriate disclaimers and advisories.

Peter


Seeing with Sound - The vOICe Learning Edition
http://www.seeingwithsound.com/winvoice.htm

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Wed May 06, 2015 10:23 pm

Ares,

I have tried to use your update which includes the rotary encoder. I used the same pins as illustrated in the link you used in your message.

Unfortunately, rotating the knob does not appear to affect menu choices for me. Though on piscope, I do see the encoder pins lighting up.

I have used pin 18 for the pushbutton, though I see the pushbutton is currently commented out in the code.

Any thoughts?

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Wed May 06, 2015 10:54 pm

Also, some pictures for everyone:

http://imgur.com/JfniRAh

Piscope showing the activity of the GPIO working properly.

http://imgur.com/gallery/MUQe1o8/new

The valkyrie case was able to fit the camera module, rotary encoder, and rangefinder wires without issue. There was not enough room for the battery and charging circuit.

As it is, I can now walk around with a headless rpi running raspivoice. The rangefinder routine is also running with no noticeable impact.

Whats on the near horizon?

1. Getting the encoder and button to rotate through the menu (or if I've screwed up the configuration on my end I need to fix that)
2. Redoing the case model to accomodate the battery and charger circuit
3. integrate the vibration motor.
4. ensure case design allows for easy mounting of all components.

5. Get prototype out to a few people

6. Figure out the legal aspects of distributing kits. Get a terms of use disclaimer of liability created. Have that read on the audio channel on bootup. Make the rotary encoder click to acknowledge. (similar to when I start my GPS, I promise not to let it screw up my driving. Every time.)

The farther horizon:

1. Obtain consensus on steps to take to get devices created; Obviously numerous people have made contributions, and I would want to have addressed any concerns that may exist. ie. It's Peters code originally. Pranav is the authority in the usefulness of the end product design. Ares made everything work on the PI with the right speed, and contributed so much more (even if the kit design is limited, the software implementation is very open, enabling great diversity in hardware for the DIY crowd.). ghans gave some valuable guidance early on about exactly what could and could not work on the PI. I've put in some code here and there, and tried to push this forward. I would like everyone to be super excited about taking the dive to getting the combined efforts out there in the hands of people who can benefit.

From this point, the design would be finalized, and the willingness to proceed would be obtained from all parties.

From there, eventually, hopefully kits for under $100 or at least very near to that. In my mind anyways, and hopefully in yours.
:D

Ares
Posts: 12
Joined: Sun Apr 19, 2015 7:57 pm

Re: Sight for the Blind for <100$

Thu May 07, 2015 8:42 pm

Great to see this project coming along!

Regarding the rotary encoder:
It seems to be set to pins 4 and 5 in the code (in KeyboadInput.cpp L39, encoder = setupencoder(4, 5); ), you'll probably want to change that to 23, 24. So far I just implemented your code example and have not yet looked into the wiringPi API, that's why the push button function is still missing. Maybe that's just a one-liner where the comment is somewhere below that code line. I probably won't find time to look into this until next week, but should have the encoder for testing by that time so I can finish that.

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Thu May 07, 2015 8:48 pm

Cool, I will make those changes and recompile. Will also look into the button press.

I'm trying to learn geomagic in my evenings to redo the case design currently. I don't think the trial version will last long enough for me, as I learn 3d modeling quite slowly for some reason. Must be getting old or something.

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Sat May 09, 2015 2:53 am

Ares,

I made sure my pins were right (23,24 as defined by raspberry pi foundation, 4,5 as defined by wiringPi), and tried. I still get nothing, but the right pins have been activated, and I can see that using piscope.

so your code is activating the pins, and they are the right pins, but rotating the encoder is not advancing a menu, nor do I hear any espeak menu items being said.

PranavLal
Posts: 124
Joined: Fri Jun 28, 2013 4:49 pm

Re: Sight for the Blind for <100$

Mon May 11, 2015 1:36 am

Hi all,

Distributing a kit will work but the assembly should not involve soldering. Soldering is one of those things that blind people cannot do easily.

I wonder, would croud funding work for this kind of project?

The Technaxx TX-25 glasses look quite interesting and I'll see if I can order them in India but I have my doubts. The $100 is a good target but I do not believe we should hold back on the project if we cannot achieve this goal just yet. As for the battery, I am guessing that we can use battery packs that are used to charge mobile phones. The problem with those is detecting when the battery is about to die so that we can do a clean shutdown.

What about heat discipation? Outside temperature during the day here is about 37 degrees celcius. How much can the pi handle?

Headphones are very common items so they need not be supplied with the kit. In my experience, any blind person who uses any kind of electronic device that gives audio output does own headphones.

Pranav

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Mon May 11, 2015 11:12 pm

Pranav,

When it comes to funding, I intend to eventually use every approach available. From crowd funding sites to working through my personal connections.

I've been starting to put out the feelers, and will try to leverage all the relationships I have to ensure success. In the limited audience I have engaged thus far, the interest level seems high. People who are far more influential than me will help connect me to the right people. I feel very positive about this area. In my day-to-day life, I am involved in technical sales, and I am virtually certain I will be able to translate those skills to fundraising. Especially for such a worthy cause.

I will have to get in contact with lawyers to determine some details. I understand what you say about soldering being a task not for the blind, but I have to balance that against the liability issues of performing the soldering for people. In an ideal world, it would be modular pieces that plug into each other in an orientation that can't be screwed up. I don't know yet if this will be possible. I am looking into it.

Prior to that though, getting rock solid prototypes out is my main concern.

I am currently doing case design while the small details surrounding the rotary encoder and vibration motor are sorted out.

I have been using an online tool called tinkercad, and I am starting to get results from my efforts. I found most of the other programs too difficult to learn, and too feature rich.

I understand your concerns about temperature. The case design will likely need some ventilation holes, as I have noticed that the unit does warm up in my hand while running, and to a lesser extent while charging. This means it won't be waterproof at all. I can't imagine this will be a show stopper at this stage, and it could be looked at over time to solve this issue. My ambient temps these days are less than 20 degrees Celsius, I am jealous of your warm weather. I wish I lived there.

I am looking into the range. I find most articles quote -25 to +80.

I think you can access a temperature probe built into the broadcom SOC to monitor for the critical temperature.

I'm sure during the testing phases, I can have it writing the temperature to a file once/sec without causing grief.

PranavLal
Posts: 124
Joined: Fri Jun 28, 2013 4:49 pm

Re: Sight for the Blind for <100$

Mon May 11, 2015 11:50 pm

Hi Mikey11,

I appreciate your situation with respect to liability. Rock solid prototypes are indeed the way to go for now.

Monitoring temperature should not be all that difficult. We could run a cron job which would keep poling every minute and sound an alarm when necessary or have the vOICe check after every soundscape.

As for cameras, could we leave the choice to the user? I see all kinds of issues with extending the ribbon cable. USB may indeed be the way to go. In my testing, I did not have a significant performance drop when using USB but my measurements were not as objective as I would have liked them to be.

Pranav

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Tue May 12, 2015 12:17 am

Also, as for clean shutdown, the power regulator module I picked sends the low battery signal to the pi and cause a clean shutdown. It will just take one more GPIO pin

Ares
Posts: 12
Joined: Sun Apr 19, 2015 7:57 pm

Re: Sight for the Blind for <100$

Tue May 12, 2015 9:39 pm

I got my rotary encoder and connected it, apparently the original pin codes were right after all. I forgot about the reassignment done by wiringPi. In Software, I ended up with pins 4, 5 for the encoder and 6 for the push button function ("wiringPi pin"), corresponding to 23, 24 and 25 in hardware ("BCM GPIO") The second push button pin of the encoder needs to be connected to ground, which is conveniently located just in between pins 5 and 6. In total, I ended up with 5 cables connected to pin-header positions 14, 16, 18, 20, 22 in a nice row (see http://wiringpi.com/wp-content/uploads/2013/03/pins.pdf)
After updating from git, rebuilding and re-installing, the encoder function should work if you use command line options like this (plus additional input/output/setting options depending on hardware):

Code: Select all

sudo raspivoice --use_rotary_encoder --speak
So far, there is no visual feedback, but I guess that is not needed anyway. Also, I'm not happy with how the vOICe audio output interferes with espeak, right now you always need to wait for one additional vOICe run until any input is registered. Maybe we need to make the vOICe output pause for a second or so while there is any user input, in order to make the system react more sensibly.

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Tue May 12, 2015 9:56 pm

I can't wait to try this again. I am unfortunately separated from my equipment for a few days.

Assuming this checks out, it's time for me to make a module that hosts the encoder and rangefinder and components required for the vibration motor and rangefinder. I will probably need to host battery and power module connections on this board as well.

An ideal situation would be to map this board onto the rpi to the correct pins, thus making assembly much less error prone.

A thoughtful design for this board could eliminate many wires by joining the pin headers from the power module, rangefinder, and encoder.

The result would be a much more reliable final design.

PranavLal
Posts: 124
Joined: Fri Jun 28, 2013 4:49 pm

Re: Sight for the Blind for <100$

Wed May 13, 2015 12:49 am

<snip
Maybe we need to make the vOICe output pause for a second or so while there is any user input, in order to make the system react more sensibly.
PL] That should work. In terms of user experience, I do not want the vOICe sounding when I am making changes that need me to hear options. In terms of visual feedback, we may need it at some point for permitting sighted users troubleshooting and for demonstration.

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Sat May 16, 2015 12:58 am

Good news:

1. I have confirmed the operation of the rangefinder output on the vibration motor. It works great.
2. I have ordered the TX-25 glasses, but arrival is early-mid june for me (no north american suppliers). Pricey glasses, hope they are worth it.
3. I am working with my father on the integration board that ties the power module, rangefinder module, and associated components such as resistors, transistors, and diodes. He is much more well versed in the hardware selection and circuit planning, although I'm not too bad. This will be assembled as one unit that is similar to the arduino shields/pi plates.

Bad News:
1. Power down the Pi is annoying. I will solve this problem on a later revision of the unifying board.
2. The glasses cost me >95 Euro.


Ideas:

For powerdown, I would like the rotary encoder to detect a five second press and run a command line function to shutdown such as "sudo halt" or "sudo shutdown". Even though this doesn't turn the unit off, this could be coupled with a power switch to enable clean shutdowns by users.

For cost reasons: I propose three models. This lets users decide if the glasses are a priority or not.

1. Cheap Cheap: Rpi 2, Camera Module, Rotary encoder
2. Middle. Rpi 2, Camera Module, rotary encoder, rangefinder/vibration motor, power board, battery
3. Top end: Rpi 2, no camera module - TX 25 glasses instead, rotary encoder, rangefinder/vibration motor, power board, battery

If all goes well with the unifying board, I intend to have good prototypes ready shortly. I was planning on sending a couple out to Peter/Pranav. If you want one Ares, let me know. For these models, I know Peter and Ares have the glasses, so I would skip sending the camera module with those ones.

PranavLal
Posts: 124
Joined: Fri Jun 28, 2013 4:49 pm

Re: Sight for the Blind for <100$

Sat May 16, 2015 2:17 am

Hi Mikey11,
<snip 3. Top end: Rpi 2, no camera module - TX 25 glasses instead, rotary encoder, rangefinder/vibration motor, power board, battery
PL] I tried buying the glasses without success. I see them only in amazon Germany. I like the idea of the 3 packages. My question remains for options 1 and 2, how will the camera be mounted?

sudo shutdown -h now (I am writing this from memory)
should work. It should power down the pi without trouble.

mikey11
Posts: 355
Joined: Tue Jun 25, 2013 6:18 am
Location: canada
Contact: Website

Re: Sight for the Blind for <100$

Sat May 16, 2015 3:07 am

A little note for everyone who finds the output low on the audio jack:

Code: Select all

amixer  sset PCM,0 90%
Change the % to set the volume. As a Canadian, we prefer 110% :D

For options 1 and 2, the camera will be mounted inside the case in the center. I know this isn't ideal, but the case can be easily adapted to have a chest strap, and then the view at least comes from the upper center of mass. Making the unit removeable from the strap by velcro should be easy, and then the view can be more finely steered by hand.

I know this isn't what you had in mind, but until there are wide angle UVC compliant glasses for a more reasonable price...

I can always work on a 3D printed glasses mount for the camera module and look into longer cables as a sort of medium solution between the two that has minimal extra costs.

I got the audio menu going for the first time tonight. I notice it is not playing the voice sample during the menu items for me, so this appears fixed.

I believe I am just about ready to make an image file that will have the rangefinder/rotary encoder going automatically on bootup. One last thing to do before that is to look for the low battery signal from the power board. So I'm going to test that out a bit tonight.

Ares: If it pleases you, a request: When the user holds the rotary encoder pushbutton in for more than 5 seconds, a soft shutdown is initiated to halt the raspberry pi and park the file system.

With all of that in place, I am confident I can begin distributing the prototypes, and not have them die rapidly from hard shutdowns on power loss or low battery.

I can imagine that it would be annoying to have to reimage the SD cards on a regular basis.

Return to “Assistive technology and accessibility”