Author Topic: A circuit works on a breadboard, but doesn't on the PCB I made. What's wrong?  (Read 371 times)

0 Members and 1 Guest are viewing this topic.

Offline vsevolopod

  • Contributor
  • Posts: 9
  • Country: us
  • Country: us
I'm trying to turn small 5 volt relays on and off from an arduino. I'm using a BC547 NPN transistor triggered by one of the digital pins. I've built the circuit based on this tutorial.

https://www.electronics-tutorials.ws/blog/relay-switch-circuit.html

I built the circuit on a breadboard, and it works. I made a PCB that has the Atmega 328 and the transistors on it. I know the microcontroller works, and that the extra digital pins on it will turn on the relay if I build the exact same circuit that is on the PCB on a breadboard. I don't understand why the exact same circuit on a breadboard turns the relay on, but it doesn't work on the PCB at all. I thought maybe it was because I have about a foot of cable between the transistor and the relay, but I put the same cable between the transistor circuit on the breadboard and the relay, and it worked. So at this point I've narrowed it down to a problem with my PCB design.

When I measure the voltage between the collector of the transistor on the board and +5v, I get +5 volts switched on and off by my arduino sketch. When I connect the relay, I get like 2V or less (I forget the exact number). This only happens with my PCB, not the breadboard.

What could I have done wrong with my PCB design?

Might there be a way to fix this, at least for now and use the same board, then update the design when I iron out all of the possible issues?
« Last Edit: February 03, 2019, 02:59:13 am by vsevolopod »
 

Online sokoloff

  • Super Contributor
  • ***
  • Posts: 1196
  • Country: us
  • Country: us
Occam's Razor suggests that the most likely cause is something is actually different between the breadboard and the PCB you made.
I'd spend a lot of time verifying or disproving that notion before thinking there's something different between the breadboard and PCB with the same circuit and components.
 
The following users thanked this post: vsevolopod

Offline tsman

  • Frequent Contributor
  • **
  • Posts: 599
  • Country: gb
  • Country: gb
Show your PCB artwork?
 

Offline vsevolopod

  • Contributor
  • Posts: 9
  • Country: us
  • Country: us
I went back and attached it to the original post, so It's easier for anyone to find.

I have spent a lot of time making sure that there is no difference between the PCB and the breadboard. The components are the same, the diodes are in the right way, everything is put together correctly, I don't think it's a construction mistake. It being a PCB and not a breadboard is the main difference I can find, the traces leading from the microcontroller to the transistors are somewhat long, and there are jumpers on top of the board that connect them to skip over some other traces on the bottom.
The digital outputs I wired to the breadboard are right next to the IC, this is the main difference I see, but maybe I'm missing something.
« Last Edit: February 03, 2019, 02:01:03 am by vsevolopod »
 

Offline JDubU

  • Regular Contributor
  • *
  • Posts: 232
Transistors backwards on the schematic.

Emitter on an NPN transistor needs to be connected to ground.  Collector goes to the bottom of the relay coil.
Turn the transistors 180 degrees on the PCB (flat side toward the left side of the board).
 
The following users thanked this post: vsevolopod

Offline vsevolopod

  • Contributor
  • Posts: 9
  • Country: us
  • Country: us
Wow yep that's it. I can't believe I didn't catch that. Thank you so much.

I'll probably come here to have my schematics checked more in the future.
I'd been staring at that so long I didn't notice that (honestly pretty obvious) mistake.

EEVblog Forum is the best!
« Last Edit: February 03, 2019, 02:31:14 am by vsevolopod »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf