Unwanted shut down of outputs.

Does the reset only happen when the makershield is connected?

I read some few things while using an IO pin as input and using serial communication that creates some trouble . . ???

If you are talking about pin0 (rec comm) on the arduino, it is already pulled-up via the 1k resistor wired to the USB serial converter chip, so it will not see a 'floating' input condition.

Furthermore, my Arduino was powered through my usb, i just transfered to an external power supply (9 Vdc) and get my code running as perfect, and forever . . .

Any explanation on that ?
It could be (most likely) that your full setup of external hardware is just drawing too much +5 volt current. The USB 5 volt power coming from your PC is limited by the on-board thermofuse, rated at 500ma max. If however you are running using external power then the on-board 5 volt regulator is supplying the current and it has a little higher max current rating then when using USB power.
Lefty

liudr:
Do you have resistors in series with your LEDs?

It is strange that you figured out the period of your problem (I wish my students were this good) and more but failed to answer such a simple question.

Hi,

retrolefty:
Any explanation on that ?
It could be (most likely) that your full setup of external hardware is just drawing too much +5 volt current. The USB 5 volt power coming from your PC is limited by the on-board thermofuse, rated at 500ma max. If however you are running using external power then the on-board 5 volt regulator is supplying the current and it has a little higher max current rating then when using USB power.
Lefty

[/quote]

Thanks for the information.

However, i removed my maker shield board and tested my UNO R3 board again.

I applied a simple sketch of blinking 1 led only, here again my Board resets itself repeatedly after an interval of 1 min or less.

However when connected to an external power, and removed the USB connection, my board does not reset

????

liudr:

liudr:
Do you have resistors in series with your LEDs?

It is strange that you figured out the period of your problem (I wish my students were this good) and more but failed to answer such a simple question.

For now, i have only 1 LED connected, it comes from pin 13, set as output, goes through my LED from +ve pin to -ve via a 1K ohm resistor and eventually to the ground.

For my previous sketch, i was using 5 LEDS, each one connected seperately to their respective output pins, and each have their resistance through their LEDS.

Hope this answers the line, if my resistors were connected in series to my LEDs. . . Sorry for late reply. . :wink:

Can someone kindly please help me, is there anything i can do to restore this problem of reseting through using the USB port?

