Trains.com

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Light "controller" of sorts

3247 views
46 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    January 2006
  • From: Northeast OH
  • 2,268 posts
Posted by NeO6874 on Monday, October 29, 2018 8:44 AM

gregc

the uln2803/4 is a darlington array that is useful as a sink (pulling something to ground).

is there a similar device (octal array) for sourcing (Vcc) higher current?

i've found devices like fdc6401n (dual, hex).

 

 

I'm using SN74HC595 Shift registers -- though they're (IIRC) limited to 20 mA per pin, or 70 mA total through VCC  (or GND - though I've never bothered trying to use them as sinks).

at 5 volts, with a nominal forward voltage of 3-3.3V, the little test-array I'm running is pushing about 8-9 mA / LED (220 Ohm resistors)

Granted, these are chineseium LEDs, so they may not all actually be anywhere near that value (but after 4 days of running, the shift registers were still working fine...)

-Dan

Builder of Bowser steam! Railimages Site

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Monday, October 29, 2018 9:04 AM

NeO6874

Nice - will have to check the 'bay for those guiderails.

 

I really like that "cards in a box" approach -- toying around with a redesign that'll be similar now.  Except that I'll add a backplane power source, and some card-edge connectors for power.  (outputs will be the other side, not sure what yet, maybe 8p8c).

 

I also prefer that type of back plane but I tried that early on and had problems with pin alignment.  I solved the alignment problem but I use the Arduino type connectors and didn’t like having to apply as much pressure as needed to plug them in.  I don’t like to force things.
 
 
 
I’ve standardized on connectors for my layout, the Arduino header type for my Arduino wiring and the micro header connectors for everything else.
 
 
 
There is a 5cm x 7cm card (very close to the same size as a UNO) that has edge connectors and I might give that a shot down the road.
 
 
16 x2 on each end of the card.
 
Mel
 
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
 
  • Member since
    July 2009
  • From: lavale, md
  • 4,678 posts
Posted by gregc on Monday, October 29, 2018 9:34 AM

NeO6874
The MOSFETs will handle something silly like 20 amps

did you actually build a circuit using mosfets?   if so, were they discrete or an array?

i have large discrete mosfets, but the fdc6401N is rated at only 3A.   still plenty

greg - Philadelphia & Reading / Reading

  • Member since
    January 2006
  • From: Northeast OH
  • 2,268 posts
Posted by NeO6874 on Monday, October 29, 2018 10:24 AM

Yeah, The edge-connectors are just an idle thought -- I think that connectors in general look cleaner than using header pins; and "needs force to insert" tends to also mean "needs force to remove".

Going with the "split" approach, the brainbox board is 1.0 x 1.3 inches -- just big enough for an attiny, capacitor, and an rj45 connector for power/signal output (or programming input). 

Remotes in or near buildings would then take input, and have howevermany shift registers the building needs (up to four, assuming we stick with that ATTiny25 ... I haven't really messed with seeing how well the code scales, so let's assume we can double it (8 registers, 64 LEDs) with a -45, or double it again (16 registers, 128 LEDs) with an -85).

 

Although 16 registers is 1.12 A if we're driving them as hard as they'll go (70 mA apiece), and 24AWG wire is only rated for 570mA per conductor (and I'm not 100% sure we could use two conductors)

-Dan

Builder of Bowser steam! Railimages Site

  • Member since
    January 2006
  • From: Northeast OH
  • 2,268 posts
Posted by NeO6874 on Monday, October 29, 2018 10:30 AM

gregc

 

 
NeO6874
The MOSFETs will handle something silly like 20 amps

 

did you actually build a circuit using mosfets?   if so, were they discrete or an array?

i have large discrete mosfets, but the fdc6401N is rated at only 3A.   still plenty

 

 

Just a test board, and actually, now that I double-check the parts ... they're actually FQP30N06L, and rated to 32A apiece.  (Not the FQP27P06 which're 27A)

-Dan

Builder of Bowser steam! Railimages Site

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Monday, October 29, 2018 4:42 PM

 If you really need ports, there are the devices I am planning to use on my CMRI nodes - Microchip MCP23S17 poort expanders. There is a 23017 which is I2C and a 23S17 which is SPI, and each has 16 I/O pins. So 2 pins (or 3 if using SPI) becomes 16 - but not quite. Each 23x17 has 3 address lines to set the internal address, so you can have 8 of them per bus, so 2 or 3 pins becomes up to 128 pins! Not quite as cheap as the 74HC595 shift registers, but they also don;t do bit shofting to get the output - each 8 bit port (there are 2 per 23x17) is individually addressable. They are $1.30 in single unit quantities from the usual distributors, maybe cheaper on ebay. But remember, that's 16 pins for that, so 2x of the shift registers. And there are Arduino libraries for either version.

                                       --Randy


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    January 2006
  • From: Northeast OH
  • 2,268 posts
Posted by NeO6874 on Monday, October 29, 2018 6:39 PM

Heh, I've got a boatload of the sn74 registers right now. This initially started out as a project to see how small I could get the code while making the missus a little present (and yep, I crammed it into an attiny25 using plain Arduino IDE code.  I think if make use of more inline assembly, I can shrink it some more).

As I was playing with it, I figured it might be useful on a layout.  

Expanding it is more just a thought exercise -- 32 individual random LEDs is already probably pushing it Smile.  But it helps me learn if I have a semblance of an actual project (like pluggable cards in a power bus to act as brainboxes for ... something Wink).

I was also looking into the Maxim Integrated MAX6971 series - but they're 4.50 apiece (yuck).

 

-Dan

Builder of Bowser steam! Railimages Site

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Monday, October 29, 2018 8:37 PM

 That's sort of how MRCS does their cpNode - thye have add-on boards for IO expanders using the MC23017, and it just interfaces to the main board with 4 wires, 2 for the I2C and 2 for power and ground, and you can daisy chain another one to the first.Nice thing is the hardware design is the same for no, one, or two expansion boards. It's all just a software change to address the extra ports over the bus.

 I checked out the MAX6971 - it seems liek it's really meant for controlling large LED strings - with 36 volts per channel you can hook 10 LEDs in series and then it's a constnat current cource for each one - plus PWM on the enable pin controls the LED brightness. Might be an option for layout lighting, but it's way overkill for structire lighting. There are cheaper smaller LED constant current drivers for single or small quantity LEDs - then you don;t have to supply any resistors on the LEDs themselves.

                                        --Randy

 

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    January 2006
  • From: Northeast OH
  • 2,268 posts
Posted by NeO6874 on Tuesday, October 30, 2018 5:25 AM

Yeah, the 6971s are for a different LED-based project of mine (not related to MRR'ing). 

Those registers you mentioned look like simple i/o expanders -- I probably misread the datasheet, but it didn't look like they could deal with LEDs -- or at least I couldn't find the ratings on a pin.

I'm not currently skilled enough to set up a multi-board communications network, so the "expansion board" idea I'm thinking about is simply that the backplane supplies 5VDC power to the card(s) that're plugged in.  Each card then has its own microcontroller doing whatever it's been programmed to do.

Maybe in the future, write up something more complex (although, by then, I think whatever that ends up being would also involve "hey MRR editors, how much does the smallest ad space cost?")

-Dan

Builder of Bowser steam! Railimages Site

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Tuesday, October 30, 2018 6:56 AM

 The 23x17's can drive something like 45ma or so per output, to a max of 160ma for the whole chip, so if you use all 16 lines for output, it's no more than 10ma per line. Which is fine for LEDs. If you need more, just add a drive like a ULN2003.

 The key thing to remember is that there are usually two specifications on data sheets for anything that has multiple drive lines - how much each line can handle, and how much total you cna have for the whole chip. Most have a combined total that is much less than the per line limit times the number of lines. 

                                       --Randy


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    January 2006
  • From: Northeast OH
  • 2,268 posts
Posted by NeO6874 on Tuesday, October 30, 2018 11:00 AM

Yeah, I wasn't seeing either spec in the tables.  It's probably just somewhere in the text and I just glossed over it, in looking for the tables.

-Dan

Builder of Bowser steam! Railimages Site

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Tuesday, October 30, 2018 11:11 AM

 Table 1, page 3, in the MCP23x17 data sheet.

                            --Randy


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    January 2006
  • From: Northeast OH
  • 2,268 posts
Posted by NeO6874 on Tuesday, October 30, 2018 12:32 PM

Yup, I must be blind Smile

-Dan

Builder of Bowser steam! Railimages Site

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Tuesday, October 30, 2018 1:53 PM

 Actually I back-doored into it, since I saw the expansion board on the MRCS site and they mentiont he limitations there, but I was curious about the chip they used so I looked it up and got the data sheet. ANd found out there is already an Arduino library that supports both versions (for some reason I like SPI - dunno, I just like it better than I2C). So among other parts, I have some MCP23S17's ready to build a prototype circuit. Soon as I finish getting the finalized schematic for my turnout controller, and getting the boards spun. And more or less finalizing the software. It works perfectly fine but I'm tweaking it a bit. Then I will start work on my version of the cpNode. I've already done the very basic "hook an RS484 adapter to an Arduino and use JMRI to turn an LED on and off" test.

                                   --Randy


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    January 2006
  • From: Northeast OH
  • 2,268 posts
Posted by NeO6874 on Tuesday, October 30, 2018 2:32 PM

I have the distinct feeling anything I feel like trying to tackle has probably been done (and possibly better) ... Some crazy smart types in this hobby if you know where to start digging ...

-Dan

Builder of Bowser steam! Railimages Site

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Tuesday, October 30, 2018 5:40 PM

 Very true. There's little truly new. I'm not one to reinvent the wheel, I always look for prior works, change or incorporate them if possible, before I ever try to come up with solution on my own.

                          --Randy

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    January 2006
  • From: Northeast OH
  • 2,268 posts
Posted by NeO6874 on Thursday, November 8, 2018 7:28 AM

Well, I got the PCBs from China yesterday, and other than a few gaffes on my part, such as that label that is half off the board ... they turned out well.

Soldered one up yesterday, and it works pretty nice -- especially with having slowed it down to ~1 second between cycles, rather than the 100ms I was using during testing.

 

Here's a couple of pics of the completed board:

 

 

If anyone's interested, I'd be willing to ship you one.  Would rather see them go to a good home, than sit here collecting dust.  Just PM me and we'll hammer out what timing you want on the LEDs, and your shipping addres.

Board'll arrive (nearly) ready to run -- you'll just need a 9-24v power source (it "should" work with AC or DC, but I can't find my MRC pack to test it with so, I'd recommend not using AC), LEDs, and their current-limiting resistors.

-Dan

Builder of Bowser steam! Railimages Site

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Users Online

Search the Community

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
Model Railroader Newsletter See all
Sign up for our FREE e-newsletter and get model railroad news in your inbox!