SMD led, Bluetooth and the thing with rotating nacelles

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

Moderators: Sparky, Moderators

Post Reply
summ
Posts: 43
Joined: Thu Dec 06, 2012 6:51 am

SMD led, Bluetooth and the thing with rotating nacelles

Post by summ »

Hi everyone,

encouraged by Bellerophon I wanted to share my experience with SMD lighting, Bluetooth control and having a Voyager kit with remote controlled rotating nacelles.

But first feel free to take a look at my Voyager thread in the Star Trek modeling section. There you´ll find a ship that´s been rigged with SMD leds. Besides a few expeptions where SMD made no sense at all.
The whole ship is controlled by an Arduino UNO that fitted into the saucer nicely. Hooked to the Arduino is a small bluetooth device from Sparkfun which accepts any command from a generic bluetooth app on my Android device. But any other BT device will do.
The electronics also incorporate voltage regulators/converters, which I soldered myself, just like everything else except the Arduino ;) Leds are in row ... resistors, transistors and the whole stuff to drive the incoming 12V.
The rotating nacelle effect is achieved by a high torque RC servo driving a sort of pulley system that turns the nacelles.

It took me a very long time to get this thing together as it is. So please enjoy. I still need to to a video. But for now there is a link to the nacelle effect in the afforementioned thread.

Looking forward to any questions you might have!
Cheers
Christian
User avatar
Bellerophon
Posts: 2621
Joined: Fri Oct 16, 2009 10:00 pm
Location: 13 miles southwest of Grovers Mill
Contact:

Post by Bellerophon »

I suspected you did something like this: http://www.instructables.com/id/Cheap-2 ... Arduino-a/

I bet the Arduino puts out enough current to run the motor. But the BT board might not even put out enough to run more than one LED.

What BT board did you use? How does it connect to the Arduino? Also, you had to give it at least a simple program--how do you do that? Do you program into the BT board? How do you interface with it to load a program?

Since seeing Ross Waddell's presentation at WF last year, my intention has been that my next major lighting project would use PIC chips, since compared to Arduino both the investment and learning curve are less. I imagine there's a way to get BT or WiFi communication with PIC chips, too. But I'm definitely interested in seeing how you do it with Arduino, too.
But isn't it all Klingon opera?

http://bellerophon-modeler.blogspot.com/
summ
Posts: 43
Joined: Thu Dec 06, 2012 6:51 am

Post by summ »

Bellerophon wrote:I suspected you did something like this: http://www.instructables.com/id/Cheap-2 ... Arduino-a/
Excactly! Besides I don´t know what the resistors doing there in your link. I´ve connected a Sparkfun BT Mate Silver basically the same way.

The Arudino pins never provide more than 500 mA of current, which is enough for a couple of leds, but no motor. At least not with a load to it. And you should not request more of them. To drive everything in my ship I require 12 V. Arduino pins also just supply 5V.
I could have done 19V or 24V, which I will consider in my next build, because I could daisychain more leds at the same time.
So the trick is to use a pin of the Arduino to drive a transistor, which handles the higher voltage. In good old Voyager the main power 12 V goes into the ship to the Arduino (max. 12 V operation voltage). Prior to that I derived to a 5 Volt regulator, because the servo runs on 5 Volts.

By the way ... the BT board requires NO programming. It connects to power (in my case 5V from one of the Arduino voltage outputs) and it uses two lines for sending and recieving. You can programm the BT device and change its name or baud rate and whatnot. But it essantially works out of the box and you use a library in Arduino to talk to it.
You can not use it to programm the Arduino (I´ve a usb port in my Voyagers belly for that matter)

Programming is another issue. I´m at work right now and will come back later. Feel free to ask if something is not celar.
summ
Posts: 43
Joined: Thu Dec 06, 2012 6:51 am

Post by summ »

Here´s my last entry for today ... ;)

in my Voyager thread you´ve stated that SMD have not been discussed that much. My guess is because of two major downsides regarding model making: there are no round SMD leds. They are all shaped rectangular. And they are a trouble to be mounted.

Using 3mm or 5mm Led is not such a big deal. You drill a hole, sitck it though, done. If you want an SMD to do the job you have to make a rectangular opening, use ca glue and hope for the best. And if you want to have the SMD stick out of your surface ... it is very tedious to have a completely smooth surface around the SMDs. In my Voyager build most of the SMD leds ended up a bit different. I used a toothpick to put some ca glue to it and pulled it back in, then trying not to move for about a minute. Once it began to bond I´ve slammed putty onto it form the backside. That helped in light blocking it to the inside AND more important ... to hold the lacquer wire in place! As I said ... soldering an SMD is easier than not ripping of the wires including the super thin and tiny connectors.

But I think they are perfect in a way. They are more "to scale" than any Led out there. A 3mm Led is "in scale" on a 1/350 Enteprise still an unbelievable big bulp. A 402 sized SMD led can be mounted to simply anywhere and when using lacquer wire in smallest diameter (like a human hair). For e.g. I have the trench covers for my 1:1400 1701-D. But with lacquer wire I won´t need them. Either I scrape a panel line in which to hide them or simply glue them to the sruface next to a panel line and paint them ...
Ant
Posts: 521
Joined: Tue Nov 19, 2002 8:02 am
Location: Oxford UK
Contact:

Post by Ant »

summ wrote:
The Arudino pins never provide more than 500 mA of current, which is enough for a couple of leds, but no motor. At least not with a load to it.
Just to call this out, the ATMEGA in the Arduino is rated at an absolute maximum of 40mA per output - and that does not mean it is safe to continually operate at that rating. Keep it under 30mA for a trouble-free long life..

You should not try and drive a motor or other inductive load directly, especially if there is no flyback protection.

Ant
summ
Posts: 43
Joined: Thu Dec 06, 2012 6:51 am

Post by summ »

Thanks for the correcting this! You are right.

In my case I´m driving a servo, which does not backfire. Although I´ve placed a diode just to be on the safe side.
It can be a bit misleading that in many examples on how to connect a servo the servo is connected directly to the pins. My test setup worked with a direct connection and never failed. Guess I was just lucky. One time I forgot to give it extra DC input and the USB gave in as I exceeded the 500mA at that end ;)
User avatar
Bellerophon
Posts: 2621
Joined: Fri Oct 16, 2009 10:00 pm
Location: 13 miles southwest of Grovers Mill
Contact:

Post by Bellerophon »

OK, so Arduino can't put out much current. Transistor switch, easy fix. I just remember Transistor Man when wiring those. Picture is from The Art of Electronics by Horowitz and Hill. Great book for those of us who need to build circuits but don't have time to go get an EE degree.

As for flyback protection, this circuit diagram illustrates why you need it and how to do it.

I'll have to buy a roll of SMD LEDs and just burn a few learning how to solder them. They're really cheap. So what if they're rectangular when they're 1mmX0.5mm? Besides, they can be flush-mounted in the model, masked and painted.

So Christian, you've got a screen on your smartphone that says "Connected toVoyager" and has buttons, two of them labeled "Impulse" and "Warp 9." How'd you do that? (Maybe I shouldn't ask--I don't even have a smartphone.)
But isn't it all Klingon opera?

http://bellerophon-modeler.blogspot.com/
summ
Posts: 43
Joined: Thu Dec 06, 2012 6:51 am

Post by summ »

I couldn´t have done it if it werent that simple ...

There are a couple of free BT apps for Android/iPhone and even Windows Phones. This particular one, BT Controller (Android) has the option to create labeled buttons. What is does is nothing more than sending either the letter "a" or "b" to the BT device. Meanwhile it also sends "c" to turn on/off the torpedo launchers. Arduino checks regularly if there is anything in the value buffer and runs a section of a programm accordingly. You can send what ever you like, doesn´t have to be a letter.
I could type in "100" and tell Arduino to use that value to drive the brightness of a specific output.

"Connected to Voyager" ... you can give your BT device a name. It is a bit tricky to get in that programming mode, which you can to if you´re usb-connected to Arduino. When you scan for any available BT devices, it now reports as "Voyager" instead of its original name. It is no necessity to do that, but I thought it would add to it ;)

But again ... there is no way to programm the Arduino over the BT connection. That is not a 100 percent true, because you need to hold a reset button on the Arduino while sending the programm. Hard to accomplish with a sealed model.
Ant
Posts: 521
Joined: Tue Nov 19, 2002 8:02 am
Location: Oxford UK
Contact:

Post by Ant »

Connecting a servo input directly to an output pin is ok because that does not directly drive the motor inside the servo, and so does not draw a lot of current.

The servo electronics decodes the input signal, and converts & amplifies it into something capable of moving the motor to the appropriate place.
summ
Posts: 43
Joined: Thu Dec 06, 2012 6:51 am

Post by summ »

Ant wrote:Connecting a servo input directly to an output pin is ok because that does not directly drive the motor inside the servo, and so does not draw a lot of current.

The servo electronics decodes the input signal, and converts & amplifies it into something capable of moving the motor to the appropriate place.
But if you power the servo form Arduinos 5V output at the same time you might fry your USB ;) stuff you might not know when venturing into electronics ...
User avatar
tetsujin
Posts: 2353
Joined: Mon Feb 28, 2005 6:08 pm
Contact:

Post by tetsujin »

summ wrote:there is no way to programm the Arduino over the BT connection. That is not a 100 percent true, because you need to hold a reset button on the Arduino while sending the programm. Hard to accomplish with a sealed model.
That's not quite true either...

When you reset the Arduino, it starts up and runs its bootloader code. If it doesn't get some bootloader instructions pretty quickly (like a fraction of a second) it leaves the bootloader and starts running the sketch.

When programming an Arduino (Duemilanove, Uno, etc. - one of the ones with a separate chip for USB communication) the board has hardware that resets the AVR processor when one of the serial signals (DTR line, I think) goes active... So the PC can instruct the board to reset via this feature.

If the bluetooth module can't trigger a reset in this way, there is another option: include software in your sketch that will trigger the bootloader when a certain command is received.
---GEC (三面図流の初段)
There are no rats.
The skulls eat them.
summ
Posts: 43
Joined: Thu Dec 06, 2012 6:51 am

Post by summ »

I´ve only seen a few guys beeing able to upload sketches via BT. Can you provide a link to the procedure?

edit: after a bit of google I found that it requires a mod of the IDE uploader code and/or couple of other tricks to upload sketches and reset. Or hardwire DTR.
I admit that it is not "impossible".
User avatar
tetsujin
Posts: 2353
Joined: Mon Feb 28, 2005 6:08 pm
Contact:

Post by tetsujin »

summ wrote:I´ve only seen a few guys being able to upload sketches via BT. Can you provide a link to the procedure?
'Fraid not. I'd be more inclined to muddle through myself. Probably by using code in my sketch to trigger a reset, like I said. Less convenient but it gets the job done.

Wiring a reset line to the outside would also work - not a sexy solution, but again, workable.

Reading the datasheet of the RN42 module, it seems as though the module does provide a DTR signal. This page appears to support the idea that that pin really does what one hopes it would do - that you can pretty much just wire it up to the Arduino's DTR input and trust it to do what you want.
I admit that it is not "impossible".
It is not "impossible", due to this minor technicality of it being completely possible...

There was an Arduino with Bluetooth comms built in at one point (ArduinoBT) - expensive and discontinued, but officially supported in the IDE. So if nothing else, getting the same Bluetooth module it used and wiring it up as it was done in the ArduinoBT (and maybe loading the ArduinoBT's bootloader, since it had more favorable timings) should work.
---GEC (三面図流の初段)
There are no rats.
The skulls eat them.
Post Reply