Planning a project-To Arduino an Enterprise-C

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

Moderators: Sparky, Moderators

Post Reply
Redag
Posts: 124
Joined: Fri Jan 14, 2011 1:50 am
Location: Chicago, IL

Planning a project-To Arduino an Enterprise-C

Post by Redag »

I've entered a period of relatively little building action as I plan a transition to building lighted kits. I've got a Galor, DS9 and D'Deridex all sitting around either slowly being prepped or waiting for tools/supplies to be acquired.

And beyond that horizon I'm about to acquire a Pro-Shop USS Yamaguchi which I intend to build as a 'mint' version of the Enterprise-C.

Reading about lighting has left me with the distinct feeling that I am better off substituting software for hardware in cases where I want complicated effects. So I am targeting the Enterprise-C as a long-term first Arduino build. Here's what I'm planning. Please comment/critique and let me know what you think can be done, and what is a pipe dream.

Switch: the switch should 'listen' after first touch and set the effects mode based on number of touches in period 'n' where 'n' is less than three seconds.

Modes:

1) Runs all lights directly from a cold start, including effects patterns to be described below. Powers down after five minutes.

2) Powers up over about 15 seconds to a cold-propulsion configuration. Times out performs sequential power-down after five minutes.

3) Powers up over 15 seconds to an impulse propulsion configuration. Times out in five minutes, gives sequential power down.

4) Powers up over 15 seconds to a hot-warp configuration including one-time nacelle flash as it enters the five minute 'on' interval. Warp 'exit' flash performed as it enters sequential power down.

Effects:

Warp: Fade up of engine LEDs in all modes save 1 (cold start). Bussard LEDs have subtle flutter. Warp line LEDs have sequential sinusoidal fore-to-aft effect, becoming subtle as power-up completes. Additional LEDs called for warp entry/exit flash in nacelles.

Impulse: Subtle flutter, fades up and down when called to power-on/power-off respectively.

Flashers: Runs appropriate flash and strobe effects. Fade in/out with PWM? May not make sense for discrete flashers.

Deflector illumination: It may not be canon, but mimicking the color-changing refit deflector with a tri-color LED is hard to resist. Runs in sequence to power-up/power-down where appropriate in the modes above.

Window illumination: Fade in/out, save in the 'cold mode'.

Optional display base: Runs small, low-spec negative LCD or perhaps just acrylic backlight for the base. Color change of backlight to indicate mode of operation?


From what I can tell the software is simple, and I can set much of this up by brute force in the 'loop' portion. But I haven't yet looked to deeply into how I can drive many LEDs while conserving output pins. I've seen references that indicate I can, but I haven't up-familiarized myself yet.

Am I crazy? Totally nuts? Missing something obvious?
User avatar
tetsujin
Posts: 2353
Joined: Mon Feb 28, 2005 6:08 pm
Contact:

Post by tetsujin »

You can take this with a grain of salt, bearing in mind that I've never actually completed a lit starship model:

One thing you might need to consider is the limits on output current. The ATMega can (IIRC) source or sink a maximum of 40mA for each I/O pin, with no more than a total of 200mA for all the I/O pins.

For a starship model, I would guess that this would not be enough. Like a nacelle would probably use ten LEDs or more - if you're driving them with the Arduino's voltage level, then a lot of them (possibly all of them) are going to have to be in parallel - which handily puts you up against that 200mA limit pretty quickly.

For this reason you may need to think carefully about how you set up the circuit. Maybe that means you have a separate LED driver controlled by the ATMega... Maybe it means you use a dual-voltage supply, use a high voltage to drive long series-chains of LEDs and use the ATMega to sink (output low) or block (input mode, high impedance with no pull-up) the current flow at the other end of the LED series. There are different ways you could approach the problem.
---GEC (三面図流の初段)
There are no rats.
The skulls eat them.
Redag
Posts: 124
Joined: Fri Jan 14, 2011 1:50 am
Location: Chicago, IL

Post by Redag »

Thanks for the response. From what I've seen it seems like Arduino's can pass wall wart 9v current along as well as the onboard 3 and 5 volt options. I haven't checked the amperage yet, but I assumed that the board would pass the properties of the power supply along mostly unmitigated.

Is that false?
User avatar
Disillusionist
Posts: 1134
Joined: Wed Apr 09, 2003 10:11 pm
Location: Closer than you think

Post by Disillusionist »

I used an arduino with great success to control my PL refit. However, the current requirements of multiple LEDs are far beyond its capabilities. I ended up building a separate power board with MOS FET transistor switches that could be turned on and off by the arduino.
Affordable laser cutting and engraving for the hobby community

www.laserfirecreations.com While you're at it, follow us on Facebook
User avatar
tetsujin
Posts: 2353
Joined: Mon Feb 28, 2005 6:08 pm
Contact:

Post by tetsujin »

Redag wrote:Thanks for the response. From what I've seen it seems like Arduino's can pass wall wart 9v current along as well as the onboard 3 and 5 volt options. I haven't checked the amperage yet, but I assumed that the board would pass the properties of the power supply along mostly unmitigated.

Is that false?
A standard Arduino does include a "Vin" pin on the shield header, which (IIRC) does pass along unregulated input voltage.

But even with 9V to work with - your series strings won't be more than 3 white LEDs at most (even that may be a little generous) - so if you're driving each string at 20mA, the Arduino will be able to control no more than 20-30 LEDs total. Or at least, no more than 10 of those LED series strings can be on at any one time. But maybe that's enough...

You may have to write your own PWM code to control the brightness of the LEDs if you're controlling them with the Arduino and driving them with the 9V source. If you connect the anode end of the LED series string to +9V, and the cathode end to an Arduino I/O pin, and you're using the Arduino to control the brightness of that LED chain, you want it to oscillate between 0V and "high impedance" (passing no current) - not between 0V and +5V.

Also - if you're using that +9V to drive LEDs it has to be regulated somehow. Wall wart power supplies aren't necessarily regulated - which is fine for the Arduino since it has a regulator of its own... But if you're relying on that 9V to light LEDs and it's not really 9V, that could mean a big difference in how much current the LEDs pass - which could mean inconsistent lighting effects, or burning out the LEDs and/or the Arduino.
---GEC (三面図流の初段)
There are no rats.
The skulls eat them.
Sparky
Moderator
Posts: 2404
Joined: Thu Jun 05, 2003 8:28 am
Location: Are we there yet? (Chicago)
Contact:

Post by Sparky »

Ya you're gonna want to off load the driving of LEDs from the chip, completely. you don't want that thing trying to do any power driving requirements. The internal wiring just can'a break the laws of physics ;)

