Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
poeticoddity
Jan 14, 2007
"How nice - to feel nothing and still get full credit for being alive." - Kurt Vonnegut Jr. - Slaughterhouse Five

babyeatingpsychopath posted:

I have been tasked with designing a little LED doodad. It takes some small number of white LEDs and lights them up. The only hiccup is that they want it to be dimmable, and also to work when plugged into USB, 12V or 24V, with no external changes except the plug. They said they wanted 115vac, too, but I told them no deal on that input.

What power topology am I looking for? Is there a single driver chip that takes 5-24vdc and has a dimmer input that will read the correct range regardless of Vin?

You may be able to find a buck converter that will do a 3.3V output with some sort of adjustable current regulation, but you'll find more part options (and probably an overall cheaper BOM) with a separate buck converter and something that does PWM.

Adbot
ADBOT LOVES YOU

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS

My Rhythmic Crotch posted:

Have you tried any domestic suppliers? https://www.newhavendisplay.com/tfts-c-1.html for example, or there's always Mouser and Digikey.

Hitting the $20 price point seems unlikely without establishing some kind of factory-direct relationship with a chinese company though.

Yeah, but that's a hard pill to swallow when I can buy an entire smartphone for $50.


Considering getting some refurb smartphone screens and hacking the MIPI interface

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


poeticoddity posted:

You may be able to find a buck converter that will do a 3.3V output with some sort of adjustable current regulation, but you'll find more part options (and probably an overall cheaper BOM) with a separate buck converter and something that does PWM.


KnifeWrench posted:

Is there a reason you're not considering a two-chip solution to normalize your input voltage and then drive the LEDs with a predictable rail? Feels like the slight bump in complexity is a small price to pay for avoiding designing yourself into a corner.

I was hoping for a single-chip solution that someone knew off the top of their head.

How would the thread recommend doing dimming when the input voltage is unknown? This is a replacement for some kind of fishing light, and apparently they're dimmed by varying the input voltage (1-4 6V deep-cycle batteries). So I guess the dimmer could go 0-6V or 0-24V?

I'm not sure why I agreed to this, but I'm not deep into it, so I may just give up unless these cranky old dudes can agree to meet me halfway.

Foxfire_
Nov 8, 2010

babyeatingpsychopath posted:

I was hoping for a single-chip solution that someone knew off the top of their head.

How would the thread recommend doing dimming when the input voltage is unknown? This is a replacement for some kind of fishing light, and apparently they're dimmed by varying the input voltage (1-4 6V deep-cycle batteries). So I guess the dimmer could go 0-6V or 0-24V?

I'm not sure why I agreed to this, but I'm not deep into it, so I may just give up unless these cranky old dudes can agree to meet me halfway.

Describe what the circuit is supposed to accept (power and signal), whether you care about efficiency, how much power the LEDs are outputting, and how much space you have.

A multiple IC solution is probably going to be cheaper and easier than finding a snowflake monolithic one (and in either case you'll have supporting passives)

poeticoddity
Jan 14, 2007
"How nice - to feel nothing and still get full credit for being alive." - Kurt Vonnegut Jr. - Slaughterhouse Five

babyeatingpsychopath posted:

I was hoping for a single-chip solution that someone knew off the top of their head.

How would the thread recommend doing dimming when the input voltage is unknown? This is a replacement for some kind of fishing light, and apparently they're dimmed by varying the input voltage (1-4 6V deep-cycle batteries). So I guess the dimmer could go 0-6V or 0-24V?

I'm not sure why I agreed to this, but I'm not deep into it, so I may just give up unless these cranky old dudes can agree to meet me halfway.

The maximum input voltage you'll need to deal with is either the maximum surface charge on a 100% charged nominal 24V series (which, IIRC, is somewhere around 28 to 30V) or whatever the maximum output voltage on a battery charging system would be. Your minimum would be a fairly low depth of discharge a single cell, so maybe 5V unless you're expected to include some sort of system to prevent excessive discharge. There are plenty of chips available which can handle that wide range and output 5V, 3.3V, or something else under 5V, which could then be PWM'ed to however many LEDs in parallel.

I think the starting point, really, would be to figure out what you need in terms of the LEDs and application.
Hardware requirements are going to be a bit different for "light up a few 20mA LEDs on a one-night trip on the lake" versus "light up 20A of LEDs every night for a week out at sea".

KnifeWrench
May 25, 2007

Practical and safe.

Bleak Gremlin

babyeatingpsychopath posted:

I was hoping for a single-chip solution that someone knew off the top of their head.

How would the thread recommend doing dimming when the input voltage is unknown? This is a replacement for some kind of fishing light, and apparently they're dimmed by varying the input voltage (1-4 6V deep-cycle batteries). So I guess the dimmer could go 0-6V or 0-24V?

I'm not sure why I agreed to this, but I'm not deep into it, so I may just give up unless these cranky old dudes can agree to meet me halfway.

If you need to vary analog voltage and not PWM or current, then you should be able to make something work with an adjustable buck regulator with a wide input range. Hell, you could maybe even just omit the inductor and use the buck as a PWM directly. But I've never done LEDs this way (for a couple reasons) and I offer no warranty on how well it would function.

Are you sure these diodes take a varying voltage in? That's a mighty hefty assumption for the "if" at the top there, and it's a strange concept.

shovelbum
Oct 21, 2010

Fun Shoe
Has anyone tried 12V individually addressable LEDs, like 12V WS2812b equivalents? I am the last person on earth to try out the 12V 5050 RGB tape stuff, and just having the higher voltage vs trying to feed WS2812b strips 5V at any length/density has been life altering.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


poeticoddity posted:

The maximum input voltage you'll need to deal with is either the maximum surface charge on a 100% charged nominal 24V series (which, IIRC, is somewhere around 28 to 30V) or whatever the maximum output voltage on a battery charging system would be. Your minimum would be a fairly low depth of discharge a single cell, so maybe 5V unless you're expected to include some sort of system to prevent excessive discharge. There are plenty of chips available which can handle that wide range and output 5V, 3.3V, or something else under 5V, which could then be PWM'ed to however many LEDs in parallel.

I think the starting point, really, would be to figure out what you need in terms of the LEDs and application.
Hardware requirements are going to be a bit different for "light up a few 20mA LEDs on a one-night trip on the lake" versus "light up 20A of LEDs every night for a week out at sea".

The LEDs they pointed to when I was looking at mouser were some 3V 150mA white LEDs at (i think) 50 lumens. They said "about 20 of those should be fine." So that's like 3A, which I think is ridiculous. Of course, they're using incandescents now, so 3A is probably pretty great, comparatively.

So let's start there. 3A @ 3V, 5-30V input. The ideas I'm seeing are saying use a buck converter to switch down to (say) 3.3V and then feed that into some constant-current parallel driver chip or five.

What's a good way to dim, then? How do I know that the dimmer isn't set halfway on a 24V system and not that it's hooked up to a 12V system? Is this getting into microcontroller stuff where it's gotta remember things?

poeticoddity
Jan 14, 2007
"How nice - to feel nothing and still get full credit for being alive." - Kurt Vonnegut Jr. - Slaughterhouse Five

babyeatingpsychopath posted:

The LEDs they pointed to when I was looking at mouser were some 3V 150mA white LEDs at (i think) 50 lumens. They said "about 20 of those should be fine." So that's like 3A, which I think is ridiculous. Of course, they're using incandescents now, so 3A is probably pretty great, comparatively.

So let's start there. 3A @ 3V, 5-30V input. The ideas I'm seeing are saying use a buck converter to switch down to (say) 3.3V and then feed that into some constant-current parallel driver chip or five.

What's a good way to dim, then? How do I know that the dimmer isn't set halfway on a 24V system and not that it's hooked up to a 12V system? Is this getting into microcontroller stuff where it's gotta remember things?

Hey, someone who's well rested/isn't currently drinking beer:
https://www.diodes.com/assets/Datasheets/AL3065A.pdf

Am I reading correctly that using a suitable pot (and an additional resistor) as a voltage divider between Vcc and ADIM would allow analog dimming in this application?
(I'm not sure if the LEDs could all be run off of a single channel, but splitting them into two channels shouldn't be any additional parts or complexity.)

Sagebrush
Feb 26, 2012

babyeatingpsychopath posted:

What's a good way to dim, then? How do I know that the dimmer isn't set halfway on a 24V system and not that it's hooked up to a 12V system? Is this getting into microcontroller stuff where it's gotta remember things?

Yes. LEDs are basically always dimmed using PWM rather than by reducing their current. It has the same effect on power consumption but it's more linear, covers a wider range (LEDs don't work well at like 1% of rated current but they have no problem with a 1% duty cycle), and it's easier to build a simple square wave driver than a variable constant-current source.

