Recommended Posts

I've put together an open source solution for controlling Power Functions using Bluetooth. Back when I started this, I had heard of the upcore, but it promised to be expensive and do a lot more than necessary. (Now that project doesn't even seem to exist anymore.) I've designed more of a 1:1 replacement for the standard PF IR receiver.

Go here to find all the delicious source files: https://github.com/Btbricks

Reading the readme can help in getting started: https://github.com/BTbricks/brickster-bluetooth-receiver/blob/master/README.md

Here is a video of a very early prototype:

I've built an Android app that looks just like the Power Functions remotes:

I'd love to hear your thoughts about different app designs that could be useful.

The cost per device is about $26.

Everything squeezes into the inside of a theoretical 3x4 brick.

I'm working on designing an enclosure (read: flashy plastic box), so please tell me what you would be looking for in terms of how it integrates with other LEGO bricks.

Thanks!

P.S. I'm trying to keep things licensed under an MIT license as much as possible. It is the most open of open source licenses!

P.P.S. This topic is maybe inadequately named now.

Edited by codefox421

Share this post


Link to post
Share on other sites

That's a very good idea!

Depending on whether or not you will be able to make a good quality LEGO-ish housing for it, I would suggest a studless design, as more often than not it is easier to integrate studless into a studded creation, than the other way around. Maybe a 4x3x1 footprint/base, with two holes in one of the long sides (as more holes on more sides would take up internal space) ?

And then maybe something like a 1x4 liftarm with the holes facing upwards on top of this, next to the two PF outputs, that in themselves requires the remaining 2x4 area..?

If this made any sense at all... :blush:

I should note that I have absolutely no knowledge of the size of things in this kind of stuff :classic:

Share this post


Link to post
Share on other sites

That's an excellent idea Philo! I hadn't thought of taking that route. It would be an easy solution to get things going once I get some PCBs fabbed.

D3K, you also have a lot of good suggestions, and I think I will incorporate them if I end up 3d printing the enclosure. The technic-beam on top is especially superb, since using a few pins-with-stud would turn it into a normal brick. :classic:

Share this post


Link to post
Share on other sites

You can get such cases from mouser.com in the US, but a LEGO compatible 3D'ed case would be much cooler :wink:

Share this post


Link to post
Share on other sites

Nice work! I have succesfully worked on the same using BLE (low energy 4.0 bluetooth). The form factor is always a challenge indeed! Together with my students we are also working on a XBee powered system.

Share this post


Link to post
Share on other sites

What about putting some holes in the PCB that are big enough for a 1.5L pin to fit into? The .5L half would connect to the PCB and the 1L half would connect to whatever you want. I think this way you can avoid having to make sure that the parts that have been glued on line up correctly, and you can also get around the issue of 3D-printed parts not being accurate enough for Lego standards.

Share this post


Link to post
Share on other sites

Thanks for the tip about Mouser, 1974! And I agree, a custom fabbed case would be supurb if I can make it work. That might take a while however, so quick (temporary?) options are nice to have as well.

Thanks, JopieK! Have you posted about your BLE or XBee project anywhere? I would love to learn more.

I was looking into XBee at first. The pin compatibility between modules is nice, but I found them to be rather expensive. I'm striving to keep the finished device around $30.

I've been prototyping with an RN-42, but I'm waiting on an HC-06. The smaller sizes of these modules are a huge plus, and the HC-06 goes for about $5.50/each. The downside is their pin-outs differ, and unlike the RN-42 the HC-06 doesn't have a Class 1 counterpart. (The 100m range of an RN-41 would be killer! but probably unnecessary :wink: )

That is also a great idea you have, Phoxtane! Have you ever tried it before? I'm wondering if the PCB thickness would give a proper click for the .5L half of the pin?

In other news, I've put together an Android version of the 8879 Speed Remote Control:

Share this post


Link to post
Share on other sites

Can you make it fit in one of these?

64179.gif?1

Nice idea btw!!

Share this post


Link to post
Share on other sites

That is also a great idea you have, Phoxtane! Have you ever tried it before? I'm wondering if the PCB thickness would give a proper click for the .5L half of the pin?

Early Mindsensors devices simply used holes in PCB with tight fit around axles (4.7mm diameter?), and used axle pins to attach to LEGO parts. accx.jpg

In other news, I've put together an Android version of the 8879 Speed Remote Control:

Remains to try to control it using NXT/EV3 BT... Edited by Philo

Share this post


Link to post
Share on other sites

Can you make it fit in one of these?

