Go Down

Topic: Serial communication in first standalone project (Read 1 time) previous topic - next topic

I'm new to the Arduino world and am planning my first standalone project and am wondering how I can most cheaply enable serial communication with a desktop computer.  An FTDI board is out of my price range since I am a grad student and will be giving the end result to my fellow students without charge.

Background and Goal:
My university research lab has an electronic door lock.  Right now, we have a bypass for the lock connected to a push button on one of our desks so that we don't have to drop what we are doing and walk to the door to let visitors in.  Pushing the button closes one of the lock's circuits causing it to unlock.  This is great, but we would like to allow any staff in the lab to unlock the door from their workstation (in case no one is near the button).  I've figured out how to do this using a simple circuit in which a TIP122 NPN transistor closes the lock circuit.

The Problem:
The standalone Atmega328p will need to receive a signal from a PC telling it to raise the pin connected to the TIP122 base to high.  I was planning on following the tutorial for converting a Nokia USB cable (http://www.uchobby.com/index.php/2009/10/04/diy-usb-to-serial-cable-for-3/) for serial communication until I saw that it can only handle 100mA.  The TIP122 datasheet says it can draw 120mA on the base, so this is not an option. 

Are there any other well-known ways of doing cheap (less than $5-$10) PC communication?  Can I use a basic USB to RS232 adapter like this one http://www.ebay.com/itm/3Ft-Translucent-USB-2-0-DB9-RS232-Serial-Converter-Adapter-Cable-3-Feet-/140662645519?pt=LH_DefaultDomain_0&hash=item20c025a30f#ht_2053wt_1392?

Any advice will be greatly appreciated!

winner10920

Just because it can draw 120ma doesn't mean it should or that you have to let it, you should be adding a resistor anyway to limit the current
an arduino pin shouldnot be driven past 30ma anyway,  which enough to trigger a tip 122
mind you the ardunio itself draws about 40ma so you need to add that in there,
and the cheapest I've seen is on ebay so check that out for cables

Thanks.  In that case, does adding a resistor (and probably a fuse) seem like it would be a suitable solution?  I imagine  I should do that regardless of what solution I come across.

Graynomad

You can use any USB-serial cable I would think. That one has RS232 voltage levels so you would have to deal with that. Otherwise get a standard FTDI cable that has 5v levels.

Another option is to do a stand-alone version of the new Leonardo Arduino, all that will need is a USB cable.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Thanks,  I've been thinking about the voltage issue.  I think that what I may do is get a USB to RS232 cable, open it up near the RS232 end, and splice out the USB +5v and ground wires to a JST connector so that I can use them to power the Arduino and TIP122.  My understanding is that the 3.3v the RS232 provides to the data wires will be sufficient for the RX and TX data lines even though it's not enough to power the Arduino or transistor.  Does that sound right?

zoomkat

It has been my experience with some of the cheap ebay USB to serial adapters is that they just use 0v-5v and not the spec -12v-+12v.
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

Graynomad

Quote
I think that what I may do is get a USB to RS232 cable, open it up near the RS232 end, and splice out the USB +5v and ground wires to a JST connector

So why not just buy an FTDI cable, that's all done and they have a proper 5v supply.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

The main reason I haven't just bought an FTDI cable for this is my budget.  I will be donating a couple of these to my colleagues in my lab at school and I am currently on a grad student's income.  The cheapest FTDI cables I have seen are about $15, but these cheap USB to RS232 cables are about $3 shipped.

Graynomad

He he, sorry, I'm retired and not exactly flush but I'd forgotten what it's like to be that short of cash, it's been a while :)

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

marklar

Is the idea here to create a connection from each computer to the unlock mechanism? If so and the computers are on a network, you may consider an Ethernet shield or computer with web server.

zoomkat

Quote
but these cheap USB to RS232 cables are about $3 shipped.


So order one.  :smiley-roll-blue:
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

I guess I will give one of the cheap ones a shot and see what voltage it's using.  Maybe I'll luck out, or can at least use it for something else.


Is the idea here to create a connection from each computer to the unlock mechanism? If so and the computers are on a network, you may consider an Ethernet shield or computer with web server.


What I plan to do is have a single arduino in the room (or possibly each room) connected to one of the computers which will run a simple server that will authenticate connections from other computers in the room.  That server will then be the one that sends the signal over a serial connection to unlatch the door.

zoomkat

All things considered you might want to consider an RF setup like below.

http://www.electronickits.com/remote_control/rf2.htm
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

retrolefty

#14
Dec 22, 2011, 03:25 pm Last Edit: Dec 22, 2011, 03:28 pm by retrolefty Reason: 1

The main reason I haven't just bought an FTDI cable for this is my budget.  I will be donating a couple of these to my colleagues in my lab at school and I am currently on a grad student's income.  The cheapest FTDI cables I have seen are about $15, but these cheap USB to RS232 cables are about $3 shipped.


I've used several of the below USB to TTL voltage serial converter cable/modules and they work fine with the Arduino IDE with only a slight mod. Just wire a .1 mfd cap from the DTR pad to the base of the reset pin on the output connector. Then turn the board over and cut the trace that is going to the reset pin. That makes the arduino auto-reset function work and everything functions just fine, and you can't complain about the price.  ;) If you don't require the auto-reset function then no mod at all is reqired.

http://www.ebay.com/itm/USB-2-0-UART-TTL-6PIN-Module-Serial-Converter-CP2102-/370532286388?pt=PCC_Drives_Storage_Internal&hash=item564571ffb4

Lefty

Go Up