text
stringlengths
83
79.5k
H: Help with delayed smoothing code I'm hung up on how to smooth analog sensor data in a specific way. Math/code is not my expertise so thanks in advance. My sketch needs to listen an AnalogPin and smooth/remove any outliers as the values change, though smoothly settle on the final AnalogPin value. Ex. if the sensor is a Mic in an empty room and over 30-60 seconds the room fills with people, I'd need a MicValue that slowly grows to the new volume but omits any initial foot steps or major peaks. Ex. if the AnalogRead pin is a potentiometer, rapidly rotating the knob for 5 seconds wouldn't have much effect, but where the knob ends up the value would slowly settle upon. Any help to define what I am looking for, or help with code would be greatly appreciated. Thanks! AI: A simple smoothed estimator can be obtained simply by a linear blending of the newly sampled value and the existing smoothed value: smoothed_value := (1 - alpha) * smoothed_value + alpha * new_value For instance if alpha is 0.20 (20%), then we have: smoothed_value = 0.8 * smoothed_value + 0.2 * new_value In other words, take 80% of the existing value, and 20% of the new sample. By doing some algebraic manipulation, we can show that it can also be calculated this way: smoothed_value := smoothed_value + alpha * (new_value - smoothed_value) In other words, update the smoothed value by adding to it just the alpha fraction of the step between it and the new value. If you make everything integer, and use a power of two for alpha or a multiple of a power of two, you can do this very efficiently on even unsophisticated processors that don't support multiplication or division. For instance, suppose we want to make alpha 3/16. In C, we can do the multiply by 3 and divide by 16 with shifts and adds: delta = new_value - smoothed_value smoothed_value += ((delta << 1) + delta) >> 4; This type of smoothing exhibits exponential decay. It is similar to processes in nature such as, oh, the way an RC circuit charges or discharges to track changes in the applied voltage. The alpha parameter is in the range [0, 1]. If it is zero, the new values are ignored; there is no convergence. If it is 1, then smoothed_value isn't smoothed at all; it follows new_value instantly. Low values close to zero provide slow convergence. This algorithm, or something very similar, is used in the TCP protocol to establish a basis for the retransmission time-out based on measurements of the connection round-trip time.
H: Identifying live, neutral, and ground wires cold I have a European (230 volt AC motor, no markings), 1 phase (I think). It is roughly 6 inches long, just to get a sense of the scale. It basically wobbles when current is supplied to it. 1) I need to figure out which leads connect to ground, neutral and live. 2) I also need to figure out what kind of transformer I need to use. All I know is that it needs to convert the voltage from 110V (in the US) to 230V (so that the European motor can use the power). I read about how to do it when there is live voltage, in a situation where you need to figure out which wire are which in a house with running current. How do you do so with a cold circuit? How do I do it without first connecting (and possibly shorting) the motor to a transformer? How do I know which wires to connect to what before doing so? All I have is this shabby old multimeter, but it works. Motor is .2Amps 240V and 45 watts. AI: Yes it is an single phase motor, referring to the wire color codings. You need to step up transformer 110/240 but before you do so u need to check the frequency. As in Europe its 50 Hz not 60 Hz as this may effect your motor's speed.Please refer to the picture below link:
H: DS18B20 temperature interpretation I have a problem interpretting the temperature reading of a DS18B20 chip. There is a certain situation I am not abble to resolve. This is the example temp table for the chip from the datasheet: an example for reading of -0.5*C is shown as FFF8. Cutting off the 4 LSBits we get 0x0FFF. In signed data structure that is equal to -1, not 0. How am I abble to resolve the difference between 2 readings: -0.5*C and -1.5*C? If 0xFFF8 = -0.5 then what is the form of -1.5? The table then shows an example for -10.125*C. Cutting off the 4 LSBits gives 0x0FF5 which really is -10, then there is no reason to think that there is some kind of a shift for reading negative values... AI: You don't shift, you divide. The value is a simple 16-bit signed integer that is 16 times larger than the temperature. Just assign the value to a 16-bit integer, then divide it by 16.0 as a floating point number: int16_t min5s = 0xFF5E; double d = (double)min5s / 16.0; printf("%g\n", d); >>> -10.125
H: What could this scammy "magic whole-house electronic powersaving surge protector box" have actually done? My parents had good intentions, I guess, but the company that sold them this bad boy probably didn't. After blowing a fuse at their place, I noticed this box hooked up to the breaker panel. It was hooked up to a 50 amp breaker which led to the stove. I removed it shortly after I explained that there is no magic box to cut power bills, and they received a full chargeback through their credit card company when the installer of this device didn't even dispute that it was a scam. Not to mention, the way it was tied into the panel was not even close to being up to code - 2 wires into one breaker, one was stranded. They also charged just under a hundred bucks to wrap our hot water tank in bubble wrap. Sigh. The total was somewhere near $1500. I feel terrible for the folks who bought this and didn't know any better. Anyways, that doesn't stop the curiosity. Obviously nothing useful, but what could this thing have possibly done? I think I see diodes, caps and resistors.. so I'm thinking maybe there's a transformer in that cylinder and maybe this is a power supply for the light on the box? Or maybe that's not an LED and none of this stuff does anything at all. I'm a little scared to open up the large cylinder. If you guys give me the go-ahead, I'll cut that open too. The company was called SolarTEK, and no, they don't do solar. Gotta hand it to them though, pretty decent production quality. EDIT: Below it was suggested that this could be a power factor correction unit. Regardless of the usefulness of that at all in this context, this makes me wonder: Would such a device have functioned, being hooked up to only one circuit in the breaker? I saw an image while researching these capacitors that suggests on physical expansion of the capacitor, it breaks a fuse. Is that a type of surge protection? What would it take to trigger that? And if so, with this literally hooked up in-line with a stove, that couldn't possibly have protected the entire house from an actual surge, could it? AI: The red disks are MOVs (metal oxide varistors); these are the "surge protection" aspect of the device. There are four groups of them, for line-to-neutral and line-to-ground for both lines. The small silver tubes are fuses that are intended to blow in order to prevent a fire when the MOVs fail, since they often fail shorted. The large silver cylinder is a multi-section electrolytic capacitor, which is connected line-to-line. It is either a nonpolarized device, or the multiple polarized sections have been connected in such a way as to effectively make it nonpolarized. It is notionally there for "power factor correction", but this a waste of effort in a domestic application. It looks like the big capacitor is also being used to drop the voltage (limit the current) to the indicator lamp, which is probably neon.
H: Controlling output voltage (12v to 0-12v 5a) I'm having a problem finding the right circuit/device for a circuit I need to make (I'm quite a noob). It doesn't matter what the input voltage is, but I need an output voltage which I can digitally change from 0 (or at least the lowest possible) to 12 volts. It needs to be able to handle 5 amps and sudden changes in the output voltage. Since I don't know how such a circuit is called, I have no idea if it has been asked before. Please tell me how I can make this or at least how this sort of thing is called. AI: That sort of thing is called a power supply and typically uses a voltage regulator to stabilize the output. Without fancy converter circuitry you would need the input to be higher than 12V, say 15V for example. There's the LM138/338 voltage regulator which regulates a voltage according to the values of two resistors: The output voltage is determined by the formula on page 7 of the datasheet. You could use a digital resistor or digital potentiometer for R2 and thus make the regulation digital. There's one problem: this IC needs a reference voltage (VREF) of 1.25V to work properly, which means that the minimum output voltage is 1.25V. You will therefore not be able to regulate the output from 0-12V but from 1.25-12V.
H: How much resistance will I need to drop the voltage? 9 Volts is applied to circuit. There is a LED which runs on 3 Volts. I want to drop 6 Volts. how much resistance (\$R_1\$) would I need for that? AI: The short answer is: Any resistor will drop 6V. The LED has a fixed drop of 3V. All the rest of the voltage has to be dropped across the resistor, regardless of its resistance*. The purpose of that resistor is not to drop the voltage, but to limit the current. You need to specify an amount of current the LED needs, and then use simple Ohm's law to calculate the resistor to limit the current to that amount: $$ R=\frac{V}{I} = \frac{9-3}{I} $$ When you know what I should be you can find the resistor. *assuming enough current flows to allow the LED to conduct
H: What happens to a polarity sensitive capacitor when you feed a square wave through it? Consider the following circuit. simulate this circuit – Schematic created using CircuitLab The output wave form will look like this Orange - input signal Blue - output signal The Wikipedia entry on Electrolytic capacitors says Nevertheless, electrolytic capacitors can withstand for short instants a reverse voltage for a limited number of cycles. In detail aluminum electrolytic capacitors with non-solid electrolyte can withstand a reverse voltage of about 1 V to 1.5 V. This reverse voltage should never be used to determine the maximum reverse voltage under which a capacitor can be used permanently It does not specify what a short duration is. Since polarized capacitors are meant to be used one way, will the falling edge's dv/dt damage the capacitor ? AI: I disagree with the answer given. I think the answer confuses a negative voltage (with respect to zero or ground) with potential difference between two points in a circuit (i.e. the plates of the capacitor). The voltage ACROSS a capacitor cannot be changed instantly, so the positive plate is still MORE POSITIVE than the negative plate at the transition, thus it always maintains the normal polarisation. Case 1: Suppose the input was 0V to 5V (or 0 to +V). On the negative edge of the input pulse the positive plate falls to 0V BUT the negative plate falls to -5V at the same time maintaining the correct polarisation direction (positive plate more positive than the negative). The negative plate then discharges through R1 back to zero. On the positive edge the voltage across the capacitor is zero. The positive plate rises to +5V as does the negative plate. We still have zero volts across the capacitor. The negative plate then discharges through R1 to zero BUT the positive plate remains at +5 volts. The capacitor is polarised normally. At no time is the negative plate more positive than the positive plate. Case 2: (As suggested in comments) Suppose the input was +5v to -5V (or +V , -V) This simply cannot be the circuit as drawn above. There is a common (ground) connection clearly shown between the pulse signal and R1 with a positive end shown connected to the capacitor.
H: Do I have to power-on reset CMOS counters? I am designing a project that contains several CMOS counter ICs (CD4017 specifically). What is the state of the counter on power-on? Do I have to incorporate circuitry that pulls the reset pin high on power-on to ensure the counter starts at zero? I checked datasheets from multiple manufacturers, and none of them mention this subject. I found several claims online that the state of the counter is unpredictable on power-on. However, I also found many projects which do not include a reset circuit, and the issue is not mentioned either. The reset circuit adds complexity and additional parts, which I would like to avoid if they are unnecessary. AI: You have to assume that if the datasheet doesn't specifically mention a power-on state, that the state of any digital logic is undefined at power-on, and you need to provide a reset pulse to get it to a known initial state. Generally speaking, only single-chip microcontrollers implicitly handle power-up initialization. However, you can purchase tiny power-up/reset controller chips that will add that feature to any circuit.
H: Transistor fuse problem I can't find out how this transistor fuse works. I know that the R1 is there because of voltage drop 0,7 V when the voltage on output is at its highest possible value. But I don't understand why there is the diode and reverse biased. And my next question is how the transistors operate. How is it possible that there is output immediately after it is turned on, shouldn't there be an small current to open the T2? But the base of T2 is grounded. Thank you simulate this circuit – Schematic created using CircuitLab AI: First of all, note that T1 and T2 are both PNP transistors. To turn a PNP transistor on, the base must be more negative than the emitter. When the circuit first powers up, T1 is off, and T2 is turned on by the current through R3 and R4. As more current is drawn by the load (R5), the voltage drop across R1 increases, making the base of T1 more negative with respect to its emitter. When this voltage drop reaches about 1.3V — the forward voltage drop of T1's B-E junction plus the forward drop of D — current begins to flow through D and T1, turning T1 on. This reduces the base drive to T2, causing it to start to turn off. As T2 turns off, the voltage across the load drops, causing current to flow through R2. Since this current can't flow through D, it must flow through T1, turning it on harder, and turning T2 off more. This process continues until T1 is saturated, T2 is completely cut off because there's no voltage across R3, and there's only a trickle of current flowing through T1, R2 and the load. The collector current of T1 is flowing through R4 to ground. Now the fuse is "tripped". The load (or the supply) must be removed altogether in order to reset the fuse and restore power to the load.
H: Current capacity of very thin (0.1mm ~ 0.5mm) copper wires? I am looking at this very thin copper wire. It does not have much description other than the physical dimensions. What's the maximum current capacity of these wires? I guess they are not for power wiring (~ 200mA)? AI: That all depends on the length. There's two factors to consider with wires: The self-heating caused by the current The voltage drop caused by the resistance Number 1 is purely a factor of the wire diameter. Number 2 also has to take into account the length of the wire as well. I find this table is a good reference: http://www.powerstream.com/Wire_Size.htm 0.1mm is roughly 38 AWG. So for that, for "chassis" wiring (i.e., short runs between boards, switches, lights, etc) the current limit is 130mA. For longer "power" runs, the limit is a mere 22.8mA. The resistance of the wire is around 659.6Ω per 1000 feet, so about 0.659Ω per foot. That kind if wire is usually used for winding your own inductors, transformers, or electromagnets. It's not often used for chassis wiring without an incredibly good reason.
H: Output Units of Soil Moisture Sensor I have an Octopus Soil Moisture Sensor connected to a Rasberry Pi through an MCP3008 ADC chip. The sensor is working correctly, but I have no idea what the reading values mean. I say its working correctly because when I place the sensor in known dry soil and take a reading, I get a 'dry' result. When placed in known wet soil, I get a 'wet' result. These delineations I was able to find in this datasheet. However, that is the only datasheet I can find, and in the Specification section we are given this table: My ultimate goal is to turn on either a valve or pump when the moisture content in the soil drops below a certain percentage of either weight or volume (SI units of either grams / gram or inches / inch, which are the units mostly used in the industry). I have found scholarly articles which contain easy to use equations for converting between different units of measurement, including going from a dielectric constant measurement to % Moisture Content. I believe the output value is either somehow related to the drop in voltage observed or an indirect measurement of resistance, but I cannot be sure. Without some kind of units I cannot perform any calculations to obtain the result in the units I desire. According to this, correct values of the dielectric constant should not be above ~80 or so for water. I tried emailing the company I purchased the sensor from but without a response after 2 weeks. The datasheet I linked above does state this: This sensor uses the two probes to pass current through the soil, and then it reads that resistance to get the moisture level Can I take that as meaning that the output units the sensor is giving me is in Ohm meters? If so, I find it odd that the same document doesn't also list that as the units in the specifications. Does anyone here have any experience with this sensor, or know where I can find a datasheet that provides the units it is measuring in? AI: It's giving you units of "wetness", from 0 meaning "bone dry", and 950 meaning "sopping wet". It's for an Arduino. It doesn't give you anything as technical as real units - just a rough scale between wet and dry. It's entirely up to you how you interpret that value. It's about as accurate as sticking your finger in the soil to feel how wet it is. You could divide the sampled value by 10 and use it as a percentage of sogginess.
H: Can I do this (MOSFET instead of switch)? This might be a very trivial question: Can I simple swap a switch that is connected to a RESET pin with internal pull-up with a N-channel MOSFET? My goal is to pull the RESET to ground using a signal (OUTPUT) instead of a switch, but not sure if it is this simple? So can I replace this: with this?: AI: Yep, that's ok. Make sure to put a pull down on the gate of the MOSFET.
H: How accurately can an ESC detect the number of RPMs? I am working on a project involving brushless motors, so I got an ESC to power them. The problem, is that I need to accurately control the number of RPM. Can an ESC, like this one, control the number of RPM the motor is doing? Or is it based more on percentage of throttle? If I wanted to accurately control the number of RPM my motor is doing, would I have to get an optical RPM sensor? AI: In theory, an ESC can precisely know the RPM, since it's the ESC that provides the RPM. The whole way that a brushless DC motor works is about exciting individual coils. As subsequent coils are turned on / off the magnet is pulled around the circle. Only when all the coils have been used in turn has one revolution takes place. Since it's the ESC that is responsible for creating that sequence of coil activations it's the ESC that dictates exactly how fast the motor is turning. But the real question you should be asking is, can you control the RPM setting of the ESC to any great accuracy?
H: Developing an intuition about this circuit I am trying to gain an intuition with circuit analysis by going through MIT's free course on intro to electronics. Question S2E3 presents the circuit below. I solved the problem (find all currents at nodes and voltages across elements) by applying KCL and KVL and doing some algebra, but I had no real intuition that my answer was right until I submitted my answer and it told me I was correct. Which took several attempts. When experienced electronics gurus sees this circuit, what do they see? I see a voltage source and a current source fighting each other to decide who's in charge, but I'm pretty sure that's not the right way to see it. simulate this circuit – Schematic created using CircuitLab AI: Other people have given good quantitative methods. If you want a more qualitative method, one place you can start is to try to figure out which way the currents are flowing in each branch. That will usually help give you some intuition as to what's happening with the voltages, too. There are three branches -- The V1/R1 branch, the R2 branch, and the I1 branch. The I1 branch has a constant current source, so you know which way the current is flowing. Next, look at the R2 branch. All of your sources are pointing towards the top of R2, which tells us that the current will be flowing from top to bottom. That leaves the V1/R1 branch. The question here is, under what conditions will current flow into the branch (from the top node towards V1) and out of the branch (from V1 towards the top node)? Well, it depends on the voltage at the top node, which I'll call Vtop. When Vtop < V1, V1 sources current. When Vtop > V1, V1 sinks current. When V1 = Vtop, no current flows through V1. Let's imagine that V1 = Vtop, so there's no V1 current. All of the I1 current goes through R2. What would Vtop be, then? \$3A * 5\Omega = 15V\$. Do we have anything close to 15V in V1's branch? Nope! Therefore, V1 must be sinking some of I1's current -- probably a fair bit since it's a small voltage source. In this circuit, the resistors were all roughly the same size. That's not always the case. If one resistor is much larger than the others, anything in series with it will have a small effect on the rest of the circuit. Likewise, a small resistance will tend to short out whatever's in parallel with it. (You'll see this principle at work in passive filters once you get to AC circuit analysis.) Lastly, there are two special cases that are very rare but may help with your intuition. The first is an ideal voltage source in parallel with an ideal current source. In this case, the current source has no effect at all. Likewise, when an ideal voltage source is in series with an ideal current source, the voltage source has no effect at all. You should make sure you understand why. Feel free to post a comment if you want to confirm anything.
H: PWM Modules vs Channels I don't seem to understand, when a manufacturer states that their microcontroller has 2 PWM modules but 8 channels, does this mean I can drive only 2 motors but I have 8 pins (channels) to choose to output my PWM? AI: That particular PIC has two "simple" CCP modules (that can be configured for basic PWM) and a single "power control" PWM module that can be configured to provide up to four, differential, PWM outputs, each with different duty cycles, offsets, dead times, etc, but all synchronised to the same timebase. You could drive two simple DC motors with the CCP modules; their PWM signals would not be guaranteed to be synchronised (which probably isn't a problem) and the PWM resolution would be 10 bits. Driving a complex motor with the CCP modules would be difficult if not impossible. You could drive up to four simple DC motors with the power control PWM module; their PWM signals could (if you chose) be perfectly synchronised and the PWM resolution would be 14 bits. Alternatively, you could drive a more complex motor (BDCM or stepper, perhaps) with the power control PWM module.
H: Type "X2" line filtering capacitor failing as short circuit I recently plugged in an old Apple IIGS that had been sitting in a basement for almost 15 years and it worked for awhile before blowing up in a smokey mess. The reason for the smoke was easy to diagnose, one of the line filtering film capacitors had exploded and shattered. The fuse was also blown in the process (so I'm assuming the capacitor managed to somehow blow in a short-circuit fashion). Although it is straightforward for me to buy replacement parts and repair the device, is there a particular reason why a film capacitor would fail in such a spectacular fashion? My understanding is that typical film capacitor failure modes involve a gradual reduction in capacitance, rather than a sudden internal short circuit. Does a capacitor failure in this fashion typically indicate another component has also failed down the circuit? Unfortunately, I do not have schematics for the power supply, but my understanding is that "Type X2" capacitors are "across the line" -- between line and neutral. The exploded (and also the intact capacitor on the other side of the transformer) read: 0.22uF X2 and have a 250V rating. AI: Going by the colour of the capacitors, they look like Rifa PME 271M types. If that is the case, they are well-known in vintage computer circles. The BBC Micro PSU was fitted with them (made 1981 or so) and they fail with a lot of smoke but no fire. The smell is characteristic, a sort of wood-smoke, bonfire smoke smell. The standard fix for the BBC Micro (and similar Acorn PSUs) is to replace them all with modern X-class equivalents. In this forum post: http://www.vintage-radio.net/forum/showthread.php?t=69128 There's some failure analysis, which suggests a mismatch between the capacitor itself and the epoxy coating. Rifa capacitors that have not yet failed usually have many tiny hairline cracks in the epoxy outer shell. Do an image search for "Rifa PME271M" to see more examples of failed capacitors.
H: Does "Connected" mean solder together? Looking here, I am shown that the connecting symbol, means the wires are, literally "connected" as shown below. I am currently working on trying to decipher an FM Radio schematic, but am having trouble with this "connected" thing... On the above schematic, I am shown that almost everywhere on the board, there are connecting wires. Is this exactly how it's meant to be soldered/constructed? Am I meant to grab 3 wires, and just drop a blob of solder on them so that they are all connected? AI: It might be easier if you understand that schematics are simply a symbolic representation of the circuit, the components do not need to be placed in that particular physical layout to work, i.e. R2 doesn't have to be vertical and R3 doesn't have to be horizontal (though it is often easy to think of it as a close approximation to the layout). As for "connected", it could mean they are soldered together, either through wires, the leads of the components if using through hole, or are both connected to the same trace of a PCB at some point. It could also mean they belong to the same "node" on a breadboard, in which case there is no solder. So for example with TR2, the collector at some point in following the path (it could be wires, leads of components, traces on PCB, etc.) of the collector, it must be connected to one end of each C4, R3, and R4. The base must be connected to the other end of R3 and one end of C3 and the emitter is connected to ground.
H: How can I tell if a given MOSFET can be fully driven by 5V TTL high signal? (what should I look for on the datasheet?) How can I tell (by reading the datasheet) if a specific MOSFET can be turned fully on (with the minimum drop) with simply 5V on the gate? (assuming 5V or 12V potential between the drain and source). What specs am I looking for (preferably ones that are not on graphs, ew) to determine if a MOSFET is suitable, apart from the fact that it must be N-Channel? AI: Turn on is governed by the threshold voltage. Vth or Vgs_th or similar. This is specified at a stated current - usually small - 10 uA or 100 uA or sometimes 1 mA. Useful turn on voltage is a volt or more above this value and fully enhanced operation needs typically 2 or 3 times as much voltage. Most data sheets (all good ones) contain graphs that show the current that can be passed at various combinations of Vgs and Vds. These are often given at two temperatures - often 25C and 125 C Below are two sets of curves for a BSS138 MOSFET. I do not recommend this MOSFET as there are many many .. better ones available BUT it is a popular hobbyist choice. Fig 6 shows Vds versus Ids (or Id) for various values of Vgs. When the curves rise relatively vertically the FET is in a near resistive mode - the resistance at any point is given by R = V/I = Vds/Ids at that point. When they begin to curve to the right the FET is entering an ~= constant current mode and resistance risews with increasing Vds wit minimal increase in current. For Vgs = 2V the FET is != fully on up to about 0.1A. It is close to CC (constant current mode by Id=0.2A. At Vgs = 2.5V it is in resistive mode up to about 0.5A when Vds is about 0.9 V. At Vgs = 3.5V it is in resistive mode for all Ids shown on the graph. Fig 7 is unusual - not many FETs have this graph shown. This shows Id for values of Vgs below what would be considered to be Vth usually. Also it shows min, typical and max curves - a very unusual set of data to be given but very informative. It can be seen from Fig 7 that to get 1 uA Id you need about 0.55 / 0.8 / 1.15V Vgs min/typ/max. To get 1 mA you need about 0.8 / 1.0 / 1.6V min/typ max Vgs. SO in this case - the FET can be said to be "starting to turn on " with about 1.1V worst case on the gate - when you get about 1 mA Ids. But to get say 500 mA you'd want 3.5V or better for Vgs. As a general rule, the higher Vgs the better as long as Vgsmax is never exceeded. Exceeding Vgs by a modest amount (say 10%) MAY lead to gate-source oxide insulation breakdown and destruction of the FET. ADDED: Vth or Vgsth is a useful starting point BUT the graphs are MUCH more useful and are your great friends. Learn to use them and appreciate what they tell you. A single parameter is relevant at one point only and is usually a typical value. Rdson (= the slope of the Vds/Ids curve at some specified point) is often given for pulsed operation at 25C. To properly understand what happens you need to look at the graphs. DO NOT be scared of them - once you learn to use them they are vastly more useful than any single figure can be.
H: RMS measurement/calculation On-the-fly I have an SAR ADC to measure the RMS value of an AC signal. My present method is to use a timer to trigger the conversion and store the conversion result. When I've sampled a whole cycle of points, I subtract the DC level (the average of all points) from the signal then use the well-known RMS algorithm to get the RMS value. I wonder if there is any method to "distribute" the calculation work to samples. For example, if I need to calculate the mean value of the cycled signal, I can add the conversion result to a global variable "sum" after a conversion is done. When the conversion of the last sample is done, I only need to divide the "sum" by the sample count. In this method, I only need one global variable, there's no need to store all the samples. But for my RMS measurement, what is difficult for me is that I need to subtract the DC level, but the DC level can only be gotten after I've done a whole cycle sampling. I think you can understand me. Any suggestion is appreciated. Update: Thanks for all you who have gave me answers and suggestions. And some answers are acceptable for me. After some searching and thinking, I've an ideal too. But not very sure. As known, $$ V_{RMS(total)} = \sqrt{V_{D}^2 + V_{1RMS}^2 + V_{2RMS}^2 + \cdots + V_{nRMS}^2} $$ Assume a perfect whole cycle sampling, and omit the higher harmonics, $$ V_{1RMS} = \sqrt{V_{RMS(total)}^2 - V_{D}^2} $$ So, I can use running-averaging to get \$V_{D}\$, and running-rms to get \$V_{RMS(total)}\$ (without removing the DC), then finally do a subtraction and sqrt to get the RMS value of the fundamental wave signal. Certainly, there will some error when my sampling is not a perfect whole cycle one. I need someone to confirm this, thanks. AI: Keep the data stored in a circular buffer, and keep a pointer to the current value. Keep a running squared total. At each sample, subtract the squared value that "falls off" your buffer, and add the squared value that adds on. To get the new sum squared, its then two squarings, and add and a subtract, regardless of how big your buffer is. You're still on the hook for the square root, though. For efficiency in the modulo math for the circular buffer, I suggest a buffer size of a power of 2.
H: What is Subsampling in image processing? I was going through some image processing document. And I came cross this term "sub sampling". What does it mean? Is it sampling again already sampled data .. ? AI: Subsampling does not necessarily mean resampling previously sampled data, although it often gets implemented that way in practice. It really refers to sampling at a rate (either in space or time) that's lower than the Nyquist criterion would indicate. It usually follows some sort of low-pass or bandpass filter that reduces the information content of the original signal to a level appropriate for the new sample rate. In color image or video processing, this is often done to reduce the amount of data that needs to be transmitted or stored, taking advantage of the fact that the human visual system has poorer acuity for color information than it does for intensity. So, in a YCrCb representation, the Cr and Cb (color) components are filtered and then sub-sampled at 1/2 or even 1/4 the rate of the Y (intensity) component, with very little loss in terms of perceived image quality.
H: Use of 100K ohm resistor along with 0.1uF capacitor? In the circuit diagram below, why is there a 100KΩ resistor (NOT R2) connected to the capacitor? To my understanding the capacitor-resistor act as a high pass filter to block the DC offset of the microphone, but since only the capacitor blocks DC why is the 100k resistor used? According to the author of the video (link below) he said, the 100k is used "not to overload the microphone's un-amplified output". I don't get this part. Also, can only a capacitor be used in this circuit or any other circuit without the 100k resistor? Passive RC high pass filter tutorial! AI: The resistor is there to provide a DC path for the input bias current of the opamp. It is normally selected to be the same as the DC resistance connected to the other input, so that the bias current does not produce a voltage offset at the output of the opamp. But in this case, the effective DC resistance on the inverting input is only 1k||100k = 990Ω, so that benefit is not realized here. It is also selected to be high enough that it doesn't affect the frequency response of the circuit overall (in conjunction with the DC blocking capacitor). In this case, 0.1 µF and 100 kΩ have a corner frequency of $$\frac{1}{2\pi R C} = 15.9 Hz$$ This means that for frequencies above this value, the resistor will have no effect in the AC signal, but there will be a rolloff (loss of amplitude) below this frequency. This "loading" effect is probably what the author of the video was referring to.
H: Long term voltage change - analog voltmeter, op-amps and logarithmic scale I want to display one minute voltage change on analog voltmeter. Voltage change: from -0.5V/min to +0.5V/min. My analog voltmeter has 0-10V scale (I will replace it with homemade printed scale). I don't want to use any microcontroller, PWM etc. I want to learn how to do it by using op-amps and single supply. In future - I want to scale it logarithmically (-0.5, -0.05, -0.005, 0, +0.005, +0.05, +0.5), but for now - let's assume that I need just linear delta-V read. WHAT I KNOW FOR NOW I know that I need active differentiator block. I can use formula from Wikipedia, find resistor and capacitor value. After that block I can use some non-inverting block to amplify voltage to desired range and add 5V with summing amplifier block to have 0V/min at the center of my voltmeter scale. WHAT IS MY PROBLEM My problem is single supply. When voltage change will be negative - I guess single supply op-amp will not work properly. How can I deal with that? BACKGROUND Long time ago I was bored and I built custom thermometer that measures water temperature at the output pipe of old central heating furnace. It is supposed to inform me about temperature and temperature change. I can see how fast temperature is rising or dropping, and I can estimate when I should go to basement and put some logs or coal into furnace. There is analog LM35 temperature to voltage converter (linear, 10mV/°C), microcontroller with 10-bit ADC with high oversampling and low pass filter at input. Display looks like this: I realize that 0.01°C resolution for temperature read is huge overkill and my thermometer acurracy is about +/- 1°C, so please don't comment that. Now I want to build analog version of this and use two analog voltmeters similar to this: One will show temperature, another temperature change. AI: Let's take the straightforward part first. In order to deal with both positive and negative voltages from a single supply, what you need is a virtual ground, centered between ground and the positive supply. simulate this circuit – Schematic created using CircuitLab Use the new signal ground for all analog processing, with the op amps powered by ground and V1. Now for the harder part. Your approach to measuring temperature differences will be very difficult. Your active differentiator is OK as far as it goes, but you haven't tried to calculate the RC values, and you need to do so. 0.5 V/min is .008 V/sec, and if you want to get 10 volts out, RC needs to be 10/.008, or 1200. You can get this, for instance, with a 1 uF capacitor and a 1.2 Gohm resistor. You may have some difficulty finding a resistor like this. So let's say you use a 1.2 Mohm resistor - then you need a 1000 uF capacitor. That may seem like no big deal, but you have to use a very special capacitor, one with a leakage current less than 80 nA if you want leakage to cause less than a 1% error. And that will be harder to find than a Gohm resistor. Either way, you'll have to learn all about managing leakage currents in your circuit. Worse, even if you manage to get this working, it won't tell you what you want to know, which is the temperature trend over 1 minute intervals. All you'll know is what's happening right now, this very second - and that is likely to be very noisy. If you want to know about 1-minute intervals, you need to sample at one-minute intervals and display the difference. You can do this with, for instance, a pair of sample-and-hold circuits. But making a sample-and-hold which does not droop over a one minute hold interval is probably even harder than making your differentiator. You can, of course, use discrete logic, an A/D converter and a D/A converter to do the job. A microcontroller will be much more compact. There's a reason this sort of display has only recently become widely available, and that is the proliferation of cheap, low-cost processors and peripherals. Some things just don't lend themselves to a pure analog approach.
H: Steady state response and transfer function For an LTI system in frequency domain, Y(s) = H(s)X(s), where symbols have their usual meanings. I am confused in what this represents, i.e., is it true only in steady state (in other words is it only the forced response) or is it true for all times including the transient time (forced plus the natural response). Because when we take the sinusoidal response of a system we calculate the steady state response by calculating the magnitude of the transfer function H(s) and multiplying it by the input sine. But when we calculate the inverse laplace transform we get the total output of the system. AI: Not quite, \$H(s)X(s)\$ is the response to the signal \$X(s)\$ if the system is initially at rest, i.e. with "zero" initial conditions. You can understand this in the following way. A LTI system can be described in the time domain by a linear differential equation with constant coefficients like the following: \$ a_ny^{(n)}(t) + a_{n-1}y^{(n-1)}(t) + \dots + a_1y^{(1)}(t) + a_0y(t) = b_mx^{(m)}(t) + b_{m-1}x^{(m-1)}(t) + \dots + b_1x^{(1)}(t) + b_0x(t) \$ Keeping in mind the differentiation property of the one-sided Laplace transform: \$ L\{D[q(t)]\} = sQ(s) - q(0^-) \qquad\qquad \text{where} ~~ Q(s) = L\{q(t)\} \$ you can take the L-transform of both members of the differential equation and you obtain the following equation in the s domain: \$ a_ns^nY(s) + a_{n-1}s^{(n-1)}Y(s) + \dots + a_1sY(s) + a_0Y(s) + R(s) = b_ms^mX(s) + b_{m-1}s^{(m-1)}X(s) + \dots + b_1sX(s) + b_0X(s) + K(s)\$ Where \$R(s)\$ is a polynomial expression in \$s\$ where the coefficients are combinations of the derivatives of \$y\$ computed at \$0^-\$ (this term comes from the \$q(0^-)\$ in the differentiation property). Analogously \$K(s)\$ is a polynomial whose coefficients are combinations of \$x\$ computed at \$0^-\$. If you factor out \$X(s)\$ and \$Y(s)\$ in the transformed equation and then isolate \$Y\$ you obtain the following, which is an expression for the entire response (zero-state + zero-input): \$ Y(s) = \dfrac {b_ms^m + b_{m-1}s^{m-1}+\dots+b_0} {a_ns^n + a_{n-1}s^{n-1}+\dots+a_0} X(s) + \dfrac{K(s)-R(s)}{a_ns^n + a_{n-1}s^{n-1}+\dots+a_0} \$ The first term is \$H(s) X(s)\$ and gives you the full response of the system when it is excited by \$x(t)\$ when its initial state is "zero" (i.e. no energy stored in caps and inductors, if we are talking about electrical circuits), the other term represents the part of the transient response due to the energy stored in the system at time 0. Note that this latter depends on the values at \$0^-\$ of y, x and their derivatives. From a circuit POV these values are related to the initial conditions of the circuit: currents in inductors and voltages across caps. Take as a simple example an RC circuit like the following: from the KVL and Ohm's law we have: \$ v(t) = R i(t) + v_c(t) \$ but the v-i relationship for the capacitor tells us that \$ i(t) = C \dfrac{dv_c(t)}{dt} \$ Thus we have the following differential equation for the circuit: \$ v(t) = R C \dfrac{dv_c(t)}{dt} + v_c(t) \$ Where \$v\$ is the excitation (x) and \$v_c\$ is the unknown response (y). If we now apply the L-transform to both sides we get: \$ V(s) = R C \left[ sV_c(s) - v_c(0^-) \right] + V_c(s) = (R C s + 1 ) V_c(s) - R C v_c(0-)\$ which, after simple passages, becomes: \$ V_c(s) = \dfrac{1}{R C s + 1} V(s) + \dfrac{RC v_c(0^-)}{R C s + 1} \$
H: How to solder with one hand? I am a beginner at electronics. I don't have many tools and stuff, so I am forced to solder by hand. I don't have a pcb to solder on, so I usually just solder the wires together, but it's really difficult without a holder. Is there an easier way to do this? If not, is there a substitute for a wire holder? Any help would be appreciated. AI: Something like this may help. Just google "solder helping hand"
H: Understanding The Art of Electronics mathematical explanation for capacitors The author mentions that the reader should not worry if they cannot keep up with the mathematics, I however feel uncomfortable doing so. The issue is the fact that the author does not explain what the mathematical variables are for so I would like someone who understood it to clarify. The give the following circuit simulate this circuit – Schematic created using CircuitLab It mentions that at time = 0 the equation for the current is $$ I = C{dv\over{dt}} = {V_i - V \over {R}}$$ The author does not specify what Vi or V are. However, I can conclude that you would need to subtract the voltage supplied by the battery by the voltage of the capacitor. Vi is the source voltage, V is the voltage on capacitor. Afterwards they define the V (capacitor voltage) as $$V=V_i+Ae^{-t\over{RC}}$$ What confused me here is what the term Vi was doing in the expression for the initial voltage across the capacitor or does Vi stand for something else? also what does A signify? As the author then states that A is determined by initial conditions V=0 ,t=0. A will be equal to -Vi so then $$I={V_i -(V_i + (-V_i * e^{-t/RC})\over{R}} = {V_i * -e^{-t/RC}\over{R}}$$ at this point I have lost track of the intuition behind it and if someone could walk me through what the author means, or really just the intuition behind the mathematics I would appreciate it. AI: First, you should be aware that the treatment of circuit theory in The Art of Electronics is very brief. An actual circuit analysis textbook would cover time constants in much more detail and provide more examples. Your circuit appears to be Figure 1.31 from section 1.13. You left off the switch and the initial conditions, and mislabeled the voltage source. The battery is \$V_i\$, not \$V_1\$. Here's a corrected version: simulate this circuit – Schematic created using CircuitLab It is implied (but not stated) that the capacitor is discharged at t = 0, so that V starts out at zero volts. With the switch open, there is no DC path from V to ground, so we have to make an assumption like this. Once the switch is closed, current can start to flow. The mathematical way of approaching this is to write an equation using Kirchhoff's Current Law (KCL). Because of the capacitor, this will be a first-order differential equation: $$current\ out\ of\ V_i = current\ into\ C$$ $$\frac{V_i - V}{R} = C\frac{dV}{dt}$$ (A differential equation is an equation involving a rate of change. Here, \$\frac{dV}{dt}\$ is the rate of change of V with respect to time.) You can then solve this to get an equation of the form: $$V = V_i + Ae^{-t/RC}$$ where e is the base of the natural logarithm (~2.718) and A is an unknown constant. You can solve for the constant using your initial condition of \$V_{t=0} = 0\$. An alternate way of looking at it is to say that a capacitor acts like an open circuit at DC, and like a short circuit when the voltages in the circuit are changing rapidly. At the instant we close the switch, we have a rapid change -- \$V_i\$ is suddenly applied all at once. The capacitor acts like a short to ground, so the current is \$V_i/R\$. After a long time, the voltage has stabilized and we effectively have a DC circuit. The capacitor acts like an open circuit, so \$V = V_i\$ and no current flows. The transition between these two states in an exponential decay. This means that the equation for V will have a term like \$e^{-t/\tau}\$, where \$\tau\$ (tau), called the "time constant", determines the rate of decay. At t = 0, this exponential term is equal to 1. As t -> infinity, the exponential term decays to 0. We can use this to get an equation for V: $$V = (final\ condition) - (difference\ between\ final\ and\ initial\ conditions) * (exponential\ term)$$ At t = 0, when the exponential term is equal to 1, this gives us: $$V = (final\ condition) - (difference\ between\ final\ and\ initial\ conditions) = (initial\ condition)$$ At t = infinity, when the exponential term is equal to 0, it gives us: $$V = (final\ condition) - 0 = (final\ condition)$$ In this circuit, our initial condition is \$V = 0\$. Our final condition is \$V = V_i\$. The difference between them is \$V_i - 0 = V_i\$. We would normally have to solve the differential equation to get the time constant \$\tau\$, but what the book is telling us is that for an R-C circuit, \$\tau = RC\$. Now we can write the final equation: $$V = V_i - V_ie^{-t/RC}$$ When the initial condition is zero (as it is here), we can write the equation as: $$V = (final\ condition) * (1 - (exponential\ term))$$ which gives: $$V = V_i(1 - e^{-t/RC})$$ And that's exactly what's in the book.
H: Atmega328 to SD card issues I am working on a board that includes an Atmega328 which needs to read data from an SD card. I am having problems. Here is a diagram: I believe the issue may stem from the voltage divider that is connected to The hex converter (74HC4050D) and the micro SD card. However I have tried removing that and connecting a regulated 3.3V signal in it place and it still does not work. Does anyone have any idea what I am doing wrong? Help is greatly appreciated! AI: You need a separate 3 volt linear regulator for the SD card. Use one that has an ENABLE input, because to reset the SD card (after an error), you need to power down the card and pull all the signals to zero. You also need a level shifter to translate between the 5 volt AVR and the 3 volt SD card signals, although even resistor dividers can be used for that. If you connect PB4 like you have, be careful not to drive 5 volts from PB4 by accident. At least use a series resistor as a rudimentary safety feature if you don't want to invest in a proper level shifter IC.
H: BJT Astable Multivibrator I have the basic knowledge about multivibrators, but I did not understand the working principles of the circuit schematic provided down below. I have done the basic research about how it works, but I could not understand this particular BJT Astable Multivibrator circuit. Could someone please explain why 470 ohm and 10K ohm resistors are used and why the outputs of the circuit are not the emitter legs of the transistor but the collectors of the transistors. And the most important question is : I put LEDs to the outputs. Does that changes the duty cycle of the Multivibrator (or frequency)? AI: The emitters of NPN bipolars are often directly connected to ground for various reasons. For one thing, this makes the circuit analysis easy. The NPN transistor starts conducting when there is more than about 0.7 volts base-emitter voltage. At that point the base-emitter current starts to flow, causing also the collector-emitter current to flow. As the emitter is connected to ground, you can see that this threshold voltage of 0.7 volts is 0.7 volts from the ground. Consider T2. When a transistor's base has at least 0.7 volts, then the collector is drawing current, causing the collector voltage to be near zero volts. At that point, the LED D2 is not light. The other state is that the transistor is not conducting: at that point the LED is light and there is about 2 volts at OUT2. C2 charges to 1.3 volts : the left plate will have 0.7 volts (the threshold voltage of T1) and the right plate has 2 volts. Now, let's say that T2 starts conducting. OUT2 will drop from 2 volts to 0 volts. But there is still 1.3 volts charged into the capacitor. This means that the left plate of C2 suddenly drops to -1.3 volts, causing T1 to stop conducting. C2 starts to discharge, C1 starts to charge.... and round and round we go.
H: Op amp noise specifications at DC One thing I've never quite understood about noise specifications is what happens if your circuit uses DC only -- yet all specifications for noise make reference to a bandwidth. I have an instrumentation amplifier. Let's say the thing I'm measuring is a DAC, with a spec'd noise level of -149dBm/Hz (== 7.1nV/rtHz if I math'd correctly...), and the instrumentation amp has an input voltage noise of 3.2 nV/rtHz. The gain is set fixed at 5. My question is, since the DAC is outputting DC voltages, what "bandwidth" do you use if you want to calculate the Vrms noise of the circuit? AI: If you only have DC, then you're not allowed to change it. Ever. As soon as you change it, you have a bandwidth that corresponds to the rate that you want to keep up with that change. Also, your bandwidth may include whatever frequencies you're likely to detect as unwanted noise, even if all you want is a solid reference.
H: Transfer function of an op-amp circuit Let's suppose the following circuit: I am trying to find a relation between Vs, V1 and V2 in this circuit. Please note that Vs is measured in relation to ground. I have declared some extra points (A,B,C) on the circuit and using voltage divider laws and the properties of an ideal operational amplifier I came up with the following solution: Is this correct? Another solution with a different result is the following: I am really confused. AI: Voltage division isn't a great approach to hang this on. Just build the output from the bottom up. You just need to know that current doesn't enter the input terminals of an op amp. You know Vc, so you know the current through R3. That has to be the same as the current through R4, so now you know Vb. You also know Va, so now you can calculate current through R2, which has to be the same as the current through R1, which would give you Vs. Looks a little like the input stage of an instrumentation amplifier,but there's an extra resistor. CORRECTION This is a two op-amp instrumentation amplifier. Full discussion of the circuit at http://www.analog.com/static/imported-files/design_handbooks/5812756674312778737Complete_In_Amp.pdf on page 2-4. -- though the resistor numbers and inputs are not quite the same as what you use Taking a shot at your derivation, starting from the line i2=i1=V2/R3, lets have a go at it $$ V_B = V_2 + i_2R_4 = V_2 + \frac{V_2R_4}{R_3} $$ $$ = V_2 \left ( 1+ \frac {R_4}{R_3} \right ) $$ $$ i_3 = \frac{V_A-V_B}{R_2} = \frac{V_1 - V_2 \left ( 1 + \frac{R_4}{R_3} \right )}{R_2}$$ $$V_S= V_1 + i_4 R_1 =V_1 + \frac{V_1R_1}{R_2} - V_2 \frac{R_1}{R_2} \left ( 1+ \frac{R_4}{R_3}\right )$$ or just shifting to make this look a bit more differential: $$ V_S = V_1 \left ( 1 + \frac{R_1}{R_2} \right ) - V_2 \frac{R_1}{R_2} \left ( 1 + \frac{R_4}{R_3} \right )$$ That's a quick pass, and something feels wrong. Feel free to correct.
H: Would adding an LED to a multimeter's LCD screen affect readings? I purchased a TekPower TP4000ZC multimeter, which has no backlight for the LCD. I wish to add one myself, perhaps a single led at low current, driven directly off of the two AA batteries. I'll add a small toggle switch as well for saving the battery. I'm wondering if there's any reason not to do so. Could this end up altering a reading? I know the multimeter has to accommodate a battery that diminishes in power anyway, so I'm assuming the small drop won't be an issue. However I'm worried there may be something I'm not considering, as multimeters measure several parameters with high sensitivity and have many components in close proximity. I could see some sort of tiny EMF or other phenomenon occurring right next to a component and changing a reading, making this a waste of time. AI: I wouldn't expect that adding an LED would affect the meter's accuracy. However, I would suggest trying the LED backlight idea first, in a temporary fashion, to make sure that you can really add an effective backlight. If the display was not designed to have a backlight, it may not be possible to add one.
H: Instrumentation amplifier: resistor to ground for input bias current? I've inherited an RF amplifier design (50MHz-1GHz) that uses an instrumentation amplifier to accept a DC voltage control signal. Neither myself nor my PI can explain why R8 and R18 are present. My guesses follow. R8: Reading the spec sheet of related amplifiers, they say that the input bias current must have a DC path to ground for the amplifier to not float / saturate. This doesn't seem to be the case here: the input is just a coax cable with a DC control voltage on it. I think I'd need the 10k if I had a thermocouple, or transformer. But here it seems unnecessary, and makes the input impedance much lower. R18: Why would you want your opamp to be referenced slightly above ground? Is this to compensate somehow for the offset voltage (which is 500uV max)? I'm tempted to remove both to save PCB space, but this is a working design so I'm hesitant to make a change based on ignorance. Thanks! AI: R8 and R18 serve an important function. They guarantee a zero volt input when the input coax isn't connected to anything. Without them, the inputs would float to unspecified (and probably unpleasant) levels. They do not try to reference the input measurably above ground. The INA111 has input bias currents of about 20 pA, so there is really no IR drop there. R18 is not zero, just in case the cable is connected to a system with a ground slightly different than the INA111. Without it, such a connection could conceivably produce nasty ground loop currents.
H: transistor voltage always on I've purchased this kit: https://www.adafruit.com/product/1687 I've been using this as a reference: http://www.ti.com/lit/ds/symlink/sn754410.pdf I'm trying to power a DC motor from the kit and am having some issues. I've connected ~5v input to vcc2 and 5v to vcc1 (as instructed - vcc1 connects to en 1/2 and en 3/4). When I measure the voltage between either of these two and the ground, I get 4.8v (close enough to 5?) When I then measure the voltage between 1a/ground or 4a/ground (the input pins) I get a voltage of ~0.66v. If I measure the voltage between 2a/ground or 3a/ground I get ~1v. If I disconnect vcc1 (and as such en 1/2 and 3/4) the voltage drops on these. My issue is this, since 2a/3a voltage is above the max for low input, the 2y/3y pin is always set to high. I'm struggling to understand this a little - have I screwed up something, or is this functioning correctly? I had to assemble the kit myself, I've double checked all the soldering, and as far as I can tell nothing is wrong. AI: If I'm correct, you've assembled the board and connected power, but have not connected the board to a controller, and the inputs are not connected to anything, right? Under these circumstances, this circuit topology will in fact, treat these unconnected inputs as high. Simply ground all your inputs (except the enables, which you have correctly tied to +5). You should see all outputs go to 0 volts (or maybe a few tenths of a volt).
H: DSO Screen Refresh - Start position I just picked up my first DSO Oscilloscope, A Siglent SDS1052DL. I have never used an Oscilloscope, so I am trying to learn the basics. I have the following square wave, which drifts during the screen refresh. I know there is a way to set the start position but I can't find it in the scopes directions. I may not be looking in the correct place for it either. Is this called the Video Trigger? If not, what is it called and perhaps some hints on how I can set it? AI: The word you are looking for is "trigger". The trigger system on a scope can seem fairly complex to a beginner. The trigger system has several controls: Trigger source: Channel 1, Channel 2, External, Line (AC power line) Trigger mode: Auto (sweeps runs without a trigger of none available), Normal (sweep only with trigger), Single Sweep (run once on trigger, must be reset for another sweep) Trigger type: rising edge, falling edge, TV (Analog TV sync) Trigger Level: a pot to set the voltage at which a trigger occurs. Usually, on digital scopes, an icon will appear on one side of the screen to indicate the trigger level. Digital scopes may allow you to set the trigger point to be near the left or right side of the screen, or in the center (pre-trigger or post-trigger).
H: Can I feed lower than rated voltage? I'm poking around on eBay for some capacitors to use in circuits which I'm working on and see that they have a rated voltage. After some quick research, I found that going over the rated voltage of a component can cause harm and/or destroy it. Does the same happen if I go under it? My circuit runs on a 1.5V battery and the cheap (xD) capacitors I was looking at have a rating of 50V and 16V. Will this affect my circuit in anyway, as I am running like 58.5V less through them? AI: It depends on the component what a rating means. Some voltage ratings are such that you should supply the device only the rated voltage (+/- some tolerance). Examples of these are most IC's/complete devices, which won't work properly when given too little voltage, and can be damaged if given too much voltage (not to say that too low voltage can't damage the device, or too high a voltage will allow a device to work properly). Others are a simple max bound. Any voltage below the rated voltage is fine. This is the category capacitors fall into. The higher the limit, the better. So both the 50V and 16V capacitors will work just fine with a 1.5V battery. However, only the 50V capacitor will still work if you decide to hook up a 24V battery.
H: cannot fix: warning signal clk IBUF has no load please help! I have been trying to design a simple Hardware design to controll another board that powers a set of LEDs for a stage drum lighting system. I cannot for the life of me figure out why I am recieving these warnings In short what I am trying to do here is create a design that switches the lights color each time the Base drum (BaseBeat) is hit, with a maximum transition time of 1 light change a second (I am using a 50Mhz clock so I used a counter qtemp to count up and then reset after the BaseBeat is pressed) I have tested both the TB and the design on my Spartan3e but nothing happens (when I remove anything to do with the clock and the one second transition limit it works). Also so far I have taken one course on VHDL and FPGA design, I will be taking more this spring, but I hope to have this working so I can set up the light system earlier. these are the warnings WARNING:Xst:646 - Signal is assigned but never used. This unconnected signal will be trimmed during the optimization process. WARNING:PhysDesignRules:367 - The signal is incomplete. The signal does not drive any load pins in the design. WARNING:Par:288 - The signal clk_IBUF has no load. PAR will not attempt to route this signal. WARNING:Par:283 - There are 1 loadless signals in this design. This design will cause Bitgen to issue DRC warnings. (the next_color warning does not seem to be my major problem, although I could be wrong) Here is my code: entity LEDcontroller is port( BaseBeat: in STD_LOGIC; output,ON_BOARD_LED_output: out STD_LOGIC_VECTOR(2 downto 0); color_scheme: in STD_LOGIC_VECTOR(1 downto 0); ON_BOARD_LED_color_scheme: out STD_LOGIC_VECTOR(1 downto 0); ON_BOARD_LED_BaseBeat: out STD_LOGIC; ON_BOARD_LED_ONEsec_flag: out STD_LOGIC; clk : in STD_LOGIC); end LEDcontroller; architecture controller_behavior of LEDcontroller is type color_type is (RED, YELLOW, GREEN, TURQOISE, BLUE, PINK, WHITE, OFF); signal current_color: color_type := OFF; signal next_color: color_type := OFF; signal outputTEMP: STD_LOGIC_VECTOR(2 downto 0); -- default is off signal qtemp: STD_LOGIC_VECTOR(24 downto 0); signal ONEsec_flag: STD_LOGIC; begin process(clk) begin if (clk'event and clk='1') then qtemp <= qtemp + 1; end if; end process; sequence: process(current_color,color_scheme) begin if (color_scheme = "00") then case current_color is when RED => next_color <= GREEN; when GREEN => next_color <= BLUE; when BLUE => next_color <= RED; when OTHERS => next_color <= RED; end case; elsif (color_scheme = "01") then case current_color is when RED => next_color <= YELLOW; when YELLOW => next_color <= GREEN; when GREEN => next_color <= TURQOISE; when TURQOISE => next_color <= BLUE; when BLUE => next_color <= PINK; when PINK => next_color <= RED; when OTHERS => next_color <= RED; end case; elsif (color_scheme = "10") then case current_color is when RED => next_color <= PINK; when PINK => next_color <= BLUE; when BLUE => next_color <= TURQOISE; when TURQOISE => next_color <= GREEN; when GREEN => next_color <= YELLOW; when YELLOW => next_color <= RED; when OTHERS => next_color <= RED; end case; else case current_color is when RED => next_color <= BLUE; when BLUE => next_color <= GREEN; when GREEN => next_color <= WHITE; when WHITE => next_color <= RED; when OTHERS => next_color <= RED; end case; end if; end process; transition: process(BaseBeat,qtemp) begin if (qtemp = "10111110101111000010000000") then ONEsec_flag <= '1'; end if; if (BaseBeat'event and BaseBeat = '1') and (ONEsec_flag='1') then current_color <= next_color; ONEsec_flag <= '0'; else current_color <= current_color; end if; end process; control: process(current_color) begin case current_color is -- main colors when RED => outputTEMP <= "110"; when GREEN => outputTEMP <= "101"; when BLUE => outputTEMP <= "011"; --extended colors when YELLOW => outputTEMP <= "100"; when TURQOISE => outputTEMP <= "001"; when PINK => outputTEMP <= "010"; --all or nothing when WHITE => outputTEMP <= "000"; when OTHERS => outputTEMP <= "111"; end case; end process; --components --main outputs output <= outputTEMP; -- on board led outputs ON_BOARD_LED_output <= outputTEMP; ON_BOARD_LED_color_scheme <= color_scheme; ON_BOARD_LED_BaseBeat <= BaseBeat; ON_BOARD_LED_ONEsec_flag<=ONEsec_flag; end controller_behavior; and my UCF: # Clocks NET "clk" LOC = " B8 " ;#Bank = 0, Signal name = MCLK # Pin assignment for LEDs NET "ON_BOARD_LED_output" LOC = "G1" ; # Bank = 3, Signal name = LD7 NET "ON_BOARD_LED_output" LOC = "P4" ; # Bank = 2, Signal name = LD6 NET "ON_BOARD_LED_output" LOC = "N4" ; # Bank = 2, Signal name = LD5 NET "ON_BOARD_LED_BaseBeat" LOC = "P6" ; # Bank = 2, Signal name = LD3 NET "ON_BOARD_LED_color_scheme" LOC = "M11" ; # Bank = 2, Signal name = LD1 NET "ON_BOARD_LED_color_scheme" LOC = "M5" ; # Bank = 2, Signal name = LD0 NET "ON_BOARD_LED_ONEsec_flag" LOC = "P7" ; # Bank = 2, Signal name = LD5 NET "color_scheme" LOC = "L3"; # Bank = 3, Signal name = SW1 NET "color_scheme" LOC = "P11"; # Bank = 2, Signal name = SW0 NET "BaseBeat" LOC = "A7"; # Bank = 1, Signal name = BTN3 # Loop Back only tested signals #NET "BaseBeat" LOC = "C6" | DRIVE = 2 | PULLUP ; # Bank = 1, Signal name = JA1 NET "output" LOC = "B6" | DRIVE = 2 | PULLUP ; # Bank = 1, Signal name = JA2 NET "output" LOC = "C5" | DRIVE = 2 | PULLUP ; # Bank = 1, Signal name = JA3 NET "output" LOC = "B7" | DRIVE = 2 | PULLUP ; # Bank = 1, Signal name = JA4 #NET "BaseBeat" CLOCK_DEDICATED_ROUTE = FALSE; Sorry that this is long, please help me though if you are able to, I have given myself several headaches reading my book and searching the forums all to no avail. Thanks in advance, Scott EDIT: in response to my own comment to @Paebbels' suggestions @Paebbels I do have a new issue now, even after a second has passed the transition does not always occur when BaseBeat is pressed. When I hold BaseBeat down for a long time, the lights start transiting every second, but when I quickly press them even after a second it does not always transition, only some times. Oddly enough, if I press the BaseBeat for say 1/2 a second it doesn't always transition either? (I thought it may have something to do with rising_edg(clk) and BaseBeat not occurring at the same time, but rising_edg(clk) occurs 25M times in half a second..) Thanks again I altered the suggested statement: ONEsec_flag <= '1' when (qtemp = 49999999) else '0'; to be: process(clk) begin if rising_edge(clk) then if (qtemp = 49999999) then ONEsec_flag <= '1'; elsif (BaseBeat='1') then ONEsec_flag <= '0'; else ONEsec_flag <= ONEsec_flag; end if; end if; end process; Is this good design practice? it seems to be working now (it transitions after a second regardless of how long or fast I press the BaseBeat) and I think I made it synchronous, at least within my understanding of synchronous. Thanks for all the help guys, especially you @Paebbels! have a Happy New Year! AI: Some hints for and questions to your code: signal nextColor should not have a default value, because it's not mapped to a register signal nextColor : color_type; signal qtemp misses a default value: it's a counter/mapped to a register secondly, this signal represents a counter and it's used in arithmetic calculations. So qtemp should be of type (un)signed or integer/natural. Doing artithmetic calculations on std_logic_vector is not a recommended style. signal qtemp : unsigned(24 downto 0) := (others => '0'); qtemp should also be reset to 0 after 1 second passed by (as David Koontz wrote in the comment below) if you change the type of qtemp you can rewrite the test (qtemp = "10111110101111000010000000") to (qtemp = 50000000) Actually, it should be 49,999,999, because your counter starts at 0. ONEsec_flag is asynchronous set and synchronous reset -> try to write full synchronous design. line if (BaseBeat'event and BaseBeat = '1') and (ONEsec_flag='1') then can and will cause several problems: BaseBeat is no clock signal, but you are using this signal as a clock. A better solution would be to use BaseBeat as an (clock)enable signal. writing a rising edge condition and a clock enable in one line is no good style. Additionally it can cause synthesis tools to infer wrong hardware. In combination with your else-statement this code will not be synthesizable. Here is a solution: calculating the flag (concurrent statement): ONEsec_flag <= '1' when (qtemp = 49999999) else '0'; -- ternary operator like ?: in C transition process: transition: process(clk) begin if rising_edge(clk) then -- synchronous design using the main clock if (BaseBeat = '1') then -- using BaseBeat as an clock enable if (ONEsec_flag='1') then -- using flag as an write enable (second ce) current_color <= next_color; end if; end if; end if; end process; So now, flag is calculated concurrently, it can be used to reset the second timer, otherwise a 25 bit vector will overflow after 2^25 cycles, that are 33554432: process(clk) begin if (clk'event and clk='1') then if (ONEsec_flag = '1') then -- synchronous reset if one second is reached qtemp <= (others => '0'); else qtemp <= qtemp + 1; end if; end if; end process; this leads us to another problem: your counter signal has insufficient bits to hold 49,999,999 -> you need at least 26 bits the UCF file has several errors: NET "clk" ... has another signal name in comment one signal can not have multiple locations ON_BOARD_LED_output is a vector, so you should access each bit by using netname<index> and assign a location for each bit. NET "ON_BOARD_LED_output<2>" LOC = "G1" ; # Bank = 3, Signal name = LD7 NET "ON_BOARD_LED_output<1>" LOC = "P4" ; # Bank = 2, Signal name = LD6 NET "ON_BOARD_LED_output<0>" LOC = "N4" ; # Bank = 2, Signal name = LD5 NET "output" ...: Why have you enabled internal pullup resistors (inside the IOB)? Most development boards have them externally. and why are you limiting the current to 2 mA (DRIVE = 2)? All pins have no assigned IOSTANDARD: This is needed for a proper timing analysis. If you want to switch to newer FPGAs and tools, it's then absolutely necessary to declare an IOSTANDARD
H: Antenna efficiency and PCB impact I'm trying to improve the range on my 433 MHz radios and came across http://www.att.com/edo/en_US/pdf/AntennaFundamentals.pdf. (Geez, there's so much RF information in many bits and pieces, if only there were a more complete source somewhere) Section 3.2 talks about antenna efficiency and defines it to be the amount of power that is radiated by the antenna (excluding the reflections to the signal source and the power absorbed by nearby objects). Is this the reason why most PCB designs put the antenna at a corner of the board? So that less of the power will be absorbed by the board? The reason why I ask this is that our current board does something like this: My initial thought is that the power absorbed by the board is directional. Or in other words, the size optimization that we did by putting the antenna directly behind the board should not affect the antenna efficiency in the directions away from the board. Does this theory make sense? If so, why does everyone isolate their antenna? Is it just for a more omnidirectional radiation pattern? AI: Putting the antenna behind the board affects its performance. Your board seems to contain a ground plane directly below the antenna, this can also adversely affect its performance, the ground plane in this case stops part of the signal from reaching the antenna. The board size and layout also affects the antenna performance. If I am not mistaken, you have a monopole antenna from Lynx technologies (Or Laird, or Antenna Factor, same company), This antenna requires large (>10cm) ground for optimal performance. If you can rotate the jack 90 degrees counter clockwise, you might get a significant improvement in reception range.
H: How a zener and a schottky diodes protect laser diode? I purchased a strain relief wire SR9C which has a small protection circuit for a laser diode. It says to contain a zener and a schottky diodes which protect the laser diode from ESD. By looking at the PCB board, I drew the following circuit (hopefully correct): Also, I managed to recognize the schottky barrier BAT54 - L4, however, I do not know what's the zener diode part is, though it says that it is a 3.3V one. Could someone explain me the function of each of the diodes in the circuit and what kind of protection they provide and to what extent. The detailed answer would be greatly appreciated. AI: Due to the Schottky's low forward voltage drop, any (positive) ESD on the left side of your diagram will cause the Schottky to be forward biased, preventing back biasing of the LD. The Zener will clamp the forward voltage of the the LD to the Zener's breakdown voltage, in this case 3.3V, preventing over voltage across the LD.
H: Where to find the data sheet for Huawei Honor 6 smartphone? The smartphone seems to have bq24190 chip for power and charging control (according to /sys/), for which the data sheet specifies that it can be powered not only from USB's 5V, but also from up to 18V. Does it mean I can charge my Huawer Honor 6 directly from 12V? Where to find the absolute maximum ratings for a smartphone? AI: There is no such thing like "datasheet for phone". Phone is consumer electronics. Consumer doesn't have to know all these things. All you can/should get from manufacturer is manual (that usually says: "use original battery charger"). I would not recommend trying to power phone from 12V even if you are sure that there is BQ24190 chip, because you don't know what else is there. Maybe some zener diode that will blow up without any other damage, maybe some extra ESD protection designed for 5V and you will destroy whole ESD circuitry).
H: What is the best suggested way to amplify the voltage and ampere of a signal coming out of a microcontroller and keep wave form as it is? I am generating semi-pure sine wave voltage signal out of an AVR microcontroller. The thing is I want to amplify this signal (power amplification [voltage and current]) with keeping wave form as source (as it is produced from the AVR pin) considering the best way to do it without damaging the microcontroller And without that much complexity of the circuit to be designed and implemented. The circuit should be supplying about (2500 watt in output [desired output voltage is 220 volts] and the frequency is about 50HZ ) The input is supposed to be varying between (0-5 volts and about 20 milli ampere) I've seen many designs on the web, mostly about RF amplification circuits. I need advice about this certain situation mentioned above. Any help, or reference source or contribution would be appreciated. AI: Now that you've specified that you want 220 V at 2.5 kW out, it sheds a whole different light on the question. A simple opamp isn't going to do it. What you want is something called a "inverter". These are devices intended to produce AC power from DC. Note that somehow you still have to supply DC at over 2.5 kW as input, regardless of what topology you use. What the available input voltage is will make a significant difference to the topology. Another thing to look at are high-power class D amplifiers. At this voltage and power level, inverters and class D amplifiers won't be all that different. Inverters are for a specific known frequency, so can be more targeted to that frequency, whereas class D amplifiers have to handle a range of frequencies. Either way, messing with this voltage and power level is NOT for beginners. If you have to ask here, you should start with something simpler and less dangerous to learn on. By the time you're ready to take on designing something like this yourself, you won't need to ask here.
H: Simplest possible 5V to +/- 10-15V converter (for op-amps) Im looking for simplest possible solution to power op-amps from USB or phone charger. Requirements: +5V input voltage ±10V to ±15V output voltage at least 10mA output current on both rails (+/-) very low cost low part count simple and accessible parts (no specialized ICs) low noise and ripple would be nice (small and cheap linear regulators at output allowed) Is this possible without a transformer, when I need no separation and I don't care about GND shift relatively to USB GND? AI: (comments got a bit long!) It is generally possible to create your own switch mode boost converter with varying levels of functionality. Any boost converter switches an inductor to ground with a FET to produce a higher voltage waveform. This can be rectified and smoothed to produce the higher voltage. All chip type boost converters take this output and feed it back so they can adjust the PWM switching waveform to keep the output stable. The following circuit is take from an Adafruit note and shows the concept: The adafruit note isn't concerned with absolute output stability, only a range of output voltages at a pretty static output current and input voltage. It has no feedback so is only approximate. However, with a small range of output currents, a linear regulator can take up the slack here. Inversion can be done by utilising the higher voltage PWM waveform, present at the inductor-fet-diode node and feeding it to a capacitor-diode charge pump. The wave at the node is put through a capacitor. The other side of the capacitor is diode clamped to ground, thus shifting the waveform negative. This image, pulled somewhat randomly from google images, shows the idea: In this case, this circuit is generating gnd to +Vcc transitions which are then inverted by the capacitor and two diodes. The output is smoothed and then zener regulated. The combined concept (ie: the PWM input to the FET is "someone else's problem!) might look like this: For opamp use, it would be recommended to filter the switching waveform through a PI inductor filter before feeding it to the linear regulators. Edit: I asked a question about this inversion tactic on stackexchange a short while ago which may also be relevant: Inverting charge pump with boost converter loading characteristics
H: Output capabilities of super capacitor I have come across a question that is very near and dear to my heart and I am in the hopes that somebody can answer this new years eve question of mine per se. So I am wondering, if I were to run two 2.7V 360F super capacitors in parallel and attach them to a 5V step-up regulator, could I supply 500mA @5V (or very close to 5V) for about 2 hours? I did some math from equations that I found online and I was wondering if the above question is plausible based off of the values stated above. AI: The energy in a capacitor is $$ E = \frac{1}{2}CV^2 $$ So at 2.7 V in two capacitors, you would have $$ E = 2\:\text{capacitors} \cdot \frac{1}{2} \cdot 360\:\mathrm F \cdot (2.7\:\mathrm V)^2 = 2624.4 \:\text{joules} $$ The amount of energy you are taking per second is $$ 0.5\:\mathrm A \cdot 5\:\mathrm V = 2.5\:\mathrm{J/s} $$ So, in a perfect capacitor with a perfect power supply, you could run this for $$ \frac{2624.4\:\mathrm J}{2.5\:\mathrm{J/s}} = 1049.76\:\mathrm s = 17.496 \:\text{minutes} $$ Note, that this is only with a perfect capacitor. Supercaps tend to have a high series resistance that loses energy. In addition, the regulator has an efficiency that will vary according to the input, likely going down in various ranges, and certainly not really going to 0 Volts. This means you will have to have the amount of energy to maintain the minimum voltage, and add to it the amount you actually consume for the time you want. To run a 5 V power supply with 90% efficiency at 0.5 A for 2 hours, or 7200 seconds requires a specific amount of energy to the input of the power supply: $$ 5 V \cdot 0.5 A \cdot 7200 s \cdot \frac{1}{0.90} = 20000 J$$ Note that the 90% efficiency effectively increases the amount of energy needed. In addition, power supplies typically won't run down to 0 V. So there must be extra energy to handle the amount that is never discharged. We'll call the minimum voltage Vmin. $$ E_{required} = E_{@Vmax} - E_{@Vmin} = \frac{CV_{max}^2}{2} - \frac{CV_{min}^2}{2}$$ $$ E_{required} = \frac{C}{2} \cdot (V_{max}^2 - V_{min}^2 )$$ So for a Vmax = 2.7 V and a Vmin = 0.5V $$ 20000 J = \frac{C}{2} \cdot (7.04 V^2)$$ $$ C = \frac {20000 J \cdot 2}{7.04} = 5681.8 F$$ This could be one huge capacitor or many smaller adding up in parallel. However, note that I haven't considered any losses due to series resistance. That just adds on the total capacitance needed, but by using multiple parallel capacitors, you tend to reduce the effective resistance as you are putting them in parallel.
H: Using BJT transistor as switch using arduino digital pin I was working on a project and decided to use a BJT transistor as a switch. I haven't taken the electronic circuit courses which deal with transistors in my university yet so I wanted some advice if my idea is feasible or not. Basically, I have an actual switch (Pololu Pushbutton Power Switch SV) that will control when my project will be turned on and off. But my device will be hooked onto a bike so I made it so that if an RFID tag is properly read (via an RFID reader), my BJT (which is in series with the battery source and the pololu switch; please see google doc for schematic) will be allowed to conduct current across it, hence powering the device. When the RFID tag is properly read, I will set a digital pin to HIGH (this pin is connected to the base of the BJT transistor) which will allow the current from the battery to flow across the BJT and power the the device. Will 40 mA delivered to the base be enough for current to flow across the BJT? Here is my circuit diagram I have quickly drawn (it's located in a google doc folder): https://docs.google.com/document/d/1H8ES5edi69eQtyavTgFldQ_BlMkgLi44-MLGMWAWi6Y/edit?usp=sharing Thank you for anyone who comments and please don't hesitate to ask me for more info! Since I have been researching BJT transistors on google, my knowledge on them is not concrete so please forgive me if I have some silly/stupid assumptions or I am totally doing this the wrong way. As requested, here is the switch: http://www.pololu.com/product/750 Just some back ground for you guys on why I am doing this. This is so if someone tries to attempt to close the device when it should be operating, the device will still be operating since the digital pin is HIGH and current is still flowing accross the BJT transistor hence allowing the device to be still powered up. If the user wants to shut the BJT off, just swipe the correct RFID tag again and this will cause the digital pin to become LOW which will cause the BJT to stop the flow of current. AI: Your circuit should look something like this: simulate this circuit – Schematic created using CircuitLab A high output from the Arduino will turn on Q2 which will pull Q1's base low, turning it on as well. Q1 should be selected to handle the current required by your device. You should also have a resistor between Q1's base and emitter to be sure it turns off when Q2 turns off.
H: What are the rules for combining transistors to form digital circuits? I just read Harris/Harris - Digital Design and Computer Architecture and in it they described how AND/OR/etc gates are made out of transistors. I read the book for fun (I'm not an EE person, my experience with circuit analysis is minimal) so while I can understand how their circuits work to make the specified gate, I'd like to be able to make my own as an exercise. In my mind I picture that a NOT gate should be as simple as the input connected to the gate and the output connected to the drain of a P type transistor. It "defaults" to on and when voltage goes up on the gate it cuts off the voltage in the drain. But the book illustrates both a P and N type in series, with the input connected to both gates, and with the output between the drain of the P and the source of the N. So that makes me think that there are some rules about what the gate, source, and drain can be connected to in order to have a working transistor. So is there any general/simple set of rules for beginners on how to connect transistors into working combinational logic units? I'd like to do this as an activity with someone who knows almost nothing about circuit design (no knowledge of KVL/KCL etc) and as I won't be designing any actual circuits I'd rather avoid studying hard on circuit analysis. Can it be boiled down into a list of rules that I could explain to, say, my grandmother? AI: In my mind I picture that a NOT gate should be as simple as the input connected to the gate and the output connected to the drain of a P type transistor. It "defaults" to on and when voltage goes up on the gate it cuts off the voltage in the drain. But the book illustrates both a P and N type in series, with the input connected to both gates, and with the output between the drain of the P and the source of the N. So that makes me think that there are some rules about what the gate, source, and drain can be connected to in order to have a working transistor. In your mind you aren't making the distinction between LOW and Not Connected. When your theoretical arrangement is "HIGH" (its "default") state, the output is connected to Vcc. When there is a high enough voltage on the base, the transistor switches off. What is the output connected to then? Nothing at all. It's actually in an indeterminate state, also known as HiZ, or High Impedance. This is one of the three states of Tri-State logic. The logic "LOW" level doesn't mean "disconnected from Vcc" but instead "connected to GND". You have to have some mechanism for the output to be connected to the ground rail in order for it to sink current and literally be "a low voltage". What you describe is basically the inverse of the common "open collector" logic gate: simulate this circuit – Schematic created using CircuitLab For the logic to make any sense at all an external pull-up resistor to Vcc is required to set the default logic level for the output when the transistor is turned off. If you were to move the resistor to the inside of the logic gate (the dotted line) then you have what is called RTL - Resistor Transistor Logic. This is perhaps the easiest logic to understand, since the output is either being linked to ground by the action of the transistors, or is being defaulted to connected to Vcc by the resistor. However, it's not a particularly efficient system. Far better would be an arrangement whereby you can switch the output between being directly connected to the Vcc or directly connected to GND so you don't drop voltage or waste power over the resistor. Something like a two-way switch: simulate this circuit And that's why the totem-pole, or Push Pull arrangement, was born. Two transistors, one connecting the output to Vcc, and one to GND, and only one of them is on at a time. By using a P type to Vcc and an N type to GND you need nothing else to control them since they are naturally the inverse of each other: simulate this circuit When D is at a LOW voltage the PNP transistor is turned on, so !Q is connected to Vcc. When D goes to a high enough voltage the PNP turns off and the NPN turns on. Thus, !Q is then connected to GND. There is usually a "dead" zone between one transistor turning off and the other turning on. This both prevents shoot-through (where both transistors are on at once thus causing a short circuit) and also acts as a noise margin, which you don't get with RTL. For instance, take the following little chart: Red is where the input voltage is considered to be off, green where it is considered to be on, and yellow is indeterminate. With RTL, if you put in a voltage at or around the switching point, say 0.7V, then what state will it be in? Will it be HIGH or will it be LOW? The slightest noise on the line will make it flip between HIGH and LOW. Not very good really. With TTL the output would switch between LOW and HiZ, and capacitance on the line or other places in that part of the circuit would keep the next stage gate at the same state for a while, effectively destroying the noise. This is especially good when the transistors are MOSFETs (i.e., CMOS logic) since the gates act just like small capacitors and hold their charge for a while unless specifically charged or discharged by connection to Vcc (through an output's P-channel MOSFET) or to GND (through an output's N-channel MOSFET).
H: Burned out filament but the light bulb has small resistance The light bulb shown below is from a Christmas tree light string. The string is made up of series connected light bulbs. However if one burns out, the other bulbs keep working. Taking out the bulb from its socket makes all the others in series with it to stop working. The picture doesn't show it very clearly, but the filament is broken in two. However, when I used my multimeter to check the resistance across this bulb it showed me about 1.5 ohms which explains the behaviour (all the other series bulbs still lighting). My question is: what is the working principle of this bulb? I guess is that they use a parallel resistor connected (see the winding wire inside bulb, left to the filament in the picture). But if this resistor is only 1.5 ohms, how does the bulb lights up? Assuming equal resistances, each light bulb gets about 7 V AC. Imagine how much current would draw that 1.5 ohms "resistor" alone... AI: These bulbs contain a shunt wire which is normally insulated from the bulb but closes when a high voltage is applied. From How Stuff Works: You can also see the wire in your image, below the burned out filament. The shunt wire is coated in an insulation with a low breakdown voltage. When a bulb burns out, the other bulbs look like wires (especially after they cool and their resistance decreases) and the burnt bulb looks like an open circuit, thus nearly the full supply voltage (110 or 220 VAC) appears across the broken bulb. This arcs through the shunt wire's insulation, destroying the insulation, allowing the shunt wire to short out the bulb, allowing the string to continue working. simulate this circuit – Schematic created using CircuitLab This is an example of an antifuse. An ordinary fuse starts with a low resistance, and converts to a high resistance above a certain current threshold. An antifuse does the opposite in every respect: it starts with a high resistance, and converts to a low resistance above a certain voltage threshold. The two could be considered electrical duals. Those Christmas light fixers that look like guns generate a high voltage spike which can help a failed antifuse work. They very briefly generate a voltage higher than mains voltage (not unlike a camera flash) which can help the antifuse do its thing if mains voltage isn't enough to break down the insulation.
H: The right vocabulary for everything related to booting a µC and loading a program The more I learn about all the steps required for bringing a µC to the phase of finally executing the program, the more I get the impression that there is no "golden path". It seems to me that the exact steps required are different from project to project. In general, following steps are required for execution of a normal bare-metal C program on a common 32bit µC like the ARM Cortex-M3: Clock must be configured. (Internal, external clock, prescalers and so on) Stack pointer must be initialized. .data region must be initialized with the right values. .bss region must be zeroed. Code to be executed must be in the memory range it was linked into. My question: Which of the steps above are done by the loader? Which are done by a boot-loader such as U-Boot? What's the difference of a boot loader to a normal loader? When I use U-Boot, it can copy the program (.text and .data) from ROM or even network to RAM and execute it from there. Does that mean that U-Boot is loading my program? What about .bss, it still has to be set up. If my program zeroes-out .bss myself, does that mean that my project is partly loaded by U-Boot and partly self-loading? There might also be projects which can run from ROM and don't have any global variables. (Hence, no .bss and .data) Is the wording correct, that such a program dosn't require any loading? AI: Ok, let's first define some terms and the differences between them. Bootloader This is a small program coded into the chip's Flash or PROM. Its purpose is to allow you to install a program from outside into the Flash or other internal storage. Apart from that it is usually completely passive and doesn't affect your running program in any way. Loader This is a small program coded into the chip's Flash or PROM. It is usually installed using the bootloader originally if one exists, or it can take the place of a bootloader and also perform the functions associated with that. It's main function is to load a program from some storage medium - be that flash, SD card, or whatever - and execute it. It often also provides some IO facilities, such as routines for accessing the console. Loaders also often provide a configuration environment with NVRAM (often just a block of Flash) for storing system settings. As you can see a loader is far more complex than a bootloader. So they are just both concerned with getting your program into the right place, be that into Flash or RAM, depending on a) how your program is written, and b) what your system is designed to do. That is the "loading" phase of the program. With the bootloader the "loading" is done once by you when you burn your program into the chip. With the loader it is done every time at reset (if needed). Then control is transferred to your program - be that in RAM (with the loader) or Flash (with either the loader or the bootloader). From then on everything else that happens is purely down to what your program does. If you happened to write your program in C, then you will have certain C conventions and C library code in place. One of those conventions is the concept of the .data, .bss, etc. C library code manages those sections for you, copying data from .rodata into .data (or wherever for your system) if you are executing from Flash, blanking .bss, etc. That routine is called "crt0", or C Run-Time stage 0, and is responsible for the initialization of your program and passing control to the main() function. If you didn't write your program in C - say you wrote it in Assembly, then what happens when control is passed to your program is entirely up to you. You might decide to have some block of RAM set aside for global variables. You may not. It's entirely up to you. So in general, once control has been passed to your program, what happens then is entirely down to your program. As for setting things like clocks and such, well, that depends entirely on the chip. Most of them have the basic clock settings stored in flash and are loaded up at power-on before anything else happens. On some chips they form part of the bootloader, on some they are separate, etc. Some chips provide a way of adjusting the clock from software, some don't. If they do, then when that would happen is anyone's guess. The bootloader may set the clock, or maybe a loader, or even your own program might set a specific clock speed. For the stack pointer, each environment in the boot sequence is a separate system in its own right. Typically the bootloader or loader would set the stack pointer for its own usage. Then when control is passed to your program the stack pointer will be re-initialized by your program to suit its own needs. Once your program executes the bootloader or loader as good as doesn't exist any more. Yes, there may be the ability to call functions based in the loader (like a PC'S BIOS calls) but the loader is no longer running as such.
H: Serial Link Between 3.3V devices I have an RPi and a freescale FRDM-KL25z controller which will talk over serial protocol. I'm using the pyserial library on the pi: import serial ser = serial.Serial('/dev/ttyAMA0', 9600) ser.write('hi FRDM') and using the serial protocol from the mbed library will generate interrupts to process the data from the Pi. https://developer.mbed.org/users/mbed_official/code/mbed/docs/4fc01daae5a5/classmbed_1_1SerialBase.html#ae67fb9b5a2ee2f4e98a39cdab10ed090 My question is, having two devices which talk over the same protocol at the same potential and in close proximity, do I need a logic level converter or some form of UART chip? I would think not, but I am aware that RS232 is a +-12V protocol so would just like to ensure that this assumption is correct. AI: If both share the same logic levels (0V-3.3V) and the same ground it shouldn't be a problem. But then you aren't using RS232, just UART. The Serial bridge on the Arduinos works the same way. The FTDI chip uses 0V-5V and the ATmega uses 0V-5V.
H: What's this symbol (capacitor with wire through the middle)? I've occasionally come across this symbol which appears to be a capacitor with a wire through the middle - but I've never seen it on anything where I could get a look at what component it corresponds with physically, and I've never seen it defined in a list of component symbols. Have a look at the first schematic here and look at the earth rail - you'll see what I mean. It has always puzzled me - can anyone shed any light? AI: If I'm looking at the correct symbol, that's a feed through capacitor. They are common on RF devices where they allow wires to enter a shielded enclosure. Looking at the picture from the link you gave here they are:
H: ADC sampling problem using FPGA I am trying to sample sinusoid signals using AD7928, which is a 1 MSPS ADC. It is connected to an Altera Cyclone V FPGA, and runs at 20 MHz master clock. Data rate is 1.25 MHz and that's due to the fact that the ADC outputs a new sample every 16 cycles. Using SignalTap Logic Analyser, I monitor the output of the ADC, and it is clocked with the same data rate frequency (1.25 MHz) to meet Nyquist criteria. Input is a 440 Khz sine signal (under Nyquist's frequency 500 KHz), however, it looks distorted in SignalTap, figure below depicts it. If I apply a higher frequency signal like 1019 KHz, it looks like a regular sinusoid signal. As I change the frequency, signal dilates and contracts. What do you think is the reason? AI: The problem is that SignalTap is not applying the correct reconstruction algorithm when displaying your waveform. Instead of using a brick-wall low-pass interpolation filter, it's simply using a zero-order hold, which turns each sample into a horizontal line segment. The sample points themselves really are proper samples of your 440 kHz sinewave. You can prove this to yourself by working it out on paper: draw several cycles of a sinewave that has a period of 2.27 µs, and then show where samples taken at 0.8 µs intervals would fall. Draw a horizontal line from each sample to where the next sample is taken, and you should end up with something that looks very much like what SignalTap is showing you.
H: This is an inductor symbol, right? This is from the PCB in a microwave oven. On the right side, there are two symbols with the labels DU and OMIF. They look like inductors. Is that correct? sidenote: this is found underneath a relay, the DU1PU. I have removed the relay. I'm guessing the components are connected to the relay pins. AI: I suspect that those symbols represent the relay coil. The board is apparently designed to use either of two types of relay - the DU1PU that you have, and an OMIF, which is slightly larger, and has the coil terminals farther from the contact terminals
H: Analyzing an op amp circuit (transfer function) that does not match the basic cases At the following circuit I want to find what it does and basically its transfer function. I've searched a lot but I didn't find any circuit like this. Since it does not match any of the basic types of op amp circuits (inverting or non-inverting amplifier) I don't know where to start from. Finally, anyone knows what's the name of this circuit? Please note that this is not homework. Following Lorenzo Donati's method I got to this point for the transfer function: AI: You can determine the transfer function \$H(s)\$ of the circuit reasoning on the following circuit: and thinking of \$V_1\$ and \$V_2\$ as two independent inputs. Since the circuit is linear superimposition applies, and the output (in the s-domain) of the circuit when \$V_2\$ is off is simply that of an inverting amplifier (\$R_3\$ shorts the non inverting input to ground, assuming an ideal op-amp): \$ V_{out1} = - \dfrac{R_2}{R_1} V_1 \$ Analogously, when \$V_1\$ is off, the circuit acts as a non-inverting amplifier whose input is filtered by the series \$C-R_3\$. Thus applying the non-inverting amp gain formula and the voltage divider formula you get: \$ V_{out2} = \left(1 + \dfrac{R_2}{R_1} \right)\dfrac{R_3}{R_3 + \frac{1}{C s}} V_2 \$ The full response is the sum of the two above: \$ V_{out} = V_{out1} + V_{out2} = - \dfrac{R_2}{R_1} V_1 + \left(1 + \dfrac{R_2}{R_1} \right)\dfrac{R_3}{R_3 + \frac{1}{C s}} V_2 \$ Your circuit is like the one I posted, but with \$V_1 = V_2\$, therefore the full response becomes: \$ V_{out} = V_{in} \cdot \left[ - \dfrac{R_2}{R_1} + \left(1 + \dfrac{R_2}{R_1} \right)\dfrac{R_3}{R_3 + \frac{1}{C s}} \right] \$ from which you get: \$ H(s) = \dfrac{V_{out}}{V_{in}} = - \dfrac{R_2}{R_1} + \left(1 + \dfrac{R_2}{R_1} \right)\dfrac{R_3}{R_3 + \frac{1}{C s}} \$ This simplifies, after a bit of algebra, into: \$H(s) = \dfrac{s - \frac{R_2}{R_1 R_3 C}}{s + \frac{1}{R_3 C}} \$ Which shows that the circuit acts as an active filter with a 1st order frequency response. Such a topology is used, for example, to create all-pass filters if \$R_2 = R_1\$. EDIT The derivation of the final form of H(s) follows: \$ H(s) = - \dfrac{R_2}{R_1} + \left(1 + \dfrac{R_2}{R_1} \right)\dfrac{R_3}{R_3 + \frac{1}{C s}} = - \dfrac{R_2}{R_1} + \dfrac{R_1 + R_2}{R_1} \dfrac{R_3 C s}{R_3 C s + 1} = \$ \$ = - \dfrac{R_2}{R_1} + \dfrac{(R_1 + R_2)R_3 C s}{R_1(R_3 C s + 1)} = \dfrac{-R_2(R_3 C s + 1) + (R_1 + R_2)R_3 C s}{R_1(R_3 C s + 1)} \$ \$ = \dfrac{-R_2 R_3 C s - R_2 + R_1 R_3 C s + R_2 R_3 C s}{R_1(R_3 C s + 1)} = \dfrac{- R_2 + R_1 R_3 C s }{R_1(R_3 C s + 1)} = \dfrac{R_1 R_3 C s - R_2 }{R_1 R_3 C s + R_1} \$ dividing numerator and denominator by \$R_1 R_3 C \$ we get: \$ H(s) = \dfrac{s - \frac{R_2}{R_1 R_3 C}}{s + \frac{R_1}{R_1 R_3 C}} = \dfrac{s - \frac{R_2}{R_1 R_3 C}}{s + \frac{1}{R_3 C}} \$
H: NPN Darlington circuit for 12V Diesel Glowplug I'm trying to build a very simple circuit to drive a glowplug. I am using a TIP122 NPN. simulate this circuit – Schematic created using CircuitLab I wanted 0.017A going through the 12V plug. I estimated no more than 0.204W. I also assumed my NPN's HFE was 1000. To find power dissipation \$12V \times 0.017A = 0.204 W\$. Calculated base current with $$Ib = \dfrac{0.017}{1000} = 0.000017A$$ $$R1 = \dfrac{4V-1.4V}{0.000017A} = 152941 \Omega$$ I hooked all this up, and the NPN got pretty hot. The glowplug started to get a little hot, probably around 100F by the time the NPN was around 200F and climbing fast. I'm very new and have been more or less dealing with NPN saturation on simple devices like LED and Fans with no issues. I have done this exact circuit with a 12V relay I pulled from a car, but I was really just experimenting here trying to learn the limitations of an NPN. AI: You are calculating this wrong. You want 0.017 A going through a 1 Ohm device, so you must put 0.017 A * 1 Ohm = 0.017 V across it. Creating that kind of current control with a non-saturated grounded emitter NPN topology is pretty difficult since the Hfe is not a tightly controlled parameter for BJTs. The correct way to do this is to put a current limiter resistor inline with the 1 Ohm device. Then when you saturate the device, according to the graph in the datasheet, the Vce(sat) at 0.1A will be about 0.6V, so you will have $$12 - 0.6V = 11.4V$$ across the pair. Ohms law says you need a resistance of $$\frac{11.4V}{0.017A} = 670 Ohms$$ 680 Ohms is a standard resistor value in that range and should give about 0.0168A in current. Now on to the calculation of the base resistor. It is typical to ensure saturation by calculating as if the Hfe = 10. This ensures that you are fully saturating the transistor. So for a collector current of 0.017 A, you want a base current of 1.7 mA. The TIP122 Vbe(sat) with a collector current of 0.1A is about 1.25V so the resistor will have 4V - 1.25V = 2.75V across it. This results in:$$\frac {2.75V}{1.7mA} ~= 1.61 kOhms$$ simulate this circuit – Schematic created using CircuitLab
H: scheduler and stack i develop my own scheduler on stm32f407 board i have different queues of tasks with different priorities and frequencies i want to mange stack operations myself when in SysTick_Handler event each 10ms where to start from in push and pop operations should i define own stack or what? any good article tutorial or example if you have??? thanks in advance.. AI: Typically each task would have its own private stack. You save and restore the stack pointer when you switch tasks in your SysTick_Handler. I also like to have a separate stack for the task switcher - basically treat that as a separate task as well - though you can use the default system stack if you wish.
H: Building a prototype rig with naked boards and wires (running 24V, 3.6 A): how to be safe? I am building a prototype rig. It includes: 1) A "naked" 24/48 V motion control evaluation board. 2) A I=3.6 A stepper motor. 3) A power supply. I wired up the motor to the board with four wires (A-, A+, B-, B+). I wired the board to the power supply: source (24 V) and ground wires. The power supply allows to set both voltage and current. I am planning to set the power supply voltage to 24 V, not sure about current. By default it's at I=0.1 A, but I guess I might need at least 1 A to activate the stepper. Now, a pessimistic assessment of the skin resistance is 500 Ohms (Wikipedia article on electric shocks). At 24 V, this would give a through current of 48 mA, causing heart fibrillation, breathing difficulties and inability to let go of the wire -- not cool. How do I play it safe? AI: There is a whole body of knowledge about how to keep from getting zapped, and I'll give you a few highlights. 1) At 24 volts, if your skin is dry you won't feel more than a tingle. Don't play with electricity in the rain and don't spit on your hands before you start trouble-shooting. Go back to the Wiki article and you'll see that the 500 ohms figure was for wet or broken skin, so don't let live wires stick into any open wounds you might have. 2) If you're seriously paranoid about getting shocked, put the circuit in a box with a switch attached to the lid, so if the lid is opened the power is turned off. 3) Poking around a live circuit is normally necessary as part of troubleshooting. First, make sure you're sitting or standing surface is dry and not conducting. Second, keep one hand in your pocket at all times. (I'm not kidding about this.) That way, you cannot make a circuit from one hand to the other. At 24 volts, this is generally unnecessary, but it's a good practice at higher voltages. 4) Never build a circuit which is directly connected to the AC power lines. Always use an isolated power supply. 5) Note that there is such thing as a "let-go threshold". When the power is on, you can poke and prod with a probe to your heart's content - just don't grab anything. Again, at 24 volts, this isn't a problem (unless you're violating rule 1 and playing in the rain), but it's still a real good policy. If you see a loose connection, or a screw that needs tightening, stop and turn off power, then fix the problem.
H: Transistor Emitting Without Collector I'm pretty new to the hardware side of electronics and am building some basic logic gates. The first Im trying is an AND gate and the problem I'm having is that whenever I power the base of the transistor it's emitting power even with no power going through the collector. Any ideas as to why? Thanks. (Am using a BC475 transistor) AI: The base-emitter junction forms a diode. If the base voltage is higher than the emitter voltage by more than about ~0.6V, current will flow even if there's nothing attached to the collector.
H: Repair (fixing back) lifted power thru hole pad + trace Attached pictures are a lifted power pad + trace of a 1000 W PSU of a commercial subwoofer. Caliper showed 0.42 mm thick, which if correct gives about 12 oz copper trace! In this particular pad was the source of a MOSFET after a rectifier bridge, transformer and capacitor bank. Pad + trace are intact, I just need to reliably fix them back to place. What are the best options? Epoxy? Maybe araldite? I am not sure if it will ever corrode copper or sensitive electronics. AI: Epoxy should be a great choice. I would tape the back of the circuit board so that the epoxy can go in the hole and self-level, put the epoxy in, and then use tape to hold the trace down. After that, you'll need to re-drill the hole for the replacement component. The existing hole was probably plated through; if it was, you will need to solder the component onto both the top and bottom traces.
H: effective voltage of a sine wave I am looking for effective voltage values for calculating power in a AC sine wave supplied circuit with a resistor under 2 conditions : full wave rectification; half wave rectification. I have searched the internet for the effective value of a half wave rectified voltage and have found nothing. I think, I have figured it out, but find puzzling the lack of this information. Effective voltage of a rectified full wave sine is Vpeak/square root of 2 Effective and RMS are the same, average voltage has no use. Effective voltage of half wave rectified sine wave is not RMS, but rather a RMS of the original sine wave /2. Or Vpeak/ 2 x square root of 2 RMS and average voltage have no use. RMS of a half wave rectified voltage is Vpeak/2 and this is not an effective voltage. What did I get right or wrong? thank you AI: Let's clarify what "effective" voltage means. First of all let's note that this is only really used to describe time-varying periodic voltages. We can imagine taking that voltage and driving across some resistor, R. Since this is a periodic wave it will on average consume some set amount of power. If we take the same resistor and drive a particular DC voltage, we will consume the same amount of power. This voltage is the Effective Voltage. It is independent of the resistor used. Different resistors will give different power consumption, but for a given periodic voltage input, the effective voltage is the same. If we go to work the problem out for determining what this effective voltage is for any wave, it effectively comes down to performing the following steps. I recommend working this out from V^2/R to understand why these steps are correct. Divide the period up into a bunch of small samples. Square the voltage value at each sample. Average up all these squared values. Take the square root of this average to get an approximation of the effective value. As you do this with more and more samples (i.e. smaller time between each sample), you approach the effective value. This sequence is called the root-mean-square, or RMS. In other words, RMS Voltage is Effective Voltage. Now, here is where people get confused. If you go and do the math, you can calculate analytically that for a sine wave $$V_{RMS} = \frac{V_{peak}}{\sqrt 2}$$ This is only true for a sine wave. For most other waves, you simply have to go do the math. However, for some waves, like a full- and half-wave rectified sine waves, you can use the definition to determine the RMS voltage more simply. For a full wave rectified wave driven across a resistor, it can be realized that a resistor doesn't care if a voltage is positive or negative, just what the magnitude is. The power is the same as a regular sine wave, therefore the RMS voltage is the same. For a half wave rectified wave driven across a resistor, again, it can be worked out that the power consumed is 1/2 of the typical sine wave. The power is 1/2 the regular sine wave, but voltages are squared to get power, so: $$\frac{P_{sine}}{P_{half}} = 2 = \frac{{V_{{RMS}_{sine}}}^2}{{V_{{RMS}_{half}}}^2}$$ which gives $$\frac{V_{{RMS}_{sine}}}{V_{{RMS}_{half}}} = \sqrt 2 => {V_{{RMS}_{half}}} = \frac{V_{{RMS}_{sine}}}{\sqrt 2} = \frac{V_{peak}}{2}$$ A bit more complicated, but it's easier than calculus.
H: xilinx create schematic of top modul with lower level moduls I have a top modul VHDL source file, which has a few instances of lower-level modules (VHDL) and signals which connects these lower-level modules. How can I generate a schematic for this? I mean, I would like to see the top module, inside it, the lower-level modules and the signals. (xilinx ise design suite 14.7) AI: Xilinx ISE 14.7: Design tab -> Synthesize - XST (expand node) -> View RTL Schematic. Alternative: menu Tools -> Schematic Viewer -> RTL... RTL Schematic (Register Transfer Logic) is the generic, hierarchical schematic in terms of combinational logic and flip-flops. The other choice is Technology Schematic, which shows how the logic maps to device-specific low-level elements such as slices and IOB.
H: Basic 12v LC Filter for Video noise reduction I'm very new to electronics and I want to build a basic LC Filter with a 12v regulator and below is my basic schematic. Now i'm sure its incorrect but I want to know why and what i'm missing so I can learn. I'm planning on using the following components: C1: http://uk.farnell.com/panasonic-electronic-components/eeefc1e471ap/cap-alu-elec-470uf-25v-smd/dp/1244366 L1: http://uk.farnell.com/coiltronics/dr73-101-r/inductor-shielded-100uh-790ma/dp/2369131?ost=2369131 The power would be provided by either 12.6v or 16.8v from a high capacity lip battery EDIT: Change of design: AI: Just to add to Andy's answer (+1 from me). I've also add a 0.1uF capacitor across the 470uF electrolytic. This is because electrolytics aren't good at filtering high frequencies. Note also where the capacitor grounds are connected. The closer to the regulator the better.
H: Eneloop rechargable batteries for mouse? I have a Apple Mighty Mouse, and I want to use rechargeable batteries, but I read somewhere on such a device I should only use Eneloop rechargeable batteries as they hold a charge when the device is not in use. Is this a correct statement? I don't understand how one battery can hold a charge when the device is not in use, and another one cannot. AI: Different types of batteries have different discharge rates when not in use due to a number of factors including type of battery, state of charge, charging current, ambient temperature and other factors (See here for more on self discharge). I previously confused ESR with self discharge, where ESR determines the maximum current the battery can provide. For more information on the characteristics of rechargeable batteries. According to the Wikipedia page on Eneloop batteries, they have a low discharge rate, making them better for items that are used infrequently. Also below is a chart that was provided to me by a professor previously that shows some of the advantages/disadvantages of different types of batteries:
H: OR to XOR algebraically If we have an OR function with two terms, like $$a \vee b$$ it can be written with only XOR like $$a \oplus b \oplus ab$$ RULE: $$a \vee b = a \oplus b \oplus ab$$ But what if we have three terms, like $$a \vee b \vee c$$ How can that be written with only XOR? What is the equivalent of the RULE above for three terms? What about four or more terms? AI: You can just add more terms the same. Starting with: $$ a \vee b = a \oplus b \oplus a{\cdot}b $$ Which has a truth table of: $$ \begin{matrix} a & b & & Q \\ \hline 0 & 0 & & 0 \\ 1 & 0 & & 1 \\ 0 & 1 & & 1 \\ 1 & 1 & & 1 \\ \end{matrix} $$ When you add c to it the truth table ends up as: $$ \begin{matrix} a & b & c & & Q \\ \hline 0 & 0 & 0 && 0\\ 1 & 0 & 0 && 1\\ 0 & 1 & 0 && 1\\ 1 & 1 & 0 && 1\\ 0 & 0 & 1 && 1\\ 1 & 0 & 1 && 1\\ 0 & 1 & 1 && 1\\ 1 & 1 & 1 && 1\\ \end{matrix} $$ Taking the entries where Q is 1 yields 7 terms. Taking just the values that are 1 the permutations equate to a, b, c, ab, ac, bc and finally abc. XOR them all together and you end up with: $$ a \vee b \vee c = a \oplus b \oplus c \oplus a{\cdot}b \oplus a{\cdot}c \oplus b{\cdot}c \oplus a{\cdot}b{\cdot}c $$ "or" is "any combination of...", so it can exclusively be one of all possible combinations or permutations. The more terms you add the more complex and long winded the expression gets. For OR made from XOR the number of valid permutations will always be \$2^n-1\$ where \$n\$ is the number of input values.
H: Boost converter Inductor Current In a boost converter during switch on time inductor build magnetic field and during off state magnetic field collapse.My question is during off satte inductor is connected to source voltage,so why not it building magnetic field ? AI: It depends on the output voltage. At the start, when the capacitor is discharged, there will still be a positive voltage across the inductor and the current will continue to build in the inductor during the switch open cycle. When the output capacitor voltage reaches the same level as the supply voltage the voltage across the inductor will be zero during the off cycle. After that the voltage on the capacitor will be greater than the supply voltage. From then on the inductor loses it's charge during the off cycle.
H: Why is the Gray code called a cyclic code? I understand why it is called reflexive and a unit distance code. I don't see any cyclic pattern which is repeating in the code. Why is it called a cyclic code? AI: cyclic ˈsʌɪklɪk,ˈsɪklɪk/ adjective 1. occurring in cycles; regularly repeated. You haven't given a reference for the 'cyclic code' terminology but there is certainly a cyclic patter. This is most obvious in an encoder disc. Figure 1. The cyclic pattern of each bit is clearly visible on this optical absolute encoder disc. Each bit has a repeating on-off pattern with a 50% mark-space ratio. The bits are arranged so that only one bit changes at a time. This prevents errors on transitions from one code to the adjacent one due to misalignment of sensors, etc. There's a generic definition about the cyclic nature of the Gray code further down the Wikipedia Gray code article mentioned in altai's answer: "The last entry in Gn differs by only one bit from the first entry. (The code is cyclic.)". That is it can wrap while still maintaining only one-bit change. It would be possible to generate a Gray-ish code that didn't have this property if, for example, the number of steps was not even or a power of 2. This might be acceptable in a linear encoder which wouldn't need to wrap.
H: How can I calculate the Cimon in a DC-DC converter? I would like to use LT3649 IC, but I don't know how can I calculate the following in the datasheet: Output current monitoring and regulation section in page 10. The datasheet: LT3649 If I use 10k resistor for Rimon and 10nF capacitor for Cimon how can I calculate the value? AI: The answer is in the datasheet, at page 10. \begin{equation} C_{IMON}R_{IMON} \geq \frac{1.59}{f_{SW}} \end{equation} Using your values, \begin{equation} (10 \text{ nF})(10 \text{ k}\Omega) \geq \frac{1.59}{f_{SW}} \Rightarrow f_{SW} \geq 15.9 \text{ kHz} \end{equation} The switching frequency is set by \$R_T\$ as described at page 11. \begin{equation} f_{SW} = \frac{10^5}{R_T \text{ (k}\Omega)} \Rightarrow R_T < 6.289\text{ k}\Omega \end{equation}
H: Non-Inverting Op-Amp noise on the output when touched I am using a non-inverting op-amp circuit (shown below) to linearize the output of multiple analogue force sensors. This is the circuit recommended by the manufacturer in their electrical integration document.The circuit is working and I am able Toggle between sensors by driving GPIO low for active sensors and high impedance for disabled sensors. However I have observed a larger amount of noise and oscillation in the output of the opamp when I apply force to the sensor with my bare hands. This noise is almost negligible when I apply force to the sensor whist covering the sensor with an insulative material. I have found by increasing the capacitance of C1 to from 47pF to 1uF I have been able to eliminate the noise and oscillation. (Why is this?) however this is at the cost of having to increase the time between sensor readings to the point where it is not feasible for my application. The reason I must wait between sensor readings is the large capacitor will hold the voltage of the previous sensor for some time when I toggle between sensors.I have the following questions: What is the likey cause of the noise/oscillation (image show below) How can I eliminate this noise? What is the purpose of C1 and why does increasing C1 remove the noise/oscillation. AI: As with all noise problems your BEST solution is to prevent the noise from getting picked up by the circuit in the first place. As such you already have a solution, which is to electrically isolate the sensor from prying fingers. As the doctor said when I told him.. "It hurts when I do this!" "Well then, don't do that!" C1 in this circuit turns it into a low pass filter. The feedback impedance will be significantly reduced for higher frequencies on the signal. As such, the larger the capacitance the less "noise" will make it through. At very high frequencies \$R_{FEEDBACK}\$ --> 0. However, for a circuit like this, finger interference means you will be injecting a significant amount of low frequency, mains hum, noise. As such, the capacitor would need to be quite large to remove it. Since you are planning on multiplexing the signal from various sensors, the effect of a large capacitance here is problematic for settling time delay as you have intimated. As such, and if it is not possible to properly insulate and isolate the sensor from fingers and local RF noise, this is really not a good circuit to use for this application. Moreover, using the GPIO pins directly to switch between sensors also adds an issue of inter-channel interference and a general inability to REALLY get the bottom end of the sensor hard to ground. Further, switching like that creates what can be problematic transient response issues in the op-amp. It would be better to receive each sensor value individually, with appropriate noise filtering, and then select the appropriate output to feed to wherever the signal is intended to go.
H: digital circuits math I want to study digital circuits with the book "digital design" by M Morris Mano. and I have no math knowledge.(I know only + - * /) Do I have to study math first? if so, how much? Generally(not specific to that "digital design" book) in which year, does the subject need math? First or second year? AI: How deep into digital circuit design are you trying to go? If all you want to do is build simple logic functions that are not very robust, you pretty much don't need to know any math beyond basic arithmetic and logic. If you want to design something more robust, and do something actually useful, you'll need to know things like linear algebra (matrices), or signal theory, or set theory etc.
H: Clipping Class-AB Output This assignment we have been given has been causing me major headaches. I feel like I'm finally close to getting this amp to work after hours of fiddling around, but now I've found the output is clipping at a very low voltage. It must have a differential input and a class AB output. Minimum of 1500 voltage gain. Stability and wasted power aren't a concern, as long as I can write up where power is lost. I'm sure there's enough base current, and don't think there's any loading, but there is no voltage swing available at the output. What is causing this clipping? I'll buy a pint for anyone who can get this thing to work. I want to understand where I'm going wrong, I just can't work it out for the life of me. Thanks for looking! EDIT: Scope with DC coupling shows the following waveforms. The left hand one is the base of Q11, and the right hand side one is the load output (before cap). It seems like together they make a full sine wave.. What is going on??? Edit 2: Here are both waveforms on the same scope: red output, blue input to Q11. AI: AC input is a sine wave, which has a positive swing and a negative swing, and goes through zero twice each cycle. For this zero point, biasing of Q11 seems nearly acceptable. Your problem arises when Q11's base voltage rises toward its positive peak. Q11's collector current increases: voltage drop across R8 increases. This would cause Q11's collector voltage to become lower. So you have the situation where Q11 base voltage is rising, and Q11 collector voltage is falling. They meet, and Q11's collector cannot pull any lower.
H: What happens to an op-amp with inputs and outputs connected to +V? EE newbie here. I am trying to put an additional op-amp circuit onto a crowded half-sized "perma-proto" breadboard; I have no room remaining on the centerline to mount a DIP package. What I do have is a dual op-amp in 8-pin DIP; I only need one of the amps, so on one side of the package only the +V pin is in use; I can straddle the DIP across the gap between the horizontals and the power rail, and the power pin will land in the right place. Obviously in the interest of sanity I will clip the unused leads and put an insulator between the stubs and the power rail, and I know this is not an elegant solution or something I should be doing routinely. But if I were to take a common 8-pin dual op-amp, and put all four pins on the right side (+V, inverting input, non inverting input, and output) onto a common +V rail, what would happen to the op-amp and the power rail? I'm not asking for solutions to my layout problem; it's solved. I'm curious what the behavior of the part would be if connected in that way. AI: I would not be shorting the output to the rail. The inputs will be fine tied to the rail. Do not leave them floating or the thing may sit there howling with noise consuming large currents and radiating EMI. That noise would be coupled to the rail. However, both inputs tied to one rail means there is a 50-50 chance the output will try to pull to the opposite rail. As such it will be straining and consuming current, though the latter will likely be limited internally. It will get a little warm. The op-amp will likely not significantly affect the rail voltage unless it is a really high current op-amp or the rail is higher source resistance. For your hack solution, just lift, or break off, the output pin.
H: What are the critical characteristics of an op-amp for buffering reference voltages? So, let's say I have a precision voltage reference with the output fed to a voltage divider which is tapped at two places for voltages A and B. I've made sure to use precision resistors (or calibrate) and the divider doesn't overload the voltage reference. So at this point, I have maintained line regulation up to the taps but significantly degraded load regulation there by using a voltage divider for A and B but I thought that the best thing to do now is to use an op-amp voltage follower to buffer each of A and B. The characteristics that I've identified so far are that the input impedance should be very high, the input offset voltage should be as low as possible, low input offset voltage temperature drift and the input and output ranges should match. It seems like CMRR wouldn't matter in this application. On top of that, I'm not sure what else to look at. Noise should be low but how low and relative to what exactly? To give a couple of examples, if I use the LM4040 4.096 Grade A then I should have, at worst, 14mV of error due to temperature drift and load, right? So how do I make sure that my buffer doesn't make that worse? What about something like the REF3240 where the error might only be in the tens of μV? Isn't it the case that something like the OPA340 would work fine in the first case but might not be quite good enough (just because of the input offset voltage and its temperature drift) for the second? AI: To summarize, you want to know what opamp characteristics you need to buffer a reference voltage. The two most obvious are low offset voltage and unit-gain stability. Any offset voltage is a error directly added to the output. Without unity-gain stability, the thing will oscillate in voltage follower (unity gain) mode. Other parameters depend on more specific circumstances. For example, will this thing be subjected to wide temperature swings. If so, low offset across a wide temperature range is important, not just offset at 25 °C or whatever. Other issues come up depending on what supply voltages you have available relative to the reference voltage you want to buffer, and how stable those supplies are. Do you expect the load to have a significant capacitive component? If so, you have to look at stability more carefully. In any case, it would be a good idea to filter both supply inputs with a ferrite chip inductor or two followed by caps to ground. That way you don't have to count as much on the active power supply rejection capability at high frequencies.
H: How to determine the input resistance of a bootstrapped emitter follower I've used bootstrapping several times, either to boost the input impedance of an amplifier or to increase its gain. However most of the times I can see the beneficial effects of bootstrapping without actually knowing what's the actual input impedance of an amp due to bootstrapping. Consider the following emitter follower stage which I got from a textbook. simulate this circuit – Schematic created using CircuitLab According to the book from which I got that circuit, the input impedance without the 10kΩ load (\$R_2\$) is 500kΩ and the input impedance with the load is 350kΩ. However the book doesn't provide any formulas or explain how any of those values were derived. So I'm trying to figure it out. This is what I've got: Just to compare, suppose there is no bootstrap capacitor C2, transistor MPSA42 has a beta of 70, so the input impedance would be roughly \$\beta (R_2\parallel R_1) \parallel R_3\$ (I didn't consider R4 for the calculation since \$R_4 << R_3\$), substituting values results in an input impedance of 77.7kΩ. Now consider what happens when the bootstrap capacitor is in: The emitter current of the transistor is approx. \$\frac{24-0.7}{\frac{R_3+R_4}{\beta}+R_1}=2.01mA\$ Which results in an incremental emitter resistor of \$r_e=\frac{V_T}{I_C}=12.93\Omega\$ The voltage gain of the CC stage is roughly: $$A=\frac{R_1 \parallel R_2 \parallel R_4 }{R_1 \parallel R_2 \parallel R_4 +r_e}=0.996$$ Now suppose that 1V is applied to the input. That would mean that the current through \$R_3\$ is \$ \frac{1-0.996}{100k}=40 nA \$ which, compared to the current through the 100kΩ resistor without bootstrap is \$\frac{40nA}{1/100k}=4x10^{-3}\$ times the current without bootstrap. This means the resistance of 100kΩ actually looks like a resistor of \$\frac{1/100k}{40nA}=250\$ times greater value, or \$100k\times 250=25M\Omega\$. This will be in parallel with the resistance reflected from the emitter to the base, which is roughly \$\beta (R_1 \parallel R_2 \parallel R_4)=233k\Omega\$, that in parallel with the 25MΩ resistor gives 230kΩ, as opposed to the 350kΩ mentioned in the book. I checked with a simulator and the input impedance is indeed close to 350kΩ. What am I doing wrong, is my line of reasoning correct? AI: Well, the equation for the Zin and voltage gain looks for the emitter follower with the bootstrap (positive feedback) at the input simulate this circuit – Schematic created using CircuitLab looks like this: $$Z_{IN} = \frac{(r_eR_E + R_3(r_e + R_E))\cdot (1 + \beta)}{R_3 + (\beta+1)r_e }\approx \frac{R_3}{1 - A_V}||(r_e+R_E)(\beta+1)$$ $$A_V = \frac{(R_3+r_e) R_E}{r_e R_E + R_3r_e + R_3R_E} = \frac{R_E}{R_3||r_e + R_E} \approx \frac{R_E}{r_e+R_E}$$ Of course \$R_E\$ is for your circuit equal to $$R_E = R1||R2||R4$$ So, in conclusion, your reasoning is correct
H: What VZ means in schematic? Couldn't find the answer on the internet. The leads of VZ1 component are directly connected to mains. AI: The leads of VZ1 component are directly connected to mains. Therefore in this context, the component which makes most sense is the varistor (often a Metal Oxide Varistor or MOV). [A normal Zener Diode, for which a designer might also use the VZ component designator, would not be connected across the mains.] Varistors are often used to suppress high-voltage transients and are directly connected across a device's mains supply input in that case.
H: 3 AA batteries vs. USB battery pack? we have a few LED string lights that use 3 AA batteries and eat through batteries about once a week. I would like to replace the AA batteries with a USB battery pack I have which has about 8,000 MAH. Since AA batteries are 1.5v and standard USB is 5v, is this as simple as cutting an old USB cord and finding the correct positive / negative cables to wire to the empty AA battery enclosure? I am not sure if the +/- .5v would make a difference? Is there an easy way to find out which wire from the old USB cord is + and -? Am I nuts or will this work? Thank you! AI: It will probably be as easy as you are hoping. Chances are, the red wire is positive and the black wire is negative. Can't say for certain without knowing more about the LED string, but chances are if it could be powered with 3 AA batteries, a USB will have more than enough capacity. Hopefully there is an inline current limiting resistor to the LED's, and therefore the additional 0.5 V will be dissipated over that. A little more wasted power, but nothing to worry about.
H: Use multimeter to find approximate impedance of miswired speaker array? I visit my father's house a few times each year. When he built the place, he had it wired for sound using in-wall systems, but (it seems) not by professionals. He blew out a receiver/amp, so I asked him to examine the wiring and he says it has all 8 speakers in parallel, patched together down in the basement! (See this question for the way it should have been done) I would like to use my multimeter to find the impedance of his setup next time I visit him. I don't need to be super-accurate so I would like to avoid sine-wave generators and speaker disassembly. My plan is to introduce a resistor in series (maybe 200W and 1-4Ω) sufficient to make the system safe against accidental volume knob twists. Sound quality and max volume are not terribly important in his case. If I simply hook my multimeter -- a low-end Fluke -- up to the (single) speaker wire coming from the wall, and then use it to test resistance, am I likely to get a reasonable estimate of the total speaker impedance seen by the amplifier? Edit: To be clear, the impedance of each of the individual in-wall speakers is presently unknown and would be tricky to obtain (they are actually mounted in the ceilings). Outcome: Following the advice from Dwayne Reid I purchased a resistor (20W, just to be sure). I found a free tone-generator program for my laptop, and played a couple different frequencies through the system. It took quite a bit of wattage and volume to get near 1V (my father went to find his earplugs), but I got close enough that I felt measurements were OK. Based on that, I obtained 8-9 Ohms of impedance in the system, so the installers apparently had done the job properly! AI: Place a resistor of known value in series with one speaker lead. Use a low-value resistor of sufficient wattage rating to withstand a few seconds of power. I would use a resistor somewhere between 1R0 - 3R3, 5 Watts. Apply a tone if you have such available. 400 Hz - 1KHz is good. Increase the volume so that you can read a decent voltage across the speaker. 1 V RMS is good but less is okay if the volume is too loud. Now simply measure the voltage across the series resistor and across the load (speakers bank). The ratio of the these two voltages in conjunction with the known value of the series resistor will allow you to calculate the load resistance.
H: Split 5V 3A into 1A in 2A to make USB charging device Overall goal: make a couple USB phone & tablet charging ports from a 12V deep cycle battery. Steps taken so far: I've read that using a resistor based system to step down from 12V to 5V leads to a lot of heat inefficiency so I purchased a SMAKN 12V to 5V 3A voltage regulator. I can simply solder the + & - terminals of a female USB port to this regulator but I thought it would be more efficient to split the 5V 3A output into 5V 1A and 5V 2A to charge a phone AND tablet at their desired wattages. Confused part: Googling this leads to surprisingly few results, most of which discuss using PSUs where the answers generally revolve around picking a more specific PSU.. [Edit]: While other answers do discuss the underlying solution, they are specific to choosing a PSU and don't get into the details of how to construct a multi-device USB charging circuit. Using Ohm & Kirchoff's laws, if I build a parallel circuit with a 5 ohm and a 2.5 ohm resistor, this will give me my 1A (5V / 5 ohm = 1A) and my 2.5A (5V / 2.5 ohm = 2 A). simulate this circuit – Schematic created using CircuitLab Jump back on google to find a 5 ohm and 2.5 ohm resistor and...I see a number of results some of which say to operate at 1/4 Watt which is clearly way too low. I called local electronic shops - they all seemed surprised that I needed such a low resistance resistor with such high wattage. All of which adds up to me thinking I'm going about this incorrectly or am violating some basic principle? Are my resistors (R1 = 5 ohm, R2 = 2.5 ohm) correct? Are there such resistors for 5V circuits? Is this design going to lead to power loss if only of the two USB ports are in use? AI: You have a fundamental misunderstanding here, that is why there are so few results. You do not need to split anything. No, it will not be more efficient to split it into a 5V 1A port and a 5V 2A port. Why would that be more efficient? And I don't understand what you think you're splitting. Loads (like a phone or tablet) draw varying amounts of current, and will have a maximum current draw rating. They will never draw more than this, but will draw much less (like when fully charged, for example). The device will draw however much current it needs, and beyond that, it needs 5V. You can't limit current using resistors because the loads aren't linear. Resistors limit current by reducing the voltage, but a phone or tablet will simply stop using the port if the voltage goes outside the USB spec. When you see a USB port rated at 1A, that means it can provide UP TO 1A. You need an integrated circuit to shut off the port using a MOSFET switch in the event of over draw. You need active circuitry if you want to limit the current draw from the port, you cannot do it using resistors. But, there is no reason to do this. You have one 5V power supply that can provide 3A. Specify the two ports as having a combined maximum current of 3A, and connect them in parallel. You're done. Now, USB ports cannot provide more than 500mA of current unless you signal the device it can draw more. Any phone or tablet that conforms to the USB spec will refuse to draw more than 500mA from either of your ports, no matter what you do. You have to use resistors to make voltage dividers that yield specific voltages across the D+ and D- USB pins, and depending on which you chose, will signal different devices a certain kind of charger port is available. Unfortunately, many tablets use 2.1A, not 2A, so to call a 2A port a tablet port is not really correct. It's insufficient for a great many tablets, while all smart phones expect a 1A charging port minimum. So you're 100mA shy of having the capacity for a true phone and tablet charging device. It might charge YOUR tablet, and if that is all you want, then no worries. But if you plan to have other people use this, you need a slightly beefier 5V regulator. As for signaling the maximum capacity for each port... well, you can do that using resistors, but high resistance, low wattage ones. They create a voltage divider with the D+ and D- pins of the USB port connected in the middle. However, there is no standard voltage value you want on the D+ and D- pins, it's not part of the USB spec. So Apple generally has its own specific resistor values that are different from android devices, and Samsung has its own thing for its tablets... so its impossible to create a true universal charging port using resistors alone. You have to use a smart port IC, which will detect the type of device connected to a USB port and set the voltages on D+ and D- appropriately. The TPS2546 is one such IC. If you only plan to use this for yourself, and only need it to work with your specific devices, then you can just use a resistor divider. There is one for 1A Apple devices, then that same divider but with the D+ and D- voltages swapped yields a port for charging 2A apple devices. There is one for sony devices, and one for samsung devices. Then European devices all need only a 200 ohm resistor shorting D+ and D-, by law. Here is an example of what I mean: I don't know what device(s) you want the ports to work with, but if you simply google the voltages for a given device and current, you can find the information you need. I also highly recommend you read this app note, which is a nice quick and dirty crash course on all this. Unfortunately, this is one of those situations where something that ought to be simple... is not. C'est la vie.
H: UART in AVR Microcontrollers If an UART is receiving data continuously, can I also send data using the same UART while receiving data at the same time? AI: Simply, you can. In addition to charansai's answer, if the MCU supports hardware UART then it becomes easier. Since the transmit/receive process is done via the hardware itself, you don't have to wait for a transmit or a receive process to complete. Depending on the setup, the module raises either an interrupt or a flag once the process is complete. Even if a software-UART is used, it's still possible by using some programming skills.
H: Biasing MOSFET with Constant Current Source In the course of researching tube amplifier designs, it seems like a common technique to bias a MOSFET in an output stage using an LM317 configured as a constant current source, such as is given in the schematic on this page. How does this method of biasing work? Why is this a preferred method? AI: It is not a preferred method. It makes for rather a 'pantomime horse' of an amplifier. But it will work. A single-ended source follower output stage needs some method of sinking current away from the source. A resistor to ground is the usual method, though it does have the the disadvantage over current source arrangements of sinking little current at low voltage, more current at high voltage, so using more bias power for the amplifier useful power output. For current source type loads, a more typical current source would be to use a BJT, with the base biassed to a volt or two, and an emitter resistor to ground. This has a larger output swing than a 317, and is more scalable to other currents and voltages, but uses more components, and may not be any cheaper. I have some concerns about the stability of a 317 used in that way without capacitors, as adding capacitors for stability would impact its dynamic compliance as a current source. Given the high distortion and high dissipation of the amplifier shown, there seems to be little point in polishing that particular stool by worrying about what type of biassing is used for the output. If you want to go tube for the lolz, then go completely tube. If you want an amplifier with low distortion and reasonable efficiency, then look up some proper designs for low power amplifiers.
H: encrypted flash of DSP when programming the flash of DSP by accident i encrypt the flash content. is there any way to decrypt flash of a DSP? the flash was encrypted. AI: If you were programming the device then you must have source non-encrypted code. Why not re-flash again with non-encrypted code? However if it is DSP allowing you to flash its code, and now you flashed with encrypted contents and DSP can not start properly (because it does not understand contents of the flash) then the only appropriate course of action is to refer to DSP's datasheet to learn how you can perform emergency flash content reload. You may need special tools (e.g. adapter) to perform it.
H: Signal in and out of flip according to IEEE symbols I have the following IEEE symbol for a SR flip-flop I have to work out the waveforms W and X given A and B. Here are A, B and the associated solution for W and X (as given by the book): From my understanding of IEEE symbols the following rules apply: If S1 is asserted then I should make W = 1 and then X will get a value according to the truth table of a SR flip flop. If R2 is asserted then I should make X = 0 and W will get a value according to the truth table of a SR flip flop If both S1 and R2 are asserted then I should make W = 1 and X = 0 If neither S1 nor R2 are asserted then I should just use the truth table of SR flip flop to determine W and X. However I'm having some issues understanding the solution as at the beginning both S1 and R2 are asserted yet both W and X seem to be 1. Where am I going wrong with my assumptions? AI: The mistake you are making is that the inputs are inverted. In the IEEE Std 91/91a-1991 rectangular shape standard, a half triangle on the top of a pin indicates that the signal is inverted. For example, this is a single bit inverter. Notice the triangle on the output indicating inversion: Image Source The same thing applies to inputs. Notice how the Load input is inverted in this symbol: Image Source So basically in your symbol, S and R are active low signals, i.e. they are considered "asserted" when they are low.
H: Multiple CAN bus devices broadcasting at the same time...possible conflict? I've worked with CAN bus recently and started to wonder what would happen if multiple devices on a network suddenly happen to broadcast at the same time. I mean every device on the CAN-bus network receives each other's messages. But since they are on the same bus, wouldn't there be a conflict resulting in some devices not receiving some of the other's messages? I see it as a one-way street where you have two cars trying to go each other's opposite direction resulting in a crash and not reaching their destination. I couldn't find anything about this on the Internet....plus this question probably relates to I²C as well or any other similar communication protocols. AI: As you stated, every node receives the others' messages. This allows the nodes to prevent any conflicts on the bus by listening the bus. Each node listens the bus before transmitting a message. If the bus is not busy then the node transmits its message. There's also a priority mechanism to avoid conflicts: If a message has a higher priority (i.e. lower ID) then it gets the bus access. An example: Let's assume there are two transmitters trying to transmit a message. One having an ID of 0x7FA and the other 0x7FF. They started to transmit right at the same time by transmitting the SOF (Start of frame) bit. A: ¯¯¯¯¯¯¯¯¯|___|¯ SOF B: ¯¯¯¯¯¯¯¯¯|___|¯ SOF There's no conflict here. Then they send the ID bit-by-bit but MSB first. A: ¯¯¯¯¯¯¯¯¯|___|¯¯¯|¯¯¯|¯¯¯|¯¯¯|¯¯¯|¯¯¯|¯¯¯|¯¯¯|___|¯¯¯|___| SOF 1 1 1 1 1 1 1 1 0 1 0 | 7 | F | A | | | conflict here | B: ¯¯¯¯¯¯¯¯¯|___|¯¯¯|¯¯¯|¯¯¯|¯¯¯|¯¯¯|¯¯¯|¯¯¯|¯¯¯|¯¯¯|¯¯¯|¯¯¯| SOF 1 1 1 1 1 1 1 1 1 1 1 | 7 | F | F | The conflict occurs when the 9th bit (i.e. 3rd bit of the ID) is sent. The 2nd device loses arbitration (because it has lower priority due to higher ID) and leaves out the bus thus the 1st device wins and continues transmitting its message.
H: Coil winding sense in dual voltage power supply Hello is the sense of the B winding in the transformer (same as A or opposite than A) can have any effect on the powered circuit? Maybe due to the fact that the AC ripple of the negative rail is out in phase with the ripple in the positive rail and then worse? AI: Since the output of the rectifier is full-wave rectified it cannot make any difference which way the transformer coils are wired. Figure 1. Full-wave rectified signal will be the same for either polarity of AC. You can save one rectifier by using a "centre-tapped" arrangement. Figure 2. The centre-tapped arrangement uses one bridge rectifier. This arrangement is also a little more efficient as the current flows through only one diode on its way from the transformer outer taps back to the centre-tap resulting in a voltage loss of only 0.7 V compared with 1.4 V for the arrangement shown in the question.
H: STM32F103: Can a timer can interfere with uart? I have a simple program, which receives data from UART interface and drives a WS2812b led strip. So, I'm using USART3 to receive data (in IRQ mode) and T3C2 (timer 3, channel 2) to drive LEDs. Here is the code: https://hastebin.com/rucumovero.cpp If I use the uart interface without enabling a timer, everything works just perfect, but when I enable the timer I start losing data. For example, here the log if I send 5 similar 32 byte packets [0x41..0x60] read 29 byte(s): 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F read 29 byte(s): 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 60 read 28 byte(s): 41 42 43 44 45 46 47 48 49 4A 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5D 5E 5F 60 read 29 byte(s): 41 42 43 44 45 46 47 48 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 5A 5B 5C 5D 5E 5F 60 every time 3~4 bytes are lost. I tried to use different baud rate, different usart port - the result is the same. The timer interval is set in line 142: timer_set_period(TIM3, WSP); where #define TICK_NS (1000/72) #define WSP (1300 / TICK_NS) If I comment out this line, the problem will disappear, but, of course, I won't be able to drive LEDs without it. So, it looks like I can't drive WS2812b leds and receive data from UART at the same time. Is it supposed to behave like this? Any idea how can I fix it? AI: Looking at this #define TICK_NS (1000/72) #define WSP (1300 / TICK_NS) your timer takes about 100 steps (if i got it right from the specs) and then runs whatever routine you told it to. I couldn't clearly see how much time it takes for your program to make one step, but it seems as if your timer routine should run very often (couple 1000 times per second or more). Now if your uart routine works as expected without the timer, but loses data when you introduce it, it strongly suggests that the timer disrupts your serial communication. This could be because: your timer routine runs to often the timer routine is too long the timer interrupt has a higher priority than the uart interrupt. Or maybe its all three put together. Possible solutions: An STM32 has something called the NVIC (Nested Vector Interrupt Controller), which you could use to change the the interrupt-priorities. When you use two or more interrupts you have to consider that they may run at nearly the same time(this happens more often when both interrupts run at similar frequencies), and one routine may loose information because of this (especially with uart). So you have to think of a way to handle this explicit case -> locking mechanism or altering the priorities. The longer your routine takes, the higher is the chance that you enter the case described in point two. It's usually good practise to make interrupt routines as short as possible, and never ever use delays or loops inside an interrupt. Consider if there is a way to run your timer routine considerably less often. This way you at least minimize the chance of data loss, but to completly rule it out, you will have to do the things described in point 1-3.
H: Is 18650 battery capacity from 3V or 0V? To calculate the battery capacity in mAh of an 18650 battery I understand you can use something like an iMax B6 in discharge mode on a fully charged (4.2V) battery to get the mAh it provides. The iMax B6 stops at 3V. So my understanding of this is that the reading shown is the mAh that were provided by the battery going from 4.2V (or whatever it charged to) down to 3V. I understand that running an 18650 Lithium Ion battery below 3V causes chemical instability and shouldn't be done. So what I am unsure on is if the value shown on the iMax B6 is the "rated capacity" for this batteries (the ones shown on the specs and printed on some batteries) or if you need to do some other calculation to get the full capacity of the battery going down to 0V? AI: The rated capacity of a battery is measured between its rated full charge and rated end of life voltages. With lithium polymer, these are usually 4.2 V for full charge, but the end of life quoted varies between manufacturers. I have seen 2.5, 2.7 and 3.0 V all used as the end of life voltage. There is no 'right' voltage, as higher end point voltages extend the cycle life of the battery, at the expense of capacity, leaving the capacity/lifetime tradeoff as your choice. If you are lucky, the manufacturer quotes the life of the battery, the number of expected charge/discharge cycles, between the same voltages. If you are unlucky, the number of cycles will be quoted to a higher voltage than the Ah capacity.
H: Highly integrated RF front-end chipset RFX8055 issues In this datasheet of RFX8055 (CMOS 5GHz WLAN 802.11a/n/ac RFeIC WITH PA, LNA, AND SPDT switch), they mention "5GHz Power Amplifier with Low-Pass Harmonic Filter". If this filter is meant for filtering intermodulation products then it should better be bandpass filter right? (as intermodulation has sometimes \$f_1-f_2\$ low pass component too) They also mention "High Power Capability for Received Signals in Bypass Mode", the mode in which LNA is bypassed. Does this just mean that the chipset is able to handle high power in LNA bypass mode or is there any other important implication? Whats the purpose of "LO rejection" in this chipset? Generally, LO rejection parameter is considered in dealing with RF mixers right? AI: 1) No, it says "Low-Pass Harmonic Filter" which means that Harmonics need to be filtered. Harmonics which are created in the PA. For intermodulation there would need to be a mixer in the path and there isn't after the PA. There are only non-linearities causing harmonics of the wanted signal. 2) When high level input signals are present the LNA could distort and/or saturate and this causes intermodulation products. So if the wanted signal is strong enough the LNA is not needed and can be switched off. This shifts the usable dynamic range up so larger (unwanted) signals are less problematic. 3) Maybe that sentence about "LO rejection" concerns on-chip filters preventing LO signals from reaching the LNA and/or LO signals reaching the PA. But there's no mention elsewhere in the datasheet about LO so it is unclear how effective this "LO Rejection" is. In my opinion you should ignore the "LO Rejection" remark as the chip does not have any LO signal connected to it. Also, it does not "know" what frequency you're using as LO in the rest of your system. I think this is a marketing phrase and should be ignored.
H: "Old FM" vs. Modern FM radio signal. What's the difference and can I adapt? I have a vintage radio that I managed to get all circuits and tubes back into original spec. The AM stations tune in fine but I get nothing on FM. I am told this is because it's tuning in "Old FM" - which I can only assume was part of the APEX broadcast band (42mhz - 50mhz)? Or, is this a reference to some band of UHF/VHF? It's not clear to me. Depending on the answer to the above, might it be possible to put a line-level adapter on the antenna so I can use all the vintage hardware to tune in a few modern stations? update Model is 1947 Magnavox Georgian. Schematics to come AI: Interesting question, I hadn't heard of that band being used for FM radio before (in the UK I think it was used for TV from about 1937). You might want to build a "downconverter" that would do the job - mix a slice of the modern VHF band with a fixed frequency local oscillator, and filter the mixer output via a 42-50MHz bandpass filter, and feed into your antenna input. As the FM band is 20MHz wide, and the old one is 8 MHz wide, you would need to select one of three oscillator frequencies - there are crystal oscillator modules readily available with a wide range of frequencies ... let's see if we can find something that works. Starting at 88MHz, you would need a 46 MHz local oscillator ... maybe we'll find 45MHz, giving 87-95 MHz from the first local oscillator. Then 53 MHz would give 95-103 MHz, and 61 MHz would give 103-111 MHz. You're likely to find 60MHz giving 102-110MHz, and full coverage with a middle oscillator between 52 and 53 MHz. (It wouldn't be a disaster to use 4 oscillators, at 45, 50, 55 and 60 MHz if you had to). simulate this circuit – Schematic created using CircuitLab This is just a block diagram, you'll have to work out the details yourself. Front end bandpass filter : can be borrowed from the input of any FM receiver circuit (and may include an RF amplifier). Oscillators : should be off the shelf. You may get away with leaving them all connected (via an attenuator network) and only powering the one you want. Farnell for example show 44,52 and 60MHz as available giving full coverage from 86-110MHz. Mixer: you can either buy a "broadband double balanced mixer" covering at least 40-110MHz, or make using schottky diodes. Output filter : can be wider than shown (e.g. 30-60MHz would be OK) - or even a 50MHz lowpass filter, and rely on the filtering in your existing radio to do the job. You may be able to omit this entirely.
H: Charging a 5 cell 18v lithium battery with single charger? I want to charge a 18v cordless drill lithium battery, which is basically 5 Panasonic INR18650-20R 3.7v cells connected in series. the battery pins are BATTERY+, BATTERY- and 4 pins marked BATTERY1, BATTERY2, BATTERY3 and BATTERY4 which are connected between + and - of batteries (probably used for balanced charging) I searched for a way to charge this thing, but all i found was about using a balanced charger. However, is it possible to charge each cell individually using a single tp4056 charger? like, connecting BATTERY- and BATTERY1 to charger and, after finished proceed to BATTERY1 and BATTERY2 and so on? AI: However, is it possible to charge each cell individually using a single tp4056 charger? like, connecting BATTERY- and BATTERY1 to charger and, after finished proceed to BATTERY1 and BATTERY2 and so on? Yes, that's possible. If all you have is a single cell charger, then it's the only way to do it. It's not the quickest way to do it, it will take five times as long as a complete battery charger. But by the time you've finished charging all 5 cells to the same voltage, you'll have a fully charged balanced battery. What can go wrong? What happens if you forget to charge one cell, and then use it as a battery? Disaster. If you go this route, you need to be organised enough so that never happens. You have five times the handling of the battery, and mucking about with the balance terminals. That's more than five times the chance of reverse connecting something, or dropping something conductive across terminals. So a much more risky way of handling the battery. Be careful.
H: What is the meaning of "ground" and "-V" in a simple push-pull circuit? In this simple "push-pull" circuit, there are +V, -V and ground connections. up until now, i always considered ground to be the minus side of the battery. but that is also the way i understand -V, so i don't see how current would flow through the PNP transistor from ground to the -V If i am using this circuit to drive a simple DC motor forwards(push) and backwards(pull) with a battery what would the -V and ground connections mean ? AI: When using a 'split rail' like this, ground will be the mid terminal of the battery or power supply. So if you had a +12v and a -12v supply, that would need two 12v batteries, connected in series, with their mid point taken to be ground. This split rail connection allows you to generate both positive and negative voltages into the load. Your motor would connect between ground and \$V_E\$. This would allow it to be driven in either direction.
H: Rotate stepper motor in low RPM and minimum vibration I want to control a stepper motor about 3RPM and at very low vibration. I have a ROLLON SRL-M542H stepper controller.If I change it to high step per revolution it works smoothly without more vibration. Is it a suitable method for reduce vibration? And how to calculate pulse time for pecific RPM? Im trying to use an Arduino UNO for pulse genaration. AI: Stepper motors are natuarally resonant around each holding position because the holding torque varies from zero at the holding position out to a step distance away where the torque at its maximum. As such, in a lightly loaded or damped system they can vibrate for quite some time upon stepping. Use of micro-stepping reduces this effect by bringing the rotor towards the holding point with less velocity and overshoot. Basically, you do not hit the bell as hard. Micro-stepping does however reduce the effective torque in an open loop system. Since the motor is really alternating between pulling from each direction to establish an average position. Those opposing forces cancel out leaving you with a lesser net force. Pulse time for a specific RPM will be dependent on the number of steps per rev (poles) of the motor times whatever micro-stepping factor is employed by the driver. \$PulseTime = 1/(RPM * 60 * Poles * MicroSteps)\$ Acceleration and deceleration profiles should also be employed to successfully ramp up and down the pulses at a rate that the motor can keep up with given your worst load and inertial conditions.
H: Transistors are hard to wrap my head around with laws When I was younger I played with micro controllers and moved on over to programming. I decided to play around with circuits again, and a few things are not clicking. Specifically, I am not quite sure how exactly transistors effect circuits in regards to voltage and current. When I try to figure it out, I think of it through the lens of how a resistor effects the nature of the circuit, is this a faulty perspective? For example, when I use a NPN transistor as a switch for another circuit with a LED. The base of this transistor is switched from a separate power source than that of the LED. The LED is from a 9V source, and the transistors base is from a 1V power source. The transistor has a 1k Ohm resistor, however it appears I do not need any resistance for the LED, despite it coming from a 9V source? The LED has a max voltage of 2V and a max current of 20mA. I am unsure how the LED is not blowing, and I am also unsure how the current is only 18.6 mA. Here is a schematic of the scenario in which I am describing: Perhaps I have missed something basic,, which makes this hard to understand. If that is the case I would appreciate being pointed in the right direction. Since I am relatively new, it is hard to think of what search terms to use in order to get accurate results. Thank you. Edit: Wow, all very good answers. I wish I could mark them all correct. I'll mark the simplest answer because it helped with the initial grasp, but to anyone stumbling upon this question, the other answers help give you a deeper direction. AI: You have to remember that a transistor is a kind of "current valve". It allows an amount of current to pass between collector and emitter that is \$H_{fe}\$ times larger than the current that passes through the base of the transistor. In your example \$H_{fe}\$ is apparently set to \$100\$. The base current is only \$186\mu{A}\$ so the collector current can not exceed \$18.6\mu{A}\$. (It could of course be less than that if the current is not available, at which point the transistor is saturated.) As you expect the LED drops about \$2V\$ across it. The remaining \$7V\$ from the \$9V\$ supply is dropped across \$V_{ce}\$. So in this instance the transistor is not acting as a switch, but as a linear current regulator. However, not a very good one since the \$H_{fe}\$ of transistors is actually a very vague value. If you wanted a current limiter, the circuit below is better and relies on a resistor value to set the current. $$ I = 0.7/R1 $$ simulate this circuit – Schematic created using CircuitLab
H: Why do devices stop operating properly in extreme cold? I have noticed that a lot of smart phones say that they won't operate under -4 degrees F (-20 degrees C). Can anyone explain to me what happens when the phones get cold that stops them from operating? AI: -4 F is -20C, which is a standard low limit for chips and electrical components. Some of that is just because it is very hard to test chips at low temperature, but there are real issues you can run into, which include: Batteries degrade at low temperatures, depending on their chemistry. The battery output voltage is lower, meaning you need more current to get the same power The battery internal resistance can increase. The added resistance can heat up the board, but it also wastes power and makes the battery output voltage less stable, as it will change with current draw. The heat caused by the extra resistance can potentially damage the battery, since you are heating up the inside while the outside is cold, creating a thermal gradient which adds mechanical stress. Thermal cycling of parts can become worse. Things break when you make them cold and heat them up because of thermal expansion. I believe this issue is worse at lower temperatures, possible related to metals becoming brittle when they are very cold. Chips can draw more current at low temperatures. This issue compounds the other two, since more current becomes more heat, which increasing thermal cycling. Chip timing changes. Digital circuits have special timing rules to ensure that all signals are in the right place at the right time. Lowering the temperature changes all that and can create a race condition.
H: Installed 555 timer socket backwards - can I reverse the chip in the socket? I installed the socket for a NE555 timer ic backwards on a PCB. Can I just reverse the chip in the socket to cure the mistake? AI: So long as the IC pins connect to the right PCB tracks, the orientation of the IC socket is irrelevant. Look at where pin 1 of your 555 IC is and make sure it's connected to the pin 1 solder pad.
H: Powering Multiple loads from a single 12v battery I have built a 12v rover - designed to be fully autonomous with a 12v deep cell marine battery as its only power source. It uses the following components: 1. [Raspberry Pi3 through a power converter][1] 2. [Sainsmart 16 Channel Relay Board connected to the PI to control motors.][1] 3. [LED Monitor (Draws 2A at 12V)][1] 4. Four 60 Watt Hobby Motors It works great. I can write the code and drive it around the yard. However - when the motors are engaged, the LED Monitor shuts off and comes back on again - as if it lost power. The PI seems to be unaffected and everything works fine - except for the momentary rebooting of the monitor. A voltage meter shows 12.5 at the battery - drops to 11.9 when the motors are engaged, and stays at 11.9 until the motors stop and then goes back to 12.5. My guess is that when the motors are engaged, it draws a large amount of current, more than the battery can provide, and causes the monitor to reboot. My guess is that this is not good for the components long term. My question is - can I somehow isolate the motors from the circuit, even though they use the same power supply - so that the momentary start-up draw does not affect the rest of the components? What is the proper way to wire such a circuit? AI: No way. Marine batteries are ginormous and are not going to be "laid low" by four 60w (5A) motors starting up. That's 20A nameplate, and even if it surged at 10x, or 200A, that's still a fraction of their cranking amps. A marine battery is only going to dip a volt or so. The problem is your wires. I bet you have a pair of wires coming from the battery which then come to a junction where they split to Raspberry Pi, LED board and relay board (which I gather powers the motors). That pair of wires is not near thick enough for the jobs (and that may be saving you). Try doing a separate "home run" for each, back to the battery terminals proper. So the battery terminals will now have 3 wires each, one for the Pi, one for the LED and one for the relay board. Given the amperage of the Pi and LED, #18-20 should suffice. If testing proves this out, I would combine the Pi and LED board into a single homerun, so you now have 2 homeruns. Also as a sanity check here, make sure you are never gating on both relays on a side at the same time, as this will effectively short the battery through the relay board. And remember relays have a throw time: don't turn off forward and instantly turn on reverse relay, if the reverse relays make faster than the forward relays break, that's a dead short. If that were to happen, it would cause a lot of voltage drop on the (I presume) small supply wires from the battery to the relay board. That would explain the Pi and LED being browned out. But before you upsize the relay board feed wires, consider - the small wire may be saving your relay board and motors, by creating a lot of voltage drop during a short condition, and that current limiting would be saving parts. I have a 3' interconnect inside a panel going to a generator rated for 35A, but has a system flaw where it can overload massively. The last guy tried to assure the #12 wires don't fail again by upsizing to #6. (60A in buildings, like 100A in chassis). I found melted wire insulation oozed into the strands, so it clearly overloaded 200A+ before blowing the generator. All he did was move the failure point from the $1 wire to the $8000 generator. Don't be that guy.
H: LED strip calculate power I bought a few LED strips. I have a power supply with 12V and 15W, the strip is blinking. So I assume - not enough power!? I have 5m strip, what power supply do I need for this? And for 10 or 15m? AI: I work a bit with LED strips and here's how I conceptualize them. The "stock, basic" LED strip is 5 metres long (16') and has 300 LEDs (single density). That's 60 per metre. They make double density (600 LEDs/strip, 120/metre) and many other variations, but most start from this baseline. Strips with 3528** devices are 1 channel, i.e. monochrome. Strips with 5050 devices are 3 channels (note each "LED" has 3 emitters and 6 pins), typically Red Green Blue, but White White White is also common. Rule of thumb for power planning is 2 amps per channel for 300 LEDs (basic strip). So a basic 300-LED 3528 roll will be 2 amps. a basic 300-LED 5050 roll will be 6 amps (3 channels remember). a double-density 600-LED roll of 3528s will be 4 amps. From your photo, it looks like you have 5050 emitters in normal density (300 per 5 metres). As discussed above, you can expect a 5 metre run of these to draw 6 amps, or 1.2 amps per metre. If you want watts, multiply by your supply voltage (12). Note they only have 2 solder pads at each cut point, so the LED strip is made to be monochrome, even though it's using 5050 devices. (Many monochrome 5050 LED strips use RGB strip material, which has 3 channels and 4 solder points, allowing you to control each 1/3 of the LED separately. Not this one. Even though it only has 2 solder pads, it draws current like 3 channels, since it is 5050.) 5050s are used for triple the light output of 3528s. 15 metres of these things, I would plan for 18A / 216W of supply power. You know, this will be a lot of light. ** 3528 and 5050 come from the package dimensions, 3.5mm x 2.8mm and 5mm square.
H: How to power a white LED from batteries I would like to power a white LED from batteries. The LED I'd like to use has a forward voltage of 3.3V, the datasheet specifies the voltage range from minimum 2.8V to maximum 3.8V. My idea is to use 1.5V AA or AAA batteries to power the LED, I don't want to use Lithium batteries for this project. I'm open to alternative suggestions though, if they would fit the project better. I'm aiming for a long battery life though, so no button cells. If I use 2 batteries, I get 3V - this would be in the allowed range, but very close to the lower limit of 2.8V. As soon as both batteries drop to 1.4V, I'm out. If I use 3 batteries, I get 4.5V and therefore a much greater voltage range that I can work with, but I have to get rid of something between 3 * 1.5 - 3.3 = 1.2V and 3 * 1.3 - 3.3 = 0.6 V. I see several options here: Just go with a fixed resistor and drop 1.2V. Works fine when the batteries are fully charged, LED will become dimmer over time until the batteries reach (2.8 + 1.2) / 3 = 1.33V Use a buck converter to convert 4.5V to 3.3V. I'm not very experienced with buck converters and all items that my local electronics supplier has stocked that have a output voltage of 3.3V need at least 6V input voltage. I don't mind cramming more batteries in there, but does that give me any advantage? I guess that using a buck converter should give me a steady supply of 3.3V as long as the converter has any input voltage above a certain treshold, so I'd not experience any LED dimming. Is that correct? Use a linear regulator. Researching my question I found some answers that said something like "a linear regulator is fine, because you don't have much voltage to drop". Usually those questions where about micro controllers though and had a power consumption of some hundred µA. Would using a linear regulator work with a LED that has a power consumption of 20 or 30 mA? Can you give me some advice which solution I should follow or am I going in the totally wrong direction? Would those solutions still work if I would want to power two or three LEDs with identical specifications? AI: Try this little circuit for a start. It runs from near-empty AAA batteries. simulate this circuit – Schematic created using CircuitLab Well, how does it work? In the beginning, both the transistor and the LED are shut off. A small current flows through the lower leg of the coil into the base of the transistor. The transistor turns on the C-E path. Now a much higher current flows through the upper leg of the coil and the collector of the transistor. Because the upper and lower leg of the coil are magnetically coupled, the current cannot flow in opposite directions in both legs. The small current into the transistor base runs dry. The transistor shuts off again. The current running through the coil cannot be shut off in an instant! That's why the coil increases the voltage at its terminals to sustain the current. That voltage is added on top of the source voltage. Eventually, the voltage is high enough to bring the LED into conduction (and lighting it up in the process.) The voltage of the coil decreases again. The LED shuts off again and the process restarts. Congrats. You have built and understood the simplest boost converter of all.
H: Ruggedizing a home-made High-Current SSPC After establishing that we're not going to use our load bank in PWM mode (see here), I'm now trying to draft up a circuit that would be controlled by an µC (Arduino or else) and a multiplexer (this). I'm also trying to protect the input from reverse voltage and overvoltage / making it able to cater with 1,8-24V digital input. OK so here's my design thinking 1N4148 for reverse voltage protection 1,8V Zener diode for overvoltage protection (able to take 24V as a digital signal) Resistor for current protection (500R ==> 10mA@5V) This one I'm really not sure about : a 0,1µF in order for the whole contraption not to turn-off between two "cycles" of the multiplexer. I know that'd definitely be a no-go in a fast-switching application but that's not the case there... I'm also guessing that the MUX chip will not change an output state between two update cycles but... So anyway, I hope I'm not completely off on this and wait for your feedback. So far what I take away : My // diode is useless I could use a P-channel transistor instead of a diode for reverse protection (avoids the diode Vf). Say something like this But it also brings one question to my mind : would such an input protection be compatible with some high-speed input? Wouldn't the rise time of this p-channel transistor also add to the whole chain? I cannot use a resistor to limit the current since my input voltage has a wide range Where I'm still lost : What should I use to limit current ? :-) Is a zener diode used this way (through it's breakdown voltage) will really work at 10-40mA? If I refer to the datasheet Zener diode datasheet the Vz is way above the nominal 1,7V when above it's nominal 50µA. It's way above 3V at only 10mA Would maybe just using a LDO such as this one solve all of that? Thanks for the help! Hi everyone, OK so I'm still not confident in my zener overvoltage protection... After some reading, I found that I have to make sure the zener is always going to be conducting some current or it might not be very effective at all... So I'm going to add another resistor in // with the zener to ensure this minimum current. Not just completely sure that's the right way to do it. AI: Your Specs: (my summary) Input Input from 3.3V or 5V uC output. input reverse voltage protection. 1,8~24V digital input ( if possible) Output External 12V supply to series low-side switch , galvanic isolated from input. Output switch RdsOn ~0.0012ohm IR opto LED characteristics All LEDs can be simplified by \$V_f = V_{th}+I_f*ESR \$ From the (typ) graph, \$V_{th}=1.36V~ @T_c=25'C ~~ ESR = 2.86Ω~ \$(= 0.1V/0.035A) However there is a large tolerance on this as indicated by VOM1271 datasheet table LED forward voltage \$V_f= 1.2V_{min}, ~1.4V_{typ}, ~1.6V_{max} @I_f = 10 mA ~~\$ Comments on proposed design in question It is the wide tolerance on ESR that affects Vf vs If as well as Temperature shift in threshold voltage Vth, that makes using a fixed series R not suitable for a wide input voltage range when a limited current range is desired. An input 3.3V to 5V is possible but one must analyze the ESR of the logic voltage and include this in the voltage drop using Vol/Iol. for reverse voltage protection rather than shunt diodes, you use a series Shottky diode or seriously prevent reverse voltage by design. Recommendation: Review example specs for Automotive Smart low Side switches, there are lots of these with better performance. Then revise your design specs as req'd and start over. eg. https://www.digikey.com/product-detail/en/infineon-technologies/BTS500101TADATMA1/BTS500101TADATMA1TR-ND/6565755 https://www.digikey.com/en/product-highlight/i/infineon/high-and-low-side-switches
H: Input voltage range for Wemos D1 board What's the input voltage range for a Wemos D1 board? I have a battery pack of 4 AA batteries. This makes 41.5 V = 6 V, but I think they can drop as low as 41.2 V = 4.8 V. Can I hook the battery pack directly to the input voltage socket? Or is this to much? What happens when I connect the D1 to the USB to program it? Must I disconnect the battery pack first? Sometimes it would be handy to let the USB cable connected to the debug output on the serial monitor. I'm aware of Power Wemos D1 mini from battery but that only answers whether 3 batteries are enough. AI: It's 3.3V linear low drop out regulator has a drop out voltage of up to 0.3V. The 5V regulator from VIN is unlabeled in the schematic so we can't say. Depending on how much it drops at 4.8V, the 3.3V should still be powered. But at 4.8V, your 4 AA pack is dead anyway. The board uses a comparator to disable the USB power input when the DC jack is used, so no, it would not work that way without you disconnecting the battery pack. As listed on the website, it says the DC input is 9V to 24V. There is a SS24 diode in the way, so that will drop about 0.3V at the currents used by the Wemos. Again, without knowing the 5V LDO's drop out voltage, then it may need much more than 6V. Frankly, you should inject the batteries to the 5V rail, through a 1n400x diode. That would work nicely, as the 5V is only used to power the 3.3V regulator.
H: Voltage Drop Calculation (AC) Hope someone can help me out and point me the right direction to solving this. I am trying to do a voltage drop calculation to see the VD % for the cable selected. The following are the values, Current: 140A (I) Resistance of Cable: 0.0001 Ohm/m (R) Reactance of Cable: 0.0000704 Ohm/m (X) PF: 1 Distance: 300m (L) Voltage: 20 kV (20000V) I am using the following voltage drop formula that I found in a very old school notes (can someone pls verify this formula)?, Vd = (I x (R cos theta + X sin theta) x L) / 1000 If I input the values into the formula, my answer is 0.266V. This does not look right for me as I will get a weird VD %. Can someone please assist? Thanks! AI: I think that the 1000 in your formula is placed incorrect and probably used when the length is in kilometers. So basically for a one phase load the formula is: $$V_d = 2I \bigl(R \cos(\theta) + X \sin(\theta)\bigr) L$$ Note: the first 2 is to get the result from source to load and the return as the return cable also influences the voltage drop For a three phase system the formula is: $$V_d = \sqrt{3} I \bigl(R \cos(\theta) + X \sin(\theta)\bigr) L$$ Where: \$ \begin{align} V_d&=\text{voltage drop in volts}\\ I&=\text{current in amperes}\\ R&=\text{conductive resistance in ohms/m}\\ X&=\text{conductor inductive reactance in ohms/m}\\ L&=\text{one way length of circuit in m (or km/1000 in your formula)}\\ \theta&=\text{phase angle of the load}\\ PF&=\cos(\theta)\\ \end{align}\\ \$ Answer \$ \begin{align} PF&=1\\ \theta&=\arccos(PF)=0\\ \\ V_d&= 2I \bigl(R \cos(\theta) + X \sin(\theta)\bigr) L\\ V_d&= 2\cdot140\cdot\bigl(0.0001 \cdot\cos(0) + 0.0000704\cdot\sin(0)\bigr)\cdot 300\\ V_d&= 2\cdot140\cdot\bigl(0.0001 \cdot1 + 0.0000704\cdot0\bigr)\cdot 300\\ V_d&= 2\cdot140\cdot\bigl(0.0001\bigr)\cdot 300\\ V_d&= 2\cdot4.2\\ V_d&= 8.4\\ \\ \end{align}\\ \$ So this gives a voltage drop for one run of 4.2 V and for a double run 8.4 V. Answer with different PF Because a PF of 1 in an AC circuit is not a real world example I will show the influence of a PF of 0.8 on the voltage drop: \$ \begin{align} PF&=0.8\\ \theta&=\arccos(PF)=36.8699°\\ \\ V_d&= 2I \bigl(R \cos(\theta) + X \sin(\theta)\bigr) L\\ V_d&= 2\cdot140\cdot\bigl(0.0001 \cdot\cos(36.8699°) + 0.0000704\cdot\sin(36.8699°)\bigr)\cdot 300\\ V_d&= 2\cdot140\cdot\bigl(0.0001 \cdot0.8 + 0.0000704\cdot0.6\bigr)\cdot 300\\ V_d&= 2\cdot140\cdot\bigl(0.00008+0.00004224\bigr)\cdot 300\\ V_d&= 2\cdot140\cdot\bigl(0.00012224\bigr)\cdot 300\\ V_d&= 2\cdot5.13408\\ V_d&= 10.26816\\ \\ \end{align}\\ \$ As a result of the reactive power the voltage drop will increase.
H: MAX6966 a suitable sink driver for nixie tubes? I recieved some IN-14 nixie tubes for Christmas, and was hoping to implement them in a project i have been considering for some time. The details are unimportant, except that each nixie tube should have its own discrete pcb and driver. After looking at ICs for some time I found the MAXIM 6966, a LED sink driver with some nifty features (though i would have preferred an I2C interface instead of SPI). It seems perfect for my project (driving a single nixie tube) for the following reasons: Tiny 3x3mm QFN package Exactly 10 outputs Open-drain functionality (output pins either low or Hi-z) PWM functionality on outputs My problem is this... the datasheet says the outputs have up to 7V protection, but i'm not sure if that applies to both Hi-Z and Low output configurations, or just the Low output configuration. With an output set to Hi-Z, the corresponding pin is likely to be biased to a high voltage such as 170V... well above the 7V protection. So that is to say, if the 7V max condition also applies to the Hi-Z pin configuration then I cannot use it. I hope it will work fine, but I suspect it isn't suitable. Could someone confirm my suspicion before I dismiss this otherwise fantastic IC? Here is a link to the product page: https://www.maximintegrated.com/en/products/interface/controllers-expanders/MAX6966.html Thanks :) AI: No, that device is not suitable for driving Nixie tubes. When an output is switched off, it will see the full voltage at the output pin. The datasheet clearly states that I/O Port Outputs Are 7V-Rated Open Drain That falls well short of the 170V you'll be using. Development of drivers specifically designed for Nixie tubes pretty much reached a dead end with the 74141, but there are some modern parts around that will carry out serial to parallel conversion and drive high voltage open-drain outputs. Look at the Microchip HV5122 or HV5522 for example.
H: Offsetting a differential amplifier to remove the need for a dual supply I'm developing two similar circuits that will enable me to differentiate the X and Y coordinates from a segmented photo-diode (Four segments). These coordinates will be dependent upon the position of a laser spot falling onto the surface of the segmented photo-diode. I hope to obtain a value between (0-5V) for X and (0-5V) for Y. The circuit I based my design upon used a dual supply (+5/-5V). In my application I am using a micro-controller with a 5V rail. The design would also benefit from a single supply if the output was a value between 0 and 5V as it would be compatible with micro-controller's ADC input range. I would therefore like to run the circuit from a single supply and use a rail-to-rail op-amp to to remove the need for extra circuitry. I've tried a few different simulations where I've attempted to offset the output by 2.5V using a simple voltage divider, but the results are not what I expected. Can somebody explain to me why the result is this way and what I can do to obtain a 2.5V output when inputs (A, B, C and D) are 0V. AI: If you connect A, B, C and D to ground (through the four voltage sources), you're putting R3 and R4 in parallel, and also R5, R6 and R9. You end up with a noninverting amplifier with a gain of 3 (defined by R1, R3 and R4) being fed by a voltage of 5V / 4 = 1.25V (defined by R5, R6, R8 and R9). So naturally, the output voltage is 3.75V, more or less. But to answer the question about what you should be doing will require more information about what you're trying to accomplish. Are you trying to come up with a single output that indicates how far "off center" the laser spot is on the 4-quadrant detector? Why are you modeling the photodiodes as voltage sources in the first place? Current sources would make much more sense. A normal difference amplifier for voltages looks like this: simulate this circuit – Schematic created using CircuitLab Vref sets the output voltage for a "zero difference" input. In order to work correctly, R1 = R2 and R3 = R4. Note that the components in the dashed box on the left are the Thevenin equivalent of the components in the box on the right — which is what it appears you were trying to do with your R8 and R9. Hmm. After rereading the question and its comments, I think I see what you're doing. You're trying to combine the outputs of all four diodes to determine, say, the up/down position of the laser spot, and the same circuit with a different combination of inputs to determine left/right. (So your fundamental error was that your R1 should be 10k rather than 20k. Do you see why?) It would be much simpler to just rotate the sensor by 45° and use, for example, A and C only for up/down and B and D only for left/right.
H: Second order active low pass filter values I want to use a second order active low pass filter to cut off frequencies over 33kHz . The input is 1.3 Volts peak to peak sine wave of 32 Khz and I want to make it 30kHz of 1Vpp . The formulas for calculating the values on the components of S.O.A.L.P. are for different SOALP than mine . Can someone provide me with the formulas that I need to calculate the values of my schematic or better provide the values and explain Edit: the op amp is provided 20V in the [+] wire and is grounded on the [-] wire Edit 2: the formulas I found for other SOALP are on this link http://www.electronics-tutorials.ws/filter/second-order-filters.html AI: There are better steps to design a filter of this type; Define specs then choose the type of knee response.. Low Q like Bessel give flat group delay or rate of change of phase shift. Higher Q with steeper edge like Chebychev compromise group delay but steeper edge and some ripple in passband. Others include Butterworth, etc. Filter specs Choose Type & order (2, 4, 6, 8 ...) (low cost and much better performance) or choose characteristics ( better) Pass band gain Pass Band bandwidth -3dB f Pass Band Ripple Reject Band __ dB at f then use www.ti.com active filter tool to design AC part , then do more to correct DC bias part. it only takes minutes to create an email login, validate, then use the tool http://www.ti.com/design-tools/signal-chain-design/webench-filters.html Ensure DC bias is in valid CM range by adding biasing, e.g. Vcc/2 instead of Gnd. Scale R up and C down to minimize current Check input bias current offset voltage and balance both input R equiv with suitable R's. on (+) input.
H: Atmega328 without bootloader Atmega328 is available in market in two versions - With and without bootloader. All prefer the one with bootloader. What will be the advantages/disadvantages of Atmega328 without bootloader ? I read that bootloader should be present in a controller for ease of programming. But I am not sure how it eases programming. AI: A bootloader lets you get your program into the chip without a separate physical programmer. The bootloader has to be written to work with particular hardware, like a board that brings UART connections out to a serial port, for example. To use the bootloader, you have to run a specific program on the host computer. This program reads the HEX file with the code you want to program into the part, then communicates over the interface provided by the hardware and using the protocol specified by the bootloader. The advantage of this is that if you have the right hardware, you don't need a physical programmer. The disadvantage is that programming the bootloader into the part is a extra step in manufacturing, so the part costs more. For the vast majority of parts sold, the bootloader is of no value. Some production jig will program the parts. For any serious development, there will be a programmer/debugger available, so again the bootloader is useless. The part with bootloader is aimed at hobbyists with arduinos or hardware compatible enough with them for the bootloader to work.
H: Purpose of black overlay in flex circuit design Does anyone know the purpose of the black overlay I see applied to flexible circuits inside phones? This is inside the S7, I see the same thing in the iphone. It's clearly been applied on top of the coverlay. So what purpose does it serve. Could be EMI maybe? Maybe it's just for style... AI: that is a conductive EMI shield