Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Netduino 3 and Electronic Brick of Relay


  • Please log in to reply
4 replies to this topic

#1 Dave1374

Dave1374

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 01 August 2015 - 08:01 PM

Trying to figure out how to plug things.

 

I'm using this relay http://www.robotshop...k-5v-relay.html

 

Let's call the screw connector : Connector 1

Let's call the white 4 pin connector : Connector 2

Let's call the black 3 pin : Connector 3

 

I want to use it to make a 12 volt valve work.

 

I striped red and black from a 12 volt adapter pluged in a wall.

 

Black and red goes to Connector 1 (tried both NC and NO)

 

Then I'm not sure if I'm supposed to plug netduino digital pin to Connector 2 or Connector 3, and output 12 volt from Connector 2 or Connector 3.........

 

I've tried both, didn't work.

 

Of course I've read the datasheet but it's not detailed enough for me and can't find any project with this exact relay.

 

Datasheet.pdf

 

schematic diagram of relay

 

my code :

static OutputPort relay = new OutputPort(Cpu.Pin.GPIO_Pin0, false);
relay.Write(true);

How do I wire this relay ?

 



#2 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 02 August 2015 - 07:43 AM

Reading the data sheet it suggests that the minimum working voltage for this board is 4.5V with the nominal voltage being 5V.  The Netduinos whilst tolerating 5V on the digital input will only output 3.3V so I would think that you would need a level shifter in the circuit somewhere.

 

The block three pin connector looks to be the digital input and logic level power (i.e. 5V, GND and logic input).

 

The Blue connector with the screw terminals looks to be the relay connection.

 

The White connector is a Grove connector and serves a similar purpose to the block three pin connector.  We can ignore this for the minute.

 

There is a picture in the data sheet which shows the blue connector wired up.  So this is the relay portion of the circuit.

 

For the three pin connector, you should connect the V to 5V, G to GND and S is your signal.  However, connecting this to the Netduino may not work as it suggests that this requires a 5V signal.  You can test this by connecting S to GND, your relay should be open and then connecting S to 5V, the relay should close.  If this works then you need to boost the output from the Netduino from 3.3V to 5V.

 

Hope this helps,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#3 Dave1374

Dave1374

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 05 August 2015 - 06:53 PM

Thanks for your input, Nevyn, but it turns out there was no voltage problem.

 

It works now.

 

Apparantly, I wasn't using the correct namespace.

 

I was using

static OutputPort relay = new OutputPort(Cpu.Pin.GPIO_Pin0, false);

Which uses the Microsoft.SPOT.Hardware namespace

 

And now I'm using

OutputPort test = new OutputPort(Pins.GPIO_PIN_D5, false);

Which uses ScretLabs.NETMF.Hardware.Netduino.Pins

 

Strange enough, this works just fine and is using the Microsoft.SPOT.Hardware namespace.

static AnalogInput sensor = new AnalogInput(Cpu.AnalogChannel.ANALOG_0);
double value = sensor.Read();

I'm still confuse between the two and don't understand their specific purpose.



#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 06 August 2015 - 04:24 AM

Hey Dave,

I'm still confuse between the two and don't understand their specific purpose.

Cpu.Pins is a NETMF enumeration which specifies the physical pin # on the microcontroller itself.

Netduino's Pins.GPIO_PIN_## enumeration specifies the header pins on the Netduino (i.e. Digital 0-13 and Analog 0-5).

I wish that Cpu.Pin didn't have an enumeration at all... That would make this simpler :) In any case, glad you solved the issue. [And thanks as always, Nevyn for helping out!]

Chris

#5 Dave1374

Dave1374

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 07 August 2015 - 02:56 PM

Cpu.Pins is a NETMF enumeration which specifies the physical pin # on the microcontroller itself.
 

 

Chris, is there a case where one would use Cpu.Pins instead of Pins.GPIO_PIN_## ?

 

Should I change my 

static AnalogInput sensor = new AnalogInput(Cpu.AnalogChannel.ANALOG_0);

for

static AnalogInput sensor = new AnalogInput(Pins.ANALOG_0);

  • JLJ likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.