1 Channel High Power Relay

I’m having trouble figuring out how to control the relay on my board. I’m using a Bluz DK and the online Particle IDE. I’ve been able to successfully flash the Loop_Test.ino file, but the relay does not toggle on and off. I’ve read through the readme file on GitHub and can’t figure out what I’m doing wrong - is there an issue with different pins on Bluz vs Photon? Any direction/advice would be appreciated.

Hi,

First thing I always ask for is a Photo of your hardware setup if possible. Many times something will jump out there.

It’s honestly been a long time ago since I worked on that project and do not 100% remember everything. Send over that photo and I will dive back into the code and see if I can lend some assistance.

Thank you,
Travis Elliott

Right now my entire setup is composed of the Bluz DK plugged into the relay board. I assumed I could cycle the relay without external hardware/wiring attached. I don’t have the board with me at the office - I’ll have to wait until I get home this evening to upload any pictures.

The relay board does require 12VDC for power in order to actually switch the relays on and off. These are the sort of small details that can be found and corrected by a single Photo. I’ve seen hardware setup photos save hours of back and forth communications. Please post when you have a chance.

Thank you,
Travis Elliott

Finally got around to working on this again today, and after messing with the relay some more, I decided to get the other one out of the box and see if it would work. I put the Bluz DK on the other relay board, plugged it in, and as soon as the Bluz began flashing cyan, the relay was toggling itself on and off. I changed to another Bluz DK, flashed the same code, and it works as well. The first relay board I tried does not work with either Bluz - I’ve also tried switching the power supplies (both purchased with the boards from the NCD store) and it doesn’t make a difference. I think that maybe one of the boards is non-operational.

Any suggestions for testing it via another method? I can’t post pictures or videos yet because I’m a new user.

The first thing I would try in troubleshooting a relay board would be to flash this I2C scan code. It should print the address of the MCP23008 chip on the relay board to the serial terminal:
https://go.particle.io/shared_apps/58d97ada3f3d0d3a1a00083e
If you see No Devices Found printed then the Bluz module is not able to communicate with the MCP23008 chip on the board which controls the relays.

Let me know what you find.

It looks like it is communicating with the chip on the board:

That looks a bit strange. The event should only show that it has discovered one device. Is there any way you could run this same firmware on the Bluz module/board that you said was working correctly to see what it shows in these events?

Last night I ran the same firmware on both of them and got the same results on each. I am running this code:

void setup() {
    //Set the speed of the I2C port on the Photon and start it.
    Wire.begin(); 
}
 
void loop() {
    bool devicesFound = false;
    String newDevices;
    //Step through all 127 possible I2C addresses to scan for devices on the I2C bus.
    for(int i = 1; i < 128; i++){
        //Make a general call to device at the current address to see if anything responds.
        Wire.beginTransmission(i);
        byte status = Wire.endTransmission();
        if(status == 0){
            //Device found so append it to our device list event string
            char devices[20];
            sprintf(devices, "Device at: %in", i);
            newDevices.concat(devices);
            devicesFound = true;
        }
        
    }
    if(devicesFound){
        Particle.publish("New Devices", newDevices);
    }else{
        Particle.publish("New Devices", "No Devices Found");
    }
    
    delay(2000);
}

from https://ncd.io/bluz-quick-start-guide/

Here are the results running the firmware on the Bluz connected to the functioning relay board:

Is there any way you could post a photo of your hardware setup. Something is not quite right but I’m not exactly sure what it is.

Both Bluz are blinking Cyan, I just caught the top one when it was off

Ok. Thank you. I will try to replicate you setup later this afternoon and let you know if I can replicate the problems you are seeing there.

Were you able to find out anything? I would really like to move forward with my project, but I need a minimum of two working relay boards. I’m getting ready to order some other products from you and if it is determined that one of my boards/relays is bad, I’d like to get it all together in the same shipment.

Sorry, I have not had a chance to set a board up just yet. I’ll try to get one together ASAP. I have to locate a Bluz module.

I have a relay controller setup here at my desk. I have opened a forum with Eric from Bluz here if you want to follow:

I2C scan code does not appear to run correctly on the Bluz module. However you should be able to run this code on your 1 channel relay controller and it should toggle the relay on and off every 2 seconds:
https://go.particle.io/shared_apps/5a8db3391d761cef2f000885
Let me know if that works or not.

Thank you Travis - I’m following that discussion. I have flashed the linked code to both of my setups and one relay is toggling on and off. The other isn’t doing anything.

I unplugged both, swapped the Bluz DKs between them, plugged them back in and the same one is still toggling - the other isn’t responding.

Sounds like that relay controller needs to come back here for repair. Ship the board to:

National Control Devices
430 Market St
Osceola Mo 64776

Include a note in the shipment that says. Relay controller not working with Bluz module. This will let me or the other repair technician know what is wrong. Also on that note include your contact information and return shipping address.

We cover UPS ground shipping on the return.

If you need anything else please let us know.
Thank you,
Travis Elliott