I use photocells connected to very "consumer" gate automation boards. Those photocells output the infrared beam status via a relay with potential free contacts. The relay is the Hongfa HFD23 (datasheet).

I use the photocells with several types of boards; normally there are no problems but, in rare cases (< 0.1%), there are problems with a particular kind of board - let's call it "board type +24V".

The majority of the boards have the following schematic:


simulate this circuit – Schematic created using CircuitLab

When the infrared beam is detected, the relay closes the contacts and the voltage at the pull-upped input goes down to 0. If the beam is obstructed, the relay opens the contacts and the input is pulled up to +5V.

Using a scope, I see that when the relay closes the contacts have some bounces, for 1-2-3 milliseconds, but that is managed by the firmware of the board and there are no problems.

The "board type +24V" instead, sometimes has problems. The schematic is different:


simulate this circuit

Basically this schematic is the same as before, but the input works with 24V dc, and the logic is opposed: when the photocell is OK, the input has +24V on it. Again, bounces of the contacts are filtered via firmware. Note: I am not really sure about this schematic, but I measured the input with a multimeter, and it showed precisely 30k; I see in fact two resistors of 10k and 20k on the board.

With this board, using a scope, sometimes I see that, when the relay closes, the voltage rises very slowly: it can take up to a second to reach +24V on the input. I imagine that, with a signal so slow, the digital input goes crazy. This happens rarely, and only with a few photocells; but the defective photocells never give problems with the other boards working with pull-up to +5V.

Reading carefully the relay datasheet, I see this statement:

Minimum applicable load: 1 mA  5V

with the note that the statement is only a reference value.

Doing some calculation, I see that the current for the +5V board is 0.5 mA, while for the +24V is 0.8 mA. Both the boards do not respect the minimum applicable load of the contacts, but the +24 board works worser even if the current is higher. I would understand better what the issue is. I suppose that all has to do with the physics of the contacts, which in this case are gold plated if I well understand.

My question is: may it be that the minimum load current is in relation to the voltage, for what the relay is concerned? I mean: the ratios of the current vs voltage is 0.5mA/5V which is higher than 0.8mA/24V, and so the +5V board is favoured. In other words, its input impedance is lower.

Or would it be better to find a relay able to cope with very low loads, if those relays exist?

  • \$\begingroup\$ With a failing combination, add a switch and 10K resistor to GND to the 24V board (+2.4mA when ON) if you want to test the minimum current hypothesis. \$\endgroup\$
    – user16324
    Commented Dec 5, 2021 at 15:05
  • \$\begingroup\$ Thank you @user_1818839, I will try. I wait to know something more. \$\endgroup\$ Commented Dec 6, 2021 at 6:31

2 Answers 2


In the +5V board the supply voltage does not depend on the photocell circuit, in the +24V it does. I believe the +24V board and the photocell needs to behave similar to the +5V board. In this case, you need to move the photocell pin connected to the +24V pin to ground and connect a resistor between the +24V pin and the 20K resistor pin, keeping the photocell pin connected to the 20K resistor. This way the +24V is always feeding the circuit through the new resistor and the 20K resistor, with the photocell shorting it to ground when the relay is closed. The new resistor should be around 18K to feed the MCU input with at least 5V for a relay current of 1.33 mA. Any higher will reduce the relay current but also the MCU input voltage. Any lower will increase the relay current but, because of the zener diode, it will not go much above 5.1V. I hope this helps. Thank you.

  • \$\begingroup\$ Thanks. You suggest to replicate the topology of the +5V board. Problem is I don't have direct control on the +24 board, so I must be very sure before I tell them they should modify the circuit and the firmware. \$\endgroup\$ Commented Dec 6, 2021 at 6:46
  • \$\begingroup\$ Ok. By the dotted lines I thought the circuits were two different ones and that you had access to the pins connecting them. Thanks. \$\endgroup\$
    – VictorTito
    Commented Dec 6, 2021 at 14:40
  • \$\begingroup\$ Indeed the dotted lines wanted to show that the photocell is a separate device from the board type "+5V" and this board is different from the type "+24V". \$\endgroup\$ Commented Dec 6, 2021 at 15:51

Au plating prevents oxidation but tends to be very thin flash plating. For > 2A, no Au plating is ever used as it would burn off. There are contaminants that can cause slight oxidation. HP used to recommend pink pearl erasers for maintenance on their gold-plated PCB fingers. Although not feasible for Relays, it suggests that contact cycling can raise the contact resistance even if gold plating is much better for low current. Non-Au plated relays > 2A must use 10% minimum current a small e-cap across the contacts to burn off oxides.

Arcs occur on charging currents into low ESR capacitance and extinguishing currents on low DCR inductance of long cables.

For your situation of contact bounce, the variables are inductance, current torque, temperature and excess spring force above MUST SWITCH. I don't know what is different in your relays, but one method is to drive slightly over-voltage on the coil with a series R to create an under-voltage to reduce holding current heat.

When I solved this problem back in the 70's for non-Au plated aux contacts to sense state of the 20 to 30A primary contacts only powered TTL and they were unreliable, since back then, they were not gold plated, so I used ~15uF solid Tantalums to fix the intermittent problem across the 10k, 5V TTL pullup. I never got a chance to measure life testing , but it ran error free after I applied this fix.


I would add up to 0.1 uF across the contacts and raise the R values by a factor of up to 30. e.g T=RC= 300k * 0.1uF = 30ms ~ debounce filter time. This will provide the debounce and clean oxide from Au plating contaminants from V/(C_ESR+contact_DCR)= Ipk

But I would not implement this without test/verifying if it is excessive discharge energy by performing an MTBF test and also sensing contact temperature rise by rapid cycling of contacts with this load. Define/compare the results with your MTBF needs. I would also alert supplier to MTBF failures and request reliability test reports.

  • \$\begingroup\$ Thanks for your interesting answer, but my problem is not bouncing. I suspect the relay contact, sometimes, shows a high resistance. May be that, with a bigger load (lower load resistor) the contacts clean themselves while closing. Indeed, even with the +24V the behavior is right, but too slow. \$\endgroup\$ Commented Dec 6, 2021 at 6:42
  • \$\begingroup\$ I can simulate any problem to demonstrate arc energy and deadtime between close and open if I had L/DCR , and switching times with may/must currents for each. There must be a difference in L,DCR for each coil spec. The Zener or TVS voltage will also affect everything as V=Ldi/dt +I*DCR during open transition and Ic=CdV/dt with 1/2CV^2 energy dumped in contacts during close and 1/2LI^t during open must be transferred to TVS and not the the air before ionization occurs. Then there are EMI parameters from crosstalk from dI,dV/dt in the loop. So do you have all these parameters in concise list \$\endgroup\$ Commented Dec 6, 2021 at 14:55
  • \$\begingroup\$ Ionization times may approach <1us so BDV thresholds rise during this time in terms of V/um air gap of about 1 to 3V/um to >5x this level depending on risetime of clamp diode. obviously a coil power diode to V+ is slowest but inaccessible, but then secondary contact time is extended promoting worse behaviours unless snubbed. So if not possible, then a faster transition time is achieved with a higher TVS coil clamp like 40V instead if 15V as Andy suggested which is good for MOSFET, but bad for secondary contacts arc time. So what is the contact voltage and load and Z(f) \$\endgroup\$ Commented Dec 6, 2021 at 15:00
  • \$\begingroup\$ The other hidden issue is the arc is like an SCR with trigger dV/dt and holding or extinguishing current thresholds that vary due to contact acceleration, velocity and gap. I digress but these are solveable issues and Omron has done a great job, but have migrated to SSR's to overcome some of these issues,of why a 1e6 mechanical contact with R loads degrades several orders of magnitude in MTBF with parasitic reactances in coil, clamp and contact, reactive load without snubbers \$\endgroup\$ Commented Dec 6, 2021 at 15:04
  • \$\begingroup\$ I don't think arcs on the contacts are an issue, and neither the coil of the relay. But your points are interesting, it's a pity I find it difficult to fully understand them. \$\endgroup\$ Commented Dec 6, 2021 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.