External arduino reset

Hi, i am working on a egg incubator. Because arduino freezes sometimes because of emw, i need some kind of external reset circuit.

So i already have indication led on arduino with 60hz frequency blinking and i was thinking to use it as signal for external circuit. I was thinking about a circuit which would reset arduino if blinking signal stopped. A professor suggested me a dogwatch circuit with 2 NOR gates and in parallel another circuit with 2 NAND gates to ensure reset if arduino freezes in 1 or 0 signal.

I tried this circuit in couple simulators and IRL and it didnt work because once square signal comes on the gate, potencial changes and it triggers gates, capacitors starts charging/discharging and since NOR or NAND cant be triggered untill capacitor fully discharges/charges, this circuit isnt useful to me because it reswts every time there is a change in signal.

I hope you understood me.

Do you have any other idea?
Thanks


emw?

1 Like

Oh sorry, wrong translation, i meant emf as electro magnetic field and distruptions

I suggest a missing pulse detector.

You can make one with a '555, it may be what your professor was aiming for.

Google it, You will see '555-based solutions, and you may see one like you are working with.

You may be failing because the time constant implied by the exact component values is not matched to your input frequency and duty cycle.

You said 60 Hz, shoukd we assume a square wave at the system voltage for high and low? OIC, you have said.

60 Hz is not a good indicator, not for human consumption anyway. A lamp blinking way slower woukd be mor informative. Do you have control over that? How is the indicator being created in you code.?

a7

1 Like

So professor gave me 4011 chip which is NAND gates.

Oh, sorry I meant 1Hz, 60 blinks per minute

So I have signal led connected on arduino

Why not fix the real issue?

1 Like

Because last time it happend after 20days of running, somtimes it happend after couple of hours..

And i need it only as precaution

Hmm, I'm curious, how did you found it to be EMF?

1 Like

So at first i was using relay and light bulb (230v) then i switched on 12v heater, it was better but not the best, I moved psu further away and arduino stopped freezing so frequently. Then i used shielded wires etc... and as i remember high current, switching... equals EMF

It could be bug somewhere in 1600 lines of code, i dont know what else it could be..

SMPS can be bad in that way. So 12 V PSU, to the Arduinos RAW pin?

Arduinos have a watchdog timer built into them that will internally reset the controller if it is not periodically reset. Enable the internal watchdog, then put the reset all throughout your code (but NOT in an independent timer interrupt). Now if it gets in a weird state, the watchdog will timeout and reset it.

5 Likes

This begs the question: can interference take out an watchdog too?

1 Like

It certainly raises the question.

Casual use of the watch dog mechanism can lead to a fAlse sense of security.

Curl up under the umbrella or in from of the fire with a beverage of choice and see

a7

2 Likes

Yes, this is why more modern microcontrollers (e.g., STM32) often have multiple watchdogs. So there might be a "regular" watchdog that's driven by the system clock, and an Independent watchdog that's isolated on its own circuit. Failure to manage either of them will cause a reset. The independent watchdog has a useful quality in that after you turn it on, there's no way to turn it back off other than resetting the system. So, your code can't accidentally disable it after it's running.

3 Likes

Thank you all for response and quick help!

1 Like

Will you use the watchdog, or try to filter out interference (sounds like your power supply is the source), or both?

1 Like

I will try both. I dont really have a choice :wink:

Can you do a diagram over the setup? Include what models of the PSU, Arduino and other things you have.

1 Like