The relays will switch up to 2A, whereas the Darlinton Array that supplies the outputs can only sink up to 500mA. The one you use generally depends upon what device you’re switching.
The Darlington Array outputs can also only sink current, they do not function as a power supply (there’s no 24v supply available on the Pi anyway) which means your wiring from the source, through your sink, and into the Automation HAT would all be live at the supply voltage if you were switching it with an output.
This is usually fine, but means the majority of your circuit is still prone to shorts when it’s off.
Supplying a circuit via a relay has the benefit of cutting power to the whole circuit path on the output side of the relay when it’s off, making it safer.
In most uses, however, your main consideration will be how much current you’re dealing with, or whether you need to source/sink interchangeably.
It’s possible to pair two relays, for example, to drive a motor in forwards and reverse directions. It’s not possible to do this with the Darlington driver without the use of additional circuitry.
Yes, where is the schematic for the automation phat please?
I assume there is a uln2003 on there? If so, although each output can sink up to 500 mA, the chip can’t sink much more than that in total without overheating. Would i be right in assuming one of the uln’s output drives the relay? How much current does the relay coil need? (A tpic6b595 would have been a more up to date choice.)
I just bought an Automation PHAT from Pimoroni as it seems to have all I need for my project which consist of acquiring a signal from an ADC channel, measure temperature, turn of an heating system and turn on/off the Tower light with buzzer (12 Vdc) also from Pimoroni. Now having the AUTOMATION PHAT in my hands it seems a bit difficult to achieve my goal. Could you please guide me through the following questions.
Acquire the signal from ADC is quite simple however I am wondering about precision as my sensor deliver only 100 mV at its maximum.
How to get the heating system on ? I was thinking that I should connect the heating resistor to relay and the ground. But how is the AUTOMATION PHAT fed in order to deliver the required 24 V ?
The Tower light with buzzer (12 Vdc, red one) needs 12 Vdc, should it be connect to the relay or to a sink output. Again from where will come the required 12 V? From an external supply ? In this case which cable goes to the output/sink or to the relay, which one goes to the ground an which one to the external supply?
I would appreciate your help very much. If you have any tutorial with wiring schema it will be helpful.
Since the ADC is scaled from 0-25.85v via a voltage divider down to 0-3.3v where it has a 2mV granularity, then - if I’m not mistaken - your sensor will have an adjusted range of 0 to 12.76mV or around 6 steps versus the 50 you’d get if it were connected directly to the ADC channel. IE: Sensitivity would be terrible!
You don’t feed 24v into Automation pHAT, but rather into the other end of your heating resistor. A relay then effectively becomes a switch between the other side of your heater and ground.
You need to supply a separate 12v power supply. The positive side of this supply would go via your tower light, into the sinking output, and the ground side would be tied together with the ground of Automation pHAT.
Thank Your for the answer. It is very clear @gadgetoid . I have a last question. If I would want to improve the sensibility of the analog measurement with the 100 mV sensor what should I do? Is there any simple way to amplify the signal before sending it to the ADC channel ? Maybe with a small board from pimoroni ?
You could amplify the signal with an OpAmp but it’s a little contrived. If you could guarantee that you’re never going to connect > 3.3v to that particular ADC input you could bridge over the resistor.
The three resistors for the ADC channels are the ones just above the A of ADC on the top of the board.
They are mapped as follows:
Bottom = ADC channel 1
Middle = ADC channel 2
Top = ADC channel 3
If you were to, for example, bodge a little wire over the top of the resistor, or replace it with a zero-ohm link resistor or a solder bridge (you can usually remove resistors with a soldering iron quite easily) then the ADC would “see” the 0-100mV range, giving you a much more granular signal. Note: without modifications to the library it will still report it as 0-25.85v so you’ll have to do something like: adc_reading / 25.85 * 3.3