Star Wars Millennium Falcon Lego - Wifi-controlled Lighting and Audio project

Hi there,

I bought myself the Millennium Falcom Lego set and am almost finished building it :slight_smile:

When completed I would like to enhance the Millennium Falcon with LED lights and sound which can be controlled (simultaneously and individually) from a cloud server over wifi. I have read some posts on internet but as I am new to arduino I am not sure which steps to take and which hardware I would need.

As the kit will be integrated in the Lego set I am looking for a 'as small as possible' solution for the boards.

What I would like to achieve is to control individual LED lights (on/off) triggered from a server. Secondly I would like to be able to stream and play sounds (mp3) through small speakers which will be integrated in de Lego set. From a server I would like to determine which sound will be played, and then stream it to the speakers in the set through wifi.

In the end the LEDs and Sounds will be triggered by specific events, for which scenarios exist on the server. These scenarios are like a playlist, a queue of actions which are triggered over a timeline for each event. This 'playlist' will control the LEDs and sounds in a specific order.

What hardware would I need to achieve this? Any help and guidance is very much appreciated. I will share a video and photo's of the final project :slight_smile:

Cheers! Sietze

you are a web developer?

Hi Juraj,

Not really, I am a project manager for a company that does web development. So for the server part I am covered. However we do not have any experience with hardware like arduino.

Any help would be very much appreciated.

You want to play sounds.... by streaming it over a server?

Or you just want to 'trigger' sounds already 'loaded' to your sound board of choice via a 'web interface'..

please clarify..

The later is much bigger/different animal IMHO..

Also... how many leds and what kind of leds are we talking about here?..

The Arduino and Audio triggered playback (not streaming) could be done for under $5.00 using an Arduino Pro-Mini, and a DFPlayer .mp3/.wav player board..
Another $2.00-$3.00 USD and you have wifi with an ESP8266 module..

The Arduino can do 'several things at once'... (but not really).. LOL..

So you'll need to REALLY think about how you want the project 'flow/experience' to behave.

Another 'gotcha' here is your internet/web enabled 'interface'.....

If the Arduino is constantly checking some 'web page' for an update or change in 'commands'.... when does it take time to 'perform' these actions? After a web update comes through? (what happens when another web update comes through as the Falcon is beeping and blinking?)

Then you need to think about the 'protocol' you will create in order to send data to the Arduino.. and a parser to interpret this data, that actually MEANS SOMETHING to the code..

ie: you get a '1' value from some web interface.. what do you do?

  • Answer: write some code that parses this incoming '1' via serial comm... and then do whatever you think a '1' should do (blink the back lights... play a specific sound clip..etc)

However... it sounds as if this will be much more in depth? (multiple blinking patterns with multiple triggers sound effects..etc) Might want to keep things small here to get something functional up and running before scaling it up.

There are MANY (many) ways to approach this.. what I listed above is just one way you might tackle it.

IMHO.. have something that CONSTANTLY polls a webpage/feed for a 'change/command' is not a very good approach.

Using an MQTT server (like a Raspberry Pi configured as such)... is more like the 'brain' that will PUSH updates out to subscribed Arduino/devices.. so they do not have to do the same thing over and over and over and over..(especially when there is no change).. its much more efficient to just keep 'doing what you do' until there is a change.

Or you can use a number of on-line (free or not) MQTT services.. Blynk I think is one.. there are several others out there too.. (so you can save yourself some time without having to set-up a Raspberry Pi and configure it)..

You dont keep calling your friends house to see if hes there.. over and over and over...etc..etc (rinse and repeat)..
You leave a message... and wait until he gets home and calls YOU!..

Your 'web interface' will also need several 'layers'.. If the web page itself is NOT being hosted (served) by the ESP module itself.. there is no real direct connection. You'll need to either update an on-line MQTT type of service.. or save itt o a database.. where the ESP will call/load this page and get the details/updates/changes from a database or something..

IMHO.. you might be best served if you try this all LOCALLY first.. without the inclusion of the 'internet'..

You can create a web page with some buttons/links.. have to hosted on the ESP module itself.. when you grab your phone and search for new wifi networks.. you would then see 'falcon-wifi' (or whatever).. you can connect to that wifi network.. and now whenever you open a browser up in your phone/device, it will ONLY serve up that web interface (page) that you just created... (this is call configuring the ESP module as a captive portal)...

With the webpage being hosted in/on the ESP module itself.. and the ESP module connected to the Arduino itself.. you have a direct connection from interface > esp module > Arduino > blinkies and beeping triggers!

So there is a lot to plan out still.. I would suggest you start mapping out your features, and details.

first you need to know how to light a led with Arduino :slight_smile:

the you must master some networking hardware for Arduino (WiFi or Ethernet) to light a led with REST request

then you must master sound and storage hardware for Arduino to play sound (streaming is not the right option here)

the you must learn how to make it small, because putting a shield on Uno is easy but it is not small

And in my opinion bluetooth and smartphone app would be a better option to control the show. unless you want to put the page on Internet with a camera feed of the Lego model

Sietze:
Hi there,

