Microcontroller Projects

Ask and answer questions, share tips and resources for installing lighting and other electronics in your models.

Moderators: Sparky, Moderators

User avatar
kitty
Posts: 1337
Joined: Wed Jan 23, 2008 6:54 pm
Location: Eindhoven NL

Post by kitty »

I don't think it's wise to try and develope a board dedicated to a single purpose or model, the market is too small.
Not with these cheap programmable tiny boards around.
Basicaly you can just solder a few leads from such boards to a Led driver, or directly to a LED-resistor pair.
in most cases you wouldn't even need a board for that.
I think it would be smarter to develope a modular system around one of these existing low cost small boards and write the necessary programs for the functions.
That way at least your design would not be limited to just 1 model, but universal.
Democracy may be only a few steps removed from anarchy,
But at least it's not as loud.
You broke your little ships. See you around Ahab. :spock:
sbbbugsy
Posts: 7
Joined: Mon May 04, 2009 7:03 pm

Arduino for model lighting

Post by sbbbugsy »

If anyone has written a code that controls the LEDs for a model starship, could they post it? (please, please?)

I have an Arduino Mega board, but have never programmed before. I can make one LED blink. Sure, it's pretty, but not quite enough to light the NX-01. :P
jwrjr

Post by jwrjr »

I've done that ... for a couple of PICs. It would not be useful for you.
User avatar
kitty
Posts: 1337
Joined: Wed Jan 23, 2008 6:54 pm
Location: Eindhoven NL

Re: Arduino for model lighting

Post by kitty »

sbbbugsy wrote:If anyone has written a code that controls the LEDs for a model starship, could they post it? (please, please?)

I have an Arduino Mega board, but have never programmed before. I can make one LED blink. Sure, it's pretty, but not quite enough to light the NX-01. :P
Now try and make that led fade in and out.
if you can do that you have the collission light in principle.

Now make a second led blink and fiddle with those values untill you have it full for 1/10th of a second then fade till it's out in 0.15 seconds, pause 0.5 second and repeat.
Once yo have managed that, you already have collision lights and nav stobe.
First just write programs for each group, then put them as routines in a larger programm and call those routines.
Build it routine by routine.

You have an arduino, so you can reprogramm via USB and fiddle with the values without having to unplug anything.
You can use 14 outputs on those breakout boards i think (the sandwich board that plugs in on top) 6 of them PWM.
So you have an ideal board to experiment with.

And once you figured it all out and have it all in 1 neat programm, get yourself an arduino mini and put that programm in it.
Last edited by kitty on Fri Aug 27, 2010 4:24 am, edited 1 time in total.
Democracy may be only a few steps removed from anarchy,
But at least it's not as loud.
You broke your little ships. See you around Ahab. :spock:
Ant
Posts: 517
Joined: Tue Nov 19, 2002 8:02 am
Location: Oxford UK
Contact:

Post by Ant »