[Technic, Liftarm > 64179]

Nice idea btw!!

Thanks Jim! I haven't gotten around to laying out the board yet as I have to create some component profiles from scratch. I'm aiming to have a PCB of 2x4 or 3x4 size, which would definitely fit into the 3x5 opening of that piece. I'm not sure what the height will be like; worst case you might have to stack 2 of them to fully enclose the electronics. The real challenge will be mounting it to that piece! :laugh:

I was reading up on a thread last night regarding 3D printed parts, which you had been testing. I may have some questions for you in the future...

Early Mindsensors devices simply used holes in PCB with tight fit around axles (4.7mm diameter?), and used axle pins to attach to LEGO parts.

Remains to try to control it using NXT/EV3 BT...

This definitely seems like a great solution to the mounting problem, especially now that I know it's been a success in the past. Do you know if it works with studs as well as axle pins? My use-case in particular involves more studs than Technic. :wink: I could just give it a try myself, no harm in that.

I would like to test with NXT, but I won't be able to do that until the end of the year. The board layout will undoubtedly be finished before then (even within a week if I can find the time). Maybe someone else will be able to give it a rundown with NXT/EV3 earlier than I can.

Share this post


Link to post
Share on other sites

Two stacked might do the trick as well. Although it might be a bit bulky.

If you have any question, don't hesitate to ask :thumbup:

Share this post


Link to post
Share on other sites

That is really a nice topic! I am looking myself into a non-line-of-sight communication between the PF Elements. However I took BT out of the equation as the modules I found were somehow expensive. I looked up modules in the 868MHz band which are cheaper than BT.

My plan is to keep them in the IR-Receiver housing to ensure compatibility. There could then be a BT-868Mhz or an IR/868Mhz Gateway to control the elements either by a BT device or the standard PF remotes.

I will definitely follow this as I want this for the PF controlled Monorail and I do not want to place IR-Towers everywhere!

Share this post


Link to post
Share on other sites

Wow, there were more components to place in less space than I was really conceptualizing! I still managed to fit the components onto a 3x4 sized PCB.

Fitting mounting holes in that space with the components was out of the question, so I came up with an alternative: one mounting hole on a tab in the back. It provides a direct mounting point for the PCB, can be removed for a true 3x4 PCB, and doesn't get in the way if I later make a housing with technic pin holes to mimic the IR receiver.

What do you think?

i.png

i.png

Share this post


Link to post
Share on other sites

I think maybe if there were two holes along the top, it would work better - that way it's not dangling by one pin.

Share this post


Link to post
Share on other sites

I think maybe if there were two holes along the top, it would work better - that way it's not dangling by one pin.

Quite a good point. I just realized D2 is intersecting the Bluetooth module, so I will need open the file back up anyhow. :blush: Will be a good time to make some other edits too.

Share this post


Link to post
Share on other sites

Very smart device! Maybe LEGO can make an app to control PF elements... :classic:

Thanks, matthewclso! A seal of approval like that from LEGO would be awesome! That said, an app is already underway, for Android devices at least.

brickster-speed-control.pngbrickster-momentary-control.png

The must-have features still needing implementation are the little motor reversing switches and a way to swap between the two controllers (it's currently hard-coded).

I lack the tools and skills necessary for iOS development, so there probably won't be an iOS app. That is unless someone else feels up to the task. This is an open source project after all. :wink:

Edited by codefox421

Share this post


Link to post
Share on other sites

I originally started this topic to solicit ideas for an enclosure for the finished product. I sadly misjudged the stage at which thing were at the time.

I have to admit, though I've studied electronics design somewhat, it is far from my specialty. Therefore, I'm now seeking advice regarding electronics design wrt microcontrollers.

I've bricked (or maybe pseudo-bricked?) a few chips now while trying to program fuses or load a program. I've read that connecting the programmer directly to the pins of the uC isn't the best choice and can lead to the kind of failures I've been experiencing, but I can't seem to find an explanation of how to actually connect them properly.

Can someone who has experience programming microcontrollers (especially the ATtiny84) advise?

Never mind. Using Atmel's programmer makes all the difference. Sayonara Arduino-based programmers!

--------

Otherwise, I stumbled upon a MOSFET trick which enables DC polarity rectification with ~0 voltage drop, and I have integrated this into the design. This means the receiver can be powered directly from older battery boxes, even though they only output on the PF "motor" lines. Additionally, the PCB's bounding box hasn't expanded with this upgrade.

Edited by codefox421

Share this post


Link to post
Share on other sites

I'm still working on this, though my schedule has been busier lately, so I haven't had much time to spare.

I've narrowed down the programming issue a bit. I can successfully burn the fuses and program the microcontroller ~100% of the time while it's off the PCB. This means there's an issue with something on the PCB or something between the AVRISP and the PCB (I've been using a pogo ISP adapter). However, I can program the chip, so I'm going to try getting one board working as soon as I can. Meanwhile, I'll continue to sort out the programming issue.

I've never been quite so happy to see an LED blinking :laugh:

P.S.

The must-have features still needing implementation [in the Android app] are the little motor reversing switches and a way to swap between the two controllers (it's currently hard-coded).

These are finished, so the app could technically ship right now... but there is nothing for it to control yet! :wacko:

Share this post


Link to post
Share on other sites

Thanks for the tip about Mouser, 1974! And I agree, a custom fabbed case would be supurb if I can make it work. That might take a while however, so quick (temporary?) options are nice to have as well.

Thanks, JopieK! Have you posted about your BLE or XBee project anywhere? I would love to learn more.

I was looking into XBee at first. The pin compatibility between modules is nice, but I found them to be rather expensive. I'm striving to keep the finished device around $30.

I've been prototyping with an RN-42, but I'm waiting on an HC-06. The smaller sizes of these modules are a huge plus, and the HC-06 goes for about $5.50/each. The downside is their pin-outs differ, and unlike the RN-42 the HC-06 doesn't have a Class 1 counterpart. (The 100m range of an RN-41 would be killer! but probably unnecessary :wink: )

That is also a great idea you have, Phoxtane! Have you ever tried it before? I'm wondering if the PCB thickness would give a proper click for the .5L half of the pin?

In other news, I've put together an Android version of the 8879 Speed Remote Control:

(removed media)

just wondering if there would be a way to control more than 1 motor.

Happy building!

NXT45

Share this post


Link to post
Share on other sites

Howdy! I love what you are doing. I recently built a 2.4GHz receiver for Power Functions. You can see my progress here. It has a simple housing that I made out of two plates and 6 2x2 panels. Well, the pictures on my blog are 2x3 panels, but I've gotten it to fit in 2x2 panels. You said earlier that you were having PCBs fabbed. Have you tried etching your own, and soldering with a hot electric skillet? I learned everything I know about etching and soldering SMD parts from working on this project. My new version is all surface mount, and is working awesome. I'm going to make a new blog post for the new version here in the next week or so.

I hope you keep it up and find sweet glorious success!

Brian Z

Share this post


Link to post
Share on other sites

just wondering if there would be a way to control more than 1 motor.

Happy building!

NXT45

Hi NXT45! I've planned to make this a suitable replacement for LEGO's IR receiver, so it will have two motor outputs. It falls somewhere between the v1 and v2 IR receivers in terms of available amperage.

Howdy! I love what you are doing. I recently built a 2.4GHz receiver for Power Functions. You can see my progress here. It has a simple housing that I made out of two plates and 6 2x2 panels. Well, the pictures on my blog are 2x3 panels, but I've gotten it to fit in 2x2 panels. You said earlier that you were having PCBs fabbed. Have you tried etching your own, and soldering with a hot electric skillet? I learned everything I know about etching and soldering SMD parts from working on this project. My new version is all surface mount, and is working awesome. I'm going to make a new blog post for the new version here in the next week or so.

I hope you keep it up and find sweet glorious success!

Brian Z

Awesome receiver, BrianZ! Definitely a big win for LEGO racing :thumbup:

I've had my PCB fabbed because I need a two-layer board so I can make my device as small as possible. I hand solder my SMD prototypes, so the solder mask is a big help too. And at $5 per sq. in. for three copies (including shipping), getting it fabbed isn't cost prohibitive. Three copies of this board come out to about $6.20. The only downside is having to wait a few weeks for them to arrive. :wink:

pf-bt-pcb.jpg

Now to find some free time so I can solder it up and give it a try...

Share this post


Link to post
Share on other sites

That is super impressive. I'm using a laminator with toner transfer to make double sided boards, but those vias on your board fill me with envy. That's just something you can't do with home-fabbing, and It makes my board quite a bit bigger than yours, even though it looks like I have fewer components. I can't put a via under a chip, because mine are a soldered wire going through the board, and it makes a lump. Again, impressive work, and I'm excited for you. I know how good this part of a project like that feels. Keep up the good work, and post a video of the final project.

Brian Z

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.