Hardware robustness... (ADC & RESET)...

Hi,

I work in a high-EMI environment. A couple of small changes to the standard Arduinos would ease matters for those like myself:

  1. Add in a low pass filter for the AVCC pin - a simple LC filter (15uH, 10nF) as recommended by Atmel - this will also enable more accurate ADC readings...

  2. read AVR040 & AVR042 - it's not commonly known that the /RESET pins on most AVRs is not ESD-protected in the same way as all other I/O pins - its almost impossible to find this out in the data sheets - its very obtuse indeed. A small diode (1N4148) with a 4k7 resistor to VCC, and a 4n7 cap to ground would help greatly (assuming you're not using HV programming). In addition, leaving space for a small zener between GND & /RESET would allow it to be easily added in very high noise environments.

Probably only a few cents to add, but these are simple changes that are recommended by Atmel that would, IMHO, greatly improve the robustness of these boards.

Cheers

Nick

Both of these changes are implemented on all of my boards.
http://www.wiblocks.com

  1. I use a 10uH, 0.1uF low pass filter.
  2. For the reset I have a 1N4148 from the reset pin to Vcc. I also include
    a position of a 0.1uF cap from /RESET to GND. (NB If you use the
    0.1uF from /RESET to GND the /RTS on close reset will not work
    reliably).

(* jcl *)

it's not commonly known that the /RESET pins on most AVRs is not ESD-protected in the same way as all other I/O pins - its almost impossible to find this out in the data sheets - its very obtuse indeed.

I believe that is so it can be set-up for high voltage programming where (I think) +12vdc is wired to the reset pin. Perhaps the datasheet section covering HV programming might explain the reset pin functions better. Obviously the normal clamping diodes from Vcc to pin wouldn't work for this pin.

I believe that is so it can be set-up for high voltage programming where (I think) +12vdc is wired to the reset pin. Perhaps the datasheet section covering HV programming might explain the reset pin functions better. Obviously the normal clamping diodes from Vcc to pin wouldn't work for this pin.

As I stated in point 2 of my OP, HV programming precludes the use of the full ESD protection, but Arduinos don't use that so can take advantage of the optional additional protection. Even if empty pads were left for optinal extra components, that'd be good and at no extra cost to the dev board.

Cheers

Nick

Hi,

I work in a high-EMI environment.its very....good programming