I put together an ATMega based system for the Pegasus Area 51 UFO last year (Video here http://www.vimeo.com/8074653 ) and now have reduced the design down into a cheap generic 8-channel LED driver than can be used in many other projects, each coded up to requirements.

I've recently had 50 PCBs made but have been too busy to actually finish off the instructions / literature allowing me to go more 'live' with the project but hope to do so soon!

Prototype video 1 http://s113.photobucket.com/albums/n202 ... river2.flv

Prototype video 2 http://s113.photobucket.com/albums/n202 ... Driver.flv

Final PCB http://i113.photobucket.com/albums/n202 ... C_1645.jpg

The prototypes have a piggyback board with smd leds on for quick change/testing purposes.

Ant
User avatar
Underlord
Posts: 220
Joined: Mon Jan 28, 2008 3:49 pm
Location: Connecticut, USA
Contact:

Post by Underlord »

I'm jumping on the Arduino band-wagon too. I read up on it, and it looks promising. I'm a software developer, and I went to college for electrical engineering and robotics so this thing has my brain jumping from project to project! Exciting stuff!

Anyway, I ordered an Arduino Uno for testing, and a handfull of Arduino Pro Mini boards for installation in various models. I've downloaded the development environment and even coded up what I think will be a good base for Star Trek models. I haven't been able to find a software emulator yet, so I'm really anxious to receive my boards to see what my code does.

I'm a big fan of open source, so once I debug my code I'll share it. If anyone else out there has used an Arduino and wants to share code, please PM me. I'd love to see other solutions, and better yet, one that already has been proven! LOL
Your mileage may vary, void where prohibited, if it lasts more than 4 hours, see a doctor. All prosecutors will be violated. Only fools are certain. Substantial penalty for early withdrawal. The best advice I ever received was "Don't take anyone's advice. Listen to what everyone says, then make up your own damned mind."
User avatar
Underlord
Posts: 220
Joined: Mon Jan 28, 2008 3:49 pm
Location: Connecticut, USA
Contact:

Prototype Federation blinker done. (That was easy!)

Post by Underlord »

I've got my Arduino UNO, and after a few tweeks, my code works great! I've currently got navigational and collision blinking lights, a control line for main lights, green/blue fading deflector tied with warp engines, warp engine control line, and left/right glow-up & flash torpedoes! What is even cooler is I've got it coded to take serial commands. I've ordered some bluetooth adapters. I'm going to code up an LCARS control panel on my Android phone to control the lighting!

Development cost is irrelevant'cause it was just so damn fun! In-model cost is a different case...
$10.00 - Arduino pro mini
$10.00 - Bluetooth serial board
$ 0.10 - 3x 2n222 transistors

Ok, so that's a bit more than 555 timers or 4060 chips and their components, but I don't think I have the electronic know-how to do all of these things PLUS add wireless remote control from an LCARS interface without it!

I've gotta go back and watch "The Motion Sickness" to get the timing exact off of the beauty shots in space dock, but I kinda like the timing I have now. I've also got to capture the timing for Voyager 'cause she's on my TODO list too.

Next up is the transistor control for multiple LEDs 'cause the Arduino can only power one LED per pin. I'm hoping I can use 2n222 transistors to power a bunch of LEDs based on the logic output of the Arduino... In fact I know I can, the issue is if the Pulse Width Modulation on the Arduino pins will translate so I can run a bunch of green/blue LEDs to the deflector.

PM me if you want a copy of my schetch! :)
Your mileage may vary, void where prohibited, if it lasts more than 4 hours, see a doctor. All prosecutors will be violated. Only fools are certain. Substantial penalty for early withdrawal. The best advice I ever received was "Don't take anyone's advice. Listen to what everyone says, then make up your own damned mind."
Madman Lighting
Posts: 1816
Joined: Sat Mar 05, 2005 9:16 am
Location: Serenity.
Contact:

Post by Madman Lighting »

Wow thats all pretty cool stuff there.

I gotta ask, how many LEDs can you drive with each output? I can drive six with each output on mine... :wink: And its a constant current source so brightness it the same no matter the battery voltage.

But keep on with it, sounds like a neat project!
That Madman Who Lit Up Deep Space Nine
User avatar
Underlord
Posts: 220
Joined: Mon Jan 28, 2008 3:49 pm
Location: Connecticut, USA
Contact:

Post by Underlord »

Madman Lighting wrote:Wow thats all pretty cool stuff there.
Coming from you, that's HIGH praise! :)
Madman Lighting wrote:I gotta ask, how many LEDs can you drive with each output? I can drive six with each output on mine... :wink: And its a constant current source so brightness it the same no matter the battery voltage.
The Arduino only supplies 40mA at 5v, so you can only drive one LED per connection directly. Thats why I'm going to be using 2N2222 transistors to drive main lights, deflectors, collision, and navigation LEDs from a higher current source. Even with those I can only push 600mA so each pin will be able to light 2 feet of 3528SMD light tape or 20-24 LEDs. That should be enough for now!

This is my first embedded processor, and my first Android app so I may be pushing myself a bit too hard. :)
Your mileage may vary, void where prohibited, if it lasts more than 4 hours, see a doctor. All prosecutors will be violated. Only fools are certain. Substantial penalty for early withdrawal. The best advice I ever received was "Don't take anyone's advice. Listen to what everyone says, then make up your own damned mind."
wbrowniv
Posts: 5
Joined: Thu Jul 23, 2009 11:38 am
Location: Saint Louis Mo.

