I am building a basic thermostat using an arduint and a dht22 sensor. I have the dht working fine, and the arduino is outputing as it should, but I can’t get the relays to trip… I’ve attatched my circuit diagram, sorry that it’s maybe a little messy… v1 is 12vdc from a wall power supply (the relays have 12v coils) d1 is a flyback diode, q1 is a 2n3904 transistor, r1 is a 1000 ohm resistor, st1 is a digital output pin from the arduino. Relay 1 is 12vdc and powers a case fan, Relay 2 is 120vac and powers a heater. The ground from the arduino is tied to the ground of the 12v wall source. Any idea as to why I’m not getting any action on the relays? Thanks!
You show 2 coils for the realy. Explain that. If there are 2 coils connected the wrong way they might neutralize, work against each other each other. I don't know the hfe for the transistor but it ought to be okey. To be sure, please attach the entire code.
There are two relays, and I wired the coils in series so that they will both trip at the same time - I suspect that this is the issue. I will re-try with each relay having it's own transistor. The problem is not on the coding side of things since I can't even get the relays to trip by applying 5v manually to the resistor.
Okey. What is the nominal coil voltage of each realy? If it is 6 volt it ought to work but the transistor is not managing. If it is 12 volt.... There is the fault. If the transistor can handle the current You might connect the 2 coils in parallell. Else, do as You say, use 2 transistors.
Your mistake is putting the two relay coils in series.
Because they are in series, the voltage is shared between them. You will only get 6V across each one (assuming they are identical).
You need to connect them in parallel, so that they both get the full 12V across them.