Go Down

Topic: Controlling relays with ULN2003 (Read 3 times) previous topic - next topic

CrossRoads

The way you are wired up, the ULN2003 output is providing the low for the motor, while the relay connects the 12V.
I think you'd have better results connecting the bottom right pins of the relays to ground directly and not to ULN2003.  Kee the bottom left pin connected to 12V.
When the relay is unenergized (ULN2003 output is high), both leads have +12V, thus no rotation.
When R9 energises, current flows 'up' thru the motor. When R10 energises, current flows 'down' thru the motor. Thus you are not relying on the ULN2003 to sink the current thru the motor. Your parts will be much happier that way.
As it is, the poor ULN2003 is trying to sink both the coil current to energize the relay, and the motors current.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Graynomad

Are you sure the 12v PSU is up to the job of running all the relays and motors? Oscillating relays is often a sign of a bad supply.

Do this all still happen with no motors attached?

Quote
Too much current drawn from the mega

Those 2003 inputs would only draw about 1.2mA I think so that should be OK.


EDIT: Are you sure about that CR, I thought the schematic looked right, albeit very confusingly drawn.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

CrossRoads

Okay, maybe not 100% - I didn't see the ground connection to the top of the relay - the schematic is too big and takes a lot of scrolling around to see it.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Varkey

The oscillations starts even if the motors are not connected.
I have even tried to run only the relays through the ULN2003, Even only one ULN2003 at a time. It has not helped.
I have tried to change the connections to the relay as suggested by Dear Crossroads to no avail.
I have even tried to invert the outputs from the mega through a 74LS04 to create a barrier between the mega and the ULN2003 and changed the digital outputs for the same through the software  to take care of the inverted inputs to the ULN2003. But no luck.
I have even tried to run the motor directly from another source through the relays. There can be no current dropings because I have tried to give the supply through a 32A 12V battery.
The current drawn for the mega is from a USB of my laptop. I have even tried to give a 7V supply to the mega board through the power jack.


CrossRoads

Post your code then - maybe something funny is going on there.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Go Up