Arduino 555 watchdog timer

Advert

Arduino 555 watchdog timer

Home Forums Electronics in the Workshop Arduino 555 watchdog timer

Viewing 16 posts - 51 through 66 (of 66 total)
  • Author
    Posts
  • #235737
    Muzzer
    Participant
      @muzzer

      How much did you pay for yours? Seems to be about £250 on Amazon which looks pretty good value. As you might expect, the nearest Tek equivalent is about £500. I'm about to buy a basic scope and this might be about right for my purposes.

      There are plenty of rail-to-rail opamps around that don't require a negative rail and could be used with a small Schottky diode (like a BAT54 or BAT85) or to drive a small FET 2N7000 etc but this is really an application for a comparator rather than an opamp. Being open collector, there's need for a diode to begin with.

      The modern CMOS 7555 version of the 555 is improved and can drive its output close to ground.

      Advert
      #235742
      Anonymous
        Posted by SillyOldDuffer on 22/04/2016 11:10:48:

        A number of people have criticised the external circuit as being unnecessary. The technique was new to me but reading more widely about the quirks of resetting Arduinos revealed there are several valid use cases for it. I would ignore their advice.

        Sadly it's that sort of attitude, and the diatribes by Simon Williams, that mean I no longer participate in electronics threads on this forum.

        Andrew

        #235745
        John Fielding
        Participant
          @johnfielding34086

          Hi Muzzer,

          Actually there are no true rail-rail op amps that I have come across. Although many claim to be "true rail-rail outputs" they aren't. Some time ago I needed a true rail-rail output op amp and the best I found only got to within 50mV of the positive rail and 20mV to the negative rail, which wasn't good enough. Many are true "rail-rail inputs" as they use saturation of the input devices but they aren't linear in this mode. In my application I needed a voltage follower to buffer the D-A output to provide a reference voltage for a radio telescope positioning system. The D-A gave the correct output but after the voltage follower there was a persistent error voltage which was a big problem. Eventually had to admit defeat and run the Op-amp off a slightly higher supply rail to get rid of the error near the top of the range. The bottom wasn't an issue as the positioner had a minimum voltage of 500mV but it extended to 4.96V at the top of the range as I was using a 12-bit D-A. I spoke to the manufacturers and they admitted they aren't really rail-rail, but close enough in their opinion! They then amended the data sheets to show they aren't rail-rail outputs, but still called them such devices.

          I agree with your comments about voltage comparators, as I already mentioned in an earlier post on the topic. A good one will swing pretty close to ground for most applications as long as the sink current is only a few mA. Like all semiconductors the collector-emitter junction voltage goes up with increasing current!

          #235749
          Andy Holdaway
          Participant
            @andyholdaway

            Muzzer, my DSO was about £200 from China delivered. Compared to some of the old scopes I love this one!

            It does everything I need (and more), is simple to use, and fairly well documented. I've had it about 18 months now, and although it's not in daily ( or even weekly) use, it makes fault finding much easier. I went for the 100MHz version as I occasionally dabble in higher frequencies, and would highly recommend them.

            Andy

            #235753
            Neil Wyatt
            Moderator
              @neilwyatt

              Cor! My Hameg cost less than £40…

              Neil

              (Who helped his genius mate Ray decode the reset vector for an Amstrad PCW bit by bit (yes bit not byte) using the Heathkit scope my Dad built in the late 60s or early 70s…)

              #235757
              Muzzer
              Participant
                @muzzer

                I see. Of course, there can never be a "true" rail-to-rail" device running from a single rail, since it's a matter of what source / sink current you have and what saturation voltage you need. Whether bipolar or MOS, the output devices will always generate some level of saturation voltage. In the context of this discussion, they are widely available. For a positioning system, sounds as if you'd need an instrumentation grade device and a negative rail.

                If you are running a 12 bit D-A (0.024% steps), you will usually have a precision voltage reference and wouldn't tend to use the voltage reference rail itself to power the buffer amp? So the headroom you use to generate the reference would naturally provide headroom for the opamp too. But perhaps you'd long committed to a layout by then.

                Murray

                #235758
                Muzzer
                Participant
                  @muzzer
                  Posted by Andrew Holdaway on 22/04/2016 14:39:15:

                  Muzzer, my DSO was about £200 from China delivered. Compared to some of the old scopes I love this one!

                  It does everything I need (and more), is simple to use, and fairly well documented. I've had it about 18 months now, and although it's not in daily ( or even weekly) use, it makes fault finding much easier. I went for the 100MHz version as I occasionally dabble in higher frequencies, and would highly recommend them.

                  Andy

                  What have you got? Also a Siglent?

                  #235759
                  John Haine
                  Participant
                    @johnhaine32865

                    Just to point out that all silicon PN diodes have about the same forward voltage drop, around 0.6V at room temperature. This is a characteristic of the material not the specific diode construction. Other diode types, such as Schottky, have a smaller drop; others like LEDs can be larger. But 0.6V for a silicon diode at small currents is a reasonable assumption. At higher currents, a small signal diode like the 1N4148 may drop more than a rectifier like the 1N4001 because the junction is smaller and its resistance more significant.

                    #235760
                    Andy Holdaway
                    Participant
                      @andyholdaway

                      And 50 years ago, Heathkit was all we could aspire to, but thankfully times (and technology) have moved on! cheeky

                      Andy

                      #235761
                      SillyOldDuffer
                      Moderator
                        @sillyoldduffer
                        Posted by Andrew Johnston on 22/04/2016 13:42:36:

                        Posted by SillyOldDuffer on 22/04/2016 11:10:48:

                        A number of people have criticised the external circuit as being unnecessary. The technique was new to me but reading more widely about the quirks of resetting Arduinos revealed there are several valid use cases for it. I would ignore their advice.

                        Sadly it's that sort of attitude, and the diatribes by Simon Williams, that mean I no longer participate in electronics threads on this forum.

                        Andrew

                        Many apologies Andrew, no offence intended. I should perhaps have said something like " I would ignore their advice in this particular case". The criticism is certainly valid in other circumstances.

                        Sorry,

                        Dave

                        #235764
                        Andy Holdaway
                        Participant
                          @andyholdaway

                          Muzzer, yes, I have the Siglent SDS1102 (from memory, it's at home). Can't fault it for the things I use it for.

                          Andy

                          #235766
                          SillyOldDuffer
                          Moderator
                            @sillyoldduffer
                            Posted by John Fielding on 22/04/2016 12:52:20:

                            Hi Silly Old Duffer,

                            The 1N4148 is typically 4pF and the 1N4000 series is about 50pF, but these are much too small to cause a problem. It can only be one of two things. Either the asserted reset pulse is not going low enough, as Neill pointed out, or more likely to be the reset low duration is not long enough. Most uPs need a minimum duration of the reset pulse to provide a reliable rest pulse to be recognised. If they could be triggered by nano-second long pulses then they would be forever resetting, which would keep the uP out of running.

                            I didn't notice a POR capacitor on the original schematic? Normally one is needed to hold the uP off until the supply rail has stabilised after initial switch on. It can either use an external or internal pull-up resistor and a smallish capacitor, preferably a tantalum for low leakage. On the Motorola GP32 processors the recommended reset circuit is via a 1N4148 to the open collector device which forces the reset pin low. Not sure what Atmel recommends for the AVR types.

                            For these kind of add ons I prefer a simple monostable with a voltage comparator which gives a defined pulse duration. Something like a LM339 family works well and very low cost. I detest the 555 timer and all its problems! But YMMV?

                            Hi John.

                            Agreed. The diode mangles the waveform slightly on the rising edge and it's very unlikely that's causing Steve's symptoms. There's no substantial difference between a 1N4148 and a 1N4001. Here's the 4001 pictures:

                            Before Diode:

                            nodiode.jpg

                            After diode:

                            diode.jpg

                            POR. The Arduino family of boards all wrap the processor up with the components needed to manage Power on Reset and the other stuff needed to make the CPU user friendly. That's why Steve's circuit is so simple.

                            Arduino boards include a loader in firmware. As a result an Arduino reset isn't quite a simple CPU hardware reset. The process also checks the serial line to see if the IDE has a new image to download and installs it if necessary. Only after doing that does the CPU re-start the users program.

                            I know exactly what you mean about the 555: lots of us have a love-hate relationship with it!

                            Steve will have to look at his code to confirm that the reset pulse coming out of his Arduino lasts long enough to reset the 555. As Neil points out the pulse has to be at least 12mS long. On the output side the 555 also generates a 12mS pulse and that would explain why the relay doesn't work – not enough electrons can pass in 12mS to work the coil.

                            I can now confirm that the circuit reliably resets a Arduino Mega. As this afternoon's domestic task turned out to be much easier than expected so I might bunk off and write the code needed to generate a software heartbeat with it.

                            I paid about £270 for my Siglent and prices have dropped since then. The advantage of the CML models is that they have more memory to capture extra waveform detail, but they all pretty good. If money is no object Siglent have just released a new "go-faster" range that''s even more impressive. Bit pricey though.

                            Cheers,

                            Dave

                            #235772
                            Neil Wyatt
                            Moderator
                              @neilwyatt
                              Posted by John Fielding on 22/04/2016 12:52:20:

                              I didn't notice a POR capacitor on the original schematic? Normally one is needed to hold the uP off until the supply rail has stabilised after initial switch on. It can either use an external or internal pull-up resistor and a smallish capacitor, preferably a tantalum for low leakage. On the Motorola GP32 processors the recommended reset circuit is via a 1N4148 to the open collector device which forces the reset pin low. Not sure what Atmel recommends for the AVR types.

                              I think it must be a long time since you looked at AVRs , John.

                              The AVRs have programmable startup delays that you can choose to suit the oscillator type (from a bewildering array of types and speeds) and power supply rise times (up to 65ms).

                              They also start up with all outputs hi-z which avoids the worries of things randomly switching themselves on at switch on.

                              You can tell I like them

                              Neil

                              #235799
                              Steve Addy
                              Participant
                                @steveaddy35670

                                Dave and everyone else who contributed I really have hit the jackpot with the responses

                                I have only had chance to have a quick squint through all the posts tonight and am absolutely delighted with what you have all written. I have a Siglent SDS 1102CML to play with. Last time played with a 'scope was nearly 50 years ago. It is fair to say they have changed a little. Before I only had a multimeter and couldn't see what the circuit was doing at all until I bought the thing. That was how the 1M resistor got changed; I intended to buy an old analogue device, but decided that decent ones were too expensive to risk spending the money on if it was going to get killed in the post or pop next week

                                I checked the 22uF capacitor with a Peak Atlas ESR70 – comes up 23.83uF and ESR of 1.60 Ohms. According to the table provided, that is a low ESR for a 25V capacitor. That leads me to think it is ok.

                                Tomorrow I may get the chance to print the responses and sort them out. I'm not suspending respiration though. Today I have been helping a younger member of the Sheffield Club sort his Sweet Pea valve gear out. Last week I made him some new surface ground face valves. Today we have sharp valve events and it notches up in reverse. It is great to help people, I enjoy it a great deal personally – I really hate to be the duck egg that I am with this lark. embarrassed

                                Thanks again to all

                                Steve

                                #235850
                                John Fielding
                                Participant
                                  @johnfielding34086

                                  Hi Neill,

                                  It is indeed a long time since we had anything to do with the Atmel range, after the scare with the glitches we detected. Changed to the Motorola GP32 and never looked back. The GP32 also goes high-z with the ports on boot, which can be used for some useful tasks! On the fuel injection system I used this to momentarily turn on the fuel pump for priming before the processor had run through its start up routine. Just made the POR duration about 1-second by selecting a larger capacitor and pull-up resistor combination and it worked out fine.

                                  #235858
                                  SillyOldDuffer
                                  Moderator
                                    @sillyoldduffer

                                    Hi Steve,

                                    Now I'm jealous! You have the scope I wanted. And a ESR70. I wonder what other goodies? It took me a long time to realise that having a decent set of tools saves a lot of frustration and false leads. Making do with a multimeter and a slightly faulty set ot second hand test equipment held me back I'm sure. It's why I'm the sort of person who diagnoses electronic faults best when the broken bit is actually smoking.

                                    Last night I was able to write a simple sketch to prove that an Arduino really can reset the 555. The code was harder than I expected, but it does work.

                                    I had to use a 30mS LOW pulse to reliably discharge the capacitor. One thing I hadn't thought of is that the Arduino and 555 aren't synchronised. If the 555 has only just started to recharge the capacitor, a very short pulse from the Arduino will discharge it. On the other hand the same LOW pulse arriving when the capacitor is nearly fully charged won't fully discharge it, and the Arduino gets an unwanted reset shortly after.

                                    This screen-shot shows a successful heartbeat followed by a reset. I pulled the heartbeat lead on the Arduino immediately after the successful heartbeat tick and then watched the 555 reset the Arduino when it didn't get another heartbeat. The blue line is the reset line and the yellow line is the capacitor.

                                    tick.jpg

                                    I'm pretty sure that you were right early on when you suggested that something simple is wrong with the circuit, or perhaps with the code. It's odd that 47k works when 1M doesn't. On the code side I had to do a bit of a hack to stop the heartbeat back charging the capacitor. You can't let the heartbeat pin go HIGH after you've forced it LOW, which is what normally happens with digitalWrite(). Here's how I did it, there may be a better way!

                                    void heartbeat()
                                    {
                                    // Sends a LOW pulse to discharge the 555's timing capacitor.
                                    // Note the pin is reset to be an input at the end, ie neither high nor low.
                                    // Done because making the pin HIGH rather than LOW charges the capacitor
                                    // and messes up the 555's timing!!!

                                    pinMode(HeartbeatPin,OUTPUT);
                                    digitalWrite( HeartbeatPin, LOW ); // Start the pulse
                                    Serial.print("Tickn"; // only needed to show heartbeat is working
                                    delay(30); // 30mS needed to reliably discharge 22uF via 560 ohms
                                    pinMode(HeartbeatPin,INPUT); // End the pulse
                                    }

                                    I like helping people too. At the moment I've had much more help from the forum than I've returned. It's not only that my direct questions get good answers, it's the wealth of knowledge I've harvested from all the other threads. I'm pleased you found my comments useful and you sound exactly to be the kind of guy who helps solve my multitudinous mechanical issues.

                                    By the way I found this example of fun with an SDS1102CML on the web. I wish I knew how he did it!

                                    Cheers,

                                    Dave

                                    Edited By SillyOldDuffer on 23/04/2016 11:39:34

                                  Viewing 16 posts - 51 through 66 (of 66 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.

                                  Advert

                                  Latest Replies

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

                                  View full reply list.

                                  Advert

                                  Newsletter Sign-up