Hobbyist Forums banner

1 - 20 of 28 Posts

·
Registered
Joined
·
36 Posts
I've used it for lighting on the NX-01 I've STILL not finished!

I used some of the digital outs to transistors for on/off lights like the windows, and the PWM for photon torpedoes and engines. I also did the running lights using a PICaxe, and the used a digital out from the Arduino to switch power to the PICaxe.

I like using the Arduino, since you can breadboard the circuit, and pretty quickly tweak your program. Flash the program, see the results, change a few parameters, rinse, repeat...

Jim
 

·
Registered
Joined
·
36 Posts
Would you recommend programmable ICs over traditional component circuits?
It really depends what you want to do. I've used 555 timers to do flashing lights, and played around with the components to get the flash rate I want. I've also done the same thing with chips. I tend to like the chips because you can do more with them, and the development cycle is pretty quick.

You can make a few changes in the program, flash it in about 15 seconds, and see the immediate results. Also, the chip can do more than one thing at a time, so you can save space and parts count.

That said, each style has strengths and weaknesses. Also, the output of the chip often goes to other more traditional circuits for the rest of the display!:rolleyes:

If you can find a cheap development board, it might be fun to play around and see what you can do...

Jim
 

·
Registered
Joined
·
290 Posts
Not the Arduino per say, but another AVR product, the ATTiny2313. It also started with the NX-01. Each time I think I have the project the way I want I get the idea to ad something else. I decided on the ATTiny because if I get this to the point I feel it's worth mass producing I can get the ATTiny at 1/3 the cost of the ATMega. It wasn't the lighting that made me decide to use the microcontroller over the traditional circuits, it was the control panel. The microcontroller replaced so many logic componants it actually was practical to do it. I used the LED illuminatable (is that a word?) keys from Sparkfun with RGB LEDs under them to indicate the buttons status, blue for ready but not "on" (normal off) , green for "on" and red for unavailable. I'm not sure if it meets the cannon of Star Trek but when the model powers up no buttons are illuminated except for Battery which is blue. I figured you need to have a power source power to jump start impulse or warp power. I continually get new ideas and recode the setup for other models. Now I'm thinking I want to be able to interface it to an Android tablet to do an LCARS style touch style control panel for the Next Gen and later models. I've seen sell outs of 8" tablets for about $160 so the price is coming down to the point this will be worth trying in the not too far future especially as I delve into it find I can use the tablet to control multiple kits at once.
 

·
Registered
Joined
·
36 Posts
What got me started was realizing with all the lighting on the NX-01, I wanted to control the lights in about 8 separate circuits in a sequence. I was too lazy to sit there and flip switches. ;)

So I started fooling around with pics, got scared by assembly programming a bit, and tried an arduino. It proved to be pretty nice for breadboarding and devleoping, and I'm now working on converting all of it to a stand-alone circuit board.

I've also fooled around a bit with picaxe chips, and one of these days when I get the NX finished, I'll try to learn more complex programming.

I'm also working on a diorama with some of the Pegasus UFO's in a landing bay. More fun with leds, pwm, and some such.

Great fun!

Jim
 

·
Registered
Joined
·
160 Posts
Ive been learning MPASM for the Microchip devices, Ive built an enterprise flasher circuit already, but Im a long way from being able to design boards and such.
Most of the stuff Ive been doing focusses on the PIC12F628A and I bought a PicKit3 to do the programming with.

I also bought an Arduino Nano which I have to admit , it FAR easier to get started with.
That said, I immediately found that the 'nano has issues for what I wanted to do for example cylon eyes and such. The easy PWM stuff on the arduino only allows for 5 PWM outputs, which I would want more which you need to do software based PWM for on individual outputs.

I notice a lot of the 'pro' lighting kit guys out there are also using the ATTINY 2313 in their products.
Are the ATTINY devices easier to learn than Microchip's or is it because the development costs are cheaper? Id like to hear everybody's thoughts on this!

Cheers
 

·
Registered
Joined
·
290 Posts
In my case I had to replace my entire workbench for both modeling and electronics. For the past 18 months most of my excess income (is there such a thing) has been going to re-equip both and stock the closet of the unbuilts since kits are available for a limited time they took precidence.

