Hello All,
Long time listener, first time poster ![]()
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!