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
Blackhawk
Nov 15, 2004

SnoPuppy posted:

How precise do you actually want it (and what is the sampling rate)? Also, does the datalogger already have an analog to digital converter? Many PICs and other micro controllers have them built in already, although I don't know if the error will be sufficiently low.

If you don't have any input impedance needs, I would recommend just using a resistor divider network with smaller, high accurate resistors (probably metal film <= 1%). Smaller resistors will have less thermal noise, although depending on the ADC it might be overkill.

The datalogger is a blackbox, but yeah it already has an ADC. The problem is the ADC in the logger has a fixed voltage range of 0-3.3V and the sensor has a fixed voltage range of 0-5V, and I need to interface the two. The sample rate will be between 500 and 1000Hz.

Adbot
ADBOT LOVES YOU

SnoPuppy
Jun 15, 2005

Blackhawk posted:

The datalogger is a blackbox, but yeah it already has an ADC. The problem is the ADC in the logger has a fixed voltage range of 0-3.3V and the sensor has a fixed voltage range of 0-5V, and I need to interface the two. The sample rate will be between 500 and 1000Hz.

Well a resistor divider will still be the lowest cost and lowest noise option. a 1K resistor will produce around 4 nV/sqrt(f) of voltage noise. With your bandwidth, that would amount to about 126 nV of noise. How many bits is the ADC (and, more importantly, how sensitive and accurate is the pressure transducer)? That noise is well below even a 16 bit ADC.

The only reason you wouldn't want to use an R-divider is that it will have the effect of setting the input impedance of your ADC at a much lower value, forcing your transducer to supply more current.

Although, since the transducer outputs 0-5v, I would suspect it is already buffered. If you want, look at the max current it can source and make sure that it is less than the current in the R-divider.

ANIME AKBAR
Jan 25, 2007

afu~
A resistor divider should work fine, as long as you account for it's impedance. It should be high enough that it won't load down the sensor, but low enough that the ADC sampling capacitor will charge fully in the sample period. Check the datasheet for the sensor and your adc. You'll likely find that there is a good range of impedance that will work. If the impedance is too much for your adc, you could slow down its sampling time, or buffer the signal with an op amp. If the op amp is good (something with low offset in the microvolt range), the error should be negligible.

Delta-Wye
Sep 29, 2005

mtwieg posted:

A resistor divider should work fine, as long as you account for it's impedance. It should be high enough that it won't load down the sensor, but low enough that the ADC sampling capacitor will charge fully in the sample period. Check the datasheet for the sensor and your adc. You'll likely find that there is a good range of impedance that will work. If the impedance is too much for your adc, you could slow down its sampling time, or buffer the signal with an op amp. If the op amp is good (something with low offset in the microvolt range), the error should be negligible.

Don't want to sound retarded, but if he's buffering with an opamp anyways, couldn't he dump the R-divider completely, and just use an opamp amp with a gain of 3.3/5 ~= .66?

EDIT: maybe this is what you mean *shrug*

Innominate
Sep 2, 2004
The Innominate

Nubile Cactus posted:

What's a good way to get into microprocessors? I'd like to get one of the cheaper Atmega chips to learn with, but I'm not quite sure what'd be the best introductory/cheapest way to learn how to program the chip. I've seen some programmers such as the STK500 (something around that I think) but I don't really want to spend $50 or $100 on this quite yet.

Any recommendations? The atmel butterfly looks slightly interesting, but I'd rather just work with the microprocessor and various components I already have instead of the integrated lcd/breakout/etc on the butterfly.

Well what level are you at? The cheapest, fastest, simplest way to get into microcontroller development is probably the picaxe. They're rather slow to the point of often being underpowered, but have free programming software, a trivial to build programming interface, and the chips can be had for just a few dollars.

http://www.rev-ed.co.uk/picaxe/

carticket
Jun 28, 2005

white and gold.

Does anyone have any familiarity with purchasing and interacting with image sensors? I'd like to start getting into some embedded computer vision projects, but I don't want to rely on dismantling GameBoy cameras for sensors that aren't very good anyway. I'd like to be able to get a camera element and feed it into an ADC and process from there, etc, etc.

TwystNeko
Dec 25, 2004

*ya~~wn*
So I just saw this really cool Instructable about Charlieplexing LEDs.

It's a neat way to control more LEDs than you have pins on a microcontroller. I'm still sort of parsing it through right now.

carticket
Jun 28, 2005

white and gold.

TwystNeko posted:

So I just saw this really cool Instructable about Charlieplexing LEDs.

It's a neat way to control more LEDs than you have pins on a microcontroller. I'm still sort of parsing it through right now.

That's a bit confusing. I took a quick glance at it, and I think I'll stick with cascaded shift registers.

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik

Innominate posted:

Well what level are you at? The cheapest, fastest, simplest way to get into microcontroller development is probably the picaxe. They're rather slow to the point of often being underpowered, but have free programming software, a trivial to build programming interface, and the chips can be had for just a few dollars.

http://www.rev-ed.co.uk/picaxe/

a nicer thing might be the AVR butterfly. It's 20 bucks, plus the cost of a serial cable and a little work to program it. But you get an ATMega chip programable in C.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


TwystNeko posted:

So I just saw this really cool Instructable about Charlieplexing LEDs.

It's a neat way to control more LEDs than you have pins on a microcontroller. I'm still sort of parsing it through right now.

I like it. It's elegant, reasonably simple, and trades hardware simplicity for software complexity.

Basically, you set up a big bidirectional array and set only the pair you want to "output" mode, then one pin high and one low so your controller is both sourcing and sinking the LED current with all other current paths seeing two or more LEDs and/or hi-Z pins.

carticket
Jun 28, 2005

white and gold.

Zaxxon posted:

a nicer thing might be the AVR butterfly. It's 20 bucks, plus the cost of a serial cable and a little work to program it. But you get an ATMega chip programable in C.

Do the AVRs have a free IDE like MPLAB with a free integrated C compiler? That's my only gripe, really. The advanced PIC stuff is done in C, which isn't free.

Locker Room Zubaz
Aug 8, 2006

:horse:
~*~THE SECRET OF THE MAGICAL CRYSTALS IS THAT I'M FUCKING TERRIBLE~*~

:horse:

Mr. Powers posted:

Does anyone have any familiarity with purchasing and interacting with image sensors? I'd like to start getting into some embedded computer vision projects, but I don't want to rely on dismantling GameBoy cameras for sensors that aren't very good anyway. I'd like to be able to get a camera element and feed it into an ADC and process from there, etc, etc.

couldn't you hack apart a USB web cam and extract the bitstream?

carticket
Jun 28, 2005

white and gold.

Cuw posted:

couldn't you hack apart a USB web cam and extract the bitstream?

I don't know, that's why I was asking. I was hoping there was someone here who has more experience with this.

ANIME AKBAR
Jan 25, 2007

afu~
Now for something different: Switching supply theory

To understand switching supplies, we must first understand inductors (I'll assume people know the basics of diodes and capacitors). Inductors are passive devices that can be thought of as being analogous but opposite to capacitors. Capacitors store potential energy in the form of charge, while inductors store energy in the form of current.

As we saw before, capacitors are governed by the following equation:


Inductors are governed by this similar-looking equation:


So a constant current across a capacitor will result in a changing voltage, the relationship between the current and the rate of change in voltage being called capacitance. Conversely, a constant voltage across an inductor will result in a changing current, the relationship between the voltage and the rate of change in current being called inductance.

Another simple way to think of capacitors and inductors is work is required to change the voltage of a capacitor (and therefore they "resist changes in voltage), and work is also required to change the current through an inductor (and therefore they "resist" changes in current).

Switching supplies come in many varieties. For this, I'll be using the one I'm most familiar with, the boost converter. Consider the following circuit:



If the switch is open (we'll call this the "off state"), then current will flow through the inductor, diode, and into the load. The inductor won't do anything as long as the load current stays the same, so the load will just see a DC voltage. However, if we close the switch (turning it "on"), the inductor will be in parallel with the voltage source, meaning its current will start to ramp linearly. In fact, as long as the supply can deliver it, the current will increase indefinitely. Note that the energy delivered by the power supply isn't wasted; it's stored in the inductor.

Now if we open the switch, something interesting will happen. The current through an inductor cannot change instantly, so the current will flow through the only path available to it, which is through the diode to the load. If that load is a resistor, then the voltage across that resistor will be its resistance multiplied by the current through the inductor. The point is, this voltage can easily be greater than the supply voltage we started with. However, that will only be momentary, since the inductor's current will gradually decrease exponentially. By turning the switch on and off, we can deliver momentary jumps in voltage to the output.

This is useless as is, but if we replace our resistor load with a capacitor, then we get something useful. The capacitor stores some of the charge delivered by the inductor (current is nothing but moving charge, btw), so its voltage will rise, but will not decline, since there is no path for current to take out of the capacitor, due to the diode, which acts like a one way door. Now if we "cycle" the thing a few times (each cycle being a period where the circuit is turned on then off), the capacitor voltage will rise each time. If we were to add a current load with the capacitor, then the capacitor could deliver current to it while the power supply cannot (when the switch is on). During this time, the load draws current from the capacitor, so its voltage will decrease, until the switch is off again and the inductor gives it another boost. If you look at the voltage on the output, you would see that it rises and falls predictably; this is called "ripple."

We can say a few things about this circuit:
-The longer the switch is on, the more energy will be stored in the inductor, and thus to the load.
-It also takes some finite amount of time fore the inductor to deliver that energy to the load.
-The time it takes for the current to increase and decrease depends on the inductance. Larger inductances will take longer, and smaller inductances charge faster.
-If the switch is turned on again before the inductor's current falls to zero, then we are operating in what's called "continuous mode." If it does, then it's in "discontinuous mode"
-The output voltage cannot be less than one diode drop below the supply voltage. This certain circuit, the boost converter, is meant to give an output voltage greater than its input.

Perhaps now you've realized why we've learned about PWM already. It's because a PWM is precisely what we need to control one of these. By using an amplifier device, such as a FET or a transistor, as the switch in the above circuit, we can control its operation with a PWM signal. How much energy is delivered to the output, and therefore what voltage is seen at the output, is controlled by the on-time of the circuit. Thus by varying the duty cycle of our PWM, we can easily control this.

However, if our goal is to regulate the output voltage precisely, then this will not do. The output behavior is governed by far too many unpredictable variables to be controlled manually. If we were to let it run as is, the output would likely either run away to some extremely high voltage until something fried (most likely the diode), or it would reach a somewhat stable voltage level, but what level would be hard to predict.

Therefore we need a way for the PWM to adjust its own duty cycle by sampling the output. Once again we will look to probably the most important tool in controlled system design:

Next time: Negative feedback systems

ANIME AKBAR fucked around with this message at 07:56 on Apr 23, 2008

Three-Phase
Aug 5, 2006

by zen death robot

mtwieg posted:

Now for something different: Switching supply theory
:words:

Just one note - you really want a Schottky diode for this sort of supply. Normal diodes have a voltage drop of around 0.7, while a Schottky diode has a much lower voltage drop.

Still, excellent writeup.

ANIME AKBAR
Jan 25, 2007

afu~
Yeah, I'm going to go over efficiency equations and other odds and ends once all the basics are out of the way.

Shottkys with good reverse breakdown voltages and low capacitances aren't cheap though. For prototyping I usually go with a more common rectifier diode, then worry about the extra 10% in efficiency later.

pim01
Oct 22, 2002

mtwieg posted:

Now for something different: Switching supply theory

Great explanation, thanks!

Slightly related question: I'd like to measure ripple/switching noise from a power supply (because it's making one of my amps have a terribly high noise floor). I don't have an oscilloscope, and the scope at work broke. I do have some audio visualization software I wrote, which I can easily modify to use for more general 'scoping prurposes. To use my soundcard's input, I guess I'll have to bring the voltage down to line level, say 1 or 2 volts. Will using a resistor devider still allow me to make somewhat useful measurements?

hobbesmaster
Jan 28, 2008

Mr. Powers posted:

Do the AVRs have a free IDE like MPLAB with a free integrated C compiler? That's my only gripe, really. The advanced PIC stuff is done in C, which isn't free.

Theres a free gcc toolchain. For windows there is WinAVR to use as an IDE. In linux... vim+gcc counts, right?

(both are free as in speech)

Locker Room Zubaz
Aug 8, 2006

:horse:
~*~THE SECRET OF THE MAGICAL CRYSTALS IS THAT I'M FUCKING TERRIBLE~*~

:horse:

Mr. Powers posted:

I don't know, that's why I was asking. I was hoping there was someone here who has more experience with this.

my DSP teacher had a little camera he bought at a robotics shop that interfaced via serial port with our DSP and it had an integrated ADC on it. It was only like 1MP but i will ask him where he got it because that seems to be what you are looking for. I would think though that a skilled programmer could interface with a webcam but I don't know. I will google it I guess.

Edit: Heh found what you were looking for http://www.jrobot.net/Projects/AVRcam.html

ANIME AKBAR
Jan 25, 2007

afu~

pim01 posted:

Great explanation, thanks!

Slightly related question: I'd like to measure ripple/switching noise from a power supply (because it's making one of my amps have a terribly high noise floor). I don't have an oscilloscope, and the scope at work broke. I do have some audio visualization software I wrote, which I can easily modify to use for more general 'scoping prurposes. To use my soundcard's input, I guess I'll have to bring the voltage down to line level, say 1 or 2 volts. Will using a resistor devider still allow me to make somewhat useful measurements?
It couldn't hurt. Worst case scenario is that it impedance of the divider causes the signal to attenuate. What kind of input impedance is there on the input?

Ripple on switching supply is normally due to improper sizing in the capacitor and inductor. what values are best generally depends on the load and switching frequency. Most of the time, simply having more bypass capacitance will help out.

And ripple will not cause noise. If you're seeing true white noise, then it's not due to ripple, since ripple is a specific signal, with a certain characteristic spectrum. It might cause ripple to on some of your circuits, but not actual noise.

SnoPuppy
Jun 15, 2005

pim01 posted:

Great explanation, thanks!

Slightly related question: I'd like to measure ripple/switching noise from a power supply (because it's making one of my amps have a terribly high noise floor). I don't have an oscilloscope, and the scope at work broke. I do have some audio visualization software I wrote, which I can easily modify to use for more general 'scoping prurposes. To use my soundcard's input, I guess I'll have to bring the voltage down to line level, say 1 or 2 volts. Will using a resistor devider still allow me to make somewhat useful measurements?

