Open Power Functions Receiver

Open Source Lego Receiver 8884

Open Source Lego Power Functions Receiver

Building the mini receiverLego PF Measurements

Open source LEGO Power Functions Receiver

This page is the home of the open source power functions receiver for LEGO Power Functions. Originally, I started out just wanting to make a receiver for the LEGO power functions remote, and thought it could be done in a month, and that I’d be happy ending up with a simple prototype. In the end, the protocol holds some nasty coding challenges, and I made my life very difficult by cramming a receiver with 4 outputs (2x PWM, 2x servo) in a 2x4x1 brick whereas the original receiver is 4x4x3 and features 2 outputs. Although I made this receiver VERY small, the code runs fine on a DIP microcontroller as well. You might even consider porting this code to another microcontroller, or change the code and read out the messages with an Arduino, or… or…. it’s open source!

Presentation Open Power Functions Receiver from Tinkerer on Vimeo.


Source Code

The source code is available here at bitbucket. If you want the hex file for the receiver, you’ll find it here. Do remember to program the fuse in the Attiny44a to disable the CLK/8 scaler.

*NOTE* Due to changing of the motor driver, the schematics are no longer up to date. I’ll update them soon.

The Gerber files and board / schematic (Eagle) for the receiver can be found here. If anyone is interested in a through-hole version drop me a line and I’ll see what I can do for you.
Schematic: PDF
Layout: PDF
Partlist:: See below

 LEGO Receiver – 6 times smaller, twice the outputs

Original 8884 receiver (right) with miniaturized open source receiver on the left

Jump to ‘build log’ for latest news

The purpose of this project is to add Lego Power Functions to more DIY Lego building products. When I saw the specification was published openly by LEGO, I felt the urge to do something with that info. I also found the ‘default’ LEGO receiver (8884) to be too bulky to build nice minifig scale projects. From my background as electronics engineer I felt the receiver could be made smaller. The ultimate goal would be to jam all necessary electronics in THE Lego Brick, being the 2×4 default brick. One of the sacrifices to reach this goal was to remove all connectors, and connect motors, power supply etcetera with soldered wires to the LEGO brick. For now, that is the status quo. The schematics and PCB files are open source and downloadable, so if you wish to create a new, larger form factor go ahead and please publish the results, if needed contact me and I’ll place the files on my site.

Open Lego Power Functions receiver features

  • Support of v1.2 Power Functions protocol
  • Channel selection by using tactile switch on side of brick; last channel used is remembered between power offs.
  • simultaneous servo and PWM output
  • 1000mA 5V regulator to provide power to servos (NXP NX1117C50)
  • Size: standard 2×4 LEGO brick
  • connections for external power supply, 4.5 to 16V
  • 2x 1400mA PWM output @ 14kHz (DRV8835 driver)
  • NO power down mode! (bug or feature?)

Will this be the end of the commercial LEGO receiver?

No way! This project is a hack in the sense that it shrinks the existing receiver by a factor 4 while adding functionality. The very nice LEGO connectors are not provided though, you’ll have to buy LEGO cables (8871 or 8886), cut, strip and solder them to use LEGO motors. I might think of a larger form factor in future to make this more convenient. In pricing, this is not a ‘cheaper’ alternative. Although part pricing is about half of the unit cost of  ‘the’ LEGO receiver, you’ll still have to make a housing, buy the PCB and solder the components to the PCB.

So why is this still a good alternative? At first, you’ll be able to add LEGO power functions in a more aesthetically pleasing way. At second, you’ll get servo control (using micro servos, not the big LEGO servos). That way, you could use micro servos in your LEGO to get better steering options for boats, cars, maybe even planes? And although some VERY cool builds excists with RC LEGO on minifig scale, none of those can use a LEGO RC handheld unit. I can’t wait to see the first minifig scale car steered by a LEGO remote control. But that might just be me 😉

Schematic and Layout

*NOTE* updated schematic and layout will be published!

Schematic: PDF
Layout: PDF


RefDes Value Pkg Farnell no.
IC1 Attiny44A SOIC14 1699397
IC3 NX1117CE50 SOT223 2057286
U$1 LB1948MC-AH MSOP10 2137871
U$2 TSOP4136 TO-92? 4913164
U$3 Sideswitch ? 1437640
C3,C4 100n 0805 1740665
C1,C2 4u7/16V Case A 1754083


Tested Remote Controls

8879 (dual jog) and 8885 (dual joystick) were tested and received OK. See ‘measurements’ section on description of protocols used by each transmitter.

