Author Topic: What have I done? (have I bricked them)  (Read 7136 times)

urbanmania

  • Newbie
  • *
  • Posts: 6
What have I done? (have I bricked them)
« on: February 27, 2017, 01:48:21 am »
Hi

So, have a few Digispark boardsm the micro USB flavour.  They have all worked when I plug them in and test (using the LED blink code) so I know the setup is not the problem.  My problem is that after having uploaded a simple code to turn on 17 NEO Pixel (using Adafruit neopixel library) to full white, they stop responding.  The pixels don't light up and I can't upload any code to the digispark, just get a time out.  Any ideas of how I can upload new code to them (I first thought it was my soldering that was causing it so I didn't solder the 4th one).

Now regarding the code, the only thing I can imagine causes this is that I forgot to add delay(X) to the loop that sets up the lights. I decided to post here first, before bricking another one by uploading more code, as I'm not sure adding the delay(x) would indeed fix this problem.  The original code I uploaded did have delay in it but the delay was messing with what I wanted to do so I removed it and thats when things started to go belly up.

Cheers

Joe

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: What have I done? (have I bricked them)
« Reply #1 on: February 27, 2017, 05:13:53 am »
Not sure what's going on there. A delay shouldn't change anything, as the bootloader has an automatic 5 second delay to allow for programming to commence.

So did you try any of them with just the code on, without connecting them to the neopixels (this will help determine if it is an electrical or code fault). How are the pixels being powered? Is there  a resistor on the data line between the pixel and the Digispark?

urbanmania

  • Newbie
  • *
  • Posts: 6
Re: What have I done? (have I bricked them)
« Reply #2 on: February 27, 2017, 05:50:17 am »
Hi
No, there isn't a resistor, perhaps I should try that on the next one, thought about it but was tring to make it as small as possible (it's an Iron Man Arc Reactor for my 5 y/o son, to be worn in the palm of his hand).

I'll try running this on just the digispark and see if it bricks it, before connecting the lights.  I had tested the lights before I hooked them up with this code.  Was using a colour changing code I found in some tutorial, can't find the link at the moment (am at work now).  That did run using the digispark so that's why I'm blaming the code. I could upload the new code (the one that bricked them) after I had used the test code with the pixels connected.

The pixels are powered through the 5V pin on the digispark.  I will then, once it works, power this using a 9V battery through the VIN pin.

JOhannes

exeng

  • Sr. Member
  • ****
  • Posts: 454
Re: What have I done? (have I bricked them)
« Reply #3 on: February 27, 2017, 09:29:27 am »
Quote
The pixels are powered through the 5V pin on the digispark.
I'm not sure that the Digispark voltage regulator can source enough current to power the Digispark and the 17 NEO pixels especially if they are all on.

urbanmania

  • Newbie
  • *
  • Posts: 6
Re: What have I done? (have I bricked them)
« Reply #4 on: February 27, 2017, 01:30:50 pm »
I was a bit concerned about whether it could run so many lights at the same time. But with the lights not connected, I should be able to upload new code to it and interact with it.

urbanmania

  • Newbie
  • *
  • Posts: 6
Re: What have I done? (have I bricked them)
« Reply #5 on: February 27, 2017, 02:02:54 pm »
So, now I've uploaded a different code onto a brand new digispark, nothing hooked up yet tho.  This time around I can interact with it after uploading the code.

I've also hooked the lights up to a Metro Mini from Adafruit, just to test them out and they all worked (with the code that is on the digispark).

I didn't have time to test the two together tonight, but will tomorrow.  With a resistor between the spark and the pixels.  Wish me luck :)

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: What have I done? (have I bricked them)
« Reply #6 on: February 28, 2017, 04:41:59 am »
ouch... 17 neopixels at 60ma each is 1.02A... and the regulator on the digispark (78M05) is only rated at 500mA (0.5A)... and even if it didn't go bang... I don't think a 9v battery would have lasted more than 5 minutes with that load on it. I wouldn't be putting more than 6 neopixels on if they are drawing their full 60ma... as that doesn't take into account the few milliamps the digispark itself needs to run, and you never push a linear regulator to it's limits unless you want to see the magic smoke come out!

A simple test is if when you plug the digispark into power the green led (near the power header pins) doesn't come on, the regulator is toast / MIA / dead, as that is simply a power indicator.

You really need to use a  (external) switching regulator to provide the necessary power. Something like this would do well for that. You would then be able to still tap off the VCC pin on the digispark, as the power would be coming from the switching regulator via the usb connector, which would have the 9v battery connected to it, not the digispark. But then you need to consider changing to something different to supply the power, as a 9v battery won't last long at all.

Good luck btw!  ;) ;D

exeng

  • Sr. Member
  • ****
  • Posts: 454
Re: What have I done? (have I bricked them)
« Reply #7 on: February 28, 2017, 09:07:32 am »
Pete,
Quote
You would then be able to still tap off the VCC pin on the digispark, as the power would be coming from the switching regulator via the usb connector,

Am I missing something. Good idea on the buck converter but looking at the Digispark schematics, I don't see how the USB power gets to VIN if power is coming in on the USB connection. Unless the MC78M05BDTRKG somehow allows the 5V on the out to get to the in?

urbanmania

  • Newbie
  • *
  • Posts: 6
Re: What have I done? (have I bricked them)
« Reply #8 on: February 28, 2017, 12:30:43 pm »
@PeterF thanks for this, I notice a mis-calculation on my part so that is the reason for the whole mess. I was just a bit too excited when I got my digisparks delivered, wanted to use them for something right away :) Teaches me not to rush into things, to properly calculate :)  The only reason for the 9V battery was I had one sitting on my bench when I started, there was no need for that particular one.

I'm guessing I'll switch to something slightly bigger, perhaps the Metro Mini for this, and just power it through a USB bank, or just go for a Gemma and a 3.7 V li-poly battery, my daughter has that setup in a dollhouse-disco she created (with some help from me on the electrical side) with 16pixel ring.

Thanks all for your help :)

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: What have I done? (have I bricked them)
« Reply #9 on: March 01, 2017, 01:42:07 am »
@exeng: Yeah, just one minor detail (so I won't hold it against you! :-P) VCC, not VIN ;) I don't think the 78M05 would allow the output the flow into the input, so I don't think you'd be tapping into the USB power from the VIN. However, USB power is routed directly to VCC as it is already 5v.

@urbanmania: No worries. So did the digisparks survive, or did they die a horrible death? Have fun, and good luck with your project! ;)
« Last Edit: March 01, 2017, 01:44:01 am by PeterF »

exeng

  • Sr. Member
  • ****
  • Posts: 454
Re: What have I done? (have I bricked them)
« Reply #10 on: March 01, 2017, 09:22:05 am »
Pete, Ooops you caught me. I swear I read VIN not VCC. Perhaps the coffee hadn't kicked in yet that morning.

urbanmania

  • Newbie
  • *
  • Posts: 6
Re: What have I done? (have I bricked them)
« Reply #11 on: March 03, 2017, 01:08:54 pm »
@PeterF I fried them all!  Luckily I bought 10 so I still have a few left.  My daughter decided to make necklaces out of the wrecked ones, so she was happy with my failed attempts :)

exeng

  • Sr. Member
  • ****
  • Posts: 454
Re: What have I done? (have I bricked them)
« Reply #12 on: March 03, 2017, 03:35:46 pm »
What exactly are you doing that is frying all these Digisparks? How are you powering them?

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: What have I done? (have I bricked them)
« Reply #13 on: March 04, 2017, 02:29:26 am »
@exeng: I think that was the answer to my question earlier... so it looks pretty certain that the regulator went on (permanent) strike as it was being overloaded. :(

@urbanmania: lol... although your daughter obviously has plans for their remains if they suffer an untimely demise... and would probably like a few more, at least you know what the cause of the problem is! ;)

exeng

  • Sr. Member
  • ****
  • Posts: 454
Re: What have I done? (have I bricked them)
« Reply #14 on: March 04, 2017, 09:03:13 am »
I guess my inquiry was more rhetorical. If the problem was understood, then why continue to fry?

I once had a boss early in my career who would like to say in a passive aggressive way, "If you find a mistake you like, stick with it."

Maybe I missed the exact problem but was it over current draw as we suspected, or improper power through USB or elsewhere?