Post by wbrowniv »

I too have really been interested in using the Arduino for lighting. I know absolutely nothing about them but I want to learn! I will be interested in your progress.
Bill Brown
Ant
Posts: 517
Joined: Tue Nov 19, 2002 8:02 am
Location: Oxford UK
Contact:

Post by Ant »

I've had a lot of success with the board I produce - got a variety of applications now. There are some sample videos up on my web site here http://www.antsnest.net/LEDDriver.php

Keeping it simple and generic means its easy to adapt to all sorts of uses

Ant
User avatar
Underlord
Posts: 220
Joined: Mon Jan 28, 2008 3:49 pm
Location: Connecticut, USA
Contact:

Post by Underlord »

Ant wrote:I've had a lot of success with the board I produce - got a variety of applications now. There are some sample videos up on my web site here http://www.antsnest.net/LEDDriver.php

Keeping it simple and generic means its easy to adapt to all sorts of uses

Ant
Ant, I remember seeing your board, very cool!

One thing that is very important to me is to give back to the community. I'm not interested in making a business out of modeling. At least for me, that would take some of the fun out of it. This site has been invaluable in getting me re-indoctrinated into modeling. I've learned more from trying things I hear about on here than I could have learned on my own. One individuals work in particular has really driven home the importants of freely distributable knowledge. Carlos "Arthur Pendragon" Zangrando donated his work on aztec decals for many different ships. Without his downloadable decals, my work on several Star Trek models would have been much less satisfying. Sure I could have (and have) bought professionally created decals to do the same job, but I really appreciated his effort being provided for non-commercial use without anything further than attribution. BRAVO, and Thanks Carlos!

I've been involved in many open-source projects, including some commercial ventures. I'm a big fan of getting paid for my work as I do it, and letting others benefit after I'm done. I've found that the Arduino projects share the open source ethics that I hold so dear, so I'm going to do this very specific pointed project for myself, but if anyone else wants access to what I did, they are welcome to it. There will be virtually no support, no refunds of the nothing people have paid for my work, and probably very little interest except for folks to see what I've done. The reward for me is sharing my excitement for the project.

I may be making some people a little uncomfortable by giving away my work, but I don't think any of our professionally created packages have anything to worry about. Besides, if they like what I've done, they can grab it all, make it better, and provide their amazing build quality and far greater experience to make something they can make money on!

I've created some short videos to document the process. I recorded it in a storage room where I have my computer set up for now. Please pay no attention to the boxes and furniture stacked around :) If you've got the bandwidth, and you're still listening :) Here's the links:
http://youtu.be/qvGooknHZRE
http://youtu.be/PKSK9K0tGkU
Your mileage may vary, void where prohibited, if it lasts more than 4 hours, see a doctor. All prosecutors will be violated. Only fools are certain. Substantial penalty for early withdrawal. The best advice I ever received was "Don't take anyone's advice. Listen to what everyone says, then make up your own damned mind."
wbrowniv
Posts: 5
Joined: Thu Jul 23, 2009 11:38 am
Location: Saint Louis Mo.

Post by wbrowniv »

Ant,
I too was way impressed with your board. I saw your video on the Area 51 UFO light up and the Alpha Centauri kit which I plan to build in the future. Is your board available for purchace?
wbrowniv
Posts: 5
Joined: Thu Jul 23, 2009 11:38 am
Location: Saint Louis Mo.

Post by wbrowniv »

Underlord,
Those are some great videos! I like how you can program the Arduino and if you don't like the end result, change it until it's acceptable. The LCARS interface sounds cool as well. Can't wait to see more.
User avatar
Underlord
Posts: 220
Joined: Mon Jan 28, 2008 3:49 pm
Location: Connecticut, USA
Contact:

Post by Underlord »

I did some research last night... and since this will be a refit enterprise project (at least at first) I decided to go with the blue theame late movie era LCARS. Then I realized that Star Trek Online uses a very similar look... the more things change, the more they stay the same.

