Random operating lights in structures?

I didn’t know the Arduino ULN2033 stepper motor driver could be used to drive switched outputs, my Arduino starter kit came with a ULN2003.

My current demand is very low, 35ma at 9½ volts for most ports with a max of 60ma. I went with 2N3904 200ma transistors as a voltage interface from my 9½ volt lighting power supply. 200ma will handle almost all of the goodies on my layout, for high current things I use TIP-31 & TIP-3055.

You wiil have look too Randy for info on the ULN2033, the Arduino programming is a bit over my head. I got the hang of programming the Uno to do what I needed by starting out with a Sketch from the Arduino library, it was close enough to get me going then I did some Mel mods to the timing to get it to do what I wanted. Scratch Programming isn’t my thing.

I got hung up trying to build up a sketch to operate a mini stepping motor as a wig-wag, after way too much time involved I put everything in a bin box on the shelf.

<

The ULN2003 isn’t specifically a ‘stepper motor driver’ - they use it as oen in a lot of the starter kits. It’s really just a package of 7 Darlington transistors with snubber diodes included (but when driving a relay you really should still add your own snubber diodes and not rely on the chip). So it can be used to turn anything on and off, up to the rated current and voltage (I think it’s 40V). 4 of the outputs together can form an H bridge to drive a DC motor with PWM, like a DCC decoder’s output stage, or pretty much anything else you can think of. The actual ULN2003 library in the Arduino IDE is probably geared towards using it to drive a stepper motor, for lights or other simple on/off operations you wouldn;t even need a library, just connect say D5 output to one of the UNL2003’s inputs and turn it on and off with basic digitalWrite commands.

There are other options as well, all you need is a buffer chip to allow the relatively low power Arduino output pin to drive a larger load. Even a basic transistor circuit would work - examples can be found on many of the relay boards. Much of that stuff is open source hardware so the schematics are freely available, instead of the relay coil and the snubber diode you would connect your LEDs there and that’s it. All that transistor is doing is acting as a higher current switch to control teh relay coil since the Arduino can’t do so directly. Whether it controls a relay coil or a string of LEDs really makes no difference. There are some technicalities that could affect how this works but experimenting is aprt of the fun and worst case with the transistor driver is you either can;t turn the LEDs off or they won’t come on, it wouldnt fry anything. The ULN2003 and similar chips shouldn;t have any issues with this unless you exceed the maximum current

–Randy

<

As usual Randy is right on the money with the ULN2003! I checked into them and for $7.54 I have 10 boards on the way.

I tested the one I have and it’s working from an Arduino Uno perfectly. It was labeled Stepper Motor Driver in the Startup Kit so I didn’t go there.

Ed that board should work fine for what you want to do. I know they will make my dinking around much easier.

Thanks again Randy!

Mel

Modeling the early to mid 1950s SP in HO scale since 1951

My Model Railroad

Excellent! Just the information I was looking for…

Thanks again to you both, Mel and Randy. (and Dave for starting the whole thread!)

Regards, Ed