Note that the advantage of the method shown in the video versus using the Watch Dog Timer is this method with reset the Arduino MCU as well as anything else tied to the reset pin. The Watch Dog Timer will just reset the MCU.
I've used a similar technique, but used an opto-isolator in place of the transistor. In effect, it's working in exactly the same way, but with no transistor 'base' in the circuit; start-up noise and/or spurious floating of pins is not an issue. To activate the reset, the digital pin driving the LED side of the opto-isolator needs to be actively driven to HIGH for the switch to work.
This is not good practice. It might work now, but its not guaranteed to always work. When the AVR is reset, all I/O become inputs, which means the base of the transistor is not driven by anything. When you have a floating base, anything can happen. If the environment is noisy, you may pick up current enough to cause the transistor to turn on ? Ive worked in a lab where someone had a floating base and their circuit would get all screwy, but when they took it to their desk for debugging, it worked fine. Use a WDT instead. More reliable.
+Ian Brown watch dog timer. I have yet to see a microcontroller that does not have one. It's a timer that you have to reset every so often, otherwise, it forces a reset .Its to prevent hangs in the applications, because if you hang, you cant reset the timer, and so the application resets.
+efox29 Good point, although I am not sure that noise would have enough current behind it to turn the transistor on. One way to ensure this does not happen is to add a pull down resistor between the base and ground. Thoughts?
+ForceTronics yup that should work. Then the base is always in a known state and would be more reliable. However, the WDT or better if the microcontroller has access to a reset command like __asm__('reset') then that would be the easiest way to reset. Im pretty sure the AVR has it, not sure if the arduino environment stripped that away or not.
It seems to me using the transistor is a bit redundant when you could just tie a pin directly given the fact a digital output is simply the output of a transistor already.(don't enable a pull-up so you can still use the reset button).. i even used the reset pin as an analog input with another switch to use as an input (or a hall sensor) but just had it sens a halve voltage and still had the reset pin to do a full reset from,,works flawlessly..Attiny85 limited pins etc
how to add a serial port in Arduino Leonardo because mine after install (append) the another code the COM 7 are removing the only available is COM 4 but did not capable to install
I don't quite understand this question? Are you worried about not enough voltage out of digital pins to turn on transistor all the way? BTW I have another video on this topic using Watchdog timer
@@ForceTronics Thanks for the reply! I am rather worried about the transistor conducting even when you don't apply a full +5V to it. Like some transient just after resetting can occur, this transient voltage may not be as high as +5V but lower valued, moving transistor in active region if not in saturation region. Transistor may conduct enough to produce a reset even in active region. Am I correct? And yes I saw your watchdog timer video, it was great!
I am not sure I understand your question. When you reset a microcontroller the code starts over just a like cycling the power. Unlike a power cycle, a reset only affects the microcontroller or processor it is not going to reset other ICs in the circuit
Note that the advantage of the method shown in the video versus using the Watch Dog Timer is this method with reset the Arduino MCU as well as anything else tied to the reset pin. The Watch Dog Timer will just reset the MCU.
Nice and clear. Thanks!
I've used a similar technique, but used an opto-isolator in place of the transistor. In effect, it's working in exactly the same way, but with no transistor 'base' in the circuit; start-up noise and/or spurious floating of pins is not an issue. To activate the reset, the digital pin driving the LED side of the opto-isolator needs to be actively driven to HIGH for the switch to work.
Great comment. Can you share a link to a schematic and / or part numbers you used in your setup?
No problem. I've got this configuration built into my last Arduino project out of my head, but I'll knock up a simple circuit diagram.
fritzing.org/projects/arduino-uno-soft-reset#
This is not good practice. It might work now, but its not guaranteed to always work. When the AVR is reset, all I/O become inputs, which means the base of the transistor is not driven by anything. When you have a floating base, anything can happen. If the environment is noisy, you may pick up current enough to cause the transistor to turn on ? Ive worked in a lab where someone had a floating base and their circuit would get all screwy, but when they took it to their desk for debugging, it worked fine. Use a WDT instead. More reliable.
+efox29 What is a "WDT" - please elaborate. Cheers
+Ian Brown watch dog timer. I have yet to see a microcontroller that does not have one. It's a timer that you have to reset every so often, otherwise, it forces a reset .Its to prevent hangs in the applications, because if you hang, you cant reset the timer, and so the application resets.
+efox29 Good point, although I am not sure that noise would have enough current behind it to turn the transistor on. One way to ensure this does not happen is to add a pull down resistor between the base and ground. Thoughts?
+ForceTronics yup that should work. Then the base is always in a known state and would be more reliable. However, the WDT or better if the microcontroller has access to a reset command like __asm__('reset') then that would be the easiest way to reset. Im pretty sure the AVR has it, not sure if the arduino environment stripped that away or not.
+ForceTronics for some additional info see electronics.stackexchange.com/questions/16143/unnecessary-transistor-and-fet-resistors
It seems to me using the transistor is a bit redundant when you could just tie a pin directly given the fact a digital output is simply the output of a transistor already.(don't enable a pull-up so you can still use the reset button).. i even used the reset pin as an analog input with another switch to use as an input (or a hall sensor) but just had it sens a halve voltage and still had the reset pin to do a full reset from,,works flawlessly..Attiny85 limited pins etc
how to add a serial port in Arduino Leonardo because mine after install (append) the another code the COM 7 are removing the only available is COM 4 but did not capable to install
Hey did u consider the fact that transistor may conduct enough to reset in case the digital pin 4 gives even lower voltage transient output.
I don't quite understand this question? Are you worried about not enough voltage out of digital pins to turn on transistor all the way? BTW I have another video on this topic using Watchdog timer
@@ForceTronics Thanks for the reply! I am rather worried about the transistor conducting even when you don't apply a full +5V to it. Like some transient just after resetting can occur, this transient voltage may not be as high as +5V but lower valued, moving transistor in active region if not in saturation region. Transistor may conduct enough to produce a reset even in active region. Am I correct?
And yes I saw your watchdog timer video, it was great!
Yeah good point. There should be a pulldown resistor on gate of get to prevent it from turning on when it should not
Do you need to reset the code for the new code to work?
I am not sure I understand your question. When you reset a microcontroller the code starts over just a like cycling the power. Unlike a power cycle, a reset only affects the microcontroller or processor it is not going to reset other ICs in the circuit
How do I get back into my yun 2 password for setting up its settings back to factory
sorry can't find your code even go to 2016 blog. Please link me there.
Go to blog and search on title of the video