Pages: [1] 2   Go Down
Author Topic: [SOLVED?] Switching power source on/off with Arduino  (Read 979 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't know why i can't come up with an answer for this, I feel like an idiot.

I have a 12 servo biped that has two power sources.
A 9v battery for logic on both an SSC-32 Servo Controller, and an Arduino ADK.
There is also a rechargeable 6v 16mah battery pack connected to the SSC-32 for servo power.

Currently this is what I have to do to get it to start:

   If programming:
   Connect USB cable to Arduino, power is spliced to SSC-32 as well.
   Flip physical on/off switch to on for servo pack

     If Autonomous:
     Hook up 9V manually, power goes to SSC-32 as well
     Flip physical on/off switch to on for servo pack

Major(Minor) issues
If the servos are turned on before the logic (I've asked this question before but never found an answer) the servos behave violently and randomly.
If USB is plugged in while 9v connected, COM abilities lost, a computer reboot and Arduino shut down required to regain communication

I'm hoping that someone can give me an idea on how to replace the physical mechanical switch, with something the Arduino can control when it receives power. I don't want to buy anything as I am hoping that I can just DIY it really quickly.

I only have one IRF510 MOSFET left, plenty of 2N3904 Transistors, and any resistor I could need. This has to be enough for a circuit.

Goal: to switch 6v 1.6Amp power source on/off via Arduino

Sorry if I've made this way too complicated, but like I said I just can't think today for some reason.
« Last Edit: May 20, 2013, 06:43:37 pm by SilentDemon555 » Logged

"I want to die peacefully in my sleep like my grandfather, not screaming in terror like his passengers."

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8108
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I only have one MOSFET left, plenty of 2N3904 Transistors, and any resistor I could need. This has to be enough for a circuit.

Goal: to switch 6v 1.6Amp power source on/off via Arduino

The transistors won't be a big help because the datasheet (http://www.fairchildsemi.com/ds/2N/2N3904.pdf) says that they are only rated for 200 mA continuous collector current.

The IRF510 MOSFET won't be of much help either.  The data sheet ( http://www.vishay.com/docs/91015/sihf510.pdf ) shows that if you drive the Gate with only 5V you will only get about 1 Amp through it.  That MOSFET, like most, is designed for 10V on the Gate.  For the Arduino you want what is called a "logic level" MOSFET, designed for a 4.5 to 5V Gate voltage.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Alright, so i have to buy something. Now that i'm buying something, is there something premade, or cheap. The DIY option was if i had the parts, which it looks like I don't, some kind of simple three prong IC? Or will one of these logic level FETs work all by themselves?
Logged

"I want to die peacefully in my sleep like my grandfather, not screaming in terror like his passengers."

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8108
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A logic-level N-Channel MOSFET between the common ground of the servos and the negative side of the 6V battery should do the trick.  Just look for one that can handle at least 10V and at least 3A.  Use a pull-down resistor on the Gate so that the MOSFET stays  OFF when the Arduino is disconnected, turned off, or reset.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Any recommendations on FETS?


How many ohms should the pull down be, 10k? In the future how do I calculate a pull down?
and is this attached picture what you meant?


* Untitled.png (99.81 KB, 1024x768 - viewed 110 times.)
Logged

"I want to die peacefully in my sleep like my grandfather, not screaming in terror like his passengers."

Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I bought 2 FQP30N06L FETS. Will these do?
Logged

"I want to die peacefully in my sleep like my grandfather, not screaming in terror like his passengers."

SG
Offline Offline
Sr. Member
****
Karma: 7
Posts: 425
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can not use N-Channel MOSFET to control the supply, you need logic level P-Channel MOSFET to control supply.


* Mos-SW.gif (11.99 KB, 545x472 - viewed 95 times.)
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8108
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can not use N-Channel MOSFET to control the supply
The N-channel MOSFET is being used as a low-side switch (between load and Ground).
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8108
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I bought 2 FQP30N06L FETS. Will these do?

Yes.  Those will work much better with a 5V signal to the Gate.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay I have no idea what I did wrong...

I tried to build a low-side FET switch but...

I took the aforementioned MOSFETS I bought and soldered one to a circuit board. I put a resistor from Gate to Source(10K) and I soldered the ends of the mosfet to a wire screw terminal.
 I then took both negative leads(Power from battery is soldered to VCC on Servo controller) the ground from the Servos and the negative from the battery and attached them to the terminals. I took a bread board wire from my Arduino and clamped it in the third GATE terminal.

As soon as the wire touched the gate, the Bipeds leg came and hit me in the face.
I then attached a ground wire from the SSC to the Arduino, same thing.
I don't know why this isn't working... I turned the Arduino on and set the swithpin to HIGH... then LOW... Still not working, power just stays on the the servos... why isn't it working?

Logged

"I want to die peacefully in my sleep like my grandfather, not screaming in terror like his passengers."

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8108
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oops... I had Source and Drain confused in my head.  Reverse them:

http://www.physics.udel.edu/~watson/scen103/mos4.html

Your load (the GND side of your servo controller board) connects to Drain and Source connects to Ground.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Doing that, switching both of the black cables, still makes the servos power up, but this time it's either really weak with a LOW signal from the Arduino, and when HIGH is set, the servos receive seemingly full strength

Oh and the FET gets really hot

I've checked my circuit from crosses... I just don't know anymore... is breadboard wire enough to transfer 6v 1.6A...? i would believe so...

LED, same thing.

I attach the LED low side to the the mosfet with a pull down resistor of 10k. The LED is always on, but gets a little brighter with an Arduino HIGH signal...

I don't know why this always happens to me. I gave up TTL logic because this always happened, the circuits stay on and won't go all the way off.

« Last Edit: May 16, 2013, 10:45:03 pm by SilentDemon555 » Logged

"I want to die peacefully in my sleep like my grandfather, not screaming in terror like his passengers."

Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I rewired a new circuit, the FET now works to turn on and off the LED, but the same problem happens with the Servos...

Here is my drawing to describe what this looks like...

I'm desperately looking for an answer


* Untitled.png (23.11 KB, 956x532 - viewed 59 times.)
Logged

"I want to die peacefully in my sleep like my grandfather, not screaming in terror like his passengers."

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8108
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Take the wire connecting Arduino Ground to MOSFET Drain and move it from Drain to Source.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Take the wire connecting Arduino Ground to MOSFET Drain and move it from Drain to Source.
Done, and same result

I don't understand why the servos power up when either ground or a digital pin are connected to GATE... the gate isn't receiving a HIGH, so it shouldn't transfer power

And once again, a shameless bump.
I can't move forward without fixing this problem, this is crucial right now... Any other hints? What am i doing wrong? May it have something to do with the two connected grounds of different battery sources all kind of smashed together?
« Last Edit: May 19, 2013, 11:09:44 am by SilentDemon555 » Logged

"I want to die peacefully in my sleep like my grandfather, not screaming in terror like his passengers."

Pages: [1] 2   Go Up
Jump to: