Lightning

Lightning

Viewing 22 posts - 26 through 47 (of 47 total)
  • Author
    Posts
  • #851351
    duncan webster 1
    Participant
      @duncanwebster1

      I should have said in the feed to the 7805

      #851387
      Robert Atkinson 2
      Participant
        @robertatkinson2
        On duncan webster 1 Said:

        So it’s not as bad as I thought, only 7 blown signals, not 8. At least one of the signals has a blown 7805, which is outputting well over 5v, so what’s happening to the inputs on that one is a bit irrelevant.

        To incorporate the mods suggested would mean a new pcb, and I’ve already got 9 spares. I’ve also got time restraints, got to have them up and running for next public running, so I’ve decided to just fit sockets for the time being. Nano from AliExpress is only about £2, it’s just the pain of fitting them

        On the mk4 board when the panic is over, is it worth a resistor in the feed to the processor, to drop the voltage to 8v, then a beefy capacitor to mop up spikes? Any mileage in passing the inputs/outputs through ferrite beads?

         

        Feed to 7805, Yes. a series resistor BEFORE your 470uF capacitor is a good idea. Also move the 18V Zener to the capacitor / 7805 input side of the resistor.

         

        #851391
        Robert Atkinson 2
        Participant
          @robertatkinson2
          On peter1972 Said:

          A 1N4007 is rated at 45A for a 1ms square pulse but its forward voltage would then typically be over 1.8V. I doubt the Arduino would survive. Adding a fairly high value of resistor in series with each Arduino input makes sense, but I would prefer to use much higher resistor values throughout.

          With the circuit shown, 1KΩ in series would not prevent correct operation of the circuit if the ternary signalling threshold levels programmed into the Arduino are modified accordingly.

          On Macolm Said:

          One thing to be aware of with schottky diodes is the very high reverse leakage current. It can be a maximum of several milliamps for a small diode, an amp or more for a larger stud diode.

          For the 1N5817 Schottky diode mentioned, the data sheet shows typical reverse leakage current of 3µA with 5V applied (at 25C).

          The 100R and 1N4007 reduces the stress on the internal protection. A 1ms 45A pulse is not a credible input condition.

          You can’t change the logic thresholds on any Arduino I’ve seen. Using a 1k series with 1k pullup places the input at 2.5V, not a good place.
          As I said earlier it would be ideal to to have the series 100R, diodes, pull-up (1k) and then a series 1k to the pin. A 1nF 50V ceramic capacitor to 0V after the 100R would help too.
          The low reverse breakdown voltage of typical Schottky diodes mae them unsuitable for ths application.
          Lightning protection for aircraft and avionics is part of my day job.

          Robert.

          #851406
          duncan webster 1
          Participant
            @duncanwebster1

            I’m using analogRead, so I can set my own thresholds, I need 2 as I said before. I do have capacitors to earth, will check the value.

            #851415
            peter1972
            Participant
              @peter1972

              The low reverse breakdown voltage of typical Schottky diodes make them unsuitable for this application.

              If Schottky diodes were to ever get over say 20V reverse voltage then the Arduino would be dead anyway.

              Using ordinary silicon diodes as discussed may well not give sufficient protection to the Arduino’s very delicate inputs. It has been suggested that a fairly high value resistor in series with each Arduino input would help.

              I suggest putting an optocoupler between the ULN2003 and the 1kΩ resistor. An additional resistor would be needed to limit the current through the optocoupler’s LED.

              I still think we should question whether satisfactory operation could be achieved by using much higher values of the resistors giving very much better lightning protection.

              #851416
              duncan webster 1
              Participant
                @duncanwebster1

                The  ULNs seem to have survived. I chose to use 1k in the detection side as very high resistance would be more susceptible to leakage across the sleepers. However as readers will have realised by now I am not an electronics expert, a mere dabbler

                #851446
                peter1972
                Participant
                  @peter1972
                  On duncan webster 1 Said:

                  The  ULNs seem to have survived.

                  They will be much more robust than Arduinos and they incorporate clamping diodes. Part of my thinking was to give say 5kV isolation between signals so lightning close to one signal hopefully does not damage other signals via the interconnections. We don’t really know why so many of your circuits have been damaged. Anyway, use of optocouplers is probably not worthwhile although they are cheap. With lightning protection you have to draw the line somewhere.

                  On duncan webster 1 Said:

                  I chose to use 1k in the detection side as very high resistance would be more susceptible to leakage across the sleepers.

                  I have no idea what leakage to expect when a track section with plastic sleepers is soaking wet. You could adjust your ternary signalling thresholds to allow for some leakage.

                  The 100Ω resistors that have been suggested could be increased to say 1kΩ to improve protection but you would need to adjust the ternary signalling thresholds accordingly. All I’m saying is that I suggest the resistor values are reconsidered with a view to improving lightning protection.

                  #851504
                  Macolm
                  Participant
                    @macolm

                    The charge that leads to lightning is likely many millions of volts, with the flash usually flowing to ground. You can think of the path as forming an inductive potential divider, including any wire that is part of it. As a crude example, discharge from a height of 1000 metres of a charge at a potential of one million volts would result in an instantaneous drop of 1000 volts across a metre of wire in which it flowed. Indeed, things might well be much worse than this.

                    You can see that making the protection circuitry as compact as possible is a good idea, with a single AC connection to the flash path. In particular, capacitors need to have the shortest leads possible to be effective, with feed through capacitors the best choice, and choosing a “four terminal” configuration if possible. Ground planes with small surface mount capacitors can also be effective.

                    #851522
                    Robert Atkinson 2
                    Participant
                      @robertatkinson2

                      input protect

                      #851575
                      duncan webster 1
                      Participant
                        @duncanwebster1

                        I could have sworn I’d responded to this last night, must not have hit submit.

                        Thanks for that, I’ve saved it and the next batch of boards will be modified in accordance, but as I said before, I need to get the damaged signals up and running quickly before next public running.

                        Just a couple of questions to aid my understanding (never stop learning).

                        According to interweb “The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less”. Does this mean that the 1k you show connected to the Arduino could be 10k? Would it be better to move the 1nF to the Arduino end? Could it usefully be bigger?I’m not looking for blistering fast response.

                        The LEDs are fed direct from the 12v, so the current to the processor is very low, I’ll measure it, but guess a few 10s of mA. Why is the 5R6 resistor so low? Is it to allow excess voltage to go back into the 12v supply?

                        I don’t think this matters, but according the the 7805 data sheet there should be 0.1uF across the 470uF and 0.2uF across the output. Both of these seem to be optional

                        #851578
                        Robert Atkinson 2
                        Participant
                          @robertatkinson2

                          Hi,
                          You could use a higher series resistor at the ADC input pin but I’d add an additional 1nF capacitor to ground at the input pin. This is because the ADC tends to draw current in pulses de to the multiplexer and the capacitor improves accuracy.
                          I sized the 12V input resistor low as I wasn’t sure if you had other loads on the 5V. It should be sized to drop about 4-5V at the maximum load but it’s not critical.
                          A “7805” is a generic number for a wide range of devices. Requirements for input and output capacitors depend on the exact (make and full part number) device. Typically you need a 0.1 across the input if the device is more than a few inches from the filter capacitor typically found in a mins supply. The 470uF fulfils this requirement. A capacitor on the output helps with noise and stability.and is mandatory for some specific devices.

                           

                          #851603
                          duncan webster 1
                          Participant
                            @duncanwebster1

                            Thanks again, all understood

                            #851616
                            Macolm
                            Participant
                              @macolm

                              For the purpose of lightening protection the circuit Robert gives is comprehensive, but in addition, the physical layout is also important. In particular, the 1nF capacitor is critical, and the leads need to be as short as possible to minimise inevitable unwanted inductance. Take a look at this link from Murata showing how this translates to self-resonance, above which frequency the capacitor ceases to be fully effective. On the second page, the first diagram shows how you should best connect the capacitor, with a short lead to a ground plane, and short two terminal connection into the circuit.

                              https://www.murata.com/~/media/webrenewal/products/emc/emifil/knowhow/12to14.ashx

                              This all helps to minimise any feed through of any spike to the semiconductor.

                              Even better is the same configuration where the capacitor is a surface mount component, or best, a feed through capacitor.

                              #851830
                              SillyOldDuffer
                              Moderator
                                @sillyoldduffer

                                The main problem as I see it is that Duncan’s design connects a delicate high-impedance 5 volt microcontroller between two large antennae!  The set-up is as likely to pick up static electricity in a thunderstorm as Benjamin Franklin’s kite and key experiment.

                                I suggest isolating the Arduino (which is tried and tested functionally) from both the track and the 12v power line.

                                A Model Engineering signalling system is probably turned off until the track is needed.  Therefore, when the track isn’t being used, the Arduino signal units can all be physically disconnected from the power line.  Can be done automatically with a relay, and the miniature 5V types common in Arduino-land should provide about 1.5kV of isolation.   I also suggest bridging the 12V supply with a Gas Discharge Tube and a bi-directional Transient Voltage suppression diode.  These are specifically designed to protect against surges and cost less than 50p each.

                                The same devices should also be applied across each section of track, hopefully limiting the voltage it picks up.

                                The other major problem is connecting the track direct to the Arduino’s A1 pin.  A1 is fitted with an Analogue to Digital Converter with an input impedance of about 5MΩ, max input 5.1volts, so it stands no chance if a thunderstorm or sultry weather charges the track up with a few thousand volts of static electricity.  The counter-measure here is an opto-isolator with an analogue output, home-made if necessary. As per Duncan’s 3-level design, the LED burns more or less brightly.  It’s full on if the track develops a continuity fault.  Normally half brightness by the potential divider when no train is on the track, and off when a train shorts the rails.   Duncan’s code stays the same, the difference being there is no electrical connection between the track and the Arduino’s delicate ADC.

                                isolatedRail

                                None of the suggestions, including mine, would protect against a direct lightning strike, but that’s very unlikely – Duncan would have noticed more violence.  A house in the village was struck last year, and the damage was very obvious – half the chimney stack disintegrated, and about a quarter of the tiles blown off.    Duncan’s signals were probably destroyed as described by Macolm due to being inside the voltage gradient between ground and a charged storm cloud.   Playing amateur radio, I’ve seen sparks jump 5mm to earth from a 10 metre long wire antenna. No lightning, just static electricity.  Takes about 3kV to jump a millimetre, easily generated by rubbing a rubber balloon against a woolly jumper…

                                Dave

                                 

                                 

                                #851841
                                duncan webster 1
                                Participant
                                  @duncanwebster1

                                  Michael Faraday reckoned he learned more from failed experiments that successful ones. I’ve just spent all afternoon failing, bt have finally learned something.

                                  Those of you who have been following this thread will know that I’m building 7 off replacement control boards. Rather than using Arduino minis, I’ve decided to use Nanos, as they are much the same price nowadays, and I’ve been having problems programming Minis since changing computer and upgrading to W11. The pins fit in the same holes, the only difference is that instead of A1,2,3 on the Mini, the corresponding pins on Nano are A4,5,6. No problem think I, just change the pin allocations.

                                  It’s taken me all afternoon to discover that A5 & 6 are analog only on a Nano, and INPUT_PULLUP, DigitalRead and DigitalWrite simply don’t work. Putting in a physical pullup, and using analogRead/Write solved all the problems.

                                  I’ll have to have a good cogitate about SOD’s suggestions, the idea of a 3 level opto-isolator is new to me. Is such a thing available as a chip?

                                  #851859
                                  duncan webster 1
                                  Participant
                                    @duncanwebster1

                                    More thoughts, could I use a quad op-amp as a buffer? Might be more robust, and only ~40p from Mr Ali.

                                    Alternatively I can get a 4 pole relay of £11

                                    #851862
                                    Robert Atkinson 2
                                    Participant
                                      @robertatkinson2

                                      You can use any basic opto coupler in “analog” mode. You just keep the LED current and phototransistor load so that the transistor is not saturated.
                                      The problem is that they are not very consistent device to device and with temperature.
                                      For 3 levels it should not be too much of a problem. If you wanted to be clever and have 3 channels (one spare) you could use a 4 channel isolator and use one channel with a fixed resistance in series with the LED as a reference level and do a comparison in software. Using a 4 channel optocoupler means all the semiconductors inside probably came from same wafer, are well matched and thermally connected.

                                      What is the track detection circuit and what are the levels you are working with? I can do some sums and see how feasible it is.

                                      Robert.

                                      #851890
                                      duncan webster 1
                                      Participant
                                        @duncanwebster1

                                        Apart from the power supply, the box of tricks has 2 inputs direct to arduino and one output from the ULN2003. The only voltage regulator that failed was a 78L05, mistake using that as I read they are a bit fragile. 4 of them survived as did 2 off proper 7805s. I’ve only tested one ULN so far, but it survived, again I think they are fairly robust. On that basis I only need 2 isolators.

                                        Track occupied is < 5/3 v, fault is > 5×2/3, clear is anywhere between. Bearing in mind I’m getting on and no-one else in the club understands it, I want to avoid anything that needs setting up

                                        #851925
                                        duncan webster 1
                                        Participant
                                          @duncanwebster1

                                          And just to add further complexity, train in section isn’t always 0v, we’ve had track so dirty it didn’t get down below the 5/3 v and so didn’t trigger the signal. This under some trees which drop sticky sap and on a downhill section, so adhesion wasn’t an issue.

                                          Colleague is working on a track cleaner

                                          #851936
                                          Robert Atkinson 2
                                          Participant
                                            @robertatkinson2

                                            EDIT:
                                            sorry, I somehow missed SOD’s post (are we still suffering from disappearing posts?). Sorry Dave. Dave’s scheme is basically the same as I was thinking of. I think there is an issue with the relay circuit on the power supply but Dave has much more pressing issues at the moments than model engineering.

                                            I had not seen his post when I wrote the following:

                                            OK so your 3 states are:

                                            Open (leakage current only) = fault or open points

                                            1k = Track not occupied

                                            Short (train resistance) = Track occupied

                                            Is that correct?

                                            I assume you have a 1k resistor across the end of the track.
                                            I think I can make a reasonable opto isolator design with that.

                                            The ULN2003s are surviving because A. They have relatively large semiconductor junctions being power devices and B. they have protective diodes from output to supply.

                                            I’ll knock up a detailed design.

                                            Robert

                                            #851950
                                            Robert Atkinson 2
                                            Participant
                                              @robertatkinson2

                                              My design:

                                              Track monitor scheme

                                              The ILQ74 is a quad device so only one needed per board. The nodes marked 0V should be a low impedance ground plane, single earth point or similar.
                                              If not using automatic compensation, you should measure the current transfer ratio (or output voltage for each of the three states and adjust your thresholds to suit.

                                              Robert.

                                              #851962
                                              duncan webster 1
                                              Participant
                                                @duncanwebster1

                                                Thanks, I’ve ordered a couple of ILQ74s to play with. Hopefully the Nanos should have come from China by the time I get home,  so I should have a batch ready for tomorrow.

                                                I’m still smitten with SOD’S relay, but altered so that when power is off it shorts the inputs to ground. Its simplicity appeals.

                                              Viewing 22 posts - 26 through 47 (of 47 total)
                                              • Please log in to reply to this topic. Registering is free and easy using the links on the menu at the top of this page.

                                              Latest Replies

                                              Viewing 25 topics - 1 through 25 (of 25 total)
                                              Viewing 25 topics - 1 through 25 (of 25 total)

                                              View full reply list.