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!

Edit: Boards have arrived! Well, gone and done it now - PCBs on the way for my servo controller

8277 views
23 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    July 2009
  • From: lavale, md
  • 4,640 posts
Posted by gregc on Friday, September 20, 2019 4:21 PM

Randy

thanks

i'm really glad you brought up the SMC circuit using LM324s.   The circuit is not capable of dirving regular motors, but it worked on the tortoise motors.   I think I can do a simple board using 324s, mpc23017 to drive 8 switch machines and have 8 I/O for buttons or LEDs.

greg - Philadelphia & Reading / Reading

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Wednesday, September 18, 2019 1:46 PM

 I am far from an expert - I've drawn 3 boards now in my life. And the third one is just from a simplified schematic of the second one. 

 I tried KiCad, but I had a hard time getting a handle on the whole process - getting your parts int he library for the schematic part plus getting a footprint to put it on a PCB just seems relly awkward to me. I suppose if I kept using it more, I would eventually get used to it. But I heard about JLCPCB and their compelte integration - they have the design software, board supply, AND a good selection of components (not as good as Mouser or Digi-Key, but not bad) - really and truly integrated. Every part int heir inventory has a library item for EasyEDA, and the EasyEDA BOM can be used to fill your LCSC shopping cart with the parts you need.

 EasyEDA DOES allow you to save standard Gerber files, you aren't stuck using JCLPCB if you draw your board with EasyEDA. But they do make it easy - one click and it's uploaded to JLCPCB and it tells you how much it will cost. The promo rate is only for a board up to 100x100mm. But they are pretty inexpensive with larger boards as well. And ou cna get them in different quantities, and the more you get, the less per board you pay. 

 There are tutorials for all the free programs, like KiCAD and EasyEDA, that will walk you through drawing the schematic using that particular tool, and then laying out the PCB. It turned out to be much easier than I thought it would be.

 KiCAD and EasyEDA seem to be the only practical free software packages now, Eagle is still free but very limited, and there's one other that there is a way to get a free non commercial license that removes many of the limitations of the free one (the limitations are almost always in the size of a board you cna design and/or the number of components - and number of components is very eacy to exceed even for something fairly simple. Like I said, I tried KiCAD but had a hard time - and I use other CAD programs, though the last EE CAD I used was 30 years ago, using OrCAD for DOS. EasyEDA, I picked up on right away. There s both an online (runs through a browser) and an actual locla install, so you cna get to your files anywhere - your files are stored in projects that are kept online, so you do need an internet connection to use it. If you've gone to the links I posted to my projects, yo can see it in action.

 There is a catch with the low price - that is indeed the price of the board. Shipping not included. Unless you want to wait a month and a half, you need to pick DHL shipping. I think for my first board, which was small enough to qualify for the 10 boards for 2, it was $15-$18 shipping. Still cheap compared to what it cost to have someone make PCBs for you 10-20 years ago. 

 There are other board houses, OSHpark, ExpressPCB, PCBWay. There are a couple not in China, but the board cost more than makes up for the reduced shipping, and I don't think the quality. Most of these are hobbyist grade boards - they work fine for what we are doing. Some of the others, but I don't think JLC does this, can make more expensive production quality boards - if you were making something for commercial production.

 Seems split on the YouTube channels I subscribe to, some have taken sponsorship from JLCPCB, and other from PCBWay.  

                                   --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
    July 2009
  • From: lavale, md
  • 4,640 posts
Posted by gregc on Wednesday, September 18, 2019 7:40 AM

i committed to helping someone with an interlock.   seems that fabricated PCBs would be a reasonable approach

