text
stringlengths
83
79.5k
H: Are USB protocol and connector free or are they patented? For a hobbyist developing a device, certification is not pleasant. I am wondering if implementing USB in any way is patented or needs a certification? I am concerned about both protocol (USB-2,3) and headers (USB-A, B, C). I am also curious if the processor producers should pay to use USB output for their chips? AI: You do not need to pay anything if USB logo and the word "USB" is not important to you and you are happy using a non-unique Vendor ID code. The logo is protected by trademark and copyright and you receive a license to use it with conditions. One of those conditions is that you conduct certification testing. The Vendor ID is how they make sure you pay to support the spec. There are certainly patents associated with USB, however, this will only become an issue if you attempt to reimplement (fork) USB itself, simply designing a device, but not testing it or paying for the logo, will not likely run into patent issues. There is nothing wrong with using a "USB" connector for other purposes, e.g. USB as a device charging port started out as this kind of "off-label" use, or USB reusing interface for a different signal scheme of your design (custom UART). As long as you do not try to make this into its own spec or patent that starts to look like USB... which is when you would need to understand the patents. Most companies selling USB products pay to join the USB organization to obtain a vendor ID and may conduct some conformance testing depending on what they make. USB Implementers forum (USB-IF) owns the USB Specification, logo, and associated trademarks (https://www.usb.org) Specifications, for the most part, are free to read USB-IF maintains the list of vendor IDs USB-IF sets the rules for testing and licenses the third party labs to do testing Every organization that wishes to obtain a Vendor ID joins USB-IF and pays a $5000 annual membership fee or a one time $6000 fee for ID without membership. (https://www.usb.org/getting-vendor-id) Some microcontroller companies let you sublicense use their Vendor ID for prototypes and testing. There is an "unnoficial" vendor ID 0xF055 used by open source projects. Joining also gives you the right to influence the future of the specifications. All assigned Vendor IDs are listed here, every one of those companies has paid to obtain this number. Note that many of companies that make processors and microcontrollers are on there. In order to use the logo and call yourself a USB device you must pay a license fee of $3500 for the logo. (https://www.usb.org/logo-license) As a condition of the license, you must pass a compliance test. (https://www.usb.org/compliance) In order to pass a compliance test you must pay an outside lab and provide test samples that may cost you money. Some devices may not require testing, usually applicable if you make many similar devices and do not want to test all of them. If you are a member paying annual dues, the $3500 fee is waived. As an aside, conformance testing in and of itself is a great engineering challenge, while you may wish to avoid the fees associated with USB and conformance testing with independent lab and this is reasonable for a hobbyist it is still a good exercise to go through the certification tests on your own. It serves as a design checklist and implementation guide, and is also there to ensure that your device is inter-operable with other USB devices. The last thing you would want as a designer, even of a hobby product, is a USB widget that damages or is not interoperable with other USB devices.
H: How to get from theory to a working Industry Control System? EE Student here who recently finished the classical control theory class. I was wondering the process of how the industry or anyone goes from drawing block diagrams to actually implementing in hardware. For example, I'm trying to design a system that keeps a battery from reaching a threshold temperature without having the battery reduce its power output. I'm having trouble visualizing how I will go from a PID controller in theory to the actual hardware system. AI: I used to have the same feeling when I were introduced to control systems. We always worked on this perfect little DC motor with a nicely made test bench with good sensors etc. Implementing the hardware is usually, drivers (high/low side), communication protocols, sensors networks, this isn't really the worst thing. Always research your options https://www.electronicdesign.com/electromechanical/add-simple-temperature-monitoring-battery-management-systems So my way to go about this - Identify your sensors and actuators. (Learn all you can about them most important step!!) Identify your system. (disturbances, integrating influences, unlinearities etc.) Choose a proper control scheme. (Fuzzy logic, cascaded, MIMO etc.) Draw a block diagram. (then think about the system as a whole and redraw it 10 times) Implement and tune accordingly. That's the quick and dirty, as you gain experience you will start to look at more advanced things, such as the influence of clock jitter, automatic gain scheduleing etc.
H: Why cannot I use the USB port directly to communicate via PC with STM32F4-DISC I will keep it short and clean, if it won't be enough please let me know and add more details. When using an Arduino UNO, a serial communication can be achieved by the same USB connection which is also used to load the code or power the board. But when using another board for ex. stm32f4-disc, I also power the board and send the code into the board via a USB port on my board. However to get a serial communication between pc and board, I specify some pins as UART Tx/Rx and use a TTL-USB converter. So why using the USB port on Arduino UNO for serial communication is possible while it is not the case with STM32F4-DISC? AI: In both boards, communication between the PC and the microcontroller is mediated by another microcontroller. On the Arduino board, communication between the target micro and the interface micro happens through the serial port of the target, while on ST boards communication happens through SWD interface. ST used SWD interface because it allows for much more sophisticated control and debugging, while the serial port is somewhat limited on that sense. When you are not programming the target, on Arduino boards, the serial interface is free to be used as is; the interface chip is seen on PC side as VCP (Virtual COM Port), so the PC thinks it is connected to a serial interface, and sends (and expects) serial signals, that are relayed directly to the target micro. This is not possible through SWD though. While you do not specify the exact discovery board you have, most if not all of the target MCUs of the STM32F4 series have an onboard USB controller, that can emulate VCP with the ST software stack. If there's a second USB on your board, usually "USER USB", odds are you can use that one, but you will need to use (and understand) the software stack, at least to some extent.
H: Why does the voltage of a lead-acid battery drop with load? My solar power system contains a lead-acid battery but as soon as I use the inverter to power some load, the voltage drops instantly by 1 volt. Why does this happen? And is it proportional to the load (bigger load = bigger voltage drop)? AI: Take a look at this graph from here: - From All About Batteries, Part 3: Lead-Acid Batteries. It's a typical 12 volt lead-acid battery discharge characteristic and it shows the initial drop from about 13 volts to around 12 volts occuring in the first minute of a load being applied. Thereafter, the discharge rate doesn't unduly affect the output voltage level until the battery gets quite depleted of stored energy. This site explains in detail why that initial drop of terminal voltage is steep compared to the much slower drop in voltage that occurs afterwards: - When a current is being drawn from the battery, the sudden drop is due to the internal resistance of the cell, the formation of more sulphate, and the abstracting of the acid from the electrolyte which fills the pores of the plate. The density of this acid is high just before the discharge is begun. It is diluted rapidly at first, but a balanced condition is reached between the density of the acid in the plates and in the main body of the electrolyte, the acid supply in the plates being maintained at a lowered density by fresh acid flowing into them from the main body of electrolyte. After the initial drop, the voltage decreases more slowly, the rate of decrease depending on the amount of current drawn from the battery.
H: Isolated audio without a transformer I'm putting together a guitar pedal for splitting the signal to two different amps. One of the features I want to put in is a 'ground-lift'; isolating the signal to avoid ground loops between the two different loads. The traditional way to do that is with the following simple method: a suitable transformer... simulate this circuit – Schematic created using CircuitLab However, I don't know how much I trust the transformer to not colour the signal, and I don't mind doing a bit of over-engineering to avoid using one. I'm more trusting of op-amps and AC-coupling using series capacitors, so I figured the following might be a good workaround: simulate this circuit The load-side of the AC-coupling capacitor is biased by an supply isolated from the source and fed into a buffer. Is there any reason this wouldn't work the way I think it would? AI: Is there any reason this wouldn't work the way I think it would? You cannot expect that circuit to work because the guitar signal ground connection has to connect into the op-amp circuit ground node and without that connection you are just going to get noise. The impact of this is that you are not therefore isolating the two receiver circuits as you previously wished would happen. Try using fully differential amplifiers such as Instrumentattion Amplifiers but, don't expect miracles - IA's can isolate quite well but only within the voltage range of their respective power rails. In other words, if receive circuit A is offset from receive circuit B by a few volts to a few tens of volts you will hit problems. True galvanic isolation (up to several hundred volts) is acheivable by using magnetics and therefore transformers.
H: What is the current capacity of this cable? This is a 8 wire 0.5mm2 cable (insulator is PVC), there's 17 strings of copper in each wire. I couldn't find the current capacity of this specific wire on their website but their 1.5mm2 x 8 cables are capable of handling 27A when distance is about 10 meter (reduces to 5A when distance is 150 meter). I'm going to pass a maximum of 7-8A through two of this wires (other wires gonna carry about 1A) and the distance is about 1.5-2 meter. Can this wire handle 8 amperes of current? wires current: 1. LEDs 12V 30W 2.5A 2. Waterpump 220V 40W ~200mA 3. Airpump 220V 20W ~100mA 4. Heater 220V 300W 1.5A 5. MCU* 5V ---- 500mA *there's some relays connected to MCU that's why it's using 500mA. and two wires gonna be 220V INPUT which gonna carry ~5A in total. AI: Assuming the resistance is 300% of the resistance of 1.5 mm^2 wire and the thermal cooling area is only 57%, you can keep it cool enough if one wire has max 2 amperes RMS continuously in free air. Four wires in parallel can handle 8 A. But that's not all! How long is your cable? Do the fuses trip in case of a short circuit soon enough (=before there's a fire)? There's length limitations is regulations also for that reason. What wires are before your cable affects too! Get local pro help to check your distribution system!
H: Why an 8kHz notch on the headset mic input of a Qualcomm WCD9330? I have here a smartphone which uses a Qualcomm WCD9330 audio codec IC. (Itʼs a Galaxy Note 4.) Iʼve discovered through testing that the headset microphone input exhibits a roughly 10dB notch in its frequency response at about 8kHz, and, as well as being concerned, Iʼm also curious as to what are possible engineering explanations for this, intentional or otherwise. (In part, Iʼm also trying to figure out whether this is a characteristic of this model, or if the phone has been damaged.) Rewinding a bit, once I knew the IC involved, I of course grabbed its device specification (this actually turned out to be for a different but very similar device — canʼt find the spec for the WCD9330, but even the WCD9335 is similar). At this point, all I knew was, recorded sound was muffled, like itʼd gone through a low‑pass filter. The ADCs have sample rates of 8, 16, 32, 48, 96, and 192 kHz, so it occurred to me, particularly when viewing the 16kHz frequency response chart on page 30, that maybe the phoneʼs firmware has the hardware sample rate stuck at 16kHz (even though the recording application asked for and was being fed 44.1kHz). I eventually decided to test out this theory physically. I have access to a sweep generator, oscilloscope, etc., but not having them handy at the apartment, I went with a more ghetto approach. I created a WAV file on my PC with 28 pure sine tones, 0dBFS, 500ms each, on 1kHz intervals from 1kHz to 20kHz and 500Hz intervals in the area of interest where I figured the roll‑off was. I just wired the PC sound interfaceʼs output straight to the microphone leads on a 3.5mm TRRS plug — I know, terrible! It did basically work, though. I used a third-party recording app on the phone to capture raw 44.1kHz PCM into a WAV file so that there shouldnʼt be any interference by a lossy data compressor. Initially I turned the PCʼs software volume control all the way down, not wanting to swamp a mic‑level input, but ultimately I found I had to set it fairly high, around 75%, to get a signal that got anywhere near 0dBFS in the recording, and there was still no clipping. This may also be part of the problem, and is consistent with the observation that headset recordings on this phone come out with a rather low signal level. I pulled the resulting file into an audio program on the PC that can do RMS power and FFT analysis on selected regions. The result is not quite what I was expecting. Well, first of all, it was full of harmonic distortion. I blame that on a combination of fairly cheap input and output circuits and the hideous way I had them connected. I should probably have used a load resistor to correctly impedance match, and also maybe use a DC blocking capacitor. (Mind you, on the latter point, I didnʼt see any significant DC bias in the result.) Not to mention, I didnʼt consider whether the phone powers the microphone through those same wires. But I was anxious and lazy. And the main tones were still more or less clearly discernible on FFTs in spite of also having strong harmonics, so I figured the results would still mean something, and it looks like they did. When I saw a dip towards 8kHz I figured, hey, I was right, itʼs sampling at 16kHz. But then the response curve mystified me by coming back up. From 14kHz through 20kHz, the response is back at its maximum! All the way up to 20kHz, the principal frequency is the strongest peak, by a clear margin; so per Nyquist, the phone must be using 48, 96, or 192kHz sampling after all! Thatʼs where I really start scratching my head. Itʼs like itʼd been put through an 8kHz notch filter... but why?? Hereʼs the results: (The blue plot is rounded to the nearest dB, thus the bumps. Technically, the total RMS should probably have been higher than the principal, but these were measured using different tools.) Iʼm pretty sure this is not an artefact of my sloppy measuring setup, because this very much mirrors what I was seeing and hearing in recordings made from the Samsung headsets: muted sibilants, and power spectra that took a dip around 8kHz. It also confirmed my observation that the exact same headset in another model Samsung phone (Note II) didnʼt produce this muffled sound; itʼs now doubly clear that itʼs something in the phone itself. I wish I had a second identical unit to test this on to rule out something actually broken in the phone, but I donʼt. Iʼm not even sure how something would break in such a targeted way! Iʼm struggling to understand what reasonable explanations, either intentional or otherwise, might exist for this very specific notch. Maybe itʼs a design flaw in the WCD9330, but if you ask me, a two‑octave 10dB notch at 8kHz would be such a remarkably embarassing flaw that I canʼt possibly see a company half as reputable as Qualcomm releasing such a thing. Itʼs so huge I was able to characterize it with the engineering equivalent of a sundial! Now, Iʼm aware that ADCs can produce strong aliasing artefacts where the input has any components above the Nyquist frequency, and therefore have to have an analog low‑pass filter ahead of them. Itʼs occurred to me that maybe some firmware dev forgot to set the AAF cutoff frequency appropriately for the sample rate being used, but this explanation seems, well, a little strange, for two reasons. (i) Arbitrarily high frequencies can produce aliasing, so an AAF should be a low‑pass, and I suspect theyʼre simpler than notches, too; and (ii) I canʼt think of any use case for setting the AAF independently of the sample rate, so Iʼd kinda-sorta assume the chipset would lock the two together at the hardware level, although I havenʼt confirmed this! Another dimension to this problem is that the signal level from the headset mic is really low, and I suspect this is probably due to a setting by the firmware (thus an Android SE question). I donʼt know if a really low gain, or attenuation, on the input amp could affect the frequency response of the input in this manner. Is that possible or likely? (If so, why?) The WCD93xx also have a pair of five-stage digital IIR filters, which could of course be configured to produce the notch, but Iʼm under the impression phones normally use the IIR for sidetone, not for muffling the microphone!  XD I donʼt know for sure if the phone has any circuitry ahead of the WCD9330, but from what I can glean, it probably doesnʼt have much. I was able to dig up the service manual for a closely related model that is basically the same except for which UMTS and LTE bands are supported. Itʼs for the SM‑N910F rather than the SM‑N910W8 which I have here. This is what it shows for the headset circuit: The big IC is of course the WCD9330, as best as I can tell (the manual is missing the part manifest!) The manual doesnʼt show where EAROUT_L, EAROUT_R, HPH_REF, EAR_MIC_P, and EAR_MIC_N go, but Iʼm more or less assuming these go directly (via a separate PCB) to the 3.5mm jack. This seems to be also suggested by the relevant part of the “typical application” diagram of the very similar WCD9311: One thing that confuses me, however, is that HPH_REF and EAR_MIC_N are shown as separate lines and even have separate resistors, but in fact the phoneʼs headset uses a TRRS (four conductor) plug, on which the ground ring is shared between the headphones and headset mic.  Hmmmmm. So whatʼs going on, there? Anyhow, my main question is, what are possible/likely explanatons for this 8kHz notch? EDIT:  I havenʼt objectively tested, but by ear, this loss of fidelity does not seem to impact recordings made using the internal mics.  It seems to only be on the headset port.  Given the explanation in Brian Drummondʼs answer, this further makes it look like a firmware oversight. AI: The key word here is "phone" ... when telephone systems (wired) were first digitized, the sample rate was standardised at 8 kHz, and on reconstruction, an analog filter cut off high frequencies above 3.4 kHz, slightly below the Nyquist frequency (fs/2 or 4 kHz). An unfortunate consequence of that is that the spectrum of older digitised phone systems (i.e. most landlines) absent that 3.4 kHz filter, contains a lot of unwanted content around 8 kHz (aliasing as Andy says), and making a call to such a system from a modern phone would be quite an unpleasant experience. A fairly broad 10dB notch at that frequency looks like an unhappy compromise between fidelity on modern systems and excruciatingly nasty sound on older ones. It would be possible to turn off that notch when playing music, or maybe on Whatsapp etc where the source of the data is confidently known to have a higher sample rate; but that might well not be possible for a random phone call to/from an unknown phone system.
H: Question about the equivalent circuit of an induction motor This is the given equivalent circuit for the above parameters (from the problem's solution): The resistance is R2[(1-s)/s]. However, my textbook shows that the resistance is instead R2/s for the equivalent circuit of an induction motor: What is the significance in the discrepancy between R2/s and R2[(1-s)/s]? AI: In your top circuit, R2 is also shown as a seperate component. In the bottom circuit, R2 is combined such that: - $$R_2 + R_2\cdot\dfrac{1-s}{s} = \dfrac{R_2}{s}$$
H: Relaxation oscillator, how to change the duty cycle I have a Relaxation Oscillator here. What I'm trying to do is to change the duty cycle of ca 50% to 10%. What I thought of and tried to change R1 and C1 values so the time the capacitor loads and unloads changes. But it stays at ca 50%. What I am trying to find is a way to change the duty cycle to 10%. AI: Charge the capacitor faster (or slower) than you discharge it. For example, replace R1 with this: simulate this circuit – Schematic created using CircuitLab Now, when discharging (Vout low), D1 conducts putting R1 and R2 in parallel. This will reduce the period, but also increase the duty cycle (by decreasing the low period). If you wanted to reduce teh duty cycle, reverse the diode.
H: How can I rectify up to 85 kV? I've recently gotten into eletrochemistry, and I found out that if you break through \$\epsilon_{0}\$ with a high enough voltage you can ionize various gasses. I've already wound a 1:1250 EE core that I plan to operate at 350 kHz on a 25 V supply which should give me 31.25 kV in the arctube, but there's this problem where I think I need to rectify the output and uh, I have yet to see a 50 kV diode. Is there a way to do it that I'm just not remembering? I thought there was a way to do that back in the vacuum tube days. AI: There are rectifier stacks that can handle (say) 100kV. Forward voltage might be 120V meaning that they're 100+ individual diodes in series. Here is some data from a random Chinese supplier (no experience with those guys, but it should give you an idea):
H: How do chargers with different output values work? I have a few USB-C devices with their own chargers and I'm not sure if I can interchange them. What's confusing me is the different output values listed on the charger. From what I understand too high voltage can damage the device that is being charged and too low current can damage the charger/cable, while current above required is always fine (please correct me if I'm wrong). For example my laptop charger can output: 20V=3.25A, 15V=3A, 9V=2A and 5V=2A. If I were to charge my power bank with it which accepts 5V=3A, 9V=2A and 15V=1.2A as input, could something go wrong? In this case if I were to plug in the power bank to my laptop charger how do I know that it's charging at the 15V=3A that it should and not at 20V? On the other hand, if I were to charge my laptop with the same power bank (output: 5V=3A, 9V=2A, 15V=1.2A, same as input) could the power bank be damaged? AI: The USB-PD standard allows for multiple output voltages on USB-C devices, but every USB-C power supply must initially output 5V and communicate with the device on the other end. If the other device does not specifically ask the power supply to output more than 5V it will just continue to put out 5V and no more.
H: Sensitivity (or responsitivity?) of an electrochemical sensor - Definition I read a paper about an electrochemical sensor where there is the term sensitivity expressed in ampere. What is its definition? I found a IUPAC definition here, but the units are ampere/watt or volt/watt. I read also the description of the tag sensitivity (or responsitivity), but online I didn't find this definition about a sensor which works in amperometric condition. I'm looking for a definition where there are also the possible units of measurement. Thank you for your time. AI: Sensitivity, formally, is $$\frac{\partial \text{Output}}{\partial {\Theta}} $$ where \$ \Theta\$ is the parameter of interest. This is generally the way sensitivity appears, thought the output can be specified different ways, such as the change in resistance of a sensor, or the resulting voltage change.
H: How to solve this task that relates to power in circuit? The task says: Two impedance's are added together in parallel. \$ Z_{1} = 2 - j5 (Ω) \$ ,\$ Z_{2} = 1 + j (Ω)\$ Power on \$ Z_1 = 20 W\$. Determine the reactive power. I tried this \$P = U * I\$ => \$ P = \frac{U^2}{Z_1} \$ and that would give me the absolute value of U = 10.38 V ,after that using voltage I would find the current that goes through both Impedance's. Following that logic I would then find the current of the source and multiply that with Impedance's ( \$ 6.82\angle{-29.91} * 1.52\angle{29.93} = 61.33 - 35.25j \$ ) and that would give me the wrong answer. Is there any tip, I think my understanding of this whole concept of power in a circuit is a bit loose, so help about what I did wrong is greatly appreciated. AI: Is there any tip If you know the power on Z1 then you know that that is dissipated by the "2" part of 2 - j5 and this leads on to be able to state the current through that 2 ohms: - $$20 = I^2 \cdot 2$$ Hence current is \$\sqrt{10}\$ = 3.162 amps. From that you can calculate the line voltage using Z1's impedance. That impedance is \$\sqrt{2^2+5^2}\$ = 5.285 ohms. So you have the line voltage of 17.03 volts. Can you take it from here? In engineering, power is real (or active) power, apparent power is volts x amps and, reactive power is \$\sqrt{(V\cdot I)^2 - (watts)^2}\$: -
H: DC voltmeter gives unknown reading when powered I just bought a DC 3 wired voltmeter and it was working perfectly. Here is it image: I used the yellow wire for measuring the voltages. But for some reason, I desoldered the wires and soldered pin headers. Now it gives unknown reading like 0.XY (eg 0.37) whenever I just connect the positive and negative to battery. It was not happening before. Can I be helped to troubleshoot what I did wrong? Have I damage the circuit? Here is the underneath image of the one I soldered: AI: There's no reason I can think of why you'd get different behavior if you did the desolder/solder job well. The underneath part you show doesn't show good solder flow around the added header pins. So perhaps there's an intermittent problem due to poor/lack-of soldering? But otherwise, I don't know of a reason why replacing wires with header pins should change its behavior.
H: What is the use of resistors in series with BJTs in a push pull amplifier configuration? If you make an internet search for "Push pull BJT amplifier" you will find many different variants of the following schematics: simulate this circuit – Schematic created using CircuitLab These three configurations are the ones I am interesting in understanding better. First, I see that this circuit is often labelled as amplifier but since the gain appears to be in the best case equal to 1 it looks to me more like a current amplifier perhaps rather than a voltage one. Suppose that V_signal is a sinusoidal 1 Vpp (maybe even lower 100 mVpp) signal at a given frequency. My main question is as follows: Referring to configuration A, while I understand the role of the diodes and R1 and R2 in the biasing of the BJTs to avoid crossover distorsion, I do not understand what is the role of R3 and R4 which are in series to the BJTs. My first thought is that they should limit the current through the load but in the simulations the circuit works fine even without them so I am a bit confused on their use and how to size them. As a sidequestion, what are the advantages/disadvantages of configurations B and/or C over A? I can see how C is more advantageos in that it does not need a double side power supply and can work straight from 12 V but I cannot understand why I should use B which is using an additional capacitor apparently for the same result as A and C. Edit: I noted the circuit is not easy to visualize, so I've just added 3 screenshots (Vcc=12V, Vee=-12V) AI: You are correct that the circuit has a voltage gain of 1, and that the diodes are to minimize crossover distortion. The idea is that the diode voltage is the same as the base-emitter voltage of the transistors, so that both transistors remain biased in the "on" condition - they are both conducting. This means that there is always a theoretical current from the positive rail to the negative rail, through the pair of output transistors, which is wasted power and is dissipated as heat in the transistors and the series resistors. With no series resistors, all of this power must be dissipated in the transistors. Consider what happens when the circuit starts to drive a load. The transistors start to heat up, and the base-emitter drop starts to decrease to a value lower than in the relatively cool diodes. This causes the current through the two transistors to increase - further increasing heat by further decreasing the base-emitter drop and increasing the through-current. So in general, make the series resistors as large as you can consistent with your output load characteristics. As to the difference in circuit "A" and "C" from "B," think about the fact that the phase shift due to the capacitance of the diodes and transistors will not be identical. This is not going to be noticed at low frequencies, but if you crank up the frequency on your simulation, you will see if the mismatch is pronounced enough to cause any issues. If there is a problem, you can overcome some of the effect at high frequency from the diodes by using two large capacitors as shown in "B."
H: Adapter to plug home audio system speakers into computer I'm wondering if there is an adapter I can use to plug two speakers that came with my home audio system into a laptop. My laptop has an auxiliary port (not sure what the technical name is) that I plug my headphones into so ideally I would like to use that for these speakers also. I wasn't sure how to title my searches when I researched this due to not knowing what the speaker extensions are even called, but I tend to assume there is an adapter for everything these days! The impedance is 8 (not sure if this matters). Ultimately, the stereo itself doesn't work, but the speakers do so I'm trying to figure out if they're worth salvaging. The model of the system is Sony MHC-EC619iP. The speaker extensions have two adjoined "prongs" that plug into the back of the system under "Left" and "Right". AI: You will need an amplifier as the laptop won’t drive those speakers directly. An amplifier with a remote control works well and I do this with my laptop & a Kenwood amp driving pair of Linn bookshelf speakers.
H: I set up an amplifier (LF351) for a gain of 5.7, but it is saturating. Do I have to utilize the offset null pins? simulate this circuit – Schematic created using CircuitLab The feedback network I am using is a voltage divider with 4.7K and a 1K resistor. The node after the 4.7K resistor is connected to the inverting input of the amp. The node after the 1K is grounded. Attached is the hyperlink to the LF351 datasheet. LF351 datasheet AI: LF351 doesn't have rail-to-rail input capability, not even close. With +/- 15 V supplies, the minimum common mode input voltage is specified as -11 V, with typical operation to -12 V. Translated to your +10.5/-0V supplies, this means you need to keep the input common mode voltage above 3 V (if you want to fuss around and take a risk) or 4 V (to be sure it will work). You should either use a wider supply range (+/- 12 or +/- 15 V) or choose an op-amp better suited to the supplies you have.
H: Encrypting/Decrypting messages with Elliptic Curves in Arduino Is there any possibility to encrypt/decrypt messages using only Elliptic Curves Algorithms? I found this library ECC Arduino library but it only generates numbers, there is no function for encrypting/decrypting. I am thinking, maybe it is not possible to encrypt/decrypt messages with only using ECC? Maybe I need AES or any other encryption library too? I don't know. That is why I am asking this here. I compiled the test code of this library: #include <uECC.h> extern "C" { int RNG(uint8_t *dest, unsigned size) { // Use the least-significant bits from the ADC for an unconnected pin (or connected to a source of // random noise). This can take a long time to generate random data if the result of analogRead(0) // doesn't change very frequently. while (size) { uint8_t val = 0; for (unsigned i = 0; i < 8; ++i) { int init = analogRead(0); int count = 0; while (analogRead(0) == init) { ++count; } if (count == 0) { val = (val << 1) | (init & 0x01); } else { val = (val << 1) | (count & 0x01); } } *dest = val; ++dest; --size; } // NOTE: it would be a good idea to hash the resulting random data using SHA-256 or similar. return 1; } } // extern "C" void setup() { Serial.begin(115200); Serial.print("Testing ecc\n"); uECC_set_rng(&RNG); } void loop() { const struct uECC_Curve_t * curve = uECC_secp160r1(); uint8_t private1[21]; uint8_t private2[21]; uint8_t public1[40]; uint8_t public2[40]; uint8_t secret1[20]; uint8_t secret2[20]; unsigned long a = millis(); uECC_make_key(public1, private1, curve); unsigned long b = millis(); Serial.print("Made key 1 in "); Serial.println(b-a); a = millis(); uECC_make_key(public2, private2, curve); b = millis(); Serial.print("Made key 2 in "); Serial.println(b-a); a = millis(); int r = uECC_shared_secret(public2, private1, secret1, curve); b = millis(); Serial.print("Shared secret 1 in "); Serial.println(b-a); if (!r) { Serial.print("shared_secret() failed (1)\n"); return; } a = millis(); r = uECC_shared_secret(public1, private2, secret2, curve); b = millis(); Serial.print("Shared secret 2 in "); Serial.println(b-a); if (!r) { Serial.print("shared_secret() failed (2)\n"); return; } if (memcmp(secret1, secret2, 20) != 0) { Serial.print("Shared secrets are not identical!\n"); } else { Serial.print("Shared secrets are identical\n"); } } It gives me this output: Testing ecc Made key 1 in 1108 Made key 2 in 1107 Shared secret 1 in 1096 Shared secret 2 in 1101 Shared secrets are identical and the RAM it uses is 566 bytes (6%) and 9846 bytes (3%) of flash, running on Arduino MEGA 2560 R3 Thank you AI: The library you're using implements ECDH and ECDSA. These are key agreement and signature algorithms (respectively) -- they cannot be used directly to encrypt messages. To encrypt a message to a known public key, one can use ECIES: Generate a new, ephemeral EC key pair (uECC_make_key()) Use ECDH ( uECC_shared_secret()) with the private component of that key pair and the known public key to generate a shared secret. Use a key derivation function to turn that shared secret into a key for a symmetric encryption algorithm. (Neither of these components is implemented in micro-ecc.) Use that symmetric key to encrypt your message. Transmit the message along with the public component of the ephemeral key, then discard the ephemeral key. The recipient can use ECDH with its private key and the public component of the ephemeral key to recreate the same shared secret, then use the KDF to decrypt the message.
H: Multiple NE555 timers, disable retriggering until all have finished I plan to build a small timer device that, when triggered, lights up 3 leds. After 30 min, the first goes dark, after another 30 min the second and yet another 30 min later the third. It's pretty easy to accomplish building three separate monostable NE555 stages that share one trigger button. Yet, only one at a time prevents its being retriggered during its high-level pulse at it's output. Question is: is there an easy way to keep all of the 555s from being triggered while any of them is still activated? I thought of putting a diode between their outputs and the other's trigger input and putting a resistor between the button and ground, so that an active ouput would pull the other trigger inputs high, stronger than the button to ground would pull them down, and due to the diode prevent them from being pulled down if all outputs showed low-level... Could something like that work? Something like a only-pull-up-not-down mechanism... Any suggestions appreciated. Thanks! AI: Could something like that work? Something like a only-pull-up-not-down mechanism... Any suggestions appreciated. It could work, but you'd need an impressive amount of hand-tweaking things, and very low-leakage capacitors, guarantee stable thermal environment … it's hard to get 555s to work reliably and precise at long periods. It's not what they're designed for So, you really wouldn't want to build a long-term timer out of 555s; instead, you'd want to build something out of well-defined short periods, and count these reliable periods with a counter. You'll notice that your own description of the problem reads like an algorithm, "do this, then wait, unless a condition is met, then do this or do that, depending on…". That's really something that is easy to translate into software. So do exactly that which every EE since the mid-1980s would have done in your situation: Get yourself any microcontroller, and write a tiny bit of program code. Microcontrollers have been designed specifically for this kind of problem. Things like the Arduino platform make this easy; but for the same price, you could even have a Raspberry Pi Zero, which would allow you to program it in any language of your choosing (given there's a compiler / interpreter for Linux). And: even a Raspberry Pi Zero (which in idle consumes 100 mW) would have less power consumption than three NE555 without load.(which doesn't say much positive about the Raspberry Pi, but a lot about the NE555).
H: Interrupt control in STM32 I am trying to learn about STM32 programming. I started to read some references before start the programming. I am currently reading this ST presentation. It says: When an interrupt request with lower or equal priority is raised during execution of an interrupt handler, it becomes pending. Once the current interrupt handler is finished, the context saving and restoring process is skipped and control is transferred directly to the new exception handler to decrease interrupt latency. So back-to-back interrupts with decreasing priorities (higher priority values) are chained with a very short latency of a few clock cycles. What is the context saving and restoring process mentioned in the above quoted text? If someone can explain entire STM32 interrupt process, greatly appreciate. AI: When an exception (interrupt) happens the context of what the core is doing at that moment needs to be pushed on stack, so it is possible to return to it later. This is done by a stackframe. For an exception a stackframe looks like this: Registers R4 to R11 are not pushed to stack unless the exception code needs them. The compiler may push/pop these registers if required. Above is the minimum amount of registers pushed by hardware, to keep things quick. When the exception is finished, the hardware reverses the stackframe and restores the context to continue execution. The processor can skip returning the stackframe if another interrupt is still pending. This is called tail-chaining. More info about the Exception Model of the Cortex M0 can be found in the ARM docs.
H: Display power consumption ratio of smartphones and smart watches What is the most power-consuming part of your smartphone or smartwatch display? Or is it cpu? Naturally I think that it will change depending on the situation, but general use is assumed. AI: As you previously said, it depends much in which situation your smartphone or smartwatch is at the moment. In this article you can see some interesting data on power consumption for most parts of a smartphone considering many scenarios: In suspended mode (scenario in which the smartphone stays most of time with backlight off, but ready to receive call, wifi, etc...) the most power consuming parts are, in order: GSM, CPU and graphics. In Idle mode (when the smartphone is "awake" but no app is actively being used) almost 50% of the power consumption comes just from the screen (graphics and LCD) considering the backlight off. The GSM (22%) and CPU are the next biggest consumers. Obs: Notice that the power consumption of the screen grows exponentially with the brightness level, so you might have different results depending on that factor. As example, In idle state, if the backlight is at its maximum brightness, it can reach 80% of the total consumption. During a call, the GSM dominates the power consumption, followed by the screen and CPU. What about an entire day? In a scenario of an average day where you have to make regular calls, the main consumers are, in order, the GSM, CPU and Graphics.
H: Non-equal batteries discharge in parallel connection My friend and I have an argument and I want to ask the community to say who is right and who is wrong in their beliefs, and explain it with formulas and laws (if possible). We have two different Li-ion cells connected in parallel. Both cells are charged to 4.1V. We put a load of approximately 2A on them and wait for some time. Now when we remove the load and disconnect cells from each other, they have different end voltage. My friend says that during the load, one cell powers the load while the other powers the load AND the weaker cell. I say that the current starts to flow from the stronger to the weaker cell only after the load is removed. Who is right and who is wrong? BTW initially I thought they would end up having the same end voltage, because the weaker cell voltage would drop more under the load and the stronger cell would give more current out of it. But it appears that the cells end up having different voltages. AI: initially I thought they would end up having the same end voltage, because the weaker cell voltage would drop more under the load and the stronger cell would give more current out of it. But it appears that the cells end up having different voltages. It depends on what is making one cell 'weaker'. Imagine cutting a single cell into two sections, one twice the size of the other. The 'weaker' section has 1/2 the capacity and 2 times the resistance of the 'stronger' section, but when both sections are joined together they act exactly like the complete cell - both discharging at the same rate and ending up with the same voltage. However if you parallel two cells which have the same capacity but different resistances, the 'weaker' cell will discharge slower and end up with higher open-circuit voltage. On the other hand if both cells have equal resistances but one has lower capacity then it will discharge faster (relative to its capacity) and end up with lower open-circuit voltage. In practice this means that cells should not be wired in parallel unless they have proportionally matched capacities and resistances, otherwise the 'stronger' cell will discharge more than the 'weaker' one and the expected battery capacity will not be realized. However this is really only a problem at high currents where internal resistances become significant.
H: Why should I use a pull up/down resistor for a GPIO output pin? I know there are lots of similar questions and read them, but I need a simpler and clearer answer. I understand why and how to use a pull up/down resistor when using a button (GPIO input). But while configuring a GPIO pin which will be connected to an LED, what is the use of these settings? I tried no pull-up and pull-down and pull-up for example, but I could not see a difference in the implementation. I am using STM32F407-DISC. AI: The pull up/down is only effective in Input or Open Drain configuration. When set as output there is always an output MOSFET active, the pull up/down is then wasting energy. The exception is open drain mode, this disables the P-MOS, then pull-up can be useful again.
H: How to optimize the life of a Lead Acid deep cycle battery? I have a lead-acid battery : HANKOOK DC24MF DEEP CYCLE 80Ah 12V. In hope of extended this battery's life, I was thinking about buying an identical one and put it in parallel. This way by using "80Ah", instead of emptying one battery, both will drop to 50%. (Simplifying the math here of course.) 1 - Is this method good to extend both batteries life ? 2 - They are rated for 550 cycles, but emptying only half doesn't count as a full cycle right ? 3 - I considered 12V as "Empty" and 14.2V as "Full". Are these good numbers to save battery life ? EDIT: Battery would loose warranty after 4 years or if below 10.6V AI: 1) Fully discharging a lead acid battery is bad for its life, going to only 50% is good, and will extend both batteries lives. Twice the installed capacity also gives you an emergency 100% reserve, if you're happy for that capital to be tied up permanently. Before you connect two batteries in parallel, they must (obviously?) be the exactly the same chemistry and voltage, no paralleling a wet 12v and an SLA 12v. They should also have the same voltage, equalise them with a resistor or a lamp if not. It helps if they are the same age of battery. 2) Cycles are usually counted as a period of discharging, followed by a period of charging. It doesn't matter how deep this cycle it, it still counts as a 'cycle'. However, the battery life will be likely extended to thousands of these shallower cycles. It's more than word games, as battery life is non-linear with depth of discharge. If you start counting fractional cycles, then a 50% DoD might have to count as 0.2 of a cycle. 3) You might want to review that 14.2v figure for how you intend to charge the battery. It's a bit high for float charging SLAs, and a bit low for cyclic charging wet cells. Too low a charge voltage can lead to sulphation, which is another way to shorten the life of the battery. 12v as an endpoint will give you better lifetime than the 11.5v or even 11v that I've often seen quoted in battery literature.
H: USB bus Differential signals and Pin swapping USB 1.0 and 2.0 has D+ and D- two differential pins. My understanding is that differential signals are symmetrical so any of the two lines carries an inverted signal of the other line. But in the case of USB if I swap the two lines then the USB ceases to function. Is it because the USB lines are differential as well as tri-state logic also to reverse the data direction in them? AI: At the receiver end, the Data- is substracted from Data+ (a difference is calculated). Then if the difference is positive, and above a threshold it is translated to a logic 1 or 0, depending on the protocol, if it is negative and below a threshold, it is translated to the opposite. By swapping the lines, you basically invert the logic levels, thus messing up the protocol. Edit: Chris Stratton pointed out the non-differential use of the lines during speed identification. More info about this here
H: Z80B starts and stops? I've decided to take some time to refresh my electronics knowledge after 30 years out of college. I've run into a small problem that I can't quite figure out and need a pointer. TLDR: The Z80 initially starts (watching M1 strobing) but halts after just two or three, sometimes more, sometimes fewer, machine cycles. I've built an ~ 5hz 555 astable circuit to drive the clock line of a Z80B. The Z80B has all of the data lines pulled down to ground. The INT, NMI, HALT, BUSRQ, and WAIT are all pulled high. I have the RESET on an RC circuit to go high after 1 second, plus a push-button to pull it low for a manual reset (pictured below... Ignore the crystal oscillator circuit; that isn't connected to anything). The 555 is putting out a nice steady square pulse at about a 50% duty cycle. M1 will go high during reset and then cycle between one and five times, but then stops (seeming to indicate that the processor has stopped). With the data lines pulled to zero, I'm expecting it to continue to run, executing NOPs. Can someone see anything obvious that I've done wrongly here? The thing that keeps running through my head (and that I can't seem to find any data on anywhere) is that the clock might be too slow if the Z80B uses dynamic registers internally. I can't seem to locate any authoritative datasheet for the Z80B. AI: Thanks to @DKNguyen for reminding me of a super basic standard "thing to do". I neglected to install decoupling capacitors between the power and ground of the 555 (556) and the Z80B. With 1nF capacitors installed, it immediately begins to behave exactly as expected.
H: Grounding considering signal return path I wanted to ask if there is a difference between 2 scenarios on the illustration i've included. If we have 2 or more boards interfacing with each other should we connect every output with it's own signal return path or can we simply ground every board connecting it to a common point and carry the signal with single wires? It's much more convenient to do it like in scenario B, but i've seen a lot of PCBs where every input/output was a pair of pads: "hot" pad and a grounding pad. Why can't we just use one pad to ground a pcb and use only "hot" wires? AI: It depends. Scenario B is effective and commonly used for many situations. Scenario A may be needed when the signals have high frequency content, or when there is a special need to achieve low cross-talk. What frequencies are "high" depends on the length of the cable.
H: maximum real power problem The task says: Determine the value of resistance \$ R\$ so that true power of loads is maximum (biggest possible). Picture of a circuit that came with task: I solved it this way: I know that \$ P = I^2 * R_{real} \$ and as \$ I = \frac{U}{\sqrt{(R + 3)^2 + 4^2}} \$ so \$ P = \frac{U^2*(R + 3)}{(R + 3)^2 + 4^2}\$, when I derived that, I get \$ (3+R)^2 + 4 - 2(3+R)^2 = 0 => (3 + R)^2 - 4 = 0 => 9 + 6R + R^2 - 4 = 0 \$ which gives me \$ R_1 = -5, R_2 = -1\$. The answer that I should've got is R = 5, I don't know what I've did wrong. AI: If the objective is to maximize the power dissipated on the load \$R\$. Use, \$P_R = \frac{U^2 \cdot R}{(R + 3)^2 + 4^2} = \frac{U^2 \cdot R}{ R^2+6R+9+16} = \frac{U^2}{ R+6+25/R}\$ Then, differentiate the expression to find its maximum, that is, when \$R+6+25/R\$ reaches its minimum. If you are actually looking for maximizing the power dissipated on both resistors, \$R\$ and \$ 3 \Omega \$, use, \$P_{total} = \frac{U^2 \cdot (R+3)}{(R + 3)^2 + 4^2} = \frac{U^2}{\frac{(R + 3)^2 + 16}{R+3}} = \frac{U^2}{R + 3 + \frac{16}{R+3}}\$ Then, find when \$R + 3 + \frac{16}{R+3}\$ is at its smallest value.
H: Switched Capacitors In this link at Activity 0 i read some stuff that make me confuse : 1-At the first step he charges capacitor as we know, no problem 2-But when he ties BATTERY's POSITIVE terminal to CAPACITOR's NEGATIVE terminal, he reads 18.48 V! how is that possible? how capacitor acts like that enables this situation? Also same situation is valid here; 1-He charges capacitor as we know in first(1) step, 2-He ties BATTERY's NEGATIVE terminal to CAPACITOR's POSITIVE terminal and we read -9.14V how is this possible also? So to sum up the questions; Q-1) How these results can occur? Q-2) How capacitor acts like this to this results to occur? (what provides this situation to occur) Any help is appreciated, please help me to understand this. AI: The key point is, if you disconnect the capacitor, it is still holding a charge, so it still has 9 V across it. But when he ties BATTERY's POSITIVE terminal to CAPACITOR's NEGATIVE terminal, he reads 18.48 V! how is that possible? how capacitor acts like that enables this situation? 9 V across the battery plus 9 V across the capacitor is 18 V. This is basic Kirchhoff's Voltage Law. He ties BATTERY's NEGATIVE terminal to CAPACITOR's POSITIVE terminal and we read -9.14V how is this possible also? By putting the black lead of the meter on the positive terminal of the capacitor you're choosing to make that terminal your "0 V" reference. But there's still 9 V across the capacitor. So the negative terminal is 9 V below the positive terminal. Thus it's at -9 V. The battery is irrelevant to this situation. How these results can occur? From the very basic behavior of a capacitor and Kirchhoff's Voltage Law. How capacitor acts like this to this results to occur? (what provides this situation to occur) The capacitor's voltage only changes if there's a current through the capacitor. When you disconnect the capacitor from the rest of the circuit there's no current through it. Therefore the voltage across it remains at 9 V. (If you do the experiment yourself, you'll see the voltage slowly change as you measure it due to leakage current through the meter)
H: Voltage clamping for nixie tube driver I want to design a nixie clock based on a high voltage shift register: the HV5530. I don't what to multiplex the tubes to avoid loss in brightness. My idea is to leave the anodes powered all the time and switch the cathodes by connecting them directly to the outputs of the HV5530. I will use a ribbon cable to connect the tube driver to the board that holds the tubes. Should I worry about any inductive effects of the wires and the traces on the PCBs? Should I use some voltage clamps or will it work by simply connecting the cathodes directly to the chip? AI: Unless you use absurdly long wires (as in feet or yards of the stuff) to connect up the circuit, no, inductive effects should not be a problem. You're probably thinking of relays, which need an inductance (the relay coil) in order to work. Nixie tubes aren't appreciably inductive. All gas discharge tubes, when they are on, are basically constant-voltage devices. And to complicate matters, they need more voltage to turn on (the "strike voltage") than they need to stay on. So you want to do something to limit the current to the tubes. If you were to just connect them straight to that part then you'd fry the tube, the part, or both. It's likely that the part would die and save the tube, but you couldn't count on it. Connecting all of the anodes to your +V should work fine, but you want to connect the cathodes to the pull-downs through resistors, whose value is set to get you the rated current through the tubes.
H: Do Duracell AAA batteries have internal short circuit detection? I was shorting a Duracell AAA battery in a SAFE area with proper precautions. After 2 minutes I disconnected the circuit and measured the voltage, it dropped from 2.8V to 2.6V and the battery was hot. When I reconnected the circuit for another 2 minutes the voltage didn't decrease and the battery wasn't hot. I tried a few more times (after waiting 30 minutes) and the same pattern occurred: the battery drained a bit, but after some time it seemed as if the current stopped during a short. I used the battery to power up a led, it still works. So I'm wondering if there are internal short circuit protections. If so what are they and can I get a few references? AI: Alkaline batteries have an internal resistance. There isn't a current limiter as such, that's just the physical properties of alkaline chemistry and the limits of the relatively-small AAA battery. The thermal vs. voltage effects you see relate to the the ionic properties of the battery, as it recovers from a high discharge. Multiple high discharges will deplete the battery faster than a continuous, moderate discharge. More info here: http://data.energizer.com/pdfs/alkaline_appman.pdf (Don't try that with a Li-ion, please.)
H: Where to wire usb shield output on breakout Apologies if this is rather obvious but I am very much new to circuitry and most answers I have found are about designing new products. I have a USB Type C female receptacle that I would like to attach to my keyboard. The keyboard PCB has a USB 2.0 pin out labeled S, G, D+, D-, V. I am wondering where I should attach the S pin (I believe shield) to the female receptacle. The original cable was wired directly from pin out to USB A male plug. From what I understand, I can: Somehow connect S to receptacle (buy a different one?) Leave S unconnected Connect S to receptacle ground Edit: Here is my keyboard pin out. Here is my Type C receptacle: I would like to attach it as a Ducky 2 or Pok3r would connect to a desktop. I wish to replace the current cable with one that is detachable at the keyboard. AI: If you are trying to replace the USB cable with with the USB C port, then you would simply connect the S pin to the shield of the USB C connector by literally connecting a jumper wire from the S pin to any one of the four shield pins on the bottom(or top, being careful not to let the solder spread away from the bottom of the connector) of the USB C adapter PCB: If you are trying to add a USB C "accessory" port to your standard USB keyboard, then active USB hub circuitry will be required, either by designing your own circuit board, or salvaging the circuit board from a donor USB hub and wiring it between the USB-to-host cable, the keyboard circuitry, and the USB C "accessory" port. You should keep in mind, however, that this configuration is not officially supported by the USB C specification, and may or may not work depending on the hardware, and would also likely require the removal of the two resistors on the USB C board.
H: TL431 / TLV431 supercapacitor voltage clamping circuit I have a question regarding a circuit I've been working on for some time. The circuit is based around existing supercapacitor protection modules and uses a TL431 (actually a TLV431 lower power version) precision Zener device. Basically, the circuit works, but I wanted to get some feedback about resistor values, and whether or not my NPN or PNP transistors are doomed to fail. In summary, the circuit uses the TLV431 and it's reference and sensing resistor divider to set a trip point (somewhere around 2.65 V as I have it at the moment) the TLV431 then starts conducting, pulling current (this is where I get foggy) from the base of the PNP transistor (BC557) turning it on (hopefully in saturation). When it turns on the NPN gets (an unknown amount of?) base current, and turns on sinking the charge current (with a maximum of?) through a resistor and 'around' the capacitor cell. Eventually I'd like to have this circuit in series with my series capacitor strings so that any stage in the stack never sees more than it's 2.7 V (2.65) so long as I stay under the dissipation capabilities of this circuit on the input. The current modules that I bought from eBay only seem to limit on supplies up to about 500 mA. I'd like to get this up to 2 - 3 or 4 amps. Let me know what you think - the specific question is about R3 value, R4 value, R5 value, and if a resistor is required between the PNP and NPN base. Thanks! I've seen versions of this circuit that omit the PNP base resistor, but I've added one because without it I think the TLV431 would burn and fail - perhaps someone could also clarify this aspect of the circuit? If anyone else is building protection circuitry around the TLV431/TL431 for 2.7V supercapacitors I'd really appreciate you chiming in! AI: First off, for a clamp voltage of 2.65V this circuit really needs the TLV431 because it only drops 1.25V, whereas the TL431 drops 2.5V which doesn't leave enough voltage to turn on Q2. The BD437 has a saturation voltage of up to 0.8V at 3A with 300mA Base current. The BC557 is only rated for 100mA maximum Collector current, so to get 4A you need a power transistor with higher gain (and preferably lower saturation voltage) at that current. When Q1 is fully turned on R5 should dissipate most of the power, but at lower current it will be shared between the resistor and transistor. Maximum transistor dissipation occurs when the voltage is split evenly, at a current of ~2A. So you need a transistor that can safely dissipate at least (2.65V/2)*2A = 2.65W. Unfortunately high gain, high power, low saturation transistors are not very common. The 2SC6082 is one example. It has a typical current gain of over 100 and saturation voltage <0.2V at 4A, so it requires less than 50mA Base drive. A BC557 can easily handle 50mA at 2.65V. However in your circuit only Q2's Base current is limited by R4, so maximum Collector current could vary widely depending on the individual transistor's gain. To fix this you could put R4 in series with the Emitter and connect the Base directly to the TLV431. The TLV431 drops 1.25V and Q2's Base-Emitter junction drops ~0.6V, leaving 2.65V-(0.6V+1.25V) = ~0.8V across the Emitter resistor. 0.8V / 50mA = 16&ohm;. This will also protect the TLV431 because the Base current is about 100 times less than the Emitter current. Assuming Q1's saturation voltage is ~0.2V, R5 should be (~2.65-0.2)/4A = ~0.6&ohm;. It could dissipate up to ~(2.65V-0.2V)*4A = ~10W so it should be rated for at least 20W - and it will get hot!
H: Op-amp output wanders over the course of a few seconds In one of our designs we are doing signal conditioning of a load cell (Wheatstone bridge) We have an issue where the main instrumentation amplifier an AD8224 has an output signal that wanders by around 20mV over the course of 10's of seconds. We have gone through troubleshooting the signal chain and tracked the issue back to here, the above plot is taken with the inputs to the amplifier shorted out and connected to 0V via 500ohms. Supply to the op-amp is +-15V, and has 0.1uF bypass directly near the IC, and 10uF about 3cm away. We are using a gain resistor of 49.9ohm which should give a gain of around 991. We are not worried about the high frequency noise, this gets tidied up latter in the chain. I am keen to hear peoples thoughts on what could be causing this, as I am out of ideas. EDIT: A bit more poking around and I was able to find one of our old board revisions that does not show the same issue, these boards are modular, and I was able to slot in the new and old next to each other to compare the results. Channel 0 is the old revision and shows what I would expect of changes due to thermal effects. Channel 1 shows the same board as per above. I note that the old board used a TI INA2126 instead of the AD8224 From poking around the datasheets I also found the AD8222 is very similar to the AD8224 but with a better temperature co-efficient and will order some in for testing, however I feel this is clutching at straws. EDIT: An additional interesting observation is that if I remove the gain resistor (setting a gain of 1) the wandering goes away, from this would I be correct to infer the issue is in the input stage? AI: Welcome to the world of low frequency noise! If you really want to achieve the 0.8uV pk-pk noise at a gain of 1000 listed in the datasheet over a long term, you'll need to temperature control the part at 25C (like they did, as listed in the datasheet). It looks like even after subtracting out the long term temperature noise your at about 0.005mV pk-pk/991 = 5uV pk-pk which is still 5-6 times more than the factor listed in the datasheet. You'll also need to not have any further opamps in the signal chain, as they will increase the noise. Your ADC will also add noise depending on what it is. If 1/f noise is killing your application, build an instrumenation amplifier from chopper amps, or find a chopper instrumentation amplifier.
H: Li-ion Swollen battery dangerous or not? I have a Wifi AP and its Li-ion battery has swollen so much that its cover cannot be put in place over it now. Its working but its backup time has reduced to 20%. I cannot put on the battery cover because of its bulge. Normally its mains charger is power-ON 24/7. Is it safe to keep it working in this shape? Is their any recommendation as to when to replace a Li-ion battery? Is it possible that it blows up and catches fire? AI: Provided it hasn't been over-charged, over-discharged or physically damaged it should be safe. But, why did it puff up? If it was overcharged, over-discharged or physically damaged then it could blow up. Apart from that, puffing indicates that some of the electrolyte has turned into gas, which reduces the capacity and efficiency of the cell. You should discharge this cell to zero volts, discard it and get a replacement.
H: How does a solar PV inverter throttle the input power I have a solar power system (SMA Sunny Boy with 2 strings of panels). When the battery is nearing full charge or the inverter maximum output is reached and excess solar power is available the system throttles the amount of power coming from the solar panels. Observing the panel string voltages and currents it appears that it does this by reducing the string voltages while allowing the currents to be whatever the panel strings can supply. Presumably the voltage measurement is taken after some component that regulates the voltage. What type of circuit would be used to do this? This graph shows what happens when the power available from the panels exceeds the inverter's maximum capacity of 5kW. AI: As described in this answer the output current of solar panels is directly related to the output voltage. If you short circuit the panels you will get a very high current - but basically no power, because the voltage of the panales drops towards 0 V. The same is true for a open circuit: In this case the voltage is pretty high, but there is no current flowing. Again, with P = I * U the power output of the panels is very low. A solar inverter is using a switching DC/DC regulator at the input to controll voltage and current. In the typical use case this circuit would be controlled to find the point of maximum power (the MPP). But when there is a derating, because the inverter is not able to supply as much power as would be possible, it can increase its current draw from the panels and by that automatically decresing the voltage up to the point, where the desired power output is achieved. In this diagram you can also see the power over panel voltage and current: Image from Analog.com
H: 9 Volt battery connected with no resistance but current is not 9 A? As per Ohms law , V = IR OR I = V/ R So if I set R to 0 , then V should be equal to I ? However when I connect 9 Volt battery poles to each other with multimeter in between the reading says 0.2 A. AI: Fortunately for you, batteries have internal resistance. If they hadn't then you would have either blown your meter's current limit fuse or destroyed your meter. Never short-circuit a battery or power supply with an ammeter. Always connect it in series with the load. You can model your battery as an "ideal" 9 V battery with a series resistance. From you measurement you can calculate that the battery's internal resistance. \$ R = \frac {V}{I} = \frac {9}{0.2} = 45 \ \Omega \$. From the comments: So does it mean if I short circuit 220 V (in house voltage), then reading should be 220 amps, since now there is no battery hence no internal resistance? If there is no internal resistance on your 220 V supply then \$ I = \frac {V}{R} = \frac {220}{0} = \infty \ \text A \$. Never short out a supply like that. Explosive amounts of energy can be released. (Look up "arc flash" on YouTube.) If you try it with your multimeter the results could be lethal.
H: How do I size an isolation transformer I'm using to emulate a variable reluctance sensor? I'm attempting to emulate a variable reluctance sensor on an engine. I know I need to produce a 600hz-6000hz zero-crossing +/-12volt waveform. The engine management controller's input measures 20okhm. My first attempt used a Bourns SM-LP-5001 1:1 audio transformer for isolation. My LM2904 went into current limiting mode when I fed it any waveform on CKP1/CKP2. My assumption is that I mismatched something causing the current to exceed the LM2904's capacity. VIN is nominal automotive 12VDC, I am using 13.9VDC for my bench supply. Here's what I'm thinking for my next attempt, but I need some understanding how to specify what transformer I need. I found a Xicon 42TM018-RC audio transformer that has 1:1 10k CT winding and 550 ohms DCR on it's primary. Since the ECM measured 20kohm at it's inputs with my DMM, does my transformer need to match 20kohm primary impedance? Or will this circuit fail for a different reason? Is there another approach that would work better? AI: It goes into saturation. When the flux rises above a saturation point, then the inductance of the transformer is equal to the air core inductance. So, except the series resistance nothing will stop the current rise as short circuit. What you have to see is the volt second product. From the lowest frequency calculate half period, then multiply with voltage. Compare the volt second product with datasheet. PS; Have you measured the output signal of the sensor? I don't believe it outputs +/-12V not nearly, you will burn the ECU! EDIT: simulate this circuit – Schematic created using CircuitLab simulate this circuit
H: What is purpose of exporting system using tcl scripts generated by Qsys? To "Export" a Qsys system we merely need the .qsys file. Inside Qsys (now called Platform Designer) we have the option where we can export the system as a .tcl script. The options are the in the file menu and these are: i. Export System as Platform Designer script (.tcl) ii. Export System as hw.tcl Component My questions are: Why do we need these when we can just send off the .qsys file? Why do we have two options and not just one i.e what is the difference between them? Is the Qsys system included when we archive a project? AI: The TCL file is an alternative to the Qsys file. It allows you to use the system as a subsystem in Qsys. So why would you want it? Because you can edit the file as a general TCL script, allowing you to add more parameter options that can't be done in Qsys graphically. For example say you want a system with N submodules - that can't be done in Qsys, but it can be done in the TCL file with a for loop. As another example, say you have a system that can select between different subsystems depending on a parameter. Again you can only do that in the TCL version. You only need the TCL version if you are going to use it. Otherwise there is no point.
H: Is there an easy way to find out if my 0805 SMD components are ferrite beads? I ordered SMD 0805 components among other items and I received a package with the SMD components but there is no description at all. Also, there is no identification on the components itself. Is there an easy way to find out if the components I have are ferrite beads? (that's the most logical type I can expect from the post). When I used a DMM to measure the resistance it is 0 ohm, which seems normal for ferrite beads. (note I don't have any EMI test, but I have an (old) oscilloscope if needed). AI: If your oscilloscope has a calibration output (to calibrate probes), you could use that signal (after having calibrated the probes!) to check with the frequency characteristics of the ferrite beads. Source: https://learn.sparkfun.com/tutorials/how-to-use-an-oscilloscope/all
H: How long does it take for electricity to be considered OFF by general appliances? I'm looking for an ATS (or DIY) to switch between my solar and grid power. I've seen some automatic ATS like here I've seen on youtube someone uses this model and his computer is switching between solar and grid without "power cut". According to the details of the product : "Transfer Time:≤10ms". Transfer time is so low that the computer didn't see it as a power cut. What are the factors that can influence this ? Is it related to the appliance ? I was expecting the computer to turn off and turn on again. Do you know what is the maximum number of ms that will trigger a "power cut". Will it be difficult to DIY ? AI: It depends very much on the appliance. But most appliances with power supplies are really taking in power in pulses at a rate of 120 Hz (in a 60 Hz system), so they're already designed to "ride through" gaps of at least 8.33 ms. 10 ms is so close to this that they won't even notice.
H: Why is my fluorescent tube orange on one side, white on the other and dark in the middle? I have a ~60 cm fluorescent tube light that is failing. ~10 cm on one end glows orange, ~10 cm on the other end glows blue-white (normal fluorescent light color) and the middle 40 cm is dark. Question: From an electrical point of view what exactly is going on such that this particular graded pattern of three colors is produced? There seems to be a "starter" just behind the tube, near the "orange" end. AI: Your fluorescent tube has filaments on both ends. Those filaments are heated by the starter current and then emit electrons into the gas filling of the tube. To assist that, they have a coating of lanthanides. Over time, those lanthanides amalgamate with the mercury gas filling and cannot serve their function any more. The tube cannot be started any more then. It will be heated up through the filaments until the starter opens, but as nothing happens then, the starting process is repeated. What's still there is the filaments. Depending on the amount of lanthanides still in function, electrons are still emitted and excite the mercury gas filling in the surroundings of the electrode. That's the green or white end. At the orange end, what you see is the glowing of the filament.
H: Unit of ultrasound A-scans I have a basic question concerning ultrasound A-scans. Such an A-scan might typically look as follows (source: https://img.medscapestatic.com/pi/meds/ckb/18/7418tn.jpg): I understand that the x-axis is the time axis but I'm unsure about the y-axis. In the literature, I can find that the y-axis and the amplitudes of the signal represent the "intensity of reflected sound" but what's the unit of this intensity? Or to put it in other words: What would an amplitude value of, say, 0.2 actually mean? Thank you very much. AI: The amplitude is just arbitrary units for relative measurements only. The absolute values don't really matter all that much. The peaks in the graph represent changes in tissue properties — specifically, changes in acoustical impedance, which cause energy to be reflected back toward the source. It is the horizontal position (representing distance) and width of these peaks that is more relevant than their amplitude. Indeed, you can see that some of them "saturate" the receiver — they have flat tops.
H: Conversion error in STM32 MIPI-DSI app note? I'm trying to teach myself about the MIPI-DSI interface on STM32 F4 MCUs and came across this graphic and accompanying description: As I understand it, the data being transferred is actually 0x94 and 0x0E, and the person writing the document just goofed on their conversion. Just double checking in case. This is only one of many issues I've found in this document, so I wouldn't be surprised if it's wrong. STM really needs to get some editors. AI: It sure looks like a typo to me. The only way the values 0x92 and 0x07 would make sense is if each byte is split into 4-bit nybbles, and the least-significant nybble is sent first, but the nybble itself is sent MSbit first — which would be truly bizarre. The more likely explanation is that the author forgot to flip it in his head when reading the waveforms.
H: How/can I plug a 3 wire 4-20mA current sink probe into a 2 wire 4-20mA loop powered controller? I have a 3 wire 4-20mA output probe simulated here, where during normal operation the 20v and 250 ohm resistor are variable chosen by the user. One of my users has a 2 wire 4-20mA meter, and I am unsure what the normal approach to 2 wire 4-20 is. Can i plug my probe into the user's controller? If so what wires go where? AI: Figure 1. (a) 2-wire and (b) 3-wire. Source: copied from my answer to Several Questions About Analog Input. ... but if I can have non isolated power provided externally can I tie my 3 wire signal line to the + terminal on the 2 wire controller and tie ground to the - terminal? Yes. Consider Figure 1b. The 24 V supply is feeding the 3-wire transmitter while the grounds are connected. The 24 V could be supplied from the receiver panel or could be supplied locally at the transmitter. As an aside, the 250 Ω resistor shown in the receiver is the typical way to convert the mA signal to a 1 to 5 V signal for the internal ADC. Figure 2. OP's schematic. You have placed the 250 Ω current sensing resistor in the high side of your device. That means they can't share a common ground. One of my users has a 2-wire 4 - 20 mA meter, and I am unsure what the normal approach to 2-wire 4 - 20 is. Can i plug my probe into the user's controller? If so what wires go where? You can provided the user's meter is not grounded. If it is you will have a short across the transistor and lower resistor - always give designations to components on schematics - resulting in 20 V DC applied across the 250 Ω resistor which will pass 80 mA. Your configuration is unusual and this could give rise to problems on installation.
H: Motorola telephone-style handset audio to 3.5mm jack I retrieved a Motorola Telephone-Style handset wich was in service with a Motorola radio GM380. It is the same as https://shop.motorolasolutions.com/rln4756-telephone-style-handset/product/RLN4756A but with two additionnal keys (F1 and F2). I would like to get the mic output of the handset to a 3.5mm jack for a computer. I already managed to make the speaker work, but I can't get the mic to work. The connection is an RJ50, and I didn't find the pinout for the GM380. So I did some reverse engineering and the pinout seems similar to this one (from the GM300), if you take pin 1 as pin 2, pin 2 as pin 3, ... : Here is the circuit in my handset (both wires red and black at the bottom go to the mic) : For the RJ50 at the top, corresponding pinout to the RJ45 with the previous scheme (the RJ50 is only 8-pin on this side because 2 pin are not wired on the other side) : WHITE - pin 1 "PB1" BROWN - NC BLUE - pin 3 "HOOK" BLACK - pin 4 GND RED - pin 5 MIC AUDIO GREEN - pin 6 PTT PURPLE - NC YELLOW - pin 8 HANDSET AUDIO I only did some basic electronics and never any audio thing before, so I don't get how can I make the mic work. Can someone help me please? AI: You have an 8 pin connector in one photo, with colored wires. You also have a list of what wires do what. According to your list, pin 4 on the PCB (black wire) is ground and 5 on the PCB (red wire) is microphone. I expect the microphone connection is used to feed in DC, just like your typical PC microphone. It is also possible that one of the other pins on the 8 pin connector on the PCB provides power. The first thing I'd try is red and black from the 8 pin connector to the microphone in on the PC. If that doesn't work, then I'd try the red and black directly from the microphone to the microphone in on the PC. I expect the microphone in the handset to be an electret type with built in amplifier. You should be able to just ignore (diisconnect) the curcuitry in the handset and get usable audio out of just the microphone. The microphone amplifiers in Motorola handsets used to amplify to something like 5V peak to peak. That'd be extremely sensitive. I tracked down the schematic of a Motorola hand microphone. This is the circuit: The power for the microphone comes from the microphone line. Also, the microphone is only active (connected to the microphone line on the RJ45) when the PTT button is held down. Connect pin 4 of the RJ45 to the microphone ground on your PC. Connect pin 5 of the RJ45 to the microphone input of the PC. Press the PTT button. You should get audio out of it. If you don't, you may need to apply 5V to the microphone line through about a 2k resistor. The IC in your handset may need more voltage to operate than your PC microphone can deliver. PC microphone inputs usually only supply a couple of volts. Yes, the microphone schematic I am using is different from your handset. Doesn't matter. Motorola used the same microphone pinout for a very long time. And, as you can see, the pins match the ones in the question.
H: Full-bridge or half-bridge for a DC motor So I have a DC motor which draws around 16A at 12V. I want to have some room to play with in the top values. I need to control the spinnig direction as well as speed. I understand how half-bridges and full-bridges work. From that it seems to me that half-bridge is not an option for a DC motor as it can be used only for creating AC and not DC. On the other hand full-bridge can be used for both AC and DC. Am I right? I am asking because many sites mention the differences between the two, but I have not found a site that would mention the difference when using it to control a DC motor. Thank you for your replies AI: For bidirectional control of a DC motor you typically need a full bridge made up of four FETs or transistors. Each lead of the motor is connected to a half bridge where the upper transistor can take it to the positive supply or the lower transistor can take it to the negative. By setting either side high and the opposite low, you can make the motor spin in either direction. For unidirectional control, you really only need a single FET or transistor. You can leave one side of the motor permanently connected to the supply, and use the transistor to connect or disconnect the other. Half bridges that are not packaged in pairs as full bridges are somewhat associated with AC motors particularly because of the situation of 3-phase motors where you end up needing 3 half bridges. In that case you have three wires coming out of the motor, each of which gets driven by its own half bridge so it can be connected to either side of a DC supply. But rapidly pulse-width-modulating the half bridges, something approximating an AC sine wave can be produced, and if the three bridges do this in an appropriate phase relationship (0, 120, 240 degrees) then you can make the motor spin just as if it were connected to a 3-phase AC dynamo - but with the added benefit that you can vary the frequency of the synthesized AC to control speed. Finally most bipolar stepper motors have two independent coils and require two full bridges.
H: Will a coil of wire acting as an antenna improve reception/transmittance? I thought that a coil of wire might be good as an antenna. If this is valid would using said antenna improve reception and transmittance if used? Would an antenna of this kind be stronger with more turns in its winding? AI: I thought that a coil of wire might be good as an antenna. There are a lot of antennas that could be described as "a coil of wire", and some of them are pretty good, but there's a lot more to antenna design than just randomly coiling wires. If this is valid would using said antenna improve reception and transmittance if used? As opposed to no antenna at all -- maybe. If the size of the coil is closer to the wavelength of your signal than the antenna terminals on your radio, then probably. As opposed to an optimal antenna -- no, pretty much by the definition of "optimal". Would an antenna of this kind be stronger with more turns in its winding? Only if it didn't have enough turns to begin with. If it already had enough, or too many, then no.
H: NVIC memory map ARM cortex M3 STM32f103 I do not understand the following memory map regarding the NVIC registers in Programming Manual for STM32f103 page 129. It says that the offset address for NVIC_IPR0 is 0x300 and that of NVIC_IPR20 is 0x320. I do not understand how is this possible?! I think that the offset for NVIC_IPR20 should be 0x350. Indeed, assuming the registers follow one after another one obtains something like this: NVIC_IPR0 -> 0x300 NVIC_IPR1 -> 0x304 NVIC_IPR2 -> 0x308 etc. NVIC_IPR20 -> 0x350 What am I doing wrong? AI: You're correct -- that looks like a typo. The offset for that register should be 0x350. The CMSIS header file (core_cm3.h) avoids the issue entirely by defining NVIC->IP as an array of bytes, not of 32-bit words: __IO uint8_t IP[240]; /*!< Offset: 0x300 Interrupt Priority Register (8Bit wide) */ This documentation error was probably the result of confusion between the byte-wise structure used by ARM and the 32-bit structure used by ST.
H: Help understanding table in SAM E54 Datasheet I apologize if this isn't the right place to ask this question, but I'm having trouble interpreting a table in the SAM E54 datasheet. I am trying to configure the size of the SmartEEPROM on an SAME54 Xplained board. The example project from Atmel Start states: /* This example assumes SBLK = 1 and PSZ = 3, thus total size is 4096 bytes */ So I looked in the datasheet which says, the SmartEEPROM interface maximum size depends on SEESTAT.PSZ and SEESTAT.SBLK: I can't figure out which column corresponds to which configuration bit. It would seem the column on the left is SEESTAT.PSZ, but then it wouldn't make sense for SEESTAT.SBLK to be 3 according to the chart. Any insight is greatly appreciated. AI: I believe the columns of your table are the actual page size, rather than the value from the SEESTAT.PSZ register field. The page size is determined from the PSZ value according to a table a couple pages after the one you asked about: The rows are then the values from the SEESTAT.SBLK register field.
H: How to adjust this BJT design to increase brightness of LED without changing PCB? I am having issues with this previously designed circuit from a former co-worker. What we want it to do is turn on the LED when IN1 of TPS2121 (Power mux) is chosen as the output. According to the datasheet ST is pulled high when the output is Hi-Z or IN1 and pulled low when IN2 is powering the output. The LED is part of the switch PVA6LRE21141 I can't find the forward voltage it requires but with the current design, voltage across the diode is only 2.6V. I do not understand his BJT circuit, the LED is not very bright at the status pin I only see 3.1V. I am trying to get it to turn brighter. Can someone explain the purpose of R14 and the way it is connected. Only R13 seems to affect the brightness, except I cannot decrease it any lower than 6K or I would violate the specifications of the TPS2121 ST pin. The ST pin requires a pull up from 6K-20K. I think he used a BJT with C8 and R15 to create a ramp up effect for the LED. I do not think the ramp up is that necessary. Is there anyway I can change this design without having to change the PCB or as little as possible so that the LED can turn on brighter? I am considering changing Q1 to a mosfet with common footprint and removing C8. Thanks in advance for your help! AI: All of the current to the LED has to flow through R13 -- this is going to be your biggest limiting factor, particularly because R13 is already at the minimum resistance called out in the TPS2121 datasheet. I wonder if your former coworker used a circuit designed for a push-pull output, where the TPS2121 has an open drain? Changing to a MOSFET will only make things worse -- the base-emitter voltage of Q1 will be around 0.6V normally (it's only 0.5V here, probably because of the low current). A FET would need more than that from gate-source to turn on. It would be a board mod, but connecting the collector of Q1 to +5V should result in immediate and delightful results. If you pulled C8 off of the board, you could replace R14 and R15 with zero-ohm resistors (R13 would provide any necessary current limiting to the base of Q1).
H: Toggle power between modules/devices I'm absolutely new to this subject and I have no idea how to start, save for the fact that I need an microcontroller for this. I want to toggle the power between modules/devices I want to hook up to another device. Push button once: Turn on bluetooth, toggle RGB LED to blue and play sound 1. Push button twice: Turn off bluetooth, turn on USB port, toggle RGB LED to green and play sound 2. Push button thrice: Turn on bluetooth and USB port, toggle RGB LED to red and play sound 3. Push button for 5 seconds: Turn on bluetooth and pair it (to get into the bluetooth modules pairing mode, you just have to push a button on it) and play sound 4. Where do I start? Is an ATtiny85 sufficient for this? AI: To my knowledge, an ATTiny85 requires an Arduino board (or other micro controller) to program it and then it can run standalone, this is where you would start. As for the ability of the chip, it has 5 I/O pins (2,3,5,6,7) and you have 4 actions: Toggle bluetooth Change LED color Play various sounds Toggle USB port You could wire each action to its own pin in order to keep the fifth port open for input from your button. The PWM/Analog output that the ATTiny85 has will allow you to play multiple pitches from one port to handle all four sounds. Toggling something on such as bluetooth or the USB port uses digital output (0 or 1), which will not take more than 1 pin for each action since you send either a high or a low from a pin to engage/disengage the corresponding action. A problem arises for changing the color of your RGB LED because you only have one output port remaining now and the RGB LED has 3 inputs. You could potentially use two ATTiny85 chips to solve this or you could also explore signal splitting techniques such as charlieplexing or multiplexing, but I think those methods cannot work with a single pin. After that, just figure out the programming logic for sequential and timed button press triggers to engage your output pins. A good solution to this problem would be to use the ATtiny84-20PU for a larger array of pins. Below is the pin layout for the ATtiny84: I would recommend following this ATtiny85 program upload guide or this ATtiny84 program upload guide to learn how to get your code onto the chip.
H: Is it possible to use an LDO as an Auxiliary source to a smps? My SMPS controller can supply about 250mA and 3.3V output. There are rare but crucial moments when power demand goes above 250mA, voltage sags below 2.7V, and the MCU brown-out occurs. The question is: if I add a 3V LDO, will it stay inactive at 3.3V until the droop reaches 3V before it regulates? Or is there some kind of a low side switch that will try to “regulate” the 3.3V down to 3V? TIA AI: I'd suggest you use a 3.3V LDO with a series SCHOTTKY diode such as the SDM40E20LS or SDM40E20LA dual diodes. These diodes have very low Vf values of around 310mV @100mA. Connecting two in parallel will get you about 1A capability at 410mV drop. The LDO may have some minor supply current (about 10mA) if your SMPS drops by 0.1V during normal operation, but otherwise should tend toward zero. The two diodes in parallel won't share current exactly, but well enough to keep the load voltage well above your brownout level.
H: AND gate between 2 std_logic_vector Isn't working correctly I am trying to do a multiplication between 2 std_logic_vector have the following testbech: LIBRARY ieee; USE ieee.numeric_std.ALL; USE ieee.std_logic_arith.ALL; use IEEE.STD_LOGIC_1164.ALL; use ieee.std_logic_unsigned.all; ENTITY mult_tb IS END mult_tb; ARCHITECTURE behavior OF mult_tb IS -- Component Declaration for the Unit Under Test (UUT) COMPONENT Full_vector_multiplier PORT( ma : IN std_logic_vector(23 downto 0); mb : IN std_logic_vector(23 downto 0); mr : OUT std_logic_vector(47 downto 0) ); END COMPONENT; --Inputs signal ma_tb : std_logic_vector(23 downto 0) := "000000000000000000001111"; signal mb_tb : std_logic_vector(23 downto 0) := "000000000000000000000111"; signal mr_tb : std_logic_vector(47 downto 0) ; signal u : std_logic_vector(47 downto 0) := (others => '0'); BEGIN u<=ma_tb*mb_tb; -- Instantiate the Unit Under Test (UUT) uut: Full_vector_multiplier PORT MAP ( ma => ma_tb, mb => mb_tb, mr => mr_tb ); -- Stimulus process process begin wait; end process; END; For testing this multiplication module: library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity Full_vector_multiplier is generic(msb2 : integer:=23); port( ma : in std_logic_vector(msb2 downto 0); mb : in std_logic_vector(msb2 downto 0); mr : out std_logic_vector(msb2*2+1 downto 0) ); end Full_vector_multiplier; architecture Behavioral of Full_vector_multiplier is COMPONENT full_vector_adder generic(msb : integer:=47 ); PORT( i1 : IN std_logic_vector(msb downto 0); i2 : IN std_logic_vector(msb downto 0); s : OUT std_logic_vector(msb downto 0); c_out : OUT std_logic ); END COMPONENT; type minimatrix is array(0 to msb2) of std_logic_vector(msb2 downto 0); type matrix is array(0 to msb2) of std_logic_vector(msb2*2+1 downto 0); signal x : matrix:=(others=>(others=>'0')); signal bt : matrix:=(others=>(others=>'0')); signal b1 : minimatrix:=(others=>(others=>'0')); signal s_c_out : std_logic_vector(msb2 downto 0):=(others=>'0'); begin mr<=x(x'right); main : for i in 0 to msb2 generate b1(i)(i)<=mb(i); bt(i)(msb2+i downto i)<=b1(i) and ma;--line-A it0 : if i=0 generate x(i)<=bt(i); end generate it0; itothers : if i>0 generate addi : full_vector_adder port map( i1=>bt(i), i2=>x(i-1), s=>x(i), c_out=>s_c_out(i) ); end generate itothers; end generate main; end Behavioral; The problem is that I am trying to save or copy the vector ma in the bt array, shited i zeros in each generation of the main loop (line-A), and it(bt) seems to be only a ones diagonal: the b1 array is successfully filled with \$mb_i\$ in the \$b1_{ii}\$ "position": So, the question is if what I am doing wrong? It's only "line-A" the problem? because I need that bt be like: |0.....ma| |0...ma 0| |0..ma 00| Thanks in advance. AI: in vhdl two distinct types of instruction could be used : sequential an concurrent. You can have a look at the difference between the two instructions have a look at the answer here . in your case you are using a concurrent statement generate which translates into the following : b1(i)(i)<=mb(i); -- b1(0)(0)<=mb(0) -- b1(1)(1)<=mb(1) -- b1(2)(2)<=mb(2) -- .......... -- b1(23)(23)<=mb(23) bt(i)(msb2+i downto i)<=b1(i) and ma; --line-A -- bt(0)(23 downto 0)<=b1(0) and ma; -- bt(1)(24 downto 1)<=b1(1) and ma; -- bt(2)(25 downto 2)<=b1(2) and ma; analyzing that you can see that, since you initialized your signals here : signal bt : matrix:=(others=>(others=>'0')); signal b1 : minimatrix:=(others=>(others=>'0')); they all start with zeros. In the expansion of your concurrent code b1(i)(i)<=mb(i); as you can see from my comments above, you are constantly assigning the b1(i)(i) to one single bit of the mb and the rest is filled with zeros. you are then moving the whole vector of b1(i) padding it with zeros on the left and right depending on its position. This is explains what you are seeing in the simulation. In order to achieve what you are asking for |0.....ma| |0...ma 0| |0..ma 00| you can simply avoid the first copy and the AND so that line-A becomes bt(i)(msb2+i downto i)<= ma; --line-A and as you can see b1 is not needed
H: What happens if an interrupt callback execution is interrupted by the same interrupt? I have a microsecond timer (generates interruption every microsecond) for which I implemented a "HAL_TIM_PeriodElapsedCallback" function. What occurs if the execution of the callback function takes longer than a microsecond? PS: I'm using an STM32F030F4Px mcu with st-link v2 debugger. AI: The HAL timer interrupt handler does not do anything special, it checks all possible pending interrupts, clears them and runs the callback. So it is not re-entrant. If your callback takes longer to run than the timer period, the interrupt has to wait until callback and handler are finished to run again, so during this time the interrups are missed and it will only run as many interrupts per second it can.
H: Light load efficiency of DC-DC Switching converters I have been working with DC-DC Converters theoretically. What is it that I don't understand is that how the efficiency is very less at light loads? How does the switching and the output get affected? Light load means that the IC output has the stable output voltage but Load Current is less? Can someone help me understand the light load behaviour of DC-DC converters in simple terms? AI: What is it that I don't understand is that how the efficiency is very less at light loads? It's like a car sat at traffic lights - you are not moving hence the fuel consumption in miles per gallon are zero or, power out over power in is zero or, zero efficiency. A DC/DC converter always wastes a few milliwatts of power in just doing nothing except providing a fixed voltage at the output. If there is no current supplied to a load then the power output is zero and the power efficiency has to be zero. How does the switching and the output get affected? To minimize power losses, some switching converters enter a special mode known as burst mode and the output switching is very infrequent leading to reduced power losses. The (near) equivalent for a car sat at traffic lights is turning the engine off then restarting the engine as the lights turn green.
H: TCP data vs HTTP data over GSM modem I am using M95 GSM Modem for remote data communication with the server. The server-end persons want me to use HTTP data connection. Another embedded guy has suggested to use sockets and TCP data for communication. I cannot figure out if both of these are same methods or are they fundamentally different ways to communicate remote data using a GSM modem? AI: This evidences how each one of us sees the internet from his point of view. Starting by some basics have a look at this picture: Image Attribution : Chunte7 [CC BY-SA 3.0 (full license)] As you can see the internet can be divided into 4 layers, some times 5 by dividing the network access layer into other two layers, that are in the image on the right. The general structure of any given network is the OSI model which divides any given network into 7 layers. Now please have a look at the following image: Image Attribution: Microchip devloper help See the difference? HTTP is an application protocol that runs above the TCP protocol from the transport layer. In fact, in order to create an HTTP connection, you would have to implement an HTTP Client/Server on your system. This is sometimes taken for granted by the sysadmins since a lot of servers are easily deployed and/or implemented in Linux/Windows. When you are dealing with embedded systems this is not always the case since a module might provide an HTTP Client/Server, such as the ESP32 family, or be limited to a TCP/UDP server. My advice would be to check for the service running on the remote server and implement whatever is compatible with what is already deployed there. If it's a completely new project and you are starting from scratch, look at your embedded system resource to see if it allows an additional layer to be implemented or not. Keep in mind that implementing a protocol over HTTP would make it easier for back-end developers on the server and would become more scalable and features-rich. On the other hand, it will add a significant overhead for the data you are transferring and would eat a bit more resources from your embedded system. Having a quick look at your particular module form here in section 11 you have already some TCP/IP commands so there is no need to build it from scratch, on the other hand if you go the HTTP route you would have to implement an HTTP Server/Client compliant application.
H: Embedded C - Most elegant way to insert a delay I'm working on a project involving a cortex-m4 mcu (LPC4370). And I need to insert a delay while turning on compiler's optimization. So far my workaround was to move up and down a digital output inside a for-loop: for (int i = 0; i < 50000; i++) { LPC_GPIO_PORT->B[DEBUGPIN_PORT][DEBUG_PIN1] = TRUE; LPC_GPIO_PORT->B[DEBUGPIN_PORT][DEBUG_PIN1] = FALSE; } But I wonder if there's a better way to fool GCC. AI: The context of this inline no-dependency delay is missing here. But I'm assuming you need a short delay during initialization or other part of the code where it is allowed to be blocking. Your question shouldn't be how to fool GCC. You should tell GCC what you want. #pragma GCC push_options #pragma GCC optimize ("O0") for(uint i=0; i<T; i++){__NOP()} #pragma GCC pop_options From the top of my head, this loop will be approximately 5*T clocks. (source) Fair comment by Colin on another answer. A NOP is not guaranteed to take cycles on an M4. If you want to slow things down, perhaps ISB (flush pipeline) is a better option. See the Generic User Guide.
H: In your experience, how well do NPN SPICE models replicate real DC current gain Title, I'm currently running some simulations and noticed that my DC current is in the very rough ballpark of datasheet parameters. Is this normal or does it indicate there may be something wrong with the circuit itself. This is not a question on any particular circuit I am just trying to expand my knowledge on simulations vs. reality. AI: Look at the datasheet of a typical transistor, for example the P2N2222A Notice look at the specified value of the DC current gain. See how only minimum values are specified. Only for Ic = 150 mA, Vce = 10 V is there a typical value specified. For that condition the DC current gain is guaranteed to be higher than 100 and is expected to be typically around 300. That's a factor 3 change ! This is "normal" for most transistors. The DC current gain is largely determined by Base thickness and Base / Emitter doping concentrations. These are all somewhat difficult to control in manufacturing! Only if the manufacturer would measure each transistor and sell it as having a DC current gain being within a certain range could you get a more predictable value. This "binning" isn't usually done as it is expensive resulting in expensive components. Furthermore: it is simply not needed ! It is much easier to just design the circuit such that it can support even the minimum DC current gain. If the transistor then has a higher gain the circuit design would be such that this will not change anything. I'll be blunt: a circuit which relies on one or more transistors to have a specific (a value within a narrow range) DC current gain isn't a good design. Almost all common circuits only need a DC current gain above a certain value, as long as the transistors meet that requirement, the actual value of the DC current gain is irrelevant. Most transistor models just model the typical value of the DC current gain. There might be an option in your model and/or simulator to simulate the extreme ("corner") values as well. But again, if your ciruit, even in the simulator is dependent on a transistor's DC current gain, you should consider changing the design such that it does not rely on this transistor property. Example: you could amplify a current using an NPN, then the amplification factor will change "all over the place". A current mirror using many transistors in parallel (with emitter resistors) will be much better. Next step better: an opamp based circuit using resistors to do accurate current amplification.
H: Does a CR2032 take damage when connected to a 5V rail? I've seen applications (Nintendo game cartridges, for example) that uses a coin cell battery for backup power to some RAM-chips (for savegames). When the ordinary 5V is gone, the battery takes over and lets the IC retain its contents. However, won't the CR2032 (3V) take damage when connecting it to a power rail that contain almost its double voltage? Or is there some overvoltage protection within the coin cell that shuts it down when external voltage is applied? Or how does it work? AI: The main supply is not in parallel with the battery. Most often the battery powers RAM chips via a diode, so that main supply can be connected to RAM chips with a transistor. Sometimes both the supplies go through diodes.
H: "Ignoring" a dangerous AC level, while performing ADC conversion on DC level I need to monitor a plasma cutter's DC voltage. I selected the AD629 from Analog Devices and have a schematic and layout that works on a test bench. Admittedly, my talents are in software and what I know about EE just makes me dangerous. :) My concern is that welders and plasma cutters emit a high-frequency AC signal in order to start the arc. Not knowing any better, it seems to me that signal would fry my board. Although I've seen torch-height controllers and similar and see no obvious technique for "shielding" the PCB from this. I am assuming that a 5K volt AC signal would happily create arcs anywhere the POS and NEG lines are very close -- such as on a PCB. How is this working? AI: Probably something like a low pass filter with a high-voltage rated resistor to the input. The HF start is in the ~1MHz range so filtering that out is not difficult. Looking at the block diagram of my AC/DC TIG welder with HF start, they monitor the voltage from the other side of the HF coupling transformer. Image from here.
H: Dumping values of multi-dimensional arrays into gtkwave for Verilator I am able to do a VCD dump of multidimensional arrays using the $dumpfile() and $dumpvars() commands in the iverilog simulator, but the same commands are not working for Verilator. Kindly do let me know if there is any way to do the dump. AI: Verilator has limits on the size of arrays it will dump. See these two switches: --trace-max-array <depth> Maximum bit width for tracing --trace-max-width <width> Maximum array depth for tracing
H: Why choose to tie the output to the non-inverting input of an op-amp? I came across this schematic design of a driven-leg circuit, designed in order to enhance the performance of an ECG amplifier. As far as i can see, the solution provided here is a little bit different from the normal approach, where two R5/2 resistances would be used and the common node voltage would be gathered from their common connection. The above presented approach would make sense to me if two buffers were used in order to repeat the signal and then divide it on the two 47K resistors. But why use such a configuration, where the non-inverting input is tied to the output? I have never seen such thing and by simulating this i got a strange result. Any thoughts? Thanks. AI: The above presented approach would make sense to me if two buffers were used in order to repeat the signal and then divide it on the two 47K resistors. But why use such a configuration, where the non-inverting input is tied to the output? It's a faulty circuit - U3A and U3B should not have positive feedback - I would say that the inputs on both those op-amps need to be swapped around for this to work.
H: How to calculate reactance from an impedance analyzer circuit? Background I have an impedance analyzer that uses the below circuit: Source One can measure impedance of the device under test (DUT) by using the following formulas: Z_load = Z_ref * (V_C1 - V_C2) / V_C2 One can measure the phase by comparing the phase difference between V_C1 and V_C2. Let's say positive phase is when V_C2 lags V_C1. Question How does one get from this information/formulas to be able to calculate resistance and reactance of the load? Does one need to make assumptions about the load? For example, in this article they assume series RC or RL, or parallel RC or RL circuits. AI: If you know the magnitude, Z, and phase angle, Theta, of an impedance, then the reactance and resistance can be calculated as follows: reactance = Z*sin(theta) resistance = Z*cos(Theta)
H: How to proceed to draw the circuit diagram of an unknown circuit? I have some old devices like SMPS power supplies, and I would like to analyze their workings by first drawing a circuit diagram of them. I'm looking for some tips/techniques for doing this. Should I first draw all components of the circuit, then find out which ones are directly connected to each other by using continuity setting on my multimeter, and then try to figure out the values of individual components? Is there a good general guide/procedure for this? Assume that the diagram of the circuit is not available online or anywhere else, I want to be able to build it on my own. Also, I'm looking for techniques for doing this in general, without having assumptions of the workings of the circuit beforehand. I'm mentioning SMPS as just an example. AI: I usually take a picture of the top and bottom of the board. I line the photos up in software and switch between the top and bottom pictures. Then draw the traces over it in a program that allows stacking of images and vector graphics (power point, visio). If the program has layers, then traces can be created for both top and bottom layers. I then identify each component, either by visual inspection or by unsoldering and using a digital multi meter to find the functionality. It's also nice because it allows one to label all of the components. This would be difficult to do on a four layer board at which point, instead of taking pictures, an x-ray machine would need to be used. The picture below shows this done for the top layer of a board, which all of the traces on the top layer have been traced out. If I couldn't see a trace, I used a microscope to find out where it went and sometimes a continuity check.
H: It it possible to run 5V led strips with a 12V Power supply? I am working on a LED project involving 5V led strips. I did some calculations using the WS2812B led strips and found that I need ~100W. I took the cheapest power supply available where I live but it delivers 12-24V. Is it possible to arrange the LED strips in a way that the voltage would add up to the output of my power supply? AI: Putting two in series is not going to work, since you'd then have to interface the serial data line. You could however use a small DC-DC (such as the many LM2596 based) to convert 12V down to 5V. It would also reduce the current requirements in the wiring.
H: What to do with the excess of energy from a solar off grid system? I have an off grid solar system and I'm playing with it with a Raspberry Pi and an Arduino. I'm looking for an automatic usage of the 12V power produced when the battery is full. (The Arduino has a sensor for voltage and my Raspberry is ready to do activate/deactivate with relays.) Here are some ideas I had : Use a water pump to store water as potential energy 6 meters high and convert it later to power with a water turbine. (Seems really inefficient and too much investment into nothing.) Use Peltier systems to convert electricity into water for later usage. (Dehumidifier) - Didn't try yet. What do people do usually ? I can't sell it back to the grid, I'm not connected to it. AI: Large buildings often run chillers during off-peak to make ice, then use the ice for cooling during the day. That’s a bit opposite of what you want, but it explains the principle of using phase change to store energy. The pump idea isn’t so dumb at all. It’s been used at larger scale in hydro dam projects to store energy during off-peak. Simplest thing? Use the excess PV energy to heat water. It’s 100% efficient, and with a well-insulated tank the losses are low.
H: Why does DMA send the first byte as soon as it is enabled? I'm using DMA to send data to GPIOF which is configured as a parallel bus. DMA is being driven by update events on TIM8. TIM8 is configured in slave mode and starts on an output compare event from TIM1. And TIM1 runs in input mode, being reset by a falling edge on pin A9, and capturing the width and duty cycle of the pulse on A9. TIM1 also raises an interrupt on input capture events. Then I check the width and duty cycle of the last pulse to determine whether I am currently in active video or not, and re-enable DMA for the next scanline if I am. For context, this is for a video graphics application. GPIOF outputs pixels driven by a pixel clock (TIM8), in time with sync pulses from an external composite video source (pin A9). Mostly this all works like clockwork. But I noticed that when I enable DMA in the interrupt, a single byte gets sent to GPIOF by DMA immediately. The rest of the bytes in the scanline buffer are sent at the expected time, when TIM8 starts running. Here is a logic analyzer session showing what happens. CSYNC is the pulse going to pin A9. PCLK is a pin being toggled by TIM8. PIXEL0 is pin 0 on GPIOF. The first black band is (roughly) the time when the interrupt occurs and DMA is enabled. The second black band is when TIM8 is gated on by an output compare on TIM1. What is the reason that PIXEL0 turns on shortly after DMA is enabled, causing a very wide pulse which continues until PCLK starts? AI: I found the answer to this some time ago, posting it here in the hope it will help others. The reason 1 byte is sent immediately on enabling DMA, is because a DMA request (DRQ) is still active from the last time that TIM8 ran. TIM8 keeps running and raising DRQ signals, even after all the bytes in the buffer have been written and DMA stops. TIM8 is gated by TIM1, and only stops when TIM1 is reset. Before enabling DMA, the previously-activated DRQ needs to be reset. There is no way to directly do this. Resetting TIM8 doesn't clear the DRQ. But you can clear it by clearing and then re-setting the appropriate bit in the DIER register. The code to do so is below. // Disable the DMA request line, then re-enable it to clear any pending request. TIM8->DIER &= ~ TIM_DIER_UDE; TIM8->DIER |= TIM_DIER_UDE;
H: Is there such a thing as a 24V DC computer? Same as the title : Is there such a thing as a 24V DC computer ? There is a 5V computer called raspberry PI, but I'm looking for something like 800W-1000W computer working with 24V DC. AI: None of the computers you use run at 220V or 120 V or 5V – there's a lot of different voltage supplies for a lot of different parts of the computer, integrated in the computer. For example, the CPU in the raspberry Pi doesn't run at 5V, but a voltage significantly lower than that. The conversion from 5V to what the CPU does is done on-board. Same goes for your PC. The job of converting the power source voltage to the different voltages your computer needs is done by power supplies. So, what you're looking for is a PC power supply that converts ca 24V to all the voltage rails a PC needs. Those exist. General remark from my direction: Even if your energy comes free, it's questionable at the current mining rates that PC-style hardware would ever return its own cost in mined bitcoin. If that weren't the case, there'd be enough people with much larger installations of practically free energy reducing the bitcoin price until a hardware cost – bitcoin price equilibrium was reached. Basic supply and demand. Don't beat a dead horse – if you have electrical energy to spare, you can actually do something productive with it, like growing tomatoes, refining metals, desalinating water and irrigating the desert, folding proteins to cure cancer, render 3D videos …
H: What is the reference/name of this connector? I would like to know the name/reference of this connector: This is for 2.5mm² max wire When you push the orange button, it unleash the wire Thank you AI: That connector type goes by various names: wire-trap, poke-home, push-in and so forth. It’s a solderless connector that’s popular for low-voltage field wiring of controls and security. The type shown seems to be a 'euro block' connector style. Example: https://www.phoenixcontact.com/online/portal/gb?1dmy&urile=wcm:path:/gben/web/main/products/subcategory_pages/Push-in_connection_P-15-02/868cc764-43df-41cb-9e7d-c2429d2efe8c Not so sure how reliable they’d be for a motorcycle though, given vibration, weather, temperature concerns. Kind of a crappy design really. Pigtails with weather-tight connectors would be more suitable.
H: What is the voltage across the capacitor 3ms after the switch is closed I have this circuit: This circuit is working for a long time like this, with the switch open. So, the circuit is stabilized and the voltage across the capacitor is 40V. At t=0, the switch is closed. What is the voltage across the capacitor 3ms after the switch is closed. MY SOLUTION After the switch is closed, the capacitor will change its voltage to match the one imposed by the voltage divider composed of R1 and R4. At the left side of R1 there is 40V and at the right side of R4 there is 30V. If we remove the capacitor, we can calculate the current in the circuit to be \$V = RI\$ \$(40-30) = (100 + 22)I\$ \$I = 81.96mA\$ So, the voltage drop across R1 is equal to \$V_{R1} = 100 x 81.96mA = 8.1967V\$ So the voltage between the resistors is \$V_{div} = 40 - 8.1967 = 31.80V\$ This will be the voltage across the capacitor after stabilization. So far, so good. This matches the value I get from the simulator I am using. Now I want to know the voltage across the capacitor 3ms after it starts discharging. If I substitute both voltage sources with wires, I see that the capacitor is in parallel with R1 and R4, what gives me an equivalent resistance of 18.0327. Now I use \$V_c(t) = V_s e^{-\frac{t}{RC}}\$ \$V_c(3ms) = 40 e^{-\frac{3e-3}{18.0327 x (1000 e-6)}}\$ \$V_c(3ms) = 33.8695V\$ The problem is that when I simulate that using software simulators I get the voltage across the capacitor after 3ms to be 38.7438V. What is wrong? AI: The switch is closed at \$\small t=0\$, and the capacitor voltage for \$\small t \ge 0\$ is: \$\small v_c(t)=40-\frac{1}{C}\int i\: dt\$, where \$\small i\$ is the capacitor discharge current. Now use KCL at the node pointed to by the blue arrow to form the required differential equation, and solve (using the integrating factor method, for example). The initial capacitor current is \$\small i(0)=\frac{10}{22} \:A\$
H: Is it safe to wire an AC-DC adapter directly to a DC motor? (with this setup...) I just wanted to check that this setup is safe as I am not an electrical engineer, nor am I experienced... I am using an AC adapter which outputs 12 volts DC. It has a max current rating of 6 amps. I have wired it directly to a DC motor (rated for 12 volts) using wire rated for 21 amps. The AC adapter has a pin output like on a laptop charger, so I used an adapter which allows me to screw in the positive and negative wires. (Looks like this: https://uge-one.com/image/cache/catalog/catalog/0%20UGE%20JACK%20ADAPTOR%201-550x550.jpg) I intend on using some insulation tape around this to make it safer. The motor drives a system of pulleys to lower/raise a shelf in a linear motion, so it has some load. I tested the current drawn with this load with some batteries. With 5.9v across the motor, it drew 1.8 amps (with a load). The eBay listing for the motor (I couldn't find a decent datasheet) states that its locked-rotor current is 3.25 amperes. I assume that this is the maximum current it can draw, although could the starting current exceed this or exceed the max current rating of the AC adapter (6 amps max)? I ask this because the load could increase as it is driving a shelf with items on. I am not sure if this is something to worry about as the item description for the AC adapter says that it does have over current protection, so what's the worse that could happen? So, my question is, does this circuit sound safe with my current, tested load, and would it be safe if the load were to increase? Is the safety gap between the amps the motor is drawing and the AC adapter rating large enough? Many thanks in advance! The AC adapter that I am using: https://www.amazon.co.uk/gp/product/B074HX4GJ3/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1 The motor that I am using: https://www.ebay.co.uk/itm/775-DC12V-4500RPM-Motor-D-Style-Axle-Mini-Generator-DIY-High-Torque-Bearing/312542643980 AI: If the motor 3.25 A locked rotor current and the 6 A power supply output current rating are reliable, that should be ok. A lot of power supplies have over-current protection that is quite sensitive and shut down when a motor is switched on. I would be concerned about the motor current at full speed. Your 5.9 V test would have only driven the motor at half speed. Even the 1.8 amps that you measured may overheat the motor depending on duty cycle.
H: How does the position of the gound influences the node voltages? Here is the circuit which caused a long sleepless night and I would like to explain why: I have seen similar schema in this question (How to calculate time constant for RC circuit with more than one resistor), however, the author was concerned about the Thévenin resistance. My question is about the Thévenin voltage. It is known that the capacitor can be represented as open circuit in DC conditions. I remove the capacitor from the circuit and obtain two voltage sources in series and two resistors in series. Then the voltage on the capacitor terminals is V = (15 + 7.5) - (15 + 7.5) * 2/(2+6) = 16.875 V However, the correct answer is 9.375 V which is calculated in the following manner. We assume that the ground is in the bottom of the schema. Then we assume that the capacitor node is still there and there are 3 currents: from 15 V source, fvrom 7.5 source and into capacitor. And then we write the equation for the capacitor node: (Vc - 15)/2 + (Vc + 7.5)/6 = 0 ; 0 because no current flows through the capacitor Vc = 9.375 V Here is the simulation in LTSpice: And here is the question: why should I assume that the ground is in the bottom of the schema? If I will ground the circuit just after the second resistor, I will got the value I calculated from the very beginning: AI: The currents are all the same through the components. The relative voltages between each node are the same. The difference is the absolute voltages are not the same. No matter where you place the ground, the nodes will have the same voltages relative to one another. The ground is a point that we decide to call 0V an reference all voltages to that node. The relative voltages are the same V1 still has 15V across it in both simulations, R2 always has 5.625V (at DC deferentially) and R1 always has 16.875V deferentially across it, no matter where you place the ground It does not matter where you place ground if there is no currents flowing into it (like if you have two grounds in the circuit. If there is one ground, you can place it anywhere and the circuit will function the same. If you don't have a ground, the spice simulation will have an error. That is because the spice simulator makes equations from the circuit (like a human would) and then solves them. A human nor computer can solve these equations without a ground,because the solution for the system of equations will be indeterminate.
H: Do all common grounds end up to the chassis ground? I'm new to electronics, and still wrapping my head around "common" and "ground." The schematic is: My question is if ALL the solid black grounds/commons end up at the one going to the cap/resister to chassis? I keep debating if the power supply grounds/commons get tied together, then all the signal commons/grounds get tied together separately following the cap/resister to chassis ground. AI: The use of a specific symbol, a horizontal bar, for the common ground, is intended to communicate that these are indeed all one node, which means are all connected by wire. It doesn't communicate whether there's a link between all the PSU grounds, and a link between all the audio grounds, and then these are linked. It leaves the topology completely undefined. It could be a star ground, a single long serpentine wire, whatever. You may well find there's an audible difference for how the ground connection is actually routed. You may find that current pulses in the power supply section induce voltages in the audio section for one ground topology and not for another. This is not controlled by the diagram, but left up to the knowledge of the wireman. There may be some text to accompany the diagram which clarifies this. You are right to ask these questions.
H: How many amperes can pass through drain-source of a FQPF9N50C if 3.3v are applied to gate-source? I a playing around with this N-channel mosfet I found at home (FQPF9N50C). Using this simple circuit: I am able to turn on an off the 12v load using by connecting 3.3v to the mosfet. The load is a small motor, was the first 12v thing I found, the real application will use a 12v 20w lamp. And that triggered my question. How can I know how many amperes can pass through the mosfet when using 3.3v to switch? Im clearly not very experiences on this field, just doing this for a hobby project. Tried reading the datasheed but I find it a bit hard to understand. AI: A FET is controlled by the gate voltage, Vgs (Voltage gate-source). The datasheet always contains these graphs explaining the relation of Vgs to drain current, Id. With 3.3 Vgs it conducts nothing at 25C if you must believe the Vgs/Id graph. But, this FET can do 1A@12V at 4.5V Vgs according to the lowest line in this graph. You need at least 5 Vgs to switch this FET, all other specifications in the datasheet use 10 Vgs, so that would be the recommended value. In short: you need more then 3.3V to switch this FET. If you do not have more, acquire a logic level FET. (eg: FDP5800)
H: 1v square wave generator I'm trying to create a square wave form from a single AA battery, say 1v. I came across an IC which is essentially a low voltage 555 timer: Semtech SX8122 however it is marked obsolete. I would like to be able to adjust the frequency from 1-10khz. Crystal oscillators seem to be above this range. Are there any other simple circuits or ICs that can operate at this voltage? AI: With AA you probably mean "Alkaline" battery. These have a full charge voltage of 1.5 V, and not 1 V – and even if you heavily discharged them, most energy is dispersed at voltages between 1.5 V and about 1.15 V (look for "alkaline discharge curve" if you want to know more), so you really don't need to work at 1 V. The classical NE555 isn't suitable for this kind of battery operation: It's a power-wasting nightmare, so batteries are eaten by your oscillator more importantly, it can't work at voltages so low. You can get a CMOS variant of the 555, but you'd have trouble doing much sensible work. If you still want to do that, Spehro's answer is the way to go. It doesn't solve the current sourcing problems of the TLC551, but it's both cheaper and more versatile if you just used a low-voltage microcontroller. (The TLC551 is of course way less complex, but it's a speciality part, and thus expensive.) The MSP430L092 for example can run at 1MHz with supply voltages upwards of 0.95V. About your application: you say you want to run an LED string from your poor AA battery – there's a lot of variation, but an AA battery is typically in the 2000 mAh range. So, assuming one LED of your string uses 20 mA, and you want to run a string with 40 LEDs, that's 800 mA of current draw, giving you 2h and a bit in runtime, even assuming 100% voltage conversion efficiency. And that's a conservative guess – many ambient lighting LED strips have higher per-LED draw.
H: Switch multiple contacts in parallel from a single 24V DDC output I have a DDC (direct digital control) with a 24V digital output and I need to control around 100 external circuits, each having their own input. The switching distance between DDC and remote panel will be anywhere from 25 meters to 100 meters, they would share the same building ground. There are two types of output available on the DDC (and ideally would like to use both types to increase the utilization, ratings below are per output): Digital output dry contact (relay contact, SPST NO, 48VA at 24VAC)- pilot drive @ 24VDC 0.5A, or direct drive @ 24VDC 0.5A. Universal output configured as digital output. Open Collector Output, Max Sinking Current Rating: 200mA @ 24VDC. I would like to connect them in parallel and switch all at the same time (near, timing isn't key). I don't want to have to provide 100 DDC I/O to do this, and would like to do it via as few as possible outputs (ideally one DDC output to 100 external circuits) - even if one DDC output could control 10 external dry contact circuits that is ok. Questions please: Is the switching of multiple external circuits in parallel possible in this manner (intermediate higher power relay is OK), if so what calculations would need to be looked at to ensure we are well within head room of what current the DDC can source (if any is required)? This input type of the remote systems can be specified at this time as the remote devices are yet to be built, if it is advantageous to use opto-isolated inputs then we can specify this. The manual states on page 11 of the digital output wiring connection It does not output voltage or current. It is a dry relay contact - is it right to say that the meaning 'dry' for the digital output (as opposed to the universal output which is open collector) is that it is not sourcing its own current and we need to provide the 24V externally, and it is just the switch that is closed in the output within the DDC electronics? What is the difference in meaning between pilot drive and direct drive? I see one question in comments as what voltage is present on the dry contact inputs, how much current flows when you complete the circuit? I guess the current depends on the input if it is opto-isolated or a dry contact relay (we are free to specify) - any benchmark current ratings between opto-isolators and dry contact current required @ 24V? AI: To answer this question properly requires an understanding of the output characteristics of the outputs and inputs. Of particular importance would be the understanding of: Outputs: relay or transistor? If transistor: Are they opto-isolated from the controller? Do they share a common with other outputs? What is the output rating? Inputs: Are they opto-isolated from the controller? Do they share a common with other inputs? Do they share a common ground or V+ with other inputs? How far apart are they and is there a risk of different earth / ground potentials? What is the input current requirement? If grounding and commons are not a problem it's just a matter of calculating how many inputs can be driven by the output contact with sufficient reliability derating.
H: Why do we need a voltage divider when we get the same voltage at the output as the input? I am using a voltage divider circuit of 100 Ω and 10 kΩ resistors, and using their output for the (IRF740) transistor's input. I'm trying to figure out why do the resistors have those specific values. It makes sense that if I use voltage divider, I get 0.99x as a result with 100 Ω and 10 kΩ, resulting in the same output voltage as the output. But if that's true, then why do I need those resistors in the first place, if I get the same voltage as input. Can't I achieve the same without them? AI: The 10k\$\Omega\$ resistor is there to pull down the gate when the input is floating (thus avoiding an undefined/uncontrolled gate voltage). On the other hand, the 100\$\Omega\$ resistor is there to limit gate charging/discharging current (due to the presence of gate capacitance) and to prevent oscillations. But, as you have already detected, both resistors form a voltage divider. Thus, we need to avoid dropping too much voltage in the 100\$\Omega\$ resistor, otherwise we might not be able to achieve the gate voltage required to turn ON the MOSFET. The solution is to let the pull down resistor be much, much higher than the gate resistor. 20x higher is often used; in your case it's 100x higher, which is fine too. The pull down resistor value is not critical and is usually something between 4.7k\$\Omega\$ and 100k\$\Omega\$.
H: ULQ2003 not driving a Relay properly I am driving a 9V DC (5 PINS) Relay from darlington array ULQ2003. The ULQ2003 COM pin is connected to 9V power supply while the Relay coil is connected to +12V supply. The Ground of both are connected together. When 'OUT1' is at LOW then the Relay is operated and its 'NO' contact is connected with the 'C' pin. When 'OUT1' is open-circuit (floating) the Relay remains latched and its 'NO' contact remain connected with 'C' pin. If I check voltage at 'AB' points then I get positive voltage there. V(AB) = 2.3V --> that is VA is 2.3V higher than VB. My understanding is that after the Relay power is turned-off then a reverse polarity voltage will appear across its coil, and for that we put a reverse diode in parallel with the Relay coil. I cannot understand why the Relay is not able to de-energize completely when its circuit is break? AI: The issue here is that you have COM connected to 9V. If you look at the internals of the ULQ2003, you will see that between its output and COM there is a diode, the same diode that you have added in parallel to the coil of the relay. Because of this, when you try turn the output of the ULQ2003 off, effectively you will still have 3V going through the coil of the relay, which is enough to keep it energised
H: Question about the accuracy of integrated resistors I'm studying the implementation of resistors in integrated technology. In particular the books deals with the accuracy of the obtained resistors. It says: Then it says: "We observe that the value of the resistor depends on four parameters that are achieved with independent technological steps. Therefore, to estimate their accuracy we assume them to be statistically independent." and it comes out with the following equation: The question is: what is the meaning of this equation? How is it mathematically derived? AI: \$R\$ depends on \$L\$, \$W\$, \$\overline{\rho}\$ and \$x_j\$. If the errors of those 4 parameters are statistically independent, then the variance of \$R\$ will be the sum of the variances of those 4 parameters, hence the summation. Another way to look at it is by taking partial derivatives of \$R\$ with respect to each parameter, then dividing by \$R\$ and squaring. Then you can add it up all together because all variations are statistically independent. Otherwise you couldn't just add them up, you should take into account any cross-correlation between parameters. And just in case you're wondering how it's possible to add errors that are in the denominator of the equation (parameters \$W\$ and \$x_j\$): we can do it because there is a first order approximation involved. $$ \frac{1}{W+\Delta W} = \frac{\frac{1}{W}}{1+\frac{\Delta W}{W}} \approx \frac{1}{W} \left( {1-\frac{\Delta W}{W}} \right) \text{ if } \vert{\frac{\Delta W}{W}}\rvert \ll 1 \text{ thus}\\ R+\Delta R \big\vert_{\text{due to }\Delta W} = \frac{L \overline{\rho}}{(W+\Delta W)x_j}= \frac{L \overline{\rho}}{Wx_j}\left( {1-\frac{\Delta W}{W}} \right) = R - R\frac{\Delta W}{W} \\ \Delta R \big\vert_{\text{due to }\Delta W} = - R\frac{\Delta W}{W} \\ {\frac{\Delta R}{R}} \Bigg\vert_{\text{due to }\Delta W} = - \frac{\Delta W}{W} $$ After squaring, the minus sign disappears. The same applies to the error contributed by \$x_j\$.
H: di/dt for R of general RLC, KCL dt algebra Basic question. This is an exercise which requires all initial values for i and v0 (both 0), final values (yielding 2,4 A and 9,6 V) It also asks for di/dt and my question lies on the answer given (last equation, giving di/dt = 4A/s) I tried writing a KCL equation to observe the currents better, but how do I keep the current source value after deriving the equation How does it imply that ic = 4 AI: At t = 0+ the dominant component is the capacitor C1. Its effect trumps any effects from R1 and super-trumps any effect from L1 in series with R2. So, at t = 0+ C1 acts like a short circuit and starts to charge up taking all the 4 amps from the current source. Given this: - $$i_c = C\cdot \frac{dv}{dt}$$ We can say that the initial rate of change of voltage is \$\frac{4}{0.25}\$ volts per second (16 volts per second) hence, the initial rate of change of current through R1 is 4 amps per second. After everything has settled down and in the fullness of time C1 acts like an open circuit and L1 acts like a short circuit hence all the current from the current source (4 amps) feeds R1 || R2 and produces a terminal voltage of 4 amps x 2.4 ohms = 9.6 volts. This implies a current through R1 of 2.4 amps and a current through R2 of 1.6 amps.
H: ADC signal close to D+/D- signals layout suggestion My circuit is laid out in way so that the analog front end is on a different pcb than the MCU board. The two PCBs are connected with a vertical connector of which 4 pins are used to transfer two low frequency (<50 Hz) ADC signals and their return current. My question is whether you think the D+ and D- signals from the USB connector going to the FTDI chip will affect the ADC signals in terms of crosstalk/noise. My estimate is that, even though the actual signals are relatively seperated, the high frequency return paths of the USB signals will be spreading quite a lot affecting the ADC lines. The alternatives I have in mind are either leaving the layout as it is or placing the GND pins for the ADC signal somewhere on the left side of the connector, further apart from D+,D-. Note that I cannot change the position of the ADC1,ADC2 signals. But I can rearrange some things up north to push USB connector further up slightly. Any suggestion is appreciated. EDIT: Ok, after the suggestions in the comments and th answer I've updated the layout to increase the distance even more between the signals in question and not use the connector's pads as a path for the data lines. Also, I added a small cut-out in the top ground layer on the left but I doubt it makes a huge difference. The question that arises now is should I place a bigger cutout in the bottom ground plane, right there between ADC and Data lines? AI: Electric Field coupling ABOVE A PLANE is proportional to 1 / distance^3. Electric Fields will happily divert (most of the electric flux) to nearby metal regions, strongly attenuating the remote flux coupling. But the Fields still exploit ALL POSSIBLE paths, thus your remote coupling is never reduced to Zero. That said, large nearby pieces of metal (tied to GND or to VDD) are your friend. Push those interfering signal further to the right. Push those vulnerable ADC inputs further to the left. And, crucially, widen that Grounded-region between the interferers and the vulnerable traces.
H: What does Dominant pole/Pole mean related to capacitors and filters or Electronics in general for intuitive understanding I am trying to understand the feedback compensation techniques of DC-DC Buck converters. And I drift to more and more small questions which make me want to understand the basics of poles/zeroes/frequency In this link the answer given by user Kaz, in the last para, "One way in which amplifiers with multiple poles are stabilized is with the help of capacitors which create a "dominant pole" whose frequency roll-off is so great that the poles at higher frequencies basically do not matter (the gain is squashed at those frequencies). The amplifier basically "looks" like a single pole one." I can't able to understand what he is saying in the last para. I know, it is somewhat easy. But i am not able grasp In general, can someone clarify me the concept of pole, dominant pole with filters/capacitors? Like, if someone says, there is a pole in the feedback loop, or two poles in the loop, how to understand it electrically? one more question regarding this, i understand that if there is a pole, it means that oscillations will be present in the system. But the oscillations will be at what frequency? Will it be at the resonant frequency of the part or the entire systems? Experts who find mistakes in my question, please let me know where I am wrong. I also find a single pole and double pole loops. How do they arise? It would be better if someone can provide me an analogy regarding these poles/frequency for good understanding. Thanks. AI: You keep trying to understand it "more electrically", but the problem is that pole dominance, and the pole concept itself, is strictly related to Laplace Transform (LT) theory, which is a strong mathematical theory. Poles are not an "electrical concept" in itself. It is a concept that can be applied to any linear system, or any system amenable to be linearized usefully for the application at hand. They can be electrical systems, but also mechanical, thermal or systems in whatever field of application you may imagine where the LT techniques can be applied. Chu already gave you a very simplified view of the concept in the time domain for an electrical system. I'll try to dumb down the things some more, but keep in mind that if you don't want to grok some math, it is really not possible to understand the concept in all its depth. First of all, poles are related to how fast a system can react when it is excited, and the reaction time is related to how the system can store and release energy during and after the excitation. An (idealized) system which cannot store energy has no reaction time, it reacts immediately to any stimulus it is subjected to (think of a pure resistive circuit, where resistors are ideal). Reaction time for electrical circuits, therefore, depends on elements that can store energy: reactive elements, that is capacitors and inductors (if we keep the things simple and don't consider mutual induction and/or distributed circuits). Grossly simplifying, each independent reactive element contributes a pole to the circuit, and the number of poles of a system is called the order of the system. So a circuit with one cap and no inductors is a 1st order system. A circuit with a cap and an inductor is a 2nd order system (or two independent caps), and so on. What does it mean "independent" element? Too complex for you, if you don't want to grok the math, so let's skip it. Very broadly, it means that the level of energy storage of one element is completely independent from the level of the other elements. OK, now what do the poles do to a system? They describe the "reaction time***s***" of the system. Note the plural! A system that is excited momentarily (imagine a fast electrical impulse) reacts with a response that evolve in time and then dies off (if the system is stable). This "impulse response" is made up of different components, each of which decays with a different time constant. Every pole contributes a different component with a different time constant. The time constant is a measure of how fast a component decays: the bigger the time constant, the slower the component decay (usually a component is considered zero after 5 time constants have elapsed, actually the decay lasts forever theoretically since it is exponential -- see Chu's answer for a simple math expression). The impulse response of a stable system dies off after a while and the time it takes to die off gives you an estimate of the reaction time of the system: the time a system needs to stabilize into a new condition when the inputs are varied. A dominant pole is a pole whose time constant is much "slower", i.e. bigger, than all the other time constants of the circuit, therefore the corresponding component is still observable after all the other, faster decaying, components have died off. In other words, a system with a dominant pole behaves approximately like a 1st order system, i.e. a system that has a single pole. In the end, the concept of pole dominance is a way to simplify a system: if a dominant pole exists, with some caveats, the system can be thought as a 1st order system, i.e. the simplest system imaginable that has a non-trivial time evolution. The problem is that not every system has a dominant pole, so it can't be simplified that way. A technique used sometimes to simplify things is to add a compensating network in the circuit, i.e. a network containing at least one reactive element, in order to introduce a dominant pole in the system and thus allowing the simplification. Of course, if you want to introduce a new pole in the system that has to be dominant, its time constant must be bigger of any existing pole (unless you do pole-zero cancellation, but that is a still nastier and more advanced technique), therefore you end-up slowing down the system. So it's often a kind of trade-off: you slow down a fast system in order to make it simpler, i.e. more manageable by the rest of the control chain. In the process you lose something (e.g. fast response or gain) in order to gain something else (e.g. stability or accuracy). Note that my answer contains lots of hand-waving and gross conceptual simplifications, but everything I've said can be justified and expanded mathematically to give the exact definition and interpretation of what is a pole and what is a dominant pole. The problem is, as I've already said, that you can't escape the heavy math then.
H: Molex 5039600695: What is the SIM card stopper referring to? On some SIM card holder datasheets, I've seen references to a card stopper feature that prevents users from inserting a SIM card incorrectly. This card stopper appears to be a mechanical feature built into the body of the SIM card holder itself. Example on page 4: The detail drawing for Molex 5039600695 also refers to a card stopper. However, this particular datasheet indicates that the card stopper is 1.4mm away from the body of the SIM card holder. I am not sure how to interpret this recommended card stopper position. I understand the idea of a card stopper as a mechanical feature of the SIM holder, but not in this context of something separated from the SIM holder. In this case, is the card stopper a distinct component from the 5039600695 SIM card holder that would need to be purchased separately? AI: The phrase "card stopper" is being used in two different ways here. In the top drawing, it's referring to a leaf spring that only gets lifted up out of the way if the beveled corner of the SIM card is in the correct orientation. When a card is inserted incorrectly, it stops the card about halfway in. The small plastic post highlighted in green helps to support the spring while it is blocking the SIM card. In the second drawing, it's referring to a separate mechanical stop for a correctly-oriented SIM card, which keeps the card from moving out of the connector after it has been correctly installed. This would be part of the product packaging (e.g., some sort of lid or cover).
H: do is anyway to detect Tablets Pills package is empty or not? do infrared sensor can pass through transparent plastic and work? AI: Your eyes cannot see IR but your (phone) camera can! Grab your TV remote as an IR source and while pressing a button on the remote look at the remote through your phone's camera (actually almost any digital camera will do). Chances are you will see the IR transmitter LED in the TV remote flashing like so: Now hold the pills package in between and check if you can still see the IR LED flashing. If yes: then the IR light can pass through the holes in the package. However, the aluminium (?) foil in the pills package will block IR very effectively. If that foil is not removed then the IR light will not pass through. Only if there is a clear visible hole left (through which you can see light pass through) can this work reliably as a pill present/not present detector.
H: Optocoupler - Make active low output at active high I'm currently working on a project and it consists of amplifying a 5V signal from an Arduino to 24V. I made my circuit and hooked it up to a oscilloscope and it shows that the output of the optocoupler is active low. I just wanted to know if there's a way I can make it active high. Thanks in advance. AI: Yes. Swap the positions of the 1.6 kΩ resistor and the opto-transistor. That will default to pull-down and the opto-isolator will pull up. It's not clear why you're using the opto-isolator other than as an inverter (which you seem to not want) since you have CH connected to the micro-controller's D7 so you have lost all isolation. Your CH1, if it's a 5 V input, should be fed directly from D7, not from the top of the infrared LED where it will be clamped by the 1.4 V forward voltage, Vf of the infrared LED.
H: How to read / identify cylindrical ceramic capacitors as this is my first post I'm not quite sure as to how I should format this question but here goes. I am trying to sort a set of ceramic capacitors and I have come upon a few that I can't identify. When I look up the text on their sides (all the same) nothing if relevance comes up. I think they are 1nF, but I'm not sure. Any help with how to read these would be much appreciated. The tet says "MKT .01 63/K," Images below. AI: MKT means it is a metallized polyester film capacitor. 0.01 should mean 10nF, 63 means max AC voltage and K means 10% tolerance. The manufacturer logo is quite blurry, but regardless of that these should be identical between manufacturers.
H: Is there an intuitive reason for why NAND gate is a universal gate? Now I know the maths and logic to figure out that every boolean function can be expressed using only AND and NOT gates, which in turn can be expressed using only NAND gate and hence every boolean function can be expressed using only combination of NANDs. I know the math, I can easily work out the how. But, I am looking for a more intuitive (not necessarily non-mathematical, maybe philosophical) reason as to why this has to be true (if there is such a reason at all). For some reason I think that it is not just a mathematical fact that NAND gate is universal, there must be a more "deeper" reason or something in property of NAND gates that has this, if I am able to explain myself. So, is there really such a reason? Or is the universal nature of NANDs really just a mathematical artificact just discovered by us somehow? EDIT : Fixed the basic gates. I messed up that. AI: Now I know the maths and logic to figure out that every boolean function can be expressed using only AND and OR gates Untrue. You also need inverters. every boolean function can be expressed using only combination of NANDs. True. Or you can do it with NOR gates... But, I am looking for a more intuitive (not necessarily non-mathematical, maybe philosophical) reason as to why this has to be true (if there is such a reason at all) What both NAND and NOR have in common is that they: Allow you to "recognize" one unique possibility of the four in a two-input logic table. Allow you to build an inverter by feeing the same signal to both inputs So basically you have a "test" engine and an "transform" engine; you use the "transform" engine as needed to turn the pattern you want to look for into the pattern the "test" engine does look for, and then the "transform" engine to turn the result into what you want. And if you need to detect multiple patterns, you treat having both of them satisfied (or neither of their anti-patterns satisfied) as the pattern to be detected in another stage. Or just find a napkin and draw all the other gates as a collection of NAND gates...
H: Can a flyback diode work on the "ground" side of a transistor? In every flyback diode setup I see, the relay coils are on the drain side of the transistor (if my terminology is wrong, I mean the top), so the flyback diode sends current back toward the power source. I'm curious if it can also be setup like this, with the load and flyback on the "grounded" source side of the transistor. I think it should work, but I'm not sure. As an aside, how would I test this for myself? AI: Some misconceptions need to be corrected: 1. The flyback diode does not send current back to the power source. The power source is irrelevant. The flyback diode gives the current in the inductor an "easy" path to continue to circulate through the inductor. When current is interrupted in the inductance, it uses the energy stored in its magnetic field to continue to keep current flowing through it. So for a short time after the current is interrupted, think of it as a battery. The current flows in the same direction as before the interruption but the voltage across the inductor has reversed since it is now acting as a source and not a load. That voltage forward biases any diode in anti-parallel with it to give the current a path to flow. That voltage will be as high as necessary to keep the current flowing through the inductor. If the current path available is tough, it will be a very damaging high voltage to force the current through. If it's an easier path (like a diode with low forward voltage drop) then the voltage produced is less. Using that mindset, you should always be able to tell if flyback measures will work or not. The flyback diode gives the current IN the inductor a loop where it can continue to flow. The power source is irrelevant. So the diode in your circuit will work to suppress flyback voltage spikes, but... 2. Your circuit, as a whole, will not work. You cannot simply move the load from the "high-side" to the "low-side" like you just did. The reason you see the coil on the drain side of the transistor is that the voltage DIFFERENCE that turns the MOSFET on is the voltage DIFFERENCE between the gate and source terminals. Which means that if the source terminal is not tied to a fixed potential (i.e. ground or power rail, depending on whether you are using an NMOS or PMOS) then the circuitry gets a lot more complicated since now the signal being sent to the gate must float on the MOSFET's source voltage. This means, that as drawn, your circuit will not work but for reasons you don't yet realize. Suppose I apply 15V to the gate of M6 to turn it on, will it turn on? That offhand phrase is loaded in that it implies that the 15V being applied to the gate is relative to ground. But the MOSFET cannot and does not care about the voltage at its gate relative to ground (how is it supposed to know what the voltage at ground is? None of its pins are connected to ground). It cares about the voltage at its gate relative to the the voltage at its source terminal. The circuit you have drawn is a source follower (as long as when there is no floating gate drive, or a ground-referenced gate-drive voltage is applied that is less than \$ V4 + V_{gs_{th}} + V_{gs_{overdrive}}\$. Where \$V_{gs_{th}} + V_{gs_{overdrive}}\$ is just the voltage requires to fully turn on the MOSFET. It's not just \$V_{gs_{th}}\$ since that's the voltage where the MOSFET barely starts to conduct and is only useful for amplifiers, not switches. Being a source follower, the voltage applied to the coil (or load) can only ever be a maximum of \$V4 - V_{gs_{th}}\$, rather than V4. That is a lot of voltage not being applied to the load and if the current levels are high enough, that is a lot of heat being dissipated in the MOSFET since it's not fully on. This situation can be corrected in two ways: Replace the NMOSFET with a PMOSFET. Since the PMOSFET requires it's source terminal to be connected to +V and your transistor's location in the circuit is right next to +V, that fixes the problem of a floating gate-source voltage. Use floating gate driver circuitry to drive the NMOSFET gate with a voltage that floats (aka is relative to) the source-terminal. Often done in inverters and motor drives because NMOSFETs are cheaper, more efficient, and more available than PMOSFETs. As mentioned by @Spehro Pefhany in the comments, the source follower in this situtation actually eliminates the need for a flyback diode. When NMOSFET gate is brought to 0V to try and turn things off, the reduction in current causes the coil to kick. This kick brings the source terminal voltage negative low enough to make which make Vgs positive enough to turn the NMOSFET back on, even if 0V is applied to the gate. In effect, the inductive kick forces the MOSFET on partially thereby slowing down the shut-off time of the MOSFET, preventing it from slamming off which would cause an even higher, potentially damaging inductive kick to occur. This would interfere in high speed switching circuits, however.
H: LEDs and high currents In smartening up my doorbell I've been playing with my illuminated pushbutton and have fallen into a bit of a rabbit hole. The doorbell normally: simulate this circuit – Schematic created using CircuitLab My understanding of this is that when the switch is open the bulb lights up and there is not enough current to fire the chime. When it is closed the short circuit then provides enough current to the chime to fire its coil. I used my multimeter to discover that the pushbutton lamp has a resistance of 60ohm, and the chime 6ohm. The AC source is 8VAC. My enterprising idea was to replace the chime/coil with an optocoupler which would trigger something downstream (an ESP32 in my case). First I tried to get it all working with an LED, so to end up with a lit bell that lights the LED when pressed. Here the lamp is always off, and the LED is always lit. Which is expected - the current is way too low for the lamp due to the now larger resistance. But reducing this resistor will probably burn out the LED. So: Is what I want to do even possible? That is, to ordinarily have a high enough current pass through the button in order to illuminate the lamp but not the LED, but when pressed, have the short circuit light up the led instead? I guess what I really want is a low resistance optocoupler that can handle a high current. Does that exist, or is it possible to build one from basic components? If not, what's the mental model here that would show this isn't possible? Is it that the LED requires much less current than the lamp so shortcircuiting the lamp doesn't make sense since by definition the current would increase? To be clear I'm more interested in learning here than getting a working circuit - aside from solutions using mechanical relays and current sensors I'd probably choose to just use a normal (ie not illuminated) doorbell instead. AI: I would try something like this. You want the new circuit to have roughly the same characteristics as the chime. I don't know enough about the details to give exact values. The value of R1 needs to be small enough to light the lamp, but not too small or the transformer will be stressed when the button is pushed. See if you can see the rating of the doorbell transformer, they are often mounted directly on the main breaker box. R1 should be sized (wattage) so it doesn't burn up if the switch is held closed. D3, or several diodes in series, or a zener, is optional, if needed to raise the threshold so the opto isn't on when the switch is open. I am assuming that 60 ohms is the cold resistance of the lamp. The hot resistance should be high enough to keep the opto off. simulate this circuit – Schematic created using CircuitLab
H: Simple Op Amp Non-inverting Amplifier Circuit Not Working I am only just starting to learn about circuits and electricity, so please bare with me. I am attempting to build the circuit pictured below: And this is my rendition of it: Here are the parts used: -Op Amp is the LM318 from TI -Photodiode is the SFH 213 from Osram -Power supply is 9 Volts 1 Amp -My resistance is a bit higher, with 2 1 Megohm resistors The issue is that I should be seeing a much higher voltage than what I am seeing, I get between .15 V when covered to .23 V when uncovered. From what I understand, the higher Rf is, the higher my voltage should go. But adding more resistors does almost nothing, it slightly increases the values. If I put a 100K ohms instead of a 1 Megohm, I get almost the same values. I have tried to build every variation of the op amp mathematical functions but not one of them has worked correctly. I've also tried a few different kinds of transimpedance amplifiers to increase my photodiode signal but none of those have worked either. I also have swapped out my photodiode with other photodiodes and my op amp with other op amps. In my attempts I've already blown up a photodiode and an op amp. I have been successful in building the circuits I want in QUCs simulation software, but none of that has translated to the board. With all of that in mind, I figure it means that my understanding of ground is wrong, my supply current is much too high for the op amp, or that I don't understand how a breadboard works. But I have watched countless videos and have been working on this for over a week, well over 20 hours trying to get op amps to work the way I would like them to, but have been completely unsuccessful. I don't understand what I am doing differently from every example I have watched and every diagram I have tried to copy. If you need more information let me know. AI: Input common-mode (CM) range or "Voltage input Range" in BJT Op AMps is never Rail to Rail. So this needs an offset bias for input to work. Differential input voltage will always be 0V when output is not saturated to either rail. But here Common Mode voltage = V+/2. Check IC supply specs for useful range. If using an R or G or B LED as a photo detector, observe specs are -V Absolute max. Compare sensitivity with the PD and selectivity to colours. simulate this circuit – Schematic created using CircuitLab Sensitivity and slew rate (=0.35/BW) both change with feedback R. Suggested range is given. "ON" time can be naturally much faster than Off time due to higher current and diode capacitance, C but depends also on Rf, time constant= C * Rf(=ΔV/ΔI) = τ(Tau) = R'C
H: How to build an electric rat trap / deterrent I am looking to build an electric rat trap that acts like an electric fence, one that that can deter or block rats from climbing up a tree. Not interested in killing them. I have a large orange tree that we love, unfortunately so do all the neighborhood rats. Every night they run up into the tree, eat into several oranges, leaving debris all over the ground. In a couple months time, all our oranges could be gone. I don't want to poison them (we have dogs), snap traps are mostly useless, and if they work, it gets just one. There are always a bunch more in the area that follow. I'd like to build an electric "fence" that can shock them as they climb up the tree. I saw on youtube how they do this: Take a 12V battery, connect it to a 150 uF AC Capacitor, which then connects to two sheets of aluminum/steel (positive to one piece, negative to the other). Each piece of aluminum/steel will wrap around the base of the tree, spaced an inch or two apart, so when they climb up, they get shocked, and fall off. This is one example of a setup that I found: The negative line of the batter goes straight to one piece of metal/aluminum, the positive goes into one capacitor, then into another, and then to the other piece of metal/aluminum. As I got this off of YouTube, I was hoping for clarification on a couple things. Would this setup work? If not, what changes would be needed? How to make it safe? I would disconnect battery at night and reconnect in morning. I don't want my tree to catch fire, and I don't want to electrocute myself. What kind of shock would I expect if I personally triggered it - touched both pieces of wire. How long would battery last, if nothing touched it? I assume I would have to recharge the battery at some point? AI: Would this setup work? No. This circuit is complete nonsense -- the voltage from a 12V battery is too low to produce a shock, and connecting capacitors in series with the battery will prevent any current from flowing at all. Unfortunately, I suspect that the tutorial video you watched was fake. (Sadly, this is rather common.) Creating a circuit that would be effective in this scenario would involve completely different parts -- one option would be to use a transistor oscillator, a high frequency step-up transformer, and a voltage multiplier, similar to the circuit used in an electric flyswatter. However, this would require a lot more parts and some careful design -- there is no way of turning the parts you currently have into something functional.
H: Choose regulator for 12V to 5V with 3Amp I need help on choosing type of regulator base below design requirements Design Spec: Input Voltage = 12V Output Voltage = 5V max Current = 3A Power (12-5)*3 = 21W EX: Without heat sink 60C/W (lm1084 ) So: 21W*60C/w = 1260C which is out of questions So what is best option regulator with budget of under $3 (for Qty 1) and must be surface mount Main concern is the heat generated by the regulator AI: How to select your DC-DC... To go from 12V to 5V you need a buck converter, so let's check that in the search engine. Now, for the other criteria... Ready made or DIY? That's the first question to ask, especially if you're not familiar with designing DC-DC converters. There are a lot of small board-mount modules available, for example this one. Search for "PoL (point of load) DC-DC" or "board mount" etc. You'll need a non-isolated buck. A ready-made module can be a very good idea for a small production run when you don't want to waste time on designing a DC-DC. Synchronous or asynchronous rectification? From 12V to 5V, duty cycle will be 5/12 = 0.42 thus a converter with asynchronous rectification will have a diode conducting 42% of the time, wasting 3A * about 0.5V * 0.42 = 0.625 Watts. A synchronous rectification converter will be a bit more efficient, it might waste about 0.3W instead in the bottom FET (wet finger in the wind calculation with 40 mOhms FET and switching losses equal to conduction losses). Since the difference between synchronous and asynchronous is less than 1.5% efficiency in your case, if asynchronous is cheaper, no problem, just use that. Synchronous becomes very useful at very low output voltages like 1.2V though. Internal switch vs external? An external FET means you can pick any FET you want, but it is an extra part and extra cost. However, an IC with an internal MOSFET will cost more than an IC without it. If uses synchronous rectification, then it is 2 FETs, or a single package dual FET. So you need to add the price of extra parts if you use a chip without internal FET(s). Frequency Higher frequency shrinks the inductor and the input/output caps, and reduces core losses. It also increases switching losses. Other features Like efficiency at low load, losses at very low load or no-load, "power good" output, ENABLE input, input voltage range (do you want it to go down to 5V?), how much noise/ripple you can tolerate, EMI, etc. Knowing this, just input your requirements into webench and check if it generates designs you like. You can set it to optimize for cost, footprint, or efficiency. Of course, it wants you to buy TI chips, but nothing stops you from using it as inspiration and using another similar chip from another supplier. The first suggestion is this chip which looks pretty good. Note if your "3A max" load spends lots of time drawing 3A, it may be beneficial to select a chip with peak efficiency at 3A, and that would be a chip capable of a bit more current, perhaps a 4A chip. The 3A chip's efficiency peaks at 1-2A.
H: 2N7002 MOSFET gate voltage internally being pulled high, potentially dead I am using the circuit below to switch a bi-latching relay once a wire is disconnected, i.e. to not switch as long as a voltage is present on the wire. After assembling on a PCB, on which there are multiple instances of the circuit, about half appeared to work properly once, but after cycling the relays on/off by disconnecting the wire and resetting on the other side, all of them would stop working. Specifically, the Q2 gate voltage appears to be internally pulled up to between 2V and 10V, and even when connected directly to GND it becomes active and brings Q1's gate to GND. Q1 appears to still function as expected. In simulations it works as expected, and I find it strange that Q2 is the one that goes given how relatively shielded it is from the relay current and potential flyback voltage spike. Potential solutions I see here are to use bigger MOSFETs or switch Q2 to a BJT, but I'd like to understand what could be causing this to avoid the same problems in future. AI: Seems like you've damaged the gate of Q2 by ESD or similar effects. It's a bad idea to expose an unprotected MOSFET gate to external connections, particularly a small MOSFET such as a 2N7002. A series resistor (eg. 1K) and something like a 5.1 or 6.2V zener from gate to source will protect the MOSFET from most reasonable transients. simulate this circuit – Schematic created using CircuitLab You could switch to a BJT (with a series base resistor) but it would be a good idea to have a diode from base to emitter to prevent ESD-induced reverse base-emitter junction breakdown, so the component count does not look much different.
H: What is the formula for how long a capacitor can power a circuit I was thinking of implementing a feature for my circuit that protects it from loosing power after a 1 - 2 seconds power outage. Although a battery would do the trick, i would like to go with the capacitor route as its easy to implement to circuit, i will just add it to +/- of the circuit. further question, how does a capacitor work in storing a charge is it like a battery? Where is starts at 0v then gradually goes up to 5v when full (assuming the circuit is 5v). and upon discharging does it gradually looses voltage too until it reaches 0? If so, how is current affected? Or is it like you power bank stays a constant 5v when charged and can dish out a constant current until its "drained" based on observations of how a capacitor is affecting the leds i would say voltage goes slowly down, but i am not definitive. AI: The formula is $$ t = C \frac{\Delta V}{I}$$ where \$t\$ is the time, \$C\$ is the capacitance in farads, \$\Delta V\$ is the maximum change in capacitor voltage that you can allow, and \$I\$ is the amount of current drawn from the capacitor. Yes, the capacitor voltage will fall as current is drawn from it, so you must initially charge the capacitor to a higher voltage than you need and then draw current from it until it reaches the lowest voltage you can still use.
H: Real thing or just misinterpretation? Rotating batteries to make TV remote work When TV remote isn't working, I rotate the batteries in the remote in their place and it begins to work. I don't see any kind of deposit between the batteries and the contacts. Rotation of battery doesn't seem to be a meaningful factor by itself that can change the energy output. So, how? AI: When the batteries are almost too low to operate the device anything that improves conductivity will help, shaking the remote, twisting the batteries, warming them, and even pressing the buttons extra hard can get the remote to function when electricity supply is marginal. The nickel plating on the battery contacts forms a thin invisible oxide layer, but it's not usually thick enough to stop the remote from working, twisting the batteries breaks that layer and slightly improves the connection. warming the batteries enhances the strenght of the chemical reaction inside the batteries, that helps too. What you should do is replace the batteries, that will work for longer.
H: How to calculate the maximum data rate or frequency of a bus driver I'm searching a suitable bus driver for a project. I found the Nexperia 74VHC244D. On the website they say the maximum frequency is 60MHz (here). But how do I calculate the 60MHz? Because it's not mentioned in the datasheet. Is it just the inverse value of the propagation delay? AI: Looks like they're using Tpd = 15ns (Cl=50pf, Vdd=3.3V) as the figure to arrive at 60 MHz, with a little bit of margin. If I had to guess why, it was the marketing droid badgering the tech writer for a ‘MHz’ figure, so they settled on 1/Tpd.
H: I2C multiple masters, one master has internal pull up, do I need external pull up? I use 2 MCUs as 2 I2C Masters connect with 1 Slave F-Ram to Read/Write data frequency. One MCU has internal 12k Ohm pull up resistors on SDA & SCL. So do I need external pull up resistors? AI: I2C pullups are a system level consideration. You only need one pair of pullups per segment, but they should be sized with consideration for your bus load capacitance to ensure your digital signaling is sufficiently digital and your edge rates are within specifications. I always start around 2.2kOhms and adjust as necessary. 12 kOhm sounds way to high for my taste. In general an oscilloscope is handy when it comes to evaluation of I2C signal in integrity.
H: If I have a power tool in a wood box do I need a ground? I am using an old treadmill motor to build myself a variable speed disk sander. The motor is a 2 1/2 hp DC motor and I am using an mc-60 speed controller. I am wiring it all up according to the wiring diagram, but my power cord no longer has a place to ground to. I built the body of the sander out of wood, and the only metal that it has is the small aluminum case for the speed controller which I believe is not suitable for a ground anyway. What should I do with the ground? Does it cause any safety concerns if I just cap it off? AI: Any conductive surface which can be touched should be grounded. The reason for this is that if there were some fault in your device that made a touchable surface "HOT", then a fuse or circuit breaker would blow. So, for your sander, if there is some metal that can be touched, (the screw that holds the sandpaper on? The center of the sanding disk? the shaft of the motor?), you should connect it safety ground. If there is really no way to touch a metal surface in your device, I suppose you could not use the safety ground. (You have made it "double insulated")
H: What is an economical way to supply DC power for small projects? electrical engineering isn't my strong suit, but Im trying to do a home project with some automation to it. I just don't know how I'm supposed to provide power to some higher voltage components that I wouldn't be able to power off, say, GPIO pins from a Raspberry PI or something. I can get a bench power supply off the internet and use that to form my circuits, but I don't know if that's the way it should be done. What's the way people usually power projects. The component that I need to control now is simply a small fan, but my solution needs to be extensible to more components in the future, and I need it to be DC powered so I can control it using a circuit. Thanks for any help! AI: The cheapest, most universal way is to use a USB connector for 5V. I’ve taken to using this method instead of buying barrel-plug power supplies. It has saved me a lot of time and effort. You can find adapters to USB power from just about anything you might find in the home: batteries, solar chargers, 24VAC (think sprinklers, doorbells, theromostats), line voltage, your R-Pi, your desktop PC, etc. For higher voltages (9, 12V) at moderate current (2-3A) look to the barrel plug type. CUI makes both the barrel receptacle and wall-wart supply in various output voltages. Phihong is another popular brand for this kind of power supply. You can find these on Digi-Key, Mouser, etc. For even higher voltages (24, 48V) and currents (3A or more), consider a screw terminal block. A popular quality brand of high-power supply for these is MeanWell. Jameco and others sell these. Some really high power projects can use a PC power supply and use the ‘GPU’ 12V power connector, or native ATX. It’s hard to beat an ATX power supply in terms of availability and watt/$. You can also find line-to-GPU power as a separate unit - mining rigs use this type sometimes.