Background info on internals

Note: this section is not interesting to you if you’re not interested in the hardware design. If you’re a non-ElectricalEngineer LEGO builder, please read on if you’re interested, but do not feel obliged to understand this.

  • The receiver uses a TSOP4136 infrared receiver. This is one of few receivers easily commercially available that has a minimum burst length of 6 cycles
  • The microcontroller is an AVR attiny44A. This device is small enough, and packs enough peripherals to program the protocol. The program is too large to fit in its smaller brother the attiny24A, but should be able to run in the attiny84A (not tested). Peripherals used: external interrupt, timer0, timer1, pin change interrupt, EEPROM. The servo connections are also used for programming through SPI. If DebugWire is used (requires AVR Dragon of JTAGICE), servos can remain connected, as this leaves the servo pins unused during programming / debugging. pins were mapped for convenience in layout, and minimum external connections while maintaining a full feature set
  • The motor driver is the DRV8835, a dual motor controller in an incredibly small housing. Earlier, I tried using another motor driver which crapped out on me each time the motor should start. This one performs better.

38 thoughts on “Open Power Functions Receiver

  1. Terje Akselsen says:

    Hi there 🙂
    Exciting project you have started with here.
    I’m an entusiast for trains, and especially Lego. My kid’s are now at an age that they also shows an intrests in this as well.
    We have now bought a few trains and a few tracks. For shifters I’ll use a computer to controll at the time 7 of them.
    I’m now also looking into a way to control the trains as well with the PC.
    Then I’ll need assebmle a way to communicate with the trains via IR.
    I was thinking of using USB IrDA to control the trains.
    Do you have any ideas for this ?

    Best Regards
    Terje Akselsen

    • admin says:

      Hey Terje,
      Nice to see someone enthousiastic already, I’m still building on this website, so please check back later. I do not have a remote control for LEGO trains myself, but a friend of mine used a PC with remote control box. He’s using the TIRA-2 from Of course building something yourself with an Arduino or microcontroller could also be possible, you’ll probably only need a very limited set of commands.
      Have fun!

      • Cody says:

        That is exactly what I’m trying to do. I am trying to figure out if I can use my Arduino to control my LEGO Manas motors. I’ve found out that the Manas’ IR sensor is likely 76kHz. Do you have any suggestions for how I might figure out what the pulse width is and the timing?

        • admin says:

          Hello Cody,
          Interesting! I didn’t know the Manas sets existed at all. The easiest way is to open the transmitter and measure the pulses on the LED. You’d need an oscilloscope to do that. I’ll send you an e-mail to talk about the details!

  2. Thijs says:

    very nice! interesting demo video

  3. Tristan says:

    Very interesting.

    Would you be able to provide a PDF of the schematic, for those that don’t want the hassle of getting Eagle.

    With a bit extra work, I reckon you could fit that inside a battery box with a Li-Ion battery and the plug connector O/Ps.

    • admin says:

      Hello Tristan,
      I added a PDF of schematic and layout. I reckon I could fit that in a Li-Ion box, but that might also be done by someone else, since I’ve been spending many a free hour of the past half year 😉 connecting the LEGO connectors might be done by cutting a LEGO extension cable in halves.

  4. suggestion for you says:

    Woah, great!
    I would like to buy a complete (assembled/tested) unit (I’m not into electronics).

    You may consider a “” project funding or working for “hitechnic” or “mindsensors”.

    • admin says:

      Hello ‘suggestion for you’,
      I thought about commercializing this, but I guess the disclaimer in the PowerFunctions document kind of prevents this. Thanks for the tip of looking at hitechnic or mindsensors, I’ll contact them 🙂

  5. fabio says:

    Hi, this project is really great, I really like.
    I’m making a proportional radio control at 8 ch + two on-off.
    My problem is the size ………
    But we are moving with a radio system does not tie this to have no problems in public events and have infinite MODELS running simultaneously …


    • admin says:

      Hello Fabio,
      Thanks for your comment. I’ve been thinking about making a Infrared< ->RF converter tailored to power functions. That way you could maintain your current hardware. By the way, the Power Functions spec, and therefore my receiver, supports an extra address bit, therefore enabling 8 channels in total…

      • fabio says:

        Thanks for the fast response ..
        The big problem is that the transmitters lego there are only 4 channels …
        If we have to move several models simultaneously is impossible …
        I can send you my project, so tell me what you think??

        If you give me your email I will attach as soon as possible.


        • admin says:

          Hey Fabio,
          The extra receiver channels on PF are only available when you send a special command. I’ll be happy to take a look at you project, don’t know when exactly… info at hackvandedam . nl

  6. Saike says:

    Hi there! What do you think, is it possible to control the servo Lego set 9398 of the conventional receiver, such as this: ??? Lego servo has a four connectors, but this receiver has only three.

    • admin says:

      Hey Saike!
      Unfortunately, LEGO servo signals are not compatible with RC servos; your receiver generates servo signals as output (see for a bit of explanation; the connector has ground, power, position signal), whereas LEGO receivers give power (9V, not 5V as servos need!), gnd, and 2 outputs with PWM signal. The output is a so-called full-bridge. Basically, the LEGO receiver drives the motor at a certain power (0-100% PWM control), and your receiver sets a position with a small power digital signal while providing power for the motor with 5V and GND.
      The new LEGO servos use the motor power signal to set the position. My receiver can drive ‘normal’ RC servos directly AND has a motor power output.
      If you’d still like to try this you’d need to convert the servo signals to PWM signals, and drive an H-bridge at 9V…

      • Brian Z says:

        I am starting work on an RC signal to Lego Power Functions converter circuit to do just this, with a de-cased HobbyKing receiver, a 5v regulator, two Picaxe 08M2 chips (one for each channel, and I only know how to program in BASIC), and a SN754410 H-bridge motor driver. The Picaxe chips should have no problem reading a servo signal and translating it into PWM, but my problem is that each Picaxe chip can only send one PWM signal. I’m thinking that I will have the H-bridge input 1A be PWM, and 2A be either high or low, and when I flip 2A also inverse the PWM duty cycle for going past the 0 degrees position on the servo. That would make a normal motor reverse and still have speed control, but I don’t know if the Lego servo logic will accept that. What do you think?

        • admin says:

          The LEGO parts are simply motors. The only part that has some peculiarities is the LEGO servo, which seems to be picky on timing.

  7. Kai says:


    I would like to use you PCB with 2 of the original pf motors instead of others or servos. Is this sitll possible? I think so, but I’m not sure. And did you updated the schematics or is it still on your todo list? 🙂
    Please contact me via email. Thanks


    • admin says:

      Hello Kai,
      Yes, of course that’s possible! I’ve updated schematics and code, I’ll mail you for the details.

  8. John says:


    can you send me all necessary files so that I can order the PCB.


  9. Nuno Cardoso says:


    I need to teach my Raspberry Pi how to speak “Legolese”, that is, o emit IR messages so I can control my car. This makes it easier for me, no wire cutting, no risk on killing my pi, etc.

    Are you interested in creating an open source RC controller API ?

    • admin says:

      At this moment my ‘ip’ is concentrated around the receiving side, but I can help you; I’ll contact you by email

  10. Joel Finch says:

    I’ve always had problems fitting the standard power functions receiver into MOCs because it has the requirement of being visible, line-of-sight, to the controller.

    Have you considered a split system, where the channel selector and standard power connectors are on one unit, and the IR receiver is connected via a cable to a separate much smaller brick (or no brick at all)?

    • admin says:

      Hello Joel,
      Nope, never considered, but it’s a good point. You could very easily extend wires from the IR receiver and the switch to some kind of front panel.

  11. Samuel says:

    hello i cannot seem to find a schematic on the v1.0 reciever. i have(from motorized excavator)2 IR receivers (im hoping theyre v1.2 theyre date code is 34k1 and 35k1, though it doesnt matter much) im looking to modify them to a 1.8A ish circuit to handle a 11.1v LiPo with 2 PF XL motors. i believe if i can get a schematic i can reverse engineer it and give it a lil more substantial voltage and Amp capability. i have little skill when it comes to designing my own PCB and i am desiring help. this mod would eliminate all other PF errors like the XL cutoff and 2M motor whine. seeing as how PF v2 is amazing, there is no reason to hang on to these anymore. intending to make open source and fit in original package. thanks for help.

    • admin says:

      Sorry for the late answer; I’ll update somewhere the next months. Drop me an email at info at , and I’ll give you a preview 😉

  12. Rman_nl says:

    He Great job!. Ik wil met arduino over IR de lego PF motors bedienen. Welke Ir zender(led) kan ik gebruiken (ontvanger TSOP4136)? Weet jij ook waar de code daarvan is? Op Youtube staat een clip van iemand die dit al gedaan heeft maar helaas geen reactie.

  13. Nick Hamilton says:

    hi, is this still up to date? This sounds amazing, just what i’m looking for to convert some old lego trains that are too small for new PF kit as well as control points, etc.

    I’ve never actually built something like this, only did basic electronics a long time ago, but i am technically literate and keen to learn. first question is really dumb though, where do you source all these bits so cheaply and have any changed?

    • Nick Hamilton says:

      OK i realised that the farnell number is there to use to order, one of them, the IC3 NX1117CE50 SOT223 2057286, does not show up. is there an updated list for this project you could send me please?

  14. Roel says:

    Hello All,

    I don’t know another platform to share the info of the older LEGO RC. Tis is only for the LEGO trains with RC (Black IR transmitter with the yellow buttons)
    I’ve bit-counted the basics and want to use them combined

    this is the info on channel 1+2+3:
    Channel 1+2+3, speed up:
    1000 1011 0101 1111 1110 1110 1010
    Kanaal 1+2+3, speed down:
    1000 1011 0101 1111 1101 1110 1100
    Kanaal 1+2+3, Stop ALL (right under key)
    1000 1011 0101 1111 1111 1011 1000
    Kanaal 1+2+3, Horn (right upper key)
    1000 1110 1011 1111 1010 10 11 1010

    and for channel 1:
    speed up Kanaal 1, 1000 1011 1111 1111 1011 0101 1000
    Pauzes between messages: 78,3 en 106 en 57 ms, in totaal 4 in a row
    speed down Kanaal 1, 000 1111 1111 1110 1101 0110 1000
    Pauzes between messages: 33,6 en 37 en 56,4 ms, in totaal 4 in a row
    Stop Kanaal 1, STOP : 1000 1111 1111 1111 1010 1010
    Pauzes tussen de messages: 56 en 35 en 37 ms, in totaal 4 in a row
    Hoorn Kanaal 1, right up key: 1000 1011 1111 1111 0101 1011 10
    Pauzes between messages: 57 en 35 en 37 ms, in totaal 4 n a row
    Kanaal 2, linksboven (2-ul) is dus: 1000 1011 1011 1111 1101 1011 01
    Kanaal 2, linksonder (2-ll) is dus: 1000 1111 0111 1111 0110 1011 10

    Who can help me to integrate this with the PF-trains I tried on:
    A newer version of the 4 trains I will publish soon.

    I’ve all the digital screenshots of the RC-channel 1,2,3 and 1+2+3

    Who likes this?

    Roel (PE1ODF)

  15. John says:

    This is really awesome! The size of that receiver is much more appropriate.

    I’d love to build one of these – is there a good source for parts in the US? I tried looking through digikey, but only a few of those parts were stocked.

    What’s the best way to go about getting a board made? Any help would be appreciated! Thanks!


  16. Sam says:

    Hi I like this very small idea. I’m looking at something I can’t find on the internet: I need to be able to control zoom in and out as the camcorder is wall mounted out of easy manual reach. New camcorders no longer come with remote control or the more expensive ones only with a “wifi over mobile phone remote control”. Wifi is easily lost because of interference and the Panasoni v520 cuts signal to e.g. a TV and the image only shows on the phone.
    So I was looking for a small unit that is to be mounted on top of the camcorder and by remote moves the zoom lever. If the movement was done by servo motor it would need to always return the zoom lever to neutral i.e. just a momentary left or right. Or as alternative use a double solenoid as used in modelrailway junction points.
    Would you be able to build such a thing? I haven’t got enough electronics knowledge. If that was workable I would also look at additional pan and tilt unit. So in the end the camcorder would by remote zoom in and out, pan left and right and tilt up and down. Start stop is not required as camcorder is on without recording media but captured live on a PC/TV.
    Thanks for your help,

  17. Edis says:

    this is great
    can i use normal ir controllers to control this thing? can this control an ordinary normal motor like XL motor? can i use XL motors on each output? explain to me please…

  18. Geo says:


    Cool project, congrats! What’s the status on the V2 (STM32F0) ?
    I really wanna build one of these.


  19. Max says:

    Hi! Could you please put updated schematic to the site or git repo? I’d like to build one for me 🙂

  20. ben says:

    why? I mean … uhm … WHYYY?
    Infrared is just the most crappy kind of remote control, why making it smaller, its still crappy. why not use your obvious ingenuity and skills and the time to make an arduino/esp bluetooth control, It’d even be programmable? now it’s a bit late ofcourse, sbrick is out and darn expensive

Leave a Reply

Your email address will not be published. Required fields are marked *