Numato 2 Channel USB Relay Module Скачать руководство пользователя страница 14

12                                                                                                                         2 Channel USB Relay Module – User Guide

2. Set port parameters. Most of the parameters can be left to defaults except Flow Control, which 

needs to be set to “none”
3. To send a command to the module, use an API equivalent to write/writefile and pass the 

buffer/string containing the command. It is important to append Carriage Return (ASCII 13) to emulate
the ENTER key.

4. If return data is expected (Eg: “ver” command), try to read a fixed number of characters (Eg: 50mS) 
with timeouts so that the read call will return when 50 characters are received or the timeout occur. 

Depending on the operating system and language the method implementing timeouts can be very 
different. APIs equivalent to Read/ReadFile can be used to read data from the module. Please note 

that the return data will include the command itself (since the module echoes everything back), the 
result, carriage return and the “>” symbol. 

Please visit the product page for available sample programs.

Additional Information

Analog to Digital Converter

Some products do support Analog to Digital Conversion on some of the IO terminals. A list of GPIOs 

that supports analog function in this product is listed elsewhere in this document. There is no special 
command is required to execute to 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 unless otherwise noted. The input voltage range of 

the ADC is 0 – VDD (this product uses 5V power supply, so the range will be 0 – 5V). The result will be 
returned as a number starting at zero and ending at 1023. Zero indicates zero volts at the ADC input 

and 1023 indicates VDD (5V for this product) at ADC input.

Using GPIOs with switches

It is possible to read the position of a switch that is connected to a GPIO. A SPST or SPDT switch is 
recommended to use with GPIOs. Push switches do maintain the contacts closed for a very short time 

so using them is discouraged. The fundamental idea of using a switch with GPIO is to have the switch 
cause a voltage level change at the GPIO pin when pressed. Usually this is achieved by using an 

external pull-up resistor along with the switch. The pull up resistor is connected between the GPIO 
and VDD and the switch is connected between the GPIO and ground. When the switch is not pressed, 

the pull-up resistor will cause the GPIO to stay at VDD voltage level. When the switch is pressed, the 
GPIO is short circuited to ground and stays at zero voltage. This change in voltage and thus the 

position of the switch can be read using “gpio read” command. Please see the recommended 
connection diagram below.

 

Содержание 2 Channel USB Relay Module

Страница 1: ...2 Channel USB Relay Module User Guide www numato com...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 19: ...17 2 Channel USB Relay Module User Guide Schematics...

Отзывы: