Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Howto Readout usb-ftdi-ttl-232-cable


  • Please log in to reply
12 replies to this topic

#1 Ellen

Ellen

    Advanced Member

  • Members
  • PipPipPip
  • 65 posts
  • LocationRotterdam, Netherlands

Posted 01 September 2012 - 09:10 AM

Hello, My newest project "smart monitoring", and before I buy again the wrong things i do more homework: I have a technical question and am looking for the very best solution. We want to readout a rs232 signal from a electric "smart" home meter. Can I connect a cable like this directly into the USB of the N+?, and if so how to approach this USB connection? http://www.adafruit....ng-immediately/ Or must I use a breakoutboard like this one, is this the best solution.? https://www.sparkfun.com/products/9716 I'm curious Ellen

#2 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 01 September 2012 - 09:37 AM

I have a technical question and am looking for the very best solution.
We want to readout a rs232 signal from a electric "smart" home meter.

Can I connect a cable like this directly into the USB of the N+?, and if so how to approach this USB connection?

http://www.adafruit....ng-immediately/

Or must I use a breakoutboard like this one, is this the best solution.?
https://www.sparkfun.com/products/9716

I'm curious



I would not even consider connecting the output from the meter to the USB on the N+. I would put together a MAX232 circuit and connect the meter to the MAX232 and the MAX232 to one of the N+ serial ports.

The MAX232 circuit only needs the chip and a few capacitors (5 I think) and the circuit you will need it in the datasheet for the chip. I've put one of these together in the past and it takes a few minutes on breadboard. You might also have to take the logic levels into consideration as the N+ can tolerate 5V input but only allows 3.3V output.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#3 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 01 September 2012 - 06:36 PM

Hi Ellen, Here is a USB to Rs232 adapter, http://www.mdfly.com...products_id=756 and a very inexpensive USB to TTL module, http://www.mdfly.com...products_id=485 I have ordered several USB-TTL modules and Bluetooth serial modules from MDFLY and I am very satisfied with them. Baxter

#4 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 01 September 2012 - 07:34 PM

Can I connect a cable like this directly into the USB of the N+?, and if so how to approach this USB connection?



Here is a USB to Rs232 adapter,


These two things are very different....

Unless I'misunderstood, the question is can I connect from RS-232 to the N+ using USB on the N+.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#5 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 02 September 2012 - 05:16 AM

Sorry about my irrelevant response, Mark. I misread the question. Anyway, MDFLY has good prices on Prolific PL2303 USB to serial adapters ($5). Baxter

#6 Ellen

Ellen

    Advanced Member

  • Members
  • PipPipPip
  • 65 posts
  • LocationRotterdam, Netherlands

Posted 02 September 2012 - 03:47 PM

If it was that simpel, but that is not. I need to invert the signal, and i can with a 7404 ttl inverter chip. Thats what the cable also does. (signals RTS en RxD) Price of the cable 23 euro vs the 7404 chip 44 cents. The project must be low budget. Ellen

#7 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 02 September 2012 - 07:59 PM

It is unclear what you are connecting. If your smart meter has an RS232 output then you need an atapter to convert the RS232 signal levels to TTL as Mark said. You can buy these cheap on eBay (<$3), http://www.ebay.com/...?_nkw=rs232 ttl Forget the USB and directly connect the TTL output of the adapter to D0,D1 on the Netduino. Netduino uses true serial logic. If for some reason you need inverted logic on your smart meter, use a 74HC14 Hex inverting Schmitt trigger rather than a 7404. This chip provides a sharply defined output signal in a mixed 3.3 V and 5 V environment and for this purpose is better than the 7404. For a smaller 2 gate version look at the 74LVC2G14. Netduino UART --> <--(if needed INVERTER) --> <-- RS-232 Adapter --> <-- Smart Meter Baxter

#8 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 05 September 2012 - 02:23 PM

You may want an opto isolator as well between the inverter and the rs232 adapter, a simple circuit using a MAX232 and an opto should be suffcient as the MAX232 should take care of the inversion and level adjustment for you. The opto is to protect the max232 and ND in case of voltage spikes etc, they cost next to nothing i.e. you should easily be able to get 2 4N36 opto's for < €0.5, virtually any serial or parallel connection should be opto isolated if you are interfacing from one device to another, to protect either device from damage.

I would look to build a circuit like this:

ND_UART<-->MAX232<-->4N36<-->smart meter

Nak.

#9 Ellen

Ellen

    Advanced Member

  • Members
  • PipPipPip
  • 65 posts
  • LocationRotterdam, Netherlands

Posted 06 September 2012 - 07:59 AM


I would look to build a circuit like this:

ND_UART<-->MAX232<-->4N36<-->smart meter

Nak.

Thank you Nak, Baxter...for your clear explanation.
Please can you offer me a link where to buy?.
This is not for myself but for my father (who can not read/write English) and my friend who does .....nothing. :P We will post a diagram here before we connect. I do not want to blow up the meter. :lol:
Ellen

#10 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 06 September 2012 - 09:49 AM

Thank you Nak, Baxter...for your clear explanation.
Please can you offer me a link where to buy?.
This is not for myself but for my father (who can not read/write English) and my friend who does .....nothing. :P We will post a diagram here before we connect. I do not want to blow up the meter. :lol:
Ellen


Hi Ellen

Maxim actually make a chip designed to drive opto isolaters, the MAX250 the datasheet is here (PDF)

RS stocks them here: http://uk.rs-online....=max250&x=0&y=0

However you may want to request a free sample from Maxim, they offer the 14pin DIP package for sample/evaluation here http://www.maximinte...vp/id/1310/t/or the model you want is the MAX250CPD+ you need to register for a free account but other than the occasional marketing email thats the only catch...

As for the opto isolaters them selves i have used 4N34,4N35 and 4N36's in the past, as you stated cost is a deciding factor RS stocks 4N35's available in single quantities here the rest are usually in bags of 10 or 20 here. There may be better component suppliers for main land europe, but RS and Farnell both offer Dutch versions of their websites if that helps...
http://nl.rs-online....rm=4N35&x=0&y=0


Nak.

#11 Ellen

Ellen

    Advanced Member

  • Members
  • PipPipPip
  • 65 posts
  • LocationRotterdam, Netherlands

Posted 09 September 2012 - 09:15 AM

Thanks Nak.

But the most simple Arduino can do the job without any additional hardware...

SoftwareSerial Library

The SoftwareSerial library has been developed to allow serial communication on other digital pins of the Arduino, using software to replicate the functionality (hence the name "SoftwareSerial"). It is possible to have multiple software serial ports with speeds up to 115200 bps. A parameter enables inverted signaling for devices which require that protocol.


SoftwareSerial myOwnSerial(10, 11, true); // RX, TX, inverted

http://arduino.cc/en.../SoftwareSerial

So about serial communication, am I a little disappointed in the netduino.

#12 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 09 September 2012 - 10:20 AM

hi ellen Software is not the issue here both uarts on the nd work well, the additionalhardware is for protection of your nd as if the serial port you are connecting to uses rs232levels then you will damage/destroy your nd with 12v voltages on the input the max232 converts the voltage levels to ones that are safe for the nd to use (this is equally true of arduinos or any other dev board) whilst the optos are an industry standard way of isolating digital circuits from higher voltages than they can handle. No software can protect you from overvoltage conditions. As for a softserial implementation I can't say I would recomend it over dedicated hardware Nak.

#13 Ellen

Ellen

    Advanced Member

  • Members
  • PipPipPip
  • 65 posts
  • LocationRotterdam, Netherlands

Posted 25 September 2012 - 02:17 PM

Nak, Besides the problem of the voltage (the device = 3.3v), is there any chance to invert the signaling for devices which require that protocol without additional hardware, like an Arduino?. Ellen




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.