M5StickC Make a Grove Relay Cable

M5StickC Make a Grove Relay Cable

I know you can buy the plugin Mini 3A Relay Unit, but I happened to have
a relay board, a spare Grove cable and some Female DuPont Jumper ends, and I like to think I’m a Maker… so, I’ve decided to make one instead.

Here we go… most of this can be deduced from the above image.

Take a Grove cable, cut off one end, strip the ends of single wires ready for connecting to DuPont Female ends, cut from appropriately coloured wires. .

Solder the join and trim up your connection. The Black tube is Heat shrink tube; wait for everything to cool then slide the heat shrink over the join and use your favourite heat source to shrink it tight.

It may not be pretty, but get’s the job done.

Now we can cobble together some test code, mostly taken for the test code on the web

#include <M5StickC.h>

void setup() {
  M5.begin();
    M5.Lcd.setTextFont(4);
  M5.Lcd.setTextColor(YELLOW, BLACK);
 
  pinMode(32, OUTPUT);
}

void loop(void) {
  digitalWrite(32, HIGH);
  M5.Lcd.setTextFont(5);
  M5.Lcd.setTextColor(YELLOW, BLACK);
  M5.Lcd.drawString("    ", (int)(M5.Lcd.width()/2), (int)(M5.Lcd.height()/2), 2);
  M5.Lcd.drawString("ON ", (int)(M5.Lcd.width()/2), (int)(M5.Lcd.height()/2), 2);
  delay(2500);
  digitalWrite(32, LOW);
 M5.Lcd.setTextFont(5);
 M5.Lcd.setTextColor(YELLOW, BLACK);
  M5.Lcd.drawString("    ", (int)(M5.Lcd.width()/2), (int)(M5.Lcd.height()/2), 2);
 M5.Lcd.drawString("OFF  ", (int)(M5.Lcd.width()/2), (int)(M5.Lcd.height()/2), 2);
  delay(2500);
}

Pin 32 ( white on the Grove lead) is signal to the relay, Red is 5v and Black is GND.

At the relay we can see White (Pin 32) going to SIG, RED to 5V and Black to GND

Here is the code in Platform IO, Ready to Compile and Upload.

Wow! Relay goes On, Relay goes Off. Who would have thought it.

Remember you made it yourself, and it can be used for connecting to lot’s of other cool stuff as well

Hope you have some fun with it. Keep Making.

Cheer’s Al

AFFILIATE LINKSSUPPORT ME

Things you may need…

AFFILIATE LINKSSUPPORT ME