Are there any dangers in connecting uC to battery and to laptop USB? - Page 1
Forum section: electronics / general

author: nowrd2xpln
author_rank: Newbie
timestamp: March 31, 2012, 07:11:02 pm
content: 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-LPC1768Schematics:http://mbed.org/media/uploads/chris/mbed-005.1.pdfCheers,AL

author: benemorius
author_rank: Regular Contributor
timestamp: March 31, 2012, 08:33:44 pm
content: 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?

author: baljemmett
author_rank: Unknown
timestamp: March 31, 2012, 08:44:21 pm
content: Quote from: benemorius on March 31, 2012, 08:33:44 pmThe 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...

author: nowrd2xpln
author_rank: Newbie
timestamp: March 31, 2012, 08:58:15 pm
content: 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

author: benemorius
author_rank: Regular Contributor
timestamp: March 31, 2012, 08:58:49 pm
content: Quote from: baljemmett on March 31, 2012, 08:44:21 pmYes 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.

author: benemorius
author_rank: Regular Contributor
timestamp: March 31, 2012, 09:03:00 pm
content: Quote from: nowrd2xpln on March 31, 2012, 08:58:15 pmThey'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.Quote from: nowrd2xpln on March 31, 2012, 08:58:15 pmYou 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.

author: nowrd2xpln
author_rank: Newbie
timestamp: March 31, 2012, 09:09:13 pm
content: 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/specsMotor Controller User guide:http://www.pololu.com/docs/pdf/0J25/qik_2s9v1.pdf

author: baljemmett
author_rank: Unknown
timestamp: March 31, 2012, 09:09:38 pm
content: Quote from: benemorius on March 31, 2012, 08:58:49 pmAh, of course, sorry; didn't think of that...

author: nowrd2xpln
author_rank: Newbie
timestamp: March 31, 2012, 09:11:06 pm
content: 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.

author: benemorius
author_rank: Regular Contributor
timestamp: March 31, 2012, 09:16:11 pm
content: Quote from: nowrd2xpln on March 31, 2012, 09:11:06 pmIn 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.

author: jpelczar
author_rank: Contributor
timestamp: April 01, 2012, 07:24:16 am
content: Quote from: benemorius on March 31, 2012, 09:16:11 pmMaybe this was voltage spike from the motors ?