Jump to content


Lego PF IR Protocols


7 replies to this topic

#1 Rob Klingberg

Rob Klingberg

    Posts: 56
    Joined: 09-October 10
    Member: 13681
    Country: USA

Posted 06 January 2011 - 07:25 PM

Hello all--

Has anyone decoded (or has Lego released) the protocol that governs communication between a PF remote and a PF receiver via Infrared?  I'd like to make my own automated controller (driven by Arduino or some such) with just an IR LED soldered to the board (not using the PF remote at all) and have this device be able to control up to 4 trains (as PF remotes can).

Just checking to see if anyone has the code.....

Thanks!

--Rob

#2 Lemelisk

Lemelisk

    Posts: 17
    Joined: 05-January 11
    Member: 15174

Posted 06 January 2011 - 08:11 PM

I believe the information you are looking for is here.

#3 JopieK

JopieK

  • Kneecap Buster


    Posts: 1493
    Joined: 04-January 07
    Member: 1180
    Country: Netherlands

Posted 06 January 2011 - 09:29 PM

View PostLemelisk, on 06 January 2011 - 08:11 PM, said:

I believe the information you are looking for is here.

I have both the sketches for a remote and the receiver.

http://www.leguano.n...TrainSelect.zip
An other demo zip with sketch
http://www.leguano.n...EGO_PF_Demo.zip
Train Selector (hack for remote turnouts).


A bit more structured: moodle

I have also created my own LEGuanO (Arduino + LEGO) print (produced in China). I run one train with it (at this moment), operate a level crossing and several points and signals with them.


See also:
Brickshelf


And my previous topic: here

Posted Image

-== Classic LEGO trains are the best ==-

Do you need replacement stickers for LEGO (reproductions and customs): ministickers.nl

What then about the LEGuanO?!


#4 Toastie

Toastie

  • Good Spirited


    Posts: 294
    Joined: 27-July 10
    Member: 12260
    Country: Germany

Posted 07 January 2011 - 12:22 AM

View PostJopieK, on 06 January 2011 - 09:29 PM, said:

I have both the sketches for a remote and the receiver ...


Hi JopieK,

as far as I am concerned, we need to arrange all your wonderful(!) input and other "stuff" into a way more organized manner. We have sort of discussed the Arduino approach before here at EB, but the whole thing got more or less "swamped" (Teddy's well articulated terminology) by other interesting(!) forum entries. Is there any way that we can focus this whole thing a little? I'd be very happy to try out your ideas, I just don't know how to get a hands-on instruction (My world is restricted so far to Microchip's PICs and then NXT, Scout, Spybot, and RCX micro controllers - lets call them  PBricks).

Also, I guess I am pretty familiar with the PF protocol; but we need a "focused place" to discuss these issues, don't you agree?

I guess Teddy, you are with me?

All the best,
Thorsten

#5 peterab

peterab

  • Whacking witch hunter


    Posts: 1132
    Joined: 03-August 09
    Member: 6893
    Country: Australia

Posted 07 January 2011 - 04:38 AM

I just noticed an article on Railbricks. It seem to imply we would be able to control both RC and PF trains with this new 'sensor' brick.

#6 Rob Klingberg

Rob Klingberg

    Posts: 56
    Joined: 09-October 10
    Member: 13681
    Country: USA

Posted 07 January 2011 - 05:08 AM

Thanks all for the great pointers-- I had a feeling this group would be "in the know" as usual.  :grin:

And Jopiek, it was your original topic that got me interested in the Arduino platform-- I have two Mini Pro boards on the way from SparkFun and can't wait to get started.  (One problem-- I can't seem to get into your Moodle site-- I registered but it says I can't enroll myself in the course.....    :blush: )

I agree there is value to creating an area to discuss PF automation in greater detail-- perhaps a pinned topic?

I saw the BL article on coming NXT/PF control as well-- it looks interesting but I have never gotten into the NXT platform (though I did get the RCX 1.0 set back in 1999) and am going to approach things from the standalone (embedded) Arduino board approach and/or Arduino integrated with Zigbee WiFi boards or USB controlled by a PC vs. getting into the Scout, RCX, etc. modules.  When you can pick up an Arduino Mini Pro board for $18, that's hard to beat!  Prices for Scout, NXT, etc. on BrickLink are too high to justify populating a layout and stations/signals with them.  Just my preference tho.  I hope to have some cool 12v and 9v automation projects to share with this forum soon.  And once I get the train detection circuit down (I found a really cheap and great-looking integrated IR detector/transmitter on SparkFun) I look forward to providing real-time control of RC trains as well.  A guy can dream, right!?

Thanks everyone for the tips, and Jopiek if you can give any pointers on getting into the Moodle site, that would rock.

Thanks!

--Rob

#7 JopieK

JopieK

  • Kneecap Buster


    Posts: 1493
    Joined: 04-January 07
    Member: 1180
    Country: Netherlands

Posted 07 January 2011 - 10:48 AM

I'll have a look at it :) I installed moodle just yesterday so the settings aren't optimal yet.

Posted Image

-== Classic LEGO trains are the best ==-

Do you need replacement stickers for LEGO (reproductions and customs): ministickers.nl

What then about the LEGuanO?!


#8 Toastie

Toastie

  • Good Spirited


    Posts: 294
    Joined: 27-July 10
    Member: 12260
    Country: Germany

Posted 07 January 2011 - 06:43 PM

View PostRob Klingberg, on 07 January 2011 - 05:08 AM, said:

Thanks all for the great pointers-- I had a feeling this group would be "in the know" as usual.  :grin:

I agree there is value to creating an area to discuss PF automation in greater detail-- perhaps a pinned topic?

Rob,

I think a pinned topic would be perfect!

Quote

I saw the BL article on coming NXT/PF control as well-- it looks interesting but I have never gotten into the NXT platform (though I did get the RCX 1.0 set back in 1999) and am going to approach things from the standalone (embedded) Arduino board approach and/or Arduino integrated with Zigbee WiFi boards or USB controlled by a PC vs. getting into the Scout, RCX, etc. modules. ...   And once I get the train detection circuit down (I found a really cheap and great-looking integrated IR detector/transmitter on SparkFun) I look forward to providing real-time control of RC trains as well.  A guy can dream, right!?

Nope no dream at all, a challenge, but a fun challenge!!!

I am working on more or less exactly the same thing for about 8 years now :hmpf_bad: it took me a little time to learn PBrick programming (RCX, Scout, now NXT), PIC programming (I do PICs, as said), "programming" (VBasic, and since it takes that long, I have to switch now from VB6 to VB.net, damnit) - well I guess my programming style is rather interesting than elegant but it works. I picked up 6 Scouts for $6 each in 2006, and 10 MicroScouts for $5.50 each in 2005 :cry_happy:  :cry_happy:  :cry_happy: so I decided to go all LEGO. The RCX bricks hurt funding-wise, but I am collecting the ones with the jack (1.0 version) for about 10 years now, so there are 6 waiting to run trains. The NXT is form 2008. My PICs are handling the RF transceiver logic, since I am working with discrete receivers/transmitters, for no other reason that I did not know better.

I'd love to share all this stuff and some ideas - it would perfectly fit into the entire work discussed here and in JopieK's Arduino thread. My PC based control program handles RCXs directly, PF and soon RC trains via a NXT translator running RobotC with the IRControl sensor (Xander Soldaat has thankfully  :thumbup:  :thumbup: implemented an RCX driver for RobotC in 2010), and takes care of all the switch points. With RCX and Scout PBricks communication is bidirectional (sort of handshaking), with dumb PF and RC trains one-way.

Do you think this could be of any interest within the framework discussed here (Arduino etc. etc.?)

Rock on,
Thorsten



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users