text
stringlengths
83
79.5k
H: What's up with MOSFETs? For the longest time, I've stayed away from FETs and MOSFETs (when it comes to using discrete transistors in my circuits, that is). I'm taking a current hobby project as an excuse to try and finally get comfortable with using them. However, I can't seem to make heads or tails from these beasts. Before trying any real circuits, I'm running basic (almost "sanity check") LTspice simulations. Extremely simple circuits, and they still don't seem to work. For example, see this LTspice screen capture below — the voltage probe is at the output of the power supply; the current is measured through the resistor connected to the Drain pin. It is supposed to be 1mA when the MOSFET conducts (V2 is 12Volts), and I expect it to go back to 0mA for 1μs when the input voltage is 0V: BTW, if I make V1 a DC source, then it works: I set it to 0V and the current through R1 is 0mA (well, in the order of pA), and if I set it to 5V, current is 1mA. What am I missing? I also tried with a 100Ω resistor from V1 to the gate; it just makes a little round-ish bump in the current when switching, but it still does not come back to 0mA. I also added a 10k resistor from gate to GND. See image below, showing the output of the simulation (and again: what am I missing?): I do have some more concrete questions on the topic, but I figure I better get comfortable with the simplest "toy" circuits before I try to do any "real" applications (even in the context of hobby projects). AI: Do the same simulation on a vastlty different time scale, like 1000 times slower. So change the us (micro seconds) to ms (milli seconds) and run the simulation again. Note how in the first plot the red trace is going down but before it reaches zero you switch the NMOS on again. It has no time to reach zero ! There is a large capacitor present between gate and drain and combined with the 12 k drain resistor that is a large time constant. Larger than the 1us you're allowing it. So slow things down and see what happens. When you get the curve you expect, lower the value of the drain resistor and note how the speed increases again. At 1 us you probably need 120 ohms or so, not 12 k ohm).
H: KiCAD Component Pad Clearances I'm using KiCAD version 5, and I have an issue with it. Previously, I've been using OrCAD up until the point to where I needed multiple layers for my board. So, I redesigned my components, but I'm having an issue with my SOT-23 footprint. Previously, in OrCAD, there were no problems. I managed to design my part, and in the layout, the ground plane managed to fill in the gaps between the pads as shown in the image below. You can see my pad here, and my soldermask clearances are 0.1 mm for all sides. It passed the DFM checks with no issues. However, when working in KiCAD, I can't seem to get my copper plane to go in between the gaps. The pads are the same size, but I can't view the soldermask, so my rough workaround is to change the net pad clearance to be 0.1 all around, so it fits with my old part from OrCAD. However, it still doesn't solve the issue of the planes going in between the pads. How can I resolve this issue without affecting the other components of my board (is it possible to do this on a part-by-part basis)? Also, is there a way to view the soldermask layer? I see the mask layer as an option, but it doesn't show on the component. Perhaps being able to see the soldermask on my components might be helpful for this issue. AI: KiCad (version 5) works on a maximum required clearance model. That means that it will select the smallest clearance possible from the combination of requirements. In your case, although your pad has small enough clearance, I suspect that your zone fill has a higher clearance set. In the image below, you'll need to set two things: the clearance and the minimum width. Because you want the copper to flow between the pads, you'll need the width to be smaller than the space available between pads (when including their clearance. You said that you don't want this to affect other things on the board. In that case, you can set the minimum clearance for other elements using the "Design Rules -> Net Class Editor" clearance setting. Then, as long as your other footprints are set to a clearance of "0" (and their pads are set to "0"), it will use the netclass value. Viewing the Soldermask To view the soldermask, you need to have the soldermask layer enabled (and probably selected). The check-mark enables it but because it is drawn behind the pads, they typically obscure the layer unless you also click on it to make it the front-most layer drawn.
H: Scaling up NTC measurement through Multi-Channel Ohm meter For a test bed, we want to measure temperatures with NTC sensors (~10kOhm at RT) for the range 10°C to 70°C. Our test machine accepts auxiliary signal through CAN-bus, so we used a Raspberry with a "CAN-hat" to prototype the temperature measurement (three-point probing) and configure the test machine. We now want to scale it up to 80 (phase 1) then 320 (phase 2) channels. We already have all the necessary NTC sensors (recovered from previous projects). So far we have 2 solutions which are not satisfying: An all inclusive solution by a provider for a hefty price Acquiring eight 10-channel Ohm meters + eight RS-232 to CAN. That's about $100 to $150 per channel. That would slash the price in 2 compared to solution 1. In both cases, that's more than the cost of the RPi + the CAN-hat per channel. I would expect that scaling up a prototype would mean reducing the price per unit. Is there any less resource-intensive solution(s) we are missing? Ideally measurement with 3 or 4-point method would be wished. Thank you. edit: accuracy around 1K, resolution around 0.1K. AI: At the quantities you desire, it would most likely be best to design a custom PCB with a micro with CAN bus, and ADC and an OPamp could be had for the 50$-70$ range depending on your requirements. (0.1C 0.5C or 1C accuracy?) The circuit looks like this (doesn't matter if it's a PTC or NTC): Source: Here An add on board with analog for an RPI would probably be in the same price range. If you did multiple channels on the same board the cost would go down even more. Depending on the accuracy and temperature resolution, maybe less. There would be an additional cost of time and software writing for the custom solution. Another option that might work is the LTC2986 which has a demo board with an 'arudino' (actually linear's own flavor), if I remember right they have at least 4 channels (or 8) with 0.1C accuracy. Source: Digikey.com With a one of these solutions the NTC's may also reqire calibration (depending on your accuracy and resolution requirements) with a bath or some other method which might be more complexity
H: Driving a difficult load with an Op-Amp: high capacitance, high current, high speed I've been banging my head against this problem all day. I have a bizarre load that I need to drive over 88 feet of SMA that is a 68 ohm pullup to 15V. The cabling adds 2.64 nF of capacitance. I've sketched it below. simulate this circuit – Schematic created using CircuitLab I'm driving negative-going analog pulses (worst-case from 0V to 3V and back) where both the amplitude and pulse width are important, with rise times down to 20 ns. Somehow I have to achieve: Low overshoot (<135 mV) High amplitude accuracy Stability (this has been the most difficult!) Because this requires sinking 18V / 68 Ω = 265 mA, I can't just use an opamp. So I tried a current-amplified opamp circuit like so: I originally designed this without considering the capacitance of the cabling and I managed to get it perfect, but it oscillates once I add connect the 2.64 nF, as you can see below. I tried many different transistors and op amps, guessing at what parameter would affect this, but I can't get rid of the oscillation. I'm also stuck with a high-speed op-amp (BW > 50 MHz) because of the fast rise times. Currently my only viable solution seems to be a simple voltage follower with no feedback. I'd have to calibrate out the VBE drop and temperature dependence, which makes for a terrible system. My question is this. What causes this oscillation and what do I have to do during part selection to prevent it, or how could I damp the oscillation? AI: The circuit design's Q1 output provides drive only in the negative-going portion of the output signal and is discontinuous. When the signal goes positive, the current to drive the output on R6 in the positive direction cannot come from Q1, so the voltage must rise from the pull-up resistor and the RC of R1 and C2. Meanwhile, the (much faster) op amp output is going positive to the op amp rail. Once the R6 voltage reaches the point at which the negative op-amp input starts the op-amp drive in the opposite direction, the op-amp must come out of saturation, and drive the base and miller capacitance down to a voltage that turns on Q1. Once again, the op-amp output will go to the rail as the base voltage lags, causing overshoot again, and the whole process starts again. You will need a push-pull drive on this circuit so that you can drive the load in both directions and keep the op-amp out of saturation. This will require two transistors. You must also avoid discontinuity - in this circuit, a change in op-amp output voltage does not mean a change in circuit output unless Q1 is "on." So, a push-pull circuit that keeps the drive amplifier output transistors in the active region. Good luck!
H: RS485 to RS232 conversion? I need to connect a sensor that uses a RS485 transmission to RS232 or something I can read through the com ports on my data logger. I can't use usb ports or virtual com ports due to the program I am required to use not accepting data through usb in any form. Is there a way to convert the RS485 to something I can input through the DB9 connection available on the computer? I am pretty new to data transmission in general. AI: There exists such conversion but it's not as simple as putting a cable with RS-232 standard male cable to a RS-485 standard female cable or vice versa. The RS-485 standard protocol is very similar to RS-232 in terms of serial communications. However, the RS-485 has Differential Signaling, which basically means that it transmits information using two complementary signals. NOTE: The circuit diagram above is an example that can be found here of how this conversion may work. This could be one way you can differentiate a signal. As far as the materials you need, that's up for you to decide. If you're purchasing an adapter, I will not be able to provide recommendations. There are multiple ways to approach this problem, this is just one example. Credit from Magnet Tech Research for the circuit diagram.
H: Can I use a capacitor which has 275v +-10% tolerance in a 9V circuit? I am trying to get parts for a circuit i want to make and I'm very new at making circuits. As a result i'm unsure if i can use a 150nF capacitor with 275v+-10% tolerance in the following circuit or whether i need a different tolerance or anything. As far as I know the 9V in will be DC. Any help would be greatly appreciated, thank you. AI: Any capacitor has four basic ratings: 1) Rated capacitance (in Farads, named after Micheal Faraday) 2) Manufacturing tolerance (in percentage of rated Farads) 3) Voltage (maximum) -- the highest voltage that can be applied without destroying the capacitor. 4) Temperature (primarily used only for electrolytic capacitors), typically this is related to (substantially below) the boiling point of the liquid electrolyte. A further property of capacitors is 'leakage' -- but this is largely a function of the type of capacitor and is not a 'rating' within given types. The combination of Farads and Voltage tells you how much electrical charge can be stored in the capacitor. Higher voltage capacitors (of similar type) will be physically larger than lower voltage capacitors.
H: 10 Lamps setup 220v ac, would it be safe? I am not an electrical engineering or anything, I am just a curious person trying things at my home for fun. I want to setup a lamp system for my sister's mirror where I would need to use 10 lamps from just one socket. I made a diagram of what I mean, all 10 lamps in parallel with an interrupter in between the plug. My biggest question is, would it be safe to do this connection? Is there a better way of doing it? I am scared of it not being safe since it's a lot of things on just one 220v ac plug. Each lamp is 3W A5 using the socket E24. AI: So your lamp draws 30mA, that is bugger all. Ten times that is 300mA, still bugger all. Even the smallest sizes of mains wiring will easilly carry that. Your main concerns here are making sure everything is well insulated and mechnically robust, not the current flow.
H: No output reading from Op Amp on Oscilloscope So I have an inverting op amp (gain = -1) wired up, and it works with a DC signal. I checked the DC signal by measuring the input and output voltages with a multimeter which were 5V and -5V, respectively. Now I hooked up a function generator to the input signal. The input is now 5V peak-to-peak at 1kHz. The input shows up fine on the oscilloscope, but that is because it is practically connected to the source of the generator. When I measure the output, nothing shows up on the oscilloscope (just a little bit of noise). I tried connecting the output to the virtual ground and then measure the output with the oscilloscope, but that didn't do anything. The op amp I am using is TL051CP. How am I not measuring it correctly? Solution So I guess the problem was my signal was grounded and that messed up the output. I just removed the ground from the circuit, and it is working fine. I don't know why it works when the signal is not grounded. I believe I was shorting the circuit with the oscilloscope, which caused this to happen. AI: There are two problems that could be causing grief, the first is the mode of the oscilloscope, the second is the ground of the oscilloscope. The first thing to do is validate your equipment, which you already did kind of. Make sure the oscilloscope is in DC mode, and measure a DC voltage. The probe may be capacitance coupled (in AC mode) which would explain that you can measure a 5V 1kHz square wave but not a DC signal. Measure a battery or power supply rail to make sure the oscilloscope is measuring correctly. Once you have measured DC signals then return to the op amp and make sure your oscilloscope ground is the same of the op amp. Edit: On most scopes the ground is connected to mains ground and not isolated, so if you connect a ground point to something that isn't ground (or a virtual ground that isn't isolated) then a short to earth ground will be created), check the point that you are grounding and make sure it's really ground. Another way to do this is to measure the voltage between the point you are connecting it to and the oscilloscope ground with a DMM. If it measures something more than a few 10's of mV you may have a problem.
H: 480v motor, running like a bat out of hell. I have a 480v motor that is connected to an auger. When the auger fills up, the torque from the motor continues to drive it and then just snaps the shaft clean in half. I am looking to build something that decreases power as the amp draw increases. Hopefully preventing the snapping of another shaft. I’m open to any thoughts and I’m pretty new to electronics. AI: If the motor does not already have an electronic speed controller, the only way to reduce the torque and speed is to add one. Assuming the motor is a three-phase induction motor, you need a variable frequency drive (VFD). The cost of a VFD will be significantly more than the cost of a motor. Before you buy a VFD, you should determine if there is something else that needs attention. Determine if the augur filling up is a normal or abnormal condition. Determine if something other than just filling up is contributing to the problem and whether or not that is a normal condition. Determine if the augur is suited to the material and conditions. Determine if the motor and mechanical drive train is suitable for the augur, material and conditions. If the condition that caused the shaft to break is something that happens only occasionally under abnormal conditions, a mechanical or electrical means of shutting down the motor and or disconnecting the drive train may be suitable. Make a sketch of the equipment, motor, drive train, augur, infeed system, outfield system etc. Note down all of the relevant dimensions and ratings. If there is a VFD, it should be simple to adjust the current or torque limit. Note that limiting the motor torque will likely result in the motor stopping when the problematic condition occurs. Limiting the torque will reduce the speed, but it is not the nature of an auger to require significantly less torque to operate at a lower speed.
H: Is it normal for the OC2 vacuum tubes to glow bright orange during operation & OA2 to flicker while running? I just got this vintage Heathkit IO-10 oscilloscope from ebay. Just tried powering it up and it seems to be working fine. But I noticed that the OC2 tube seems to glow very bright orange and the OA2 glows purple and works fine. Occasionally there is flickering in the OA2 tube as shown in the video. Is this normal for both the tubes? I've added a video to help understand better. https://youtu.be/SlazPn6tTwo Also I've a question regarding replacing the two can electrolytic capacitors. Can the first cap be replaced with a 250V- 100MFD and the second one with 450v-68MFD? First capacitor: 150V-100MFD(3 caps in one) Second capacitor:400V-350V-250V-150V - 40-40-30-40MFD(4caps in one) AI: It is normal for these gas voltage regulator tubes to glow. The OC2 and OA2 are not vacuum tubes, but are filled with low-pressure neon (OC2) and argon (OA2). They operate in the glow discharge region, where a very small increase in voltage causes a large current increase. The tubes should glow steadily, however, rather than flicker. As the regulator ages, the pressure drops as gas is adsorbed onto the electrodes, and even onto the glass shell through sputtering. As pressure drops, the glow discharge voltage increases. The flickering indicates either that the OA2 has aged, or that the old electrolytic capacitors are a bit leaky and the power supply cannot reach it's intended voltage. As you suggest, the electrolytics age poorly and should probably be replaced. Using a slightly higher voltage rating than the OEM is a good idea, and 250 VDC for a 150 VDC unit is fine. Slightly exceeding the capacitance is also acceptable, but too large a capacitor could draw too much on startup, eventually damaging the rectifier. Don't replace a multi-section capacitor with a single one, since each section is part of an R-C multi-stage filter and voltage divider. You can use a separate modern electrolytic for each section. The higher-voltage unit's negative connects to chassis ground, according to the schematic below, but the dual 150 VDC unit appears to be floating, so be careful placing that replacement so it doesn't contact ground. BTW, some rebuilders of vintage equipment put smaller new capacitors inside the aluminum shell of the old one for appearance, but there's no need to do so. Once capacitors have been replaced, check the voltages at the test-points above the capacitors. If all is within tolerance, and the OA2 is no longer flickering, enjoy using the oscilloscope! However, if the tube still flickers and the voltage at pin 1 of the OA2 is a bit high, you'll need to replace the tube or use a 150 VDC Zener diode. Caveat Use care with the high voltage, and use safety glasses -- should a vacuum tube shatter, particularly the CRT, glass goes flying at the speed of sound.
H: Heating a tube of aluminium electrically I need to regulate the temperature of the surface of a tube of aluminium. The tube is used as a mandrel for composite molding/curing, so the target temperature is below 100C. Currently, there is no type of heating element attached to the tube. I have done a little bit of research, and these are some of the possibilities I found: Peltier module. Its hot side would be glued with thermal grease to some areas of the tube, the cold side would be brought to room temperature with a heatsink + fan. Resistive heating element. Nichrome wire would be wrapped around the tube and heat it by thermal conductivity. However, it seems to be challenging to electrically isolate the wire from the aluminium tube. Joule-heating the tube. Voltage between the extremities of the tube would heat it by Joule effect. The problem is the current requirement is huge, since the tube resistance is low. Hot air. It is simple to setup up with a fan and heating elements, but the heating would not be uniform due to convection currents. I am looking to some answers about: The Peltier module is widely used to cooling applications, do they have a down-side when used the opposite way, to heat things up? Could the nichrome wire be isolated electrically but not thermically easily? Would it be easier to switch to a steel tube and heat it by induction? By coiling the tube and applying AC current? AI: If you need temperature uniformity along the tube surface, your most reasonable choice is #2 - wirewound resistive heater. Peltier cooler is absolutely out of question, mostly due to their standard geometry is not tubular. Hot air will have entry and exit points and there will be always an inherent temperature gradient. In case of resistive heater, the insulation is not a problem in this temperature range, even any kapton tape will do the job. Temperature sensor could be the wire itself, if proper material is used. Direct tube heating is also doable. ADDENDUM: I was under a false assumption that the material to be heated is inside the tube. It appears that the hot tube (1000 mm x 70mm dia.) is used to form and cure some plastic sheeting outside the tube. In this case the tube is better to be heated from inside with any shape of resistive wires or other electric heat elements, and maybe filled by sand to provide an even distribution of heat. The details will depend on expected heat losses across the external surface. Obviously a layer of wires over the external tube surface will be prone to mechanical wear, and the tube surface would be a good protector if the heater elements are placed inside.
H: How to test for USB dropouts on STM32F? I've got a devices that is really strange, it drops USB periodically. By periodically I mean on a weekly (or biweekly) basis. By dropping out I mean windows loses the handle to the driver. Dropouts a not tolerated well by those using the devices. The weird thing is I use a similar design on most of the products that we have (more on that later), for some reason this one doesn't want to play nicely, some of the other devices run for months to years (with the same design but different layout) with zero issues. It's only on some of the devices so that probably rules out firmware/software. The USB is 2.0 FS, running to an STM32, with an ESD diode chip in the middle. Schematic (D+ and D- and OSC_IN and OSC_OUT (oscillator design was inherited) go to their corresponding pins) A better question would be, how do I test for these dropouts? Is there some method that could monitor a device for very long periods of time with millions of packets going by and find the source of the error? AI: Is there some method that could monitor a device for very long periods of time with millions of packets going by and find the source of the error? Yes. The device is called "USB protocol analyzer". If you monitor only the host software side, the maximum you can see is that there was some "transaction error", and the port can or can't recover after dropping. USB protocol has hardware-assisted means to re-try failing transactions, and software doesn't have any visibility into "error count". So you need to identify the root cause of the error at physical level, on D+/D- wires. There are affordable USB analyzers, especially for USB 1.1 (FS 12 Mbps) rate. A good analyzer can be set for a sophisticated trigger while monitoring traffic in a long loop, or even recording the entire traffic up to capacity of your hard drive. I would recommend a small Teledyne/Lecroy model Mercury T2, but other guys like Ellisys and Totalphase Beagle are getting better and better. However you need to be careful, since the analyzers are somewhat invasive, and their connectors/internals do have some effect on signal integrity. In case of flaky connection and rare error rate the analyzer can either improve the signal (and you might never see the problem) or can kill the link functionality (which will helpful to pinpoint the problem). So in short you need to identify who is at fault when the device drop happens. It could be (a) device makes wrong responses to a valid USB protocol, (b) channel signal integrity problem, or (c) host hardware has a bug in handling some peculiarities of USB protocol. I would start with (b) and check if all signals on the bus meet basic USB signal specifications: pattern frequency within 2000 ppm, jitter within the norm, signal edges are monotonic, and signal eye meet the diagram mask, all over your specific cables, devices, and hosts. There are standard procedures described in USB-IF website how to perform the electrical tests within USB compliance program. If the signals meet basic FS signal specifications, the Protocol analyzer would be the next thing to deploy. If might be challenging to set up proper trigger and have correct interpretation of bus events leading to error. If you don't have experience with USB analyzers, you might need to take some training or get a consultant.
H: Getting garbage output in serial monitor while communicating with OBD using CAN interface (MCP2515) and nodemcu I am doing a project which involves getting vehicle speed from a car's OBD port and storing it in my database using nodemcu. I am programming nodemcu using the Arduino IDE and using this library for working with CAN. Here is a simple example program which I am trying to test, but I am getting garbage output on the serial monitor: #include <SPI.h> #include "mcp_can.h" INT32U canId = 0x000; unsigned char buf[8]; char str[20]; MCP_CAN CAN0(10); void setup() { Serial.begin(38400); START_INIT: if(CAN_OK == CAN0.begin(MCP_ANY, CAN_125KBPS, MCP_80MHZ)) { Serial.println("Initialized successfully"); } else { Serial.println("Initializing is failed"); Serial.println("Reloading..."); delay(100); goto START_INIT; } } void loop() { INT8U len=8; if(CAN_MSGAVAIL == CAN0.checkReceive()) { CAN0.readMsgBuf(&canId,&len, buf); Serial.print("<");Serial.print(canId);Serial.print(","); for(int i = 0; i<len; i++) { Serial.print(buf[i]);Serial.print(","); } Serial.print(">"); Serial.println(); } } My speculations: A CAN ID can differ from car to car. If so how do I know CAN ID of my car? (It is Maruti Suzuki Ertiga) The baudrate which I am using maybe wrong The frequency or the kbps I am using in the function call CAN0.begin(MCP_ANY, CAN_125KBPS, MCP_80MHZ) maybe wrong. If any of the above mentioned points are wrong, then how do I know/what are the correct values? AI: Regarding your speculations: As mentioned by @Alexander von Wernherr in his comment, there is not one CAN ID related to your car, but a number of different CAN Frames with individual CAN ID. However, the loop part of your program already takes care to read all of them and prints them out. So this is not the Problem here. Do you see the printout Initialized successfully or Initializing is failed on your serial terminal? If not, your baudrate of 38400 is wrong. Please consult the documentation of the MCP2515 for the correct value. The frequency you set needs to fit to the Hardware you use. In the link you shared, they are talking about using MCP_16MHZ for the MCP2515. So maybe this is the issue. Again, please check the documentation of the MCP2515. The bitrate of the CAN interface is determined by the car manufacturer. Either you have to get this number from some documentation or you simply try the most common bitrate values , e.g. CAN_125KBPS, CAN_250KBPS, CAN_500KBPS. Finally, if all of those are set correctly, you will see the individual bytes of each CAN frame. However, then you still need to reverse engineer yourself, which CAN frame contains what information and how is it encoded inside the data bytes.
H: Average Current vs Arithmetic Average I am just starting to learn the theory of electronics. Coming from a probability and statistics background I have a very deeply ingrained idea of the term average. The average to me is the Arithmetic Mean. In other words, if I was to take a sample from whatever data I calculated my mean from I have a pretty good chance of seeing a value near the mean. It seems this definition is not the same in electrical engineering. The average current is defined by the change in charge over the change in time. This is similar to the physical velocity. But there is no averaging here being done at all, is there? You aren't summing anything in the numerator, instead you are dividing the change in charge by the change in time. This would give you the amount of charge changed per unit time. Imagine I was to draw a charge value from a list of charge values measured from a circuit. If I naively assumed average meant the above I would expected any given charge measurement to be dispersed somewhere near the value there. However, in reality the Average Charge defines the slope of a line. How can I reconcile these two things so I can really understand what average means here? EDIT: After sitting with paper for a while justifying it to myself there is a single case that confuses me: Let's use this data set: Q = [0, 1, 2, 3, 4] t = [0, 1, 2, 3, 4] and we have the following data points (0, 0), (1, 1), (2, 3), (3, 2), (4, 4) Finding the average current between t = 0 and t = 4 is: 4 - 0 / 4 - 0 = 1 C/s = 1A However, using arithmetic mean: 1/5 * (0 + 1 + 3 + 2 + 4) = 2A. The final value at time t = 4 where Q = 4 is throwing the calculation off. AI: Current is rate of change of charge with respect to time. Your example shows that charge changes 1 coulomb per second therefore the current is 1 amp. When you integrate (sum) the charge values you get 10 (1 + 2 + 3 + 4). Taking that value of ten and calculating the mean (by dividing by 5) tells you that the average charge was 2 coulombs, it doesn't tell you what the current is.
H: Area under curve within a particular time window I am trying to make an analog circuit which would measure the area under the curve of a periodic signal within a certain time window (say, t2 and t3 in the image). I expect different voltages(say 50-500 mV) within that particular time (say 100 us) and want to compare the area in that interval with a threshold value later. I think an integrator should be suitable for the purpose, where after providing a cumulative value during the particular time, it will reset to zero. Is the idea correct and if yes how to design the circuit? P.S. This is my first post. I hope the info is adequate. If not please let me know, I will add whatever is required. Edit 1: Just to be even more clear. These are the envelopes of the two signals I am dealing with. The intial part of the signals are the same. Then the voltage changes for a certain time and it decays to zero. I am trying to compare these two. AI: The sampling can be acheived using sample / hold circuit. Since you don't want to hold anything, then you don't need a hold capacitor. Then you pass the output of S/H circuit to the integrator circuit. So youshould have Sample->Integrate->Hold (evaluate result)->Reset,.... S/H Integrate/Reset EDIT: A good example: https://digi.lib.ttu.ee/i/file.php?DLID=7459&t=1 http://www.ti.com/lit/ds/sbfs003/sbfs003.pdf Keep in mind that you need an extra inverting op-amp if you need a positive voltge output.
H: Non-inverting op-amp configuration with capacitor I don't really get what is the purpose of the capacitor C1 which is connected in parallel with the feedback resistor. After my knowledge, if we modify the input signal frequency the over all gain will modify accordingly because of the impedance of the capacitor which effects the feedback resistence. A lot of times I hear that it's useful for stability but I don't get why and how to calculate its value. Is it related to the fact that after a certain frequency the op-amp can cause lagging phase shifts and the capacitor prevents this? If so, why is that? Thanks in advance. AI: A lot of times I hear that it's useful for stability but I don't get why and how to calculate it's value. Consider that the non-inverting pin might have a parasitic capacitance of maybe 4 pF. That's the pin itself, the resistor parasites and any copper capacitance all lumped together. That 4 pF is in parallel with the 10 kohm resistor and its presence will start to increase circuit gain at about 3.98 MHz. If you have a slow op-amp that isn't expected to run at close to that frequency then don't worry about it; you don't need to consider adding a feedback capacitor either but, if you have a fast op-amp and you expect decent flat performance beyond several MHz, then that's the time to worry about calculating the capacitor in parallel with your 91 kohm. Your capacitive reactance needs to be in balance with the resistor it is across hence, for a 91 kohm (and assuming 4 pF at the input across the 10 kohm) you would consider a capacitor of value 4 pF x 10/91 = 0.439 pF. Alternatively you might lower the resistance values by 10 and push the problem away from the low MHz to the tens of MHz at which point your op-amp may have run out of steam. If it hasn't ran out of steam then you might pick a suitable feedback capacitor.
H: Mega2560 master on RS485 bus stops communicating with VFD when I add another RS485 module I’m doing a project where I’m building a control panel for a VFD (inverter/variable frequency drive). I’m connecting the two over half duplex RS485 and use Modbus RTU. As a master I use a Arduino Mega 2560 with a TTL to RS485 module. Yes the VFD and the Mega are correct baud rates (9600) and pairity (8N1), it works if the master and VFD are the only devices on the bus. But when I add another slave (Arduino nano) with this TTL to RS485 module (even without a microcontroller nad no code) the communications seems to be broken. I’m using a shielded twisted pair wire of about 3 metres to a circuit board daisy-chaining the module for the nano (10cm) and the VFD (1 meter). What did I try? I started with the mega as master, nano as slave, and the VFD as slave. Because I did not know the extra module on the bus was causing the problem at this point I was wondering if it was my code or hardware setup. I’ve read multiple topics of people having trouble with the Mega and the RS485 module but never got to the exact problem or a solution. I need the mega for the scale of my control panel so I kept digging. About code I use modbusmaster (see example of halfduplex on the github) and then just 2 lines of code writing to single register (0x2000, 0x0006 for example) just as a simple test to start/stop the VFD. Worked before when testing the VFD and an UNO as the only two devices on the bus, why not now? The nano slave does not have any code at this point to rule out any software issues interfering. I tried flushing as well, did not solve the problem. Back to hardware troubleshooting So I tried the same setup with another nano as a master instead of the mega (leaving the other nano as slave connected). It works! But I need the Mega… So I started looking into things. I tried hardware serial, altserial and softwareserial. None worked. Then I started questioning the lines, nothing that was having short-circuits or big interference (doing this in my living room, not on an industrial site). When I pulled out the module for the nano slave and it started to work with mega as master and the VFD as only slave connected.But hell why, I need the nano slave to be on the bus as well! Trying termination resistors So I desoldered R5 to R7 (termination resistors) of the extra module, which helps for some people. Leaving the module of the mega as is. Same situation, communication is fine until I drop in the module for my nano slave. Making the nano slave repeat works??! I also experimented with the communication between the mega master and the nano slave, that works! But the VFD will not listen to the master. When I programmed the nano slave to repeat what it hears (yes, like a parrot) then the VFD is responding correct with the setup I want (master, VFD slave, nano slave). But the nano slave should not be the one acting as a master, let alone repeat a message on the bus. The weird thing here is, the VFD is not responding to the message of the master, but the nano picks it up and is able to repeat it so the communication IS correct somehow, but not good enough for the VFD?? I'm really freaking out now.. I can't sleep anymore! please help. Other ideas I do admit, I have grounded the shield of the 3 meter cable on both ends, but this should not be the problem, it works with just a master and the VFD as slave setup so why not when adding another module for the nano as slave. The line is now measuring 120 ohm resistance (comes from the TTL to RS485 module on the Arduino Mega side). The VFD has a jumper, on position is 18,2 kOhm and off position is 500 ohm. Due to the parallel connection no matter what position the line resistance between A and B stays on or around 120 ohm. The problem just occurs when attaching the extra module for the nano slave, even when I leave out the slave itself. Anyone out there who might be able to help me troubleshooting this? Anything I don’t know of? (Yes my first RS485/Modbus application, but doing good so far I guess). Should I desolder the termination resistors of the other module as well? Any other ideas on why the communication would be broken when I throw in another module? If anything is unclear, please tell me. I tried my best to clarify the setup and what I tried. Again, code does not seem to be an issue here. UPDATE schematic of the converter Hope this helps AI: You (or whoever made this dubious module) have erroneously wired the transmit enable pin with a pullup resistor. Without code configuring a corresponding MCU pin as an output and driving it low, that RS485 transceiver will jam the bus. You should correct your schematic symbol to show the logical sense of the enables - DE is active high and /RE is active low. Then change your circuit to default them safely. If you're going to keep using this defective module as is, you'll have to be sure that the DE pin is always kept low, except at the proper time for that node to transmit.
H: What is the procedure for going from discovery board to a deployable solution? Just to clarify with some context: This voice based keyword detection requires an mbed discovery board; and I am sure some min flash size. Even for a hobby project, i.e. personal home automation, putting several discovery boards in various rooms is costly and not ideal. When answering the question, please consider the following two use cases: 1) What do business do for going from PoC to production? 2) What would hobbyists do that is similar to a business but on a smaller scale of course? AI: You first make a list of the components that you have used on the discovery board and how they are attached to the microcontroller - i.e. power supply, LCD, buttons, LEDs, I/O ports. Then you design a custom board that replicates the functionality of the stuff on your list and attaches the components to the controller in the same way. And you leave out stuff you didn't use, of course - if your discovery board has an SD card slot, for example, and your design doesn't use it, you don't need to put an SD card slot on your production board. As a hobbyist, you do exactly the same as a business. Getting a PCB manufactured isn't that expensive anymore. (It might be more expensive than a bunch of discovery boards, however, depending on how many you need.) TL;DR: Develop on the discovery board that has all the features / components you could possibly need, then trim it down to only the stuff you really need on your production board.
H: Enhancing TVS diode circuit I was reading into Electromagnetic Compatibility Engineering by Henry W. Ott about ESD protections and I was interested by the following part. First, a series resistor (or ferrite) added in front of the diodes to limit the magnitude of the ESD current, and second, additional bulk capacitance (5 to 50 mF) added across the power supply rails. Both of these approaches are shown in Fig. 15-18B This picture reminded me of the schematics seen inside a TVS Diode. The TVS diodes I am using up till now are the TVS DIODE (würth 8240116) Can the shown figure actually be compared to a TVS diode? If so, can the functionality of TVS diodes be improved by adding the current limiting series resistance and a bulk capacitance? Why aren't any of these improvements suggested in the datasheet just like decoupling or bypass capacitors are recommended in every IC datasheet? AI: Can the shown figure actually be compared to a TVS diode? A TVS has a similar function as two regular diodes, but the ESD current can be shunted to ground instead of one of the rails. The diagram above is mainly for overcurrent\overvoltage protection. A TVS has a higher breakdown voltage which is mainly useful for very high voltages such as those from ESD. You probably wouldn't want the ESD spike ending up on your power rails, even with a limiting resistor, so a port to the outside world should have TVS diodes close to the entrance of the input to the board to shunt the currents directly to ground. Source: https://www.slideshare.net/KevinDuke/aodesignprotection2015nonda If so, can the functionality of TVS diodes be improved by adding the current limiting series resistance and a bulk capacitance? See this answer TVS diode before or behind resistor : You have three components there that are all there for protecting the AVR, but all are doing a different job. The resistor is there to stop steady state high voltages. The capacitor is to remove ripple/RF/slow transients. The TVS is to suppress fast transients. In order to get the best out of your protection, you need to have the shortest (lowest inductance) path back for the fast transient impulses (such as ESD). To do this, you fit the TVS (the fastest responding device) as close to the input to the board as possible. The capacitor would then be a bit further in (depending on the layout and design) and the resistor (which only deals with very slow, or steady state situations) can pretty much be on the pin of the AVR Why aren't any of these improvements suggested in the datasheet just like decoupling or bypass capacitors are recommended in every IC datasheet? Because the IC datasheets don't know what the designer is going to connect the ports to. Most IC pins are connected internally on the board, and don't require extra protection. They do specify what not to do to the IC in the absolute maximum ratings section and in the ratings section for different pins. To provide this information on every datasheet would provide too much information. This information is provided in the form of app notes as it applies to many different IC's Analog: Solving IEC System Protection for Analog Inputs and Using ESD Diodes as Voltage Clamps TI: http://www.ti.com/interface/circuit-protection/esd-protection-and-tvs-surge-diodes/technical-documents.html ST micro: https://www.st.com/content/st_com/en/support/resources/resource-selector.html?querycriteria=productId=CL1137$resourceCategory=technical_literature$resourceType=application_note
H: why do the electronic transformers that i remove from circuit boards keep exploding when connected to a 230v main for the past 3 months I have removed several transformers from PCBs to try and use it for a different purpose ,but as I connect it to a 230v main supply they just keep exploding . I don't think my problem is that I'm using the wrong terminals , frequency or voltage because the transformer came from a circuit using exactly 230 volts .Can someone please explain to me what am I doing wrong . AI: Assuming you are talking about the ones from switch mode power supplies (tiny things), they don't run at 50Hz, the run at several tens of kHz. In SMPS's, the mains is rectified to DC then switched through the transformer at a much higher frequency. This allows for physically smaller transformers. If you connect one straight to the mains, you'll be running it at much lower frequency than it is rated for at that voltage, and hence orders of magnitude higher current than it's rated for (remember, inductor impedance is directly proportional to frequency). The net result is bang. The moral really is don't try to wire up any component without reading it's datasheet. If you don't have a datasheet, don't use it.
H: Testing hot side of smps circuit with simple secondary loads Goal: Testing hot side of SMPS independently of the cold /feedback circuit I tested the Mosfet on the hot side of SMPS along with the rest of the circuit ( snubber circuit, bleeder, etc - not shown) by connecting to a resistive load in place of the pulse transformer and the oscilloscope verifies that it worked as planned. Since I am testing with open loop circuit the feedback circuit is not important at the moment. Now I want to connect the Xmer . For the flyback system to work correctly I should connect some load on the secondary windings ( true ?) , but since I don't know the condition of the cold side I rather like to connect some load ( bulbs may be) directly to the secondary coils ( rectifier - filter - load would have been ideal I want short cut - this bad idea ?) Q1 How to ensure that the energies from the transformer is correctly drain by the secondary loads? Q2 What will be example of simple loads on the secondary? Q3 Is loading all the secondary tapings essential? AI: You cannot have load when the forthcoming pulse is under charging to the magnetic field of the transformer - a diode is obligatory to prevent current in the secondary when the switch is conducting. You have a growing current ramp in the primary during the magnetic energy charging period. Switching the mosfet off causes as high voltage to occur in all windings as is needed to let the current continue in some of the windings. This is the flyback pulse. You need so low resistance load that the voltage rating of the mosfet nor the transformer windings aren't exceeded. If your transformer is 1:1, the output peak current is the same as there was built up in the primary when the mosfet was turned off. If your secondary in use has only half of the number of turns in primary, the peak current in the output is the max primary current doubled. To keep your mosfet in safe, you must use so short ON period of the mosfet that the primary current do not exceed the allowed max peak current of the mosfet. I1max=Uin*Ton/L1 where L1=primary inductance use so long OFF period of the mosfet that the transformer current surely has been died before a new ON state. Wait at least 10*L2/R where L2 is the inductance of the used secondary winding and R is the load resistance. have a mosfet which stands the input DC voltage plus the flyback pulse voltage calculated of the peak current of the secondary, the load resistance and the winding ratio. have such high gate drive capablity that the mosfet turns OFF reasonably fast to prevent it heating due the losses have a high enough capacity transformer core which doesn't get saturated with the max primary current. Saturated core = a short circuit have so low stray inductances that they do not cause serious overvoltages. You can have 2 zener diodes in series head against head in parallel with the primary. One prevents the input voltage short circuit and the other eats the exessive flyback pulse voltage caused by stray inductance (calculate the expected voltage!) Zener diode turns the overvoltage to losses in the diode. Then measure the input current pulse and the output voltage pulse with the oscilloscope. Calculate the pulse energies to see how much is lost. There's no need to run more than one pulse if you have a proper memory oscilloscope. If you have not an oscilloscope with proper bandwidth (say 50MHz or more) and high voltage probes, this task can be a little too much. Lamps are not good test loads because their resistance is highly varying. Cold filament can have only 15% of the resistance of the same filament as hot. Use a resistor and keep pulses so sparse that you do not burn it.
H: Loudspeaker / Amplifier "POPP" sound I have different sound systems here. Some of them share the "problem" that they make a "popp" sound when I switch them on or off using the front-panel switch. If I accidentally switch off the socket they are plugged in, it's a very loud "popp" or more a "bang". I know that some audio systems implement a soft-start circuit to overcome that problem. I can hear some relays click a few seconds after I switch the amplifier on, and from that moment on I can hear the music. My questions: 1) Does that normal popp after front-panel switching harm the loudspeaker? 2) Does an accidental power-off, which causes that "bang", harm the loudspeaker or some circuits? 3) How should one implement a protective circuit? Is it sufficient to set up a delay-circuit which controls some relays on the output of the amplifier circuit, or is it better to do it in "stages", e.g. first let the supply start, then give power to the amp and in the end switch on the loudspeaker itself? Best wishes and thanks for your time in advance. AI: These question may be better suited to the Sound Design Stack Exchange and should probably be broken into two separate questions; but here's my take. In short, yes the pop or bang you hear can damage loudspeaker, especially high frequency drivers that are usually rated at a lower wattage handling capacity. It is not the power being suddenly turned off, but the instantaneous surge that is supplied to the loudspeaker drivers that can be damaging. While you could relay the speaker cables to disconnect them, typically professional sound systems use a sequencer to power on the amplifiers last after the front end equipment is powered on and turn them off first to avoid these pops produced when the front end equipment is shut down. There are commercially available power sequencing systems from Furman, Tripp Lite, SurgeX, Lowell or other companies you should be able to search for.
H: Identifying mystery dual channel opto detector? How do I identify if a component is a photo diode or photo transistor? I have a three lead component removed from an old mouse where it was used to do quadrature encoding of the scroll wheel (a normal side facing IR LED was illuminating other side of the wheel) - presumably it houses two photo detectors side by side to distinguish which direction the wheel was being turned. What tests can I do to determine if it is a photo-transistor or photo-diode and appropriate parameters to drive it? I would like to re-purpose this for a micro-controller project I'm working on. Only markings on the package is "H6.26" on the back and 'EL' on the top. Close up of the component - sorry, best I can do with 4am shed lighting In situ view - placed back from whence it came Managed to trace the two outer pins directly to separate pins on an unidentifiable micro-controller - (each trace is well below 1 Ohm). As for the middle pin it connects through a 10 Ohm resistor to I don't know where AI: Photodiode is a diode, phototransistor is a transistor. So take a DMM and measure diode forward voltage between all pins. If it's a diode, you will find one, if a transistor- two. I wonder what will you do with this information.
H: Understanding EOS SUBCKT behavior I'm trying to modify an op amp to simulate its worst case behavior at end of life. In the common mode effect section of the LM124/NS I have the following EOS 7 1 POLY(1) 16 49 1E-3 1 What is the function of EOS? I've been searching online for some information about what it does but to no avail. Thanks AI: It is a voltage dependent input offset source The offset voltage-source, Eos, provides a supply voltage dependent input offset voltage and reflects the error voltages from the power supply rejection ratio stage, the thermal effect stage, and the noise-voltage source. Below is a diagram of the Eos polynomial-source and the effects that correspond to each term. From: AN-840 Development of an Extensive SPICE Macromodel for "Current Feedback" Amplifiers
H: quartz tuning fork and its series and parallel resonances Based on the explanation here, I understand that if you electrically drive a tuning fork, you would first see a peak (resonance) and dip (antiresonance). I just tested the frequency response of a tuning fork, which was designed with 10pF load capacitance in mind. I excited the tuning fork with and without a 10pF capacitor. I noticed the frequency position of the resonance did not change but the frequency position of the antiresonance increased, as would be expected from the wikipedia page linked above. My question is the following: why do companies make the quartz tuning forks such that the tuning fork has antiresonance frequency of 32768Hz with the appropriate value of load capacitance? Antiresonance shows up as a slight asymmetry in your amplitude plot, as can been seen in the black curve in the image below (B). Why wouldn't they design it such that the peak (resonance, marked as A in the image) is at the frequency of 32768Hz? The resonance is definitely more pronounced than the asymmetry (antiresonance). Plus, it has the benefit of the frequency not changing due to load capacitance. P.S. I just added screenshots of the plot of my actual measurement. You can see that the amplitude peaks at its series resonant frequency (also note the slight asymmetry) Also note the dip of the parallel resonant frequency on log scale, and note the circuit diagram added. AI: Your plots are not accounting for the impedances in circuit, you are just viewing it from the series resistance perspective. From the oscillators in circuit perspective parallel resonance is sharp. Series resonance is not commonly used, because it requires an inductor in the oscillator circuit to cancel out the electrode capacitance of the crystal. The simplest and cheapest oscillator circuits don't use an inductor, they use capacitors, and thus must be in parallel resonance. (the crystal is operated in the inductive region) Series resonance is commonly used for overtone oscillators, as without an LC filter, the oscillator will usually prefer the fundamental. Note that manufacturers can't/don't "make" the crystal for either resonance. All they can do is tune the crystal to frequency at a specified load capacitance. The crystal is identical, and oscillates the same. (just off frequency of you use different load C.) In series resonance signal passes through the crystal. In parallel resonance, it is blocked. Which you see depends on how your test circuit is arranged. simulate this circuit – Schematic created using CircuitLab
H: AREF Voltage same as VDD but through a reference IC My project has 9V and 3.3V on the board. I would like to use a precision voltage reference IC for the analog reference on the MCU (MCU powered by 3.3V). The precision of the voltage reference IC is 0.5%, which is more precise than the 3.3V regulated output voltage from the regulator powering the MCU. The datasheet for the MCU says the AREF High voltage should never exceed the VDD. In an ideal world, the voltage of the reference IC and the voltage from the switching regulator would both be exactly 3.3V. However, I am nervous of the real world possibility that the reference IC, with its high precision, will be a higher voltage that the VDD. For example, the reference IC could output 3.29V and the regulated voltage could end up being 3.22V. Is this enough to cause a problem? Or is this small of a difference negligible? My alternative option would be to use a reference voltage of 3.0V and guarantee the reference voltage will ALWAYS be below the regulated 3.3V, However, it is easier to voltage clamp 3.3 volts as a ceiling for the analog inputs since I already have a 3.3V plane on the board. Or would it be possible to use a 3V reference and still clamp to the 3.3V plane? According to the datasheet, the analog input voltage cannot exceed the reference voltage :( but IDK why... Shouldn't the ADC value just max out at anything above the reference voltage? Obviously going above the 3.3V could cause damage... Any thoughts are appreciated! AI: There is usually a 0.2V margin for CMOS inputs outside the rails and a low current limit for Precision voltage references. But in your case only 0.1V for ADC input. https://www.digikey.com/product-detail/en/texas-instruments/LM4128BMF-3-3-NOPB/LM4128BMF-3-3-NOPBTR-ND/1284497 0.1% 20mA. 3.3V. $1 (1 pc) Further protection could be done with enable output parts and low Vdd detect circuits, if you are unsure or check load current and add RC additional current limits/ filter to Vref to reduce to 5mA. You could also consider 3.0V Vref regulator and Sch. Diode clamp to 3.3V. or better yet use a 16 bit ADC with an internal Vref.
H: How To Reassign The MISO Pin? So I have a PCB with an LCD hooked up along with a 595 shift register. Unfortunately, when I designed the board I didn't realize that the LCD library used SPI, which on the Arduino Uno is pins 13-10. Therefore, the system overrides the pin 12 for the DHT and it returns nan. The LCD library I used is here: https://playground.arduino.cc/Main/LiquidCrystal I've tried modifying the pins_arduino.h on line 40 to set the MISO pin to something else. When I debug the MISO value with serial it prints the value I set it to, however it has no effect on the DHT (still returns nan). So I'm in a sticky situation because literally every single pin is in use except for 0 and 1, and I've everything is kind of set because I've already made my PCB. Is it even possible to change the MISO pin, if so, am I going about it the right way? AI: How To Reassign The MISO Pin? You can't. The ATmega328P used on the Arduino Uno only has one SPI peripheral, and its I/O pins cannot be reassigned. As long as the SPI peripheral is active, pin PB4 (pin 12 on the Arduino Uno) is forced to act as an input, regardless of any other configuration on the device. This means that you will need to temporarily deactivate the SPI peripheral while you are communicating with the DHT sensor. The easiest way of doing this will be to call SPI.end() before communicating with the sensor, then calling SPI.begin() afterwards to return the SPI peripheral to its previous state. Alternatively, you may want to consider using different hardware to reduce your pin congestion. In particular, if you can make the A4 and A5 pins available, you could replace the HD44780 display and DHT temperature sensor with I2C equivalents.
H: Essential Prime Implicant While solving this question using Quine–McCluskey algorithm , I am getting total EPIs as 3 but by definition , it is giving 2 EPIs. I am attaching both solutions. Please correct me where I am wrong. AI: A prime implicant is only essential if no other prime implicants can 'cover' its outputs. As you pointed out, the only prime implicants that fit this definition are the ones in the corners. The ones in the middle can be covered both by the square and by the two horizontal rectangles. So the answer is two.
H: SWD AHB-AP access gives ACK_FAULT When attempting to debug a STM32L471RGT6 chip over SWD, I encounter an ACK_FAULT whenever sending an AP request to halt the core. I've implemented the following sequences which all work correctly, getting an ACK_OK for every relevant DP/AP request: Select SW-DP on the SWJ-DP interface Assert the IDCODE value on the debug port Set the CxxxPWRUPREQ bits on the CTRL/STATUS register and assert the respective ACKs Assert the IDR register value on the AHB-AP The next step is to halt the core, enable halt-on-reset, and reset the core to get it into a known state to reprogram the flash memory. When I send the halt command by writing 0xA05F0003 (DBGKEY | C_HALT | C_DEBUGEN) to 0xE000EDF0 (DHCSR register in AHB-AP), I get an ACK_OK. But then, when attempting to read that same register to check the S_HALT bit, instead of an ACK_WAIT or ACK_OK like I was expecting, I get an ACK_FAULT (0b001 LSB). I retried the entire initialization sequence, but instead, reading the CTRL/STATUS register on the debug port immediately after the AP request to halt the core, and the STICKYERR flag is indeed set. Does anyone know why this AP request is faulting and how to resolve it? AI: The issue I found out was when I wrote to the CSW register to configure the access field-size in AHB-AP, I inadvertently cleared the MasterType[29], Hprot1[25], Res1[24] and DbgStatus[6] bits documented in the Cortex-M series cores. My mistake was using only the ARM Debug Interface Specification as reference for the CSW register, which does not contain documentation on these AHB-AP implementation-specific bits for the Cortex-M series cores. In the ARM Debug Interface Specification, it documents the DeviceEn[6] bit as read-only rather than implementation-specific read/write access, and does not elaborate on the implementation-specific bits reserved in [30:24]. I confirmed that this was the problem when I used an oscilloscope to inspect the data phase of the first CSW write request from a SEGGER programmer connected to the same board and found that it wrote 0x23000052, which is MasterType[29] = 0b1 Hprot1[25] = 0b1 Reserved[24] = 0b1 DbgStatus[6] = 0b1 AddrInc[5:4] = 0b01 Size[2:0] = 0b010
H: Cole-cole plot curve collapses when trying to alter the valule of horisontal axis I am a beginner and trying to simulate a cole-cole plot of a simple parallel circuit having two R, one coil and a capacitor. Image attaced, LTspice version is XVII, pc is windows7. I've read this Q-A;[Bode plot graph: Frequency vs. Angular frequency] Bode plot graph: Frequency vs. Angular frequency but things does not seem to be the same. When I checked out the current for R1, the graph goes well. So altered this curve from R2 to 1V/I(R2) as shown in this image in the upper left. Then altered the vertical values; 85dB to -85dB, with the tick 5db, and clicked Nyquist. This seems works goo. But when I alter the horizontal value; o.oohms - 1Mohms, the curve collapses. Any tips will be very much appreciated, thanks! p.s.; Incidentally I tried turned off [Autoranging], but the results was the same... AI: LTspice doesn't have ohms, farads, etc, in the schematic editor, all it has is units, and they are case insensitive. That is, m stands for milli (1e-3), and so does M. So what you have is a step from 1 to 1e-3. So do not bother adding ohm, it has no effect, you can just write .ac oct 50 1 1meg. Also, LTspiceXVII orders the stepped values in increasing order, but I don't know if this also applies to .AC directives.
H: Need help understanding an universal pin driver schematic I was studying a schematic of an universal 48-pin device programmer, and while most of it seems pretty straightforward to me, I have trouble understanding the reasons behind some of the decisions made by the original author for the pin driver circuit. Below is the block diagram of the programmer: Combined schematic for a single pin looks like this: simulate this circuit – Schematic created using CircuitLab Each of the 48 pins can be connected to GND, VCCX (a programmable voltage VCC rail), VPP (a programmable voltage VPP rail), or act as an input pin. The questions I am asking for help with are (please refer to full schematic linked above): Why use an ULN2003L to control base of QVPP to switch the VPP voltage for a pin? Why not drive the base directly from the output of SN74LVTH273DW? What is the function of schottky diode in VCCX switch? Each pin is connected to a FPGA via two resistors and a diode (BAV70), see the block diagram. How is the FPGA being protected from high voltage (e.g. 5 volts) potentially being output by programmed chip to some of its pins? All pins are also connected to a common PULLUP (which can be switched to be either pull-up or pull-down by the MCU), but I don't get why would one need to pull all pins at once to VCCX or GND, and why wouldn't doing so interfere with supplying power to the chip's power supply pins? Or, perhaps the PULLUP function is there for a self-test to change state of all pins and read them back in FPGA? Thanks in advance! AI: The drive signal has to rise approximately to Vpp to turn that transistor off. That is not possible with direct drive and Vpp greater than the supply of the 74HC chip. Something with an open collector or open drain fills the bill, and the ULN2003 is cheap and has 7 such outputs. If the pin is switched to Vpp > Vcc the transistor would otherwise conduct, even with base drive = Vccx (off). There is a bit of variable voltage drop (depending on current) due to the diode so it's not ideal, but it's a cheaper solution than using a better switch design. The diode and series resistor clamps the voltage to Vcc plus a diode drop and the additional series resistor keeps the current into the FPGA input protection network relatively low. It's a cheap solution that is probably adequate in many situations. Probably just to deal with inputs on the target device that may be outputs from time to time, and should be held in some defined state when inputs. It would be better to have the pins individually programmed as high-Z, pull-up, or pull-down but this arrangement is cheaper/simpler and adequate for most situations.
H: Wire to VDD or GND? In the circuit below, there are four LTC485 ICs, one input (left), three for output (right). Pins 2, 3 and 8 are going to +5V, as well as GND. So where should I connect them to? Should I wire them all through the 100 nF capacitor? What I see normally for a 100 nF capacitor, is that it is located between pin 5 (GND) and pin 8 (VCC), but other pins needing 5V are directly going to VCC (not through the 100 nF capacitor). (I tried +5V, but doesn't work, not sure if it is for this reason, but the IC got warm, found out too late and before that replaced by others which probably are ruined too). (credits of circuit: http://www.chameleon.rs/e035020.pdf), design by J. Mack. AI: The circuit seems to be an Elektor RS485 splitter with three optically coupled outputs and independent 5 V supplies. The circuit is uni-directional as is obvious from the orientation of the opto-couplers IC9, 10 and 11 and data flow is from left to right. The LTC485 is a low power RS485 Interface Transceiver and, since it has only two wire connection it must be half-duplex so the receiver, R, and driver, D, buffers can't be enabled simultaneously. In this uni-directional application they can be left on. Page 5 of the LTC485 datasheet states: \$ \overline {RE} \$ (Pin 2): Receiver Output Enable. A low enables the receiver output, RO. A high input forces the receiver output into a high impedance state. \$ {DE} \$ (Pin 3): Driver Output Enable. A high on DE enables the driver outputs, A and B, and the chip will function as a line driver. A low input will force the driver outputs into a high impedance state and the chip will function as a line receiver. So IC5 is using the 'R' buffer and needs pin 2 low and pin 3 high. The others are using the 'D' buffer and require the opposite. What I see normally for a 100 nF capacitor, is that it is located between pin 5 (GND) and pin 8 (VCC), but other pins needing 5V are directly going to VCC (not through the 100 nF capacitor). The 100 nF capacitor is there to provide very short term energy supply during spikes in current demand by the IC it is connected to. If it were not there the inductance and resistance of the PCB traces would result in dips in voltage which would make the device's operation unstable or unreliable. Nothing is connected to ground through the capacitor. The idea is that the +5V rail is definitely +5 V. I tried +5V, but doesn't work, not sure if it is for this reason, but the IC got warm, found out too late and before that replaced by others which probably are ruined too. Check and recheck your wiring. From the comments: You say pin 2 and 3 should be low resp high. But if you look in the circuit than IC6, pin 2 and 3 are connected together, so how they can be different? (There was an error in my answer. DE should not have a bar over it. Fixed.) Figure 1. Notice the logic inversion symbol 'o' at (1) and that it's missing at (2). The clever chaps who designed the chip realise that since you will be transmitting or receiving that you are likely to want to switch the two lines simultaneously. By inverting the logic on pin 2 they save you having to add an external inverter. You can now wire the two together. Pin 2 + 3 high: D enabled. R disabled (high impedance). Pin 2 + 3 low: D disabled (high impedance). R enabled. Be aware that the R and D buffers are tri-state. The outputs, when enabled, can be high or low and when disabled are high-impedance and, effectively, disconnected.
H: Series inductor to limit motor current? Short question: Would it be possible to use a series inductor to limit the inrush current when switching on (or briefly loading) a DC motor? Longer question: I have a battery-powered motorized toy which for convenience I'd like to run from a power socket instead (to avoid having to recharge and replace batteries). Currently it uses 4 1.5v batteries and if I measure it in steady state it draws about 0.8A at about 6V. The way that the toy works is that the motor is usually running continuously with very low load, and occasionally it briefly gets some load on the motor. I don't know exactly what kind of motor is used, but assume it's cheap and simple. I bought a (cheap) 6V power supply which is allegedly capable of delivering 1.2A, but its current protection cuts in when switching on the motor. As I understand it (please forgive my very basic knowledge here!) the motor presents an extremely low resistance when it's starting up, and so tries to draw a lot more than its usual 0.8A. When running from batteries, I guess they have a maximum current that they're able to provide, so everything gets automatically limited. When the motor is up to speed, its "effective" resistance rises due to its motion, and it reaches its steady state of drawing 0.8A. I expect that when the motor experiences some mechanical load, then the drawn current also temporarily rises, but again the batteries can only provide what they can provide. When it's connected to the mains power supply, the motor tries to draw much more than 0.8A (I'm not sure exactly how much more), trips the power supply's protection and the power supply cuts out. The motor slows down again, the power supply recovers and switches back on, but then the motor tries to draw too much again and it cuts out again. I've read about "motor inrush current" and "current limiting" but for this simple toy I'm hoping it won't be necessary to build a custom driving circuit with transistors or mosfets and I can't believe that a temperature-based thermistor solution is ideal (partly because of wasted heat, partly because my intermittent load is not temperature-related). From what (very) little I know about inductors, it seems that one of those in series would "fight against" the sudden change in current and develop a voltage across itself at startup. So I'm hoping this would temporarily limit the current to say 1A. In the steady state this voltage across the inductor would drop to zero and it would then act as a pure low resistance, which is exactly what I think I want. It doesn't need to be super-precise or to have a perfectly-flat 1A current limit, it would be fine to curve around 0.9A or 1.1A, but I don't know of an easy way to measure what's going on with a simple DC amp-meter. Could this be the right way to go, or is it too simplistic? And how would I calculate what kind of inductor would be suitable? AI: I'd go with an off-the-shelf DC-DC converter with built-in current-limit and feed that from a plug-pack with a higher voltage eg: https://www.aliexpress.com/store/product/DC-DC-CC-CV/1326062_32803647489.html The three brass screws control the output parameters, one sets voltage, one sets output current, and the other sets input current, set the voltage one for 6v then set the input current one so that the powersupply's over-current current limit does not activate. You'll have to feed this thing with more than 6V though, the output is always less than the input, 9V or 12V etc would work fine. you're going to need a voltmeter so you can set the voltage.
H: How to find RS485 UART pins are inverted in the data sheet? I want to know, how we identify the RS485 pins are inverted. I am using at91 microcontroller? This sam9260 board has four rs485 in which two of them are inverted. How to know which ports are inverted, I didn't find such information in the datasheet also? This is the simple code: rs485ctrl.inverted = 1; rs485ctrl.pin = -1; EDIT: other serial device configuration: rs485ctrl.inverted = 1; rs485ctrl.pin = 0x40 + 2; I didn't understand where this 0x40 +2 magic number came from? I interpreted if the pin is inverted it set as -1, perhaps what I understood is wrong? I used the multimeter to verify the positive wire is greater than negative wire during idle but don't know if there any other way to find the polarity of RS485? Don't know, is this the right forum to ask such a question. AI: RS485 uses the same wires to send and receive, you need to set a microcontroller output to the apropriate mode to command the RS485 transceiver to work in the aprorpriate direction. I'm not seeing a hardware solution to this in the datasheet so I guess that means you'll need to use the end of transmission interrupt to toggle the pin.
H: Can a MOSFET be used for dimming instead of switching a LED? I have a simple circuit that uses a MOSFET to switch on and off a ~100W LED spotlight (30V, 3A). It works for this application. I have been asked to modify the circuit so that the LED can be dimmed instead, but without using PWM (the reasons are beyond the scope of this question, but I can explain if needed). So my naive solution was to drive the gate of the MOSFET with the output of a DAC, per the schematic below: simulate this circuit – Schematic created using CircuitLab The DAC I am using is the MCP4725 (specifically the breakout board from Sparkfun). The MOSFET is a logic level one, IXFP5N50P3, and it is properly heatsinked. After some testing with the DAC output at voltages other than 0 or 5V, I notice the MOSFET starting to fail. In some cases they end up letting some current flow even if the gate voltage is zero. In other cases they fails by never letting enough current flow for the LED to reach full brightness. I suspect I am using the MOSFET in a mode of operation that is not safe, but I am not sure why, or how to tell by looking at the datasheet. Is this MOSFET only usable for switching a load, and if so are there any other parts that would be suitable for this application ? AI: It is not recommended (especially for 3 A) to turn an LED off and on for dimming purposes. You should use a constant current LED driver that delivers the current in continuous conduction mode (CCM). CCM means that the LED current never goes to zero between switching cycles. An inductor is required. This is a simple Buck CC LED driver circuit using a 3 Amp Didoes Inc. AL8849. Max current is set using RSET. You would use the CTRL pin for PWM dimming The easiest and arguably the best way to do this would be to use an AC powered $45 Mean Well 42V, 120 Watt HLG-120H-42B Constant Current Driver with three dimming methods utilizing a single pair of wires. This driver provides 93% efficiency from wall to LED. This is a high quality driver with a 7 year warranty. There are cheaper knock off drivers available as well. I recommended the 42V where the constant current range is 12V-42V and max current is 2.9A. The 36V HLG-120H-36B is 18V-36V up to 3.4 A. DIMMING METHODS 0-100K Resistance 0-10VDC 10V PWM Dimming methods 2 or 3 would work in your application.
H: Negative Voltage Reference for Bipolar ADC I am considering using ADS1258 - a bipolar ADC. It needs an external reference across REFP(+) and REFN(-). How do I generate precise -2.5V assuming I have +12V and -12V analog voltage rails? I can generate an approximate -2.5V using something like LM337 but I need something more accurate as that voltage is going to be used as a reference. A more precise way is to use a low input offset voltage opamp to invert a positive reference but that would still add some error. What is the standard way to get good quality bipolar reference voltage in a circuit? AI: You are over-complicating this. The power rails for the circuit in your question are +2.5 volts and -2.5 volts and it uses a REF3125 to produce a REFP voltage that is precisely 2.5 volts above REFN. This makes REFP 0 volts but if REFN drifts to -2.6 volts, REFP must also track to -0.1 volts. The internal reference voltage needed by the ADC is REFP-REFN hence, providing REFN is within the constraints dictated by the chip, it doesn't need to be tied to -2.5 volts. For instance if your power rails are 0 volts and +5 volts then you tie REFN to 0 volts and use a regular reference chip to produce (say) +2.5 volts. In other words REFN doesn't need to be precisely set or even fairly constant but REFP needs to be a fixed value above REFN. What is the standard way to get good quality bipolar reference voltage in a circuit? You don't need one - a common/semi_rough -2.5 volt rail (that also feeds the op-amps) is fine for REFN. You need REFP to be precisely set above REFN - that's all.
H: LCD module with backlight I am using COG-C144MVGI. I am trying to turn it on with my Raspberry Pi. I am not sure if I am following the "power on sequence" correctly. Does this kind of LCD modules work without backlight? I am wondering if I am supposed to get some kind of reaction on the screen even without backlight. Thank you. Here is the datasheet : https://www.avrfreaks.net/sites/default/files/COG-C144MVGI-08%20Full%20Spec.pdf AI: Probably you will see information on the display when the backlight is off, but not when it is dark (or not so light). (Also, there exist LCD displays without backlight). However, a reason to switch backlight off, is to preserve current (especially useful in a battery operated system). Page 6/7 show information about LED A/LED K how to control the backlight.
H: Understanding constant current LED drivers (ac to DC) I am trying to understand the way constant current LED drivers work. Lets say I have a driver with these specs: Description: Power: 18W Output Voltage: DC 36-63V Output Current; 300mA Input Voltage: AC 85 - 265V I can attach one LED light (which accepts 300 mA current) of 18 watts or 3 LED lights (each of which accept 300 mA current) of 6 watts each (in series) to the driver and it should work. In both these cases, the output voltage will be 60 V so that power demands are being met. Q1 - Am I right up to this point? Now suppose, I want to use the same driver to power up two 6 watts LED lights. I can still do so by wiring them in series. Output voltage in that case will be 40 V. Q2 - Am I right? Now lets say I want to light up a single 6 W bulb which requires 300 mA. Q3 - What will happen in this case? In order to drive 6 W LED, the output voltage needs to be 20 V but the driver can give output in the range of 36 V to 63 V. AI: The specifications for this LED driver (300 mA, 36-63V) means the following: You must use LEDs (or LED clusters, whatever) that are specified for 300 mA nominal current; and You must use a number of LEDs in series, such that their total forward voltage (Vf) is above 36 V, but less than 63 V worst case (usually at cold). Then the LED driver will drive the chain of LEDs to their sum of Vfs, which should be between 36 and 63 V, with constant current of 300 mA. If Vf of your chain of LEDs sums up to 60V, this LED driver will work to its maximum capacity of 18 W. In short, "wattage" of LEDs has little meaning without knowing their Vf. If you say you have a LED lamp of 6 W at 300 mA, it means that nominal Vf is 6/0.3 = 20 V (internally there are several LED chips in series). So yes, connecting 3 of these LED bulbs in series will sum up to 60 V and be about optimal. This answers Q1. For Q2, yes, two bulbs make Vf at 40 V, which also meets the driver specification. The driver will drop its output to 40 V while maintaining 300 mA drive current. They will work just fine, and the light fixture will consume 12 W (plus losses). For Q3, it depends on driver design. The 20V is below the CC (constant current) capability of this driver. The result will be either intermittent flickering, or reduced (but steady) current. Here is the load characteristic of some MeanWell driver: Red region shows unpredictable (design-specific) behavior of the driver, but the current shouldn't exceed 300 mA in any case.
H: Rule of thumb for surface tension when placing components on the secondary side of a board I've been working on my first multi-layer PCB design, and have been placing a variety of components on the secondary side of the board (mostly decoupling capacitors and QFN ICs). However, some of these components are fairly large, and I am beginning to wonder whether they would fall off the board during reflow. Is there a general guideline dictating the maximum size of passive components allowed on the secondary side of the board? Is 0805 too big? At what point does a component become too heavy for the secondary side? Would a ~14mg (0805) inductor be likely to fall off? AI: 0805 resistors are fine without adhesive, in my experience. That's with 63/37 solder paste. This site contains the following claim: Most surface mount components will be held in place by the surface tension of the liquid solder alone when run through the re-flow oven inverted. The weight limit of the parts that can be processed on the underside during reflow is related to the pad area. This is approximately 30g per square inch of pad area before the component will actually drop. My standard (low density) 0805 is 3.22mm^2 for both pads, which is about 0.005"^2, so that's 16mg. An 0805 resistor is 4mg. You might want to put your 14mg part on the other side if you can. I think 14 and 16 are a bit too close for comfort. A bit of vibration or slightly different processing conditions might be fatal.
H: LM317 Vout drops on load I built a very basic circuit to get around 5.5V from a +15V source I have a 220 Ohm between Adj and Vout and one 470 Ohm, one 220 Ohm and two 100 Ohm in parallel between Gnd and Adj summing up to about 740 Ohm that should give me about 5.45V between Vout and Gnd. With a 1.5k Ohm Load between Vout and Gnd I get 5.5V. However with a 470 Ohm Load I only get about 3.7V. Putting in 100nF capacitors between Vin and Gnd and Vout Gnd did not help simulate this circuit – Schematic created using CircuitLab Any Ideas what I'm doing wrong? AI: I'm guessing you have swapped the input and adj pins by having the LM317L reversed. Note that the view is from the top looking down through the plastic (dashed lines for the pins). Connected backwards, it perhaps acts as a sort of zener breaking down at 9V or so with some resistance in series.
H: Nonzero current at voltage zero-crossing when consuming reactive power In a circuit that consumes some reactive power, the current waveform indicates current flow even when the supply voltage is at the zero crossing. This seems paradoxical since there cannot be current flow at zero volts, barring some kind of superconductivity effect. What is the best way to understand this aspect of reactive power? AI: The voltage across an inductor, V equals the indutance x the rate of change of current passing through the inductor. In short: - $$V = L\dfrac{di}{dt}$$ So, if the rate of change of current through the inductor is zero then the voltage across its terminals is also zero BUT this doesn't mean that there isn't a value of current present and that it has reached a peak like this: - Picture source.
H: I2C & SPI - share clock lines? I know mixing SPI and I2C is a bad idea, but, when using a microcontroller short on pins, is it safe to share clocks between both buses, provided both are running at bus-tolerable frequencies? In my application, I plan on using one bus at a time, but I suppose this question applies even if that was not the case. AI: You could theoretically do this but you'd have to use two different buffers. The system I'm envisioning would have a bidirectional buffer with tri states might work (or maybe two) and you could switch the SPI bus on and the I2C bus off. The pull ups for I2C could be on the other side of the buffer However if one is using a small micro, they are probably doing so to save on space and you might as well use a bigger micro than a micro and a buffer (or two).
H: Prime Implicant In a K-map, I know block consists entirely of don't cares and is not part of a bigger block is considered as Prime implicant. For ex-The one in red in the given figure- But I am not able to figure out the reason behind it. As that Prime implicant is of no use then why to consider it even as prime implicant? AI: Prime implicants are the minimal parts of a boolean equation that can represent your function. Since you can represent part of your function with the don't cares, they do count as prime implicants even if every part of the implicant is a don't care.
H: Control 24VAC solenoid with arduino using a octocopuler and a Triac Following a previous question I implemented the following schematic on my PCB. The schematic : My PCB: I have been unable to make it work, if I measure the voltage on j13 it's allways 25v, i know the controller is working because D2 Led is on for 5 seconds and then off for 5 seconds. If I remove R20 J13 is always 0v. If I remove the MOC3012 j13 is always 25v. I have replaced U2 and Q1 with brandnew ones just in case they where fried but it makes not difference I have been scratching my head all day long trying to figure out what's wrong with my implemention but I can't find where is the problem. My adrduino code : void selfTest() { int counter = 0; /* Clears the LCD screen */ lcd.clear(); lcd.setCursor(0, 0); lcd.print(F("Self Test")); /* This routine never stops */ while (true) { diagnostic.turnOn(); delay(100); diagnostic.turnOff(); /* Updates the counter test */ lcd.setCursor(0, 1); lcd.print(counter); /* Acoustic notification */ beep(); /* opens the valve and waits 5 seconds */ openRelay(); delay(5000); /* closes the valve and waits 5 seconds */ closeRelay(); delay(5000); /* increment the counter as 1 complete open/close cycle */ counter++; diagnostic.turnOn(); delay(100); diagnostic.turnOff(); } } Edit: Added J12 which is the connection to the 24VAC power supply. AI: Change output circuit for inductive load (check the triac datasheet, you have 1 and 2 swapped). See Figure 8 in MOC3012 datasheet. Don't forget to remove R20. You might also need a snubber as on Figure 13 in here
H: Non-coaxial 50 ohm cable for LVDS I'm looking to configure a Xilinx Zynq-7000 custom board with LVDS receivers according to the following diagram. In my setup, the 'IOB' on the left represents an LVDS driver from a radar receiver and the IOB on the right represents the Zynq board that receives and processes the data. My concern is with the 50 ohm cable connecting the LVDS transmitter to the LVDS receiver. Standard 50 ohm coaxial cable is not going to work because there are actually many such connections that all need to fit within a single shielded cable that plugs into the Zynq board. I'm having a tough time finding higher gauge wire that specifies a characteristic impedance and I don't feel like putting two lengths of 100 ohm ethernet cable in parallel to make a single connection. I was considering using MIL-C-27500 22-awg wire because we have a bunch lying around, but I can't seem to find any datasheet that specifies its characteristic impedance. The cable will be up to 3.5 feet long and will be used to transmit 10 MHz SPI data. A quick calculation using 100 ohms and 50 pF (completely made-up number approximating cable + receiver capacitance) gives a rise-time of 5 ns, so BW = 70 MHz. At 70 MHz, the electrical length is 14 feet so my 3.5 foot cable is starting to look like a transmission line (of course, these are extremely ballpark numbers). Anyways, I don't think I can get away with using regular old 22-gauge wire (please correct me if I'm wrong) given that signal integrity is fairly important in this application. Where should I be looking for higher-gauge, 50 ohm wire for this LVDS application, or is there a better solution? AI: I'm having a tough time finding higher gauge wire that specifies a characteristic impedance and I don't feel like putting two lengths of 100 ohm ethernet cable in parallel to make a single connection. Cat 5 cable is 100 ohms differential, which is exactly what you want. Your prototypical coaxial solution uses two 50-ohm cables for the two arms of a differential signal, giving 100 ohms differential. The twisted pair in Cat 5 gives the same differential characteristic impedance as the original solution. Even if you used some different cable, for example with 85 ohms differential characteristic impedance, you could resolve the mismatch by changing the value of the termination resistor. Trying to combine multiple cables to change the effective characteristic impedance could only lead to pain and aggravation. One difference: The Cat 5 cable won't shield the signal like coaxial does, but this is usually not a problem. Also, the Cat 5 won't provide any ground connection between the two systems, so you may need an additional conductor in your overall solution to connect the two grounds. If the link distance is very long you might also need to connect to the cable through a transformer at one or the other end to avoid common mode currents due to ground potential differences between the transmitting and receiving circuits.
H: Visualizing Electrical Potential After going through multiple youtube videos and some articles I'm still having trouble imagining voltage. If we measure across a battery's terminals we will see electrical potential. This is caused by the collection of negative particles on the negative terminal and positive particles on the positive terminal. Since these are being "kept apart", there is some work being done to hold them where they are, and therefore potential energy. The difference in potential energy between the two terminals is our voltage. When we connect a battery to a simple circuit consisting of a lamp (for example), we can measure the two points on the conductor using a voltmeter and see 0V. Since the electrons are being "pulled" towards the positive terminal (in the same sense that gravity pulls a dropped object downward), there is no work being done to prevent the from traveling to the positive terminal, therefore the difference in the potential energies between the two points is 0. Now when we measure across the lamp in the circuit we will once again see a voltage. I think this is where I get confused. The lamp isnt part of the conductor, and therefore there is voltage - this is where my book leaves off. Using my reasoning from above - is this because on the positive end of the lamp, it's connected to the positive terminal and has a higher positive charge than the rest of the conductor? This would explain why there is a measurable potential difference. If so, what happens inside of the lamp with the potential energy? Some of it must be turned to heat? AI: You have a fundamental misunderstanding about voltage. A voltage difference isn't caused by an imbalance in the amount of charge, it's caused by a difference in the amount of energy available from the charge. As charge passes (i.e. current flows) through an incandescent lamp it loses electrical energy, which is converted to heat and light. The density of electrons is the same at both ends of the filament, but the charge entering the filament has more energy than the charge leaving the filament.
H: Reducing noise on a voltage reference I need a stable, low noise voltage reference that I can adjust between 1.4V and 1.8V. The output should source or sink up to 0.25mA @150Hz max. The output will provide a +1.65V bias for a bipolar signal driven by another op amp into the ADC on a microcontroller. (I need some adjustability because the bipolar signal has got some d.c. offset error I want to null out). A similar question was posted here Are all voltage reference ICs able to sink as well as source current? and I wanted to develop that with a proposed design (below). My question is: where would I put a capacitor to decouple noise in the reference? Could I assume a 100nF between the 2.5V reference diode's anode and cathode would suffice or would I ned further filtering on the input? (By the way, I'm changing from the TLE2141 to a TL071AN in my circuit because the TLE2141 has too large a supply current.) AI: Most of the noise (perhaps 1-2mVp-p) will be due to the reference, so putting a capacitor on the op-amp non-inverting input (with a series resistor in the case of the TL071) makes some sense. 100nF with a 20K series resistor (about 22-23K equivalent total) will give you a cutoff frequency of around 71Hz if I did the math right. Similar to @WhatRoughBeast's comment but with added series resistance. On the other hand if you use a lower noise reference such as an LM4040-2.048 or -2.5 which has something like 250uVp-p noise typically, the capacitor and resistor may not be necessary, since the amplifier is contributing significantly.
H: Why isn’t thermal noise work possible? This must be an absolute naive question, but I’m going to ask it anyway. Aside from the obvious thermodynamic law violation, if I short cut a resistor’s terminals, why doesn’t thermal Nyquist noise in the resistor produce heat and raise its temperature until it burns up? AI: Because of the mechanism of noise production, shorting the resistor (or leaving it open) does not heat the resistor. This is analogous to asking why reflecting the black-body radiation back to a hot sphere does not cause it to heat up and melt. Connecting it to a noise-free resistive load draws power from the resistor and cools it (optimally transfer is between equal value resistors). If the load is resistive and exhibits Johnson-Nyquist noise the two resistors will equalize in temperature. This is like black body radiation equalizing the temperature between two surfaces. The roots of this behavior are deep and you can refer to the fluctuation dissipation theorem for more information. For example, a damped mechanical system will exhibit the same kind of temperature-dependent noise.
H: 5V Tolerant Way To Generate Rising Edge Signal on USB Connection I have a microcontroller device that can be awakened from deep sleep mode when it detects a rising edge signal on a wakeup pin. The wakeup pin is 5V tolerant and I'd like a connection to a USB port to generate the rising edge signal. Originally I was just going to have the Vusb generate that rising edge on connection along with a pull down resistor but somebody pointed out that Vusb can be very noisy and have large transients especially on attach. The following image shows my USB input circuitry as currently designed. I've had some people tell me that a pulldown (10k) paired with a small (0.1uF) cap on the wakeup pin using Vusb directly will do the trick but another person recommended a buffer IC like a non-inverter buffer with schmitt trigger. Are they both right or is one clearly a better option than the other? Is there another generally accepted approach that would be better for generating the rising edge when USB power is connected? AI: If a uP pin is "5V tolerant", it doesn't mean that you need to push the input pad to its maximim. A standard level (I assume it is a 3.3V uP) would be just fine to wake the uP up. Here is the standard circuit to handle VBUS connect event: Anything "better" like a buffer or else will be an overkill.
H: Gibbs phenonemon in real life If I feed a square wave into a first order, passive, low-pass filter (resistor and capacitor), I get the following results on an oscilloscope (sorry, I don't know how to scale and rotate images): Why does the overshoot only occur on half of the corners of the square wave? Based on Fourier analysis, partial sums of a square wave should look something like this: This is the Gibbs phenomenon. Here the overshoot occurs on all 'corners' of the square wave, rather than just the ones following a transition. I got some similar results when testing the frequency response of a unity gain buffer op amp: Hypothetically, the op amp acts as a low-pass filter due to its finite bandwidth, so it's not surprising that it produces similar results to the actual low-pass filter above. My question is: based on electrical theory, low-pass filtering should produce a square wave with attenuated higher harmonics, which should produce something similar to the Gibbs phenomenon with overshoot at each of the corners. Why doesn't this happen here? For me, it makes MATHEMATICAL sense that the output wave should have overshoot at each corner, but it makes INTUITIVE sense that the output should only have overshoot at the corners that occur after a transition. Why? Because if the 'ringing' (overshoot/undershoot) also occurred BEFORE a transition, it would seem non-causal - it would almost be as if the wave is guessing that it's about to transition! How can I reconcile my understanding from the perspective of Fourier theory with what actually happens in real life? AI: I figured it out! I created a MATLAB script which sums the first 1000 terms of the output's Fourier series with a 1Hz square wave input. Here's the answer: Low-pass filters can cause the Gibbs phenomenon to occur, but these filters are not physically realizable. (This makes sense, otherwise non-causal behavior would be possible). Consider a brick wall filter. This is equivalent to truncating the Fourier series of the input to a certain maximum frequency. The results of the MATLAB script verify this: As mkeith said in the comments, a perfect first order RC filter does not produce ringing. Instead, the filter just 'rounds off' the square wave: The filter that I created was a first order filter, but parasitic elements, bad probes, etc. must have produced the ringing/overshoot, since as the result from MATLAB above shows - first order low-pass filters do not produce ringing. However, second order (RLC) low-pass filter can produce ringing! The MATLAB script verifies this: You'll notice that there is no non-causal behavior occurring here. This second-order filter is physically realizable (neglecting parasitic elements, but even then this behavior should be able to be approximately reproduced). This means that the reason I was confused was simply because I didn't do the maths! I assumed that the Gibbs phenomenon would apply to a first order filter despite the fact that phase-shifting and attenuation occur in a first order filter which do not occur when truncating the Fourier series.
H: Restrict making pcb library from board in altium Hi can anyone let me know if there is any provision to make user not to extract the library from the given board file in altium designer as i would not want the user to extract the footprints from my board file AI: No, there is no way (as far as I know) to lock out the footprints if you give a third party the full design in Altium. By giving someone the raw design files, it implicitly means you are giving them full access to the design. If this is anticipated to be a problem, then you should have a proper contract in place to address this. If you just wish to share the physical form of a design with a partner, then the Gerber files and 3D models would be sufficient. Having said this, footprints are trivial to copy and create so don't expect this to be any protection from someone copying the design. If someone is determined to copy your design, this is a tiny time expenditure in the wider effort.
H: Schematic for input protection with NMOS? Does this really work? I was reading an old schematic and found this and sketched it up; (see box in image "Some kind of protection") The closest thing to this schematic that I've been able to find, that could have briefly explained how it was works used a depletion mode NMOS to act as an over voltage protection circuit. Over voltage protection with depletion mode NMOS That could have explained it! Sadly the NMOS used is a IRFBG20 that isn't a depletion mode fet, if I did not now totally misread.. So I wonder, is there something I've missed? This design is in use, so it should work somehow.. AI: That's input overvoltage protection. Essentially it's a voltage regulator. The 3 zeners produce about 810 volts (nominally), so at nominal 700 volts in the gate of the FET is at 700 volts. Then the FET will produce a source voltage of about 10 volts less, or on the order of 690 volts, since a 10-12 volt Vgs should turn it on fully. If the input voltage ever gets above about 810 volts (+/- whatever the zener tolerances are) the gate voltage will be clamped at 810 (+/-) so the output will also be clamped. ETA - As the input rises, so does the gate voltage. If (for instance) Vgs of 10 volts is enough to fully turn on the FET, then as the input rises above 10 volts the FET will be turned on and charge C1, with R3 taking up the slack. Once the input reaches its peak, if there is no current drain through the transformer, the output will gradually rise the final 10 volts or so until the FET is turned off. However, in operation the capacitor voltage will vary, and this will turn on the FET to produce the necessary current. For instance, let's say the cap is 10 uF and the turn-on time of the input is 7 msec, for an input dV/dt of 100 V/msec. Then the turn-on current will be 1 amp, which is well within capability. If the cap were 1000 uF, it would need 100 amps, which the FET cannot provide. However, the 100 ohm R3 means that, in the worst case, the charge current would be 7 amps (700 V/ 100 ohms), so that should not be a problem. It may help to visualize the transformer circuit as a simple resistor to ground, with a value which produces an appropriate average current level. You can do this due to the lowpass action of R3/C1, which will buffer the current spikes actually produced. Then the average cap voltage will stabilize, with the cap voltage plus the iR drop on R3 adding up to just enough less than the input voltage to keep the FET operating correctly. If Vgs is too low, the FET will not be properly turned on, the voltage across R3 will be less, and the FET will turn on more. Vice versa if the FET is on too hard, although this obviously has no potential to hurt the FET.
H: IC that would pull output to the ground, perhaps NOT gate? I have a board with four relays on it. It has a standard Vcc, Gnd, and In1-In4 pins. I want to control it with Arduino or in my case an ESP32. However, I noticed that when output pin on my controller is pulled HIGH nothing happens when it's pulled LOW the relay will engage. This is a problem when the board is reset because of all the relay switches will engage until and this isn't something I want. After some digging, I made this: This works as desired, there's always 5V on the relay and the relay is disengaged all the time. When I output a signal to the base of the Q1 it will pull the output to the ground and the relay will engage. Right now I have four of these relays and pretty soon I'll have more. So, I'd like to solve this with an IC. In particular, I was looking at the IC7404 which is a bunch of NOT gates, however, I am not sure this will solve my problem. So, is there an IC that would pull the output to the ground when the signal is present on the input? Will 7404 work and I'm just not seeing something? :) Edit: This is the relay module I am using. I wasn't able to find any useful data sheets on it. AI: The fact that relays are actuating at reset when pins should be in a high impedance mode is worrisome, and something that you need to fully understand in order to validate your system and fix it. Edit: now that it is clear that this is a software bug in your code, to solve the inadvertent drive low during starting, configure the pin's output data register bit to high before you set the pin to be an output. That said, a literal answer to your original question would be a chip containing several open collector inverters. The 74xx05 is an example. The 74xx06 is similar but allows applying acceptable voltage to the output even when this exceeds the supply voltage, for example you can operate the part on 3.3v but pull down outputs from 5v. But these are not the solution to your actual problem.
H: split LED current over 2 sinks I have a display assembly with 8 WLEDs in 4s2p configuration for backlight. However, the split between 2 strings is made within the display assembly so I have only a single anode/cathode pair in the display connector. Each WLED has a Vf of 3.2V and If of 20mA, so I need to source 12.8V @ 40mA to drive the LEDs. In my current design I have been using a TPS61165, which has been working great. Now for the next iteration of the device in question, I want to make use of the Qualcomm PMI8994 PMIC which comes with the SoC module we have selected. It has an integrated WLED SMPS that is capable to supply the required voltage, but has 3 WLED sink drivers, which, judging by the datasheet, can sink max 30mA each. Assuming I synchronously control each sink driver to set brightness, can I safely split the backlight cathode connection on my PCB and connect them to 2 of the LED sink drivers to get under the 30mA limit? Note that the part within the dashed region is something I can't change. AI: Combining controlled or Constant Current (CC) sinks (or sources) in parallel may be added to a single load (s) as long as the resulting voltage is within the specified range, which is true in this case. Other info The same is true, for PTC polyfuses which are resettable current limiters. However, not part of this question, constant voltage sources ( power supplies ) with current sharing links to each other for redundancy can have stability issues under 10% of the rated load.
H: importance of voltage Gain of an audio Op amp I have been looking into audio amplifiers theory. So I understand that in the output you need a current gain in able to drive low impedance loads. But I am having difficulty in understanding why it is important to have a high voltage gain at low frequency for the IPS(input pair stage) and VAS (voltage amplifier stage). Why is a high open loop gain so important for low distortion ? What would happen if the open loop gain is lowered significantly ? by for example excessive emitter degeneration Does anyone have an intuitive explanation? AI: Anyone who claims that only the open loop gain matters for distortion doesn't understand how distortion in circuits with feedback works. Let's say that you have an opamp with a open-loop gain (so at DC and very low frequencies) of 1000. You want to use it to make an amplifier which amplifies an input signal 10 times. To do this you would be using the opamp in a feedback configuration, don't worry about how the schematic would look like, that's not relevant yet. To get the closed loop gain of 10 you would need to make \$\beta = 1/10\$ That then results in a closed loop gain of \$A_{ol} \beta = 1000*1/10 = 100\$ This is also called the "excess loopgain" as it is gain that is "too much", you need only 10 gain and you "waste" 100. But that does not mean that this excess loopgain is useless! In fact it is what decreases distortions created inside the loop. Suppose that the opamp is slightly non-linear and instead of outputting 100 mV (when the opamp has a Vin = 0.1 mV, like so 0.1 mV * 1000 = 100 mV) it outputs only 90 mV. Oh dear, that's a 10% error !! Luckily that's where the excess loopgain comes in. Since the opamp is monitoring it's own (distorted) output voltage with the (non distorted) input signal it can "detect" it's own distortion! This mechanism then reduces the distortion by the excess loopgain factor so in our case by a factor 100. So 10% distortion becomes 0.1%, that's much better. Now what would happen if the opamp didn't distort 10% but we'd use a better opamp which also has an \$A_{ol}\$ of 100 but distorts 10x less so only 1%. Then the total distortion at the output will be 1% / 100 = 0.01% So in conclusion: it is not only the loopgain that matters but also how much distortion the opamp adds. So a 10 higher \$A_{ol}\$ is pointless if the opamp also has a 10x higher distortion! Both excess loopgain and intrinsic linearity of the opamp matter. Disclaimer: I am aware that above numbers aren't 100% accurate, as commented below the actual excess loopgain is really 99 instead of 100. I prefer to explain with rounded off numbers to show the principle, not the exact values.
H: How to condition a NTC of very low resistance? I want to use a temperature sensor which changes its resistance. For 0 degrees celsius its resistance is 0.5325 ohms and for 40 degrees celsius it is 3.264 ohms. Obviously putting it in series with another resistance to produce a variable voltage is not logical since the current that would circulate is high. (the variable voltage must be within the range of 0 to 5 volts). It occurs to me to use a small voltage (reference voltage) for the voltage divider and then variable voltage should be amplified but when working with very small voltages there may be problems with electrical noise. Can it be done better and economically? Thanks AI: I assume you want to keep power dissipation low in the sensor, say, well below 1 mW. If you maintain a voltage of 10 mV across the sensor, the current will range between roughly 2.8 and 20 mA, and the power dissipation will range from 28 to 200 µW. A circuit to do this would look something like this: simulate this circuit – Schematic created using CircuitLab The output voltage will be highest when the temperature is lowest, about 3.2V when the sensor is at 0.5Ω and about 0.5V when the sensor is at 3.5Ω. You can deal with this in software after the ADC or add additional conditioning circuitry to get what you want. The key parameter for the opamp is its input offset voltage. There are specialized devices on the market that have extremely low values for this parameter. Also, if you want to operate from a single power suplly, keep an eye on the input common mode range.
H: Converting boolean function (dnf) to only 2-input NANDs I'm currently preparing for an exam and was doing some exercices regarding boolean logic. Commonly asked question is to build a function from a truth table and simplify it with a karnaugh map. After that we mostly have to convert the dnf to a circuit with NAND or NOR logic only, usually not the problem, but im struggling to convert this dnf to a circuit with NAND-Gates that only use 2 inputs: (¬B ∧ D) ∨ (A ∧ ¬B ∧ C) ∨ (¬A ∧ ¬C ∧ ¬D) ∨ (¬A ∧ B ∧ ¬C) The inputs are available in a double-rail-system, so normal and inverted. I tried using the rules for boolean logic to extract a variable, so i'd only have 2 variables/inputs per gate left, but was getting confused due to having initial 3 inputs/variable for the AND gates. Appreciate any help on this! AI: Don't worry much about three variable cases, you can always use two NANDs: https://www.quora.com/How-can-this-be-simplified-using-only-NAND-gate-A+B-C-D+E Writing it like this might help you: (¬B ∧ D) ∨ (A ∧ (¬B ∧ C)) ∨ (¬A ∧ (¬C ∧ ¬D)) ∨ (¬A ∧ (B ∧ ¬C))
H: Li-ion battery cell balancing statistically unnecessary when many cells are in parallel? Lithium ion batteries packs need to be balanced because of a small random voltage difference for each section in series, that may cause the voltage levels in a pack to diverge over time, right? So if you had a large number of cells (<40) in each series section wouldn't it be unnecessary to have balancing circuitry as the voltage difference of each series section would be extremely small due to the large sample? AI: When several lithium cells are connected in series, it is the variation between series sections that requires balancing to be used. The problem with leakage and charge efficiency is that differences in these have a cummulative effect, and battery imbalance grows with each charge/discharge cycle. I understand that you think that making each series section out of many cells in parallel would tend to even out the variation between those series sections. However, 'tend to even out', and 'reduce to such a low level that it's not an issue during the expected lifetime of the pack' are very different things. In the worst case, each series section will be as unbalanced as each individual cell. So there may be no improvement. In the 'typical' case, you could statistically expect sqrt(number_of_cells) less variation in the parallel ensemble than for individual cells. For 40 cells, that's about 1/6th. So if you relied on this improved balance, you could typically cycle your cells 6 times more often before they became as unbalanced as a single series string. Doesn't really sound good enough improvement to me. In the matched case, where you measure all the cells for capacity, internal leakage, charge and discharge efficiency, over temperature don't forget, and select the cells so each series section matches on all parameters, unfortunately those parameters change with age. Maybe you'll get 10 or 20 cycles out of the pack before differential parameter drift causes them to become unbalanced. If you have series lithium cells, actively balance the charge between them. Some people wonder why we need to balance lithiums, when we never needed to balance lead or nickel chemistries. The answer is that lead and nickel can be overcharged safely (as long as certain limits are observed) which naturally balances them. Unfortunately, there are no conditions that will allow the safe overcharging of lithium chemistries, overcharge rapidly destroys the cell.
H: STM32 Virtual EEPROM Page Swap not working correctly I try to save a look up table in the flash memory by using the virtual eeprom library from STM32. I chose a page size of 3kByte to save all the data and it works good until the page is full. Then, the routine EE_PageTransfer(VirtAddress, Data); is called nonstop when new data is written and it throws always an error. Inside this routine, page 1 seems always to be the valid page, that need to be copied to page 0 and this fails. After reboot, the EE_Init() function throws an error and does not recover, until a full flash erease is done. Does anyone know whats wrong here? Is there a bug in the STM32 EEPROM library? I attached my settings from the eeprom.h library and the function EE_PageTransfer() below. I could not add the whole eeprom.c file, because it is too big. If someone knows how to upload source files correctly here, please let me know. Edit: I got a first idea what it could be. At first, the page 0 is copied correctly and it seems to transfer the page. But then after 1kbyte is written to page 1, the PageFull error comes again, and not after 3kbyte as it should be. From then, always a page full error is thrown. Is there a bug somewhere in the library? Edit 2: It seems like the library is just not made for page sizes other than 2kByte, but I'm sure this can be changed somehow. I will try to figure out how to. With 2kByte page size everything works fine. eeprom.h: /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __EEPROM_H #define __EEPROM_H /* Includes ------------------------------------------------------------------*/ #include "stm32f3xx_hal.h" /* Exported constants --------------------------------------------------------*/ /* EEPROM emulation firmware error codes */ #define EE_OK (uint32_t)HAL_OK #define EE_ERROR (uint32_t)HAL_ERROR #define EE_BUSY (uint32_t)HAL_BUSY #define EE_TIMEOUT (uint32_t)HAL_TIMEOUT /* Base address of the Flash sectors */ #define ADDR_FLASH_PAGE_0 ((uint32_t)0x08000000) /* Base @ of Page 0, 2 Kbytes */ #define ADDR_FLASH_PAGE_1 ((uint32_t)0x08000800) /* Base @ of Page 1, 2 Kbytes */ #define ADDR_FLASH_PAGE_2 ((uint32_t)0x08001000) /* Base @ of Page 2, 2 Kbytes */ #define ADDR_FLASH_PAGE_3 ((uint32_t)0x08001800) /* Base @ of Page 3, 2 Kbytes */ #define ADDR_FLASH_PAGE_4 ((uint32_t)0x08002000) /* Base @ of Page 4, 2 Kbytes */ #define ADDR_FLASH_PAGE_5 ((uint32_t)0x08002800) /* Base @ of Page 5, 2 Kbytes */ #define ADDR_FLASH_PAGE_6 ((uint32_t)0x08003000) /* Base @ of Page 6, 2 Kbytes */ #define ADDR_FLASH_PAGE_7 ((uint32_t)0x08003800) /* Base @ of Page 7, 2 Kbytes */ #define ADDR_FLASH_PAGE_8 ((uint32_t)0x08004000) /* Base @ of Page 8, 2 Kbytes */ #define ADDR_FLASH_PAGE_9 ((uint32_t)0x08004800) /* Base @ of Page 9, 2 Kbytes */ #define ADDR_FLASH_PAGE_10 ((uint32_t)0x08005000) /* Base @ of Page 10, 2 Kbytes */ #define ADDR_FLASH_PAGE_11 ((uint32_t)0x08005800) /* Base @ of Page 11, 2 Kbytes */ #define ADDR_FLASH_PAGE_12 ((uint32_t)0x08006000) /* Base @ of Page 12, 2 Kbytes */ #define ADDR_FLASH_PAGE_13 ((uint32_t)0x08006800) /* Base @ of Page 13, 2 Kbytes */ #define ADDR_FLASH_PAGE_14 ((uint32_t)0x08007000) /* Base @ of Page 14, 2 Kbytes */ #define ADDR_FLASH_PAGE_15 ((uint32_t)0x08007800) /* Base @ of Page 15, 2 Kbytes */ #define ADDR_FLASH_PAGE_16 ((uint32_t)0x08008000) /* Base @ of Page 16, 2 Kbytes */ #define ADDR_FLASH_PAGE_17 ((uint32_t)0x08008800) /* Base @ of Page 17, 2 Kbytes */ #define ADDR_FLASH_PAGE_18 ((uint32_t)0x08009000) /* Base @ of Page 18, 2 Kbytes */ #define ADDR_FLASH_PAGE_19 ((uint32_t)0x08009800) /* Base @ of Page 19, 2 Kbytes */ #define ADDR_FLASH_PAGE_20 ((uint32_t)0x0800A000) /* Base @ of Page 20, 2 Kbytes */ #define ADDR_FLASH_PAGE_21 ((uint32_t)0x0800A800) /* Base @ of Page 21, 2 Kbytes */ #define ADDR_FLASH_PAGE_22 ((uint32_t)0x0800B000) /* Base @ of Page 22, 2 Kbytes */ #define ADDR_FLASH_PAGE_23 ((uint32_t)0x0800B800) /* Base @ of Page 23, 2 Kbytes */ #define ADDR_FLASH_PAGE_24 ((uint32_t)0x0800C000) /* Base @ of Page 24, 2 Kbytes */ #define ADDR_FLASH_PAGE_25 ((uint32_t)0x0800C800) /* Base @ of Page 25, 2 Kbytes */ #define ADDR_FLASH_PAGE_26 ((uint32_t)0x0800D000) /* Base @ of Page 26, 2 Kbytes */ #define ADDR_FLASH_PAGE_27 ((uint32_t)0x0800D800) /* Base @ of Page 27, 2 Kbytes */ #define ADDR_FLASH_PAGE_28 ((uint32_t)0x0800E000) /* Base @ of Page 28, 2 Kbytes */ #define ADDR_FLASH_PAGE_29 ((uint32_t)0x0800E800) /* Base @ of Page 29, 2 Kbytes */ #define ADDR_FLASH_PAGE_30 ((uint32_t)0x0800F000) /* Base @ of Page 30, 2 Kbytes */ #define ADDR_FLASH_PAGE_31 ((uint32_t)0x0800F800) /* Base @ of Page 31, 2 Kbytes */ /* Define the size of the sectors to be used */ #define PAGE_SIZE (uint32_t)FLASH_PAGE_SIZE /* Page size */ //Now 6kByte -> HEX 0x1800 /* EEPROM start address in Flash */ #define EEPROM_START_ADDRESS ((uint32_t)ADDR_FLASH_PAGE_26) /* EEPROM emulation start address */ /* Pages 0 and 1 base and end addresses */ #define PAGE0_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x0000)) #define PAGE0_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + (PAGE_SIZE - 1))) #define PAGE1_BASE_ADDRESS ((uint32_t)(ADDR_FLASH_PAGE_29)) #define PAGE1_END_ADDRESS ((uint32_t)(ADDR_FLASH_PAGE_29 + PAGE_SIZE - 1)) /* Used Flash pages for EEPROM emulation */ #define PAGE0 ((uint16_t)0) #define PAGE1 ((uint16_t)1) /* Page nb between PAGE0_BASE_ADDRESS & PAGE1_BASE_ADDRESS*/ /* No valid page define */ #define NO_VALID_PAGE ((uint16_t)0x00AB) /* Page status definitions */ #define ERASED ((uint16_t)0xFFFF) /* Page is empty */ #define RECEIVE_DATA ((uint16_t)0xEEEE) /* Page is marked to receive data */ #define VALID_PAGE ((uint16_t)0x0000) /* Page containing valid data */ /* Valid pages in read and write defines */ #define READ_FROM_VALID_PAGE ((uint8_t)0x00) #define WRITE_IN_VALID_PAGE ((uint8_t)0x01) /* Page full define */ #define PAGE_FULL ((uint16_t)0x1800) /* Variables' number */ #define NB_OF_VAR ((uint16_t)1536) //Half a page, since Address will also be safed -> always uint32_t /* Exported types ------------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ uint16_t EE_Init(void); uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data); uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data); #endif /* __EEPROM_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ PageTransfer(): static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data) { HAL_StatusTypeDef flashstatus = HAL_OK; uint32_t newpageaddress = EEPROM_START_ADDRESS; uint32_t oldpageid = 0; uint16_t validpage = PAGE0, varidx = 0; uint16_t eepromstatus = 0, readstatus = 0; uint32_t page_error = 0; FLASH_EraseInitTypeDef s_eraseinit; /* Get active Page for read operation */ validpage = EE_FindValidPage(READ_FROM_VALID_PAGE); if (validpage == PAGE1) /* Page1 valid */ { /* New page address where variable will be moved to */ newpageaddress = PAGE0_BASE_ADDRESS; /* Old page ID where variable will be taken from */ oldpageid = PAGE1_BASE_ADDRESS; } else if (validpage == PAGE0) /* Page0 valid */ { /* New page address where variable will be moved to */ newpageaddress = PAGE1_BASE_ADDRESS; /* Old page ID where variable will be taken from */ oldpageid = PAGE0_BASE_ADDRESS; } else { return NO_VALID_PAGE; /* No valid Page */ } /* Set the new Page status to RECEIVE_DATA status */ flashstatus = HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, newpageaddress, RECEIVE_DATA); /* If program operation was failed, a Flash error code is returned */ if (flashstatus != HAL_OK) { return flashstatus; } /* Write the variable passed as parameter in the new active page */ eepromstatus = EE_VerifyPageFullWriteVariable(VirtAddress, Data); /* If program operation was failed, a Flash error code is returned */ if (eepromstatus != HAL_OK) { return eepromstatus; } /* Transfer process: transfer variables from old to the new active page */ for (varidx = 0; varidx < NB_OF_VAR; varidx++) { if (varidx != VirtAddress) /* Check each variable except the one passed as parameter */ { /* Read the other last variable updates */ readstatus = EE_ReadVariable(varidx, &DataVar); /* In case variable corresponding to the virtual address was found */ if (readstatus != 0x1) { /* Transfer the variable to the new active page */ eepromstatus = EE_VerifyPageFullWriteVariable(varidx, DataVar); /* If program operation was failed, a Flash error code is returned */ if (eepromstatus != HAL_OK) { return eepromstatus; } } } } s_eraseinit.TypeErase = FLASH_TYPEERASE_PAGES; s_eraseinit.PageAddress = oldpageid; s_eraseinit.NbPages = 1; /* Erase the old Page: Set old Page status to ERASED status */ flashstatus = HAL_FLASHEx_Erase(&s_eraseinit, &page_error); /* If erase operation was failed, a Flash error code is returned */ if (flashstatus != HAL_OK) { return flashstatus; } /* Set new Page status to VALID_PAGE status */ flashstatus = HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, newpageaddress, VALID_PAGE); /* If program operation was failed, a Flash error code is returned */ if (flashstatus != HAL_OK) { return flashstatus; } /* Return last operation flash status */ return flashstatus; } AI: The STM32 flash that you're interfacing with has an inherent page size. This page size reflects the physical organization of the flash memory and cannot be changed. On STM32F3 devices, this page size is 2KB. You can only erase an entire hardware page at a time -- there is no way to partially erase a page. Redefining the page size to 3KB in code will not work. The hardware page size is still 2KB, and a call to HAL_FLASHEx_Erase() will erase a 2KB page of flash based on the hardware page number. This will end up erasing the wrong data entirely. You could potentially use a virtual page size of 4KB (2 x 2KB), but you will need to make some changes to the EEPROM emulation code to support this. In particular, you will need to call HAL_FLASHEx_Erase() twice -- once for each physical page.
H: DS1302 maximum current source/sink? What is the recommended and maximum current sourcing and sinking capability on the DS1302? Is this what's given by "Active Supply Current" in the spec? AI: Current source and sink are given as IOL and IOH on the data sheet. That is for signal pins. Not sure if that is what you are after.
H: LDO ground with Diode for temperature Drfit compensation I work the below circuit. LDO is 3.2V fixed , Two diode is connected one at output and one at ground for compensate the temperature drift occur. Op is connected to a micro controller VDD-BUS which takes generally 10mA current. D1(SD103ATW-7-F) top diode which i mention in datasheet ( 0.32 at 5mA If), So the output voltage (OP) should be a) 3.2V with respect to ground ( since both diode cancel each drop) b) 3.4V with respect to ground ( since diode at ground will have very low current Iq of LDO) Any adivse. AI: If you add a single resistor to drive a few mA through the 6-1 diode then you'll be a lot closer. The problem is that the voltage across the diode will be much less at 25~100uA than at 5mA. At various temperatures, it looks like the typical difference will be in the 100-150mV range (Fig. 1). As well, I'm not 100% confident that those numbers are not a bit optimistic. You might want to grab the SPICE model and do some simulations, but of course that will only tell you the typical behavior not worst-case. The MCU current drain is likely also highly variable. There are probably better ways of doing what you have in mind, but if your application will tolerate a few hundred mV difference maybe this is a usable solution.
H: Question about using variable reluctance sensor I am integrating a variable reluctance sensor into my project. These take the the signals produced by inductive pickups and convert them into nice square signals that a processor can use. Quite often, the voltages produced by inductive pick ups can be very large (> 100 volts). Becase of this, most of these sensor inputs are rated over 100V (see the LM1815 or the NCV1124). However, one sensor IC, the MAX9926, appears to have inputs that are limited to Vcc. This doesn't make sense to me. Am I reading the datasheet wrong or do they expect you to take care of clipping the voltage before the IC input? AI: The current on the input pins is rated +/- 40 mA. The data sheet shows 10K resistors in series with the input. So if the input is 100V the current into the chip would be 10 mA. Internal protection diodes clamp the input to VCC + diode drop. If input is really 100V I would attenuate it with resistor divider or external clamp to be safe.
H: Is there some way to measure mains voltage with the ACS712 sensor? Last year I went to a maker event where some guys used an ACS712 sensor with an Arduino to monitor the mains voltage and current to monitor the energy cost in the house. One thing I saw there is that they were measuring the mains voltage with the ACS712 sensor (as its values had some 0.1V to 0.5V variance when I was talking to them). I was playing at home with one of these sensors, but I couldn't find a way to measure the mains voltage with it. Is there some example or tutorial of how can I can do it? AI: One thing I saw there is that they were measuring the mains voltage with the ACS712 sensor No, they weren't using that sensor to measure the mains voltage. It measures current only. (as its values had some 0.1V to 0.5V variance when I was talking to them) That variation in the reported mains voltage does not mean that it was being measured using an ACS712 sensor. I couldn't find a way to measure the mains voltage with it You couldn't find a way to do that, because there isn't a way to do that. The "live side" measurement connections of the ACS712 (pins 1+2 and 3+4) are isolated from the Hall-effect sensor on the low-voltage side of the device (2.1kV RMS minimum isolation). Therefore the ACS712 cannot be used to measure the "live side" (e.g. mains) voltage. (Image from ACS712 datasheet) In summary: The ACS712 + Arduino system which you saw, measured the mains voltage some other way. The ACS712 was used only for the current measurement.
H: Do voltage-limiting resistors exist? I see sometimes that resistors are specified as current-limiting resistors, so I decided to see if voltage-limiting ones exist. When I do a search though, I don't see anything mentioning voltage-limiting resistors. AI: A voltage source is theoretically capable of supplying an infinite current into a short circuit hence if a series resistor is used then that short circuit current becomes amps or milliamps rather than infinite amps. A current source, on the other hand, will not be affected by a series resistor at all - it will continue to produce whatever voltage is needed into an "open circuit" resorting to making a sustained electrical arc to create a conductive path if necessary. In these circumstances a parallel resistor will restrict the open circuit voltage because it will conduct the current back to the other terminal of the current source. So, in short, a resistor can be a voltage limiting AND a current limiting device. I see sometimes that resistors are specified as current-limiting resistors They are not specified as such i.e. a resistor isn't to be regarded as a current limiting resistor rather, it is the function it plays in the target circuit that may be described as "current limiting".
H: Uknown connector type I'm looking for some information for the type of the connector this drone is using. My nephew lost his charging cable for it and he can't reachage it anymore. Can someone provide me with information if this connector has a specific name that I can look for or it's some proprietary connector that can't be found. Below is a close up image on the connector in question and here is the link to the drone itself: https://uae.souq.com/ae-en/taiyo-water-drone-29717429/i/ Any info will be much appreciated. AI: It rather looks like "SYMA-X5C-X5S-X5SC-X5SW-X5HW-X5A-1-X5HC-RC-Quadcopter-Lithium-Battery-Connectors-Battery-Charging" connector, You need the red end, whichever the name is. JST connectors do not have the split/notch.
H: Controlling an Array of Motors I am trying to measure the state of a switch on a vending machine motor (model # BC-D27/28). It has a micro switch on it that has a lead going from COM1 to NC2 when engaged and COM1 to NO3 when disengaged. There seems to be a 18 mV state when the switch is engaged that drops to zero when it is disengaged. The machine is wired only to the + and - terminals of the module. Ultimately I would like to control an array of these with an Arduino or Raspberry Pi. How can I measure the state of the motor's switch to know when to disengage the motor? AI: A switch state can be measured with a pullup resistor and a GPIO input. For example: simulate this circuit – Schematic created using CircuitLab In some cases there may be an internal pullup that you can turn on and even get rid of R1 but it's better to run a bit more current through the switch than internal pullups deliver. R2 provides a bit of protection, and is not strictly necessary. Vdd will be 5V or 3.3V depending on the microcontroller. If the switch is connected to the motor internally (hard to tell from the photo) you'll likely have to disconnect it or you could damage the microcontroller.
H: How can I signal a USB charger to provide power? I want to use an 18650 battery pack to power a circuit with 5 volts at a low current. The 18650 battery pack has a USB output which provides 1 amp at 5 volts. I measure voltage drop across the left and right pins and it’s only .77 volts. When I plug in a device like a phone, it goes to 5 volts and a light turns on on the charger board. How can I get power without talking to the charger board? Ok actually I solved my own issue through dumb luck. I plugged it in and it turns out my clumsy self had shorted the usb shield to positive and it tripped protection until it was plugged into the charger. Now everything is working great @5 volts 300mA (I’m powering 4 hall sensors). AI: Power delivery from power packs doesn't need enumeration. As a matter of fact, none of standard power schemes do this, the entire power delivery or older battery charging protocols/handshakes don't rely on USB enumeration. Battery charging was intentionally specified outside the USB in-band signaling protocol. However, many powerbanks have a design feature to shut itself down if the current drawn from it falls below 50-70mA. Try to add an extra load (like 47 Ohms resistor), or find a powerbank that doesn't have the cutoff threshold. For more details see this discussion. There are references to models that don't have the shut-off.
H: Load causes voltage collapse. Why? I have a circuit where a typical 3.7V LiPo battery supplies power through a bq24074 Charger IC, which should in theory short that voltage straight to the output of the charge-protect circuit, which then can be attached to a load. For a load, I'm having an electronic load drain constant current of 200mA. The flow is as I described: [LiPo] ---(Vbatt)---> [Charge IC] ---(Vload)---> [Electronic load] When the load is turned on (draws 200mA), the battery voltage remains relatively unphased, but the voltage between the Charger IC and the Electronic load drops to 1.7V from 4.0V. I followed the application schematic from the datasheet almost exactly, only changing resistors that control charge current rates. The application I have for this only draws around 15-25mA, and at those draws the voltage collapse is much smaller so there's no urgency in solving this. That said, in the future I want to implement applications that have infrequent large spikes in current consumption, so it begs the questions: In the situation I described, why might the load be causing the voltage to collapse? (and bonus question for curiosity's sake, since google wasn't helpful:) In general, why might a load cause voltages to collapse? AI: The standalone circuit on page 36, Fig.41, has one missing connection, pin SYSOFF. This seems to be the datasheet mistake. The spec says about SYSOFF pin: System Enable Input. Connect SYSOFF high to turn off the FET connecting the battery to the system output. When an adapter is connected, charging is also disabled. Connect SYSOFF low for normal operation. SYSOFF is internally pulled up to VBAT through a large resistor (approximately 5 MΩ). Do not leave SYSOFF unconnected to ensure proper operation. SO it looks like the transitor Q2 (see functional diagram section 9.2) is floating, partially open, which causes the voltage to drop. Connect the SYSOFF to ground for proper operations.
H: How to amplify RF signal to high enough level for a CMOS downconverting mixer? I've been reading original academic papers on mixers and now a RF textbook and I have been unable to understand a very basic thing, which is how do I get a RF signal, say -65 dBm, at a high enough voltage level for input into a CMOS-based downconverting mixer? Everything I read shows a LNA blackbox, which is fine and good, but LNAs amplify signals at what, 15-20 dB typically? How on earth is that even remotely close to activating a CMOS NPN transistor in the mixer with a typical threshold voltage of 700mV? +15dB gain on -65 dBm doesn't get it to 700mV+. And chaining multiple LNAs to get it to 700mV+ would destroy the signal with noise, no? I know I'm missing something extremely obvious here so be kind. I'm just starting out. I know there's a lot more to downconversion (filtering, etc). This question is solely about the initial amplification. AI: Here's a schematic of a typical CMOS mixer circuit: It's the classical "Gilbert" mixer. Although not clear from this picture, the bottom NMOS is just for biasing, you can view it as a DC current source. That makes the bottom half of this circuit identical to a standard differential pair. The inputs of this differential pair are connected to the outputs of the LNA so this differential pair simply converts the RF (voltage) signal into a current signal. That current (containing the RF signal) is then fed into the upper "business" part of the mixer, the actual switching happens here. For that those 4 NMOS in a row need to be switching on/off properly. Therefore the LO signal needs to be large enough. Do we need 700 mV (as you claim), in the order of Vt for that? No we don't! As long as the switching transistors switch "enough" then we will get an IF output signal. If the switching NMOS have a large enough W/L then even a 200 mV LO signal could be all we need. What matters is the difference in Vgs for each pair of NMOS. As long as one NMOS has a larger Vgs than the other NMOS and the difference is such that the current from the RF part below chooses one NMOS over the other, then the mixer will "mix". This is the same principle as applying a bias to a transistor in an amplifier circuit, by applying a bias we overcome the Vt (700 mV) "dead zone" of the NMOS so it is not an issue.
H: Resistor in the inverting terminal of the op-amp I was studying the gain of an op-amp in both inverting and non-inverting configuration. In case of inverting configuration, the resistor is in series with the applied AC voltage. But in case of non-inverting configuration, the resistor is not in series with the applied AC voltage. In other word, the resistor is placed on the inverting terminal for both inverting and non-inverting case. Why is the resistor used in the inverting terminal but not in non-inverting terminal? simulate this circuit – Schematic created using CircuitLab The circuit shown above is the copy of one shown in my textbook. The first one is in the inverting configuration with resistor in series with the AC source. The second one has resistor connected to the inverting pin and other side to the ground. I know the signal is applied to the right pin, but why with resistor in one case and why not with resistor in another case? Thanks in advance.. AI: The placement of the resistors around the opamp is related to how the circuit works. Let's first discuss how the non-inverting amplifier works: simulate this circuit – Schematic created using CircuitLab In this circuit the opamp is used in such a way that it will try to make the voltage difference between its - and + inputs zero. Since we apply the input signal directly to the + input the opamp will try to make the - input follow that signal. It can do that by driving the output appropriately. Note how R3 and R4 make a voltage divider. Suppose that R3 and R4 have the same value and the input signal is 1 V. Then to make the voltage at the - input also 1 V, the output of the opamp will need to be 2 V. Now we discuss how the inverting amplifier works: simulate this circuit Also in this circuit the opamp is used in such a way that it will try to make the voltage difference between its - and + inputs zero. Here the inputs of the opamp are at a constant voltage, they're not following the input signal (as in the non-inverting amplifier circuit). Since the + input is grounded, the opamp will try to keep the voltage at the - input grounded as well. Personally I think the easiest way to view how this works is to look at the current through R1 and R2. No current can flow into the opamp's inputs so the current through R1 and R2 are the same, it is the same current. Now if we consider that the - input is kept at 0 V then R1 will have the input signal voltage across it. So the current through R1 is Vin / R1. Similarly the output voltage is across R2 so it's current will be Vout / R2 (I'm ignoring some - signs here, just bare with me). Suppose Vin = 1 V and R1 = R2 = 1 kohm. Then the current through R1 is 1 V / 1 kohm = 1 mA. Then in order to keep the - input at 0 V, the output must be at a negative voltage of -1 V because Vout / R4 must be that same 1 mA flowing through R1. So here R1 is needed to act as a voltage to current converter. If we made R1 = 0 ohm what would happen? Then there is no way that the opamp's output can pull its - input to 0 V, the - input is shorted to the input voltage so there's nothing the opamp can do to influence the - input's voltage. For the non-inverting amplifier, a series resistor is not needed. No current flows there so adding a resistor does nothing. In fact, you can add a series resistor and it would not change anything as no current flows.
H: Altium 18 Place 3D bodyl dialog box missing I'm trying to import a .step model into my footprint. I just upgraded to Altium 18 last night, and for some reason when I either click the icon to place 3D Body or go to the Place->3D Body menu, it doesn't open the dialog box. Instead, my crosshairs turn green and it wants me to define some kind of region. How do I get the dialog box to appear? It's not opening in the background... AI: Make sure the properties window is open, In altium 18 a lot of functions are incorporated into the "properties window" including this one. There you should be able to find your options to place an external .step file, click the generic button under 3D model type and you can browse for an embed model path.
H: USB type-B sockets vs USB Mini-B sockets Most Programmers hardware equipped with USB type-B connectors for connecting to PC. USB Mini-B connectors are much less used in device programmers. Have the USB type-B connectors any advantages or benefits over USB Mini-B connectors when use in device programmers? AI: Mini-B was popular before the advent of Micro-B. Its downside is the tendency of the plug to get loose, as its relatively small, but doesn't have the hooks that Micro-B has. So, it's mostly a mechanical thing. Since programmers (I assume you mean EEPROM programmers or something like that) are typically not as size-restricted as say, smartphones, you just use the larger, more durable plug. Makes sense to me. Also, that large plug is easier to handle.
H: Design for manufacturability I am a current EEE student and was wondering how the process of design for manufacturability works? What are the technical and safety issues that a manufacturer focuses on when designing a product to mass produce and sell? For example how do they determine that the circuits/product will not stop working after 6 months? AI: I'm just a noob in electronics, but I will do my best to think of some considerations: Checking for each component's datasheet, that the ranges where the component work in are (well) within specifications (i.e. not more current/voltage than specified) Endurance tests, probably with voltage/current close to the range, maybe even slightly above it. Although endurance tests are not done for more than hours/days probably (per test). For safety (not related to 6 months) there are a lot of rules, depending per country. Manufacturers should apply these rules in their products. Probably also 'misuse' by users is taken care of, like not accidentally using the device with an adapter reversed (by using diodes). EMF tests or other tests with hash conditions, like noisy environments for motors/sensors/communication devices.
H: Tune the track length of a segment but not the entire net in Altium I have a differential pair routed like this: U1 ======> U2 ========> U3 I want to equal the length of the pair between U1 and U2, but Altium always try to equal the entire net length between U1 and U3. Are there any method to achieve this? AI: Maybe you could place a net tie in your schematic either between U1 and U2 and place this net tie at the end of trace you want to do the length matching on. When using a net tie both of the signals on either side gets their own net name even though they should be connected. I haven't tried this myself yet, but give it a read. This is achieved by connecting the 2 nets through a Net Tie component. A Net Tie component is nothing more than a controlled short circuit. On the schematic, the Net Tie component has two (or more) pins, with each pin connected to the nets to be shorted. Note that the pins are not wired to each other on the schematic, but they are connected together within the PCB footprint. Altium description
H: Turns ratio of multi winding transformer Hi can anyone let me know what is the overall turns ratio of the transformer shown in image below as i was confused AI: You could describe the overall turns ratio as: 9.25:2(C.T.):1(C.T.), where the first number is 3-5, the second is 8-10 with centre tap 9 and the third is 12-14 with centre tap 13
H: How to show a long sentence on character LCD by using bascom? I want to show a long message that going to differ every time and it's 3 lines or less. This message comes from Sim900. I cant show the whole sentence on my 4x20 lcd. how can I print it in several lines? AI: See SPLIT. You can use e.g. the SPLIT command to split the text in multiple lines (like 0-20 for the first line, 20-39 for the second line, 40-59 for the third line). However, this is quite a 'crude' way because words will be split in the middle. To improve this, some smarter algorithm is needed, e.g. checking position 19 if it is a space, if not, go backwards until a space is found, than print index 0 to that position (except the space) to the first line, and do the same for the other two lines. Also it might be there are no spaces at all, or the text will not fit on the three lines (like words of 10 characters each with spaces in between).
H: Can R-783.3-0.5 DC-DC converter be used with 5V input? I need to use a DC-DC converter to obtain 3.3V/100mA from a 5V supply. I have a R-783.3-0.5 available, but I am not sure if it can work with 5V input. The datasheet says that the minimum input voltage is 4.75V, but note (5) says: "The R.783.3-0.5 requires Vin>5.5V to meet the Transient Response specifications". I do not understand what it means. So, can this converter be used with 5V input or not? AI: The input rating of the R-783.3-0.5 is 4.75V up to 32V. So yes. However, transient response from/to 100% <-> 50% and 10% load will not meet the given specification of ±75mV and ±100mV. For this 5.5V is required. In other words, you might shortly get less than 3.2V or more than 3.4V if you have large load steps when Vin is below 5.5V. If the 5V is from USB, I'd recommend not using this converter, since USB is allowed to go as low as 4.40V within spec.
H: Driving an Arduino with 12 V I have an Arduino that I want to drive using a 12 V source. Of course, this can be achieved using a voltage regulator or similar solution. Notably, there is a loss in the conversion (at best, this is roughly 5 % with the best switching regulators), which is acceptable. That is all fine. However, I also know that I need to drive a few LEDs. Let us for now ignore the fact that the LEDs work with 3 - 3.6 V and that the source, being a lead-acid battery actually differs in voltage depending on charge. Assume that I have a LED with exactly 3.5 V drop and place two in series with the Arduino, producing a voltage distribution as 3.5 V, 3.5 V and 5 V. In the below circuit diagram, the Arduino is modelled as a resistance (commonly called an R-duino), but I suspect it is not very accurate. Exactly, what will happen? My guess is that since LEDs are passive and the Arduino consists of active components, the current draw will be decided by the Arduino, causing the LEDs to shine more brightly when the Arduino draws more current and shine less when the Arduino is in sleep/idle. If we disregard the losses in cables and such, could this solution be considered having 100 % efficiency? If not, then where are the losses (note that light emission is desired and not a considered loss)? AI: In the below circuit diagram, the Arduino is modelled as a resistance (commonly called an R-duino), but I suspect it is not very accurate. You're right - it's not very accurate. The Arduino runs on a steady 5 V supply but its current varies depending on its load and what it is doing internally. Assume that I have a LED with exactly 3.5 V drop ... Nope, we can't assume that as no LEDs behave this way. There are two problems: VF, the forward voltage, is not a constant but varies with current. VF varies from device to device. Figure 1. If vs Vf for an LED nominal (blue) and spread (shaded area). Source: Variations in Vf and “binning”. My guess is that since LEDs are passive and the Arduino consists of active components, the current draw will be decided by the Arduino, causing the LEDs to shine more brightly when the Arduino draws more current and shine less when the Arduino is in sleep/idle. Correct, but note that when the Arduino is in idle that the If/Vf curve shows us that the voltage drop across the LEDs will decrease. This will increase the voltage to the Arduino and the end result will not be good. If ... could this solution be considered having 100 % efficiency? Nothing is 100% efficient, but you are right in that if your load didn't require a particular voltage - or could at least tolerate some variation in voltage - then your circuit makes use of power that would otherwise be wasted in the regulator. simulate this circuit – Schematic created using CircuitLab Figure 2. Both circuits use 12 V x 10 mA = 120 mW. The second gives four times as much light for the same energy. Note that very often we use this idea. If we require an LED indicator on a 12 V supply then 10 V will be lost in the resistor. We can add in additional LEDs without affecting the power budget. If not, then where are the losses (note that light emission is desired and not a considered loss)? LEDs dissipate heat as well as light.
H: In an ideal transformer circuit, how is power transferred? If I have a system of circuits like this: where Circuit 2 is providing power the Circuit 1, where does the energy come from? Do the inductors store energy? If not, how is power transferred from the Circuit 2 to Circuit 1? I initially thought that inductors won't store any power and the power must come from the mutual inductance. Am I correct in thinking that? AI: I initially thought that inductors won't store any power and the power must come from the mutual inductance. Am I correct in thinking that? Yes, the equation is this for one inductor, \$\Phi \$ is the magnetic flux E is the EMF or voltage and N is the number of turns. $$E= N\frac{d\Phi}{dt}$$ Since an ideal transformer has 100% mutual inductance connection from one coil to the next, it means that all of the magnetic flux is directly linked so \$\Phi \$ would be the same on both sides (in a real transformer some of the magnetic flux is lost and is not exactly the same on both sides) $$E_{primary}= N_{primary}\frac{d\Phi}{dt} $$ $$E_{secondary}= N_{secondary}\frac{d\Phi}{dt} $$ Then you get this relationship $$\frac{E_{primary}}{E_{secondary}}= \frac{N_{primary}}{N_{secondary}} $$ The power is transferred through the magnetic flux (not the magnetic field, because energy transfer can only happen if the magnetic field is changing hence the rate \$\frac{d\Phi}{dt}\$) Inductors do store power and do so for a given amount of time, they do this by creating a magnetic field around the inductor as a current is converted to a magnetic field. If the current is removed, they generate voltage or EMF. Transformers have a 'load' on their coil so they don't store energy as well as an inductor because the energy is transferred to the secondary coil.
H: PWM, PAM, PCM sine generation and usage confusion I am confused about something fundamental regarding PWM, PAM and PCM. I am going to be using a speaker's driver analogy to explain my point. As far as I know motors use PWM for power input, I don't know if my scenario with the speaker is any different but that's where it all began from. As far as I know some DAC's convert digital signal to analogue signal using PCM. So you have pulses varying in amplitude being used as a carrier to represent a quantized signal (Fig. 1). That signal is then passed through a low-pass filter to interpolate the discrete pulses and get rid of the high frequency carrier. We feed the reconstructed signal into the speaker and we get clear audio. Figure 1 Then we've got PWM with varying duty cycle (Fig. 2). Let's assume it's Vhigh is 1V and its Vlow is -1V. By varying the pulse width in a certain order we can get a desired signal (a sinusoidal in this case) as we can calculate the average voltage of each cycle: Vavg = D*Vhigh + (1-D)*Vlow, where D is the duty cycle. The result is a choppy sine wave but a sine wave nevertheless. Figure 2 Now, this is where I am getting confused, sounds like a paradox to me. If I fed a PWM signal from Figure 2 into the speaker, what would happen? Would I hear a sine tone or the speaker popping as if it was being pushed back and forth? I understand that the average voltage comes to a sine wave, but if I connected an oscilloscope to the signal's output I would see a PWM, so what outcome would I get without any filtering or interpolation? Similar thing with PAM, if we have 50% duty cycle and PAM pulses in a sequence of a sine wave, what would the speaker output, a tone or a popping noise? AI: Would I hear a sine tone or the speaker popping as if it was being pushed back and forth? Usually, for audio, the PWM frequency is substantially above 20 kHz (and usually above 100 kHz) so the speaker (if directly connected to the PWM signal) would reconstruct the audio on the cone because it has mass and cannot move the cone at the PWM rate. In other words the speaker acts as a low pass filter. However, the PWM frequency may still produce cone movements that can annoy bats/animals but a human wouldn't hear this. But, there will be energy lost in the speaker due to the raw signal being applied and this may not be negligible hence, an inductor/capacitor low pass filter is chosen that removes the PWM "carrier" content. The same applies to a motor - a motor isn't usually as "agile" as a speaker and may be operated at a PWM frequency in the low kHz range but it can still present a problem with over-heating when connected to the "raw" PWM signal so extra low pass filtering is sometimes employed. Similar thing with PAM/PCM, if we have 50% duty cycle and PAM pulses in a sequence of a sine wave, what would the speaker output, a tone or a popping noise? Again, the answer is similar; the "digital noise" is almost certainly at a much higher frequency than audio so some filtering may be required but it won't affect the sound quality or the sound produced if the PCM frequency is high enough.
H: Number of prime implicants How many prime Implicants are there, 2 or 3? F(w,x,y,z)=Σ(5,7,8,10)+d(9,11,13,15) I am confused if red block will be counted as Prime Impicant or not? AI: By the definition: A prime implicant of a function is an implicant that cannot be covered by a more general, (more reduced - meaning with fewer literals) implicant. it is a prime implicant as it cannot be covered by some other (single) implicant. But it is not an essential prime implicant defined as: Essential prime implicants (aka core prime implicants) are prime implicants that cover an output of the function that no combination of other prime implicants is able to cover. because it is fully covered by two other implicants.
H: Kicad - Custom library folder How do you create a folder to hold your custom components? The tutorials I've come across such as the official getting started guide show the creation of only one custom component. Using this approach you end up with several folders... For example in the image below, I have created two custom libraries, ALU_ROM and CONTROL_UNIT. Each appears in its own folder... However, I want instead to have a folder named COMPUTER, where both components (and more in the future) reside. How can I do this? AI: To create a new library: Click on the "Create New Library" button on the top left - To choose a library for your new symbol: When you click the "New Symbol" button it prompts you to choose which library you want to add it to. Click on the library you want and press "OK" (or just double click). Then just save your symbol as you normally would. It'll be added to the library. To move a symbol to a different library: It's as simple as Cut & Paste. To export the symbol you're currently viewing into a different library: Click the "Export" button... ... and save it to the library you want.
H: Why are my relays dying? I am using a SainSmart 5V 2-Channel Relay Module for Arduino to drive a hot plate (110V, 1000W). I plugged my Arduino VCC and GND to the VCC and GND pins of the relay board and I drive both relays simultaneously through one of the digital output pin. The relays are controlling both the phase and the neutral of the cooking plate. In order to control my temperature, I turn the relays on or off in a 15 seconds window. Twice, already, my relays appeared to die. The LED still works, and I still hear the noise when it is toggled, but the contact is not made anymore. What am I doing wrong? How can I fix it? AI: If possible increase your time base to double or triple the 15 seconds. A better relay will last longer- you could also go to an SSR, but it would require a fair size heatsink to dispose of around 9-10W. The lifetime of a mechanical relay will be specified in the data sheet, but typically it’s around 100K at full load, so at 15 seconds that’s a bit over 2 weeks 24/7. If it’s 50K, obviously half that.
H: How to flicker high-power LEDs with precise square or sine wave? I need some advice regarding a setup with high-power LEDs I am currently working on. My aim: I have a set of 6 high power LEDs (http://www.roithner-laser.com/datasheets/led_highsingle/apg2c3-530.pdf) that I need to flicker at different frequencies (between 20Hz-1kHz approximately) preferably with a sine or square wave and fixed 50% duty cycle while keeping the luminance constant. I also need to be able to set the frequency from a PC (e.g. using MATLAB). My attempted solution so far has been to power the LEDs using a bench power supply unit and a customized circuit (schematic below) while controlling them from an Arduino. However, with this setup, the wave is not square and there’s an observable change in luminance as a function of frequency with higher frequencies resulting in lower luminance (oscilloscope luminance measurements below). I’ve tried the same code with a simpler circuit (a low power LED and a resistor connected directly to the Arduino) and I get the same results. I’ve also tried a different code using the TimerOne library, and the wave has the same shape, resulting in the same changes in luminance. At this point, I'm considering switching to a different solution completely. Is there a different setup that would give more precise results? Ideally, I would like to keep the cost low (less than $300), with some flexibility there; and as I don’t have any expertise in electronics, the simpler to set up the better. I've been searching for solutions online and it seems that a constant current LED driver could help with this problem, but I'm not sure how would I generate the wave and modulate the frequency from a PC in that case. Any help would be greatly appreciated. Many thanks in advance! Edit: The LED's rise time has decreased significantly with @JackCreasey 's proposed solution: AI: There is not a lot wrong with your thinking about your problem, it's just a problematic implementation. In your schematic when you turn the transistor off the LM317 will stop conducting and pull the voltage up to almost the battery supply. When you turn the transistor on you include the fall time of the transistor, the settling time of the regulator and the time it takes to charge the forward capacitance of the LED. These types of LEDs have rather large junction capacitance which can be problematic for constant current drivers. What you need to do to operate the LED in a very fast mode is to ensure that only the current through it is switched, and minimize changes in the voltage across it. The datasheet for your LED ( the APG2C3-530 ) is a bit lacking in detail, so I've clipped the important detail from a 350mA Green LED. Here, in the left hand graph you see the forward voltage (Vf) of the LED vs current through the device. In the right hand graph you see the luminous output versus current. If instead of setting the LED current from zero to 350mA (in this example) we set the current from 1mA to 350mA we get a 1000:1 change in brightness. If this is sufficient for your needs then the circuit below can help you. simulate this circuit – Schematic created using CircuitLab With M2 on the LM317 still provides 350 mA, but the voltage drop across R2 is only 2 V. When M2 turns off the current flows through the LED. There is a risetime as the LED junction charges, but since the voltage transient is much reduced (it is not rising from Zero) this time is reduced. This circuit is very effective both for LEDs and Lasers, but typically the Vf slope of the laser is much steeper so the voltage transient less. You should certainly see your risetime improve when driven by a 50% PWM signal. There is enough detail in the schematic to run a simulation, but just be aware that the FET details are incorrect even though I show a viable part number. Update: From the Op's comments a question was asked whether 6 LEDs in series could be driven. IMO this would be closer to the upper voltage in for the LM317 than I would personally feel comfortable with. However you could comfortably run 4 in series (shown below). The best solution may be to actually only run 3 in series and run two strings with two LM317. I've added a string of resistors (R4 - R7) that mask the low current/Vf differences between devices, these may be optional. simulate this circuit
H: MCP23017 connection to CD74HC4067 through Diode I am connecting a digital output pin from an MCP23017 through a diode (1N4001, forward biased) to a CD74HC4067 input channel. VDD is 5V to all devices. I am seeing 1.45V on the anode side of the zener and 0.7V on the cathode side. Since the CD74HC4067 is hooked up to the cathode side of the diode, I'm also seeing 0.7V there. If I hook up the CD74HC4067 to the anode side, I see 1.45V there. I was expecting to see 5.0V-0.7V=4.3V at the anode side of the diode, why am I not seeing that? If I just connect the diode from 5V to ground, I see 4.3V when it's forward biased. Any help would be appreciated. Thanks! Edit: rectifier diode, not Zener. Fix found! I had to disconnect GPA1 (accidentally still had it connected). AI: I suspect you have the MCP23017 pin configured not as an output but as an input with a weak pullup and that you have an as-yet unreported 10K pulldown on the other side of the diode (on the input of the HC4067). 1N400x are just regular very slow rectifier diodes, not Zener diodes. It's always better to supply an actual schematic, it prevents wasted time and guesses. If you use the schematic button you can edit your question to include a schematic.
H: Please help with resistor color code? I have trouble with finding out resistance of a resistor. It has 5 bands but somehow I cant get the code right. AI: Here's my best attempt: - 1st band is grey because the 2nd band can't be gold (see above) = 8 2nd band is red hence = 2 3rd band is green = 5 This makes the value 8.2 Mohm The gold band makes it a 5% resistor and the final white band is the tricky one but I suspect it should be regarded as a "null" (or nil) band and meaningless as implied in this picture: - The final white band could imply a 20% tolerance.
H: why do most sensors have an electrical output, regardless of the physical nature of the variable being measured I have been trying to figure out a explanation to this question, can someone explain this ? AI: Why do most sensors have an electrical output, regardless of the physical nature of the variable being measured? Electrical control systems have the following advantages over alternatives such as mechanical, pneumatic, hydraulic, etc. Speed. Electrical control systems are fast. Size. The control systems can be miniaturised. Power. Electricity is readily available. No compressors or pumps are required. Reliability. Electro-mechanical (relay) systems can have high reliability despite the moving parts. Solid-state (transistor, triac, etc.) can have far higher reliability as there are no moving parts. Distance. Electrical signals can be transmitted long distances without significant loss. Cost. Mechanical control systems require precision components which can be more expensive to manufacture and calibrate. Versatility. Electrical systems are very versatile. Transducers are available to convert light, sound, pressure, force, strain, radioactivity, viscosity, temperature, velocity, etc., into electrical signals. The last one is probably the most important. While, for example, pneumatic logic and control systems exist and have their benefits (explosive atmospheres, for example) it is difficult to imagine how a light to air pressure transducer is going to beat a light-dependent resistor. In other applications such as temperature control mechanical solutions - car coolant thermostat, for example - are more than adequate.
H: Unable to start calculating this voltage divider I'm trying to solve all kinds of voltage dividers for an upcomming exam, but I'm stuck in this one. I've solved it in LTSpice, but I cannot solve it on paper. LTSpice showed me, that the Ux=3V, but closest to that, I got to 3.333V (which I got from a voltage divider equation Ux = (5V*2000)/(1000+2000)). I need just a "kick" for the start on how to start solving dividers as this one. AI: Convert voltage sources to current sources. One is 5 mA and the other is 1 mA. They will then be both in parallel with a resistor of value equal to the parallel combination of R20 and R22. And all of that will be parallel to R21. Enough of a kick? That solves to 3 volts without using a calculator.
H: How to transfer energy generated from electromagnetic induction to a USB port? For a school project, I'm creating a shake-powered phone power bank that will generate current similarly to a Faraday flashlight, which will in turn power a usb port. A simple enough concept. Now to my (limited) knowledge of electronics, as I understand it, this process of electromagnetic induction will induce an AC current, which I believe can be converted to DC via use of a rectifier. My problem lies in that I'm not sure how to store this charge. My original idea was to purchase and disassemble a power bank and rewire its input to my "shaker" circuit's DC current. However, I've been advised that without knowing what voltage my shaker will produce, this may not work as well as I'd hoped, and could end up frying the whole circuit. I know of supercapacitors, but there appears to be a wide range, with varying volts and Farads, of which I don't know what to choose. I would have assumed that more Farads would be better, considering that it is a unit electrical capacitance, which would give the power bank more capacity, however in this video that partially inspired the project idea, the narrator opts to use a 1.5F supercap instead of a 22F one, which has added to my confusion. (sidenote: if I use a supercap, I'd need to wire the USB port myself, which I'm hoping I can simply take off of the circuit of the store bought power bank, but let me know if that is a bad idea that will just cause more problems) Hopefully you people a lot smarter than I am can clear up how to go about wiring this thing up. Thank you in advance. AI: The idea is good! So, to talk about the problems: The power bank expects a charging input voltage of 5 V. How much above and below that it'll accept is pretty much undefined; don't expect charging to happen below 4.7 V, and don't expect damage-freeness above 5.5 V, I'd say. That'll be hard to do with your "shaker": The speed with which it's shaked defines the voltage, and obviously, shaking isn't a continuous motion, so that this will be impossible for the power bank to use directly. So, as Stefan Wyss said, you'll need some kind of voltage "smoothing" first, so that the very uneven voltage gets "processable" at all, and then a regulation that converts that voltage to a different voltage (namely, 5V). I'll go ahead and recommend not doing this with a shaking generator. Go for a small motor, such as you can salvage from old cassette players (avoid battery-powered casette players, their motors will usually generate too little voltage), and attach a lever with a small weight to its axis. Bringing that into rotation is about as complicated as vigorously shaking something, but much more power efficient. Attach your bridge rectifier to that. Add a large capacitor to its output – in fact, as large as you can cheaply get, so maybe 47µF (hint: when I took apart broken cassette players as kid, there were plenty of electrolytic capacitors inside ;) Watch their polarity!), and attach a small load to it (maybe 10 Ω or so – in a pinch, a small incandescent 12 V light bulb will do, and you can often get those cheap at gas stations. Measure the (DC) voltage across that load when rotating the weight at a realistic speed. Note down that voltage. It's hopefully well above 5V. If that's the case, you only need to step that voltage down to a constant 5V. Stefan's recommendation of the LM317 does exactly that. I'd go a step further and say that in your application, getting a switching voltage regulator would be a good choice – because the LM317 simply "burns" the voltage difference between 5V and what you generate, but with a switching voltage regulator, you actually get more current capability the faster you turn. A good powerbank might make use of that. As a general comment: In a school project, technical success is about as important as demonstration quality. Make good schematics, explain what part does what in your device. If something doesn't work as expected, write that down, and explain what you did to solve it. If the thing works well, make sure to make it robust enough (strong zip ties to solidly attach your motor to your power bank, for example, (beautifully) glue down flying cables, etc) so that you can give it to other people. Nothing says impressive like you having a half-empty powerbank that's full after giving it to other people for a while to rotate it (plus, if your thing is robust enough to entrust it to other people's hands, you don't have to do the rotating, which is a big plus, because it's a lot easier to explain stuff while not having to actuate something). simulate this circuit – Schematic created using CircuitLab
H: How does the power station compensates for the current that flows down to earth due to domestic body-current faults? I know current flows in a loop and energy is used to move it in a loop. Now suppose we get a single phase AC (220/120V) electricity supply for our home and we have earth connection to prevent shocks from the current that leaks on to the metal body of our appliances. So we have a circuit loop in which current (electron present in the wire) flows from station to house and back to the station (the direction of electron is opposite to that of conventional current flow). Also there are fixed number of free electrons present in this circuit loop. Now consider a situation where somehow current leaks to the body of a appliance and goes to ground instead of returning back to the power station( due to earthing). How is this lost current compensated by the power station which never receives it back ? I was talking about conventional current so if you talk about electrons I can reframe the question as how does the power station deal with the extra electrons that flows from ground(earth) back to the loop? Note: I know in the real scenario there are three-phase wires from the power station and a local step down transformer steps it down and provides us with 1 or 2 phases which forms a micro loop between the transformer and the house so the situation remains the same (wouldn't it?), although contained to the move loop instead of the giant loop. AI: I know current flows in a loop and energy is used to move it in a loop. Now suppose we get a single phase AC (220/120V) electricity supply for our home and we have earth connection to prevent shocks from the current that leaks on to the metal body of our appliances. OK so far. So we have a circuit loop in which current (electron present in the wire) flows from station to house and back to the station (the direction of electron is opposite to that of conventional current flow). Also there are fixed number of free electrons present in this circuit loop. Stop thinking about electrons. It doesn't help. Just think of voltage, current and energy flow. Now consider a situation where somehow current leaks to the body of a appliance and goes to ground instead of returning back to the power station( due to earthing). How is this lost current compensated by the power station which never receives it back ? The neutral conductor is "neutralised" by connecting it to ground. If there is no ground reference then there is no reason for the current to flow to ground. I was talking about conventional current so if you talk about electrons I can reframe the question as how does the power station deal with the extra electrons that flows from ground(earth) back to the loop? Again, thinking in terms of electrons is no help. Current returns to the power station through the ground and back to the source - the generator or its transformer in this case. Further reading: Does electricity always flow in a closed loop and why does current flow to ground?. Why is neutral wire connected to ground at the transformer?.
H: How to determine data transmission rate from an eye diagram? I would like to know how to determine the data transmission rate from an eye diagram such as the one given below: Would it be the reciprocal of the length of time from the start of the diagram to the end? In this case 3 micro seconds? AI: Observations: Symbol lenght appears to be 2µs, and there are three voltage levels. There is no transition from 1V to 2V in the diagram. Hypothesis: There is a coding on top that pairs two symbols to encode 3 bits, and the eye diagram was recorded relative to the start of symbol pairs. In this case, you get 3 bits per 4µs.
H: Difference between conventional Eye-diagram voltage plot and "Eye-density" plot in ADS Keysight Simulation I know what is eye diagram. It is the sampled voltage plot at the clock frequency (Usually) of my circuit and superimposed. If the logic 0 corresponds 0V and logic 1 corresponds 1V then for the ideal case, the eye diagram Amplitude will also plot the superimposed samples of the signal which corresponds to 0V and 1V. For the lossy channel, the amplitude moves away from the 0V and 1V level for logic 0 and logic 1 respectively. And that movement depends on the attenuation and loss of the channel. Generally I have seen so far to be around 0.8V or 0.9V for logic 1. Like below. This eye diagram is actually PAM4 level eye diagram. I generated in Cadence Virtuoso using its eye diagram tool using its embedded calculator. I am fine with that. Now, I have experienced in ADS Keysight simulation that they have Eye density which also produces Eye diagram. but I see it always plot the eye diagram amplitude into half. Like my below eye diagram that I generated in ADS using its generic TX, RX driver and low pass filter like channel. I have driven the TX with V_low = -1V and V_high = 1V PRBS signal. So, the difference is 2V. At the receiver (in simulation), it produces the eye with V_high around 0.4V to 0.6V. This is the case most of the time I experienced in ADS. So I was confused that Eye density is not exactly the conventional Eye diagram plot (Maybe or my conception of Eye density is not clear). Eye density Summary: In the help of ADS it is written like below: Density: A temperature view of the 3-dimensional eye histogram. The eye is automatically centered and displayed over 2UI on the horizontal axis. Color indicates the number of crossings of a segment in the time-voltage plane. Blue areas are cold, whereas red indicates comparatively more crossings. In statistical mode, the density histogram is plotted as if 1e6 bits are run. I am confused about what exactly then it produces if it is temperature view...because it is also showing the voltage amplitude of the signal. And the Amplitude (as it is showing in the summary is around 0.698V whereas my input signal difference is 2V. My channel was normal passive low pass filter-like channel. So, is the Eye density plot in ADS different from conventional Eye diagram? If it is what is then? Because the definition in ADS help is not enough for me to understand density. AI: temperature view = RGB , Blue = least common , like a phosphor decay storage scope. But probably a colour histogram of all voltage samples for each sample of cycle time. Your channel out/in = 0.7/2.0V is lossy and nothing much to say about this channel. There is a conventional correlation between SNR and BER and eye pattern statistics. It is useful to predict error rate and improve margin statistics if possible with a short term measure instead of longer term comparing data for errors. Symmetry, jitterRMS , width, height , & overshoot are all factors to consider.
H: Connector type suggestions required for 12V supply I made a power supply enclosure with a mains switch and now I need external DC connectors to be mounted in the slot shown. I want to mount two female connectors onto a 3D printed panel, that will sit where the slot is (see pictures below) and which will connect to the 12V DC output of the power supply. I will then put male connectors onto two wires, so I can easily unplug the power supply from the machine. What is the best connector for this? Please note I am not an electronics guy and primarily do mechanical engineering/design work so my knowledge on electronics is very limited at this point. Thanks in advance! AI: I would go for two things known as a binding post, but that also double as banana jacks. This sounds complicated, but they are actually quite common. This is the kind of connector you see often on benchtop power supplies. You can clamp bare wires into the binding posts, or you can plug in cables with banana pins on the ends. If you mount the two banana jacks the right distance apart, then you can use cables that have a double banana pin on the end, all as one molded part. Check the specs for such double pins to find the correct spacing between the banana jacks to allow the double-pin connector to work.
H: Identify this rechargeable battery pack I want to identify a rechargeable battery pack from inside an old portable hard-drive. It is unlabelled. (I ripped open the blue covering - it isn't labelled on the internal metal cover either.) Battery is ~55m x ~33m x ~5mm - so relatively flat. The plug is 3-4 mm wide. Device takes +5V DC, so I imagine that is the charging voltage. One part of the circuit takes 3.3V DC, so I imagine that's the output voltage. How is this battery specified? AI: It looks like one of a standard Li-Ion or Li-Po pouch cells, size 5.0 x 33 x 55 mm, more like 50 mm, or 503350 for short notations, could be 503250. An example from Adafruit of a 503035 battery: The example has h=5mm, w=30mm, and L=35mm To see the actual label and determine the size, you need to carefully remove the blue wrap and exclude battery protection part from measuring. CORRECTION: the battery protection part is included into length measurement.
H: Ambiguous symbol Does anybody know what this symbol presents? AI: Figure 1. Tri-state buffers with opposite control logic. Image source. It's a combination or overlay of the two symbols in Figure 1. Rotate the symbol on the right by 180° and overlay on the symbol on the left. Figure 2. Borrowing the symbol from KingDuken's answer but changing the infill to show the two buffers. If the control signal is high the gate transmits from left to right. If the control signal is low the gate transmits from right to left.
H: Can I replace a battery with a source of the same voltage but different capacity (mAh)? I have a device that has a bad battery and I am trying to find a suitable replacement. There are no replacement batteries for the device so I am trying to put something together myself. The original battery has written on it 3.7 V, 1.41 W. I have found a battery (CR123A) that is 3.7 volts and 700 mAh. Can I safely use it? Also, the original battery has 3 wires - red, white, and black. How would I connect the new regular battery? ** It's for my Nest thermostat. AI: The new battery (700 mAh) comes up with 3.7 * 0.7 = 2.6 Wh, so it should be capable to power your device. Your original battery (1.41 Wh) comes down to 1.41/3.7 = 380 mAh, or it is smaller than CR123A. It should be expected that your built-in charger uses no more than 200 - 380 mA charging current, which should be fine for CR123, it will just take a longer time to re-charge. More challenging would be the handling of "white" wire. I assume it is a plain thermistor, although it could be more complicated. You can measure the resistance between thw white wire to ground (black wire). If it comes up as, say, 10k +- 25%, then it is a thermistor. You would need to fool the white wire with the same value, plus-minus. Without the termistor the charger would think that the battery is overheated (or broken), and would refuse to charge it. The negative side is that the thermistor was there for a reason of extra protection, and your new setup will be lacking it. However, the Nest thermostat is a fairly popular product, so the replacement batteries should be freely available. It is advisable to get a direct replacement.
H: Why doesn't my charge pump work with 1.5v supply? I have been trying to get the following circuit to work with 1.5V AA battery but it does not work, even though it works fine with a 3.3v supply. I built the multivibrator circuit by discrete components because I haven't been able to find a suitable op-amp or timer IC that works at 1.5v. I observed the following in my circuit: At 3.3v supply, the output voltage on 3.3k Ohm load is 4.5v. I did not expect the voltage doubler to actually double the voltage, and I am not using Schottky diodes so I'm okay with with it. At 1.5V supply, though, the output voltage on the same 3.3k Ohm load is 1.4V. That is not really what I expected. I was thinking that I should be able to obtain at least 2V with the circuit but it decreased. I am trying to use this setup to power an ATtiny (works on >1.8V). I am really puzzled by it because even at 1.5V the oscillator works fine. It even dimly blinks a led when I use a larger capacitor. So why should it not be able to charge two small capacitors. My question is, what is lacking in my logic? Why are the capacitors not pumping charge at a lower voltage? Also, if you have any suggestions on how I can make my design more power friendly(maybe a different oscillator design or another voltage doubling topology) please mention them too. Also, please don't suggest charge pump ICs because it is almost impossible for me to obtain them. AI: With regular diodes, the forward volt drop is generally said to be 0.7 volts and this eats into the peak-to-peak voltage made by your oscillator so, the negative clamping voltage below 1.5 volts (brought about by D1) is more likely to be 0.8 volts and therefore the peak voltage is 1.5 volts higher (due to the oscillator producing 1.5 volts p-p) at 2.3 volts. This is then rectified by another diode (D2) which also "loses" 0.7 volts in the process hence, the final rectified voltage is about 1.6 volts. Of course, it's more likely that your oscillator is producing 1.3 or 1.4 volts p-p and this means your doubler is running out of steam big time. Try schottky diodes to get maybe 2.5 volts at the output (on very light loads).
H: BJT: Equation of Vce for Saturation Region In Sedra and Smith: Microelectronics Circuits (6E), it is mentioned, on page 185: Recalling that the CBJ is much larger than the EBJ, the forward-voltage drop \$v_{BC}\$ will be smaller than \$v_{BE}\$ resulting in a collector-emitter voltage, \$v_{CE}\$, of 0.1 V to 0.3 V. Why does a difference in junction area causes a change in the forward-voltage drop? A similar question was asked on the site, however, it did not help. So, I tried using Ebers-Moll model and that is where I am actually getting stuck. So, my question is this: How should I apply Ebers-Moll method for a transistor working in a saturation region, to get the equation for \$V_{ce}\$? So far, I know that there are three major Ebers-Moll models, here. I also read that the \$I_{s}\$ is a property of the emitter-base junction. Additionally, \$i_{c} \leq \beta i_{b}\$. Thank you for your time. Please inform me if some additional information is needed. AI: There is no formula for Vce(sat) because this bulk resistance is process dependent. The chip size, doping, layered etching methods all are factors. You must refer to the Vce(sat) parametric model or datasheet for this property. Diodes Inc (nee Zetex) has many of the earliest process patents of ultra-low Vce(sat) at high currents. They were also the first to characterize this as Rce, a linear resistance, in datasheets. This collector-emitter saturation bulk resistance called \$R_{CE}\$ is defined for Vce=Vce(sat) at Ic/Ib=10 at various currents. In some cases, the log-log, or linear graph of Ic vs Vce shows the linear property above 10% of Imax. example of Rce p.2 of 5 SOT-23 Prior to Zetex, you had to get a big power transistor in TO-3 can to get this low value of ~Vce(sat)/Ic. Equivalent On-Resistance Rce(SAT) 35m typ 50 mΩ max. @Ie = 2A, Ib = 200mA I have often referred to bulk resistance in diodes as ESR and this property is always inversely related to package power rating ( and thus chip size) as a designer's figure of merit (FoM). This property exists for all diodes and LEDs. Also Ic approaches 10%β*ib at Vce(sat), so that ultra-low Vce(sat) parts tend to have extremely high β.
H: Name of an enclosure in the shape of a DIP Years ago, in a junk bin far away, I saw a device which was a small plastic box with protruding pins in the form of a 14-pin DIP — so that you could solder jumpers or small axial components to the inside end of the pins, close it up, and have a module of your own design that could be plugged into a DIP socket. What would these be (or have been) called? I have a use for one, if I can find it. (Of course, I could abuse a DIP socket by soldering or just pushing individual leads into it, but in my experience, sockets have shorter (or thicker) leads and a shape not best suited for plugging into a socket, and it would be an open frame rather than enclosed. If that's my only option, I'll take it, but I'd like to evaluate the alternative I once saw.) AI: "DIP header". For example, this one. Some may have covers available. Eg. Aries. They're a niche product, so not cheap.
H: Op. amp. with integrator - enough values to start? All the red-circled values (Uref, C2, R31 and R36) are missing. I'm supposed to calculate them, but I think there's at least one value missing. Shouldn't Uref be known to calculate the rest of the values? The waveform was given beforehand. The power supply voltages are +/-15V for both op. amps, where the green line is the output of the integrator and blue one is output of the Schmidtt trigger. AI: Not right. You should deduce Uref from the output waveform. It's well possible after you have made it clear how the circuit works in details Some guidance: Find how to make the switching levels of the schmitt-trigger to be the extremes of the triangle waveform. You have 2 unknowns (one voltage; one resistor) and 2 voltage division equations. Then find an integration time constant which makes 15V charging in 2ms with 15V input to be true. You can select integrator's R or C freely, if the parts are ideal. In practice you must obey output current limits and the need to keep the drift low enough. ADD due the comments. Seemingly you have skipped some basic lessons. Now it's the right time work them. Time constant: The output of the integrator changes just amount -U in time RC, where U=the input voltage of the integrator. You need -15V transition in time 2ms when the input is 15V from U13. RC=2ms is right. 1uF & 2kOhm are ok. Output current 7,5mA isn't impossible for practical opamps altough 0,1uF and 20kOhm would need only 10% of the current. NOTE: Your Schematic possibly demands that R31=R36. Then you cannot select R31 freely, you must use the value which satisfies the Schmitt trigger's switching levels. The Schmitt trigger (=ST) should flip its output when the integrator output reaches +10V or decays to -5V. In the former case ST's output is -15V until the +10V limit is reached and after it ST's output is +15V until the -5V limit is reached. See this generalized voltage divider: You must be able to prove with elementary DC calculations the formula of Ux in case Ux is not loaded with any current. If you cannot prove this when your teacher wants, you will fail. Let Ua be the output of the integrator, Ux=the voltage in the plus input of U13 and Ub = the output voltage of U13. We can use Ux's formula if we assume U13 is ideal (= its inputs do not take significant currents and the output really reaches plus and minus 15V) Now you should write Ux=Uref in two cases: 1) Integrator's output reaches +10V but the ST still outputs -15V. 2) Integrator's output has dropped to -5V but the ST still outputs +15V. Now you have 2 equations which give Uref and R36.