Object avoidance talking (kinda) robot car

sbscott

Senior Member
I have been playing with object avoidance and line following for awhile. I was intrigued by the SPO-512 speech synthesizer chip. Converting text to phonemes is not as easy as I thought. The resulting "talking" bot needs some work but it has great potential!
I used an 18m2 as the controller and the L293 as the motor driver. The little guy has a bunch of sensors including a US-100 Ultrasonic Sensor Module for front/side objects, an IR sensor to detect dropoffs, and front whisker sensors for front/close-in objects. It speaks when it encounters objects or drop offs. I tried to make it as small as possible including stacking the two ckt boards.

It does a creditable job of "breaking out" of his little jail!

The YouTube is here
The code is simple:
Code:
#picaxe 18m2  'Robot  12-11-2012
setfreq m16
sound b.2, (80,15,100,15)
goto start

'b.0  -
'b.1  -  servo
'b.2 -   distance sensor
'b.3  -  sound
'b.4  -  wheel
'b.5  -  wheel
'b.6  -  wheel
'b.7  -  wheel

'c.0   dept sensor
'c.1 - led
'c.2 -  
'c.3   
'c.4 - 
'c.5 - 
'c.6 - left whisker
'c.7 - right whisker

goto start

rv:   high b.6:low b.7:high b.5:low b.4:return   ' reverse
frd:  low b.6:high b.7:low b.5:high b.4:return   ' forward
rt:   low b.6:high b.7:low b.4:high b.5:return   ' right turn
lt:   low b.7:high b.6:low b.5:high b.4:return   ' left turn
stp:  low b.6:low b.7 :low b.4: low b.5:return   ' stop

'---------------------------------------------------------
Start:debug
setfreq m4
readadc c.0,b4  ' check for drop
if b4>30 then gosub drop     '  chck for dropoff
if pinc.7=1 then gosub rturn  '  check for blockage
if pinc.6=1 then gosub lturn  '  check for blockage
readadc b.2,b5   ' check for front block
if b5>80 then gosub ck
gosub frd
goto Start
'----------------------------------------------------------

ck:   '  check for blockage
gosub stp
gosub scan
'gosub wtc
if b6>b7 then gosub rturn     ' determine witch way to turn
if b7>b6 then gosub lturn     ' determine witch way to turn
return

rturn:     ' right turn
gosub rrt
b6=0:b7=0
gosub rt
pause 4100
gosub stp
return

lturn:    ' left turn
gosub lff
b6=0:b7=0
gosub lt
pause 4100
gosub stp
return

scan:          '    scan for blockage in front
setfreq m4
servo b.1, 220    'head left
b10=0:for b9=1 to 5:readadc b.2, b6:b10=b10+b6:pause 10:next
b6=b10/5
pause 600
servo b.1, 141   ' head center
pause 600
servo b.1, 75   '  head right
b10=0:for b9=1 to 5:readadc b.2, b7:b10=b10+b7:pause 10:next
b7=b10/5
pause 600
servo b.1, 141    ' head center

return

drop:setfreq m4
gosub stp
gosub fal
gosub rv
pause 4000
gosub rt
pause 4800
return

'----------------------------------------------

lff:setfreq m16
high c.2:pause 10
SEROUT c.2,T9600_16,(13,13) 
SEROUT c.2,T9600_16,("[V4] [PA5,PA5,PA5] go [d3] [PA5,PA5,PA5] [V7][s3]leftt",13,13)
GOSUB waitspeak
return

rrt:setfreq m16
high c.2:pause 10
SEROUT c.2,T9600_16,(13,13) 
SEROUT c.2,T9600_16,("[V4] [PA5,PA5,PA5] go [d3] [PA5,PA5,PA5] [V7][s3]right",13,13)
GOSUB waitspeak
return

fal:setfreq m16
high c.2:pause 10
SEROUT c.2,T9600_16,(13,13) 
SEROUT c.2,T9600_16,("[V8] [S3] [E3]stop [PA5] [PA5,PA5,PA5,PA5] [S3] [E3] stop [PA5]",13,13)
'SEROUT c.2,T9600_16,("[S3] [E3][G3]iiiam  [S3] [d3][PA5,PA5,PA5,PA5]fallinggg [A2]"
GOSUB waitspeak
return

'what:
high c.2:pause 10
SEROUT c.2,T9600_16,(13,13) 
SEROUT c.2,T9600_16,("[V6] [S3] [E3]what [PA5,PA5,PA5,PA5] [C3]is  [PA5,PA5,PA5,PA5,PA5] thisssss ",13,13)
GOSUB waitspeak
return

'wtc:
high c.2:pause 10
SEROUT c.2,T9600_16,(13,13) 
SEROUT c.2,T9600_16,("[V6] which  [PA5,PA5] [s3]way  [PA5,PA5] do i [PA5,PA5,PA5] go ",13,13)
GOSUB waitspeak
return

'bak:
SEROUT c.2,T9600_16,(13,13) 
SEROUT c.2,T9600_16,("[V6] reeee  [PA5][S3] [plup] tttreeeattttt ",13,13)
return

waitspeak:
PAUSE 200
test:
IF input4=1 THEN test
RETURN
I would be interested in anyone who has had experience with this voice chip.
 
Last edited:

erco

Senior Member
Nice bot, sbscott! I have done some work with the RoboVoice chip. You may have seen my article bout it in SERVO magazine. Speech quality depends on many factors, speaker & housing, amplifier, etc. The TTS algorithms are good, but not perfect. Some creative spelling is in order sometimes! My latest use of RoboVoice is shown at http://www.youtube.com/watch?v=dZTfIyrRne0
 
Top