What you need to do is

- find out exactly how many LEDs you need to drive and what is a reasonable voltage and current for the arrangement you choose (probably you want to arrange them in series to get close to 12v total drop, then in parallel until you have the requisite number)
- find or build a buck converter that can take your highest expected incoming voltage and drop it down to 12v
- find a constant-current driver IC that can handle that 12v output and configure it for an appropriate maximum current
- connect that to a simple microcontroller doing variable PWM. You can also do this with a 555 or whatever but an ATTiny45 is only like 10 cents more and is the same size and 1000x more capable should you decide to add functionality.

Splode
Jun 18, 2013

put some clothes on you little freak
Plenty of LED driver chips exist and can do dimming, but they usually are expecting instruction from a microcontroller via I2C. You might be able to find one that can take an analogue dimming signal from a pot as an input though

CarForumPoster
Jun 26, 2013

⚡POWER⚡
TLDR: any way to recover a computer from a lightning strike?

Backstory:
It looks like some very high voltage transients came through the ground wires of my house due to a close lightning strike killing a few services and setting off my smoke alarm and garage door light. All affected devices had ground connections.

It looks like the coaxial cable that I get internet through had the transient come through and it ate my cable modem and router. Any way to recover the router?

KnifeWrench
May 25, 2007

Practical and safe.

Bleak Gremlin

CarForumPoster posted:

TLDR: any way to recover a computer from a lightning strike?

Backstory:
It looks like some very high voltage transients came through the ground wires of my house due to a close lightning strike killing a few services and setting off my smoke alarm and garage door light. All affected devices had ground connections.

It looks like the coaxial cable that I get internet through had the transient come through and it ate my cable modem and router. Any way to recover the router?

If some parts have been fried, I would suspect that others have suffered damage that leaves them teetering on failure. What I'm getting at is that, even if you could somehow identify and replace the obviously damaged parts, and even if none of them needed to be programmed with factory firmware, and even if you actually got it working (each of these feels less likely than the last), it wouldn't ever be the same again.

There's a reason car hobbyists lament the transition from purely mechanical machines to the electromechanical computer symbiosis we have today: they're just not as user serviceable.

That doesn't mean it's impossible, but it will likely be frustrating and more expensive than just replacing it. Simultaneous reverse engineering and failure analysis doesn't strike me as a fun learning project.

Edit: but I didn't sleep well; maybe I'm just cranky.

TotalLossBrain
Oct 20, 2010

Hier graben!
It's possible that the router had a protective device on the input, like a metal oxide varistor. Those can be replaced or just be removed. But I'm not sure this type of protection is legally required in consumer level devices.

Edit:. However, as the poster above me points out, chances are high that other stuff fried even if there was a working protective device

TotalLossBrain fucked around with this message at 16:29 on Jul 27, 2019

CarForumPoster
Jun 26, 2013

⚡POWER⚡

TotalLossBrain posted:

It's possible that the router had a protective device on the input, like a metal oxide varistor. Those can be replaced or just be removed. But I'm not sure this type of protection is legally required in consumer level devices.

Edit:. However, as the poster above me points out, chances are high that other stuff fried even if there was a working protective device

I'm like 65% sure the transient came across the coaxial cable ground and into the modem/router that way. Seems unlikely they'd protect that route of coming in but what do I know. I'll probably tear it open just to take a peek whenever I'm around a harbor freight to get security screws.

I've actually done ESD testing before so I know the answer I just miss my semi fancy ASUS router.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Sagebrush posted:

Yes. LEDs are basically always dimmed using PWM rather than by reducing their current. It has the same effect on power consumption but it's more linear, covers a wider range (LEDs don't work well at like 1% of rated current but they have no problem with a 1% duty cycle), and it's easier to build a simple square wave driver than a variable constant-current source.

What you need to do is

