Erratic Supply Voltage Readings

I have a 3v relay (https://www.amazon.com/dp/B01FK11HV4) that is not consistently staying closed, and I’m troubleshooting why that is. The behavior in the relay is that the indicator lights would remain lit, but the relay itself would cycle fairly frequently and open the circuit it was controlling (a pool heater).

As part of troubleshooting, with the relay removed from the system, I’ve been monitoring supply and ground voltage in a thermistor voltage divider that measures the exhaust temperature of the heater (to track how long it’s on). There are some fairly erratic readings in the supply voltage (3.3v) measured at the location X’ed blue, but not at the supply voltage (same 3.3v, but upstream of a couple breadboard connections) immediately at the photon 3v3 pin (X’d green).

The chart below is the analog read value of a few points. The colors correlate to the measurement locations drawn on with X’s in the fritzing diagram. So the supply voltage right at the pin doesn’t fluctuate, but after a couple internal connections, I get pretty big swings. Once over the weekend it went as low as 2400.

My questions:

  1. any idea what’s causing this behavior? I’m speculating it’s possibly the breadboard connections, and considering upgrading to a soldered perfboard instead of the more flexible breadboard. Does this seem like it would fix it?

  2. absent any direct data on the relay circuit (it’s next on my list to get), does it seem like a similar thing could be happening there, causing the cycling behavior I was seeing?

You may not have enough power from the 3.3v regulator for 5v USB source output on the Photon to drive the relay coil constantly which could cause the issue your seeing with the relay not staying closed.

@eric.spaeth, I can’t tell what’s what on the fritz diagram. Do you have a schematic you can post?

Just drew this up, hopefully it’s a bit easier to understand. The relay output is currently tied to 3v3 for common and NO to A5. The intent was to monitor it’s switching, which, of course, since I started watching it, hasn’t actually switched yet, but it also hasn’t received a command to switch on or off, so it’s just been holding. Pool temp needs to get to 87 before it commands the relay to open, which it hasn’t since it started acting up for various reasons.

@eric.spaeth, you will need to read up on interfacing with relays. First, the 3V3 line probably can’t supply enough current for the relay. Seconds, you are not protecting the 3V3 line from reverse currents with a flyback diode. The lack of such diode can damage the Photon.

I am trying to understand why you need the relay in the first place. Before I make recommendations, can you explain?

Sure, the relay is being placed into a control circuit for my pool heater. Ultimately, it will connect to the “Fireman Switch Connection” shown in the schematic below and the manual potentiometer will be turned to the max, effectively giving me full control of the thermostat for my pool heater.

As for protection, the relay module (shown below) has an opto-isolator built into it, is that not sufficient protection? Right now I am powering it through the jumpers, not through an independent power supply.

@eric.spaeth, the Songle relay requires 120ma to operate which the Photon 3V3 cannot supply reliably. I suggest you use a small 3.3v (eg. LM1117) linear regulator fed from Vin (assuming you are powering via USB) to supply the 3.3v for the relay module.

The “fireman switch” is design for someone to pull to disable the unit. Replacing this switch most likely violates your local electrical and safety code. Replacing or working in parallel with the ON/OFF switch is a more desired approach and it will give you the same results.

2 Likes

Thanks for the power tip. I’ll work towards that. Probably will have to order some parts. (Also considering just getting the Relay Shield and working towards a more permanent circuit.)

Don’t worry, I’m not removing a fireman switch. The system doesn’t have one to start with. Just 2 screw terminals with a 2" length of wire between them.

1 Like