background image

8                                                                                                                         2 Channel USB Relay Module – User Guide

4

adc

adc read x

Reads the analog voltage present at the ADC input mentioned. 

X stands for the number of ADC input. The response will be a 
number that ranges from 0 – 1023. Please see examples below.

adc read 0

 – Reads analog input 0 

adc read 4 

– Reads analog input 4 

5

gpio

gpio set x

Sets the GPIO output status to high. Here x is the number of 
the GPIO. Please see examples below.

gpio set 0

 – Sets GPIO 0 to high state

gpio set 4

 – Sets GPIO 4 to high state

gpio clear x

Sets the GPIO output status to low. Here x is the number of the 
GPIO. Please see examples below.

gpio clear 0 

– Sets GPIO 0 to low state

gpio clear 4

 – Sets GPIO 4 to low state

gpio read x

Reads the digital status present at the input mentioned. Here x 
stands for the number of GPIO. The response will be either 

“on” or “off” depending on the current digital state of the 
GPIO. Please see examples below.

gpio read 0

 – Reads GPIO 0 status

gpio read 4 

– Reads GPIO 4 status

Controlling relays using Serial Terminal Emulator software

The simple set of ASCII based human readable command set supported by this module makes 

controlling relays easy with any off the shelf Serial Terminal Emulation program like Hyper Terminal or 
Teraterm.  The most important thing to remember here is that since the module appear as a serial 

port in the operating system, treat it just like any serial device you may use. Since the underlying 
transport is USB not RS232, almost all settings such as baud rate, parity, number of stop bits can be 

left to the default values in the software. Flow control needs to be set to “None”. The following 
sections give examples of how to use the module with Hyper Terminal and Teraterm.

Using this module with Hyper Terminal is very easy. Please follow the steps below.

Connect the module to the computer, install driver and note down the name of the new serial 
port that appears in the device manager. 

Open Hyper Terminal and select the serial port corresponding to the relay module. Click OK.

 

Summary of Contents for 2 Channel USB Relay Module

Page 1: ...2 Channel USB Relay Module User Guide www numato com...

Page 2: ...ebook https www facebook com numato Visit our blog http www numato cc Mailing Address NO 29 NEW MICO LAYOUT 16TH MAIN BEGUR ROAD HONGASANDHRA BANGLORE KA 560068 INDIA Mail orders phone orders and dire...

Page 3: ...tion Test Fixtures DIY and Hobby This product is compatible with the following operating systems Windows XP and later Linux Mac And any other operating system that supports USB CDC devices And these a...

Page 4: ...ilure to comply with safety regulations may result in injury and or death Connection Diagram Above image shows basic connection diagram that can be used in most of the situations The connection diagra...

Page 5: ...e versa the contacts C and NO will be disconnected when relay is turned off and will be connected when the relay is turned on The table below summarize the relay contact positions Relay State Connecti...

Page 6: ...pins support 5V TTL signals and the ADC input range is 0 to 5V The ADC can acquire analog signal at the resolution of 10 bits per sample It is recommended to use a series resistor with the GPIO ADC pi...

Page 7: ...r a PC serial port over a standard RS232 data interface The Serial Interface pins do support only 5V logic So to connect to a standard PC Serial Port a level translator such as MAX232 is required This...

Page 8: ...is driver pre installed The chances of you requiring to rebuild the kernel to include the USB CDC driver is very slim When connected to a Linux machine this product should appear as a serial port in t...

Page 9: ...parameter x stands for the relay number The relay number starts from zero See some examples below relay on 0 Turns on relay 0 relay on 1 Turns on relay 1 relay off x Turns a particular relay off In th...

Page 10: ...w gpio read 0 Reads GPIO 0 status gpio read 4 Reads GPIO 4 status Controlling relays using Serial Terminal Emulator software The simple set of ASCII based human readable command set supported by this...

Page 11: ...be changed In this window leave all settings to defaults except Flow Control which needs to be set to None and click OK If everything goes well you should be presented with a blank screen Press ENTER...

Page 12: ...llow the steps below Teraterm is an open source software A free copy can be downloaded from http en sourceforge jp projects ttssh2 releases Run Teraterm application and select the port corresponding t...

Page 13: ...ng system even when the same language is used For example when using C C on Windows Win32 Serial Communication APIs along with File IO APIs CreateFile ReadFile WriteFile etc needs to be used http msdn...

Page 14: ...switch between analog and digital mode Executing adc command will set the GPIO to analog mode and executing gpio command will set the GPIO to digital mode on the fly Resolution of the ADC is 10 bits...

Page 15: ...change of current is maximum at that point Even though the back emf lives only for a very short time a few milliseconds it can cause sparks between the relay contacts and can deteriorate the contact q...

Page 16: ...ng on the load itself Some of the parameters that affects the suppression device selection are the inductance of the load power supply voltage load current physical size structure of the load etc It i...

Page 17: ...oltage Source 2 5 K Relay Specifications Nominal relay coil voltage 12 V Nominal coil power consumption per relay 400 mW Relay contact material AgCdO Contact rating 12A 120V AC 7A 250V AC 10A 24V DC M...

Page 18: ...a value high low that particular GPIO is put to output mode When you are trying to read the GPIO it needs to be put in input mode In input mode the GPIO will go to high impedance state and thus looses...

Page 19: ...17 2 Channel USB Relay Module User Guide Schematics...

Reviews: