1

I have a 2008 Mac that hardly ever crashes. But from time to time (not always) it crashes (the whole computer shuts down as if the power has been cut off) when I plug in an Arduino via USB.

What could cause this?


I've done some testing and the constant in when this occurs seems to be a cheap PIR sensor from eBay. It works some of the time.

Should I get another sensor? Or is there something about PIR sensors that makes them prone to this? It has a lot of caps... Is there another kind of motion sensor?

futurebird
  • 425
  • 4
  • 15
  • A faulty cable or board. – Ignacio Vazquez-Abrams Sep 12 '15 at 06:00
  • What sort of fault? – futurebird Sep 12 '15 at 06:02
  • Which Arduino? Genuine, clone or knock-off? I ask because some of the cheaper ones require unusual USB drivers. – Nick Gammon Sep 12 '15 at 06:12
  • This has happened with multiple micros, from genuine one to a nodemcu esp8266... I'm thinking it's the long micro usb cord that came with my headphones... are short cords better? – futurebird Sep 12 '15 at 06:16
  • Try a different USB cable, see what happens. – Nick Gammon Sep 12 '15 at 07:26
  • Well it could be that something shorts on the board and it draws too much power from mac and it shuts down to protect the motherboard. Most of the times it would just disconnect usb port, but it also could trigger some interrupt on mac itself. Do you have Lab PSU to test if there is a short circuit? – Gossamer Sep 14 '15 at 14:55
  • I looked for a short and found none. In the end I resolved it by moving the power supply for my potentiometer from 3.3v to 5v. I don't know why that would matter... but now it's fine. – futurebird Sep 14 '15 at 19:19
  • 1
    @futurebird Power supply for your potentiometer? – Avamander Sep 14 '15 at 20:23
  • I'm using the pot for user input. It's connected to power ground and an analog pin. – futurebird Sep 14 '15 at 20:25
  • "It has a lot of caps" implies that the device actually will "look like" a short circuit until those capacitors are charged. If the total capacitance is high and the USB protection circuit sensitive, it could indeed trip. – Chris Stratton Jul 06 '17 at 17:17
  • Finding resolution in moving the potentiometer to the current-limited 3v3 pin suggests that the potentiometer or something sharing its supply is drawing too much current. The little 3v3 regulator can't supply enough to load down the USB port, and so would be being abused as a sort of inrush limiter - might be working, but not a very good idea. – Chris Stratton Jul 06 '17 at 17:18

3 Answers3

2

It could possibly be that there is a fault that is causing a short circuit. This short circuit could be in the board itself or the USB cable that connects the Arduino. The USB port on the Mac should have protection to protect against a short circuit. Your comments have indicated that you have tested for a short and found none - but this is helpful for others that are looking for a solution.

In your comments you mention that you solved this by changing the positive rail of your potentiometer from 3.3V rail to the 5V rail.

sa_leinad
  • 3,188
  • 1
  • 22
  • 51
1

I had this problem with a Chinese knock-off of an Arduino Nano -- looks like it was actually because I had previously installed some CH341 drivers that no longer work with Sierra.

Removing those drivers (sudo rm -r /Library/Extensions/usbserial.kext) stopped the crash (full computer shutdown when I plugged in the Arduino, even through an externally powered USB hub), but unfortunately my Mac doesn't seem to recognize the Arduino.

It looks like there is a newer version of the driver (1.4, 2017-01-11, downloadable from here), or the 1.3 version is available as a homebrew cask if you tap that repo.

I am a little wary about installing a driver from a random Chinese site. If you want, you can unzip the driver and unpackage the .pkg file with pkgutil --expand package-name.pkg destination-folder. There are a couple subfolders including a Payload that you can inspect a little with zcat -- way over my head.

Alternatively, it looks like this repo may have a C++ driver that may work.

n8henrie
  • 111
  • 2
0

As n8henrie said this is an issue regarding drivers with Mac OS. I updated to Mac OS Mojave (Full disclosure I run a Hackintosh system) and plugging in the arduino nana would cause a massive kept stall causing my computer to loop (if playing a video it would loop back and forth) and I’d need to turn off the PSU in order to successfully boot. However by deleting the current drive I used (CH341) the board would no longer do this (note- I tried 3 boards from different sellers, with 1 genuine and 2 Chinese) in High Sierra this did not happen however

Tijhe
  • 1