5

Story: I have a lego train that is modded to run off of a 9v train track rail system that was a control function of 0 to 9 volts when fully on. LEGO does not make the motors that can run on these rails ( such as a regular model train does) and thus have made use of a trickle charge system that has a bridge rectifier and uses the circuit that is included in the LEGO LiPo battery pack that controls the charge time,rate,etc...

image
Here is a picture of what I have going on.

The system consist of ac wall wart that breaks the voltage down to 9 volts thus is controlled by a voltage control (0 to 9 volts) to metal rails. Train engine has motors that will take the 9v dc power which are powered through the trickle charge setup through the LiPo battery.

Question: How to I come up with a circuit, diode, etc to switch from this 9v dc power to the LiPo battery in a time of power loss?

Is there a better way to do this whole system as a whole, if needed I supply the needed info such as pics, measurements, etc...

Also so sorry that this is a drawn out story/question(s)

Anindo Ghosh
  • 50,188
  • 8
  • 103
  • 200
Poe
  • 59
  • 1
  • 1
    Sounds like you're looking for almost the same thing [as I am](http://electronics.stackexchange.com/q/79697/11606), except you need a boost regulator with the ability to shut off when the supply is live. – Ignacio Vazquez-Abrams Aug 22 '13 at 01:08
  • @IgnacioVazquez-Abrams, I think you're right, this seems duplicate, although it was just posted 3 hours after yours. Your question is much more clear though. – travisbartley Aug 22 '13 at 05:19
  • @Poe, could you try to draw a schematic for your setup? It would help a lot in clearing up your question. There is a schematic drawing tool above the text box when you are editing the question. – travisbartley Aug 22 '13 at 05:24

1 Answers1

2

The LEGO LiPo battery is rated for 7.4 Volts, I believe. Thus, a single diode would be enough to switch between the 9 Volt rail supply and the LiPO when the rail voltage fails or falls below 7.4 Volts.

Note: If the speed control is DC instead of DCC, then in any case when you set the throttle to slow, the rail voltage will drop below LiPo voltage. This means that below a certain speed setting at the throttle, the loco will continue to run at the speed defined by the LiPo, and will not drop lower - instead, the rail supply will simply not be used until the throttle is turned up again.

This following schematic addresses cases where the rail voltage does not drop below the LiPo voltage.

schematic

simulate this circuit – Schematic created using CircuitLab

Why this works:

  • When the rail supply from the wall wart is on, the cathode of D1 is at a higher voltage (~8.3V) than the anode (7.4 Volts) - at least until the throttle reduces speed, assuming DC control. Hence D1 acts as an open circuit.
  • When the rail voltage is set below the LiPo voltage, or off, D1 conducts in the forward direction, supplying ~6.7 Volts to the voltage controller. D2 becomes open, preventing voltage to the wall-wart from the LiPo.
  • Of course, this is not satisfactory if prototypical scale-speed slow running is desired.

If the 0.7 Volt diode drops are unacceptable, use a high current Schottky diode such as the Vishay 95SQ015 instead: 0.25 Volt drop at up to 9 Amperes.


If the intent is to continue using rail voltage and DC speed control until the rails actually are supplying practically no voltage (say down to 2-3 Volts or so), and then switch over to LiPo power, that too can be done - but the loco would then speed up to a fixed speed as determined by the LiPo's supply, until rail voltage came back up to the chosen threshold value.

To achieve this, a Schmitt Trigger takes the voltage from the rails as input, while its supply voltage is from the LiPo cell. The output is used to drive a switching solution, such as a MOSFET, to switch between rail supply and LiPo supply for the motor. The supply would come from the rail until the rail voltage drops below the Schmitt Trigger's threshold voltage that you preset. If this is the solution you are looking for, a schematic can be added if desired.


Edit: Added schematic.

A simple schematic for achieving the objective described in OP's comments:

schematic

simulate this circuit

