Can anyone tell what's wrong with my circuit?

  • Thread starter Thread starter UWouldKnow
  • Start date Start date
  • Tags Tags
    Circuit
Click For Summary

Discussion Overview

The discussion revolves around troubleshooting a malfunctioning circuit involving an Arduino and a relay intended to control LEDs. Participants explore various potential issues related to circuit assembly, power supply, and code execution, while seeking clarification on the circuit diagram and code used.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning
  • Experimental/applied

Main Points Raised

  • One participant reports that the relay does not trigger the LEDs as expected, suggesting a possible issue with the circuit setup.
  • Another participant requests circuit diagrams and code to better understand the problem, expressing concern over reliance on breadboard layouts instead of symbolic diagrams.
  • Suggestions are made to check power supply connections and to use a multimeter to verify voltage at various points in the circuit.
  • Some participants propose testing the circuit with battery power or a wall wart instead of USB to rule out power supply issues.
  • There are recommendations to isolate components, such as disconnecting the transistor collector wire to test the relay operation directly.
  • One participant mentions the possibility of the Arduino sourcing too much current, suggesting the use of a separate power supply for the relay coil.
  • Discussion includes a correction regarding the orientation of a diode in the circuit, which some participants agree is likely causing the relay to malfunction.

Areas of Agreement / Disagreement

Participants express multiple competing views on the potential causes of the circuit's failure, with no consensus reached on a single solution. There is agreement on the importance of checking the circuit diagram and code, but differing opinions on the specific troubleshooting steps to take.

Contextual Notes

Participants note the limitations of relying solely on breadboard layouts for troubleshooting, emphasizing the need for clear circuit diagrams. There is also mention of the potential for parasitic effects in breadboard setups, which may complicate circuit behavior.

Who May Find This Useful

This discussion may be useful for individuals learning about circuit assembly and troubleshooting, particularly those working with Arduino and relay systems. It may also benefit those interested in best practices for presenting circuit questions in forums.

UWouldKnow
Messages
19
Reaction score
2
I am doing basic tutorials with an arduino but I can't seem to get this circuit to work. I hooked everything up and ran the given code but nothing happens. The relay is supposed to trigger the led's on and off but when I run the code the relay isn't even making any noise

20170907_184645_zpsyszssulz.jpg

20170907_185942_zps29t1ejh5.jpg
 

Attachments

  • 20170907_184645_zpsyszssulz-jpg.jpg
    20170907_184645_zpsyszssulz-jpg.jpg
    43.7 KB · Views: 541
Last edited by a moderator:
Engineering news on Phys.org
UWouldKnow said:
am doing basic tutorials with an arduino but I can't seem to get this circuit to work. I hooked everything up and ran the given code but nothing happens. The relay is supposed to trigger the led's on and off but when I run the code the relay isn't even making any

most of your images are missing

show us your circuit diagram(s) for the circuit
also show the code for the micro
 
  • Like
Likes   Reactions: UWouldKnow and Asymptotic
Have you tried running everything off battery power (or wall wart) instead of USB? Without seeing a schematic or relay number that would be my guess.
 
  • Like
Likes   Reactions: UWouldKnow
davenn said:
show us your circuit diagram(s) for the circuit
It concerns me that so many circuit experimenters seem to present their questions in the form of pictures of a breadboard layout. Am I so old fashioned in expecting a symbolic circuit diagram? I wouldn't expect someone with an arithmetic problem to have it presented in terms of piles of beans. I wonder if it's the general habit to work with wires and components, directly form the device spec sheet. A breadboard realisation of fast circuitry - or even slow analogue - can be full of parasitics.
 
  • Like
Likes   Reactions: davenn, gleem, cnh1995 and 1 other person
Have you got a multi-meter and done some basic checks? eg is power getting to all the places it should? Is there any evidence the code is running? eg is the pin that drives the relay changing? That check alone might narrow the problem down to one half of the circuit or the other.
 
  • Like
Likes   Reactions: UWouldKnow
I notice the OP has not replied to any of this. Perhaps he needs a chance to do some checking of his wiring and code.
We tend to forget how hard troubleshooting can be to the uninitiated (and even the initiated).
 
  • Like
Likes   Reactions: CWatters and davenn
mishima said:
Have you tried running everything off battery power (or wall wart) instead of USB? Without seeing a schematic or relay number that would be my guess.

Thanks, I'll try that... I think that's what the issue is. What do you mean by wall wart? Is that something that converts the wall power into something suitible for an arduino

sophiecentaur said:
It concerns me that so many circuit experimenters seem to present their questions in the form of pictures of a breadboard layout. Am I so old fashioned in expecting a symbolic circuit diagram? I wouldn't expect someone with an arithmetic problem to have it presented in terms of piles of beans. I wonder if it's the general habit to work with wires and components, directly form the device spec sheet. A breadboard realisation of fast circuitry - or even slow analogue - can be full of parasitics.

Sorry I didn't mean to bother, I was just wondering if someone could see any obvious issues right off the bat. I was just curious as I am trying to learn and am in no need to try to get this circuit to work. The circuit diagram and code was made by a starter kit, so I am assuming that their circuit and code is correct. I should have been more clear and explained that

CWatters said:
Have you got a multi-meter and done some basic checks? eg is power getting to all the places it should? Is there any evidence the code is running? eg is the pin that drives the relay changing? That check alone might narrow the problem down to one half of the circuit or the other.

Interesting, I would be glad to run some test with my multimeter but I have no idea what to check for. And you it receives the code but it is just not doing anything.

davenn said:
most of your images are missing

show us your circuit diagram(s) for the circuit
also show the code for the micro

The code and circuit diagram was created by a starter kit so I was assuming that it is correct, I could still add them to the chat if your interested though.
 
UWouldKnow said:
The code and circuit diagram was created by a starter kit so I was assuming that it is correct, I could still add them to the chat if your interested though.

we ALL want to see them so that we have a better understanding of what you are talking about

again ... please post them
 
20170910_012658_zpsurwcjjra.jpg

20170910_012729_zps85z0gybc.jpg

20170910_012746_zpsrnrskhzx.jpg
20170910_012752_zpsj1ohxbis.jpg
 
  • #10
davenn said:
we ALL want to see them so that we have a better understanding of what you are talking about

again ... please post them

Okay I just posted them
 
  • #11
Troubleshooting:
The purpose of the following is not to make you feel bad - it's exactly what I (and the others here) would be checking from the very start)
Take nothing for granted about what you have done. Assembling circuits is an alien world for most people.
First of all, do you have your supply volts and ground actually arriving at your breadboard (both places) and processor?
Does the processor actually give you a different voltage on Pin 2 when it's supposed to? That test will determine if your code is ok. If that's a fail then look again at your code.
Are all the leads firmly in contact with the holes on the board?
Does the collector volts go 'down' when Pin 2 volts go 'up'?
I forgot - the most important is to check (twice) that the connections really are on the correct pins and not on a 'mirror image' in your head when you are looking at the thing upside down? (Happens every day!)
Is the transistor emitter actually connected to ground?
etc etc.
This is not a whole afternoon's work but something that need only take a couple of minutes and would be 'automatic'.
With luck, you may find one of the above tests 'fails' and you will have found your circuit fault.
 
  • Like
Likes   Reactions: cnh1995
  • #12
Are either of the LEDs lit?
If +5V and 0V (ground) are connected to the circuit then the LED on the N.C. relay pole ought to be on.

To isolate the transistor and Arduino output pin 2 from contention, temporarily disconnect the transistor collector wire, and jump it to ground. The relay coil should energize, switch the contacts, and the other LED ought to turn on.
Q-driven-relay(test).jpg


If the relay doesn't switch, then a problem exists in this 'half' of the circuit.
If the relay operates, and the other LED turns on, then the problem is on the Arduino/transistor side.
 
  • Like
Likes   Reactions: davenn, cnh1995 and sophiecentaur
  • #13
You'll most likely be able to resolve the problem using the troubleshooting tips from Sophiecentaur and asymptotic.

My two cents: I believe it is also possible that your arduino board is sourcing too much current (coils+LEDs). That gives you an error message "problem uploading to board" when you try to run the code. What is the current rating of the relay coil? Try using a separate 5V supply to feed the coil.
Edit: I don't see a mention of such error message in your OP. Are you sure the code was uploaded successfully?
 
Last edited:
  • Like
Likes   Reactions: Asymptotic
  • #14
cnh1995 said:
Try using a separate 5V supply to feed the coil.
This is a great idea, and has shaken loose another possibility ... is the Arduino USB cable plugged directly into a computer USB port, or is it plugged into a USB hub? An unpowered USB hub doesn't have much current sourcing capacity, and more often than not, doesn't have the juice to power an external HDD.
 
  • Like
Likes   Reactions: rbelli1 and cnh1995
  • #15
Is the diode the wrong way around?

EDIT: Scratch that - the diode IS the wrong way around, even in the breadboard diagram. Not your fault. The circuit diagram is correct. Give the person who drew the breadboard diagram an insulting slap across the face.
 
  • Like
Likes   Reactions: Asymptotic, sophiecentaur, davenn and 2 others
  • #16
Guineafowl said:
Is the diode the wrong way around?

EDIT: Scratch that - the diode IS the wrong way around, even in the breadboard diagram. Not your fault. The circuit diagram is correct. Give the person who drew the breadboard diagram an insulting slap across the face.

yup, good spotting

the flyback diode is reversed on the breadboard layout :smile:
result ... the relay won't operate

As @sophiecentaur said earlier, this is why we wanted the diagrams etc so we could check for errors

NOTE ... DONT DO Asymptotic's test UNTIL you have reversed the diode and checked operation, else you will just be shorting the 5V to ground via the poor diode and it probably won't survive that

Asymptotic said:
To isolate the transistor and Arduino output pin 2 from contention, temporarily disconnect the transistor collector wire, and jump it to ground. The relay coil should energize, switch the contacts, and the other LED ought to turn on.
Dave
 
  • Like
Likes   Reactions: Asymptotic and phinds

Similar threads

Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
Replies
12
Views
3K
Replies
7
Views
3K
Replies
12
Views
3K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 6 ·
Replies
6
Views
2K