the MOS FET solutions will be the best idea, those things draw almost no power to drive (its field effect) and have very little internal resistance to eat into the power requirements (also means they won't produce a lot of heat).

IRF series are good to look at some of them have built in short circuit protection!

http://www.irf.com/product-info/hexfet/
<a href="http://www.kc6sye.com/2_wheresaneatpart.jpg" target="_Sparky">Is this plastic thingy on the counter a neat part?</a> <a href="http://www.kc6sye.com/1_casting_inprogress.jpg" target="_Sparky">Let's cast it.</a>
Sloucher
Posts: 72
Joined: Mon Dec 07, 2009 5:49 pm
Location: UK

Post by Sloucher »

For multiple led driving, you could consider using a led matrix driver like a MAX7219 - they can be a bit pricey but Maxim will supply samples for free.

Have a look on the Arduino site for matrix controllers, you'll see what I mean.

Have you thought about building the ATMega as a standalone rather than using the complete Arduino board? All it needs (apart from 5v) is a couple of small caps and a crystal.
WiredFX

Small Lighting and Effects UK
User avatar
tetsujin
Posts: 2353
Joined: Mon Feb 28, 2005 6:08 pm
Contact:

Post by tetsujin »

Sloucher wrote:Have you thought about building the ATMega as a standalone rather than using the complete Arduino board? All it needs (apart from 5v) is a couple of small caps and a crystal.
It doesn't even need those. You can skip the crystal if you use the ATMega's internal oscillator. (The internal oscillator's timing frequency is temperature-sensitive and can vary by around 5% and so it's not precise enough for asynchronous serial communications - but it's quite adequate for blinking LEDs.) The caps you'd typically attach are for the crystal (which you don't need if you're not using it), and to provide some power filtering (not a bad idea if you want your circuit to last - but not critically necessary either, especially if you're feeding it regulated voltage.

In short, a modern microcontroller can operate without any external components... That's one of the things I find really delightful about them.
---GEC (三面図流の初段)
There are no rats.
The skulls eat them.
Sloucher
Posts: 72
Joined: Mon Dec 07, 2009 5:49 pm
Location: UK

Post by Sloucher »

True 'nuff :D
WiredFX

Small Lighting and Effects UK
Redag
Posts: 124
Joined: Fri Jan 14, 2011 1:50 am
Location: Chicago, IL

Post by Redag »

Sloucher, I've seen people talking about/using the Matrix solution for running many LEDs, but I haven't seen a lot on practical implementation.

I've also heard that the Arduino solution is somewhat overbuilt and that it can be stripped down to the microcontroller proper pretty easily. Do folks have any links to projects that proceeded that way?

Currently I'm trying to gain awareness by seeing what's been done, so that would be pretty helpful. The code side looks very comfortable which is why it has me so excited.
User avatar
tetsujin
Posts: 2353
Joined: Mon Feb 28, 2005 6:08 pm
Contact:

Post by tetsujin »

Redag wrote: I've also heard that the Arduino solution is somewhat overbuilt and that it can be stripped down to the microcontroller proper pretty easily. Do folks have any links to projects that proceeded that way?
The extra bits on the Arduino (that is, the stuff you might frequently not need) would be the voltage regulator, the USB-to-serial circuit, and the bootloader code on the AVR.

Benefits of doing away with the extras are cost and bulk. (A bare microcontroller costs between $2-$10 depending on what you get.) But you also lose some convenience, of course.

You might consider some of the smaller Arduino versions - boards like the Pro Mini. Something like that will cost more than a bare micro ($20 instead of $5 or whatever) but you retain most of the important advantages of using the Arduino (voltage regulator, bootloader code, and having it all hosted on a pre-assembled PCB). The omission of the USB-to-serial converter isn't a big deal, you can buy those in cable form and just hook 'em up when you need 'em...

"Teensy" is another good one, and aptly named. It's really very small. It doesn't provide a voltage regulator built-in, but it does incorporate USB (unlike the Arduino, the Teensy uses a single AVR microcontroller which also provides USB features.) - it is said to be compatible with the Arduino programming environment, at least once you do a little configuring...

Boards like the Pro Mini or Teensy can be very convenient for their small size and good feature sets. You do pay a bit more for them, but having a compact circuit on a solid PCB, with convenient places to solder wires on can make things a lot easier. They're a comfortable middle-ground between a full Arduino and a bare ATMega chip.

As for the matrix thing - I don't think there's much in the way of Starship projects that would benefit from a matrix. Usually a matrix is useful as a way to get the most out of a limited number of I/O pins. But you're not driving a large number of independent lighting effects... There's maybe seven or eight things going on independent of one another (flashers, strobes, torpedos, nacelles, deflector - any one of those effects may require just one or many LEDs but they operate in unison.) - so each independent group of LEDs really just needs one I/O pin, and the trick is just turning the signal from that I/O pin into enough power to do the job.

Using a matrix also makes your wiring more complicated... So, yeah. :)
---GEC (三面図流の初段)
There are no rats.
The skulls eat them.
Madman Lighting
Posts: 1818
Joined: Sat Mar 05, 2005 9:16 am
Location: Serenity.
Contact:

Post by Madman Lighting »

I agree with putting all the power handling into a set of external MOSFETs or other similar devices. Have a look at the 2N7002 MOSFET. Its small, can be driven by microcontroller logic levels, and its cheap.

I really driven person would invent a constant current regulator circuit to drive long strings of LEDs from a high input voltage. That would give you a constant brightness no matter what your input voltage happens to be. I know someone who did that (me!) but giving out just how I did it might be giving away too much.

:wink:
That Madman Who Lit Up Deep Space Nine
julioz
Posts: 2
Joined: Wed Jul 17, 2013 11:12 am
Location: Maryland

Just got a Yamaguchi with no instructions

Post by julioz »

Hi,

Just joined the forums and saw your post. Was wondering if you still have the instructions for your Yamaguchi? I just got one with no instructions and wanted to know if you might make a scan and email it to me if you can?

Very nice kit but not much good without the instructions :?
User avatar
Joseph C. Brown
Moderator
Posts: 7301
Joined: Thu Jul 11, 2002 6:13 pm
Location: Oak Ridge, TN, USA

Post by Joseph C. Brown »

________
Joe Brown
Shizman
Posts: 288
Joined: Mon Dec 01, 2008 11:24 am
Location: Cambridge, Ontario, Canada

Post by Shizman »

A TLC5940 or TLC5947 will both work well for controlling LEDs and their respective brightness. There's an Arduino library for the 5940 already and the 5947 isn't that hard to use. I've used both and they work very well.
julioz
Posts: 2
Joined: Wed Jul 17, 2013 11:12 am
Location: Maryland

These will help but . . .

Post by julioz »

These will be good for general assembly, but not the lighting. The kit I have is the AMT Pro Shop Lighted Yamaguchi. The instructions have detail on wiring and placement of the lights.

Thanks for the help and quick response. I think I might like it here :)
Redag
Posts: 124
Joined: Fri Jan 14, 2011 1:50 am
Location: Chicago, IL

Post by Redag »

I actually misplaced the instructions, so the link is useful for me as well. Hooray!
galaxy_jason
Posts: 631
Joined: Fri Apr 10, 2009 2:44 pm
Location: Dallas
Contact:

Post by galaxy_jason »

--
-Jason Ware

---------------------------------------------------------
VISIT MY ASTROPHOTOGRAPHY HOMEPAGE!!
ASTRO IMAGES FOR DOWN-LOAD, PRINTS
http://www.galaxyphoto.com
---------------------------------------------------------
My Other Hobby....High Power Rocketry
http://www.galaxyphoto.com/rockets.htm
Redag
Posts: 124
Joined: Fri Jan 14, 2011 1:50 am
Location: Chicago, IL

Post by Redag »

It's safe to say I await all the gory technical details of this project, the more the better.
ShortBtwnHdset
Posts: 27
Joined: Tue Jun 18, 2013 12:48 pm

Post by ShortBtwnHdset »

Hi Redag!

I'm going to be using arduino to light my Voyager build. Like what others have said, you need the arduino to do signaling/control, and use relays and single mosfet or transistor circuits with separate power in to step up the current or voltage. There are boards made to do this, called LED drivers.

Look at this, bottom of page, led booster boards:

http://www.ngineering.com/lighting%20ef ... rcraft.htm

Also look at this:

http://www.sainsmart.com/arduino-compat ... anove.html

I've bought two of the three channel booster boards. May need one or two more channels when I'm done.

So, take 12v power supply to your model. Take one circuit leg and step down the voltage to 9v for the arduino power in. Any circuit that uses less than 200mA run from a booster board channel, with 12V V-in and arduino controlling. Any circuit requiring more than 200mA (hull interior lights, for example), 12V in to relay, again being controlled by arduino. Lot's of combinations available. For instance relays could control AC current to cold cathodes, long lengths or parallel lengths of LED tape. Relays could also be used for switching between fwd and aft photon torpedos. 12V source would also allow you to string more LEDs in series (what is it, 3 to 4 whites?),so you could figure out a series parallel arrangement of LEDs still under the 200mA max of a booster channel. All circuit legs should use a common ground.
Redag
Posts: 124
Joined: Fri Jan 14, 2011 1:50 am
Location: Chicago, IL

Post by Redag »

Thanks for the links. I'll be interested in seeing how this works out. At the moment I am likely to first use an Arduino in a Pegasus build, prepping the on/off color effects for the engine lights.
galaxy_jason
Posts: 631
Joined: Fri Apr 10, 2009 2:44 pm
Location: Dallas
Contact:

Post by galaxy_jason »

Don't use clunky relays, 2N2222 transistors are plenty of dirive for most
LED projects.
--
-Jason Ware

---------------------------------------------------------
VISIT MY ASTROPHOTOGRAPHY HOMEPAGE!!
ASTRO IMAGES FOR DOWN-LOAD, PRINTS
http://www.galaxyphoto.com
---------------------------------------------------------
My Other Hobby....High Power Rocketry
http://www.galaxyphoto.com/rockets.htm
ShortBtwnHdset
Posts: 27
Joined: Tue Jun 18, 2013 12:48 pm

Post by ShortBtwnHdset »

Don't use clunky relays, 2N2222 transistors are plenty of dirive for most
LED projects.
Hi Jason!

Clunky relays have their uses. I'm hoping to use 3' to 4 ' of LED tape in my voyager for the main and secondary hull lighting. That's anywhere from a third of an amp to a half amp of current.
Don't know the specs on the transistor/mosfet your listing, don't want to figure out how to hook it up, not everyone wants to breadboard together a circuit, especially for multiple channels. And, there are certain things that are hard to do without a relay, whether it be mechanical or optical.

For instance, my plan is to use an IR remote to control everything. Switching between fwd and aft photon torpedo's takes more code without a relay (routine for fwd, routine for aft), and I wont have a mechanical switch for the momentary on needed. Relay works perfectly for that. Why do you think they are still used? They are usually for switching AC or high voltage DC, or high current. I plan on using all 4 on my build. Could it be done differently, yes. I'm not even saying the circuit will be efficient. But I'm not an electronics guru, just need a down and dirty method of doing what I need, without getting overwhelmed in electronics.

By the way, amazing job on that 6' enterprise!!! And all from scratch!!!WOW, I'm awed!!!
Post Reply