profmason.com

November 27, 2007

39.2 Khz signal modulated at 1200baud for Robosapien

Filed under: PicAXE, Robotics — profmason @ 12:41 am

irtransmitter.jpgThis is a work in progress. (It now works!)

I setup the pwmout to provide close enough to 39.2 kHz and feed that into an AND gate. The other input of the AND gate is an output from the picaxe. I send T1200 signals out from the output and into the AND gate which results in a 39.2 Khz carrier modulated at 1200 baud. Great so far!

BUT! The Wowee protocol wants a header that looks like this %11111111 followed by a time spaced pattern where a high is 0001 and a low is 01. If I code up a typical pattern for say “Walk forward” or $86 it looks like %11111111,%000101010,%01010001,%00010100

It took me the longest time, but I think I know what isn’t working. Looking at the output on a scope there is a single low to high transition between each 8 bit transmission. This is messing up all my timing. I assume this is the “1 stop bit” in the 8n1. I don’t know where to go from here. Maybe if I sleep on it I will have some ideas in the morning. Otherwise, I will have to give up on the Picaxe for this project.

UPDATE:

After learning that the V2 protocal is 12 bits long, (From building a receiver and tying it to a scope) and getting an idea from Hippy on the Picaxe forum the project is now working. Here is the code

  • ‘RoboSapien IR control using picaxe 08M
    ‘Pass commands at 4800 baud 8N1 from your terminalsetfreq m8′IR is modulated by channel 1
    symbol IR = 1
    ‘This is a dummy variable to make pulsout work
    symbol dum = 4′These are values to make the timing work
    symbol duration = 88
    symbol start = 1203
    symbol highbit = 560
    ’start the pwm module
    pwmout 2,50,100
    main:
    low ir
    ‘refresh the pwm module
    pwmout 2,50,100
    pause 50
    ‘Get a value from the terminal
    serin 4,N2400,b0
    pause 10′Init and WAKEUP sequence
    high IR
    pulsout dum,start
    ‘RSV2 header is always 0011 0
    low IR
    pulsout dum,duration
    high IR
    pulsout dum,duration
    ‘This bit is low 0
    low IR
    pulsout dum,duration
    high IR
    pulsout dum,duration
    ‘This bit is high 1
    low IR
    pulsout dum,highbit
    high IR
    pulsout dum,duration
    ‘This bit is high 1
    low IR
    pulsout dum,highbit
    high IR
    pulsout dum,duration
    ‘END HEADER

    ‘logic

    if bit7 = 0 then
    gosub lowsignal
    else
    gosub highsignal
    endif
    if bit6 = 0 then
    gosub lowsignal
    else
    gosub highsignal
    endif
    if bit5 = 0 then
    gosub lowsignal
    else
    gosub highsignal
    endif
    if bit4 = 0 then
    gosub lowsignal
    else
    gosub highsignal
    endif
    if bit3 = 0 then
    gosub lowsignal
    else
    gosub highsignal
    endif
    if bit2 = 0 then
    gosub lowsignal
    else
    gosub highsignal
    endif
    if bit1 = 0 then
    gosub lowsignal
    else
    gosub highsignal
    endif
    if bit0 = 0 then
    goto finallowsignal
    else
    goto finalhighsignal
    endif

    goto main

    highsignal:
    ‘This bit is high 1
    low IR
    pulsout dum,highbit
    high IR
    return

    lowsignal:
    ‘This bit is low 0
    low IR
    pulsout dum,duration
    high IR
    return

    finalhighsignal:
    ‘This bit is high 1
    low IR
    pulsout dum,highbit
    high IR
    pulsout dum,2
    goto main

    finallowsignal:
    ‘This bit is low 0
    low IR
    pulsout dum,duration
    high IR
    pulsout dum,2
    goto main

A quick note on the IR transmitter stage. I adapted this from the robotroom. He has a nice writeup on using a 555 to drive a IR transmitter. However, the PicAxe pwmout gives a reasonable alternative.

irdriver.JPGdso.jpg

Finally just for fun I tried taking pictures of the oscilloscope screen with the digital camera. This is not of any particular signal, but it works better then I expected! I remember using a special adapter to take Polaroids of Oscope screens back in the day…..

Because this project was such a pain, I bought a new scope written about elsewhere. I love it! Here is a wowee signal on the new scope. Where was this a few weeks ago! Note that the 0011 header followed by the device command. In this case it is 10010000 This corresponds to the master program command (Or the D button on the remote)

woweeir.jpg

4 Comments »

  1. [...] completing the PicAXE based Robosapien control unit, I wanted to interface it to Roborealm.  Since the PC Robosapien interface I built just takes [...]

    Pingback by profmason.com » Controlling Robosapien from roborealm — November 29, 2007 @ 1:26 am

  2. [...] adapted the Robosapien Control unit by changing the IR header from 0011 to 0110.  I finally found a set of Roboquad IR commands at [...]

    Pingback by profmason.com » Voice Controlled RoboQuad — December 5, 2007 @ 12:24 am

  3. [...] both the RoboSapien and the Roboquad project, I used an IR transmitter consisting of a Picaxe driving an IR LED. The IR [...]

    Pingback by profmason.com » High Powered IR Transmitter — December 19, 2007 @ 4:56 pm

  4. [...] pulse stream. This should be a pretty straight forward adaption of the techniques I used in the Robosapien project. I am not sure if I need to encode the carrier or not? (It seems like the transmitter section might [...]

    Pingback by profmason.com » Decoding VExplorer Remote: — December 27, 2007 @ 12:15 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress