Controled Reset with a switch transistor

Hello everyone,

I am working on a arduino uno project which need to connect recurrently to Serial without reseting the board.
The solution I found to disable reseting is to add a capacitor between Reset and Ground but it also blocks the upload of new code. My board is outside and inaccessible for maintenance so I can't use reset button to send my code.

I decided to use a 2N2222 transistor as switch between the Reset and capacitor ( 470 µF) and operated by a resistor relied ( 250 Ohm ) digital pin by the arduino which I remotely change state when I need to "turn off the capacitor bridge" and send new code.

I had tested it and it works like a charm but I am not sure if it is the proper way to do it ( never found a software way to do it) or if it is viable on the long term. For instance I not sure if I use the good resistor value for the Base and I think that the capacitor value is a bit more oversized.

Thank for any advise and help !

The most reliable way of forcing an Arduino reset is to use the watchdog timer to do it.
See, for example, Arduino Reset via Software

What do you use as the terminal program? The serial monitor will indeed reset the board; some other terminal programs have the option to suppress this behaviour (at least under Windows).

Thanks for your response, my issue is not really to force reset but to avoid it when I connect to Serial via my PC and to be still able to upload code.

I use the use the default terminal program and also python script which use Serial python to open automatically terminal and to log data from it.

Sorry. I read it too quickly. There are other discussions about that issue, for example: Autoreset Disabling but you appear to have an interesting solution.

Which is? If that's serial monitor, you can't do much from the software side so it needs indeed a hardware solution.

It's not quite clear to me what you do. But your python script should be able to communicate directly with the Arduino board and suppress the autoreset by disabling DTR and RTS; I know it works under Windows, not sure about Linux/Mac.

See the link marked "RESET EN" on the UNO? (OK, "RE ET EN" on that version. :grin: )
https://cdn.arstechnica.net/wp-content/uploads/2013/10/ArduinoUno_R3_Front.jpg Edit: Image is not "broken", just on a site which is antisocial! :roll_eyes: Click it!
You need to cut the link and solder a pair of header pins to it so you can put a jumper there when you need to upload code and remove the jumper when you do not want it to reset.

Or you can get some tiny SMD switches - or even buttons to hold pressed to start uploading.

The serial monitor from the Arduino IDE. I use it to debug when it is needed.
In the normal processing, my Arduino send lines of data via Serial and it's catch on my windows PC by python scripts to log it into files.
But when Serial python scripts are launched, it reset my board.
I think you are right about the possibilities of disabling DTR and RTS on the PC side. I will deepen this way, thanks.

Hello, I had already tried this option, It worked like the capacitor option but it also stop the upload of new code. I also only have remote access to by board so soldering jumper isn't the solution. I could install also a 2N2222 switch between these pins but I is less practical that the capacitor.

I think it's rtscts and dsrdtr as described in pySerial API — pySerial 3.4 documentation. I'm not a python person so can't say how to use it exactly.

if you connect a 220 ~ 470pF ceramic capacitor from RESET pin to GND, it will bypass the reset pulse, but has to be removed to program the UNO. I use a SPDT slide switch to switch the cap in or out.
cap_sw
cap_n_sw

He knows that and stated in the OP. What I suggested in #8 is the proper way to do it. The board is specifically designed to facilitate it and you use a jumper, switch or pushbutton to do it just as your suggestion.

He says he can't do that as the board is "remote". In which case I can't see how he proposes to do code uploads in the first place! Or control a transistor switch or relay.

A reed relay would be a simple option to switch the "RESET EN" jumper. Or a 74HC4066.

No idea what

means! :roll_eyes:

Hello again, thanks for your help, I tried these Parameters which should be the solutions but my board still reseting. I have to try on another PC to test it.

You need both to be false or both to be true; I think it's the former. If one of them is false and the other one is true it does not work in my experience (C#, Windows 10).

Hello again, I control the state of my transistor via a Serial command.
Strangely when the command switch to HIGH to LOW cutting the transistor, I can upload my code but the reseting is still disabled. Not a problem but I don't know why, maybe the time the capacitor discharge in the reset pin.

It is a little more difficult to solder on these pins and if I use a transistor on these. I also prefer when command pin 13 is by default LOW, it s possible to Reset and upload so that mean the current must pass between reset enable pins.

I disable both of them by passing them to 0, It didn't seem to work but maybe it's related to the doc 's note:
image

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.