Hello Guest it is May 17, 2021, 02:58:51 PM

Author Topic: Tuning a relay on and off  (Read 2328 times)

0 Members and 1 Guest are viewing this topic.

Tuning a relay on and off
« on: May 22, 2013, 08:52:48 AM »
Hi Guys ,

New to pokeys so go easy  ;D

I have got a pokeys attached to a relay module with pins 1 thru to 4 and with the VB.net example Example2_BasicPinFunctions tried changing the state of the relay.

Setting the Pins data type the relay latchs  with this code :

        device.SetPinData(0, pinFunctionsEnum.pinFunctionDigitalOutput)
        Console.WriteLine("Pin 1 was set as digital input")

But I cannot unlatch it with this code :

           device.SetOutput(0, False)
           Console.WriteLine("Pin 1 set to 0")

Am I doing something completely wrong here ?

This is diagram of my Relay module :

Thanks in Advance ))





Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: Tuning a relay on and off
« Reply #1 on: May 22, 2013, 09:01:13 AM »
This relay board uses PNP transistors that are activated by the LOW signal. In order to turn them off, you must supply the VCC to them. However, this may be a problem if VCC is greater than 3.3V (that is the maximum voltage of the PoKeys pin).
One option for 5V relays (if VCC = 5V) is that you change the pin function back to digital input and provide an additional external pull-up resistor from pin to 5V.
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope
Re: Tuning a relay on and off
« Reply #2 on: May 28, 2013, 07:00:42 AM »
Thank you NeoTO that worked great :D