SparkFun Forums 

Where electronics enthusiasts find answers.

Questions relating to designing PCBs
By Andycos
#163738
Hey all,

I'm new on here - and to tell you the truth, this is kinda the first work that I've done on Circuit design like this - I've done plenty of wiring over the years on car projects and other things, but never really got down to component level.

So, based on this, I'm hoping that you can all give me some feedback on my design.

I'm building a control box for a small automated system which will be run via an arduino board. However, I also want to add the following capability.

1 - For each Auto Output, I want to be able to choose between On-Off-Auto via a 3 way toggle switch
2 - Show (using RGB LED - 1) whether On-Off-Auto is selected
3 - Show (using RGB LED - 2) whether each Output (to Relay) is switched On or Off (whether via Auto or Manual)

Based on what I've learnt over the past 2 days I've put together this PCB schematic, which I think should achieve what I'm hoping to.

Image

The bottom right corner is the Input/Output Connector
Pin 1 - GND
Pin 2 - 12V In
Pin 3 - Auto Input (12V)
Pin 4 - Output to Relay

The top left corner is the DPDT switch
- First Pole has Auto In and 12 V in, and is used to switch the system between Auto, Manual and Off signal being fed back to the Relay Out and Base pin of Q3
- Second Pole is used to show status, each output is then run to the base pin either Transistor Q1 or Q2
- The 12V In is connected to the Collector of each Transistor, but also to the two Red LED Anode Pins (Via 560 Ohm Resistor a for each)
- The Emitter legs of the transistors are connected to the Blue or Green LED Anode Pins (Via a 470 Ohm resistor for each)
- The Common Cathodes for the LEDS are connected to the GND Pin

I think that should cover almost everything, but if there's anything I've missed, please ask.

Being a n00b I'm grateful for all feedback

Thanks
-
Andy
User avatar
By Ross Robotics
#163743
Your image doesn't work. Upload it as an attachment to a post.

What software are you using? Would be better if you attached the original files as well.
By Andycos
#163751
Ok Codlink,

Sorry, I wasn't sure if the link to Dropbox was going to work.... Here's the same image. I'm using DesignSpark software for this, but I can't seem to upload a .sch file to the post.

Thanks
-
Andy
You do not have the required permissions to view the files attached to this post.
By Tomdf
#163945
Hey there Andy. I'd like to help out with your circuit, but first I've got some schematic design tips that will make your work more legible in the future. Your schematic is a little difficult to read, but please do not sweat that at all! It's your first one and you've gotta start somewhere, right?
  • • Keep your positive connection toward the top of the schematic, grounds toward the bottom.
    • When necessary, replace awkwardly long traces with labels. For example you can write 12V next to any trace that would connect to 12V instead of drawing lines all the way back
    • Components and their labels should be horizontal whenever possible. When it isn't possible and things do need to be rotated, try to keep them all turned the same way.
Here is another way that your schematic could be drawn using those guidelines (drawn with the free version of EaglePCB.) For this schematic I assumed that "Auto" is the input from the arduino.

Image

Ok, so looking at this schematic I'm afraid that this will not work as you intend. Here are the issues as I see them:
  • 1. The red LEDs are both connected to 12V and ground and will be on all the time (as long as 12V is supplied.) Is this intentional? If so, are you aware that the colors of the RGB LED will mix resulting in colors like purple and brownish red? I'm assuming that you're using a regular ol' 5mm RGB LED. You may want to consider using separate LEDs for each function.

    2. The signal coming from your Arduino is connected to Q3 and your relay via the switch, that's not a good thing. The arduino will put out 5V which is not enough to drive the relay, and the relay is likely tied to 12V (I'm guessing). The arduino's output would be connected to a voltage higher than 5V, which would likely damage the microcontroller.

    Relays typical consume enough current that a microcontroller, like the arduino, can't handle it alone. To control things with coils, such as motors and relays, you'll need to connect the signal from the arduino to a transistor that can drive the needed current to the coil. You will also need a diode known as a "flyback diode" to handle the spike of voltage that is generated when power is removed from the coil. This is the exact same thing that is going on in an car's ignition coil except that in this case we don't want that massive voltage going back into our circuit. Check out this bildr tutorial for details on driving parts with coils: High-Power Control: Arduino + TIP120 Transistor

    3. Your relay does need a transistor, but your LEDs do not. A relay might need a half an amp or more to flip over, but standard LEDs only need about 1/50th of an amp (20mA) so you can drive them right off your 12V supply, or from your arduino (the LED's resistor value would be different depending on the supply voltage. Now, if you are using high brightness LEDs that consume more than 40mA you will need some kind of driver like with the relay, except without the flyback diode.
I do hope this points you in the right direction, feel free to ask if you need some clarification or help redesigning things.
By Andycos
#163948
Tomdf,

Thanks for the feedback on the schematic. I'm a mech engineer in the Automotive industry, and have done plenty of CAD work, but no wiring schematics, so all of this feedback is great! Thanks!

With relation to the LED setup, what I am trying to do is have the Red LED powered when the Blue or Green aren't. Ie. the LED should highlight one of three operational modes from the switch - red = off, green = on and blue = auto. So I was hoping that when the transistors switch the Blue or Green LED on, the RED would be switched off - this was my main concern with the circuit.

I've checked with the relays that I'm trying to use, and these should be fine - I've got relay boards (not relays) that allow for a 12v 30mA signal to switch the relay (at 24V output). The board is actually a sanguino I think, not arduino, and the control signals are 12v.

Does that make more sense? Sorry for missing some key inputs before!

--
Andy