wondering what other choices for board fabricators there are.   is JLCPCB simply the least expensive  ($2 for 5 ~4x4" board)??   

also wondering about schematic capture and layout tools.   I'm familiar with ExpressSch/Pcb but assume PCB output may not be usable by other fabricators.  Am told KiCAD is a more professional tool that outputs Gerber files which I believe are standard.

also wondering what the common mistakes are when designing and laying out a tool

I don't want to become an expert in this.

appreciate any advice  

 

greg - Philadelphia & Reading / Reading

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Friday, September 6, 2019 11:03 AM

 It has a drop ceilign now, replacing with the same. I have a decent idea of where to put lights int he ceiling - but that will not be the layout lighting. Layout lighting will be LED strips. Basic plan so far is two strips of white, a strip of RGB, and a strip of blue, so I can do anything from night through sunrise to high noon to sunset. The RGB ones I got came with a cheap controller that only does 16 steps per color and is useless, but I recently picked up a driver that is compatible with DMX as used in theater lighting (just a protocol on an RS422 network) so I cna get 256 steps per color, and in just playing around with it using the same LED strip, I was able to make some decent fades and transitions.

I have a fairly developed track plan for the lower level, although final positioning will have to wait until the demo of the mess that is there now is done so I can get truly accurate measurements (t's probably close enough now - I never draw my plans to use ever last inch anyway). 

It's not what you see on my web site, that's my old house. Soon as they got done ripping the current one back to bare walls, I will get pictures of my space now, and get back to updating my site. I did have a few threads here on the new places with the outline and the plan I am currently workign with. Who knows, once I have a big empty space to look at, I might come up with a different idea. My current plan may have been subconciously influenced by the walls and other features that are being removed, even though the blank canvas I was drawing on was based on just the outline of the space.

                              --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
    July 2007
  • From: Yorkton, Sk, Cnd
  • 441 posts
Posted by wvg_ca on Friday, September 6, 2019 8:06 AM

that basement is an ambitous project ....

walls are reletively easy ... kindof, lol ..

what about the ceiling ?? do you have a rough track plan so you know where to pop in lights ??

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Friday, September 6, 2019 7:04 AM

 No, this is how I am going to drive the turnouts on my layout. I displayed the breadboard version at a meet last year, but got too sidetracked and didn't get the board done until now, and the show is next weekend. 

 There's also a CMRI node board I am designing that will go along with this (that's what the 'remote' connection is for) and will also read block detectors and drive signals.

 Guess I better get going - I just hired a contractor to rip all the junk out of my basement and build properly insulated walls with moisture barrier so I can start layout construction, although that won't be done until the end of the year at the earliest.

                                    --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
    July 2007
  • From: Yorkton, Sk, Cnd
  • 441 posts
Posted by wvg_ca on Thursday, September 5, 2019 10:11 PM

used the editor to open up the last pcb there ....

i'd call it good enough ...

do you actually intend to get any, or was it just an 'exercse'...

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Thursday, September 5, 2019 8:29 PM

 OK, I optimistically labeled the newest one as FinishedPCB.

https://easyeda.com/megaslug/single-relay-turnout-controller

Very little spare space. I added the outputs for position indicators, so all pins are used again. I also shifted a couple around to make the layout easier.

Qty 30, these come out to $1.47 per board. I don't think I'm going to spend much more time trying to make it any smaller. Validating the layout, and making the silkscreen neat - yeah, need some time yet to double check everything.

                                     --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
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Wednesday, September 4, 2019 7:29 AM

 Perhaps - then I'd have to reassign the pins again for cleanest routing. It would mostly have to go with pin 1 facing down, the 4 remote inputs for one use the analog inputs on pins 28, 27, 26, and 25. 

 Certainly a possibility. That may allow it to get a little narrower. Though witht he oscillator and stabilizing caps it's almost as wide as it is long anyway.

 Not sure I can push the edges in much further, and still have the mounting holes. Not sure what JLCPCB's absolute limits are, but the holes are fairly close to the edge. The dimensions are currently something and .xxx mm so I might tweak it just to even numbers - it's hard to judge but it looked like I was snapping the lines directly to the grid lines on the layout screen but obviously it's a tiny bit off to get odd numbers out. Won't change the price but it looks a lot better if the board is 120mm tall instead of 121.314 mm. 

                          --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
    July 2007
  • From: Yorkton, Sk, Cnd
  • 441 posts
Posted by wvg_ca on Wednesday, September 4, 2019 2:03 AM

the version 2 pcb is quite a bit smaller ...

would rotating the 328 save any space in the east / west direction ??

there's not much you can reduce it in the north / south direction ... maybe a little in the area of the bottom jack

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Tuesday, September 3, 2019 10:18 PM

 I actually did another one, this time I got the board size down to 127x170mm. It looks buildable, just got to pay attention to which holes are for what resistor and capacitor in the input circuits.

 In units of 30, the boards are under $1.50 each.

 It's in this project:

https://easyeda.com/megaslug/single-relay-turnout-controller

ControllerPCB_AR (except it's 75% NOT autorouted - though for these simple 2 layer boards, the EasyEDA autorouter does a decent job). I do have to move the two servo connections down a bit, they are too close to the corner for labels. And to get the nets in the right order, I had to modify the schematic and I didn;t do it in a particualrly neat fashion. Still thinking about using my last 2 IOO pins for position indication outputs, that would be another 3 pin header over between servo 2 and frog 1.

                                         --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
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Sunday, September 1, 2019 9:51 PM

 It's all thru-hole, I don't do SMD. It would be a LOT smaller without the input protection - which it works perfectly fine without on a breadboard, but since there will be runs of around 2 foot for most turnouts fromt he controller to the pushbuttons, on a layout full of DCC signals and all sorts of other stuff... I'm not sure how much smaller I could make it and still keep the connectioons all at the edges. I can squeeze it all over on the right side a bit more, there's plenty or room between the filter caps, and the relay drivers can be moved over a bit as well. The single relay version opened a ton of space on the right side, the original one had 2 more relays and 2 complete driver circuits in that space. Directly below the mico is always a dead space because the center pins on that side are a Vcc, GND, and the two crystal connections. 

 I'm open to ideas. The 4 relay version is already 20mm less wide and 10mm less tall than the ones I had made because after having a physical board and co,ponents in hand I could see I left far too much space between things, so I closed it all up when I fixed the error with the relay symbols (the contact shown as the NC contact is the NO side - data sheet is right, so whoever added the item to the schematic and PCB libraries drew it upside down). I also changed it to vertical entry RJ45 jacks but the footprint of those is the same as the horizontal ones, and i added mounting holes in the corners.

 Eagle todat is next to useless without paying, thanks AUtodesk. I REALLY wanted to like KiCAD, but the UI is just so off to me, it's hard just getting schematics done, then trying to do board layouts is really tough. But it's a full blown package, closer to a higher end system than the entry level ojes, and runs on multiple platforms. ANd it completely free. Then I discovered EasyEDA. Pretty darn intuitive to me, and it's a complete one stop shop if you want, boards directly from JLCPCB and parts from LCSC. But you can just generate Gerbers and have the boards made by anyone you want. The only catch seems to be that you can only have a limited number of private projects, the rest have to be shared witht he community. Since I was planning on sharing this and my other designs anyway, I don't see that as a drawback. Saves me from having to host copies of the gerbers somewhere.

                                   --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
    July 2007
  • From: Yorkton, Sk, Cnd
  • 441 posts
Posted by wvg_ca on Sunday, September 1, 2019 9:31 PM

 i went there , and used both the photo viewer, and the 3d modelling options .....

i -assume- there will be later versions of the pcb as there is quite a bit of empty space ...???

fwiw .. i use an older version of protel, and a version of eagle [pre-autodesk]

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Sunday, September 1, 2019 8:20 PM

 Thought I could cheat, the software allows exporting to various picture formats, however it looses all the detail when you do so. EasyEDA is free, and I have made my projects public, so you can sign in and open them yourself. 

 This is the newer one, with a single relay. TEST2 is the (mostly) completed board

https://easyeda.com/megaslug/single-relay-turnout-controller

ANd this is the one I already had 5 boards made from, TEST2AR is the board, although it already has the mistakes corrected.

https://easyeda.com/megaslug/Servo-Turnout-controller

There is both a photo viewer and a 3D viewer in the PCB layout menu. Photorealistic rendering of the board, or a 3D version you can zoom and spin around.

 Anyone is free to make them, and once I have the program completed, that will be freely available as well. But note that I have not fully proofed these yet, especially the single relay version, so if you go ahead and get boards made, you are doing so at your own risk. The second link SHOULD be good, I have gone over it and checked each line to the micro and they all match my chart I made as part of the design process. The new single relay one, I haven't decided if I want to use the extra two pins to provide position feedback or not.

                                    --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
    July 2007
  • From: Yorkton, Sk, Cnd
  • 441 posts
Posted by wvg_ca on Sunday, September 1, 2019 7:51 PM

do you have  photo of the boards ??   just curiosity, nothing more, lol

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Sunday, September 1, 2019 6:40 PM

 Of course I am again second guessing myself. Having the frog relay switch at the mid point of the servo is a software no-brainer. I drew up a new PCB artwork with just one relay per turnout, squeezing that gets the price of the boards down by almost $1 each - in quantity (20+) it results in a board that costs under $2. And frees up 2 pins on the micro which I can use as position feedback. Cheaper than using a servo mount with a microswitch to handle the relay. And who am I kidding, the ONLY turnouts this might not work on would be old non-DCC Walthers/Shinohara - and I'm not using such things. Parts cost drops by about $2 per board.

                               --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
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Monday, August 26, 2019 5:22 PM

 Well, got the boards today as promised. Since I got all of the parts (except one capacitor, which they didn;t have in the form factor I used in the PCB library - but it exists, I have a bunch plus I found them on Amazon), I test fit everything.

1 minor problem, 1 major problem (will require a new board layout) and a few "it bothers me so I will fix it" issues.

Minor issue: I used side entry RJ45 jacks. Fit the board, the ones I ordered snap right in, the leads int he solder pads and the two plastic support pins in the hols drilled. However - once I plug an RJ45 cable in there - it's not coming out again without a screwdriver, can't press the tab by hand. I'm going to switch to top entry type.

Major issue - the schematic and PCB library object for the EXACT part number of the relay I used has the NC and NO contacts backwards! This would just be a code change for the frog POLARITY relay, but for the one that turns the frog power on and off, I want the NC to be power one, so the relay only energizes for a short time. I COULD make it work on these 5 boards by mounting the relays on the back side of the board, upside down. 

Minor issue - I didn't mark out nor did I really leave room for any mounting holes for the boards.

"I am OCD enough to want to fix this" issue - there are some traces that I see now that I have a physical board that I could route much more neatly. Also possibly make the board a tiny bit smaller, as I left excessive room in some places.

 Overall, not bad - the one thing I worried about most, the custom footprint for the DC-DC converter module, is exactly right, the holes line up perfectly and there is plenty of clearance around it.

                                    --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
    November 2016
  • 196 posts
Posted by khier on Thursday, August 22, 2019 10:55 AM

Congeratulations Randy. You are a couple of steps ahead of me with my coach lighting decoder. I  am too a customer of JLCPCB. Great service at amazing price. However, my first order was scrapped since it has a design error. Since then I etch my prototypes, build them and test them to check the design before sending the order. I do not mess with all the chemicals, only the etching part. For design transfer I use my CNC laser engraver to avoid the developing step. It enables also using cheap copper clad boards instead of the coated ones.

Regards

 

Walid

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Tuesday, August 20, 2019 10:47 AM

 Not too long - I submitted the order not long before I posted that message last night - and my boards are already at the solder mask stage! They are FAT. There are some videos on YouTube which show the inside of their facility and how they make boards - simply amazing. Back int he day, I hand wired all my circuits because I could either mess around with a lot of messy chemicals an dmake a board - and then try to drill the holes correctly, or I could spend hundreds of dollars to have someone produce a small board. Even a single layer, single sided board. Now these various facilities do double sided, full silkscreen and solder mask in a day or two, for super cheap prices. And they can do 4 and 6 layer boards too. They may not be the ultimate quality boards, but for hobbyists they are plenty good - there's almost no excuse NOT to built everything on a PCB any more.

 The only waiting is the shipping, unless you pay through the nose - my first board fell in their 10 boards for $2 size, so I got 10 boards for $2 - plus nearly $19 shipping to get them in 3-5 days instead of 10-20 days. Shipping was actually slightly cheaper for these bigger boards, but the boards cost more.

                                             --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
    July 2007
  • From: Yorkton, Sk, Cnd
  • 441 posts
Posted by wvg_ca on Tuesday, August 20, 2019 10:04 AM

yep, it's like the lottery ...

don't find out if you're a winner, for a while :)

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Tuesday, August 20, 2019 8:14 AM

 I did blue. My first one I did plain green, because any other color was an upcharge. Now most colors are the same. I gave up waiting for my friend to draw me a logo - TrainBytes Designs.

 I'm sure JLCPCB will make EXACTLY what I sent them - and that's the scary part Big Smile

                              --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
    July 2007
  • From: Yorkton, Sk, Cnd
  • 441 posts
Posted by wvg_ca on Tuesday, August 20, 2019 12:15 AM

you will be happy with the boards when they come .... they have always done 'right' by me ...did you go with the light green pcb, or ??

  • Member since
    July 2006
  • From: Bradford, Ontario
  • 15,581 posts
Posted by hon30critter on Monday, August 19, 2019 11:49 PM

Hi Randy,

I hope your PCBs work as planned. I admire your ability to create your own electronics.

Dave

I'm just a dude with a bad back having a lot of fun with model trains, and finally building a layout!

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Edit: Boards have arrived! Well, gone and done it now - PCBs on the way for my servo controller
Posted by rrinker on Monday, August 19, 2019 11:42 PM

 Hope I got it right - I only ordered 5 so if I did make a mistake I can fix them with some bodge wires and update the design before I order more.

 I really wish one stop shopping was a real thing - PCBs are from JLCPCB, and you cna also dump your BOM and order the parts from LCSC, however they don't have 3 of the values of ceramic capacitors in the footprint I used on the design. They exist, it wasn't a goof on my part - I have an assortment of values I got a while back to stock my bench and all of the values needed for my circuit are in the footprint I used on the board, it's just that the ones that LCSC carries in those values are the next size up - so if I want to one stop shop, I'll have to respin the board. 

 Can only check so much - like making sure I have all electrolytic capacitors the right way round so nothing blows up in my face. nets were completed. Crossing my fingers, this is only the second PCB I've drawn, and it's a WAY more complex circuit than the one I already did - which worked just fine. 

 Hopefully I'll get it built up and working in time for the Reading Modelers Meet coming up Sept 13th. Last year I had my programmer board, plus the servo controller breadboard version.

 And of course I didn't order enough RJ45 connectors to make the control panels - oh well, I have to order some small perf boards for that anyway, I can just hard wire the panel end for a demo. I don't have the right buttons anyway so I will use some tact buttons and LEDs instead of lighted pushbuttons.

 As usual, shipping cost more than the actual PCBs. 5 board was I think $15 (they are pretty big, 217mm x 150mm or something close to that - the relays take up a lot of space. I want to try and get this done in the next couple of weeks, so I had to pick the DHL shipping option. Once sorted out, a production order I will just have shipped slow boat, it's half the shipping cost, it just takes 10-20 business days to get here.

 Total cost, for the 5 board and parts, plus the servos, works out to be around $9 per turnout. A LOT of that is shipping costs, AND several components have minimum order quantities so I'll have a stock of parts left over. I can take over $1 per board off the top because I ordered 10 microcontrollers instead of 5 (price break was 50% off for qty 10 vs qty 1, and I'll use them for sure anyway), at $1.10 each. This is the same chip that's on an Arduino, I just don't embed a full Arduino in my projects, there's a lot of unecessary stuff on the Arduino board. Great for testing - my breadboard version used an actual Arduino - but for putting the circuit on a PCB, no sense adding all the extra stuff. To get the program into the micro, that's what my programmer board is for, it used an Arduino to program a blank chip to put in another Arduino, or use however you like. 

 

                                                 --Randy

 


Modeling the Reading Railroad in the 1950's

 

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

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

There are no community member 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!