Author Topic: Powering a Digispark with 6V?  (Read 6970 times)

DoktorJ

  • Newbie
  • *
  • Posts: 14
Powering a Digispark with 6V?
« on: January 02, 2013, 01:45:42 pm »
I have a homebrew power supply I made for a fan, that has a toroidal transformer with 48V and 6V outputs.  I've been wanting to add PWM to the supply so I can adjust the speed of the fan, but haven't found a simple schematic that works reliably.  When I got my Digispark and realized I suddenly had an economical, programmable PWM controller in my hand, I realized it might work for this -- but the problem is the unregulated power line is for 5V, and the 7805 regulator on VIN needs at least 7V due to the voltage drop of the regulator.

My question then, is thus: Can the Digispark tolerate that extra volt on the unregulated input, or can it tolerate a lesser voltage resulting from running the 6V output through the regulated input?

If neither of those are particularly acceptable, would the unregulated input at least be tolerant enough that I could put a 1N400x diode in series with it?  Since said diodes have a ~1V drop, that should result in the Digispark getting between 4.5-5.5V worst case scenario.
« Last Edit: January 02, 2013, 01:45:42 pm by DoktorJ »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Powering a Digispark with 6V?
« Reply #1 on: January 02, 2013, 01:55:50 pm »
The diode should work - of course we can\'t guarantee it won\'t fry it, but if it was me that is the route I\'d take.

You can also try connecting the 6v to the VIN pin and see what the regulator does - check the voltage on the 5v pin and see if you get 5v.

DoktorJ

  • Newbie
  • *
  • Posts: 14
Powering a Digispark with 6V?
« Reply #2 on: January 02, 2013, 05:13:38 pm »
Hmmm, actually I tried connecting the voltage to the VIN via diode, and the Digispark seems to work even then.  Removing the diode, it still plays nicely on VIN, and I get 4.74V on the 5V line... does that sound safe/stable?

FYI, the power supply has a 6V regulator in it (why?  because it was cheap, and I was originally considering a 555-based solution which can take up to 15V no problem) so it should get a pretty stable 6V in.  I suppose if I were really industrious, I could remove or bypass the 6V regulator -- the unregulated output of the transformer is ~10V which the onboard 7805 should have no problem managing... but if it works on 6V, why fix what isn\'t broke? :P

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Powering a Digispark with 6V?
« Reply #3 on: January 02, 2013, 06:06:17 pm »
That is interesting on the VIN - I\'d think it\'d be preferred if you\'re using the diode to put it right on the 5v line rather than run the vreg out of spec - the way your doing it is probably safe, but maybe not stable at higher currents because dropout voltage rises with current.

Also if it is powering on with about 5v on VIN then I\'d bet 6v on VIN would be more stable and eliminate the diode which would allow for more current before dropout voltage was too high.

Datasheet for vreg: http://www.onsemi.com/pub_link/Collateral/MC78M00-D.PDF

kcbudd

  • Newbie
  • *
  • Posts: 11
Re: Powering a Digispark with 6V?
« Reply #4 on: March 25, 2013, 12:53:20 pm »
I know I'm resurrecting an old topic, but I thought it might be prudent to mention that the AtTiny85 datasheet provides more concrete data about the voltage operating limits of the microcontroller:


http://www.atmel.com/Images/Atmel-2586-AVR-8-bit-Microcontroller-ATtiny25-ATtiny45-ATtiny85_Datasheet.pdf


The datasheet indicates that the AtTiny85 will operate with a Vcc voltage range of 2.7V - 5.5V (under various conditions) and the table on page 162 seems to indicate that the internal oscillator is stable at 20MHz down to 4.5 volts (and at 10MHz down to the lower limit of 2.7V)


If you aren't doing anything that requires the higher clock cycles, I'd consider programming it using the 1MHz option and just run it directly with the diode in line to keep the voltage safely below 5.5V.  (Page 160 also indicates that failure shouldn't occur below 6 volts Vcc but also disclaims operating outside of the operating specifications.)


I have a digispark in one of my kid's toys in 1MHz mode running off of three AAA batteries (4.5V) driving three LEDs with PWM outputs and so far it seems perfectly stable.  (Obviously I bypassed the vreg and used the 5V pin directly to power it.)  I haven't checked to see what the default brownout detection settings on the Digisparks are, though - those might need tweaking (or disabling entirely) if you're going to push the lower voltage limits.   When I find out what voltage the thing starts failing at I'll report back.   ;)





digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Powering a Digispark with 6V?
« Reply #5 on: March 25, 2013, 02:40:38 pm »
0xE1    0x5D   0xFE
are the fuses settings


so brownout is set for 2.7v

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: Powering a Digispark with 6V?
« Reply #6 on: March 25, 2013, 10:56:53 pm »
It should be fine to power the digispark at under 4v if you use one of the 1mhz or 8mhz board settings in the new IDE and make sure to disconnect that lower voltage power supply when connecting it over USB. Technically the digispark always starts in 16/16.5mhz mode, then when the sketch starts it changes the clock speed down, but it'll probably be fine if it's only for a few seconds. If you like you could switch to one of the -jumper bootloader variants which spend a few milliseconds in the bootloader before jumping in to the user sketch and fixing the clock speed.


The most important thing is this: Don't do flash memory programming if the voltage is out of spec. It could end poorly! Better if you don't write in to flash memory at all really, since the bootloader is not protected by any hardware features, so it could be corrupted if you aren't super careful. :)