Please help solve a "mystery"

I am at my wits end;

I cannot find the problem with my Arduino device! I have a device that turns on a light and a small stepper motor every 10 min. I have been using it for a year with no problems. I decided to add a feature that involves turning “on” pin seven and then throwing a switch to run the pin to ground or “off”. The device with my alteration works great, as long as I have the pro mini plugged in to my lap top, the device stops working the instant I disconnect from the computer.

What in the world is going on? I turn “on” the seventh pin with a command in “setup” and turn it “off” via a switch to ground. Other than the one change everything else is as it has been for a year. I am using the pro mini @3.3VDC, powered by two 3400 ma lithium ion 16850B cells in parallel for 3.7 to 4.2 volts into the “raw” pin on the mini. The device will draw 110 ma in stand by and 560 ma while running the motor and light. Thanks in advance for any and all help or suggestions you may have.

Marcos “elalto”

What does pin 7 do? From your description you’re shorting it to ground.

Hi,

Post your sketch (using code tags), and highlight, with comments, the recently added lines of code. Also post a schematic of how this is wired up. A hand drawn schematic, scanned or photographed, is fine.

Please clarify what you mean by

I turn "on" the seventh pin with a command in "setup" and turn it "off" via a switch to ground

. An Arduino pin cannot be both an input and an output at the same time. If it is an output and you connect it via a switch to ground, you will cause a short circuit which could damage the Arduino.

Paul

elalto: I am at my wits end;

I cannot find the problem with my Arduino device! I have a device that turns on a light and a small stepper motor every 10 min. I have been using it for a year with no problems. I decided to add a feature that involves turning “on” pin seven and then throwing a switch to run the pin to ground or “off”. The device with my alteration works great, as long as I have the pro mini plugged in to my lap top, the device stops working the instant I disconnect from the computer.

What in the world is going on? I turn “on” the seventh pin with a command in “setup” and turn it “off” via a switch to ground. Other than the one change everything else is as it has been for a year. I am using the pro mini @3.3VDC, powered by two 3400 ma lithium ion 16850B cells in parallel for 3.7 to 4.2 volts into the “raw” pin on the mini. The device will draw 110 ma in stand by and 560 ma while running the motor and light. Thanks in advance for any and all help or suggestions you may have.

Marcos “elalto”

You should not be pulling more than about 200 mA through that board. The motor and lights should have external power (from the same battery is okay, just not through the board) that the board controls through small current to some device like a transistor or driver chip.

If you want to safely ground pin 7 through a switch then use pinMode( 7, INPUT_PULLUP ) then watch for pin 7 to go low = switch pressed. As now whatever you do seems to drag the voltage down to brown out.

elalto:
I am using the pro mini @3.3VDC, powered by two 3400 ma lithium ion 16850B cells in parallel for 3.7 to 4.2 volts into the “raw” pin on the mini.

There’s your problem.

Connect the batteries to the VCC pin. Promini will work just fine at 3.3V with the higher voltage. Do the motor & lights need 3.3V? Probably not.

Thank you all for your responses, I have found and corrected the problem.

While preparing a circuit diagram from my PCB to post, I noticed that I had an incorrect connection. I cut the trace and everything started to work as designed!

While I was at it, I changed my pin 7 to an output connected to nothing and deleted the switch. Now I just write it HIGH or LOW and the "read" returns a "1" or "0" changing the program accordingly.

The device runs great with the two batteries as I run the light and motor direct from the batteries and not through the pro mini. The power to the light and motor driver go through a FET so that they draw current only when activated (runs for 4 min. every 14 min.). The device will run all night and is charged by a Solar Panel during the day.

Once again, thanks to all who responded.

Marcos (elalto)