Hello!
In our earlier Home Automation example project we used the Relay Shield. We wanted to provide another basic example using that shield and the Pioneer kit.
In this example project we use both SW1 and SW2 switches to step through relay states.
- CY8CKit-042
- Relay Shield
Forum Post Attachments:
At the bottom of this post we are including the following items:
- Example Project Zip File
- Zip File of Images
- Project Schematic
- Component Configurations
Components Used:
The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:
- Control Register
- Status Register
- CyPins
- CyClock
The components are configured by right clicking on the component in your Top Design schematic view and selecting Configure. Please enable the following selections in the Configuration windows for the listed components above.
Firmware Description:
The main.c firmware is included in the example project. Please review the commented sections for more details.
When the PSoC4 is reset (SW1 Reset button pushed and released), the relays are in their default state (coils not powered).
Each relay has a connection between its COM and NC pins. To indicate it is in this reset state, the LED (D9 RGB LED) on the Pioneer board is set to RED.
If the Pioneer Kit SW2 button is pushed (and held in the depressed position), the LED turns blue and all relays have their coils powered and all relays connect COM to NO pins.
If the button is released, the LED turns green and the relays cycle through a sequence:
- Relays off
- Relay1 on for one second
- Relay2 on for one second
- Relay3 on for one second
- Relay4 on for one second
At the end of the sequence the LED turns a green-blue color for one second (while all relays are off) and then back to green to start the sequence again
If the button (SW2) is pushed and held, it will go back to a blue LED color and all relays on (after the green sequence is done).
Hardware Connections:
Simply connect the Relay Shield to the Pioneer Kit. The Pioneer kit will be powered using the USB cable from the PC. The Relay Shield will be powered using a 9V DC power supply. Verify the outputs on the relays using a multi-meter.
Test Your Project:
Program your project and begin scrolling through the relay states using the Pioneer kit buttons.
I hope this example can help you in your design.
Best,
Matt

