The project described in this article shows how to realize an hardware able to drive up to 6 relays,
to control up to 24 input status and to measure a temperature value using wireless Bluetooth technology.
The proposed system uses the Serial - Blue tooth converter UARTDNG200 and the IN/OUT expander board
SX16B in Stand Alone mode.
In this article we will see how to connect a Serial/Bluetooth converter UARTDNG200 to the IN/OUT expander
board SX16B in Stand Alone mode, in order to realize an hardware that can be driven by a PC,
or a PDA or a mobile phone all equipped with Bluetooth technology.
IN/OUT expander board SX16B in Stand Alone mode (SX16B - IN/OUT expansion board) is able to:
Control up to 6 loads (such as lamps or small electronic equipment with a power consumption of 5A),
monitor up to 24 input lines (8 of them are opto-coupled) and measure the temperature.
In this case, Stand Alone version is equipped with a programmed PIC that receives and sends command
through the serial port, drives the relays and monitors the input status.
The UARTDNG200 module (Bluethoot to Serial converter UARTDNG200 OEM) is a Class 1 Bluetooth/Serial converter and RoHS compliant,
able to communicate with a remote device up to 100m far (this coverage may be achieved in ideal condition
and with a same class remote device) and it is equipped with a serial interface supporting the most
common electronic voltage level: 3.3V, 5V (TTL) and RS232.
Hardware and electrical wiring
In order to realize our hardware, connections are few: in fact the two boards
needs to be linked together only with four wires, as you can see in the following image.
SX16B - CONNECTOR |
UARTDNG200 - CONNECTOR |
SIGNAL |
U10 PIN 5 |
PIN 12 |
TXD |
U10 PIN 6 |
PIN 8 |
RXD |
U10 PIN 8 |
PIN 5 |
VCC |
U10 PIN 9 |
PIN 1 |
GND |
|
PIN 2 with PIN 10 |
RTS - CTS |
SX16B board in Stand Alone mode differs from base version because it is equipped also with the
12V power supply section that will be used also to feed Bluetooth/Serial converter.
Moreover the micro PIC may be provided already programmed rather to be programmed
(the firmware to be upload in PIC memory is available in this article Download section).
Serial/Bluetooh converter configuration
The only configurations needed by our system must be performed on UARTDNG200 module
using the RS232BTEIKON tool for Windows machine and available in this article Download section.
To use RS232BTEIKON tool, you need to connect UARTDNG200 converter straight to the serial port
of the PC where it is installed.
In the following image, the wiring schematic to connect UARTDNG200 module to the PC is shown.
Once performed the connection to the PC and before powering on the module, you need to launch the configuration utility.
Then power on the moduel and click on Connect button within 2 seconds. In fact this is the time the module wait
for a command at the start up, before switching to operating mode.
To realize this system, we have to: configure the device and pin code (these values may be freely chosen),
select the item "Discoverable Slave", unselect the item "Master"
and set serial port parameters to 19200 Baud rate 1 stop bit no parity.
To save the new configuration, click on button "WRITE settings to module"
and then on button "Reset module and exit" to make changes effective.
Collegare un PC al nodo SX16-Bluetooth
To connect this hardware to a PC, this one must have a Bluetooth interface.
If it is not the case, Bluetooth interface, even CLASS 1 (100m range),
with USB connector are widely spread on the market.
Starting Bluetooh device search with the appropriate PC tool
(this one may change according to the installed Bluetooth device driver),
after few moments we will discover an icon with the name previously assigned
to the UARTDNG200 module.
Clicking on the icon and before showing device services, we will be asked to enter pairing
code previously configured in the device memory (e.g. 1234).
Once completed pairing authentication procedure, the SPP (Serial Profile Port) service provide
by the device will be shown.
Clicking on the icon representing SPP service Bluetooth, connection toward the module will start
and the Operating System will assign it a serial port (e.g. COM6) to be used for commnincation with
the device connected to UARTDNG200.
From this moment on we can consider the link between SX16 board and the PC as a "virtual" serial cable
and so we can use the Tool PC2SX16 (available in this article download section) to send commands to
Area SX Input/Output device.
Of course it is possible to develop application also for other devices such as PDAs or mobile phones
equipped with serial interface and software capabilities to interact with common serial ports.
Distance coverage for sending commands to SX16 may differ according to the class of the Bluetooth
device on board of mobile phone, PDA or PC. Usually mobile phones and PDA are equipped with CLASS 10
Bluetooth devices that covers distance up to a meter, on PC you may find CLASS 1 Bluetooth devices
allowing to send commands on distance up to 100 meters.
Available Download
Datasheet: uartdng200.pdf
User Manual: appuartdng200.pdf
Firmware SX16: PIC_SX16.zip
Configuration Software: RS232-BT_setup.zip
Source: PC2SX16_Setup.zip
Program: PC2SX16_sorgente_VB.zip
Segnala questo articolo:
Tags: - BlueTooth - Domotica - Telecontrollo -
|