Anyway... Graphics are NOT my strong suite. Anyone out there want to lend a hand? I need qHD (1/4 HD video) size screen formats for controlling main lights, warp, torpedoes, and maybe some other systems that would only have an interface on the "PADD" itself like comms, distress call, red-alert etc.

Gee... I hope this doesn't turn into another runabout interrior or JJPrise :\

... I think I can, I think I can, I think I can...
Your mileage may vary, void where prohibited, if it lasts more than 4 hours, see a doctor. All prosecutors will be violated. Only fools are certain. Substantial penalty for early withdrawal. The best advice I ever received was "Don't take anyone's advice. Listen to what everyone says, then make up your own damned mind."
broderp
Posts: 2
Joined: Sun Feb 08, 2015 12:18 pm

Post by broderp »

Kind of sad to see that this topic died a few years ago, with links that are no longer good in some places. As a new Star Trek Modeler, I am very interested in getting parts to build my 350 NX-01 and my soon to be delivered 350 Refit kit.

An Engineer by trade, I have worked in the business and have made a few circuits and power supplies. What really gets to me is the cost of these kits. The lighting kits cost 2-3 times (or more) the cost of the kit! I know what LED cost, and I know of many of the components used to make these can be had for pennies in bulk. I will admit I may be a bit out of touch, as I have not worked in a lab environment for many years, or ordered components for board level repairs but I look at these kits and see the most elaborate ones I could have made for 1/4 the cost they are being sold for.

I'm saddened that this thread has died, and I will be looking into the Arduino as a method to control my lighting. I suppose I am lucky as I have access to programmers a board rework lab and once my setup is complete, I can perhaps flash the program onto a eeprom or some other device to run. Perhaps I can make a proto board with discrete components and keep it simple.

I'm not knocking those who sell this stuff, but I can't help buy feel that the pricing on many kits is inflated, due to the cult like following Star Trek has.

Who knows, I may get into this and realize that spending the money is the quickest route to go. :oops:
Ant
Posts: 517
Joined: Tue Nov 19, 2002 8:02 am
Location: Oxford UK
Contact:

Post by Ant »

You have to appreciate that when you buy any product from a commercial concern, you are not going to be paying just what the components cost. You also have to factor in the cost of initial design & development (could be many hours, days or weeks), the cost of obtaining the components, the cost of assembly & testing, the cost of managing orders, packing & delivery & the cost of advertising.

When you build something yourself, may of these factors are just your own time, which you probably rate as zero. Just because it only costs you the price of paint to paint your house, doen't mean someone else will do it for the price of the paint!

When you produce large quantities, many of the associated costs can be reduced by spreading fixed costs over the total production run or by seeking better deals for volume. This is the "economy of scale". Most of the people selling lighting kits (or may other aftermarket services) simply don't have this luxury.

There's still lots going on in the lighting kit arena - you just have to hunt around, and be prepared to pay someone else to do the bulk of the work. That or do it yourself if the money is more important.
texastony1946
Posts: 7
Joined: Sun May 26, 2013 8:47 pm

Arduino for model lighting

Post by texastony1946 »

I would also like to see this thread resurrected. I have just finished my
Finemolds 1/72 Slave1 model and I used an Arduino pro mini to do most of the lighting. In the past I have used flickering LED's for engines. With the micro controller you can control intensity, color, and rate of change. I feel
like the micro controller could change the way we build Scifi models. I posted the build photos at scale model addicts site, and loaded a video to
YouTube. Here are the links if anyone is interested.
http://www.scalemodeladdict.com/SMF/ind ... 191.0.html
https://www.youtube.com/watch?v=W_cRaGDNnsI
The programming has a pretty steep learning curve, but it can be learned.
I'm not a programmer, but copy and paste works well for this. It just gets
interesting trying to link all the programs together without constantly having
to correct errors. There are 1000's of codes already created out there on the web. The Arduino is open source hardware and software. The pro mini's
can be purchased from China for less than $2.50 each. The programmer
is free. I am hoping everyone interested in lighting their model will share
their knowledge with the community.
RossW
Posts: 198
Joined: Wed Oct 02, 2002 1:04 pm
Location: Toronto, ON

Post by RossW »

