The Netduino forums have been replaced by new forums at community.wildernesslabs.co.
This site has been preserved for archival purposes only
and the ability to make new accounts or posts has been turned off.
Does this look right? And is there any other comments, suggestions or additions you would make?
PS Red wires are mains live, green main earth (neutral is not shown but can be assumed to be split for each IEC.
Brown is positive from the 12v supply and blue is the ground for the 12v supply.
The 12v gnd and netduino ground are tied together.
Thanks again,
Andy
Hi Andy,
Zooming in on your picture, I can see that you have the protection diodes and LEDs all facing the correct way - like in the first relay diagram posted by smarcus3.
You have wired the LEDs in series with the relay coils. This means they will both have the same current flowing through them. Given that they have very similar forward currents I don't think this is an issue.
But, your calculation is not quite right.
If we limit the current flowing to 25mA so the coils are not being over driven, then the calculation is just (12V - 2V - 2.5V) / 25mA = 7.5V / 0.025A = 300 Ohms.
One thing that is worrying me about your diagram is that the low voltage and mains voltages appear to be crossing over. For safety, it would be best if they did not. Ideally you would want to be able to draw a horizontal line across your circuit that passes through the relays; below the line would be low voltage, above it mains voltage.
Thanks, I have put a better image up now including the adjusted resistor your recommended. In terms of the mains crossing the low power, the relays in this image are only a representation, my real enclosure is already wired for mains and everything is fully insulated and grounded, this board will only provide wires out to the "coil" side of my SSR relays. There are more details of the full enclosure here: Relay Enclosure.
In terms of the transistors are the one listed (2N3904 and 2N3906) no good as they are only rated for 200ma? If so would these be any good?
The final part of this circuit (if you don't think I need any additional protection? in circuit fuses etc?) is the fan circuit.
Would you use the same circuit as the relays for this or something else perhaps with an opto?
Thanks again,
Andy
Hi Andy,
Zooming in on your picture, I can see that you have the protection diodes and LEDs all facing the correct way - like in the first relay diagram posted by smarcus3.
You have wired the LEDs in series with the relay coils. This means they will both have the same current flowing through them. Given that they have very similar forward currents I don't think this is an issue.
But, your calculation is not quite right.
If we limit the current flowing to 25mA so the coils are not being over driven, then the calculation is just (12V - 2V - 2.5V) / 25mA = 7.5V / 0.025A = 300 Ohms.
One thing that is worrying me about your diagram is that the low voltage and mains voltages appear to be crossing over. For safety, it would be best if they did not. Ideally you would want to be able to draw a horizontal line across your circuit that passes through the relays; below the line would be low voltage, above it mains voltage.
Just on the transistors, the 2N3904 data sheet and 2N3906 data sheet I just found says the 2N3904 and 2N2906 are good for 100mA as a switch - not 200mA.
If you are switching less than that with the transistors, then that is fine. If more, then you will need to find a new transistor.
Thanks, I have put a better image up now including the adjusted resistor your recommended. In terms of the mains crossing the low power, the relays in this image are only a representation, my real enclosure is already wired for mains and everything is fully insulated and grounded, this board will only provide wires out to the "coil" side of my SSR relays. There are more details of the full enclosure here: Relay Enclosure.
In terms of the transistors are the one listed (2N3904 and 2N3906) no good as they are only rated for 200ma? If so would these be any good?
The final part of this circuit (if you don't think I need any additional protection? in circuit fuses etc?) is the fan circuit.
Would you use the same circuit as the relays for this or something else perhaps with an opto?
Thanks again,
Andy
Back from work.
I've just followed your link and looked up your "relays". These are Solid State Relays "SSR"s containing a triac that is triggered using an LED inside the package of the relay. (They also have a network around the triac to help reduce electrical noise when it switches.)
As you have already said, the relay just requires 2.5V 25mA to switch it on (because the "coil" is just and LED), so a 100mA transistor will be OK for switching this.
Also since it is just and LED and not an actual coil of wire, you don't need a protection diode across the coil because there will not be any back emf when the current is turned off.
(With a real relay that has a coil, as the current is shut off, the magnetic field collapses and generates a spike of voltage across the coil that can damage other components. The protection diode gives this a safe place to go.)
I am not qualified to advise you on the safety side of the project.Very few people on this forum would be.
In my unqualified opinion, I would expect to see protection such as grounding and fuses on any project using mains voltages. If the project is being used outside or with water or in a wet environment I would expect to see a residual current device to cut off the mains if there is a path to earth. The list is endless.
Mario had some recommendations in the relay enclosure topic.
Thanks, I will be supplying the whole circuit with 12v 1amp, this is more where question arises from in terms of the transistors. The total load for the componets that the transistors will swich is 55ma, but does it matter if 1amp is flowing through the circuit?
The mains side of my enclosure I feel is pretty solid, maybe there are some additions such as stray current shut off as recommended, the enclosure itself is for indoor use, but near an aquarium so perhaps this is a consideration. The case itself is grounded to the earth terminal and I will run it using a surge protector for its power, plus the power inlet is switched and fused and all the power outlets are fused. I was wondering if I need any fuses or addition protection on the low power side?
The fans draw 120ma each so my total circuit (not including anything lost from other components) is 120ma x 2 + 30ma x 6 + 25ma x 6 = 570ma.
Thanks again,
Andy
Back from work.
I've just followed your link and looked up your "relays". These are Solid State Relays "SSR"s containing a triac that is triggered using an LED inside the package of the relay. (They also have a network around the triac to help reduce electrical noise when it switches.)
As you have already said, the relay just requires 2.5V 25mA to switch it on (because the "coil" is just and LED), so a 100mA transistor will be OK for switching this.
Also since it is just and LED and not an actual coil of wire, you don't need a protection diode across the coil because there will not be any back emf when the current is turned off.
(With a real relay that has a coil, as the current is shut off, the magnetic field collapses and generates a spike of voltage across the coil that can damage other components. The protection diode gives this a safe place to go.)
I am not qualified to advise you on the safety side of the project.Very few people on this forum would be.
In my unqualified opinion, I would expect to see protection such as grounding and fuses on any project using mains voltages. If the project is being used outside or with water or in a wet environment I would expect to see a residual current device to cut off the mains if there is a path to earth. The list is endless.
Mario had some recommendations in the relay enclosure topic.
Thanks, I will be supplying the whole circuit with 12v 1amp, this is more where question arises from in terms of the transistors. The total load for the componets that the transistors will swich is 55ma, but does it matter if 1amp is flowing through the circuit?
I think you are saying that you have a power supply that is rated at 12 Volts 1 Amp. The power supply should supply 12 Volts all the time, but the 1 Amp is the limit of the current that can be taken from the power supply. If your components don't need that much current then they will not take it.
For example, if you just connect one LED with a resistor, the power supply will only supply 12V at 25mA.
The mains side of my enclosure I feel is pretty solid, maybe there are some additions such as stray current shut off as recommended, the enclosure itself is for indoor use, but near an aquarium so perhaps this is a consideration. The case itself is grounded to the earth terminal and I will run it using a surge protector for its power, plus the power inlet is switched and fused and all the power outlets are fused.
In the UK it is possible to buy an RCD plug. Typically these are used for garden tools to ensure the power is shut off if you run the lawn mower over the cable, or drop the hedge trimmer in a pond. Its wired up just like a normal plug - you might consider something like this.
I was wondering if I need any fuses or addition protection on the low power side?
The fans draw 120ma each so my total circuit (not including anything lost from other components) is 120ma x 2 + 30ma x 6 + 25ma x 6 = 570ma.
Since the low voltages are all contained inside your case (there are no wires leaving the case that might fray and short circuit), there seems little chance that a fault will develop, but it would be prudent to add a 1 Amp fuse at the power supply input.
The data sheet for the 2SD882 transistor says it can carry up to 3 Amps - so these will be fine for the 120mA fans.
Hi Paul
Thanks for the great answer. In terms of the transistors then, is the the components they are driving rather than the current that comes in to the circuit? I.e. these will have 55ma (30ma from the leds and 25ma from the relays) so the 100ma switching rating is enough?
In terms of the fans the transistors I linked will be ok, what rating do I need to look for in terms of the diodes which I guess I will need in this case? Is there any additional components I will need to control the transitor using PWM? Also if I decided to use the pwm from my 2 spare TLC5940 outputs as they are open drains?
Thanks again,
Andy
PS I will definately be using an RCD thanks for the tip
Thanks for the great answer. In terms of the transistors then, is the the components they are driving rather than the current that comes in to the circuit? I.e. these will have 55ma (30ma from the leds and 25ma from the relays) so the 100ma switching rating is enough?
Andy I think you have not quite grasped what is happening with the current in the circuit. When you put a chain of components in series the same current flows through each of them. So it is just 25mA, not 25mA + 30mA, but the voltages in the chain add up to the total voltage (12V).
This web page seems to explain series and parallel circuits quite clearly. Have a look at the series diagram about half way down:
In your circuit, the battery is actually a 12V power supply, and you have two LEDs in series (one is inside the SSR relay). Your components form a single chain "a series circuit", so the current is the same all the way round, and the voltages add up to 12V.
Try re-drawing the diagram above and write down the numbers around the components.
In terms of the fans the transistors I linked will be ok, what rating do I need to look for in terms of the diodes which I guess I will need in this case? Is there any additional components I will need to control the transitor using PWM? Also if I decided to use the pwm from my 2 spare TLC5940 outputs as they are open drains?
Have you got a link to the fans?
I think if they are typical computer cooling fans they will have an electronic controller built in, it may not be possible to drive them with PWM as this will cause problems to the controller.
The fans are just some salvaged from an old pc, they are 2 wire not the "posh" 3 wire type that have a control signal. These are the fans.
Thanks for the description I get current now, simple things hey! Is there a max amount of current you have to consider at any point or will things just take what they want regardless how much you make available?
Finalising the original transitor queries, they are rated at 100ma for switching does this mean for the load they are switching NOT the current available for the circuit.
And finally in terms of voltage which you disipate with resistors...
E.g. 12v supply - 2.5v from Relay - 2v from LED = 7.5v do you have to make sure voltage is 0v when it gets ack to ground?
So if you have a really simple circuit of the above flowing from the positive supply in that order, do you use 1 resistor before the relay and this should disipate 7.5v leave 4.5v to the relay and finally 2v to the LED resulting in 0v by the time you get to the negative (gnd) of the supply?
Sorry for the simpleton questions, but I just want to make solid my understanding before I go trying to wire up things on my own back without instructions.
The fans are just some salvaged from an old pc, they are 2 wire not the "posh" 3 wire type that have a control signal. These are the fans.
I am not sure if you will be able to control the speed of those fans with PWM. I know that some fans have electronics in the hub to drive a series of motor coils - that type would probably not like being driven with a PWM signal.
I think you should just give it a go and see what you get.
If they don't work very well, then it might be worth adding a large capacitor (100uF plus) across the fan terminals to help average the PWM pulses into a variable DC voltage.
When you write the software, you will probably want to turn the fans on at full speed at first for a second or so to ensure they start to spin, and then reduce the PWM to slow them to the desired speed. You will have to determine the PWM setting when they stall, and have it as a lower limit in the driver software.
Thanks for the description I get current now, simple things hey! Is there a max amount of current you have to consider at any point or will things just take what they want regardless how much you make available?
If you give them the correct voltage (by using a resistor) then they only take the current they need.
Finalising the original transitor queries, they are rated at 100ma for switching does this mean for the load they are switching NOT the current available for the circuit.
Yes, its for the load they are switching.
And finally in terms of voltage which you disipate with resistors...
E.g. 12v supply - 2.5v from Relay - 2v from LED = 7.5v do you have to make sure voltage is 0v when it gets ack to ground?
Yes, calculate the resistor so that the total voltage adds up to the power supply voltage:
2.5V (relay) + 2.0V (LED) + 7.5V (resistor) = 12V (power supply)
So if you have a really simple circuit of the above flowing from the positive supply in that order, do you use 1 resistor before the relay and this should disipate 7.5v leave 4.5v to the relay and finally 2v to the LED resulting in 0v by the time you get to the negative (gnd) of the supply?
Yes that's right.
Sorry for the simpleton questions, but I just want to make solid my understanding before I go trying to wire up things on my own back without instructions.
Thanks again,
Andy
OK - happy to help.
Remember that all electronic components have to have exactly the right amount of smoke inside them. If the smoke comes out, it is really hard to get it back in again.
Hi
I am still playing around with some transitors and an led I have PNP 2n3904 and NPN 2n3906. The led has 12v and resistor going in to it that then goes to the collector. Pin 10 on the netduino goes through a 2k resistor to the base and the emittor goes to the 12v gnd and the netduino ground. The problem I have is that although the LED is going on and off, it never goes fully off. I.e. it switches between half and full brightness. Any clues?
Andy
I am still playing around with some transitors and an led I have PNP 2n3904 and NPN 2n3906. The led has 12v and resistor going in to it that then goes to the collector. Pin 10 on the netduino goes through a 2k resistor to the base and the emittor goes to the 12v gnd and the netduino ground. The problem I have is that although the LED is going on and off, it never goes fully off. I.e. it switches between half and full brightness. Any clues?
I am still playing around with some transitors and an led I have PNP 2n3904 and NPN 2n3906. The led has 12v and resistor going in to it that then goes to the collector. Pin 10 on the netduino goes through a 2k resistor to the base and the emittor goes to the 12v gnd and the netduino ground. The problem I have is that although the LED is going on and off, it never goes fully off. I.e. it switches between half and full brightness. Any clues?
Andy
If I understand correctly the wiring, you can't use a PNP transistor, but a NPN.
Here is a couple of pictures that show how to drive a led with both a NPN and a PNP: http://www.electroni...ommande-led.php
The article is in French, but the pictures are clear anyway.
Cheers
Biggest fault of Netduino? It runs by electricity.
I think you have the transistor the wrong way round.
The data sheet shows (from left to right) "E B C" when the flat side faces the Netduino in your layout.
You need "C B E" - so try turning it 180 degrees.
(I am viewing this on my Palm with a very small screen - so appologies if I am mistaken about the layout.)
Hope this helps - Paul
EDIT:
One other thing is that the 2N2906 is actually the PNP transistor according to the data sheet.
You want to be using the NPN 2N2904, data sheet.