You might be able to AC couple to your sound card's input. Just put a large value capacitor directly in the signal path. I would double check with a volt meter first though (I have never done this and it seems like it could be dangerous to stick high voltages near your PC). What is the voltage of your power supply and the switching frequency?

The problem with a resistor divider is that it will cut into your dynamic range significantly. For example, if you are trying to see 1v of ripple on a 20v power rail, you have already reduced your dynamic range by a factor of at least 20. If you AC couple then you should effectively block the DC components of the signal while passing only the ripple.

Also, how do you know your noise floor is higher without access to a scope? It could very well be a ground loop introducing the noise. Ripple wouldn't show up as broad band noise - just some wide-ish spikes in the spectrum.

pim01
Oct 22, 2002

mtwieg posted:

And ripple will not cause noise. If you're seeing true white noise, then it's not due to ripple, since ripple is a specific signal, with a certain characteristic spectrum. It might cause ripple to on some of your circuits, but not actual noise.

SnoPuppy posted:

Also, how do you know your noise floor is higher without access to a scope? It could very well be a ground loop introducing the noise. Ripple wouldn't show up as broad band noise - just some wide-ish spikes in the spectrum.

Well, colour me educated. I'll have to troubleshoot some more for the cause of my noise-issues, then. Thanks :).

Still going to measure the things, just for the learning experience. I'll try removing the DC component with a big capacitor, hadn't thought of that option.

StumblyWumbly
Sep 12, 2007

Batmanticore!
Using a mic input for signal measurement is a neat idea, but the soundcard should limit the incoming signal to whatever the range of human hearing is. That's what, 30kHz? Plus, you may run into grounding problems which could set something on fire. If your signal on board A is 1V, but ground on board A is 25V higher then ground on your computer... things get bad.

Also, to clarify what mtwieg was saying: The simplest symptom of switching supply noise is a spike in a signal that you see whenever the switch turns on. If there is a pattern to your switching (which is fairly common), there'll generally be a pattern to your noise.

To solve a big noise problem, you need to look at the signals with a scope, verify all relevant grounding on the boards and for inputs, outputs, and power, and just do a whole mess of stuff.

Good luck.

Nerobro
Nov 4, 2005

Rider now with 100% more titanium!
So, here's where I'm at.

I have a 5v SMPS. I want to use it as a current source for my LED headlight. I understand you can use voltage regulators as current sources by fooling the sense pin. Using a shunt resistor is what comes to my mind immediately.

SO, to get a 5v response back to the SMPS I have, I'd need to drop at least 5 volts across the shunt resistor. While the math for that is easy, finding a resistor that can handle 7w isn't. And I'm not so fond of the idea of burning off my power like that.

My next genius thought was to find a regulator that had a lower input voltage. it seems the lowest common input voltage is 1.2-1.25v. And while that's a whole lot better than 5, that would still mean disapating more than a watt from the shunt resistor.

What I think my solution is, is to use an op-amp to amplify the voltage from a shunt resistor. Say, a .05 or .005 ohm high precision resistor.

Is this a good plan? Am I completely out of my gourd for thinking about this? Or should I just spend the $6-8 each for the 1-3-5w led drivers off of ebay.

*goes off to re-read the op-amp tutorial*

Zuph
Jul 24, 2003
Zupht0r 6000 Turbo Type-R
I have a question regarding servo motors.

I recently discovered this website: http://leavemealonebox.com

Essentially, it's a box with a single switch on it. When the switch is flipped, a hand comes out of the box, and turns the switch off, then disappears back into the box. He uses two servo motors controlled by a microcontroller to open the lid, and flip the switch back. The way the hardware is designed, it appears that the servos will move into a set position when a port line is placed at Logic 1, and return to their original positions when the port line is returned to Logic 0.

I know quite a bit about Microcontrollers, but absolutely nothing about interfacing with motors or servos. How would I construct a device like that? Actually, is there a site out there for beginning robotics for people that aren't completely new to electronics? I'm a 3rd year EE student, so I've got a more than basic grasp of electronics, I just don't know anything about robotics.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Zuph posted:

I have a question regarding servo motors.

I recently discovered this website: http://leavemealonebox.com

Essentially, it's a box with a single switch on it. When the switch is flipped, a hand comes out of the box, and turns the switch off, then disappears back into the box. He uses two servo motors controlled by a microcontroller to open the lid, and flip the switch back. The way the hardware is designed, it appears that the servos will move into a set position when a port line is placed at Logic 1, and return to their original positions when the port line is returned to Logic 0.

I know quite a bit about Microcontrollers, but absolutely nothing about interfacing with motors or servos. How would I construct a device like that? Actually, is there a site out there for beginning robotics for people that aren't completely new to electronics? I'm a 3rd year EE student, so I've got a more than basic grasp of electronics, I just don't know anything about robotics.

Think of a servomotor as a device where position is encoded by a PWM signal. If you output a signal with pulse width X, the motor will attempt to drive itself to X. Common servos have 90 degrees of output with 0deg having a 1ms pulse width and 90deg having a 2ms pulse width, linearly interpolated, with one pulse every 20.0ms.

If you output 1ms pulses every 20ms, the servo stays at 0. If you start outputting 2ms pulses, it moves until its arm is at 90. 1.5ms pulses have the arm at 45. As I understand it, the 20.0ms should be pretty precise, and the more precise your widths are, the more precisely you can control your arm, to a point.

You should be able to get it from there.

LOL 9000
Nov 16, 2002
STFU

Nerobro posted:

What I think my solution is, is to use an op-amp to amplify the voltage from a shunt resistor. Say, a .05 or .005 ohm high precision resistor.

Is this a good plan? Am I completely out of my gourd for thinking about this? Or should I just spend the $6-8 each for the 1-3-5w led drivers off of ebay.

*goes off to re-read the op-amp tutorial*

Ok, so if I understand it correctly, you want a current controlled voltage source controlled by a voltage controlled current source.

Anyways, the easiest approach in my mind would be to use a current shunt (which can be as low as 1 milliohm, depending on the current, and still give accurate readings in my plan) and an current sense amplifier such as TI's INA197 50 gain amp (which from my experience is the best current sense amp available).

So if you went with my plan you would then have an output voltage of your current sense amp that corresponds to the current flowing through your resistor. Actually, and this is very dependent on your source, but you might be able to use just the current sense amp and connect its output pin directly to the sense pin of your source. All you would need to do is to select a resistor of proper value that would give you 5V on the output of the current sense amp at your desired current level.

Really, after thinking about it some more, all you need are the CS amp, the CS shunt resistor, and a bias for the amp. edit: And a bypass cap on your CS amp for noise rejection if it matters.

LOL 9000 fucked around with this message at 04:07 on Apr 25, 2008

LOL 9000
Nov 16, 2002
STFU
Here is an MS Paint schematic of the circuit I am describing, it is actually incredibly simple, just a big unknown if your 5V source will oscillate like a banshee. Also, you need to provide a rail voltage for the amp.

Only registered members can see post attachments!

Nerobro
Nov 4, 2005

Rider now with 100% more titanium!
This is the most confusing thing about electronics. There's often JUST THE RIGHT part for a given application. But hell if I know what it is, what it's called, or even necessarily what to look for.

I just looked up that part. That's... just plain awesome. It's also $2.50 a chip. Which isn't so bad. ;-) it's cheaper than buying completely new PSU parts.

The whole point of this is so I don't end up burning off 2-3Wh through resistors.

Mach Won
Jun 17, 2004

Is UNC playing? My post is either whining about (1) ref favoritism, (2) unfair recruiting/player caliber, (3) opposing team sucking or (4) the inevitable UNC win. The day you see me giving UNC credit for anything is the day someone hacked my account.

Roy era: 1-16 :qq: RIVALS!!!!!

Nerobro posted:

This is the most confusing thing about electronics. There's often JUST THE RIGHT part for a given application. But hell if I know what it is, what it's called, or even necessarily what to look for.

Seriously, it seems like there are billions of IC's, how are you supposed to know what to look for beyond obvious stuff like op amps and regulators?

slackingest
Dec 9, 2006

mosfet.swf

Mach Won posted:

Seriously, it seems like there are billions of IC's, how are you supposed to know what to look for beyond obvious stuff like op amps and regulators?

You can sometimes get closer to something you're looking for by searching through application notes. The big chip manufacturers have searchable databases, and sometimes it can be a little easier to figure out what's useful if you see, say, 'circuit for measuring power draw' as opposed to 'current accumulator'.

That, and familiarity. Nothing beats experience.

LOL 9000
Nov 16, 2002
STFU

Nerobro posted:

This is the most confusing thing about electronics. There's often JUST THE RIGHT part for a given application. But hell if I know what it is, what it's called, or even necessarily what to look for.

I just looked up that part. That's... just plain awesome. It's also $2.50 a chip. Which isn't so bad. ;-) it's cheaper than buying completely new PSU parts.

The whole point of this is so I don't end up burning off 2-3Wh through resistors.

But there is still the problem of needing Vcc for the amp that is above 5V. If you have room for a 9V battery, it would work, where does your 5V supply get its input power from?

Nerobro
Nov 4, 2005

Rider now with 100% more titanium!
a 9.6v NiMH pack. :-) so that should work nicely.

LOL 9000
Nov 16, 2002
STFU
Also, you (obviously) don't necessarily have to use that particular current sense amp, I just recommended it because it has the best noise immunity from my experience. If power loss is really a concern, you could use a 100 gain amp and a smaller resistor, just it would be more noise susceptible, but since your load is LEDs, you probably wouldn't even notice if it's way off. And better yet, you can fine tune the current going through your LEDs by swapping out different resistors for your current sense resistor if you want brighter or dimmer output.

Also the SOT-23 package is very small, and you risk breaking leads if you aren't careful. I don't know how your whole setup is constructed, but a through hole package would more likely be easier to work with.

But if you are really feeling adventurous and want to test your reverse engineering skills, you could crack into your 5V supply and tweak its internal overcurrent protection circuitry (if it is something active and not just a fuse) to do all the work for you, but that is a little extreme. Stick with the current sense amp, it's only 2 parts total in addition to your supply and LEDs.

LOL 9000 fucked around with this message at 01:31 on Apr 26, 2008

Nerobro
Nov 4, 2005

Rider now with 100% more titanium!
Yeah.. my SMPS is pretty much sealed. Otherwise I'd be looking at other ways of screwing with it.

I'll go digging at digikey, see what else i can come up with. I just put in an order with TI for samples of that chip.

LOL 9000
Nov 16, 2002
STFU

Nerobro posted:

Yeah.. my SMPS is pretty much sealed. Otherwise I'd be looking at other ways of screwing with it.

I'll go digging at digikey, see what else i can come up with. I just put in an order with TI for samples of that chip.

Also, something of concern if you plan to run your 5V supply with its sense lines at a different voltage than your output, you may damage parts inside of it. Sometimes, as a form of overvoltage protection, a supply will tie its sense lines to its outputs internally with resistors (for a 5V supply they will probably be in the order of 20 or so ohms, you can check if yours has these simply by ohming out +S to + out) known as open sense protection resistors (they prevent the supply from killing itself if the sense lines aren't tied).

Anyways, what my concern is, (and your supply may not even have this problem) is that if you have your +S line at 5V, but your +out line at 1.1V or whatever your LED diode drop is, you could potentially blow out the protection resistor (let's assume it's 20 ohms, that would be .76W, a lot of power for one part, actually the 20 ohm value is probably an order of magnitude too low, but you get the idea).

The fact that your supply has remote sense means it has some sort of internal protection circuitry (or is really really cheap). And as a general rule (for everyone), unless you are intentionally messing with the sense lines (such as making the supply be a current controlled current source) always tie the sense lines to the output leads either at the outputs, or at the point of load (or somewhere in between if you really want), but never short them together or tie the +S to the -Out or the -S to the +Out. That may sound straightforward, but it happens too often.

Zuph
Jul 24, 2003
Zupht0r 6000 Turbo Type-R
I'm having some trouble figuring out how to interface a handful of 14-segment displays to a microcontroller. The micro I'm using has enough power to drive the LEDs directly, but there's no way I can sink the necessary amount of current through the micro to properly multiplex the display. Allegro made a current sinking driver chip at one time, but it has since been discontinued, and Maxim makes a chip that does a fantastic job of controlling the displays directly, but it's $15 a pop, and moreover hard to find.

What are my options here?

Locker Room Zubaz
Aug 8, 2006

:horse:
~*~THE SECRET OF THE MAGICAL CRYSTALS IS THAT I'M FUCKING TERRIBLE~*~

:horse:

Zuph posted:

I'm having some trouble figuring out how to interface a handful of 14-segment displays to a microcontroller. The micro I'm using has enough power to drive the LEDs directly, but there's no way I can sink the necessary amount of current through the micro to properly multiplex the display. Allegro made a current sinking driver chip at one time, but it has since been discontinued, and Maxim makes a chip that does a fantastic job of controlling the displays directly, but it's $15 a pop, and moreover hard to find.

What are my options here?

you can use a BJT or MOSFET low switch to dump the current. A very cheap 2n3904, i think they are $.02 a piece, can deal with 100mA current sustained and 200mA peak and still operate pretty well at 25MHz, although you aren't going to be switching anywhere near that speed.
The only problem with this is you are going to be using a ton of BJTs, one per segment.

Zuph
Jul 24, 2003
Zupht0r 6000 Turbo Type-R

Cuw posted:

you can use a BJT or MOSFET low switch to dump the current. A very cheap 2n3904, i think they are $.02 a piece, can deal with 100mA current sustained and 200mA peak and still operate pretty well at 25MHz, although you aren't going to be switching anywhere near that speed.
The only problem with this is you are going to be using a ton of BJTs, one per segment.

I can drive the segments fine from the Micro (or, in this case, a shift register to minimize port lines), but each segment is common cathode, so I could (theoretically) need to sink up to 300mA of current.

Adbot
ADBOT LOVES YOU

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Zuph posted:

I can drive the segments fine from the Micro (or, in this case, a shift register to minimize port lines), but each segment is common cathode, so I could (theoretically) need to sink up to 300mA of current.

I did a search on digikey for LED Driver, 16-channel, 100mA per channel, and found a couple of decent candidates looking like "IC LED SINK DRVR 16BIT". The data sheet shows a serial data in/out, output enable, failure sensing, thermal shutdown, and 16 outputs in a 24-pin package. $2.94 each.

Is this the kind of thing you're looking for?

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