text
stringlengths
83
79.5k
H: Why does this 75C battery only have a 12 gauge wire on it? Example battery: https://www.amazon.com/Lectron-Pro-7-4V-7600mAh-Battery/dp/B01AAVM1MS I see many different RC batteries that are have very High "C" ratings but all of them use connectors rated for very low current. According to the formula the continuous current out of that battery would be 75C * 7600mAh = 570A. 570 A is way more than any deans connector is rated for. Also the wire off of that battery looks like 12 gauge wire. From charts I find the gauge would have to be below 1 gauge to work effectively. Is the "C" rating for RC batteries just much greater than it needs to be and they are in a sense selling a spec that really doesn't make any difference? AI: This battery is for RC toys. The RC toys usually run in open air and at high speed, which provides good thermal exchange with ambient. Also, nowhere it says 75C continuous. The RC toys, however, can have near-stall conditions which might require high peaks of current to start-stop-reverse. So it is not given that the battery should be used at 75C dead short situation, the rating has likely a specific meaning as an indication of peak capability, aka "burst rating". On the other hand, the gauge ampacity ratings are for industrial applications of copper wires inside enclosures and conduits, and must meet stringent safety concerns. The ratings usually are for 10 deg.C temperature rise, both for wires and connectors. If you allow 50 deg.C overheat for a 2-minute ride, these short wires won't melt even at 200 A. And yes, RC batteries and wires are getting hot when toys are running. BTW, the battery itself has 4-mm connection, normally rated at 75A, and you don't have to use their supplied adapter, which uses XC-60 (60 A) on the other end, and something even smaller. So, there is not much contradiction between industrial ampacity and toy's specific applications and area-specific marketing monikers.
H: What is the smallest metal object you can ground yourself with? Say I am installing a new CPU in my desktop motherboard and I am interested in grounding myself (by touch or one of those nifty bracelets) to avoid damaging my components. What is the nature of grounding? Does grounding effectiveness correlated to the size of an object, the conductance of the object, its connection to the soil-earth, a combination of these or other factors? I'd imagine touching a matchbox car with plastic wheels has a different effect than shaking hands with a life-sized gold statue of Michale Faraday, half embedded in the earth and contacting bedrock. AI: If you are installing a CPU in a motherboard, you don't really care about grounding - what you really want to do is to make sure that you, the CPU, and the motherboard (and any tools) are all at the same potential. If you have one of those grounding bracelets, you should connect its ground lead to the computer case or motherboard Ground - whether that is "Really Ground" or not is not particularly relevant.
H: Can I decrease the width of microstrip at the pin? I am trying to connect a 60 mil microstrip to the pin of IC. However, the width is relatively large to the space between pins on the IC. Can I decrease the width of microstrip where I connect it to the pin, so that it can be no clearance error? In addition, when I route this microstrip to the pin, there will be a gray half circle like in the figure. Does any one know what it is? Thank you! AI: Yes, it is a common problem, especially in routing of big BGA packages, where pad/ball pitch is rather small. As long as the narrower section is shorter than a quarter of shortest wavelength of your specific signal, this won't affect much your signal integrity (shape of waveform). Regarding the grey semi-circle, you need to consult with user manual for the tool you are using.
H: Tesla coil, where do the sparks from the secondary coil ground to? This might be an obvious question, but I was wondering how a Tesla coil emits sparks that's seem to complete a circuit in thin air, and how one end of the secondary completes a circuit with the other side of the secondary. Is this circuit simply being completed by the electromagnetic radiation in the air reaching the ground and completing this circuit or is there more to it? AI: The circuit is completed by capacitance to ground. Ground in this sense is all that is conductive in the vicinity of the topload. When you consider that you have 100s of kV available, almost anything is conductive. Most importantly, ionised air is conductive, and forms the 'hot' plate of the capacitance to ground. The 'ground' plate of that capacitance includes wiring in the walls and ceiling, central heating pipes, building materials with any degree of moisture in, aerial leads, data and telephone leads, your garage door, any steel frame to the building. It also includes ground, if you're running in a ground floor apartment, or out of doors. The base of the secondary is connected to ground. By choosing what you connect it to, and how, you choose (to some extent) where the return currents will flow. This controls now much EMI any discharges and strikes will inject into your house wiring.
H: Auto Gain control circuit idea I am trying to make an Auto Gain control circuit. Having any input source's voltage the same. For example my latop outputs around 1.36Vrms @ 1khz and my iPhone outputs around 0.962Vrms @ 1khz Regardless of input source I want the input voltage to be around the same as the laptops. The idea is convert the input signal into a DC signal to essentially map it out. Compare the DC signal the Vref ~=500mV. The comparator will output from 0V to 1V, depending on that it will turn on the respective transistor. One transistor will be a voltage follower and will not doing anything if (V+ > V-) and if (V- > V+) then it will go to the respective transistor and go through an active op amp with a negative feedback containing a digital pot controlled by an ardunio. Using the negative feedback equation the arduino will calculate a value for the R2 resistor (Digital pot) and make it so the voltage will become 1.32Vrms using the equation R2/R1 + 1. 1 - I am not sure if this will work due to how an audio signal isn't a constant amplitude. 2 - For the full bridge rectifier since the voltage of the iphone out is already so small, I believe the Forward Voltage drop of the diode will ruin the idea of it. 3- Is this even possible? simulate this circuit – Schematic created using CircuitLab AI: If you want to do this, the right way is to use a log rectifier, and a VCA with a mv/dB response. Parts like SSM2020 have both these (twice in fact, for stereo) on a single chip. (It's obsolete now but you can still find them, or maybe there is a more modern equivalent. The datasheet is well worth studying, it shows a number of excellent gain control applications.) But you are right to be concerned about dynamics of the music. Any which way, you will lose some of that (depending on the time constants in your circuit). AGC circuits are inherently unsatisfactory in this way (although much modern music has been compressed quite excessively). For the problem you describe, it would be a simpler and better solution to simply have a "PAD" switch, to slightly attenuate the laptop. You switch in a potential divider with an attenuation of about 0.7 when the laptop is in circuit. I assume both outputs are capable of driving headphones : if so, you could use values of, say, 100R and 200R; the output will see 300R, and the following amplifier will be driven by an impedance of less than 100R, which should be fine.
H: How to sense voltage of 48 V 600 Ah VRLA battery bank for Arduino How to check the battery terminal voltage across 48 V (2* 24 V cells) of VRLA battery bank (600 Ah). I am not sure whether a voltage divider serves the purpose. Please give me the advice to convert it to 5 V (Arduino compatible). AI: A voltage divider should do fine. As long as you have no load on the divider and are using it to only read the battery voltage then you will be fine. If you use the divider equation of Vdiv = Vin*(R2/R1+R2) then you can choose your own resistor values to give yourself a readable voltage.
H: Meaning of the "pole" of a transfer function with time delay I learned in basic control theory that we can determine the stability of an LTI system by the signs of the real part of the poles of its transfer function \$H(s)=\frac{N(s)}{D(s)}\$. For a rational system, where both \$N(s)\$ and \$D(s)\$ are polynomials is s, it is easily understandable because a positive real part of the pole will cause an exponential increase in time domain, thus being unstable. My question is, if the system has a delay of T seconds somewhere, then \$H(s)\$ will contain a factor \$\exp(-sT)\$, sometimes in the denominator. In this case, why can we still determine the stability by looking at the real part of the "poles" of \$H(s)\$ (points in s plane where \$D(s)=0\$)? An example: $$N(s)=s$$ $$D(s)=as^2+bs+c+d \cdot \exp(-sT)$$ where a, b, c, d, and T are constants. In this case, we can not do partial fraction expansion as we do for rational transfer functions. Then, how to link the time domain behavior to the roots of \$D(s)\$? AI: I believe the property you're referring to is $$\mathcal{L}\left\{ f(t-\tau) \right\} = e^{-s\tau}\mathcal{L}\left\{f(t)\right\}$$ This means that your transfer function does not really follow that rule, and does not really have a time delay: $$H(s) = \frac{s}{as^2 + bs + c + de^{-sT}}$$ Solving the inverse Laplace transform for this function will most likely involve numerical methods. What is possible, is to have something like this: $$H(s) = \frac{s + de^{-sT}}{as^2 + bs + c}$$ Because it can be separated in: $$H(s) = \frac{s}{as^2 + bs + c} + e^{-sT}\frac{d}{as^2 + bs + c}$$ You can see that the second term also can be separated in partial fractions, like the first term. The poles of the denominator will then say something about the stability of the transfer function. Stability in general The formula for the inverse Laplace transform is $$f(t) = \frac{1}{2\pi j}\lim_{T\to \infty}\int_{\sigma-jT}^{\sigma+jT} F(s)e^{st}ds$$ where \$\sigma\$ is chosen to be greater than all singularities of \$F(s)\$ on the complex plane (in our case such that it includes all poles). This integral is equivalently solved by the Cauchy residue theorem: $$f(t) = \mathcal{L}^{-1}\left\{ F(s) \right\} = \sum_{all\ poles\ of\ F(s)} Res\left[ F(s)e^{st} \right]$$ Remember, this is general, ie. it always works out for a transfer function with whatever singularities! So it doesn't matter whether or not the poles come from a polynomial or from a transcendental function. As long as the singularities are all in the left-half plane, their residue will always contain an exponential that decays to 0 rather than infinity. Any singularities in the RHP will always lead to an exponential that explodes. Appendix It can be noted that \$e^{-sT}\$ can be expanded in its Taylor series: $$e^{z} = \sum_{n=0}^{+\infty} \frac{z^n}{n!}$$ So this means your example transfer function can be written as $$\begin{align} H(s) &= \frac{s}{as^2 + bs + c + d\cdot (\sum_{n=0}^{+\infty} \frac{(-sT)^n}{n!})} \\ &= \frac{s}{\sum_{n=0}^{+\infty} A_ns^n} \end{align}$$ Where \$A_0 = c + d\$, \$A_1 = b - d\cdot T\$, \$A_2 = a + d\frac{T^2}{2}\$, \$A_n = d\frac{(-T)^n}{n!}, \forall n>2\$. So this kind of transfer function has "poles" all over the place. This is to illustrate that you definitely can't deal with this like a regular second-order transfer function. Appendix The residue of a (simple) pole is $$Res_{s=a}\left[ H(s) \right] = \lim_{s\to a} (s-a)F(s)$$ For poles with multiplicity \$n\$: $$Res_{s=a}\left[ H(s) \right] = \frac{1}{(n-1)!} \lim_{s\to a} \frac{d^{n-1}}{ds^{n-1}}\left( (s-a)^n H(s) \right)$$
H: Voltage divider with ac source Left side of the voltage divider is a bit confusing. How would AC react with DC voltage? Considering a high frequency ac source, capacitor would act as a wire. So what will be the output voltage? Logical answer instead of a mathematical one would be more appreciable. AI: Vout would be 1 volt DC superimposed with the AC signal applied at the input. However, if the input frequency is quite low, the output AC content will be small. The cut-off point of this high-pass circuit is 14.468 kHz and this is the 3 dB point. Frequencies significantly above this would not suffer attenuation and frequencies significantly below this would suffer higher attenuation.
H: understanding of UART , if two devices share a common ground. How do they get to the same voltage level for a save data transmission? My question is related to the common ground in a UART communication. So far, what I understand how communication in general works is: Distinguishing the voltage between two cables (one is a GND and one is the data wire). But if they have two different grounds and two different supply voltage like for example one device has 5V and the other device has 12V. How can they create a common ground, for a stable data transmission?? AI: Grounds should be established by connecting them together. If they cannot be connected together, galvanic isolation can be employed. The signal levels over cables are typically defined by a standard such as RS-232C (1969). Discrete circuits or chips such as the antediluvian MC1488/MC1489 and more modern parts such as MAX3232 can be used to convert between TTL/CMOS levels (as would come out of an MCU directly) and RS-232 levels (they also invert), as you would send over a cable into the outside world.
H: Input bias current compensation I am studying the Input Bias Current compensation technique by connecting the resistor to non inverting terminal of opamp. why the reistor of bias compensation should be parallel value of Rf & Ri ? the other end of Rf and Ri is not same and voltage produced by bias current in Rf and Ri does not add up together .. Kindly help me understand with this bias compensation idea. AI: DC bias conditions are defined without any input signal. It is correct that - without any input - the output voltage will not be at zero volts (as desired). However, with negative feedback (as shown in the diagram) the output voltage will be, most probably, not beyond 1 V. Therefore, it is reasonable to assume Vout(DC)=0V. In this case, both resistors (Ri and Rf) are connected to ground potential and the input bias current (into the inv. terminal) goes through the parallel connection of Ri and Rf. The error we have made in assuming Vout(DC)=0 is certainly smaller than the influence of resistor tolerances and the error we have made in assuming that both DC bias currents would be equal. As a result - the unwanted DC voltages across the resistors caused by the DC bias currents will be approximately equal and cancel each other up to a certain degree (the input differential DC voltage at the opamp input nodes is remarkably smaller than without this bias compensation).
H: How are glass diodes produced? What I am trying to understand is how the diode is placed inside of the encapsulating glass container such as that pictured in the following: I've tried to read some patents, where I more or less couldn't understand any of the language. How do manufacturers get the glass to encapsulate the actual semiconductor material without destroying it? AI: The silicon wafer or bead can withstand 900’C but the critical process is the low temp interlayer powdered glass that is now Pb-free using Bismuth and other metals mixed with Silicon Dioxide. This passivation layer reduces the high temp leakage and limits most diodes to 200’C or less. The outer layer of glass is then molded with powdered SiO2 to form the shape that appears. The trade secrets are in the passivation blends of powder , cleaning processes and standard wire bonding to the melted gold bond to the crystal.
H: Calculation of Microstrip Width I am confused by the "substrate height" and "trace thickness" when I am calculating my microstrip width on here . From manufacturer, I got Does the "out layer copper thickness" refer to "trace thickness" and "inner layer copper thickness" refer to "substrate height"? The board is FR4 with thickness is 0.8mm. I am trying to get 50 ohm impedance. Thank you! AI: Inner copper width is applicable only to multilayer boards (more than two layers). The outer copper thickness is applicable to the two outermost layers. If you have a trace running inside the board on an inner layer, you would need to use the inner-layer copper thickness for the calculation. If your microstrip is running on either the top or bottom layer, then use the outer layer thickness. The substrate is the FR-4, and is its own thickness (core). Here is an example of a 4-layer PCB stackup: The "Top Layer" and "Bottom Layer" are your outer copper layers, so they would have the "Outer Layer Thickness". The "Prepreg" layers in the above image are a fiberglass weave that separates the "Top Layer" or "Bottom Layer" copper from the "Internal Ground Plane" or "Internal Power Plane" copper. The "Internal Ground Plane" and "Internal Power Plane" layers are the inner copper layers, so they have the thickness specified for that. The "Core" is the rigid fiberglass FR-4 that gives the PCB its strength. You have not yet mentioned whether your board is 2-layer or multi-layer (more than 2). If it is only 2-layer then your "substrate height" in the calculator would be the thickness of the core itself (specified by the manufacturer). If you have a multilayer board your "substrate height" would likely be the thickness of the prepreg layer between the "Top Layer" and the "Internal Ground Plane" layer.
H: Problem with voltage between a DC step up and Raspberry I am working with a DC step up (XL6009) and a battery for the cell phone (3.8V), with a capacity of 2800mAh to power a Raspberry (10 minutes maximum). The output voltage of this module (XL6009) can be regulated by a trimmer (included), granting an output range of 5V-32V. After using the trimmer to set the output to 5V and measure the output voltage of the module without having connected the Raspberry, I get 5V. Everything is normal. The problem is that when I connect the Raspberry, the voltage goes up to approximately 7.30V ~ 7.38V, and I really do not understand the cause, since as I pointed out previously, it was configured the module -and tested- to 5V. When I unplug the Raspberry and retest, I get 5V again. What could be causing this voltage surge? I used a Raspberry Pi B + (2014) and a Raspberry Pi 3B, and in both cases the same thing happens... Both Raspberry have no connected peripherals, so their current consumption should be low, especially that of the year 2014. Regards! AI: The minimum voltage you can put onto the XL6009 is 5 volts. If you go lower than this (i.e. 3.8 volts from your cellphone battery) then all bets are off and you can't predict what the output voltage will be under load and no-load conditions. I would also look at the table above and note that the values are specified with an output load current of 0.5 amps. I'm mentioning this because the XL6009 doesn't appear to specify a minimum load current so if your load is significantly less than 0.5 amps then expect other strange things too.
H: Parallel EEPROM write to with I2C I was wondering if there is a hybrid between the serial and parallel EEPROM's? What I mean is, is there an EEPROM that can be written to over I2C and then once it is setup can be controlled with some hardware Address pins, like how parallel EEPROM's change there output pin states when their address pins change. Just some background, I am, for fun, building a little 4 x 7 segment led display. I wanted to just have the arduino send the current time once a minute to the eeprom over I2C, where then an external clock and counter change the eeproms addresses to multiplex the display. AI: I'm not aware of any parts that support this feature. Parallel EEPROMs are generally considered a "legacy" part nowadays. They're all older designs, typically with 5V I/O, and they haven't changed significantly in decades. There's never been any serious consideration of adding more modern features like I2C access; these parts are all aimed at use in ancient systems designed long before I2C was in common use. Besides, EEPROMs are primarily intended for "write-once" applications. While they can be rewritten, they have a limited number of write cycles -- 10k - 100k is typical. Even at one write per minute, you'd burn through that in weeks or months. Consider using an LED driver like the MAX7219 / MAX7221 instead. They're made explicitly for this application -- they'll handle everything, including current control, multiplexing, and even have a character table built in -- and they can be controlled over SPI.
H: What happens when a motor is spun faster than its rated RPM from an external force? I've seen plenty of questions wondering what happens when voltage is applied that would exceed the RPM rating, but what happens on the voltage/current side when something external - the wind spinning blades attached to the motor - spins the motor faster than its rated RPM? Does it overheat? Does the voltage eventually saturate? I'm planning on using a permanent magnet motor, but this question applies to any motor. AI: PMDC All PMDC motors generate V proportional to RPM [kRPM/V] . The rated maximum power will be at approximately 82% of its maximum speed but will continue to rise with overheating above if load continues. While the max RPM depends on the mechanical and eddy current losses in the magnets at some frequency. This maximum powerpoint (MPP), of course depends on the load current, I . All static structures have a resonant frequency including moving parts like bearings and the risk of imbalance or approaching those resonant frequencies with stored inertial energy rising means a high risk of fatigue and catastrophic failure . Therefore all structural resonances must be much greater f than the excitation frequency is its harmonics. Thus shunting the generator to act as a speed brake into wasted energy and inertial flap speed brakes must be designed into the system to handle worst case winds expected in the next 100 years to prevent these failures. The motor loads will increase with conduction current losses I^2*DCR and eddy currents will rise with f^2 above max and thus liquid cooling may be needed or simply rely on increasing the drag on the blades with speed flaps and possibly an inertial clutch brake . The mechanical solutions were how we did a 20m tall egg beater type wind power Gen in 1975. If the mechanical brakes failed and the structure held together somehow with guy wires AND the electrical system to brake failed then a 3rd protection system is needed for safety. Otherwise the voltage could increase possibly enough to breakdown and arc , if there was not at least a 300% safety margin on insulation. PMAC Large synchronous wind turbines however use a transmission to speed up the RPM and the PMAC generator requires a drive specifically designed for PM motors, similar to flux vector drives for ac induction motors, in that the drive uses current-switching techniques to control motor torque — and simultaneously controls both torque and flux current via mathematically intensive transformations between one coordinate system and another in order to keep in phase with the grid frequency and phase while allowing prop angle to harness more power. Therefore they are only designed to run at constant speed unless starting or stopping or shifting slowly with the grid. These are generally Betz type steerable turbines, so they can control speed by direction error with wind but still must be able to survive a near miss of tornado.
H: Passive reset circuit for multi-chip game design I've been building a small handheld gaming device based around the ATTiny85 and an SSD1306 OLED screen. It's a very limited system and as such I needed to be creative about how I used the I/O pins. I asked a question for replacing the SSD1306 reset logic with passive? components. This worked in my initial prototype and I was happy. Today I received new PCBs with a smaller, closer layout and a different power source and the reset circuit no-longer works properly. This is the circuit in question: simulate this circuit – Schematic created using CircuitLab The schematic shows the original design when I was using a 3.7v lipo cell to power it. I'n my new design, I'm using a CR2032 lithium cell and I'm wondering if that has caused the issue. When the system is powered on 'cold' everything works fine. If I power off and then on again within about 10 seconds, the OLED doesn't get the proper reset signal and displays garbage. Pressing the reset button resets the micro controller but not the screen properly - it'll display progressively less garbage until it just goes blank on successive resets, MC still resetting fine (it has a 'startup' tone that plays, and button presses beep as expected). As mentioned - I got the reset circuit from another question I asked, but I'm not sure I completely understand how it works. I'd really appreciate a short description of what happens when it powers on / reset button pressed. Is my issue likely the small change in voltage? I know that when I first put together my first prototype I accidentally used the wrong resistor, putting a 1k ohm in place of the 10k ohm one and this also caused the circuit to stop working properly - Am I naive in hoping that I can tweak the resistor value to make things work again? Things I've tried based on comments below: Added a delay to program start-up of 200ms. No Effect. Replaced 3v CR2032 with original 3.7v LIPO. No Effect. Holding a 10uF capacitor in parallel with the existing 0.1 (C1). No Effect. Bypassed D2 with a bit of wire. No Effect. On my old prototype, holding down the reset button caused the screen to blank and reset, holding down the reset button here doesn't affect the screen at all until it's released. All I did between revisions was move pads around, connections are all the same. My multimeter appears to confirm this too. #4 though makes me wonder if there's something mechanical wrong though. AI: Bulking the cap to a few 10s of uF (at least 3us of low reset pulse is expected during power on.. Currently, it looks like it is marginal.. ) should improve reset timing. I would short both reset pins together (by replacing diode with 0 ohm resistor) and I don't see any negative effect of the same. What is the reason for D2? It is also avoiding press switch reset to provide reset to this display by keeping the reset pin above forward voltage drop of the diode. If possible, I would use a dedicated reset generator ICs too but I am not sure about the constraints you have. Place a 100nF cap if possible near VCC pin of the display module. 10k pull up for MCU is missing currently. It will not hurt to have it pulled high to VCC via 10k. Please also share the waveform shape for first power on subsequent power on. When Reset button is pressed: The capacitor immediately discharges through the switch. The reset pin of both MCU and the display module will be held to ground. When reset button is released: The capacitor slowly charges to 3 V via the 10k resistor. 3RC time is roughly 3 * 10k * 100n which is 3 mili seconds. Hence, the current capacitor resistor way too small to generate a low pulse of 3us. Increasing capacitor value to higher value will help. When power is removed: The charge in this capacitor is discharged via diode which is in parallel with the Resistor in KiCAD schematics version. Hence, discharge happens faster.
H: How to create variable power source circuit from a battery source? Basically, I have a high drain battery at 3.7v and I want the output power to be controllable. The circuit I have designed so far is a boost DC-DC converter using a 555 timer to control the switching mosfet, and a homemade inductor, and all the necessary capacitors, resistors, etc. My issue is determining the output current. The inductor is the component that generates the voltage boost, so how does the design of the inductor affect the current? How does the total current to the load get determined? If for example, I have a load at 1ohm, and supply voltage (without boost) of 3.7v, then I get an output current of 3.7A. Now if I use the boost circuit, I can get an output of 10v, so is my output current 10A? Do I draw more current from the battery to generate the extra voltage since the battery is drained from both the 1ohm load and the inductor? Will changing the switching frequency actually modify the output power? As far as I know, this is how commercial circuits basically work (for ecigarettes/vape mods, etc), is there some other way? AI: Since a battery is like a voltage source with a resistor in series, to control the power you need to control the voltage. Source: https://evertiq.com/design/33082 so how does the design of the inductor affect the current? The inductor switches on and transfers the current from the battery to "charge" the magnetic field of the inductor. When the switch is turned off (depending on the configuration of boost converter) the voltage on the inductor goes higher than what you could normally get from Vcc itself. Usually boost converters control voltage as shown in the feedback newtork above, usually in the form of a voltage divider. An error amlfiier ensures that the voltage of the feedback network is maintained, so if the attenuation of the resistor network was 1/12th and the error amplfiier was built to control to 1V, you would get 12V at the output of the diode (or secondary switch) in the boost converter. Voltage is usually what is controlled, and then the load determines the current, so if you have a voltage of 12V, and a 10Ω you'll get 1.2Amps of current. The boost converter doesn't care how much current, it's only trying to control the voltage. Some boost converters also have a current limit, meaning it won't allow more than X amount of amps. These boost converters also have a current resistor and amplifier to measure the current. If the current hits the limit then the voltage drops on the output of the boost convert or it shuts off. How does the total current to the load get determined? If for example, I have a load at 1ohm, and supply voltage (without boost) of 3.7v, then I get an output current of 3.7A. Now if I use the boost circuit, I can get an output of 10v, so is my output current 10A? Since it's probably voltage controlled you use V/R = I to determine the current. So 10V/1Ω is 10A. Do I draw more current from the battery to generate the extra voltage since the battery is drained from both the 1ohm load and the inductor? Energy must be conserved in circuits, if you had a perfect boost controller (100% efficiency) and you drew 10A at 10V then that would be 100W, the boost controller would need to get 100W from the battery, so if the battery were 3.7V you would get 100W/3.7V=27A of current (if it could actually source that much). Now suppose the converter is 80% efficient, to source 100W at the output you would need 100W/80% = 125W (you divide because your working backwards. 125W/3.7V=33.7A to run your boost converter. There is one more caveat, the inductor saturates and has a limit to how fast it can switch, the boost converter is limited by the inductor on how much current (and sometimes the switches) can be transferred through the converter. Will changing the switching frequency actually modify the output power? As far as I know, this is how commercial circuits basically work (for ecigarettes/vape mods, etc), is there some other way? Yes an no, the switching frequency is determined by the controller which is attempting to regulate a voltage, the way to build boost converters is to carefully calculate the on and off time and control loop. An easy way is to buy an off the shelf converter. To build good DC to DC converters you need a knowledge of circuits and control theory.
H: Why solder mask are not applied to RF PCBs I've gone through some of the RF PCB designs. In which solder masking on the traces are not present. Like this one Is there a specific reason or performance issue to remove that? AI: There are several reasons. 1) Soldermask is lossy, and different types of mask are differently lossy. So having no soldermask where the RF fields are gives the best transmission, and if your board is made by different fabs, the most repeatable transmission. 2) Line dimensions, which affect characteristic impedance, are critical. It's difficult to optically inspect them if they're covered with resist. 3) In development, you might just want to add an attenuator pad, or pickoff resistor, to the line. This is tricky enough as it is, without having to start by scraping resist off.
H: VHDL/FPGA Tacho Pulse Counter I am attempting to implement a tachometer interface that will accept digital pulses as an input. I simply count clk rising edges (50Mhz) between each rising edge of the tacho pulses (1Mhz). I have found examples on the web that achieve what I need to do, but in an attempt to not make the same mistakes in the future I would like to understand why this solution doesn't work. When I say doesn't work I mean post-synthesis functional simulation doesn't produce the results I would expect. The behavioral simulation does output the values I was expecting. In summary, synthesis appears to be ignoring my attempt to reset a variable to 0 (see comment 'this does not appear to execute' below). The tacho_count output increments without resetting. See simulation plots below. entity tacho_interface is Generic ( FREQ_DIVISOR : integer := 6; MIN_RPM : integer := 200 ); Port ( enable : in STD_LOGIC; clk : in STD_LOGIC; pump_tacho : in STD_LOGIC; tacho_count : out STD_LOGIC_VECTOR(31 downto 0); error: out STD_LOGIC := '0' ); end tacho_interface; architecture Behavioral of tacho_interface is begin process variable last_tacho : std_logic := '1'; variable tracking_cntr : integer := 0; begin if (clk'event and clk = '1') then if (pump_tacho = '1' and pump_tacho /= last_tacho) then tacho_count <= std_logic_vector(to_unsigned(tracking_cntr * FREQ_DIVISOR, tacho_count'length)); wait for 0ns; tracking_cntr := 0; --this does not execute end if; last_tacho := pump_tacho; tracking_cntr := tracking_cntr + 1; end if; wait on clk; end process; end Behavioral; Post-Synthesis Simulation illustrating problem (accumulation without reset to 0) Behavioral Simulation illustrating what I expected AI: Delay statements are not synthesizable. Have a look at this: https://www.nandland.com/articles/synthesizable-vs-non-synthesizable-code-fpga-asic.html
H: Old Radio Colpitts Oscillator? Or not? I am a beginner hobbyist form Brasil, posting here for the first time. I am trying to understand the schematic of an old Transglobe radio that my late grandfather gave me. It motivates me to learn more of analog electronics. After searching the internet for oscillators, it appears to be something like a Colpitts Oscillator, but not quite. If any of you could tell me what oscillator it is, it would be of great help. The Signal comes from T101 and goes to T103, which is the mixer. From what I understand T102 gives the gain to maintain the oscillation, but where is the Tank circuit? Where is the feedback? C112 maybe? But from where does it come? Why is t102's base a constant voltage? Really appreciate any help! Sorry if it was too much of a beginner's question. AI: At first glance T102 looks like a common-collector colpitts oscillator but it isn't. It has split capacitors (C108 and 109) on the emitter but these do not feed to the base so that is ruled out. On further inspection and noticing D101 (a varactor diode) it's clear that it is a tuned-collector-oscillator with capacitors C126||CT103||CV103||[C113+D101] in parallel with inductor TR103. C111 is the feedback circuit from the tank to the emitter. That feedback is attenuated by C108 C109 takes the oscillator signal at the emitter of T102 and "adds" it to your received signal from T101. This addition of signals is non-linearly amplified by T103 and you get an "addition" turning into a "mix" (multiplication) with sum and difference frequencies produced at T103's collector. Here's the closest diagram I could find of the type of oscillator you have: - See figure 8 in this link.
H: Does a pickup microphone work in space (vacuum)? Of course in space there is no sound transmitted via air, so there is no air-borne sound, but there is structure borne sound. This sound can be recorded with a pickup microphone, but do pickup microphones need air to work as well? Considering that a pickup is really just recording the surface waves, but if it is mounted on the same surface with the same vibrations, it in theory should measure nothing, correct? My assumption is that pickups measure the difference between the air damped surrounding and the material itself, so it should not work in vaccum as there is nothing to damp against. The other theory I have is that it depends on the mounting of the microphone. So if I fully connect it in a sphere around a certain point, it would measure the surface wave within this mounting area, but wouldn't that limit the measurement to sound waves smaller than the mounting area (higher frequencies)? AI: A contact microphone is basically an accelerometer. It does not require any air for its operation.
H: HIGH in input pin without connect I declare pin 12 as input mode in Arduino UNO. I didn't connect to that pin 12 but if I read state of that pin, the result is always HIGH. I want to avoid that. I made several googling but I don't get cool answer. AI: Why are you reading that pin? If the intention is to detect an external input (assuming to be a high level signal), put a pull down resistor externally. You only should connect a 10kohm or 20 kohm resistor between arduino input pin and ground. If you need the pin state to be default high, then you can use internal pull up already present in the ATMEL MCU. Properties of Pins Configured as INPUT_PULLUP There are 20K pullup resistors built into the Atmega chip that can be accessed from software. These built-in pullup resistors are accessed by setting the pinMode() as INPUT_PULLUP. This effectively inverts the behavior of the INPUT mode, where HIGH means the sensor is off, and LOW means the sensor is on. In case you are pulling the input line ground, then do not enable the internal pullup. Either you should have pull up or pull down in the input line. Not both . Refer to this for good description Here is sample circuit for pull down. In the code, you onle have to configure it as input. That is all. Do not enable internal pull up. pinMode(inPin, INPUT); // sets the digital pin 7 as input }
H: How does the inductor have an initial condition in this circuit? If the initial current in the inductor is \$i(0^+)= 0 A \$ why is it that when the switch occurs the initial voltage in the inductor is \$ V_L(0^+)=121.4 V\$ AI: The circuit you have is this: simulate this circuit – Schematic created using CircuitLab I have removed the component values because they are not important for this question. ASSUMING the switch as been in position #1 to full charge the capacitor, the voltage at the capacitor is 20V The AC voltage source follows \$ 100 \sqrt(2) Cos (100 t) \$, ie at t=0 has an instantaneous value of: 141.421V The moment you throw the switch to connect the AC source to the RLC network you will have (141.421 - 20) 121.421 volts across the R-L, but how much across the inductor? Remember that for DC an inductor is a short circuit and for infinite frequency the inductor is open-circuit. Likewise remember on of the fundamental equations of an inductor: \$V = L\frac{d I }{d t}\$ as a result the inductor appears as an open-circuit, initially and thus all 121.421V appears across the inductor and the inductor's current is 0
H: Looking for external watchdog chip for Raspberry Pi 3 model B board I'm working on a project that has chosen an RPi3 model B board as part of the system. We previously had an external watchdog system that would cut the entire system power if the watchdog expired. This external watchdog system has been "optimized out" now due to various changes needed for UL certification, so I'm looking to add a dedicated watchdog chip to the Rpi. We already have a custom power supply board that plugs into the 40 pin expansion header (http://pi4j.com/pins/model-3b-rev1.html), so my plan is to do a new version of that board that includes a WDT chip. The requirements are: Fairly long timeout, e.g. >= 3 minutes. We'd prefer to not have to modify the bootloader & kernel to pat the WDT while the system is powering up. We'd like to just pat the WDT from the main userspace application. Low cost. Looking for a chip level solution rather than some type of external module. The WDT can be easily patted from a GPIO line on the 40 pin RPi header Optional - some type of indication the WDT is about to fire. I've only used simple WDT chips before that reset the system when they expire. I'd be quite good if we were also able to log the fact in Linux that the WDT is about to expire, then have it reset the system. Optional - also can reset the RPi on brownout conditions. It'd be great to hear if anyone else has made an external custom WDT for an RPi system like this and if anyone can recommend a WDT chip that can meet these requirements. Thank you. AI: The "about to fire" indication can be implemented by delaying the reset pulse. I suggest using a small microcontroller together with reset chip. The internal separately clocked hardware windowed WDT on the MCU can keep the micro honest and then you can use that to implement the reset. For example, you can implement a windowed WDT. The implementation should be easy enough for anyone that thoroughly understands both microcontrollers and watchdog timers. It won't be much more than a couple of chips. I assume you've already considered the RPi internal hardware WDT and found it wanting, but you could combine the two to increase the likelihood of a reset occurring under any conceivable circumstances.
H: OPAMP saturating when output is negative, simulation is OK The schematics: It should convert 0-3.3V input from the DAC to -4.1 + 4.1V (roughly) The positive part works great, the negative output voltage saturates at -2.95V. Is it ok? The simulation looks ok (and it is the expected behavior): The part: https://www.st.com/content/st_com/en/products/amplifiers-and-comparators/operational-amplifiers-op-amps/standard-op-amps/tl084c.html#design-scroll AI: the negative output voltage saturates at -2.95V. Yup. If you look at Figure 2 of the data sheet, it shows a nominal maximum for +/- 5 volt supplies to be 6 volts pk-pk. In other words, about +/- 3 volts, and you're getting -3. Just about what you'd expect. The positive side is doing better than expected, but that's just an unexpected bonus. TL;DR - You should never count on getting +/- 4.1 with your power supply and this op amp.
H: Why LME49710 does not perform at least as good as LM358 for audio mic op-amp? I built a hobby mic op-amp circuit as described here: It gave me a pretty ok result: Now I replaced LM358 with LME49710. The circuit is the same, except from the wiring to the LME49710 pins (LM358 pin 1 is the output while it's pin 6 on LME49710, VCC also moved from pin 8 to 7, the rest are the same) LME49710 is supposed to be a more high-end op-amp, so I expected some improvement. However... That doesn't look right and doesn't sound right. A lot of noise is added, and the audio is less amplified and hardly heard over the noise. What are LME49710 characteristics that makes it less suitable for this circuit? Is there a simple way to change the circuit and make it work better with LME49710? AI: I suspect it is honking somewhere ultrasonic! The 49710 is an excellent part, but it is FAST (~50MHz GBP), where the '358 barely manages 1MHz GBP. Layout will be a LOT more important with the faster part, as will things like isolating load capacitance (100pF max by the datasheet) and capacitive loading of the inverting node. I would instinctively be adding maybe 100R in series with C3 and something like 10pF or so across R5, but really the capsule self noise (And the noise contribution from the resistors is going to be large enough to swamp the use of an expensive opamp in that design. If you placed a 50MHz GBP part on one of those white plug boards, you deserve whatever happens to you (Lots of strays in those things), get a bit of copper clad and dead bug the thing over a ground plane you will be MUCH more likely to get it to work.
H: Is there such a thing as a fully differential line driver? I'm looking to find something similar to the TI drv134 (http://www.ti.com/lit/ds/symlink/drv134.pdf), but then with differential inputs instead of single ended. Is there even such a thing? I can't seem to find it. I can of course easily place an opamp before the drv134's input but i'd rather have one less component. AI: I found my answer: the THAT1606.
H: Basic Op Amp Circuit I am reading "Intuitive IC Op Amps" by Frederiksen and getting stuck on one of the basic circuits. The book presents this image as a simple proxy for an op-amp. Can someone help me understand a few things: 1) How is the Input biasing current and Output biasing current selected? What simple BJT circuits could realize these sources? 2) Why not replace Q3 with a diode? 3) What do D1 and D2 in the second stage do? Looks like they are trying to account for the diode drop of the Q6 and Q7 but I am not sure. What would happen if they weren't present? Why are 2 required? 4) What is Cc (compensation capacitor) doing? I vaguely understand that it's providing stability by pole separation. I can't get an intuitive grasp of what it's doing to the circuit, however. 5) Does anyone have a similar simplified image for a MOSFET implementation of a simple op-amp? AI: Ok, I will walk you through the steps of a very basic op-amp circuit, just elaborating on @jonk comment. He wrote enough to post an answer. Anyways: All transistors have a minimum CE current below which they will not function, but at the same time the input stage is run at a low current/low gain to cut way down on schott noise. Ultimately it depends on the engineers target for noise floor vs. dynamic range and the budget allowed per each IC, which comes from marketing dept. Q3 needs to have exact matching thermal coefficients with Q4, so a diode would be the wrong choice. Think of Q3 and Q4 as a matched pair. D1 and D2 are getting a bit too basic as normally in any class AB push-pull output you have a transistor with a trim pot that controls its gain, and in an op-amp precision trimmed resistors would be used. This transistor or those diodes HAVE to be mounted on the same heatsink as Q6 and Q7, to prevent thermal runaway. To keep distortion (THD) to a minumum both Q6 and Q7 have an idle current flow through them of 5 mA (op-amp) to 50 mA (power amplifier). This prevents cross-over distortion as the signal crosses zero volts and one transistor must switch OFF while the other switch's ON. If you bypass D1 and D2 or set the bias current too low severe distortion will occur as now you have a gap where neither output is ON until the signal is strong enough to turn one ON. Cc is there at the high-gain stage to prevent oscillation usually above the audio range, which is not needed anyways. Typically the upper limit is 50 KHZ for most audio op-amps and power amplifiers. Look up the CA3140T CMOS op-amp, and you will see CMOS equivalents to each section here. The CA3140T is ancient but still used due to its 1.5 T\$ohm\$ input impedance.
H: Inductor degradation? For SMPS, I would like to know if inductors degrade with time and frequent high current usage. The idea of this, is to determine the elements that are most likely to fail over time in a SMPS (for example electrolytic capacitors), so I can make them easily replaceable in my PCB. Thank you AI: The only common failure mode of an inductor is overheating, which can be from too much current (saturation) or too wide of a pulse width. The insulation burns at the core and shorts out the magnetic field. Now you effectively have a 'short circuit'. Same failure mode as transformers. An extremely intense overload can crack ferrite cores, but that would be part of destructive testing, way beyond core saturation. Like metal film resistors, they have no natural enemy except excessive heat. No parts corrode if the core and windings are coated in epoxy or polyurethane. NASA counts on such parts lasting centuries in outer space in deep space probes. As you mentioned, electrolytic capacitors can and do have latent failure issues, especially cheap imports.
H: Modbus RTU Implementation to Automate Temperature through PIC Microcontroller I would like some help about implementing the Modbus RTU communications protocol in an automated system that I am trying to develop. I am confused about how to generally set up my network because I have never used modbus and am generally new at programming PLCs. I want to monitor the temperature of an oven that is held by a Watlow F4 temperature controller. It requires Modbus RTU communication through an RS-232C interface. I want to constantly read the temperature in the oven and process the data through my PIC microcontroller, which will then communicate back to the F4 controller to adjust the temperature accordingly. -In this case, will the PIC controller be my client, while my F4 controller is the server? -Is the Modbus RTU protocol simply a way to structure the data transmission, or do I need to download software that uses the modbus implementation? In other words, is the Modbus RTU protocol simply the way you should structure your code to accept and transmit the data packets between the client and server? -Is it possible to simply program the PIC to automate the temperature indefinitely without having a terminal like a PC be the client? I want to make sure I am understanding the general structure of my project and whether there are any issues with the way I will set up my Modbus network. Please let me know what I can do. Thank you for your time. AI: RS-232 are point to point connection this meant you can only connect the wires to a master and a slave as apposed to RS-485 which can be multydrop. modbus is a fairly easy to work with it just reading and writing to registers. take a look at this link these guys give you a lot of information. At the start of your question you mention PLC is that correct or men to be PIC as a lot of PLC have built in modbus and with easy to work with library. PLC also come industrial ready and tested and do not require a PC. A PLC would be a better solution then a PIC if your not wanting to make a PCB and wanting a reliable controller. Even better remove the Watlow F4 temperature controller and use the PLC with a HMI to do it all. if the wiring is simple. wire the temp sensor to the PLC input and the Heater on/off or/and up/down to the output. If you still want to use a mico i would recommend using arduino to do this as it easier to get started, the code is simpler to work with and there is lots of examples. this guy id using RS-485 but it will give you an idea if how it done link.
H: E fields and M fields in Near Field I am reading a textbook that mentions that small loops with high dI/dt on a PCB tend to produce predominantly magnetic waves and stubs with high dV/dt tend to produce predominantly electric waves in the near field. In the far field, both radiators result in EM waves. 1) I don't understand how in both cases (loop or stub) the resulting wave is not an EM wave (with a predominantly E or M component depending on the case)? 2) I also don't understand how you determine how a specific structure will radiate (with respect to E field to M field proportion). Can someone please clarify? 3) Why do these fields become an EM field in the far field? Is this because the free-space impedance (377ohm) forces any field traveling through it to become an EM field? 4) Why don't magnetic fields (ie rare earth magnet) or electric fields (ie electrostatically charged glass rods) become EM fields? AI: This is mainly a problem with imprecise wording, so we'll have to pick your statements apart very carefully: small loops with high dI/dt on a PCB tend to produce predominantly magnetic waves and stubs with high dV/dt tend to produce predominantly electric waves in the near field. In the far field, both radiators result in EM waves. so based on this you state: 1) I don't understand how in both cases (loop or stub) the resulting wave is not an EM wave (with a predominantly E or M component depending on the case)? There's no such thing like an E- or M-Wave. Waves always consist of an electric and a magnetic field which periodically exchange energy. Maxwell's Equations describe that pretty unambigously: Change one over time and/or space, and you get the other. If you want a propagating wave, you'll get both. No way around that. So, I don't know what your textbook actually says, but if it says "magnetic waves", get another textbook. I mean that. Pozar's Microwave engineering is the go-to textbook on that field. If it says "changing magnetic field": yeah, a small coil is primarily an electromagnet. The "mechanism" with which energy is transferred from conductor to free space is electromagnetism. However, a changing magnetic field, per Maxwell, causes an electric field. No way around that. 2) I also don't understand how you determine how a specific structure will radiate (with respect to E field to M field proportion). Can someone please clarify? That's antenna design. Basically, you can go the "old school antenna designer" ideology and see your structure as an impedance matcher between free space and conduction. Or you can just say "there's a current flowing in my structure, and I can describe that mathematically. Then I just throw Maxwell's equations at it, and see whether part of the energy leaves the system: radiation". It's really down to reading a antenna or microwave engineering textbook in whole. 3) Why do these fields become an EM field in the far field? Is this because the free-space impedance (377ohm) forces any field traveling through it to become an EM field? Free Space impedance is not a "force" that can "force something to do something". It's more of an effect. Please don't mix up cause and effect! Maxwell's equations. Learn them. Live by them. They link changing E and H fields to each other, invariably. In some media, this leads to a fixed wave impedance. Wave impedance only simplifyingly represents relation between E- and H-fields in "easy" media. It's an effect, not a cause. 4) Why don't magnetic fields (ie rare earth magnet) or electric fields (ie electrostatically charged glass rods) become EM fields? Maxwell. They don't change with time. Since your profile says "Electrical Engineer", I trust you've heard of Maxwell's Equations before, or you'll have multiple lectures that revolve around them :) They are really the theoretical basis on which all of EE base their understanding of the world. (aside from the quantum guys. Those are special.)
H: Drawing DC current from batteries on charge controller I have an off-grid solar system where this inverter/charge controller (ICC) is connected to a 48V battery (which is in fact 2 parallel quartets of 12V batteries, but this is non-relevant detail I guess). The ICC would feed current to the battery at as high as 56V (high sun, low load and when the battery needs charging), and draw it back (for making AC — when the sun is down and/or load is high) to as down as 42V. Now, the hitch is that I have some DC appliances and would like to feed them DC without the double conversion through AC (the ICC does not have a DC output for connecting load). The idea is to get a DC-to-DC converter (which would deal with 42-56V floating input) and let it draw DC from the battery/ICC circuit directly — in parallel. I am hereby trying to figure out if this setup would undermine the ICC's job to any such extent that the battery gets charged/discharged incorrectly and therefore passes away sooner than if I did not do this. The extra parallel circuit will push down the overall battery/ICC circuit resistance so that: when the ICC is charging the battery, the effect will be just higher current in the overall circuit — as the ICC will (attempt to) maintain the voltage; when the ICC is drawing current from the battery, the effect will be just that the voltage drops faster — as the ICC won't be the only one consumer anymore. So it looks like the only thing to watch out would be the battery's depth of discharge as the ICC won't be able to account all the current drawn from it anymore, and would only see the voltage as indicator of discharge. How do the above understanding, reasoning and conclusions stand? Is there something I am fallaciously missing, or is it all reasonably sound? AI: As you are swinging the batteries between 56v and 42v, they are already getting a very hard life, especially the 42v end. I am assuming they are lead acid, and I am hoping they are deep cycle types. I doubt that the controller is doing any coulomb counting, there's no real need to do that with lead acid, so putting an extra load on the batteries is unlikely to worsen their cycle life, except to the obvious extent that more load possibly means more cycles. Beware that more load does not mean lower minimum voltage. If you want longer cycle life, then limiting the bottom voltage to 44v or even 46v would be well worthwhile, if possible. You would win financially by limiting the low voltage, and putting an extra battery string in parallel with the existing to make up for the capacity being reduced by limiting the voltage swing. The better cycle life would more than make up for the higher investment in batteries.
H: Can a system with more than 180 phase lag ever be stable? For a system to be stable you must not reach a phase of 180 degrees before gain reaches 1 (for an ideal system). The layman explanation I was offered was that otherwise, your negative feedback becomes positive and you just built an oscillator. What if you created a system (ie 4 poles H(s) = 10^100/(s-10)^4 that underwent a phase change of -360 and then limit inputs to the system to be >Fmin (which is the frequency after the phase changes). Would the system be stable for these inputs Fin > Fmin? AI: At first, some clarifications: 1.) It is the loop gain (open the loop and measure/simulate the gain of the complete loop) which is subject of this stabilization criterion you have mentioned (if the loop phase reaches -180deg the loop gain must be <1 already). If this criterion is fulfilled, the closed loop is stable. 2.) However, this criterion applies only to a system where the critical phase (-180 deg) is crossed only once! Otherwise (when the phase goes again above this critical line) you must apply the Nyquist criterion to check stability (which might be a "conditional" stability only). 3.) Regarding your last example: The loop gain criterion (first point) applies to a 4th-order system as well. No - it does not help at all to "limit" the frequency.....
H: Getting Accelerometer values from MPU 6050 I m trying to read accelerometer values from mpu 6050 in atmega328p (Arduino UNO). I want an embedded c program that's why don't wanna use any external lib. So I read about I2C protocol, read the datasheet of MPU 6050, register sheet of MPU 6050 and developed a code as per my understanding. Here's the code #include<avr/io.h> const int MPU_addr=0x68; void i2c_init() { TWSR=0x00; TWBR=0x48; TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA); } void i2c_start() { TWCR=(1<<TWEN)|(1<<TWINT)|(1<<TWSTA); while((TWCR&(1<<TWINT))==0); } void i2c_stop() { TWCR=(1<<TWEN)|(1<<TWINT)|(1<<TWSTO); } void i2c_write(uint8_t data) { TWDR=data; TWCR=(1<<TWINT)|(1<<TWEN); while((TWCR&(1<<TWINT))==0); } uint8_t i2c_read(unsigned char isLast) { if(isLast==0) { TWCR=(1<<TWINT)|(1<<TWEN)|(1<<TWEA); } else { TWCR=(1<<TWINT)|(1<<TWEN); } return TWDR; } int main() { uint16_t i; i2c_init(); i2c_start(); i2c_write((MPU_addr<<1)|(1<<0)); i2c_write(0x6B); i2c_write(0); i2c_stop(); Serial.begin(9600); while(1) { i2c_start(); i2c_write((MPU_addr<<1)|(1<<0)); i2c_write(0x3B); i2c_start(); i2c_write((MPU_addr<<1)|(0x00)); i=(i2c_read(0)<<8)|i2c_read(0); Serial.println(i,BIN); } return 1; } The problem is in the while loop, the program hangs after the i2c_start(); call. I have checked this by putting a Serial.println("a"); after that line, but nothing gets printed on the serial monitor. I have also checked that the program enters the while loop successfully. So can anybody help where is the problem in the code? Note: 1. All the i2c function(s) are in accordance with the book "The Avr microcontroller and the embedded system using assembly and C" by Ali Mazidi". AI: Looking at the datasheet of the 328p (page 297), it seems like you're handling the TWINT bit wrong. By the datasheet, the bit is never cleared by the hardware, which is what you're seeing. It's set by the hardware instead. By a quick skim over the code, what you could simply do would be inverting the logic around the TWINT - clearing it to make it do stuff, and waiting for it to become set again.
H: A globe from a torch and a refrigerator bulb are connected in series across a power supply. Predict what would happen? A globe from a torch (rated at 6V, 0.5 amp) and a refrigerator bulb (rated 240V, 10W) are connected in series across a 240V power supply. Predict what would happen? I understand that the torch globe will emit very little light and the other globe will operate normally but I don't understand why? Would really appreciate some help! AI: Let's start by calculating the operating resistance of the two bulbs. Given V = IxR, the torch bulb will have a resistance of about 12 ohms. Given P = V^2/R, the refrigerator will have a resistance of about 5760 ohms. With me so far? Now let's look at the proposed circuit: simulate this circuit – Schematic created using CircuitLab From this we can calculate the voltage across the torch bulb, and it is $$V=240\frac{12}{12+5760}=0.499 $$ So our 6 volt bulb will have about 1/2 volt across it, and will barely light up. This is not the most accurate analysis, since (as you probably don't know) light bulbs do not have a constant resistance. Typically, when cold a bulb filament resistance will be on the order of 10 times less than when hot. In this case, that works to make the bulb even dimmer. A variation of 10:1 won't make much difference in the bulb current, since that is controlled by the 5760 ohms of the refrigerator bulb. But if the torch bulb filament resistance is 1.2 ohms rather than 12, the voltage across the bulb will only be about 0.05 volts, and the the bulb will be really, really dim. Note that this very dim condition is consistent with the low filament resistance derived by assuming the filament is cold, so it's an indication that the assumption was correct.
H: Pin letters not shown in circular connectors D38999 series I'm working with military circular connectors of the D38999 series and I've discovered that when the connectors have their pins designated by letters instead of numbers, some letters are not shown. For example, in this image, the letter "O" is not shown: I've done about 10 different Google searches and I can't find any information on this. Does anyone know which letters are not shown (both capital and non capital)? If anyone has some site/pdf file about this it would be great too. Also, somewhat related, is there a part in Orcad that is a connector that has pin names in letters and not numbers? Thank you! AI: The pin arrangements for 38999 connectors are specified in MIL-STD-1560 (link is for MIL-STD-1560C). 'I' and 'O' are omitted for obvious reasons Here is another example with some lower case letters omitted as well as 'Q':
H: How to find the value of alpha in this curcuit? I have tried to solve this way but i am not sure how to proceed from here: [![tried solution][2]][2] AI: You have a \$9\:\text{A}\$ current source that leaves from the top end by only two paths and arrives to the bottom end via only two paths. You have two unknowns, \$\alpha\$ and \$I_x\$. So this feels convenient to me. Let's walk through the two paths using KVL to produce two equations. The first equation walks around the left side loop's KVL and the second equation walks around the right side loop's KVL. $$\begin{align*} \left(9\:\text{A}-I_x\right)\cdot 2\:\Omega + \left(9\:\text{A}-I_x +\alpha\:I_x\right)\cdot 2\:\Omega&=V_{9\:\text{A}}\\\\ I_x\cdot 1\:\Omega+\left(I_x-\alpha\: I_x\right)\cdot 2\:\Omega&=V_{9\:\text{A}} \end{align*}$$ These are easily reduced to: $$\begin{align*} \left(2 -\alpha\right)\cdot I_x&=18\:\text{A}-\frac{V_{9\:\text{A}}}{2\:\Omega}\\\\ \left(3-2\:\alpha\right)\cdot I_x&=\frac{V_{9\:\text{A}}}{1\:\Omega} \end{align*}$$ Which is easily solved simultaneously for \$\alpha\$ and for \$I_x\$. Note that G36, in a comment I upped above, points out that you know something about the voltage difference across the \$9\:\text{A}\$ current source. Use that information to provide the value for \$V_{9\:\text{A}}\$. Just look at the \$9\:\text{A}\$ source for a moment. It splits into two parts. \$9\:\text{A}-I_x\$ goes to the left, through a \$2\:\Omega\$ resistor at the top left, where it then combines with an arriving current, \$\alpha\: I_x\$, that must be added to it before going through the remaining \$2\:\Omega\$ resistor at the bottom left. Clearly, the voltage drop across the first \$2\:\Omega\$ resistor is \$\left(9\:\text{A}-I_x\right)\cdot 2\:\Omega\$ and the voltage drop across the second \$2\:\Omega\$ resistor is \$\left(9\:\text{A}-I_x+\alpha\: I_x\right)\cdot 2\:\Omega\$. \$I_x\$ goes to the right, through a \$1\:\Omega\$ resistor at the top right, splitting into two parts: \$\alpha\: I_x\$ and also therefore also \$I_x-\alpha\: I_x\$ that goes through a \$2\:\Omega\$ resistor at the bottom right. Clearly, the voltage drop across the \$1\:\Omega\$ resistor is \$I_x\cdot 1\:\Omega\$ and the voltage drop across the \$2\:\Omega\$ resistor is \$\left(I_x-\alpha\: I_x\right)\cdot 2\:\Omega\$. You should be able to see why the current split occurs at the top end of the \$9\:\text{A}\$ current source such that \$I_x\$ goes to the right and \$9\:\text{A}-I_x\$ goes to the left. You should also clearly understand that the sum of the two currents arriving at the bottom end of the \$9\:\text{A}\$ current source must combine to make up that same \$9\:\text{A}\$ current source magnitude. There is no option, otherwise. The other current source, \$\alpha\: I_x\$, subtracts current from node and injects it into another node. You merely need to remain consistent about the indicated directions in the schematic. If the current arrow says a current is leaving a node, then you subtract it. If the current arrow says a current is entering a node, then you add it. Do not try and impose some mental "sense" about what might "really" be happening. Your intuition is irrelevant, here. Just follow the directions indicated and assume they are correct. If they are NOT correct, then the sign will be negative and that will tell you that the current is actually going opposite to what you assumed from the indicated arrows. But that is fine. The point is to form up the equations in a consistent manner.
H: Photovoltaic/solar power supply for Raspberry Pi I want to build a power supply for my Raspberry Pi zero. It needs 5V and 2.5A (2A also working but only if 2.5A is not possible). I want to use solar cells to get the 5V and 2.5A. I have already searched amazon for solar panels but somehow the ones I've found do only have an output of 80mA - 500mA what's obviously not enough... Do you have any advice for me about suitable solar/photovoltaic panels... Please also include some more (technical)details as I'm an noob in electronics. Thanks in advance!! AI: using a solar panel directly to power the raspberry pi would not be a good idea. in the same manner where solar panels power houses, not by direction connection, but in conjunction with power electronic converters, and storage systems, so also would those be applicable here. Now what you would need, would be a good rechargeable battery, a simple DC-DC converter, and finally, a linear regulator as the buffer between the battery, and the raspberry pi. Solar panel to DC-DC converter DC-DC converter to rechargeable battery rechargeable battery to linear regulator Linear regulator to raspberry pi. NB: you can cascade the solar panels which you find to give you more current output, and have faster charge rate.
H: Identification of SMD component could someone please help me to identify what is long white SMD with JR marking? I am trying to draw a schematics for better understandig how ethernet and PoE on this device is implemented. It has near zero resistance and i could not google anything with JR marking witch would have this shape. Board function is Ethernet input overvoltage protection and PoE voltage extracting. My best guess is that it is fuse but it is quite big one. And i don't understand why there would be two of those - one is connected to +48V supply over ethernet and one is 0V. Both lines are separated from chassis grounding AI: Might be a fuse or a high power resistor. I found this as an example of fuse: https://www.alibaba.com/product-detail/Bussmann-fuses-TR3-TCP1-25-R_60711164349.html
H: LED Dimmer only using NPN BJT and potentiometer Does this circuit looks ok? I'm trying to make a RGB lamp with knob controls. The LED has a maximum current of 20mA. I've successfully created a working prototype of below circuit. I'm not from electronics background (hence for me priority wise simplicity of circuit > its efficiency). I tried creating PWM using 555 but was not getting the desired result. Combining all the answers and suggestions, does the below circuit make sense? simulate this circuit – Schematic created using CircuitLab AI: Why bother with the BJT at all? With a maximum current of 20 mA, and assuming a minimum voltage drop across the LED of 1.8V, the power dissipated by the potentiometer can't possibly be more than: $$ 20\:\mathrm{mA} \cdot (5 - 1.8)\:\mathrm V = 0.064\:\mathrm W $$ This is well within the capabilities of all but the most tiny potentiometers. Check the datasheet to be sure, but anything big enough for a knob should be able to handle much more than this. simulate this circuit – Schematic created using CircuitLab The combination of R2 and R3 serve to approximate an exponential taper pot, since our perception of brightness is logarithmic. Otherwise you end up with a control that appears near full brightness over most of the range of R2. You may need to experiment with different values of R3 to get the best response, especially in an RGB module where each color has a different forward voltage. R1 exists just to put a minimum resistance in series with D1 so the current can't get too high when R2 is turned all the way to minimum resistance. Many pots don't go all the way to zero, so you may need to make R1 smaller to get full brightness.
H: Strange footprint labeled PJ## on laptop's motherboard Today I came across a picture of a laptop motherboar (below). I noticed three strange looking small footprints, labelled PJ12, PJ36 and PJ37. The J may stand for jumper, and on the top left corner there is a PJ8 that appears to be covered with a blob of solder. If that's the case, why are they using that weird shape? Two adjacent plain square pads wouldn't also do the job? Why bother taking so much space? AI: Solder Jumpers Reason not sure why so big but yes they are solder jumpers for sure. sometimes used to isolate a few MCU pins which might be conflicting otherwise connected during programming (ex.: Boot loader) for example, when sharing boot loader pins and programming pins.. So, once programming is done, a quick solder wave will join the joints later.
H: How to test for shorts on a breakout? Working on LoRa project with the RFM95W. Most online resources like 1 and 2 suggest using a PCB since the module itself is quite small and hard to work with; but where's the fun (and learning) in that! After soldering it looks like: (it isn't meant to be deployed, just testing it out on my workbench at the moment) Please see photos: And the back side: To my untrained eye, they don't look like they would cause a short. Googling brings up continuity testing, which would be proving the negative (no continuity means no shorting) but I am wondering if there's something better and what the procedure is like? I do have this Multimeter. AI: Clean the board with flux and let it shine use a good magnifying lens to visually check if there are any shorts, especially between two pins of the module Measure power supply pins with respect to ground to make sure there is no short waiting for first power on check the assembly BOM again once more to see that all the components required to be mounted are indeed mounted (and also, components that are not supposed to be mounted are left open) measure resistance values (you should be able to read approximately actual values, but not for all cases), at least they should not just read zero or Very less ohms.. Multimeter is your friend. Check neighbor IC pins one by one. Pin4 can be short with pin 5 or pin 3.. so, that can be performed for all the pins. Check for diode polarity and capacitor polarity (if any) Repeat the same test for the connectors power on the board with current limited power supply
H: Why do most rotary potentiometers have an opening? Is this opening not a bad thing because dust can get in? I'm thinking about putting a piece of tape on it. AI: I think it is to do with manufacturing process. Most low cost pots have a carbon track that has been deposited onto some kind of fibre board, which the wiper mechanism and cover attach onto. They are designed to be cheap and easy to put together. You can also get sealed pots, but they cost several times more: 10k standard pot 10k sealed pot The gap is handy for squirting cleaning fluid into, though.
H: Designing an IoT product This is more of a general question of the embedded electronics industry. At the moment I'm planning on building a device with a similar requirement to the Nest products. Essentially, I want to have a WiFi hotspot from this device that I can connect to with a nice browser UI and can see live sensor data. My initial approach was to use an Arduino and an ESP8266 to achieve a prototype and then to create a PCB using just the Arduino's ATMega328P MCU with the ESP8266. However, I soon realized that displaying nice interfaces and incorporating a standalone ESP8266 IC itself on a single all-in-one PCB isn't really possible. I'm now looking into use an ARM Cortex based chip like the STM32 which is what Nest actually uses in one of their products along with another ARM Cortex based NXP chip. After looking through STMicroelectronics site, I could only find full WiFi modules compataible with the STM32. There was no WiFi IC or anything. I see so many companies that have these really nice UIs and intuitive ways of connecting their IoT to your home network with a nice browser setup process. However, when you look at the hobbyist area, it usually only has a single browser page with one text line displaying the sensor data. My question is: is it feasible for a single individual to be able to produce a standalone product with a single PCB that incorporates an MCU/WiFi functionality for IoT operation? And if so what's the best route for me to go? AI: Size & Components I'd say that if you're interested in minimizing size, choosing to use a WiFi board such as the ESP8266 along with the Arduino's large chip (Assuming you mean DIP form) isn't the most space efficient route, but I think you've figured that out. If you want to continue with the Arduino's chip for ease of programming you could get it in a smaller, possibly SMD, format, and find a suitable WiFi module to accompany it. One that I found with 2 min of searching is the ESP8266 ESP-01, which seems to work with Arduino, as I found a page of projects here The ESP8266 (Full board version) (or at least the one I have beside me) is 60mm x 31.5mm which is only slightly smaller than the Raspberry Pi Zero W at only 66.0mm x 30.5mm x 5.0mm. I assume your initial rejection of the Raspberry Pi didn't consider the multiple forms it comes in. It's only $10 and would allow a great suite of programming options with a large community. You could also just simply program the ESP 8266! The other option if you really desire to do a custom PCB is to use a WiFi enabled MCU such as the TI CC3120. These types of chips would throw a lot more hurdles at you in terms of soldering, programming, designing, troubleshooting, etc. But power to ya' if you wanna tackle that! Hopefully this helps. Feasibility Of course it's possible for a single individual to take on this sort of project. I currently am! I'm using BLE instead of WiFi but I have the same goals. Large companies have teams of people who pack their devices with every feature you could need and make beautiful UIs and have UX specialists making the experience amazing. They just put a lot more time into their presentation. But, for a hobbyist, you only want to transmit sensor data which isn't nearly as monumental, or beautiful, of a task. I'm not as much into the programming side but you could most definitely achieve this if you want to put in the effort.
H: How much energy is required to charge a battery to 50% vs 100%? When I go hiking, I only recharge my phone to about 80% from my backup supply because I know it gets harder and harder to push more energy into a battery the closer it gets to full capacity. So I am roughly assuming I could charge my phone a few times to 70%, versus 1 charge to 100%. (The higher the voltage in the battery the slower and less efficient recharging seems to be. Even how superchargers for Tesla can charge to 80% almost instantly, but takes considerably longer to reach 100%) I was wondering if anyone knows what that graph looks like. Total energy input vs percent charged. **I know it depends on battery type and recharge rate and all that, but generally speaking, they should have a similar graph. It won't be linear, but how about exponential? logarithmic? or is it just the inverse and derivative of discharge? Can I charge to 70% two times vs one charge to 100%? Any rule of thumb to follow while on my hikes?? My efforts to search haven't been very rewarding, so I figured I'd ask. AI: The batteries you're talking about are lithium ion. They have specific charging procedure where you put constant current until 80% and then you do constant voltage from there to 100%. That's why it takes longer above 80%. Constant voltage means there's less and less potential difference between the resting battery voltage and the charging voltage so it'll get slower and slower. Up to 80% it's basically linear. After that it'd be effectively asymptotic since the charge voltage is effectively the same as the final resting battery voltage. You could charge your batteries differently than this industry standard, but if you did so, you may blow up the batteries.
H: Data acquisition and sending with different speed I need to read certain physical parameters through the sensors and send them to the microcontroller and microcontroller should combine this information and send through rf transmitter. I can read all the analog parameters using ADC. There is PWM signal coming from the temperature sensor, I thought using interrupts, I can measure the signal length and get the info. The problem is sampling rate changes according to parameters. Some of them should be sampled with 2kHz some 500Hz and some of them 1Khz, also temperature sensor produces PWM in 1 second period. So how should I combine them and send properly and solve after receive? Edit: I did not explain the question clearly enough. Problem is not about the acquisition. It is about, in which order, how often I should send the data. I don't want to lose information while sending data but also since sampling frequencies are different I should be able to differentiate which data is coming at receiver. My first idea is saving all data in 1 second period (the slowest data speed) and sending it once. Thus it will be in order. But now I guess sending each data when it is sampled and put some label while sending it is much better. So my main question is what is the common way to handle such a problem? AI: The best way of reading PWM signal is by using timer-counter in input capture mode. You run your counter at high frequency and program it for external interrupt. When signal on a pin changes current counter value gets stored in the input capture register. All this is handled in hardware, so your program is free to do whatever else you need. You have to handle interrupts to acquire that value and to prepare next capture at the beginning of the pulse. How exactly you connect those PWM signals depends on MCU. Some of them have only one input capture pin, so you have to use multiplexor IC and cycle it through your sensors. Or you can look for MCU with enough input capture pins for all your sensors. Even if you have to use single input and multiplex sensors you do not need to worry about different PWM frequency. You simply run counter as fast as possible (not too fast to get overrun, though) and calculate actual duty in software according to input being sampled at the moment. UPDATE: If you asking about sending data, then it is completely different question. First of all, you should clearly split data acquisition code from data transmission. Your sampling routines (especially ISRs) should not do any transmission, they should place all data into shared variables and forget about them. Your transmission code then depends on the needs of your target recipient and available bandwidth only. For example, it can combine all data into one block and send this block every time. Slow data will be often sent unchanged, but the code will be very simple, on both transmitter and receiver. Alternatively you can design your own protocol and send each parameter individually tagged by source ID. In this case you can send fast changing data more often. Ideally, the transmission frequency for each value will correspond to its acquisition rate, but since you've separated two layers your timing is flexible and you can finish previous transmission before sending next even if new data become available in the process. In the end it is simple bandwidth calculation. Figure out how many bytes you can send every second given the transmission speed. Calculate how many blocks you can send and see if it gives you sufficient data rate per your requirements. If not, calculate individual data rates and see how many bytes you need to send per second (including tags) and sum them into total data volume. If it is still over transmission speed you are out of luck. If it is not you can go ahead and implement interleaved protocol.
H: Compact thermostat for VCO temperature stability So I have a voltage controlled oscillator with an exponential input made using the THAT2181 VCA IC. The schematic is shown below - the THAT2181 IC is used to change the C4 capacitor charging current and, therefore, the output frequency depending on the LOWCV input. The problem is the thermal stability of such a solution - THAT2181 has a 3300ppm temperature dependance and for precise audio it is unacceptable - with the same input the schematic will output 807 and 837 Hz signal at 25 and 35 degrees Celsius respectively. A typical solution for this problem is adding a 3300ppm NTC thermistor divider at the input, but those are hard to find, not exactly precise anyways and manufacturers today move towards "IC heating solutions" in transistor array ICs using one of the transistors in it as a heater. So, my question is: what will be the most compact, yet cheap solution for THAT2181 IC heating in my schematic? I've looked at the PTC heaters, but the minimal transition temperature of them is about 60-70 degrees Celsius, which is way too hot (I am looking for about 40 degrees) and adding a microcontroller feels like an overkill. AI: You could try something along these lines. Mechanical arrangement is up to you, but insulation will reduce maximum required power. Rt is a common 10K thermistor (eg. 0402 type) and R4 is an SMT power resistor. Pick R4 so that it is powerful enough to maintain the desired temperature at the minimum allowable ambient and supply voltage (preferably stick it in an environmental chamber to check it). It's basically a bridge where the thermistor temperature causes balance at Rt= 4.99K which is about 44.5 degrees C for popular types. R6 and C1 should stabilize the controller with a sensible amount of gain so it doesn't oscillate and cause audible noise (total proportional band is about 1/3 Kelvin) simulate this circuit – Schematic created using CircuitLab
H: RL filter output attenuation I am designing high pass RL filter. R is 550 [Ohm], L is 220 [uH]. I calculated that time constant is therefore 0.0000004 [s] and -3 dB pulsation 2 500 000 and frequency 397 887 [Hz]. I put this on the breadboard and connected JDS 6600 signal generator and Rigol DS1054Z oscilloscope to test it. For testing I apply sine signal of 5 [V] (Vpp, amplitude) and varying frequency. As expected I observe decreased amplitudes of the signal at the output for low frequencies and increasing amplitudes for signals of increasing frequency. Using transfer function |H(j omega)| = 1 / sqrt(1 + (1 / (omega tau)^2)) I calculated that 0.95 signal attenuation should happen at 1 210 781 Hz (|H(f=1210781)|=0.95) and that would mean that I should see about 4.75 V at this freq, but in practice I get this value at about 1 MHz. Why do I see such a big difference? simulate this circuit – Schematic created using CircuitLab AI: What you may actually be testing simulate this circuit – Schematic created using CircuitLab Assuming 1:1 probe You should see a low Q <0.3 breakpoint around 1~2MHz with 50% attenuation when coax load pF impedances falls to equal rising ZL(f).
H: Understanding the resistance readings between PCB connectors Based on a question I asked earlier today, I am trying to verify that there's not short caused by my bad soldering. Luckily I had bought two of these modules. To make a baseline, I started looking at the module that I had not done anything to. Using this Multimeter (on a disconnected module -- it has no solder and no wires in/out), I am pressing the black lead again the MOSI pin (see diagram below) and moving the red lead one pin down, one pin at a time. However, I am not entirely sure what I am looking at, for example: With black on MISO and red on MOSI, or SCK, the reading is 350+K Ohms. With the black on MISO and read on RESET, the reading is 150+K Ohms. With black on MISO and red on DIO5, the reading is 1.05K Ohms and red on GND shows 0.5K Ohms. When I compare that with this video for example, his reading stays at 1 across pin changes. Again, this is an untouched board, direct from the seller. So is my understanding not correct (i.e. the readings are fine and I don't know what they mean)? Or is it a bad module? AI: None of these are shorted, which is what you read when the DMM leads are connected to each other. With black on MISO and red on MOSI, or SCK, the reading is 350+K Ohms. MOSI and CLK are both high R inputs as displayed With the black on MISO and read on RESET, the reading is 150+K Ohms. Reset is high R input as displayed With black on MISO and red on DIO5, the reading is 1.05K Ohms Both are low R outputs but not active? probably diode resistance and red on GND shows 0.5K Ohms. Same as above Unless you wore a gnded ESD strap, they were not untouched
H: Why do cascading D-Flip Flops prevent metastability? I understand what metastability is but don't understand how linking together flip flops reduces this? If the output of the first flipflop is metastable, this gets used as input for the second one. But I don't see how the 2nd flip flop will be able to do anything with this input and make it stable. Thanks in advance! AI: Metastability cannot be 'cured', but if you wait long enough, the likelihood of it occurring can be made arbitrarily small. Once you've got it down to once in the age of the universe, it's probably unlikely to cause you trouble. It's like balancing a pencil on its point. It's likely to fall over, and the longer you wait, the less likely it is to remain standing. There are two problems with waiting a long time, and one of them is fundamental. The fundamental problem is that if you have a single memory element (latch or flip-flop, they both suffer from metastability) in a clocked system receiving the output from an asynchronous external system, then you physically cannot define a lower limit to the waiting time, sometimes the external signal will make a transition near the latching control edge. You have to pipeline the signal to another flip-flop to let it wait there. This gives you a guaranteed one clock cycle minimum wait time. The second problem is that often you're trying to run a system as fast as possible, and the system clock rate cannot be slowed down to give enough time in the second flip-flop. The only way to increase the signal latency to what's necessary, without decreasing the throughput, is to pipeline the waiting to more stages. Some people have trouble visualising what's happening between the flip-flops. There are two ways to induce metastability, and they both involve violating the flip-flop rules. One way is to violate the input setup and hold times, to make a transition when the flip-flop expects the input to be stable. The other is to violate the input logic levels, to make the flip-flop data input sit at an intermediate voltage level. A flip-flop that's being metastable can produce either type of violation on its output, to cascade on to the next flip-flop.
H: Window Comparator I am reading this website and don't understand why this circuit doesn't blow up. If Vin = Vcc then seems to me top opamp A1 would drive low (Vcc > 2/3Vcc and inverting comparator) and the bottom one A2 would drive high (Vcc > 1/3Vcc and non-inverting comparator). So now you have two opamps driving against each other and whichever one overheats first looses. https://www.electronics-tutorials.ws/opamp/op-amp-comparator.html AI: There is no issue if the output is an open collector type. I found the text in the article you where referring to: As a result the output stage of the voltage comparator is generally configured as a single open collector (or Drain) transistor switch with open or closed states rather than actual output voltages as shown:
H: Square wave to DC voltage with passive components Good day, I have a design challenge that I have been thinking about. Is there a passive and inexpensive system that I can get a square wave (frequency not decided yet, but less than 8MHz) that will output a 5V DC signal? If the input changes to a fixed voltage the output must go low. My solution was to DC null the square wave with a decoupling cap and then smooth out the gaps in the remaining square wave with a passive low pass filter. Essentially take advantage of the capacitor to GND and allow it to charge and discharge at a frequency that will result in a DC signal. The problem with this design that I can see is that this is wildly inefficient as the DC null will half the power and the passive LPF will also result in a loss of power. Is there a way I could use transistors to active what I want? (I am trying to stay away from IC's) EDIT @Neil_UK Thank you for your help. This is my simulation response with a slow frequency of 2kHz. AI: The following voltage doubler may give you what you want simulate this circuit – Schematic created using CircuitLab It presents the peak to peak input voltage to the output, less two diode drops. Choose D2/3 to be schottky types for lower drop than silicon. A 5v squarewave will give you a bit more than 4v. Choose C1 depending on frequency. Its impedance at the input frequency needs to be much less than the load resistor R1. R2 should be as small as possible, consistent with it limiting the current taken from the gate driving the line. If it's a 'buffer gate' like HC125 or similar, it could be quite small, or with a small C1, not needed at all. The ratio C2/C1 determines how many cycles are needed to 'pump up' the output voltage. The product C2.R1 determines the time it takes for the output voltage to drop once the input signal has gone to DC. With its less than 5v output, slow ramp up, and slow ramp down, the circuit may or may not meet your requirements. You may want to add a transistor or logic buffer to get crisper outputs. To get 5v output, you'll need either to use a higher voltage input, to stack on another doubler stage Dickson multiplier style, or to add active FETs to reduce the diode drop to near zero, which is probably more complicated than you need. simulate this circuit The zener clamps the output voltage. Bonus Points. What's the difference between Dickson and Cockcroft-Walton? This is a Dickson. In a Cockcroft-Walton, C3 goes to the junction of C1/D2/D3. The Dickson style has a lower output impedance, but subjects its input capacitors to a higher voltage. This means low voltage cascades are best with a Dickson, and high voltage cascades usually need a Cockcroft-Walton.
H: How to divide complex number in VHDL? I know how to divide numbers in VHDL (or using one of the Xilinx IP core generators) but I do not know how to do it in the case the numbers are complex. In my case I have defined a complex number as this: type complex12 is record re : std_logic_vector (11 downto 0); im : std_logic_vector (11 downto 0); end record; So my complex number it is just two vectors of 12 bits, one for the real part an other for the imaginary part. Let say that now I have a and b complex numbers: signal A : complex12 := (re => (others=>'0'), im => (others=>'0')); signal B : complex12 := (re => (others=>'0'), im => (others=>'0')); I know that the theory for dividing to complex numbers tell us two approaches for doing a division: $$ c = \frac{a_r + j\cdot a_i}{b_r + j\cdot b_i} = \frac{(a_r + j\cdot a_i) \cdot (b_r - j\cdot b_i)}{b_r^2 + b_i^2} $$ Alternatively: $$ c = \frac{|a|}{|b|} \cdot e^{j (\angle a - \angle b)} $$ But both approaches seem very difficult to implement in VHDL. What would be the preferred approach? Is there an easy way to divide complex numbers? Is there any Xilinx block that can save the day? I am bit lost on how to approach this. AI: You've got the right idea with that first equation. You've just got to do some more algebra: $$ c = \frac{a_r + j a_i}{b_r + j b_i} = \frac{(a_r + j a_i) (b_r - j b_i)}{b_r^2 + b_i^2} $$ $$ c = \frac{a_r b_r + a_i b_i + j a_i b_r - j a_r b_i}{b_r^2 + b_i^2} $$ $$ c = \frac{(a_r b_r + a_i b_i) + j (a_i b_r - a_r b_i)}{b_r^2 + b_i^2} $$ $$ c = \frac{a_r b_r + a_i b_i}{b_r^2 + b_i^2} + j \frac{a_i b_r - a_r b_i}{b_r^2 + b_i^2} $$ Yes, there are a lot of operations required. Looks like 6 multiplies, two additions, one subtraction, and two divisions. Yes, implementing this in Verilog/VHDL will be rather complex. If you don't need maximum throughput, then you can probably get away with one multiplier and one divider and then sequence the operations with a state machine. Compute the denominator first, store it, then do the numerators, computing the second one while the divider is working on the real part of the output.
H: Large LED Array powered via USB I am working on building a keyboard at the moment and I have run into an issue. I need to power 79 led backlights on the keyboard but I have no idea how to do this given that the power is coming via usb. I know usb 3 can handle up to 900ma but I want to make this work on all usb. So I am limited in the assumption that I have 500ma to work with and 5v. That's 500ma to power two teensy 2.0 ++ and the 79 backlights plus 3 indicator leds. I cannot find any through-hole leds that are less than roughly 3v and 20ma. So connecting all the leds in series is pretty much out of the question and since they are 3v I cannot put them in parallel either. How are commercially made keyboards powering their leds, and they usually have 100+?? How can I power all of these? AI: LEDs will produce light well below 20 mA. The backlight of our display uses a LED with around 1 mA current - you can't see it in daylight but when it's dark it's fine. You have around 5 mA per LED, that should be plenty (no idea what a teensy is and how much current it needs). Modern LEDs are almost blinding at 20 mA. However I'm not sure if you will find modern and efficient LEDs in through hole, so I'd use SMD LEDs.
H: Limiting current for Peltier We are building a greenhouse box for strawberry plant. We need to control the humidity and temperature inside the box. We need to maintain in range of 23 - 18 degree Celcius and humidity in range of 68 - 73 %. So we arrange the peltier in parallel and also the fan in parallel. We have a voltage supply of 12 V 60 A. To make the pelteir run efficiently without any problem. What type of resistor should we use to make the peltier to take in range of 4 - 6 A, which mean to protect the peltier and the fan we need to choose a resistor which is suitable for specific current take in. We have 9 peltier and 18 fans. So we need to supply 12 V 4-6 A to every peltier and as for the fan we need to supply 12 V and 600 mA for every fan. So the question is if the overall current take in is about 57 A, what should we do with the excess current of 3 A? is there any possibility of burning or short? What resistor should we use? And what type of wiring cable size should we use to distribute the voltage and current to pcb board with 8 V strips? Item specification Peltier (40 mm x 40 mm) 12 V 60 W Intel cooling Fan 12 V 600 mA Voltage supply 12 V 60 A Wire size Used : For peltier Awg 24 For Fan (we use wiring that is suitable for electronic stuff example like raspberry pi or arduino) Component connected to RPI 3: DHT22 x 2 Soil Moisture x 4 Relay Board v1.0 5V 2-channel relay board 7 inch official raspberry pi touchscreen Purpose for Final Year Project AI: I'm not sure whether I understand you question or not. You have a 12 V supply and components which require also 12 V, I don't think you will need any resistors. We have a voltage supply of 12 V 60 A. Keep in mind that it is a voltage source you are using, which has the intention of keeping its output voltage the same, no matter what current you try to get from it. The 60 A then should be the maximum current it can supply. It will not always give 12 V and 60 A at the same time. For example, if you would only connect a 1 Ohm resistor, the voltage across the resistor would be 12 V and the current trough it also 12 A (Ohm's Law). In order for the current to be 60 A the voltage across the resistor then should be 60 V.
H: 128-bit data UART I have made a UART controller in VHDL (transmitter, receiver and a FIFO for each component) and I'd like to send/receive 128 bits of data. Is there anything that prevent me from implementing a 128-bit FIFO, and send/receive 130-bit UART frames ? Or should I send/receive 16 frames of 10 bits (8 bits of data plus 1 bit of start and 1 bit of stop). AI: Start and stop "frame" bits are important in asynchronous communication as they provide a way to sychronise the receiving bit clock with the stream being sent if you send 128 bits of data the two clocks must agree in frequency to better than 0.4%. Most crystal oscillators are much better than 4000ppm so it could work. but I've not seen such a scheme ever used. Also the better the clock agreement the better the noise immunity of the system - towards the end of the packet the signal degades as the sampling point drifts towards the edge of the bits. However most UARTSs send only 8 bits of data between each pair of frame bits. this requires only 5% speed accuracy making communication practical with a cheap ceramic resonator, or even a good RC oscillator. If you want to communicate with a PC you will need to use a line discipline that it understands, that typically means no more than 8 data bits between the start and stop bits, so transmitting 128 bits of data will require a total of 160 bits on the wire.
H: LED blinking while loop not working AVR timer 0 It is strange and rare. I am trying to blink a LED at PD0 at 2hz, but it doesn't work. Seems to me that while loop doesn't work at all. I have triple checked the code. what is the problem here? uint8_t c=0; int main(void){ DDRD= 1<<0 ; TCCR0 = (1 << CS02) | (1 << CS00); // (clk_i/o )/1024 ( Prescaler) TIMSK |= 1<< TOIE0; sei(); while (1){ if ( c >=30 ) { PORTD ^= 1<<0; c=0; } //61.035/30= 2.034 hz } } ISR (TIMER0_OVF_vect){ c++; //16000000/1024/256=61.035 hz } Of course, I know the solution. It's by adding a random line of code to the while loop, and it works again. Strange!! What would be the problem? compiler bug?? uint8_t c=0; int main(void){ DDRD= 1<<0 ; TCCR0 = (1 << CS02) | (1 << CS00); // (clk_i/o )/1024 ( Prescaler) TIMSK |= 1<< TOIE0; sei(); while (1){ if ( c >=30 ) { PORTD ^= 1<<0; c=0; } //61.035/30= 2.034 hz _NOP(); } } ISR (TIMER0_OVF_vect){ c++; //16000000/1024/256=61.035 hz } AI: By NOT declaring it volatile you give the compiler permission to optimise. In the first loop, the compiler knows the value of C at all times, because nothing else in the loop can modify C (and it isn't volatile) so, because C is always 0, the loop doesn't need to do anything. The code is working perfectly because that's what you asked for. In the second loop, you call a procedure (oops, void function) NOP() which could do absolutely anything. So, unless the compiler does whole program analysis over all the libraries (and it doesn't), how does it know if NOP() modifies C? It doesn't, so it can't make any assumptions about C's value and has to re-fetch it from memory. Ths second program isn't working, it does what you expect by accident. If the "random additional line" didn't involve a call - e.g. it was an inline assembly NOP instruction, you would probably see different behaviour. Declare C volatile.
H: MOSFET as switches in non ohmic region I have a project in which I have to "close a digital switch" using either a 5V or a 3.3V supply. The load will be at 12V, with a required current of around 200mA. As a newbie I thought to use an N-channel MOSFET such as the FQP30N06L datasheet. While the transistor will actually provide me more than enough current, according to the datasheet, either at 3.3V or 5V, I will be in the saturation region and not in the ohmic region. I thought I was fine with that, but reading around I found out you should be in the ohmic region to use the MOSFET as a switch. Why so? Also: What are the downsides of my configuration (i.e. switching in saturation region)? AI: The ideal switch has infinite resistance when off and 0 resistance when on. When a MOSFET is being used as a switch, you want it to look as much like 0 resistance as possible when on. This happens when the part is being driven hard, which is in the ohmic region. However, don't get hung up on labels. Look at the datasheet and see what maximum on-resistance is guaranteed for what minimum gate voltage. If you can supply that gate voltage and that on-resistance is acceptable, then go ahead and use that FET. If you had provided a link to the datasheet of your FET, I could have commented on its suitability to your problem. My jellybean FET for such purposes is the IRLML2502.
H: kVA calculations For electrical panels / systems with three phase electricity (red, yellow, blue) ~220/127. When using line to line we get 220 V is this considered single phase system or three phase? I know three phase devices such as motors use all three phases together, this is clearly three phase and we use three phase formulas for calculations, but what about when using three phase system line to line? What formulas do we use for apparent power calculations? Also if a circuit breaker is 20 A for each phase, and I am using line to line wiring, does this makes my maximum amps usage 40 A or still 20 A? AI: What is described appears to be single-phase loads connected to a three-phase supply. If the current capacity for balanced, three-phase use is 20 amps, that is all that can be drawn by a single-phase load. You can not safely connect any combination of single-phase loads that causes any of the three individual phase currents to exceed 20 amps. If the three phase currents are not equal, the safe the maximum kVA will be less than the rated kVA of the supply. There is nothing wrong with loading the supply with single-phase loads that do not result in a balanced three-phase load, but that is not the optimum use of the generation, transmission and distribution system. Since you are presumably being charged for actual power used regardless of balance, the supplier may object because your imbalanced usage limits what can be sold to other customers. ... what about when using three phase system line to line? What formulas do we use for apparent power calculations? When the load is not balanced, the apparent power can be calculated as the sum of the apparent powers of the individual loads. If necessary, represent the supply as three, wye-connected, sources.
H: LP311 collector remains at ~11V when "low" Okay, I'm trying to monitor current going to a device, and in case current is drawn, light a led and provide a low signal (<5V) to a microcontroller. The current goes through a half-ohm resistor and the voltage difference is amplified by AD8210. Output of the amplifier is compared to a reference value set by a potentiometer using a LP311. Reference value is set by hand so that the led illuminates when the load is active. This far everything goes fine, but trying to read the status to a microcontroller won't work, as LP311's collector stays at ~11V even when active. My only idea so far has been that the output transistor is not saturated. However, increasing the load current and therefore increasing the comparator input difference should then bring collector voltage lower, but this was not the case. So, why is emitter-collector voltage so high? I was expecting it to be 1V or less. simulate this circuit – Schematic created using CircuitLab AI: You are trying to draw too much current from the output. If your supply is 12V then the current would be 60 or 70mA, which is far higher than the low power comparator can supply. If your supply is higher, it's even worse. You say: However, increasing the load current and therefore increasing the comparator input difference should then bring collector voltage lower, but this was not the case. But this is not true, the output current will be limited by the available base current (which has more to do with the internal biasing networks), which will not increase for differential inputs beyond a few mV. With a 5V supply (4.5V in the specifications) it is only guaranteed to sink 1.6mA with a defined maximum \$\text V_{OL}\$. So add a buffer for the LED and all should be well.
H: PNP instead of NPN in series voltage regulator I have a question regarding PNP transistor, since I am not very familiar with it. What would be the difference in the circuit below, if we switched NPN to PNP? Right now the output voltage is equal to \$U_D\cdot\left(1+\frac{R_4}{R_4}\right)\$ The value of \$R_1\$ is limited by \$R_{1max}<\frac{U_{INmin}-U_D}{I_{Dmin}}\$ I know that for NPN the base's voltage must be positive, while for PNP - negative. But I just don't see how this would affect this circuit. AI: The difference is that in a "positive" regulator (the regulator regulates the positive side of the input voltage) like this an NPN is used in a common collector (emitter follower) configuration. This means that the voltage gain of the NPN from base to emitter (and note that the emitter is the output) is about 1x. This means that the NPN does not add gain to the feedback loop. This means that it is fairly easy to stabilize the loop. When using a PNP the emitter will have to be at the input side making the circuit a common emitter. A common emitter has a gain depending on the load on collector. Here the circuit fed from this regulator is the load. So if the load changes, the gain changes ! This makes stabilizing the circuit much more challenging. Also a common emitter has a negative gain meaning the output voltage is inverted compared to the input voltage. This means for the PNP version you also need to swap the + and - inputs of the opamp for the circuit to work. Another difference is the minimum voltage drop needed for the regulator to work properly. In this case using a PNP will result in a lower dropout voltage compared to the NPN version. I'd say that swapping the NPN for a PNP looks like a small change but really, it is not. It results in a fundamentally different circuit. Even if both circuits are still voltage regulators. With the PNP version you run a much higher risk of actually making an oscillator instead of a regulator.
H: Power indicator for circuits with voltages much higher than LED forward voltages (say 15-48V) I have a circuit that has a 24V power rail and I put an LED and series resistor on it for power indication. Even at 10mA forward current, over 200mW of power is dissipated, over 90% of it in the series resistor. This is more than many (but not all) SMD resistors can even provide. This seems like a lot of power for a simple LED. Neon indicators might work at the higher voltage end, but they aren't commonly available in SMD packages and they're bulky, expensive and can have limited life. I also considered an astable multivibrator to do a low-duty cycle flash to keep average power down, but that needs 4 resistors, 2 capacitors and 2 transistors, or an IC (which would be unlikely to work at 24V) and some passives. Is there a very simple (low component count, cheap, low-power and low-board-area) way to show power indication in circuits with a rail voltage more than about 10 times the LED \$V_f\$ (say around 15V up to 48V). AI: Use a different LED. High brightness LEDs should still be plenty bright enough for an indicator at 1-5 mA. The problem you have is whatever component(s) you use to do this linearly will be dissipating the excess energy as heat. The only way to perform this more efficiently if you wish to run from a high voltage, and put 20 mA thru the LED is to use some kind of switching device but that goes against one or more of the simple, cheap and low component count requirements.
H: Why do we use Laplace transforms to analyse transient circuits? I just learned transient circuits and we solved them both in the time domain and the Laplace domain and I can't understand why we would use the Laplace domain as it seems it is a lot more simple to use the time domain especially in series RLC circuits. AI: It's easy to solve simple filter circuits in the time domain but there becomes a tipping-point where most engineers would prefer to solve problems in the frequency domain and apply (for example) a step-function. Finding the inverse Laplace is fairly straightforward because of Laplace tables. As an example of an RLC low pass filter, engineers become accustomed to the transfer function: - $$H(s) = \dfrac{\omega_n^2}{s^2+2\zeta\omega_n^2 s + \omega_n^2}$$ And, applying (for example) a step function is as simple as multiplying by 1/s: - $$\dfrac{1}{s}\cdot\dfrac{\omega_n^2}{s^2+2\zeta\omega_n^2 s + \omega_n^2}$$ Engineers who are familiar with this get to recognize that this converts to a standard form and the next step is just using the tables to derive the transient response. In addition, the term \$\omega_n\$ (the natural resonant frequency) can be is factored out a lot of the time so that solving the step-function formula for \$\omega_n=1\$ begins with: - $$\dfrac{1}{s}\cdot\dfrac{1}{s^2+2\zeta s + 1}$$ This is rearranged to a standard form such as this (underdamped resonance): - $$\dfrac{1}{s[(s+a)^2 + b^2]}$$ Where \$a =\zeta\$ and \$b=\sqrt{1-\zeta^2}\$ The Laplace tables give us this: - $$H(t) = 1+\dfrac{1}{\sqrt{1-\zeta^2}}\cdot e^{-\zeta t}\cdot \sin(t\cdot\sqrt{1-\zeta^2}+\phi)$$ Where \$\phi = \arccos(\zeta)\$ But you will probably only be convinced when you are dealing with slightly more complex situations or really do need to analyse the frequency spectrum.
H: PIR Sensor triggering voltage not enough I'm using a HC-SR501 PIR sensor. The sensor is working fine, it outputs 3.3 V on motion detection. But when I connect the PIR sensor to pin 2 (interrupt) of an Arduino pro mini, the voltage output is only 0.289 V on motion detection. The sensor is detecting motion, it's just not giving enough voltage. How is this happening? AI: If the sensor is putting out 0 to 3.3 V when open circuit, and 0 to 290 mV when connected to a microcontroller, then the micro is obviously loading the signal. A normal CMOS input wouldn't load a signal like that, so obviously that input of the micro is not acting like a normal CMOS input. Possible reasons include: The pin is not configured as a input in firmware. Check your code. The pin is dedicated to some other function. Check the datasheet. Something else is loading the pin. Check the schematic and your wiring.
H: Vias Size for Microstrip if my microstrip trace width is about 50 mil, how large should my via drill size be? Should it also be around 50 mil? Thanks! AI: You can design your via to minimize the discontinuity it introduces in your transmission line. Basically this means balancing the inductance introduced by the via with the capacitance between the via and other nearby conductors (such as plane layer copper, etc). The ideal geometry won't just specify the via diameter, but also the keep-out diameter around the via, the diameter of pads on layers without connections (if used), and the location and diameter of vias for the return currents. In addition to the required Z0, the ideal geometry will depend on the substrate Dk and which layers are being connected by the via (and thus how much stub is present on either side of the connection). Designing the optimum geometry is generally a job for a 3-D EM simulation, although some tools (like the Saturn PCB tool) will give rough estimates. For 900 MHz, it's unlikely that optimizing the via geometry will be needed unless you are looking for extremely low reflection coefficients in your design.
H: measure Watts, given only Current in a single-phase AC system I live in Greece where 220Volts/50 Hz is in every house's socket. I need to measure the Watts being consumed by a device (a single lamp), which I hook up in the socket. The problem is that I can only measure the instantaneous current i(t). I don't know the resistance of the lamp neither the instantaneous voltage. The current is being measured from an arduino, using ACS712-5A, which makes my first question : Is this safe, for me, my arduino and all my peripherals to measure the curent with ACS712-5A ? Secondly, this is the "analysis", I did to determine a way to measure the Power. I need you to tell me, if it's valid ? $$ P_R(t) = V(t)i(t)\\ => P_R(t) = \sqrt(2)V_{rms}cos(ωt)*\sqrt(2)I_{rms}cos(ωt+φ) $$ ,but φ=0 since I just have a lamp (an ohmic load). So, $$ P_R(t) = 2V_{rms}I_{rms}cos^2(ωt)\\ => P_R(t) = V_{rms}I_{rms}(1 + cos(2ωt))\\ $$ but instantaneous power is not so usefull, so I go for the average power : $$ P_M = \int_0^T V_{rms}I_{rms}(1 + cos(2ωt))dt\\ => P_M = V_{rms}I_{rms} (t\Big|_0^T + \frac{sin(2ωt)}{2}\Big|_0^T)dt\\ $$ the second term is 0, so $$ P_M = V_{rms}I_{rms}T \\ => P_M = \frac{V_{rms}I_{rms}}{f} \\ => P_M = \frac{220I_{rms}}{50} $$ So, all I need is calculate $$I_{rms} : I_{rms} = \frac{I_{max}}{\sqrt2}$$ which means that I must determine the maximum current. In order to do this, I need to have a sample rate faster than 50Ηz (ideally faster than 2*50Hz based on Nyquist theorem). On this question : https://arduino.stackexchange.com/questions/699/how-do-i-know-the-sampling-frequency is being said that : For a 16 MHz Arduino the ADC clock is set to 16 MHz/128 = 125 KHz. Each conversion in AVR takes 13 ADC clocks so 125 KHz /13 = 9615 Hz. So, I guess my arduino is capable of that measure. The pseudocode I guess will be something like this : max = 0; t = millis(); while (1) { instantCurrent = readAnalog(); if (instantCurrent > max) max = instantCurrent; if (millis() - t > 1/50) //period is over. { // prepare for the next maximum in the next period Irms = max/sqrt(2); AveragePower = 220 * Irms/50; // --> THAT'S WHAT I WANT t = millis(); max = 0; } } So, what's your opinion ? Edit : Missed, the division by T in calculating the average power : $$ P_M = \frac{1}{T}\int_0^T V_{rms}I_{rms}(1 + cos(2ωt))dt\\ $$ which makes a more reasonable result, independent of frequency, as Anderson mentions : $$ P_M = V_{rms}I_{rms} $$ The general problems thought, remains the same :) AI: From the datasheet you can see that there is sufficient isolation to support your needs. However, whether it's safe for your depends on either the implementation of the board your bought, or the PCB you laid out. When including mains voltages and MCU/logic level circuitry on the same PCB you have to be very careful to ensure you have the correct spacing of tracks. I consider PCBs such as these (Ebay specials) to be quite dangerous as they have no solid mounting points or have very small safety spacing on tracks so are difficult and potentially dangerous to use. A much safer sensor interface is to use a current transformer, again readily available and easy to connect to an Arduino A/D. Here the mains is kept in it's rated cable and well isolate from your MCU/logic levels. Since you are measuring a resistive load all you need to do is find the peak current flowing. From this you can find the RMS current and even assuming the mains voltage you'll get reasonably accurate results. For an Arduino based solution sensing only the current flow I'd suggest you find the zeros crossings (of the current waveform) and simply calculate the top of the sine wave current flow and trigger the A/D. Or you could take say 1kHz readings, and search for the highest current reading. Remember that if your load is reactive in any way you need to measure voltage/phase/current together to get accurate power readings. You could then follow the bouncing ball at OpenEnergyMonitor.
H: CMOS NAND Image I was looking at this image which shows a CMOS NAND standard cell. However, how can I see this depicts a NAND? A CMOS NAND has parallel PMOS and serial NMOS transistors but somehow I can't see this in this image. Any explaination? AI: I've put a picture of the ciruit below: blue/violet ... metal 1 red ... polysilicon (used for the pmos/nmos gates) green ... n-active area yellow ... n-diffusion p-active area light blue ... p-well (the bottom large rectangle) light orange ... n-well (the large rectangle on top) small rectangles ... contacts and vias to contact the different layers A PMOS is made by drawing a red rectangle over a yellow active n-region A NMOS is made by drawing a red poly over green active p-region
H: Confusion about inductors in series vs. combined I suddenly was getting confused while reading about inductors. The formula for inductance I was using was the one like in the answer to this question. However, I have also read that the inductance of inductors in series is the sum of the inductances (like with resistors in series), but that suggests to me that longer inductors would have larger inductances. The formula in the link has length on the bottom. I'm probably missing something simple here but I'm not sure what. AI: The answer you linked describes the effect of spacing out the windings on the total inductance. That is, length refers to the length of the solenoid, not the length of wire used to create the windings. Consider: (Image Source)
H: What kind component is this? What kind of component is this? And is that crack normal or is it a sign that it's bad? AI: Spark Gap over voltage protector. Here is another E.SE question relating to a similar air gap component. The component could also incorporate a capacitor or MOV (metal oxide varistor) that the lead wire straddles and the spark gap is there to protect this component or provide additional protection. The component lead wire was a continuous inverted U moulded into one or more layers of epoxy. The component is then cut with a fine saw with a selected blade thickness to set the desired gap in the top of the wire loop. The ends of the cut component lead are the flat embedded electrodes of the spark gap. Having decent gauge wire in a heavy epoxy body allows for decent heat dissipation. The illustrated component manufacturer MDC also sells varistors and as this device is missing a capacitance rating it is more likely a plain spark gap or a varistor with a spark gap. There is a similar looking product called variously a GAP-KAP or GAP CAP that incorporates the capacitor and protection spark gap. These devices are found in higher voltage power supply circuits, CRT electron gun circuits and also in the front end protection of some (including Fluke) digital multi-meters. Component failure is often characterised by burn marks in the gap area. Just to speculate, but it might be possible in some variants that the epoxy will char and swell and short out the gap with a continued over voltage condition and blow a protection fuse. EDIT: It looks like some of the Fluke meters as described in this forum thread come with spark gaps that look like this component and have had them replaced with MOVs in later design revisions. Components with kV ratings in places that should never have high voltages present are going to be some kind of protection device. It also looks like the charring may act as an optical and electrical failure indicator.
H: How to program ATmega8U2 I was given an ATmega8U2 chip by my friend and I have been doing a bit of research about it. It says it does not come with a pre-programmed with a boot loader, so I was just interested about how to go about getting a c program on there? Do I have to download a boot loader to the chip or something? AI: You need a programmer/debugger. Atmel (now Microchip) sells a suitable device, or you could use an Arduino with suitable software as a programmer only. The latter will be a lot cheaper.
H: Root locus, where do they leave the line parallel to imaginary axis I know how to sketch by hand root locus of simpler systems. Consider the root locus which Matlab gives for: $$G(s) = \frac{1}{(s+4)(s+6)(s^2 + 10s + 100)}$$ I've marked the points of interest P1 and P2. When the following task was done during class the points were determined by solving for the breakaway point: $$\sum_{j=1}^{n} \frac{1}{\sigma - P_j} - \sum_{i=1}^{m}\frac{1}{\sigma - N_i} = 0$$ Which when solving yields a real solution and two complex conjugate solutions: $$\sigma_1 = -5, \sigma_2 \approx -5 + j6, \sigma_3 \approx -5 - j6 $$ Obviously the breakaway point from the real axis is the real solution, however for the points P1 and P2 the two complex conjugate solutions were taken, respectively. I have been unable to find the reasoning behind that in my books and on the internet. My question is how do we determine the points P1 and P2 and why? AI: The poles for determining the root-locus for an open-loop transfer-function \$H(s)\$ are found using $$1 + K\cdot H(s) = 0 \Rightarrow K = \frac{-1}{H(s)}$$ The equation holds for any \$s\$ that solves the equation. If \$N > 1\$ poles are hugging in a single point \$\sigma\$, then that means that locally, \$K\$ changes proportionally to \$(s-\sigma)^N\$. This means that the first derivative of \$K\$ will be \$0\$ in this point \$\sigma\$. So we can find these points by solving for $$\frac{dK}{ds} = 0$$ or similarly $$\begin{align} \frac{d}{ds}\left( \frac{-1}{H(s)} \right) &= 0 \\ &\Downarrow \\ \frac{1}{H(s)^2}\frac{dH(s)}{ds} &= 0 \\ &\Downarrow \\ \frac{dH(s)}{ds} &= 0 \end{align}$$ A break-away point is defined as the point where the poles leave the real axis. Similarly, a reentry point is where the poles enter the real axis again. However, complex poles can still be kind of "breakpoints" elsewhere on the complex plane, and the above relation will still hold. Appendix For rational transfer functions, you can get to the equation in the question by calculating the derivative. $$H(s) = \frac{\prod_i (s-z_i)^{m_i}}{\prod_k (s-p_k)^{n_k}}$$ With \$k\$ and \$i\$ indexing all poles and zeroes respectively. \$n_k\$ and \$m_i\$ are the multiplicity of their respective pole or zero. $$\begin{align} \frac{dH(s)}{ds} &= \frac{d}{ds}\left(\prod_i(s-z_i)^{m_i}\right)\prod_k\frac{1}{(s-p_k)^{n_k}} + \frac{d}{ds}\left( \prod_k\frac{1}{(s-p_k)^{n_k}} \right) \prod_i (s-z_i)^{m_i} \\ &= \left( \sum_i \frac{m_i(s-z_i)^{m_i}}{s-z_i}\prod_{j\neq i} (s-z_j)^{m_j} \right) \prod_k \frac{1}{(s-p_k)^{n_k}} \\ &+ \left(\sum_k \frac{-n_k}{(s-p_k)(s-p_k)^{n_k}}\prod_{l\neq k} \frac{1}{(s-p_k)^{n_k}}\right) \prod_i (s-z_i)^{m_i} \\ &= \left( \sum_i \frac{m_i}{s-z_i} - \sum_k \frac{n_i}{s-p_k} \right) \frac{\prod_i (s-z_i)^{m_i}}{\prod_k (s-z_k)^{n_k}} \end{align}$$ So you finally get $$\sum_k \frac{n_k}{s - p_k} - \sum_i \frac{m_i}{s - z_i} = 0$$
H: MPLAB X XC32 - Peculiar build issue involving volatile variables I am struggling with an issue that is already costing me 2 days of productive work. The code of main.c at the end of the question is a stripped-down version of the entire project, and contains the relevant code related to the issue discussed. A brief summary of the entire setup: Microcontroller: PIC32MX250F128B PICkit3 MPLAB X v4.20 XC32 compiler v1.34 Windows 10 64-bit I have a project that involves receiving data over the UART and performing certain functions based on the data received. A software FIFO buffer is used to temporarily store the received data for processing (since the hardware FIFO is too small for the rate at which data is received). The soft FIFO gets populated with the received data by using an interrupt routine. I am experiencing a very peculiar issue when attempting to build the project (both in debug and release modes). At first I thought that the problem described below is due to a hardware issue (faulty PICkit3), but the problem persists even if I use the simulator instead of the PICkit3. Then I investigated into possible MPLAB X issues, but the same issue also persists in multiple versions of MPLAB X (I have tested this with v4.05, v4.15 and v4.20). I have also tested this in both Windows 7 and Windows 10, with exactly the same results. Upon further investigation, I have narrowed it down to the soft FIFO and the main() function in main.c. The soft FIFO is defined as follows (relevant snippets from main.c): /* Software FIFO buffer size */ #define FIFO_BUFFER_SIZE (2100u) /* Software FIFO buffer type */ typedef struct { char dataBuffer[FIFO_BUFFER_SIZE]; int firstByteIndex; int lastByteIndex; int numBytes; } SOFT_FIFO; /* Variables used with FIFO */ static SOFT_FIFO rxFifo = {{0}, 0, 0, 0}; static volatile BOOL fifoFlagBufEmpty = TRUE; static volatile BOOL fifoFlagFull = FALSE; static volatile BOOL fifoFlagOverflow = FALSE; Here is the part in main.c that I have further narrowed down to be related to the issue: void main(void) { char c; /* ... initialisation code is here (see full main.c file)... */ /* ... higher-level infinite loop is here (see full main.c file)... */ /* While there is data in the software FIFO buffer */ while (fifoFlagBufEmpty == FALSE) { /* Process data in the FIFO buffer */ c = getByte(); processGeneralMessage(&c); } /* while */ } /* main() */ Whenever I build the project for debugging (for both PICKit3 and the simulator), the entire build process just hangs and never completes. It has to be killed manually in the Windows Task Manager by terminating the "cc1.exe" process. After leaving it to try and build for more than 2 hours, I think it is pretty safe to come to the conclusion that it will not complete the build at all. The apparent cause of the issue seems to be related to how the variable fifoFlagBufEmpty is defined and declared. If I remove the "volatile" specifier from its definition: //static volatile BOOL fifoFlagBufEmpty = TRUE; /* Old definition */ static BOOL fifoFlagBufEmpty = TRUE; then the project builds perfectly and the debugger starts executing the code. If I put the "volatile" specifier back, the build hangs again and never completes. What is even more bizzare is that when I comment out any of the following two lines in the while block: c = getByte(); processGeneralMessage(&c); the project builds completely and start executing normally (just like when I remove the "volatile" specifier)! I have absolutely no explanation for why this is happening. The most frustrating issue is that I have this exact same definition and use of the soft FIFO in another project using another PIC (PIC32MX664F128H) and it works perfectly there. Can anybody please help me with this and identify why this is happening? Here is the full main.c file: /*------------------------------------------------------------------------------ Module : main.c Microcontroller : PIC32MX250F128B ------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------ CONFIGURATION BITS ------------------------------------------------------------------------------*/ // DEVCFG3 // USERID = No Setting #pragma config PMDL1WAY = ON // Peripheral Module Disable Configuration (Allow only one reconfiguration) #pragma config IOL1WAY = ON // Peripheral Pin Select Configuration (Allow only one reconfiguration) #pragma config FUSBIDIO = ON // USB USID Selection (Controlled by the USB Module) #pragma config FVBUSONIO = ON // USB VBUS ON Selection (Controlled by USB Module) // DEVCFG2 #pragma config FPLLIDIV = DIV_2 // PLL Input Divider (2x Divider) #pragma config FPLLMUL = MUL_20 // PLL Multiplier (20x Multiplier) #pragma config UPLLIDIV = DIV_12 // USB PLL Input Divider (12x Divider) #pragma config UPLLEN = OFF // USB PLL Enable (Disabled and Bypassed) #pragma config FPLLODIV = DIV_2 // System PLL Output Clock Divider (PLL Divide by 2) // DEVCFG1 #pragma config FNOSC = FRCPLL // Oscillator Selection Bits (Fast RC Osc with PLL) #pragma config FSOSCEN = OFF // Secondary Oscillator Enable (Disabled) #pragma config IESO = ON // Internal/External Switch Over (Enabled) #pragma config POSCMOD = OFF // Primary Oscillator Configuration (Primary osc disabled) #pragma config OSCIOFNC = OFF // CLKO Output Signal Active on the OSCO Pin (Disabled) #pragma config FPBDIV = DIV_1 // Peripheral Clock Divisor (Pb_Clk is Sys_Clk/1) #pragma config FCKSM = CSDCMD // Clock Switching and Monitor Selection (Clock Switch Disable, FSCM Disabled) #pragma config WDTPS = PS1048576 // Watchdog Timer Postscaler (1:1048576) #pragma config WINDIS = OFF // Watchdog Timer Window Enable (Watchdog Timer is in Non-Window Mode) #pragma config FWDTEN = OFF // Watchdog Timer Enable (WDT Disabled (SWDTEN Bit Controls)) #pragma config FWDTWINSZ = WINSZ_25 // Watchdog Timer Window Size (Window Size is 25%) // DEVCFG0 #pragma config JTAGEN = OFF // JTAG Enable (JTAG Disabled) #pragma config ICESEL = ICS_PGx1 // ICE/ICD Comm Channel Select (Communicate on PGEC1/PGED1) #pragma config PWP = OFF // Program Flash Write Protect (Disable) #pragma config BWP = OFF // Boot Flash Write Protect bit (Protection Disabled) #pragma config CP = OFF // Code Protect (Protection Disabled) /*------------------------------------------------------------------------------ INCLUDES ------------------------------------------------------------------------------*/ #define _SUPPRESS_PLIB_WARNING /* Suppress PLIB warnings */ #define _DISABLE_OPENADC10_CONFIGPORT_WARNING /* Suppress ADC warning */ #include <p32xxxx.h> #include <plib.h> /*------------------------------------------------------------------------------ DEFINES ------------------------------------------------------------------------------*/ #define SYS_CLOCK (40000000u) /* 40 MHz */ #define SYS_CLOCK_MHZ (SYS_CLOCK / 1000000) #define PB_CLOCK (SYS_CLOCK) /* Use system clock for peripherals */ #define BAUD_RATE_COMMS (19200u) #define UART_MODULE (1u) #define BRGH_BIT (FALSE) /* Missing interrupt defines in int_1xx_2xx_legacy.h */ #define mU1RXClearIntFlag() (IFS1CLR = _IFS1_U1RXIF_MASK) #define mU1RXGetIntFlag() (IFS1bits.U1RXIF) #define mU1RXGetIntEnable() (IEC1bits.U1RXIE) #define mU1RXIntEnable(enable) (IEC1CLR = _IEC1_U1RXIE_MASK, IEC1SET = ((enable) << _IEC1_U1RXIE_POSITION)) #define mU1RXSetIntPriority(priority) (IPC8CLR = _IPC8_U1IP_MASK, IPC8SET = ((priority) << _IPC8_U1IP_POSITION)) /* Logic state definitions */ #define HIGH (1) #define LOW (0) /* Software FIFO buffer size */ #define FIFO_BUFFER_SIZE (2100u) /* LED pin */ #define LED_PIN (LATBbits.LATB7) /*------------------------------------------------------------------------------ LOCAL DATA TYPES ------------------------------------------------------------------------------*/ /* Software FIFO buffer type */ typedef struct { char dataBuffer[FIFO_BUFFER_SIZE]; int firstByteIndex; int lastByteIndex; int numBytes; } SOFT_FIFO; /*------------------------------------------------------------------------------ LOCAL FUNCTION PROTOTYPES ------------------------------------------------------------------------------*/ static unsigned int calcBRG(unsigned int baudRate, BOOL BRGH_bit, unsigned int clk); static void initUART(unsigned int channel, unsigned int baudRate, BOOL BRGH_bit, unsigned int clk); static void initMain(void); static void configureInterrupts(void); static char getByte(void); static void processGeneralMessage(unsigned char *c); /*------------------------------------------------------------------------------ GLOBAL VARIABLES ------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------ LOCAL VARIABLES ------------------------------------------------------------------------------*/ static char rxData; static BOOL byteReceived = FALSE; static int rxCount = 0; static SOFT_FIFO rxFifo = {{0}, 0, 0, 0}; static volatile BOOL fifoFlagBufEmpty = TRUE; static volatile BOOL fifoFlagFull = FALSE; static volatile BOOL fifoFlagOverflow = FALSE; /*------------------------------------------------------------------------------ GLOBAL FUNCTION DEFINITIONS ------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------ Function : main Purpose : Entry point of the system. Parameters : None. Returns : None. Notes: : None. ------------------------------------------------------------------------------*/ void main(void) { char c; /* Initialise the system */ initMain(); /* Wait for commands from the user interface */ while (1) { /* While there is data in the software FIFO buffer */ while (fifoFlagBufEmpty == FALSE) { /* Process data in the FIFO buffer */ c = getByte(); processGeneralMessage(&c); } /* while */ } /* while */ } /* main() */ /*------------------------------------------------------------------------------ LOCAL FUNCTION DEFINITIONS ------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------ Function : initUART Purpose : Initialises the UART peripheral. Parameters : channel - which UART channel to initialise. baudRate - baud rate used for UART comms BRGH_bit - bit to indicate high/low speed baud rate generator clk - clock speed of the PIC Returns : None. Notes : None. ------------------------------------------------------------------------------*/ static void initUART(unsigned int channel, unsigned int baudRate, BOOL BRGH_bit, unsigned int clk) { /* Enable UART, BRGH = 0, simplex, RX idle LOW, 1 stop, no parity */ unsigned int uxMode = 0x8800; /* Enable RX & TX */ unsigned int uxSta = 0x1400; unsigned int brg; brg = calcBRG(baudRate, BRGH_bit, clk); switch (channel) { case 1: U1BRG = brg; U1MODE = uxMode; U1STA = uxSta; break; case 2: U2BRG = brg; U2MODE = uxMode; U2STA = uxSta; break; #if (UART_COUNT_MAX >= 3) case 3: U3BRG = brg; U3MODE = uxMode; U3STA = uxSta; break; #endif } /* switch */ } /* initUART() */ /*------------------------------------------------------------------------------ Function : calcBRG Purpose : Calculates the BRG value required for the UART baud rate generator initialisation. Parameters : baudRate - baud rate used for UART comms BRGH_bit - bit to indicate high/low speed baud rate generator clk - clock speed of the PIC Returns : BRG value Notes : The formula used to calculate the BRG value is obtained from the PIC32 Family Reference Manual, sect. 21 (UART) - in section 21.3. ------------------------------------------------------------------------------*/ static unsigned int calcBRG(unsigned int baudRate, BOOL BRGH_bit, unsigned int clk) { unsigned int BRGval; if (BRGH_bit == FALSE) /* low speed baud rate generator used */ { BRGval = (clk / (16 * baudRate)) - 1; } else /* high speed baud rate generator used */ { BRGval = (clk / (4 * baudRate)) - 1; } return BRGval; } /* calcBRG() */ /*------------------------------------------------------------------------------ Function : initMain Purpose : Main initialisation routine. Parameters : None. Returns : None. Notes : None. ------------------------------------------------------------------------------*/ void initMain(void) { /* Initialise the system clock */ SYSTEMConfigPerformance(SYS_CLOCK); /* Initialise the UART peripheral */ initUART(1, BAUD_RATE_COMMS, FALSE, PB_CLOCK); /* Configure interrupts */ configureInterrupts(); /* Disable JTAG */ DDPCONbits.JTAGEN = 0; TRISBbits.TRISB7 = 0; /* LED pin - output */ U1RXR = 0x00; /* U1RX on RA2 */ RPB3R = 0x01; /* U1TX on RB3 */ } /* initMain() */ /*------------------------------------------------------------------------------ Function : configureInterrupts Purpose : Configure the interrupts used in this module. Parameters : None. Returns : None. Notes : None. ------------------------------------------------------------------------------*/ static void configureInterrupts(void) { /* Configure UART interrupt */ mU1RXSetIntPriority(1); INTEnableSystemMultiVectoredInt(); mU1RXIntEnable(HIGH); mU1RXClearIntFlag(); } /* configureInterrupts() */ /*------------------------------------------------------------------------------ Function : getByte Purpose : Retrieve the next available data byte from the FIFO buffer. Parameters : None. Returns : Data byte. Notes : None. ------------------------------------------------------------------------------*/ static char getByte(void) { char byteValue = -1; /* If data exists in the buffer */ if (rxFifo.numBytes > 0) { byteValue = rxFifo.dataBuffer[rxFifo.firstByteIndex]; rxFifo.firstByteIndex++; rxFifo.numBytes--; //rxFifo.lastByteIndex--; } /* NOTE: this condition should actually never be reached */ else /* If the software FIFO buffer is empty */ { asm("nop"); /* TODO: Doen dalk iets hier? */ //fifoFlagBufEmpty = TRUE; /* (Now it IS empty) */ //return byteValue; /* with value = -1, indicating no data */ } /* If the software FIFO buffer is empty, after the above read */ /* This is the same as (numBytes == 0) */ if (rxFifo.firstByteIndex == rxFifo.lastByteIndex) { fifoFlagBufEmpty = TRUE; /* Note that numBytes should now also be 0 */ } /* If the index has reached the end of the buffer */ if (rxFifo.lastByteIndex == FIFO_BUFFER_SIZE) { rxFifo.lastByteIndex = 0; /* Roll-over the index counter */ } /* If at the end of the buffer */ if (rxFifo.firstByteIndex == FIFO_BUFFER_SIZE) { rxFifo.firstByteIndex = 0; /* Roll-over index counter */ } return byteValue; } /* getByte() */ /*------------------------------------------------------------------------------ Function : processGeneralMessage Purpose : Process general incoming messages from console system. Parameters : c - pointer to one byte of the incoming message. Returns : None. Notes : None. ------------------------------------------------------------------------------*/ static void processGeneralMessage(unsigned char *c) { LED_PIN ^= 1; /* Toggle the LED pin */ } /* processGeneralMessage() */ /*------------------------------------------------------------------------------ Function : uartRxInterruptHandler Purpose : Interrupt handler for the UART receiver. Parameters : None. Returns : None. Notes : None. ------------------------------------------------------------------------------*/ //void __ISR(_UART1_RX_IRQ, ipl1auto)uartRxInterruptHandler(void) void __ISR(_UART1_VECTOR, ipl1auto)uartRxInterruptHandler(void) { /* If software FIFO buffer is full */ if (rxFifo.numBytes == FIFO_BUFFER_SIZE) { fifoFlagOverflow = TRUE; } /* If the software FIFO buffer is not full */ else if (rxFifo.numBytes < FIFO_BUFFER_SIZE) { /* Read a byte from the UART receive (hardware) FIFO */ rxFifo.dataBuffer[rxFifo.lastByteIndex] = U1RXREG; rxFifo.lastByteIndex++; rxFifo.numBytes++; } /* If buffer has now been filled up after the byte read above */ if (rxFifo.numBytes == FIFO_BUFFER_SIZE) { fifoFlagFull = TRUE; /* TODO: Besluit nog wat hier gedoen moet word */ } /* TODO: skuif hierdie iewers anders heen om reg te hanteer */ fifoFlagBufEmpty = FALSE; mU1RXClearIntFlag(); } /* ISR */ AI: It seems that the culprit is the fact that the variable c in main() is not initialised. After initialising it at its declaration, it builds fine as normal. It would still be enligthening to understand what actually went wrong.
H: What is the point of Geiger counter calibration? I understand that the three ways Geiger counters can be calibrated are electronic calibration and energy calibration, which both use a pulse generator, and radiological calibration which uses a check source. Electronic calibration simply involves sending pulses to the Geiger counter, which registers them as counts. But why is this necessary? I thought every ionization in the Geiger–Müller tube registered as a count anyway, without the need for calibration using electrical pulses beforehand. So what is there to calibrate? One ionization always equals one count. Radiological calibration involves exposing the Geiger counter to a radioactive check source and setting the Geiger counter's measurement of the radioactivity to match the actual known radioactivity of the check source. But instead, why not simply program the Geiger counter to know that x cpm from a particular source = x µSv/h as detected by a particular model of Geiger–Müller tube? I sort of understand the usefulness of energy calibration; I understand that it determines the voltage threshold for each ionization; but I cannot see the point of the other two methods. AI: First of all, the answer lies in the very principle of a measurement. When you measure something (anything, even weight, length etc.) you actually compare the measured parameter of the object to another object (a standard) with known parameters. The same applies to radioactivity (cps) or any other parameter/measurement for that matter. This also means that it's impossible to take an "absolute" measurement of anything. The other problems you seem to neglect is the problem of noise and aging/change of your measuring instrument. Noise is something that always has to be accounted for, otherwise you'll end up "measuring" values which bear no meaning whatsoever (as they contain random "information" that's the noise itself) or end up with "glitches" in your measurements (and might even draw wrong conclusions from them). To translate this into your question: one count might not always be one count, because of the noise present in the instrument (both in the physical and the electronic part). Aging is something that's particularly of concern with equipment dealing with radioactive radiation. Since such radiation is an "ionizing" one, it means that the very exposure to such source of radiation causes electrons to be kicked out of the instrument's material (which sometimes leads to permanent changes in the material structure). The other cause of aging of these materials is the very environment we live in. Just consider this: ~21% of the atmosphere we live in consists of a very reactive gas called oxygen. The other problem lies in the fact that literally everything is covered in a thin layer of water (a layer so thin that it can't be seen with the naked eye but causes problems in atomic force microscopy). Since most of the elements on Earth are at least somewhat reactive (with the exception of gold and platinum), they enter into chemical reactions with the water, the oxygen or other materials in the air (CO2, the sulfides causing the tarnishing of silver etc.) and thus the materials change as the result of these reactions. This will cause instruments to "go out of tune", their signal-to-noise ratio to decrease and other effects that cause instruments to go out of calibration. Moreover Geiger counters are really precise instruments that are some of the most sensitive devices out there. This means that even really small changes will have a noticeable effect on their calibration.
H: question about Vivado synthesis and implementation I use Vivado to program my Basys-3 card and I have a quick question about Synthesis and implementation. I noticed that when Vivado knows the inputs of an entity, it calculates the result directly and this calculation is not done on the FPGA core. For example, I have an encryption algorithm that takes the encryption key and the plain text as input and returns the encrypted text as output, if I declare two signals equal to the key and the plain, the encryption calculation will not be done on the card but at the time of synthesis. Is there any way to disable Vivado's "behavior"? AI: There are attributes that can be used to turn off bits of logic optimisation? These tools are REALLY good at eliminating unused logic and at simplifying the logic that is used, and you want them to be good at that stuff. Attributes are somewhat implementation defined, for Vivado see UG901 chapter 2 in particular the "dont touch", and maybe the "keep" attributes.
H: Optimization of Vivado synthesis I am currently using Vivado to develop several FPGA designs, and I am wondering if the components numbers given during Synthesis are optimal. I mean, are there some ways to optimize the synthesis, in order for example to reduce the number of LUT or FF used by the FPGA ? AI: They are pretty close for the exact thing you describe, but often writing something very slightly different but with the same essential behaviour will get you a smaller or faster design. For example on a 7 series device, there are multiple registers per slice but they share a clock and IIRC also reset and set, so there can be opportunities to improve the packing is what you have is pathological, then there are neat tricks like the availability of the SRL16s (16 bit shift register implemented as an alternative use for a LUT, but it has some constraints, very efficient when the tool can use it, but that depends on how you write the code). You need to respect the details of whatever architecture you are targeting if you want to write efficient hardware because (for example) not paying attention to the need for (at least) a sum of products register in a DSP48 will cause it to run very slowly, the details of the chip architecture really matter. The general FPGA tradeoffs are area for speed, and clock speed for latency, you can do a lot but you have to think like a hardware designer not a programmer, it is the classic newbie mistake for people coming from the software side. In software you tell a pre defined CPU what to DO (in, usually, a mostly sequential manner), when designing hardware you are telling a sea of gates what to BE, it is a fundamentally different outlook. UG901 is a good starting point, also UG474 or the equivalent for whatever family you are using.
H: How was this formula of voltage on capacitor achieved? We know that voltage across a capacitor is given by But there is this other formula How this second formula was deducted mathematically from the first one? or from another one? AI: Let I_r be current in the resistor = Vc/R at any time. Vc = Q/C from the basic definition of capacitance. dQ/dt = -I_r = -Vc/R From the basic definition of current. dQ/dt = -Q/CR Apply initial conditions, Q at time 0 = Vs * C and do trivial calculus, then substitution to get Vc in place of Q.
H: What does "minimum etch technique" refer to in PCB layout/design? in the application hints for an ADC (AD7927 page 26) it says: The printed circuit board that houses the AD7927 should be designed such that the analog and digital sections are separated and confined to certain areas of the board. This facilitates the use of ground planes that can be separated easily. A minimum etch technique is generally best for ground planes as it gives the best shielding. What do they mean by ground planes that can be seperated easily? And what is a "minimum etch technique"? AI: "etch" here refers to "area etched free of copper"; in other words: the note recommends that you use ground planes as large as possible.
H: Why does my LED strip list maximum power as 45W while the LEDs added makes 37.5W? My 5-meter LED strip with 30 WS2812B per meter lists "Maximum power: 45W". However, if I calculate it I get: WS2812B max current draw * voltage * number of LEDs = 50 mA * 5 V * 150 = 37.5 W Is the rest of the power due to voltage drop along the wires? Do regulations require a margin of error? Is there any other effect that I'm not taking into account? AI: They are calculating the max current draw per segment at 60 mA not 50.
H: Can anyone ID this 3 pin plug? This connector is out of a Sega Dreamcast. I need a new wiring harness but can't find out what this plug is. The plug is 6.54mm wide, 3.42mm high (excluding the "key" 4.08 with the key), 6.48mm deep. I can just about make out the letters JST, but very small. I can't get the camera to focus. AI: Incase anyone is looking for a dreamcast fan plug in the future I can confirm it is a JST PH. Thanks everyone.
H: What is a reasonable way to connect small wires? These wires will carry up to 1.5A at 5V outdoors in clear weather. Would it be reasonable to connect them by simply taping them together with electrical tape? I'm new to electronics outside of embedded programming and simple Arduino prototyping, so I wanted to check that I'm not running into any safety issues. Hope this is on topic and not too basic. AI: For a good connection that can withstand lots of movement/bending, use: Solder Crimp terminals (either permanent "butt" connectors, or male and female terminals if you want to connect and disconnect) Screw terminals ("terminal block") (Image from pixabay.com) (Image from wikipedia.org) For a more temporary connection that is quick to add/remove: Use spring-loaded terminals (Image from dhgate.com) For a hack that will work in a pinch but destined to eventually fail under light abuse: Twist the wires together and add wire nuts or tape. (Image from cnc-plus.de) This is all under the preface of "clear weather" as you had stated. Note that while weather can be "clear", hidden moisture in the air can still accelerate corrosion/rust over time, depending on the metals involved. Corrosion can lead to shorts or opens.
H: Equivalent Inductor Equation (Antoniou Gyrator Proof) I've been working on a proof for University and I've been able to understand most of what I was asked, but I'm having trouble understanding why is it that the equivalent inductor in an Antoniou Gyrator has inductance L = (R1*R3*R5*C4)/R2, referring to the image below. I've understood the parts of the proof concerning the differentiator and the operational amplifiers and I have almost closed my reasoning, but I don't precisely understand why that equation works out to be that way. From what I've understood, R5*C4 is the gain of the differentiator, but other than that, I don't know where the equation comes from. Can you guys help me on this? Any tips? I looked at the other question on here about this type of gyrator, but it didn't answer my specific question. Thank you! AI: simulate this circuit – Schematic created using CircuitLab The figure shows two NIC circuits (NIC=Negative Impedance Converter). NIC 1 is short circuit stable (a low source resistor at "in1" makes the circuit stable; negative feedback dominates). It is relatively simple to derive the input impedance at "in1" as Zin1=-\$\frac{Ro.R2}{R3}\$. NIC 2 is open-circuit stable (100% negative feedback; a large source impedance at "in2" is required.) The input impedance at "in 2" is Zin2=-\$\frac{R4.R6}{R5}\$. Now, if you replace the grounded resistor Ro by the input resistance Zin2 the whole circuit remains stable because the negative input impedance Zin2 is "far beyond" infinite. A mathematical proof is possible. That means: The inverting node of NIC1 is now connected with the inverting node of NIC2 (and Ro is removed). Therefore, the resulting input impedance "in1" will now be: Zin1=Zin=+\$\frac{R2.R4.R6}{R3.R5}\$. This is the basic form of a "Generalized Impedance Converter GIC". This two-opamp block can be used to create an active grounded inductor (replace R3 or R5 by a capacitor). In many cases, such a GIC is also used to realize an FDNR (Frequency-Dependent Negative Resistor) . A better circuit arrangement (Antoniou`s circuit): The discussed circuit will work - however, it was shown, that a modification (proposed by Antoniou) has better properties because the opamps non-idealities cancel each other up to a certain degree (higher frequencies possible). The new circuit (Antoniou`s GIC block) can be explained as follows: For quasi-ideal op-amps both non-inverting input nodes (of the basic GIC) have the same potential because the voltage across the op-amp´s input nodes is assumed to be zero. Hence, the positive input nodes can be exchanged against each other. That`s all. When you redraw the circuit (without any line crossings) you will arrive at the circuit arrangements as shown in the original question. Of course, the expression for the input impedance remains unchanged. Replacing R3 or R5 with a capacitor (Z:1/sC),thus, allows you to realize a grounded inductor. The value of the inductance can be selected with 4 resistors and/or one capacitor.
H: Operational Amplifier Integator I want to design op amp integrator circuit with variable time constant using a simple switch. What is the typical shunt capacitance of a switch? I assume Ron of switch to be less than 5 Ohms. I want switch to minimally effect overall feedback capacitance. I am not worried about transient response when capacitor are switched. Any suggestions on the design? Thank you all for your suggestions. AI: It appears sound. I'll just assume you calculated your time constants correctly, as you don't list any design goals. Just to avoid noise, though, I'd suggest moving the switch to where the caps join the output (the switch is larger, and you may not want the noise it picks up on your virtual ground). You also might want to eliminate the "switch glitch" where both caps are switched out, by hardwiring the 47pF and switching the 680pF in and out. This has the additional advantage of requiring only an SPST switch and thus reducing routing (and as such noise).
H: Why use DDR instead of increasing clock speed? Why would you want to use DDR ram and read/write on every rising and falling edge of the clock instead of just doubling your clock speed and read/write on just one of either the rising or falling edge? Are there pros and cons to each? AI: With SDR, there are two clock edges per bit, but only at most one edge on the data line. With high frequency communication, the analog bandwidth limits how close you can put edges together on any given wire. If your clock signal hits that limit, you're wasting half of the bandwidth of the data wires. Therefore, DDR was invented so that all of the wires hit their bandwidth limit at the same bit rate.
H: What is the best way to search components I am a student of Electronic Engineering and right now I am doing my practicing in a company. When I was in the university, I have no problem searching a component, but here in the company needs sometimes normal elements (Level Converters, resistors, capacitance, Reductor DC-DC, etc) but with very good performance, one of my task now is to find a Level Converter with a very high response (at least better of 10ns) and I searched a lot, but I didn't find anything with this characteristic. However, I think that it has to exist to FPGA or CDML very fast. Maybe the question is very stupid for some people, but there is a better way to find this components that just google it? I mean, when I was searching that, I putted on Google "Level Converter High response" and searched the most important links and also I was searching in Digikey but I find its Search complicated and I didn't find a better Level Converter that I already have. How do you search for parts? AI: I search in this order (usually): Distributors (Digikey, Mouser, Newark, Arrow, Ect) It's easier to find information and search multiple sources by using a distributor. Digikey has the best and easiest database to search, then mouser. If I can't find the part there, or analog parts are easier to search manufacturers, For analog parts I search linear\Analog.com, TI.com, and then other suppliers. Octopart.com is becoming better all the time at finding parts. There are some parts that can only be found using a google search, but google isnt' specific enough when it comes to searching parts most of the time.
H: Examine rectified voltage before and after I built a simple bridge rectifier. simulate this circuit – Schematic created using CircuitLab I connected the output of the function generator with CH1 of my oscilloscope and with the input of the rectifier (using a T-Piece). The output goes into CH2. The original wave looks like this: After connecting CH2 the picture looks like this: While CH2 looks good, CH1 now shows the wave I would expect without capacitator but not the expected original wave. Could somebody explain why? I'm using a Gwinstek GDS-1072A-U Oscilloscope and a Gwinstek SFG-1003 function generator. AI: Your oscilloscope ground connections are shorting out one of the bridge rectifier diodes (D4 by the looks of it). Oscilloscope inputs share a common ground connection unless you are using special differential probes.
H: Need help to find replacement for power mosfet IRF7303 I have to design a voltage regulator circuit using DC-DC controller MAX1655. Required voltage output from the circuit is 3.3V at 2A (circuit is shown at page 10 of datasheet). According to the datasheet for MAX1655 (at page no- 11) i have to use IRF7303 or NDS8936 as mosfet in the circuit. After looking up on the internet i found that NDS8936 is obsolete/not manufactured anymore.But i am unable to confirm whether IRF7303 is locally available at my place. Questions: 1)I would like to know if any functionally equivalent mosfet for IRF7303 exists so that i can use in this circuit(for output 3.3V at 2A)? 2)Does the complete circuit using DC-DC controller MAX1655 work as a voltage regulator(Can it handle changes in input voltage)? AI: The IRF7303 is available here on DigiKey. I don't know if that works for you since you said you want it locally... 1)I would like to know if any functionally equivalent mosfet for IRF7303 exists so that i can use in this circuit(for output 3.3V at 2A)? If you were to use a different MOSFET, page 22 of the datasheet gives you some guidelines you should follow: Based on that, you should be able to find a suitable Mosfet on DigiKey o somewhere else. For example, the SH8K1 (which I found on a really quick search, didn't give too much thought to all the tradeoffs you may want to consider) seems like a good choice. This is it on DigiKey. There tons of options, this is not meant to be a unique solution—just to give it some context. The SH8K1 is comparable to the IRF7303. It has lower gate charge specs than the IRF7303 (the datasheet for your voltage controller recommends < 70nC). Also, the current and voltage specs for the transistors are similar—and they come in a similar package (dual N channel mosfets). 2)Does the complete circuit using DC-DC controller MAX1655 work as a voltage regulator(Can it handle changes in input voltage)? Yes. On page 11 it says that the range for your settings (3.3V @ 2A) is between 4.75V to 28V. The upper limit is depends on the Mosfet you choose (e.g 30V) like the IRF7303 and SH8K1.
H: LM833N OP AMP Configuration Help I am using this Chip: LM833N to essentially trying to Half Wave rectify my low AC signal input ~1.36Vp. Using it in this configuration for now to get things started (Ignore the part number). CH1 is the input and CH2 is the output, noted this is while the OP AMP is turned off. (Image Above). Once the OP-AMP is turned on this is the result, CH2 is a flat Rectified line? Here's the schematic simulate this circuit – Schematic created using CircuitLab I used the Green output of my single power supply as the ground, and connected the black output to -VEE. Picture for reference: Any light/clue onto the situation would be greatly appericiated, I am sure this isn't working as indeed. AI: Well, your "off" picture is explained by the input voltage passing unimpeded through the two 10K resistors. It doesn't go below GND due to the protection diodes, but if your VCC is floating, that'll float enough to let positive excursions through. Not sure about your DC output, though...I can't troubleshoot it without some probing, but it's probably because the 833 doesn't support rail-to-rail input, so you have to keep the inputs within the common mode voltage range. At +/-15V supply that's +/-12V worst case. You'll have to use a rail-to-rail input op amp (or at least one that can take 0V relative to VEE) or switch to a more complex circuit.
H: reverse engineering the Nord Lead 4 control board I am reverse engineering a synthesizer named nord lead 4. I want to tap in between the control board and mainboard which has the microprocessor. i didn’t started with the powered on analysis but i am making a map of the connections and getting to know the IC’s. I figured out all the pins of the 26 pin cable between the control board(which has potentiometers and two leg switches and 7 segment led displays etc.). This board has also the IC’s that i am interested 3 ADC ‘s (max1039) a mux/demux(hc4052) 2 octal bus trancievers(lc245a) and probably for the seven segmented displays 6 flipflop IC’s(hct374) and one demux(lvc138a). I also figured out all the selects and connection between the ADC’s and the mux/demux hc4052. This is mostly all i understand from topology until now. My question is about the switches. There are around 34 switches in this control board(the ones you press with your finger they are momentary switches) they have two legs when you press there is a connection created between the two legs ofcourse. These switctches are distributed to 8 busses of the octal tranciever(lc245a) and those busses sent to the other board which has the microprocessor. So multiple switches are on the same bus. Do you have an idea how this machine reads them and know which is which? Does this topology seem familiar to you? Thank you very much Please tell me if you need more info. *i hope i put the right tags to the question AI: You can identify and match functions to pins. Only the OEM designer knows how they are read into memory. Usually by a chip select to enable bus side read. From ‘138 8 switches need 3 bits to address. 32 switches need 5 bits to address. 38 switches need 6 bits to address. Or 8 bits as done here. This can be done with 3 bits to ‘138 and 3 more bits from CPU using matrix array if switches are not grounded. This uses typical low to select 1 of 8 rows and “1” to bias 5 Columns with diodes or in software input open cct or output=1. Thus 3+5 software switches = 8 bits from CPU during port 8 address bits then read switches like RAM. Or any variation of this. CPU inputs 3 but address to ‘138 decoder to select 1 of 8 latches in a sequential manner as fast as it needs to. Classic bus MUX.
H: Noise on the whole board after USB connection I designed a device on which there is a HUB, FT232 , two external USB port and some periphery. I wanted to check the noise on the power bus. And I saw only white noise. But after I connect the USB cable, I see on ALL circuit this is an noise. Most likely it is common mode noise from fronts D+/D-, because if I connect only the VBUS and the GND noise disappears. How terrible is this noise? How can i get rid of this noise? AI: Here is my take at this "USB problem". First, the noise, as shown, is a typical noise from an on=board DC-DC switcher, with ~400 kHz switch rate, which has no relation to USB signaling. It is very likely that this is an emitted noise from switcher magnetics and/or poorly-designed high-current loops. The noise might be real, or might be just a loop pickup on sloppy scope probe connection, and it might have no effect on actual functionality. Here are some very useful references on ho to deal/avoid switching noise in DC-DC converters, from TI appnote, and from "Power Electronics News" Why there is no spiky noise when only power is applied? When a USB design is powered up but no D+/D- activity exists, all USB IC fall into "SUSPEND" state by design, and therefore consume little-to-no current. When power consumption is low, modern switchers usually turn into some pseudo-LDO mode, and don't switch. My guess is when D+/D- are connected and all on-board USB ICs wake up due to USB traffic, they begin consuming current, and the switcher starts switching and produces these EMI spikes. First, you need to check your measurement technique, and use a correct one: Second, check your on-board switcher if the layout is done in good accord with manufacturer's suggested plan. Then,... it depends.
H: Large amount of heat generated by AC to DC power supply I purchased this power supply: https://www.amazon.com/Yes-Original-Power-Supply-Security-Camera/dp/B078MN4XQG/ref=sr_1_3?ie=UTF8&qid=1530044862&sr=8-3&keywords=CCTV+Security+Camera+18CH+12V+15A+180W&dpID=51SEIcuz4xL&preST=_SX300_QL70_&dpSrc=srch I am running about 15m of LED lights that are rated at a working current of 0.35-1.2A per meter. In reality they seem to pull more like .6A per meter. I estimate the total current drain to be between 8 and 10 amps. This is well under the rated max for this unit. The unit however gets very hot. Outside of the metal case reaches 120-135F inside 180 to 195F. These seems VERY hot for this small of a load. I can only imagine how much energy is going up in heat. The entire reason I purchased a more expensive supply would be for the advertised 89% effecenty. I don't know electronics or physics well enough to know how much heat should be generated by the dissipation of an amp of current. I was hoping someone could tell me if this power supply is broken, or if this is what is to be expected. -----------------Update------------------- I'm not sure what I did, but all of this is due to wiring. I THINK this is what I had wired: https://www.tinkercad.com/things/5FPIjvucQ46 However, the drain of each is screwed into the box, no guarantee that they aren't shorted against one another. This: https://www.tinkercad.com/things/9SnoHMoNnBh Seems to be what I should have done. I think the wiring was somehow causing an overload, and it to pull more current that just for the LEDs. I have it re-wired and it is running at about 140F inside and 90F outside. AI: 150°F (65°C) is not an excessive temperature for a power supply. You have the supply enclosed in a box where the ambient will continue to increase. As diffidence between the power supply and ambient decreases (ambient increasing) thermal convection to cool the power supply will decrease. It's running at about 120 watts. Can't get much more inefficient that an incandescent bulb, and this thing seems to be running hotter than a 100w bulb. Your reference to a 100 W light bulb is appropriate. Put a 100 W light bulb in a closed box and you have an easy bake oven. A 100 W bulb gets very hot like 4000°K filament. A fan from the box or mounting the power supply to the enclosure so it can conduct heat away for the supply would be suggested. A small, very quiet fan like the $9 12V, 13.5 CFM, 30 dB Sunon HA60151V3-E01U-A99 would likely be sufficient. I did not see where the ad you reference specified an efficiency. Actual efficiency peaks at a specific capacity like 95%. Actual is generally less. I find many of the vendors on Amazon lie about such things so I would doubt you have 89% efficiency. I recommend Mean Well power supplies for pricing, reliability, warranty, efficiency, and distribution. LINK: Standard LED driver catalog. UPDATE even at 80% efficiency, that would be a 38 watt bulb, not a 100 watt. I think that would be far too low to generate this temperature level. The point is heat is being generated with nowhere for it to go. The PSU heat must have a path to the outside air. The current heat transfer path is by natural convection from the PSU to the air inside the box. Then conduction from the air inside the box through the steel sides of the box. Then finally natural convection from the outside surface of the box to the outside air. The highest thermal resistance is the air between the PSU and the sides of the steel box. Natural convection cooling between the air in and outside the box requires a difference in temperature to be effective. The air temperature in the box has to rise to high enough for the difference between the air out side the box is high enough for natural convection cooling to the outside air. As the temperature of the air inside the box rises the convective heat transfer from the PSU to the air diminishes and the temperature of the PSU rises. The problem is the heat transfer from the inside air to the outside air is too inefficient. So either you mount the hot part of the power supply to the box to use conductive heat transfer to the outside of the box and/or improve ventilation which may required forced convection with a fan.
H: Measuring Current Using A Resistor? Sometimes in videos made by the YouTube creator ElectroBOOM the creator says he is using a 1 ohm series resistor to measure current. I looked it up and found some links to forums where people are saying that you can use a resistor rather than a DMM to measure current, but I can't find anything saying how to do this. Are they usimg the voltage drop across the resistor from a voltmeter or are they doing something else? AI: Yes, you can use a resistor and voltage range on a multimeter (to measure the voltage across the resistor) and calculate I = V/R. That can be useful if you need to measure current outside of the range of your meter. For example, if you need to measure 100A you could use an inexpensive 100A shunt and a multimeter on voltage setting. The meter might read 75mV for 100A (assuming a 75mV shunt), so on the 199.9mV range you can read with a resolution of 130mA up to +/-100A. In the case of shunts, the resistance (0.75m ohm) is not usually given, rather the voltage at the measuring terminals at full rated current is given. In most cases you can assume the meter impedance does not affect the measurement (shunt) resistor, but not always. For example if you need to measure 1nA and you just have an inexpensive handheld multimeter with 10M ohm input impedance on the +/-199.9mV range you can just use the meter on voltage range as a current meter. It will read 10.0mV for 1.00nA, giving you a resolution of 10pA.
H: Verify bias voltage with no load I have a device that can be configured to maintain a specific bias voltage on the output. How should I verify if it actually generates that specific voltage? I do not think I could simply use a multimeter to measure that voltage. Instead, I thought I should use a resistor on the output of that device and then measure the voltage across it. Is that necessary? AI: If your goal is to measure the no-load voltage, for most cases you can simply use the multimeter. When set for "DC volts", a multimeter already contains a built-in resistor in the megaohms range, so only a tiny amount of current will be drawn from your output. Unless your circuit is very sensitive or is operating in the microamps range, the current drawn by the meter will have a negligible effect. If you add your own load resistor, its resistance will be in parallel with the meter's own internal resistance.
H: variable regulation source I am learning electronics and I want to make a , variable regulation source for a soldering iron, which works at 50W, how much voltage and amps should have the output? For the soldering iron works correctly AI: Every Load has its recommended applied power. Some works by applying AC voltage and other works by applying DC voltages. First you have to determine which coil you will use to know its applicable Amp, Voltage. you want it to be 50 Watt so you have to choose a coil that consume V(voltage) x I(current) = 50 watts. Also you have mentioned that your regulation source is going to work only for supplying the heating element of the soldering wire "Coil". why you are going to use a variable regulation source? to learn how to design your regulation source refere to the following links. Basic Power Supply Application Guide How to design and build a linear power supply How to design a regulated power supply
H: Measuring crystal drive strength without a current probe TL;DR Is there a means of measuring the crystal drive level reliably using voltage measurements (even with a differential voltage probe)? Background: I am attempting to measure the crystal drive strength in order to ensure that it is not exceeding its rated power of 100uW. Every application note I have read on the subject says to measure with a current probe and calculate from there. Unfortunately, I don't have a current probe capable of measuring this signal. Is there any other means of measuring the crystal drive level reliably using voltage measurements (even with a low-capacitance differential voltage probe)? Coarse accuracy (say 25%) is fine - if I'm not that far below the max drive strength, I would concerns about the design in any case. For example, would it be valid to measure the voltage across a small "R_Q" (e.g. 1R) on the below diagram? What pit-falls are there in using a method like this? AI: Next time, I should read those application notes a little more carefully :) The STM32 Crystal Application Note AN2867 offers an alternate method in Section 3.5.2: This current can be calculated by measuring the voltage swing at the amplifier input with a low-capacitance oscilloscope probe (no more than 1 pF). The amplifier input current is negligible with respect to the current through C_L1, so we can assume that the current through the crystal is equal to the current flowing through C_L1. That is, measure the voltage at the non-inverting input to the amplifier (across capacitor C_L1), because the current through the load capacitor is essentially the same as the current through the crystal (since the amplifier is high-impedance). The drive level can then be estimated as: $$ DL= \frac{ESR \times \left(\pi f C_{tot} \right)^2 \times \left(V_{pp}\right)^2}{2}$$ where $$ C_{tot} = C_{L1} + C_{s}/2 + C_{probe} $$ and ESR is from the crystal, Cs is the board stray capacitance, C_probe is the capacitance of the probe leads, and f is the frequency of operation. I have not been able to verify this method against the current probe measurement, but it gives sensible values for an NXP S32K development kit (i.e. an 8MHz crystal with a measurement of 0.6Vpp gives a power estimate of 6uW).
H: Relay model for controlling the Air Conditioner power supply I am trying to control my Air conditioner via MQTT protocol. I just want to make the power on and off. How can I calculate the relay current rating for 1126 Watts of power? Link to AC model: https://www.amazon.in/Voltas-1-2-Split-155-CY/dp/B00LWRDJEE Also which is better for this application ( SSR/electromechanical relay). Experts please, Help. AI: Assuming you are using a 220VAC mains supply, 1126 Watts will consume about 6 Amps of current, you can calculate it from the following Online Calculator. Average mechanical relay have a life cycle of 100,000 cycles which means it can be used for a long period of time. Also its not mandatory to use the fast response of the solid state relay. Because your application is going to switch the air conditioner on and back off once every half an hour. The starting current of AC motor is usually 2 - 2.5 times the running current, which is equal to 15 Amp. So a typical 220VAC 20Amp mechanical relay will fit your application well.
H: How can I replace an electret microphone with a dynamic microphone in the Velleman voice changer circuit? I am attempting to build the MK171 Velleman voice changer, but with a 1/4" microphone socket for a dynamic microphone instead of the electret microphone which is attached to the board as standard. I've done some googling and apparently omitting R6 will mean that the microphone no longer gets the power that the electret microphone needs, but the dynamic microphone does not. The googled answers seem to suggest it will still not be ideal, without offering any means to improve it. I'm not sure if there is anything that can be done, or indeed what (if anything) I need to consider here. Do I need to amplify the signal via an op amp or similar, or is there something else that needs to be modified to supply the right signal to the IC? I also want to add a "line out" socket. Looking at the circuit, I think I should be able to omit the amplifier section entirely and just take my audio connection from the op amp side of C3, where it would usually go to pin 3. Does this seem correct? AI: The problem with using a dynamic microphone in place of an electret microphone is that the signal level is much lower from the dynamic microphone than it is from the electret. The output of an electret microphone will be on the order of 100mV. The output of a dynamic microphone will be on the order of a few millivolts. That's on the order of 100 times higher signal from the electret as from the dynamic microphone. If you want to replace an electret with a dynamic microphone, you will need an additional amplifier to make up for the weaker signal. That's the why. Jasen has provided an example of how. His circuit can pretty much be just dropped in place of an electret microphone. That's a plus. I wouldn't make any bets on sound quality or noise levels, though. You also can't predict how much amplification you will really get. Those are some pretty big minuses. You can build small, single transistor amplifiers with low noise and good performance - and you could probably make one as a drop in replacement for an electret microphone. Since the whole purpose of the circuit is to distort your voice, a poorly performing amplifier that clips might be regarded as a plus. It'll certainly help to make your voice harder to recognize. The instructions for the kit indicate that it uses the LM386 This opens up a new possibility. The gain of the LM386 can be increased from 20 to 200 by simply adding a single capacitor in the right place. Connecting a 10uF capacitor from pin 1 to pin 8 of the LM386 will increase the amplification. Make sure the positive end goes to pin 1 if you use an electrolytic capacitor. Might be enough. Might not. Might amplify noise from the the rest of the circuit to the point that it is unusable. It only costs you a few minutes and a part you probably have at hand to find out, though. Also, I would recommend building the kit as it is designed first. Once it works, you can modify it. If you modify it first, you will have a hard time telling where the error is. Did you build the kit wrong, or is your amplifier not working right? Easier to do it piece at a time.
H: Why is the output voltage of this circuit is changing in simulation? Circuit 1: Circuit 2: The only difference between Circuit 1 and Circuit 2 is`that in Circuit 2 a parallel 2.2k resistor R8 is added as a load next to R6. Why adding this R8 is halving the output voltage here? I tested this in real with a scope, and the voltage remains at 12V pulse when I add R8. So unlike in simulation R8 didn't change the output voltage. In real implementation the grounds of the input side and output side are isolated. edit: AI: I tested this in real with a scope, and the voltage remains at 12V pulse when I add R8. So unlike in simulation R8 didn't change the output voltage. The simulation model will likely have a typical current transfer ratio of based on the data sheet and your real test may be using an opto isolator with a very high CTR. With a very high CTR the output opto-transistor remains saturated and you largely get the same output peak-to-peak voltage as you got when you didn't load with the extra 2k2 resistor. The minimum CTR for the 4N26 is 20% but typically this can be 50% and if you had a really good one it could be a lot higher such as over 100%. The model parameter can be changed and you should be able to resimulate and obtain a result that is closer to what you measured.
H: Safety of Using USB Charger I am looking at getting a 3 port USB wall charger, to save having so many individual ones plugged in. A lot that I've seen offer Qualcomm FastCharge, and other similar things, which are around 2.4A, or higher. The chargers that I currently have (which are cheap ones) are alll 1A or less (with the exception of my Lenovo tablet charger, which is 2A). I'm slightly concerned that using such a charger will overload my devices (eg phone), and cause damage to the battery. I have a fairly large powerpack, I think 10Ah, and it says that it should be charged with a 1A current. Am I right to be concerned? A very related question is "Choosing power supply, how to get the voltage and current ratings?". It's not a duplicate question, but the answers there provide an answer for this question. The answers to this question given confirm that the answers to the linked question do indeed apply here. AI: Maple already answered this, but I want to say it differently: The current is determined by the device, not by the charger. All USB chargers output a constant voltage, and all USB-powered devices are designed to take only as much current as they need from the constant voltage source, but... ...There is a limit to how much current any given charger can provide. Your 1A charger is only capable of providing one Ampere. The USB charging protocol allows a charger to tell the device how much current the charger is able to provide, and the device can then decide what to do about it. A device that needs more than 1A will simply refuse to take power from a 1A charger. Some devices (e.g., most things that use USB power to charge a battery) will adjust the amount of current that they take to match whatever the charger is able to provide. So, for example a "power bank" device or a tablet computer might charge its battery quickly when connected to a 2.4A charger or, more slowly when connected to a 1A charger. Some (especially older) devices will never take more than 1A (maybe not even 1A) no matter how much current the charger is able to provide. Same goes for the really old 0.5A chargers.
H: why does this approach neglect the output resistance of the bjt in calculating gain? This is the question that I would like to ask about. My question is with regards to finding Vc for question 3. This is the memo for the question: However, I have a problem with regard to how they find Vc. Surely, if Vc is equal to Vcc- Rc(ic) then that is regarding the circuit as DC and ignoring the effect of the output resistance of the bjt, in which case it would be equal to Vcc- Rc|| Ro *ic? Ro would be equal to Va/ic = 80/1.5*10^-3 = 53kohm Or do you think that for question 3, without stating it, that it was assumed that Va = 0? AI: You must distinguish between DC analysis and small-signal (AC signal only 10mV peak). When we are doing DC analysis we usually treat the BJT as a current controlled current source with fix Vbe value and beta. And sometimes, we are a force to use a Schottky equation to find the DC operating point. But almost always we ignore the Early effect in DC calculation. And the model we used to model the Early effect is also a linear model. See the example here How does early voltage affect collector current? But even this is just another simplification of a reality. On the other hand in the small-signal analysis, we are using the highly linearized BJT's small-signal model. So we can use linear equations and theory. Because do not forget that in real life the is BJT highly nonlinear device and this is why we using linearized models. Because the reality is too complicated for us.
H: Triac optocoupler circuit I am working with this circuit: I am using a snubberless triac (BTA216X) and hence I am getting rid of snubber circuit (39 ohm res and 0.01 uF cap circled in red). Am I right in doing so? Besides this, can I get rid of 330 ohm resistor circled in blue? As per my understanding, it works like a pull down resistor but I have seen some comparable circuits not using this resistor. How critical is this component and what problems might occur if I don't use it? AI: You have to analyze whether the triac in the optocoupler can be triggered by the dv/dt, not just the power triac, before you can draw conclusions about the snubber. The 330 ohm resistor prevents leakage in the optocoupler from triggering the triac. Snubberless triacs tend to be fairly insensitive so you may not need that, but you can analyze the minimum trigger current vs. maximum leakage (probably at maximum temperature). You should try to keep the opto cool for lifetime reasons, but usually it ends up being mounted near the triac. In this case your triac is guaranteed not to trigger with 2mA gate current at 25°C Tj, and from Fig 7 we can assume that <1mA will not trigger it even when hot. The optotriac leakage appears to be <100uA at 100°C so I think you're fine without the resistor.