This is it guys. :o I think I have found an answer. I am using Atmega 328P in a race data logger installed on a go-kart, due to the kart size it can not be moved far from an engine. I am having problem with constant Arduino resets (see here Arduino Randomly Resets - adafruit industries
My three inputs which connected to sensors external to the box a already have low-pass filters, but resets still occur.
After reading this topic, I am suspecting the RESET pin to be cause of this, so EMI resets the processor via reset pin.
I didn't quite understand the point 2 of the first post, how to protect the reset pin from EMI? Would directly connecting the reset pin to Vcc help?

Secondly, is there way to completely disable the reset function?

You can disable RESET by programming the FUSE bits.

But be warned, this is quasi permanent. ISP programming won't work as well anymore. Only a HV programmer can revert this.

You can read the cause of a reset from a status register. Something similar to this or this (english).

due to the kart size it can not be moved far from an engine

Is it close to any part of the ignition system?

Don't know if its related but on the Twentyten the serial pins are biased

RX pin biased
The issue with an Arduino sometimes not booting in noisy environments has been corrected, the RX pin is now biased to prevent the bootloader freezing if it gets electrical noise on startup.

Thanks guys for hints in solving this puzzle. :wink:
The ignition is part of the engine, which is at the back of the go-kart and my logger is at the front, sitting behind nassau panel, but i guess the EMI from the ignition is still quite strong there. I am certain it is the ignition noise causing the reset, as the logger would run for hours until engine starts. How do I know it had been reset? it would create a new file on SD card less then second after it stoped writing to last file. The timestamps from the GPS show that.
I wouldn't change FUSE to disable RESET it is still useful feature. After I have studied AVR40 & AVR42 I understand better how to implement EMI protection. I have had a close look at the PCB itself and the Pin 1 (reset) on the chip wired all over the place! :o and its connected to a pin on ISP connector sticking out like an aerial! No wonder it will pick up EMI very well. So idea for now is to cut the ISP pin 1 and place a diode to Vcc and 0.1u capacitor to the ground, as close as possible to the Atmel 328 pin 1.
Regarding the RX biased on twentyten. Well I have GPS output wired to RX pin, so on restart of Atmega, gps would still be sending data to RX pin. Would that cause it to freeze? I think I had couple of times when something like that happened.

How do I know it had been reset?

Put something in the setup() to flash an LED. Then you will see it flash every time it resets.

However note that the reset function is only activated when this pin is low, to improve noise immunity on this simply change the value of the pull up resistor to say 1K.

ESD protection will not stop the processor pin from resetting it will only prevent damage in the case of a large voltage being present on the pin.

I did connect LED with 5000ms delay in the setup() and it comes on everytime I rev the engine high.
Now, I am connecting the pull up resistor and capacitor as recommended in diagram below.
The R value is 4k7 , capacitior C 0.1u and 1N4148 diode.

on Page 15. Sorry can't upload the picture itself.

So did it solve the problem?

I will be testing this solution this weekend. Will keep you posted.

I probably is necessary for you to shield the box and wires associated with your aduino controller in this high EMI environment. A solid steel box made of roofing tin may help though the "big guys" use Mu Metal shielding for such boxes. Ground this shield to the frame of the vehicle. You may want to do two layers of steel box if you use the cheaper material.
If you need to shield the box you probably need to opto-isolate or use circuit drivers such as ULN2003A chips to protect your box. This last item is just an industrial standard for automotive use. Shielding your input power lines is achieved by using DC-DC converters and all sorts of filtering as discussed in other discussions on this thread.

This sort of shielding is required because all of those nice pins that make an arduino shield are great antenna for the collection of EMI.

The really bad problem of your cart is that it probably uses a really noisy generation system and your power supply is unstable altogether. Solving this is a matter of doing several layers of power supply conversion with large caps at each layer to avoid the momentary current flow changes. I work on really big trucks and we have the same sort of problems. Typically we put a DC-DC converter that takes the 12VDC or 28VDC (our Case) and convert it to 12VDC. This is buffered with some big caps and then we DC-DC convert down to 5VDC or 3.3VDC as required. If we need 12VDC again for some use we actually take the 5VDC and kick it back up again using Buck Boost.

Power supplies of motor vehicles are just noisy as can be and you get all sorts of problems. USB lines have to be ringed on both ends with ferrites.

Hope this helps :sunglasses:

Thanks PaulNoel for you comments. I have put all the components in to a metal box from a VGA extender, except of coarse the sensors. The sensors connected via shielded cable and are no longer than 0.5 meter. It also runs of the battery, which is in the box iteself and the power line has ferrite ring as you can see on the picture.


The battery is good to hold for many hours and I doubt that its voltage drops below the minimum "browning out" voltage. But that is quite difficult to know.
At my last racing on the track the logger failed miserably, resetting at the rate of 4-5 resets per minute, more at the faster parts of the track.
Now I have made another mod in addition to the ones above. I have cut the PCB line going from PIN 1 of the ATMega see picture to avoid this line acting as an antenna.

Imgur

This mod will make me loose automatic reset during uploading sketches, but I am OK with the manual reset, just time the button press right after the upload begins. :wink:
I am going to test it next weekend and let you know the results.

Hi to all! :slight_smile:
Like Vlado, i'm developping a board on my kart 125 shifter that cut-off the electric current of engine coil to permit me to shit without close the gas pedal.
And like Vlado, i have the same problem: after few seconds (with the engine on) the arduino resets!
So, reading this post i decide to apply the reset protection.

Both of these changes are implemented on all of my boards.
http://www.wiblocks.com

  1. I use a 10uH, 0.1uF low pass filter.
  2. For the reset I have a 1N4148 from the reset pin to Vcc. I also include
    a position of a 0.1uF cap from /RESET to GND. (NB If you use the
    0.1uF from /RESET to GND the /RTS on close reset will not work
    reliably).

(* jcl *)

But i have a trouble with the 0.1uF cap from reset to gnd... After applying the cap the board come into a reset-loop status...
If i apply the cap after the first boot, the sketch start and anything go ok. But if i start the board with the cap mounted on, in this case it appen the condition described...
Any suggestions? Thanks a lot!