There has been a fair amount of activity over on SFMA re: Arduinos, so much so that Boyd created a new forum for it:

http://scifimodelaction.com/sfmaforum/i ... board=23.0

There's sample code to blink both running lights & strobe lights with one board.
User avatar
brt
Posts: 1890
Joined: Thu Feb 14, 2008 6:04 pm
Location: Waiting for the Mothership

Post by brt »

RossW wrote:There has been a fair amount of activity over on SFMA re: Arduinos, so much so that Boyd created a new forum for it:

http://scifimodelaction.com/sfmaforum/i ... board=23.0

There's sample code to blink both running lights & strobe lights with one board.
Thanks for posting this. I added the link to my favorites. I gave up arduino because I didn't have time to learn code and couldn't find the examples needed for what I wanted. :8)
“Life is pain, highness. Anyone who says differently is selling something.”
― William Goldman
texastony1946
Posts: 7
Joined: Sun May 26, 2013 8:47 pm

Arduino's

Post by texastony1946 »

Thanks for the link, I will certainly follow and subscribe.
trekman
Posts: 25
Joined: Fri Apr 24, 2009 12:32 pm

Re: Microcontroller Projects

Post by trekman »

Anyone hear about inner lights-scaletronic lighting systems?
seam-filler
Posts: 3889
Joined: Thu Apr 17, 2003 11:05 am
Location: Aberdeen, Scotland

Re: Microcontroller Projects

Post by seam-filler »

No, but I found their website...

http://www.scalectronics.co.uk/
"I'd just like to say that building large smooth-skinned models should be avoided at all costs. I now see why people want to stick kit-parts all over their designs as it covers up a lot of problems." - David Sisson
turner3d
Posts: 11
Joined: Sat May 22, 2021 10:20 am

Arduino/TLC5947 powered NX-01

Post by turner3d »

Several months ago, I started working on a Polar Lights 1:350 Enterprise NX-01 kit that my father in-law got me for Christmas. I had shown him Boyd's TrekWorks old NX-01 build series on Youtube, and he wound up getting me all the things, right down to the Monsters In Motion lighting kit, the Tenacontrols flasher, the 9v->5v stepdown board, the LED tape... the whole 9. (My father in-law rocks) Anyway, after I started testing the electronics, I was npt thrilled with the way they looked. The bussard collectors on the Monsters in Motion board were extremely spastic and blinky, and even the Tenacontrols nav board was way off. If you frame-by-frame the CGI model from the show, you'll see that the nav lights and even the strobes don't just instantly snap on and off like pretty much every light kit I've ever seen does - they each take about 3 frames @ 24fps to fade in and to fade out - that's .125 seconds and really matters and suggests the scale of the model, IMHO. It's really strange to me that the timing of the lighting is so often just glossed over when so much attention is typically given to other details.

Image

Since electronics were a hobby for many years when I was a kid and now I make a living writing code, I decided to put together my own lighting solution. I landed on using an Arduino inside of the stand with 6 wires running up the mounting tube into the saucer section which connect to an Adafruit TLC4957 24-channel PWM LED driver board - https://www.adafruit.com/product/1429.