- find out exactly how many LEDs you need to drive and what is a reasonable voltage and current for the arrangement you choose (probably you want to arrange them in series to get close to 12v total drop, then in parallel until you have the requisite number)
- find or build a buck converter that can take your highest expected incoming voltage and drop it down to 12v
- find a constant-current driver IC that can handle that 12v output and configure it for an appropriate maximum current
- connect that to a simple microcontroller doing variable PWM. You can also do this with a 555 or whatever but an ATTiny45 is only like 10 cents more and is the same size and 1000x more capable should you decide to add functionality.

Ok. I've set a feature freeze on this:
12 high-power white LEDs, 3V Vf, 150mA each, total 1800mA
(1-4)x 5-33V -> 3.3v voltage modules, each driving a parallel string of 3 LEDs through...
(1-4)x constant-current driver with PWM dimming
1x ATTiny45 driving the PWM dimming. It will have a voltage divider feeding its ADC, and will detect the maximum voltage it's seen over the last X00hours, and assume that's the system voltage, and set its pwm dimming based on that system voltage. Maybe this gets a jumper setting
Input assumptions:
Vin is a variable voltage from 4-32V. Maximum charging voltage on the 24V string is 32.2V, but it shouldn't be on charge with the lights on. 4V on a 6V battery is unhealthily low. I guess this means the 6V input doesn't get dimming, since that input would drop below the limit of the input modules, and a buck-boost module is an order of magnitude more expensive.

I can find 500mA CC drivers and 500mA wide-input-voltage buck converters. Does anyone have a part number for 2A versons of the same, just to lower chip count? I'd like this design to be physically as small as possible so I can churn the driver boards out for the lowest cost. The actual panels are roughly 300mm circles "to simulate the full moon" but those are going to be in some cheap plastic. Ideally the driver boards are going to be ~20mm on a side so I can panel a TON of them for fab. That would mean a 3-chip-plus-passives solution. I don't THINK I have to worry about thermal effects, but the board will eventually be potted in epoxy to make it waterproof, so maybe be conservative with the power?

Splode
Jun 18, 2013

put some clothes on you little freak
I mean I'd be worried about thermal effects, that's a shitload of power

Shame Boy
Mar 2, 2010

Sagebrush posted:

Yes. LEDs are basically always dimmed using PWM rather than by reducing their current.

Except in situations where flicker would be a problem, like when working on moving parts where you could set up a stroboscopic effect that makes them appear stationary.

(While I mostly brought that up to just be all :goonsay:, if this is some sort of fish... attracting...(?) light, it might be worth looking into whether or not fish care about flicker more than humans do or something, animals are weird)

Sagebrush
Feb 26, 2012

Shame Boy posted:

Except in situations where flicker would be a problem, like when working on moving parts where you could set up a stroboscopic effect that makes them appear stationary.

(While I mostly brought that up to just be all :goonsay:, if this is some sort of fish... attracting...(?) light, it might be worth looking into whether or not fish care about flicker more than humans do or something, animals are weird)

This is true. I had a student once in my intro to Arduino class who made an automatic dog door, but he used an ultrasonic sensor to detect the dog's presence and it turned out his dog could hear it pinging and wouldn't go near it. lol

---- other topic ----

I'm looking for a way to very accurately measure angles in the range of 0 to 180 degrees. 16 bits of resolution would be ideal. I don't want to break the bank.

Right now the best option seems to be to just get a decent quality potentiometer and a high-resolution ADC and run with it. I've also seen some rotary hall effect encoders online, and that is appealing to me because the non-contact nature seems like it'd be smoother and more reliable, but they're also like 40 dollars each and I need at least 2 and IDK if I want to spend that much.

Any other suggestions and/or good places to get cheaper rotary hall effect sensors?

CopperHound
Feb 14, 2012

Probably far from the most graceful solution, but the first thought I had was modifying an encoder from a joystick to work a full 180 degrees (and maybe adjusting gear ratio for desired resolution):

...Or just take apart a $15 digital protractor and see what they do.

e: that looks like a better idea below. Anything mechanical will introduce some lash.

CopperHound fucked around with this message at 02:26 on Jul 29, 2019

My Rhythmic Crotch
Jan 13, 2011

AS5047U is 14 bit. You just need the breakout board and 3d print (or attach somehow) a magnet above the chip, done.

I'm not sure if there is a 16 bit solution out there. Anything is better than trying to do it with a pot, as they are so noisy.

