text
stringlengths
83
79.5k
H: Power cable for 5V 20A power supply? I bought a switching power dupply (SMPS) rated at 5V | 20A | 100W. But it seems I don't understand how power supply works. I need total of 18A on output, but that seems to be over the limit of standard 16A | 220V wall outlet's limit. How would I power this supply without burning my house down? I bought fuses and relays but that can only handle max at 10A. Reason for such high amperage needed: I was going to power 300 LEDs that require 5v 60mA per LED. I'm planning to make it in 2 parallel structure, giving me 150 leds each side. It turns out I need 5v each side with 9A flowing each side, totaling 18A. So does two 9A merge on outlet's side? AI: If you only draw 90 watts from the supply, it will only draw perhaps 100 watts from the AC source - a power supply passes power (voltage times current), not just voltage or just amperage. (The "extra" input power is lost, usually as heat, due to inefficiency in the conversion process).
H: RS232 serial output: confusion with wiring Brace with me as I am new to electronics, but am also eager to learn. I have a sensor which has 4 un-terminated wires: 1) 12V to 24V 2) RS-232 TxD 3) RS-232 RxD 4) Ground(and serial connector return) I'm trying to get the sensor and my computer to talk but have faced nothing but failure. I have an RS-232 to TTL converter followed by an RS-232 to USB adapter. Here's where my real question starts. I understand that TTL has VCC, Tx, Rx and GND pins. Can my sensor talk to my computer using only the Tx and Rx wires? From my understanding, the two other wires need to be connected to an external battery since it draws so much power...but that leaves VCC and GND empty on my converter. I've come to realize this morning that my RS-232 to USB adapter was out of date and not supported on my current version of windows. I have a new one on its way but still feel something is not quite right with my setup. Any help is greatly appreciated. Thank you! EDIT: Some extra information about my sensor: Digital output is RS-232 as ASCII chars, runs on 12-24 VDC(30mA@12V), configuration is 115200,8,N,1. I've also come to realize I probably don't need my TTL converter. How then would I communicate with only Rx and Tx? (Also, I know that Tx must go to Rx and vice-versa) AI: simulate this circuit – Schematic created using CircuitLab Figure 1. Wiring diagram. It sounds as though you have an industrial sensor as 24 V is standard for these. You need to supply 24 V DC between the Vcc and GND terminals. You also need to use screened data cable back to your RS232 port. If your sensor sends out a continuous stream of data then you can monitor this with a serial terminal emulator such as PuTTY to see if you can make any sense of the data.
H: If Conventional Current is wrong, how can I trace the flow of current in a schematic? If Conventional Current is backwards, how do I look at something like this schematic and trace the flow of current? I'd like to follow the design linearly from positive to negative. When the battery is on, does current go to 8, then 4, then through R1 and so on? Does the current get "back around" to the side of the capacitor, 1, and the speaker eventually (though fast)? How can this be so if in reality electrons flow from negative to positive? Edit: If the current were water here, how would I see that physically on the wiring, as if they were pipes? AI: Conventional current being backwards from electron flow has no effect whatsoever on circuit analysis. If you really wanted, you could swap the signs on all your currents and voltages and the math would work out the same, but people would be confused. If you're doing an ad-hoc intuitive analysis without any math, well, it still doesn't matter whether you start at the positive end or the negative end of things, or neither. The behavior of currents flowing in wires and through components can and should be be understood symmetrically — positive and negative voltages/currents, or electrons and “holes”, being equal and opposite to each other. The causality, the ways changes propagate around a circuit, is also symmetric. If you close a switch or make some other such change, the changes in voltage and current propagate away from the switch along both connected wires — with opposite signs, but otherwise completely identical, at the same speed. Specific components (diodes, ICs, capacitors, tubes…) may have polarity, so they require or only allow a flow with a specific direction/sign, but it does not actually matter at all for understanding the behavior of the circuit which one matches the actual flow of electrons — only if you want to understand why the components do what they do does that begin to matter.
H: Saturation Point of a magnet given some Parameters I know from my hard magnets (the remanent magnetization is very close to the saturated magnetization) the Coercivity \$h_c\$, the energy product \$B-H\$ and the remanent magnetization \$m_{rs}\$. Is it possible to estimate the value for the saturation field that I must apply? AI: Yes, there is a model that can help you relate all of the parameters of a magnetic hysteresis curve. There are several papers describing it and numerous codes available to help you fit the data to the model (some written in python). The model is called the Jiles Atherton model There is also a good description here on fitting the model. If you need time series fitting or something else there are other papers if you search Jiles Atherton model or inverse Jiles Atherton Model. I'm not aware if the parameters will give you \$ H_c\$ directly but you could find that once you fit the model easily. This is another paper Jiles–Atherton Magnetic Hysteresis Parameters Identification that will help you fit the parameters to the model, its not trivial, but neither is nonlinear parameter identification.
H: Self-clocking driver / transceiver I'm looking for a way to transmit a clock signal and data over a single line, perhaps using a self-clocking signal such as Manchester coding. The design I'm working on has a number of chained units, with data fed into the first unit in the chain and passed along to subsequent devices. In order to make connection easy I'm using USB connectors, so I have four lines (VCC, GND, D+, D-) for communications. Ordinarily I'd just use one for clock and the other for data, but I'm concerned about data corruption and cross-talk over the distances involved (1ft or so). As such I'm planning on combining both signal and clock onto one line, then using LVDS for improved noise resistance - after all, USB is differential in the first place! This would likely be trivial with a microcontroller, but I'm trying to avoid that for both complexity and cost reasons. Is there such a thing as a transceiver IC which translates between discrete clock and data pins and a combined self-clocking signal? What sort of keywords should I look for? AI: Self clocking serial protocols exist in a thousand variations everywhere magnetic recording to primitive ethernet communication, telephony to industrial and SCADA communication. These protocols and their designs have existed for over 40 yrs in my use as well as others. There are many implementations depending on the bit rate, and expected BER, SNR. The simplest encoders use 1T,2T transition intervals where 2T = is the 1/f, baud rate and have been defined as Bi-Phase or Manchester codes for Mark, Space and Invert define the toggle on centre bit transitions or Bi-Φ{M,S,I}. Early Hard Disk drives and present day Floppies conserved bandwidth using MFM which used 2T,3T. This expanded to Run-Length Limited (RLL) codes used in ethernet and many other serial comm. links which stretch the interval between clock transitions. Once you choose a bit protocol, for clock and data sync, you must choose a frame sync, byte sync and bit orientation and message protocol , of which there are thousands , so why reinvent the wheel? Encoding uses the Clock and Data into an XOR gate for Mark (1) or Space (0) ( from early telegraph terms) to use a normal or inverted clock. Depending on the frame length and number of 0's, 1's or transitions, one chooses the best approach. Simple Decoding uses a clock recover with a pulse edge created from every edge with XOR gate delay of <5%T and then a 1shot of 3/4T to sample the data value. Sophisticated Rx discriminators will integrate the entire bit energy over 1T interval. Filtering is essential to avoid group delay in the signal band which causes bit shift and Intersymbol Interference. Critical Rx use Raised Cosine filter, while non-critical Rx use LPF 5xf approx. Differential signalling is better for CM noise immunity when signal are low compared to EMI. There are many implementations freely available in HDL, AVR and programmable logic as well as discrete "old technology" one shots and XOR gates. Filters may be analog but some use more sophisticated digital filtering to minimize ISI and maximize SNR to get highest Bit Error Rate (BER), which as we know from Shannon's Law is directly related to SNR. Volumes have been written on this subject decades ago , so it you seek, ye shall find. Remote Controllers at low f use a pulse stretch or delay or duration modulation for 1's & 0's which compromises SNR/BER ratio but can work in a low noise environment. Don't forget to include error detection, (Parity, or Hamming Code or CRC, or ECC ) and Clock loss of sync detect. Then you need frame sync detect, byte sync clock Error Detect logic etc. Although not cheap or well stocked, this uses a 16x or 32x clock up to 1Mbps https://www.digikey.com/products/en/integrated-circuits-ics/specialized-ics/686?k=manchester&k=&pkeyword=manchester&v=20&FV=ffe002ae&mnonly=0&ColumnSort=0&page=1&quantity=0&ptm=0&fid=0&pageSize=25 > Is this to decode CANBUS ISO 11898 signals? If so then look at SCAN921226H Receiver chip $10 with 8bit parallel out and timing signals.
H: Would the Bluegigga WT12 be suitable for a battery powered application? I understand that the Bluegigga WT12 requires RS232 when using UART which is what I'm planning to do and thus it requires high voltages? Would that make it unsuitable for a battery powered application? If not what alternative Bluetooth module could I use that supports SPP and has a robust API like iWrap? AI: One would first have to ask "how big is your battery? (Capacity)". However, use of RS232, which does use higher voltage than logic circuits, does not preclude battery operation. These devices use chips such as the MAX232, which generates RS232 voltages levels from 5V using charge pumps. Edit: I think I see why you're confused. The datasheet includes the following: WT12 Universal Asynchronous Receiver Transmitter (UART) interface provides a simple mechanism for communicating with other serial devices using the RS232 standard. The UART interface of WT12 uses voltage levels of 0 to Vdd and thus external transceiver IC is required to meet the voltage level specifications of UART. This really badly worded, in my opinion. The WT12 does not use RS232 levels. It instead uses logic levels. What it is trying to say is that to connect to an external PC using RS232, it requires an external transceiver, such as the MAX232. Its UART pins can be connected directly to the UART pins of almost any microcontroller which uses the same I/O voltages: if you're powering the WT12 Vcc on 3.3 volts, use a microcontroller also with 3.3 volt Vcc (or Vio if that can be set separately).
H: How do I power/wire something that is rotating constantly WITHOUT extra batteries? So I want to make a Lazy Susan that is rotating constantly in one direction. I also want to have some other things on top such as neon signs, moving things, and etc. Problem is I want this to all run off of one DC source. Problem is I cannot figure out how I wire it so that things don't get tangled since the entire thing is constantly in motion. AI: You are looking for a slip ring. This is a device designed to do exactly what you describe - transmit power and/or signals to a rotating object. Generally, they work by having a rotating circular contact on one side and a spring-loaded pin which pushes against it on the other. They are not super reliable long term or in harsh conditions, but should be fine for your project. More expensive ones are generally better and last longer. The other alternative is inductive power transfer/signalling, but this will be harder to get right first time, so might not be ideal for a hobby project.
H: If one of the resistors becomes open circuited, what is the power Question: The total power in a parallel circuit with four resistors of equal value is 570W. If one of the resistors becomes open circuited, what is the power dissipated by each of the remaining resistors? My Attempt: \$P_1 + P_2 + P_3 + P_4 = 570\$ \$P_1 + P_2 + P_3 + \frac{v^2}{R} = 570\$ Open circuit causes \$R-> \infty \$ \$P_1 + P_2 + P_3 + \frac{v^2}{\infty} = 570\$ \$P_1 + P_2 + P_3 + 0 = 570\$ \$3P = 570\$ \$P = 190\$ This is not the correct answer, so what am I doing wrong? AI: This line: \$P_1 + P_2 + P_3 + \frac{v^2}{\infty} = 570\$ is not valid, because total power changes as there is less loads (resistors) in the circuit. You can see this by calculating the equivalent resistance, in this case was \$\frac{R}{4}\$ and now is \$\frac{R}{3}\$, so the resistance is higher and decreases the power. Actually each resistor in parallel is responsible for a part of the total power, so, before, you had: \$P_1 = P_2 = P_3 = P_4 = \frac{570}{4} = 142,2\$ So as long as voltage remains the same over the resistors, dissipated power will remain the same. Now you have only three resistors, so: \$P_{total} = P_1 + P_2 + P_3 = 3*142,2 = 427,5\$
H: Switching a 12V AC current from a microcontroller (no magnetic relay) I need to commute on/off a coil feeded with 12 Vac from a microcontroller output (5V). I've found a cheap Solid State Relay but the datasheet and a forum says this doesn't work with less than 75 Volts ac. G3MB-202P SSR https://www.electronicasannicolas.com.co/productos/index.php?id_product=3099&controller=product&search_query=rele&results=10 Others models operate in a high dc input. What can I do? (in a cheap way). Solved: thanks to Jack Creasey. the circuit work perfect. adding a triac in the output I can drive the voltaje like this image. AI: Any SSR will have a significant forward (on) voltage drop of 2-3 V. Typically where two triacs (one opto-isolated and one power) are used there is a very significant turn on voltage required. While I have not seen one needing the 75 V specified for the Q3MB-202 I have seen plenty that don't turn on till about 20-25 V. I'd suggest that you could use the MOC301x or MOC302x optically isolated triacs. These will turn on with only 3-4 V but at the current levels you want they will typically drop about 1.5 - 2 V RMS. If you actually want to get 12 V RMS on your load you may have to use a 15 V RMS transformer output. You can parallel 2 * MOC30xx triacs and they will work well (you could expect less on loss). BUT ...you must have both the LEDs on all the time you want the AC on. You can parallel the outputs and you can either operate the LEDs in series or drive separately with their own limiting resistors. Another possibility is to use a DC SSR. These typically have a FET output and you could use a low Vf Schottky diode bridge to switch the AC. This would have a slightly lower loss voltage probably around 1.5 V, though there is not a lot of gain.
H: How do I prevent bridges while soldering SMD Components? I have noticed that whenever I try to solder a component with many pins close together (like an IC), I get tiny bridges of solder, which shorts the pins. Is there any easy way to solder SMDs without solder bridges? AI: When soldering by hand, it is easier and faster to just ignore the bridges while you solder the part and then clean it up. Just put some desoldering wick on the bridge, heat with your soldering iron (may need a bigger tip or more heat) and the excess solder will happily flow into the wick leaving perfect solder joints. With practice the cleaning of even large parts just takes a few seconds.
H: Unexpected bits when shifting out (ATtiny85) I'm trying to spoof a 433 MHz remote and I have a sequence of 32 bytes that I want to repeatedly shift out to one of ATtiny85's pins. The signal then goes to a cheap Chinese-type 433 Mhz transmitter. I utilized the built-in 8-bit Timer/Counter0. Unfortunately, in constant places in my sequence there are glitches in form of repeated bits. For example (byte no. 5): Bit number (starting from 0) 40 41 42 43 44 45 46 47 Correct 0 0 1 0 0 1 0 0 Actual 0 0 0 1 0 0 1 0 My code: #include <avr/io.h> #include <avr/interrupt.h> #include <avr/pgmspace.h> #define OUT PB2 uint8_t bit = 0; // current bit const uint8_t data[32] PROGMEM = { 0b10101010, 0b10101010, 0b10101010, 0b00000000, 0b01001001, 0b00100100, 0b11010011, 0b01101101, 0b00110100, 0b10010011, 0b01001101, 0b10100110, 0b11010010, 0b01001101, 0b10100100, 0b10011010, 0b01101001, 0b10110110, 0b10011010, 0b01101101, 0b10110100, 0b11011011, 0b01101101, 0b10110110, 0b11011010, 0b01101101, 0b10110100, 0b11011010, 0b01101000, 0b00000000, 0b00000000, 0b00000000, }; int main() { DDRB |= _BV(OUT); TCCR0A |= _BV(WGM01); // clear timer on compare match TIMSK |= _BV(OCIE0A); // 2 kbps TCCR0B |= _BV(CS01); // prescaler: 8 OCR0A = 62; // timer counts to 62 instead of 255 sei(); while (1) { } } ISR (TIMER0_COMPA_vect) { if (pgm_read_byte(&(data[bit / 8])) & (1 << bit % 8)) { // read current bit from progmem array PORTB |= _BV(OUT); } else { PORTB &= ~_BV(OUT); } // I tried // if (bit == 255) bit = 0; else bit++; // but it made no difference, so i left it like this // because it's shorter bit++; // let it overflow } I wondered if somebody could help me to troubleshoot this or maybe propose a better solution to this task which is just shifting out bytes without a clock. EDIT: A comparison between "measured" and correct sequence (always the same, even after looping many times) Bit Correct Measured 0 1 1 1 0 0 2 1 1 3 0 0 4 1 1 5 0 0 6 1 1 7 0 0 8 1 1 9 0 0 10 1 1 11 0 0 12 1 1 13 0 0 14 1 1 15 0 0 16 1 1 17 0 0 18 1 1 19 0 0 20 1 1 21 0 0 22 1 1 23 0 0 24 0 0 25 0 0 26 0 0 27 0 0 28 0 0 29 0 0 30 0 0 31 0 1 DIFFERENT 32 0 0 33 1 0 DIFFERENT 34 0 1 DIFFERENT 35 0 0 36 1 0 DIFFERENT 37 0 1 DIFFERENT 38 0 0 39 1 0 DIFFERENT 40 0 0 41 0 1 DIFFERENT 42 1 0 DIFFERENT 43 0 0 44 0 1 DIFFERENT 45 1 0 DIFFERENT 46 0 0 47 0 1 DIFFERENT 48 1 1 49 1 0 DIFFERENT 50 0 0 51 1 1 52 0 0 53 0 1 DIFFERENT 54 1 1 55 1 1 56 0 0 57 1 1 58 1 1 59 0 0 60 1 1 61 1 1 62 0 0 63 1 0 DIFFERENT 64 0 0 65 0 1 DIFFERENT 66 1 0 DIFFERENT 67 1 1 68 0 1 DIFFERENT 69 1 0 DIFFERENT 70 0 0 71 0 1 DIFFERENT 72 1 1 73 0 0 74 0 0 75 1 1 76 0 0 77 0 0 78 1 1 79 1 1 80 0 0 81 1 1 82 0 1 DIFFERENT 83 0 0 84 1 0 DIFFERENT 85 1 1 86 0 0 87 1 0 DIFFERENT 88 1 1 89 0 1 DIFFERENT 90 1 0 DIFFERENT 91 0 0 92 0 1 DIFFERENT 93 1 0 DIFFERENT 94 1 1 95 0 0 96 1 1 97 1 0 DIFFERENT 98 0 0 99 1 1 100 0 0 101 0 1 DIFFERENT 102 1 1 103 0 1 DIFFERENT 104 0 0 105 1 1 106 0 1 DIFFERENT 107 0 0 108 1 0 DIFFERENT 109 1 1 110 0 0 111 1 0 DIFFERENT 112 1 0 DIFFERENT 113 0 1 DIFFERENT 114 1 0 DIFFERENT 115 0 0 116 0 1 DIFFERENT 117 1 0 DIFFERENT 118 0 1 DIFFERENT 119 0 0 120 1 1 121 0 0 122 0 1 DIFFERENT 123 1 1 124 1 0 DIFFERENT 125 0 0 126 1 1 127 0 1 DIFFERENT 128 0 0 129 1 0 DIFFERENT 130 1 1 131 0 0 132 1 1 133 0 1 DIFFERENT 134 0 0 135 1 0 DIFFERENT 136 1 1 137 0 1 DIFFERENT 138 1 0 DIFFERENT 139 1 1 140 0 1 DIFFERENT 141 1 0 DIFFERENT 142 1 1 143 0 0 144 1 1 145 0 0 146 0 1 DIFFERENT 147 1 1 148 1 0 DIFFERENT 149 0 0 150 1 1 151 0 1 DIFFERENT 152 0 0 153 1 1 154 1 1 155 0 0 156 1 1 157 1 1 158 0 0 159 1 0 DIFFERENT 160 1 0 DIFFERENT 161 0 1 DIFFERENT 162 1 0 DIFFERENT 163 1 1 164 0 1 DIFFERENT 165 1 0 DIFFERENT 166 0 1 DIFFERENT 167 0 1 DIFFERENT 168 1 1 169 1 0 DIFFERENT 170 0 1 DIFFERENT 171 1 1 172 1 0 DIFFERENT 173 0 1 DIFFERENT 174 1 1 175 1 1 176 0 0 177 1 1 178 1 1 179 0 0 180 1 1 181 1 1 182 0 0 183 1 0 DIFFERENT 184 1 1 185 0 1 DIFFERENT 186 1 0 DIFFERENT 187 1 1 188 0 1 DIFFERENT 189 1 0 DIFFERENT 190 1 1 191 0 0 192 1 1 193 1 0 DIFFERENT 194 0 1 DIFFERENT 195 1 1 196 1 0 DIFFERENT 197 0 1 DIFFERENT 198 1 1 199 0 1 DIFFERENT 200 0 0 201 1 1 202 1 1 203 0 0 204 1 1 205 1 1 206 0 0 207 1 0 DIFFERENT 208 1 0 DIFFERENT 209 0 1 DIFFERENT 210 1 0 DIFFERENT 211 1 1 212 0 1 DIFFERENT 213 1 0 DIFFERENT 214 0 1 DIFFERENT 215 0 0 216 1 1 217 1 0 DIFFERENT 218 0 1 DIFFERENT 219 1 1 220 1 0 DIFFERENT 221 0 1 DIFFERENT 222 1 1 223 0 0 224 0 0 225 1 0 DIFFERENT 226 1 1 227 0 0 228 1 1 229 0 1 DIFFERENT 230 0 0 231 0 0 232 0 0 233 0 0 234 0 0 235 0 0 236 0 0 237 0 0 238 0 0 239 0 0 240 0 0 241 0 0 242 0 0 243 0 0 244 0 0 245 0 0 246 0 0 247 0 0 248 0 0 249 0 0 250 0 0 251 0 0 252 0 0 253 0 0 254 0 0 255 0 0 256 0 AI: You're reading your binary constants backwards when calculating your expected 'Correct' bits. Your code which reads the individual bits: pgm_read_byte(&(data[bit / 8])) & (1 << bit % 8)) starts with the Least significant bit (the one on the right), not the one on the left. So your actual 'correct' sequence (at least according to the code you've written) is: 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 1 0 0 1 0 1 1 etc... which exactly matches what you're seeing from your output. If this is not what you want, then you'll need to reverse the order you're pulling the bits out by doing something like: pgm_read_byte(&(data[bit / 8])) & (0x80 >> bit % 8)) instead.
H: Using Fourier transform to solve current in a circuit with initial condition I am trying to solve the inductor current for the circuit below by using Fourier transform instead of Laplace. The purpose is to see if Fourier transform also works for problems with initial conditions like this. The voltage source is a DC voltage source. By KVL: \$\ -1 + L\frac{\mathrm{di} }{\mathrm{d} x} + R i = 0\$ Fourier transform the equation above: \$\ -2\pi \delta (\omega ) + j\omega L *I(\omega ) + R*I(\omega ) = 0\$ However, I don't see anywhere that the condition i(0) is used here. How can I include the initial condition and solve for the current? PS. The circuit is taken from this site. AI: First of all, the Laplace Transform and the Fourier Transform spring forth from the same body of water. They are sorta the same thing, and if you have common conditions using either, they are the same thing with \$ s=j\omega \$. the unilateral Laplace transform is better for circuit problems that are defined only for \$t \ge 0\$ and have initial conditions because there is a convenient mechanism for dealing with those initial conditions at \$t=0\$ with the unilateral Laplace transform. The bilateral Laplace transform is most like the Fourier transform (which always has a bilateral definition) with the substitution of \$s=j\omega=j2\pi f\$. That said, the problem above can only be dealt with with the Fourier transform if the circuit, which is completely "relaxed" (having all initial conditions equal to zero) at \$t=0\$, is modeled as driven by a unit step of 1 volt, rather than a constant input of 1 volt. If the above circuit was connected to 1 volt for all time, there is no way that initial current, \$i(0)\$ can be anything other than \$i(0) = \frac{1 \text{V}}{R}\$. If \$i(0)\$ is equal to anything other than that, you must represent the input to be a step function. Then the other problem with the Fourier Transform that the Laplace doesn't really have, is that the Fourier Transform does not converge nicely for the unit step. Through an indirect method, the F.T. of a unit step can be inferred, but it's natural with the Laplace. So with the F.T. you would have to represent the unit step as a limiting case of a function that does have a legitimate F.T.: $$ u(t) = \lim_{\tau \to +\infty} \begin{cases} e^{-t/\tau} \qquad & \text{ if } t \ge 0 \\ 0 & \text{ if } t < 0 \\ \end{cases}$$ for a finite \$\tau\$, that has a legit F.T. and you can solve this system using the F.T. for a finite \$\tau\$, get an answer, and then let \$\tau\$ go to \$\infty\$.
H: How to interface the HX711 Weight Scale ADC with a microcontroller? In my project I need to interface HX711 24 bit External ADC to STM32L100RC6 MCU How can I do this ? AI: I've used this IC in several designs. It's quite simple, but a bit ad hoc: you connect DOUT and PD_SCK to 2 GPIOs of your MCU. Data comes out on DOUT when you clock PD_SCK , so you can think of it as SPI without MOSI. You don't send instructions to the HX711, you just pulse its PD_SCK to read the next measurement. To read a value, you must wait for DOUT to be LOW. Then, clock PD_SCK with 24 positive-going pulses. To set the internal differential amplifier's gain (128, 64, 32), you add extra pulses at the end for a total of 25, 26 and 27 pulses respectively. This is applied to the next acquisition, so you should do a dummy read in the beginning to set the initial gain. DOUT is a 24-bit value with bits valid on PD_SCK falling edges. It's really all there is to it. Here's a capture I did recently in gain=128 mode (25 pulses). It is a single acquisition part of a train of samples. I was experimenting with taking multiple samples and averaging them to reduce noise. The events on the right are the times at which the samples were measured. It's not constant because I was doing something like 6 acquisitions per measurement, at roughly 10Hz. Below, a capture of the overall acquisition over a longer period of time. Each yellow glitch is a full sequence as the one shown in the first image. You can see I'm doing 1 measurement per second, where each measurement consists of 6 samples as 10Hz. This was just for testing the chip and my asynchronous acquisition interface in the firmware.
H: In a single diode rectifier circuit, is capacitor offering additional energy to Load? I am a graduate student majoring in electrical engineering. Now, I am studying about wireless power transfer and energy harvesting. While reading a paper written by Bruno Clerckx, who is senior member at IEEE, I encountered something that doesn't make sense to me (maybe makes sense for experts naturally.) Take a look at the following circuit diagram; single diode rectifier circuit. Surely, the authors did not consider Vin as a simply sinusoidal signal, but for simplicity and for striking what I do not understand, I assume Vin is a single sinusoidal signal. Then Vout will be a signal $$V_{out} = \max ~\Big\{V_m\;\cos(\omega t + \theta), ~0 \Big\}$$ if the capacitor does not exist. On the other hand, if the capacitor exists like the figure, the Vout will be smoothened like the figure. Of course, Vout keeps higher in this case than in the case without the capacitor, so I expect to harvest energy better. However, in the power view, Let P1 be transmit power, P2 receive power, and P3 output of rectifier's power. P2-P1 is the loss of the power due to the wireless channel, P3-P2 is the loss of the power due to the block for rectifier. Then, I think P3 is anyway determined by the efficiency (power loss) of the channel, the one of the rectifier block, and the transmit power. Why can we get more harvested energy if adding the capacitor, even though the capacitor is not a source but an energy consumer (anyway, one of resistances). AI: Why can we get more harvested energy if adding the capacitor, even though the capacitor is not a source but an energy consumer (anyway, one of resistances). You don't get more harvested energy - you get better managed energy. The capacitor accepts power in short bursts during charging. The capacitor supplies power when the AC < DC. Most likely the circuit that you are powering requires steady DC rather than half-wave rectified power. The capacitor helps supply that. Re-run your simulation with and without the capacitor and monitor the current at the top of Vin and the current through RL. You will see a big change in both.
H: VHDL Knight Rider I am newbie in VHDL. In my code, everything seems right but code doesn't work properly. I couldn't find where my fault is. Any solutions? library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity Knight_Rider is port ( in_CLK: in std_logic; out_LED: out std_logic_vector(9 downto 0) ); end entity; architecture Behavioral of Knight_Rider is signal shift_reg: std_logic_vector (9 downto 0):= "0000000001"; signal counter: std_logic_vector (19 downto 0); signal i: integer range 0 to 9; signal res: std_logic:= '0'; begin CLOCK:process(in_CLK) begin if(rising_edge(in_CLK )) then counter <= counter + 1; end if; end process; process(counter(19)) begin if(rising_edge(counter(19)))then if (res = '0') then for i in 0 to 8 loop shift_reg(i+1)<= shift_reg (i); res <= '1'; end loop; else for i in 9 downto 1 loop shift_reg(i-1) <=shift_reg(i); res <= '0'; end loop; end if; end if; end process; out_LED <= shift_reg; end architecture; EDIT: I have changed the code a bit and now runs perfectly. library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity Karasimsek is Port ( CLK : in STD_LOGIC; LED : out STD_LOGIC_VECTOR (9 downto 0)); end Karasimsek; architecture Behavioral of Karasimsek is signal shift_reg: STD_LOGIC_VECTOR (9 downto 0) := "0000000001"; signal sayac: integer range 0 to 50000000; signal yonsec: std_logic:= '0'; signal pulse: std_logic:= '0'; begin process( CLK ) begin if(rising_edge(CLK)) then if (sayac < 50000000) then sayac <= sayac + 1 ; else sayac <= 0; pulse <= '1'; if (pulse = '1') then if (yonsec = '0') then shift_reg <= shift_reg (8 downto 0) & '0'; if (shift_reg(8) = '1') then yonsec <= '1'; end if; elsif (yonsec = '1') then shift_reg <= '0' & shift_reg (9 downto 1); if (shift_reg(1) = '1') then yonsec <= not yonsec; end if; end if; end if; end if; end if; end process; LED <= shift_reg; end Behavioral; AI: It's been a while since I've used VHDL, but it looks like your if(res...)else loop is simply bouncing back and forth. Think of it this way, 1) Set your start condition (you did that and it looks OK). 2) Use res to change the direction of motion. This means you don't change it every time counter has a rising edge (this is causing your blink). You change it when the first bit or last bit of shift_reg is 1. Your starting condition is 0000000001. Say the first bit on the left (a zero) is "bit #9" and the last bit on the right (a one) is "bit #0". res should be set to 0 (moving the bit to the left) when "bit #0" is equal to 1. It should be set to 1 when "bit #9" is equal to 1. You probably shouldn't set res in the shift block. I'd set it independently after the shift is complete. 3) Finally, you need to be sure the last bit of each direction is fed into the first bit. (You could do this programmatically, but a real circuit would have to act this way.) Again, your starting condition is 0000000001, which means res should be zero. On each rising edge of counter you shift everything to the left one bit and you shift that last bit (bit #9) onto bit #0. In the other direction you're shifting bit #0 onto bit #9. That's how you keep your zeros in place. In other words, store bit 9, loop up 0-8, then assign your stored bit 9 onto bit 0. In the other direction: store bit 0, loop down 9-1, then assign bit 0 onto bit 9. I suspect #2 is your biggest problem. That's what stopping the register from moving along. Finally, take a moment to Google "VHDL Johnson Ring Counter." It's not exactly what you're trying to do, but it's about 90% of it. It will help you with your code because many of the examples mimic actual shift register designs including your missing feedback loop.
H: How can I determine maximum load current limit of DC-DC step up switch regulator? I have a trouble in designing power supply for my device. I've shifted 3.3V up to 5v by using LMR 62421 manufactured by Texas Instruments. I'm planning to use the 5v rail to power my devices(module, sensor, etc...) Everything is fine except that I can't find out how much load(output) current LMR62421 allows in maximum. Datasheet only says it has minimum switch current limit of 2.1A. I don't think this is equal to Maximun load current. There are some equations on datasheet but they start from knowing VIN VOUT Ioutmax. My devices which are connected to 5V rail will consume approximately 1.6A in sum. I expect that LMR 62421 will be fried if I do not take careful consideration on its maximum allowable current value. Can anyone help me find it out? AI: From page 1 of the data sheet you see these two graphs (I have added max current figures in red just to emphasize things): - So, when outputting 20 volts, the graph informs you that the maximum sustainable output current is 200 mA. It tells you this because the curve on the graph ends at 200 mA. Now, this is page 1 of the data sheet and if it could supply 300 mA (for instance) it would definitely have that curve going to 300 mA. Page 1 tries to promise as much as possible! OK that's a power output of 20 volts x 0.2 amps = 4 watts. Similar story for the 12 volt output, max current is about 330 mA and at 12 volts this means it can supply an output power of 3.96 watts. What current are you going to get at 5 volts - you could say that maximum output power is 4 watts and this predicts an output current of only 0.8 amps. You won't get 1.6 amps at 5 volts. Maybe try one of these: - And yes, they are a little expensive so maybe try again on TI's site and narrow down your selection using their search engine.
H: High speed parameters for transistor How to choose a Bipolar Junction Transistor (BJT) for a switching frequency of 400KHz. AI: If I would get a transistor to switch at 400 kHz, then I would look for a transistor with a bandwidth of at least 400 kHz, I'd probably look for a transistor with 1 MHz for some margin because the real world is messier than in theory. But what I'd also look for would be the minimum \$h_{fe}\$, because that will greatly affect the efficiency of the BJT, or what kind of things you can use the BJT for. Also the maximum amperage (through Ic). But since your question is screaming of much effort put into the question, I don't know what other kind of parameters you should be looking for, rather than 400 kHz bandwidth. If you are going to make something that needs a lot of amp's, say more than 0.5 A, then I'd strongly advice you to use a MOSFET instead of a BJT.
H: Voltage converter (220V to 110V) with surge protector power strip—how much wattage do I need, and is it safe? For the next 6 months, I'll be living in a country where the voltage is 220V. The risk of frying electronics is also much higher there, so I want to get a surge protector. I've been researching this for the past 5 hours, however, for some reason, finding a good power strip that accepts both 110V and 220V—and also has good surge protection—isn't easy. So instead, I'm thinking of doing the following (*it seems USB plugs aren't surge protected on power strips—manufactures don't put this information up front): Voltage converter (220V to 110V) -> 110V power strip w/ 900J+ surge protection -> USB charging hub* Laptop plugged into the power strip and USB devices (iPhone, iPad, ereader, portable charger) charged on the USB charging hub How much wattage would I need with the voltage converter? Would this setup be safe? Would there be overheating? Not all power strips/hubs/etc. are UL certified. How important is this? AI: You don't say what the wattage of all your appliances adds up to. I suspect about a 1kVA transformer would be plenty, especially if it's one designed to cope with short-term higher loads. The ones designed for power tools often have two ratings - for continuous and intermittent loads. If you use the right transformer, it should be fine. Not every country cares about UL certification. Check for other national or certifications instead, but beware that some are largely meaningless.
H: Altium high current trace I'm designing a PCB in Altium and I need to trace tracks that can support 20A. I used a PCB Track Width Calculator and I need a width of 10mm for my tracks. The problem is, how do you link the pads of component to such a large trace? Can I make a small trace at the end of the large one? Do you have a solution for this problem? Here is a screenshot so you can see the size. Thank you. AI: The rules for track width are for long tracks, and they are meant to achieve a certain limit on the temperature rise (typically 10 C) of the track due to self-heating. A small length of short track connected to a wide track will heat up more, but it will also (because it's short) get the benefit of thermal transfer to the wide track, so it won't heat up as much as a long narrow track. Calculating the "exact" (nothing is really exact in thermal analysis) temperature rise of the short track (or the long track, for that matter) is a job for a heat-transfer simulation. Can I make a small trace at the end of the large one? Do you have a solution for this problem? Yes. Either extend the wide trace with a narrow trace, or make a polygon around the pad you're connecting to that extends to somewhere you can attach the wide trace. Make this section as short as possible. You could also widen the wide trace near where it connects to the narrow trace (or use a polygon) to give it more surface area and allow it to provide greater heat-sinking to the narrow trace.
H: What is the efficiency of a stepper motor driver? We are using this stepper motor driver (https://www.sparkfun.com/products/12779). In its datasheet, there is no mention of efficiency? How much is the efficiency in motor drivers like these? AI: In motion control efficiency is usually mechanical output power (w*T) divided by electrical input power (U/I). Obviously it is different for different working points. For a standing stepper it's zero. On higher speeds sometimes nice figures may be reached, but bot very nice. Because for stepper you always take spares, otherwise it slips.
H: Dynamic Braking resistor chopper circuit I want to design a standalone dynamic braking circuit for AC motor driver , because to deal with regenerative energy that the AC source cannot handle causing a DC bus voltage Rise . The concept is well established in many resources online that senses the DC bus voltage and dissipates the access energy in a " Brake Resistor ". I want to know what is usually used circuit that is called in the diagram as "chopper module" and design it without micro controller if possible. I donot know of an IC that is designed for this purpose solely , so what comes to mind is comparator with hysteresis with a low side gate driver to open/close Braking mosfet. but no so sure if this is a decent choice until i test in reality and see how well it will work. My concept test circuit : So I would like to know your comments on the subject, and corrections if i am missing something here . AI: What you are presenting is an extremely common method to deal with the regenerative energy. It is a simple chopper circuit to regulate the DClink voltage via dissipating the energy in the resistor Whether the hysteresis is done in the hardware domain (your comparator) or in software comes down to system architecture. I have personally done both Two additional considerations Please place a diode across the brake resistor. The inductance of such a resistor & leads can produce a destructive voltage. There is always stray inductance, but aspects of power electronics can cause the "inductive kick" to be a real problem. Lead lengths tend to be longer & equally the current involved higher. Both these contribute to a higher V due to \$L\frac{\Delta I}{\Delta t}\$ Consider a second comparator for an over-voltage. If the brake circuit fails you could cascade a failure during deceleration. Overvolting power-electronics has a habit of exploding. Imagine the situation where your brake circuit failed (undersized resistor, random failure of the resistor, FET, comparator etc...). Your controller will still decelerate transfering the inductive and rotational energy to the DClink. Normally this would be regulated by the chopper, however this no longer exists & the DClink will carry on rising as long as there is energy to be transferred. At some point something will reach its avalanche voltage: Inverter or Capacitor. The energy stored in the capacitor, \$\frac{1}{2}CV^2\$ will now rapidly dissipate & further failures can & do occur.
H: Why is the plastic around my battery terminal melting? I am using 2 dry batteries for my backup UPS. For some reason the plastic around one of the terminals of a battery is melting and producing a lot of smell. Most of the times it works fine but at some odd days, whenever we put load on the batteries/UPS, it starts melting. I have replaced the whole wire/clip around that specific terminal but to no avail. I do not see any spark and all the connections seem fine. The wire also gets very hot but that's due to the heat obviously. How can I debug the issue? AI: This problem is an indication of resistance near or on the battery contact. When there is resistance present, any current through the connection will be converted to heat. As you described, when you put a load on the UPS, it starts to melt. The load is the increased current that flows through the connection. Try cleaning the connections, making sure any hardware such as clamps and screws are very tight, and making sure that any wires are firmly attached to the hardware and not coming loose. Based on the picture you added to your question, I would make sure the battery post is very clean, that the crimping of the ring connector is very tight - it does not look so in the picture (perhaps solder it as well), and you may wish to consider adding a flat washer with a star washer underneath it, immediately on top of the ring connector. This will help with the electrical connection. Also make certain that your UPS is not drawing more current from the battery than its rating.
H: Can I use a transimpedance amplifier using current through a resistor? I'm designing a lab exercise for 1st year circuits students. They learn about current controlled voltage sources, but we never show them one. I know that transimpedance amplifiers are used for this purpose, but I've only seen them used with devices that produce current, like a photodiode. I'd like to have them choose a resistor and a voltage to generate a current through that resistor. I want to tell them that the gain of the CCVS is X, and they are required to choose their resistor and voltage so that the output voltage of the CCVS is Y. a) Can a transimpedance amplifier be used in this way? b) If not, is there anything that can? AI: A plain ordinary opamp configured as an inverting gain stage sounds exactly what you are looking for because, that is exactly how they work when fed with a voltage source in series with a resistor. Basically, a transimpedance amplifier is a subset of an opamp inverting amplifier. You might also be interested in looking up the term virtual earth (as applied to an opamp).
H: Is cable to resistor also considered a resistor? I have a parallel circuit with 50 parallel wires each connected to main cables (+ and -) on top and bottom side of the circuit. I want to calculate the total resistance which I know is R = R1/ total number of parallel wires. Should I also include main cables in my calculation? If so, should I measure the length of the cable from the first "resistor"? Should I only calculate the main + cable or both? Thank you! AI: I guess it depends on some information that we don't have. The "main cables" (which hopefully for your safety aren't mains cables), may be significantly thicker than the other smaller cables and have a negligible resistance. If you want to model the resistance exactly, go ahead and measure the main cables as well, and add it in series with the parallel mess of wires. Unless you are doing something unsafe, the resistance of these wires really shouldn't make a difference. On the topic of safety: If you are doing something where you are drawing enough current that your putting 50 wires in parallel to solve the problem, that isn't the solution your looking for. While it will lead to a lower overall resistance, there will still be fairly high current going through each of the wires, and you don't want them to burn up. Any power dissipated by your makeshift resistors will turn into heat, and potentially a lot of it. Please make safe decisions, especially if you aren't that experienced with electronics yet, and avoid high voltage until you know what your doing. And if you insist on still going through with this stuff: please keep one hand behind your back at all times. High voltage can really kill you if you aren't careful.
H: Set array of wires to integer value in Verilog test bench I am writing a test bench for a module that takes an array of inputs that represents a number using the following code: module ComparatorTest; wire [3:0] a; wire [3:0] b; output aHigher, bHigher, equal; Comparator c (a, b, aHigher, bHigher, equal); initial begin $dumpfile("test.vcd"); $dumpvars(0, ComparatorTest); # 0 a[3:0]=1111, b[3:0]=0000; # 20 a[3:0]=1111, b[3:0]=1111; # 40 a[3:0]=0000, b[3:0]=1111; # 60 $stop; end endmodule I want to be able to set the arrays a and b either in base 10 or in binary like I would a number. How do I go about doing this? The code that I have gives me a syntax error (ComparatorTest.v:12: Syntax in assignment statement l-value.) AI: Change wire to reg and you should be good to go. And if you want to set them in binary, then you have to prefix with 4'b, like so: 4'b0000, 4'b1111, etc. The 4 indicates the number of bits. If you want decimal, then do 4'd0, 4'd15, etc.
H: Can a modern multimeter be classified as a discrete component tester? I work for an avionics training company where we are required to meet certain criteria with respect to the theory and practical tasks that we teach. At the moment there is one area of debate with respect to a requirement for us to teach the use of various pieces of test equipment which include multimeters, logic probes, oscilloscopes, current probes and discrete component testers. Many people at my work consider a modern multimeter as a discrete component tester since they are able to test resistors and capacitors. I am not so sure however since they specifically mention multimeter and discrete component tester as two separate items. With that background, my question is this - can a multimeter be classified as a discrete component tester? AI: I think 'discrete component tester' may be an alternative name for an 'LCR meter', which specializes in measuring resistance, capacitance, inductance, and related factors (D, Q, ESR, etc.). These devices are precision instruments which don't passively measure, but actively apply test signals and measure the response. They will also generally have features to increase accuracy, including kelvin connections (separate source and measurement leads) and guard terminals (driven output that is used to minimize the effects of leakage). Some multimeters may have some of these features, but generally a dedicated LCR meter is more accurate and can measure more than one parameter at the same time (C and D or ESR, L and Q, etc.).
H: DC Voltage Polarity and Current Flow? So I'm getting pretty familiar with Electrical Theory but one issue keeps bringing me problems. In a DC circuit, there is a negative (-) and a positive (+). I am aware that in electron flow theory, current flows from the negative (-) to positive (+). See Figure 1. But in a car battery, the positive terminal is considered the hot lead and the negative terminal is ground. If you take a wrench and connect the negative (-) terminal to the metal chassis of the car, it won't short, but when you short the positive (+) terminal to the metal chassis, it does. See Figure 2. My question is.. How is it possible for the positive terminal of the battery to be hot when, there is positive charge on the terminal? ? If electrons are supposed to flow from negative(-) to positive(+), wouldn't the negative terminal be considered hot and not at ground potential? Also, when the positive(+) terminal is shorted to ground, is that positively charged terminal just allowing negatively charged electrons to flow from the ground? Please Help! simulate this circuit – Schematic created using CircuitLab AI: Electrons are flowing from negative to positive when there is a connection for them to flow. You can also think of it as "holes" (or the absence of electrons in an atom) flowing from positive to negative. Because of historic reasons, we generally think of conventional current, or the "holes", rather than the actual electron current. You are correct that the positive terminal just "pulls negatively charged electrons." There is also no magical node called "ground." We simply assign a point that is easy to keep track of to refer to as ground. In a circuit, you could refer to the positive terminal of the battery as ground, and simply be working with negative voltages (though it would likely cause some confusion for others interpreting your work). Likely in the case of shorting the battery to the chassis of the car, the negative terminal of the battery is already connected to the chassis. Possibly this is done for some sort of EM shielding (vehicles are inherently very noisy environments). When you make another connection from the negative terminal of the battery to the chassis, no current flows. When you connect the positive terminal, current flows through the chassis of the vehicle to the negative terminal.
H: Need circuit to toggle voltage between two paths I need to create a circuit to allow me to toggle a source voltage from one path to another. I need to be able to toggle the path from the first path to the second while a second voltage is active, and go back to the first path when the second voltage is not active, such as in this diagram. P.s. Please do not suggest using a switch, I can only toggle by using a second incoming voltage AI: simulate this circuit – Schematic created using CircuitLab Figure 1. Relay voltage source switch. When V2 is not preset V1 will power LOAD1. When V2 is high enough to energise the relay the V1 will power LOAD2. Figure 2. A typical relay. Choose the relay coil voltage to match V2. Choose relay contact voltage and current ratings to meet or exceed the supply voltage and load current. If using DC check that they are adequately rated for DC.
H: BJT Transistor Amplifiers Why the input voltage to the amplifier in the circuit on right side is taken from resistor R2 when circuit on the left side is doing the same job with just one resistor (Rin). Why to use the voltage divider circuit to provide the input to the input of an amplifier ? AI: If you remember the diagram from an answer to an earlier question I showed this: - To that picture I've added two red lines. The horizontal line reresents 50 uA (DC) into the base and, correspondingly, this roughly equates to a base emitter voltage of about 0.64 volts. If this transistor were configured as a common emitter amplifier (as per your left hand circuit) and you biased it at 0.64 volts you would get 50 uA into the base and, if hFE were 100 you could expect to see about 5 mA flowing through the collector. So you would need a battery supply of 0.64 volts and in series with this you put your signal source. Alternatively you could use a 1.5 volt battery and introduce a resistor so that the current is limited to 50 uA. That resistor is equivalent to \$R_{IN}\$ shown on your left diagram. You want that resistor to drop 1.5 volts - 0.64 volts whilst taking 50 uA so its value would be 0.86/50E-6 = 17.2 kohm. Taking this further you could use the full supply voltage (say 9 volts) and \$R_{IN}\$ would need to be 167.2 kohm. That all works fine for a common emitter amplifier with a grounded emitter but, common emitter amps with a grounded emitter are crappy on distortion and, as explained in that earlier answer (here), are hard to keep stable so, we use the type of circuit seen on the right in your question above. This circuit tries to overcome the base-emitter temperature anomalies by inserting an emitter resistor and we try and mask the base-emiiter voltage a bit by making sure we have maybe 1 or 2 volts dc bias at the emitter. This dc bias sets the collector current. So now we are dealing with voltage and if we have 2 volts at the emitter we need 2.64 volts at the base so we use a potential divider. As was previously mentioned in the linked answer, a benefit to having an emitter resistor is that the impedance looking into the base is approximately \$R_e\$ x hFe so, if \$R_e\$ is 400 ohms then we should expect to see an impedance looking into the base of about 100 x 400 ohms = 40 kohm. This makes it easy to choose resistor values for a potential divider because the base isn't loading things too much. So, you are not comparing apples with apples - if you want an uncontrolled common emitter amplifier with no emitter resistor then you can choose a single base resistor; if you want a much more reliable common emitter amp go for the circuit on the right and use a potential divider.
H: Would a stepper motor driver chop a high current to its max allowable limit efficiently everytime? We are using this stepper motor driver A3967(https://www.sparkfun.com/products/12779). If we increase the input current to the driver to 2Amp, will it cutoff the current to the motor at 750mA everytime since it is a chopper driver? AI: You can't increase the input current, the driver will sink the needed amount which in your case is 750mA (per phase IMO, so 1.5A total). You have to provide a stable voltage source that can source at least that amount of current, higher is better. Q: Will the chopper driver limit the current efficiently anytime? A: Well, it depends on the setpoint speed and supply voltage. The motor is always producing back EMF voltage - generator mode. As long the supplied voltage is greater than motor BEMF voltage, then it will be able to maintain the current at setpoint level. At higher speeds the motor BEMF voltage becomes high, almost the same as supply voltage. In this situation the potential difference is zero and it is impossible to feed the motor with such current. The motor looses torque at high speed. Higher voltage -> higher max. motor speed.
H: Is thinner solder better? I have a few types of solder. One of them is 0.4 mm and the other is around 0.8 (not very sure). Which one should I use for SMD, and which is good for general purpose? I have heard that it is best to learn with a thinner wire. Is this true? AI: The primary way of controlling how much solder you feed into a solder joint is by the length of solder you shove in. Thus if you assume a certain "length accuracy" of your hand, the overall volume accuracy of a thinner wire is higher. I personally use .5mm or less for most work, even non SMD, unless the solder joints are really big.
H: Altium Designer 3D collision/distance problem I'm using Altium designer 17 and I want to make a 3D layout of my board. My only problem is that whenever I place a piece on the pcb, the component is flashing green and it says Collision. It Collision even if nothing is touching the pcb. Exemple this transfo: AI: It sounds like your vertical component clearance is set to infinite, or at least a ridiculous number. I generally set mine to 0mm unless a specific application requires that I change it. You can modify this value in the Design -> Rules window (shortcut D-R), down near the bottom under "Placement". Look for "Component Clearance" and set the "Minimum Vertical Clearance" to 0mm. If the radio button to the left is set to "Infinite" you'll have to change it to "Specified" before adjusting the number. See if that helps.
H: Voltage Generator with Full Wave Rectifier I have simulated a circuit which gives +12V and -12VDC output. I am planning to obtain input signals from a transformer. I have some questions related to it, if you share your ideas i will be very happy. I used LM7812, LM7912 regulators and S1M diodes. There is a delay at the beginning of the output2 signal (-12V). What can be the reason of it? Is simulation the reason of this delay or will it still there when the cirucit is set in real life? How can this be prevented? I intend to use this negative supply for SN75188 VCC- pin. Can this delay affect IC's operating? If a special IC like MAX764 is used, does this delay still happen? This is my circuit; Output Voltage Signals: Output Current Signals (Reversed because of LTSpice's display of current, both signals should be inverted): AI: You are driving your simulated bridge with two sources ​that are in-phase. Presumably, these are supposed to represent the output of a center-tapped transformer. This is incorrect — the sources should be out of phase. Either reverse the connections to the lower source, or change the sign of its amplitude parameter. With them in-phase, they both reach their positive peak during the first half-cycle, and their negative peak during the second half-cycle, which explains your results. This is why you should always graph both the inputs as well as the outputs in a simulation — this issue would have been immediately obvious.
H: Baking SMD integrated circuits for prolong time I recieved samples of AD7175-2 and AD5684R with an instruction: If these samples are to be subjected to solder reflow or high temperature process, they must be baked for 24 hours at 125°C prior board mount. Failure to comply may result in crack and/or delamination of critical surfaces within the package. Is it done in a reflow oven? Otherwise how? I am confused because Elektor qs-5188C reflow oven in our lab seems to lack an option, that would let it run for such a long time. AI: The whole point of performing this pre-bake before soldering or reflowing the devices is to ensure you've slowly pushed out any h2o. If you don't do this, if you go straight to soldering or reflow, the sudden high temperatures can cause the h2o to go straight to steam in a hurry causing catastrophic separation of parts within the device. You can bake these parts at 125 degrees in any oven that will maintain that temperature (conventional, reflow, convection). It doesn't have to be terribly accurate so long as you can gently/slowly evaporate the h2o. After this is done, any shock temperature isn't going to cause issues during the soldering/reflow process.
H: Missing pads allowed on BGA? I'd like to use a 0.35mm BGA in a new design. If possible, I'd like to do this without resorting to an expensive manufacturing process with microvias. This is possible for my particular application, if I can pull a little trick. All of the pads I need for my application are around the perimeter of the chip, except one. The other internal pads I don't need. Perhaps I can just miss out the pad that's in the way of my track, and hope that the solder resist prevents a short. Question: Is this a sensible thing to do? AI: Yes and no. You can omit pads if you wish however, the following issues can occur. If you run traces under the ball and trust the solder resist to act as an insulator you are likely to get shorts or insulation breakdown/capacitive coupling through the resist. It simply is not intended for that purpose. If you remove too many pads you are reducing the mechanical stability of the device attachment. If you remove too many pads you will be reducing the thermal conductivity of the device to the PCB and may incur greater heating problems with the device. As such, it is recommended that missing pads be kept to a minimum and no traces should be routed under the pins. EDIT: If the pin on the device is an unused input and there is no issue if there is a short to the underlying trace, fan-out etc, you could get away with it... but really, if that is the case, then just wire it that way and keep the pad in.
H: Wrong load capacitance for 20 MHz, 20 pf crystal I am new to microcontroller development, and I wanted to try running the MSP430f5529 off of an external crystal of 20 MHz that requires 20 pF of capacitance. I read on the datasheet that the pins can support up to 12 pF of internal capacitance, which is what I planned around when I ordered external 22 pF capacitors. When using the equation described here. $$\frac{(22+12)\cdot(22+12)}{22+12+22+12} + \sim3 = 20\,\text{pF}$$ Unfortunately, I did not do my research well enough, as it seems that XT2 (the high frequency external register) does not have internal capacitance. The XCAP bit is only for the XT1 register. My question is, will the lower capacitance be a significant problem for running the clock near 20 MHz (±500 kHz)? $$\frac{22\cdot22}{44} + \sim3 = 14\,\text{pF}$$ That makes it 6 pF less then desired. edit: Also, I do not know if this is how capacitors work in series, but another option is I could put two of the 22 pF ones inline on one terminal. So I could have $$\frac{(22+22)\cdot22}{22+22+22} + \sim3 \simeq 17\,\text{pF}$$ Does that work? Thanks AI: To get the specified 20 pF load for a crystal, you need two 40 pF caps, theoretically. However, these 40 pF caps in reality do include package pin capacitance (2-3 pF each pin), plus parasitic capacitance of traces and pads under the IC and under XTAL, which typically are about 5-6pF. Therefore in your case you should use about 33 pF caps. Together with pin and trace capacitance it will form the desired 40 pF. The parameter you seem to be concerned with is called "crystal pullability", see this publication for brief explanation and typical dependence. Deviation of +- 5pF from the designated 20pF load will give you at most +- 100ppm, which is about +- 2 kHz for a 20 MHz crystal.
H: Configure UCSCTL0 register MSP430F5529 First off: I'm brand new to microcontroller development, so please forgive me for the simple question. I'm trying to learn for my FIRST robotics team so we can use the MSP430 to handle some extra sensors. I'm working on understanding/configuring the Unified Clock System. I want it to run on the 25 MHz setting. I've been reading the family guide and device specific datasheet. I think I have a basic understanding. My code is below: /* * Objective: have SMCLK run at ~25 MHz for driving an SPI device */ WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer __bis_SR_register(SCG0); //Disable FLL UCSCTL0 = DCO0+DCO1+DCO2+DCO3+DCO4 ; //DCO 31 bit and MOD bit 0 [THIS IS NOT WORKING] UCSCTL1 = DCORSEL_4; //Select frequency range on http://www.ti.com/lit/ds/symlink/msp430f5529.pdf page 31 UCSCTL2 = 0x000; //Select no loop divider UCSCTL3 |= SELREF_2; //Set FLL reference to REFOCLK (only internal) UCSCTL4 |= SELS__DCOCLK; //Select SMCLK clock source to be DCOCLK P1DIR |= (BIT0 + BIT2); //irrelevant P2DIR |= BIT2; //Set P2.2 as out direction to monitor clock P2SEL |= BIT2; //Select P2.2 as SMCLK output defined in http://www.ti.com/lit/ds/symlink/msp430f5529.pdf pg 84 __bic_SR_register(SCG0); //Enable FLL However, this isn't working well, resulting in a very strange oscilliscope output for two reasons: The output's waveform is not how I usually see the clock output. Usually I see something resembling a sin wave, now I see something very different. The waveform shows the clock to be running at ~2 MHz not the desired 25. Ignore the green line. AI: According to the MSP430F5529 datasheet, this MCU supports "up to 25-MHz System Clock" rate. Consequently, achieving 39 MHz stable operation is not possible. On msp430, it's often possible to write DCO configuration values in the registers that are out of the range of the MCU capabilities. Looks like this is what's happening here. Try setting UCSCTL1 to DCORSEL_4. That should give MCU clock speed in range from 12 to 28 MHz according to the datasheet.
H: What is the terminal labelled "U" in some autotransformers? I'm trying to wire an autotransformer for usage as a speed controller for a brushless motor fan. The terminals are quite self explanatory: Pe for ground, L-N are my input, N1-L1 are unregulated output (same as L-N) and U-N are the output to my motor. Having that said, I'm still hesitant to wire this up before I understand the the following: Q1: What is the U terminal? What does it stand for? Q2: Do I connect my motor's ground to the common Pe? I'd have imagined that there would be a dedicated terminal for the ground near the output to the motor. Here's a picture from inside the transformer's case: Transformer's datasheet https://www.sentera.eu/Product/ViewDocument/ENG/?DocumentId=690814&ArticleID=108450 AI: Sentera's website shows a connection diagram for a similar controller: Figure 1. Source: Sentera. Pe for ground, L-N are my input, N1-L are unregulated output (same as L-N) and U-N are the output to my motor. N1-L should read N-L1. Yes, unregulated output but on when running so it is switched. Q1: What is the U terminal? What does it stand for? 'U' is commonly used in Europe to mean 'voltage'. It makes sense when you think that we use 'I' for current and avoids confusion between 'voltage' and 'volts'. U1 and U2 are the fan terminals and the naming suggests that neither of them is at neutral potential so the triac is likely to be in the neutral line. Q2: Do I connect my motor's ground to the common Pe? I'd have imagined that there would be a dedicated terminal for the ground near the output to the motor Yes. It appears that they have been a bit mean with the terminals.
H: Opamp input voltage divider creates wrong voltage - what could be the cause? I'm using above 1:2 differential opamp, when 72V applied to the 30:1 voltage divider, voltage across R1 is only 1.727V instead of 2.4V, opamp output is around 3.4V. Opamp is LMC6062IN/NOPB http://www.ti.com/lit/ds/symlink/lmc6062.pdf I think it's because of bias current, any suggestion on solution? Follow up question: Same circuit below but now this time 0V does not connect to circuit main GND, so there is not second voltage divider but i am seeing around 1.5V across R1 simulate this circuit – Schematic created using CircuitLab Follow up question #2: simulate this circuit Switch on both side of V1, top and bottom circuits are identical differential opamp circuit, bottom one is before switches and connect to v1 directly, top one is after two switches. When SW2 is open, SW1 is closed: voltage across R3 is 1.4v, output 2 is 2.83v. voltage across R23 is 0.532v, output 1 is 1.08v. Seems like R3 is in parallel with a 60K resistor, does that mean two op amps' inverting and non-inverting pin are tied together? I am using a dual op-amp. AI: ... when 72v applied to the 30:1 voltage divider ... It's not 30:1, it's 31:1. \$ V_{OUT} = V_{IN} \frac {10k}{200k + 100k + 10k} \$. ... voltage across R1 is only 1.727 V instead of 2.4 V. But you have a second voltage divider in parallel with R1. "R1" is now effectively 7.5 kΩ. The voltage at R1 will be \$ V_{OUT} = V_{IN} \frac {7.5k}{200k + 100k + 7.5k} = 72 \times 2.44\% = 1.75 \; V\$ and the voltage into the non-inverting input will be 2/3 of that = 1.17 V. Im (sic) thinking its because of bias current ... I'm thinking it's because of biased thinking ... simulate this circuit – Schematic created using CircuitLab Figure 1. OP's second attempt. In the standard inverting and non-inverting op-amp amplifier configurations the output will adjust until the difference between the two inputs is very close to zero. For practical analysis they are connected together as shown in Figure 1. Now it is clear that you have 20k in parallel with your 10k of R1 giving 6.67k. Running the calculation again the voltage at R1 will be \$ V_{OUT} = V_{IN} \frac {6.67k}{200k + 100k + 6.67k} = 72 \times 2.17\% = 1.56 \; V\$ Your question 2 circuit is a bit of a mess and I don't think I could analyse it for you. I think you are trying to combine a traditional voltage divider on an non-ground referenced source and feed this into a differential amplifier. I doubt that this is necessary. Figure 2. Just use the differential amplifier itself. For example, setting R1 and R2 to 100k and Rf and Rg to 1k would give you a differential amplifier with a gain of 1/100. Your 72 V input on the original circuit would then give an op-amp output of 0.72 V (if it can swing that low). Why complicate things?
H: Configuring BLDC motor for low-speed application Given: I need to the simulate sinusoidal forces on a wind-tunnel model using a bench-top setup. I've designed a rig where I spin a load at high speeds to generate centrifugal centripetal forces, and those forces--which will periodically align completely in the X, Y, or Z directions--will serve as my sinusoidal forces. I will mount the rig on top of a six-axis load cell, and I will measure the periodic forces via the load cell. At this point, my load consist of a TBD-length aluminum or steel rod. I've derived the following expression for my loading given the rod's mass/unit length (\$\rho^{l}\$), desired centripetal force (\$F_c\$), the length of the rod (\$L\$), and the distance from the end of rod to installation bolt hole (\$d\$): $$ F_c = \rho^{l} (\frac{L^2}{2} - Ld)\omega^2 $$ or, when re-arranged to solve for \$\omega\$: $$ \omega = \sqrt{\frac{F_{c}}{\rho^{l} (\frac{L^2}{2} - Ld)}} $$ Problem: For safety, I'm trying to keep the forces and speeds low. To generate a 2 lb. (8.90 N) load and a 20 lb. (89.0 N) load (one load needs to be 10X greater than the other) with a 4 inch (0.0762 m) long, 0.5 in (0.0127 m) diameter steel rod, I require spinning my rods at 467 RPM (48.9 rad/s or 7.8 Hz) and 1478 RPM (154.7 rad/s or 24.6 Hz) respectively. Originally, I just bought 2 hobby BLDC motors and figured I'd command "slow" speeds via the ESC, but now I realize that they operate way too fast for my 2 lb load without some sort of reduction. A quick test of the Viking motors at 2 cells and a "slow" PWM command (1 ms/20 ms pulse) yielded average speeds around 1200 RPM. My questions: Given that I only have 2 weeks to run my experiment, will a brushed DC motor like this work for the 2 lb. load, or is the motor going to wear out? More abstractly, what is the usable continuous-operation lifespan of micro brushed DC motors? How strong are the ball bearings in small, hobby BLDC motors? Could my Viking motors withstand a 20 lb. radial force? More abstractly, what is the radial force limit on small, hobby BLDC motors? Would you recommend some other motor system for this low-speed application? Stepper? BLDC with smaller \$K_v\$? BLDC + speed reducer? Many thanks, and please let me know how I can improve my question. UPDATES: Your comments/answers and further research on my end are pushing me towards buying some sort of speed reducer for both motors/loads. I will operate my motors at 4000 and 6500 RPM, and I will use 11.73:1 and 4.5:1 speed reducers + external ball bearings to safely reduce 4,000 RPM and 6,500 RPM to near 467 RPM and 1477 RPM respectively. Thanks to @John Birckhead for making me think about this: My steel rods have mass of 0.098 kg, length of 0.102 m. When the rod is perfectly parallel to the ground, rotating the rod will require torque (T) of 0.053 Nm | T = mgL/2 = 0.053 Nm. If \$K_\tau = \frac{1}{K_V}\$, then my motor has a Kt of 0.0023 Nm/A, and generating 0.053 Nm of torque will require 22.8 A (!). This is greater than the max current rating of the motor (16.7 A). I understand momentary current spikes from a motor are OK, but can a motor sustain momentary current spikes for many cycles? This gravitational torque will fight my motor for a fraction of every cycle. AI: Side loading is probably an issue with a motor this small, but here is the real problem: if the rod "weighs" .96 N, and the center of gravity is .102/2 or .051 meters from the shaft, you have a torque load of .049 N-m on the way up. Even if you find a motor large enough to provide this torque, it won't run at a constant speed because you will have this torque opposing you on the way up and aiding you on the way down, so you won't get a sinusoid with any small bare motor without feedback. You could go with a stepper or possibly a brushless or brush motor with a gearbox and hall feedback, or if sensorless, very good speed control. By the time you get to a motor or gearbox capable of providing the torque, you will likely have bearings that can handle some side loading.
H: SPI: MOSI not dropping LOW for receiving device I hope this question is not a repeat of others on this stack exchange concerning SPI. I've been searching for at least an hour and have not found the same problem/answer. SCENARIO My friends and I are attempting to get an OLED and rotary encoder working together using our own personal board. Right now, we just want the position on the encoder to show up on the OLED. An absolute position rotary encoder is hooked up with a development board using the ATmega2560 chip. The 2560 is talking to the encoder with these SPI settings: Master Mode (SPI Mode 3) Phase: 1 Polarity: 1 SPI Prescaler at f_OSC / 128 (current CPU Freq = 16MHz) OLED: Adafruit SSD1306, 1.3" 128x64 Encoder: iC-MU Absolute Position - iC-MU Position Encoder Datasheet I have the current program set to read from one of the encoder's internal EEPROM registers every second. Although I'm not yet certain about addressing the EEPROM accurately, the problem I would like to address is different. PROBLEM I wasn't getting a response from the encoder, so I hooked up an oscilloscope and checked all four SPI lines, as seen below. For some reason, the MOSI line never drops below ~3.50V. The receiving device would still consider this a HIGH signal. I have tried tapping into the OLED SPI connections since the display itself works with SPI. Nothing new happened. I've double-checked that I still have a working board, constantly reconnecting the OLED and disconnecting the encoder. The board definitely still works. What might be the problem with the SPI? Is there a specific name for this problem? AI: What might be the problem with the SPI? That scope trace suggests that there is another driver on the MOSI signal, in addition to the MCU. That is bad, since MOSI typically uses a push-pull driver and multiple push-pull drivers will conflict, if they attempt to drive to different logic levels at the same time. As a result, you tend to see a "stepped" voltage like you see on your MOSI scope trace, when the different conflicting drivers change the logic levels that each is driving. (In the worst case, multiple drivers of the same signal can become permanently damaged, if they exceed their allowed maximum sink/source current through the opposing driver.) It isn't as simple as MOSI being shorted to Gnd as we wouldn't then see it reach ~5V, nor is it shorted to ~5V since the signal is 0V at the start of the trace. There appears to be a low resistance (e.g. another device's output driver? a low value resistor?) pulling it up. (See below.) Is there a specific name for this problem? Conflict between multiple drivers on the same signal. Your next step is to find out what else is driving that signal and why. I browsed the encoder's datasheet. It is worth noting that it doesn't have a fixed SPI interface. It has a programmable serial interface, which can be SPI but can also be in other modes. I would check your programming of (and connections to) the encoder, to see if that is in a mode where it is driving the pin, which you believe is MOSI in SPI mode. Notice how the MOSI signal starts at 0V, and goes to that ~3.5V level when -CS becomes active (low). Below, I have added a vertical white line onto your scope trace, to show that MOSI rises to ~3.5V at the same time as -CS is driven low, before the first clock pulse on SCK: That correlation is a big hint that you are enabling the conflicting driver on the MOSI signal, when you drive -CS low. Assuming that the -CS signal goes only to the encoder, then that again makes the encoder the primary suspect.
H: What are the (ill) effects of drawing too many amps through a DC power supply I am running 256 WS2811b RGB LED "pixels" off a 5V 8A power supply. After about a week, I'm noticing the power supply runs quite hot and I'm worried I'm damaging it (or causing some other ill effects that I"m not aware of). Since a lot of the time the LEDs are near full RGB max brightness, I'm using the full 60mA/"pixel" to calculate peak current draw, which is working out to ~15A. I'm keeping this project disconnected until I get some responses here just in case! AI: I'm keeping this project disconnected until I get some responses here just in case! I'm afraid nobody (sensible) is going tell you that all is OK and that you should carry on. A little background info. Power supplies are generally used to convert power from one voltage and current to another. The relationship between power (P), voltage (V) and current (I) is given by the simple equation \$ P = VI \$. If your supply was 100% efficient the \$ P_{IN} = P_{OUT} \$. For simplicity here we will assume that it is. You require 15 A at 5 V so \$ P_{OUT} = VI = 5 \times 15 = 75 \; W \$. In Canada your mains voltage is 120 V. The current you will draw from your mains will be \$ I = \frac {P}{V} = \frac {75}{120} = 0.625 \; A \$. Give that your power supply < 100% efficient the actual mains current will be more like 0.8 to 1 A. Your power supply contains various components such as resistors, semiconductors and wires or PCB traces each of which has a maximum operating temperature. The temperature will rise on each until the power lost as heat = electrical power input to each component. This is thermal equilibrium. The power dissipated in each component will also be given by \$ P = VI \$ but this time \$V\$ will be the voltage drop across that particular component. Now if you double the current drawn from your supply \$I\$ will double but so will the voltage drop across the component (typically). Power dissipated could now be four times what it was originally. The new thermal equilibrium will be at a much higher temperature. Once this exceeds the component's maximum it dies - often in smoke. Fire is a very real hazard in budget power supplies as every corner has been cut to shave the last cent off the price.
H: How to repair ripped off solder pad So the left button of my mouse was broken and I wanted to repair it by replacing the switch. But when I took the switch off the solder pad came off too. As you can see in the picture below I tore it off clean. Is there anything I can do to save and fix this? For the record I am a beginner in soldering so I am new to many terminology and methods. Thanks! AI: As @DigitalNinja says, solder and crazy glue would do it. Perhaps get a hand lens, or one of those lighted magnifier strap-ons. so you can see close up. It looks like the trace leading to the missing pad is going through the white letters "R6", then dives into the board through a small round "via." Use the back of a razor-knife to scrap all the green soldermask off this trace and via. Don't scrape off the copper. I'd try first gluing down the torn-off pad in its original place. (Carefully unsolder it from the switch, without bending it, then glue it down using a tiny droplet of crazy glue.) Then, use solder to "tin" the scraped copper trace, then solder a tiny wire from the glued pad to the trace. Finally, solder in the new switch. Normally it's a very bad idea to glue down a component, but for a heavily-used button you might consider it. Crazy-glue under the switch body after it's soldered, since the copper pads are the only thing holding it down, and they aren't as strong as before. (Otherwise, glue parts down with silicone caulk, which doesn't prevent later removal.)
H: Mechanical or Solid State Switch for 48V DC and 2 Amps current I've been looking for a SPDT switch that can support 48VDC and 2 Amps current but so far I haven't had any luck. It can be mechanical or solid state it doesn't matter. Is there such a thing? AI: An SPDT able to support 48V potential difference and 2A continuous current may be a bit beefy (physically). If you must have a smaller switch for the user to interact with, you can use a small switch to activate an SPDT electromagnetic relay switch that supports 48V, 2A. There are power FET's that can get the job done as well.
H: Effect of cooling a DC power adapter with too few amps? I have a device (PC fan) which wants 2.0 amps, and a DC adapter that supplies 1.8 amps; both 12v. As I understand it, using this adapter will cause overheating and reduced voltage. My probably-foolish theory is that I can cool the adapter (I'm customizing a refrigerator for homebrewing) to make up difference, and prevent either device from failing. Assuming I keep it safe and dry, what are the effects I should expect from cooling the adapter to ~15ºC? Will the voltage hold at, or move closer to 12? Will either device be damaged? ...is my initial assumption even accurate? Thanks in advance! AI: The correct answer is, "find the appropriate sized adapter." A quick Google search found them for $6 and up. Your underpowered fan will not operate efficiently, leading to downstream heating problems that you're not considering. Cooling the outside of the adapter is only half the battle. You need to worry about thermal transfer from the transformer inside the adapter to the outer casing. If the adapter can't move its internal heat to the surface fast enough, it doesn't matter how cold you get it. It will eventually burn up. If you get lucky and there are no downstream consequences and the adapter can cool itself fast enough ... then you've come up with just about the most expensive solution to the problem I can imagine. How badly do you want that brew? Remember, the correct adapter is $6+shipping.
H: I2C problem on STM32F303 processor, what is happening with SDA? I am trying to add an I2C display to my remote control drone. I can't get the display to work. I took the same code and copied it to a stm32f303k8 nucleo and got the display to work. I moved the code back to the drone and tested on the STM32F303cc processor. It doesn't work. The signals below are form the exact same line of code going over I2c on both chips. Well, recompiled in the cubemx framework for the different chips of course. The yellow line is scl. The blue line the clock. The yellow line with the squiggles is from the drone that doesn't work. The other 2 are from the working nucleo. What is wrong with the signal on the drone, the stm32f303cc chip? Why is it really squiggly. Both have pull resistors 2.2k and 4.7k. Specifically, why is the yellow line below, top image, split 50/50 between high and low on what looks like the acknowledgement bit? Thanks AI: split 50/50 between high and low on what looks like the acknowledgement bit [...] It looks like a tug of war between high and low on the ack Correct, and that means that the I2C Master didn't actually release the SDA line, for the I2C Slave to perform the Ack. In turn, that means that the GPIO pins used for the I2C bus on the I2C Master (likely both pins, but certainly SDA) were incorrectly configured and left at their default of "push-pull", and not switched to "open-drain", as required for I2C operation. That's what causes the "tug of war" as you described it, or as glen_geek said: "why does SDA line not pull all the way down to ground?" The answer is that SDA (and probably SCL too, but most slaves don't try to drive it) is still being driven (by a GPIO pin still configured as "push-pull") and not released (with passive pull-up only) as an "open-drain" pin would be. If you are relying on STM32CubeMX to write the initialisation code, then you've either just discovered a bug in the version you are using (look for updates & errata) or else configuring it incorrectly (I don't use it, so can't tell you which setting may be wrong). On the Nucleo, the I2C is on I2C1. On the drone, it is on I2C2. So the I2C ports are different between the working and non-working configurations. That could easily explain why your problem shows up only on one configuration, if the STM32CubeMX framework isn't correctly initialising I2C2 (and there have been port initialisation bugs which affect only some ports).
H: LM317 Get Stable Output voltage at 1,25 V I am currently trying to use the LM317 with a stable output voltage of 1,25 V. The general formula is $$ Vo = Vref\cdot\left(1+\frac{R2}{R1}\right) + Iadj\cdot R2 $$ I used this circuit to create the 1,25 V output voltage: simulate this circuit – Schematic created using CircuitLab This circuit is directly according to the formula. R1 is infinitely high, R2 is zero. In general I measure the 1,25 V output voltage. But when the load is drawing current, everything gets unstable. Then I measure voltages higher and lower than 1,25 V... I read some things regarding the minimum current in Adj Terminal. Therefore I thought about calculating R1 to create Iadj at ~50µA (according to ST LM317 datasheet). But whats with R2, should it be shortened to ground in this case? I also thought about inserting a series resistor at the output, just to create a small load of ~1mA. Maybe the LM317 needs a minimum load... Are there any suggestions? Thanks for your help. AI: Yes, as suggested, the LM317 DOES need a minimum load. The specification sheet suggests about 10 mA, LM317 see table 7.5 "minimum load current". The bias current to run the internal error amplifier comes from the input pin (#3 of the TO220 package) and the circuit is completed by output current at the output pin (#2), while the sense pin (#1) carries only a small trickle of sense current. If the R1 resistor is 120 ohms, it will be an adequate load resistance (R2 = zero ohms). Lacking an adequate load, though, the formula is inapplicable, because the internal amplifiers are lacking the needed power supply current.
H: Understanding Mosfet simulation and initial conditions in Spice Here is a simple circuit with a P mosfet. I got a strange behavior when powering a circuit, so I isolated this part to understand it. Circuit is powered at t = 3s (I've used a pulse input voltage source to simulate it). Here is a zoom on power on : blue plot : input voltage green plot : PMOS gate voltage red plot : output voltage As we can see, when circuit is powered on, during a transient phase of some µs, PMOS is closed. How can we explain that? Are some initial conditions missing in LTSpice simulation? AI: How can we explain that? Actually it's the parasitic drain source capacitance that is inside the MOSFET that is producing the pulse at the output. Nothing really to do with conventional MOSFET action. The FDC5614P has an internal capacitance of 90 pF and the CR time with R3 is 90 ns. At 5x CR the transient waveform should be pretty much over so that is a time of about 0.5 us and this looks about right on your graph given that you have a scale granularity of 2 us and my powers of interpolation aint that good! Try shorting gate and source and removing C1 and R2 and repeat the experiment. I bet it looks very similar.
H: how to calculate the power of the energy harvester this is a tough question for me.looking for your guys's help.This energy harvester use DC motor to collect the energy.And an external electrical load R is connected to the generator,i got an oscilloscope to to record the curve of voltage.Then the power of output is is it right? and i tried the resistance of 200ohm,the curve likes this but i tried the 1Mohm the curve is almost keep the same. If you can help me with this i wll be really really grateful for you kindness. AI: Yes, the average power is as per your equation. Possibly why the waveforms look similar between a 200 ohm load and a 1 Mohm load is that you are nowhere near the best maximum power transfer load of your generator i.e. 200 ohms and 1 Mohm both represent a light load and will hardly alter the output voltage shape at all.
H: Find transfer function from Bode plot This is my Bode plot The solution manual says the function plotted is $$\frac{s^2+0.02s+1001}{s^2+2s+101)(s^2+20s+10100)}$$ What I know is the Bode plot for $$\frac{s^2+2ζω_ns+ω_n^2}{ω_n^2}$$ and the inverse of that. I can see three peaks at ω=1 , ω=10 , ω=100. Since the plot is going up after the peak we have a second order equation on the numerator. Then we have a second peak and then the plot is almost a straight line so I guess there is a second order equation in the denominator followed by another one afterwards because of the next peak. The phase diagram makes sense as well for the above. The initial value is -120 so we must have a constant given by :$$ 20logK=-120=>K=10^{-6}$$ So my transfer function must be of the following form : $$10^{-6}\frac{s^2+2ζ_1 1s+1^2}{\frac{s^2+2ζ_2 10s+10^2}{10^2}\frac{s^2+2ζ_3 100s+100^2}{100^2}} $$ Can I find the ζs? This is a question from an exam so I should be able to , by hand . But I also get a quite different result. This is what I'm using : AI: Background The solution given in the book is wrong because the numerator in the given solution would make the notch frequency at \$\sqrt{1001}\$ and clearly it is at about 1 radian per second. Answer how can I find the damping ratios ? Pictorial analysis of the bode plot: - I've drawn the red lines on to show what I consider to be flow of the frequency response should the peaks and nulls be subdued. This allows me to say that the resonant peak at 10 rad/s is about 12 dB and ditto at 100 rad/s. Knowing that for a fairly undamped filter, Q (quality factor) is the peaking value as per this graph on this answer: - You could use the more precise formula detailed lower down in that picture but I suspect assuming the peaking amplitude = Q is good enough. So, we can say that Q is approximately 12 dB converted to a real number i.e. about 4. Because Q = 1/2\$\zeta\$, \$\zeta\$ = ~0.125. We can also fairly well say that with the three resonances at factors of ten difference there is little interaction to muddy the waters too much.
H: Adding a variable offset to a signal I would like to add an offset to a signal to send it on a differential ADC. But i want to be able to control the value of this offset with a PWM. My sensor has a bandwidth of [1-100Hz] and i only have a 0-5V supply. It works well with offset of 2.5V / 2V / 1V but for 0.512V i have an offset of 4V instead at output. And i don't understand why. The OP-Amp use is a TL072, maybe it's a limit of that Op-Amp? If you guys have an idea about how i can fix that or which Op-Amp should i use or an another way to doing that i'll like to hear that ! Thank you File: https://www.catupload.com/download/c5e9aaaa13797a98368cb01dce96e3f5.html Schematic V2 : AI: The input common mode range of a TL072 doesn't get to within 0.5 volts of the most negative power rail (0 volts) in your circuit. That is your likely problem. Try looking for a rail to rail opamp or maybe try an LM324. Additionally, the minimum recommended supply voltage for that opamp is +/- 5 volts.
H: Which nRF24L001+PA+LNA should I get? I ordered 5 nRF24L01+ chips for 2.4 GHz RF. I have not done tests with them, but doing tests with my current 433 MHz results in a low speed, few meters maximum range. So I expect with my 2.4 GHz RF's I also will need something better. What I would like is to built these into an enclosure, to communicate about max 10 meters, but with low latency/fairly fast speeds (like 250 kbps). These 10 meters will not have walls, but musical instruments, possibly many mobile phones from audience (also 2.4 GHz I believe), (music) power amplifiers and speakers, wireless microphones, mostly < 1 GHz etc. My questions: - Below I put some examples, but there are so many types, which of the types below would be sufficient for about 10 meters (noisy environment) range? - Did I miss other types which might be more suitable? 2.4GHz (simple ones) These are the ones I will get soon 2.4 GHz with PA+LNA These have PA+LNA and an antenna nRF24L01+PA+LNA YJ-13039 These do not have antenna but have PA+LNA See Link E01-ML01DP5 based on nRF24L01P, shielded, builtin antenna? These do not have a clearly visible antenna (but shielded) See link AI: The range you quote seems extremely low. Friis' transmission equation tells us that, all things equal (we will come back to that) higher frequencies suffer more signal loss. It states: $$ \frac{P_{R}}{P_{T}} = G_{T}G_{R}\Bigg(\frac{\lambda}{4\pi R}\Bigg)^2 $$ Where: \$P_{R}\$ and \$P_{T}\$ are the received and transmitted powers in Watt \$G_{R}\$ and \$G_{T}\$ are the receiver and transmitter antenna gain \$\lambda\$ is the wavelength in meters \$R\$ is the distance between the antennas (actually their phase centers). Note that this only applies in the far field! The dB version: $$P_r = P_t + G_t + G_r + 20\log_{10}\Bigg( \frac{\lambda}{4 \pi R}\Bigg)$$ For now, let us ignore the \$G_t\$ and \$G_r\$ terms, since in general they will be pretty close to one. The datasheet can give us a lot of information. To get an estimation of the range, what we need to look at is the received signal strength the device needs in order to, in the best case-scenario, operate. On page 15 of the nRF24L01 datasheet There is a table "Transmitter Operation". It tells us for the maximum output power (typical): $$P_{RF} = 0\ \text{dBm}$$ On page 16, we find the "Receiver operation" table. In this table, we can see that: $$RX_{SENSE2}= -82\ \text{dBm}$$ $$RX_{SENSE1} = -85\ \text{dBm} $$ The received power is the transmitted power minus the power lost along the way. In symbols: $$P_{R} = P_{T} - PL$$ Where \$P_{R}\$ is the received power in dBm \$P_{T}\$ is the transmitted power in dBm \$PL\$ is the path loss, in dB (Not dBm!) In other words the maximum pathloss the system tolerates at 1Mbps communication rates is: $$PL_{MAX} = P_{T}-P_{R} = 0 \text{dBm} + 85 \text{dBm} = 85 \text{dB}$$ That means that $$PL_{MAX} = 20\log_{10}\Bigg( \frac{\lambda}{4 \pi R}\Bigg) $$ $$R = \Big(10^{\frac{PL}{20}}\cdot \frac{4\pi}{\lambda}\Big) ^{-1} = 140\ m$$ That means that if you use half-decent antennas, no external amplifiers, it should work to about 140 meters. Ofcourse, in practice you will never reach this range. So, pretty much any board that uses the chip and hasn't been poorly designed will easily meet your requirements. (20 bytes within 5ms is about 32Kbit/s, so you have 968Kbit/s to spare). What could be happening is the following: A lot of other devices are causing interference You put the antenna too close to metal (the enclosure?) The boards you use are just really, really, really poorly designed. I would suspect a board with extra PA can do more harm than good, since it might actually cause noise and/or oscillations. The performance of an external antenna could allow you to mount the antenna far enough from any materials you don't want close. On re-reading your question, I noticed you saying: "These 10 meters will not have walls, but musical instruments". Is it possible that you are trying to use these modules very close to human bodies? If so, they could be an issue.
H: A DC source and only a Reverse Diode What will happen having only a DC source and a diode connected in reverse? Will the diode or the source overheat over time or something bad might happen if you let it operate like that? AI: You're about 1/5th the way from the center on the left of the graph. You'll get a marginal reverse current, but it's so little it wouldn't matter to much electronics. Your battery would drain ever so slowly. Internal battery drain current would probably be higher. So basically your circuit does nothing.
H: Random number generation with skewed distribution I would like to implement a fully-digital circuit that can generate a random variable X with P(1)=p, P(0)=1-p (where, ideally, the probability p would be configurable with a programmable parameter). An LFSR is useful for pseudo-random number generation and for getting a random variable in which probabilities to be at 0 or 1 are (almost) equal: this is not what I am looking for. The ideas I was thinking about: I could 'AND' the outputs of several LFSRs, but given that in my application p will often be <0.1, the number of required LFSRs would be unpractical. I could also try to add a comparator and compare the contents of the LFSR to some configurable threshold to get the probability p. But given that an LFSR 'shifts' its contents, wouldn't the successive outputs of the comparator be too similar or predictable? I am unfamiliar with these concepts, so I am not sure. I need the successive values of the generated random variable to be as independent as possible, but it is not a problem if the pattern of successive values is cyclic in the very long term (as for any LFSR output). Thank you in advance for any improvement of the above ideas or any totally different idea that could solve my problem. EDIT - A microcontroller is out of the scope of this question for two reasons: This implementation targets an ASIC I am limited in resources and I might have to instantiate this circuit a couple of times, a µC is just overkilling this has to be high-speed random number generation (a µC would would require several clock cycles) AI: You don't need to XOR many LSFRs to get something that looks much more random (less shifty) than a single LSFR. Other techniques to improve the output of LSFRs are to cache the output in a small 2 port RAM, reading out and then replacing a random bit each time, that random address given by another LSFR of different length. Given several short LSFR-based streams, you could construct a multibit number each clock cycle that goes into your comparator against \$p\$, making sure that at least a few MSBs are from the better sources. None of this mucking about will get you to cryptographic levels of random goodness, but it will mitigate against the most obvious shortcomings of the LSFR.
H: What is the proper way to earth aluminium profile frames? Frames built with aluminium profiles (such as 4040) do not make good electrical contacts at joints, because of the surface oxide protective layer. What would be a good way to properly earth these frames? On my frame sits a heater which runs on 220V. It would be dangerous if cables loosen out and touch the frame. AI: Bore a hole slightly smaller than the screw, use a self-tapping screw, connect earthing cable to screw with cable lug. Alternatively: there's ready-to-use slide-in terminals for exactly that purpose: https://www.youtube.com/watch?v=Abi-TyDWO4I Generally, screwing up something with a spring washer that is guaranteed to penetrate the oxide layer should do the job.
H: Need help finding the transconductance author of this book is referring to I am reading a book "Practical Electronics for Inventors" and I was trying to understand the FETs, at several places the author has mentioned about the trans conductance that he has noted with gm. I did understood what transconductance(gm)is but I took this datasheet for a reference to figure out if that is a static parameter or a parameter that depends upon various other parameters.In the datasheet there is a mention of Forward Transfer Conductance(gfs) & Output Conductance(goss). Which one is the Transconductance(gm), and what does the other conductance mean. AI: \$g_m\$ is a small-signal parameter that will depend on transistor biasing. Additionally, it will vary from device to device. Circuits must be designed to not depend on \$g_m\$ having a precise value, same as bipolar circuits must not depend heavily on \$\beta\$ as this will vary with biasing and temperature. \$g_{fs}\$ is the manufacturer measuring \$g_m\$ at one specific bias condition, to give a ballpark value of \$g_m\$. \$g_{oss}\$ is related to the output impedance, where \$g_{oss} = 1/r_d\$, again at one specific bias condition.
H: Connecting DAC to line out and headphones I am designing a PCB with a stereo DAC UDA1334BTS and two stereo jacks -- one for "line out" and the second one for headphones. My original plan was to connect the DAC output both directly to the "line out" jack and to an input of an amplifier TDA1308 which will be connected to the headphone jack (and use the recommended application schematics for both of them). However, the amplifier is an inverting one, which is not optimal for my application -- the two outputs would have different phases and the person listening to both headphones and line out would be confused. What is the correct approach for this kind of application? I can think of two possible solutions: Put an inverting amplifier to the "line out" signal as well so that both of them are inverted Use the amplifier in a non-inverting mode (Is that even possible? All recommended applications for similar amplifiers I've seen use the inverting mode) AI: Well you're in luck, as no one will ever be able to listen to both the headphones and the line out at the same time. How exactly do you envision someone listening to the line out? The signal is unamplified and not suitable to drive some sort of electric-to-human adapter like, well, headphones. Let's say you hook up headphones to your line out anyway. Aside from loading and distorting the signal, the poor quality result that is also feeding the headphone amplifier will be, well, amplified and totally down out whatever sound was coming directly and unaided from the raw line out signal, if it was ever audible at all. To put it bluntly: it doesn't matter. The situation you posit can't happen. Unless you're actually imagining a very different scenario than the one you're describing. Maybe you're imagining a performer listening on headphones while a venue's PA system is blasting the sound from the line out? Or maybe just a humble home stereo system? Nowhere in those scenarios is anyone listening to the headphone signal and the line out signal. Is the line out driving a giant PA system? Or living room speakers? No, of course not. It can't. The line out is doing the same thing it is already doing with your headphones - the line out is going to get fed into an amplifier. Because it cannot be heard by humans if it isn't. And who knows what signal chain awaits our poor line out. Is it fed directly into a power amp that drives some hard hitting cochlear cannons? Or is it gently fed into a preamp, and maybe a second preamp because reasons, and then finally into a distribution amp that feeds 10 power amps across an entire field? Or maybe it's driving a stepper motor driver to make a dot matrix printer drop a sick bass line. And someone is also monitoring all that over that headphone jack. Your line out at best is going to also go through some other inverting amp if it is going to ever be audible. It will be potentially inverted and reverted several times before it actually gets turned into sound waves. There is literally nothing useful you can do about this. Oh, and this is ignoring that the sound will always be out of phase with the headphones because waves that originate from different spatial locations will never be in phase . And likewise, they'll never really be perfectly out of phase m. Like that's just how sound works, and our brains have no problems dealing with all that nonsense on a nearly perpetual basis. And even ignoring all those points still, if it sounds weird, they can just swap the polarity of the wires driving the speaker or whatever the line out is feeding and boom - it's phase is now 180 degrees flipped. And one closing thought, it's relative phase that matters to our brains when it comes to stereo anyway. As long as the phase between the two channels is right, hearing the same two channels out of phase but correct relative stereo phase doesn't even matter. In closing, you don't actually have a problem. The best kind of problems are the ones that aren't!
H: 3,8 Volt to 1 Volt via Voltage Divider I am trying to get an analog reading from a YL-69 Soil Moisture Sensor onto my ESP8266-12F Module. The ESP8266 12F is powered via 3 AAA 1,2 (so 3,8 Volt when fully charged) Volt Batteries. The YL-69 Moisture Sensor and the Controller Board need min. 3,3 Volt. The ESP8266 12F's analog pin is only capable of reading 0-1 Volt. Reading the analog pin gets me 1024 every time no matter what conditions are present. so I tried a voltage divider with 1x 200 Ohm and 1x 100 Ohm resistor to bring down 3,8 to max. 1,18 Volt. It looks like this: Problem: I am not sure I did the right thing when trying to build a voltage divider. The reading now gives me values between 34 and 36 and that does not change when conditions are changed. Is the setup shown in the picture correct or did I something wrong? Did I use the wrong resistors or did I simply violate the principles of electrical engineering. Update: I tried 2K instead of 200 Ohm and 1 K instead of 100 Ohm and now I get values from 272 to 276.... something's still off... Is my setup correct? AI: The device you have does not provide an analog output- it is a simple resistance comparator (bridge circuit into an LM393 inputs): Since the LM393 has an open-collector output, your loading it will cause the LED D2 to turn on and will reduce the voltage substantially. You can use the output as a logic signal into your micro, but there is no analog signal to work with. The switching threshold is set by R2, and at mid-scale is when the sensor is 10K. You could try using the sensor alone, but you would have to add a resistor (like R2) and a voltage reference (maybe a 1.25V shunt reference + another resistor) to get a sort-of decent result. This is a particularly crappy moisture sensor since it has DC across the PCB and will not last long. I suggest throwing it in the garbage (by which I mean properly recycling the electronics which probably has lead) and looking for something better. Edit: The output impedance at the 'AC' pin is from 10K to much less, depending on the sensor state. The input impedance of the ESP seems to be fairly high, so you could try 100K+200K with a cap like 10n to ground. However the reading will vary directly with Vcc as others have noted. Note that you will not be using the board at all except for R1. So U1, D1/R3, R2 and maybe D2/R4 will serve only to drain your battery. If you want to add a reference, a MCP1501 with a single resistor replacing R1 would do a much better job and will not vary with battery voltage. It does not require an output capacitor (and should not have a large capacitor added), but a small cap on the input would not hurt. Put the resistor near the reference not near the sensor if you are running any length of wire. Since you would then have a 0-1V output you could dispense with the divider.
H: Do I need undervoltage protection? I am making a small, handheld device powered by a 9V battery. I am using this regulator and the ATtiny104. My question is, do I need to protect against a low voltage battery? The minimum input for the tiny is 1.8 volts so do I need a device to shut off the power when the 9V hits about 6V (and then rapidly drops voltage) or can the tiny handle such a voltage for the brief amount of time before the circuit turns off when the battery fully discharges. If it helps, I estimate the current draw of the circuit to be about 200-250mA. AI: There are two reasons for undervoltage protection. To protect the battery from discharging excessively- a condition that can damage rechargeable batteries or cells. To keep the circuit from damaging itself or something that it is controlling, including data integrity in EEPROM, flash etc. This may include ensuring an orderly reset so that it starts up in a valid state when power is restored. You will not damage the micro itself by applying voltage that is too low. Data corruption will probably not be a problem if your program doesn't write to nonvolatile data memory, and you clear the NVM lock bits with in-system programming.
H: What is the name and purpose of the following component? I'm trying to repair a small electronic door bell. I was wondering what is the name and purpose of the white box component ? It seems to be just a wire with some white body around. Is it a resistor or a fuse? My guess is that 4W22R means 4 watts 22 ohms but I'm not sure. How can I test that component is still working ? AFAIK the ground (the black wire) goes through the 400V capacitor first, then it has to go through that white component before going to the bridge rectifier. EDIT : I found out the issue : the zener diode is dead and acts like a wire (it's always closed). Because of this, the main 400V capacitor is never charging and don't provide power to the rest of the circuit. I disoldered the diode and tried to put 5.0V directly between the solder joints using a external power supply, it works again ! Thanks Marko Buršič for pointing out the zener diode. AI: I was wondering what is the name and purpose of the white box component ? It seems to be just a wire with some white body around. Is it a resistor or a fuse ? It's a resistor, perhaps wirewound. Look at the PCB where that component is soldered. Its component designator will probably be a number prefixed by "R". In combination with that capacitor C25, this is a "capacitive dropper" from the incoming mains voltage. You can read more about that type of power supply in this previous question and elsewhere. My guess is that 4W22R means 4 watts 22 ohms Yes. How can I test that component is still working ? With power completely removed and the capacitors on the PCB discharged, you could try measuring its resistance with a DMM and see if you get a sensible result. Since I expect it to be in series with C25 and no other components in parallel with it, then you should measure 22 ohms +/- 10% 5% The lack of discolouring gives us no indication of overheating (although doesn't disprove that it has occurred).
H: Help identifying a component in glass housing (looking like a resistor) and markings "PH 41 48" I have found an electric component and am asking what its name is. The orange thing is smaller than the a resistor, if that helps... Thanks all. New Info The characters written are: PH 41 48 AI: PH 41 48 That marking is the Philips (now Nexperia) version of the 1N4148 diode. Here is the Nexperia datasheet link, where that marking is confirmed:
H: Which of these connections are incorrect and why? Is there a difference in these connections and is there anything wrong on any connection? I am new to phase and neutral wiring. Kindly help me. AI: Putting colour codes aside*. Option 2 is correct. Option 1 will work, but is against regulations in the US, the UK and likely many other places. The problem is that the load will still be "live", even when turned off. This is considered undesirable from a safety perspective. Option 3 will leave the light on when the switch is open and cause a short circuit when the switch is closed. * Before doing any work you should find out what the colour codes are where you live (and whether people actually follow them). The colour codes in your image are wrong for the USA and archaic for the UK, but I believe there are some places where they are still correct.
H: Which frequency to consider in SPWM for a transformer, the resulting frequency or SPWM frequency? I am build an inverter with the EGS002 board, which has a SPWM carrier frequency of 23.4 KHz. In my mind the logic is that the transformer winding, material and size should be calculated using the carrier frequency, not the 60Hz that it will output since the variations on the magnetic field will be from the carrier frequency. Is this correct? Is the resulting frequency not important when calculating a transformer, only the SPWM frequency? PS: Of course that there are many other factors when calculating a transformer, my question only focuses on the switching frequency. AI: In my mind the logic is that the transformer winding, material and size should be calculated using the carrier frequency, not the 60Hz that it will output since the variations on the magnetic field will be from the carrier frequency. Is this correct? That is incorrect unless you have contrived a new method which doesn't match the standard sinusoidal PWM as exemplified below: - I've purposely chosen the slightly over-modulated scenario to demonstrate that the base frequency (60 Hz for example) is hidden in plain sight and, this applies to the under-modulated case too. It might be an option to get rid of the transformer and work with a full-voltage DC bus instead. The higher-voltage DC bus can of course be produced with a transformer whose dimensions are determined by the switching frequency.
H: Altium full-stack pad custom shape I an currently trying to reconstruct a PCB in Altium from the Gerber files. So far, I have been able to import the Gerbers in a PCB document. The existing Gerbers have through-hole pads that have a special shape in the inner layers (in green here): I am able to set the pad in full-stack mode, but I am not sure on how I can achieve the pad shape of the old design (unless maybe create a custom pcb component). Is there an easy way to do this? AI: The green arcs are a thermal relief for a connection to a plane on that layer. They are not part of the pad stack, or defined in the footprint. They are created automatically when a via or through-hole pad has to connect to a plane layer or copper pour.
H: Does inductance in a resistor matter if it is used as a bleeder resistor? I am designing a Marx generator and I want to place a bleeder resistor across each capacitor in every stage of the Marx gen. I have been looking at using low cost RI80 resistors from eBay. Each stage of the Marx will be charged by a 45kV power supply so I was thinking of using five or six RI80 10kV 3W 200MOhm resistors in series for each stage. I have run into conflicting data that RI80 resistors are wirewound or some kind of glass glaze film resistors. I know wirewound resistors have a large inductance. If they are wirewound does the high inductance matter if they are being placed across a capacitor and used as bleeder resistors? AI: Parasitic inductance is not really an issue for bleeder resistors. Wire-wound resistors should be fine.
H: Connecting an open-collector output to a transistor base using a single pull-up resistor I have a Hall-effect sensor with an open-collector output rated for max. 25 mA. This sensor will be used to switch an NPN transistor powering a 12 V LED strip. The load is 300 mA. Could I get away with a single pull-up resistor here? Assume the transistor has a gain of 100 and a saturation voltage of 1 V. If I use a (12-1) V / 3 mA = 3.6 kΩ pull-up resistor, would the transistor switch on the LED strip when the sensor output goes high? Secondly, could I use the same single-resistor configuration with a PNP transistor instead if I wanted the LED to switch on with a low signal from the sensor? AI: Could I get away with a single pull-up resistor here? Yes, but not the way you describe it. What you describe is called "dangle biasing" and is not recommended. It relies on the transistor's beta being constant, stable, and predictable. In reality it is none of those things. A transistor's beta changes with temperature, aging, collector-emitter voltage, collector current, base current, manufacturer, lot-to-lot variations - just about everything except the phase of the moon. This is why the long-time rule of thumb for driving a transistor as a saturated switch is to assume a gain of 10. That's 1 mA of base current for every 10 mA of collector current. That rule is from the 1950's, back when transistors (and especially power transistors) sucked. Today's are much better, and I'm comfortable with a 20:1 ratio. Since the sensor output is rated for 25 mA, use your same math to design for 15 to 20 mA of base current. For a PNP transistor, the sensor output now is sourcing the base current rather than bypassing it. Either way, the base current-limiting resistor is the same value. Add a 100K resistor from the base to the emitter to assure a fast and crisp turn-off.
H: Current between RC and RL parts of a circuit I got stuck on a problem, and I've found the source of my confusion but can't figure out. Cutting to the chase: in the following circuit, the behavior when the switch on the bottom is closed makes complete sense to me, the capacitor being an open circuit and the inductor being a short. However, when the switch is opened the current between the RC and the RL part immediately goes to 0, and I can't figure out why. The exact values on the capacitor and inductor don't seem to matter, this stems from a problem where no values are specified. More readable circuit from the original problem below. If anyone has any input on this it would be greatly appreciated. AI: I'll just give an intuitive answer to see if it helps. Both the RC and LC blocks have only two "ports". That means that if current goes in one port it must come out the other. No current can flow in or out of the outer ports because the circuit loop is open at the switch. That means that no current can flow in the link between the two blocks. Anything can happen within each two-port block without charge entering or leaving the block. In this case C will discharge its stored energy (\$\frac 1 2 CV^2\$) through its R and L will discharge its stored energy (\$\frac 1 2 LI^2\$) through its R. However, when the switch is opened the current between the RC and the RL part immediately goes to 0, Correct. The exact values on the capacitor and inductor don't seem to matter, ... Correct - although it does determine the decay time constant, \$ \tau _{RC} = RC \$ and \$ \tau _{RL} = \frac L R \$, of the current and voltage within those loops. From the comments: I got stuck in analyzing this based on discharge behavior/equations, and thinking why the capacitor and inductor immediately would have the same voltage on each side of the bridge to make ΔV=0, but maybe unnecessarily so. I didn't cover the voltages in the circuit as your question was primarily about the currents. In the steady state we have 2.6 V across the CR circuit. When the switch opens we will still have 2.6 V across that pair and this will start to decay with \$ \tau = RC = 1k \times 10\mu = 10\ \text{ms} \$. (After 10 ms the voltage will have decreased by 63%, at 3τ by 95% and 5τ by 99%.) Because you have an ideal inductor (zero resistance) the steady-state voltage on the LR circuit will be zero. When you open the switch the inductor tries to keep 2.5 mA flowing through it and the only path for this to take is through the parallel resistor. Notice now that there is a voltage drop across L as the current is no longer constant. Note also that the voltage across R is reversed compared to that on the capacitor circuit. The inductor loop time constant is given by \$ \tau = \frac LR = \frac 1 {1k} = 1\ \text{ms} \$. The voltage drop across that resistor will decay at ten times the rate of the other one. Interestingly, the voltage across the switch will vary as the capacitor and inductor discharge until after some time1 it will settle at the battery voltage. 1 After 5τ of the longer of the two time constants we should be within 1% of the long-term steady-state value. Tip: always include the component designators, R1, R2, etc. It makes it much easier to discuss "R1" rather than "the resistor on the left".
H: Why does my transistor turn "partially" off? I'm trying to get IV curves of the BFP720FESD NPN bipolar junction transistor using a PXIe-4162 SMU. I do a sweep of 0-3V on the collector for six base currents between 5uA and 85uA and measure the collector current. DUT schematic (please ignore the erroneous JFET symbol representing a BJT): Here is a picture of the setup: In the picture of the setup, the SMPM3 has a loop back I attached between the signal and shell of the SMP connector so that the emitter is connected to ground. Currently, my IV curves appear correct up until roughly the same percentage of their maximum Ic (or to the same slope depending on how you want to look at it). Please ignore the random disappearance of the curve in the graphs (I believe that's a separate issue). For reference, here is an IV curve I took of the same transistor on a different board with no capacitors and with its emitter connected directly to ground on the PCB (no external loop back to ground). What is causing my IV curves to dramatically dip as if partially turned off and the other visible odd behavior? AI: I've seen this frequently when using excessively inductive (i.e. excessively long) cables to connect an SMU to the device under test. What's happening is that your SMU is oscillating, thus failing to reach its set point, so the measurement ends up being a fraction of what the true value would be. Note that this is not your transistor turning off at higher collector voltages; this is either the collector voltage or the base current not actually being what the SMU thinks it is. The simplest solution for this is to just shorten up the cables between the DUT and the SMU. If that's not an option, experiment with ferrite beads or resistors in series with the SMU's force (not sense) lines.
H: Conversion of radio emissions to decibels and role of impedance ratio to power ratio This question is about a web article about radio noise suppression by Ferrite beads. The above diagram plots of a family of four curves for the ferrite bead. Each curve depicts the relation of impedance to frequency for some value of dc-bias current. To quote from the article: "changing the current from 100 mA before you plugged in the USB device to 300 mA after you plugged in the device decreases the impedance of the ferrite bead at 100 MHz from 400 to 120Ω. Assuming that the emitted radiation varies inversely with the impedance of the ferrite bead, you just increased the radiated emissions by more than 10 dB!" Where did that 10dB number come from? Is it because the author considers radio emission levels (units like using Volts) rather than using Watts and that is why the author used a factor of 20 rather than 10 when converting the emission ratio to decibels if used power units? (because based on the author's simplified assumption of "emitted radiation is inversely proportional to the impedance", relation between impedance and power doesn't involve a square factor so my assumption is using a factor of 10 is more prudent and sensible which causes ~5dB increase of radiated power emission. I did a thorough web search but couldn't find any info regarding this other than this article which mentions "Counter-intuitively, impedance is considered an amplitude and uses a factor of 20 when converting from Ohms to dB." Is this related to the issue in the previous article? I mean did the 10dB come from the fact author raw converts the impedance ratio to decibels using a factor of 20 and used it as a measure of power ratio? But I don't see how that makes sense. Furthermore, another question comes up. Why does "impedance is considered an amplitude and use a factor of 20" which defies the original intention of the decibel conversion convention (which I think is to make it easier to get a sense of how one ratio affects another different ratio like voltage ratio increase to power ratio increase) to give the same value for relative ratios for both power and root-power quantities? AI: The assumption is as given. Mind it's not very realistic, but it's just a hand-wave, and, it is what it is. To motivate this with an equivalent circuit, consider the following: simulate this circuit – Schematic created using CircuitLab In the large-ratio limit, the gain ratio goes from 1/401 to 1/121, or about the ratio of impedances, 1/400 and 1/120. The voltage gain therefore went up (from left to right cases) by 400/120, or 3 1/3 times, or \$20 \log 3.33\ldots\$ = 10.45... dBV. The power in the 1Ω resistance went up by the square of the voltage ratio, or \$10 \log 10\$ ≈ 10dB. In practice, the dividing impedance might be a bypass capacitor to GND, following the ferrite bead. A typical 0.1µF chip cap will have an impedance of a few ohms at these frequencies. It's still not realistic that this will affect a direct path to radiated fields -- one would need a sizable antenna wired to this node following the capacitor, whereas most likely this is a short and tight loop to nearby IC(s) and the gain of this path (to the far field) is considerably smaller than that of, say, the cable itself; more likely poor grounding between cable shield and PCB plane, or a leaky ground (poor quality cable / connectors) dominates the far-field coupling situation, and this has no effect. But one might apply the article's logic to situations where the filtered signal does, in fact, have a dominant far-field coupling (say, filtering on-board SMPS/logic noise away from an unshielded cable to some peripheral), and the figure will be more representative in that case. It's also not the case that every situation will have this large-ratio limit. Ferrite beads into cables, for example, see the impedance of the cable itself (typically mid 10s to low 100s Ω), and the change in ratio will be smaller. So, like I said -- it's not an exceedingly realistic claim, but it's not meant to be taken perfectly at face value; at least, I would say so. It's up to the designer to understand where it does, and does not, apply. The more important point to understand is that ferrite beads are dependent, nonlinear elements, and not a salt-and-pepper design (and I use "design" lightly in that case!) element.
H: Finding an IC without really understanding the numbers First of all, this is only about learning & seeing if I can revive a tablet. I have an Onn tablet that even tho it is a few years old has only been used less then 5 hours. The battery was flat which I expected. I hooked it up to a charger and it draws .09 amps at 5 volts. So I pulled the battery and charged it slowly then plugged back in. I noticed the board was warm so I started testing it and removed a cap I found grounded but the pad was still grounded. Looking under the microscope, an IC had a dot on it and I touched it before trying to read it. It is likely the numbers were already burnt off, but I will never know now. There is another power circuit beside of it I hope is the same but I can not find these exact markings. Here are two pictures of the board. Please let me know what you want me to get a close up of. Beside of "1" is the bad IC & by "2" is the one I can read the markings. There is an error pointing at the cap I removed. AI: It's a Lowpower (微源半导体) LP3987H-33B5F 3.3V LDO regulator. The datasheet doesn't specify the markings, but other Lowpower parts use this pattern: LPS PPYWX P: Product code Y: Year code W: Week code X: Series number I found a picture that shows that the LP3987H-33B5F seems to use the product code 1e: (Source: lcsc.com)
H: 2 Coil Latching Relay I am using a 2 Coil Latching Relay and I was hoping that someone could confirm if my understanding of the relay I am using is correct. The part number I am using is a TQ2SA-24V (https://api.pim.na.industrial.panasonic.com/file_stream/main/fileversion/4514). From their datasheet, the manf states that the part is shipped out in the RESET position. So, based off the datasheet, if pin 8 is common for the top side and pin 3 is common for the bottom side, I expect Pin 8 to be connected w/Pin 9 and Pin 3 to be connected w/Pin 2 when receiving the part for the first time, correct? Now, let's say I want to switch it such that Pin 8 is now connected to Pin 7 and Pin 3 is connected to Pin 4. In order to do so, I have to put the relay in a SET state, ie. I need to apply 24V to Pin 1 and Ground to Pin 5. Is that a correct assumption? If I were to want to put the relay back in a RESET state, ie. pin 8 is now connected back to 9 and pin 3 is now connected to pin 2, I would just need to apply 24V to Pin 10 and GND to Pin 6? What would happen if I applied 24V to Pin 6 and GND to Pin 10? Would it switch only pin 8 to 7? Or is this not a used case? Sorry for what might be a remedial question, but this is actually my first time working with latching relays and I think I've exhausted all attempts online to figure this out, so any help would be greatly appreciated. AI: So, based off the datasheet, if pin 8 is common for the top side and pin 3 is common for the bottom side, I expect Pin 8 to be connected w/Pin 9 and Pin 3 to be connected w/Pin 2 when receiving the part for the first time, correct? Yes. Pin 9 and 2 are called NC (normally closed) contacts, 7 and 4 are called NO (normally open) contacts, and 3 and 8 are COM (common). Now, let's say I want to switch it such that Pin 8 is now connected to Pin 7 and Pin 3 is connected to Pin 4. In order to do so, I have to put the relay in a SET state, ie. I need to apply 24V to Pin 1 and Ground to Pin 5. Is that a correct assumption? Yes. You should apply the rated coil voltage (24 V for your relay) across the SET (white) coil with shown polarity and for at least the commutation (operate or release) time which is specified in the datasheet (usually up to 10 ms). If I were to want to put the relay back in a RESET state, ie. pin 8 is now connected back to 9 and pin 3 is now connected to pin 2, I would just need to apply 24V to Pin 10 and GND to Pin 6? Yes. Just like in the SET coil, you should apply the rated voltage across the RESET coil to put the contacts in reset (a.k.a. relaxed) state. What would happen if I applied 24V to Pin 6 and GND to Pin 10? Would it switch only pin 8 to 7? Or is this not a used case? A polarised coil is not supposed to be driven with a reversed-polarity voltage. They have a diode connected in parallel internally, so once you apply the coil voltage in reverse polarity the diode will clamp the voltage which then may result in either the voltage source's protection or the diode's failure (destruction or short). This is clearly indicated on p.17:
H: Working on 64-point SDF FFT Verilog code I am an undergraduate student who has chosen to work on an FPGA project for my capstone. My professor provided me with a PDF file without any context, and now I am trying to figure it out on my own. I have a Verilog code for a "64-point SDF FFT," and my task is to complete the code for the final stage. However, I'm currently at a loss and could use some guidance. I have a basic understanding of the concept, but I'm still exploring and learning about it. /Stage 1 to 5 module Stage(nrst,clk,bf_en,cnt,inReal,inImag, valid, outReal,outImag); parameter BW=16; parameter N =32; input nrst,clk,bf_en; input [BW-2:0] inReal,inImag; input [5:0] cnt; input valid; output[BW-1:0] outReal,outImag; reg [BW-2:0] rReal,rImag; wire [BW-1:0] bf_x[1:0]; wire [BW-1:0] bf_y[1:0]; wire [BW-1:0] mult_out[1:0]; wire [BW-1:0] sr_out[1:0]; wire [BW-1:0] mux0[1:0]; wire [BW-1:0] mux1[1:0]; assign mux0[0] = bf_en? bf_x[0] : sr_out[0]; assign mux0[1] = bf_en? bf_x[1] : sr_out[1]; assign mux1[0] = bf_en? bf_y[0] : {rReal[BW-2],rReal}; assign mux1[1] = bf_en? bf_y[1] : {rImag[BW-2],rImag}; Shift_Reg #(BW,N) sr0(nrst,clk,mux1[0],valid,sr_out[0]); Shift_Reg #(BW,N) sr1(nrst,clk,mux1[1],valid,sr_out[1]); BF #(BW)bf0({sr_out[0][BW-1],sr_out[0][BW-3:0]},{sr_out[1][BW-1],sr_out[1][BW-3:0]},rReal,rImag,bf_x[0],bf_x[1],bf_y[0],bf_y[1]); MULT #(.BW(BW),.N(N))mult0(mux0[0],mux0[1],cnt[4:0],mult_out[0],mult_out[1]); assign outReal = bf_en? mux0[0] : mult_out[0]; assign outImag = bf_en? mux0[1] : mult_out[1]; always@(posedge clk) begin if(!nrst) begin rReal <= 0; rImag <= 0; end else if(valid) begin rReal <= inReal; rImag <= inImag; end end endmodule /Stage 6 module Stage6(nrst,clk,bf_en,inReal,inImag,valid,outReal,outImag); parameter BW=16; parameter N =1; input nrst,clk,bf_en; input [BW-2:0] inReal,inImag; input valid; output[BW-1:0] outReal,outImag; reg [BW-2:0] rReal,rImag; wire [BW-1:0] bf_x[1:0]; wire [BW-1:0] bf_y[1:0]; reg [BW-1:0] sr_out[1:0]; wire [BW-1:0] mux0[1:0]; wire [BW-1:0] mux1[1:0]; assign mux0[0] = bf_en? bf_x[0] : sr_out[0]; assign mux0[1] = bf_en? bf_x[1] : sr_out[1]; assign mux1[0] = bf_en? bf_y[0] : {rReal[BW-2],rReal}; assign mux1[1] = bf_en? bf_y[1] : {rImag[BW-2],rImag}; ///////////////////////////////////////////////////// ////////// Fill your code here /////////////// ///////////////////////////////////////////////////// endmodule My approach was Shift_Reg #(BW,N) sr0(nrst,clk,mux1[0],valid,sr_out[0]); Shift_Reg #(BW,N) sr1(nrst,clk,mux1[1],valid,sr_out[1]); BF #(BW)bf0({sr_out[0][BW-1],sr_out[0][BW-3:0]},{sr_out[1][BW-1],sr_out[1][BW-3:0]},rReal,rImag,bf_x[0],bf_x[1],bf_y[0],bf_y[1]); assign outReal = bf_en? mux0[0] : sr_out[0]; assign outImag = bf_en? mux0[1] : sr_out[1]; always@(posedge clk) begin if(!nrst) begin rReal <= 0; rImag <= 0; end else if(valid) begin rReal <= inReal; rImag <= inImag; end end The error is occurring due to a "concurrent assignment of a non-net (reg sr_out)." AI: If BF is driving sr_out, then sr_out should be defined as a wire, not reg. In Verilog, reg variables can only be assigned inside procedural block (always, initial, task, function, etc). Signals driven by assign statements, module instances, and primitives need to be net types (typically wire). SystemVerilog (the superset and successor of Verilog) relaxed this rule. If you are allowed to use SystemVerilog change the file extension from .v to .sv and any modern simulator or synthesizer should be able to correctly parse the code.
H: Why does the MOSFET Vds vs. Id graph stop at a certain point? Why does the Vgs=15V line stop at around Vds = 3V? Is it just because the behaviour can be guessed by seeing the lower Vgs lines, or does the MOSFET not work at Vds>3? This is from the IRFZ44N datasheet. AI: The IRFZ44N has a maximum pulsed drain current IDM of 160 A: That fits well with your graph... Note the maximum continuous drain current ID is much lower. Figure 11 in the linked datasheet explains how they arrive at the maximum pulsed current.
H: How much voltage can a contactor withstand? I tried searching, but unfortunately did not find an answer. Given a typical 24V AC (or DC) contactor, how much voltage can the contactor control circuit withstand? Will it be damaged by mains electricity? AI: Contactors are similar to relays- they are electromechanical devices operated by a coil. The datasheet for the particular device may include some information on permissible coil voltage tolerances that will guarantee operation and avoid premature failure (especially over temperature). Applying much more than the rated voltage will cause the coil to overheat and it may be destroyed. Certainly mains voltage on a 24V coil (AC or DC) would cause it to fail within a very short time. Even faster (essentially instantly) if it has some kind of coil suppression, as some do.
H: Need regulated 15 kV output I was just playing around with this ZVS circuit I made in LTspice. It was made to output 15 kV, but when I saw its actual output it had spikes of 25 kV, then it stabilized after a while. How to prevent this misbehavior when making the actual circuit? The circuit: The output: EDIT: I've already tried attaching an RC circuit to the 100 Ω resistors at the top but that delays the circuit powerup and the LC circuit won't resonate. The extra circuitry at the bottom (from Electroboom) just delays when the resonating stuff will happen, but still the spikes come. I've left it because it can be useful in the actual circuit. I've also tried putting very small capacitors and inductors at the final 1 MΩ load but that reduces the output voltage to 10 kV even if I use only one at a time, and the spikes are still there, at 15 kV. AI: This type of ZVS circuit is primitive and, I believe the problem you are seeing is due to it being a primitive circuit. When running normally you'd expect the primary current to rise and fall between a positive value (\$I+\$) and a negative value (\$I-\$) of current but, at start-up, the primary current starts at zero amps and rises (or falls depending on the first transistor to switch) to a value of either twice \$I+\$ or twice \$I-\$. I suspect that this contributes in some part to excessive induction (and the higher-than-expected peak voltages in those first few cycles). Waveforms are needed to verify this and I encourage you to work at it more and add the primary current waveform to your question.
H: Old oscilloscope has its plastic screen slightly shifted, is it safe to use? I found an HP 1220A oscilloscope in a thrift store. It's in pretty good shape, but I noticed its front green/blue plastic screen is a bit shifted to the right. I can slide it back in place with my hand? I just want to make sure this isn't a safety issue. I assume all the plastic does is change the contrast as explained here. AI: It will be fine. The acual CRT is a sealed glass tube so you don't get exposed to any of the high-voltage stuff. It would be worth taking the cover off and fixing it in place so the grid doesn't move about. It may also protect you if something did hit the tube and cause it to shatter.
H: How to make 0.1" male headers to fit into female DIP socket that has holes which are too small? I recently received my largest batch yet of assembled PCBs. The design hasn't changed since the last order, but the supplier's stock of a socket I had been using has been depleted, so I substituted a different socket. Old socket New socket I've got some headers from various suppliers, such as this, this, and the ones that come with the part intended for this socket, none of which will fit into the new socket. I've tried taking a single pin and forcing it in with a pair of pliers, but the pin just bent. Sullins headers Tayda headers Adafruit headers Production of my product is stalled until I can resolve this, and I live in Aotearoa New Zealand, which is about a week minimum from any supplier. So in desperation, I'm wondering whether it would be OK to sand down the header pins to make them fit. I realise this will remove the surface coating, and that's why I'm unsure if this is a good idea. The product is a guitar effects pedal, and it's meant to last a long time. I've been careful not to mate gold pins with tin sockets in the past (because this might create a kind of cell, causing corrosion), so I'm aware sanding is pretty dodgy. I've also tried taking some other sockets I have and using them as an intermediary, but the legs of this socket are so thin they don't make a good contact with the socket on the PCB. Piggyback socket Any other suggestions? Would I be justified complaining to the PCB supplier that the socket they supplied is defective, given that it won't accept any of the pins I have tried? I mean, headers are headers, right? They are supposed to be a fairly standard fit, aren't they? AI: As you can (sadly) see, nope, sockets are not sockets! You got precision pin sockets, do you need what is usually sold as precision turned pin headers, or precision machined pins. These are cylinders, instead of prisms. These are all candidates, but check the individual dimensions of the pins against your socket's data sheet! (The data sheet isn't great, but does mention pins of nominally a diameter of 0.432 mm, as far as I dare interpret it) https://www.digikey.com.au/short/3j1mdh3n And: forget about sanding. Not going to realistically be possible.
H: How critical is SOT89 footprint? I've pulled datasheets for a dozen compatible NPNs from Toshiba, Diodes, Onsemi and Nexperia. They all had different recommended layouts for SOT89 package. More than that, Nexperia has different footprints for wave and reflow, KiCAD has yet another layout, and simple picture search on web produces a dozen more variants. It is like nobody knows what to do with this particular package. I have no problems creating custom footprint for the part I will actually order, but I don't want to be stuck with it. Any recommendations? EDIT: I would like to know if it is important to use recommended layouts from datasheet for each particular part even though they all are specified as SOT89 package. In addition, if one footprint can be used for all of them then I would like a recommendation on which one is better. BTW, I've used this package before, did not pay any attention to recommended layout and simply used KiCAD footprint. Seems to work just fine, even though the recommended layout had 3 separate paste shapes for central pad, while KiCAD used pad outline for paste. UPDATE: Just to illustrate what I am talking about, here are suggested footprints from TI, ROHM, Infineon and Diodes Inc datasheets. Note, how central pad comes very close to sides on ROHM and especially on Diodes layouts. Also note trapezoidal shape of TI pad for better paste release, as discussed here: Adapted from Texas Instruments TL431 datasheet Adapted from ROHM BDxxFA1 Series Application Information application note Adapted from Infineon PG-SOT89-4-2 footprint document Adapted from Diodes Inc. AP7370 datasheet AI: There are three issues in play here: Not all packages are identical. SOT-89 is the JEDEC reference; SC-62 is the EIAJ reference; and most manufacturers have their own internal numbers which need not match an industry standard (for example, having their dimensions and tolerances a subset of the industry standards). There may also be lookalikes, with similar shape but outside the tolerances of such a standard. (I don't think there's any SOT-89-alikes, or that I recall offhand, but there are some quirky SOT-23-alikes that are just different enough you might want to update their footprint.) Not all footprints are created equal. There are two sub-issues in turn: (a) Manufacturers may specify their part is some e.g. JEDEC standard, but realize this includes gross-dimensioned parts like TO-220 (the non-AB version I mean!), DO-214 series, etc., and compliant footprints for these can be quite awkward. Real parts never (in my experience) use the full dimensional range of these old standards. But manufacturers rarely show what dimensions (tolerances included) they're actually making them to -- they give the JEDEC file, not their internal one. Assuming this is the case -- you can, perhaps, infer their package dimensions from the footprint, when a minimal footprint is provided. There are, for example, SMA diodes where the datasheet gives a footprint that won't even fit a LMC/MMC part per their own drawing (which again, isn't the internal drawing but the JEDEC one). And by "fit", I mean, the leads either won't both align with the pads, or one or both leads are resting on soldermask rather than pad face. (b) Footprints are dimensioned differently, for different purposes. IPC-7351B is the basic starting point, and also a good introduction for terminology, solder joint types, and measurement. They give three basic calculations: minimal / high-density, normal, and maximal / low-density. The manufacturer may choose any of these, or use their own bespoke calculations. And again, they may calculate them from their internal drawings, rather than what they show the customer. Different footprint dimensions serve different purposes. You might choose among the IPC options where component placement density is a primary concern (as the names suggest), or you might choose larger pad dimensions for easier hand soldering. Still other dimensions apply for wave soldering (which may include asymmetrical pads and different footprints for different orientations on the board!). Ultimately, footprint dimensions are driven by production: they determine soldering quality and consistency. And then it's worth getting into esoterica like home-plate or dogbone paste patterns, shaving pads or soldermask to optimize fab and assy yield, etc. If you aren't making thousands of boards per year, just stick with IPC calculations or manufacturer recommended dimensions. They won't be particularly good, but they're most likely to work at any CM (contract manufacturer), without incurring huge hand rework trouble.
H: Can anyone tell me what this circuit is doing? I am reluctant to share the whole circuit due to company confidentiality, but effectively a frequency ref is inputted into Q1B. Q1a's collector is connected to 3V3 through a series of resistors and a frequency output can be measured there based on manipulating a capacitor connected to the collector of Q1B What is the deal with the two NPN transistors Q1A and Q1B? I assume it is something to do with charging / discharging the inductor L3? Thanks AI: On the right you have an oscillator that generates a square wave or a periodic pulse train. See the 2 BJT transistors and the COG capacitors. That circuit on the right makes me think to an ultra low power oscillator designed by David Johnson at discoverycircuits.com The whole circuit might be a mixer between Q1 reference frequency and the signal generated by the oscillator on the right.
H: PSL usage in Formal Verification, assertion problem I am investigating the usability of formal verification in FPGA designs using VHDL, PSL, SymbiYosys, and GHDL. I've watched several webinars, read a PSL book, and gone through tutorials. Currently, I am attempting to create test assertions, but I'm facing numerous challenges, especially with what I believe are basic constructs. I've created sample design: I would like to test following cases: Sequence: req_i (when reset is not asserted) -> data_en_o* -> eot_o** -> ack_i * (1)data_en_o should be raised exactly 2 clks later (2)data_en_o should be raised at some undefined point in the future, but it must occur ** (1)eot_o should be raised next clk after data_en_o is deasserted (2)eot_o should be raised precisely on the last clock cycle when data_en_o is asserted. During my tests I was trying this approach: f_seq : assert always (rst_n_i -> req_i -> next[2](data_en_o) -> eventually! eot_o); Symbiyosys complained about: "next[2](data_en_o) -> eventually! eot_o : left-hand side operand of logical '->' must be a boolean". I don't understand why it is not correct as next2out_data_en_o is also check for specific condition (output should be boolean) when I removed " -> next[2](data_en_o) " the assertion is passing even without eot_o asserted. Eventually! is 'strong' so assertion of eot_o should occur before end of the test. Additionally, I am also interested in how to formulate these assertions using SERE. AI: assert directives are used for checking outputs or internal states of the DUT, modeling input behavior is done using assume directives. This: always (rst_n_i -> req_i -> ... means that if your design is out of reset, req_i has to be '1' every cycle. That's not the case. What you probably want to write is something like: assume always (not rst_n_i -> not req_i); assume always req_i -> next not not req_i); That would model the behavior of req_i input. It has to be '0' during reset, can be set 1 at any other cycle, and has to be '1' for one cycle only. Another hint is to better split your properties in simple ones. They're better readable for the user and mostly easier to proof for the tool. Here are some examples to check the output behavior you probably want. Beware that these checks aren't complete. They only check exactly the behavior they specify, nothing more. (1)data_en_o should be raised exactly 2 clks later assert always (rst_n_i and req_i -> next[2](data_en_o)); (2)data_en_o should be raised at some undefined point in the future, but it must occur That's not that easy, at least with GHDL and SymbiYosys. SymbiYosys supports liveness proofs, but not really with GHDL and the eventually! PSL operator (see ghdl/ghdl#1345 and ghdl/ghdl-yosys-plugin#152). Other thing is, that unbounded liveness proofs can be very hard to prove. What you could do is to restrict the length of your proof by choosing an upper cycle count. For example: data_en_o should be raised at some undefined point in the future, but it must occur at least 50 cycles after req_i Of course, your DUT has to fulfill this. If it does, you can use following assertion for example: assert always (rst_n_i and req_i -> next_e[2 to 50](data_en_o)); (1)eot_o should be raised next clk after data_en_o is deasserted assert always (fell(data_en_o) -> eot_o); assert always ({data_en_o; not data_en_o} |-> eot_o); -- Using a SERE (2)eot_o should be raised precisely on the last clock cycle when data_en_o is asserted assert always (fell(data_en_o) -> prev(eot_o)); assert always ({data_en_o; not data_en_o} |-> prev(eot_o)); -- Using a SERE Additional checks You probably want to check some other things too, like data_o is stable during data_en_o is '1': assert always (data_en_o -> next(stable(data_o) until not data_en_o)); eot_o is '1' for one cycle only: assert always (eot_o -> next(not eot_o)); The behavior of ack_i can be modeled by assume directives: assume always (eot_o -> next(ack_i)); assume always (ack_i -> next(not ack_i)); As mentioned earlier, these examples don't say anything about behavior of the DUT outputs in other design states. For example, eot_i could be high at many other cycles, there is no assert that proves the reverse.
H: What is the best way to implement an accelerometer with existing Modbus equipment and limited ADC resolution? I need to find the easiest and cheapest way to add an accelerometer to my current set up. I only need to detect local disturbences that will affect the weighing process that I am carrying out. My current set up uses LabVIEW Community Edition on a PC to control and collect weight data with a load cell that can resolve 2 grams in 100kg, so quite sensitive. The data is collected using Modbus RTU. Other operations are also controlled by Modbus through a Barth STG-680 PLC. This has a 0-10V 12bit ADC so expecting 4096 levels. I have tried using an ADXL335 accelerometer wired directly into the PLC but it is not sensitive enough as the voltage range is 0-3.5V and so only uses 1352 levels of the 4096 available on the PLC. I have thought of getting an Arduino UNO R4 Minima which can be set to 14 bit ADC giving 16383 levels over 5V so 11468 levels in the 3.5V range. I would then have to spend time with the Arduino code and find out how to get the data with LabVIEW or add a Modbus shield. I am not sure if that works with the R4 Minima. Another alternative might be to get a SM24 geophone which may be more sensitive than the ADXL335 but that seems to run on 5V also so not much advantage to wiring it to the PLC. My third guess is to get or make a board with high bit ADC and Modbus RTU capability but I haven't found one yet or a circuit diagram. STG-680 ADXL335 AI: This has a 0-10V 12bit ADC so expecting 4096 levels. I have tried using an ADXL335 accelerometer wired directly into the PLC but it is not sensitive enough as the voltage range is 0-3.5V and so only uses 1352 levels of the 4096 available on the PLC. Use a precision op-amp powered from (say) 12 volts to raise the 0 to 3.5 volt input to the required 0 to 10 volts input level. Whether this is good enough to meet your needs is unknown to me but, it will certainly improve the resolution of your readings by nearly 3 times. Maybe consider the ADA4522 <-- first device that sprang to mind but there may be more appropriate choices.
H: Why is there a negative source voltage when the MOSFET is off in this buck converter? This is the voltage source. As you can see, when there is a turn-off phase, I have a negative source. Why? AI: Why is there a negative source voltage when mosfet is off? It's an asynchronous buck converter and, when the MOSFET turns off (goes open-circuit), the inductor current keeps flowing and forward biases the diode: - That's the whole point of the inductor and the diode; it transfers energy from the inductor to the output capacitor. It's absolutely normal operation for this type of converter.
H: LTspice model file for new component I would like to add some new components to the LTspice library. I have never done this before. The online SPICE forum discusses 3rd party component steps. It says I have to download the SPICE model file from the manufacturer's website. I have tried to find the SPICE model file for the FDA69N25 MOSFET from Fairchild, but I can't seem to find the specific data clip. There is the datasheet and other info regarding the packaging, but I just can't make heads or tails of the other export files. I don't know which should be the SPICE model file. From what I have seen, if you know what you are doing it is quite easy to import the right component into LTspice, but I don't quite have enough experience with the simulator. AI: If you have the file, its a text file, usually cir/txt/lib extension. You should see a standard header somewhere in the file (after comments): It looks like this .subckt XXX 1 2 4 XXX should say something like FDA69N25 or FDA69N I couldn't find the file on their site, I would request it from a manufacturer. If you can't do that you'd have to try and create your own or find a similar transistor that has a spice file. Here are the instructions for import: https://www.analog.com/en/technical-articles/ltspice-simple-steps-to-import-third-party-models.html
H: Antenna tuning and L/C matching I see there are already a few questions asked wether it is better to physcally tune the antenna for said frequency and impedance or use a matching network. It seems the conscenus is often the physical way is prefered firstly. But id like to know exactly why. From my current understanding, the matching network will infact reduce any reflective power due to mismatching, logically then that "not-reflected-power" would lead to more power to the antenna and hence more power to the air? I suspect just because more power is going to the antenna, it is probably wasted in some form and not 100% propagated, so in essence matching a mismatch will always help partly, but just not as if the antenna is actually tuned for that frequency. So id like to know if im on the right track here, and if so, in a case i had matching network to increase power to the antenna since im not TX at its natural frequency, AND hyperthetically there is no ohmic loss in the antenna and matching network, would the now matched system behave asif it was at its original resonante frequency? Edit 2: I gather from existing answers in reality that non relfected power is still going to be wasted in parastici losses AI: From my current understanding, the matching network will infact reduce any reflective power due to mismatching, logically then that "not-reflected-power" would lead to more power to the antenna and hence more power to the air? Generally true i.e. whether it's matched due to physical length tuning or, matched due to an impedance matching network then, the result is the same with the following caveats: - An antenna that is a lot different in length compared to the physical optimum may have a very low radiation resistance and, that can make it trickier to match to. An antenna with a lower-than-ideal radiation resistance will have a loss-resistance that is much more significant i.e. greater losses have to be incurred and hence less power transferred to free-space. An antenna with a low radiation resistance will necessarily require a matching network that is high in Q-factor and, as a result, the usable bandwidth of the antenna will be significantly reduced. A simple quarter-wave monopole might have a radiation resistance of 37 Ω but, it will also have a series loss of a couple of ohms and, when you reduce the antenna length, you disproportionately lower the radiation resistance and, quite soon, losses ramp up to near 50% or worse. There is nothing you can do about correcting these losses.
H: 4-20mA analog output into a digital input? I'm measuring the 0-10V pressure output of a pressure sensor with a LOGO! smart relay (PLC). I would like to make sure that the pressure sensor is working even when I'm measuring nearly zero values with the device. My idea was to connect the other output (4-20mA) of the sensor to the LOGO!'s digital input to make sure that the sensor is working. I would do this beacause the LOGO! only has voltage analog inputs so I can't use the 4-20mA directly in the analog input. The input resistance of the digital input is 80k and the 4-20mA output of the sensor provides nearly 24V (which is the supply voltage) when such a high impedance is present between the output pin and the common ground. So my purpose would be to make sure if the pressure sensor has supply voltage therfore it is probably working. (Unfortunately when a nearly zero pressure is measured the 0-10V output gives 10mV which is a very small value to decide if the pressure sensor is working at all.) I've tried and it was working. The current was only 0.33mA coming from the 4-20mA output and flowing into the digital input. The voltage dropped at the output by 0.2V. Eventually I measured a logical high value at the digital input so it was working, but I have concerns that in the long term this usage may demage the sensor's output. I dont't have the particular circuit diagram of the pressure sensor's current output but as I understood there aren't major differences between the implementations. Here is an exaple I found: https://www.analog.com/en/design-center/reference-designs/circuits-from-the-lab/CN0314.html#rd-overview Does someone know if this soulution could work in the long run? AI: I used the LOGO! units successfully on a number of industrial projects and interfaced with 4 - 20 mA signal by using a current to voltage converter, commonly known as a resistor. For 20 mA to 10 V conversion you need a 500 Ω. I was delighted to find that TE Connectivity make a range of 0.5 W, 500 Ω, 0.1% tolerance resistors available in single units from RS, starting at about €3.50 at the time of writing. This gives a simple, cheap, reliable solution with the advantage of a "live zero" (2 V) signal to detect sensor loss or fault.
H: My Sallen Key Butterworth high pass filter's frequency response graph is not responding I tried to make a cutoff frequency of interface in partial discharge but the response frequency graph is not responding. I already changed (Amplitude= & frequency= 50Hz) in the sine generator properties and DC generator properties in both U1. I measured frequency response in Vout. What should I do? AI: This (red circle) appears to indicate a connection problem: - In other words, the crossed wires should be connected.
H: Detecting water (via resistance) between two metal probes using 3.3v MCU's ADC For the past few days, I've been going in circles trying to plan a circuit to detect water between a pair of metal probes (or more precisely, between several pairs of stainless steel probes approximately 1 inch apart connected in parallel, and two "water sensor" circuit boards that consist of two zig-zagging 50-mil traces separated by 50-mil space). The fundamental problem is, I don't really understand the finer points of Ohm's Law (or at least, the parts that might deviate from what I suspect is actually a simplified special case... when you aren't just talking about a simple resistor limiting current between +3.3v and ground). Consider the following circuit (in series), using a 3.3v ESP32: GPIO pin that's normally left floating as an input (to minimize galvanic corrosion of the probes), but configured for output & taken high (to 3.3v) shortly before triggering ADC conversion. 82-100 ohm resistor (to limit the maximum possible current flowing between the GPIO and ADC pins to 40mA or less, even if there ends up being a dead short and zero ohms between the probes a pair of probes (normally, with air insulating them... potentially, with tap water insulating them a bit less)... and two or more such pairs connected in parallel (so there could be current flowing between none of them, between one pair, or between multiple pairs) ADC input pin on the ESP32 The things that have me scratching my head: If you assume 3.3v on the GPIO pin and only 82 ohms between it and the ADC pin, how many volts will the ADC sense/measure/see? Does a 12-bit ADC actually have enough "headroom" to meaningfully sense the difference between all-but-infinite resistance (82 ohms + an inch of open air) and whatever resistance you'd likely encounter between two stainless-steel probes immersed in tap water? Or at best, would you end up with readings that just jittered between something like 0 to 5 and 2 to 7 (out of 4095), and were so close and mostly-overlapping, you almost might as well randomly flip a coin to decide whether or not there's water present? I suspect that the impedance of the ADC itself is an important detail that I don't know the value of. I'm kind of embarrassed to be asking this, because this is apparently considered to be an absurdly-simple circuit... but all the examples I've seen basically consist of a voltage comparator whose output directly triggers a piezo, as opposed to using a MCU to measure it through a proper ADC. I'm not sure whether that's because the amount of voltage at the far end would be too low to reliably measure with a 12-bit ADC, or just because prior to just a few years ago, the very idea of using a MCU and ADC for something like this would have been prohibitively expensive overkill (instead of, like, $9 for an ESP32-C3 that you need anyway for the wi-fi link). Do I actually need to do something like have the ESP32's 3.3v GPIO trigger a MOSFET switching 5.0v, then amplify the other end with an op-amp and/or run it through an optocoupler or something? Or am I way overthinking something that isn't nearly as complicated as I'm making it? AI: If you assume 3.3v on the GPIO pin and only 82 ohms between it and the ADC pin, how many volts will the ADC sense/measure/see? The 82 Ω to the ADC will form a potential divider with the input impedance of the ADC. I would expect this to be in the order of 100 kΩ to several MΩ. The datasheet should give this value. In any case the if the ratio was 82 Ω : 82 kΩ (1 : 100) the ADC would see 99% of 3.3 V (which is fine). A higher input impedance would improve this further. Does a 12-bit ADC actually have enough "headroom" to meaningfully sense the difference between all-but-infinite resistance (82 ohms + an inch of open air) and whatever resistance you'd likely encounter between two stainless-steel probes immersed in tap water? "Headroom" isn't quite the right word as the dry reading will be 100%. "Resolution" or "span" of readings might be better. This would be very easy to test with a 3.3 V supply, your multimeter and test probes. Check the open-circuit voltage (3.3 V) and then apply the various test conditions to your probe while measuring the voltage. I suspect that you'll find that 82 Ω is quite a stiff pull-up and that a wet probe may struggle to pull the voltage down significantly so be prepared to check with 1 kΩ and 10 kΩ. Or at best, would you end up with readings that just jittered between something like 0 to 5 and 2 to 7 (out of 4095), ... More likely > 4000, if anything (he said without doing any tests). I suspect that the impedance of the ADC itself is an important detail that I don't know the value of. It will be high relative to what you're measuring so I wouldn't worry about it (unless you end up with very high pull-up resistors). That information must be available from the datasheet? simulate this circuit – Schematic created using CircuitLab Figure 1. Equivalent circuit. RPU is the pull-up resistor. So you're saying that the circuit would NOT be, GPIO (outputting 3.3v) -> resistor (limiting current) -> probe -> water -> probe -> ADC pin? No. That wouldn't work. You want to create a potential divider. The voltage at the ADC input will be $$ V_{ADC} = 3.3 \frac {R_{SOIL}} {R_{PU} + R_{SOIL}} $$ Now it should be clear that the ADC input impedance makes very little difference to the reading.
H: Core demagnetisation - What is the condition? Consider forward converter topology. What is necessary for core to be successfully demagnetised? Does the magnetising current has to reach absolute zero amps, or even little negative is advantage? How about voltage across windings? Seems the voltage reaching 0V naturally is sufficient, no need to goes negative. AI: What is necessary for core to be successfully demagnetised? In simple terms, the average voltage across the driven winding has to be zero volts else the current will continue rising until the core saturates. Seems the voltage reaching 0V naturally is sufficient, no need to goes negative. Consider a voltage (blue) applied across a 5 henry inductor and, look at the current in red: - When the positive voltage pulse drops to 0 volts (after 3 seconds), the current remains at 6 amps then, when the next voltage pulse arrives, current begins ramping-up from 6 amps. I think you can see that you need a negative voltage to de-flux the core and prevent an ever-increasing flux in a positive direction. So, if the negative voltage was 4.2857 volts you would get this: - Current has returned to zero when the next positive pulse arrives and, flux doesn't walk-upwards towards core saturation. This is because the average voltage is precisely zero. Does the magnetising current has to reach absolute zero amps, or even little negative is advantage? In a practical forward converter demagnetization is typically applied via a 3rd winding connected via a diode to the power rails. This ensures that demagnetization takes place before the next switching cycle begins. Once the magnetic energy from the core has been recycled to the power rail, the current stops at zero amps due to the diode.
H: Offset Voltage not matching Datasheet I'm using the OPA4990 Op Amp from Ti for a project and I noticed today that the offset voltage seems to be larger than the datasheet specifies. I'm using one of the op-amps as a voltage follower in the unity gain buffer configuration. I measured the voltage present at the input to the positive terminal of the Op Amp and saw 3.300 volts. When I measure the voltage present on the negative terminal and the output of the Op Amp I see 3.320 volts. This seems like an effective offset voltage of 20 mV. The data sheet lists a maximum offset voltage of 1.5 mV and the bias currents for this part mean that the input resistance shouldn't be affecting anything. The output of this Op Amp is fed directly into a TLV1704 comparator so the load current the Op Amp has to provide is extremely low. For now, the other Op Amps in the package are properly terminated/tied off so they aren't saturated and I don't think they should be affecting anything. The voltage rail I'm trying to measure is the main power rail which the op amp is also powered off of. Any ideas what could be causing this? I tried changing the input voltage across the input range and saw this effective offset voltage change with the magnitude of the input voltage. simulate this circuit – Schematic created using CircuitLab AI: I suspect meter loading measuring the voltage divider. Not counting component tolerance. If you calculate \$V_+\$ without loading for a 10V input the result is 3.33...V. If you calculate using a 10M\$\Omega\$ meter in parallel with the 100K resistor a 22mV decrease is observed. The meter will not load the output measurement. So what you are seeing is correct.
H: OVP MOSFET Circuit I've been trying to make a circuit that once a certain voltage (in this case around 7.1V) is supplied by the power supply, a MOSFET will disconnect the load from power. I know there are other alternative OVP circuits out there but I was curious to see if something like this would work. I haven't been able to simulate it in LTspice as the gate voltages I need for the circuit to work are rather finicky and none of the default models have the right values which is why I'm asking here. The idea is during normal operating conditions, the divided pulls the gate of the n-channel mosfet low enough to keep it off, thus the gate of the p-channel MOSFET is pulled to ground, resulting in a V(gs) on the p-channel of -5 (meaning it will be on). Then once it is a high enough voltage the V(gs) of the n-channel is high enough to turn the MOSFET on. This shorts the gate of the p=channel to the source of the n-channel, which ver a range of 60V, should always be within 4V of the supply voltage. In the circuit the R2 resistor represents the load, R4 is to limit the current flow to keep the drain current of the n-channel low enough. By my calculations, this circuit should enter an OV condition at around 7.1V and should stop working (start conducting again) if the voltage reaches 60V. If anyone knows if this would work or could point out any issues it would be greatly appreciated. (Edit; Fixed incorrect values) AI: From a comment on the question, noting an issue with getting a deterministic NMOS transistor threshold voltage: Looks okay at first glance but take a look at a typical datasheet for an NMOS transistor and note that the "on" threshold voltage is not all that predictable. They will often specify a maximum value at which the transistor is definitely on but there can be quite a range across individual transistors with the same part number. There will also be temperature variation. This makes it hard to target a specific voltage at which the circuit will be switched off. – Tony I have seen a design which uses a Voltage regulator diode to set the overvoltage protection. E.g. from the schematic of the Advantech EVMK2HX Evaluation Module: The analysis of the over-voltage protection circuit is that in the event of an over-voltage: D8 conducts when the over-voltage causes the D8 breakdown voltage to be exceeded. When D8 conducts Q9 turns on. When Q9 turns on, Q20 is turned off. When Q20 turns off, Q19 is turned off which disables power to the board. The D8 BZX84-C12 part is specified with an approximately ±5 % (BZX84-C) tolerance range, so a min breakdown voltage of 11.4 V and a max of 12.6 V. With a Q9 Vbe of 0.6 V (room temperature and an Ic of ~0.1 mA) that means the over-voltage protection could trigger from an input voltage of 11.4 V + 0.6 V to 12.6 + 0.6 V, i.e. 12.2 V to 13.2 V. While this answer gives an analysis of a over-voltage protection for a 12 V supply, rather than the voltage of 7.1 V given in the question, it may serve as an example of a different circuit configuration to achieve an a more controlled threshold voltage using a Voltage regulator diode. The BZX84 series given as example: Is available in the normalized E24 ±1 % (BZX84-A), ±2 % (BZX84-B) and approximately ±5 % (BZX84-C) tolerance ranges. Includes 37 breakdown voltages with nominal working voltages from 2.4 V to 75 V
H: Using a BNC shorting cap as a switch Regarding this short-circuit BNC cap: Is there a way to know if the cap is isolated from the inner BNC pins where the current will pass through? I want to use this as a lock with a panel mounted BNC, so that when the cap is plugged it will act like a switch for 12 V. I am not sure whether the cap will also be at 12 V potential or not when it is plugged in. I need a connector, rather than a switch, so it can also be extended by a cable to be used as an external lock. AI: Is there a way to know if the cap is isolated from the inner BNC pins where the current will pass through? The words "short circuit" are the giveaway: - And, the fact that is talking about it being a male gender is also significant. Im not sure whether the cap will also be in 12V potential or not when it is plugged in. The cap is grounded and will short the 12 volts on the panel connector to ground. If you need a non-shorting type, they are available from here for example: - From comments it appears that the outer part of the BNC is not grounded but, an alternative wiring of the inside of the enclosure can achieve this: -
H: Reading voltage across Christmas light wires, multimeter shows erratic readings I am attempting to splice a simple on/off switch into a strand of Christmas lights. Previously, I separated the two wires and cut open the one marked with dots, expecting it to be the positive/live lead. I joined the two leads of the switch to the two open ends of the dotted wire. Testing, the lights appeared to work as expected: leaving them connected to power through their transformer and toggling the switch toggled the lights successfully. However, later I noticed that with the switch set to off, the lights appear very dimly lit. Googling around, I discovered that: This can happen if the switch is installed on the neutral side of the circuit, and While the standard marking is dotting the live wire, sometimes the opposite is true. So I cut everything apart, and measured the two open ends of the wires coming out of the power supply with my multimeter in voltage mode, direct current, to determine polarity. However, when doing so my multimeter readings do not stabilize, instead oscillating randomly between 10 and -10 volts at the refresh rate of the multimeter screen. The power supply is marked as providing 36V DC. Here is a picture, with the two open leads I tested (when the thing was plugged in), and with the power supply markings hopefully visible. Here is a drawing, hopefully illustrating the situations: What is happening here? How do I wire the switch so that the lights are completely off when the switch is in the off position? AI: It is not a simple power supply. And even if it was, the LEDs could still be slightly light up. The problem is not seen in your schematics because what matters is how you installed the LEDs and where, with how long wiring and mounted where. If the LED wiring has capacitive coupling to earth ground, then any capacitive mains leakage from LED driver will pump some current through LEDs. That is likely a 2-prong power supply internally and they have an Y cap between mains and low voltage side for preventing electromagnetic interference but then it will cause this leakage. And LEDs are very sensitive and light up with very little leakage current. If you can, try swappint the polarity how you plug the power supply to mains, but it looks like you have polarized plugs so it might not work. Also what is the white device on the black power supply, it can make the problem worse. One solution is to use a dual pole switch to isolate both wires going to LED driver, not only one.
H: Op-amp not increasing amplitude of signal I was doing some LTSpice simulation with an op-amp to amplify a 1 millivolt 40 kHz sine wave. However, in the output signal, it had just raised the voltage of the whole waveform, it decreased the amplitude. The amplitude now was under 500 microvolts. I was expecting it to only increase the amplitude of the signal. AI: First of all, since you are giving it a 0V and 3.3V supply, an input of signal around 0V or even negative are invalid. It would need a negative supply to handle signals near 0V.
H: Zener diode on NRST pin of STM32 I am using STM32L476QGI6 in my project. As shown in the following figure, I have placed a 3.6 V Zener diode (ZM4729A-GS08) on the NRST pin of my microcontroller. The problem is that when I connect the 3.3 V power supply to the MCU, sometimes the microcontroller turns on, and sometimes it does not! When I remove the Zener diode, the circuit and MCU work perfectly. I don't understand the effect of the Zener diode on the circuit's functioning. Previously, in another project, I used the same circuit for the NRST of the MCU, and the MCU was an STM32F103RDT6, where the same problem was observed. [Edit] The MCU_NRST node is also connected to a connector used for programming the MCU using ST-Link. Therefore, I used the Zener diode for ESD protection. I also employed it to prevent high-voltage damage to the programmer or PC, which could potentially affect the signal circuit of my board. AI: The zener, if made by Vishay, has 3.6V voltage with +/- 5% tolerance. The problem is the rated current, where the voltage is 3.6V +/- 5%, is 69mA. And zener diodes are not ideal devices. They start conducting current far before the zener voltage. And these low voltage zeners do not have very sharp knee like higher voltage zeners do. Unfortunately, the Vishay data sheets do not have graphs of voltage vs current. The expectation is, the zener prevents the MCU from coming out of reset, the voltage may just be very close at the threshold of MCU being held in reset or allowed to run.
H: DIN rail terminal block resistor Is there a reliable solution for placing my own through hole resistor into a DIN rail mountable terminal block? Or is there any off the shelf solution the use a resistor to convert my 4-20mA current output of my pressure sensor to 2-10V signal? I'm using a LOGO! smart relay (PLC) which only has analog voltage input and I want the solution to be cheaper than buying an analog expansion module. AI: Weidmüller has such DIN terminal blocks with built-in components. They have some often used components as diodes or indicator LEDs in stock. For resistors they have terminal blocks with internal soldering lugs so you can solder the needed resistor in yourself.
H: TRIAC controlled fan output on furnace control board not working At board power-on, the fan output connector has mains (230V AC) voltage without the fan connected, that drops to ~2V AC with the fan connected. At power-on, on the attached display, the board shows a message error code that means "insufficient fan speed". From this, I deduce that the fan is supposed to be starting immediately but it doesn't. As far as I can understand it, the output is controlled by an ATMEGA micro-controller, through an ULN2003 Darlington array, through an MOC3063 opto-coupled, zero-cross TRIAC driver and finally a BT136 TRIAC. It includes what I believe is a snubber circuit comprising 3 resistors and a capacitor and also a motor (start or run) capacitor. I have determined the motor (and its external capacitor) to work by connecting it directly to mains. It rotates vigorously. The motor also has cables (that go to another part of the control board) for an internal speed sensing mechanism that takes +5VDC (and GND) and outputs ~4.3VDC at certain rotor angles that I have also determined to function correctly. I have changed the TRIAC and the TRIAC driver on the board with new parts to exactly no change in behavior. What information should I add to this question? What further steps can I take to try and fix this issue? the control board optocoupler input Darlington input (green) and output (blue) EDIT: I've shorted terminals 1&2 of the TRIAC and checked that the motor spins OK. Given the third picture, showing scoped input/output of the Darlington, can it be concluded that it is the cause of my problem, seeing how its output seems insufficient to trigger the optocoupler? Darlington input (blue) and output (green), referenced to the common cathode. AI: There's no convincing drive signal there- it should be about 1.2V when on (-1.2V the way you have it connected). I hope you are being careful with grounding, it would be pretty easy to seriously damage something if your scope has an earth connection, and pretty easy to get a shock if it does not. Furnaces have a sequence they go through and if something fails they may retry a few times then give up. If it's a gas furnace there may be multiple fans. I would look first at those row of relays- relays wear out. Also at the power supply electrolytic capacitors- they also wear out/dry out. The focus is poor and I can't read any date codes, but I would guess it's quite old, so such problems are to be expected.
H: Can I safely remove this buzzer from a UPS PCB? I want to remove this buzzer from this UPS PCB. It's very noisy. For the UPS to continue working, should I just remove the buzzer with a soldering iron? or do I have to put some wire or resistance in-place? AI: It would be harder to build the UPS so that it would stop working with the buzzer removed than to build it so that it doesn't notice whether the buzzer is there or not. Whether someone decided to make it "notice" -- that's up to the UPS manufacturer. If you can figure out how to test your work, take it off and see what happens -- then put it back in if needs be.
H: Can someone explain this current sink circuit for me? I am trying to get my head around this (current sink) circuit. I have seen this circuit with two NPN transistors and connected base - but to swap around one of them seems a little strange to me. Does this arrangement have a special name? Can someone please explain it to me? AI: It looks like an erroneous version of a standard constant current circuit. Figure 1. Image source (mine) from LEDnique. How it works: On power-up Q1 and Q2 are off. There is no collector current so L1 is off. If the digital control input on the left is brought high (5 V) Q1 will turn on. Current will flow through L1, Q1 and R2. As the voltage drop across R2 increases to about 0.6 V Q2 will start to turn on and shunt some of the base current away from Q1. The result is that the circuit will settle at whatever Q1 emitter current will drop 0.6 V across R2. When the input signal drops to zero Q1 and L1 turn off. If an unswitched version is required then just connect R1 to Vbb. Note that the usual series resistor is not present with the LED. Q1 acts as a variable resistor in this case adjusting to maintain the required current.
H: 230 V AC motor not running I have a 230 V shaded pole motor of a dehumidifier that does not work anymore. The motor makes absolutely no noise when connected to 230 V. The rotor spins smoothly, there is not much dirt in it. That motor is very simple: 4 coils, an inner magnetic shaft, and nothing else except a component between the two coil pairs that is exactly in the middle between the two phases. The component looks like a resistor but it is white and has golden descriptions on it like "128 UMI" and a ground symbol. And it says "N1". What kind of component is this? Could it be broken? I have measured the resistance between the phases, they are all good and the same. AI: Your description makes me think the component is probably a thermal fuse, like these from SIBBLE: (Photo from Amazon) And yes, it could be blown.
H: 10MHz reference vs 1 PPS vs GPSDO In the context of Software defined radios (SDRs), what are the differences between using an external 10MHz reference versus using a GPSDO? Why/when would you use one over the other? And how does the 1PPS relate to all this? Is the 1PPS only used for system time? What happens if you don't use a 1PPS? AI: A GPSDO is a way of providing a 10MHz reference. A GPSDO can be an external device, but some SDR devices are also able to "host" a GPSDO so that you don't need an external unit in its own box with its own power and its own cable for the 10MHz; you just buy the GPSDO option, plug a GPS antenna into the port for it, and go. Other sources of 10MHz are available, of course, and if you have one of those you might prefer the simplicity of an external reference input. PPS is another signal commonly available from GPSDOs and similar devices. Yes, it's usually synchronized to top-of-second, which means that it's useful for deriving time as well as frequency. In some radio applications that's not needed at all, but some systems (such as LTE) require participants to have good absolute time, and 10MHz won't give you that. In theory 1PPS will give you frequency as well as time, but disciplining frequency from 1PPS is much slower (and much more demanding of oscillator stability) than using 10MHz, so if you have 10MHz available you will almost always use that, and if you need time and frequency you will use both.