Second attempt at the big intersection

Thread Starter

Edmunds

Joined Sep 27, 2010
85
Hi all,

Thanks' to input of this forum, the next, much improved to my mind version of big intersection project has been born. I will not repeat all the "wall of text" as some of you referred to it describing all the functions. I'm quite sure, it actually does not matter as it is only inputs and outputs anyway and all depends on the software that will go into picaxe-20M2 and picaxe-08M2 chips. What I'm after is any advice about the electronics. Any beginners mistakes you can catch or things I have not thought about. A filter capacitor here or there. A pull-up or pull-down resistor missing. From power supply to i/o expanders and optocouplers. Maybe something can be omitted to save space and money?

The ten pin connectors go out to 4 blocks of input and output devices, the 6 pin connectors go to LED traffic lights and JP1 and JP2 is just rows of male headers to have access to picaxe pins in case such a need would arise. DIP switches allow selecting various options that the software will take into account when running the outputs.

Thank you all for your time,

Edmunds
 

Attachments

bance

Joined Aug 11, 2012
315
I'm not familiar with the IC's in your circuit, however as a rule you should place 100nF caps from VDD to grnd as close to the chip as possible.
I would have a look at the power supply section, I'm not sure exactly what your intentions are, I assume that the components marked MO25MM are AC inputs (transformers possibly?)
The usual configuration here is AC->rectifier->smoothing cap->regulator....
The regulator should have caps on input and output (100nF and 10uF, check data-sheet)

Also you may be able to switch pins 13-16 for 17-20 for an easier layout on those pca955d's

HTH Steve.
 
Last edited:

Brevor

Joined Apr 9, 2011
297
The A0,A1 and A2 address lines from the PCA9555's dont need to connect to the Picaxe, They should be connected to gnd. or Vdd at the 9555 to set the address for that IC. They will then respond when that IC's address is sent from the Picaxe.
 

Thread Starter

Edmunds

Joined Sep 27, 2010
85
The A0,A1 and A2 address lines from the PCA9555's dont need to connect to the Picaxe, They should be connected to gnd. or Vdd at the 9555 to set the address for that IC. They will then respond when that IC's address is sent from the Picaxe.
Silly me! Thank you for 3 free pins. Maybe I should reconsider the size of the PICAXE IC :).

Edmunds
 

Thread Starter

Edmunds

Joined Sep 27, 2010
85
I'm not familiar with the IC's in your circuit, however as a rule you should place 100nF caps from VDD to grnd as close to the chip as possible.
I would have a look at the power supply section, I'm not sure exactly what your intentions are, I assume that the components marked MO25MM are AC inputs (transformers possibly?)
The usual configuration here is AC->rectifier->smoothing cap->regulator....
The regulator should have caps on input and output (100nF and 10uF, check data-sheet)

Also you may be able to switch pins 13-16 for 17-20 for an easier layout on those pca955d's

HTH Steve.
Thank you for your response.

Done with switching the pins. This will definitely improve pcb routing. While the power supply is optional, since likely, I will run 5V bus from a high power switching power supply under the layout anyway, I wanted to include one in case I need to power it from the "track power" at some point. This is 16VAC and likely quite noisy because of all the locomotives with sound decoders and what not running on it. Thus the overcurrent protector LP30-110. I looked at the data sheet here and it specifically says you do not need to install any capacitors, but I do want to be on the safe side, so that is the big fat 1000uF thing. Isn't that enough?

Do I need a separate capacitor at each IC? Can you explain why, please? I was hopping to get away with one big thing at the "entrance".

Edmunds
 

bance

Joined Aug 11, 2012
315
This is why you need decoupling/bypass cap's.....

It is not necessary to bypass the out-put, although this does improve transient response. Input by-passing is needed only if the regulator is located far from the filter capacitor of the power supply.
This does not explicitly mean capacitors are not required, it means that if your circuit has latency and is not affected by a "slow" response, then they are not required. Only you can tell if the regulator is far from the filter cap (far is usually more than 6" (150mm))

Put simply capacitance and frequency are related, DC= zero f noise= mucho f, capacitors block (look like open circuit) to DC, but pass AC (noise).

HTH Steve.
 
Last edited:

THE_RB

Joined Feb 11, 2008
5,438
Your optocouplers LEDs are driven by active HI. So they light up when at 5v.

I would change them to active LO, so they have;
5v -> 330 ohm -> LED -> input
and light up when the input is 0v.

That gives you a couple of benefits;
* there is no signal inversion, ie; LED LO = opto output LO
* voltage of the driver circuit is not so critical, only grounding
* it's easier to connect buttons or switches to the inputs; they only need the button and gnd wire (not the button and a 5v wire!)
* it's a more common standard for opto interfacing (probably because of reasons mentioned)
:)
 

Thread Starter

Edmunds

Joined Sep 27, 2010
85
Your optocouplers LEDs are driven by active HI. So they light up when at 5v.

I would change them to active LO, so they have;
5v -> 330 ohm -> LED -> input
and light up when the input is 0v.

That gives you a couple of benefits;
* there is no signal inversion, ie; LED LO = opto output LO
* voltage of the driver circuit is not so critical, only grounding
* it's easier to connect buttons or switches to the inputs; they only need the button and gnd wire (not the button and a 5v wire!)
* it's a more common standard for opto interfacing (probably because of reasons mentioned)
:)

Thank you, RB. Like in the attached sch?


Edmunds
 

Attachments

Thread Starter

Edmunds

Joined Sep 27, 2010
85
Friends,

I have taken into account all of your suggestions at least to some extent and a new schematics and board layout is attached. I spent some four hours learning and re-learning what I had forgotten about decoupling and bypassing. It seems, the only thing I know for sure about it is that it is kinda rocket science :eek:

Anyway, added some simple capacitors, re-arranged a number of things, scrapped the power supply part to work with 5V from a separate, dedicated 5V bus from a big switching PSU unit. This will not run any trains or relays - some servos at some places, but these are quite easy to decouple locally.

Now, I feel quite comfortable with everything, but since I have zero experience with this complexity PCBs, please take a look. For an example, is having 100+ VIAs ok? Or are there any obvious inductance/capacitance problems (sorry, read too much about it lately :) )?


Thank you for your time,

Edmunds
 

Attachments

Last edited:
Rip up and redo. Do NOT NOT NOT use the autorouter function!!! This is the biggest ever mistake beginners do.

One improvement is to use the polygon tool, draw a square around the endges of the board with it, then name it GND and then hit the ratsnest button, this will give you a ground plane.

Then you draw your signal traces on the other side of the board.
 

bance

Joined Aug 11, 2012
315
I am no expert but, I think with the use of a power plane and a ground plane and some judicious pin changes on your micro you could simplify your layout quite a bit.....

HTH Steve.

beaten to it!!!!
 

Thread Starter

Edmunds

Joined Sep 27, 2010
85
Rip up and redo. Do NOT NOT NOT use the autorouter function!!! This is the biggest ever mistake beginners do.

One improvement is to use the polygon tool, draw a square around the endges of the board with it, then name it GND and then hit the ratsnest button, this will give you a ground plane.

Then you draw your signal traces on the other side of the board.

Thank you :). Well, I tried the GND plane, but which side of the board would you put it on? I would love to have one-sided board, but with 250+ air wires as eagle suggests, it is kind off crazy to expect to be able to do that, I assume. Back to the drawing/tinkering board...

Edmunds
 

bance

Joined Aug 11, 2012
315
After looking again, I think a 1 sided board is doable, think about using 0 ohm resistors as jumpers/links!!!

Steve.
 

THE_RB

Joined Feb 11, 2008
5,438
Thank you, RB. Like in the attached sch?
...
Yep. It's not so critical when the driver of the opto LEDs is a chip, it's more important when the opto LEDs are driven from external connections like remote PCBs, switches etc.

But it's a good standard to adhere to (throughout the entire circuit), as a general rule. :)
 

Thread Starter

Edmunds

Joined Sep 27, 2010
85
Dear Friends,

After much tinkering (cannot name anything else significant I have done since the last post here) a new, hand-made thing has seen the daylight. While it looks better than the auto-router thing, it has about a dozen more vias than the computer idea of the best.

I have squeezed it onto an 80x100 board just because, as I have painfully discovered, Eagle is free for everyone as long as you do not go outside 80x100. Maybe, if I would make a larger board, I could actually fit it onto one side only.

While this is not a must, a double sided board that could be produced (milled) at home would be nice. The current design - does not seem possible at all. The traces are fine, but the space between them - no way.

If you can see anything that can be improved, I'm very open to suggestions. If you think this is about a normal board to order from some pcb fab place - I'd be happy to hear that, too.

Thank you for your time,

Edmunds
 

Attachments

Last edited:

Thread Starter

Edmunds

Joined Sep 27, 2010
85
After looking again, I think a 1 sided board is doable, think about using 0 ohm resistors as jumpers/links!!!

Steve.
Steve,

Thank you. That is an interesting idea. I will have to play with it some day, but that will definitely take me outside 100x80mm Eagle for free limits :(.


Edmunds
 
Top