Go Down

Topic: circuit dying or acting bizarre (Read 1 time) previous topic - next topic

treebykooba

hello,

i just learned fritzing so here is a poor attempt to show you the circuit i am working with. i hope you get the idea:

http://www.jeremycouillard.com/circuit.jpg (it's actually an atmega 328p but the pin config is the same)

the relays are not the ones i have but they are an spst relay that is turning the motors on and off and a dpdt relay that is reversing the polarity. the spst is 5v, powered by the arduino with a nominal current of 20mA. there is a diode across the coils. the dpdt is 12v and controlled through a tip120 transistor (with a diode). everything is powered through a 12v 1.7amp wall wort.

the leds are 12v, huge things and also are being powered separately and controlled through tip120s. the leds have a forward voltage of 3.5.

the code, pasted below, is very very simple. just starts the motors in one polarity, stops them, blinks some lights, then starts them again in a different polarity.
The problem is as follows: The program starts up and everything runs fine for about 2-3 cycles and then it either 1) just stops or 2) the relays and lights start turning on and off in a continuous loop...about 2 seconds on, two off. it is very strange....i've never had a circuit do something that wasn't in the code. Is there anything in my circuit that is suspect? any help/guidance would be so so appreciated!!!


Code: [Select]
void setup() {
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(5, OUTPUT);
  digitalWrite(13, LOW);
  digitalWrite(13,LOW);
  delay(5500);
}

void loop() {

 
  digitalWrite(13, HIGH);
  digitalWrite(12, HIGH);
  delay(35000);
  digitalWrite(13, LOW);
  digitalWrite(12, LOW);

  //light show needs to be 11 seconds exactly
  //22 loops
////////////////////////////////////////////////
  for (int i = 0; i<22;i++){
    digitalWrite (11, HIGH);
    delay(100);
    digitalWrite(10, HIGH);
    delay(100);
    digitalWrite(5, HIGH);
    delay(100);
    digitalWrite(11, LOW);
    delay(100);
    digitalWrite(10, LOW);
    delay(100);
    digitalWrite(5, LOW);
  }
///////////////////////////////////////////////

  //delay(11000);

  digitalWrite(13, LOW);
  digitalWrite(12, HIGH);
  delay(36000);
  digitalWrite(13,LOW);
  digitalWrite(12,LOW);
  delay(2000);



}




retrolefty

Well I can't really follow the drawing in great details, a real schematic drawing would be so much better. But the symptom you are having could just be that your loads are drawing too much current for your wall wart voltage source. Can you somehow measure the total current being drawn from you wall wart using a digital multimeter in current measurement function?

Lefty

treebykooba

man...i so with i knew how to do both those things but unfortunately i don't know how to get amperage readings off my multimeter and i'm still trying to learn the schematic part in fritzing. might take another couple days. i was thinking this was an amperage issue also. i can hopefully find another wall wart with more amperage. but 1.7 already seems like more than enough to run 6 LEDs, some transistors, 2 relays and an IC, no?

also now i am noticing it's mostly the timing that is off. this program i wrote is a very time specific thing (timed to be in sync to a video) and currently the circuit has been running for awhile but the timing is changing a lot. could this mean something is off with the crystal?

retrolefty


man...i so with i knew how to do both those things but unfortunately i don't know how to get amperage readings off my multimeter and i'm still trying to learn the schematic part in fritzing. might take another couple days. i was thinking this was an amperage issue also. i can hopefully find another wall wart with more amperage. but 1.7 already seems like more than enough to run 6 LEDs, some transistors, 2 relays and an IC, no?

also now i am noticing it's mostly the timing that is off. this program i wrote is a very time specific thing (timed to be in sync to a video) and currently the circuit has been running for awhile but the timing is changing a lot. could this mean something is off with the crystal?


Not likely in my opinion.

MarkT

Where are the decoupling capacitors?  You can't expect anything to work if you don't decouple all your supplies properly.
[ I won't respond to messages, use the forum please ]

Go Up