Wire the G-Mod 2-channel relay module to a Glyph ESP32 development board and switch two independent high-voltage loads from Arduino digital pins.
A 2-channel relay for controlling two independent high-power loads simultaneously using low-power control signals from microcontrollers like Arduino, GLYPH, or even Raspberry Pi. Here’s how it works:
Components
Two Relays: Each relay can independently control a high-power (Both AC / DC) device.
Control Pins: There are two input pins (IN1 and IN2) for controlling each relay.
Power Supply: A single power source is used for both relays 5V
Protection : Has 2 Optocoupler to electrical isolation between the control and relay circuits for both channels.
Pin Configuration
VCC: Power supply for the module (5V).
GND: Ground connection.
IN1: Control signal for Relay 1.
IN2: Control signal for Relay 2.
COM1, NO1: Relay 1 switching terminals.
COM2, NO2: Relay 2 switching terminals.
Relay Contacts
COM (Common): The input terminal.
NO (Normally Open): Open by default, closes when the relay is activated.
Working
Each relay channel works independently, following the same principles as a single-channel relay:
When Control Signal is LOW (0V):The associated transistor remains off.
The corresponding relay coil is de-energized.
The relay’s Normally Open (NO) contact stays open, and the Normally Closed (NC) contact remains closed.
When Control Signal is HIGH (3.3V/5V):The associated transistor turns on, allowing current to flow through the relay coil.
The coil energizes, creating a magnetic field that pulls the armature.
The relay’s NO contact closes, completing the circuit for the connected load, while the NC contact opens.
Operation Sequence for Two Relays
IN1 HIGH: Activates Relay 1 to control Load 1.
IN2 HIGH: Activates Relay 2 to control Load 2.
Both IN1 and IN2 HIGH: Activates both relays simultaneously to control both loads.
Both IN1 and IN2 LOW: Deactivates both relays, disconnecting both loads.
Applications
Home Automation: Controlling lights and fans independently.
Industrial Automation: Managing two separate devices or motors.
DIY Projects: Operating appliances remotely with microcontroller-based projects.
This guide will help you interface a 2 Channel Relay assuming you are using GLYPH-C3(but any GLYPH development board from the ESP32 Series should work)
Step 1: Hardware Required
Glyph Board
GMOD 2 Channel Relay Module
Step 2: Circuit Diagram
Step 3: Code Setup
Open Arduino IDE.
Copy and paste the following code into the Arduino IDE:
// Pin definitions for 2-Channel Relay Moduleconst int RELAY_1 = 3; // GPIO2 for first relayconst int RELAY_2 = 2; // GPIO3 for second relayvoid setup() { // Initialize serial communication Serial.begin(115200); // Configure relay pins as outputs pinMode(RELAY_1, OUTPUT); pinMode(RELAY_2, OUTPUT); // Initialize Both Relay Channels to OFF state (relays are typically Active LOW- Means they are OFF when a HIGH Signal is Applied and vice-versa) digitalWrite(RELAY_1, HIGH); digitalWrite(RELAY_2, HIGH); Serial.println("Relay Module Initialized"); //Print that Relay Module is Initialized}void loop() { // Example control sequence // Turn ON Relay 1 digitalWrite(RELAY_1, LOW); Serial.println("Turning on Relay 1"); delay(2000); // Turn OFF Relay 1 digitalWrite(RELAY_1, HIGH); Serial.println("Turning off Relay 1"); delay(1000); // Turn ON Relay 2 digitalWrite(RELAY_2, LOW); Serial.println("Turning on Relay 2"); delay(2000); // Turn OFF Relay 2 digitalWrite(RELAY_2, HIGH); Serial.println("Turning off Relay 2"); delay(1000);}// Helper functions for relay controlvoid turnOnRelay(int relayPin) { digitalWrite(relayPin, LOW);}void turnOffRelay(int relayPin) { digitalWrite(relayPin, HIGH);}void toggleRelay(int relayPin) { digitalWrite(relayPin, !digitalRead(relayPin));}
Step 4: Upload the Code
Connect the Board
Connect your GLYPH board to your computer
Select the Board and PortDo the following settings in your Arduino IDE,
Tools > Board > esp32 > Pcbcupid GLYPH C3
For the Pcbcupid GLYPH C3 to appear under Tools > Board > esp32, the esp32 board version installed in the Arduino IDE should be greater than or equal to 3.1.0.
Tools > Port and select the port connected to your GLYPH.
Tools > USB CDC on Boot >Enabled
If USB CDC on BOOT is not enabled, you won’t be seeing any serial data on Arduino IDE.
Upload the Code
Click the upload button (➡️ icon) or use the shortcut CTRL + U in Arduino IDE to upload the code to the board.
Step 5: Observe the Output
On Serial Monitor, you should see the output like this:Along with this you should see the relay ticking and corresponding LED blink.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"PCB Cupid","colors":{"primary":"#0D9373"},"favicon":"https://mintcdn.com/pcbcupid-bae3761c/4dXNuJjZhqL5zqVd/images/favicon_PCBcupid.png?fit=max\u0026auto=format\u0026n=4dXNuJjZhqL5zqVd\u0026q=85\u0026s=697c4189e0a983e1722bddbedde79f61","appearance":{"strict":true},"background":{"decoration":"gradient"},"navbar":{"links":[{"href":"https://spell.pcbcupid.com","label":"Circuit Spell"},{"href":"https://shop.pcbcupid.com","label":"Shop"},{"href":"/","label":"Learn"},{"href":"https://events.pcbcupid.com","label":"Events"},{"href":"https://forum.pcbcupid.com","label":"Forum"},{"href":"https://pcbcupid.com/articles","label":"Articles"},{"href":"https://pcbcupid.com/tools","label":"Tools"}]},"seo":{"indexing":"all"},"fonts":{"family":"Space Grotesk","weight":400},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","latex":true},"contextual":{"options":["copy","chatgpt","claude","cursor","vscode","mcp"],"display":"toc"},"thumbnails":{"appearance":"dark"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"pcbcupid-bae3761c","hasAudioNarration":false,"actualSubdomain":"pcbcupid-bae3761c","customDomains":["learn.pcbcupid.com"],"gitSource":{"type":"github","owner":"pcbcupid","repo":"pcbcupid-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae268427b458a5c875a9a81","clientVersion":"0.0.4177","searchFilterCounts":[{"language":"default","tag":"Documentation","count":77},{"language":"default","tag":"Modules","count":67},{"language":"default","tag":"PCB Design","count":45},{"language":"default","tag":"Examples","count":32},{"language":"default","tag":"Glyph","count":25},{"language":"default","tag":"G-Mod","count":17},{"language":"default","tag":"KiCad","count":16},{"language":"default","tag":"Basic","count":15},{"language":"default","tag":"Welcome","count":9},{"language":"default","tag":"G-Sense","count":8}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"documentation/modules/g-mod/relay","slug":"/documentation/modules/g-mod/relay","pageMetadata":{"description":"Wire the G-Mod 2-channel relay module to a Glyph ESP32 development board and switch two independent high-voltage loads from Arduino digital pins.","title":"2-Channel Relay","sidebarTitle":"2-Channel Relay","href":"/documentation/modules/g-mod/relay"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Wire the G-Mod 2-channel relay module to a Glyph ESP32 development board and switch two independent high-voltage loads from Arduino digital pins.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const ShopHeader=({title,url})=>{const _components={a:`a`,..._provideComponents()};return _jsx(`div`,{style:{display:`flex`,justifyContent:`flex-end`,alignItems:`center`,width:`100%`,marginBottom:`1rem`,gap:`20px`},children:_jsx(_components.a,{href:url,target:`_blank`,rel:`noopener noreferrer`,style:{display:`inline-flex`,alignItems:`center`,backgroundColor:`#00b894`,color:`#fff`,padding:`8px 18px`,borderRadius:`8px`,textDecoration:`none`,fontSize:`0.95rem`,fontWeight:600,whiteSpace:`nowrap`,flexShrink:0},children:`Shop now`})})};const ImgGallery=({images,modelUrl})=>{var[active,setActive]=useState(0);var[show3D,setShow3D]=useState(false);var[isFullscreen,setIsFullscreen]=useState(false);var[fullscreenDialog,setFullscreenDialog]=useState(null);useEffect(function(){if(show3D||isFullscreen||images.length\u003c=1)return;var t=setTimeout(function(){setActive(function(p){return(p+1)%images.length})},3500);return function(){clearTimeout(t)}});var img=images[active];function openFullscreen(){var dialog=fullscreenDialog;if(dialog\u0026\u0026!dialog.open)dialog.showModal();setIsFullscreen(true)}function closeFullscreen(){var dialog=fullscreenDialog;if(dialog\u0026\u0026dialog.open)dialog.close();else setIsFullscreen(false)}return _jsxs(`div`,{style:{position:`relative`,background:`linear-gradient(to bottom, #fff 0%, #fff 80%, #f8f8f8 100%)`,borderRadius:`32px`,border:`1px solid rgba(0,0,0,0.08)`,overflow:`hidden`,marginTop:`0.75rem`,marginBottom:`1.5rem`},children:[_jsx(`div`,{style:{position:`relative`,height:`450px`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#fff`,padding:`1rem`},children:show3D\u0026\u0026modelUrl?_jsx(`div`,{ref:function(el){if(!el||el._mv)return;el._mv=true;var s=document.createElement(`script`);s.src=`https://ajax.googleapis.com/ajax/libs/model-viewer/4.2.0/model-viewer.min.js`;s.type=`module`;s.onload=function(){var mv=document.createElement(`model-viewer`);mv.setAttribute(`src`,modelUrl);mv.setAttribute(`camera-controls`,``);mv.setAttribute(`auto-rotate`,``);mv.style.width=`100%`;mv.style.height=`100%`;mv.style.backgroundColor=`#f8f8f8`;el.innerHTML=``;el.appendChild(mv)};document.head.appendChild(s)},style:{width:`100%`,height:`100%`}}):_jsx(`img`,{src:img\u0026\u0026img.url,alt:img\u0026\u0026img.label,loading:`lazy`,noZoom:true,onClick:openFullscreen,role:`button`,tabIndex:0,onKeyDown:function(event){if(event.key===`Enter`||event.key===` `){event.preventDefault();openFullscreen()}},style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:`8px`,cursor:`zoom-in`}})}),_jsxs(`div`,{style:{display:`flex`,justifyContent:`center`,gap:`12px`,padding:`1rem`,background:`#eee`,borderTop:`1px solid rgba(0,0,0,0.08)`},children:[images.map(function(img,idx){return _jsx(`button`,{onClick:function(){setActive(idx);setShow3D(false)},style:{padding:`0.6rem 1.5rem`,borderRadius:`12px`,border:!show3D\u0026\u0026idx===active?`1px solid #00b894`:`1px solid rgba(0,184,148,0.4)`,background:!show3D\u0026\u0026idx===active?`#00b894`:`#fff`,color:!show3D\u0026\u0026idx===active?`#fff`:`#000`,cursor:`pointer`,fontSize:`0.75rem`,fontWeight:700,textTransform:`uppercase`,fontFamily:`inherit`},children:img.label},img.id||idx)}),modelUrl?_jsx(`button`,{onClick:function(){setShow3D(true)},style:{padding:`0.6rem 1.5rem`,borderRadius:`12px`,border:show3D?`1px solid #00b894`:`1px solid rgba(0,184,148,0.4)`,background:show3D?`#00b894`:`#fff`,color:show3D?`#fff`:`#000`,cursor:`pointer`,fontSize:`0.75rem`,fontWeight:700,textTransform:`uppercase`,fontFamily:`inherit`},children:`3D VIEW`}):null]}),_jsx(`dialog`,{ref:setFullscreenDialog,\"aria-label\":img\u0026\u0026img.label,onClose:function(){setIsFullscreen(false)},onClick:function(event){if(event.target===event.currentTarget)closeFullscreen()},style:{width:`100vw`,height:`100vh`,maxWidth:`none`,maxHeight:`none`,margin:0,padding:`2rem`,border:0,background:`rgba(0,0,0,0.88)`},children:_jsxs(`div`,{style:{position:`relative`,display:`flex`,width:`100%`,height:`100%`,alignItems:`center`,justifyContent:`center`},children:[_jsx(`button`,{type:`button`,\"aria-label\":`Close fullscreen image`,onClick:closeFullscreen,style:{position:`absolute`,top:0,right:0,zIndex:1,width:`2.5rem`,height:`2.5rem`,border:0,borderRadius:`999px`,background:`rgba(255,255,255,0.92)`,color:`#111`,cursor:`pointer`,fontSize:`1.5rem`,lineHeight:1},children:`×`}),_jsx(`img`,{src:img\u0026\u0026img.url,alt:img\u0026\u0026img.label,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:`8px`}})]})})]})};function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,img:`img`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning,_MdxComponentBoundary}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsx(_MdxComponentBoundary,{name:`ShopHeader`,children:_jsx(ShopHeader,{title:`2-Channel Relay Module`,url:`https://shop.pcbcupid.com/product/gm002/`})}),`\n`,_jsx(_MdxComponentBoundary,{name:`ImgGallery`,children:_jsx(ImgGallery,{modelUrl:`https://raw.githubusercontent.com/pcbcupid/pcbcupid-hardware-libraries/main/pcbcupid_3dmodels/glb/gmod-relay-2ch.glb`,images:[{url:`https://files.pcbcupid.com/Documentation/Boards/g-mod/2-ch-relay/relay-2ch-FB-view.avif`,label:`ILLUSTRATION VIEW`,id:`illustration`},{url:`https://files.pcbcupid.com/Documentation/Boards/g-mod/2-ch-relay/pcbcupid-relay-2ch-topview.avif`,label:`BOARD VIEW`,id:`board`}]})}),`\n`,_jsxs(_components.p,{children:[`A `,_jsx(_components.strong,{children:`2-channel relay`}),` for controlling two independent high-power loads simultaneously using low-power control signals from microcontrollers like Arduino, `,_jsx(_components.a,{href:`https://shop.pcbcupid.com/product-category/development-boards/`,children:`GLYPH`}),`, or even Raspberry Pi. Here’s how it works:`]}),`\n`,_jsx(Heading,{level:`3`,id:`components`,children:`Components`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Two Relays: Each relay can independently control a high-power (Both AC / DC) device.`}),`\n`,_jsx(_components.li,{children:`Control Pins: There are two input pins (IN1 and IN2) for controlling each relay.`}),`\n`,_jsxs(_components.li,{children:[`Power Supply: A single power source is used for both relays `,_jsx(_components.strong,{children:`5V`})]}),`\n`,_jsx(_components.li,{children:`Protection : Has 2 Optocoupler to electrical isolation between the control and relay circuits for both channels.`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`pin-configuration`,children:`Pin Configuration`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`VCC: Power supply for the module (5V).`}),`\n`,_jsx(_components.li,{children:`GND: Ground connection.`}),`\n`,_jsx(_components.li,{children:`IN1: Control signal for Relay 1.`}),`\n`,_jsx(_components.li,{children:`IN2: Control signal for Relay 2.`}),`\n`,_jsx(_components.li,{children:`COM1, NO1: Relay 1 switching terminals.`}),`\n`,_jsx(_components.li,{children:`COM2, NO2: Relay 2 switching terminals.`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`relay-contacts`,children:`Relay Contacts`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`COM (Common): The input terminal.`}),`\n`,_jsx(_components.li,{children:`NO (Normally Open): Open by default, closes when the relay is activated.`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`working`,children:`Working`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Each relay channel works independently, following the same principles as a single-channel relay:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`When Control Signal is LOW (0V):`}),`\n`,_jsx(_components.p,{children:`The associated transistor remains off.\nThe corresponding relay coil is de-energized.\nThe relay’s Normally Open (NO) contact stays open, and the Normally Closed (NC) contact remains closed.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`When Control Signal is HIGH (3.3V/5V):`}),`\n`,_jsx(_components.p,{children:`The associated transistor turns on, allowing current to flow through the relay coil.\nThe coil energizes, creating a magnetic field that pulls the armature.\nThe relay’s NO contact closes, completing the circuit for the connected load, while the NC contact opens.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Operation Sequence for Two Relays`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`IN1 HIGH: Activates Relay 1 to control Load 1.`}),`\n`,_jsx(_components.li,{children:`IN2 HIGH: Activates Relay 2 to control Load 2.`}),`\n`,_jsx(_components.li,{children:`Both IN1 and IN2 HIGH: Activates both relays simultaneously to control both loads.`}),`\n`,_jsx(_components.li,{children:`Both IN1 and IN2 LOW: Deactivates both relays, disconnecting both loads.`}),`\n`]}),`\n`]}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`applications`,children:`Applications`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Home Automation: Controlling lights and fans independently.`}),`\n`,_jsx(_components.li,{children:`Industrial Automation: Managing two separate devices or motors.`}),`\n`,_jsx(_components.li,{children:`DIY Projects: Operating appliances remotely with microcontroller-based projects.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`This guide will help you interface a 2 Channel Relay assuming you are using `,_jsx(_components.a,{href:`https://learn.pcbcupid.com/boards/glyph-c3/overview`,children:`GLYPH-C3`}),`(but any `,_jsx(_components.a,{href:`https://shop.pcbcupid.com/product-category/development-boards/`,children:`GLYPH development board`}),` from the ESP32 Series should work)`]}),`\n`,_jsx(Heading,{level:`2`,id:`step-1-hardware-required`,children:`Step 1: Hardware Required`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Glyph Board`}),`\n`,_jsx(_components.li,{children:`GMOD 2 Channel Relay Module`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`step-2-circuit-diagram`,children:`Step 2: Circuit Diagram`}),`\n`,_jsx(_components.p,{children:_jsx(_components.img,{src:`https://files.pcbcupid.com/Documentation/Boards/modules/2_channel_relay/2chanrelay_circuit.avif`,alt:`pcbcupid_2chanrel`})}),`\n`,_jsx(Heading,{level:`2`,id:`step-3-code-setup`,children:`Step 3: Code Setup`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:`Open Arduino IDE.`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:`Copy and paste the following code into the Arduino IDE:`})}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`62`,language:`cpp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cpp`,children:_jsxs(_components.code,{language:`cpp`,numberOfLines:`62`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Pin definitions for 2-Channel Relay Module`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` int`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` RELAY_1 `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // GPIO2 for first relay`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` int`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` RELAY_2 `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // GPIO3 for second relay`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`void`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` setup`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Initialize serial communication`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Serial`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`begin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`115200`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Configure relay pins as outputs`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` pinMode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(RELAY_1, OUTPUT);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` pinMode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(RELAY_2, OUTPUT);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Initialize Both Relay Channels to OFF state (relays are typically Active LOW- Means they are OFF when a HIGH Signal is Applied and vice-versa)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` digitalWrite`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(RELAY_1, HIGH);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` digitalWrite`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(RELAY_2, HIGH);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Serial`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`println`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Relay Module Initialized\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` //Print that Relay Module is Initialized`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`void`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` loop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Example control sequence`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Turn ON Relay 1`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` digitalWrite`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(RELAY_1, LOW);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Serial`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`println`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Turning on Relay 1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` delay`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Turn OFF Relay 1`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` digitalWrite`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(RELAY_1, HIGH);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Serial`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`println`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Turning off Relay 1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` delay`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Turn ON Relay 2`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` digitalWrite`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(RELAY_2, LOW);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Serial`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`println`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Turning on Relay 2\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` delay`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Turn OFF Relay 2`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` digitalWrite`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(RELAY_2, HIGH);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Serial`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`println`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Turning off Relay 2\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` delay`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Helper functions for relay control`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`void`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` turnOnRelay`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`int`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` relayPin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` digitalWrite`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(relayPin, LOW);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`void`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` turnOffRelay`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`int`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` relayPin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` digitalWrite`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(relayPin, HIGH);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`void`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` toggleRelay`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`int`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` relayPin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` digitalWrite`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(relayPin, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`digitalRead`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(relayPin));`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`step-4-upload-the-code`,children:`Step 4: Upload the Code`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:`Connect the Board`})}),`\n`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Connect your GLYPH board to your computer`}),`\n`]}),`\n`,_jsxs(_components.ol,{start:`2`,children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Select the Board and Port`})}),`\n`,_jsx(_components.p,{children:`Do the following settings in your Arduino IDE,`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`Tools > Board > esp32 > Pcbcupid GLYPH C3`})}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`For the `,_jsx(_components.code,{children:`Pcbcupid GLYPH C3 `}),` to appear under `,_jsx(_components.code,{children:`Tools > Board > esp32`}),`, the esp32 board version installed in the Arduino IDE should be greater than or equal to 3.1.0.`]})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Tools > Port`}),` and select the port connected to your GLYPH.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Tools > USB CDC on Boot >`}),` `,_jsx(_components.em,{children:_jsx(_components.strong,{children:`Enabled`})})]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`If `,_jsx(_components.code,{children:`USB CDC on BOOT`}),` is not enabled, you won’t be seeing any serial data on Arduino IDE.`]})}),`\n`,_jsxs(_components.ol,{start:`3`,children:[`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:`Upload the Code`})}),`\n`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Click the upload button (➡️ icon) or use the shortcut `,_jsx(_components.code,{children:`CTRL + U`}),` in Arduino IDE to upload the code to the board.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`step-5-observe-the-output`,children:`Step 5: Observe the Output`}),`\n`,_jsx(_components.p,{children:`On Serial Monitor, you should see the output like this:`}),`\n`,_jsx(_components.p,{children:_jsx(_components.img,{src:`https://files.pcbcupid.com/Documentation/Boards/modules/2_channel_relay/PCBCUPID_double_channel_relay_serialmon.avif`,alt:`pcbcupid_2channelrelay`})}),`\n`,_jsx(_components.p,{children:`Along with this you should see the relay ticking and corresponding LED blink.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{ShopHeader,ImgGallery,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"description":"Wire the G-Mod 2-channel relay module to a Glyph ESP32 development board and switch two independent high-voltage loads from Arduino digital pins.","title":"2-Channel Relay","sidebarTitle":"2-Channel Relay","href":"/documentation/modules/g-mod/relay"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[146,4557,")=>null;const ImgGallery=()=>null;functi"]]},"mdxExtracts":{"tableOfContents":[{"title":"Components","slug":"components","depth":3,"children":[]},{"title":"Pin Configuration","slug":"pin-configuration","depth":3,"children":[]},{"title":"Relay Contacts","slug":"relay-contacts","depth":3,"children":[]},{"title":"Working","slug":"working","depth":3,"children":[]},{"title":"Applications","slug":"applications","depth":3,"children":[]},{"title":"Step 1: Hardware Required","slug":"step-1-hardware-required","depth":2,"children":[]},{"title":"Step 2: Circuit Diagram","slug":"step-2-circuit-diagram","depth":2,"children":[]},{"title":"Step 3: Code Setup","slug":"step-3-code-setup","depth":2,"children":[]},{"title":"Step 4: Upload the Code","slug":"step-4-upload-the-code","depth":2,"children":[]},{"title":"Step 5: Observe the Output","slug":"step-5-observe-the-output","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"pcbcupid-bae3761c","siteName":"PCB Cupid","title":"2-Channel Relay - PCB Cupid","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-24T13:11:14.020Z","originalFileLocation":"documentation/modules/g-mod/relay.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Wire the G-Mod 2-channel relay module to a Glyph ESP32 development board and switch two independent high-voltage loads from Arduino digital pins.\">\u003cmeta data-mint-head name=\"application-name\" content=\"PCB Cupid\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"2-Channel Relay - PCB Cupid\">\u003cmeta data-mint-head property=\"og:description\" content=\"Wire the G-Mod 2-channel relay module to a Glyph ESP32 development board and switch two independent high-voltage loads from Arduino digital pins.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"PCB Cupid\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://learn.pcbcupid.com/documentation/modules/g-mod/relay\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://pcbcupid-bae3761c.mintlify.site/_mintlify/api/og/v2?division=G-Mod\u0026amp;title=2-Channel+Relay\u0026amp;description=Wire+the+G-Mod+2-channel+relay+module+to+a+Glyph+ESP32+development+board+and+switch+two+independent+high-voltage+loads+from+Arduino+digital+pins.\u0026amp;theme=2c7e3818cca0f9e7f4434aa9\u0026amp;signature=0c324fa59e09348dee39a1231e98121d9a09f74f6ff1cc1b0fef3ff20edbc52d\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"2-Channel Relay - PCB Cupid\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Wire the G-Mod 2-channel relay module to a Glyph ESP32 development board and switch two independent high-voltage loads from Arduino digital pins.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://pcbcupid-bae3761c.mintlify.site/_mintlify/api/og/v2?division=G-Mod\u0026amp;title=2-Channel+Relay\u0026amp;description=Wire+the+G-Mod+2-channel+relay+module+to+a+Glyph+ESP32+development+board+and+switch+two+independent+high-voltage+loads+from+Arduino+digital+pins.\u0026amp;theme=2c7e3818cca0f9e7f4434aa9\u0026amp;signature=0c324fa59e09348dee39a1231e98121d9a09f74f6ff1cc1b0fef3ff20edbc52d\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"PCB Cupid\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0D9373\">\u003clink data-mint-head rel=\"canonical\" href=\"https://learn.pcbcupid.com/documentation/modules/g-mod/relay\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/documentation/modules/g-mod/relay.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://learn.pcbcupid.com/#organization\",\"name\":\"PCB Cupid\",\"url\":\"https://learn.pcbcupid.com\"},{\"@type\":\"WebSite\",\"@id\":\"https://learn.pcbcupid.com#website\",\"name\":\"PCB Cupid\",\"url\":\"https://learn.pcbcupid.com\",\"publisher\":{\"@id\":\"https://learn.pcbcupid.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://learn.pcbcupid.com/documentation/modules/g-mod/relay#webpage\",\"url\":\"https://learn.pcbcupid.com/documentation/modules/g-mod/relay\",\"name\":\"2-Channel Relay\",\"description\":\"Wire the G-Mod 2-channel relay module to a Glyph ESP32 development board and switch two independent high-voltage loads from Arduino digital pins.\",\"dateModified\":\"2026-09-24T13:11:14.020Z\",\"isPartOf\":{\"@id\":\"https://learn.pcbcupid.com#website\"},\"breadcrumb\":{\"@id\":\"https://learn.pcbcupid.com/documentation/modules/g-mod/relay#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://learn.pcbcupid.com/documentation/modules/g-mod/relay#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Modules\",\"item\":\"https://learn.pcbcupid.com/documentation/modules/glyph/glyph-esp32c3/overview-glyph-c3\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"G-Mod\",\"item\":\"https://learn.pcbcupid.com/documentation/modules/g-mod/1-ch-relay\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"2-Channel Relay\",\"item\":\"https://learn.pcbcupid.com/documentation/modules/g-mod/relay\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://learn.pcbcupid.com/documentation/modules/g-mod/relay#article\",\"headline\":\"2-Channel Relay\",\"name\":\"2-Channel Relay\",\"description\":\"Wire the G-Mod 2-channel relay module to a Glyph ESP32 development board and switch two independent high-voltage loads from Arduino digital pins.\",\"url\":\"https://learn.pcbcupid.com/documentation/modules/g-mod/relay\",\"mainEntityOfPage\":{\"@id\":\"https://learn.pcbcupid.com/documentation/modules/g-mod/relay#webpage\"},\"dateModified\":\"2026-09-24T13:11:14.020Z\",\"publisher\":{\"@id\":\"https://learn.pcbcupid.com/#organization\"},\"isPartOf\":{\"@id\":\"https://learn.pcbcupid.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"PCB Cupid\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"PCB Cupid\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/documentation/modules/g-mod/relay.md","siteName":"PCB Cupid","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Welcome","pages":[{"title":"Introduction","href":""},{"title":"Getting Started","href":"/documentation/welcome/getting-started"},{"group":"Prerequisites","pages":[{"title":"Setting Up MCP","href":"/documentation/welcome/prerequisites/setting-up-mcp"},{"title":"Arduino IDE Setup","href":"/documentation/welcome/prerequisites/arduino-ide-setup"},{"title":"ESP-IDF Setup for Glyph Boards","href":"/documentation/welcome/prerequisites/esp-idf"},{"title":"Smowcode IDE Setup","href":"/documentation/welcome/prerequisites/smowcode-ide-setup"},{"title":"Code Composer Studio IDE Setup","href":"/documentation/welcome/prerequisites/cc-studio"},{"title":"Glink Connector Overview","href":"/documentation/welcome/prerequisites/glink"},{"title":"CircuitPython Setup Guide","href":"/documentation/welcome/prerequisites/circuitpython-setup-guide"}]}]},{"group":"Modules","pages":[{"group":"Glyph","pages":[{"group":"Glyph C3","pages":[{"title":"Overview","sidebarTitle":"Overview","href":"/documentation/modules/glyph/glyph-esp32c3/overview-glyph-c3"},{"title":"Pinouts","sidebarTitle":"Pinouts","href":"/documentation/modules/glyph/glyph-esp32c3/pinouts"},{"title":"Assembly","sidebarTitle":"Assembly","href":"/documentation/modules/glyph/glyph-esp32c3/assembly"},{"title":"Power Management","sidebarTitle":"Power Management","href":"/documentation/modules/glyph/glyph-esp32c3/power-management"}]},{"group":"Glyph C6","pages":[{"title":"Overview","sidebarTitle":"Overview","href":"/documentation/modules/glyph/glyph-esp32c6/overview-glyph-c6"},{"title":"Pinouts","sidebarTitle":"Pinouts","href":"/documentation/modules/glyph/glyph-esp32c6/glyphc6-pinouts"},{"title":"Assembly","sidebarTitle":"Assembly","href":"/documentation/modules/glyph/glyph-esp32c6/glyphc6-assembly"},{"title":"Power Management","sidebarTitle":"Power Management","href":"/documentation/modules/glyph/glyph-esp32c6/glyph-esp32-c6-power-management"}]},{"group":"Glyph H2","pages":[{"title":"Overview","sidebarTitle":"Overview","href":"/documentation/modules/glyph/glyph-esp32h2/overview-glyph-h2"},{"title":"Pinouts","sidebarTitle":"Pinouts","href":"/documentation/modules/glyph/glyph-esp32h2/pinouts-h2"},{"title":"Assembly","sidebarTitle":"Assembly","href":"/documentation/modules/glyph/glyph-esp32h2/glyph-assembly"},{"title":"Power Management","sidebarTitle":"Power Management","href":"/documentation/modules/glyph/glyph-esp32h2/power-management-glyph"}]},{"group":"Glyph S3","pages":[{"title":"Overview","sidebarTitle":"Overview","href":"/documentation/modules/glyph/glyph-esp32s3/glyph-s3-overview"},{"title":"Pinouts","sidebarTitle":"Pinouts","href":"/documentation/modules/glyph/glyph-esp32s3/glyph-esp32-s3-pinouts"},{"title":"Assembly","sidebarTitle":"Assembly","href":"/documentation/modules/glyph/glyph-esp32s3/glyph-esp32-s3-assembly"},{"title":"Power Management","sidebarTitle":"Power Management","href":"/documentation/modules/glyph/glyph-esp32s3/glyph-esp32-s3-power-management"}]},{"group":"Glyph S3 Lucid","pages":[{"title":"Overview","sidebarTitle":"Overview","href":"/documentation/modules/glyph/glyph-s3-lucid/overview"},{"title":"Pinouts","sidebarTitle":"Pinouts","href":"/documentation/modules/glyph/glyph-s3-lucid/pinouts"},{"title":"Power Management","sidebarTitle":"Power Management","href":"/documentation/modules/glyph/glyph-s3-lucid/power-management"}]},{"group":"Glyph C5","pages":[{"title":"Overview","sidebarTitle":"Overview","href":"/documentation/modules/glyph/glyph-c5/overview-glyph-c5"},{"title":"Pinouts","sidebarTitle":"Pinouts","href":"/documentation/modules/glyph/glyph-c5/pinouts"},{"title":"Power Management","sidebarTitle":"Power Management","href":"/documentation/modules/glyph/glyph-c5/power-management"}]},{"group":"Glyph 2040","pages":[{"title":"Overview","sidebarTitle":"Overview","href":"/documentation/modules/glyph/glyph-2040/overview-glyph-2040"},{"title":"Pinouts","sidebarTitle":"Pinouts","href":"/documentation/modules/glyph/glyph-2040/pinouts"},{"title":"Power Management","sidebarTitle":"Power Management","href":"/documentation/modules/glyph/glyph-2040/power-management"}]}]},{"group":"Glyph Mini","pages":[{"group":"Glyph Mini 2040","pages":[{"title":"Overview","sidebarTitle":"Overview","href":"/documentation/modules/glyph-mini/glyph-mini-2040/overview"},{"title":"Pinouts","sidebarTitle":"Pinouts","href":"/documentation/modules/glyph-mini/glyph-mini-2040/pinouts"}]}]},{"group":"TERRA","pages":[{"group":"EC200U","pages":[{"title":"Overview","sidebarTitle":"Overview","href":"/documentation/modules/terra/terralink-ec200u/overview"},{"title":"Pinouts","sidebarTitle":"Pinouts","href":"/documentation/modules/terra/terralink-ec200u/pinouts"},{"title":"Programming with Glyph","sidebarTitle":"Programming","href":"/documentation/modules/terra/terralink-ec200u/programming"}]},{"group":"A7672S","pages":[{"title":"Overview","sidebarTitle":"Overview","href":"/documentation/modules/terra/terralink-a7672s/overview"},{"title":"Pinouts","sidebarTitle":"Pinouts","href":"/documentation/modules/terra/terralink-a7672s/pinouts"},{"title":"Programming with Glyph","sidebarTitle":"Programming","href":"/documentation/modules/terra/terralink-a7672s/programming"}]}]},{"group":"G-Mod","pages":[{"description":"Wire a single-channel relay module to a Glyph ESP32 development board and toggle a high-voltage load on and off using an Arduino digital pin.","title":"1-Channel Relay","sidebarTitle":"1-Channel Relay","href":"/documentation/modules/g-mod/1-ch-relay"},{"title":"2-Channel Relay","sidebarTitle":"2-Channel Relay","href":"/documentation/modules/g-mod/relay"},{"description":"Interface the G-Mod micro SD card module with a Glyph ESP32 board over SPI to read and write files, log sensor data, and store project assets.","title":"Micro SD Card","sidebarTitle":"SD Card","href":"/documentation/modules/g-mod/sd-card"},{"title":"MCP79412 RTC","sidebarTitle":"MCP79412 RTC","href":"/documentation/modules/g-mod/mcp79412-rtc"},{"title":"PCF8563 Real-Time Clock Module","sidebarTitle":"PCF8563 RTC","href":"/documentation/modules/g-mod/pcf8563-rtc"},{"title":"Limit Switch Module","sidebarTitle":"Limit Switch","href":"/documentation/modules/g-mod/limit-switch"},{"title":"WS2812B RGB Ring","sidebarTitle":"WS2812B RGB Ring","href":"/documentation/modules/g-mod/ws2812b-led"},{"title":"Key Array","sidebarTitle":"Key Array","href":"/documentation/modules/g-mod/key-array"},{"title":"Serial Flash","sidebarTitle":"Serial Flash","href":"/documentation/modules/g-mod/serial-flash"},{"title":"Dual Motor Driver","sidebarTitle":"Motor Driver","href":"/documentation/modules/g-mod/motor-driver"},{"title":"Lithium Charger","sidebarTitle":"Lithium Charger","href":"/documentation/modules/g-mod/lithium-charger"},{"title":"DC-DC Buck Converter (SY81103)","sidebarTitle":"Buck Converter","href":"/documentation/modules/g-mod/dc-buck-converter"},{"title":"DC-DC Boost Converter (SX1308)","sidebarTitle":"Boost Converter","href":"/documentation/modules/g-mod/dc-boost-converter"},{"title":"Audio Codec","sidebarTitle":"Audio Codec","href":"/documentation/modules/g-mod/audio-codec"},{"title":"CAN Bus Transceiver","sidebarTitle":"CAN Bus","href":"/documentation/modules/g-mod/can-bus"},{"title":"RS-485 Transceiver","sidebarTitle":"RS-485 Transceiver","href":"/documentation/modules/g-mod/rs-485-transceiver"},{"title":"Bi-Directional Voltage-Level Translator","sidebarTitle":"Voltage-Level Translator","href":"/documentation/modules/g-mod/bi-voltage-level-translator"}]},{"group":"G-Sense","pages":[{"title":"Single-Channel I2S Microphone","sidebarTitle":"Microphone","href":"/documentation/modules/g-sense/microphone"},{"title":"Single-Channel I2S Microphone (T5848)","sidebarTitle":"Microphone (T5848)","href":"/documentation/modules/g-sense/t5848-microphone"},{"title":"2-Channel Microphone","sidebarTitle":"2-Channel Microphone","href":"/documentation/modules/g-sense/2-channel-microphone"},{"title":"SHT35 Temperature and Humidity Sensor","sidebarTitle":"SHT35","href":"/documentation/modules/g-sense/sht35"},{"title":"SHT45 Temperature and Humidity Sensor","sidebarTitle":"SHT45","href":"/documentation/modules/g-sense/sht45"},{"title":"GSI003 Industrial Temp \u0026 Humidity Sensor","sidebarTitle":"GSI003","href":"/documentation/modules/g-sense/hdc3020-rs485"},{"title":"QMC6309 Magnetometer","sidebarTitle":"QMC6309 Magnetometer","href":"/documentation/modules/g-sense/qmc6309-magnetometer"},{"title":"Capacitive Touch Slider","sidebarTitle":"Capacitive Touch Slider","href":"/documentation/modules/g-sense/capacitive-touch-slider"}]},{"group":"G-Kit","pages":[{"title":"SoundBox — DIY MP3 Player","sidebarTitle":"MP3 Player","href":"/documentation/modules/g-kit/soundbox"}]},{"group":"Breakout Boards","pages":[{"title":"Qwiic 2-in-1","sidebarTitle":"Qwiic 2-in-1","href":"/documentation/modules/breakout-boards/qwiic-2-in-1"},{"title":"Qwiic 4-in-1","sidebarTitle":"Qwiic 4-in-1","href":"/documentation/modules/breakout-boards/qwiic-4-in-1"},{"title":"USB 4-in-1","sidebarTitle":"USB 4-in-1","href":"/documentation/modules/breakout-boards/usb-4-in-1"},{"title":"USB-A Female","sidebarTitle":"USB-A Female","href":"/documentation/modules/breakout-boards/usb-a-breakout-female"},{"title":"USB-A Male","sidebarTitle":"USB-A Male","href":"/documentation/modules/breakout-boards/usb-a-breakout-male"},{"title":"USB-C","sidebarTitle":"USB-C","href":"/documentation/modules/breakout-boards/usb-c"}]},{"group":"Gadgets","pages":[{"title":"USB to RS485 Converter","sidebarTitle":"USB to RS485","href":"/documentation/modules/gadgets/usb-to-rs485"},{"title":"USB to TTL Converter","sidebarTitle":"USB to TTL","href":"/documentation/modules/gadgets/usb-ttl"}]}]},{"group":"Enclosure","pages":[{"title":"3D Printed Enclosure for Glyph C3/C6","sidebarTitle":"Enclosure-C3/C6","href":"/documentation/enclosure/3d-printed-enclosure-for-glyph-esp32-boards"}]}]},{"tab":"Examples","pages":[{"title":"Examples","href":"/guides/arduino-ide-blink-led"}]},{"tab":"PCB Design","pages":[{"title":"PCB Design","href":"/pcb-design/design/kicad/introduction-on-kicad"}]}]},"basePath":"","title":"2-Channel Relay - PCB Cupid","deploymentId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","buildId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","dynamics":["a74be98ba7"],"chunks":["zoom-image-lightbox-DQG3o8Eu.js","lightbox-handle-r17bVUz3.js"]}