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
Zuph
Jul 24, 2003
Zupht0r 6000 Turbo Type-R

babyeatingpsychopath posted:

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?

That's almost exactly what I'm looking for, but I need it to sink at least twice as much current.

I think this will work: http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=260144

Adbot
ADBOT LOVES YOU

carticket
Jun 28, 2005

white and gold.

babyeatingpsychopath posted:

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?

I love you. I looked these up for a project I was working on just now, and there is actually an I2C-based LED driver with 16 outputs with brightness control (2 bits per LED). I was doing exactly this, except via cascaded shift registers, and 3 resistors per LED. This saves so much pain and suffering.

zeverken
Sep 26, 2004
I wonder if any of you electronics wizards can help me with something... I need to tape some telephone conversations on tape for my masters thesis. Is there any way to build a RJ11 (telephone plug) to audio jack converter? So i can talk on the phone as usual, but having everything also recorded on an audio tape?

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


zeverken posted:

I wonder if any of you electronics wizards can help me with something... I need to tape some telephone conversations on tape for my masters thesis. Is there any way to build a RJ11 (telephone plug) to audio jack converter? So i can talk on the phone as usual, but having everything also recorded on an audio tape?

Believe it or not, I just built a box that does this (in addition to some other things).

An RJ11 jack has 4 pins. Connect a 500ohm resistor to pin 3, then to the tip on a 1/4" audio jack/plug. Connect the ring of the jack/plug to pin 2. Make sure you don't have the thing plugged in when the phone rings, because there's 100-300VAC on the line when that happens, and it may burn out your recording device.

I have some mono plugs from radio shack whose shell is big enough you could probably mount the resistor inside there. I think they're $2 for 2.

Locker Room Zubaz
Aug 8, 2006

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

:horse:

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.

well there are higher current BJTs, they go up to about 1A, for cheap so current shouldn't be an issue. The real issue will be wiring everything.

Zuph
Jul 24, 2003
Zupht0r 6000 Turbo Type-R

Cuw posted:

well there are higher current BJTs, they go up to about 1A, for cheap so current shouldn't be an issue. The real issue will be wiring everything.

Yeah, that's the trouble I'm trying to keep to a minimum. What I'd really like is a current replacement for the Discontinued Allegro UDN2595A, which does exactly what I need to have done.

ANIME AKBAR
Jan 25, 2007

afu~
Tying things together: Negative feedback

All right, before we make something cool, there are a couple odds and ends to clear up. First of all, we'll need to choose a part to use as the "switch" in the boost converter part of the circuit. What specs you want will affect your choice. BJTs are okay but can only draw so much current, and they're sort of inefficient since they have significant saturation voltages. They are, however, quite fast, and speed is important in some cases. The other main choice is MOSFETs, which are nice because good ones don't have saturation voltages (but rather on resistances, which can be very low) so they're efficient, and they're generally easy to drive, since they don't draw current on the gate. They can also tolerate quite a bit of power. On the other hand, they are usually ill suited to high speed switching due to a nasty characteristic called transverse capacitance, but we'll ignore this for now since we likely won't be going very fast. Think of a MOSFET as being like a transistor; a transistor acts like a current source that is controlled by its base emitter current. A mosfet acts like a variable resistance that is controlled by its gate-source voltage. Just think of it as a little electrically controlled switch, or an SSR (solid state relay).

Also, we'll need some sort of voltage reference. That is we'll need a circuit that generates some predictable voltage that isn't effected by things like supply voltage, noise, etc. You can buy them discretely, but we can build one that gets the job done. Zener diodes won't work to well because we will want our reference to be a small voltage (we'll see why later). So we can instead use a couple normal diodes, feed them some current, and get a voltage drop of about 0.6V times however many diodes there are. Small signal diodes work well because they require less current and typically have better line regulation (more on this later) than bigger devices. For this, we'll make a 1.2V reference using two diodes. You could have more or less, but it really doesn't make a huge difference.

Okay, so we've got all the pieces. Now to put them together. We want to do so in a manner that results in negative feedback. Remember, a system is in negative feedback when a change in its output is fed back to its input in a way that opposes that change in output. So what we want is a closed loop that feeds back information about the output and changes the input.



I already stated that the voltage controlled PWM we made would control the operation of the boost converter, so those two pieces are set. But what about the rest? what is needed to complete the feedback loop?

We need some circuit that will decide if the voltage on the output is too high or too low, and correct the duty cycle of the PWM accordingly. But how will this circuit know what to look for, given that we aren't really certain about any of our supply voltages? It needs the voltage reference. In order for your circuit to output a certain voltage, it must have something to check it against. This applies to all regulators, from the lowliest linears to the mightiest switchers.

We we will make a circuit that will compare our output to our reference and give an output voltage to the PWM. What we want is a voltage amplifier that takes the difference between the reference and our output voltage and amplifies it, preferably by a lot. This is called an error amplifier. This name isn't really a description of the circuit itself, but rather a description of its function. An error amplifier simply takes "error," which in this case is the difference between the output voltage and our reference and amplifier it to something that can drive the feedback loop. Why amplify it you ask? Well it should be obvious that if the error amplifier has a very high gain, it will be more sensitive to error. This will effectively make our entire circuit more accurate.



But what kind of amplifier do we need? Remember that our feedback loop needs to be negative. In order to see if our feedback is positive or negative, we can qualitatively analyze its response in open loop. We simply take our incomplete loop, change one end, and see how that changes the other end of the loop. Then we'll know how to close the loop.

So we'll start at the PWM. What happens if we increase the input voltage of the PWM? Duty cycle decreases. Assuming that the boost converter is in its "on" state while the output of the PWM is high, a shorter duty cycle will decrease its output voltage. Therefore the error voltage (the difference between the reference and the output) will decrease. That's as far as our loop goes. We want to add a our amplifier so that when the change in the PWM input and the change in the error voltage oppose each other. Therefore, we want our amplifier to react to an decreasing error voltage by decreasing the input to the PWM. That will make the feedback negative. So we want a non inverting amplifier, which is one of the basic circuits linked earlier. Keep in mind, though non inverting amplifiers typically amplify with reference to ground, we can make one amplify a differential voltage by simply changing it a bit. This isn't a true differential amplifier circuit, since the output is offset by Vref, but that's fine for our purposes.



You may notice that we can't really compare our 1.2V to the output of the boost converter directly. After all, it's supposed to output voltages much higher than that. What we do then is we use a resistor divider to scale the output voltage down to a range that is close to the 1.2V. These resistors are what let us set our desired output voltage. The closed loop will effectively do its best to keep the output of the resistor divider and the voltage reference equal (if the gain is pretty high, that is). Much like we made the assumption for differential amplifiers with high gain that when they operate in negative feedback their two inputs would be essentially the same, we can make the same assumption here. So our output voltage will be determined by a simple resistor divider equation:
output of divider = Vref = Vout(R2/(R1 + R2))
or
Vout = Vref(1 + R1/R2)
So if we want an output of 20V and our Vref is 1.2V, we just want the ratio of R1 and R2 to be R1 = 15.67*R2.



This is essentially the basics of how the feedback loop operates. There's more to it, of course. We need some guidelines for selecting lots of parameters, such as operation frequency, load and line regulation, component values, etc.

Here's a complete schematic of what we have so far:



Next time: Supply analysis: math n' poo poo

carticket
Jun 28, 2005

white and gold.

mtwieg posted:

Stuff

Is that the sort of stuff you learn in a control theory class? I've been considering taking one for work ever since I started having to do things like implement PID control loops in software. I also found out that my work will reimburse enough tuition to completely cover full time graduate studies, so I am considering complementing my BSEng in Computer Engineering with an master's in EE (I already have most of the foundation classes, it would mostly be just electives).

Nerobro
Nov 4, 2005

Rider now with 100% more titanium!
YOU jerk. I just spent the last three days trying to figure this all out on my own. I just bought an opamp and dug up the circuts so I could mulitply the output of my shunt resistor to make my SMPS behave as a current supply. :-)

Thanks, great writeup.

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!!!!!

Mr. Powers posted:

Is that the sort of stuff you learn in a control theory class? I've been considering taking one for work ever since I started having to do things like implement PID control loops in software. I also found out that my work will reimburse enough tuition to completely cover full time graduate studies, so I am considering complementing my BSEng in Computer Engineering with an master's in EE (I already have most of the foundation classes, it would mostly be just electives).

You wouldn't really get this in a control class. That would mostly cover compensator design for either analog or digital systems, depending on the context of the course.

ANIME AKBAR
Jan 25, 2007

afu~

Mr. Powers posted:

Is that the sort of stuff you learn in a control theory class? I've been considering taking one for work ever since I started having to do things like implement PID control loops in software. I also found out that my work will reimburse enough tuition to completely cover full time graduate studies, so I am considering complementing my BSEng in Computer Engineering with an master's in EE (I already have most of the foundation classes, it would mostly be just electives).

Uhh I learned this in one week in my applied circuit design class. Well, the week before that we built function generators, so I already had the PWM part down.

Kynetx
Jan 8, 2003


Full of ignorant tribalism. Kinda sad.
Apologies if this has already been answered. I read about halfway through the thread and didn't find anything concrete.

I've got a wireless guitar transmitter that is typically powered by a 9-volt transistor style battery. Using Alkaline batteries the typical lifespan is about 4-5 hours. NiMh is abysmal, somewhere around 1 1/2 hours. I called the manufacturer and spoke to an engineer about the possibility of using a 9.6v battery pack of the type found in Tyco R/C cars. The engineer thought it would be perfectly reasonable to run the transmitter at the higher voltage.
Since Audio Technica in their infinite wisdom decided to use spring tabs instead of a normal socket-type mechanism to connect to the battery I had to build an adapter. I bought a cheapo dry-cell 9v battery and gutted it. I soldered wires to the contacts on the inside of the case and then potted the whole mess with epoxy. It works fine. Using standard Molex plugs I can connect the battery to the gutted 9v case and the transmitter powers up and performs perfectly. I used it all through a 6-hour practice without any glitches.
I still have one worry though, maybe two. Firstly, the pack is rated at a capacity of 1000 mAh and presumably is capable of outputting a couple of amps if a dead short occurred. Secondly, I'm concerned that as the battery dies the current could possibly rise to uncomfortable levels as the voltage drops. Is this a legitimate concern? Could I effectively kill two birds with one stone by using a current-limiting resistor? The 9v battery case seems like it would be roomy enough to accommodate a resistor or two. I could certainly make another "adapter" and pot it in epoxy.

ANIME AKBAR
Jan 25, 2007

afu~
Supply Analysis

Okay, so we've got a basic understanding of how this thing works. But we can't expect to be able to throw random part together and expect it to work. We have to make sure that certain parameters of the circuit suit each other.

