text
stringlengths
83
79.5k
H: Wire capacity - Total power or just current? So I've gotten myself into a healthy, educational Facebook discussion. Link is here if you're a member of that group. When I thought about it, everyone defines wire capacity by current only. The voltage only comes in when talking about wire insulation. However, I've always thought about a wire's capacity by total power transmitted, not just the current. Assuming arcs and corona discharges aren't a problem, could I transmit say 10 kW via a #40 AWG wire at 10mA, 1MV DC? The ampacity isn't violated, but that doesn't look right for wire that's around the width of a hair. I'm aware of the math behind it (5th year Electronics engineering student) and I can judge what voltage/current I need for X watts versus safety/other constraints, but wires being rated by current only hasn't bothered me up until this point. AI: The wire will heat up because of its resistance and current passing through it, and this also makes a voltage drop over wire. The potential of the wire itself is irrelevant, assuming the insulation does not bŕeak down. 10mA flowing in a wire still heats up the same amount whether it comes from 1.5V battery or 1MV generator.
H: Transformer secondary C.T. Label Can anyone tell me what the “C.T.” Stands for in the Secondary Volts column (see pic) stands for? When I see that my mind thinks “current transformer” but this is not a current transformer in the sense that I think of them. I know that current gets “transformed” across any transformer but my understanding of a current transformer is on the order of a Window CT used to monitor motor current or line current in substation, etc. Image from www.alliedelec.com/m/d/08507f560b87dc69b56b0077e6976f5f.pdf. AI: Center-tapped. In this case it means that the secondary winding has two opposite phases and a middle connection. Such a transformer looks like this: simulate this circuit – Schematic created using CircuitLab For a 5V AC secondary transformer, the voltages are: V1 to V2: 5V AC V1 to Vct: 2.5V AC V2 to Vct: 2.5V AC
H: Boost Converter Design Formulas I have a boost converter. Vin=10-16V Vout =23V Iload=250mA. Fsw=125kHz NCV3063 I have a Boost converter App note from TI. Boost Converter TI App note I tried to design my boost converter circuit using the formulas provided from the app note as I was not able to understand the formulas provided in my NCV3063 Boost Converter datasheet. Can I use the App note formulas to design my boost converter inductor? Why are there different formulas for the same boost converter topology? Thanks. AI: I followed that Application note from TI once, back in 3rd semester, worked like a charm. Can I use the App note formulas to design my boost converter inductor? No I would not mix and match two different manufactors design notes. Why are there different formulas for the same boost converter topology? Many ways leads to Rome :) Sorry for the vague answer, I'm not entirely sure. But I'm fairly confident the result should be the same if its the EXACT same topology.
H: Why have both: BJT and FET transistors on IC output? This is the structure of FAN3100 gate driver IC: (taken from its datasheet) As you can see - there are two ouput switches: CMOS and BJT. Why they put them both? AI: Paragraph 2 of the description says: FAN3100 drivers incorporate MillerDriveTM architecture for the final output stage. This bipolar-MOSFET combination provides high peak current during the Miller plateau stage of the MOSFET turn-on / turn-off process to minimize switching loss, while providing rail-to-rail voltage swing and reverse current capability. At the bottom of page 14 in the section *MillerDrive Gate Drive Technology" it goes on to explain: The purpose of the MillerDrive architecture is to speed up switching by providing the highest current during the Miller plateau region when the gate-drain capacitance of the MOSFET is being charged or dischared as part of the turn-on / turn-off precess. For applications that have zero voltage switching during the MOSFET turn-on or turn-off interval the driver supplies high peak current for fast switching even though the Miller plateau is not present. This situation often occurs in synchronous rectifier applications ecause the body diode is generally conducting before the MOSFET is switched on. The answer to "Who can tell me about Miller Plateau?" explains it thus: When you look at the datasheet for a MOSFET, in the gate charge characteristic you will see a flat, horizontal portion. That is the so-called Miller plateau. When the device switches, the gate voltage is actually clamped to the plateau voltage and stays there until sufficient charge has been added/ removed for the device to switch. It is useful in estimating the driving requirements, because it tells you the voltage of the plateau and the required charge to switch the device. Thus, you can calculate the actual gate drive resistor, for a given switching time. The BJTs are able to get the output moving while the MOSFETs are ramping up. The MOSFETS can then provide the rail to rail voltage swing.
H: Digital signal into the video cable The input signal is simply composite sync signal, without any additional video information. It is CMOS - 0 to 5V levels. I need the same type of signal to appear in the cable along with the RGB lines. The difficulties I face relate to the best way to tranform the signal - in terms of level and impedance. First, the 5V CMOS signal can be easily transformed into 300 mV-pp or 600 mV-pp signal using simple resistor network, not introducing much currents and affecting logic output of the previous chip: Vref will simply be a positive supply rail, and I can, and most probably will, DC bias the resulting signal somwhere within 1-2 V (relatively far away from the power rails). As for the operational amplifier, I would be very happy using ADA4891 device for the purpose. And then I have difficulties to decide how to proceed, as I need to match output impedance of the operational amplifier with the cables' impedance (75 Ohms). Use G=+2 configuration. I will make input signal 300 mV-pp, and it will be converted to 600 mV-pp, and then divided back to 300 mV-pp by the 75-Ohm resistor network. However my environment does assume single supply power. I read somewhere (e.g. here) that putting gain resistor onto the ground in this configuration is bad idea as it creates unnecessary currents from the output to ground (=to negative power rail of opamp), and capacitor must be used. Then it is stated that gain and capacitor will form a filter which will change the frequency response of the circuit. That sounds somehow complicated. I reviewed a number of sources and some of them signify these problems, but most just connect Rg onto the ground without further exploring the issues. Use G=+1. It will be as simple as voltage follower, with no relation of the feedback to the power rails. I will make input signal as 600 mV-pp, and just translate it to 600 mV-pp at the output with low impedance - and then divided to 300 mV-pp by the 75 Ohm resistor network. That would be so simple if datasheet would not constantly recommend using this operational amplifier in G=+2 configuration for the video, even in its headline, e.g. Video specifications (G = +2, RL = 150 Ω). Can I use the op-amp in G=+1 configuration as explained in point 2 and what risks will it present? Probaly datasheet has technical information on it, but I am unable to derive it out of there. Analysing plots does not give me any warning signs of possible problems... AI: Reading the datasheet, the amplifier is unity gain stable, so can be used with G=+1, where it should give you a -3dB BW of 250MHz. You will want your data rate to be somewhat slower than this to get good pulse shape. The data sheet specifications expressed in video specific terms (diff gain, diff phase), have only been measured in the G=+2 configuration, as that's the way that most people will configure it for video. As you are (presumably) not interested in meeting a particular video spec, you can choose which configuration you like.
H: Inverting high DC voltages How do I turn a high negative DC voltage into a positive DC voltage around -88v? I need to do this to be able to measure this across a sense resistor using an LTC2992 AI: I need to do this to be able to measure this across a sense resistor using an LTC2992 The LTC2992 will handle negative power rails: -
H: Current coupling in self-monitoring laser diodes I always wondered why the most common pinout for laser diodes with a monitoring photodiode was so strange. It wasn't sure how it was intended to be used until I ran into this circuit here: https://www.youtube.com/watch?v=MUdro-6u2Zg In my mind, it seems a bit strange that the current source is shared by both the laser diode and the photodiode since it seems that this coupling would cause the laser diode and photodiode to distort each other's output. The only reason I can think for this is to reduce component count by using the laser diode's own forward voltage voltage drop to reverse bias the phtoodiode to eliminate the need for a bias supply, and that the tiny photodiode current is considered negligible relative to the full laser diode current. Is my reasoning correct? Or is there a useful purpose to this coupling? AI: That isn't the usual way to use this laser diode configuration. A more typical application would look something like this: simulate this circuit – Schematic created using CircuitLab The important difference is, the common node between the laser and photodiode is a low-impedance node, not high impedance.
H: How strong a transformer do I need to convert from 220V to 11V at 1.6A? I have a (cordless drill) battery charger that has these specs on its back: INPUT: 120VAC ~ 60Hz 26W OUTPUT: 3.6V - 10.8V DC, 1.5A Where I live the wall electricity is ~220VAC so I thought a small step down transformer (converter?) from 220V AC to 110V AC that outputs (?) 30W should work with my charger. I went to an electronics store and the owner did some math around the 1.5A figure and told me I'd need a much bigger transformer capable of putting out at least 150W or so. Is the store guy right? What's the math that he did in his head? And why does my charger show 26W on the back? AI: You are right, a 30W step-down transformer should be fine. I suspect that the person at the electronics store was multiplying the input voltage by the output current, which is not the right thing to do. Edit: Watt's Law says that power is equal to the product of voltage and current. (We will ignore the issues of reactive power and power factor for this simple case.) $$ P = V \times I $$ On the output side of your charger the nameplate says that the maximum output voltage is 10.8V and the maximum output current is 1.5A. So, the maximum power out of the charger is 16.2W (watts). On the input side you are given voltage and power, so we can calculate the current: $$I_{IN} = \frac{P_{IN}}{V_{IN}} = \frac{26}{120} = 217\,\textrm{mA}$$ Thermodynamics tells us that the power out can never be greater than the power in, and in this case we see that this is true.
H: Base Current vs Emitter Base voltage Why is it universally stated in so many places that the Base Current Ib controls the collector current Ic in a Bipolar Junction Transistor when I guess it is pretty obvious that its the Emitter Base forward bias voltage that will be responsible for the change in the base current.. Making the Vbe controlling factor of Ic.. It is all very confusing AI: Voltage does not cause current, current does not cause voltage, at least for any meaningful understanding of the word 'cause'. They both co-exist. When the base-emitter junction of a transistor is biassed, an Ib flows into the base, while a VBE exists across it. If we now measure the collector-emitter current, we find the ratio to the base current is more or less constant over a very wide range, many orders of magnitude. This is sufficiently useful that engineers call this ratio beta. The ratio of collector current to VBE varies with the base current. The ratio of them is still useful, engineers call it the transconductance or gm of the transistor, but it's valid at only one base current setting. So while the BJT is also voltage controlled, as the relationship is non-linear, it's not useful for doing calculations for the initial biassing of the transistor, which usually involves comparing currents over a wide range. This means that when biasing up a transistor, the beta×Ib expression is most useful for collector current. When using a biased transistor as an amplifier, the gm×VBE expression is frequently used.
H: Normally Closed Optoisolators I understand that typical optoisolators can logically be considered as "normally open". However I have a situation where I'd like the circuit controlled by the opto to be normally closed, mainly for the failure state but also so that the opto's led doesn't have to be activated for 99% of the time. How can this be done on the transistor side? Failure states aside, should I be concerned with having the opto activated indefinitely (in a normally open circuit)? AI: Instead of switching the actual load with the opto, use the opto to drive a transistor which switches the actual load. However, note that if the opto fails short then that will open the transistor. The risk could be potentially reduced by having two optos wired series on the output and parallel on the input so that both must close (or fail) for the transistor open. simulate this circuit – Schematic created using CircuitLab
H: Can one of the capacitors in series get negative Voltage when discharging? Supppose i have the following circuit. And I complelty discharge all the capacitors by having a load on them for a long time, so there will be 0V overall. Let's assume the one in the middle has a slightly different capacity. My question is will C5 have a negative Voltage because it has less capacity ? simulate this circuit – Schematic created using CircuitLab I'm asking this because in my setup i have 3 Supercaps (which have polarity) connected in series and I'm wondering if I can discharge them all the way without giving one of the caps a reverse polarity. Some thoughts: This seems like a very basic question, but i've never asked myself this until now. So from a logical point of view it must get negative, because let's say they all start at 3V when discharging . Then the voltage starts to drop , then one of the caps must reach 0V first because it hass less capacity and then the current should still continue to flow because the overall potential on the load is > 0V . But my first instinct was that it shouldn't get below 0 , although I have no argument for that it's just a feeling. So that's why I'm a bit skeptical what will happen. AI: It depends on how they were charged to begin with. If you charge the capacitors to the same voltage individually, then connect them in series and discharge them, then when the total voltage reaches zero, you'll find that the largest capacitor has a small positive bias on it and the smaller capacitors all have small negative biases. On the other hand, if you connect the discharged capacitors in series and then charge them, you'll find that the largest capacitor ends up with the smallest relative voltage, and all of the smaller capacitors have larger voltages across them. When you discharge them, they all reach zero volts at the same time.
H: Propagation delay and its measurement in datasheet I am referring to Gate driver LM5102 Here the terms are bit misleading 1] Lower turn off propagation delay 2] Turn on delay But application curves uses different measurements symbols(tp/tdl)/names, I am now assuming turn on delay is 50% of VI to 10% output Propagation delay is 50% of input to 50% of output Is this right but application curves speaks differently How is it measured ? AI: Turn OFF time When in Figure 17 signal HI turns off / goes from high to low (HI falling) the output HO also goes from high to low (HO falling). The time it takes for this "HI falling to HO falling" is the Higher (input to output) Turn-Off Propagation Delay \$t_{HPHL}\$ as defined in chapter 6.6. In Figure 17 this delay is shown with the symbol/name \$t_P\$. (So, \$t_P = t_{HPHL}\$.) When in Figure 17 signal LI turns off / goes from high to low (LI falling) LO also follows (LO falling). The time it takes for this "LI falling to LO falling" is (as expected) the Lower Turn-Off Propagation Delay \$t_{LPHL}\$ as defined in chapter 6.6. Note that it has the same value as Higher Turn-Off Propagation Delay. In Figure 17 this delay is therefore shown with the same symbol/name \$t_P\$. (So, \$t_P = t_{LPHL}\$ = t_{HPHL}\$.) Turn ON time When in Figure 17 signal LI turns on / goes from low to high, LO follows, but with quite a delay. The same applies when in Figure 17 signal HI turns on / goes from low to high: HO follows with quite a delay. With RT1 and RT2 you can change thid turn on delay. There will be a turn-on propagation delay from input to output just as there is when turning off. However, there is an aditional time delay caused by RT1 and RT2, resp called time delay \$t_{RT1}\$ and \$t_{RT2}\$. There sum is resp. \$t_{DH}\$ and \$t_{DL}\$ as shown in Figure 17. These parameters \$t_{DL}\$ and \$t_{DH}\$ have been defined in chapter 6.5, section time delay controls as well as in Figure 13. (Last sentence of page 12 of DS should refer to Fig 13 not to Fig 18.) Summary How long takes it for the output to follow the input when turning off? The Turn-Off Propagation Delay \$t_P = t_{HPHL} = t_{LPHL}\$. How long takes it for the output to follow the input when turning on? It is determined by the values of RT1 and RT2. Check Figure 13 for the total delay time \$t_{DH}\$ and \$t_{DL}\$.
H: Basic transistor circuit I'm playing around with a BD179 transistor, trying to get my LED bulb to light up but without luck. My mistake is probably something very simple but I'm learning so bear with me. AI: There are two potential problems in your circuit. 1. The 2kOhm base resistor is too high. By applying 3.4V through a 2K resistor, and accounting for the base-emitter voltage drop of the BJT (in the datasheet) you get a base current of: \$ I_{collector} = \frac{V_{supply} - V_{be}} {R_{base}} = \frac{3.4V - 1.3V} {2kOhm} = 1.05mA\$ In the datasheet, the BJT's DC current gain ranges anywhere from 15 to 160 which means your collector current will be anywhere between 15 to 160 times the base current which is 16mA to 168mA. But your bulb is a 12V, 6W bulb which means it runs at: \$ I = \frac{P}{V} = \frac{6W}{12V} = 500mA\$ 2. The LED should be on the collector side of the transistor. Put simply, the current flowing between the base and emitter terminals of an BJT determine how much it turns on by. The BJT can ONLY see the voltage difference between its terminals. It does not and cannot know about voltages anywhere else. Your power supply is applying to the base resistor relative to ground. But the voltage and current parameters that the BJT actually cares about are those between the base and emitter terminals. If your source pin is not connected to ground then what you BJT cares about is not the same as what the supply is providing. Things get distorted As the transistor turns on and conducts current through your bulb, the voltage across the bulb rises pushing the source terminal voltage away from ground which reduces the base-emitter voltage difference (and the voltage across the base resistor which reduces the base current). This acts as negative feedback and fights the transistor turning on more. This negative feedback has its uses, but not when using the transistor as a plain old switch. It's mostly for amplifiers and analog circuits.
H: Are all Earth Grounds Equal? Hypothetical: I have two circuits that are being powered from the same electrical service. They both have a hot and a neutral wire from the same transformer. The first circuit and the transformer are earth grounded locally with a ground rod. The second circuit is earth grounded on the other side of the country with a second ground rod. Assuming the voltage drop is acceptable for circuit #2: Are these equivalent circuits? What problems could occur when a circuit is grounded elsewhere than where its electrical service is grounded? Hypothetical Schematic simulate this circuit – Schematic created using CircuitLab AI: Are these equivalent circuits? Not really. The resistance between G and N on CCT#1 is likely to be very low. It may be less than an ohm. The resistance between G and N on CCT#2 is likely to be much higher. With a simple rod hammered into the ground, it could be anything from a few tens of ohms to a few kilohms. Dirt isn't a good conductor, especially if it's dry. The first supply would be classified as "TN-S", the second is "TT". What problems could occur when a circuit is grounded elsewhere than where its electrical service is grounded? You haven't said what circuit protection devices CCT#1 and CCT#2 have. A short between L and G on CCT#1 will cause a large current to flow. This should trip a circuit breaker or blow a fuse. A short between L and G on CCT#2 is unlikely to pass enough current to trip a breaker or blow a fuse, unless you have an unusually good earth rod. Such circuits really need to be protected by an RCD/GFCI to be safe (RCD and GFCI are the same thing under different names).
H: How to solve this power relating task The task says: Determine Z if power on R (R = 3 Ω) equals 666 W. Apparent power equals S = 3370 VA and power factor is 0.937(capacitive). This is the picture od circuit: I tried to solve it like this: \$ P_R = I^2 * R => I = 14.9 => U_{RL} = U_Z = 99.95 \$ I know that \$ P = cosφ * S = >P = 3157.69\$ Then as i know that real power on parallel branch is 666 W i know that real power on Z branch must be 2491.69 and then \$P_Z = \frac{U^2}{R}\$ gives me R = 4 that supposed to be real part of Z, the same way i thought to get imaginary part ,but that is wrong, answer is Z = 2 - 2i AI: Here are two ways of solving it. I know it's not the best to give you the answer straight away, but I'm very rusty anyways so I wanted to go through with it from start to end. Plus, you've shown your attempt, and that means the world to me and that you should be able to absorb my answer. Just looking at the apparent power, power factor and voltage. \$ \begin{align} U &= |(3+6i)|\sqrt{\frac{666}{3}} &\approx 99.95\text{ V} \\P &= 3370\times0.937 &\approx 3157.7 \text{ W} \\Q &= 3370\sqrt{1-0.937^2} &\approx 1177.3 \text{ VAr} \\Q &= \text{Due to being capacitive} & -1177.3 \text{ VAr} \end{align} \$ With these values we can set up another equation that we know $$ \begin{align} P+Q&=\frac{U^2}{Z||(3+6i)} \\\\\frac{U^2}{P+Q}&=Z||(3+6i) \\\\\frac{U^2}{P+Q}&=\frac{Z(3+6i)}{Z+3+6i} \\\\(Z+3+6i)\frac{U^2}{P+Q}&=Z(3+6i) \\\\(3+6i)\frac{U^2}{P+Q}&=Z(3+6i-\frac{U^2}{P+Q^*}) \\\\Z = \frac{(3+6i)\frac{U^2}{P+Q^*}}{(3+6i-\frac{U^2}{P+Q^*})}&= \frac{(3+6i)\frac{99.95^2}{3157.7+1177.3i}}{(3+6i-\frac{99.95^2}{3157.7+1177.3i})} \approx 2-2i \text{ ohm} \end{align} $$ I am a little bit unsure about where the conjugate of Q comes in. I know that it does, just not 100% sure when. If I did this at an exam I would try to get rid of a complex denominator because it complicates things. Or you can do it like this, closer to what you tried. \$ \begin{align} I_{RL} &= \sqrt{\frac{666}{3}} &\approx 14.9\text{ A} \\U_{RL} & = |3+6i|I_{RL} &\approx 99.95\text{ V} \\P &= 3370\times0.937 &\approx 3157.7 \text{ W} \\Q &= 3370\sqrt{1-0.937^2} &\approx 1177.3 \text{ VAr} \\Q &= \text{Due to being capacitive} & -1177.3 \text{ VAr} \end{align} \$ And then we plug them in into similar ways that you were doing $$ \begin{align} P_Z&=P-3I_{RL}^2=3157.7-666= 2491.7 \text{ W} \\\\Q_Z&=Q-i6I_{RL}^2=-1177.3i-1332i= -2509.3 \text{ VAr} \\\\I_Z&=\frac{|P_Z+Q_Z|}{U_{RL}} = 35.4 \text{ A} \\\\Z &= \frac{P_Z+Q_Z}{I_Z^2} = \frac{2491.7-2509.3i}{35.4^2} \approx 2-2i \text{ ohm} \end{align} $$ There are more ways, but I don't want to spend too much time on this answer. I hope this gave you some insight into how to deal with these complex circuits.
H: Light Sensitivity Indicator (using transistor, LEDs, LDR) I have; 1) 9 V dc source 2) two LEDs (red and green) 3) LDR 4) few resistors (kilo ohm) 5) npn transistor I need to build a circuit such that the red LED lights up only at night (0 light intensity) and the green LED lights up only during the day (maximum light intensity). How can I do this? I found out how to achieve the results for only one LED. The follwing is a rough sketch for the task at hand. thank you AI: If you really want a solution with only one transistor, take a look at the circuit below. R1 and R2 values can be the same, so that these two resistors are equivalent to a 4.5V supply with some series resistance. The idea is that when Q1 is off, the LEDs are polarized between 9V on the bottom and 4.5V on top, what makes D2 turn on. When Q1 is on, then the LEDs are polarized with 4.5V on top and zero volts on the bottom, what makes D1 turn on. Q1 is normally on in darkness thanks to R4. When light is present, LDR1 drops the base voltage below 0.6V turning Q1 off. It's not the most elegant circuit I've created, but it may work ;). simulate this circuit – Schematic created using CircuitLab
H: Multiplex Analog pin and digital pin on single pin I have to manage one single analog pin with other digital IO. I am using a PIC micro, where I have utilized all the pins and I want one more pin for analog input. At the current stage, I can not really afford a new controller design for my project. I have assigned 7 pins for 7 segment and the other pins are assigned to LEDs, which is a must. I am looking for multiplexing circuit design (using transistor or something) where I can multiplex analog input and digital output in the design. I will be connecting an LDR to the analog input. AI: just connect both... simulate this circuit – Schematic created using CircuitLab So long as you are not doing charlieplex the LDR circuitry will not be disturbed by your LED multiplex, and the LED multiplex will not be disturbed much by the LDR.
H: Basic OpAmp as a Comparator question I'm continuing my refresher on electronics, and want to validate a conclusion/deduction that I'm reaching. Consider the two comparator circuits below: In both cases: I have chosen not to picture decoupling capacitors for simplicity/clarity The input waveform is a 6 Hz square wave that is 3.25 volts peak to peak The output waveform is a 6 Hz square wave that is 5 volts peak to peak Question: Is the primary reason to build a comparator using a voltage divider on the (-) input to set a threshold voltage (2.5 volts, in this case), preventing stray signals from triggering the output? (My intuition and very foggy memory says "Yes"). If so, is there any other reason to do so? What I was seeking to accomplish was a level shifting buffer to bring things up to a normal TTL range. AI: The input waveform is a 6 Hz square wave that is 3.25 volts peak to peak The output waveform is a 6 Hz square wave that is 5 volts peak to peak I'm assuming this means your square waves have as low voltage 0 V (i.e. VSS potential), and 3.25 an 5V as high level, respectively. "Square wave with a Vpp" is a bit ambiguous, because it doesn't say anything about the average voltage. Your opamp's lowest possible output voltage is Vss+Voffset, and in a good approaximation that's VSS=0V. Is the primary reason to build a comparator using a voltage divider on the (-) input to set a threshold voltage (2.5 volts, in this case), preventing stray signals from triggering the output? (My intuition and very foggy memory says "Yes"). If so, is there any other reason to do so? The motivation is to use a selectable voltage (defined by the voltage divider) as comparison threshold. This doesn't fulfill the role of hysteresis or similar, so not quite sure where "stray signals" come into this. If you want a level shifter with Schmitt trigger, it's probably wisest to just buy one; in fact, you can buy speciality level shifters like the especially promising SN74LVC1T45 that can pretty much be adapted to arbitrary voltages, or you can just get a 74xx logic family IC that accepts your voltage range of interest and outputs a suitable voltage range on its output (with your voltages, 74HCTxx is probably the go-to family). Pick an IC that has Schmitt trigger inputs if you're in for the extra noise immunity. Your first circuit is highly problematic: your threshold voltage is the negative input voltage. Not many opamps support that – typically your input voltages need stay at least a couple mV away from your supply voltages. Depends on your Opamp! What you'd need is a Rail-to-Rail input opamp; since input is usually the harder part, the abbreviation RRIO is what you'd look for.
H: Old stereo with a blown fuse I have an elderly but much loved Kenwood cd/radio/tape stack that has blown a fuse. The fuse rating is T800mAL 250volt. For reasons beyond me these don't seem to be available in the UK and the Amazon US supplier does not ship to UK either. Could someone tell me, please, if there is a compatible fuse that I can install. AI: If you look at the Amazon article (T800mAL2150V), you see it's a 800 mA, 250V, slow blow fuse. I think you can buy themk also in the UK, if they don't have 800 mA, buy something close. Btw, AliExpress sure ships to the UK, there are plenty to be bought, 10 pcs for 10 euro, or 25 euro for 200, enough for its entire lifetime.
H: Can I get 9 V out with a 12 V input from the attached regulator? The 9V regulator in this datasheet has a 2V dropout voltage. However, in the electrical characteristics on Page 9, the datasheet says that you need 15V input to get a  9V output. Does that mean I can't get 9V out with a 12V input? Or am I interpreting the datasheet wrong? AI: Yes, this regulator will give you 9V from a 12V input. The dropout voltage is indeed 2V. The heading on page 9 is just telling you the test conditions that were used to characterize the part and get the data shown in the table. It's not practical to specify a device at every possible operating point, so the manufacturer chooses some typical conditions and measures the device parameters under those conditions. If you look at the quiescent current specification, for example, you will see a maximum value of 6mA. The section on quiescent current change gives you an idea of how the quiescent current will vary for a few different cases: varying input with a smaller load, varying input but held at room temperature, varying the load current with constant 15V input.
H: Transistor design with beta variation I am studying Schilling-Belove Electronic Circuits, 3rd Ed. where in its second chapter under the "Maximum Symmetrical Swing" section it gives an example where the base current is kept constant and the beta is varied from 200 to 400 which makes the collector current reach the edge of the saturation value almost... and then it says.. "... (hence) the transistor is biased with a constant-emitter rather than a constant-base current". What I don't understand is how can the emitter current stay constant while we can vary the base current to our will to satisfy design requirements.. It isn't that Ib and Ic can adjust between themselves keeping Ie constant.. Ib and Ic themselves are constrained by beta.. Or is there something hidden in the language I am not getting through.. AI: This is how "constant-base current" circuit will look like: simulate this circuit – Schematic created using CircuitLab The base current will be fairly constant as long as \$V_{CC} >> V_{BE}\$. $$I_B = \frac{V_{CC} - V_{BE}}{R_{B1}} \approx \frac{V_{CC}}{R_{B1}}$$ And due to the fact that \$I_C = \beta \cdot I_B\$ and \$V_{CE} = V_{CC} - I_C \cdot R_{C1} \$. Any variations in \$\beta\$ bale will have a huge effect on collector current and Vce voltage. For example, if \$ V_{CC} = 10V\$ and \$ \beta \$ changes from \$\beta = 200 \$ to \$\beta = 400\$ will will have: Case 1 (\$\beta = 200 \$) $$I_B = \frac{10V - 0.6V}{400k\Omega} \approx 25\mu A$$ and $$V_{CE} = 10V - 200 \cdot 25\mu A \cdot 1k\Omega = 5V $$ Everything looks good, the transistor in active mode Case 2 (\$\beta = 400 \$) $$I_B = \frac{10V - 0.6V}{400k\Omega} \approx 25\mu A$$ and $$V_{CE} = 10V - 400 \cdot 25\mu A \cdot 1k\Omega = 0V $$ In this case, we get \$V_{CE} = 0V \$ which is impossible and in fact, the transistor will be in saturation mode. And there will be some small voltage drop across BJT. More about saturation here: A question about Vce of an NPN BJT in saturation region But we can bias the transistor in a different way to get "constant-emitter" current. In this case, we fixed the emitter current at \$I_E = \frac{V_E}{R_E}\$ and any change in \$\beta\$ value will only change the base current \$I_B = \frac{I_E}{\beta +1}\$ because the emitter current will be fixed by the external voltage source and emitter resistance. See the example: simulate this circuit As you can see the emitter current will be \$beta\$ independent as long as we have an ideal voltage source at the base terminal. $$I_E = \frac{V_B - V_{BE}}{R_E} \approx \frac{1V}{200\Omega} = 5mA $$ And if the \$\beta\$ changes from 200 to 400 the only thing that will change is the base current from \$25\mu A\$ to \$12.5\mu A\$. In real life instead of a voltage source, we are using "stiff" voltage divider instead. Which means that the base current only slightly affects the output voltage of the voltage divider. And we can achieve this if we pick the voltage divider current much larget then the maximum base current. See some examples BJT Amplifier with Emitter Bypass Capacitor Design BJT amplifier (Vce) voltage!
H: How to calculate an op-amp's current usage based on datasheet's supply current and its Vout terminal? This might be a dumb question so if yes, I apologize. I would like to power an op-amp off of a boost converter and I need to know how much current an op-amp would use. I'm using TI's web bench and there's a lot of cost / space differences depending on the max output current. So I have to pose this as a question even if it sounds dumb because it has a lot of space / cost ramifications. On a datasheet, it says that the "supply current" for an op-amp like the MCP6002 (https://www.digikey.com/product-detail/en/microchip-technology/MCP6002T-I-MS/MCP6002T-I-MSCT-ND/669500) is 100 uA. The MCP6002 is actually two op-amps in one integrated component. I will be outputting roughly ~1 mA from one of the op-amp's Vout terminal. For now just assume the other Vout terminal isn't used. When I design my boost converter, I'm assuming the booster should only require a max output of 1.1 mA. This is for the 1mA coming from Vout and the 0.1 mA going to the "supply current". I can round up to 3 mA to be safe. Is this a correct assumption, however? Another question: If I do wind up using the other output's Vout, do I need to also 2x the supply current (e.g. 200 uA). AI: The typical current is 200uA for the package, plus whatever else you draw from connections to the op-amp output(s). You should use the maximum of 340uA rather than the typical. You can't stop the unused op-amp from drawing quiescent current, it does so whether you connect to the output or not, however if you connect the unused one incorrectly it might draw more current because it's oscillating or whatever. If you draw 1mA from the output of the used op-amp, total current could be as high as 1.34mA. Of course the current at the input of your boost current will have to include the voltage ratio (if you double the voltage, the current at the input will be double the output current, plus more current for the quiescent current of the switching regulator and the losses in the switching regulator.
H: Bi-Directional Logic Level Converter I want to create a logic converter to communicate an ATtiny85 (trinket 5V) with my raspberry-pi. I am currently following this guide. I want to use a written program for ATtiny that only generates a TX UART output on the software side and send data to the raspberry. In this guide the NMOS BSS138 is used, I would like to know if I could use the NMOS 5LN01SP instead. Also, I want to communicate in the simplest possible way. What is the difference if I choose to use a voltage divider (two resistors) at the ATtiny85 output to ensure the 3V on the Raspberry input pin or the fact that I lose bi-directional property? Thank's you for your help. AI: I want to use a written program for ATtiny that only generates a TX UART output on the software side and send data to the raspberry. I need 9600 baud In this situation a resistive voltage divider should work fine; in fact with decently chosen resistors (say 1.2K series and 2.2K shunt) it will deliver a better signal than most off-the-shelf implementations of a series MOSFET shifter which tend to use a 10K pullup resistor. Another option could be to run your ATtiny at 3v3 itself; however if you do that it is better to give it its own 5v to 3v3 voltage regulator, as even inadvertently connecting or disconnecting loads (especially anything that may have its own supply filter capacitor) from the pi's delicate 3v3 pin tends to cause system failures.
H: ESD mats & motherboard safety Let’s assume bog standard two layer ESD mat with static dissipative top and conductive bottom layer, with resistance to ground somewhere between one mega-ohm to one giga-ohm and with both a mat and an operator grounded to a common ground point; bog standard consumer or HEDT motherboard. A) If I were to put a completely new motherboard straight from its retail package onto the ESD mat, would there be any risk of said mat draining CMOS battery or shorting out RTC circuit powered by CMOS battery? Why? Why not? B) Does the situation change if the motherboard have been on for some time before turning it off and immediately putting it on ESD mat? Why? Why not? C) Is it safe to turn the motherboard on while laying on the ESD mat? Why? Why not? AI: A) If I were to put a completely new motherboard straight from its retail package onto the ESD mat, would there be any risk of said mat draining CMOS battery or shorting out RTC circuit powered by CMOS battery? Why? Why not? The mat typically has a resistance > 1 MΩ and < 1 GΩ. Such huge resistance won't short or (really) drain any battery. B) Does the situation change if the motherboard have been on for some time before turning it off and immediately putting it on ESD mat? Why? Why not? No. Same reason as in A. The resistance is huge enough not to cause damaging currents anywhere on the motherboard. C) Is it safe to turn the motherboard on while laying on the ESD mat? Why? Why not? Yes. Assuming the power supply providing the voltages to the motherboard is safe, the voltages on the motherboard itself (12V, 5V and 3.3V) are SELV, Safety Extra Low Voltage. Important thing regarding A and B: If you don't wear a ESD strap yourself (which has the same connection as the mat), you might damage the motherboard by the act of putting it on the ESD mat or, when it is already on the mat, by the act of touching it. The second action is most easy to understand. There can be an Electrostatic Discharge (ESD) from your fingers through the air to the motherboard which drains away even better due to the ESD mat. Image source When holding the motherboard without protection and approaching the map (to put it on the mat), this same ESD pulse can go through your fingers, through the motherboard, through the air, through the mat, which may have the same catastrophic result.
H: RC Snubber For Phase Angle Controller I have a phase regulator and I'm using it for regulating the RPM of a fan - centrifugal blower. The motor is a shaded pole induction motor (220VAC, 28W). The regulator is working fine, but if the RC Snubber (R8+C8) is disconnected (due to the failure of C8 or R8), the voltage and current are getting out of phase and false triggering / turn off of the triac occurs, which leads very quickly to overheating and failure of the coil of the induction motor. What type of capacitor should I use to minimize the chance of its failure (I’m using this regulator for 8 hours a day)? Or is there a way to add additional circuit for protection, if such failure occurs? I’m currently using Polypropylene capacitor rated for 250VAC/400VDC (Wima MKP 10 - https://www.wima.de/wp-content/uploads/media/e_WIMA_MKP_10.pdf). For the resistor I’m using 1W/Metal Film. AI: The edited question is clear, now. The capacitor is correct WIMA MKP 250VAC is the correct choice. The resistor could be under rated, also it seems a little bit too low 360 ohm to me. Have a look here: RC snubber circuit design for TRIACs - STMicroelectronics , there is a calculation for 26W pump and the calculated sbubber is 10nF and minimum resistance of 620 ohm. I wouldn't change the capacitor you've got, it's really high quality and for this specific task. Choose a capacitor for higher voltage, like WIMA MKP 630V Also, BTA-16 is somehow too big for the required load, if you can change it use a smaller one like BTA-06.
H: MEMS piezoelectric sensor circuitry I have a question what exactly does a MEMS piezoelectric sensor chip contain. Does it contain the sensor element alone (or) also the signal conditioning circuitry for the MEMS piezoelectric sensor as a microelectronic integrated circuit (nanometer/micrometer level). From what I understand, MEMS sensor has capacitor fringing plates with a seismic mass and then the changing capacitance between the plates is proportional to the acceleration. I guess the signal conditioning circuitry would be on the chip due to the proximity. Also, is it possible to process the signal off-chip as well? AI: You'd typically need some kind of energy flowing into the vibrating structures, so the stabilized supply electronics need to present, anyway. Since the currents involved are very small, it's highly desirable to place these in the same package to avoid much larger noise currents from external traces. The signal of interest is most of times "coupled out of" these stationary supply signals. So, that coupling electronics should be close to the MEMS element, too. Then, you've got a weak signal. You'll want to amplify that as close as possible to the source. So, in the same package, if not even on the same die. Whenever you amplify something, you want to limit the bandwidth – to not amplify more noise than signal. So, typically, loopback filters are integrated. That's often the first thing that "leaves" the sensor: you'll find MEMS sensors where you can set the bandwidth with an external capacitor. So, MEMS technology is exactly interesting for the opposite reasons: it's possible to integrate signal conditioning, and so you do. If you circumvent that (for example, by replacing the external filter capacitor with an open end), you'll simply not get any sensible signal, because the phenomena observed are much smaller than what's easy measurable from afar. That is not to say it's impossible to do that externally, but you'd have to do very careful (and potentially expensive) board design to protect these signals from noise influences, and to protect the sensor element from loading.
H: How can I attach a USB microphone to a Breakout-board using ADC Ports? I am almost a total noobie to electrical engineering and I bought a programmable Drone called "PlutoX" from here. I am currently trying to attach a USB microphone like this: to the so called "X-Breakout board" delivered by the drone manufacturers. My question is... how can I attach the usb microphone mentioned above to the ADC Ports on the Breakout board? Here's an image: I've circled the ADC Ports in red. Through some recherche I was able to find out that the slot on the very bottom of the ADC Ports is the Pin13 (for coding purposes), where I have to attach the microphone to. Unfortunately I don't know which kind of wire I need for this or even which kinds of wires exist. I am pretty sure that I will need some kind of adapter to set up a connection between the usb microphone and a wire which is connected to the Breakout board. I am very thankful for your help! AI: You can't. The USB "Microphone" is actually a microphone, an amplifier, analog filtering, an ADC of its own, a bit of digital signal processing and a microcontroller that speaks the rather complex USB protocol, probably all in one chip (aside from the actual microphone). There's no analog signal coming out anywhere of that thing. You need to use an analog microphone, add your own amplifier and anti-aliasing filter before connecting it to your microcontroller's ADC.
H: How to decipher hex code for time data on an older serial port device I’m using an old Draeger PAC III sensor to measure gas concentrations, with the goal of remotely transmitting the data via Arduino. Accordingly, I cannot use the proprietary software to output the system information/data. Even though the system has been “retired” by the company and is no longer sold/distributed, their technicians will not provide the datasheet for communication on the device. To circumvent this, I’m attempting to use a serial port monitor to read the com between the device and PC. The PC communicates through a RS-232 port, but uses only ground and a combined Tx/Rx line to get data from the device. To activate communications, all written data starts with a high (01). All read data duplicates the written data, then tacks on device data. The first command is always 'initiate communications by identification' aka the first 4 chunks of data. I can only assume the remaining data communicates time, but I don’t understand how to decipher it. If endian is used/needed, how can I do this? Thank you in advance! According to the proprietary program’s reported values: Time (probably 24 hr clock): 1:13 Date (mm/dd/yyyy): 4/9/2008 Serial Number: ERXL-0162 Part Number: 4530011 Software Version: v3.50 [03/08/2019 16:44:22] Written data (COM4) 01 01 01 02 00 05 ...... [03/08/2019 16:44:22] Read data (COM4) 01 01 01 02 00 05 01 01 01 26 02 34 35 33 30 30 .........&.45300 31 31 20 20 20 45 52 58 4c 2d 30 31 36 32 20 20 11 ERXL-0162 20 20 34 35 33 30 32 37 30 76 33 2e 35 30 07 3b 4530270v3.50.; [03/08/2019 16:44:23] Written data (COM4) 01 01 01 02 00 05 ...... [03/08/2019 16:44:23] Read data (COM4) 01 01 01 02 00 05 01 01 01 26 02 34 35 33 30 30 .........&.45300 31 31 20 20 20 45 52 58 4c 2d 30 31 36 32 20 20 11 ERXL-0162 20 20 34 35 33 30 32 37 30 76 33 2e 35 30 07 3b 4530270v3.50.; [03/08/2019 16:44:23] Written data (COM4) 01 01 02 02 00 06 ...... [03/08/2019 16:44:23] Read data (COM4) 01 01 02 02 00 06 01 01 02 07 89 28 01 0d 38 01 ..........‰(..8. 02 . [03/08/2019 16:44:23] - Close port COM4 Edit: Two more time stamps as requested Time: 1:02 4/9/2008 [03/08/2019 20:04:30] Read data (COM4) 01 01 02 02 00 06 01 01 02 07 89 28 01 02 28 00 ..........‰(..(. e7 ç Time: 1:04 4/9/2008 [03/08/2019 20:05:50] Read data (COM4) 01 01 02 02 00 06 01 01 02 07 89 28 01 04 00 00 ..........‰(.... c1 Á AI: Here's a hypothesis of the time part of the data: From the original data capture: 01 0d 38 01 02 We know the time was shown as 01:13. That's the 01 0d and I believe the next byte 38 is likely the seconds value, but that is not displayed. I am considering that the last 2 bytes on each "packet" sent from the device may be a checksum (it's a common approach). That explains why the last 2 bytes of the first two packets are the same (07 3b) - since the data in both packets is the same. Then the next packet (the first data & time example) has different values for the last 2 bytes. From one of the additional date/time captures: 01 02 28 00 e7 Following from my first interpretation above, knowing the displayed time is 01:02, that's (not surprisingly) the 01 02 and also 40 seconds (hex 28) with an 00 e7 checksum for the whole "packet". Here's a higher-level hypothesis of the packet decoding: Using the original date/time packet as an example: 01 01 02 02 00 06 01 01 02 07 89 28 01 0d 38 01 02 The original command is the leading 01 01 02 02 00 06 where the actual command is 01 01 02, then the number of bytes following (including checksum) is 02 and then there is a checksum for that "command" - 00 06. The response starts with the next bytes: 01 01 02 (perhaps tells us what command this is a response to, for sanity checking by the master/PC). Then there are 07 following bytes (including checksum) - 89 28 01 0d 38 01 02. As I already suggested, I suspect that the 01 0d 38 is hh mm ss values in hex. The trailing 01 02 is a checksum. That means that the actual date can only be encoded in the two remaining bytes 89 28 in that data packet. My hypothesis at this stage, is that those two bytes 89 28 might be a little-endian day counter value, meaning it might really be 28 89 (hex) i.e. 10377 (decimal) days. If that was true, then 9th April 2008 - 10377 days seems to be 11 November 1979. Not an unreasonable "epoch". (That's much more reasonable than if I treat the bytes as big-endian, convert 89 28 hex to decimal (35112) and subtract that many days from 9th April 2008, which seems to suggest a day counter start (epoch) of 21 February 1912 - that's much less sensible for a piece of modern equipment.) If you can wait for the date (i.e. the day) to change on the devices internal clock, then we can see if the date value does indeed change in those response bytes from 89 28 to 8a 28, which would confirm that it is a little-endian day counter value sent from the device, and interpreted to become a display date in normal format, by the PC software. Or you could try to feed a modified set of data to the PC software and change those two bytes which I believe encode the date, and see what the PC software displays. The problem is the (what I believe to be) checksum on each packet. That makes it difficult (likely impossible) to feed modified data to the PC software, until you have the checksum algorithm, and can correctly modify the checksum bytes, when you modify the data bytes. Finding the checksum algorithm proved easier than I expected. The last 2 bytes in each packet, both the 6 byte "sent" data packets, and the longer "received" data packets (but only the real "received" data, which starts with the 7th byte in that mixed sent + received data capture) are indeed a checksum. It is literally the sum of all the the bytes (but excluding the checksum itself, obviously) in big-endian (i.e. MSB then LSB) format. (All examples below are in hex.) For example, in the sent data packets, it is easy to see this: 01 01 01 02 00 05 => 01 + 01 + 01 + 02 = 0005 01 01 02 02 00 06 => 01 + 01 + 02 + 02 = 0006 In the first date & time packet (ignoring the 6 bytes of "sent data" at the start): 01 01 02 07 89 28 01 0d 38 01 02 => 01 + 01 + 02 + 07 + 89 + 28 + 01 + 0d + 38 = 0102 With this information, it is now possible for you to build a modified data packet and send it to the PC software, with a valid checksum, to see how that data is displayed. As mentioned before, the bytes to concentrate on changing (to help you understand their meaning, and confirm or deny my hypothesis of them being a day counter) are those containing 89 28 in the real date & time packets.
H: If I increase the number of motors in a parallel circuit, will my current increase? I am new to electronics, and am looking to build my own quadcopter. Before I purchase anything, I want to make sure I can get an appropriate battery to power the motors. The battery I am looking at is a lithium polymer 3s (11.1V), 5200mAh, with a maximum discharge capacity of 30c. The motors I am looking at are DXW A2212 DC, 3 phase brushless motors. I believe the maximum current load will be no greater than 20 amps, and the max efficiency current is at 10 amps. Assuming that there will be a constant current of 20 amps being drawn, and I add 3 more motors (4 in total), what will happen to the current drawn from the battery? I know that the current in parallel is split up, so will my overall current drawn increase? In the example above 2A is split up. If I reverse this, and have 20 amps * 4 (as 4 motors in parallel to each other, each drawing 20 amps), would I be drawing 80 amps from the battery? This would be logical, but I don't know if it is how motors work. I hope this made some sense. AI: If you put two identical resistors in parallel, the resulting resistance is 1/2 of each resistor. Therefore, twice as much current will be drawn from the power source. So, yes, if you put four motors in parallel, they will try to draw quadruple the current as one. (Actually, not quite 4x as the internal resistance of the battery will drop the voltage to some degree.)
H: Sense resistor connection I'm looking throw bq76940 datasheet and I've found such connection of sense resistor: What is the purpose of the additional resistors and capacitors? Why all 3 capacitors are required? AI: It's a lowpass filter. It filter out common mode noise (resistors and those capacitors connected to the earth) and differential noise (mid capacitor and resistors)
H: Level shifting between SD Card and Lipo-powered microcontroller I have an ATtiny861 microcontroller powered directly from a Lipo battery. My circuit is designed to operate on supply voltages from 3V - 4.2V (bonus if it tolerates up to 4.6V). I need to interface with a MicroSD card, which works around 3.3V. I'm using this datasheet from Kingston as a reference (feel free to point me toward a more authoritative spec). I'm looking for suggestions on sourcing (or building) a level shifter that tolerates the entire 3V-4.2V range on one side, and 3.3V on the other. Initially I looked at the TXB0104 but it's inappropriate because it requires one side always remain lower than the other. (I suppose I could run my SD card under-voltage, eg. at 2.9V, but I'm hoping there's a better way). Also note I'd like to minimize part count, routing complexity and footprint (in roughly that order). A few more details: I only need to read the card, and am limiting myself to SPI mode. That means three unidirectional "output" lines from the uC to the SD (CLK, CMD, CS/DAT3), and one unidirectional "input" line from the SD to the uC (DAT2). Running the uC at 3.3V isn't an option I'm considering. It spends most of it's time sleeping, and periodically wakes to see if activity is required. I figure putting a linear or buck converter between the battery and uC would likely waste some power due to conversion losses during these periods. It would also necessitate a redesign of some other parts of my circuit. I'm powering the SD card with a 3.3 buck regulator (PAM2301CAAB330) which is shut down when I'm not reading the card (nor using other devices sharing the same enable line). I could probably do a quick-and-dirty hack by wiring the input directly to the uC, and the three outputs through voltage dividers. It might work at "typical" values, but would violate the min/max specs of the components. Some helpful tidbits from the datasheets: uC input HIGH min: 0.7 * Vcc (so down to 2.1V) uC input LOW max: 0.2 * Vcc uC output HIGH min (@3V Vcc): 2.5V uC output LOW max (@5V Vcc): 0.6V SD Vdd: 2.7V - 3.6V SD input HIGH min: 0.625 * Vdd SD input LOW max: 0.25 * Vdd SD output HIGH min: 0.75 * Vdd SD output LOW max: 0.125 * Vdd AI: For the 3 output signals, use a 74LVC3G16 triple logic buffer with Vdd connected to the SD Card 3.3V supply. This logic family's inputs can take up to 6.5V and have no Vdd clamp diodes, so the ATtiny can safely drive them even when powered with 4.2V. For the input side you might just get away with a direct connection. Input high voltage of the ATtiny is permitted to go +0.5V above Vcc, but you are powering the SD Card through a step-down converter so it cannot output a voltage higher than the battery voltage anyway. With a fully charged battery the ATtiny could get as much as 4.2V, while the SD Card's logic high output is nominally 3.3V. This gives a logic high level at the MCU of 3.3/4.2 = 79%, which is above the required minimum of 70%. However the SD Card spec says it might only manage 0.75 * Vdd which is not enough. To ensure that the output reaches 3.3V you could use a 74LVC1G16 single buffer gate. You might also consider redesigning the circuit work with the MCU's power supply regulated to 3.3V. Regulators such as the MCP1700 have quiescent current of less than 2uA, and will help prevent possible misoperation of the MCU due to rapid supply voltage changes.
H: No. of comparators in Parallel ADC I can't figure out why exactly the no. of comparators is (2^n)-1 in a parallel type ADC. The truth table (shown below) for a three bit priority encoder say that there must be at least one HIGH input for the valid output. But as I was reading the Digital Fundamentals by Thomas L. Floyd, the figure shows that the pin 0 of the priority encoder is grounded(it's a reference point and can be any level of volts but I am taking it to be zero as a common practice). So when every output of comparator is 0, all the inputs of the priority encoder are 0. Is this input valid? Or is it me that is taking the ground to be 0V, rather than some +ve volts to keep this pin high every time? Here is a screenshot of the circuit shown in the book I am going through. AI: That ground is actually an error in the schematic. It should be a connection to VCC (logical 1). The intent is that, when the SaH input is very close to analog ground, all of the comparators will output a logical 0. To activate the appropriate condition in the priority encoder (that is, the first row in the truth table), the D0 input needs to be 1. Otherwise, all inputs would be 0, which is an unspecified state. Keep in mind that the priority encoder is a digital component, not an analog one. In this context, ground and VCC are primarily logical values, not reference voltages.
H: Astable 555 circuit not oscillating I'm a complete beginner to electronics, but I'm trying to follow Ben Eaters video series "Building an 8-bit computer". I tried to do the first part of an astable 555 timer, but the LED does not oscillate and on top of that the timer draws A LOT of current and heats up pretty fast. Does anyone have an idea what I did wrong and how? I'm using NE555P, 1uF capacitor, 5V from a rigged phone charger. AI: This answer is a summary of existing good answers plus various comments. The OP supplied a good image and schematic. Several issues stand out or were a potential past problem. Breadboards are known for odd behavior, however this circuit should be stable with just a 4.7 µF capacitor across the 555 power and ground pins. Inputs should NEVER be left floating. As Marcus mentioned in his answer the active low reset pin should be tied to Vcc for stable operation. As Sunnyskyguy mentioned in his answer it is very possible the LED was inserted backward. If so it may or may not have been damaged. Replace it when possible. Peter Jennings mentioned that you may have inserted the 555 IC backwards initially or had Vcc and gnd reversed at the power connector. If so consider it toast and try a new one. Reverse polarity can damage most any IC and cause it to get very hot even with no load connected. While it is not mandatory, inserting a 10 nf cap from the control pin to ground helps the 555 reject noise on the Vcc line. It is good practice to route ALL ground connections first, then power, then inputs, then outputs. Much better chance of getting connections right the first time, and having even complex boards work right the first time. Plug in your ICs last after testing your power feeds with a DVM. Do NOT bend LED or other component leads close to the body of the part, as this can cause internal stress and damage. Use needle-nose pliers to create a 1/16th inch minimum gap before the bend. I would replace the LED and make sure the cathode goes to ground. Use a new 555 timer and please pay attention to component orientation. Add the extra capacitors mentioned for stability. This is a simple 555 timer IC. Pay attention to details and it should work just fine.
H: Interpolating output specs on SN74LVC1T45 transceiver Section 7.5 of the datasheet for the SN74LVC1T45 shows minimum HIGH and maximum LOW voltages for output lines of the chip. Values are given for several different Vcc values (e.g. 2.3V, 3V, 4.5V). What's the most reliable way to interpret values for intermediate Vcc's? Or do you need to jump down to the next-worst-case value? AI: [FAQ] What method is best used for estimating specification values between those given in the datasheet? says: If, for some reason, you really need a value between those given in the datasheet, linear interpolation is the TI approved method for getting intermediate points. You might be saying "but not all those specs are linear" – and you'd be right. The fact is though, that across a small range (for example, between 1.65V and 3V), the variation from linear will be minor, and the datasheet values provide some headroom to the specifications. This method gives a safe approximation that is backed by TI and our characterization process. […]
H: Current Source and Current Sink Excuse me for this simple question. Can someone tell me how this circuit works? In the video, it is said that, the voltage drop across the resistor connected to NPN/PNP will be only a diode drop. But I'm not grasping that. Can someone simplify it better? AI: A first approximation for the NPN circuit would be: Where D4 represents the Base-Emitter junction. It is clear that the added voltages across D2 and D3 equals the voltage across D4 added to the one across R1. Since the voltages across diodes directly polarized don't vary too much with the current, it is also clear that the voltage across R1 is similar to a voltage drop across a diode. \$V_{D2}+V_{D3} = V_{D4} + V_{R1}\$ \$ V_{D2} \approx V_{D3} \approx V_{D4} \$ Analyzing the circuit with the transistor, if it is kept far from the saturation, the base current will be a small fraction of the emitter current. If \$V_{R1}\$ doesn't change considerably, also its current will remain practically constant. Since \$ I_C \approx I_E \$, the circuit will keep the current entering the collector almost constant. To do that the \$V_{CE}\$ will change, so if the transistor goes into saturation, the current control will not be effective. Maybe it easier to understand if you connect a load resistor (\$R_L\$) between the collector and the voltage supply. You can vary \$R_L\$ from 0 to a value which allows the \$V_{CE}\$ voltage to stay above the saturation voltage. Just flip everything upside down for the PNP circuit.
H: Need help in cable temperature calculations I am trying to calculate how hot will a 0.6m long 28AWG wire carrying a load of 12VDC, 0.2A get. I understand that are other factors such as environment cooling rate, thermal resistance between air and the cable etc. Ampacity values are not really relevant to my scenario as the cable is in contact with the human body. Thus, I am more concerned about whether if the user can detect the change in the wire's temperature. I also do not have the resources nor the proper apparatus to conduct an accurate measurement test. An aluminium core 28AWG wire has a resistance of 0.32716 Ω/m. Power dissipation: $$P=I^2R$$ $$P=0.2A^2\times0.32716Ω \times 0.6m$$ $$P=7.851mW$$ Found this equation here, altough it is only meant for radiative heat loss $$ \dot{Q}_{12} = \epsilon A\left ( \sigma T_1^4 - \sigma T_2^4\right )$$ Based on the above, I got a value of \$309K\$ which means the temperature increase is about \$4°C\$ from an ambient temp of \$305K\$. Is this an accurate reference? Basically, I want to know if a 28AWG wire will stay cool during operation or do I need to select a lower gauge wire. AI: Radiation is a negligible component of heat loss for a wire close to room temperature in air. It becomes a factor for long wires in a vacuum, and high temperature differences, but that's not the case here. Convection is the primary source of heat loss for a long wire in still (or moving) air. If it's in contact with skin, conduction will be a big factor. In air, convection is the primary factor. Convection calculations involve fluid dynamics so they're not as straightforward as you might hope for. But to get a rough estimate, consider this graph from this website: Very roughly the temperature rise in still air is about 3.3\$\times \text I^2\$, so for a current of 200mA in an AWG 28 wire you could expect about a 0.15K rise. If it's in contact with a 'bag of mostly water' the conduction to the skin (and therefore the skin temperature) will have a large effect.
H: Flexible GPIO routing Arduino shield I want to make a combined MIDI In/Out/Thru + MDX Output shield, so I can order/design just one shield for all my needs. It is intended to use the shield for Arduino Mega which has 4 UARTs, and I want to stack multiple of these on top of each other, and use jumpers to select which UART pins will be used for MIDI In/Out (1 UART = 1 MIDI In + MIDI Out). For the DMX part, I could do the same, not thought about that yet, I probably need one DMX output, so I just use the DMX output of one shield and not use the others (maybe not even solder the components for it). Also, maybe in the future I want to move to Arduino Due, which is 3.3V, and I might need an alternative routing for some components. What is the best way to create this flexibility (especially for the UART pin selection)? I was thinking about the following two solutions: Solder pin headers and use jumpers to make the correct connections; because the device will be transported a lot, I might glue the jumpers. Solder pin headers and I solder small wires as jumpers (like permanent wires). Use resistors to make the connections, 0 ohm like a jumper, and do not solder the other connections. Dip switches. But maybe there are better solutions I didn't think about. AI: For robust connections like this I like to use normal pin headers, but instead of using push-on jumpers I make wire-wrap connections. A good wire-wrap connection is very reliable. The disadvantage is that you need to have a wire-wrapping tool and the special wire used with it. As an old timer I happen to have that on hand anyway.
H: Battery type Identification Request I am trying to replace the battery of a rechargeable LED torch, but it looks different than most others that I have seen. I was wondering if anyone can help me identify it, so I can try to find a replacement. Otherwise I'm thinking I'll replace it with an 18650 and a TP4056 (mini USB dc charging), but an in-place replacement would be good. It recharges from Mains power, if that helps. I opened a couple of others of different make but similar form, and they all had similar looking batteries. The yellow caps are kinda like silicone I think, and not solid. The battery voltage is ~3 or 3.5 I think, and the LEDs are very dull. The source of the torch is India. But essentially Mains is 220V. The battery is very similar to this 4V 0.5Ah lead acid battery AI: The following (as edited :-) ) IS good advice. Whether it is worth following, is up to the original poster or those who come after. Do please note the clear warnings re potentially ** lethal voltages probably present in the original device. These will not be present if a 5V USB type power supply is used, as recommended, in the new design. The battery is "almost certainly" a two cell "4 Volt" lead acid one. These are not common but I have seen Chinese made lights using similar. The design is probably very old (I'd love one), the LED is probably low efficiency and low output and the charger is probably lethally dangerous. If that doesn't stop you, read on. The battery can probably be replaced with an 18650 or other LiIon single cell battery. These have lower low end voltage than the Pb battery - which may be a problem if their circuitry purposefully drops some voltage using eg series diodes or a voltage regulator with more than a few tenths of a volt dropout voltage. (Use of a regulator is unlikely. A simple series resistor would probably replace the "electronics" previously used (if any). Recharging is more problematic. The mains charger will destroy the liIon battery unless limited to say 4.0V ABSOLUTE MAXIMUM. You can float a liIon cell at 4.0V with some hope of an OK lifetime but NOT at 4.2V. A good alternative choice is to use one of the many many TP4056 LiIon charger modules available on ebay / AliExpress. These accept 5 to 6V (preferably 5V) and handle all charging aspects. Modules with an inbuilt output protection/cutoff feature cost little more and are a good idea. Identifying what sort of charger is currently in use. There are strong indications from the photo that the existing charger is a dangerous "AC mains input series capacitor" type. This is covered below, but 1st I'll mention the possible alternative. Low voltage charger: - IF the charger uses a "plug pack" / wall wart" with a low voltage output of say 5VDC to 6VDC it may be able to be used for a LiIon battery - see below. If not, adding one would be (very) wise. HIGH VOLTAGE AC MAINS INPUT TO TORCH. If the cord that connects to the torch carries AC mains (110 VAC?) then the following applies. ASSUME THAT ALL PARTS OF THE TORCH AND CHARGER CIRCUITRY ARE AT FULL MAINS VOLTAGE WHEN THE LIVE CORD IS CONNECTED TO THE TORCH!!! The markings on the capacitor used indicate that it is a 0.68 uF 400V rated part - indicating that this is almost certainly a mains voltage charger. (Such as part is almost certainly not used in a low voltage charger). Be aware that IF you input AC mains to the on-body connector then it is almost certainly a capacitor impedance voltage dropper type that will kill you if you let it - consider ALL connections always at MAINS VOLTAGE with that sort of supply. If it is a mains input charger the best choice would be to change to a regulated 5VDC plug pack (such as used for most modern cellphones) and proceed with the TP4056 advice. If you MUST try to adapt a lethally dangerous AC mains capacitor charger (Hint: Don't!) then you need to establish Voc and Ichg. Charge current is probably 25 or 50 mA half/full wave on 110 VAC and about double that on 230 VAC. Too low really. I'll not give more advice on that here - ask if still interested in that aspect. Low voltage charger If adding one, use a 5VDC one rated at up to 1A. If the existing input is low voltage DC (unlikely) Measure the voltage O/C (open circuit) from the inbuilt charger. If OC voltage is >= 5V and under about 6V or maybe 7V it will operate the TP4056 Ok. Loaded it should be 5V optimum and not over 6V for thermal reasons. The modules are resistor programmable for charge currents of <= 1A. If Voc is > about 7V it will need to be regulated or resistor loaded to bring it under 7V OC. TP4056 chargers: ebay TP4056 charger search Avoid this style - only $2.99 for 10! BUT does not have battery cutoff feature - battery output only - no separate load terminals. Aim for this style Note separate Out-/Out+ and Battery - / Battery + connections. Vin can be via microUSB connector or +/- terminals on other side of it. Here is an SE EE question related to the TP4056 modules. TP4056 circuit with and without low voltage battery cutout protection. This is a typical module circuit diagram: The simpler modules omit the DW01-A protection IC and the FS8205A back-to-back MOSFET switch and connect B- to Out-. Simple module: Relatively complete LiIon charger with up to 1A output current. More complex module: As per simple module but adds a battery over-discharge protection function. Given the very small difference between the modules, use of the module with output protection is by far the best choice. The battery connects to B+ and B-. The load connects to Out+ and Out-. That's it ... . TP4056 IC datasheet here. A web page on TP4056 charging performance under various conditions here
H: Sine to square on complex wave? What are the required parts on a circuit to get a square wave out of a sine one following the constraint shown in the image? Schmitt triggers seem to work on continuous sine wave but as you can see, I need to keep the variable volume information as is. Do you know any part(s) that could do it? Edit: Oldfart corrected my graph. This is what I want to achieve. To me, the net result is the same but I understand how wrong I was with my waves looking into the future. My mistake. I currently solve that situation in C++ but I was curious if HW could do it. AI: This is doable, but could be prone to noise. What you appear to be after is an output squarewave, which transitions on the defection point of the incoming signal AND whose amplitude is that of the transition point. The point of inflection can be determined by differentiating the signal and testing for a sign change (+ve to -ve or -ve to +ve). A Sample&Hold can then be used to influence the amplitude of the resultant signal. The concept is demonstrated below (crudely, for a 2min model...). How this is realised in practice is a different problem. The main concern will be the differentiator and the susceptibility to noise. The incoming signal will need to be filtered and potentially a deglitch/retrigger function on the sample & hold. This will impact your bandwidth. If the signal of interest is "slow changing" with regards to the processing you should be fine. You can see the impact of a fast-changing signal on the differentiator below as techically there was a very quick +ve change and a -ve change, but the fix-step sim triggered once. A 1kHz filter before resolves aspects of that WIth a 1kHz pre-filter (to manage the fast transition) Now you can see there is an additional level change as the signal is slow enough for the fix-step Do you know any part(s) that could do it? To sample, to differentiate, to sample & hold, to output... I doubt any dedicated analogue chip exists that does this. It could be built out of some OPAMPS, FETS, R,C ... A better solution would be to use a small uP and this would not need that much processing.
H: Current Sensing Amplifier Circuit explained I've been trying to understand why each every comment is in the circuit shown. I understand that the amp is taking the voltage drop across the Rsense and amplifying it such that the current across it is known. However, I'm not sure why the two resistors are there because if I didn't know any better, I'd design with no resistors that way all the current is accounted for across Rsense. Also, I'm not sure how to analyze the BJT in the feedback loop. I'm assuming the current mirror is there to provide a 1:n ratio current/mirror the current at the output. AI: RG2 is only there to make the circuit symmetrical so that input bias current of the amplifier cancels out. From the current through the sense resistor to the load, there is a voltage drop such that the right hand side of the sense resistor is at a lower potential than the left hand side. The op-amp drives the BJT base to equalize the voltage at the lower end of RG1 with the voltage at the right hand side of the sense resistor. That means that the collector current is equal to the load current multiplied by Rsense/RG1. The base current is relatively small, perhaps 0.3% of the collector current, so the emitter current is almost the same. So a resistor to ground can receive the sensed current and produce a ground-referenced voltage that can be buffered and fed to the output. You may note that the current through the resistor RG1 does not pass through the sense resistor, that means that it represents the current through the load better than then current from the supply, but there is a proportionality between them, and typically RG1 = RG2 >> Rsense so it's a very minor difference. I don't know why they show a "current mirror", it is not often used, but possibly some integrated circuits might use a structure like that to deal with low supply voltages, reflecting the current off ground and supply again to get a voltage that can go a bit higher with respect to ground (the shown circuit produces a current with a compliance on the positive side that is limited by the op-amp output voltage and Vbe drop). For example, if the op-amp output can only get to Vin -1V then the maximum voltage at the emitter of the transistor is perhaps Vin - 2V, accounting for possible low-temperature operation where Vbe is large. That might be a bit tight if the circuit is intended to operate from a 3.3V or lower supply voltage.
H: Equation of graph from the graph How would I go about finding the equation of the solid black line exponential/logarithm graph? The two data points are: (x,y) (9,-14) (20,-21) AI: For grabbing information from datasheets and producing useful coefficients, I've successfully used WebPlotDigitizer. Here is a comparison of various programs, apparently the reservations expressed for WebPlotDigitizer have been dealt with and no longer apply, but do your DD.
H: ESC Output Current for a Brushless Motor with a Given Max Current Rating I am trying to power a brushless motor with a max current consumption of 12.5 A (specified in datasheet). How should I figure out the maximum current drawn by one of the phases of the ESC? Should I just divide the max current draw of the motor by three, or is the solution more complex? AI: With 6 step commutation each phase wire is connected for 2 out of every 3 steps, so as a rough guide you can assume that it conducts 2/3 of the average motor current. That means you can generally get away with motor wires that are one gauge smaller than the battery wires. Getting a more exact figure is harder because the current waveform varies depending on motor characteristics and throttle level. Below is an example scope trace of current in one phase wire of a brushless model aircraft motor. In this case the battery current was measured at 15.4A. We see that current is flowing for 2 out of every 3 steps, and the current during this time is fairly flat at ~16A. Therefore the average current over a full cycle should be ~11A and the rms current should be ~13A. And here's the same motor running at part throttle on a higher voltage battery, showing the effect of PWM:- In this case the battery current was only 10.3A, but the waveform has become triangular and peaks at ~32A. The average and rms currents are still ~11A and ~13A, but are now higher than the battery current.
H: VHDL: case when using constants constructs I'm having some trouble with the following statement if spi_ctr = 9 then case spi_op is when spi_op = op_get_r_count => spi_reg_out <= ref_count_i; when spi_op = op_get_s_count => spi_reg_out <= sig_count_i; when spi_op = op_get_g_limit => spi_reg_put <= gate_limit_i; end case; Quartus sinthetizer spits the following errors Error (10500): VHDL syntax error at spi_iface.vhd(93) near text "="; expecting "!", or "=>" Error (10500): VHDL syntax error at spi_iface.vhd(94) near text "="; expecting "!", or "=>" Error (10500): VHDL syntax error at spi_iface.vhd(95) near text "="; expecting "!", or "=>" i don't see a syntax error around however, i also tried using the following spi_reg_out <= ref_count_i when spi_op = op_get_r_count else sig_count_i when spi_op = op_get_s_count else gate_limit_i when spi_op = op_get_g_limit; and it spits a similar error the constants are defined as follows -- read operations constant op_get_r_count: std_logic_vector(7 downto 0) := "00000001"; constant op_get_s_count: std_logic_vector(7 downto 0) := "00000010"; constant op_get_g_limit: std_logic_vector(7 downto 0) := "00000011"; spi_op is as follows signal spi_op: std_logic_vector(7 downto 0); is there something obvious i'm not seeing or you need to use literals in these kind of statements? --- Edit after following the recomendations from @Oldfart i changed the code to this case spi_op is when op_get_r_count => spi_reg_out <= ref_count_i; when op_get_s_count => spi_reg_out <= sig_count_i; when op_get_g_limit => spi_reg_out <= gate_limit_i; when others => spi_reg_out <= (others => '0'); end case; and voila! it Almost works however it outputs quite a weird error that really caught me with my pants off Error (10344): VHDL expression error at spi_iface.vhd(102): expression has 31 elements, but must have 32 elements ?! shouldn't the last statement take care of that? --- edit again actually that error was from an other line, dumb me Oldfart post your answer if you want the kudos :) AI: I'll turn my comment into an answer (Last night it was very, very late). The case statement itself will do the comparison. Thus another comparison is too much. The correct syntax is: if spi_ctr = 9 then case spi_op is when op_get_r_count => spi_reg_out <= ref_count_i; when op_get_s_count => spi_reg_out <= sig_count_i; when op_get_g_limit => spi_reg_put <= gate_limit_i; end case; If this code is inside a rising_edge(clk) section it is fine as it is. However if it is outside a clocked section you can get latches. (Not only from the case but also from the if). In that case you should add a when others => spi_reg_put <= ... but also an else ... section. Last remark: it is useful to be able to distinguish constants from variables. There are several methods. Using something like 'const', 'cnst' or 'c_' in the name: constant const_op_get_r_count: std_logic_vector(7 downto 0) := "00000001"; Or follow the Verilog and C convention to use capitals: constant OP_GET_R_COUNT: std_logic_vector(7 downto 0) := "00000001"; A colleague of mine prefers both: constant C_OP_GET_R_COUNT: std_logic_vector(7 downto 0) := "00000001";
H: Incorrect gerber rout output in Altium I tried to get a panelized PCB from Altium using the embedded array option from the PCB Doc file. But, I get a continuous board edge around each of the PCB replicas: it would actually need mouse bites or tab routes or V scores. So, I imported the Gerber and drill files into Camtastic and deleted the board edges. I tried exporting the edited board edge file but gives me jagged lines all over. What should I do? AI: Use the header given in the image and copy it to the top of the new board edge file before reloading it.
H: ARM Instruction size vs Instruction encoding I cannot make sense of the difference between 'Instruction size' and 'Instruction encoding' specially about ARM and Thumb ISA's as explained here: Can we say that Instruction size is 32 bits but its encoding is 16-bits for Thumb-1 ISA and 32 bits for Thumb-2? IS 'encoding' related to the binary code generated by the Assembler or is it related to the MCU internal architecture and not visible to the software developer? AI: From my point of view they are both "interconnected". The old style CPU instruction sets were all the same size, now with this Thumb mode the instruction size is variable, where some of the bits (encoding) of the instruction determines also its size . It is explained in the link you provided: the CPU fetches the first half (16bit) of the instruction, then it branches wheather it is 32bit instruction it fetches the second half (additional 16bits) of it, if it's only 16bit instruction it executes it without fetching the second half. With this kind of instructions also the programming memory is smaller compared to fixed size of instructions.
H: Use half bridge driver with one mosfet I need a single mosfet driver but only have half bridge drivers (IRF2004) in my parts box. Is there a risk I destroy them if I only connect one mosfet to them? Any other risks which I should be aware of? AI: This is done quite often, especially on bigger ICs incorporating several half bridge drivers. Unused half bridge drivers can be used to drive single MOSFETs.
H: How to read this switch data I'm come across a schematic that uses a switch symbol shown below. This switch is a Kraus & Naimer CA10 Switch (That's all I know). The schematic symbol is shown on the right with terminals numbered 1-6 and lines representing the three positions. The physical location and angle of these positions is shown on the left. Has anyone seen this before and could tell me how to read these or direct me to somewhere showing how? I'll shown another example below. AI: Each switch position is represented by a vertical line. Contacts are arranged horizontally. Contact closure is indicated by a black dot. Figure 1. Position A: 5 is connected to 6. Position B: 3 is connected to 4. Position C: 3 is connected to 4. 1 is connected to 2. This is rather like a car's ignition + starter switch with 5 - 6 closed in the off position. Turn 90° clockwise for ignition on and a further 30° for starter. When released from the start position it will spring back to ignition position. Figure 2. Position A: no contact. Position B: 5 is connected to 6. Position C: 3 is connected to 4. Position D: 3 is connected to 4. 1 is connected to 2. Note that in this case A and D the switch springs back to the adjacent position.
H: Why does capacitance not depend on the material of the plates? As a student, learning about a capacitor after understanding what a resistor is, it was quite surprising to note that the capacitance does not depend on the nature of the plates used, at least in any type of capacitor I have known. I am guided, "it makes no difference as long as the plates are conducting." Is that true? AI: Yes that is true, capacitance is: \$C = \frac q V\$ where q is the charge and V the voltage between the plates. As long as the charge \$q\$ can be "hold in place" this relation applies. I mean, there is no need to have a "good" conductor as the charge is static, it does not move. So as long as for a certain voltage \$V\$ is applied resulting in a certain charge \$q\$ to be present on the capacitor's plates then \$C\$ can be determined. It does not matter if the plates are bad conductors (high resistance) as it will then simply take longer for all charge to reach its final location. In the final state there will be no difference compared to a capacitor with well conducting plates as the amount of charge will be the same. Only if you look at the dynamic behavior of a capacitor (how does it respond to quick voltage changes) would you see an influence of the conductivity of the plates. In first order the capacitor would exhibit additional series resistance.
H: OpenServo and I2C Syncronization I need to send a command to multiple I2C devices on the same wire. The devices are OpenServos. Each device get's it command and begins processing the information in the command. How do I ensure that they all start processing the command at the same time? EDIT: Just to clarify, this question is mainly about I2C's ability to support syncing. AI: A few possibilities come to mind: Have an I2C Master device dedicated for each servo (a microcontroller for example) and a single microcontroller dedicated for generating a synchronization signal which will go to each of the I2C Masters. If possible, configure all the servos to have the same I2C address. They will all receive the command at the same time thinking that it is for them. Absolutely will not work if each motor needs its own parameters - only if they are to receive the exact same identical commands. Possible issues: multiple devices trying to drive the line during ACK or during a reply may cause unpredictable bus contention. Might be worth a try though if they're all going to receive identical commands. A quick look at the OpenServo page tells me that these devices are re-programmable and you can write your own firmware. It sounds like to me that plain I2C may not be the best choice here considering your synchronization problem and there may be an opportunity to do something clever by modifying the motor controller firmware to accept an additional 'sync' signal. EDIT: Fake Name mentions a broadcast address in I2C and this may be hacked to your advantage. The official I2C Specification supports a "general call" address which is optional for the device. Laid out in the spec for general call are: address change with reset, address change without reset, and software reset. I suppose it is possible to modify the firmware to support a custom command and use(/abuse) the general call for your own purposes.
H: Resistive Touch Screens I was reading this article today about interfacing a microcontroller with a 4-wire resistive touch screen, and found myself a little bit confused. The article suggested this could be done by using four digital i/o pins and two ADC inputs. Two of the four touch screen interface wires are for the X-axis and two are for the Y-axis. The pairs are operated on independently (e.g. the other pair is tristated by the microcontroller). The operation performed by the microcontroller on each pair is to apply Vcc to one wire and apply Gnd to the other. The wire to which Gnd is applied is also connected to an ADC input on the microcontroller, and the voltage read is proportional to the position being touched along that axis. What I don't understand is why the ADC would ever read anything but 0V since the microcontroller is driving that wire to Gnd. How does this work? Here is the schematic from the article for reference: AI: I think the reading is taken from the other axis. So if you want to read the X axis you apply power/ground to the X wires and read the ADC connected to Y. If you notice in the code snippet it says power is applied to X axis but reading is taken from CH0 (RA0) and named result_y (I think the diagram may have RC0 and RC3 connections mixed up though): //Set PORTA To Inputs/High Impedance TRISAbits.TRISA0 = 1; TRISAbits.TRISA1 = 1; //Set Lower 2 Bits to High Impedance TRISCbits.TRISC0 = 1; TRISCbits.TRISC1 = 1; //Set Higher 2 Bits to Output TRISCbits.TRISC2 = 0; TRISCbits.TRISC3 = 0; PORTCbits.RC0 = 0; PORTCbits.RC1 = 0; //Provide Ground To X-axis Of Touch Screen PORTCbits.RC2 = 0; //Provide Power To X-axis Of Touch Screen PORTCbits.RC3 = 1; // configure A/D convertor OpenADC( ADC_FOSC_32 & ADC_RIGHT_JUST & ADC_8ANA_0REF,ADC_CH0 & ADC_INT_OFF ); Delay10TCYx( 5 ); // Delay for 50TCY ConvertADC(); // Start conversion while( BusyADC() ); // Wait for completion result_y = ReadADC(); // Read result CloseADC();
H: What's the next step in my track to become an Embedded Hardware or Hardware Engineer? I'm a student studying computer engineering , I'm in love with hardware stuff /logic gates design ... etc What I studied till now is : Electronics IC fabrication Logic circuits design (sequential , ... ) Error detecting & correction in logic circuits (parity check , ...) HW design Computer architecture (Control unit ,execution unit ...etc ) after finishing it I was able to design a microprocessor MicroProcessor (Z80 , 8086 , ..) Computer Interfacing (Buses , creating cards , motherboards ..... ) Digital signal processing ALL of the above courses I studied them hardly, understand them fully I also made some projects using AVR uc , So what do you think the next proper step for me ?? Update 1 : I've the following software background : Software Engineering Java, C , C++ ,C# C for embedded Data structure & Algorithms Operating systems AI Image processing AI: Make something. Seriously, make something major. Imagine this: hundreds or thousands of people are exactly in your same predicament of getting out of school with lots of classes. These people are largely indistinguishable from each other. You need to do something that differentiates you from the others, and shows that you have initiative and can "hit the ground running". I suggest designing and making something from start to finish. It should be as close to a real product as possible (without incurring lots of costs of fancy prototypes). It will probably take you 3 to 6 months to complete the project. This should also be something useful and something that you have a passion for. Don't do another me-too project. What I don't recommend, at least initially, is going for a masters or Ph.D. People with post-doc degrees and no experience have a hard time getting jobs. These folks have the education to demand a high salary, but no practical experience to actually do the job and no job history to show that they are worth the salary they demand. In short, most employers are hesitant to hire these folks. Once you have something other than school on your resume then you can think about furthering your education. There is also a huge chance that you'll decide to not bother.
H: Controlling Electromagnet Via USB I need to control an electromagnet via USB with an android phone, to make a small educational project. I know how to write the software, but how can I control an electromagnet via USB? Via an USB Relay? Any suggestion? AI: This may be overkill for what you want, but Microchip do an Accessory development starter kit for Android. With that you can create anything you like to interface with your Android phone. You can even use Arduino shields with it! To this you would need to add something to actually drive the electromagnet. You might like to check out the many tutorials online about interfacing motors and solenoids to the Arduino, as the same applies to this board. Most commonly either a transistor, or transistor pair (known as a Darlington Pair) is used, depending on power requirements. These are also available in an IC form, such as the popular ULN2003 chip with 7 Darlington Pairs in it. I have created an Arduino shield that contains an 8-channel Darlington IC, the ULN2803, which you can etch yourself using Toner Transfer. The details on it are here. Shameless self promotion there :)
H: Help with TIP122 darlington transistor i want to use the TIP122 darlington transistor with my atmega8 to control a 3A 12V geared DC motor. i found that the current gain is 1000 for tip122 from its datasheet. so the base current for 3A output is 3mA(am i wrong?). So i used a 1.6k resistor to limit the current from atmega8. I breadboarded the circuit and found that i get only 4v emitter voltage even though i the supply voltage is 12.4V. why is this so? i removed the resistor and again i get the same voltage( base current from atmega8 without resistor is 40mA). i simulated the circuit in Proteus and still the same result. So something is wrong? Please help me with this. AI: TIP122 datasheet is here Fig 2 of the data sheet shows that Vbe is typically 1.75V "saturated" when Ic = 3A. Using Vbe = 2V is safer. Using 2.5V does no harm. Fig 2 shows that Vce = 1V typical at 3A. So the transistor will dissipate Power = V x I = 1V x 3A = 3 Watt. If you use eg a TO220 package you will need a modest heatsink. If you use a surface mount package you may need to check heat sinking issues. Your circuit should look like the diagram below. Note that the motor connects from 12V to collector. Fig 1 in datasheet shows that gain improves wuth IC upto about 3 and that a gain of 4000 may be expected. Do not trust it :-). Designing with a gain of 1000 will work well. For Ic = 3a you need 3 mA drive at gain = 1000 as you noted. If we assume a 5V supply then R1 is such as to allow 3 mA to flow when Vbe = 2V (see above) R = V/I = (5-2) /0.003 A = 1000 ohms. If the process ior was running on 3V3 say then R1 = V/I = (3.3-2) / 0.003 A = 430 ohms =say 390 ohms Worst case if you allowed Vbe = 2.5V and drove it with a 3V3 processor pin then R = V/I = (3.3-2.5)/0.003 = 266 ohm = say 270 ohms. So R1 may have a 4:1 variation depending on what Vbe you decide to choose* and what processor supply voltage is. In fact 1000 ohms would probably work O in all cases and 470 ohms is probably a good all round compromise. (* I said "what Vbe you decide to choose" but in fact the transistor does the choosing - actual Vbe will depend on the transistor in the given circumstances and we choose a Vbe for design purposes based on what the datasheets tell us. ). A motor is inductive. When you turn it off the motor current cannot styop instantaneously and MUST go somewhere. Diode D1 gives it somewhere to go. Without D1 you will get a LARGE inductive driven voltage spike. The voltage will rise until the motor current finds somewhere to go ! :-). This can be fatally bad for the transistor and for other electronics, ALWAYS include a D1 equivalent on such cases. To be safe D1 should be rated at motor current. In practice this may not be needed depending on how you are driving the motor. If you are using fast PWM then D1 should be a fast diode BUR in almost all cases a standard power diode will do OK. 1 x 1N400x will probably do. 2 o3 3 in parallel will be better. A single power diode rated at3A or more is better still - but 1N400x are cheap and more usually available. No no no !!!; You mentioned driving the transistor base directly with no resistor. This is very bad practice as it very probably violates the processor's datasheet specifications. Once you do that anything can happen and anything might. In some cases (not in this one) you may also destroy a driven device doing that. Circuit components should always sbe designed !.
H: A little clarification regarding voltages, and "real" current movement To my understanding, the voltage supplies the potential, and free electrons are taken from ground? This makes somewhat sense to me, for example if something has a "positive" charge then it will attract negative electrons to it - which works out, however I am unsure if negative charge (relative to one specific point) means more free electrons. Another question, so mains line provides the potential of 120/240VAC (ignoring AC) and the current does not actually "come" from it, only from ground? This subject seems to be just taught quickly, it would be very nice to have an understanding that "works" in all aspects I throw at it. AI: To my understanding, the voltage supplies the potential Voltage is the difference in electric potential between two points. It is analogous to a difference in pressure between two points of a hydraulic circuit. and free electrons are taken from ground? Free electrons are everywhere in metal. All matter contains electrons, and in metals, some of those electrons can flow freely. They won't flow until you apply a voltage, though. Applying a voltage causes them to flow, which we call an electric current. http://amasci.com/miscon/eleca.html#batt "Ground" is just a label for a point in a circuit. Any point can be considered ground. It's not special, it's just a common reference point for measuring. Another question, so mains line provides the potential of 120/240VAC (ignoring AC) and the current does not actually "come" from it, only from ground? Current doesn't "come from" anywhere. Current is a flow of charge, which already exists everywhere. In electronics, electrons aren't usually important. What's important is flows of charge, waves in charge, etc. Go read everything on this page: http://amasci.com/miscon/elect.html Related: Why does a resistor need to be on the anode of an LED? Also related: Why is the charge naming convention wrong?
H: Building a power supply for a Vic 20 I recently acquired an early model Vic 20 computer but don't have a power supply for it and thought I might be able to make one. The Vic 20 is the early model with the two pin AC connector - not the later model DIN plug. From what I've read it needs 9VAC at about 3A. I'm in Australia where mains is 240VAC, so I'm looking at this transformer: http://jaycar.com.au/productView.asp?ID=MM2014&keywords=mains+transformer&form=KEYWORD. It doesn't say on that site but in their dead-tree catalog it's got two sets out secondary outputs each multi-tapped 0->9V->12V, 2.5A each. Since I've not done much with mains, just want to check somethings: Wiring the two secondary 0v + 9v outputs in parallel will give 5A output - enough to power the Vic and some accessories. Will I need a fuse on the mains side? They recommend one on the page so I presume so. What sort of case would you recommend for something like this - it's just the transformer and fuse, with a mains and 9VAC leads coming out. Should the case be ventilated, plastic, metal, how to best mount the transformer etc... Have I missed anything? AI: Check! There's discussion whether the fuse should be placed before or after the transformer. I place it before. I'd use a 500mA, slow-blow ("T") version. I would use a metal case rather than plastic. Not that there would be a risk of the plastic melting — it doesn't get that hot — but metal transfers the heat better to the environment. I would use a ventilated enclosure if I could find it, though it will cost a bit more. Mounting should be straightforward; if it's a classic EI transformer use a bolt and nut for all 4 mounting holes. Use spring washers so that the nuts don't come loose because of vibrations. A toroidal transformer often comes with mounting material, so use that. I don't think so. Success!
H: How can I increase the number of hardware UARTs in a design with a single UART MCU? I am using a TI CC430 MCU because it contains an embedded CC1101 radio frontend. I would really like to stick with this MCU. However, I need to simultaneously interact with a separate serial radio, a FTDI (uart->USB), and an RS232 GPS. So it would be nice to have 3 separate UARTS on the MCU. What are my options for increasing the number of UARTs? I have considered adding a CPLD and muxing the single UART to 3 outputs, but I really don't like that approach because it not really 3 simultaneous connections. AI: You could add an extra UART over SPI or I2C. These have internal FIFO buffers inside them so you periodically check them for content and let them handle some buffering. NXP, TI, Maxim probably offer these parts. MAX3100, SC16IS752 etc. You could also add a second MCU to do this, but as you're already using quite a simple microcontroller with 1 UART and want to stick to that, that seems overkill. You could also use a multiplexer to choose between the UART your micro talks to. But as you mentoined data is transmitted simultaneously , that won't work. Software serial could be your last option but it can be very annoying to deal with if your microcontroller is doing other stuff as well.
H: Theoretical analysis of amplifier circuit I have the circuit of the amplifier below. I want make the DC analysis and find the gain the amplifier produces and the cutoff freq(high-low). My problem is that it's been 15 years since I was student and I remember nothing. I will appreciate any help provided. AI: I did the DC analysis by hand: Summary: Theoretical: Ib = 5.963uA Ic = 895uA Ie = 900uA Vce = 7.362V Spice: --- Operating Point --- V(n002): 6.71675 voltage V(n005): 0.895875 voltage V(n006): 0.248847 voltage V(n001): 12 voltage V(n004): 0 voltage V(n003): 1.47768e-014 voltage Ic(Q1): 0.0011241 device_current Ib(Q1): 7.02464e-006 device_current Ie(Q1): -0.00113112 device_current I(C2): 6.71675e-019 device_current I(C1): -8.95875e-020 device_current I(R5): -6.71675e-019 device_current I(R4): 0.000497708 device_current I(R3): 0.000504733 device_current I(R2): 0.00113112 device_current I(R1): 0.0011241 device_current I(V2): -0.00162883 device_current I(V1): 8.95875e-020 device_current Then the AC analysis: Gain: Summary: Theoretical: Voltage Gain: -17.6 Spice: This gives you the -3db points: f-low: ~= 500Hz f-high: ~= 24MHz Comments: As you can see the theoretical and Spice DC analyses match closely. Spice differs since it takes many more factors into consideration.
H: Alternate ways of measuring distance (lateral)? I'm working on a micromouse, a small autonomous robot that traverses a maze. I need an efficient way to measure lateral distance to walls and I'm looking at the Sharp GP2D120 but looking at the datasheet, it has long typical response time of 39ms, is quite bulky, and has a minimum distance of 4cm. Can you recommend a better sensor (that possibly has a lower minimum distance)? I was wondering what are some alternate ways of measuring distance? I have seen other micromice use IR LEDs and it was interesting but I'm not sure how it works. Any input is appreciated. Thanks! AI: I have read somewhere (I think the Arduino forums) that sharp no longer manufactures these sensors (though that can be hearsay). I do know however that they are quite expensive compared to much simpler solutions. The simplest would be a IR LED - IR phototransistor combination: Phototransistor on left, led on right You would power the IR LED (remeber the limiting resistor!) and then use the phototransistor to pick it up. The voltage drop over the phototransistor will be proportional to the intensity of the IR light it picks up which is proportional to the distance the emitter and detector are from the reflecting surface. Pointers (Personal Experience): It will take some experimentation and calibration to find the correct voltage - distance relationship The voltage will vary depending on the reflectivity of the reflector to IR light. The detector and reflector will need to be shielded from each other in order to gain a accurate measurement. This type of sensor is only reasonaly accurate. Keep it in mind. The detector is susceptible to outside sources of IR light, including the sun, incandescent light and florescent light bulbs. There are many links on the internet on how to use said components. Take a look here: http://letsmakerobots.com/node/2907 Lastly, this method (I have found) is only accurate over small distances (not more than 20cm I'd say). For longer ranges you should consider ultrasonics or those fancy Sharp sensors.
H: 40 pin ZIF / DIP footprint I am looking for an eagle footprint that can accept both a standard 40 pin DIP socket or a ZIF socket. Alternatively, if you have tried this and found it to be impractical I'd like to hear that too. update: thanks for the contributions. I had not realised that different brands of ZIF sockets can be very different in pin spacing. The ZIFs I have is marked 3M (although it is more likely a clone). The two rows are definitely not at the standard distance from each other, yet close enough to the standard distance that two holes is out of the question, the holes would overlap which AFAIK is frowned upon by boardhouses. I now made the holes larger, I'll see whether this works out OK (the file was sent to the PCB house today). The holes are now so large that no trace will fit between two pins, but the autorouter did not mind :) update 2: larger holes worked OK. It is a bit of a compromise now, I would never use such large holes for a normal DIP socket, but is still fits OK. supercat's answer was the most usefull to me, but it is in a comment :( I have one of those black ZIFs too, I like it much better than my '3M clone', but it costed maybe 10 times as much... AI: The pins of a 40-pin ZIF will have the same spacing as a 40-pin DIP. The issues to watch out for are: (1) some ZIF sockets have pins which require larger holes than would be required for most sockets, and (2) nearly all ZIF sockets are wider or longer than ordinary sockets; many are significantly longer. If you wish to solder a ZIF socket directly into a board, you should leave room for this. My normal preference, however, is to solder an "ordinary" socket into the board and plug a ZIF socket into that. If you take that approach, it may be possible for the ZIF socket to overhang some low-clearance components.
H: Determine suitable resistor for the base of transistor as switch (NPN) I have designed a program to count the frequency and time period of the pulse generated by a 555 timer IC using PC Parallel port. I’ve connected a base of BC547 (NPN) transistor to the output pin (no. 3) with a resistor of multiple values to the IC and its emitter to the common ground. Parallel port Input pin is connected to the Collector and its ground pin is also connected to the common ground. As shown: R1 = 1440 Ohms; R2 = 3.3 M Ohms; C1 = 1 micro farad. So the; time period of ON pulse = time period of OFF pulse = 2.2 sec. When I connect LED to output pin it shows right value but when I connect transistor it displays wrong values. In this ratio: Greator Resistor = Greator Time period; Lessor Resistor = Lessor Time period. I don’t know how to connect right resistor to display the right values. The circuit is powered by 6volt @ 250mA power supply. If there is any equation for this purpose please provide here. AI: Use 10kΩ for R3. I didn't look up a BC547, but if that's a typical small signal transistor as it should be, figure a gain of at least 50. 6V supply minus 700mV B-E drip leave 5.3V accross the resistor. 5.3V / 10kΩ = 530µA. Times the gain of 50, and that can support over 25mA of collector current. That's well more than any reasonable digital input will require, even if it has a pullup connected. As others have said, you may need a pullup if whatever you are driving doesn't passively make the line go high. However, make sure the pullup goes to same voltage as the power supply of whatever will receive the digital signal. Your supply is 6V, which is probably higher than the receiver's supply. That could cause the receiver to not work or even to damage it if its power voltage is significantly lower.
H: What happens if I connect a transformer in reverse? I was thinking the other day. A transformer is just two coils, right? There is no polarisation or anything else fancy? The ratio of the number of windings on the input to the number of windings to the output reflects how many volts are outputted given the input? So if I connect my 250V to 7.5V transformer to the mains in reverse, will I simply get 8.33KV? I assume so. More practically, what will happen? From memory, the breakdown voltage of air is approx 1KV/cm. Doesn't this mean there would be all sorts of streamers between the transformer output terminals? What about between the windings themselves? Surely the thin layer of insulation around the transformer windings tightly wrapped doesn't insulate that much? And say there are streamers between the 8KV outputs of the transformer. What then? Fire? Blown fuse? AI: As Mr Banana says - magic smoke happens. Because ... Energy is transferred in transformer via a magnetic field. The field is produced by the amp-turns in the core (amps flowing x number of turns). Above a certain level the core cannot support any more amp turns and the core "saturates". What was an inductor with resistance to AC of far more than its resistance becomes mainly a resistor. You'd get lots and lots and lots of amps in the case that you mentioned - so much so that if the fuse didn't get there first the transformer would DEFINITELY be destroyed. The iron core in a transformer is usually operated on the part of its magnetic curve where it is beginning to saturate and get less efficient. This is to get as much use of the steel core as possible. They are run close enough to "the edge" that a transformer made to run on 60 Hz mains will get much warmer on 50 Hz mains at the same voltage as the cycles are 60/50 = 20% longer and the current in the winding gets that much longer to increase and ... So a SLIGHT overvoltage may work OK - say about 20% max. But 230/7.5 0 30+ times as much "will not work"! :-)
H: Why does my solder occasionally pop? Sometimes when soldering, it sorta "pops" and leaves tiny droplets of clear, hard substance on my PCB. It seems to be able to melt away with a brush of my iron, and isn't too bad. I'm ironing at about 260 degrees C (510 F) with "44" rosin core .80mm. AI: As the other answerers have said, the clear, hard substance is the rosin from the solder. There are a number of things which can cause what you describe. Voids in the rosin core: As the solder heats up, the gas in the void becomes pressurized. Once the solder is sufficiently molten that the gas in the void can escape, it does so. Violently. Some rosin is hygroscopic: The composition of some rosin cores can cause it to absorb moisture from the air. Once the rosin is heated to a certain point, it releases the absorbed moisture in the form of steam. Sometimes rather violently. Hot-Spots on your soldering iron: If you are using a low-quality soldering iron, the tip may not be very thermally conductive. Therefore, if you apply a lot of solder to the tip, it can cool fairly dramatically. If the applied solder then runs along the surface of the iron (due to surface tension) to a section which is much hotter, it can cause the rosin to boil off suddenly. Overall, the little rosin balls are generally fairly harmless. If you want your boards to look really nice, you can wash your assembled PCB once you are done putting it together. Look up your flux's datasheet. It will tell you what you should clean it with. There are water soluble fluxes, as well as more aggressive fluxes which require solvents. From your post, ("44"), I assume you are using Kester #44 solder. You can find it's datasheet here. It states: Cleaning: Kester 44 possesses excellent fluxing ability, the flux residue is non-corrosive and non-conductive under normal conditions of use. When exposed to an elevated temperature and humidity environment (38°C, 94% RH) for 72 hours, there is no evidence of corrosion caused by the flux residue. Throughout its many years of wide usage, 44 Rosin Flux has produced many billions of soldered connections. In all these billions of solder joints, involving the most delicate and critical of electrical and electronic components, there has never been an authentic instance of corrosion by the flux residue under normal conditions of use. This mild property of the residue permits leaving the flux on the assembly for many applications. It's worth noting that more aggressive fluxes can be harmful to leave on your PCB. Such fluxes can actually eat away at the plating on the device pins over time. As a last note, one area where cleaning the flux off the PCB is critical is very high impedance applications. While the flux residue is a good insulator, it is significantly worse then the PCB alone. Therefore, you can have considerable leakage through the flux (~1MΩ between SMD pins). While it is not much current, if you are trying to measure nanoamperes, it can be a significant issue.
H: How is damage by pulling sideways usually addressed in connectors? Looks like the primary goal of Magsafe is to prevent damage to the connector (both the mobile part and device-attached part) from pulling the connector sideways. Wikipedia cites a patent issued in 2007. That puzzles me. Isn't the problem at least several decades old? For example, Micro-USB seems to be designed for mobile devices and is super tiny and it's a result of many years of connectors evolution, so I guess the problem of pulling sideways should have been addressed there. What are typical ways to mitigate risk of pulling sideways in connectors design? AI: That problem is normally solved by not having clumsy users yank at the cable at the wrong angle. Most users are clumsy or have clumsy children or clumsy pets, so it's not a very good solution to rely on an absolute clumsy-free environment for your connectors. Before magsafe there was one solution to clumsy users and that was to beef up the connectors and the cables to the point where the user was the one damaged in stead of the connector.
H: Are solenoids/inductors dangerous to have exposed? An inductor doubtfully will be in a position to be of harm, however a solenoid with 1A+ running through it (and of course a lot of it stored in the magnetic field) can certainly harm the circuit, if not somebody touching it at one point. From what I would imagine, the stored current will be converted back from magnetic flux and then be sent in to the circuit again, however, is there any harm in somebody happening to touch a (50mA->1A) solenoid when continuously on? When the circuit is accidentally ungrounded (not 100% my worry) or turned off? The input voltage should always (hopefully) be under nine volts, and I will be using it as a small electromagnet maybe for experimenting, however if the release of current causes a large potential that is one of the concerns although I do have quite a lack of understanding. AI: At 9V I wouldn't worry about touching the solenoid. After all, you can touch other parts of the circuit that are at 9V. The only issue with a solenoid is that it can for a short period of time make a high voltage if its current is shut off suddenly. For example, hold the wires of a solenoid accross a 9V source, then watch what happens when you release one of the wires. You'll see a spark. This is indication of temporary high voltage. If you were touching the two wires at the time you'd feel this spark. But, its energy is limited and duration short, so other than being unpleasant won't do anything bad unless maybe you somehow manage to get the current running thru your heart or your brain. The same temporary high voltage you can feel can also damage your circuit if you don't deal with the stored energy in the solenoid properly. The simplest way to do this is to put a diode in reverse accross the solenoid: In this case transistor Q1 is just a example of something switching the solonoid on and off. L1 is the solenoid coil, which is just a inductor with significant series resistance from the point of view of the driving circuit. D1 is reverse biased and therefore does nothing when the solenoid is on. However, when the solenoid is switched off it provides a path for the current to flow until it decays by disspating against the inherent resistance of the solenoid and the voltage drop accross D1. The highest voltage ever in this circuit is 9V plus the forward drop accross D1. This circuit would be safe to touch with your hands like any other 9V circuit.
H: Safe operating area for different types of battery chemistry? I'm trying to find the safe operating area for various types of batteries; in particular I need minimum and maximum termination voltages, although information on temperature / power / current is also desirable. For example, I know Li-Ion typically has a safe charge window of about 3.0V to 4.2V, and I've heard that NiCd / NiMH should never be discharged lower than 0.8V / cell. Are there any authoritative resources that list the safe operating area for a majority of battery chemistry types? AI: I have had a lot to do with a range of battery types in recent years. No one source covers everything or is perfect in it's treatment of a given chemistry, but I have found that Battery University usually does a good job of providing accurate, detailed and useful information. A look at Battery university's home page will immediately show you that this is a better than usual place to find battery information. Nickel based Lead based Lithium based And much much much more ... Manufacturer's pages are also an excellent source, although harder to find specific chemistry related material.
H: Distance range of a Color Sensor? I would like to know what is the usual range of a color sensor ? Can it detect a light source from a few meters away ? for example, if I want to use a color sensor to detect a particular LED 1 meter away, would a color sensor detect that ? I hope someone might know an answer to this based on expertise. Thanks ! AI: Summary: Your requirement can easily be met. Working with only one light source present light below the illumination levels that you can see at can be detected with an under $1 sensor. Having other light present may require optical filtering to distinguish between the various type of light present. Range capability of a given sensor will depend on absolute light level and on relative % illumination compared to total illumination from all sources. Absolute light level depends on emitter light output (lumen) and radiation or cone angle of source - which together result in the level of brightness (= lux = lumen/meter^2) at a given distance away. Brightness can also be measured in candela (= candle power) which is the amount of light over a given area and distance from the source compared to what would be emitted by a "standard candle". A typical modern 5mm LED operated at full power (typically 20 mA at 1.5 to 3.5 V depending on LED type) will typically produce around say 3 to 12 lumen (depends on wavelength etc). An LED with a say 15 degree cone angle and the above output will produce a brightness of around 30 candela or 33,000 millicandella. If you double the cone angle for the same lumen output the candela reading drops by about 4 x as the light has to cover 4 x the area. (draw yourself a picture). A single modern eg White LED operating at 20 mA and 3V with a15 degree one angle - as would be used in a typical high quality flashlight - and producing about 8 lumen will produce about about 30+ candela of brightness. At one metre that is approximately blinding - enough tp destroy your night vison and leave spots before your eyes. At 2 metres it's "rather bright" and at 4 metres still "extremely noticeable". If that was a red or green or blue or other modern LED the results would vary somewhat due to eye response but it would still be very bright. SO a colour detector working with that sort of light and no other light present would need to have very very modest capability to detect it at 1 metre. In oherwise darkness light at 0.1% of that would be detectable with relative ease using easily available technology. The sensor below is an example of what is chap and readily avaiable. Sensors can be mde to respond to specific colors only or ranges of colors using filters. These may be as simple as gelatin or plastic or cellulose fultyers or be complex and expensive interference filters. So filter cost cam be from under 1 cent to $100+. Sensors are also avai;able which respond to only a range of frequencies. For example a colored LED (NOT a phosphor based LED) can often be used as a sensor for light of around it's emission frequency. Gets complex in detail. Superb example of an under $1 sensor: This Avago APDS-9003 (Hewlett Packard in another lifetime) typical "ambient light sensor costing under $1 can detect light levels of well under 0.01 lux . Bright daylight at midday = 100,000 lux A monitor screen on full brightness may be 300 lux. Reading level with comfort and good color rendition = 50+ lux Bright moonlight < 1 lux Just perhaps see shapes on a dark room as you stumble about = 0.1 lux So 0.01 to 0.001 lux is "very dark"
H: Shunt resistance VS Rogowski Coil in current measurement , which one is better? Shunt resistance VS Rogowski Coil in current measurement , which one is better ? Just for reference I want to create small circuit that measure the power , so which one I go for ? UPDATE 1 : I'm measuring AC current Isolation is required Scale of current will be A to hundreds It will be a permanent part of the circuit I'm going to make an Electrometer AI: Rogowski coils measure only AC current. If you're measuring DC power, they are 100% not applicable to you. I've made use of several Rogowski transducers in my workplace, and have found that the coils can be quite fragile. Shunt resistors can be used for AC or DC current measurement. For AC applications, it can be preferential to use a current transformer instead of a shunt, as it introduces less losses in the circuit under measurement (assuming your single-turn primary is of sufficient size). Hall effect sensors are good for AC or DC as well, but the ones that I've used need + and - DC biasing, and can be cost-prohibitive at lower power levels. Given your range of current, I suggest that a hall effect sensor will be your best bet in terms of accuracy, size and losses.
H: "Overclocking" an AVR In AVR datasheets under the Electrical Characteristics section you will typically find a graph like this (this one is from the ATMega328): I've seen designs that seem to "work" but operate outside the shaded envelope. Specifically, I've seen 3.3V (Arduino) designs that run the clock from an external 16MHz crystal. Clearly, this is out of spec. What are the practical negative consequences of running outside this envelope? AI: How to make life more interesting 101: If you don't care that your results may sometimes be wrong, that your system may sometimes crash, that your life may be more interesting, that your Segway clone only occasionally does face-plants for no obvious reason, that ... Then by all means run the part outside manufacturer's spec. You get what you don't pay for. If you have a $10 head, buy a $10 helmet. It may often work. It may not work sometimes. It may not be obvious that it isn't working sometimes. A divide may usually work A jump may usually arrive. A table may be looked up correctly. An ADC value may be correct. Or not
H: Switch between battery and USB power Following on an earlier question I am looking for a circuit where it powers from USB when it is available and uses the battery when USB is not plugged in. I want voltage drop to be minimal, zero if possible. So using oring diodes is not possible. The mosfet power oring ICs mentioned in the answer are extremely expensive (4$ for 1K) although they have low voltage drop. I am looking for a discrete solution where I can build with simple switches or even a cheap LDO. I didn't try to build it but I thought I could use the existence of the Vbus to do a simple switch to control LDO's one from VBus, the other from VBat. UPDATE Ideally zero drop is wanted however up to 100mV can be tolerated. My system has 4 AA batteries, so there could be cases where the battery voltage is larger than 5V, that is why I focus on the existence of VBus. The small drop comes from the Operation voltage of one of the ICs, it needs to be 3.5V (min) and the larger voltage drop eats into the battery life. (i.e. 4 battery, 0.9 each, 3.6V, 100mV drop, I can squeeze the batteries). If there is a 0.7V drop, I can not use the full battery power. (I have to shut down the system at some point of time to ensure proper operation but batteries has still a lot of juice left) AI: A circuit that will do what is wanted, or as much as what is wanted as has been revealed, is shown below. This circuit is much simpler than it sounded like it was going to need to be, due to the revelation that the USB power feed could easily accomodate a Schottky "blocking dioe" and still meet the Vout requirement. If this diode had had too high a voltage drop to be acceptable then a circuit withtime delays and current flow direction detection would hav ebeen needed. It can be surprising how much difference a little more information can make to the solution of a problem. Battery feed at top. USB power feed at bottom. USB power is fed to load via Schottky diode D1. Power may be fed via Ja and the LDO regulator or via JB as desired. If feed via JB is used the LDO must survive with external voltage on its output when it has no input. If necessary (depends on LDO) adding another Schottky diode across Ja "pointing upwards" would apply the same voltage across either side of the LDO and minimise quiescent current (in most cases) when USB power is in use.If absolutely necessary another FET could be used to block USB feed from LDO but should not be needed. LDO could be put above Q3 BUT then battery supplies LDO quiescent current at all times = poor. When USB voltage is absent Q3 = P Channel MOSFET is turned on by R4, feeding battery voltage to LDO and thence to Vout. When USB voltage is present Q1 is trurned on by R2/R3 and this turns on Q2 (usually held off by R1) which clamps Q3 gate high turning it off, thus disabling battery feed. USB power feeds via D1 either via Ja and LDo or Jb as above. Battery current when USB connected: Changed R1, R4, R5 to nominal 1 megohm each to reduce battery load when USB in use. A small MOSFET for Q2 and/or some more thinking will reduce required standby current. USB on, Q1 on, About 5 uA via R5 to turn Q2 on. About 5 uA via R4 to turn Q3 off. R4 can probably be 10M if slow response OK. ( At R4 = 10 megohm if gate capcitance on Q3 is say 10 nF then time constant for turn on = RC = 1E7 x 10E-9 =~ 0.1 second. Depending on =FET gate threshold it MAY take a few 10ths of a secind for battery to turn on when USB is unplugged. This could dropout powered cct unless a large enough output cap was provided. At R4 = 1m the time constant is about 10 milliseconds and a "usual" sort of cap on output rail would suffice. Can be "tuned". Q1 on removes voltage from R1. 10 uA quiescent when USB is on =~ 90 mAh/year. This is about 3% of battery pack capacity. Small but annoying. Q1, Q2 = almost any jellybean bipolar. Q3 = P Channel MOSFET. Vthreshold << Vbattery. D1 = Schottky eg 1N5817. LDO to suit. Roll your own LDO with MOSFET and eg TLV431 can have about 100 uA quiescent when running and essentially zero dropout voltage. Can be much lower with lower Iq ref diode. BUT When you can get eg Microchip's VERY nice TC2104 LDO for under 50 cents in 1's, making your own makes less sense. ASdded Oct-2001: The TC2104 seems to have vanished. The LM293x series is widely avail;able - see eg Digikeys listings here Or, here are LDOs with 0.1V or less dropout voltage - Digikey listings quantity 1. Added 9/2015 Kar asked ... why are the BJTs needed? Why not just have a MOSFET and a diode, and that's it? @Kar Good question. The MOSFET solution is a good one but it is slightly more design-demanding than may be apparent, whereas the bipolar solution uses a few more components but is easier to ensure operation ioj all conditions. Tpo use the MOSFET as shown the FET's Vgsth must be chosen to suit. Battery max voltage (assuming his AA cells are Alkaline) is 1.65V (new cells) x 4 = 6.6V. In a few cases even maybe 1.655V so say 6.8V for 4. USB is say 5.3V max when on and 0V when off after any capacitors discharge. But critical here is not USB Vmax but USB_on_min USB_on_min = say 4.8V. Under that condition FET must be off, so FET Vgs = (6.8-4.8) =~~~~ 2V worst case. The FET MUST NOT turn on at Vgs = 2V. Battery min is say 4V and USB low falls to 0V "after a while" so FET must turn on at Vgs = 4V. That puts the FET Vgs_off_max and Vgs_on_min in a fairly narrow 2 to 4V range. That's certainly doable by correct choice of FET - but datasheet must be chacked to ensure that worst case spread lies in the desired range. The designer needs to be aware that design is needed! In the bipolar case the USB Von_min is very easily accommodated by Q1 and if desired full turnoff can occur when V_USB is say 2V so changeover to battery is better defined. So overall, the bipolar addition adds 2 x Q and 4 x R (small but non trivial) for the sake of better flexibility and designability. BUT the MOSFET only solution is a good one as long as the complexity that goes along with the simplicity is properly understood.
H: How to use resistors? I have a power supply of 5 volts @ 1A. I want to reduce the current from 1A to 250mA. Which resistor should be use? I tried this equation(Ohm's Law): R = V / I = 5/(0.75) = 6.66 Ohms. I tried the 6.66 Ohm resistor but it only reduce few mili Amps. AI: The 1A rating on the power supply is simply it's maximum, not the actual amount of current drawn by whatever you hook up to it. That is the amount you must ensure the load stays below. If the "load" is a short circuit, then your calculation is nearly right. $$ R = {{V}\over{I}} = {{5V}\over{250mA}} = 20\Omega$$ If the load is something else, a resistor of lesser resistance is required.
H: How does an audio transformer work with DC in this circuit? From my knowledge, there needs to be an alternating current for the transformer to be able to create magnetomotive force throughout the core. Various nerve testers (say for standard school projects) include an audio transformer ran on a 9V DC circuit though, with nothing looking like it would create an AC. Now I see a pushbutton? over an SCR, however in simple thinking that should not do too much, just act like transistor switch? What on earth makes the circuit work to have a high enough voltage? Something has popped in to my mind actually, tranformers actually do work with DC, only for a miniscule period of time when power runs through it, is that why it shocks? And why an audio transformer? Cheaper? AI: As you pretty much guessed, then transformer works when DC is applied initially. This causes a change in current through the windings. As the formula V = L(di/dt) shows, a change in current will produce a voltage across the inductor, proportional to how quickly the current changes. So when you touch the wand to the maze, there is a step change in voltage across the primary winding which falls off as the current rises, and this appears stepped up (assuming a step up transformer) across the secondary winding. The same effect will occur but with polarity reversed when the wand is pulled away from the maze and the current flow is stopped abruptly.
H: How much longer should we expect DIP (or DIL) Packaging to be around? More or less in response to this question: Reliability of anti-static packaging A few comments were made (which made sense) on manufacturers not really shipping many DIP packages in comparison with SMD devices. So my question is, should we expect this type of package to end eventually at some point, and is it just a matter of "whats left" in production. It makes sense for a manufacturer of chips not to really care about hobbyists which only make up a small portion of their sales. But do you think the package itself will be phased out completely? (especially with Popular Boards like Arduino becoming even more popular?) AI: I think they will probably be around for quite a few years yet. It's true the use of DIP packages (and through hole in general) as declined sharply in the last decade or so, but they are still widely produced even for new chips. They are still used a lot for prototyping and hobbyist use - I'm sure many find it useful to be able to quickly prototype a design using the DIP package version of their chip, then switch to the e.g. TQFP package for the final version. For example Microchip produce a DIP version of pretty much all their ICs bar top end stuff like the PIC32. As long there is some reasonable demand out there I'm sure they will continue to do so.
H: Prototyping with SMD components? In response to the answers here: How much longer should we expect DIP (or DIL) Packaging to be around? If DIPs are phasing out, how would one proto their boards quickly and cheaply? Does this mean we have to all start learning to build surface mount boards? Is there something I'm missing because that sounds like a lot of work for simple proof of concepts... AI: Several vendors offer tiny PCBs that adapt SMT devices to match DIP footprints. Typically, the SMT part and a set of pins must be soldered to the PCB. A representative vendor can be found here.
H: Boost Converter for TTL circuits to drive large loads I've got a small PIC-based TTL circuit device, powered by a 4.5V coin cell, that needs to drive a solenoid which requires 12V. Obviously my logic level device can't directly power that so I could either replace the cell with something stronger, or use a boost converter. Is there another option I'm missing? This seems like it would be a very common problem so I don't want to reinvent the wheel here. What's the most common way to power higher voltage devices like motors, solenoids, etc from logic level circuits? Thanks in advance. AI: There are many boost converter ICs available (as you probably know). One which is low cost available and effective is the ancient but still worthwhile MC34063. If it's a one off and you want maximum performance and don't mind paying a few dollars for the IC there a better ICs than this. But for even modest volume this IC does well in many cases and is about as low cost as any and is very flexible and easy to use. Disadvantages include Not vastly efficient at low Vin - but that's not a problem here as you'd run it only when needed and for brief periods. 100 kHz (or slightly mote) operation. That's not terrible but means the inductors are somewhat larger than with 500 kHz or 1 MHz or higher devices. Not totally tiny. DIP-8 or SO8 packages. Only a problem if you want super miniature. SO8 is usually acceptable. Advantages: Extremely flexible topology. Has a driver with both ends available that can support buck, boost, buck-boost, SEPIC CUK and more. Low parts count For the circuit you want it needs 1 inductor, 1 diode, 1 capacitor, 3 resistors (2 to set voltage) + a Vin and Vout filter capacitor. You can hardly get less parts (some include diode or use sunchronous switching). Low cost. About 50 cents US in 1's. About 20 cents in volume. I get them for about 10 cents in Asia. Here is a datasheet for the ST version - most major IC makers make them still. See fig 13 for a stepup circuit. The 0.22 ohm resistor is an optional current limit sense resistor. More after tea ... :-). POWER & ENERGY REQUIREMENTS: A question has been raised re required power and energy levels. I assumed that as you are using such a small battery you would be wanting to pulse the solenoid and not to hold it in. As we don't know the application this assumption is just an assumption. A look at Digikey's site shows the samllest solenoids they sell have continuous operating powers in the 2 to 3 Watt range. You will be able to buy smaller and a custome one could be ,ade that was MUCH small power (and performance) wise. If you assumed you wanted to pulse the solenoid to open a latch or release a rope or spring or ping a bell, then say a 0.1 second excitation pulse may be good enough. Assumptions can be adjusted. Say 3 Watts x 0.1 second = 0.3 Watt second or 300 mWs. Allow say 60% overal conversion efficiency so say we need about 500 mWs. As the battery cannot supply that instantly a capacitor must be used to store the energy. For charging purposes that's 500 mW for 1 second or 250 mW for 2 seconds or 50 mW for 10 seconds etc. Battery type is unknown. 4.5V sounds like it MIGHT be 3 x Alkaline. so 3.xv would be close to true. Regardless, such small batteries unless speciallu made have low max mA out. 1 mA may be typical for some. 10 mA would probably be mx in most cases. Assume 10 mA, 4V available = 40 mW operating power mex. To get 500 mWs of energy we need to charge it for 500/40 ~= 12.5 seconds. Say 15 to 20 seconds to be safe. Could work out far less. A CR2032 cell (3V Vout) typically has 220 mAh capacity. Multiply that by 4V in this example = 880 mWh capacity. Taking the 500 mWh we need from it for the solenoid takes 500 / (880 mWh x 3600 seconds /hr) = < 0.02% of battery capacity. Notionally you could get 6000 + solenoid pulses from that batter. In practice Murphy says "less!" Increase the solenoid on time to one second (you'll need a suitable reservoir capacitor) and operating energy does NOT increase by a factor of 10, because hold-in current can be much less than operating current. A factor of 5 to 10 is not unknown. That needs extra electronics to get a high current pull in pulse and a lower holding current, but it is not hard to design. Battery: A proper description of the bttery is required. Link to data sheet would be best. 4.5V coin cell is unusual. Does it have to be that small? A single AA battery has both vastly more energy content AND much higher acceptable energy transfer rate. On Watt continuous is acceptable and you can hold a small solenoid in indefinitely at that level if you need to. If an AA battery is too big its nasty little AAA cousin may do. These are worse in all respects, less efficient on space (but smaller) and cost about the same. Or a flat Lithim Ion or Lithium Polymer battery can be had in very small capacities and may do the job far better. Solenoid: What is the task. Is there a datasheet? IS there any sort iof spec for pull in curremt, hold in current, hold ij time, stoke or force or ...?
H: A quick way to remember NAND & NOR logic? I'm frequently asked in class to create a logic circuit based on some specifications. Building the circuit and deriving the equations is the easy part. We are usually told to implement our circuit using only NAND or only NOR gates (akin to a real-life scenario). I find myself consulting pages like this once I have my equations an am about to draw the circuit. If memorizing these combinations are the only way to make a NAND or NOR exclusive circuit, then I will. But there ought to be a better way of converting everything quickly and neatly. Anyone? AI: If you have an existing schematic consisting of Inverters, AND, and OR Gates, then there is a simple, three step process that you can follow to convert the circuit to all NAND (you can modify the process slightly for NOR). You can use "Bubble Logic". Let's assume you have three levels of logic. The first level, closest to your inputs, consists of inverters. The second level consists of AND gates. And the final level consists of just a single OR gate. Some textbooks may refer to this as being a "sum of products" Boolean Algebra expression. Convert all of your AND Gates to NAND Gates. Wherever you added a bubble, you've actually inverted the Boolean Algebra function on that wire. So, add another bubble to that wire and draw the bubble close to the OR gate on the output. A NAND gate is equivalent to an OR Gate whose inputs are inverted. So, if you're OR gate at the output has all of its inputs inverted, simply redraw it as a NAND gate. If it does not, then make it so by adding a bubble near the input to the OR and another bubble (inverter) somewhere else on that particular wire. You could do a similar process for an all NOR implementation. I hope that helps!
H: Building a "ground plane" for a CB radio I'm new to CB radio's and finally setup a home one. The kit I bought was cheap and was made for a car. I got all the wiring done correctly and able to get some fuzz back when I turn the unit on and scroll through the channels. I'm just realizing now that I need a "ground plane" I large metallic surface to give and receive signals. Normally this would be your car. I have the antenna on my fire escape now, do you know a DIY object I can build / place under it to act as a good ground plane? Thanks in advance. The antenna in question is here: http://www.amazon.com/Cobra-Base-Load-Medium-Magnet-Antenna/dp/B00005N5X2/ref=cm_cr_pr_product_top AI: Not all antennas require a ground plane. A basic antenna like a dipole is self-contained and requires no ground plane. The concept of a ground plane is roughly to build a antenna half as long as a normal self-contained one, then add a mirror so that it looks like a complete antenna from the antenna side of the mirror. We call this mirror a ground plane. such antennas are more compact, but don't work right without the ground plane (mirror to make it look like a real full size antenna). So your first order of business is to find out what kind of antenna you have. If it was meant to be mounted on the top of a metal car, then it very likely requires a ground plane. A good ground plane extends about a wavelength underneath the antenna, although less can be used as long as this is taken into account when the antenna is designed, else the impedance won't be as expected. CB frequencies are in the 27 MHz range, which means the wavelength is 11 meters. No car has a roof 22 meters accross, so a car top antenna will have been designed with a small ground plane in mind. A metal sheet about the size of a car roof, or a bit bigger if you can manage it, should do fine. If you have or end up getting a self contained antenna, then it is best to keep it away from anything conductive. It is meant to work on its own, so conductors in the near field will mess up its resonance and change its impedance. Again a whole wavelength clearance would be great, but in reality you can live with less. If you really want to get into this, get a SWR (standing wave ratio) meter and experiment. Some transmitters may have SWR meters built in already. If you want to get into this some more, you can measure what the antenna impedance is, know what load the transmitter wants to see, and put matching components in between so each side sees a nicely matched load. There is something called a "Smith chart" that helps with all this, but that's serious decent into the black magic of RF.
H: Creating an IR sensor Is a PIR sensor as easy as just a receiver? Rather than use some pre-canned device I was planning to just hook up an IR LED to my microcontroller and then read the IR sensor/receiver for a threshold voltage level. My concern is that is a naive assumption as everyone would just do that instead of buying these pre-made sensor packages. AI: What you propose will work as long as you can keep all other light out of the sensor. If the sensor is inside some equipment where it will always be dark except your transmitted IR, then you may get away with it. Even then, varying temperature will add a varying DC offset to your received signal. AC coupling the signal from the sensor and using a protocol that doesn't depend on the DC level is a good idea. In most cases though, the ambient light level is unknown but can easily vary be several orders of magnitude during normal operation. It can also be stronger than the transmitted signal. The way this is usually dealt with is to make sure the transmitted signal is modulated on a carrier. The ambient level is close to a DC offset and can then be filtered out. The common three-terminal IR receivers do several useful things all in one cheap integrated package. They filter out frequencies outside the IR LED range (usually around 910 nm) that the sensor still responds to, do the amplification, DC rejection, carrier detection, and demodulation. You supply 5V and ground, and the third pin indicates when it see the presence of IR modulated at the specific frequency for that device. These devices are available at a range of frequencies in the 30-50 kHz range. It may take up to 10 carrier cycles for this integrated receiver to indicate the presence of the carrier. Common consumer devices, like TV remotes, use a protocol above this such that everything is encoded as bursts of carrier of varying lengths and varying gaps between bursts. The information is carried in the length and sequence of the bursts and spaces. There are various things that can go wrong with this process, so it's a good idea to send data in packets with a checksum in each packet. If the direction is one way, then send everything mutliple times because no one packet is guaranteed to be received. Now that you say these are PIR sensors: PIR sensors are quite different from IR photosensors. Basically, they are at opposite ends of the infrared spectrum. IR photosensors are sensitive to just below visible light. 910 nm is a common center wavelength, for example. PIR sensors are meant to detect the black body radiation from something like a human walking around the environment. They work on a different principle than a photodiode or phototransistor, and are meant to pick up much longer wavelengths. You have to decide what you are trying to do. If you want to detect people moving around in a room, then a PIR sensor is appropriate with the right lens or occlusion. If you want to do digital communication, then a PIR sensor is essentially useless and you want a IR photodiode or phototransistor. This is what I thought you wanted (since you originally mentioned a emitter) when I wrote the original section of my answer above.
H: Converting an analog signal of varying maximum and minimum values to a series of pulses I have a situation where I need to convert an analog waveform into a series of pulses. The generated signal will be coming from an IR LED/photo-transistor pair that will output a signal whose maximum and minimum value will depend on the person whose finger between the IR LED/photo-transistor pair because of varying values in systolic and diastolic values of blood pressure among humans. I can't use a Schmitt trigger because I can't define a specific value to be the threshold limit above which the output is a logic level HIGH, and I can't use a peak detector because it would simply hold the highest value of the waveform which was sensed. Can someone please make a recommendation that would help me resolve this issue? Any help would be much appreciated. AI: Presumably pulse count is the aim and exact pulse separations in a given cycle are not too important. General method is to create a reference based on the short to medium term values and compare the instantaneous value with that. Many possible methods. eg Average value produced by a simple RC integrator will produce a DC level equal to the DC mean value. RC time constant should be at least a few pulse cycles. Feed that and instant signal to a comparator. Using a 2 or 4 pole Bessel low pass filter here can make a nicely smoother but responsive mean value. Much better than single RC passive smoothing as need not be so heavily "slugged" but variation much better removed. Each pile pair can be an emitter follower and x R, 2 x C. Cheap and easy. Unity gain amp in LH low pass filter cct can be an emitter follower. Circuit below from here very useful looking filter page. R1 input comp_- C1 comp_- ground input to comp+ output = pulses (maybe :-)) Produce a say +ve peak detector with a value a diode drop or so below V+ and smoothed as above. ADC - track rate of change signal. Not when slope goes +/- and -/+ for more than X samples etc. As above but analog. Input to resistor to capacitor to ground. Capacitor will track Vin with delay. Place comparator +/- inputs across R so when Vin is charging cap in will be > Vcap and when Vin is discharging cap Vin will be discharging cap so polarity across resistor will swap. Noise an issue. Short term variations against trend need smoothing. Analog PLL track. CD4066 digital PLL track.
H: Getting PWM with an astable multivibrator (square wave generator) I would like to use this schematic: to create a square-wave generator but I would like to modify it by getting an output that runs from 0 to +5V, as well as changing the signal so that I can change the duty cycle of the pulse(PWM). Should I replace the resistor R2 with a variable resistor so that I can get the PWM signal? If not, what would be the correct approach? AI: One way to vary the duty cycle would be to remove R1 and connect a potentiometer track between V- and V+ with the wiper connected to R2/non-inverting input of the comparator. With the pot at mid position you will get 50% duty cycle but this will only be very roughly linear for small changes in position of the pot. Also, the frequency will reduce as you move the pot either side of mid-position. Note that if you want single supply (5V) operation with the original circuit as shown, R1 would have to be returned to 2.5V rather than 0V.
H: Using Parallel port to Power circuits How to use PC parallel port as a power supply for any device (similar to charging Mobile Phones). Actually I have to powrer my circuit based on parallel port. Which pin of parallel port can supply at least 5 volts without cause any change(sending signals) to the pc. AI: The PC parallel port is not designed to power external equipment. While it xcan be used for his the power levels obtainable are low. Better, if available, is USB. Even a serial port MAY have greater power capability. Parallel port pinouts are given here and here and here and here I provide several pages as, when you are trying to do something non standard, seeing what various people say can help. Below is a typical pinout table. Any one of the output pins may supply some current. If you take all outputs, connect a 1N4148 diode from each facing "outwards" (Anode to port, cathode to output) , connect all Cathodes and add a capacitor o ground (say 10 uF) you will get some voltage. How much and at what level is to be determined. This page reports that Linksys, who should know better [tm] have drawn power from some pins for some of their equipmenty. eg "Another area that might be of interest in your document would be some comment on the parallel port extenders. I have a xmit/rcv pair from LinkSys that I bought from Fry's Electronics for about $70. They convert the parallel signal to a serial data stream, using the signal and control lines for power. My set was working fine until I added a hardware dongle for an expensive Windows application. Then, printing ceased to work reliably. I took the transmitter apart and partially traced the schematic. They have used 7 diodes to suck power from pins 13, 14, 15, 17, 1, 2, and 3. Also, they connected pins 15 (ERR) to 16 (INIT). The strobe line is coupled in to a flip-flop, which starts clocking the parallel loaded data."
H: Meaning of balanced transmission line? Simple question, what does it mean to have a transmission line (RS-485 in my case) balanced vs unbalanced? AI: The two signal lines are mirrored around a central reference point - often but no necessarily ground. When one is 'up" relative to the reference point the other is ":down" by an equal amount. The mean level is always zero relative to reference. In a digital system the driver applies +v/-V for eg logical 1 and -V/+V for logical 0. This is compared to an unbalanced system where one line may be considered the reference (often ground) line and the other swings relative to it. eg in the RS232 system logical 1 = -12V nominal and logical 0 = +12V nominal. When a 1 is sent the legs ae at -12/0 and when a 0 is sent the legs are at +12/0. A balanced system is inherently more immune to noise. If fed via a twisted pair, noise induced into the pair is of the same amplitude in both legs and the differential signals still have the same amplitude +/- or -/+ relative to it. So noise levels can be greater in magnitude than the signal and the system will still work. Voice telephony in standard telephone systems use analog balanced signals. Max transmit level is usually about -10 dBm where 0 dBm = 600 mV in 600 ohms = 1 mW. Customer end of line signals may be 10-20 dB below that and still work 'after a fashion". Despite this low level of signal you can have many volts of induced (usually 50 Hz or 60 Hz mains) noise on a cable pair and not hear any "hum. Imbalance the line just slightly and ALL you will hear is hum.
H: Using Zener diode for circuit protection on RS-485 network I'm examining an RS-485 driver circuit that uses what look like Zener diodes between D+ and gnd and D- and gnd. Anode is connected to gnd, cathode to the D+ or D-. So in this arrangement the idea is for the diodes to shunt current if gnd goes above D+ or D-? Circuit is at http://resplendid.com/rs485connector_withdiodes.png. How effective in general are Zeners at this type of overvoltage protection? On an RS-485 transmission line I would think some pretty large voltage spikes could be induced, wouldn't the diodes blow up pretty easily with a large spike? When blown, to they fail open or closed circuit? Maybe putting some MOVs on the bus would be a better idea? In general what's a good protection scheme for an RS-485 network that's going to be used outside? Thanks, Fred AI: I wouldn't trust a standard zener to protect a line running outside. Can you show the circuit? Are you sure it doesn't mean a TVS diode anyway? You could use a single (say 6-10V) TVS on the lines as you mention. A more expensive but more robust solution would be to use a three stage protector like this (or make your own) It combines a gas discharge tube with a series impedance and a TVS. You get the benefits of the gas discharge (high current capability, high breakdown voltage, slow) with the TVS (fast, low clamping voltage)
H: 10 bit PISO shift register I have a device that has a 10bit parallel output that I need to get to a serial input. Can I use a 16 bit PISO shift register and somehow ignore the 6 LSB? How might that work? AI: You should not have a problem using a 16 bit shift register (or two chained 8 bit shift registers similar to the 74HC589A). There are two ways that you could consider to ignore the unused 6 bits: 1) shift all 16 bits and mask the unused bits in software, or 2) only shift 10 bits across the serial connection. If you are reading the data using the built-in SPI peripieral on some microcontrollers, you may have to shift in a multiple of 8 bits per word, which would force you into scenario 1. Otherwise, it may be simpler to implement scenario 2. Most shift registers don't care if you don't shift all the bits... they will happily accept new data on the parallel load clock regardless of how many bits have been shifted. If you only plan to shift 10 bits, make sure to use the bits that will be shifted out of the register first. In either case, you should tie the unused input pins to your supply rail or ground through a resistor, as floating inputs can cause problems on some ICs.
H: Frequency Reuse Patterns In Multiple Access Protocol for cellular networks, there is this Frequency Reuse Patterns. And I am given a formula to one of the patterns that states: \$\text{Reuse factor }\mathbf{K} = i^2+j^2+ij\$ I know that the reuse factor \$K\$ meant the number of cells that are reusing the frequencies. But what do the \$i\$ and \$j\$ represent? And how can I use this formula? AI: "K" in your formula is the number of cell sites that can form a valid "cluster: which meets certain rules - more on that below. i and j are simply terms that make a formula that returns values of K that are valid in practice. They may have "real" meaning but there is no need to know it. You can deal with the "abstraction" one level above that. Here is pages 11-12 from here that shows how cells may be packed in a multi cell frequency resue system. Here is how cells might be packed in a system with frequency reuse. Not that a hexagon is NOT the only shape that allows syymmetric repacking - it just works better than most in building shapes that fit together well. Real meaning: Here is the actual answer to your question BUT to make use of it you are probably going to have to pore over the better drawings in the references below. Cell frequencies in a cellular system are reused in other cells a certain distance away. On an open level surface true cell radiation amplitude patterns are circular but when packing sites together diagrammatically the assumption is made that the cell sites are hexagonal see diagrams. To pack in an infinitely even manner cells are packed in clusters of cells with a certain number of cells in the cluster. These clusters then pack into a larger overall system. When hexagons are packed and there are symmetrically distributed sites around the current one which use the same frequency, they can be reached by travelling along two straight lines through the centres of hexagons. The geometry of hexagons is such that only certain combinations of hexagons can be packed together to achieve symmetric reuse patters (see diagrams). i & j are simply the lengths in number of heaxagons traversed to reach the nearest cells using the same frequency. The formula relating the length of these two "arms" and the number of cells in a "cluster" thus formed is not immediately intuitive but is obvious enough from working through the formulae in the diagram below. Empirical approach: If desired you can ignore the above reason and treat it as a set of empirical rules. K is the number of cells in a "cluster" that meets certain packing rules. eg Playing with coloured hexagonal blocks will demonstrate this. Values of K which match what can be achieved in reality are given by your formula i and j are +ve integers starting at 0 (although 1,0 or 0,1 is the smallest sensible combination. As can be seen, i and j are interchangeable in the formula so 1,2 is the same as 2,1 Using that formula the number of cells in a valid cluster are K = i^2 + j^2 + i x j i j K 0 1 1 ........ = 1^1 + 0 x 1 + 0^2 1 1 3 0 2 4 1 2 7 ......... = 1^2 + 2 x 1 + 2^2 = 1 + 2 + 4 = 7 0 3 9 2 2 12 ... Making it clearer: Starting with "i & j are the arm lengths between two cells of the same frequency in a system of reusable frequency hexagons" there are many references on the web which deal with this, many of which can be found by eg gargoyling - Reuse factor K=i2+j2+ij But some are overly simplistic and some are horrendously complex. One which may be 'just right' is found here as a slide show. Not enough words but enough to get a feel. Pages 8-12 lead up to this, 11 & 12 directly address the question and 14-15 discuss a reuse proof which has pictures but which would benefit from more words. This paper - also a slideshow again has good pictures but too few words but the real world meaning of i + j can be seen in the diagrams (about 8 pages starting at about page 12 - pages not numbered) http://wmnlab.ee.ntu.edu.tw/951cross/Lec7_Cellular_Network.pdf
H: Why ship a low power charger with an overkill thick cable? Today I saw a Sony camera charger that claimed to provide 8.4V/1.7A output but had a cable going to the device being powered with 18AWG (0.824mm2) cross-section and insulation rated at 300V (yeap, three hundred volts). It was composed of two single-wire components each insulated separately and being about 3 millimeters thick (measured over the insulation). Components were aligned in parallel and welded together which resulted in about 3 by 6 millimeters cross-section. AFAIK such beefy cable could be used to power a several hundred watts desk lamp anywhere in the world (even in Europe where mains is 230V) and having such bulky (and not very cheap) cable looks quite unreasonable unless it is necessary. Why would a tiny low-power charger be shipped with such beefy cable? AI: Because they had such cables in stock at the moment? Maybe they were able to buy them cheaply. Some manufacturer may have overproduced them and was looking to get rid of the stock or they were designed for another product that turned out to be a failure. They may have same power supply case for several products and just change the electronics inside. Some of them may require more power than others. Also note that 300 V insulation isn't that much. It could be more expensive to look for cable with lower insulation ratings. For example ALL professionally made serial port cables I have have 300 V insulation and we all know that 300 V isn't anywhere near the voltages used in RS-232 ports. Another point could be the bulkiness of the cable itself. While the cable may be overkill for electricity transmission, consider usual environment in which the cable would be used. You can't assume that the user of the cable will be able to handle the thin cable well and that the environment may will be friendly to thin cables. Remember there are pets that may want to eat the cables, someone may trip over the cable, the cable may be bent many times during it's lifetime and so on. In such cases it may be better to provide a good quality cable and just using one which is thicker may be the cheapest solution. Another point is the appearance of the product itself. You didn't mention the exact camera model, so I can't dig up any information about it, but sometimes the sufficient cable may look and feel cheap or weak and that may leave bad overall impression of the product. It's certainly cheaper to just put in a good quality cable in order to impress the customers a bit more. So to sum this up: I don't see a valid reason to use this cable from the point of view of physics, but keep in mind that engineering is applied physics and that makes the business side of the problem important to engineers.
H: What's the purpose of two capacitors in parallel? What's the purpose of the two capacitors in parallel on each side of the regulator in this power supply circuit I've seen similar setups in other similar circuits and can guess that it's related to one being polarized an one not, but I don't really understand what's going on there. AI: Summary: Big capacitors handles low frequency ripple and mains noise and major output load changes. Small capacitors handle noise and fast transients. That circuit uses "overkill" with that application but serves as an OK example. Here is a typical LM7805 datasheet It can be seen on page 22 that having two capacitors at Vin abd two at Vout is not necessarily a standard arrangement, and that the capacitor values in the supplied circuit are relatively large. Below is fig22 from the datasheet. Your circuit: A large capacitor like the 2200 uF act as a "reservoir" to store energy from the rough DC out of the bridge rectifier. The larger the capacitor the less ripple and the more constant the DC. When large current peaks are drawn the capacitor supplied surge energy helps the regulator not sag in output. The white and black bars on the capacitor symbol show that it is a "polar " capacitor - it only works with + and - on the selected ends. Such capacitors are usually "electrolytic capacitors". These have good ability to filter out low frequency ripple and to respond to reasonably fast load changes. By itself it is not enough to do the whole job as it is not good at filtering higher frequency noise because electrolytics tend to have large internal inductance + large (relatively) internal series resistance (ESR). The small input capacitor (here shown as u1 = 0.1 uF) will be non polarized and will usually nowadays be a multilayer ceramic capacitor with low ESR and low inductance giving it excellent high frequency response and noise filtering capabilities. By itself it is not enough to do the whole job as it cannot store enough energy to deal with the energy needed to filter out ripple changes and large load transients. The same applies in general terms to the output capacitors. C4 = 10 uF helps to supply any gross load changes thus taking some load off the regulator. It is not usually deemed necessary to have more than a very small capacitor here. Some modern regulators need a largish capacitor here for stability reasons but the LM78xx does not. Here the second output capacitor is 0.1 uF and it is there to deal with high frequency noise. Note that having a large capacitor on the output can cause problems. If the input was shorted so that power was removed C4 would discharge back through the regulator. Depending on voltage and capacitor size this can cause damage. One method of dealing with this is to provide a usually reverse-biased diode from regulator output to regulator input. If the regulator input is shorted to ground the output capacitor will discharge through the now forward biased diode. Added: Nils noted: A very large reservoir capacitor may lead to increased noise. The on-time of the diodes would get shorter yet the same amount of power is transferred. This causes current spikes in the transformer which start to radiate out a noisy magnetic field. Bigger is not always better here. It's unlikely to cause problems in circuits that uses the 78xx series regulators though, they just don't move enough power usually. Good point. Adding a small series resistor between transformer and 1st capacitor serves to "spread" the conduction angle, reduce current peak, reduce noise and make life easier for the diodes. Working out the diode current can be somewhat mind-taxing I seem to recall (having done it as an exercise long ago). Nowadays a simulation is easy enough to make calculation unusual.
H: What is the IEC standard number for this plug? I need the specific IEC standard number for a power plug/socket used in a laptop. See the photo below. I need to know the laptop-side plug (the lower plug in the photo). Thanks. This plug is used in Lenovo laptop power supplies, and others. AI: The lower connector looks like an IEC 60320 C5 to me.
H: What should I know about interference between wires in a multi-conductor cable? I want to use a multi-conductor cable for a few different circuits. What do I need to know about interference between circuits within a multi-conductor cable? Some of the wires will carry stepper motor coil supply and return. I suspect this will emit a lot of EMF due to large, rapidly changing currents, and should probably be shielded. Other wires will carry optical switch supply, return, and output. This circuit is probably tolerant to noise and doesn't make much of it either. Others wires could carry high-speed digital data. These circuits are probably susceptible to noise and might make some as well. Can I run these all in the same cable? What else might I need to consider? EDIT: Let's assume I'm talking about using a cable that has a single shield around all of the wires, instead of individually shielded bundles of a few wires. AI: There are two issues with crosstalk between conductors of a cable: capacitive coupling and inductive coupling. Inductive coupling happens because current flowing thru a wire creates a circular magnetic field around that wire. This also works in reverse. If a wire is subjected to a changing circular magnetic field around it, a voltage will be induced. Therefore, if one wire is carrying a changing current and another wire is close enough so that part of the resulting circular magnetic field also surrounds this second wire, then a voltage is induced in the second wire. The most effective way to combat this problem is to make sure a equal and opposite return current flows such that the magnetic fields from the two currents cancel out. The best way to ensure this is coaxial cable. Outside the cable, the two equal and opposite currents cancel and there is no net magnetic field. Inside a multi-wire cable like you describe, this is usually done with twisted pair. At any one point, the two conductors are next to each other. Far enough away the two currents cancel, but up close they don't. Another wire running closer to one wire of the pair will preferentially pick up signal from that wire. This is why the wires are twisted together. A straight wire next to a twisted pair will alternately be nearer one conductor then the other of the twisted pair. Each induces the opposite voltage since the direction of current is opposite in the two wires of the twisted pair. However, these average out to zero over any whole number of twists. In a long enough cable they usually average out well enough. There is another problem with twisted pair though. Suppose you have multiple twisted pair in the same cable, which is probably the case in the cable you describe. If the twists of one pair are in sync with the twists of another pair, then the induced voltage no longer cancels out in the long run. This is why cables with multiple twisted pair usually have a different twist pitch for each pair. Let's say one pair has 11 twists/foot and another 13 twists/foot. Over any one foot the induced coupled voltage cancells out again. Take a look at the CAT5 cable spec and you will see the different twist pitches for each of the four pairs are carefully specified. Capacitive coupling is because there is some finite capacitance between every two conductors in the universe. For things far enough apart this can usually be ignored. However, different conductors in a multi-conductor cable are up against each other for a long distance such that capacitive coupling can't be ignored. The best defense against capacitive coupling is a shield, but those are expensive and you say your cable doesn't have any internal shields. Twisted pair again helps here. There will still be capacitive coupling between pairs, but with the right twisting strategy as described above there won't be much preferential coupling to one conductor of the pair. In other words, twisting will cause all the coupling to be common mode with the differential mode mostly cancelling out. So to finally get to some kind of answer, make sure each signal is carried by a separate twisted pair with the forward and return current of that signal all being carried by that pair. Then treat any signal as differential. Realize there will be common mode noise added to each pair and deal with it accordingly. The external world will also have noise, and due to twisting, this noise will show up as common mode on each pair. 10 base-T and later ethernet, for example, is transformer coupled at each end partly for this reason and also to avoid ground loops. All that said, I think running stepper motor coil currents thru the same cable as signals is just nuts. This is going to cause trouble. I would seriously look into sending control signals and power for the steppers, but put the stepper drivers close to the stepper motors. That also allows for a local power reservoir cap to make the supply low impedance again after the long cable run. Having the resistance and inductance of the cable between the stepper driver and the stepper motor is asking for more trouble.
H: One USB device with multiple device types? I am just wondering if this is possible with USB. I am used to programming a device with USB to be a specific device type, say, a HID, or a CDC etc. Is it possible to combine multiple device types into one USB device, so a single chip (say a PIC32) could be seen as both a HID and a CDC device at the same time, providing the functionality of both? Ideally with the two device functionalities tied to different parts of the firmware. Is this even possible with USB, or would I need to have a small 2-port hub chip and 2 USB devices connected to that? Or could I emulate it by having the chip seen as a hub, then connect "virtual" devices into it in software? Has anyone tried anything like this before? AI: Yes, you can do this with a PIC18 (full speed USB 2.0) or another PIC with USB 2.0 capability. Microchip has a couple of examples of composite devices bundled with their stack. I would maybe have a look at one of these and adapt as necessary.
H: Reset: synchronous vs asynchronous I've been working with fpgas for years, and always used synchronous resets for every parts (that need it) of my circuits. It helps the circuit to be globally reset at a given clock cycle. However, I was told that in ASIC circuits, people tend to use asynchronous reset everywhere. I'm wondering why, and if it is the case in some fpga designs too. I would love to hear professional opinions. Thanks AI: There seem to be a lot of views on this one. Asynchronous assertion, synchronous deassertion is said to be good practice. This avoids the issue of the clock not running (or running too slowly to capture the reset signal) on synchronous assertion, and possible metastability on asynchronous deassertion. You would use a reset synchroniser (two FFs) with the output tied to the rest of the designs resets: Couple of discussions: Async and sync reset Letters On Sync vs. Async Resets
H: How to perform small value approximation for sqrt(x) on FPGA I am trying to implement a fixed point routine which involves computing the value of \$ \sqrt{x} \$ for small \$x\$ that approaches \$0\$. The target architecture is an FPGA. One problem is that this function does not lend itself easily towards the use of Taylor's expansion. One can see that for small values of x, the slope of \$\sqrt{x}\$ goes to infinity when \$x\$ approaches \$0\$, therefore evaluating the function using a power series involves multiplying huge coefficients with a small \$x\$. This method is therefore numerically unstable. Using an iterative approach, the Newton-Raphson yields the following iterative equation: \$x_{n+1} = \frac {x_{n}}{2}- \frac{\alpha} {2x_{n}}\$, where we are trying to approximate \$\sqrt {\alpha}\$. But once again, since \$\alpha\$ is small, \$x_{n}\$ would likewise have to be small for the solution to converge. Since the equation involves dividing a small number by another small number, chances are that fixed point arithmetic would fail. With that, I would like to know how to implement small value approximation for \$\sqrt{x}\$ using fixed point arithmetic, either using precomputated coefficients or iterative methods. AI: A routine which I have used before (I don't know if it's a "proper" one or not) is a divide-and-conquer approach. You start off with an arbitrary upper and lower value (say 5 and 0 respectively - the highest and lowest square roots you want to find) and find the mid-point between them. Square that value. If the squared value is greater than your target, set the upper value to be your squared value. If it's lower, set the lower value. Repeat until either the square value matches your lookup value, or you have executed enough iterations to be as accurate as you like. Here's a little version I have knocked together in perl: #!/usr/bin/perl my $val = shift; my $max = 5; my $min = 0; my $iterations = 0; my $maxiter = 40; while(($max > $min) and ($iterations<$maxiter)) { $iterations++; my $diff = $min + ($max - $min) / 2; my $square = $diff * $diff; if($square == $val) { print "Square root found at $diff\n"; print "$iterations iterations\n"; exit(0); } else { if($square > $val) { $max = $diff; } else { $min = $diff; } } } my $diff = $min + ($max - $min) / 2; print "Approximate square root after $iterations iterations: $diff\n"; This of course is using floating point, but could easilly be addapted to fixed point. You can vary the accuracy by changing the iteration limit. Each iteration gets slightly more accurate than the one before. eg: - find the square root of 9: Approximate square root after 40 iterations: 2.99999999999955 - or - Approximate square root after 10 iterations: 3.00048828125 - or - Approximate square root after 5 iterations: 3.046875 If it had found the value 3 it would have stopped early of course. Give it enough iterations and it should get it very accurate: ./sqrt.pl 0.00284 Square root found at 0.0532916503778969 59 iterations
H: RS232 vs USB CDC quality of service / should messages contain a checksum? Does USB have a quality of service guarantee for data sent between my USB-CDC device and the USB host? I know with traditional RS232 in a noisy situation (e.g. automotive diagnostic port) bad bits happen often enough that checksums are important to the protocol. If I were to adapt such a protocol to a pure-USB application, can I safely omit the checksum and related error handling routines? For reference, I am using an AT91SAM7S256 with the USB-CDC framework provided by Atmel. Update: I exercised my Google-Fu a bit longer on this problem and found this article which describes a CDC subclass for Ethernet emulation and states: Over the USB cable, encapsulated Ethernet frames flow starting with the destination MAC address and ending just before the frame checksum. (The frame checksum is not needed since USB is a reliable transport.) They may mean USB-CDC is reliable transport, not USB in general, since some device classes intended for high-throughput bursty data (webcam?) might not want to fill up buffers if a program can't poll for data fast enough. I would still like additional confirmation on this. AI: This depends on what endpoint types your device is using. A quick summary taken from USB in a nutshell: Interrupt Transfers Guaranteed Latency Stream Pipe - Unidirectional Error detection and next period retry. Isochronous Transfers Isochronous Transfers provide Guaranteed access to USB bandwidth. Bounded latency. Stream Pipe - Unidirectional Error detection via CRC, but no retry or guarantee of delivery. Full & high speed modes only. No data toggling. Bulk Transfers Used to transfer large bursty data. Error detection via CRC, with guarantee of delivery. No guarantee of bandwidth or minimum latency. Stream Pipe - Unidirectional Full & high speed modes only. To properly answer your question, you will need to find out what transfer modes are being used underneath to implement the CDC device. The CDC device class specification may be a starting point. If you have source code for the device then that would be even better. I am not familiar with the CDC class so I can't comment on its implementation standards, but at first glance at some documents and google, it appears that there is some flexibility in implementation. EDIT After reading the Atmel document that you linked, it appears that it is up to you! The Abstract Control Model requires two interfaces, one Communication Class Interface and one Data Class Interface. Each of them must have two associated endpoints. The former shall have one endpoint dedicated to device management (default Control endpoint 0) and one for events notification (additional Interrupt IN endpoint). The Data Class Interface needs two endpoints through which to carry data to and from the host. Depending on the application, these endpoints can either be Bulk or Isochronous. In the case of a USB to serial converter, using Bulk endpoints is probably more appropriate, since the reliability of the transmission is important and the data transfers are not time-critical. So in your implementation, be sure to use bulk transfers on your Data Class interface to ensure reliable transport.
H: Huge led matrix - using mm5451 Hi I'm using the MM5451 led driver chip to source current for my led matrix. Am told that the chip has open drain outputs. To source current from the chip do I just connect the anode of my led to the output then connect the cathode to my circuit gnd? Also am unsure how it limits the current going to each led? The datasheet says 40ma is the absolute max for each output. http://www.micrel.com/_PDF/mm5450.pdf AI: The clue here is the "open drain". Basically each output is a switch which is connected to ground. This switch goes between the cathode of your LED and ground, and you feed your power supply into the anode of each LED. If you look on page 8 of the data sheet you see an example with lots of 7 segment LED displays. You can see the "Vled" is connected to all the displays through a pair of transistors - these are just used to switch between left and right halves of the display to get twice as many digits - and there is no ground connection from the displays. This is because each cathode goes into the chip and then to ground. The chip itself doesn't source any current, it just sinks it. As for the current limiting, yes, it is very vague. Looking at the data table you can see that when a segment is off then the output voltage is at 3V. This is the same voltage you should be providing to the anode of your LEDs. When the segment is turned on the output voltage "drops" to 1.8V. This means that when the output is "on" it has a voltage drop of 1.8V to ground. With a 3V supply to your LED anode this would equate to 3V - 1.8V = 1.2V for running the LED. This is the same as having a resistor that drops 1.8v at the current your LED draws.
H: why electric motor or alternator have stack of plates? i have noticed that all of the transformer/motor/alternator/electric actuator have a stack of metal for stator ( or where winding is done. ). why is that needed ? can same thing not achieve by using a block of metal ? i guess its because of performance. how much performance can possibly lost ? why motor or alternator has stack of metal plates instead of simple block of metal ? what is the difference between the two ? AI: FYI they are called laminations (you'll hear "lamination stack" or "lam stack" in the trade) and they're for keeping low core losses by interrupting induced eddy currents and keeping them confined to a single lamination where the loop area is small. Also, there's an additional practical reason for using laminations: you can easily use the same lamination design for different length stacks just by using more or fewer laminations for a shorter/longer stack. A solid core would require different manufacturing steps for different designs.
H: Calculating Voltage I am trying to calculate the voltage \$Vw\$ of the following circuit: I have little experience with these kind of problems, so I tried to solve first a more simple circuit that did not include the R2-L2-C2-R4 branch. In the simplified circuit, I considered it as a voltage divider with \$\frac{1}{Z1} = \frac{1}{R1+sL1} + \frac{1}{R3}\$ and \$Z2 = R5+sL5+\frac{1}{sC5}\$. Then, I solved \$V_w = V_{\text{in}}\frac{Z2}{Z1+Z2}\$, transformed back to the time domain. I compared with a circuit implemented in SPICE with the same results. Now, the problem is that I don't know if I can continue to use the voltage divider strategy because C2 is connected to ground. What tips, strategy (or elements that I am probably not considering) would you suggest to calculate this \$V_w\$ ? How does SPICE solve this problem? (I would like to clarify that I do not have an electrical or electronic background or studies. Therefore, I usually have some knowledge gaps). Edit: Here is the SPICE circuit that I am using in order to compare my results, with a simple unit step for \$V_{\text{in}}\$. * example Vin 1 0 DC 1 R1 1 4 2 L1 4 Vw 2 IC=0 R3 1 Vw 5 R2 1 2 1 L2 2 3 1 IC=0 C2 3 0 1 IC=0 R4 3 Vw 5 R5 Vw 5 1 L5 5 6 1 IC=0 C5 6 0 1 IC=0 .control tran .0001s 2s 0s .0001s uic .endc .end AI: (this is in regards to the fixed schematic) I think your general approach is correct, but the addition of the branch with C2 complicates things. I think this would be a good opportunity to apply the "Extra Element Theorem." Call C2 the extra element, and remove it from the circuit. The EET then states that the transfer function of the circuit is going to be \$H_\infty \frac{1 + \frac{Z_n}{Z}}{1 + \frac{Zd}{Z}}\$, where Zn is the impedance looking in to the node where C2 is connected when Vin is set to be an infinite impedance, and Vw is nulled to zero volts. \$Z_d\$ is the impedance looking in to the node where C2 is connected when Vin is set to zero, and the node Vw left alone. \$H_\infty\$ is the input to output transfer function when C2 is out of the circuit, that is the same voltage division type transfer function you calculated earlier but with R2, L2, and R4 added to the parallel combination. It will probably still be a messy expression, but I think it will be easier to calculate than using nodal analysis. Edit: Z in the equation above is the impedance of the extra element.
H: Is it safe to apply higher voltage to the output of a MIC2920A voltage regulator? I made a mistake on a board recently when adding an optional PIC12F615 processor to supervise my ARM processor. I didn't realize the PIC needed >4.5V to erase. So, I've got this MIC2920A 3.3V regulator feeding the PIC (and only the PIC) and I need to let the programmer pod apply 4.5V to it. Will it work? I don't see anything in the regulator datasheet that says it will or won't. The datasheet discusses how "bulletproof" this thing is, capable of handling -20 to 60V on the input pin. I don't see anything about high voltage on the output pin. I've got 100 fairly expensive PCBs like this (20 stuffed). I can modify one board for development with a diode or reverse-power-protecting mosfet, but I'd like to be able to easily reprogram these boards later on. I'd planned on simply leaving the PIC off entirely if it didn't work... but it almost works. EDIT The regulator's input is a regulated 5V, so I wouldn't be going over that. EDIT 2 It works! I hooked up a bench supply, set it to 4.5V with a 30mA current limit, and then tried connecting it to the VDD pin of the ISP header (which is wired to the regulator's output pin). I didn't see any measurable current. I was unable to force the programming pod (PICkit3) to supply 4.5V when there was already 3.3V present, though. The regulator had to be unpowered to program the PIC. However, this regulator seems fine with it... the GND and VIN pins are 0V, and it draws no current or at least no measurable current. I was able to erase and reprogram the PIC. Thanks! AI: Surmises only - hard to be sure for a specific part with no hard data. Connecting one as stated and measuring current flow into regulator would tell you something. A look at the block diagram at the bottom of page 5 of the datasheet suggests you will be trying to reverse bias junctions in Q24 & Q26 (top right of page).I'd expect the 4.5-3.3= 1.2V overvoltage to be low enough to have a good chance of being safe. Is power applied to the regulator during programming? If not you may breakdown internal intrinsic body diodes (which we may not have got). After which anything can happen. You mention a reverse protection diode. It's not obvious where you were going to put that. It's usual to place a diode from regulator output to regulator input - Schottky probably a good idea.
H: Arduino: How to make a final prototype? I've been working with my Arduino starter kit for a while and learning the basics of electronics. Now, I have a project that I would like to move off from the standard bread board that came with the starter kit. I'd like to make the entire board configuration smaller so I can fit it in tighter places. So my question is, how do you go from prototyping on a standard breadboard to a final product? By final product I mean a more compact board. Right now this is what my mood lamp looks like for example: I'd like to be able to move from the breadboard there to something smaller that I can stack that is more permanent. I realize this may not be one-hundred percent clear as I'm still really new to electronics in general and I'm having a hard time explaining myself. So please let me know if I can help clear up anything as I'd love to get this answered, thanks! AI: If you want the thing you're making to be a "proper" Arduino shield, you can buy something like this "Protoshield" board from Adafruit: http://www.adafruit.com/products/51 Other vendors sell similar boards. It's basically a bit of perfboard that's designed for mounting components, but with the header pins already setup to "stack" onto an Arduino. If you don't need an actual shield that stacks onto your Arduino (that is, if you're going to run cable of some sort from the Arduino to the rest of the device, or if you're going to use one of the the super small Arduino clones) then you have a couple of options: Build it on perfboard. You can get perfboard that's designed to map very closely to the experimenters breadboards, or perfboard with one small copper pad per hole. Make your own PCB (printed circuit board), using one of a couple of techniques. You can use chemical etching, after you either draw traces on the copper clad board with a resist pen, or use the laser printer technique mentioned by Majenko. In either case, it involves soaking the copper clad board in an etching agent that dissolves all of the copper, except the part covered with "resist." What's left are your PCB traces. Or, if you have an active hackerspace or hobby electronics community in your area, you might get lucky and find somebody who has built a DIY PCB Mill, who could mill the board for you. Or if you're really enthusiastic, you could build your own DIY PCB Mill. :-) Farm out the "fab" of your circuit board to a specialist. This involves creating the PCB layout on a computer using something like Eagle, and then submitting the file to the fab, along with payment, and then receiving a package of boards a few days later. This may be a little too expensive if you only need one board... this is more for people who are building things to sell in volume. But some hobbyists make it economical by pooling their orders and splitting the cost.
H: Is it okay to keep a USB charger plugged into the cigar lighter? I have a USB micro charging adapter for my smartphone for my car. It is basically a cigar lighter plug that turns into a USB micro plug. When I don’t have my phone connected, and as such don’t want the adapter to draw any current, is it still safe to keep the adapter plugged in? I’m wondering because most other AC adapters (i.e. those not for the car) usually keep drawing some current, even if no device is connected. Is that also the case for those car adapters? Should I rather unplug it whenever I don’t need it? AI: A good quality adapter will probably draw some current - but not much. Strangely - a poor quality adapter MAY draw none. A good quality adapter will use a switching regulator to step the voltage down - probably a "buck regulator" The quiescent (no load) current draw will vary depending on the design but I'd guesstimate it could be as low as 10's of microamps and would hopefully not be more than say 5 mA. A load of 5 mA will take 200 hours or about 8 days to drain 1 Ah from the battery. That's about 2 to 5% of a typical car batteries maximum capacity. So even if you left that connected for a year it would probably take not more than about 1/2 of the battery's capacity. as you start a car far more frequently than that it should not be a problem. A low quality adaptor may use a zener diode dropper - I've seen it done. This can draw no current at all when there is no load, but the output varies badly with load and it wastes more energy that it outputs. Most adapters will be active switching regulator types. You can easily test the quiescent current draw. Using a 12V power supply or a car battery and a multimeter with mA ranges. Set meter to low current range. (You may want to start on a higher current range to protect the meter from violence or stupidity. Operate adapter with no load powered by 12V and with meter is series with the battery leads so you can measure current.
H: Best way to connect 2 USB devices to a single port I have a 4GB Thumb Drive that the plug broke off. So I extracted the chip and hard wired it to an old cable to retrieve the data. Now I'm thinking it might be a fun project. I have a USB Gravis Eliminator Aftershock game controller that I use to play games, and there is tons of space inside. I would like to wire the drive inside the controller and have them connect to a single usb port via the cable on the controller. Does anyone know if I can just solder the wires to the drive pins or do I need some kind of splitter type circuit between them? AI: Probably you can hard wire the 2 power wires to those of the Gravis device but will need to switch the 2 data wires of each device so that only one device at a time is selected. If you want a device that allows both devices active at once on the same USB cable you need to add the IC from a passive hub as well. These are cheap and commonly available and it should be a metter of "just doing it. ie cutting and soldering and suitable care mechanically. The end result may not be very useful compared to just plugging the two devices into an existing passive hub, but you will learn things along the way.
H: Why is high input impedance good? Naive perhaps, but Why is high input impedance a good thing? Is high input impedance always a good thing? AI: It is a good thing for a voltage input, as if the input impedance is high compared to the source impedance then the voltage level will not drop too much due to the divider effect. For example, say we have a \$10V\$ signal with \$1k\Omega\$ impedance. We connect this to a \$1M\Omega\$ input, the input voltage will be \$ 10V\cdot\frac{1M\Omega}{1M\Omega+1k\Omega} = 9.99V \$. If we reduce the input impedance to \$10k\Omega\$, we get \$10V \cdot \frac{10k\Omega}{10k\Omega + 1k\Omega} = 9.09V\$ Reduce it to 1k and we get \$ 10V \cdot \frac{1k\Omega}{1k\Omega + 1k\Omega} = 5V\$ Hopefully you get the picture - generally an input impedance of at least 10 times the source impedance is a good idea to prevent significant loading. High input impedance is not always a good thing though, for example if you want to transfer as much power as possible then the source and load impedance should be equal. So in the above example the 1k input impedance would be the best choice. For a current input a low input impedance (ideally zero) is desired, for example in a transimpedance (current to voltage) amplifier.