Hacking Openpicus usb-to-serial converter

Usb to serial converter hackingGeeks usu­ally have, in their DIY bags, many usb-to-serial con­vert­ers such as Arduino’s or Open­picus’. These con­vert­ers, for the peo­ple not accus­tomed to micro­con­trollers’ world, are cir­cuits nor­mally used for upload­ing com­piled code from the PC. Addi­tion­ally, they are used to seri­ally com­mu­ni­cate with the PC. They take usb sig­nal and con­vert it to ser­ial TTL.

Even though ser­ial TTL is very impor­tant when com­mu­ni­cat­ing with micro­con­trollers, many home and indus­trial devices exchange data using RS485 pro­to­col. The main ben­e­fits of using RS485 are basi­cally effi­ciency, econ­omy, the long dis­tances allowed between devices (up to 1200 meters) in elec­tri­cally noisy environments.

The con­vert­ers pre­sented above are not com­pat­i­ble with the RS485 pro­to­col and com­mu­ni­ca­tion can not be per­formed. Because of that, the out­put sig­nal of the con­verter needs to be fur­ther mod­i­fied to com­ply with the 485 stan­dard. This is usu­ally done by using for instance the Maxim’s MAX485 chip (or even­tu­ally the cheaper one like for instance 75176). Indeed, since the RS485 is a half-duplex pro­to­col, it does not allow send­ing and receiv­ing data at the same time. This is nor­mally accom­plished by using MAX485’s TX and RX enable pins (specif­i­cally the RE* and DE pins on the chip).

In this post we want to present a sim­ple hack­ing pro­ce­dure in order to use an exist­ing usb-to-serial con­verter to com­mu­ni­cate with a device over RS485. The only three ingre­di­ents needed are the following:

  • a begin­ner sol­der­ing experience,
  • a max485, or equiv­a­lent chip,
  • a usb-to-serial con­verter (for our exper­i­ments, we used the Open­Picus’ usb ser­ial converter)
Hacking Openpicus usb to serial converter

Hack­ing Open­picus usb to ser­ial converter

The key point here is to use the CBUS2 pin of the FT232RL chip that is nor­mally shipped within the usb-to-serial con­verter but it is not usu­ally con­nected to the main board. Because of that, it is nec­es­sary to sol­der the pin (located to the bot­tom left of the chip, pin #13) to a wire. Essen­tially, this pin goes to 5v as soon as the chip receives data to send and goes back to 0v when send­ing buffer is empty. The wire con­nected to CBUS2 pin will be used basi­cally to enable the MAX485’s TX pin. Even though in the FT232R datasheet, there exist an alter­na­tive solu­tion that use both CBUS2 and CBUS3 pins to obtain an usb-to-rs485 con­verter, with MAX485 only one pin is nec­es­sary. The wire will be con­nected both to MAX485’s RE* and DE pins (see fig­ure below) such that when FT232R is pro­cess­ing TX data, the RX chan­nel will be auto­mat­i­cally disabled.

Openpicus hack Schematic

Open­picus hack Schematic

The pro­ce­dure explained in this post gives a gen­eral idea of how sim­ply and cheaply expands a con­ven­tional usb-to-serial con­verter in order to com­mu­ni­cate over RS485. Although RS485 is well known mainly in indus­trial con­text, it rep­re­sents a very inter­est­ing and cost-effective oppor­tu­nity in other con­texts such as in home automation.