Hi,
hi,
i am programing a type of change over switch for mains supply and backup. I have most the programming done. There is this one little problem. I am controlling the contactors with relay. I have a 4 relay module and arduino mega 2560 r3. The problem is with restart. now arduino can anytime just restart due to many reasons like power failure to arduino or other things. What i am afraid of is that everytime arduino restarts all the relays turn on for a moment and then power off and then function acording to the program. As its acting like a turn over switch only one relay can be on. If more than one relay powered on at the same time then it can cause problem. Please help and tell me what to do. How can i prevent the arduino from turning on all relays for second after i restart it.
Thanks in advance.
All the pins are set to inputs on reset. If you want the pins to be HIGH during that time, use a pull-up resistor. If you want them to be LOW during that time, use a pull-down resistor. 10K resistors should be sufficient.
Which pin and with which sketch? Upon a reset or power up all the I/O pins default to input pins so all external wiring signals will be 'floating', that can be a problem for external circuitry expecting a true logic high or low at all times. The bootloader then uses the serial pins and pin 13 (on a uno) until finally jumping to your sketch where you set the I/O pins as your project requires. Usually you can deal with external floating signals during reset/restarts with pull-up or pull-down external resistors. I would have to see a schematic drawing of what you are wiring up to be able to give more specific advice.
Lefty
kaashvicky:
Hi,
Where is your code? In what way is this a programming question? There doesn't even seem to be a question.
What, you can't read between the lines?
kaashvicky:
Hi,
Read this before posting a programming question
Point 6: Describe your problem in detail.
First i am sorry for the "Hi," am new to the forum so please bear with me.
And secondly this problems takes places before my programm starts so no problem there. i just thought there might be something to include before the start to solve it. like the internal pullup. But if i knew then i wouldnt have posted here in the first place.
johnwasser and retrolefty thank you so much.