NJHA Posted September 18, 2014 Share Posted September 18, 2014 So, crazy ideas is just my other hobby. What am i up to? Well, on my layout i will need 12V for the trains and turnouts. Then i am considering on lights on buildings and maybe even street lights. That's something for a 5v or lower power source. So i start considering the number of power supplies i would need and it came up to me... Why not use a computer power supply (i have a few unused ones around)? They have 12, 5 and 3,3V outputs, they are somehow quite stable. So my idea: Use a computer power supply to: 1- Feed 12v to the turnouts to operate them (via DPDT switch) 2- Feed 5V to a Arduino that will provide DCC signal. 3- Feed 12V to a booster that will drive the trains using the arduino created DCC signal. 4- Use other outputs to drive the lights (aka leds or ledstrips) What do you guys think? Crazy idea? Or is it a possibility? Link to comment
kvp Posted September 18, 2014 Share Posted September 18, 2014 Works perfectly and you can wire an ATX supply to start on an external switch. One thing is important tough, current limitation. The 30A output of a power supply can fry most N scale control switches, turnouts and trains in case of a short. So you should add a resettable 1-2A fuse between the supply and each powered branch. Also consider adding one before the booster. (or even use multiple boosters, each with its own fuse) In the past, i've used a supply modified like this to power a robotics project i've built and it's very reliable as long as there is a minimal load on each high current output. Also, you can safely ignore the low current 3.3V and -12V outputs. Link to comment
cteno4 Posted September 19, 2014 Share Posted September 19, 2014 Yeah I have heard of this before and I think having a auto tail light or other 12 v lamp on the 12v out was a trick to give some load all the time and and give you an "on" light. I actually pulled the power supply on the last couple of dead pcs that were around here to play with this, but have never gotten to it. Also uber cheap to pickup at a surplus store. Cheers Jeff Link to comment
NJHA Posted September 19, 2014 Author Share Posted September 19, 2014 Works perfectly and you can wire an ATX supply to start on an external switch. One thing is important tough, current limitation. The 30A output of a power supply can fry most N scale control switches, turnouts and trains in case of a short. So you should add a resettable 1-2A fuse between the supply and each powered branch. Also consider adding one before the booster. (or even use multiple boosters, each with its own fuse) In the past, i've used a supply modified like this to power a robotics project i've built and it's very reliable as long as there is a minimal load on each high current output. Also, you can safely ignore the low current 3.3V and -12V outputs. Limiting current is a huge concern, especially with kids around. Derailments will happen, and also shorts so circuit protection has to be there. So, this means that technically, with a correct fuse and some load on the 12v line it will work ok. Link to comment
kvp Posted September 19, 2014 Share Posted September 19, 2014 Yes, and i would add some load to the 5V line too, but imho the arduino will be enough. I would use some leds as load/indicators tough. Also, you have to connect pin 14 (green wire, power on) to a ground next to it through a switch to turn it on. Link to comment
cteno4 Posted September 20, 2014 Share Posted September 20, 2014 Even with lower amp power supplies its smart to have a slow blow fuse in line (or one of the thermal switches they use in USB circuits) to prevent meltdowns if there is a short circuit from a derailment on a point. We have had mrc and kato power supplies melt trucks on derailed trains that shorted on a point in various ways. Jeff Link to comment
Lawrence Posted September 20, 2014 Share Posted September 20, 2014 You may find these useful http://www.helpwithpcs.com/courses/power-supply-basics-inc-pinouts.htm http://web2.murraystate.edu/andy.batts/ps/powersupply.htm Link to comment
kvp Posted September 20, 2014 Share Posted September 20, 2014 About the 2nd link: I strongly advise against opening a perfectly working power supply, because it's much safer to use the provided low voltage output wires only. There is no need to open it up and expose ourselves to the high voltage circuits or make an error during reassembly and for example let line voltage run around on the case. Just add everything to the output wires. You can even use terminal strips or salvaged pc power cable connectors to connect everything in a removable and safe fashion. (also a higher resistor, like 100 ohm 1 watt or a 150 ohm one with a led /on 5V/ or a 560 ohm with a led /on 12V/ should be enough as a load and can also act as a power on indicator) 1 Link to comment
cteno4 Posted September 21, 2014 Share Posted September 21, 2014 Interesting, from what I remember from a long time back that the 12v needed a good draw to stay on hence the 12v lamp, but maybe I misremeber or the lower power stuff now does not require that. Nice to know that an led and resistor is enough. Jeff Link to comment
kvp Posted September 21, 2014 Share Posted September 21, 2014 Modern (less than 10 years old) atx supplies usually don't require a high load. This is due to the low power modes of modern computers, that essentially turn off most devices, while the memory and cpu are still keeping their context and can resume operation on the first movement of the mouse, so the main power lines are active. For these, instead of the 0.5A load, a 0.02A-0.1A load is usually enough. If the ATX supply is very old and can't provide stable voltages with small loads, then adding the small lamp is a good idea. Link to comment
cteno4 Posted September 21, 2014 Share Posted September 21, 2014 Kvp, Thanks that's what I thought, thanks for confirming. I will probably chuck the two old ones I have laying around here and go with a new one when I get to fiddling with this. Also thinking of using the 12v for the power supply for a few simple throttles and the 5v for LEDs and Arduino. I like 5v for LEDs as I do them individually usually so no need to burn extra power in the resistors and 5v power supplies are sooo cheap these days. Jeff Link to comment
NJHA Posted September 22, 2014 Author Share Posted September 22, 2014 Those are interesting aspects for sure. So, that clears that i can use a computer power supply for powering stuff around the layout as long as i setup some fuses. I think i will have to buy a large box of fuses, judging from what i have seen with my kids around the layout. Now i got a question with the DCC wave. Like i said on another topic i want to use an Arduino to generate a DCC signal, and i already found out that i will need a H-bridge based booster to put the correct voltage to the tracks. But now i have 2 problems (remember i am a computer science dude, i did some electronics back at school but it has been a long time): 1- Will 12V be enough? don't we get losses on the h-bridge ? (Its the L298 H-bridge motor driver from itead studio) 2- The 12V will be DC or AC? From what i researched the H-bridge will produce a "false" AC wave, using the pwm wave from the arduino as a guide. Is this so? Link to comment
kvp Posted September 22, 2014 Share Posted September 22, 2014 I think i will have to buy a large box of fuses, judging from what i have seen with my kids around the layout. Just get resettable fuses, like the one on the back of a Kato controller. It's a small switch that turns itself off on overcurrent and you can latch it back on after you cleared the problem. Much easier than swapping conventional fuses. (most new 1:1 fuse boxes use these automatic circuit brakers too) 1- Will 12V be enough? don't we get losses on the h-bridge ? (Its the L298 H-bridge motor driver from itead studio) Not really. Actually i have a few decoders that work reliably only above 14V DCC, so the my mini central/booster needs around 16V DC in. (0.7V loss at the optional protection diode and another 2*0.3V at the bridge, so actually only 14.7V goes to the tracks) But many modern (and more expensive) decoders can go down as low as 9-10V and still operatate reliably. If you run from 12V, you will probably end up with around 11.4V on the tracks, which will be ok for most Z scale and some N scale decoders. But you should check the datasheet of your bridge for the exact voltage drop. A simple workaround is to install a charge pump on your 12V circuit before the booster (bridge) and boost it up to 13-16V. he 12V will be DC or AC? From what i researched the H-bridge will produce a "false" AC wave, using the pwm wave from the arduino as a guide. Is this so? Not really. The DCC output is a bipolar square wave, so esentially a DC wave changing polarity very fast. The pwm on and off signal controls the polarity. This is why an analog locomotive gets damaged pretty fast when placed on a DCC layout. Gets both overvoltage, overcurrent and just buzzes, which means it gets full throttle and full brake many thousand times a second. This burns them out pretty fast. A DCC decoder rectifies this back into plain DC (with the same loss as any diode bridge) and also measures the polarity changes to get the commands, then uses a PWM pulse to drive the motor (with some loss at the H bridge of the decoder). This is why you have to measure the true DCC voltage through a rectifier bridge in DC mode and add the bridge voltage loss (usually 2*0.7V) to the displayed value. Link to comment
inobu Posted September 23, 2014 Share Posted September 23, 2014 (edited) Not really. The DCC output is a bipolar square wave, so esentially a DC wave changing polarity very fast. The pwm on and off signal controls the polarity. It is a refreshing to hear someone who understands what DCC is. I was kicked off a forum because I stated that DCC was not AC that it was an alternating DC wave. lol Inobu Edited September 23, 2014 by inobu Link to comment
NJHA Posted September 24, 2014 Author Share Posted September 24, 2014 DCC is kind of a vague cloud for many people. Its not pure DC , nor its pure AC and for most people those are the only two options. I have a degree on computer science (or informatics as it is sometimes called in my country and other european countries), also know a bit of electronics and electricity and it took a while for me to understand several of the aspects of DCC, as it is clear from my questions on this topic. Fortunately for me and others reading this, there are some forum members around that explain the concepts in a clear way. The AC/DC aspect is important. Most sites related to arduino and DCC explain in depth the coding part but when it comes to : "how do i make the 5v feed the tracks at 12v?" most said sites have no information on them. I had to dig deep for a reply, and i found one on a french forum. Luckily for me i understand a bit of french so i got the idea, but for others i believe it can be difficult. I plan on putting my findings on a topic at a latter time, i am waiting for my decoders to arrive first. As for my project with the computer power source, that one needs a bit of free time, something that is scarce now. Link to comment
kvp Posted September 24, 2014 Share Posted September 24, 2014 If you need any info, i think i could help, because i did cobble together a DCC system from a 8 pin PIC12F510 microcontroller, a 10kohm potmeter and an L293DNE H bridge motor driver chip with a 7805 and two capacitors thrown in to supply the PIC. Most of the info i used comes from the official NMRA documents. If someone is interested i could start a topic and post a circuit diagram and the code for the PIC. Imho that's all that is needed to make your own or understand how it works. Link to comment
NJHA Posted September 24, 2014 Author Share Posted September 24, 2014 Thank you for the offer kvp. So far i am just researching DCC, but i will go the arduino way on the programming side, it is easier for me( i am comfortable with programming languages). As for the nmra docs, well i've seen them, but they are a pain to read/understand for a computer guy. I am used to reading RFC's , so when i saw the nmra documentation i got a bit of a shock. For a protocol description, they could/should have presented on a nicer, more graphical way. Nevertheless it's the documentation we have, so i will take a deeper look at it in due time. Have a lot of projects on my hands now, and am also trying to secure a more stable job so available free time slots are few. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now