Note that both the LiPo battery positive voltage rail, and the LiPo battery motor output rail, are used in the schematic.

  • The rail voltage supplies the motor as long as it is over 0.65 Volts or so, and the P channel MOSFET remains off, so the LiPo supply to the motor is blocked.
  • Once the rail voltage drops below around 0.65 Volts, the MOSFET switches on, and the motor is then supplied from the LiPo's motor output line - adjust that output to provide a very slow motor speed, else there will be an abrupt increase in speed the moment the external supply via the rails stops or drops below 0.65 Volts.
  • To reduce or eliminate any switching back and forth at the threshold voltage, play with the C1 capacitor's value. In the experimental circuit I've put together, I find that value to give stable switch-over, but YMMV.

Alternatively, more complex logic circuitry needs to be added on board the loco, to distinguish between crawling speed as determined by the controller, and no-power-on-rails, and to lock the no-power voltage from the LiPo to a defined value (i.e. a predecided speed). This however is a pretty strong case for DCC instead of DC. If you are already on DCC, then it's no big deal.

Anindo Ghosh
  • 50,188
  • 8
  • 103
  • 200
  • I think the problem here is that the "To Voltage Controller" node also is used to power the LiPo charging circuit. So when the external supply is disconnected, the battery tries to charge itself! The original question was not totally clear on this though... – travisbartley Aug 22 '13 at 05:16
  • Yes, the LiPo charging circuit is drawing power through the metal rails, thus when there is no power the Train needs to switch over to the battery for power. – Poe Aug 22 '13 at 21:25
  • @Poe, if that's the case, you may already find yout answer here http://electronics.stackexchange.com/questions/79697/adding-a-battery-backup-to-a-circuit-with-external-power-supply. If that doesn't answer it, you will have to explain your question in much more detail. Otherwise, we don't know how to help you. – travisbartley Aug 23 '13 at 06:27
  • Ok guys thank you for the info, I will get back to you on Sunday with more info and a drawing as needed. I will also look at the link to see if its what I am after... – Poe Aug 24 '13 at 07:49
  • Ok, Sorry for the lapse of time I said I would get back to this. Crazy one day off and then back to work I go. Ok I have a dumbed down drawing of what I have going on for a layout. I am not sure if its the greatest setup or if there is better with the help from the more understanding among here. I think that I would rather have the motors feed right off of the power pick up and have the battery kick in when there no power to have, though if it could pick up with no interuption so that the train doesn't have to be reset with the remote, that would be great. – Poe Aug 26 '13 at 22:40
  • Seems I haven't reached my number 10 Rep yet so I cannot post images yet. – Poe Aug 26 '13 at 23:06
  • I discussed this with another and what is needed is this:----to have the motors draw power from the metal wheel pick up to run. When power from the wall wart is missing to switch over to the LiPo battery without missing a beat. IS this possible?------If so then how may I do it?-----the link provided within this discussion, is that what I need to follow or the circuit provided by Anindo Ghosh?---------Thank you – Poe Aug 31 '13 at 13:54
  • @ Anindo Ghosh...... There is no DCC, could be a future thing though, not now. Yes a schematic for the mention Schmitt Trigger would be most welcomed, given the fact that it seems the most logic for what I am after. The LEGO LiPo battery has a speed control on board, with a directional aspect, so I could preset that once it kicked over to the LiPo........ Thank you so very much in helping me with this bit of a headache!!! – Poe Sep 02 '13 at 00:51
  • @ Anindo Ghosh : Thank you so very much for the info, it will be put to good use. – Poe Sep 11 '13 at 07:17
  • @Poe What scale are you modeling at? Would love to chat about your MRR, in this site's [chat room](http://chat.stackexchange.com/rooms/15/electrical-engineering). You will need 20 reputation points to chat, though - so this might be a good time to contribute on the site, with questions or answers. – Anindo Ghosh Sep 11 '13 at 10:16
  • @ Anindo Ghosh, Sorry for the lapse in response, I have had a busy last 7 days with our Lego Show and running the trains. Let me know when would be a good time to chat. Also I should post a picture of my setup of the trains? – Poe Sep 18 '13 at 21:41
  • @Poe the chat room is live all the time, drop in and say hello. – Anindo Ghosh Sep 19 '13 at 04:12