Author Topic: MEGA Power Issue  (Read 5599 times)

donaldhwong

  • Jr. Member
  • **
  • Posts: 92
MEGA Power Issue
« on: August 17, 2015, 06:26:26 PM »
I am perplexed. 

When I connect the MEGA using the vcc through USB FTDI adapter, the PWM signals out of digital pins performs well.

When I input the VCC directly from a 12v battery to the VIN pin of MEGA, the PWM signals are weak.

That does not make sense.

HELP!!

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: MEGA Power Issue
« Reply #1 on: August 17, 2015, 08:06:31 PM »
Can you describe "weak"?

donaldhwong

  • Jr. Member
  • **
  • Posts: 92
Re: MEGA Power Issue
« Reply #2 on: August 17, 2015, 08:42:55 PM »
Thank you Felix for being on top of this.

I don't have an oscilloscope. I can only describe the situation.  I use pin  12 and 13 to drive a motor.

It works fine when I hook it up through a FTDI adapter to my notebook.  But once I hooked it up to a 12v battery, the motor wiggles and not moving.  That's what I mean by weak.  Not sure what's going on electronically. 

I hope this is enough information for you to make some sense from it.

Thank you,
Donald

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: MEGA Power Issue
« Reply #3 on: August 17, 2015, 08:45:06 PM »
Are you driving the motor directly from the pins?

donaldhwong

  • Jr. Member
  • **
  • Posts: 92
Re: MEGA Power Issue
« Reply #4 on: August 17, 2015, 10:49:09 PM »
No, I drive the motors through a motor driver.. using analogWrite();

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: MEGA Power Issue
« Reply #5 on: August 18, 2015, 08:02:27 AM »
Is your whole circuit powered from the same 12V source? Can you earth ground everything and see if it's still happening with the 12V source?
Otherwise can you try a 5V source like the FTDI instead of 12V? I'm puzzled how your circuit works with both 5V and 12V. Schematics would help I guess.
Anyway I think you will need to hook this up to a scope and see what's going on. At best we can throw a few best guess answers but that's no way to do engineering.

donaldhwong

  • Jr. Member
  • **
  • Posts: 92
Re: MEGA Power Issue
« Reply #6 on: August 18, 2015, 10:54:55 AM »
You are right, this is no way to do engineering...  :) I am just having fun.

Now I added a 12v to 5v converter in between the battery and the MEGA VIN, using a module from my USB car charger.

It works fine.

Still, it does not answer the question, why a 12v VIN in, does not work.  I also measured the v3.3 terminal during the 12v input, your down converter works.  There is 3.3v from the 12v VIN.

Still quite puzzled.

Attached is the circuit diagram of the motor module.  I tried both the open and close of the K switch.  It made no difference, still not working.  Then I open the K switch, input the MEGA VIN with both 12V and 5V directly from the battery.  The 5V works and the 12V did not.

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: MEGA Power Issue
« Reply #7 on: August 18, 2015, 01:53:13 PM »
Donald,
I suspect that you will find that 'ground' is not 'ground'.  Your motors have ground currents with their power source, presumably the same 12V battery giving you grief on your Moteino. 

As long as those ground currents are kept circulating ONLY to the battery and the signals from the Moteino to the driver board are from a totally different source, then you have no problem. 

Once you supply the Moteino from the same power supply, however, the ground currents have a NEW path to follow AND it is probably along the same wire as the PWM signal returns.  Definitely NOT good...

If you want to supply 12V to the Moteino.  Tap the power to the Moteino from your Motor Driver board, not from your battery, and don't connect the Moteino to anything else.

Tom
« Last Edit: August 18, 2015, 02:41:43 PM by TomWS »

donaldhwong

  • Jr. Member
  • **
  • Posts: 92
Re: MEGA Power Issue
« Reply #8 on: August 18, 2015, 05:38:11 PM »
Hi Tom,

Thank you for your input.  Not clear on your explanation.  Using my attached circuit diagram of my previous post, I connect the PWR & GND of  battery to the motor board.  Connect the PWR & GND of the motor board to the Moteino.  It does not work.