I will be late in preparing my Garduino .. =( , on top i need to submit that too.

Thanks

taz .. ..

taz3m:
However, i removed my maker shield board and tested my UNO R3 board again.

I applied a simple sketch of blinking 1 led only, here again my Board resets itself repeatedly after an interval of 1 min or less.

Just to clarify. You have a Uno board, no shield at all, connected to a single LED on pin 13, via a 1K resistor (to ground). Is that right? And running what sketch?

And it resets after 1 minute?

How do you know it resets?

Yes an UNO R3 BOARD.. i removed my shield for trouble shooting purpose..

so as is now, my UNO board is without any shield at all and 1 LED is connected to pin 13, through a 1k resistor to ground..

Moreorless, it resets every 1 min or smetime less.

Please Note that i encountered this prob wen i was doing some other sketch.. see my first post.

For simplicity in troubleshooting, i change my circuit to a single led and watch my connected Led whch is blinks within a delay of 1000 ms..
Wen it resets you can see visually the blinking of my on board led connected to pin 13 n my led connected externally blinks just the same a wen as u press reset button.

If i try my code from my first post, my outputs goes out automatically and i need to press my switch again(input), clearly knowing that areset has been performed..

Taz ..

You do know that opening and closing the serial monitor resets your arduino.

I still don't see how you know it is reaseting. Maybe you have a faulty USB cable.

If you don't mind answering my question, I would be much obliged.

taz3m:
If i try my code from my first post, my outputs goes out automatically and i need to press my switch again(input), clearly knowing that areset has been performed..

What switch? How do you know it reset?

I ask this question again.

I'm getting a bit tired of this thread. If you don't want to answer my questions I'll lock it.

No please do not lock it.

Im actually at work, and i used my mobile to reply, so i could not actually paste my codes and all.

Grumpy_Mike:
You do know that opening and closing the serial monitor resets your arduino.

I still don't see how you know it is reaseting. Maybe you have a faulty USB cable.

Yes i do know it resets the Arduino.

I did change the USB cable this morning, same thing happen.

For the 1 led blinking i used the following code, in the example itself:

/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.

This example code is in the public domain.
*/

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

How do i know it is reseting:

Ok! may be i am wrong, i presume so because, when my led blinks within an interval of 1000 ms and when you press the reset button manually and intentionally, you can notice that your led blinks 3 to 4 times rapidly, both the on-board and the externally connected led. I presume a reset has been achieved.

I confirmed it to be reset because, with my first sketch which i posted on my first post, i have a switch as input, with the same switch being pressed, i have 3 light modes.

Light mode 0= ALL OFF
Light mode 1 = All led blinks

when pressing reset manually and intentionally my outputs will go off and i need to press my switch again to activate my outputs as in the sketch:

/*

  • Bike light, revision 3: blinky
    */

int switchPin = 2; // switch is connected to pin 2
int led1Pin = 12;
int led2Pin = 11;
int led3Pin = 10;
int led4Pin = 9;
int led5Pin = 8;

int val; // variable for reading the pin status
int val2; // variable for reading the delayed status
int buttonState; // variable to hold the button state

int lightMode = 0; // What mode is the light in?

void setup() {
pinMode(switchPin, INPUT); // Set the switch pin as input

pinMode(led1Pin, OUTPUT);
pinMode(led2Pin, OUTPUT);
pinMode(led3Pin, OUTPUT);
pinMode(led4Pin, OUTPUT);
pinMode(led5Pin, OUTPUT);

Serial.begin(9600); // Set up serial communication at 9600bps
buttonState = digitalRead(switchPin); // read the initial state
}

void loop(){
val = digitalRead(switchPin); // read input value and store it in val
delay(10); // 10 milliseconds is a good amount of time
val2 = digitalRead(switchPin); // read the input again to check for bounces
if (val == val2) { // make sure we got 2 consistant readings!
if (val != buttonState) { // the button state has changed!
if (val == LOW) { // check if the button is pressed
if (lightMode == 0) { // light is off
lightMode = 1; // turn light on!
} else {
lightMode = 0; // turn light off!
}
}
}
buttonState = val; // save the new state in our variable
}

// Now do whatever the lightMode indicates
if (lightMode == 1) {
digitalWrite(led1Pin, HIGH);
digitalWrite(led2Pin, HIGH);
digitalWrite(led3Pin, HIGH);
digitalWrite(led4Pin, HIGH);
digitalWrite(led5Pin, HIGH);
delay(100);
digitalWrite(led1Pin, LOW);
digitalWrite(led2Pin, LOW);
digitalWrite(led3Pin, LOW);
digitalWrite(led4Pin, LOW);
digitalWrite(led5Pin, LOW);
delay(100);
}
// If lightmode is 0, we dont have to do anything because the LEDs are already off!
}


Evening i will try to post my circuit as well.

Thanks

taz ...

Evening i will try to post my circuit as well.

While you are at it, modify that last post. Select the code and hit the # icon then save it.

Your sketch can not cause the arduino to reset.
Is it close to a interference source like a motor or switching thermostat?

Grumpy_Mike:

Evening i will try to post my circuit as well.

While you are at it, modify that last post. Select the code and hit the # icon then save it.

Your sketch can not cause the arduino to reset.
Is it close to a interference source like a motor or switching thermostat?

taz3m:

Grumpy_Mike:

Evening i will try to post my circuit as well.

While you are at it, modify that last post. Select the code and hit the # icon then save it.

Your sketch can not cause the arduino to reset.
Is it close to a interference source like a motor or switching thermostat?

Hi,

I think i figured out the trouble.

Actually when i connected the UNO board to my laptop, it does reset each time and even now.

I tried connecting the UNO on my desktop PC, here it is it does not reset at all.

i have tested it for maybe 1 hour now, and it seems to be fine.

So i think my source prob was my usb. . .

Any suggestion upon how i can solve this issue on my laptop . . . :astonished:

Still atleast i know my UNO is alright till now.

thanks to everyone who help and gave me the support up to here .. :wink:

taz .......

taz3m:
So i think my source prob was my usb. . .

Or the mobile phone application you (or laptop vendor) installed.

If you leave Serial Monitor running and connected to the Arduino serial port does the reset occur?

Which mobile apk you refering to ??

cant get your point??

No it dont reset when serial monitor is running?
......

On the laptop computer is an application that is "probing" serial ports on a regular schedule. Mobile phone / PDA applications are the usual culprit. When that application opens the Arduino's serial port, the Arduino resets. By leaving Serial Monitor running you are blocking that application from accessing the Arduino serial port.

Hi,

You are totally right man . . . :smiley:

I kill the 2 processes which were running in the background . . . Here goes my ARDUINO Running & Running . . .

Many thanks man . . . That really Helped . . .

:smiley:


You are welcome. I'm glad you have it working.