The Atmel cips weren't available when I last had a work area however at that time I wasn't using microprocessors at all if I needed processing power then I'd have gone for a Z80 CPU mostly out of familiarity. I was laying out a control panel last year when it became apparent that a microprocessor would replace most of the logic circuitry so I took the plunge. I went with the Atmel mostly because of lower start up cost. I ever make something worth mass producing the ATTiny will help me keep my costs lower. The Mega is about $3.50 for a single DIP and is overkill for my needs, I get the 2313 for $1.50 but see now I can get the 4313 (same chip twice the code space) for about $1 from Mouser if I buy 25, .80 if I buy 100.
 

·
Registered
Joined
·
58 Posts
ATTINY and the Arduino

You can use the Arduino as a programmer for its smaller siblings.

Here is an example - https://www.youtube.com/watch?v=qf23xtkrgkc&feature=plcp

and the sketch code behind it. Note that is code is done by me - and I'm a very amateur (NOT a programmer) so don't kill me. It is written to be modular as far as the number of LEDs you can control and what chip you use so it is a little more complex than a one line one LED program (sketch). Key is the line

byte pin[LEDcount] = {0,1,2}; //Pins assigned to those LEDS

this example is for the ATTiny85, for others, just change the respective pins in the sketch to match your wiring and the on and off times to meet your needs.

Benefit are:
1. You develop on the Arduino that also dubs as the ATTiny Programmer.
2. Low parts count - note there are no timing resistors or capacitors, just the device, LED and current limiting resistor per channel.

Code:
/* 
 *
 *  Blink Multiple LEDs without Delay on/off times individually assigned
 *
 */
const int LEDcount = 3; // Number of LEDS used
byte pin[LEDcount] = {0,1,2}; //Pins assigned to those LEDS
unsigned int oninterval[LEDcount] = {1000, 950,1000}; // On intervial time for leds (max 65535 ms)
unsigned int offinterval[LEDcount] = {1000, 50,1000}; // Off intervial time for leds (max 65535 ms)
unsigned long timeoff[LEDcount] = {0,0,0}; // What time was the LED last tumned OFF
unsigned long timeon[LEDcount] = {0,0,0}; // What time was the LED last tuned ON
int CurrentLedState[LEDcount] = {0,0,0}; // What is the current LED state of each LED in the array

void setup()
{
  for (int i=0; i<LEDcount; ++i)
  {
    pinMode(pin[i], OUTPUT); //initilize all used LED pins as outputs
    digitalWrite(pin[i], LOW); //Turn LEDs off to start
  }
}

void loop()
{
  unsigned long CurrentTime = millis(); // assign current elapsed time to variable "CurrentTime"
  for (int i=0; i<LEDcount; ++i) // loop through all LEDS
  {
    if (CurrentTime - timeoff[i] > offinterval[i] && CurrentLedState[i] == 0)
    {
      digitalWrite(pin[i], HIGH); //Turn LED on
      timeon[i] = CurrentTime;// Set timeon = current time (or relative 0)
      CurrentLedState[i] = 1; //Flag LED state on since we turned it on
    }

    if (CurrentTime - timeon[i] > oninterval[i] && CurrentLedState[i] == 1)
    {
      digitalWrite(pin[i], LOW); //Turn LED off
      timeoff[i] = CurrentTime; // Set on timeoff = current time (or relative 0)
      CurrentLedState[i] = 0; //Flag LED state off since we turned it off
    }
  }
}
 

·
Registered
Joined
·
559 Posts
Picaxe

I have used the PICAXE chips to control LEDs and other things in models.
PICAXE chips are cheap, and just need 5 volts to make them go. Programming software is free and they are programmed via an RS232 (Serial) port on a PC. (Or you can use a USB to serial convertor)
Programming language is a form of BASIC so it is very easy to use.

Have a look at www.picaxe.com for more information.

Fun Fun.

Alien
 

·
Registered
Joined
·
373 Posts
I have also used the PICAXE and found it easy to program. However it seems more people are going to the arduino so I might get a kit and play with it.

I believe the PICAXE is limited by the number of outputs you can use. I have not checked it out but I hear the arduino can control more LEDs if that is what you want to do.
 

·
Registered
Joined
·
1,719 Posts
There's an open source Arduino script (not mine) for controlling a TOS E here:
http://rweather.github.com/arduinolibs/blink_startrek.html
Lots of other scripts on-line but they take some searching in often very weird places. I love the Arduino clones that can fit on top of a penny, perfect for hiding in Cylons. Lots of open source scripts for the flaming Cylon eye out there, too, which would work for J2 light rings and TOS E nacelles much better than simple flashing or chasing led circuits, making digital effects look mechanical or even random.
 

·
Registered
Joined
·
36 Posts
There's an open source Arduino script (not mine) for controlling a TOS E here:
http://rweather.github.com/arduinolibs/blink_startrek.html
Lots of other scripts on-line but they take some searching in often very weird places. I love the Arduino clones that can fit on top of a penny, perfect for hiding in Cylons. Lots of open source scripts for the flaming Cylon eye out there, too, which would work for J2 light rings and TOS E nacelles much better than simple flashing or chasing led circuits, making digital effects look mechanical or even random.
Thanks for posting this! I just skimmed it, but a great resource for doing lighting for all kinds of things... now I just have to read through it and try to understand it.

Jim
 

·
Registered
Joined
·
408 Posts
I'm currently working on the program to control the lighting for the 1/350 enterprise refit.

It's almost complete, theres a bug in 2 of the leds which fade, some other leds need to be down faded instead of turning off and servo control needs to be added.

Only other thing is 2 sections of the code need to be looped. otherwise its almost complete.

https://www.youtube.com/watch?v=f-trRl2oFaw

the right hand side white led represents the cabin lights and flood lights. I will be using a seperate circuit to add a delay in the cabin lights and the flood lights coming on taking its trigger signal from that led pin.

same with the shuttlebay landing strips circuit from pin 7.

If anyone wants the code and think they can refine it for their project, PM me.

the strobes and navs section has simple to adjust timings. literally you set the "on time" and "off time" individually in milliseconds.

the code has a startup mode, impulse mode and warp mode. each mode has adjustable "stay in this mode" times before moving onto the next "mode" and you can adjust the time between the next action too.

It IS still a work in progress though.

But the idea behind it is to be a universally usable program for all star fleet models.
 

·
Registered
Joined
·
2,188 Posts
Discussion Starter #19
It's been 9 months since I started this thread, but I finally got around to purchasing an Arduino UNO board to play around with (other projects have just gotten in the way--I'm sure you all know what that is like).

I hooked it up this morning and it looks like a very promising playground.

I'm looking for a good starter book on the Arduino. There are PLENTY of them out there. Anyone have any suggestions?
 

·
Registered
Joined
·
16 Posts
Say, for example, you have a space of 1inch x 1inch x 1/2 inch and you need to light up 10 LEDs, one by one in a sequence. No problem! You just need a good old '555 & 4017' pair in SMD. So, you can do a simple single-sided circuit board for this.

Now, say that the 10 LEDs, not only does it goes up, it needs to come down as well, i.e. Knight Rider. Alas, the '555 & 4017' above can't hack it and even if they can, it would be only 5 LEDs and lots of creative wiring where the circuit board is now double-sided.

Now, say, that additional four LEDs needs to flicker almost randomly and the 10 LEDs now needs at least another three patterns that can be activated via push button. Yep, cheep and cheerful '555 & 4017' can't hack it anymore. Even if they can, the size of the circuit board would be huge and also takes up a lot of power. Plus, it the client needs to change the sequence on the fly, you're out of luck.

So, in comes the microprocessor which not only does the job for you but more. Also, the most amazing thing is that its only one small chip. When I was into microprocessors, the first choice was the PIC from Microchip. I am not sure as to why, but I have seen them in a lot of applications such as them being used to bypass the protection in Playstation machines, and also those Satellite Decoder cards. Also, they work nice with a minimal voltage of just 3 volts.

For one chip that does so much and also in a tiny footprint which is crucial in a model kit, I am quite impressed. I don't usually need any more components other than a reverse polarity protection and also, some transistors.

One of a good example is the Enterprise Navigation/Strobe module which I have built in 2009 with the intention to sell them but cancelled at the last minute due to other products coming out. With some jumper settings, the board can give you the different RED/GREEN Navigation and WHITE Strobe lights for the following 1/350 ships:

1) Motion Picture Enterprise 1701-A
2) Star Trek VI Enterprise 1701-A
3) Enterprise NX-01, and
4) JJ Abrams Star Trek 2009

You can see the video here:

And just a few weeks ago, I have bought an Arduino UNO for playing but truth to be told, I have not even done anything to it yet other than to plug in the USB and run the default sketch, which is to make the orange LED blink. :lol:

 
1 - 20 of 28 Posts
Top