Electronics > Microcontrollers

Arduino Mega Reset Problem

(1/3) > >>

caffeinatedbard:
I have been using an arduino mega for a project that uses relays to switch an AC three way air valve.  Initially I had issues with noise causing resets on the virtual com port. The arduino is sending data through RS-232 to be logged by a computer.

To remedy the situation I moved the RS-232 over to one of the other UARTs that are not shared with the other atmega USB emulator.  The other thing I did was to put the 110ohm resistor pulled to 5V on the reset line.   And I bypassed the USB 5V voltage and used a 12V power supply directly to Vin.

I am still getting random resets throughout the day.  Could someone please offer any suggestions as to what other things I could do to help mitigate this reset issue?


Cheers,
-Bard
"This arduino coolaid is starting to leave a bitter aftertaste."

Kremmen:
Reduce the EMI spikes from the air valve relays and solenoids: Make sure your freewheel / kickback diodes are there and positioned optimally. Incorporate snubbers and TVS devices in aggressor and victim wiring. Replace mechanical relays with fets and soft switch those. Throw away the Arduino and use something originally designed for such an enviroinment an application. Those come into mind immediately.

Psi:
What exactly is resetting? The micro, usb connection etc.

A usb virtual com port done in software on an 8bit micro is always going to be pushing things a little. It wouldn't surprise me if its a random timing problem with the usb code.

caffeinatedbard:
@Kremmen- Thanks for all those suggestions.
I have darlington pairs driving the relays for isolation.
I also agree with your suggestion about using something else.  I wanted to give it a trial run, but will be sticking with what I know works reliably (PICs).
Also, could you elaborate what you mean aggressor and victim wiring?  I am not familiar with those terms.

@Psi
I am not sure how familiar you are with the USB protocol used with the mega so I won't assume anything.
The ftdi chip was replaced with an atmega chip that emulates the USB.  There is a pin that can cause a reset by a software io toggling on the PC side. This will cause the bootloader to run on the arduino side so when you upload a sketch you don't have to manually reset the microcontroller.  In a harsh environment such as my particular case the reset line is prone to noise and can actually cause a reset.  I added a cap and resistor across the reset line so once I turn the micro on, the only reset would be cause by noise on the power supply.
To answer your question, the micro is resetting not the USB connection. 

Thanks for your suggestions so far.  I would welcome any other suggestions.

PeterG:
Which Arduino Mega board are you using?

Regards

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod