text
stringlengths
83
79.5k
H: Servo motor always limited in range? I am reading up on (servo) motors to start to play around with them. It seems to be that all servo's are limited in range. Most have a 180 degrees range I read. This would mean that the shaft of a servo never rotates a full cycle. Is this really the case or I am missing the obvious here? AI: RC servo’s use a linear Pot for internal feedback are limited in range usually by the rotary magnet. But if you have a gear reduced motor e.g. 1000:1 with a sin/cos pot, then you can have continuous 360 deg control. But these are vastly more expensive. I used them in the late 70’s with Bourne Pots and Swiss motors for an XY scope auto zero and rotate phase to a reference from an eddy current test signal. stepper servos use an external “home” or Trk0 index sensor for a reference like Floppy Disk drive head actuators for continuous control.;
H: What makes an active buzzer oscillate? All I can find online are descriptions on how active buzzers have an oscillator built in so that you just need to feed them a DC and they buzz at the frequency set by such oscillator, but I haven't been able to find either a diagram, description or teardown of an active buzzer to see how is this usually done. I can easily see how to build an active buzzer from a passive buzzer providing one of infinite possible ways of implementing an oscillator, but I wonder how is it actually done, specially on the tiny packages. I've seen a teardown here, fantastic BTW, but I assume there are other much simpler/cheaper constructions. AI: There are 2 kinds of buzzers. Piezoelectric ; which use internal CMOS Osc like 4xxx These operate like any Crystal Osc. Except the ceramic diaphragm is a large crystal. All std ceramic caps in fact are piezoelectric but incapsulated. These buzzers operate over a wide V+ range and use low current. Schmitt Trigger Inverter oscillators are very simple using Dc negative feedback to self bias and with 180 deg phase shift , Ac Positive feedback to oscillate reliably with a square wave. An extra inverter doubles the voltage across the resonator. Since they use 4xxx series CMOS the driver impedance fairly high from 3k to 300 ohms at max voltage, they may be ganged in parallel for higher power. Magnetic ; which use a relay type mechanism on the sound diaphragm that the internal coil current breaks from the metallic diaphragm , when actuated , so it relaxes by a spring and repeats . These take more current >20 mA typ depending on dBa levels.
H: Altium - How to disable white (polygon?) outlines during interactive routing I seemed to have pressed some hotkey activating a white outline around same layer objects during interactive routing. See image below. It seems to slow down FPS quite a bit, so I'd like to disable it. Can someone tell me (1) What the white outline means / what it's for (2) How to disable it? AI: I think @Hearth is correct. Try Preferences->Interactive Routing->Interactive Routing Options and de-select "Display Clearance Boundaries".
H: What for are two resistors and one capacitor when attaching an audio CD drive output to a TDA7318, but not for Line In? I'm trying to build a TDA7318 audio mixer chip into my automobile infotainment system. Now I've found a similar project, where the output of the CD drive is attached to the chip by using two resistors (one in series, one in parallel (attached to ground)) and one 2.2 µF capacitor (in series). There are also two Line In inputs, both of them just with a cap in series. The tuner input has neither resistors, nor a capacitor. Why is it so? The official datasheet of the TDA only mentions 2.2 µF caps, but for each audio input. Will I need the caps or even the resistors when attaching a computer sound output and a DAB+/FM radio board? Sorry for a question, which might sound pointless, but I'm not an audio systems professional. AI: The tuner is built into the unit, utilizing a Philips OM5610 module. The datasheet shows (page 11, pin 9 and 11) that this module has the audio coupling/DC blocking capacitors built in so there's no need to add additional ones. The other audio inputs are connectors to external devices. One cannot make assumptions about external devices so it's best to add the capacitors to block any possible DC on those inputs. The 2 resistors on the CD player input form a resistor divider that attenuates the incoming signal amplitude by approximately -1.7dB. Why is anyone's guess. Perhaps the author's CD player is a bit too loud.
H: MOSFET: Cannot control gate signal using Arduino PWM I attempted to power a 100mA LED with my Arduino. The power for the LED was provided by a battery (3.0V) - tge Arduino was connected via USB to a computer. The idea was to use the Arduino PWM to regulate power from the battery to the LED. Wiring the N-channel Mosfet (IRFZ44N) mostly as shown in the picture (taken from this guide) below (where the power supply is a battery.) For simplicity I connected the gate signal directly to the Arduino pin (without resistors.) I observed something that I couldn't explain: The PWM signal (or 3.3V or 5V pin) from the Arduino seemed to have no effect. Connecting the gate wire to either + or - of the 3V battery circuit turns the LED off and on. My (noob-level) concept so far was that MOSFETs are simply 'voltage controlled switches' and therefore this doesn't make sense to me. Can someone explain (in layman's terms) why this is happening? AI: I will guess that you did not connect ground from the Arduino to ground for the MOSFET circuit. That is required. I am assuming that the LED does light up when you close the switch.
H: Confusion about relationship between energy per coulomb, and the amount of coulombs in current I am trying to understand how a power supply works and working from the ground up I am learning about electricity, voltage, current, amps, and wattage. I am new to this stuff so I apologize if this is an easy or already answered question. From what I have read so far, here is my understanding: electricity in a current is the movement of free electrons through a conductive material. The free electrons "hop" from one atom to the next. a coulomb is a unit of charge. Charge by itself is just a property of an object, number of electrons or lack thereof. When charges are separated, they create an electric field, which then allows you to define potential energy that an object in the field would have, depending on its location in that field, regardless of its charge. The potential energy is the Joules/Coloumb at that specific point in the e-field, which is volts. If you take volts * charge of object in the field at that point, you get the electric potential energy that the charge would carry. That electric potential energy is converted to some other energy for useful work as the charge moves through the current - light, heat, or power for a component. This is analogous to how potential energy of a falling object in a gravitational field is converted to kinetic energy. The AMOUNT of charge, moving past a specific point, is the Amperes. This is a rate measurement in coulomb's per second. Voltage and Amps are directly proportional. If you take voltage, which is joules per coulomb, and you take amps, which is coloumbs / s, and you multiply them, you get joules / s. This intuitively to me, means the amount of energy that can be provided to some component in a circuit, per second. This is Watts. My confusion is that I don't understand the relationship between "amount of charge" and "energy of charge". A common analogy used here is water and water pressure. If I have a tank filled with water, and I attach a hose at the bottom, and I apply X amount of pressure, a certain amount of water (measured volume of water) will move past a certain point in the hose at a rate of Y. If I increase X, then the water molecules move more quickly through the hose, meaning numerically more water molecules move past the certain point, so Y (flow rate volume / second) increases. So, more pressure causes water molecules to move faster, meaning more water gets through the hose - i.e more volume of water per second. With voltage and charges, voltage is supposed to represent pressure. If I increase the voltage, the numerically more electrons - more units of charge - flow through the circuit. But due to what? In other words, my question is: Which of the following is correct? More couloumbs AND more energy per coulomb: When voltage increases, amount of energy per unit of charge increases. This means each unit of charge is more "energized", and BECAUSE of that, moves faster through the circuit. Faster charges means MORE charges move through the circuit per second, and because each charge is MORE energized, there is more joules per second at any given point in the circuit (more work). More coulombs BUT same energy per coulomb: When voltage increases, more units of charge flow through the circuit. But each unit of charge still has the same amount of energy as before the voltage increase. The increase in potential energy is spread across more coulombs of charge. Same number of coulombs BUT more energy per coulomb: When voltage increases, the number of coulombs flowing through the circuit remains the same, but the energy per coulomb increases. I know 3 will not be true because of V = IR, but I want to understand this on an intuitive level. Does the increase in voltage equate to increase in energy per unit of charge, or does an increase in voltage keep energy per charge equal but forces more charges to flow through the circuit? AI: electricity in a current is the movement of free electrons through a conductive material. This is one kind of current. But it's also possible to have positive current carriers. Batteries and many kinds of transistors would not work if electrons were the only kind of current carrier. Voltage and Amps are directly proportional. This is true in a linearly resistive material. For example in a copper wire or a resistor. In other components, there will be a different relationship. For example, in a (junction) diode the current goes up exponentially with increased voltage across the device. In a transistor the current through one branch of the device may depend on the voltage across a different branch of the device. Which of the following is correct? Again, it depends what kind of device you are investigating. More couloumbs AND more energy per coulomb: This is the behavior of a resistor. If you increase the voltage across the resistor, by definition, you've increased the energy per coulomb lost as charge flows through the device. And, because of the nature of the resistor, you will also increase the current (rate of charge flowing through). More coulombs BUT same energy per coulomb: This would be the behavior of a voltage source when you change its load. You can increase or decrease the current you draw from it, but it will always (to the extent it's an ideal voltage source) produce the same potential across its terminals. Same number of coulombs BUT more energy per coulomb This is the behavior of a current source. You can apply whatever potential you want across it, and it will always (again, in the ideal case) produce the same current.
H: Is any signal ever one way I am trying to confirm a suspicion/understanding about electrical signals, and especially One-way CONTROL signals i.e. specifically NON-Power type signals in electronics like, Trig/Echo pin in UltraSonic Sensor, Digital IO line on an application specific IC/Sensors feeding into a microcontroller via high speed buses. High Speed USB Camera connected via Serial Tx/Rx which DO not EXPLICITY require a DEDICATED Ground (unlike power signal which requires a ground connection to function), but IMPLICITLY always return via Ground/PCB Ground Plane to the point of origin. In short, what I am trying to confirm is that, no signal (control or power) is ever one way, and MUST find a way back to its origin to complete its journey. In practice, we observe this on PCBs with ground planes, as every signal will find its own path back, usually right under the trace, on the ground plane underneath. AI: A physicist would say that "you are right - every signal transferring method which supplies a voltage between 2 wires from one device to another along 2 wires uses 2 wires". That's common solution because 2 wires is a technically simple way to transfer energy which actually travels in the space as electromagnetic wave between and around the wires. The wires only guide the wave. The current in the wire is a necessary interaction between the wires and the fields. It gives to the wires the ability to guide waves, but the energy isn't packed to the electrons in metal, it is in the space outside the metal. For very short distances a transformer is an useful way to put the fields to affect without a wire connection between 2 devices. A little more complex transfer method to use electromagnetic waves which propagate without any wires between transmitting and receiving antennas. Somehow intermediate way is to use transmission lines which have only 1 conductor like a waveguide (=tube which keeps the wave inside) or Goubau-line (= a single line without a pair which keeps the wave symmetrically around one wire) Most of us here are practical electricians. We avoid thinking the electromagnetic fields. If the signal frequency is low enough and the dimensions of our system are small enough we can calculate what happens in our systems very accurately with circuit theory. It uses voltages and currents but doesn't care how those things are related with electromagnetic fields. That's handy because e.m fields are complex 3D vector fields, a current flows along a wire and a voltage is a number between 2 points - much simpler. Physicists have created the circuit theory for us who like to keep our thoughts simple and still get some work done.
H: Create Transformer Center-tap From 2nd Secondary After ordering this 200VA, 32V transformer, I realized that it doesn't have a center tap on each secondary, which I need to have. (duh on my part) So I want to use 110V across the 220V primary leads to give me half the voltage at each secondary, resulting in a single secondary of 32V and a center tap. I know that this works because I have done it and observed that the output is 32V RMS with a center tap, but I want to make sure I'm not throwing away half the VA rating by doing so. I read TONS about transformers trying to get a definitive answer to this, and I think that the core saturation and the secondary wire size and associated voltage drop and heat are the main concerns, along with the fact that the ratio of number of turns is proportional to the ratio of the voltages and inversely proportional to the ratio of the currents in the primary and secondary. So on those points, I think I'm not reducing the usable 200VA, with the possible exception of secondary wire heating. To illustrate what I mean using the image below, I would wire-nut the middle black and red primary wires together and connect 110V across the top red and bottom black wires. And on the secondary, I would connect the middle blue and green wires and use that connection as my center tap. I would use the top green and the bottom blue wires as my supply rails and there would be 32V RMS across these rails. If that's confusing for me to say rails, I'll add that I'm using a bridge rectifier and 2 shunt capacitors to make them into +/- 45-ish volt rails for an amplifier. Yes, I know that this is NOT standard, and this is not for a commercial product, so please don't reply simply that this is not standard or that it will void my warranty. There is a similar question here with 2 answers to my question, but unfortunately those two answers contradict each other exactly. Also, here is a question with a very promising title, but the answers don't answer my question. The other similar questions don't have answers which address the current-rating-doubling part. Please weigh in if you know whether I can safely get the full 200VA in this way. AI: You will halve the rated VA of the transformer if you run it at half the rated input voltage. The rated maximum VA is the product of maximum allowable Volts and maximum allowable Amps. The Amps will be unchanged, that's limited by wire heating. You've halved the Volts, so you've halved the VA, to first order at least. Running the core at half the field reduces the core losses, so the thermal load on the transformer is not quite so high. This means you can increase the thermal loading on the copper a little, at the expense of voltage drop aka voltage regulation. Maybe then the rated VA has only fallen to 55% and not to 50% of what it was. If you have a centre-tapped 32 V, ie 16-0-16, you can bridge rectify that to about +/- 22 V. If you want +/- 45 V (that is, a total of 90 V from positive to negative, with ground in the middle), then the simplest way to get there is with a centre-tapped 64 V secondary (two 32 V secondaries in series), leaving your transformer configured and supplied as it sounds like it was meant to be, and like my audio amp transformer is. simulate this circuit – Schematic created using CircuitLab
H: Tap controller implementation in JTAG I’m looking at a TAP controller for the implementation of JTAG, but I’m not sure what which part of the diagram the top left circuit is refeering to. Are the boundary scan cells just D-flip flops? AI: The item in the top left of the graphic looks very similar to the boundary scan register ell from the JTAG standard, IEEE 1149.1 figure 1-1. Each cell consists of two muxes and 2 D-flip-flops. A group of boundary scan register cells are arranged into a boundary scan register. Data moves serially from one cell to the next like a big shift register. Setting Shift/Load = 0 and toggling clock A will load the left flip-flop in each cell with the pin value. Setting Shift/Load = 1 and toggling clock A will shift the captured data through each boundary scan cell, and eventually out of TDO so you can read it. You can also shift new data in via TDI that will can be loaded into the output registers. Toggling clock B can load right-most flip-flop in each boundary scan cell with the data from the left most one. This data can then be put onto the pin if the right-most mux selects that it should be put there. The right most mux selects weather the the pin value is controlled by the device under test, or if it is driven by the output flip-flop. Per IEEE 1149.1-2001 page 21 in the description for the Shift-DR state, Clock A is supposed to toggle once every time TCK toggles and the TAP state machine is in the Shift DR-state, and the boundary scan register is selcted. CLOCK_A <= TCK when state=shift_dr and bs_reg_selcted = '1' else '0'; Per IEEE 1149.1-2001 page 21 in the description for the Capture-DR state, Clock B is supposed to toggle once every time TCK toggles and the TAP state machine is in the Capture-DR state, and the boundary scan register is selcted. CLOCK_B <= TCK when state = capture_dr and bs_reg_selcted = '1' else '0';
H: LCR meter weird datasheet I have a LCR meter. In the datasheet there is a measurement frequency given for the inductance measurement. But not for the measurement of the capacitance. Is the frequency for the capacitance measurement not important? AI: While both capacitors and inductors have a performance that can vary with frequency, the sensitivity of capacitors to frequency is slight to non-existent. The sensitivity of inductors is serious to pathological. A good LCR meter will not simply tell you what the measurement frequency is, but will measure at several different frequencies, to allow you to see what's happening to the measurement. Capacitors At the sort of frequency common LCR meters use (kHz, 10s of kHz), the geometry/inductance of 'most' capacitors is negligible. The frequency dependent dielectric relaxation effects of most plastics are completely negligible, and you would be hard-pressed to measure the effects of electrolytics in a simple LCR meter. Inductors These are generally wound on a magnetic core. If you use a frequency that's too low, the core will saturate, and the measured inductance will change by orders of magnitude. If you use a frequency that's too high, the core will become very lossy, which may create a significant reading error, depending on the method the LCR meter uses.
H: Replacement for 50+ year old solder fuse technology I am refurbishing an old automotive clock (VDO Kienzle) that uses an internal low-melting point (~120 degrees F) proprietary solder "fuse". Is there a way to calculate or estimate the size of a suitable modern automotive fuse replacement, specified in amperage? AI: I don't know if it will be possible to determine at what current the solder fuse "blows." But as a practical matter, you could measure the normal current consumed by the clock, double it, then round up to the nearest standard value fuse. IMPORTANT: fuses are sized to protect the wire, not the device at the end of the wire. Wire and fuse must be chosen together. And of course, both must be large enough to support the load. Once you fuse the wire, it is OK to use heavier wire. The fuse imposes a minimum size on the wire, not a maximum. Based on the comment, maybe a thermal fuse would be more appropriate. It can be tricky to try to protect against a stuck solenoid using a normal over-current fuse. The reason is that you WANT the fuse to blow when the normal operating current happens, but only if it happens for a long time. Unfortunately, if the solenoid gets stuck on, the copper wires will heat up, increasing resistance and reducing the current. This means you need a smallish fuse. But if the fuse is too small it may blow when there is no fault. On the other hand, if it is too big, it may not blow even when there is a fault, because the solenoid current will decline over time. It is kind of like chasing a ball downhill. You try to catch up with it but it goes faster and then you speed up, but by then it speeds up too, and you never catch it. I have been down this road before trying to find the goldilocks fuse. If the solenoid is accessible it may be better to put a thermal fuse in physical contact (with silicon or something) with it. So the solenoid current goes through a thermal fuse (AKA thermal cutoff or TCO) which physically touches the solenoid. Then if the points stick, and the solenoid starts to heat up, the heat will reliably blow the TCO. TCO's are subjected to a lot of regulatory stuff and are very reliable because of it. Protecting against over-temperature is their one and only job. There are wide ranges of temperatures available. See just as an example the NTE8070. (No affiliation or commercial interest on my part and there are other parts out there this is just an example). https://www.nteinc.com/specs/8000to8999/pdf/TCOs.pdf
H: My daughter's science project is to charge AA batteries with a solar panel We bought a 0.5 watt solar panel with 4.5 V, a 4 AA battery holder and a 15 ampere Schottky diode 45V , and 4 lithium ion rechargeable batteries. We connected the red positive solar wire to the diode. We assumed the end of the diode with the silver line is the cathode and connected that end to the solar red wire. We then connected the red wire on the battery holder to the opposite end of the diode that was black. The black wire on the battery holder was placed with the black end of the solar panel. We placed it in the sun to charge but my daughter said it did NOT charge the 4 lithium batteries. Please let me know where I went wrong. Thanks so much for such a quick response! You engineers are amazing, kind and helpful people. This world would be a much better place with people like you in government....but I guess that's why you are engineers. I heeded everyone's comments. I still used the 0.5 watt solar panel with 4.5 V, a 4 AA battery holder and a 15 ampere Schottky diode 45 V, and changed to 4 Energizer Recharge Power Plus 2300 mAh NiMH AA. I changed the direction of the diode. Guess what!?! It worked. Thank you for all the warnings about the lithium CoO2/graphite Tenavolts 1.5V AA High-Capacity Rechargeable Batteries with 2775 mWh. Out of curiosity, because we used a 4.5V solar panel and the lithium batteries were 1.5Volts (x4) the total voltage need to charge would 6V solar panel. By using a solar panel that was less than the required voltage, would the batteries get charged but not to full capacity? Would that decrease the risk of fire? How does time of charging come into the equation? Any books or websites recommendation that are not too esoteric that can explain this to my 12 year old daughter and me would be greatly appreciated. AI: You have the diode backwards. Connect the black end of the diode to the red wire from the solar panel, and the end of the diode with the silver band to the red wire of the battery holder. A 4.5V solar panel won't generate enough voltage to charge the batteries. Lithium ion cells have a voltage of 3.6 volts and higher. Four such cells in series means a charging voltage of at least 14.4 volts. Your solar cell can't produce that voltage. This is probably a bad idea, any way. Lithium ion batteries tend to catch fire if improperly charged. A proper charger is not a solar cell and a diode. You could use your solar cell and diode to charge nickel cadmium cells or nickel metal hydride cells. The crude charger will damage them over time, but they won't explode or catch fire. The voltage of the cells also fits better with the available voltage from your panel - the nominal cell voltage for NiCad and NiMh is around 1.2 volts, so four of them in series could get a decent part of a full charge from your solar panel. Your cheapest bet is to switch to NiMh cells. They are readily available, and you can charge them with your solar panel. If you want to stick with lithium ion cells, then you'll need to look into getting a proper battery management IC or module. That can get expensive and complicated for a science fair project. The Tenavolts batteries you mention in the update contain safety circuits and regulator circuits. They probably wouldn't go up in smoke if you tried to charge them with your solar cell - but there's no guarantee they would charge at all. Tenavolts is using lithium ion cells with a buck circuit to provide a constant 1.5V output until the cell reaches its discharge limit - at which point it just shuts off. It probably also has a charge circuit built in, but Tenavolts doesn't provide any information about that.
H: Calculating the power lost per foot from “\$I^2R\$ losses" I am currently studying The Art of Electronics, third edition, by Horowitz and Hill. Exercise 1.6 says the following: C. Power in resistors The power dissipated by a resistor (or any other device) is \$P = IV\$. Using Ohm’s law, you can get the equivalent forms \$P = I^2 R\$ and \$P = V^2 / R\$. Exercise 1.6. Optional exercise: New York City requires about \$10^{10}\$ watts of electrical power, at 115 volts (this is plausible: 10 million people averaging 1 kilowatt each). A heavy power cable might be an inch in diameter. Let’s calculate what will happen if we try to supply the power through a cable 1 foot in diameter made of pure copper. Its resistance is \$0.05 \ \mu \Omega\$ (\$5 \times 10^{−8}\$ ohms) per foot. Calculate (a) the power lost per foot from “\$I^2R\$ losses," ... So we have that \$P = \dfrac{I^2}{5 \times 10^{-8} \ \Omega} \$, which means that we need to find the current \$ I \$. I sought to use Ohm's law: \$I = \dfrac{115 \ \text{V}}{5 \times 10^{-8} \ \Omega} = 2.3 \times 10^{9}\$. Have I done this correctly? If not, then why is this incorrect, and what is the correct way to do this? AI: It is important here that you differentiate between the power dissipation (losses) in the wire and the power that is still available for the consumer. The power that is supposed to be available for the consumer is provided: $$P_{load} = 10^{10}\; \text{W}$$ You are also provided with the load voltage for the consumer: $$V_{load} = 115\; \text{V}$$ From this information you can calculate the current that is required to achieve the stated power at the given voltage: $$I = \frac{P_{load}}{V_{load}} = \frac{10^{10}\; \text{W}}{115\; \text{V}} = 8.7 \times 10^7 \; \text{A}$$ Now that you know the current you can calculate the resistive losses caused by the wire with the provided resistance per foot: $$P_{loss} = I^2R$$ The results are of course pretty silly. Nobody would think about supplying all of New York via one thick wire at 115V. But generally this kind of calculation can be applied to more realistic scenarios.
H: UART receiving random values I tried to transmit "S" using De0 nano FPGA board and UART over USB module . The problem is i am not receiving "s" constantly . I am using the software Called Hterm to see receiving data. When i remove the USB to UART module from the PC and reconnect the receiving value changes. After removing the Module and plug it again the value changes. And after this is received "S" AI: The problem is sending constant data stream without any pauses between symbols. The ASCII symbol 'S' has a value of 0x53, so it is sent over the wire as repeating pattern of 0110010101 which includes the start and stop bits. Because there is no pauses between transmissions, the receiving UART does not know which bits are the start and stop bits in the constant data stream, so it may synchronize to any wrong but valid-looking point in the stream. There are 4 combinations of valid symbols when sending out ASCII letter 'S' constantly. In addition to the 'S', they are the following: 0101011001 is one combination that also looks like perfectly valid symbol, that's 0x35, the ASCII symbol '5' you are seeing. 0101100101 is another one, that is 0x4D, the ASCII symbol 'M'. 0010101011 is another one, that is 0xAA, which is an unprintable ASCII character, the box you are seeing. This is why there should never be a constant symbol transmission, at least occasionally an idle space that is longer than one symbol should be sent to make the receiving UART to synchronize properly on the actual start bit.
H: Colpitts Oscillator - Supply/Output Voltage I try to simulate Colpitts oscillator but i got stacked about one thing. When I simulate this circuit, the output Vpp is 24 V in other words, it oscillates between 0 V and 24 V. The question is, we give 12 V DC supply voltage to the circuit and we get 24 Vpp output voltage what is the reason of it? Why the output peak to peak voltage is more than 12 volt while supply voltage is equal to 12 volt? So much thanks. AI: The question is, we give 12 V DC supply voltage to the circuit and we get 24 Vpp output voltage what is the reason of it? It's because the collector connects to 12 volts via an inductor. That's the short story. The longer story requires you to think about the average voltage drop across an inductor. If the average volt drop is anything other than zero volts then the current would have to rise and rise until the inductor core saturated or the power supply collapsed. That doesn't happen because the transistor sets the collector current to be 1 mA or 10 mA or whatever value in that sort of range. Now, because we are controlling the current through the inductor to a sensible smallish value it has to mean that the average voltage across it is zero volts. If the average voltage across the inductor is zero volts then, the average voltage on the collector is 12 volts. If the average voltage on the collector is 12 volts, then any AC signal on the collector has to rise equally above 12 volts in one half cycle and fall by the same amount in the other half cycle. For instance, a 2 volt peak-to-peak signal on the collector will rise up to 13 volts and drop down to 11 volts. This keeps the average voltage across the inductor at 12 volts. So, if you pushed it, you might see a peak of 24 volts and a trough of 0 volts. If you pushed it too hard you might cause the transistor to switch off completely and you might get inductive kick-back that raised the peak voltage higher than 24 volts and, that could potentially damage the transistor. But we don't do that.
H: How do you decide on having more than two layers to have on a PCB? I just started writing my bachelors thesis. I have been working as a junior hardware designer for a little less than a year now. All the boards I have designed until now have 2 layers. For my thesis I will be designing a board around the new Raspberry-Pi compute module 4, so I would like to know if I should base my design on a 4 layer board. 1.st Question I see that for RF, low noise, high speed etc. applications 4 to 6-layer boards are used. I haven’t taken a lecture on the subject yet and most of my PCB knowledge is self-taught outside of the university. I would really appreciate it if someone could explain why and when to use more than 2 layers for reasons other than board complexity. If you could link maybe a book or lecture to the subject it would be even better. 2nd Question I vaguely understand that for high speed boards like computer mother boards, multi-layer boards are used. Referring to my 1st question, why? Would I need to make my board multi-layered? If yes, how should I go about my layout and copper regions? Are there any mystery rules that I should take into account other than respecting the datasheets of the ICs I use? AI: This is a pretty broad topic, so I'll try to keep the answer general, instead of trying to answer all in detail. First of all, some components force you use more than two layers. You simply cannot export all signals from a dense BGA chip on two layers. There's simply not enough room. Then, some problems force you to use more than two layers for traces. Can't get the trace density on two layers; can't control impedance well enough (or with thin enough traces) on two layers; can't get the heat away quickly or the supply current enough without a dedicated power and ground plane... Most importantly, ground return paths are important, and if you need to break your ground plane because a single signal layer simply isn't able to support your circuitry (which easily happens, most schematics are not planar graphs...), then you've lost. Then, the huge area of things that are trade-offs between complexity, cost, signal quality, ease of routing, manufacturing abilities, ... start, and you could (and will) find library shelves full of advanced PCB design methodology that explains what you can (and cannot) do on any given number of layers. For example, I don't know your salary, but not all boards are produced by the millions. If you need 10 boards of the same design, and layouting things takes you twice as long if you need to do it on two layers instead of having the freedom of four layers, well, it might simply be cheaper and better to do it on four, and move on to the next design. Note that you say "4 to 6 layers are used"; but really, you can order (as far as I've personally seen) 18 layer boards (the comments show much higher layer counts, even!), so the world is slightly more complex than you think :)
H: Can this low-pass filter for audio possibly work without a power source? In MOSQUITO: Covert Ultrasonic Transmissions between Two Air-Gapped Computers using Speaker-to-Speaker Communication, M. Guri et al describe a malware capable of bridging air gaps and creating a bi-directional covert channel by turning connected audio output devices, e.g., speakers, headphones, etc., into microphones using what's called jack restasking. One of the countermeasures proposed is using a low-pass filter circuit like the one shown here: No specific components or parts are mentioned or suggested. Would it be possible to make this circuit work without connecting a power source to it? One of the answers to this question mentions: In general it is bad practice to apply input signals to a device before applying power. When you do this, you can cause semiconductors to 'latch up'. The semiconductor can act due to its physical build as a SCR (Silicon Controlled Rectifier), which can cause it to short out its pins. and another says: With no power supply, the transistors in the IC would not do anything, so the input would be "ignored"...and there would be no output. It requires a power supply to open the switches to let the signal in. Right now, I'm looking at using either an LM358 or LM386 for the amplifier as they are what I have available, but would there any amplifiers out there that could make this work without an external power supply attached? AI: In general, no circuit that had an active amplifier works without a power supply.
H: I2C bus with different voltages slaves I have one MCU powered with 3.3v acting as an I2C master in the BUS and 4 slaves, one of them is 3.3v logic and the others three are 5v logic. It's ok if they share the BUS, connecting the 5v devices to the BUS using a MOSFET level shifter and the 3.3v device directly to the BUS?. AI: Yes, this is often done. A common approach looks like this: simulate this circuit – Schematic created using CircuitLab You need to make sure to use a logic level N-channel MOSFET that will be fully on @ 3.3 V. Note that you will need two of these circuits, one each for SCL and SDA. The resistors may need to be adjusted depending on speed and number of slaves. Another solution would be to use a dedicated I2C level shifting IC like a TXS0108.
H: What is the irregular signal at the bottom of this "spectrogram"? I am reading research papers about LoRa, and I have come across the below figure in this one. The horizontal axis is clearly labeled frequency, but the vertical one isn't. I recognize the chirps in the middle, so I understand that the vertical axis is indeed time for that graph, but I still have no idea what the other, darker blue graph represents. Could you shed some light on this please? AI: That's two diagrams in one: The background one, the turquoise zig-zag, is called a waterfall; the vertical axis is time, the horizontal is frequency, and power is coded into color. the line at the bottom is something else; maybe just a time trace; it's at the very least not a representation of the spectrum at the same bandwidth, because otherwise, the center would have to have higher amplitude (where the zigzagging happens) Generally, if a figure is unclear, that's a fault in the publication you're reading, and since this curve isn't described any further, I'd recommend ignoring it.
H: Current drawn by MQ9 Sensor Here is the datasheet of the MQ9 sensor I would like to be sure about the current drawn by this sensor. The datasheet doesn't say anything about that, but tt says the power Ps heating comsumption is about 340mW and the heating time is 60 to 90s Is the current drawn just for 60 to 90s (o I=Ps/Vcc=340mW/5v=68mA) or should that be calculated when RL is inserted? AI: The MQ-9 uses a heater (a filament lamp more than likely) to produce a broad band of infra red spectrum. The quantities of gas present of the right molecule will absorb some of that light at a certain wavelength and this allows the sensor to estimate the gas mix percentage. The data sheet shows this: - I would like to be sure about the current drawn by this sensor, the datasheet doesn't tell anything about that The heater voltage is 5 volts and the heater resistance is 33 Ω hence, the current is 151.5 mA typically. RL doesn't play a role in the dominant current consumption of the device. It says the power Ps heating consumption is about 340mW I expect that is an average power based on something around a 50% duty cycle (see picture below) or maybe the heater resistance rises as it warms and thus the power stated (340 mW) implies a hot heater resistance of 73.5 Ω. The picture above taken from this much better data sheet.
H: Sensing 24v AC with 4N35? Basically I have sliding gate which has contacts to turn lamp when it's open or closed (two different ones) that are rated 24v AC max 3W. I would like to use those contacts to know if the gate is open or closed. I'm a total newbie in electronics, googled a bit, and found that what I probably want to use is optocoupler. And found a scheme like this: Explanations seem logical, I can get 4N45 at my local shop and for diode I would use 1N4148. The thing is that I already have low amps (0.125) so will it be enough to drive the 4N35? AI: From the datasheet. The 4N35 isn't rated for an input of more than 50 mA, 0.05 A. So if that's not enough for your application (the output current of a 4N35 is approximately equal to the input current, and also isn't rated for more than 50 mA continuous), it's not a good part for this application anyway. But I don't think you'll need more than that; that's quite a lot of current for a signal.
H: Class AB Amplifier - Weird oscilloscope output I have built this little kit for a class AB Amplifier. This is the schematic if you do not want to follow the link It works fine, I can hear decent sound. I then tried to check the output with an oscilloscope to learn a bit more. I am using a bitscope micro USB oscilloscope. I have replaced the speaker with 5 47 Ohms resistors in parallel to cope with the load. The voltage peaks match what I get in LTSpice, but I was a bit surprised to see the straight lines on the descending and raising part of the wave. This is for a 50mV peak signal @ 1kHz (the maximum allowed by the design). The clipping is obvious when I increase the signal, and the strange behaviour is still there even if I halve the signal to 25mV. The device is also a function generator. This is what the input signal looks like (100mV sine wave). Do you think it is because of the oscilloscope limited sampling or some kind of distortion? Solution (I think) The answer from bobflux made me think that problem was in the quality of the signal. If you look at the signal trace you can see that there is a lot of noise. The solution was to introduce a 10/1 voltage divider (10K/1K) and increase the input signal to 1.1 V. This creates a beautiful sine wave (although it is seems a bit attenuated). AI: Quantization steps are visible in the waveform. The amplifier can't generate those, so they either come from the (presumably digital) signal generator, or from the scope analog to digital converter. However... If the quantization steps were from the scope ADC not having enough bits, then the sloped top would be flat and horizontal: it would be a single quantization level. If we're seeing ADC quantization, then the signal as displayed has values between quantization steps, which is not possible. So, the sloped top happened after the quantization that creates the visible steps. This means either: 1- The quantization steps come from the signal generator (probe signal generator output to investigate) 2- The quantization steps come from the ADC, but some sort of digital processing is applied to the data after conversion, which gives this abnormal result. In both cases, this is a measurement problem, and your amp is most likely not to blame.
H: How do causality and stability affect the response of a linear time-invariant system? Suppose that there's a linear time-invariant system with the following transfer function: $$H(s) = \frac{1}{3(s-2)}-\frac{1}{3(s+1)}$$ If the system is causal and stable, I can determine \$h(t)\$ by simply evaluating the Laplace transform of \$H(s)\$. Now, if the system is neither stable or causal, how would I determine \$h(t)\$? I can't figure how the response in time domain is affected by causality and stability, in general. AI: Technically, the Laplace transform already implies a causal system by its definition: $$F(s)=\int_0^\infty f(t)e^{-st}dt$$ As you can see, the integral starts from 0, so this implies that \$f(t < 0) = 0\$. In other words, a non-causal system would react before it received the Dirac pulse or \$f(t < 0) \neq 0\$. A regular Laplace transform would not work in this case. If the system is causal, the method of finding \$h(t)\$ does not change whether or not the system is stable or unstable. The example you gave has a pole in both left- and right-half plane and is therefore unstable, but the inverse Laplace transform can still be calculated (IIRC) to be $$\frac{e^{2t}}{3} - \frac{e^{-t}}{3}$$ As you can see, the first term explodes as \$t\$ increases, hence the system is unstable, but I didn't have to use any weird techniques or something. If you are given the information that the transfer function is a two-sided Laplace transform, then you cannot assume anymore that the system is causal while you might still reconstruct the impulse response from it, but I have never encountered such a situation.
H: Recharging a Li-ion battery while using it Right now I am designing a circuit that will charge a Li-ion battery via USB, using the MCP73831 (at 100 mA). The battery voltage (nominally 3.7 V) will be regulated to 3.3 V to power a microcontroller like an ATtiny85 or ESP8266 for example. Below is what I have so far. My question is: Are there any flaws/mistakes I made, and how can I charge the Li-ion battery while simultaneously powering the MCU? Because right now I can only charge OR use the MCU, depending on the SPDT switch. AI: Most Li-ion chargers don't charge a Li-ion battery with a load attached correctly, because the load current interferes with the charging algorithm. Charger ICs that can support a load while still charging correctly exist, but your MCP73831 isn't one of them. The MCP73871 is; it supports load sharing and can supply a load while charging the battery. You could add a load sharing circuit to your MCP73831 if you want to get rid of the switch; see MCP73831 Li ion battery charger problem with load sharing circuit for an example of how to go about it. There's also a Microchip application note that describes how to do it.
H: Power consumption LCD display on digital watch 12h/24h just a fun question: When I was a child, I thought that displaying my casio F91w in 12h mode rather than 24h will make my battery last longer since there are fewer segments displayed. when i saw this graph i realized it wasn't that simple. Does the energy consumption depend on the number of segments displayed and does switching to 12h mode increase the battery life? Was i wrong as a child? on the graph, we can see that the consumption of an on or off segment seems the same. Is it true? AI: A single segment of an LCD display can be modeled by a (very tiny) capacitor. The segment is ON when there is a voltage difference between the capacitors terminals. The LCD gets damaged if the segments/capacitors are driven with a DC voltage. That's why the LCD driver always needs to toggle the signal polarity on both terminals. (Check the mean voltage in the graph above: It's 0V). For driving the segment in ON state, the capacitor is recharged a lot (switching losses!), where in the OFF state, there is no voltage difference between Backplane and Segment terminals. So your assumption is right: The fewer segment are in the ON state, the less current is used.
H: Ideas for driving an electromagnet with high voltage AC current from a PCB I have an aquarium pump that is no longer being used and I want to integrate it into a design of mine. I am inexperienced designing for stuff with high voltage AC or AC current in general. i've done many <12V DC electronics designs, even complex ones involving BGA FPGAs, I've never NEVER touched high-voltage or AC current on my PCBs before. Here are some photos of the pump: https://imgur.com/a/iZFpGGL]https://imgur.com/a/iZFpGGL[/url The pump plugs into mains voltage and seems to have a potentiometer and some passives to control the amplitude, and what i believe is a flyback diode for the inductive load. I'm not really sure the circuit for it but i'd be happy to dissect if further if someone wants to help explain what each passive does. I assume the diode is for sinking the induced negative voltage from the massive inductor when the AC voltage switches polarity, but i'm not sure what the capacitor is doing there. I only plan to use "half" of it since it's essentially two electromagnets each of them pushing two dual-diaphragms. So I only intend to use one electromagnet pushing two diaphragms. The product page for the pump shows that the entire unit only uses 6 watts at 120VAC, i only need half the unit so the section I would need would use 3W@120VAC; quick calculation means one half only uses 25mA of AC current. At first I was thinking of plugging mains power directly into my PCB using something like an IEC connector and then using a PCB mounted AC-DC converter to step down to 5 volts for the rest of my design (raspberry pi zero, stepper motors, LCD display, etc) and have the AC side of the PCB feed into a relay that connects to the inductor and have the relay switched with the raspberry pi's logic level output. This seemed like an okay approach but it also has me nervous since i've never used high voltage and in addition the PCB mount switching power supply i'd need to go from 120VAC to 5VDC would be huge and unwieldy to design around. That part alone would take up half of my planned PCB board space. I need at least ~7Amps supplied on the 5VDC side because that side of the design uses 12 MG996R servos which have a running current of 500mA; truth be told I will only ever be actuating one servo at a time but when the board comes online I don't want the inrush current from all the servos to burn anything out. The other components (rapsberry pi, LCD display, addressable LEDs, etc) all use a relatively small amount of current, the Pi being the largest at no more than 300mA (but probably no more than half that to be honest). I was wondering if a better idea was to use a commercially available power brick to provide 12VDC 10-15A to the board and then make a smaller section of the PCB somehow drive the AC electromagnet. Is believe DC-AC converters are called inverters? Does it seem reasonable to be able to convert 12VDC to AC for something this low power (roughly 25mA by my calculation)? I've also found these but the output frequency is too high to drive the electromagnet correctly. What do you all think? Should I use the huge PCB mount AC-DC converter with a relay thrown from the 5V side? Or is there another circuit I could build if instead I supplied 12VDC 15A and used a section of PCB to convert to higher voltage AC? Would an H-Bridge driver work for this? Maybe I could use a DC-DC converter to generate 120DC and use an H-Bridge to alternate the current flow? It would be a square wave so maybe I could use a low pass filter to get a sinusoid. I would need another circuit to do the switching unless I manually controlled the switching in software (non-ideal as it's one more thing to deal with). AI: Assuming you absolutely must use this specific pump and no other, the way I would do it is as follows: Bring 120 V mains into the enclosure, but not onto the board; have it go into a pre-made and certified power supply (like one of these, for example) so you don't have to worry about dealing with mains isolation on your board. Then have the mains line also go into an off-board relay (I'd use one like this in an off-board relay socket), and then have your circuit switch the relay's coil voltage, which is a nice safe 24 volts (you can find 12 volt ones too if you want lower!), thus avoiding any need for mains voltage on your board. This is not the smallest possible solution, and if you have space to put a DIN rail you can use DIN-mount PSUs and relays to make things a little neater, but this is how I'd go about solving this problem.
H: Regarding PCB IFA microstrip antenna mirror image on ground plane hole areas This is regarding the adjacent mirror image formed over the ground plane by a PCB antenna during operation. Take the first image of the IFA with the ground plane highlighted in yellow on layer 2, the top signal layer is hidden in the image. Say I have some through-hole components or vias to other layers which would punch holes in the second layer ground plane as shown. Now take the second photo of the antenna image mirrored over the ground plane as it would be during operation. Do these holes in the ground plane where the mirror image is forming have any effect on the function or effectiveness of the antenna, or degrade the performance at all? AI: Thanks for asking an intriguing question. The short answer is "no", you do not need to consider a mirror image of that inverted-F antenna when considering the adequacy of your ground plane. The inverted-F antenna acts as a short monopole, and as such, you definitely need a ground plane. But without doing a full simulation, you can think of the RF currents induced in the ground plane as a simple set of radial spokes spreading out from the feed point. Your rows of four through-holes would be most troublesome if they were cutting across those radial lines, and least troublesome if they aligned with the radial lines. It could help a tiny bit to nudge them apart, so the ground plane isn't completely interrupted by the row of 4. If your PCB extends at least a quarter-wavelength in all directions, I'd consider it to be quite adequate.
H: How to measure high frequency with an oscilloscope without loading circuit down too much? I am experimenting with building a high frequency common emitter circuit shown here. It operates at 144MHz and it should have around a gain of 4. Here is the simulated circuit. I do not have any load resistor attached yet (knowing of course this will also divide up the gain.) I wanted to purely see what the circuit gain was without a load. Looks to be near 4 in the simulation. This would make sense since I have no emitter bypass and my RC/RE is around 4 - and the transistor Ft of this transistor should be able to go up to a gain of 6 at 144MHz, so my gain is within limits. When I built this circuit in real life however, I think I had trouble measuring it. When I measure the output with my oscilloscope the signal is actually attenuated and not showing gain. I suspect the problem isn't my circuit but my method of measuring. I'm using a passive 200Mhz scope probe with a Siglent 200Mhz digital oscilloscope, with the probe set to 10x mode. I was also using the "short stub" ground "spring pin" and not the long, high inductance ground clip. But the signal measured on the output was showing an attenuation of almost .5x. Someone had mentioned that my probe capacitance was probably loading the circuit down too much. My probe says in 10X mode it is around 18pf capacitance (if I'm reading it correctly.) I was told that this capacitance will be across the load. Now, if I simulate that, you can see it does kill the output pretty hard. Example in the simulation: Notice now the red signal is the OUTPUT and it's actually attenuating! Losing gain. This is because the 18pf is loading down the collector. This looks almost exactly like what I was seeing in real life when I built the circuit. Is there any other way I can attempt to measure the gain of this amplifier without loading it down too much? Should I just use a loop of wire on the scope probe and bring it near the base/collector? I thought perhaps if I built an impedance transformer to connect to a 50ohm load, this still may not help if the scope is also acting like too much of a load, it will again cut the signal "in half." Measuring the input and the output with the same probe also doesn't work to "compensate" for the loading because the input has a source resistance of 50ohms, (so it would at most divide voltage in two on the scope) whereas the collector output resistance is 500ohms - the loading effect will be much greater on the collector, giving me inaccurate results entirely. Would an active probe help much? I think they can get down to 2pf but even that is around 2K or so impedance. It seems you need special techniques to get accurate amplitude measurements at these higher frequencies - is there maybe some methods that I don't understand yet? I know I saw an article where the author just uses a RG58 cable, strips it, puts on a resistor on the center lead to use as the probe "tip", and then uses a 50ohm tee on the scope side. I can't recall if it was a 50ohm resistor or a high megohm resistor they put on the tip. I don't actually care about the voltage value being accurate since I'm measuring relative - I will be comparing output to input. I just need a way for the scope to not load down the circuit too much and I think my probe is doing that. (If the probe doesn't load down too hard that a relative measurement should actually be accurate.) Any other ideas on how to possibly measure the output of this circuit "in real life" and know if it's working correctly? AI: For RF measurements, it is best to scale the output down to 50 Ohms so that probe capacitance has less impact. 3 pF probe 100pF < 10 Ohms at 180 MHz even so a 3pF probe is still ~ 230 ohms reactance @ 160 MHz so low capacitance (1pF) diff. active FET probes are the best bet from TEK which are common industry tools who use these signals often. ~40 dB pad for up to 200MHz plus load effect of 5k/(5k+500)
H: STM32F407VG Discovery + CMSIS HSE Clock Configuration I am trying to program an STM32F4 discovery board using Vscode, Platformio and CMSIS. However, I cannot set the right clock frequency. I have programmed it to blink an LED every second, except it seems to be blinking every 3 seconds. This is my desired clock configuration: This is the code that I have configuring the clock: // Enable the HSE in bypass mode (there is a 8MHz signal coming from the ST-LINK) RCC->CR |= RCC_CR_HSEBYP | RCC_CR_HSEON; while(!(RCC->CR & RCC_CR_HSERDY)); //Set the main PLL M, N, P, Q, R, and HSE as the input //STM32F4DISCOVERY: M = 4, N = 168, P = 2 = 168Mhz SYSCLK, Q = 7, R = N/A (Q & R not used) RCC->PLLCFGR = (4 << RCC_PLLCFGR_PLLM_Pos) | (168 << RCC_PLLCFGR_PLLN_Pos) | (2 << RCC_PLLCFGR_PLLP_Pos) | (7 << RCC_PLLCFGR_PLLQ_Pos) | RCC_PLLCFGR_PLLSRC_HSE; RCC->CR |= RCC_CR_PLLON; // set APB prescalers // APB1 = 4, APB2 = 2 //STM32F4DISCOVERY: 42Mhz and 84Mhz RCC->CFGR |= RCC_CFGR_PPRE1_DIV4 | RCC_CFGR_PPRE2_DIV2; // wait for PLL lock while(!(RCC->CR & RCC_CR_PLLRDY)); // Switch SYSCLK to PLL RCC->CFGR |= RCC_CFGR_SW_PLL; SystemCoreClockUpdate(); I have checked what the clock is actually set to by debugging using the onboard ST-Link and I am even more confused. Before the clock is configured, SystemCoreClock is 16000000 (HSI frequency, makes sense) After the clock is configured, SystemCoreClock is 175000000 (I have no idea where this number is coming from, and it is faster than the 168Mhz max, while the LED blinks 3 times slower) Can someone tell me what is going on and how to fix it? Thank you. For reference, here is the LED blink code: // Call this after setting up the clock void SysTick_Init(void) { // Enable the SysTick interrupt every 1ms SysTick_Config(SystemCoreClock / 1000); NVIC_EnableIRQ(SysTick_IRQn); } uint32_t millis(void) { return ticks; } void delay_ms(uint32_t t) { //uint32_t elapsed; uint32_t start = millis(); do { // elapsed = millis() - start; } while (millis() - start < t) ; } void SysTick_Handler(void) { ticks++; } int main(void) { initClock(); SysTick_Init(); RCC->AHB1ENR |= RCC_AHB1ENR_GPIODEN; // enable the clock to GPIO LEDPORT->_MODER |= GPIOMODER; // set pins to be general purpose output for (;;) { delay_ms(1000); LEDPORT->ODR ^= (1<<LED1); // toggle diodes } return 0; } AI: I realized the problem, two things were configured wrong. Platformio by default has #define HSE_VALUE ((uint32_t)25000000) in system_stm32f4xx.c. This is not the case with the discovery board, which has a 8Mhz crystal, not a 25Mhz one. I changed this to 8000000 In order to achieve divide by 2, PLLP actually has to be set to 0, not 2.
H: Cannot find this 6 pin IC 362J38 I have a power brick I'm trying to repair but have been unable to locate a 6 pin IC 362J38 that I suspect is the issue. No other faults found except the fuse after going over the board 3 times. No visual clues. All e caps, mosfets removed & checked. Opto is good. Not sure what the IC function is, either pwm or a regulator, open to suggestion. It is located on the hot side. I'm trying to find out if there is a substitute IC - please answer only if you are familiar with these type of 'cheap' SMPS units. Just asking for help. Close-up Full board Zoom in on pic if you need more detail. After having a conversation with 2 qualified techs (far more experience with these than me) no other faults detected, it was suggested that an IC probably blew. The unit was accidentally shorted on the output side and stopped working. IC on secondary was replaced to no avail. Only other fault was fuse. Inductors were not tested. AI: From the looks of it that chip is actually marked 362J35. Going by this it's probably some kind of buck regulator. Unfortunately I don't think you'll be able to find a replacement anywhere but the Shenzhen market.
H: Increasing Amplification using a MAXIM MAX492 Op Amp? I'm using a Maxim DAC (the MAX541) with a TI microcontroller. I output a digital audio signal from the microcontroller to the DAC. I have the DAC's output hooked up to a typical 3.5mm audio jack. When I plug the 3.5mm jack into typical computer speakers the volume is quite low. I have to crank up the speakers to hear the audio. Hooking up the 3.5mm audio jack to my oscilloscope I see the max peak-to-peak voltage output is only about 0.12 volts: When I play the same digital audio using my phone at a reasonably loud level and analyze it with my oscilloscope I see the peak-to-peak max voltage is around 1 volt: When purchasing the MAX541 DAC I suspected it would need some amplification so I also purchased a MAX492 op amp. I have the analog output of the DAC going to the input exactly as shown in the MAX492 datasheet's "typical operating circuit" example: Here's a link to the MAX492 datasheet. However, this is only amplifying the signal to a peak-to-peak max of about 0.23 volts. I of course need the MAX492 to amplify the signal to around 1 volt (like my phone's output level), however, I've read through the datasheet and it's not clear to me how to do this or if it's even possible. Any help would be most appreciated. Thank you. AI: You have the voltage gain of the opamp at \$Gain = 1 + \frac{10k}{10k} = 2\$ times. If you want the voltage gain to be 8.3 times then use 75k for the negative feedback resistor (R1 in the image below).
H: I'm losing data when my Raspberry pi talks to its USB connected Arduino Some very simple code, which I got somewhere on the Internet Arduino: void setup() { Serial.begin(9600); } void loop() { if (Serial.available() > 0) { String data = Serial.readStringUntil('\n'); Serial.print("You sent me: "); Serial.println(data); } } Raspberry Pi code: #!/usr/bin/env python3 import serial import time if __name__ == '__main__': ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=1) ser.write(b"Hello 1 from Raspberry Pi!\n") time.sleep(1) line = ser.readline().decode('utf-8').rstrip() print(line) time.sleep(1) ser.write(b"Hello 2 from Raspberry Pi!\n") time.sleep(1) line = ser.readline().decode('utf-8').rstrip() print(line) time.sleep(1) ser.write(b"Hello 3 from Raspberry Pi!\n") time.sleep(1) line = ser.readline().decode('utf-8').rstrip() print(line) time.sleep(1) So the plan is to send some data from the Pi to the Arduino and get it echoed back, but always the first line is missing. I appear to see just a blank line coming back ie a line feed. The output: vagrant@vagrant:~$ ./fine.py You sent me: Hello 2 from Raspberry Pi! You sent me: Hello 3 from Raspberry Pi! So where is the first line disappearing to? George AI: Probably you are losing the first line to the bootloader delay of the Arduino, after opening the port triggers a reset via the traditional wiring of the modem control lines to the ATmega reset, and the traditional default manipulation of those on serial device open. Generally speaking you want to avoid using time delays to make serial code work, but in this case you could reasonably put a few seconds delay between the open and the first query. Also beware of debug messages generating responses which are longer than the input - it's entirely possible for this to result in saturating the output baud rate, even when the input stays well within its capacity.
H: Why does adding one more extension cable turn the MCB on again? I found a strange phenomena when I tried to use a metal cutter that consumes about 2000 watt. See the following illustration. If I just use one extension cable, the MCB will trip when I turn on the cutter. However, if I add one more extension cable, everything is just fine (the MCB does not trip). It looks strange to me. Why does it happen? AI: The additional extension cord adds more resistance, reducing the inrush current. The inrush current required to trip a 20A breaker instantly can be as much as 300A, though it's more likely to be about 150A. This means the resistance of the whole system is less than 0.8 ohms. An extra hundred milliohms, as would be added by a 20 foot 14 AWG extension cord, would make a difference of tens of amps of inrush current.
H: DC blocking capacitor value for 2-12GHz? I'm working on a simple RF mixer circuit, and having some trouble picking the right DC blocking cap value for 2-12GHz (even higher if possible). Here's the schematic for the front end LNA: C7 and C9 are what's giving me problems, especially C9 since it's part of the bias-T and I definitely want to get that right so Im not pumping 3.3v into the input of the mixer What I don't understand is that I've seen some people saying not to go >100pF for any frequencies above 100MHz, but meanwhile this circuit is taken directly from the manufacturer's recommended application circuit in the datasheet and it says to use 100pF which seems high, especially for 15GHz. Is there some equation I can use to figure out the right value? Or is it not as big of a deal as Im thinking it is? AI: The value you choose for a blocking capacitor mainly depends on how low you need your low frequency cut-off to be. Macom chose 100 pF for their demo circuit in order to obtain a low-frequency cut-off well below 1 GHz. If you only need a 2-GHz low-frequency cut-off, and (say) you're willing to accept 10 ohms reactance from your blocking capacitor at that frequency, then you could use a capacitor value as low as about 10 pF. But if you are using common 0201 size multilayer ceramic capacitors as recommended by Macom, the value you choose won't affect the performance at 15 GHz much, because at that frequency the behavior will be dominated by the inductive parasitic behavior. And the parasitic behavior will mainly depend on the package size you choose (0201 for Macom's recommendation), not the capacitor value. The part recommended by Macom will give about 10 ohms reactance at 8 GHz (and no data for higher frequencies) according to Murata's SimSurfing tool. As shown in the Macom datasheet (comparing the S21 data for the bare chip and the demo circuit) this will reduce the gain of the circuit by a couple of dB. If that's not acceptable, special "broadband" and "ultra-broadband" capacitors are available. These essentially package a very high-frequency low-value single-layer ceramic capacitor with a higher-value multi-layer capacitor in the same package. These allow you to push the low-frequency cut-off down to the 10's of kHz with a resonant frequency out beyond 20, and in some cases beyond 50, GHz. But for these parts expect to pay a few dollars each instead of a few cents. Manufacturers include Presidio Components, ATC, Passive Plus, and Knowles Precision Devices.
H: How to shutdown op-amps for low-power standby What is the best way to shut down the analog front end of my sensor system for a low-power standby mode. My circuit is battery powered via a 3.3V buck/boost converter I would like my STM32 microcontroller to shutdown the analog circuitry (op-amps) before going into low-power mode. Is this as simple as putting a MOSFET switch on my AVDD rail controlled by a GPIO pin? Should specialty power switching ICs be used? The combined current draw of the analog circuitry is only around 1mA but will deplete the battery for long standby intervals. AI: Maybe. You have to realize that the inputs (or even output if there is a pull-up) may power the op-amp through protection networks. If that is not an issue, then a high-side (eg. P-channel) MOSFET or PNP works fine. Some op-amps allow inputs in excess of the supply voltage, which is nice when your supply voltage is zero. Depending on your application you may wish to consider an op-amp that has a power-down input. That allows the Vdd to be maintained, but puts the amplifier in a low power consumption mode.
H: Inverting Amplifier Not Applying Gain to Bias Voltage I am simulating an inverting amplifier circuit (Page 3 in this app note) with LT spice. The amplifier has a gain of 10 V/V and since I am using a single rail supply, I am applying a bias voltage at the non-inverting input of about 0.113 V. I expected the bias voltage to be amplified to about 1.25 V at the output but it looks like this is not the case. Below are the amplifier circuit and simulation results. It is connected to a series of sallen-key filters not shown. The filter output rides on a 1.25 V bias which should be removed after passing through the 1uF coupling capacitor. The output shows that that bias voltage does not get amplified and so the amplified signal clips at the negative swing (green plot). The blue plot is the output just after the coupling capacitor. When I increased the bias voltage to 1.25 V, the output had the correct bias voltage. This seems contrary to what's suggested in the application note. Am I missing something? Edit When I simulate a circuit like this, I get exactly what I expect. The only difference is that there is no coupling capacitor before the op-amp. Why does the removal of the capacitor cause such a difference? AI: The Photon immediately identifies one problem -- the input capacitor will charge up to the average and effectively block any galvanic path for your gain-setting arrangement. So let's dispose of that, right away. If you want to set a gain, you need to provide a DC gain-setting arrangement. This will be something like the following: simulate this circuit – Schematic created using CircuitLab \$R_1\$ and \$R_2\$ can get your voltage gain, now. \$R_3\$ and \$R_4\$ can set your DC bias point. The input signal will be imposed upon that bias point and the voltage gain then applied. Let's assume your opamp can work with the single rail of \$+2.5\:\text{V}\$. Then we have the following: simulate this circuit Here, we expect the output to be \$11\times\$ the (-) node. Since we want that to be centered on \$\frac12 V_\text{CC}\$, this means the output should have an average of \$1.25\:\text{V}\$ and, by implication, the (-) node's average should be \$\approx 113.64\:\text{mV}\$. That also should be the (+) node's average. If we want the input impedance of both (-) and (+) to be similar, we probably should set \$R_4=47\:\text{k}\Omega\$ and solve for \$R_3\$. This will find that \$R_3\approx 987\:\text{k}\Omega\$. Just set \$R_4=1\:\text{M}\Omega\$ and that should be close enough. Assuming a decent rail-to-rail opamp, such as the LT1800, the resulting circuit is: simulate this circuit Running an LTspice simulation on the above we find: From this we can compute \$A_v=\frac{765.23\:\text{mV}}{70.363\:\text{mV}}\approx 10.88\$. (This is very close to the expected \$A_v\approx 11\$.) LTspice also computes the average of the opamp output as \$1.2352\:\text{V}\$, which is very close to the desired \$1.25\:\text{V}\$. (The difference in large part due to the fact that we chose \$R_3=1\:\text{M}\Omega\$ instead of \$R_3\approx 987\:\text{k}\Omega\$.) In short, this all works okay if you approach things correctly and if you select opamp devices that can work within the desired voltage ranges.
H: Wave disappearing on oscilloscope I am trying to observe a wave on my oscilloscope (with a CRT display). I can see a point on the screen tracing out the waveform, but the wave does not stay on the screen for me to say. This wave is very slow (only 1 Hz). Could that be the problem? I have linked a video of what I see below: https://drive.google.com/file/d/1jHj5FqOF1nYCibUaxG_4Qu_OmAZMekKa/view?usp=sharing AI: As tlfong01 correctly noted in the comments,the scope you are using is a digital storage oscilloscope. You need to turn on the storage function of your scope. From page 22 of the manual: Push the "Storage" button so that it lights up, and you should be able to see the whole trace. You may need to turn on the available single shot function. That is described on page 43 of the manual. Page 42 describes a "ROLL" mode which may also be useful for your signal. I am not sure from the description how "ROLL" is activated. It might be automatically turned on at low sweep speeds in storage mode.
H: Generator synchronization to grid and angle difference Following conditions are needed for generation synchronization : 1 Phase Sequence 2 Voltage Magnitude 3 Frequency 4 Phase Angle I have question about Phase angle assuming that the frequency is the same and there is a big phase angle then the phase angle will never change. And I should wait for the phase angle to be minimal but there is a chance that this could never happen. What happen in practice? AI: If the frequency is in fact identical, then the phase angle will never change. However, this is not what is meant by that sequence of instructions, nor what happens in practice. Getting the frequencies equal means nominal frequencies, getting it fairly close. With an unsynchronised generator, any slight change in drive power will alter the frequency slightly. While the frequency is close, the phase will be changing slowly with respect to the grid. You observe the phase meter, and close the contactor when it's less than some specified tolerance. If the phase is changing too fast, then the frequency is too far from the grid frequency. Adjust the frequency until the phase is changing slowly. If the phase is wrong, and is not changing at all, then adjust the frequency until the phase is changing slowly.
H: AC, Negative instantaneous power x Wh consumption measurement If a load is connected to an AC power source, and the current wave on it is shifted from the voltage wave of the power source, for some periods of time the instantaneous real power (Vinst x Iinst) will give a negative instantaneous power value, due the voltage value be positive and the current value be negative at the same instant, or vice versa. How this "negative power" affect the Wh real power consumption measurement? How it accounts in cumulative energy measurement? AI: How this "negative power" affect the Wh real power consumption measurement? How it accounts in cumulative energy measurement? Here are a few waveforms to consider: - The power waveform is in red and, it is the average value of this waveform that indicates true power consumption. If the instantaneous power goes negative then it just reduces the average power. At 90 ° phase shift between voltage and current, the average power is zero because positive parts exactly cancel negative parts.
H: HDMI for Jetson Nano contradictions in guides For my drone, I want to develop a custom Jetson carrier board with minimal required interfaces. For quick debugging, I would like to add an HDMI port on the PCB. However, I’m not familiar with HDMI and I found some contradictions between guides. In most guides, it’s written the impedance of the trace should be 100 Ohm. I found some pretty easy schematics examples However, in the Jetson Nano design guide, there are more required elements as these capacitors and Rs resistors, which I do not completely understand the purpose… Schematic: At the end, there is this figure, which tells us to have 500 Ohm impedance traces where all segments should be 100 Ohm :/ Schematic: I can blindly reproduce the carrier board but I would like to understand better what I’m going to do. Thx in advance! AI: The capacitors are there for signal decoupling and the protection of the Jetson together with the resistors. For protection, there are many different implementations possible and it may vary. It doesn't mean that one or another is wrong, it's often a question of cost vs effectiveness and may vary on the chip itself, some are designed for having decoupling caps, some are designed for not. For example, ethernet also has many different implementations, decoupling caps, chokes, no chokes, etc... If you are developing for the jetson, your best bet is to copy their schematics as it was tested in this configuration.
H: Galvanic isolation in multiple battery design I'm trying to design a board to control a couple of DC motors (or stepper motors) for a small robot. The device will integrate a control logic based on a uC and the necessary H bridges for the motors. DC motors speed will be modulated with ~1 kHz PWM signals. No great powers involved: logic is powered at 3.3 V while motors work at 12 V maximum (haven't decided yet, may be 5 V too) with a current draw limited to 3 A. The goal is to integrate batteries and their charge circuitry as well. Li-Ion cells will be used, along with DCDC converters to generate the required voltages. I've used the plural because I'm planning on use two different batteries: one dedicated on the control logic section and the other for the motors and the H bridges (power section). I had some past experiences with disturbances and voltage drops when using a single battery to power both sections, so I'd like to separate the two power supplies in order to avoid any future issues. However, I recognize that these experiences may be caused by a poor circuit design. And here comes the questions: does it really makes sense to use two different batteries or it is sufficient to design an effective ground path and to use bypass capacitors, taking into account the low currents and voltages involved? Moreover, if using two batteries is a good idea, is it worthed to galvanically isolate the two sections to completely avoid ground loops and disturbances propagations? Or, again, a good ground path design on the PCB is enough? If more details are required, I can add them. Sorry if I made some grammar errors, English is not my mother tongue. AI: There is no pointing isolating the batteries unless all your circuits are isolated between the two sides as well. ie. Control board running off battery A and motor driver running off battery B must interface through isolators. Or motor driver that accepts battery A for logic power and battery B for motor power must have isolators on board between the two sides. Isolation takes a LOT of work because of this. Two unisolated batteries (i.e. sharing a ground) does help with power supply disturbance issues but won't really help with noise issues like isolated batteries will. Often a single battery with proper decoupling and grounding is the simpler solution for both. Two batteries (isolated or not) makes sense if your motors run at much higher voltage than your logic because you do not need to step down the voltage. It also allows your motors to run the battery dry but not kill your electronics which can be important in some applications (i.e. a model airplane whose propeller motor uses one battery but the electronics which include the radio and servo motors which allow you to control the plane run off another battery). Newbies worry too much about ground loops. Ground loops are only a problem if they cause a problem. On a tiny 3A robot there should be no good reason to isolate or use two batteries. 50A airplanes often fly with single batteries and no isolation, and those things crash with too much noise or power supply disturbances. DO NOT regulate the voltage to the motor. Choose the motor and batteries to run direct. It is a waste to try and regulate voltage for high a power system that is not sensitive to voltage like a motor. A motor driver is kind of like a crude regulator for the motor and that is its job so don't make yourself do the same thing twice.
H: Transformer Magnetization Flux As far as I understand, an ideal transformer wouldn't show any net flux inside its core, as any such net flux would induce electric fields and in turn currents in the windings such that it will disappear. So an ideal transformer would show no (net) flux at all, correct? So it would kind of act like a control loop trying to keep the flux at 0. A real transformer requires energy in order to magnetize its core. This energy is provided to the transformer in the form of the magnetizing current \$ I_\mu \$ and a corresponding magnetizing flux \$ \phi_m \$. It was introduced to me as $$ \phi_m = \phi_1 - \phi_2 $$ with \$\phi_1 \$ being the flux put into the system by the primary winding, and \$\phi_2 \$ being the induced flux coming back from the secondary winding. So what's left after taking this difference is the magnetization flux. We were shown this visualization in class: It suggests this flux flows in the whole ferrite core. My internal model was that the energy provided by the additional current \$ I_\mu \$ would be "absorbed" by the core in order to magnetize itself and the flux wouldn't make it to the secondary winding. If it does flow throughout the whole core, and also through the secondary winding, wouldn't it play into the "control loop" described above and vanish as soon as it arises? What am I missing? Thank you for your time in advance! AI: My internal model was that the energy provided by the additional current Iμ would be "absorbed" by the core in order to magnetize itself and the flux wouldn't make it to the secondary winding. Magnetization flux couples both primary and secondary. It induces voltage in the secondary as per the turns ratio. If the secondary is open circuit then that should be easy to see. The problem most engineers have is realizing that when the secondary is attached to a load, the current in the secondary would "appear" to produce another flux that would "appear" to alter the core flux and screw around with the magnetization. It doesn't because as soon as the secondary current forms, an extra primary current forms in opposition to the secondary current and the two individual fluxes caused by the secondary current cancel. What is left is (still) the same magnetization flux and we still get a voltage transformation as per the turns ratio. So an ideal transformer would show no (net) flux at all, correct? This is called an ideal power converter or impedance transformer and, as much as EEs like to break down things into smaller manageable lumps, I don't think "an ideal transformer" brings anything to the party when trying to understand non-ideal transformers. A real transformer requires energy in order to magnetize its core. I think this misses the point a little. A real transformer has a secondary winding and, if this secondary winding isn't connected to a load, it might just as well be not there at all. So, the "real-transformer" is really just an inductor when it comes to what current it draws from an AC supply in order to produce core magnetism. Nothing more complicated than that. I mean... do we say that an inductor requires energy to magnetize its core? No we don't; we say that current flows due to the applied voltage and the inductive reactance and that current (along with the number of turns) produces a H field that magnetizes the core. We don't need to think in transformer terms when thinking about core flux. And we don't need to think about energy when defining core flux; current and turns is sufficient.
H: Active highpass filter for microphone, how to choose cutoff frequency? I am currently taking a class on filter design, and I am learning by doing. I want to make a small project by building a microphone circuit. I found online a tutorial by Great Scott. He made a circuit like this. His results were pretty good so I will probably leave it as it is. His design already has a low and high pass filter implemented in the design building a bandpass filter. I am thinking also about implementing an active high pass filter on the end of the circuit to cancel out low frequency noise and get better signal quality and also practice the real world application of what we do in the lecture. I used the Texas Instruments filter design tool to create a 3rd order Bessel filter, with 3dB gain because its voltage peaks were around 3V. I think it would be better if they were closer to 5V, I was thinking a little less than 4.5V. Now my problem is that I have no idea how to choose the cutoff frequency. I was thinking 60Hz would be induced from AC wires around the house etc. So triple that at 180Hz should be good - I guess. I would appreciate any input and help on the matter. AI: I was thinking 60Hz would be induced from AC wires around the house etc. So triple that at 180Hz should be good - I guess. I would appriciate any input and help on the matter. Well induction from AC wires is due to current flow in those AC wires inducing voltages in series with the microphone wires but, the current in the AC wires can easily have multiple harmonics of 60 Hz and you'll find that the third harmonic (180 Hz) is still very dominant in household appliances etc.. Fifth harmonic is 300 Hz so, where do you conceivably stop? Answer: you use good practises and avoid induction by twisting signal cables so that the net magnetic induction is basically very low. We also use shielded (or screened as they say in the UK) to remove/reduce electric field coupling. In other words, we filter as a last resort but if we are at that last-chance saloon, then surely we have made a wrong design decision a few stages ago. Sometimes when I mix guitar or vocal tracks from one of my pals in the US, I use a notch filter to remove as much 60 Hz as I can. Reason: his setup is carelessly put together and I don't think his mancave/shed has a decent earth. Mind you, it's usually some trashy rock song we are writing so it doesn't really matter.
H: Using an optocoupler to drive a pulse counter I am trying to design a circuit to measure the RPM of a small internal combustion engine. The ignition on the engine is a simple magneto style ignition. These ignitions are switched off by grounding a wire. When not grounded, the wire carries a signal that pulses once per revolution from 0V to up to 270V. The pulse length is typically 5 micro seconds. Because the engine drives a remote controlled vehicle, it is important to isolate the ignition from the rest of the electronics, to reduce RF noise. Thus, I was thinking about using an optocoupler to take the pulse as input, with a suitable resistor in series to limit the current. On the output side, I am thinking about connecting the source to a pull-down resistor, and the drain to +Vcc of the Arduino. The idea is to turn the input pulse (the yellow curve in the below image) into a square wave, and that is why I am thinking about a MOSFET-based optocoupler. The source would be connected to an input pin on the Arduino, programmed to work as a pulse counter (I have that part already done). The square wave does not have to have the same width of the pulse. In fact, I would like the square wave to overlap the portion of the pulse above 50V. So my question is: What is the best optocoupler to use, and what is the best way to apply the 50V threshold? Figure 1: The yellow pulse is the one that is fed to the optocoupler. Note that here it is inverted AI: I suspect that the signal is very weak and can't drive much of a load. If it can drive 100k, something like this should work. I plain NPN optocoupler should work, I don't see an advantage here to a MOSFET Opto. If the 50 V threshold is important, this won't be accurate. If you are only building a few, you could hand-tune it. If a 50 V threshold is important, you should consider a pulse transformer like Tony recommended. simulate this circuit – Schematic created using CircuitLab
H: Identifying a 6 pin and a 18 pin WSON IC I have a couple of the following ICs, which I suspect to be some DC/DC converter possibly from TI, but I could not find the exact part number. It is a 6 pin, WSON package IC with a thermal pad. The top says: 48D6K L197B The other IC is a 11 pin QFN one where 8 pins are GND and connected to a thermal pad. It is also suspected to be some kind of DC/DC converter from TI. The top says: SBL TI 481 A052 T1 or TI I am not sure. Both ICs were acquired about 4-5 years ago. AI: L197B is a 6 pin WSON package, not QFN. LM2832 has this marking in 6 pin WSON. The second one is a 11 pin VSON package. In which case it would be a TPS61232DRCR/TPS61232DRCT
H: 74LS multiplexer outputing 2V as LOW I'm using a 74LS257 to select between 2 4-bit buses, but instead of 0V it's outputing 2V. Here's the schematic: The problem appears when Reading is logic 1 (selecting Actual). If Actual0 is logic 1, @0 outputs 2V. All the inputs are 0V or 5V (the problem lies in the IC's output). I have tried to replace it with another one, same results. The exact model is: SP8524 - DM74LS257BN. All the outputs are conected to this RAM following this schematic: AI: I have found the problem, @0 was connected to DB0 (and even worst, the RAM was not connected to GND). So silly for my part...
H: CMOS Buffers minimum voltage for logical high I'm looking at the datasheet for a non inverting CMOS buffer CD74HC4050 What is the lowest voltage that can be placed on 1A to cause 1Y to be logic High? I know it's somewhere in the datasheet but I new to this and don't know which value. Thanks Datasheet https://www.ti.com/lit/ds/symlink/cd74hc4050.pdf?ts=1609459927711&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FCD74HC4050 AI: You are looking for the minimum value of Vih:
H: USB on/off switch I have this LED light strip which has AA Battery converter with a USB female output port. I will attach picture below. I would like to know how can I connect a SPST on/off switch to the light strip so that I can easily turn the lights on and off. Do I just tap into one of the power wires in the USB cord? Thanks for any advice. AI: Yes. You can splice in-between the battery pack and the female usb plug or the usb male plug and that black rectangle. Either the V+ or the Ground (unless both the shield and ground are tied together). Color is not guaranteed so make sure you use a multimeter to figure out which is which. Personally I would add the switch to the case if you can. No added fuse is needed. And for this you could probably use 24 or 22 awg. It may be thicker than whats already used.
H: What is the critical current density of indium tin oxide ITO? What is the critical current density of indium tin oxide ITO? AI: Of course Jc will depend on the temperature and magnetic field. This paper... Aliev, A. E., de Andrade, M. J., & Salamon, M. B. (2016). Paramagnetic Meissner Effect in Electrochemically Doped Indium-Tin Oxide Films. Journal of Superconductivity and Novel Magnetism, 29(7), 1793–1803. doi:10.1007/s10948-016-3501-7 ...suggests it's around 20 million to 40 million A/m^2 at liquid helium temperatures.
H: Tap into 12AWG wire with 20AWG wire I am using 3 of these Mighty Max 12V 12Ah batteries on my Razor MX650 electric bike and they are connected with 12 gauge wire. I would like to tap into the power on one of the batteries with a 20 gauge wire. Is it ok for me to tap into the 12 gauge wire with a 20 gauge wire to pull power? I am actually just going to use it to power a voltmeter on the bike. UPDATE: @Cubic273.15 Here is an actual diagram of the wiring for the bike, I added what I am trying to do with the voltmeter. I just want to make sure you are saying it's ok to tap into the 12ga wire with the 20ga wire. AI: In the amp-gauge table and many websites, the 12-gauge wire capable of delivering 20A. Check here Usually, a Voltmeter is not drawing over 0.5A. and using 20ga wire is okay, tapping into 12ga wire is okay too. But for safety reasons, you can fuse 0.5A or 1A fuse in between your 20ga wire to the voltmeter. Image source: 12 Volt Planet - Fusing Guide EDITED: adding picture of how to 0.5A. but I do prefer to tap directly to the battery pin because it is quicker for me. :)
H: Can we consider an XNOR operation as an even number of 0 checker? I am a little confused about the role of XNOR operation when we have more that two inputs. After simulation, I realized that when we use multiple two inputs XNOR gates, the resulted output is 1 if there is an even number of 0 at the inputs. I searched on the internet to confirm this but I did not find anything. So my question is: Is my interpretation of XNOR operation true or false? AI: The NOT part of an XNOR gate can be moved from the output to either of the inputs without changing the function of the gate. XOR (Not Q) - a.k.a XNOR | A | B |!Q | +---+---+---+ | 0 | 0 | 1 | | 0 | 1 | 0 | | 1 | 0 | 0 | | 1 | 1 | 1 | XOR (Not A) - a.k.a XNOR |!A | B | Q | +---+---+---+ | 1 | 0 | 0 | | 1 | 1 | 1 | | 0 | 0 | 1 | | 0 | 1 | 0 | XOR (Not B) - a.k.a XNOR | A |!B | Q | +---+---+---+ | 0 | 1 | 0 | | 0 | 0 | 1 | | 1 | 1 | 1 | | 1 | 0 | 0 | If you start moving them further and further down the chain, you should see that they start to cancel out with each other. The first two gates cancel to become a pair of XOR gates chained together, as do the second pair. So essentially you've built a 5-input XOR gate. More generally, for it to be considered an N-input XNOR gate, or even number of 1's detector, you need to construct it from one XNOR gate, and N-2 XOR gates. Essentially you need to result in an odd number of NOTs in the circuit. If you want to make an even number of 0's detector, you will need to invert all the inputs. You can of course propagate those NOT gates through, at which point you will find that for a even number of bits in your input, the circuit is the same as for an even number of 1's detector. For an odd number of input bits, you want the final gate to be an XOR not an XNOR.
H: Circle with arrow symbol interpretation in circuit I am trying to find all currents in this circuit: (Question 19 from https://www.allaboutcircuits.com/worksheets/algebraic-equation-manipulation-for-electric-circuits/) Although I'm familiar with Ohm's law and can find values in series-parallel circuits, I don't know how to approach this. What is the meaning of the circle with arrow in it symbol, that has 5mA? Should I interpret that as an extra power source? Why not use a battery symbol there then? What is the approach to solve this problem? AI: What is the meaning of the circle with arrow in it symbol, that has 5mA? It's a constant current source - it draws a constant 5 mA come what may. Should I interpret that as an extra power source? You should interpret that as a current source - it can be converted to a voltage source in series with a resistor if that might help you - look up Thevenin equivalent sources: -
H: Routing USB 3.x Type-C Signals I'm designing an open source USB Type-C Switch (KVM Style), and I started to route the USB 3.x SuperSpeed+ and USB 2.x HighSpeed differential signal pairs on the PCB. The switch will have 2 input + 1 output USB Type-C ports. The USB 3.x SuperSpeed+ signal are switched by two ON Semi FUSB340-s, while the USB 2.x HighSpeed ones using an ON Semi NL3S588. As I don't have too much experience with routing high speed signals, I though to post a question here and ask your opinion about my PCB design attempt. After some research, here is what I came up with: the PCB will be a 4-layer one, probably with 1 mm thickness. The top and bottom layers will be signal layers, while the two inner layer will be ground planes the differential signals will be routed on both on the top and bottom layers. According to PCBWay's online calculator, a micro-strip track width of ~0.23 mm with ~0.14 mm spacing should provide about 45 Ω single / 90 Ω differential impedance the two tracks of each differential pair is length matched no length matching between multiple differential pairs clearance between the differential pairs is kept > 1mm (~5x track width) This is what the USB 3.x and USB 2.x signals would look on the PCB: (The PCB is about 40 x 50 mm. The two symmetrically places IC-s are the FUSB340-s, while the middle one is the NL3S588. Colors are Top:red, Bottom: green, Inner layers: yellow & magenta) Now, I have some concerns mainly related to the following areas: Vias - as there are many track to route, some vias on the differential pairs (2+2 at most) where inevitable - Is 2+2 vias acceptable on a USB 3.x (~5 GHz) differential pair? Pair swap / flip - in some cases the two signals of the differential pair were in the "wrong order", so I must swap them to be able to route them to their destination. I did this using two vias on one of the singals. - Is this the correct solution? Top & Bottom layer tracks crossing - I guess is not a problem, as there are two ground layer between them - Is this correct? Differential pair length matching - when trying to match the length of the tracks in the differential pairs, I observed that KiCad refuses to insert "corrections" if they would be "too small" (but the skew is still > 0.1 mm). I tried to workaround this by adding "corrections" manually. - Is this OK, or there are some special rules I should follow? (left: KiCAD, right: manual) What do you think about the above concerns? Any other thing terribly wrong with my design? Any other observations? Thanks! Update: Here is a new PCB layout with the following changes re-arranged some signals between the channels of the high-speed mux to better match the layout of the USB Type-C ports removed pairs swaps / crossings, by swapping the signals in the schematics re-routed all the signal on the PCB - the layout looks betters, and there are max 2+2 vias on any of the singal pairs moved all components to the top layer adjusted the skew tuning parameters to more reasonably sized pattern What do you think? AI: I have several suggestions. First up, I would not swap the P and N over in the way you have shown. All via crossings must be symmetric, so dropping one half of the pair to the other side is a bad idea. If you can't curl the pair in from the opposite side of a set of pins (not possible for QFNs), then you have to do it by crossing over both P and N to the other side of the board. Here is an example of how you can reverse the P and N symmetrically. You will additionally need a pair of vias to get both traces back to the top side. When crossing the pair to the other side of the board, something which you should try to minimise, you should additionally have stitching vias nearby to ensure that return currents can swap between reference planes. Crossing traces over each other when there are reference planes between them is perfectly fine as you suspected. For phase matching of the P and N parts of the pairs, you need to keep the changes in spacing to a minimum to avoid large impedance discontinuities. The large humps that KiCAD has made for you are terrible and should not be used. You also want to do this matching as close as possible to where the shift occurs - that means matching each individual bend, not having one big correction part way along the pair. As a general rule, you want to try and keep the change in spacing to around 1.25x the normal spacing, and certainly no more than 1.5x. If we assuming a 1.5x spacing, then at each 45 degree bend you need four wibbles, two each side of the bend. For example, this is a 90 degree bend, matched using eight wibbles: As a passing note, you have lots of places where the traces cross over and then cross back again in an attempt to untangle the routing. I would suggest having another go at laying this out. I would look to try and keep the muxes on the same side of the board initially as it will reduce assembly costs (single side assembly is cheaper). Start with routing of the high speed traces, ignore the USB 2.0 lines initially (they are much more forgiving). You could draw thet traces initially as single-ended sketches on the silk layers to get an idea of where each trace will go (much easier to move around a silk line than a diff pair). Another helpful think to consider is that you may be able to reduce the cross-overs by swapping the two outputs of the mux. If you swap both RX1<->RX2 and TX1<->TX2, then it may help reduce congestion. You can compensate for this by adding a simple inverter (e.g. SN74LV1T34) to the select signal of the multiplexer. Similarly, the differential pairs use CML, which is a symmetrical standard. There would be no issues swapping the + and - lines of all the inputs and outputs on a multiplexer if it made it easier to route and avoided having to cross over the Ps and Ns. (With the device you've selected, as far as I can tell, it's a high-speed analogue mux. There doesn't appear to be any difference between the Tx and Rx signals (essentially two identical muxes, one used for Rx, one used for Tx). So you could for example use one of these muxes for both sets of transmit lines, and the other for both sets of receive lines. I'm not sure that will help you, and I would avoid doing it without checking with OnSemi first, but in a tight spot I might consider it).
H: Tact switches only work once I am trying to do a digital clock using an Atmega8A, LCD display (2x16) and four tact switches. Key number 1 is connected to pin PD2, number 2 to PD3, number 3 to PB6, number 4 to PB7. When you press key 1 you can choose between hours, minutes, seconds, when you click key 2 you increment hours/minutes/seconds (chosen by button 1) by one. Key 3 is use to stop the clock. You can modify the clock only when the flag "ableToEdit" is set to one. Key 4 is used to start the clock again. Last thing that I need to do is debouncing. I have tested this method on my other Atmega8A microcontroller and it works. My method: #include <avr/io.h> #include <avr/interrupt.h> #include <util/delay.h> #define KEY1 (1 << PD2) uint8_t key_pressed; int main(void) { DDRD &= ~(1 << PD2); DDRB |= (1 << PB0); DDRB |= (1 << PB1); PORTD |= (1 << PD2); PORTB |= (1 << PB0); _delay_ms(10); while(1) { if(!key_pressed && !(PIND & KEY1)) { key_pressed = 1; PORTB ^= (1 << PB1); }else if( key_pressed && (PIND & KEY1)) key_pressed++; } return 0; } When I tried to implement this in my clock code, it doesn't work as in the code above. When I click a tact switch the value of hours/minutes/seconds is incremented by one and later I can't do anything; only after a long while when I click a key again is the value incremented by one and so on. Other keys work similar. I click them and only after longer moment it does someting but sometimes I cant't do anything. By saying longer moment I mean a minute or several dozens of seconds. #include <avr/io.h> #include <avr/interrupt.h> #include <hd44780.c> #include <stdio.h> #include <stdlib.h> volatile int modeFlag = 1; volatile int ableToEdit = 1; volatile int seconds = 0; volatile int minutes = 0; volatile int hours = 0; uint8_t key_lock1; uint8_t key_lock2; uint8_t key_lock3; uint8_t key_lock4; char secondsBuffer[3]; char minutesBuffer[3]; char hoursBuffer[3]; void key1Pressed() { if(ableToEdit == 1) { if(!key_lock1 && !(PIND & (1 << PD2))) { key_lock1 = 1; modeFlag++; if (modeFlag > 3) { modeFlag = 1; } } else if(key_lock1 && (PIND & (1 << PD2))) { key_lock1 ++; if(key_lock1 == 255) { key_lock1 = 0; } ; } } } void key2Pressed() { if(ableToEdit == 1) { if(!key_lock2 && !(PIND & (1 << PD3))) { key_lock2 = 1; switch(modeFlag) { case 1: if(hours == 24) { hours = 0; } hours ++; break; case 2: if(minutes == 60) { minutes = 0; } minutes ++; break; case 3: if(seconds == 60) { seconds = 0; } seconds ++; break; } } else if(key_lock2 && (PIND & (1 << PD3))) { key_lock2 ++; if(key_lock2 == 256) { key_lock2 = 0; } } } } void key3Pressed() { if(!key_lock3 && !(PINB & (1 << PB6))) { key_lock3 = 1; ableToEdit = 1; TCCR1B &= ~(1 << CS12); TCCR1B &= ~(1 << CS10); } else if(key_lock3 && (PINB & (1 << PB6))) { key_lock3 ++; } } void key4Pressed() { if(!key_lock4 && !(PINB & (1 << PB7))) { key_lock4 = 1; ableToEdit = 0; TCCR1B |= (1 << CS12) | (1 << CS10); } else if(key_lock4 && (PIND & (1 << PB7))) { key_lock4 ++; } } ISR(TIMER1_COMPA_vect) { seconds++; if(seconds == 60) { seconds = 0; minutes ++; if(minutes == 60) { seconds = 0; minutes = 0; hours ++; if(hours == 24) { hours, minutes, seconds = 0; } } } } int main(void) { DDRD &= ~(1 << PD2); DDRD &= ~(1 << PD3); DDRB &= ~(1 << PB6); DDRB &= ~(1 << PB7); PORTD |= (1 << PD2); PORTD |= (1 << PD3); PORTB |= (1 << PB6); PORTB |= (1 << PB7); _delay_ms(20); // LCD init LCD_Initalize(); // Timer init TCCR1B |= (1 << WGM12); OCR1A = 977; TIMSK |= (1 << OCIE1A); sei(); while(1) { key1Pressed(); key2Pressed(); key3Pressed(); key4Pressed(); if(hours == 24) { hours = 0; } if(minutes == 60) { minutes = 0; } if(seconds == 60) { seconds = 0; } itoa(seconds, secondsBuffer, 10); itoa(minutes, minutesBuffer, 10); itoa(hours, hoursBuffer, 10); LCD_Clear(); LCD_GoTo(0, 0); LCD_WriteText("Aktualna godzina"); LCD_GoTo(4, 1); switch(hours) { case 24: LCD_WriteText("00"); break; case 0: LCD_WriteText("00"); break; case 1: LCD_WriteText("01"); break; case 2: LCD_WriteText("02"); break; case 3: LCD_WriteText("03"); break; case 4: LCD_WriteText("04"); break; case 5: LCD_WriteText("05"); break; case 6: LCD_WriteText("06"); break; case 7: LCD_WriteText("07"); break; case 8: LCD_WriteText("08"); break; case 9: LCD_WriteText("09"); break; default: LCD_WriteText(hoursBuffer); } LCD_GoTo(6, 1); LCD_WriteText(":"); LCD_GoTo(7, 1); switch(minutes) { case 0: LCD_WriteText("00"); break; case 1: LCD_WriteText("01"); break; case 2: LCD_WriteText("02"); break; case 3: LCD_WriteText("03"); break; case 4: LCD_WriteText("04"); break; case 5: LCD_WriteText("05"); break; case 6: LCD_WriteText("06"); break; case 7: LCD_WriteText("07"); break; case 8: LCD_WriteText("08"); break; case 9: LCD_WriteText("09"); break; default: LCD_WriteText(minutesBuffer); } LCD_GoTo(9, 1); LCD_WriteText(":"); LCD_GoTo(10, 1); switch(seconds) { case 0: LCD_WriteText("00"); break; case 1: LCD_WriteText("01"); break; case 2: LCD_WriteText("02"); break; case 3: LCD_WriteText("03"); break; case 4: LCD_WriteText("04"); break; case 5: LCD_WriteText("05"); break; case 6: LCD_WriteText("06"); break; case 7: LCD_WriteText("07"); break; case 8: LCD_WriteText("08"); break; case 9: LCD_WriteText("09"); break; default: LCD_WriteText(secondsBuffer); } _delay_ms(200); } return 0; } I tried to change the value of the "ableToEdit" variable but it doesn't help. I also tried using INT0 and INT1 interrupts and don't see any effects. Why doesn't it work? The method in the second example is exactly the same as in the first example. How can I fix it? AI: Your "working" code sets "key pressed" to zero by incrementing it, luckily it's uint_8_t. If that's intentional there should be a comment explaining that. this is undefined behaviour. (so don't compile with optimisation on) Your "non-working" code has delay_ms(200) instead of delay_ms(10) resulting in twenty times more debounce delay. but it explicitly zeros the debounce counter (which is good)
H: Find the voltage Vab and current of the circuit I I was asked to find the voltage Vab and the current of the circuit I. I tried finding the voltage in ab using voltage divider, but I have two voltage sources and I don't know how to make the respective formula A voltage divider is E*(R1/R1+R2) for the respective place you want to measure, but what about when there are two voltage sources? I'd like to ask for some guidance as to where I am supposed to look or how to start. As for the current of the circuit, maybe finding an Rtotal and then using two Ohm's law? AI: Use your eyes and very simply, write down the numbers for voltages and the currents defined by ohm's law: - I think your big mistake is not recognizing that ground (shown in green) connects to the 6 volt source and the 5 ohm resistor. Do not launch into anything mathematical until you understand the diagram and it is simplified. So, quite literally the voltage at node a becomes -6 volts and, the voltage at node b becomes -20 volts (just by visual inspection). These voltages define the current of 7 amps flowing through the 2 Ω resistor. Node b being at -20 volts also defines the current through the 5 Ω resistor being 4 amps. The 7 amps and the 4 amps tell you that 11 amps flows through the 20 volt battery. -6 volts across the 3 Ω resistor means there is 2 amps flowing in it. And finally, you should be able to see why the 5 amps flows in the 6 volt battery. This bit is down to you. Simple visual inspection of the circuit and ohms law.
H: Is this an Inductor, mystery component 600R/2A? I was checking a schematic for work, and I saw this component that I don't recognize, marked 600R/2A. Since they are marked L and are used in combination with capacitors, I think they are inductors meant to serve as low pass filters in combination with the capacitors. Why do they have such an odd symbol and why are they marked the way they are? I assume the "2A" part to be the maximum current, and 600R to be some sort of resistance value. But what is the inductance here? I read online that it is a type of ferrite inductor/filter. I need to copy parts of this circuit into another design but I would rather understand what it does first. AI: Most likely it's a ferrite bead. 600R / 2A indicates that its impedance is 600 Ohms at 100MHz, and its current rating is 2 Amps.
H: Raspberry Pi relay on GPIO does not toggle, but does on +3V power I am trying to toggle an SRD-03VDC-SL-C (3V rated) relay with a Raspberry Pi GPIO. When I put a wire to the Raspberry Pi 2B ground pin and the other to a 3.3V power pin the relay works (it clicks). I measured 3.28V with my multimeter. Now, as the relay is confirmed to be working I want to toggle it via software by switching a GPIO pin. I confirmed that the GPIO switching is working with my multimeter: It shows 3.28 V when high and 0 V when low. But when I connect the wire with the GPIO in high state it does not toggle the relay. How is this possible when both pins have the same voltage and how can I fix this? Experimenting with the Raspberry I also observed the situation that I could set the voltage to 0 but disconnecting then made a difference. I would assume that in this case disconnecting would not make a difference. AI: A GPIO pin cannot provide enough current to a relay directly. Use the GPIO pin to drive a transistor, and use the transistor to drive the relay.
H: Logic analyser reads bits as if they are shifted left by 1 bit, what could be the issue? The logic analyser is from Hobby Electronics, and is being run on the PulseView software. It is not reading the data correctly. All of the bits are shifted one to the left so everything is read incorrectly. I tried changing the settings like clock phase/polarity but this didn't help. Additional information: I'm sending the data from an ESP32 slave to an ESP32 master (CHPOL = 0, CHPA = 0, msb-first, word size 8). Here's what the signal looks like, I'm sending all 0x42s, it's reading as 0x84. It should be this: 01000010 It's reading this: 10000100 This is the start of the transaction, here I tried to send a 0x01 but it read 0x03. The clock seems to be starting at the right time... EDIT: I am manually driving the CS LOW which means it is ready to transfer to the master. Please note, the sent data is being read correctly on the other end, it's just the logic analyser that is reading it incorrectly. EDIT2: As per the answers and comments below, the issue was due to the CS pin. AI: Where's the transition on CS? The CS high-low transition is needed to ensure the master and slave are in sync. Without it the slave may receive the data but may not be aligned correctly. Usually it is high between transactions with the CS being active low.
H: Why does wiring to a surge protective device need to avoid sharp bends? Here is an excerpt from some Schneider Electric installation instructions for their QO2175SB 240V single phase "SurgeBreaker" SPD: NOTE: The SPD ... must be installed as close to neutral assembly and main circuit breaker or main lugs as possible. Keep wire lengths as short as possible with no sharp bends. (source) What is the reason for avoiding sharp bends? Is this more likely to cause the wire to fail under surge conditions? Or would it somehow hurt the surge protection effectiveness? And how small of a radius bend would be considered "sharp"? AI: Surges often approximate an "infinite impulse" and, as such, contain significant high-frequency components. In order to be effective you want the surge protection device to shunt as much of that impulse as possible to ground so that it does what you installed it for, specifically to protect your equipment. A bend of any kind in a transmission line affects its impedance and a sharp bend affects it significantly. You might not think you are employing a t-line but considering the HF components of the surge, it is indeed one. By keeping it as straight and short as possible you keep the impedance as constant as possible and therefore you reduce reflections which reduce the effectiveness of the surge protection device.
H: Why use const variables instead of preprocessor directives when programming embedded with C++ I read on here that when programming with C++, const variables are better than preprocessor directives, ie #define, for declaring constants. I'm confused about why that is the case. I understand that a const variable would be stored in static memory, whereas a preprocessor directive would become a literal, and possibly an immediate in assembly, but I don't see why that is a disadvantage. I've also seen that inline functions are better than macros, but I'm confused about what is the difference. Thanks! AI: Using a const value lets the compiler do some type checking, but a value you assign with a #define is just used for text substitution so all sorts of unexpected problems can occur. Regardless of how you define constants, a good compiler should never store them as static values in RAM. A good compiler will often optimize them to immediate values embedded in the instructions themselves or literal values in the literal pool. For an embedded system running out of flash memory the literal pool would also remain in flash and would not take space in RAM. Similarly for macros vs. inline functions. A macro does text substitution in the preprocessor and can easily lead to unintended consequences if you are not careful. If you don't look at the preprocessor output directly it can be hard to find and debug problems with macros. An inline function, on the other hand, provides the same functional capability as a macro but is easier for the compiler to check and easier to debug if necessary.
H: Help with possible errors on LM306 datasheet circuit diagram Not sure if this diagram has some errors like missing nodes at wire crossing. There is an obvious one at a T-intersection but also I circled in red a couple other locations where nodes might be missing. One is below R9 because no output comes off the collector of Q8. The other is between R13 and R14 because it's strange (to me) that they are separate with nothing connecting to them in between. The circuit still does not work, so if anyone sees any other problems please let me know. Thanks. AI: Looks like this other comparator, the LM111/LM311, which was designed shortly after the LM306 has the same or a very similar circuit layout. Based on that it seems that those two nodes are missing from the LM306 datasheet. BTW, the LM306 circuit does "work" with some device (BJT) model parameters but not others. Getting a good fit to the datasheets is next.
H: Multiple Resonances along a transmission line in "Lessons in Electric Circuits", VOL III, ChPT 14, all the possible configurations of standing wave for a certain transmission line are shown. For instance, this is the case of a transmission line left open at the ends: According to the operating frequency and the transmission line characteristics, there may be: My question is: do these different configurations of standing waves exist simultaneusly (i.e. the total voltage and current waveforms are their superposition) or does each of them exclude each other? From the author's analysis, it looks like there is only one of these configurations, at a certain frequency. But I've seen many similar situations in which there is a superposition of standing waves. For instance, I'm thinking at the analogy with a rectangular waveguide: In this situation there are not V and I, but only E and H fields, but the situation is similar: the metallic surfaces of the shell's lateral wall set the condition $$E = 0$$ (as well as I = 0 or V = 0 are set respectively by the open circuit or the short circuit at the end of a transmission line), which may determine the standing waves shown in figure. For this structure, I've always been told that all these modes exist simultaneously: when a source is put inside the waveguide, it excites all propagation modes, some of which are above cut-off (and will propagate) and some other which are below cut-off (and will be attenuated). So, according to the operating frequence, multiple standing waves may exist. Is there a similar situation, with cut-off standing waves frequencies, for transmission lines? AI: Exciting each resonance requires a different signal frequency. Suppose the first resonance occurs at 50 MHz. Then the 2nd one will be at 100 MHz, the 3rd at 150 MHz, and so on. If you excite the line with all these frequencies simultaneously, then you can produce a superposition of all the different standing wave patterns at the same time. If you excite the line with only one frequency at a time, then you'll only excite one resonance at a time. is it the same for the waveguide in the second picture? Or is it how I've always been told ("Given an excitation frequency, there will be all resonance modes above cut-off?")? The two situations are different. In the rectangular waveguide, if you express the modes as a combination of plane waves, each plane wave component has a momentum vector $$\vec{k} = k_x \hat{x} + k_y \hat{y} + k_z \hat{z}, $$ and $$\left|\vec{k}\right| = \frac{2\pi f}{c}$$ and the boundary conditions for each mode are $$ k_x = \frac{n}{2}\frac{2\pi}{w_x}, n=1,2,3,..$$ $$ k_y = \frac{m}{2}\frac{2\pi}{w_y}, m=1,2,3,..$$ where \$w_x\$ and \$w_y\$ are the transverse dimensions of the waveguide. Notice there is no restriction on \$k_z\$. That means for any \$f\$ above a given mode's cut-off we can find a \$k_z\$ that allows \$k_x\$ and \$k_y\$ to "fit" in the transverse dimensions and thus allows the mode to propagate. In the longitudinal resonance case, you're already assuming a particular transverse mode, so \$k_x\$ and \$k_y\$ are fixed for any particular \$f\$ and there's no such additional degree of freedom available to allow \$k_z\$ (aka \$\beta\$) to vary to obtain a resonance except at the specific wavelengths where $$\frac{2\pi f}{c}=k_z=\frac{n}{2}\frac{2\pi}{\ell}$$
H: Subcircuit identification - Power amp Could you please tell me what is the purpose of this highlighted part of the circuit? This is from a Soundtech 6150 powered audio mixer. This specific mixer is outputting the supply voltage and has already burnt a speaker. The transistor on the top-right side of the highlighted area (C104 if you can read this old manual) is heating up quite a bit as well. It is likely that the parts in this circuit are not the original ones. Thank you for your time! AI: That's a nice topic. You're not specific about your background and how much you understand of analog amplifiers... and this one looks pretty much classic. I thought it might help if I highlight some blocks of the circuit. The whole story is long and winding, probably out of scope here - but try to look at those circuit blocks and understand how they behave. The blue and lime blocks form a complementary power output stage, actually an "emitter follower cascade", where the Q106+Q108 form a complementary driver stage, buffering drive current for the power output triplets. In terms of behavior, note that the voltage at the blue line follows the base of Q106, and the green line follows the base of Q108. The purple box contains a single transistor, the Q104 that you have mentioned. This one should stabilize voltage between its C and E, i.e. the voltage step between the blue and lime bases. = provides a pair of relative bias voltages (constant difference between the bases) for the output blue+lime cascade. AC signal propagating through the circuit moves both bases (of the Q106+Q108) "in phase" = same direction, but keeping their constant DC spacing. I'd hazard a guess that this difference should be like 3 Volts - effectively the sum of BE drops across the blue and lime follower cascades, approximately centered around the output potential of the whole amp. In reality, the N-type transies tend to have a higher gain / lower threshold voltage than P-type, therefore you will likely observe a small offset against the perfect center = output. The precise differential bias voltage at the blue+lime bases translates into a particular level of quiescent current across the output power stage, i.e. the Id through Q111..Q116, also visible at their emitter shunt resistors R125/7/9+R132/4/6. The shunt resistors have a dual role: they alleviate differences, somewheat, in the Hfe of the output transistors within a triplet (which needs to be matched nonetheless) and they serve as "current measurement shunts" for the emergency overcurrent limit detector. So: in terms of AC, if you watch it with an oscilloscope, the blue and lime "signal subpaths" should move in unison, and you should have a couple dozen milliamps of quiescent current across the very output stage. Most of the AC voltage swing should be seen at the collector of Q102 in your yellow-highlighted circuit. As others have suggested, this is a constant current source, whose actual current is altered by its input. The whole yellow block provides constant current, but at the same time acts as a voltage inverter (that's the role of the Q102). The collector of Q102 works against a pull-up resistor, consisting of R106+R108 if I'm reading the markings right. So the thermal loss within this stage is shared between Q102, Q104 and R106+R108. As for Q104, I'm slightly surprised that the two resistors across its base do not involve a trimpot = for manual quiescent current adjustment. And, optimally, I believe the Q104 should be thermocoupled to the heatsink of the output power stage, to provide negative thermal feedback. If Q104 is not original, I wouldn't be surprised if the resulting base bias voltage for the blue and lime sections was wrong, possibly with disastrous effects for the power output transistors. When diagnosing the circuit, look for transistors that behave weird, "not following their rules of operation". And, be aware of the negative feedback, that keeps trying to compensate for any broken transistor by pulling the healthy parts of the circuit in the other way. Mind the monolithic op-amp used as the diff input and early gain stages of the circuit, and Q101 itself as a voltage inverter stage - those two are a part of the global negative feedback loop as well. Debugging circuits involving a complex negative feedback is lots of fun, especially the complementary parts of the signal path where something can be broken in one half and the other half can still be working... I suggest that you get yourself some sort of a lab PSU with adjustable symmetrical output. Even just the original PSU with an iron-core mains transformer, and prepend an auto-transformer or a "sinewave chopper" / phase controller. This, in order to be able to start up with low voltages, when debugging.
H: JFET as an amplifier I'm working on this circuit below: What is the functionality of R2 here? Stabilizing the input voltage? (If it was, it would've been connected in series, right?) AI: What is the functionality of R2 here It's used to bias the gate to 0 volts. Because an N channel JFET works with a range of negative voltages on the gate with respect to the source, biasing this way ensures that the JFET conducts a few mA of current causing the source to rise to a positive value. At this point equilibrium is reached due to negative feedback.
H: About 'water soluble solder' I'm a hobbyist with a few years of practice and managed to make some nice musical instruments for myself, making steady progress over time. For about the last six weeks, nothing I try to do works. Voltages are all over the place, I'm about to go mad. I'm even unable to replicate circuits I already made with success. I'm using the exact same techniques and equipment, the only thing that changed is that I bought 'water soluble solder' from AIM. Could this have such an impact? AI: Are you cleaning the boards after soldering? From what I understand, you must clean flux residue from water soluble flux. From the datasheet of the AIM 13154 solder: OAJ flux residues MUST be removed after soldering. The solder you purchased uses OAJ flux. From what I have read, OAJ flux residue has a lower resistance than normal flux residue. The lower resistance can cause high impedance circuits to misbehave. OAJ flux is also more aggressive - the residue can apparently attack the copper and damage the connections over time. Additionally, AIM says to use higher soldering iron temperatures than you would normally expect for solder with lead: Solder iron tip temperature should be between 350° - 400°C (650° - 750°F) for Sn63, Sn62 and Sn60 alloys, 370° - 425°C (700° - 800°F) for SN100C®, Sn/Ag and Sn/Ag/Cu (SAC305, SAC405, CASTIN, etc.) alloys. I normally solder 60/40 tin/lead (the alloy you are using) at about 270°C. The temperatures AIM gives for 60/40 tin/lead are what I would use for lead free alloys. The temperatures they give for the lead free alloys are higher still. Use the recommended temperature. Clean your boards and joints after soldering. I could not find an explanation for "OAJ." AIM says it is an "amine neutralized halide-activator system." I have no idea how you get from that to "OAJ." I found an old post (from 2004) on the Microchip forum where someone has the same problem, and the same ultimate cause - OAJ flux that wasn't washed off after soldering. The flux residue caused erratic operation, and caused known good circuits to misbehave. Use hot water to clean off the residue.
H: Disable stepper driver I'm trying to disable the stepper driver to allow manual operation of the lead screw it's controlling. I've tried connecting MF+ and MF- to ground and 24V in multiple combinations but the motor was still energized. Any ideas? Thank you. AI: How are you driving the other +/- inputs? Drive MF the same. These inputs are typically meant to be driven with an open collector output. A logic output will usually work also if VCC is the same as a logic high. It appears that active = LED On. If you put 5V on MF+ and ground MF- is should disable the stepper. simulate this circuit – Schematic created using CircuitLab
H: How can I calculate the dead time to prevent shoot-through? From Figure 1 is evident that to get the dead time I must define the values for RC. E.g my resistor is 220 ohms and capacitor is 0.1uF this gives me 22us at 1-time constant, however, when I measure this on my Pico scope this shows roughly 6.5us at the point of the dead time. Could some one help me understand where the 6.5uS comes from when using these values please ? Image source: How is dead time in a half bridge implemented. AI: I have a slightly different circuit than the one proposed by Andy. I used it many times in half-bridge circuits for providing adequate deadtime. I considered a 5-V level for the clock while the AND gates being supplied by a 5-V \$V_{cc}\$ toggle at 2.5 V. If you use different gates, you can modify the below calculations accordingly: In this example, the macro calculates a 289-pF capacitor for the wanted 200-ns deadtime.
H: How does this overvoltage protection work? I was looking around for low cost and effective overvoltage protection, and I found this from this page: With this part list: RXE025 - 250 mA PTC resettable fuse Zener diode – 5V6, 1 watt Resistor – 1K ohm, 1 watt Transistor – BD139 (NPN medium power 80V, 1.5A CC rating) As reported by the author, this circuit seems to be effective and low cost, but I don't understand why the engineer placed a BD193 transistor in this circuit. Can anyone explain the step-by-step operating method of this circuit? AI: It's pretty simple: The Zener diode voltage is at (or slightly above) the normal Vcc voltage. For example, a 5.6V Zener for a 5V Vcc. When Vcc is below the Zener voltage, no current flows through the diode, and the 1k resistor keeps the base of T1 low. No current flows through the collector to the emitter of the transistor. When Vcc is higher than the Zener voltage, current flows through the Zener diode and through the base of T1. This allows current to flow through the collector and out the emitter of the transistor. The current through the transistor is high enough to cause the fuse to open. Short version: Overvoltage causes the transistor to short and blow the fuse. Having read the article and looked up the RXE025, I see I need to change my description somewhat. This protection circuit doesn't shut off power to the protected circuit. When the input voltage exceeds the Zener voltage the transistor conducts. The RXE025 was chosen because even in a "tripped" condition it will pass enough current that the protected device (an Arduino in the original example) will continue to run. The RXE025 turns in to a current limiting resistor to limit current through the Zener diode and the transistor. The result is that Vcc is limited to a little more than the Zener voltage. The "fuse" doesn't blow in the usual sense, it merely changes to a higher resistance.
H: DC Circuit Analysis from Sergio Franco Book : Electric Circuit Fundamentals If current source is absorbing power then the polarity wise Vb will be +ve.Then i calculated the value of Vb=4 x 2A = 8V Va= Vb + (20*2) = 48V and Vs = 164V Thus for current source to absorb power of 0 W., voltage source has to change from 17V to 164 V. But ansewr is 140V. Even if i take Change = 164-17V = 147V. Where am i wrong ? AI: Notice that to get power equal to \$P = 0W\$ for a current source. We need to have \$P = 2A * v_B = 0W\$ Therefore \$v_B = 0V\$ becouse now \$P = 2A * 0V = 0W\$. This also implies that \$I_1 = 0A \$ and \$I_2 = 2A\$. Now it should be easy to see why the answer is \$v_S = 140V\$
H: Controlling a power supply with a MOSFET I'm making a circuit that will have a main part (up to 5A load) in a back box, mostly unreachable, and a control panel at the front. I want to have a kill switch at the front panel, so that I won't have to reach for the back part, but I don't want to bring the main load wires there, so I was thinking of having a MOSFET control the circuit, and then I would only need the wires to control the gate and a switch at the front. Here's my idea: Only SW2 would be at the front (SW1 would be a backup at the back), and the two wires to connect it, with everything else at the back. VCC and ground would then connect to the rest of the back circuit. Does this even work? AI: Almost. You need a resistor from the gate to the source to guarantee that the FET turns off when the switch opens. There is almost zero steady-state current in the off condition. For the on condition, the lower the resistance, the less noise pickup that could lead to false triggering of the MOSFET, but the higher the power dissipation. Consider 1 K, 1/2 W as a starting value. A common rule of thumb for long-term reliability is 2:1. Devices should be rated for a minimum of twice the conditions they will operate in. Examples: 12 V circuit -- 30 V FET 5 A load -- 10 A FET 0.144 W dissipation -- 0.5 W resistor
H: C++ AVR big code size & excess unused symbols in build file I'm developing the program for the AVR microcontroller in C++. I have created a class that contains 8 methods(with constructors) but used only 3. Class code: class Pin { Pin(); Pin(PinId pin_id); Pin(Port port, uint8_t pin); void SetDirection(Direction direction); Direction GetDirection() const; void Write(Signal signal); Signal Read() const; void Toggle(); }; I expect that in the build file unused methods won't be, but it will. I use the Ghidra disassembler to disassemble the build file. Pin(Port port, uint8_t pin), SetDirection and Toggle are used only (simple LED flasher). But there are all of these methods in the build file and there are no references to these methods. So, why compiler/optimizer/linker doesn't remove these methods from the build file? I compile the program with -Os optimization parameter and Release CMake configuration. For example, the Write method in the Ghidra: But the Write method isn't used in my code (and in other class' methods too). How can I optimize it? Thanks in advance! AI: If using GCC (AVR-GCC), the following options can be helpful Compiler: -fdata-sections -ffunction-sections Linker: -Wl,--gc-sections Additional explanation: The above options work together as follows -ffunction-sections and -fdata-sections -- these put each function or data item into its own section in the output file (i.e. object file coming out of compiler). At this stage it's too soon to say whether we can garbage collect anything, only when linking will there be enough information to make that decision, hence the linker option below -Wl,--gc-sections -- figures out if there are "sections" that are never used and removes them ("garbage-collection")... Reference: the documentation Also, examining the .map file is a way to deduce how much individual functions/methods or static data items are contributing to the total size
H: time domain reflectometry on long cables Is it possible to use time domain reflectometry on cables with a length of more than 100km? What kind of problems do time domain reflectometers on that long cables face? AI: If I have done my math correctly, in the region where the characteristic impedance is relatively constant with frequency, and assuming the leakage conductance is negligible, the attenuation parameter for a transmission line is given by \$\alpha \approx \frac{\displaystyle R}{\displaystyle 2Z_0}\$ If we look at, for example 100\$\Omega\$ cat 5e cable, it has a \$Z_0\$ of 100 \$\Omega\$ and an R of 0.188\$\Omega\$/m. That gives an attenuation constant of \$\alpha = \frac{\displaystyle 0.188}{\displaystyle 2\cdot 100} = 0.00094\$ nepers/meter Over 100km, the attenuation factor should be 100000 x 0.00094 = 94 nepers. That means that a 1V signal applied to the near end of the cable will be \$e^{-94} \approx 1.5 \cdot 10^{-41}\$ volts when it reaches the far end of the cable. By the time it returns, it will have been attenuated to \$1.5^2 \cdot 10^{-82} = 2.25 \cdot 10^{-82}\$ volts. So, it is not feasible to use TDR for 100km of cat 5e cable using a frequency in that region. But high voltage AC power lines can transmit power over 100km without that kind of attenuation. What if we use a lower frequency? At lower frequencies, dispersion will be the major problem. For your enjoyment, I leave you with the story of the first transatlantic cable. In order to distinguish dots from dashes which were spread due to dispersion, they had to use a very slow transmission rate. According to this account of the first transatlantic cable it took 16 hours to send the first message of 98 words. Longer cable, (3200km) but you get the idea.
H: Separately excited DC generator as a constant current source Is it possible to operate separately excited DC generator as a constant current source using the following method? Keeping torque due to prime mover and field winding constant, reduce armature reaction close to zero using compensating windings and interpole windings. Is this method practically possible and can it be implemented or is there some flaw in this method? AI: Back Torque in a DC generator is proportional to armature current x armature flux. So if as you say you keep the flux constant Back Torque is proportional to armature current. So constant torque constant current. The problem is that in order to maintain constant torque you are going to have to alter the speed of the generator. This involves a system which can measure the torque or current and an appropriate governor on the prime mover. The practicality of this depends on a number of factors the main one being the required output power range and the torque curve of the prime mover. Most generators are designed to operate at one speed which corresponds with the optimum operating point of the prime mover. As has been said in the comments it is probably simpler to implement some sort of electronic constant current source.
H: Fourier coefficient and resolution in simulators I post below two fourier graphs of the same signal, simulated for two different transient durations: The time domain function is a sine with 60Hz frequency. Transient duration 40ms gives the following fourier graph: Transient duration of 300ms gives the following Fourier graph: I had expected the fundamental frequency used to calculate the coefficients to be 60Hz, the main frequency of the time domain function. But the simulator uses the transient duration as a period to compute first the fundamental frequency and then calculates the Fourier coefficient. Is that convenient event though the sine function is periodic? In the simulator window, there is something called Resolution/Frequency; what is the link between this resolution and the formula used to calculate the coefficients of a Fourier series? NB: the simulator is Simplis/Simetrix for power electronics. AI: From your 2nd picture, I see a 120 Hz peak, and since you're using the power-supply tag, I guess you're probing the waveform after the rectifier. In the end, the best results with FFT are when there is a fixed number of periods involved. It also helps for the signal to be in its steady-state. In your case it should be n/60. For your first attempt, you used 40 ms, which means there were 0.04*60=2.4 periods involved. That results in a lot of leakage (unless you used a window). For the second case you have 0.3*60=18 periods, which is a multiple of 1/60, thus you get a clean FFT. The longer the time sequence, the lower the minimum frequency in the spectrum. The higher the points, the higher the maximum frequency. It doesn't matter what program you're using, these are the rules of the Fourier transform.
H: How can such an equation for the temperature of a *black body* be valid in this case? I am currently studying The Art of Electronics, third edition, by Horowitz and Hill. Exercise 1.6 says the following: C. Power in resistors The power dissipated by a resistor (or any other device) is \$P = IV\$. Using Ohm’s law, you can get the equivalent forms \$P = I^2 R\$ and \$P = V^2 / R\$. Exercise 1.6. Optional exercise: New York City requires about \$10^{10}\$ watts of electrical power, at 115 volts (this is plausible: 10 million people averaging 1 kilowatt each). A heavy power cable might be an inch in diameter. Let’s calculate what will happen if we try to supply the power through a cable 1 foot in diameter made of pure copper. Its resistance is \$0.05 \ \mu \Omega\$ (\$5 \times 10^{−8}\$ ohms) per foot. Calculate (a) the power lost per foot from “\$I^2R\$ losses," (b) the length of cable over which you will lose all \$ 10^{10} \$ watts, and (c) how hot the cable will get, if you know the physics involved (\$ \omega = 6 \times 10^{-12} \text{W}/\text{K}^4 \text{cm}^2 \$). If you have done your computations correctly, the result should seem preposterous. What is the solution to this puzzle. We managed to get the answer to (a) here as \$ 3.8 \times 10^8 \ \text{W}/\text{ft} \$. I then get \$ \dfrac{10^{10} \text{W}}{3.8 \times 10^8 \ \text{W}/\text{ft}} = 26.32 \ \text{ft} \$ for (b). Now, I'm trying to solve (c). I'm referring to this document, which claims that, to calculate the heat dissipated by the cable, we can use the Stefan-Boltzmann equation. However, according to the Wikipedia article, this equation describes the power radiated from a black body in terms of its temperature. How can such an equation for the temperature of a black body be valid in this case? EDIT AI: First, the exercise is intended to present an absurd answer (I assume they're using it to lead in to the use of high-tension wires). Second, blackbody radiation is used for more than things that are perfectly black. The Stefan-Boltzmann equation is only valid for things with a perfectly black surface -- but it's easy to adjust it's effects based on the surface's emissivity, or to adjust the surface emissivity for the purpose at hand (Which is why some heat sinks are black. See my last paragraph). Copper isn't very emissive (because it's shiny -- emissivity is more or less the reciprocal of reflectivity) but they're trying to show that even if the thing were perfectly black it'd still reach an absurdly high temperature. So for finding the minimum temperature that the thing would reach from radiative cooling, purely radiative cooling, they're on track. A slightly more real-world calculation would use convective cooling (i.e., air) -- but given the temperature reached with just radiative cooling, you're really just finding that the wire will take about five times longer to explode into copper vapor with convective cooling as it would with radiative. Radiative cooling really is a thing, and while it's contribution to cooling stuff in air is usually not the biggest factor, it's enough to motivate people to often make heat sinks (and engine cooling fins) black. This post -- Does the paint colour matter on a heat sink? -- does a rough calculation for a given heat sink to find that the radiative cooling in still air is something like 25% of the total (I suspect it's less). For a heat sink in a vacuum, all the cooling is radiative, so "black body" radiation does matter (as does emissivity -- if you see some bit of space hardware wrapped in shiny foil, it's because the designer wants it to stay cool when the sun is shining on it).
H: SPI protocol implementation and delay From my understanding, SPI is implemented by using 2 shift registers, one at each device. Shift registers are a serially connection of D-flipflops If the same clock is used to transfer data from master to slave and from slave to master If the clock signal is clocked at MSB on the master, the new data is racing towards the LSB on the slave device, so if the LSB flip flop does not receive a clock before the new data arrives its essentially overwritten. Similarly if the clock reaches the MSB+1 faster than MSB on a shift register the data is overwritten at MSB reaching LSB at the salve device How are these 2 problems solved? Im assuming maybe some buffers or a FIFO is used In addition, when the clock frequency increases, for the first case if the clock line to LSB slave is faster than the data transfer essentially the MSB data is clocked twice at the LSB slave How is this problem solved? Or are any of these problems at all? Thanks AI: Basic SPI is system synchronous, that is, a single clock determines the timing origin for both outbound and returning signals. SPI also specifies that signals launch on one edge (e.g., falling) and sampling on the other (e.g., rising). This is a way to ensure the data are stable during the sampling time. More generally, the SPI data needs to meet setup and hold time to the sampling edge to ensure reliable data capture. As the clock rate increases, a problem arises called turn around time: the total delay from clock launch, through the endpoint, then back to the master eats up the read data setup time at the master. This affects SPI reads and can severely limit the achievable clock speed. Careful design of the slave’s read data shift register and clock tree can reduce this, but there will always be trace delay, clock delay and clock-to-Q added to the read data. Unfortunately, by specifying launch-on-opposite edge, the SPI protocol just makes the turnaround issue worse: the half-cycle delay eats up even more of the read data setup time. It’s actually better to specify a setup/hold and design your timing to that, with read data launched on the rising edge. Then the entire cycle can be used to propagate the read data and thus relax the setup time. Another alternative is to synthesize a clock at the slave that compensates for the turn around time, using a delay-lock loop. Or, if the master and slave share a common reference they can synthesize local copies of the SPI clock. Some fast SPI implementations introduce a DQS return strobe alongside the data that has similar timing. This approach is called source synchronous, and is the same technique used for DRAM, Ethernet MAC-PHY and some fast digital interfaces like SDIO.
H: Motor rewinding - saturation concerns After reading a lot about 3 phase BLDC motors there's one concern that's nowhere to be found. Let's say that we have a 1000 Kv motor and we want to rewind it to 10 Kv to get unrealistically high torque at low RPM. And let's say that we have the right diameter replacement copper wire. Will there be saturation from iron or permanent magnets? This questions is probably very wrong as magnets are passive and will probably not saturate, but I'm really unsure and don't have sufficient knowledge about magnetism, so from my perspective only the iron laminations can saturate from high enough force produced from current circulating around them. AI: Will there be saturation from iron or permanent magnets? No. Magnetic flux is directly proportional to current multiplied by turns. Assuming all the winding space is used, if you increase the number of turns then you have to decrease the wire diameter, which increases resistance and reduces current draw. The result will be less flux and torque than the original motor could produce on the same voltage. For example if you double the number of turns then each turn has to fit in half the area, so its resistance will be double that of the original. Since you have doubled the number of turns, the total winding resistance will increase by 4 times and the current will be reduced to 1/4. The result is half the flux (and torque) of the original motor. But what if you raise the voltage? Double the voltage and current is doubled to half that of the original winding, and flux and torque are restored. Kv was halved by having twice as many turns, but the higher voltage makes up for it. Power dissipated in the windings is also the same, so you get back to the same performance as the original motor but at double the voltage and half the current. To get more torque you have to go the other way and reduce the number of turns, which increases current. Go too far and the flux produced may be enough to saturate the core, then any further current increase has less effect. Theoretically the flux could get high enough to demagnetize the magnets, but the current required to demagnetize Neodym magnets would probably melt the windings. The real danger is heat from the windings raising magnet temperature enough to demagnetize them. This is not just theoretical, as high power magnets may suffer partial demagnetization at temperatures as low as 80 °C.
H: Estimating VAC rating from VDC rating I have encountered several terminals, sockets, cables, and similar components which are rated in either DC or AC voltage, but not both. I sometimes want to use an AC rated part with DC or vice versa. Is there a way to identify when this is obviously unsafe? For example, I know not to use something rated for 12VDC with 125VAC. To give a specific case, I want to know if I can use this https://www.grote.com/electrical-connections/trailer-connectors/heavy-duty-7-way-connectors/82-2145/ 40a @ 28 VDC rated socket with a 10a @ 125 VAC load. Thank you. AI: You can not estimate an AC rating from a DC rating, a DC rating from and AC rating or estimate any other "rating." The rating is what is published by the manufacturer. What you are asking for is an estimate of the risk involved with using a component outside of its rating. It is really a bad idea to leave anything unattended if you are not certain that is will be operated within its ratings. It is probably not a good idea to operate anything above 50 volts if that is outside its rating. The risk also goes up with increased current. You are always on your own when you take the risk of using something outside of its rating.
H: RLC band pass filter — getting the correct phase Consider the RLC band pass filter circuit: I’m trying to construct this circuit with a maximum of the transfer curve at \$f=5-6\$kHz and bandwidth \$\beta=2\pi \cdot 2\$kHz and so I have chosen a 88k\$\Omega\$ resistor, 7H inductor and 0.1nF capacitor, according to the formulas $$f=1/(2\pi \sqrt{LC})$$ and $$\beta=R/L \ .$$ See the attached image. The maximum occurs at approximately 4.5kHz. The blue wave on the oscilloscope is the output signal after the resistor in the circuit above. The yellow the input signal. At 4.5kHz however, the waves are out of phase. Aren’t they supposed to be in phase? EDIT1: As the frequency decreases below 4.5kHz, they get in phase. Above they get even more out of phase. EDIT2: After increasing capacitor by 100 and decreasing resistor and inductor by 100, the two signals are more or less the same as the frequency varies. AI: your scope probe for series current resonance must be in parallel of R and not in series with scope =1M choose your load regardless of filter specs. Here I chose 50 Ohms Move the scope probes as shown below.
H: 20 amp to a 40 amp circuit On the back of my house is the breaker box. It has an open 40AMP fuse (not connected to anything any more). There is also a 20AMP fuse connected to my shed. When the shed was originally built, it was only going to be used to hold junk and so a couple of incandescent light bulbs worked fine. Now I'd like to use the shed as a workshop. I'd like to be able to run a window AC unit (700w IIRC), several LED workshop lights (like the old fluorescent tubes but only LED instead), and some power tools, nothing crazy. Can I move switch the breakers in the breaker box so that I have the 40amps available to my workshop? AI: Probably not as a 20A circuit is likely run with 12 ga wire which will be unsuitable for your 40A circuit. Doing what you propose is both dangerous and illegal. Are you really using fuses?
H: What is the meaning of over sampling EFR32FG14 ADC? In chapter 28 the SAR ADC is described. It says that we can have 12-bit sample with 1 mega samples per second. Assuming I have set the ADC to work that way, what is the meaning of oversampling it? It cannot produce more samples than what we set it to be. So there are the basic settings and oversampling is the extra option on top? What is the quality of those samples? I know about oversampling in sigma delta converters, but what does it do in SAR? https://www.silabs.com/documents/public/reference-manuals/efr32xg14-rm.pdf AI: It means that the chip has hardware support for oversampling, filtering and decimation. You have a real sampling rate, and you set an oversampling number. The chip accumulates and averages the given number of samples. You get more resolution, but a lower sampling rate. If you set the sampling rate to 1 megasamples per second, 12 bit depth, and oversampling 16, then you would get the equivalent of 16 bit sampling and an effective sampling rate of 62.5 kilo samples per second. There's a table on page 863 that shows the effective sampling depth for various oversampling settings:
H: Unsigned int values gives negative number above the halfway point of max byte value? MCU: Atemga328P: Datasheet:https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf Note: I am a beginner :) Considering a 2 byte unsigned int data type, where 65535 is the max value and 32767 in the halfway point. Problem: unsigned int num; in the below code yields negative numbers on serial monitor for unsigned int num values above 32767 even though it is an unsigned variable. Examples: unsigned int num = 65534 shows -2 on the serial monitor and unsigned int num = 32768 shows -32768 on the serial monitor. Note: I am using USB connection provided by Arduino board for UART communication. #include <avr/io.h> // header file file for input output pins #include <util/delay.h> // header file for delay. #include <avr/interrupt.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define F_CPU 16000000UL #define BAUD 9600 #define BRC ((F_CPU/16/BAUD)-1) void uarttrasnmitinteger(unsigned int num, char*snum, int delay); void uarttransmitenable(void); char snum[20]; unsigned int num = -65534; int main (void) { uarttransmitenable(); while (1) { uarttrasnmitinteger(num, snum, 1000); } } void uarttransmitenable(void){ // Enables UART transmission UBRR0H = (BRC >> 8); UBRR0L = BRC; UCSR0B = (1<<TXEN0); UCSR0C = (1<<UCSZ01) | (1<<UCSZ00); } void uarttrasnmitinteger(unsigned int num, char*snum, int delay){ itoa(num, snum, 10); //Converts integer to string unsigned int i; for (i=0; i< strlen(snum); i++) { while (( UCSR0A & (1<<UDRE0)) == 0){}; UDR0 = (char)snum[i]; //outputs to serial monitor } _delay_ms(delay); } AI: I think the problem is the itoa() function. Its parameter is a normal signed integer, so your unsigned int is being coerced to a signed int.
H: Flooding GND plane in the top side has any problems? Hope Everyone is doing well. I got confused in the grounding of PCB. I checked many open hardware boards I noticed they don't flood GND plane in the top side to connect SMD components( all components on top ) which is appeared to me the best way to minimize the number of vias instead they use vias for each pad connected to GND PLANE IN THE bottom layer and they run only signal/power traces on the top. Can anyone explain this to me please AI: A ground plane in the top layer via is ok but it’s likely to be fragmented, especially if the board density is high. If you have a ground plane on an internal layer then you’re only ever one via away from a low-impedance ground. In contrast, if your fill has lots of necks and fingers then it won’t work as effectively.
H: Why can't I make flip-flops in logic simulators? I've been playing with a few logic simulators and don't understand why flip-flops are not working. I'm trying to implement a T flip-flop with NAND gates: All the simulators I've tried give the same result. Either Q or Q' takes the state of the clock rather than toggling on the rising edge, depending on the timing of the internal updates. Given the symmetry of the circuit I'm not that surprised, but wonder how it's meant to work in practice. Is this even possible, or do these imulators provide flip-flop components because it's not possible to do with basic parts? If so, why and what is missing? Simulators: https://logic.ly/demo https://circuitverse.org/simulator https://academo.org/demos/logic-gate-simulator/ https://simulator.io/board NAND gate circuit compared to a provided T flip-flop (circuitverse.org): The same in simulator.io (using AND+NOT as there's no NAND): AI: Because from this page, the style that you show only works if the width of the clock pulse is tuned to be long enough for the output stage to react, yet short enough for the thing to not oscillate. A logic simulator that doesn't model propagation time may not be able to cope. To simulate your circuit, you'd need a circuit simulator that 'understands' propagation delay, or you'd need to simulate your circuit at the transistor level. That same page shows this circuit for a fully synchronous J-Kflip-flop (just connect J & K together for a T f-f): You may want to try that in your simulator, see what happens.
H: How does this expanded memory bus work? I'm reverse engineering a laser printer (Laserjet 1320) and I need to infer some things about the memory bus. The full schematic I've made while reversing is here (in pdf) on Drive. I'm not all that familiar with embedded hardware memory mapping and this part confuses me: The processor is a Freescale ColdFire-based device (in particular, with a ColdFire v2 core) but the particulars are proprietary. Regardless, ColdFire is basically M68k so I would assume the processor address bus is either 24 bits or full 32-bit. The program is stored in mask ROM U8, connected to the 14-bit address bus (A0:A13). Then, address bits A14:A20 are connected to D-latch U5, loaded loaded by A4:A10. Here's the datasheet for the mask ROM, and the datasheet for the D latch. When U8 is disabled (nCE HIGH) the latch is transparent; then U8 is enabled (nCE LOW) and the latch latches. What I'm wondering is, how is this implemented on the processor side? First, a bit must be set HIGH, then bits A4:A10 are set, then the pin is set LOW, and pins A0:A13 are set. But how does the processor actually access these addresses when they're provided? Does it require two clock cycles when changing the significant bits, and if so, is this a processor issue or an external hardware issue? AI: Looks like address bits A14-20 are multiplexed with A4-10. The MCU probably puts out the higher address bits first to give an external decoder time to select a memory block, then puts out the lower address bits when reading or writing to memory. This also suits the multiplexing required for DRAM, which expects row and column addresses on the same address pins as RAS and CAS are activated. A21-23 might also be multiplexed with A11-13, which would give a 24 bit address space (16 MiB, same as the 68000) in 8 bit data bus mode. This might explain why address lines A4-A10 were chosen rather than A7-A13. In 16 bit mode A0-A22 would represent A1-A23, with upper and lower data strobes substituting for A0.
H: XTR115 current loop transmitter more steady output I'm using a XTR115U in my circuit to make a 4-20mA output. As I found out this IC is a current amplifier based on the below image on the datasheet. To test this IC, I connected the 2.5V Vref using a 20K resistor to pin2 (Iin). But I have a flicker on the output with a magnititude of 0.01 mA, and on the other hand the circuit is very dependent to tempreture as I heated the 20K resistor the output changed dramaticly. What is the best practice to make use of this IC? AI: Check all your connections. Look at the output with an oscilloscope as well as a meter. Connect a 10nF capacitor across the loop connections at the transmitter end. Make sure your Vloop is a minimum of 7.5V + ~22mA * RL (RL is inclusive of your current meter input resistance). Do not add a capacitor on Vref without implementing one of the compensation schemes described in the datasheet.
H: How to find Vthreshold and K (or beta) in Pspice/Orcad Regarding M2n7000 transistor in OrCAD, I want to find its Vthreshold and Beta (or k) by its edit PSpice model. This is what I get : And by Vthresh and Beta (or k ) I mean the parameters of this formula : By the way, regarding This Thread I know the formula for K, but I cannot find all of its parameters in the model I mentioned above. Thanks. AI: In the case of a MOS transistor, the threshold voltage, and the transconductance coefficient can be extracted from a spice model. So, the threshold voltage \$V_T = V_{TO} = V_{GS(TH)} =1.73V\$ in case of your model. And the \$K\$ factor is: \$K = K_P\frac{W}{L} = 1.073\mu\frac{0.12}{2\mu} = 64.38\textrm{m} \frac{A}{V^2}\$ The end.
H: Can you turn AC into DC through a Spark Gap? Is it possible to convert AC to DC using a spark gap as the medium, if so, could you provide a diagram? AI: Yes you can, but you'll need a very special spark gap: This is a mercury arc rectifier, in other words an oldskool thyristor. A real spark gap, like this one, is usually symmetrical, which means both electrodes are somewhat the same. But... if you want to turn AC into DC, that is to rectify it, then you want it to conduct current in one direction, but not in the other direction. So it can't be symmetrical, there has to be something in its construction that makes it conduct when voltage is one polarity, and not conduct when voltage is the other polarity. A spark gap is pretty dumb, it's just gas between electrodes, and when there is enough electric field (ie, voltage) the gas gets ionized, becomes conductive, and current flows. There is no mechanism in there to only allow current to flow in one direction ; gas molecules have no idea of direction anyway, so it can't be used to rectify. So the solution is to add an extra trigger electrode (the small pin in the middle): In normal use, distance between the two large electrodes is enough so the gas doesn't get ionized and nothing happens. But if a high voltage pulse is applied to the trigger, then the gas gets ionized, and current flows. It will keep flowing until the gas de-ionizes and becomes an insulator again, which will happen only when current stops flowing. So it's possible to turn it on, but not possible to turn it off. This is not a problem with AC as the current goes to zero twice per period, so it'll turn itself off eventually. So... this triggered spark gap is pretty much like a thyristor or a triac. It's basically a switch, so if it is triggered with the proper timing, then it can be used to make a controlled rectifier. The tiny one in the picture wouldn't last very long because the spark would melt the electrodes quickly, which is why triggered spark gap rectifiers use mercury electrodes: it's already a liquid, so it doesn't care about melting. Now, these days, semiconductors are a lot more convenient and less toxic. So the answer to your question is most likely "just use diodes". Unless you want to rectify the output of a nuclear powerplant to send it over 1000km long high voltage DC line, in which case mercury arc rectifiers still seem to be a competitive option.
H: Flicker-free brightness control of RGB LEDs I would like to individually control the brightness and colour of 100 RGB LEDs. I would like to do this with a fairly smooth current through each LED. I.E. I would not like to use the traditional PWM method, because that causes irritating flicker on the retina, and problems when filming them. One way to do this would be to use an inductor to smooth out the current, but this also requires a capacitor, a diode and a transistor. With 100 RGB LEDs, that comes to 900 components! What other ways are there to achieve smooth current control through LEDs? Are there any chipsets which do this? The following are my other requirements: must be reasonably efficient, so no entirely linear solutions. must be able to control current from 0mA to 50mA in reasonably small steps. low cost and low component count would be nice. AI: The usual solution to control lots of RGB LEDs is individually addressable LEDs like WS2812B. I believe these have a PWM frequency of 400Hz, so perhaps addressable LEDs based on a chip like GS8208, which has a PWM frequency of 8kHz, would be preferable. Since each LED has its own free running oscillator, they won't be synchronized. The frequency of each LED will drift randomly. They don't turn on and off at the same time, which means the PWM flicker of all the LEDs is smoothed. 8 kHz PWM produces absolutely no visible flicker, and these LEDs are available on readymade strips, so you should really try that first. If you still have flicker problems, then the next easiest solution would be to use a readymade LED strip with control chips like WS2811 and solder capacitors in parallel with the LEDs to smooth the current. This won't work with GS8208 because of its particular output structure which puts all the LEDs in series to get higher efficiency when a white color is selected (and also allows higher supply voltage). But with a chip like WS2811, or perhaps one that has higher PWM frequency, each LED is connected independently to a PWM current source. This means efficiency is worse than GS8208 for white and better for single color, and supply voltage has to be 5V, but... adding capacitors could work. The next solution would be to control each LED individually, which would indeed require tons of components. You'd have to use linear current regulators, because it isn't realistic to use switching current regulators due to component count. These would need to regulate the current, which means you'd have to add current sense resistors and switching current regulation chips. You could get almost the same efficiency by using just three voltage output buck converters, generating just the minimum voltage for each color, and using that as power supply for each color. Then the linear current driver would use very little power. But you still need one DAC channel per LED (3 per RGB LED) which may be filtered PWM (add one resistor and cap) and a cheap voltage controlled current source, ie an opamp, FET, and resistor. You could make it with just one transistor or two, but then it'll have substantial offset voltage, which means you won't know where the zero brightness point is. So really, try it with GS8208, see if 8kHz PWM frequency does the trick first.
H: ltspice, simulate negative resistance, avalanche effect I found some nice circuits here as a pulse generators http://cappels.org/dproj/simplest_LED_flasher/Simplest_LED_Flasher_Circuit.html The author shows some scope pics and films from real world.. working. But when simulated in LtSpice... does nothing :((( What should be the problem? Thank you. AI: This circuit will not work because the commonly used BJT's models in simulation tools do not support (model) the "avalanche breakdown". You need to download the Bordodynov's lib available here: http://bordodynov.ltwiki.org/ And used the avalanche BJT's. Additionally in real life, these circuits will not work with all small-signal NPN transistors. And will never work with PNP transistors. And it will not work with a low supply voltage. Therefore, you should treat these circuits as an interesting way of using the "parasitic properties" of BJT not intended by the designer. And this is for sure not a reliable solution.
H: How do you use an LED's log V/I curve to force an exponential current change in the LED for a linear voltage change? The info needed to make log and exponential converters with silicon is widely available. The saturation current, intrinsic resistances, and the Ebers-Moll equation are sufficient. A few other numbers help extend the functional range. Does similar information exist for LEDs? If so, can someone point me to it? How much voltage increase does it take to double LED current? Is it the same for different LED colors and semiconductor formulations? How much does it vary with temperature? How much current can you push through one before the internal resistance contributes too much error? How little current can you push through one before nonlinearities and errors overwhelm the signal? Do they need to be blacked out so that ambient light can't affect them? AI: LEDs are specified, as far as they are, to allow you to design power supplies to get a reasonable current through them. They are not intended to have any particular V/I relation, or be judged on their goodness of fit to any particular theoretical relation. This means if you want to use LEDs in your V/I converter, you are on your own to characterise them. To give you a leg up, here are some curves I plotted for my own interest a few years ago. Sorry that the colours of the traces don't correspond to the colours of the LEDs. This plot was intended to be comparative, so I have not made a note of the temperature, and IIRC the illumination was typical lab lighting levels. See how bad a 3 V zener diode is, compared to a LED. Notice the 1N4006 is a 'better' diode at both high and low currents than a 1N4148, so now you know which to use to put in shunt with your 200 mV input meter to protect it from accident.
H: MOSFET voltage is opposite from what I expect I have this circuit on LTspice. The voltage from the 12V seems to rise when the 5V is falling. What am I doing wrong? AI: This is what you should get. If V1 is 0V M1 is turned off so R1 pulls the output up to 12V. In this state imagine the circuit without M1 present all you have is R1 connected to 12V. There is no current through the resistor so the output has to be 12V If v1 is 5V M1 is turned on and pulls the output down to 0V. In this state imagine that M1 is replaced with a short circuit from Drain to Source.
H: Servo motor signal voltage vs "working" voltage I'm looking at a few servo motors (on Amazon.) Typically the "Working Voltage" is 6-7.4V. I can supply that with a power supply but what can I do about the signal? Can I just feed it the 5V PWM from an Arduino? Sadly there's no other voltage mentioned on the listing; do they have to match, or be at least the minimum of the working voltage, in this case 6V? I can't find the specification sheet for most of them outside Amazon; but I assume the question is more about my understanding of servos than this particular one. Edit: Yes, they take a PWM signal; [ground, +, signal] sort of connector. AI: Most hobby servos will work with a 5 V PWM signal (and I know from experience the Hitec HS-311 and a few others will even work with a 3.3 V signal), but only specifications will give certainty. Try googling the servo brand and type, and see if specs can be found. If you can't find specs, consider buying an other servo that does come with specs, or take the gamble.
H: How to calculate measurement error in a voltage divider? I'm trying to calculate the measurement uncertainty of the voltage represented by the ADC in +/- V or % of a voltage measured across R2 of a voltage divider. What would be the general way to tackle this problem? I found a video of someone calculating measurement uncertainty of a voltage divider using partial derivatives. The formula used is shown below. Would the quantization error of the ADC be added to the voltage uncertainty I calculate using the partial derivative method? Q.E of ADC = LSB / 2 => (3.3V / 256) / 2 = 6,45 mV so is this the uncertainty I add to the uncertainty in voltage V2 to get a total uncertainty? AI: You can calculate the error using partial derivatives, if you write the formula Vout=f(Vref,R1,R2) and calculate its partial derivatives. This would give you error with regard to: Voltage error R1 resistor error R2 resistor error The ADC quantization can't be evaluated in this calculation, however it can be added latter, for example: E =+2% / -0.5% +/- 2LSB
H: Inverting a Sine Signal I created a sinusoid signal(red) using the 555 timer in LTSpice. My goal is to flip this signal about the time axis (i.e. 180 degree phase shift)s so I thought I could use an Op Amp inverting amplifier to do. The resulting waveform (yellow-green) is somewhat like an inverted sinusoid but not exactly. What circuit should I build to successfully invert this sinusoid signal? AI: The OP-07 is a great little device but not suitable for your application. The signal coming from the 555 and LC filter is about 10 kHz and has an amplitude of about 14 volts peak-to-peak and the slow OP-07 just cannot keep up. It's output is slew rate limited to typically 0.3 volts per μs: - And that means a 14 volt change in output amplitude will take nearly 47 μs and might be as long as 140 μs. Bear in mind that 10 kHz has a period of 100 μs. So, what you get is a rather triangular shaped output waveform (as you can see if you look closely): - What circuit should I build to successfully invert this sinusoid signal? A much quicker op-amp is the likely answer. Or, if you can live with a smaller amplitude sinewave, reduce the amplitude.
H: Exchanging Li-ion batteries: what to take into account? I am looking forward to exchange a swollen Chinese Li-ion battery with a 'normal' one. The device had this one: https://www.aliexpress.com/i/32908652788.html and I am considering to exchange it with this one: https://api-lemona.lt/TI/En/Pdf/accu-18650_spcb.pdf The voltage is the same, charging voltage as well. Is there anything else, one should pay attention to by using a different model of a battery? Charging happens through the device it self, so let's say that the charging conditions will remain the same and I have no influence on this. In case it is not ethical or whatever to discuss the particular products, let's answer the question neutral: What are the main specifications to take into account when exchanging batteries. AI: The main things of concern are, at least for lithium-ion single-cell batteries: Ensure the new battery has the same number of cells as the old one--do not replace a single-cell battery with a 2-cell battery or vice versa Ensure the new battery is the same chemistry as the old one (don't replace a LiFePO₄ with a standard lithium cell, for instance) Ensure the new battery has the same or higher charge and discharge current ratings (that's current rating, not C number; you'll have to convert if they have different capacities) Note that what really matters here is what current the battery actually is charged and discharged at, so if you can identify that, that is your real limit, not necessarily the old battery's ratings. It's unlikely the battery is being used right at its limit (and the new one really shouldn't be either!). These are the only real safety concerns, but you probably also want to ensure the capacity of the new battery is about the same or larger. Otherwise you might find you have nowhere near the battery life you used to!
H: Can a 3.3v logic i2c be directly connected to 5v logic i2c So can a 3.3v mCu directly communicate via i2c to a 5v mCu ? the buss will be pulled to the lower voltage 3.3v. And since i2c protocols involves just sinking current is what makes me think it will work AI: It depends what the \$V_{ih}\$ minimum level is on the 5 V device. You can look this up in the datasheet. If it's lower than 2.7 V or so, then you should be okay. This is a plausible scenario if your 5-V device uses TTL logic levels rather than CMOS. However, the I2C Standard defines the input levels roughly as CMOS levels, so this would require a non-standard device. With standard-compliant devices it won't be possible, because \$V_{ih}({\rm min})\$ is \$0.7\times V_{dd}\$ and \$0.7\times 5\ V = 3.5\ V\$. As pointed out in comments, if your 3.3-V device has 5-V-tolerant inputs, you may be able to connect the two devices together directly with the pull-ups to 5 V instead of 3.3 V. Again, check your datasheets. Again this would not be compliant with the I2C standard, but many microcontrollers are not strictly compliant.
H: How many standard deviations is Sensor / Component Uncertainty (+/- X) given in? For example a resistor of 1kohm with uncertainty of +/- 1%, does this mean in 68% of cases = 1 standard deviation, the resistance will vary by +/- 1%, or does it mean in 95% of cases = 2 standard deviations or is it in 99% of cases = 3 standard deviations the resistance will vary by +/- 1% ? AI: The tolerance of 1% tells you nothing about the statistics of the actual values. The mean of the actual values might not be the nominal value. The distribution of actual values might not be gaussian and might not be uniform, either. The tolerance of 1% is telling you that the manufacturer guarantees that all actual values are within 1% of the nominal value, nothing more.
H: How to calculate current in this circuit? update: How do I calculate current in this circuit if switch close at t=0 and the circuit initial conditions are \$IL1(0)=2A\$? AI: To answer the question you pose in your comment (changeing the circuit to include parallel resistors) - I would find whatever quantities I was interested in with Laplace. This will give you closed form solutions. If you don't care about the current in the resistors you can obviously lump them together to simplify your circuit. Here is the new circuit in Laplace domain. Solve it using usual circuit methods (the voltage source is \$L_{1}I_{0}\$ where \$I_0\$ is the initial current through inductor \$L_1\$. Once you find an equation for the quantity of interest, transform it back to time-domain. Here is a great table of Laplace transform pairs. I simulated this with \$L_1 = 2mH\$, \$L_2 = 3mH\$, \$R_{EQ}=500\Omega\$, and \$I_0=2A\$ and the resulting current through the equivalent resistor is plotted below. p.s. If you apply this same method to your original circuit and solve for the voltage across either inductor - you will see that the inverse Laplace will produce a dirac delta, \$\delta(t)\$. This would be the infinite voltage that Elliot Alderson explains in his comment. Also, here and here are a couple of other examples where I work out a Laplace solution. UPDATE: Per your request, I added the differential equations (inductor voltages) which you can use in writing KVL and KCL equations, and then solve with your initial conditions. UPDATE 2: Per your latest request, I show the network below that you would solve for the desired quantity (using differential equations and your initial conditions). I solved for \$i_{L1}\$ using Laplace and show it below - your work should result in the same: $$i_{L1}(t)=0.80 + 1.20e^{\frac{-10}{3}t} \text{ A}$$
H: Non-inverting UA741 opamp simulation on QUCS According with instructions provided here https://www.youtube.com/watch?v=dBY1k5qK2w4 (in Spanish), I tried to simulate an inverting opamp configuration, but I couldn't figure out the right vout behavior, as reported in the second graph of the following figure. Output results with a high DC term which is not supposed to be in the YouTube video, nor in the well known theory. Furthermore I expect an out of phase behavior of the output signal, as compared to the input one. Is there anyone who could find out what's wrong here? I did a second attempt . By the way, changing the opamp I've got this That could mean the 741-opamp (TI) simulation software is not properly working on my QUCS. With this other opamp the simulator seems to work reasonably well, but still there is an issue: I don't understand why there is a downward saturation on the output signal. AI: On your images, there are tiny red circles between GND and op amp power pins. I think you did not connect it. I would also suggest using LTspice.