Foxfire_
Nov 8, 2010

I think you should rethink your resolution goals. 180/65535=0.0027 degrees, which is very, very small. There is literally nothing on digikey in a purpose built encoder with that resolution and the closest things are $600-1200 for 0.005 degree steps. All of the hall sensors they list also have nonlinearities hundreds of time bigger than that.

You could do a pot or a hall and measure more than 16 bits, but the bottom bits won't have any connection to the shaft angle

evil_bunnY
Apr 2, 2003

My Rhythmic Crotch posted:

AS5047U is 14 bit. You just need the breakout board and 3d print (or attach somehow) a magnet above the chip, done.

I'm not sure if there is a 16 bit solution out there. Anything is better than trying to do it with a pot, as they are so noisy.
That'll be 13bits over 180 and it's still way more than you could get with a pot.

What you need is clearly this beauty of a thing

https://www.digikey.be/product-detail/en/sensata-bei-sensors/LP35-S-AG-16-H30S-28-SI-SM12-T2/LP35-S-AG-16-H30S-28-SI-SM12-T2-ND/9487204


This might be a more appropriate option, but surface mount and no kits so Rhythmic Crotch's choice might be better for prototyping.
https://www.digikey.be/product-detail/en/broadcom-limited/AEAT-8800-Q24/516-3787-ND/6681014

evil_bunnY fucked around with this message at 11:11 on Jul 29, 2019

KnifeWrench
May 25, 2007

Practical and safe.

Bleak Gremlin

Sagebrush posted:

I'm looking for a way to very accurately measure angles in the range of 0 to 180 degrees. 16 bits of resolution would be ideal. I don't want to break the bank.

Cheap requires compromise, as others have said, and smart compromise requires more detailed information about your application.

Does it need to be an absolute encoder, or can you get away with an incremental encoder with a homing routine on boot? Can you add a gearbox to boost the resolution on one side of the shaft? Is this device measuring only, or will there be a motor attached that's using this data as feedback for a control algorithm?

Stabby McDamage
Dec 11, 2005

Doctor Rope

babyeatingpsychopath posted:

Ok. I've set a feature freeze on this:
12 high-power white LEDs, 3V Vf, 150mA each, total 1800mA
(1-4)x 5-33V -> 3.3v voltage modules, each driving a parallel string of 3 LEDs through...
(1-4)x constant-current driver with PWM dimming
1x ATTiny45 driving the PWM dimming. It will have a voltage divider feeding its ADC, and will detect the maximum voltage it's seen over the last X00hours, and assume that's the system voltage, and set its pwm dimming based on that system voltage. Maybe this gets a jumper setting
Input assumptions:
Vin is a variable voltage from 4-32V. Maximum charging voltage on the 24V string is 32.2V, but it shouldn't be on charge with the lights on. 4V on a 6V battery is unhealthily low. I guess this means the 6V input doesn't get dimming, since that input would drop below the limit of the input modules, and a buck-boost module is an order of magnitude more expensive.

I can find 500mA CC drivers and 500mA wide-input-voltage buck converters. Does anyone have a part number for 2A versons of the same, just to lower chip count? I'd like this design to be physically as small as possible so I can churn the driver boards out for the lowest cost. The actual panels are roughly 300mm circles "to simulate the full moon" but those are going to be in some cheap plastic. Ideally the driver boards are going to be ~20mm on a side so I can panel a TON of them for fab. That would mean a 3-chip-plus-passives solution. I don't THINK I have to worry about thermal effects, but the board will eventually be potted in epoxy to make it waterproof, so maybe be conservative with the power?

If the LEDs are always seeing 3.3V from the regulator and being current-regulated by the controller, why does the ATtiny need to care what the source voltage is? It should be the same brightness if it's 5V going in or 24V. The only difference would be current drawn from the source, right?

Shame Boy
Mar 2, 2010

If you need to measure teeny tiny angles just make an enormous slotted disk the size of a house or something, it'd certainly be the most fun solution anyway.

e: Actually that Japanese transistor history video I linked in here a while ago had a creative solution to this - the only temperature gauge they could get that could read the temperatures they were working with had far too little resolution to use for manufacturing semiconductors, so they attached a little mirror to the needle and reflected light off it onto the wall across the room and used the position of the light on the wall instead :v:

Shame Boy fucked around with this message at 21:08 on Jul 29, 2019

evil_bunnY
Apr 2, 2003

Shame Boy posted:

they attached a little mirror to the needle and reflected light off it onto the wall across the room and used the position of the light on the wall instead :v:
LOL they made a galvo thermometer.

Ambrose Burnside
Aug 30, 2007

pensive
I've got a 12V piezo transducer (buzzer with no oscillator circuit on board, p sure thats a transducer) that I'm indirectly driving with an Arduino; it's pretty high-draw for a buzzer, possibly higher than the BJTs i've got on hand are rated for. I want to 'downrate' the buzzer somewhat while still permitting volume adjustment, so basically imposing a 'cap' on max current draw. Is lowering the supply voltage (within min/max specs) an ok way to do this, vs sticking resistors in there? Both lower the max apparent volume, but I've never run into a deliberate use of voltage control for this purpose (not that I've looked super hard).
Any weirdness that tweaking the voltage will introduce vs sticking to limiting current, assuming it's within spec and probably never more than 15-20% lower than nominal 12V? I have to use an adjustable buck converter for powering the buzzer no matter what, so just going with something a little lower than 12 doesn't take any extra components.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Stabby McDamage posted:

If the LEDs are always seeing 3.3V from the regulator and being current-regulated by the controller, why does the ATtiny need to care what the source voltage is? It should be the same brightness if it's 5V going in or 24V. The only difference would be current drawn from the source, right?

For the dimming. Hook up to 24V batteries, turn knob down to 12V, PWM@50% or whatever. I could do 3V=10% or some other minimum -> rail voltage -10%=full on.

Also, ATTINY5-TS8R looks to be the juice. A-D converter, $.25/each, -40-125C heat resistance. SOT-23-6 package. TIIIIIINY. I'm moving on to the driver chips now. Once those are selected, I can size my buck converter(s).

Sagebrush
Feb 26, 2012

Your LEDs don't care what kind of power supply you have because they're running through a buck converter. Whether you put in 5v or 32v, you're getting 3.3v out; the difference is that with a higher input voltage there will be less current drawn from the pack. Your LEDs will always see the same current and voltage because you're using those drivers, so 50% PWM on a 24v input will look exactly the same as 50% PWM on a 6v input.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Sagebrush posted:

Your LEDs don't care what kind of power supply you have because they're running through a buck converter. Whether you put in 5v or 32v, you're getting 3.3v out; the difference is that with a higher input voltage there will be less current drawn from the pack. Your LEDs will always see the same current and voltage because you're using those drivers, so 50% PWM on a 24v input will look exactly the same as 50% PWM on a 6v input.

Yeah, that's 100% the point. This system works precisely like a big dumb resistive lamp on a rheostat, but is LEDs, so they keep the same color all the way across the dimming range. Even at low dimming voltage, most of the drivers I'm looking at have >70% efficiency, which is still way better than an incandescent.

BattleMaster
Aug 14, 2000

You're dimming it based on what the input voltage is, so if you want to go and run the same device off of like a 5V supply instead (for example) it will only ever be at less than 25% brightness?

edit: Or do you mean that the pot for selecting brightness is going to be between the input voltage and ground so turning the pot will output a voltage between 0 and input? Why not just put the pot between 3.3V and ground so you don't need to care what the input is? You can use the 3.3V rail as the ADC reference voltage so 0 to 3.3V is the full scale

BattleMaster fucked around with this message at 01:44 on Jul 30, 2019

Sagebrush
Feb 26, 2012

babyeatingpsychopath posted:

Yeah, that's 100% the point. This system works precisely like a big dumb resistive lamp on a rheostat, but is LEDs, so they keep the same color all the way across the dimming range. Even at low dimming voltage, most of the drivers I'm looking at have >70% efficiency, which is still way better than an incandescent.

Oh, I see, your post was more about how the ADC will handle a variable input voltage. I think.

You are in luck: there is a Vref pin you can use to feed the ADC with a peak voltage level. So your ATTiny might be running on 5v, but you can put 3v3 into Vref and then it will treat 3.3v as a 1024 and 1.65v as 512 and so on. You can use a voltage divider scaled to ensure that your input voltage never goes above the chip's maximum, feed that into Vref, and also use it to feed your potentiometer, and it'll work identically no matter how the power changes.

e: beaten

Leandros
Dec 14, 2008

Do charge circuits/battery level indicators work purely on the voltage measured across the terminals of the battery to find the charge or is there some time integration of the amperage being compared to the expected charge which is programmed in? I found some lithium batteries to add to/replace the one in my wireless headphones but I don't want to overcharge anything and set my head on fire (I may still chicken out on the entire endeavour because of this). Would it be a healthy thing to hook up heterogeneous capacity batteries in parallel?

Leandros fucked around with this message at 16:53 on Jul 30, 2019

KnifeWrench
May 25, 2007

Practical and safe.

Bleak Gremlin

Leandros posted:

Do charge circuits/battery level indicators work purely on the voltage measured across the terminals of the battery to find the charge or is there some time integration of the amperage being compared to the expected charge which is programmed in? I found some lithium batteries to add to/replace the one in my wireless headphones but I don't want to overcharge anything and set my head on fire (I may still chicken out on the entire endeavour because of this). Would it be a healthy thing to hook up heterogeneous capacity batteries in parallel?

It's not advisable in general, as different cell chemistries (and, indeed, even identical cells from different manufacturing lots) will have different internal impedances, which will degrade the life of your franken-pack because the charging current will be applied asymmetrically, and then the cells will charge each other to compensate. It's hypothetically doable, though, as long as the min and max voltages are the same, and you match their voltages before the first time you connect them.

See answers to this stack exchange question for more detail and better presentation: https://electronics.stackexchange.com/questions/126673/charging-li-ion-batteries-in-parallel

In short, I probably wouldn't do it, but if I did, I would opt to replace rather than add (as adding may be counterproductive for your goal of longer runtime), and I would be very certain the chemistries are comparable before doing so, and I would definitely not charge them while I was wearing them.

Shame Boy
Mar 2, 2010

Leandros posted:

Do charge circuits/battery level indicators work purely on the voltage measured across the terminals of the battery to find the charge or is there some time integration of the amperage being compared to the expected charge which is programmed in? I found some lithium batteries to add to/replace the one in my wireless headphones but I don't want to overcharge anything and set my head on fire (I may still chicken out on the entire endeavour because of this). Would it be a healthy thing to hook up heterogeneous capacity batteries in parallel?

Depends, some of them just use the voltage and wing it, some of them track current in / current out.

Probably a bad idea to just replace one cell in a battery pack regardless of what else is going on though, if that's what you're describing...

poeticoddity
Jan 14, 2007
"How nice - to feel nothing and still get full credit for being alive." - Kurt Vonnegut Jr. - Slaughterhouse Five
On the topic of lithium cells, I recently tried to salvage a pair of 18650s from a USB battery pack that wouldn't charge. Apparently I managed to tear the casing open while trying to liberate a battery or something and very angry sounding fire came out along with some unpleasant smelling smoke.

Not sure what exactly happened, but be careful with lithium cells, folks.

Ambrose Burnside
Aug 30, 2007

pensive
who doesn't love a good reactive metal fire. keeps you on your toes, reminds you to grab a fire extinguisher for the shop and change the smoke detector batteries, all that good stuff

Unperson_47
Oct 14, 2007



I think there's a BigClive video where he takes apart a lithium battery and it ignites. Thankfully he was putting the pieces in a metal dish but burning pieces were still going all over his workbench and around more flammable stuff.

Adbot
ADBOT LOVES YOU

Shame Boy
Mar 2, 2010

Unperson_47 posted:

I think there's a BigClive video where he takes apart a lithium battery and it ignites. Thankfully he was putting the pieces in a metal dish but burning pieces were still going all over his workbench and around more flammable stuff.

That wasn't even a lithium battery, it was a nickel-metal-hydride battery:

https://www.youtube.com/watch?v=tBg4ximDrsk

I'm guessing it's mostly down to the super duper high surface area of the active chemical bits meaning it can react with oxygen so fast that you don't even need the substance to be particularly dangerous on its own to get some self-igniting fun. I bet even a car battery would do something like this if you took the plates out and got them dry fast enough (maybe with a vacuum desiccator) and then just let the air hit them all at once.

Shame Boy fucked around with this message at 00:13 on Jul 31, 2019

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply