Shop OBEX P1 Docs P2 Docs Learn Events
Update on my sensor board project — Parallax Forums

Update on my sensor board project

SN96SN96 Posts: 318
edited 2007-01-25 15:34 in Robotics
Update on my sensor board that I did months ago:

I call it the RSCU board (Robotic Sensor Control Unit)

I have made several improvements to the original design such as add tilt sensing·as well as PING))) interface connectors. I have added·a speakjet for speech reproduction. the speech can be used as a sort of audio monitor that tells the user if the battery is low, the direction it's heading, or if an internal error has occured,·just a few examples.

My·board can:

See, hear, speak, all while ballancing using the tilt sensor. My goal was to create a board that had several of the human senses all on a single board to reduce wire clutter and to save space. I have not tried the tilt sensor but I designed the board so that it will be plug-and-play. The resistors needed for the· Parallax Memsic sensor is built in the board. You just plug the memsic sensor in the 6 pin soccket and load up the code and your good to go.

The audio sensor works well, although not perfect. It will respond to left and right sounds which was my goal. Soft sounds tend to go unnoticed, however, it would be annoying if it responded to every single sound wave in the environment. I responds well to door closeings (at the oposite end of the house) and dog barks in the same room as well as in another room.

Here is a picture of the Aluminum "skull" chassis:

lowlight2ha.jpglowlightfront9bo.jpg

Here is a photo of the board, complete, except it lacks a 6 pin socket for the tilt sensor.

rscusmalluj1.jpg

Here's a video demonstration. I screwed up with the left and right side in my code. I have corrected this by changing the speech code to reflect the proper "Right" and "Left" sides, so in the video, you will notice it says "Left" when it turns right, and "Right" when it turns left. Oh well... It's fixed now.

The Robot head is made out of solid aluminum fitted with two microphones and a 36mm mylar speaker as well as Parallax PING sensors desoldered from the board and reconnected using soft leads (wires).

Enjoy the video:

http://media.putfile.com/TorsoDemo


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike





Post Edited (SN96) : 1/13/2007 3:59:50 PM GMT

Comments

  • boeboyboeboy Posts: 301
    edited 2007-01-13 21:58
    That is AWESOME. How much did it cost to make?

    PS. If it is not to much trouble could you show the code and some wiring diagrams?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lets see what this does... KA BOOM (note to self do not cross red and black)
  • SN96SN96 Posts: 318
    edited 2007-01-13 23:35
    The board was about $60 total. Shipping cost·was a killer.

    I can post the code later, I'm about to leave right now. Thanks for the comment.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike



    ·
  • SN96SN96 Posts: 318
    edited 2007-01-17 14:41
    Here's the code. Sorry for the long delay. This code is a work-in-progress so it's a little rough around the edges. It has all the features except the tilt sensor portion that will be added later.
    ' =========================================================================
    '   -----------------------------------------------------------------------
    '
    '   File.......... ADC08x32.BS2
    '   Description... RSCU
    '   Author........ Mike Bookbinder
    '   E-mail........ [url=mailto:botwire@yahoo.com]botwire@yahoo.com[/url]
    '   Web........... [url=http://www.geocities.com/botwire]www.geocities.com/botwire[/url]
    '   Updated....... 1-14-06
    '
    '   {$STAMP BS2}
    '   {$PBASIC 2.5}
    '
    ' -----[noparse][[/noparse] Program Description ]---------------------------------------------
    '
    ' This program is modified code from the Parallax ADC0832.bs2 program example.
    ' I have modified this code to work with the RSCU (Robotic Sensor Control Unit).
    ' For the original code example, please visit [url=http://www.parallax.com/]www.parallax.com[/url] for more
    ' information.
    ' -----[noparse][[/noparse] Revision History ]------------------------------------------------
    '--------------------------------------------------------------------------
    '-----[noparse][[/noparse] Ping ]-------------------------------------------------------------
    Ping            PIN     15
     
     
    '--------------------------------------------------------------------------
    
    ' PA0             CON     0                       ' pauses
    PA1             CON     1
    PA2             CON     2
    PA3             CON     3
    PA4             CON     4
    PA5             CON     5
    PA6             CON     6
    Fast            CON     7
    Slow            CON     8
    Stress          CON     14
    Relax           CON     15
    _Wait           CON     16                      ' note underscore
    Soft            CON     18
    Volume          CON     20
    Speed           CON     21
    Pitch           CON     22
    Bend            CON     23
    PortCtr         CON     24
    Port            CON     25
    Repeat          CON     26
    CallPhr         CON     28
    GotoPhr         CON     29
    Delay           CON     30
    Reset           CON     31
    IY              CON     128
    IH              CON     129
    EY              CON     130
    EH              CON     131
    AY              CON     132
    AX              CON     133
    UX              CON     134
    OH              CON     135
    AW              CON     136
    OW              CON     137
    UH              CON     138
    UW              CON     139
    MM              CON     140
    NE              CON     141
    NO              CON     142
    NGE             CON     143
    NGO             CON     144
    LE              CON     145
    LO              CON     146
    WW              CON     147
    RR              CON     148
    IYRR            CON     149
    EYRR            CON     150
    AXRR            CON     151
    AWRR            CON     152
    OWRR            CON     153
    EYIY            CON     154
    OHIY            CON     155
    OWIY            CON     156
    OHIH            CON     157
    IYEH            CON     158
    EHLL            CON     159
    IYUW            CON     160
    AXUW            CON     161
    IHWW            CON     162
    AYWW            CON     163
    OWWW            CON     164
    JH              CON     165
    VV              CON     166
    ZZ              CON     167
    ZH              CON     168
    DH              CON     169
    BE              CON     170
    BO              CON     171
    EB              CON     172
    OB              CON     173
    DE              CON     174
    _DO             CON     175                     ' note underscore
    ED              CON     176
    OD              CON     177
    GE              CON     178
    GO              CON     179
    EG              CON     180
    OG              CON     181
    CH              CON     182
    HE              CON     183
    HO              CON     184
    WH              CON     185
    FF              CON     186
    SE              CON     187
    SO              CON     188
    SH              CON     189
    TH              CON     190
    TT              CON     191
    TU              CON     192
    TS              CON     193
    KE              CON     194
    KO              CON     195
    EK              CON     196
    OK              CON     197
    PE              CON     198
    PO              CON     199
    RO              CON     200
    R1              CON     201
    R2              CON     202
    R3              CON     203
    R4              CON     204
    R5              CON     205
    R6              CON     206
    R7              CON     207
    R8              CON     208
    R9              CON     209
    A0              CON     210
    A1              CON     211
    A2              CON     212
    A3              CON     213
    A4              CON     214
    A5              CON     215
    A6              CON     216
    A7              CON     217
    A8              CON     218
    A9              CON     219
    _B0             CON     220                     ' note underscore
    _B1             CON     221
    _B2             CON     222
    _B3             CON     223
    _B4             CON     224
    _B5             CON     225
    _B6             CON     226
    _B7             CON     227
    _B8             CON     228
    _B9             CON     229
    C0              CON     230
    C1              CON     231
    C2              CON     232
    C3              CON     233
    C4              CON     234
    C5              CON     235
    C6              CON     236
    C7              CON     237
    C8              CON     238
    C9              CON     239
    D0              CON     240                     ' DTMF tones
    D1              CON     241
    D2              CON     242
    D3              CON     243
    D4              CON     244
    D5              CON     245
    D6              CON     246
    D7              CON     247
    D8              CON     248
    D9              CON     249
    D10             CON     250
    D11             CON     251
    M0              CON     252                     ' sonar pin
    M1              CON     253                     ' pistol shot
    M2              CON     254                     ' WOW
    EOS             CON     255
    TX              PIN     9
    RDY             PIN     10
    phrase VAR Nib
    phrase = 6
    idx VAR Nib
     
    '------------------------------[noparse][[/noparse] SpeakJet Setup ]-------------------------------------
    'PAUSE 3000
    SEROUT 9,$0054,[noparse][[/noparse]"\0RX"] 'CLEAR BUFFER
    SEROUT TX\RDY,$0054,[noparse][[/noparse]020,127]' set volume to max
    SEROUT 9,$0054,[noparse][[/noparse]PITCH,85,BEND,4]
    ' -----[noparse][[/noparse] I/O Definitions ]-------------------------------------------------
    CS              PIN     15                      ' ADC0832.1
    Clk             PIN     14                      ' ADC0832.7
    Dio             PIN     13                      ' ADC0832.5 / ADC0832.6
     
    ' -----[noparse][[/noparse] Constants ]-------------------------------------------------------
    Dif             CON     %0                      ' differential
    Raw2mV          CON     $139B                   ' 19.6 mV per count
    
    ' -----[noparse][[/noparse] Variables ]-------------------------------------------------------
    sglDif          VAR     Bit                     ' adc mode (1 = SE)
    oddSign         VAR     Bit                     ' chan (Sgl), sign (Dif)
    adc             VAR     Byte(2)                 ' channel values
    mVolts          VAR     Word(2)                 ' millivolts
    RightEar        VAR     Word                    ' Right Electret Mic
    LeftEar         VAR     Word                    ' Left Electret Mic
    counter         VAR     Word                    ' Loop Counter
    ' -----[noparse][[/noparse] EEPROM Data ]-----------------------------------------------------
    
    ' -----[noparse][[/noparse] Initialization ]--------------------------------------------------
    'Reset:
      HIGH CS                                       ' deselect ADC
      DEBUG CLS,                                    ' Print display
            "ADC08x32",
            CRSRXY, 0, 9, "Differential", CR, CR,
            "  Ch0:", CR,
            "  Ch1:" ,CR
      DEBUG CRSRXY,0,5,                                   ' setup report screen
            "Parallax Ping Sonar  ", CR,
            "=====================", CR,
            "Time (uS).....       ", CR,
            "Inches........       ", CR,
            "Centimeters...       "
     
    ' -----[noparse][[/noparse] Main Program ]----------------------------------------------------
    
    Main:
    DO
        sglDif = Dif
        FOR oddSign = 0 TO 1
          GOSUB Read_0832
          mVolts(oddSign) = adc(oddSign) */ Raw2mV
          DEBUG CRSRXY, 7, (11 + oddSign),
            DEC3 adc(oddSign), TAB,
            DEC mVolts(oddSign) DIG 3, ".", DEC3 mVolts(oddSign)
             LeftEar = adc(0)  'Get value from Channel 0
             RightEar = adc(1)  'Get value from channel 1
          DEBUG HOME, CR, DEC3 RightEar 'Print value of CH1
          DEBUG CR, DEC3 LeftEar        'Print value of CH2
            IF RightEar > 15 THEN          'Threshold 5. If > then go to RightEarSub
              GOSUB RightEarSub
              DEBUG HOME, "RT Ear"
                    ELSEIF LeftEar > 20 THEN   'Else if this is > the set threshold, go to LeftEarSub
                         GOSUB LeftEarSub
                           DEBUG HOME, "LT Ear"
                           ELSE
                           DEBUG HOME, "                 "
    
            ENDIF
        NEXT
      LOOP
      END
    
    ' -----[noparse][[/noparse] Subroutines ]-----------------------------------------------------
    ' Reads ADC08x32
    Read_0832:                                      ' Read ADC Chip
      LOW CS
      ' send start, mode, channel
      SHIFTOUT Dio, Clk, MSBFIRST, [noparse][[/noparse]%1\1, sglDif\1, oddSign\1]
      ' read raw counts from ADC
      SHIFTIN  Dio, Clk, MSBPOST, [noparse][[/noparse]adc(oddSign)\8]
      HIGH CS
      RETURN
    LeftEarSub:
    LeftEar = 0
    SEROUT TX\RDY, $0054,[noparse][[/noparse]PA1,LE,EY,FF,FF,TU,PA6,SE,OHIH,DE,PA2]
    FOR counter = 1 TO 150 STEP 5
      PULSOUT 5,500
      PAUSE 20
    NEXT
    PAUSE 1000
    FOR counter = 1 TO 150 STEP 5
      PULSOUT 5,728
      PAUSE 20
    NEXT
    FOR counter = 1 TO 50
    GOSUB Read_0832
    NEXT
    
    RETURN
    
    RightEarSub:
    RightEar = 0                                 ' Move servo right
    SEROUT TX\RDY, $0054, [noparse][[/noparse]PA1,RR,RR,OHIH,TU,PA6,SE,OHIH,DE,PA2]
    'Hello
    'SEROUT TX\RDY, $0054,[noparse][[/noparse]HE,EH,LE,OWWW,PA2]
    FOR counter = 1 TO 150 STEP 5
      PULSOUT 5,1000
      PAUSE 20
    NEXT
    PAUSE 1000
    FOR counter = 1 TO 150 STEP 5
      PULSOUT 5,728
      PAUSE 20
    NEXT
    FOR counter = 1 TO 50
    GOSUB Read_0832
    NEXT
    RETURN
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike





    Post Edited (SN96) : 1/17/2007 2:49:03 PM GMT
  • WarrlokWarrlok Posts: 77
    edited 2007-01-21 15:52
    good job ,,,,i wont one. why was shipping so high ? did u have any spares?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Problems are the "roads" of life,
    solutions are only "onramps" to the next problem



    ············································· "Brad Smith"
    ·
  • boeboyboeboy Posts: 301
    edited 2007-01-25 15:34
    Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lets see what this does... KA BOOM (note to self do not cross red and black)
Sign In or Register to comment.