Author Topic: Are there any dangers in connecting uC to battery and to laptop USB?  (Read 4821 times)

0 Members and 1 Guest are viewing this topic.

Offline nowrd2xplnTopic starter

  • Newbie
  • Posts: 6
I have system that is powered by a 9.6V NiCd battery to power a mbed microcontroller and motor controller.  I have the power into the mbed regulated with a 7805, but when I powered my system up, then connected it to my laptop via USB, about one minute later I believe I heard an IC pop which was followed by a burning smell. 

I quickly disconnected the battery and USB.  Afterwards I touched the top side of the med to see if anything was hot, but could not find anything but later on I made the assumption that it must have been on the bottom side of the board.

In general with microcontrollers, can connecting a system with a battery and then to a computer be harmful?  Does this happen often?  If so how can I prevent this?  Could it the problem be due to the different grounds of the laptop and the system I built? There could be a chance that I might have had the microcontroller connected to the laptop first, and then I connected the battery.

Specs:
http://mbed.org/handbook/mbed-NXP-LPC1768

Schematics:
http://mbed.org/media/uploads/chris/mbed-005.1.pdf

Cheers,
AL
 

Offline benemorius

  • Regular Contributor
  • *
  • Posts: 173
Re: Are there any dangers in connecting uC to battery and to laptop USB?
« Reply #1 on: March 31, 2012, 08:33:44 pm »
What you're wanting to do is fine in principle, but evidently something wasn't done right.

The mbed should be a 3.3V device. Where did you have the output of the 7805 connected?
« Last Edit: March 31, 2012, 08:35:41 pm by benemorius »
 

Offline baljemmett

  • Supporter
  • ****
  • Posts: 665
  • Country: gb
Re: Are there any dangers in connecting uC to battery and to laptop USB?
« Reply #2 on: March 31, 2012, 08:44:21 pm »
The mbed should be a 3.3V device. Where did you have the output of the 7805 connected?

The Vin pin on the mbed is specified for 4.5V - 9V; the USB supply and Vin supply are brought together with a pair of diodes and then fed into a pair of 3.3V regs to provide power to the mbed itself and the Vout pins separately.  Feeding 5V in should be safe enough, especially from a battery so that ground can float to the USB ground...
 

Offline nowrd2xplnTopic starter

  • Newbie
  • Posts: 6
Re: Are there any dangers in connecting uC to battery and to laptop USB?
« Reply #3 on: March 31, 2012, 08:58:15 pm »
Would you mind explaining how the zener diodes protect the system?  And to make sure I'm clear on the answer to my question, is it safe to connect the battery to my uC and laptop to the uC?

...  Apparently, my uC is acting normally.  For some reason the driver on my OS stopped working until I reinstalled the drivers.  Now I can see the the COM port that my mbed is connected to.

Cheers,
AL
 

Offline benemorius

  • Regular Contributor
  • *
  • Posts: 173
Re: Are there any dangers in connecting uC to battery and to laptop USB?
« Reply #4 on: March 31, 2012, 08:58:49 pm »
The mbed should be a 3.3V device. Where did you have the output of the 7805 connected?

The Vin pin on the mbed is specified for 4.5V - 9V; the USB supply and Vin supply are brought together with a pair of diodes and then fed into a pair of 3.3V regs to provide power to the mbed itself and the Vout pins separately.  Feeding 5V in should be safe enough, especially from a battery so that ground can float to the USB ground...

Yes you're right of course. I'm entertaining the idea that the 5V wasn't fed in on the Vin pin. It looks like bad things could happen if it was connected to the 3.3V or 5V pins.
 

Offline benemorius

  • Regular Contributor
  • *
  • Posts: 173
Re: Are there any dangers in connecting uC to battery and to laptop USB?
« Reply #5 on: March 31, 2012, 09:03:00 pm »
Would you mind explaining how the zener diodes protect the system?  And to make sure I'm clear on the answer to my question, is it safe to connect the battery to my uC and laptop to the uC?

They're there to allow multiple sources to feed one load while preventing a source from feeding back in to another source. Yes, it is most definitely safe to power the uC from the battery while having the laptop connected to the uC, but you have to make sure you get your connections right just like you would in any other case.

...  Apparently, my uC is acting normally.  For some reason the driver on my OS stopped working until I reinstalled the drivers.  Now I can see the the COM port that my mbed is connected to.


You need to tell us which mbed pin you connected the 7805 to. If things are working now, it sounds like you had it connected to the 5V out pin and may have let the magic smoke out of the usb load switch by passing reverse current through it back in to your computer's usb bus. You could prove or disprove this by attempting to power the mbed from the usb port alone. It may no longer work.
« Last Edit: March 31, 2012, 09:07:49 pm by benemorius »
 

Offline nowrd2xplnTopic starter

  • Newbie
  • Posts: 6
Re: Are there any dangers in connecting uC to battery and to laptop USB?
« Reply #6 on: March 31, 2012, 09:09:13 pm »
I triple checked my hand written schematic and the board it self.  I made a two different power rails: one from the battery and a 5V regulator.  The mbed is supplied through the regulated 5V rail along with a couple of xbees and my motor controller's logic supply.  The motor supply is connected to directly to my battery (specs bellow if interested).

Motor Controller Specs:
http://www.pololu.com/catalog/product/1110/specs

Motor Controller User guide:
http://www.pololu.com/docs/pdf/0J25/qik_2s9v1.pdf
 

Offline baljemmett

  • Supporter
  • ****
  • Posts: 665
  • Country: gb
Re: Are there any dangers in connecting uC to battery and to laptop USB?
« Reply #7 on: March 31, 2012, 09:09:38 pm »
Yes you're right of course. I'm entertaining the idea that the 5V wasn't fed in on the Vin pin. It looks like bad things could happen if it was connected to the 3.3V or 5V pins.
Ah, of course, sorry; didn't think of that...
 

Offline nowrd2xplnTopic starter

  • Newbie
  • Posts: 6
Re: Are there any dangers in connecting uC to battery and to laptop USB?
« Reply #8 on: March 31, 2012, 09:11:06 pm »
The mbed is powered through the Vin pin.  I don't use the USB 5v out or the 3.3v regulated out.  They are not connected to anything.
 

Offline benemorius

  • Regular Contributor
  • *
  • Posts: 173
Re: Are there any dangers in connecting uC to battery and to laptop USB?
« Reply #9 on: March 31, 2012, 09:16:11 pm »
The mbed is powered through the Vin pin.  I don't use the USB 5v out or the 3.3v regulated out.  They are not connected to anything.

In that case, I can see no cause for anything bad to happen with regard to power supplies assuming you've checked all your voltages. You may need to look elsewhere for the source of your magic smoke.
 

Offline jpelczar

  • Contributor
  • Posts: 36
  • Country: kr
Re: Are there any dangers in connecting uC to battery and to laptop USB?
« Reply #10 on: April 01, 2012, 07:24:16 am »
In that case, I can see no cause for anything bad to happen with regard to power supplies assuming you've checked all your voltages. You may need to look elsewhere for the source of your magic smoke.

Maybe this was voltage spike from the motors ?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf