Visual Basic GUI / Arduino Control serial connect

Hello -

I’m somewhat new to the Arduino Diec. - been using it for 3 months. I’ve read some of the board postings on the issue of the automatic reset via the DTR that occurs when opening and closing a serial port as well as some of the issues with noise induction closing the port early.

I’ve developed a product that will be operating underwater for some time and thus I can’t regularly access it to hit the reset switch when the port is tripped over. I however have a hardline attached to it in order to gather data and issue commands. I was wondering if anyone has any source code that I can use that will help with this problem.

My process involves these steps from initial setup: 1.) I connect via serial connection using MS VB.NET Express 2008 to the arduino 2.) manually hit the reset button to get the program to execute. 3.) seal my device and submerge 4.) send it a command via my VB GUI 5.) arduino responds back with an action.

The process then continues looping between steps 4. & 5. until the connection is closed.

I would like to eliminate the 2nd step and be able to reopen the connection and reset the board in software. Is this possible? Can anyone help?

the reset switch is simply pulling one of the Atmega168 pins low (or is it high ? suddently cant remember) so i believe it would be possible to use another digital pin to trigger something like a transistor or a 4066 / 4016 switch ic to connect the reset pin to ground (or 5V. if it should be high to reset the board)

Maybe there’s an even simpler solution ?

You should be able to do this in VB by setting DtrEnable to true before opening your port. Keep in mind with this setting your board will reset each time you open a new connection.

thanks, i found the dtrenable function, but it doesn’t solve my problem either as True or False. I’m still searching for a solution.

Are you saying the board did not reset when you opened a connection with dtrenable set to true? If not does the board reset when you start the serial monitor in the IDE? Can you upload sketches without hitting the reset button?

My fault. I have two declarations for open port, one inside my comms form and another on my user control form. I only changed the user control form that was a backup. It works fine with the : _port.DtrEnable = True

many thanks!

Not a problem! Glad it worked out for you.