I purchased a Seeed Studios Relay Shield v1.3 a little while back. I have tried many times since to get it working, including reading through the Wiki, using both my Arduino and Netduino, using Arduino IDE and Visual Studio, and slimming things down to the most basic code. You can see the code below along with the current configuration, layout, etc.
What is happening is when I step through code in Visual Studio debugger, everything goes perfectly. It deploys, I hit the breakpoint at the “for” statement, I verfiy the values being set are correct, etc. The port I’m trying to set is “Cpu.Pin.GPIO_Pin7”, which I have verified in the enumeration is port number 7. From what I can see this should tie through to the relay shield’s port “D0”. According to the Seeed Studios Wiki, D0 should cause NC1 to connect to COM1 when it is LOW and disconnect when it is HIGH.
To this end, I have connected my meter, in impedence mode. It should show when COM1 and NC1 are connected or disconnected. The problem is that it is initially connected as it should be, but never enters a disconnected state. Again, I have verified the values being sent to the Netduino port 7 and I have even performed a read on that port to verify it really did enter that state. I plugged in a 9v battery into the Relay Shield’s power jack (not the GND/+9V headers). that didn’t make a difference either.
This brings me to my question… what am I missing?!?!?
Current Code
[code]using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;
namespace NetduinoRelayTest
{
public class Program
{
public static void Main()
{
OutputPort o = new OutputPort(Cpu.Pin.GPIO_Pin7, false);
Boolean state = false;
for (int i = 0; i <= 100; i++)
{
o.Write(!state);
state = !state;
Thread.Sleep(2000);
}
}
}
}[/code]
Current Environment
(see hardware configs below)
Netduino Plus
Seeed Studios Relay Shield
Tpi Scope Plus 400
Wire from COM1 on Relay Shield to Common port on Meter
Wire from NC1 on Relay Shield to V/Ohm/Cap port on Meter
Hardware Configurations
Netduino Plus
DeviceInfo:
HAL build info: 4.2.0.0, Netduino Plus (v4.2.0.1) by Secret Labs LLC
OEM Product codes (vendor, model, SKU): 34, 177, 4097
Serial Numbers (module, system):
00000000000000000000000000000000
0000000000000000
Solution Build Info: 4.2.0.0, Netduino Plus (v4.2.0.1) by Secret Labs LLC
AppDomains:
default, id=1
Assemblies:
mscorlib,4.2.0.0
Microsoft.SPOT.Native,4.2.0.0
Microsoft.SPOT.Hardware,4.2.0.0
Microsoft.SPOT.Net,4.2.0.0
System,4.2.0.0
Microsoft.SPOT.Hardware.SerialPort,4.2.0.0
Microsoft.SPOT.IO,4.2.0.0
System.IO,4.2.0.0
Microsoft.SPOT.Hardware.PWM,4.2.0.1
SecretLabs.NETMF.Diagnostics,4.2.0.0
NetduinoRelayTest,1.0.0.0
SecretLabs.NETMF.Hardware.NetduinoPlus,4.2.0.1
SecretLabs.NETMF.Hardware,4.2.0.0
Seeed Studios Relay Shield
V1.3
4-Relay
Powered through external 9-Volt jack
RFBee Port (not currently used)
NetduinoRelayTest.zip (109 KB)