Tuesday, 21 February 2012 14:59

DINo Internet Ethernet IO board

Written by

 

 

DINo Internet/Ethernet Relay I/O board

( Arduino compatible, fully assembled and tested )

 

 

 

Arduino IDE compatible

Features

• ATMEGA328 Microcontroller
• ENC28J60 Ethernet Controller
• Built-in USB FTDI USB to Serial COM port converter
• Built-in RS-485 converter
• 4 Opto Isolated Digital Inputs
• 4 Relays 220VAC/10Am
• Reset Button
• Code upload via USB with the Bootloader

 

Specification

• Microcontroller - ATmega328
• Power Voltage - 12VDC/1000mA
• Digital Inputs Voltage - 5-24VDC
• Ethernet Controller - ENC28J60
• Digital Input Pins - 4
• Relays - 4
• Flash Memory - 32 KB (ATmega328) of which 2 KB used by bootloader
• SRAM - 2 KB (ATmega328)
• EEPROM - 1 KB (ATmega328)
• Clock Speed - 16 MHz

 

What projects you can realize using this board?

Some ideas ...
• Build a garage door opener with Internet or IPhone
• Control using WEB any high or low voltage equipment
• Build simple home automation and control lamps or other home equipment
• Longing processes and save to WEB server SQL base
• Build long distance 4 lines extender using two board connected directly or using Enthernet
and many more ...

 

 

back to Arduino DINo projects

 

Monday, 20 February 2012 12:57

KMTronic USB One Relay Linux test script

Written by

 

 

KMTronic USB One Relay Linux test script

 

 

 

Download test script from:

http://www.info.kmtronic.com/software/USB_Relays/KMtronic_USB_Relay_Linux_Script_OpenSUSE.zip

http://www.info.kmtronic.com/software/USB_Relays/KMtronic_USB_Relay_Linux_Script_Ubuntu.zip

          (Thanks to Karl for this script)

-------------------------

 

Create folder and extract these 4 files :

        You will need to mark it as executable with this command 

        chmod + x *.* 

        1. ubrelayspeed.sh   -      This script will set the speed to 9600

        2. usbrelayon.sh       -      This script will switch "ON" the relay

        3. usbrelayoff.sh       -      This script will switch "OFF" the relay

        4. usbrelaystatus.sh -      This script will read the status of the relay       

 

 

-----------------------------------

The script “usbrelaystatus”  gets the status of the relay (on/off) and there are places to insert code to run commands.  Hopefully included comments explain things (I left the echo’s and comments in that I used while I wrote/tested the script).  Let me know if you have questions.

If you do test this, I’d appreciate knowing if it worked for you or not.

 

I’m using OpenSUSE 12.1 – had to install libftdi1 – but it came with the OpenSUSE 12.1 install.

I never got the “.cats” program to work.

The usbrelaystatus script does not require any other programs to be installed (except for the ftdi drivers – at least on my system)

And I also discovered I have to run the usbrelayspeed script before I can send/receive data to/from the usb relay card.

Also I discovered if I include the usbrelayspeed in a cron job @reboot it doesn’t work – perhaps the @reboot executes before the usb relay card is loaded.

 

I am not a computer expert, so there may be a more efficient/better way to get the status of the relay – if you/someone publishes a better way I won’t feel sad.  But this works.

 

Hope this saves someone some time.

 

Karl

---------------------

 

 

Monday, 20 February 2012 09:21

KMTronic USB Relay Test software

Written by

 

 

KMTronic USB Relay Test software

 

 

 

Download test software from:

http://www.info.kmtronic.com/software/USB_Relays/KMTronic_USB_Relays_Tester.zip

 

-------------------------

 

USB One Relay commands:

 

FF 01 00 - OFF command

FF 01 01 - ON command

 

FF 01 03 - Status request command

  > FF 01 xx - Reply from relay where xx is status: 01 - Relay is ON, 00 - Relay is OFF

 

 

-------------------------

 

 

USB Two Relay commands:

 

FF 01 00 - First relay OFF command

FF 01 01 - First relay ON command

 

FF 02 00 - Second relay OFF command

FF 02 01 - Second relay ON command

 

FF 01 03 - First relay Status request command

  > FF 01 xx - Reply from relay where xx is status: 01 - Relay is ON, 00 - Relay is OFF

FF 02 03 - First relay Status request command

  > FF 02 xx - Reply from relay where xx is status: 01 - Relay is ON, 00 - Relay is OFF

 

 

-------------------------

 

 

USB Four Relay commands:

 

FF 01 00 - First relay OFF command

FF 01 01 - First relay ON command

 

FF 02 00 - Second relay OFF command

FF 02 01 - Second relay ON command

 

FF 03 00 - Third relay OFF command

FF 03 01 - Thirdrelay ON command

 

FF 04 00 - Fourth relay OFF command

FF 04 01 - Fourthrelay ON command

 

FF 09 00 - Status request command

  > xx xx xx xx  - Reply from relay where xx is status: 01 - Relay is ON, 00 - Relay is OFF

     First byte is status first relay, Fourthbyte is status fourthrelay

 

 

-------------------------

 

 

USB (RS232) Eight Relay commands:

 

FF 01 00 - First relay OFF command

FF 01 01 - First relay ON command

 

FF 02 00 - Second relay OFF command

FF 02 01 - Second relay ON command

.......

 

FF 08 00 - Eight relay OFF command

FF 08 01 - Eight relay ON command

 

FF 09 00 - Status request command

  > xx xx xx xx xx xx xx xx  - Reply from relay where xx is status: 01 - Relay is ON, 00 - Relay is OFF

     First byte is status first relay, Eight byte is status eight relay

 

 

 

 

RS485 Relays commands

https://info.kmtronic.com/kmtronic-rs485-relays-commands.html

 

 

 

 

 

Friday, 17 February 2012 12:59

Windows Command Line example

Written by


Windows command line application for

switching on and off the KMTronic USB relays

(Author: Jan)

 

 

You have to download the drivers from FTDI website

http://www.ftdichip.com/Drivers/VCP.htm

 

FTDI Virtual COM Port Drivers installation

http://www.info.kmtronic.com/ftdi-virtual-com-port-drivers-installation.html

 

Windows command line application

http://info.kmtronic.com/software/USB_Relays/USBRelay.zip

 

Quick help:

usbrelay.exe -c:<COM port> -r:<RELAY>#<STATE> -b:<BROADCAST> -q
-c: Com port
-r: Relay(s), State(s)
-b: Broadcast/output on successful sent
-q Silence mode

Example:

usbrelay.exe -c:5 -r:1#1 (this will turn on relay)
usbrelay.exe -c:5 -r:1#0 (this will turn off relay)

 

ZIP file including:

- USBRelay.exe

 

Step by step instructions:

Click on Start Menu > Run > Open
D:\usbrelay\usbrelay.exe -c:5 -r:1#1
Or
D:\usbrelay\usbrelay.exe -c:5 -r:1#0

 

 

This is only example command !!!

You must change path to the folder where you download Usbrelay.exe
Example: C:\Downloads\usbrelay\usbrelay.exe -c:5 -r:1#1

 

 

 

 

Friday, 17 February 2012 12:38

Sample Linux code

Written by

 

Linux

 


Instructions to install new driver: You may require the sources matching the
current kernel to be installed on your system (and built).

To install the ftdi_sio driver use the following steps:
1. Create a temporary folder in your linux machine.
2. Extract the files from ftdi_sio.tar.gz file to your temporary folder
"gunzip ftdi_sio.tar.gz"
"tar -xvf ftdi_sio.tar"
3. Build the driver
"make"
4. Plug in your ftdi device
5. Check to see if default driver was loaded
"lsmod" - you will see ftdi_sio if a driver is loaded
6. Remove the default installed driver
"rmmod ftdi_sio"
7. Install the newly built driver
"insmod ftdi_sio.o"
NOTES:
1.This driver was adapted from the 2.4.32 kernel to support both the 2232C
and 232R chip
2.There is no need to follow this procedure if you want 232R chip supprt. The
232BM driver will be sufficient.Changes made to the driver for the 232R chip
are purly cosmetic (plug/unplug will appear as a 232R chip in the kernel log).

 

 

In this case the driver is correctly installed and with the bash's command

The old kernel's "echo" commands:
stty -F /dev/ttyUSB0 9600
echo $ '\xff\x01\x01' > ttyUSB0
// the relay 1 go ON
echo $ '\xff\x01\x00' > ttyUSB0 // the relay 1 go OFF

The new kernel's "echo" commands:
stty -F /dev/ttyUSB0 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts

echo -e '\xff\x01\x01' > /dev/ttyUSB0
// the relay 1 go ON
echo -e '\xff\x01\x00' > /dev/ttyUSB0 // the relay 1 go OFF

echo -e "\xff\x01\x03" > /dev/ttyUSB0 | od -A n -N 3 -t x1 < /dev/ttyUSB0 // read status

 


 

Thursday, 09 February 2012 12:07

Control KMTronic USB relays with DSPRobotics FlowStone

Written by

 

 

 

 

The programming language for engineers

 

Homepage

http://www.DSPRobotics.com

 

So what is FlowStone?
FlowStone is a Graphical real time industrial computer programming language.

What can FlowStone do?
FlowStone allows you to create your own standalone applications for real time Digital Signal Processing,

Robotics, Mechatronics, HMI, SCADA and many more.

 

FlowStone example

(thanks DSPRobotics)

http://www.info.kmtronic.com/software/FlowStone/FlowStone KMtronic Relay.zip

 

 

 

Support  Forum

http://www.dsprobotics.com/support/

 

 

 

 

Wednesday, 08 February 2012 16:18

Mach3 & KMTronic USB relays

Written by

 

MACH3 CNC software and KMTronic USB relays

 



All in tree steps:

 

1. Connect USB relay to PC and install the drivers.

     For 1,2 and 4 channels relay boards:

https://www.info.kmtronic.com/ftdi-virtual-com-port-drivers-installation.html

     For 8 channels relay board:

https://www.info.kmtronic.com/usb-8-relay-box-drivers-instalation.html


2. Download DLL and place it in your Mach3 install folder (usually C:\Mach3)

https://www.info.kmtronic.com/software/Mach3/KMtronicDLL.zip


3. Add to your macro or button script ON or OFF command

Command's format:
a = Relay(5,1,"ON")  - where "5" is USB COM port, "1" is relay number, "ON" is command, which turns ON the relay connected to COM5
a = Relay(5,1,"OFF")  - where "5" is USB COM port, "1" is relay number, "OFF" is command, which turns OFF the  relay connected to COM5

Note- every script where you use commands has to start with this declaration:
Declare Function Relay Lib "KMSerial.dll" (ByVal comPort As Integer,ByVal numberRelay As Integer,ByVal command As String) As Boolean

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Friday, 03 February 2012 11:13

KMtronic ModBus Relays

Written by

 

COM port settings:

Baud Rate:      9600
Data Bits:        8
Parity:             None
Stop Bits:        1
Flow Control:  None

 

MODBUS commands:

 

01 (0x01) Read Coil (check relay status)

The coils in the response message are packed as one coil per bit of the data field.

Status is indicated as 1= ON and 0= OFF.

 

Status request commands:

>> 01 01 00 00 00 01 (CS) (CS)  - Request for status relay 1
>> 01 01 00 01 00 01 (CS) (CS)  - Request for status relay 2
>> 01 01 00 02 00 01 (CS) (CS)  - Request for status relay 3
>> 01 01 00 03 00 01 (CS) (CS)  - Request for status relay 4
>> 01 01 00 04 00 01 (CS) (CS)  - Request for status relay 5
>> 01 01 00 05 00 01 (CS) (CS)  - Request for status relay 6
>> 01 01 00 06 00 01 (CS) (CS)  - Request for status relay 7
>> 01 01 00 07 00 01 (CS) (CS)  - Request for status relay 8

 

Response relay board:

<< 01 01 01 00 (CS) (CS)  - relay is OFF

or

<< 01 01 01 01 (CS) (CS)  - relay is ON

 

 

05 (0x05) Write Single Coil (turn relay ON/OFF)

The normal response is an echo of the request, returned after the coil state has been written.

 

ON commands:

>> 01 05 00 00 FF 00 (CS) (CS)  - Turn relay 1 ON

     << 01 05 00 00 FF 00 (CS) (CS)  - Respond that relay 1 is turned ON

>> 01 05 00 01 FF 00 (CS) (CS)  - Turn relay 2 ON

     << 01 05 00 01 FF 00 (CS) (CS)  - Respond that relay 2 is turned ON

>> 01 05 00 02 FF 00 (CS) (CS)  - Turn relay 3 ON

     << 01 05 00 02 FF 00 (CS) (CS)  - Respond that relay 3 is turned ON

>> 01 05 00 03 FF 00 (CS) (CS)  - Turn relay 4 ON

     << 01 05 00 03 FF 00 (CS) (CS)  - Respond that relay 4 is turned ON

>> 01 05 00 04 FF 00 (CS) (CS)  - Turn relay 5 ON

     << 01 05 00 04 FF 00 (CS) (CS)  - Respond that relay 5 is turned ON

>> 01 05 00 05 FF 00 (CS) (CS)  - Turn relay 6 ON

     << 01 05 00 05 FF 00 (CS) (CS)  - Respond that relay 6 is turned ON

>> 01 05 00 06 FF 00 (CS) (CS)  - Turn relay 7 ON

     << 01 05 00 06 FF 00 (CS) (CS)  - Respond that relay 7 is turned ON

>> 01 05 00 07 FF 00 (CS) (CS)  - Turn relay 8 ON

     << 01 05 00 07 FF 00 (CS) (CS)  - Respond that relay 8 is turned ON

 

             OFF commands:

>> 01 05 00 00 00 00 (CS) (CS)  - Turn relay 1 OFF

     << 01 05 00 00 00 00 (CS) (CS)  - Respond that relay 1 is turned OFF

>> 01 05 00 01 00 00 (CS) (CS)  - Turn relay 2 OFF

     << 01 05 00 01 00 00 (CS) (CS)  - Respond that relay 2 is turned OFF

>> 01 05 00 02 00 00 (CS) (CS)  - Turn relay 3 OFF

     << 01 05 00 02 00 00 (CS) (CS)  - Respond that relay 3 is turned OFF

>> 01 05 00 03 00 00 (CS) (CS)  - Turn relay 4 OFF

     << 01 05 00 03 00 00 (CS) (CS)  - Respond that relay 4 is turned OFF

>> 01 05 00 04 00 00 (CS) (CS)  - Turn relay 5 OFF

     << 01 05 00 04 00 00 (CS) (CS)  - Respond that relay 5 is turned OFF

>> 01 05 00 05 00 00 (CS) (CS)  - Turn relay 6 OFF

     << 01 05 00 05 00 00 (CS) (CS)  - Respond that relay 6 is turned OFF

>> 01 05 00 06 00 00 (CS) (CS)  - Turn relay 7 OFF

     << 01 05 00 06 00 00 (CS) (CS)  - Respond that relay 7 is turned OFF

>> 01 05 00 07 00 00 (CS) (CS)  - Turn relay 8 OFF

     << 01 05 00 07 00 00 (CS) (CS)  - Respond that relay 8 is turned OFF

 

 

 

MODBUS Test Software:

Download test software from:

http://www.info.kmtronic.com/software/ModBus/KMtronic_ModBus_Tester.zip

 

 

Select COM port where the Relay is installed (in this example it is COM Port 4) and click to OPEN button.

 

Write (copy/paste) command without Check Sum (CS) and click on SEND button. Software calculate Check Sum and send command to relay board.

 

In this example last command is:

"01 01 00 00 00 01 FD CA"  - Request for status relay 1. "FD CA" is Check Sum

"01 01 01 01 90 48" - Reply from relay board that status relay 1 is ON.  "90 48" is Check Sum

 

NOTE: You don't need to enter checksum manually. The software automatically calculates checksum and adds it to the main command.

 

RS485 Commands

http://www.info.kmtronic.com/kmtronic-modbus-relays-commands.html

 

 

 

 

 

 

 

 

Thursday, 26 January 2012 10:40

Mach3 CNC software

Written by

 

 

 

Mach3 is PC-based CNC software

http://www.machsupport.com/

 

 

 

How to connect KMtronic 2 relay board for your Mach3 CNC project

https://info.kmtronic.com/how-to-connect-kmtronic-2-relay-board-to-your-mach3-cnc-project.html

 

How to control KMtronic USB relays from Mach3

https://info.kmtronic.com/mach3-and-kmtronic-usb-relays.html

 

KMtronic USB relays & Mach3 - step by step

https://info.kmtronic.com/kmtronic-usb-relays-from-mach3-step-by-step.html

 

 

 

 

Page 30 of 33