I bought myself the Millennium Falcom Lego set and am almost finished building it :slight_smile:

My hat is off to you !
have you passed the 34 hour build time mark ?

break your project into segments
light LED's - easy

light dozens of different LED's each at a different time takes a bit more work.
Crossroads has a board that does 64 single color LED's

sound and speakers, not hard

above is the arduino hardware forte

then web connect, sounds like you have that bit started.

break down your project, tell us the bits you need help with.

Hi @xl97,

Many thanks for the extensive answer. I am really new to this hardware stuff. I will review your answer, do some research and come back with some more details and specs for this project.

As you mention: I am gonna start easy on this project to learn more about the hardware before going more in depth and over the internet.

Hi @dave-in-nj and @xl97,

Just finished building it. I did it in approximately 26 hours by myself. Sorting out the bricks really helps building it faster :slight_smile:

The amount of detail on the set is incredible, I'm blown away by the beauty of the thing. And it is massive, great stuff from Lego. Now part 2 of the project starts.

Thank you for your answer. I will start easy with this to discover and learn about the arduino hardware.

What I definitely would like to do is control multiple (approximately 10 to 15) LEDs individually (simultaneously). I have not yet decided on the LEDs I want to use, but most likely it will be pico LED lights and a bunch of LED strips.

Can this be achieved with Arduino Pro-Mini and an ESP8266? Would I need an additional relay module to pull this off? I searched for the crossboards module but it is not clear to me which board is suitable. Any help on this lighting would be great.

The audio will be in a next phase (with a sound board in stead of streaming).

Looking forward to your replies.

Cheers! Sietze

You could use ws2812b LEDs, and throw the Arduino Pro mini + LED drivers out. Just use the ESP8266. I have to admit that I haven't tried the ws2812b with the ESP8266 myself yet, but there seem to be good libraries with DMA on the I2S bus, so that shouldn't be an issue.

Here's some documented code I wrote that controls LEDs connected to an ESP8266 from a web interface. One version has buttons to turn on/off the LEDs, the second version has sliders to set the intensity as well.

Pieter

I would double check that the audio portion you intend to use will function correctly with the Neopixel strips/libraries out there..

I suggest using Dotstar Leds instead.... (same functions.. no strict time requirements)

May be an issue with the ESP modules too.. better to research others projects and how they coded things before buying all the stuff.

An Arduino can’t play sounds by itself (even the much more powerful ESP8266 can’t), it can tell the DFplayer to “play track 5 from the SD card”.

Just about anything an Arduino can control, an ESP8266 can control. I would expect the ws1812b LEDs to work just fine.

for a beginner, the UNO or NANO is a good start. learning how to light LED's is of course the first goal and should be pretty easy.

the aforementioned ws2812b LED's are HUGE and will not fit in a block well.
the space available for an LED is just not that large.
the ws2812b offer a much simpler wiring solution because the they all connect one to the next with the same wires.
but you can easy fit 10 pico LED's into a WS2812B

one of the things you have to do with any ARDUINO is count the things you want to control.
the UNO has 6 analog pins and 14 digital pins, the NANO adds 2 more analog pins.
as a note the analog are regular digital pins, with the added ability to sense analog inputs so can be used for either use.

be all that as it may, the new ESP32 is probably your best bet. (in the future)
it has 32 I/O and has on-board blue tooth and WiFi. and deep sleep.
I Believe you can program it with the Arduino IDE, so any work you do with the UNO or NANO will only need a bit of tweeking to move over to the new board.

as was said by wvmarle, you do not need to worry about playing your music, you get the DFplayer and just tell it what to play. that part is pretty simple. not sure how many pins you need to turn it on, select a track, pause, stop, etc.

assume 4 pins for the dfplayer and you have 16 pins for everything else.
a analog pin can be used with 6 buttons(or more}. each button acts independently, the Analog pin 'decodes' the input and knows what button you pressed. so that solves button type inputs

so far, what you have asked is in the realm of the Arduino universe.
the ESP32 is relatively new and much more capable than the Arduino UNO/NANO, however, it is still new-ish and some features are in the works. lighting LED's, controlling tracks of the dfplayer, should be well documented.

as a note, I would google to see if anyone is using fibre optics on LEGO block with the WS2812B LED's that would offer color changing with ease of use.

I will also mention that we have port expanders or shift registers.
both of those are external chips that can act like more external pins.

one shift register can act like 8 more output pins. it takes 4 pins on the Arudino, but you can daisy chain them so you can add 4 or 12 pins (consuming the 4 needed to control them) with a relatively easy add-on.

a 16 pin port expander takes 2 pins to control costs a bit more and does not have the vast array of support that a shift register does.

one of our members, Crossroads, offers a board that has a special shift register that can turn on or off 64 LED's
that means you can have a LOT of single color LED's

I am excited about your project as one of the guys at work has also completed the Millennium Falcon. We are working out how to display it. and if your LED package works... I might be inclined to so something similar.

In reviewing the model, the front cockpit and front lights seem simple
the huge rear second that is the engine, is also wide open for this.

My thinking is if you want to make it light like the different scenes in the movies.