The first step was to come up with a base. I was having a hard time finding anything that looked decent, was big enough to support the model (over 2' long), and big enough on the inside to mount the arduino, switches, and jacks, so I decided to build one out of MDF. I got some pretty sweet buttons from Adafruit with blue LED rings around them which I will also control via the Arduino. I was originally going to use a quick-disconnect between the base and the model, but found out pretty quickly that it would not only be expensive, but probably not very sturdy. I decided to just go with a small breadboard in the base for easy connections while I'm building, and if I ever need to take it apart once it's done. After a few coats of primer, a ton of sanding, and a few coats of Rustoleum appliance paint, I think it came out pretty decent.

Image

Next I had to write the Arduino sketch. The preliminary version just handled the animated LEDs, but has evolved to allow setting the brightness of static LED groups, but I won't be stuck since I'll be able to update it easily via a USB jack on the back for programming. Currently, the software cycles through 3 speeds each of 3 bussard-collector modes when you press the "mode" button: 2 modes as close as I could get to accurate, and the Tenacontrols bussard mode which I just think looks pretty cool. I have the mode button LED snapping on when you press it and fading out when you release it. I also have it going into a simple "test mode" when you do a long press which auto-cycles through all of the channels. Doing a short press while in test mode switches it to manual, so you can advance from one channel to the next with each press, then long-pressing again goes back into regular mode. While in test mode, the LED rings around the power button and the mode button alternate fading in and out. Here is a short video of one of the preliminary tests of one bussard collector, the lighted buttons, and the software in general:

https://youtu.be/aL_8aaBmFrs

As I mentioned, my initial plan was to just have the PWM board drive the animated parts: the bussard collectors w. 6 LEDs each, the red & green blinking nav lights, and the white strobes. I had several of my 24 channels left over even after giving a channel to each of the 12 bussard LEDs, so my plan evolved into making every LED group in the model controllable via software. This would not only permit me to do animations the way I want, but also allow control over the brightness of even static LEDs after the thing is all sealed up, including the windows. The LED tape for the windows pulls WAY too much current for the 5947 to drive on its own, so I decided to send the output of one of its channels into a PNP transistor for inverting the PWM signal into the gate of an n-channel MOSFET to drive the tape. This is a rough schematic of what the project plan at that point (don't be too hard on me... this was before I realized that the 5947 HATES LEDs wired in parallel. Also, I am absolutely no expert - I just messed around with electronics a lot as a kid, and I'm sure that much of this could be done better):

Image

I soon discovered some gorgeous high-density blue tape with a whopping 8 LEDs per inch and ordered it for my flux chillers and deflector. But, I found out very quickly that it would not even light up with anything less than 12 volts, and I was running at 9. No problem, or so I thought - the 5947 board is good for up to 30V, and the Arduino could definitely handle 12, so I ordered a new 12V supply. Since the blue tape has 16 LEDs per segment and I'm using 3 segments for each nacelle and 2 segments for the deflector, I went with 2 more MOSFET circuits. This will be sealed up inside of the saucer section and doesn't have to be pretty, so I just slapped it together on some old perf board from Radio Shack I've had laying around since the late 1970s.

Image

The next step was to wire leads up to all of the 5947's channels and breadboard the whole mess. You can see it all in action here, including the previously-mentioned fades on nav lights and strobes:

https://youtu.be/VMgacWCJqI4

Everything worked as planned, but I'm really glad I decided to breadboard it in its entirety before wiring it up in the model. One of Adafruit's big selling points of the TLC5947 board is that it has "constant current" circuitry built in which lets you skip the limiting resistors. Each channel is supposed to supply a constant 15mA of current without having to mess with resistors, so that is how I hooked it up. Initially, running the system off of a 9V power supply and just driving the single bussard collector, it would run without issue for hours on end. With the whole set of LEDs hooked up and running at 12V, the chip on the 5947 board would get too hot to touch in under a minute. I found multiple threads in Adafruit's support forums with people complaining of the exact same issue, and the advice from support was always to reduce the power to the board to closer to 5V even though it's rated for 30. I tried several things, including reducing the voltage to everything not driven by the MOSFETs. Some things I tried helped, but just about everything I tried generated more heat on its own and nothing completely fixed the problem with the 5947.

Scouring through the support forums again, I stumbled on a post where yet another user was complaining about the chip overheating at 12V, and this Adafruit tech finally explained to this person why it was overheating: You can run the board at up to 30V, but the intent is to drive enough LEDs in series from each channel that the sum of the LEDs' forward voltage is very close to the supply voltage. The bigger the differential between the supply voltage and voltage drop from the LEDs, the harder the chip has to work to reduce the current. Boom. There it was. They had been so insistent that the board didn't need current-limiting resistors that I'd never even tried it. I pretended the constant-current stuff wasn't there, hooked up normal limiting-resistor values on each channel, and now the thing runs cool as a cucumber for hours with no reduction in brightness.

Now that I finally have the circuitry worked out, I'll be priming and painting the base coat on the exterior pieces within the next few days, and it'll be time to get to wiring. BTW, how do you guys pronounce "bussard"? Which syllable gets the emphasis? Does it sound more like "buzzard" or "Picard?"
Post Reply