The key features to keep in mind when we simply want the thing to work (we'll forget about nice things like efficiency for now):
-What is my expected range of input voltage?
-What output voltage do I want on the output?
-What range of current/power draw do I expect on the output?

Determining a ballpark estimation of the power requirement of this thing allows you to determine the two most important qualities of your circuit; inductor size and operation frequency. These are strongly related to each other, and the value of one will be determined by the other. Let's see why:

And if you're not comfortable with the math here, sorry but I'm going to go kind of fast. If you don't understand something, ask me afterwards.

Okay, so we basically have to make sure that our inductor is able to build up enough energy during the on time of the circuit to power the load. Let's derive some things.
When our boost circuit is in the off state (the switch/MOSFET/whatever is on), the current in the inductor will build to a current of
iL = (Vin * ton)/L
Where ton is the on time of the switch.
The energy stored by an inductor is:
EL = (0.5)LI2
Thus the peak energy stored in the inductor, and thus the amount of energy delivered to the load per cycle (assuming 100% efficiency) is:
E = (Vin2 * ton2)/(2L)
So the power delivered is simply this times the number of cycles per second:
P = fop*(Vin2 * ton2)/(2L)
And we want this to be greater than the load power, Pout

Obviously ton can't be greater than the period, or 1/fop.
So what we want to do with this is determine values for L and fop that will work under our worst case scenario, in which Vin is at a minimum and load power Pop is at a maximum. A good rule of thumb is that our circuit shouldn't need to go above an 80% duty cycle to fulfill this requirement. Any more and there may not be enough time for the energy to be delivered to the load during the on time.

So we replace ton with 80% of our period, which is 0.8/fop. We end up with a formula giving the required relationship between L and fop under this condition.
P = fop*(Vin2 * ton2)/(2L) > Pout
becomes:
(Vin(min) * 0.8)2/(2 * Pout(max)) > fop * L
So the product of our frequency and inductance must simply be below some value. Efficiency can be factored in by dividing the load power by our expected efficiency (80% is usually a decent estimate).

So how should we choose our frequency and inductance values? Well generally high frequency is nicer for a variety of reasons. It gives smaller ripple on the output, has faster response to load changes, and will be less noisy (I mean actual noise that comes from your inductor. If it operates in an audible frequency you can literally hear it). Higher frequency also means that your inductor can be smaller, saving space and cost (inductors can be quite big). There are also negative aspects of high frequency that will result in poorer efficiency, but this can usually be avoided with proper component selection. More on this next time. Also it's good to avoid going too high in frequency, lest you start screwing up RF devices. But simply put, high frequency is simply better. I would generally not go past a megahertz, though. The PWM circuit I gave likely won't work that fast anyways. A working supply can be built with frequencies below 10KHz, but it's nice to go at least 20 (if for any reason to avoid the ringing of the inductor). Remember, the frequency is given by the triangle wave generator. When choosing components, use the formula given previously.

Another important value is your load capacitor. Its size must be appropriate to not be effected greatly by the changing currents it will be seeing. We could derive ripple as a function of capacitor size and other parameters, but there's really no point, since it turns out that the bigger your capacitor, the less ripple you will have. It's easier to stick a big electrolytic in there and measure the ripple directly than predicting it. The exception is when you want a low power, very low noise/ripple output for things like instrumentation and such. Then you'll want to give more thought to your load capacitor. More on this next time.

Also you need to decide on the gain of your error amplifier. As I said before, higher gain gives greater accuracy, but when prototyping one of these things you can start off at something low like 50 or 100. If the gain is too high, weird poo poo can happen. For instance if the phase shift across the feedback loop is 180 degrees and the loop gain is greater than 1, you will get oscillations which will gently caress all kinds of things up. Analyzing this kind of behavior is an entirely different level of crap that I won't go into detail about. Also, if the ripple seen by the error amplifier is large, it might also cause oscillation. You want it to respond to the DC output and not see the AC component created by ripple, so it's sometimes a good idea to put a lowpass filter in the feedback path. Again, analyzing this isn't something I'm going to do here. If you could understand it, then you probably don't need me to tell you anyways.

At this point you probably have what it takes to get one of these things working reasonably well. But so far we've been dealing with theoretical stuff that doesn't necessarily apply to the real world. If you want it to be really good, we'll have to take a deeper look at what is going on and confront the brutal truth that things don't always work as expected.

Next time:
The bitter truth: Component selection, efficiency, and stability

ANIME AKBAR
Jan 25, 2007

afu~

Kynetx posted:

Apologies if this has already been answered. I read about halfway through the thread and didn't find anything concrete.

I've got a wireless guitar transmitter that is typically powered by a 9-volt transistor style battery. Using Alkaline batteries the typical lifespan is about 4-5 hours. NiMh is abysmal, somewhere around 1 1/2 hours. I called the manufacturer and spoke to an engineer about the possibility of using a 9.6v battery pack of the type found in Tyco R/C cars. The engineer thought it would be perfectly reasonable to run the transmitter at the higher voltage.
Since Audio Technica in their infinite wisdom decided to use spring tabs instead of a normal socket-type mechanism to connect to the battery I had to build an adapter. I bought a cheapo dry-cell 9v battery and gutted it. I soldered wires to the contacts on the inside of the case and then potted the whole mess with epoxy. It works fine. Using standard Molex plugs I can connect the battery to the gutted 9v case and the transmitter powers up and performs perfectly. I used it all through a 6-hour practice without any glitches.
I still have one worry though, maybe two. Firstly, the pack is rated at a capacity of 1000 mAh and presumably is capable of outputting a couple of amps if a dead short occurred. Secondly, I'm concerned that as the battery dies the current could possibly rise to uncomfortable levels as the voltage drops. Is this a legitimate concern? Could I effectively kill two birds with one stone by using a current-limiting resistor? The 9v battery case seems like it would be roomy enough to accommodate a resistor or two. I could certainly make another "adapter" and pot it in epoxy.
I don't see why current would increase as voltage drops (in a bad way, that is). Can you tell what the battery is directly powering? Some kind of regulator? In any case I doubt you'll have to worry about current surges from decreasing voltage. Short circuits are another issue. Are you afraid of a short in your wiring job or within the circuitry itself? If the latter, there's not much you can do about it, since if it fries it will likely do so before drawing too much current from the battery. If you're just worried about you terminal wired touching or something, then a fuse might be adequate. Shorts in the supply generally don't hurt the load, so you just want to protect that battery, and a fuse will do that (assuming its the right size). You could also do some active current limiting, but doing so would require putting some circuits on the supply line, thus dropping its voltage (maybe by a volt). Is this acceptable?

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!!!!!
I just wanted to say that this series you're posting about making a switching power supply is really great. I've been looking for a good summer project and this will likely be it.

Ms Jewish Anime
Feb 18, 2007


WATCH THE WAY "THE JEW" DODGES AND WEAVES LIKE A SNAKE IT IS SADLY ALL HE KNOWS
4 7
Alright, as a student in electronics I'm always seeing these magic numbers everywhere - 4 and 7. I see 4.7 uF caps, 47 uF caps, 470 uF caps, 47 ohm resistors, 470 ohm resistors, and so on.

What is so special about 47? I see 47 <unit of measurement> on half of my stuff, and I have no clue what's so special about that number. Would anyone care to explain this to me? tia

ANIME AKBAR
Jan 25, 2007

afu~

Bush is a QT posted:

4 7
Alright, as a student in electronics I'm always seeing these magic numbers everywhere - 4 and 7. I see 4.7 uF caps, 47 uF caps, 470 uF caps, 47 ohm resistors, 470 ohm resistors, and so on.

What is so special about 47? I see 47 <unit of measurement> on half of my stuff, and I have no clue what's so special about that number. Would anyone care to explain this to me? tia

Standard component values are based on a logarithmic scale. The values are derived by choosing some number of values n within a decade (like between 1 and 10 or 100 and 1000) so that those values are 10(i/n), where i is a number between 1 and n. Then you round that value appropriately for the tolerance of the component. For instance, most components have 12 values per decade, so you end up with:
10(1/12) = 1.212
10(2/12) = 1.468
10(3/12) = 1.778
10(4/12) = 2.154
10(5/12) = 2.610
10(6/12) = 3.162
10(7/12) = 3.831
10(8/12) = 4.642
10(9/12) = 5.623
10(10/12) = 6.813
10(11/12) = 8.254
10(12/12) = 10.00
Unless they have a very good tolerance (like less than 1%), those extra digits are rounded to get:
1.2
1.5
1.8
2.2
2.7
3.3
3.9
4.7
5.6
6.8
8.2
10.0

Some of them seem to round up when they should round down. This is because resistors tend to increase in resistance with temperature and age :ssh:

Components like electrolytic capacitors and inductors generally have crappy tolerances, so even 12 values per decade is kind of excessive, so you'll usually see just six. On the other hand, you can get resistor sets with 96 freakin' values per decade with 0.1% tolerance or better.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


mtwieg posted:

Standard component values are based on a logarithmic scale.

This is brilliant. Thank you so much.

I'm building a circuit to inject tones into audio. Right now, I'm using a 3-bit resistor-based DAC using 3 pins of a microcontroller to make stepped sine waves then filtering with a cheapo RC filter. I can get up to about 10kHz tones, and that's fine for what I'm doing, but is there a better way to do this type of thing? Should I be trying to use a 555 or op-amp oscillator?

ANIME AKBAR
Jan 25, 2007

afu~
Aside from something fancy like a DDS (which is really just a DAC on steroids) or a specialized mcu, a normal DAC is probably your best bet. Another bit or two of resolution wouldn't hurt, but that might require more resources than your mcu can give.

Zuph
Jul 24, 2003
Zupht0r 6000 Turbo Type-R
Well, after several hours of re-teaching myself C, I finally have a working program to interface with an 8-bit parallel LCD display for an AVR ATMega 168. I bought a parallel display because they're $10 or more cheaper than serial displays, and I have a pile of shift registers laying around.



I also got my sample order in from Maxim. For being a student, they sent me a couple segmented-display interface chips that retail $15 a piece for free, and according to the brochure they sent me, they'd be willing to send me 14 more. Maxim rocks.

ANIME AKBAR
Jan 25, 2007

afu~
I've been busy lately with finals along with my own ongoing development of a major project, so I've been busy lately. Next update will probably come in the next couple days.

Also I want advice on something. I have a device that runs on three AA alkali batteries, and I want it to have three light outputs, each controlled by a MCU. However, each "light" needs to be fairly visible, so it will consist of many individual LEDs (from 6 to 12), each with a Vf of up to 3.5V (for blue). So I'm trying to think of a way to drive these things fairly efficiently (and cheaply) off my given supply. I don't need any kind of dynamic brightness control or fast response time. Just a simple on/off function.

As I see it my options are:
-Use some kind of boost circuit to drive each light with all its LEDs in series. There are ICs designed to do this, but each channel requires it's own boost circuit, so I'd have to have a lot of external components. Efficiency would be optimal, though. I could also use a single boosted supply to bias each string of LEDs and sink each string with a current source, but this would hurt efficiency.
-Run all the leds in parallel. The simplest way to do this would be for one light, each led is in series with its own current limiting resistor, and all of these are supplied directly from my batteries and driven with one low side switch. This would be simple and cheap, but efficiency would be crap because I lose power over the resistors and the switch. Also variations in the Vf of leds will cause variation in brightness; how much, I'm not certain.
-I could also use a specialized IC that sinks a regulated current. However, it would likely need to have one channel per led (at least 18 sinks), and it would have be pretty robust to draw all that current.
-Have a separate supply for the LEDs, like a 9V battery. This would have the advantage of being simple and reliable, plus the supply voltage for all my other analog stuff wouldn't be effected by the current draw. I'd rather avoid adding another battery, though, since this is designed to be a small portable device. Also I'm not sure what the internal resistance of the average 9V is, so it might not be able to deliver to my needs.

Any suggestions?

the wizards beard
Apr 15, 2007
Reppin

4 LIFE 4 REAL

mtwieg posted:

-Run all the leds in parallel. The simplest way to do this would be for one light, each led is in series with its own current limiting resistor, and all of these are supplied directly from my batteries and driven with one low side switch. This would be simple and cheap, but efficiency would be crap because I lose power over the resistors and the switch. Also variations in the Vf of leds will cause variation in brightness; how much, I'm not certain.

You might not see a difference in brightness, but there will be a difference in current through each LED (current through a diode depends on the voltage across it), and Vf can also vary with temperature. If you have unstable current distribution you will eventually end up with one LED burning out before the others, and the remaining diode will then have to "share" even more current than before.

e: gently caress, didn't read that you were giving each LED it's own resistor. Sorry. This probably won't be such a problem then.

Locker Room Zubaz
Aug 8, 2006

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

:horse:

mtwieg posted:

I've been busy lately with finals along with my own ongoing development of a major project, so I've been busy lately. Next update will probably come in the next couple days.

Also I want advice on something. I have a device that runs on three AA alkali batteries, and I want it to have three light outputs, each controlled by a MCU. However, each "light" needs to be fairly visible, so it will consist of many individual LEDs (from 6 to 12), each with a Vf of up to 3.5V (for blue). So I'm trying to think of a way to drive these things fairly efficiently (and cheaply) off my given supply. I don't need any kind of dynamic brightness control or fast response time. Just a simple on/off function.

As I see it my options are:
-Use some kind of boost circuit to drive each light with all its LEDs in series. There are ICs designed to do this, but each channel requires it's own boost circuit, so I'd have to have a lot of external components. Efficiency would be optimal, though. I could also use a single boosted supply to bias each string of LEDs and sink each string with a current source, but this would hurt efficiency.
-Run all the leds in parallel. The simplest way to do this would be for one light, each led is in series with its own current limiting resistor, and all of these are supplied directly from my batteries and driven with one low side switch. This would be simple and cheap, but efficiency would be crap because I lose power over the resistors and the switch. Also variations in the Vf of leds will cause variation in brightness; how much, I'm not certain.
-I could also use a specialized IC that sinks a regulated current. However, it would likely need to have one channel per led (at least 18 sinks), and it would have be pretty robust to draw all that current.
-Have a separate supply for the LEDs, like a 9V battery. This would have the advantage of being simple and reliable, plus the supply voltage for all my other analog stuff wouldn't be effected by the current draw. I'd rather avoid adding another battery, though, since this is designed to be a small portable device. Also I'm not sure what the internal resistance of the average 9V is, so it might not be able to deliver to my needs.

Any suggestions?
If you use a 555 timer you can pulse them on and off at about 100hz and that will cut current draw substantially.

ANIME AKBAR
Jan 25, 2007

afu~

Cuw posted:

If you use a 555 timer you can pulse them on and off at about 100hz and that will cut current draw substantially.

I'd still need either some kind of current limiting or current feedback circuit to make sure my output current is predictable. And an astable 555 for each channel would likely be more resources than I'm willing to give. Plus 555s are notorious for creating garbage on your supply levels. Also they normally need at least 5 volts supply to run. Besides, if I had to I could PWM from my MCU. Don't know if I could get three different channels, though.

I can get efficiency and regulation individually, but I'm having trouble getting both at the same time while saving cost and space.

carticket
Jun 28, 2005

white and gold.

mtwieg posted:

I'd still need either some kind of current limiting or current feedback circuit to make sure my output current is predictable. And an astable 555 for each channel would likely be more resources than I'm willing to give. Plus 555s are notorious for creating garbage on your supply levels. Also they normally need at least 5 volts supply to run. Besides, if I had to I could PWM from my MCU. Don't know if I could get three different channels, though.

I can get efficiency and regulation individually, but I'm having trouble getting both at the same time while saving cost and space.

Depends on the speed of your MCU and how much of its resources you are using, but if you can get an interrupt occuring at something higher than 100 Hz, you can do your own PWM. 100 Hz interrupt frequency could give you 10 Hz PWM with 10% resolution, which might still be too slow, but I find it more likely that you could get something into the kHz range for your interrupt without impacting MCU performance for other tasks. Your interrupt handler would just be three decrements, three branches, with a potential for three bit manipulations and a memory write.

Three-Phase
Aug 5, 2006

by zen death robot
Ok, I need some help from the PIC pros here.

I got an ICD2 programmer from my pop. Installed it on my computer, it seemed to run OK, then it went to hell quick. This is an image of the offending device.



In my opinion, this device is a complete hunk of poo poo. There's a ton of weird driver voodoo-hoodoo with it, like these pre-install and cleaning utilities. Plus it's finnicky about power connections and soforth. My dad had issues with it as well on a separate computer, so I'm doubting it's a solo issue.

Now this is what I want to do - program PIC chips on my computer. I have a 232 port and a USB port. I liked Microchip's IDE, and the PicKit 2 prototype board. I need something like this, without needing that shitpuck programmer.

UPDATE!
Doing a careful removal/reinstall appeared to get the thing working... for now. If it doesn't "break" again I'll improve this device's review from a "complete hunk of poo poo" to "crappy".

Three-Phase fucked around with this message at 16:53 on May 12, 2008

s3rca
Oct 17, 2007

.:..:::.
I cant even express how happy i was to stumble upon this thread . Im a coast guard electronics technician and got dumped at a unit that doesnt stretch my electrical knowledge much and have come to forget almost everything i learned in school. Ive been wanting to get into hobby electronics but didnt know where to start.

cheers to the OP.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Three-Phase posted:

Now this is what I want to do - program PIC chips on my computer. I have a 232 port and a USB port. I liked Microchip's IDE, and the PicKit 2 prototype board. I need something like this, without needing that shitpuck programmer.

I have a PICkit2 programmer and "PICkit 2 Low Pin Count Demo" demo board that work flawlessly.

I even downgraded to version 1 firmware and ran it on linux flawlessly for a bit, just to make sure I could. I then upgraded the firmware back to v2 and have been running with no problems ever since.

I only have a 16F690, but I've got a tube of 12F675s and 16F688s coming.

I'll have my first ICSP-based project up and running in a couple of days, hopefully, and can report on how well that works, too.

Hypnolobster
Apr 12, 2007

What this sausage party needs is a big dollop of ketchup! Too bad I didn't make any. :(

I just ordered a Weller WES51, which is going to be loving great, because I've been stuck with pencil irons ever since I started dicking around with electronics. I ordered it to enhance the enjoyment of my newest project (tube-hybrid headphone amp).
I'll be doing lots of point to point wiring and lots of board work. Anyone have tip suggestions for me?

Also, where can I get one of those awesome no-water tip cleaners that looks like a big ball of steel wool?

Double also, where can I find a huge multi-pack of wire? I need a bunch of stranded wire in varying colors. 16-22ish.

Hypnolobster fucked around with this message at 00:34 on May 13, 2008

Ms Jewish Anime
Feb 18, 2007


WATCH THE WAY "THE JEW" DODGES AND WEAVES LIKE A SNAKE IT IS SADLY ALL HE KNOWS
I've seen the wire at circuit city, they tend to sell lots of value pack type things, for an OK price.
They also sell neat jumper wire sets, but I've never used them.

Three-Phase
Aug 5, 2006

by zen death robot

babyeatingpsychopath posted:

I have a PICkit2 programmer and "PICkit 2 Low Pin Count Demo" demo board that work flawlessly.

I even downgraded to version 1 firmware and ran it on linux flawlessly for a bit, just to make sure I could. I then upgraded the firmware back to v2 and have been running with no problems ever since.

I only have a 16F690, but I've got a tube of 12F675s and 16F688s coming.

I'll have my first ICSP-based project up and running in a couple of days, hopefully, and can report on how well that works, too.

I got the PICDEM board, I like that since you can program a wider variety of PIC chips.

I'm catching onto the nuances of the PIC pretty well. I've made a little LED-stroby program. Had some difficulty with an A/D input thing - I think I was moving too fast and need to cover the initial stuff a bit better.

Having worked with an 8051, this is pretty much the same, with some different nuances and commands.

Locker Room Zubaz
Aug 8, 2006

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

:horse:

Hypnolobster posted:

I just ordered a Weller WES51, which is going to be loving great, because I've been stuck with pencil irons ever since I started dicking around with electronics. I ordered it to enhance the enjoyment of my newest project (tube-hybrid headphone amp).
I'll be doing lots of point to point wiring and lots of board work. Anyone have tip suggestions for me?

Also, where can I get one of those awesome no-water tip cleaners that looks like a big ball of steel wool?

Double also, where can I find a huge multi-pack of wire? I need a bunch of stranded wire in varying colors. 16-22ish.

jameco has great prices on wire from my experience. They also have a ton to choose from and will do special orders if you nag em.

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik
Can someone help me find some components to order. I need to get some connecters of a specific type.

If anyone has an STK500 they know that connector which you press onto the end of a piece of ribbon cable. I'd like to get a bunch of those in various sizes. As well there is a type which works the same way, but the connecter at the end fits into a DIP socket. What are those things called?

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Zaxxon posted:

Can someone help me find some components to order. I need to get some connecters of a specific type.

If anyone has an STK500 they know that connector which you press onto the end of a piece of ribbon cable. I'd like to get a bunch of those in various sizes. As well there is a type which works the same way, but the connecter at the end fits into a DIP socket. What are those things called?

I think your "connector you press onto the end of a piece of ribbon cable" is a standard .1" header block, and you can get them in sizes from 1x1 to 60x2. My local electronics store has a whole rack of them.

As for a connector you could plug into a DIP socket, you could take another DIP socket and solder a ribbon cable (or whatever) to the socket ends, or just stick them in there, and then plug your socket into another socket.

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik

babyeatingpsychopath posted:

I think your "connector you press onto the end of a piece of ribbon cable" is a standard .1" header block, and you can get them in sizes from 1x1 to 60x2. My local electronics store has a whole rack of them.

As for a connector you could plug into a DIP socket, you could take another DIP socket and solder a ribbon cable (or whatever) to the socket ends, or just stick them in there, and then plug your socket into another socket.

That will work but it's not what I'm thinking of.

What you are suggesting will take a while and it's frankly not something I'm prepared to spend a lot of time with. The thing I'm thinking of is the same size as a header block, but it's end has wierd fork shaped connections and a back plate that you crimp onto the ribbon cable with a pair of pliers.

Fatal
Jul 29, 2004

I'm gunna kill you BITCH!!!
I'm still waiting for some components (so I can test this question) but I was wondering what would happen if I only attach a positive voltage source to an opamp Vcc (+) and nothing to the negative input? Would it only show the positive part of the output signal, nothing at all, or blow up? As a side question, any elegant way of producing a negative voltage source besides putting two batteries in series and grounding the junction point?

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik

Fatal posted:

I'm still waiting for some components (so I can test this question) but I was wondering what would happen if I only attach a positive voltage source to an opamp Vcc (+) and nothing to the negative input? Would it only show the positive part of the output signal, nothing at all, or blow up? As a side question, any elegant way of producing a negative voltage source besides putting two batteries in series and grounding the junction point?

nothing will happen if you don't put anything into the negative part. You would want to at least ground it.

Zaxxon posted:

If anyone has an STK500 they know that connector which you press onto the end of a piece of ribbon cable. I'd like to get a bunch of those in various sizes. As well there is a type which works the same way, but the connecter at the end fits into a DIP socket. What are those things called?

I found this out. They are called IDC connectors. Now to wade through a parts house's unfathomable nomenclature to get the sizes and styles I need!

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Zaxxon posted:

That will work but it's not what I'm thinking of.

What you are suggesting will take a while and it's frankly not something I'm prepared to spend a lot of time with. The thing I'm thinking of is the same size as a header block, but it's end has wierd fork shaped connections and a back plate that you crimp onto the ribbon cable with a pair of pliers.

Ahh. Look for IDC Female connectors in .10" pitch.

It looks like you can find "the other kind" [url= here.

That site also has the IDC female connectors, so you're in luck.

Edit: didn't hit reply soon enough after finding the link, apparently. Good luck.

Bantaras
Nov 26, 2005

judge not, lest ye be judged.
I got a stupid question for you guys,

I'm needing to get a pcb layout designed from a circuit I have, and I'm trying to learn the software (two I'm messing with are Expresspcb and Advancedcircuits software and I'm not learning either of them very well) and I'm curious about some of the options. Do I want Silk-screening? And - Do I want Solder mask?

I know I would like having the shape of the components (there's not that many) drawn on the pcb itself, the way beginners project boards are, and I'm thinking that's what silk-screening is, but I'm not sure.

Adbot
ADBOT LOVES YOU

SnoPuppy
Jun 15, 2005

Fatal posted:

I'm still waiting for some components (so I can test this question) but I was wondering what would happen if I only attach a positive voltage source to an opamp Vcc (+) and nothing to the negative input? Would it only show the positive part of the output signal, nothing at all, or blow up? As a side question, any elegant way of producing a negative voltage source besides putting two batteries in series and grounding the junction point?

If you ground the negative rail, everything in the opamp will be referenced to a "virtual ground" that is Vcc/2. Thus, you would need to AC couple the input and outputs, otherwise you will get a signal that has a strong DC offset.

Remember, voltage is just the difference between two arbitrary points (one of which is normally ground, but not necessarily).

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