Circuit design question for input pin...

The project I have is a bit confusing to explain but here is what I am trying to accomplish:

I have an existing pcb from an old toy that has a logic/cpu portion and a higher (6v I think) driver circuit to control a small motor when it’s instructed to. To put it simply, what I want to do is remove the motor from the circuit and instead have that circuit connected to an Arduino input pin, and have the Arduino turn the motor on and off accordingly with an opto-isolated mechanical relay and an independent power source.

First off, assuming it’s a 6v circuit powering the motor (current rating unknown), what is the safest way to hook this up to an Arduino input pin?

Second, in the scenario above, what would change if it was a 12v circuit instead of 6v (current rating unknown), and how do you figure this out?

Lastly, I want to do this with putting almost no load on the toy pcb driver circuit that originally controlled the motor, essentially turning the driver circuit into a logic circuit. Assume the board is old, rare, proprietary and irreplaceable and you want to do everything possible to relieve it from any high voltage/current applications.

[u]Here are some protection circuits[/u] that can protect your Arduino from voltages greater than +5V and/or negative voltages.

Second, in the scenario above, what would change if it was a 12v circuit instead of 6v (current rating unknown), and how do you figure this out?

As long as "logic low" is near zero volts, the same protection circuit would work.

Lastly, I want to do this with putting almost no load on the toy pcb driver circuit that originally controlled the motor, essentially turning the driver circuit into a logic circuit. Assume the board is old, rare, proprietary and irreplaceable and you want to do everything possible to relieve it from any high voltage/current applications.

You may be able to simply disconnect the motor. But, there's a possibility that you'll need pull-up or pull-down resistor in place of the motor. Something like a 1K resistor should work and it won't draw much current.

An Arduino input draws essentially no current (as long as you don't exceed 5V).

I would replace the motor with the LED of an opto isolator and resistor. Then feed the transistor output of the opto into an input and enable the internal pull ups.

The change from 6 to 12 V would then make little difference apart from doubling the current but then you can always double the current limiting resistor.

moses1592 said two times that moses1592 wants to control a motor (or 6 volt motor circuit) using an Arduino input pin.

An output pin is used for control, not an input pin.

One time could have been a typo. Two times suggests confusion and perhaps an incorrect program.

Post a decently taken photo of the board you're interfacing with too - we're groping around in the dark right now.

vaj4088:
moses1592 said two times that moses1592 wants to control a motor (or 6 volt motor circuit) using an Arduino input pin.

An output pin is used for control, not an input pin.

One time could have been a typo. Two times suggests confusion and perhaps an incorrect program.

I think you completely misunderstood what I said here. Please reread my original post very closely. I apologize for any ambiguity but I thought I was pretty clear. I am fully aware of what input and output defined pins are. I want to safely connect a circuit that was formerly a driver circuit for a motor to an INPUT on an arduino such that the arduino 'knows' that the other pcb is attempting to power the motor. Then I want to have the arduino, via an OUTPUT pin, control a relay to power said motor with an external power source.

Here is a picture of the pcb but its really not going to tell you anything. Its a proprietary board. The 2-pin JST connector on the bottom left of the pcb with red/black wires connected to it are where the motor is currently connected to the board. I want to connect the circuit from these wires to an arduino input INSTEAD of the motor, then have the arduino detect when the motor should be spinning. Then, via an output pin and relay, spin the motor with external power.

moses1592 wrote (in part):

I want to safely connect a circuit that was formerly a driver circuit for a motor to an INPUT on an arduino such that the arduino ‘knows’ that the other pcb is attempting to power the motor. Then I want to have the arduino, via an OUTPUT pin, control a relay to power said motor with an external power source.

Thanks, that is not what I understood previously at all. NOW I get it!

The input side should be easy if you can just tell us what the voltage is when the motor is off and when the motor is on.

The output side is harder but can be handled with a relay using a transistor or an appropriate shield. In fact, you might not need the relay, just the transistor or a motor shield. We need to know more about the relay. Knowing more about the motor (like rated voltage and current under load) would be useful as well.

Good Luck!

Thanks,

I'm not too concerned about the output relay and motor. It is a small motor like the type you'd see in a toy store RC car that takes AA batteries. I am going to use one of those pre built 1-channel arduino opto/relay boards that are all over ebay. I've used them before with success. My main concern is how to connect the motor driver circuit to the arduino input without overloading it. The driver circuit is zero volts when the motor is off. I have to check and see if it is 6 or 12 volts though when on.

Would it be alright to simply connect another 6 or 12 volt relay (depending on driver voltage which I will find out soon) to the driver circuit (instead of the motor), so when the relay is activated it simply acts as a button press for an input pin on the arduino? am I missing something critical here that could potentially short or damage the pcb and/or adruino by doing this?

moses1592:
Would it be alright to simply connect another 6 or 12 volt relay (depending on driver voltage which I will find out soon) to the driver circuit (instead of the motor), so when the relay is activated it simply acts as a button press for an input pin on the arduino? am I missing something critical here that could potentially short or damage the pcb and/or adruino by doing this?

Yes it would be alright. Something that was set up to drive a motor will drive a relay just fine. Unless it was an absolutely tiny motor, it should have enough output current to drive most any relay.

Alternatives would be to use an optocoupler, which provides the same isolation as a relay (thousands of volts) but it does require that you know the correct polarity and it needs a resistor to limit current through the LED side of the optocoupler. Or you could just connect it directly to the Arduino with a resistor like 1K or 2K. Even with 12V, that won't hurt the Arduino. But you do need to connect the ground, which means there's no isolation. This may be a good thing, if you're powering the Arduino from the power supply.

Woah - that's a considerably nicer PCB than I had in mind.

I would trace out the circuit around the mosfets that I wanted to replace with my own driver circuit to find the signal coming off the chip. If it runs at 5v logic levels or less, you could connect that direct to the arduino - otherwise, you could connect it through a suitable series resistor (10k is good).

Also, wait, that says "Pinball" on it. It's clearly not for a full machine, but it looks better than what I'd expect in a toy pin. Is that from a Zizzle pin? Think twice before you hack it up - those things are worth a few hundred to pinheads, and spare parts are like hens teeth.

Hi,
Question, does the circuit control the speed of the motor or just turn it ON and OFF?

If just ON and OFF then the relay solution will be fine.

Thanks.. Tom.. :slight_smile:

just on and off. no speed control.