Then Connect the PWR of the battery to VIN of Moteino, it still does not work.  When I added a 12v-to-5V step down inbetween the PWR of battery and VIN of Moteino, it worked.

Based on your explanation, how do you describe the connection using this circuit diagram?  I am sorry, I don't fully understand your explanation.  You seem to say the GND should be separate from the motor board and the Moteino.  Please help.

Thank you,
Donald

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: MEGA Power Issue
« Reply #9 on: August 18, 2015, 07:04:29 PM »
Donald,
a schematic is not sufficient.  A detailed and accurate wiring diagram, or, better yet, a photo of the wiring is required.  A schematic is a 'logical' view, how it's really wired is what is important.

Quote
Then Connect the PWR of the battery to VIN of Moteino, it still does not work.  When I added a 12v-to-5V step down inbetween the PWR of battery and VIN of Moteino, it worked.
What kind of 'step down'?  Maybe you have high voltage spikes on your 12V PWR at the motor board.  If that is the case, perhaps this connection will work:

1. Connect Battery to Motor Board PWR & ground.
2. Connect Moteinto Ground to Motor Board ground but at a Signal input pin, not a PWR input pin.
3. Connect Battery + to Moteino Vin.

Of course, if the Step Down ALREADY works, can you use this?
Can you post a link to detalis about your motor board?  (schematic or manual, mfr & model, etc)

Tom

« Last Edit: August 18, 2015, 08:19:02 PM by TomWS »

donaldhwong

  • Jr. Member
  • **
  • Posts: 92
Re: MEGA Power Issue
« Reply #10 on: August 19, 2015, 12:18:57 AM »
Thank you, Tom,

Still don't fully understand what you wrote.

Based on my circuit diagram, if I disconnect the SET resistor, then connect PWR from Battery to Moteino.  Then connect the 3.3Vout of Moteino to the VCC of the logics input of the motor board, with common ground to all. 

Will it work?

Donald

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: MEGA Power Issue
« Reply #11 on: August 19, 2015, 08:09:28 AM »
Thank you, Tom,

Still don't fully understand what you wrote.

Based on my circuit diagram, if I disconnect the SET resistor, then connect PWR from Battery to Moteino.  Then connect the 3.3Vout of Moteino to the VCC of the logics input of the motor board, with common ground to all. 

Will it work?

Donald
What will help me help you is if you answer my questions.

Tom

donaldhwong

  • Jr. Member
  • **
  • Posts: 92
Re: MEGA Power Issue
« Reply #12 on: August 19, 2015, 10:40:30 AM »
Sorry Tom.  Forgot to post the following:
  • It is a car plug in to usb output module.
  • I don't have enough space to use this 12v to 5v converter in the final product.  I must use the battery power.
  • I tried your suggestion by connect the GND to the Signal of the motor board.  But it did not work.
  • The motor board and circuit diagram already posted.

Thank you,
Donald

donaldhwong

  • Jr. Member
  • **
  • Posts: 92
Re: MEGA Power Issue
« Reply #13 on: August 21, 2015, 01:10:19 PM »
As per my previous post, I tried to disconnect SET resistor.  Hooked up 12v from Battery to MEGA, connect the VOUT 3.3 from MEGA to the digital circuit of the motor board.  It still failed. 

I can not understand why.  Though Tom and Felix both tried to help.  I still can not comprehend this lopping issue.  Can anyone explain once again to me?

It only works, if I down step the 12V to 5V through the module from my USB car adapter. (Photo attached).

Please help me to solve this issue.


TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: MEGA Power Issue
« Reply #14 on: August 21, 2015, 04:27:19 PM »
Ok, one more try.  Please see attached connection diagram.  Try this.  If it doesn't work then you need to provide MUCH more detailed information about your motor board than a 500 pixel image before I can help any more.

Tom

donaldhwong

  • Jr. Member
  • **
  • Posts: 92
Re: MEGA Power Issue
« Reply #15 on: August 21, 2015, 06:39:54 PM »
Hi Tom,

I truly appreciate you taking the time to draw a diagram.

A bow to you.

I will try as per your suggestion and report back to you.

Thank you,
Donald