Hello Kando
Sorry for the delay in responding. My day didn’t go as planned so I didn’t manage to put together some examples until now.
Firstly, there have been a number of good suggestions and valid ways of driving your relays. I believe in keeping it as simple as possible, so, considering you are only wanting to drive two relays off the one PICAXE output, I would recommend a simple circuit consisting of one transistor, one resistor and a diode (or diodes, explained below).
You mentioned (initially) that you intended on using 5V Coil relays. That’s fine, but you still can’t drive these direct from a PICAXE pin based on the data provided. See attached. The first example is based on your 5V relays. I decided to put a 1N4004 (D1) in series with the relays as you mentioned that they are rated at 4.5V. The diode will drop around 0.6V to 0.7V and this will bring the relay coils closer to their rated voltage. I am not sure what repetitive long term 5V use might do to the coils so it’s best not to risk it. The other diode (D2) is to protect your transistor.
I also used your transistor selection of a 2N3904. I found a spec sheet on this transistor and it would be fine for the task when driving the 5V relays. When we look at the transistor data, the hFE (DC Gain) is roughly around 50 for an Ic (collector current) of around 60mA. To be precise, the total collector current would be 65mA. If you divide this by 50 you get a base current of around 1.3mA. I like to then times this by a factor of 3 to ensure transistor base saturation (as you will get variations in hFE). This equals a base current of 3.9mA.
Based on a PICAXE output of 5V and a B-E voltage drop of 0.7V, we can calculate the base resistor to be 1099 Ohms, or to use the nearest preferred value, use a 1k Ohm resistor.
I hope that makes sense?
OK, now onto your second suggestion of using 12V relays. It’s the same principal as above, however you are now going to need two voltage rails. 5V for the PICAXE (assuming you are using a 5V PICAXE and/or have chosen to use that voltage level and not a lower level) and a 12V rail for the relays.
The next issue is that the specs you listed do not list the coil resistance. Instead, you have listed the contact resistance. Never mind, a search of Google revealed a number of data sheets written in what I think might have been German and I haven’t a clue how to read them. A further search managed to dig up one with some English. This sheet didn’t list the coil resistance but did list the power consumption, being 1.59W. So, based on a 12V coil, this would mean that our coil resistance is 132.5 Ohms, and, if we manage to drive the 2N3904 into complete saturation and have a very low C-E voltage drop (typically around 0.3V for this higher current application) we can calculate that the Ic (collector current) is 177mA. By the way, these are an automotive relay and are (by nature) a bit heavy on the juice and draw more than a typical PCB mounted relay (from memory, many typical 12V PCB relays have a higher coil resistance of around 200 Ohms to 250 Ohms). Anyway, we will work with these and crunch the numbers.
The 2N3904 can handle 200mA so it will just make it in terms of driving two of these relays. From the datasheet, it is a little unclear as to the hFE at currents higher than 100mA, so I will have to make the assumption that the hFE at 100mA (being a fairly low 30) is correct. This will result in a base current of 6mA. Again, to ensure saturation, I like to times this by a factor of 3. That then results in a base current of 18mA which is getting to the upper limit of what a PICAXE will handle (but it is doable). This results in a base resistor of 238 Ohms. I am inclined to suggest that you DON’T take this to the nearest preferred value of 220 Ohms as you might overload the PICAXE. Instead, I would suggest putting two resistors in series (two 120 Ohm).
Because of the higher current with the 12V version, we should also consider device wattage to ensure we don’t “fry” anything. The base resistor will dissipate 77mW (in total) so standard quarter watt resistors will be fine and the 2N3904 will (based on full saturation) dissipate 53mW, so again, well within specs (can dissipate 625mW).
There are other ways of doing this (as has been explained) and as mentioned, the 12V automotive relays are heavy consumers of current and are probably not the best choice (although I am not sure of your exact application?). If you were to stick with the automotive relays then maybe a transistor with a higher gain might be in order.
I hope this makes sense and helps. It’s very late so hopefully I haven’t made any drifty mistakes. Let me (and the forum) know if you have any more questions.