Redboard locking up

I have a Redboard connected to an alphanumeric display, single relay, and TMP117, all through qwiic. I am running the below code and, while the system works, it locks up after a period of time. When it does, I power off then back on and it resets. It doesn’t lock up at a consistent temperature or after a consistent period of time. The only thing that’s consistent is it always locks up with the relay off. I am powering the board with a barrel connector from a power supply at 12V. Any idea how I can eliminate the lock ups?

#include <Wire.h>            

#include <SparkFun_TMP117.h> 
TMP117 sensor; 

#include <SparkFun_Alphanumeric_Display.h> 
HT16K33 display;

#include "SparkFun_Qwiic_Relay.h"
#define RELAY_ADDR 0x18
Qwiic_Relay relay(RELAY_ADDR);


void setup()
{
  Wire.begin();
  Serial.begin(115200);    
  Wire.setClock(400000);   
  
  if (sensor.begin() == true)
  {
    Serial.println("Sensor - GO");
  }
  else
  {
    Serial.println("Sensor - FAULT");
    while (1); 
  }

  if (display.begin() == false)
  {
    Serial.println("Display - FAULT");
    while (1);
  }
  Serial.println("Display - GO");

  if(!relay.begin())
    Serial.println("Relay - FAULT");
  else
    Serial.println("Relay - GO");
}

void loop()
{
  
  if (sensor.dataReady() == true) 
  {
    float tempC = sensor.readTempC();
    float tempF = sensor.readTempF();
    
    Serial.println(tempF);

    String DispF = String(tempF, 2);

    display.print(DispF);

    if (tempF <= 56.001) relay.turnRelayOn();

    else relay.turnRelayOff();
    
    delay(100000); 

  }
}

This is likely because 2 sets of i2c pullup resistors are enabled; disable either the TMP or Relay’s pull up https://learn.sparkfun.com/tutorials/qw … e-overview or https://learn.sparkfun.com/tutorials/qw … e-overview (leave one item’s intact/enabled)

If that doesn’t work, try testing the relay by itself and see how that goes

Is there a flyback diode across your relay coil?

Is the relay switching a heavy inductive load?

I’m not sure on the diode question, what should I look for?

The relay is switching two larger relays which are switching 48 watts each (4A 12V).

A clear photo of your circuit would be helpful.

Here are some pictures of my circuit. Not pictured is the TMP117 which is at the other end of the gray cable coming out of the right QWIIC port of my single relay.



Try routing your qwiic wires away from the relays and see if that helps.

Tried that, no luck. :frowning:

I’m running out of ideas.

How long is your qwiic bus including any external cables?

It is roughly four feet with the majority between the relay and the TMP117.

4 feet might be too long, cut it in half and see if things get more stable. Also disable pull-ups on every qwiic board except for one.