C# "Client" Serial Port Problem

Hello All,

Long time listener, first time poster :slight_smile:

Anyways, I am relatively new with the Arduino and I am having an issue interfacing my C# program with the Arduino. First I will tell you what I am trying to do. I am working on a project that will use an Arduino to read from a couple of different sensors and log the data onto an SD card. The Arduino and SD card will be in a box with a USB port on the side. The sensors will attach to the box using some connector I haven't thought of yet. The box with the Arduino and SD card will be sitting quietly away for some time just logging data. I have gotten all this working so far.

Now is the tricky part. I want to be able to walk up to the box and plug in a USB cable to the port and "connect" to the Arduino using my C# program. The program will have 2 functions. The first is that the program will be able to download the data on the SD card onto the computer and at the same time, delete all old data from the SD card (this sounds tricky to me, but I think I can figure this out). The second function will be to go "online" with the Arduino and actively see what the sensors are reading. The C# program will send commands to the Arduino telling it to read the sensors and send the data to the C# program through the serial port.

Here is where my problem is. I have the Arduino running off an AC adapter logging data and reading sensors and everything is fine and dandy. When I go to plug the USB cable into the Arduino to start communicating to it from the C# program via serial, the Arduino resets itself and I am not able to create a connection through serial. So its seems like my plan of having the Arduino as a block box that I can connect my C# program as a "client" to, isn't going to work.

So, finally, here is my question. Does anyone know how to set up the Arduino so that it can run off an external power supply and also communicate through the Serial Port?

Sorry I got so wordy, and thanks for the help!

I don't think this has anything to do with the external powersupply.

Arduino's just reset when you open a serial connection to them.

There's way to deal with it, but i can't remember what to do.

Try searching the forum for reset + serial, you should find it

If you are logging data to the SD card, why does the reset cause problems? As MikMo says, it can be eliminated, but at a cost - the auto reset for programming purposes is what is eliminated.

Thanks for the info.

I did do some searching, probably something I should have done first :-), and I found a thread where someone ran a jumper from power to the reset pin of the uC. This allowed that person to make a serial connection without reseting the uC.

I also found that the Seeeduino makes an arduino clone that has jumpers that allow you to diable the auto-reset feature.

I am gonna try using a Seeeduino and see where I get. If that doesn't work, I am going to try and use some XBee modules to get the desired functionality. They are more $$$, but you also get the bonus feature of wireless.

Thanks again!

bamehrin:
Thanks for the info.

I did do some searching, probably something I should have done first :-), and I found a thread where someone ran a jumper from power to the reset pin of the uC. This allowed that person to make a serial connection without reseting the uC.

Wiring a resistor or cap to the reset pin is the usual method to defeat auto reset. Wiring direct to +5vdc would cause a short circuit if you ever pressed the manual reset switch.

I also found that the Seeeduino makes an arduino clone that has jumpers that allow you to diable the auto-reset feature.

The present Seeeduino boards have a two position manual switch to enable or disable the auto-reset function, at least mine does.

I am gonna try using a Seeeduino and see where I get. If that doesn't work, I am going to try and use some XBee modules to get the desired functionality. They are more $$$, but you also get the bonus feature of wireless.

I really like the Seeduino board designs. Good luck with your project.

Thanks again!

retrolefty:

bamehrin:
This allowed that person to make a serial connection without reseting the uC.

Wiring a resistor or cap to the reset pin is the usual method to defeat auto reset. Wiring direct to +5vdc would cause a short circuit if you ever pressed the manual reset switch.

Thanks again!

More details please :slight_smile:
Value of resistor ? etc