source
stringlengths
620
29.3k
target
stringlengths
12
1.24k
Solution for different Wire sizes in one circuit I have two ac voltage sources in series. the connection between the sources is a 13 gauge wire. the rest of the circuit uses a 16 gauge wire. for safety i dont want to exceed 20 amps. is there a ac current limiter that i can place between the 2 voltage source? <Q> You should hire an electrician. <S> You are going to start a fire or get shocked. <S> But I will try to answer your question anyway. <S> Fuses and circuit breakers are generally governed by some type of code. <S> I don't know what country you are in, but in the US, the national electric code (NEC) is generally the authoritative source. <S> So based on wire diameter and insulation temperature rating, you chose a specific size of fuse or breaker. <S> The purpose of circuit breakers is to prevent the wire from getting too hot and burning up the insulation or starting a fire. <S> In fact, I am not sure if the NEC allows you to use 16 AWG wire at all. <S> The maximum fuse or breaker for 14AWG wire is 15A. <S> I also want to point out that putting two AC sources in series is a tricky business. <S> The sources need to stay synchronized somehow. <S> This makes me wonder whether what you are doing is a good idea in the first place. <S> I hope you know what you are doing! <A> A 20A circuit breaker or fuse would work. <S> Whether this would actually render your circuit safe is impossible to say without more details. <S> You should be aware that even with a fast blow fuse, more than 20A can flow through the circuit for a short time. <S> Make sure that your breaker/fuse is rated for the max voltage that I can be exposed to, not just the current. <A> Sure, you've got 15-20 in your house right now. <S> Head on over to your nearest hardware store and pick up one of these and put it in series with your circuit. <S> Also do note that if you only had 16ga wire in your circuit, it would not be any safer than your original circuit with 16ga and 13ga wire. <S> The wire isn't going to current limit your circuit, it'll just start a fire if you run it at too high a current for too long. <S> So even if you're using all 16ga or all 13ga wire, if your power supply can output more current than the wire can handle, add a fuse please.
However, you cannot protect 16 AWG wire with a 20 Amp fuse or breaker.
Relay-Relay circuits: flywheel diode - yay or nay? If you're going to control a relay with a transistor and will not include a flywheel diode, you're going to have a bad time, it's a known fact. But what about relay-relay circuits? I have mixed feelings about this: When "driving" relay A is switching off another relay B, the inductive kickback of coil B would produce a spark in relay A contacts, thus, potentially reducing the overall life of relay A. So, we just include a flywheel diode on relay B and none on relay A. Well...what if A is also driven by another relay? (i.e. in a relay-based CPU? :)) So, if all relays have flywheel diodes, then we have a problem on "driving" or "controlling" relay A again: according to this article: http://www.te.com/commerce/DocumentDelivery/DDEController?Action=srchrtrv&DocNm=13C3264_AppNote&DocType=CS&DocLang=EN adding a flywheel diode would modify de-energizing profile of the coil, which modifies how the contact spring reacts to a switch off, which damages spring and reduces life of a relay. Any comments? Drop them, use them, or use diode+zener? I think I may have to just make a pair of inverter loops (with and without diodes) and see which one dies first :) <Q> I would say diodes are virtually always better, ignoring the slight complexity increase and minor cost (pennies for parts or fractions thereof), unless there is some reason to get every fraction of a millisecond speed (and then you shouldn't be using relays at all in the current year). <S> Contact life reduction due to slower drop-out is not a serious concern because relays of normal size do not draw significant current for most power relays. <S> i.e. you are using a 10A relay contact to switch 60mA. <S> So if your PLC is switching the coil of a DC power relay, I say put the 1N400x in there <S> and it will last much longer. <S> Or use a solid-state output. <S> Yes, you can use the zener + diode or resistor + diode and it will give you a bit of a compromise (more sparking but faster drop-out), but it's not all that often necessary, and it could cause more issues with field repairs because it will be unfamiliar to service people. <A> You don't want to include an extra point of failure into a system with a 40-years service life. <S> Additionally, many relay circuits rely on being able to power a relay with either polarity, something a flyback diode would prevent. <A> Choosing an adequate circuit also depends on how many operations will the relay be doing during its expected life. <S> Will you flip it once a day in a garden light style? <S> or will you switch it a high frequency in an antenna tuner style? <S> Unless you are abusing it's current capability the number of operations will probably mark how long will your relay last. <S> Use a circuit that is adequate for it. <S> If once a day use the diode and forget it. <S> For intensive applications, an RC snubber will probably be better and cheaper than the diode + Zener approach. <S> Choose R based on current coil <S> I <S> so that $$V_{peak} <S> = <S> V_{cc} <S> + IR$$ is reasonably below your control circuit limits. <S> Then choose C as big as possible within reason (acceptable board layout and C's price). <S> I'd try 100 or 220 nF to start with and experiment a bit while recording the results on a digital scope. <S> Remember C has to support a moderately high voltage. <S> Make it at least twice IR to go safe.
Last time I have seen modern relay-based logic circuits (in a railroad application), there were no flyback diodes.
How to convert a digital signal from 5V to 24V? I have an industrial application where I have to interface a microcontroller output which gives a digital signal (0V to 5V) on its outputs and I want this signal to control a relay which takes (0V to 24V) on its input. So I have to convert (0V/5V) digital signal into (0V/24V) to operate the relay. The microcontroller's pin output is 5 V 40mA for that I thinking I will use IC ULN2803 along with PC718 optocoupler to drive this 24 relay. My schematic as per my assumption is.. I am new to electronics design. Please check my design and let me know if it is correct or not. If not, then please suggest the best design that is suited to my application. <Q> Converting to a "24 V signal" is missing the point. <S> The real problem is driving a 24 V relay from a 5 V digital signal. <S> Fortunately, that is easy. <S> Here is one way: <S> You didn't say how much coil current the relay draws at 24 V, so I picked an example part I had in my system <S> (Zettler AZ8-1CH-5DSE). <S> Figure <S> the B-E drop of Q1 is about 700 mV. <S> This means there will be 1 mA of base current when the left end of R1 is held at 5 V. <S> To guarantee the transistor stays solidly in saturation, let's say we only ask it for a gain of 20. <S> This means it can support up to 20 mA collector current. <S> 13.5 mA is well below that, so no problem. <S> D1 is not optional, even though it looks like it doesn't do anything. <S> The relay coil has a significant inductive component. <S> When anything tries to shut off the current through it abruptly, the inductor will make whatever voltage it takes to keep the current flowing in the short term. <S> Without the diode, that would require abusing the transistor. <S> The diode gives the inductive kickback current a safe place to go while the current dies down on its own due to the resistance of the coil. <S> Added in response to your edit <S> I see you have substantially changed your question while I was writing this answer. <S> Your original question was better, because it simply asked how to do something. <S> That's easier to answer than having to first dispel myths. <S> I might have skipped this question entirely if I had seen it post-edit for the first time. <S> In any case, my answer above is still valid. <S> Using a opto-isolator is silly, since you don't need isolation nor a unpredictable voltage shift. <S> The ULN drivers are darlingtons, which have unnecessarily high saturation voltage. <S> You are also trying to use it as a high side driver. <S> Again, it's a lot more trouble to explain why a bad circuit is bad than to show a good circuit. <S> I'll therefore stick to my original answer. <A> The circuit in your schematic will work fine except that the relay coil should be connected to the output and to +24, not the output and GND. <S> Pin 9 is not shown on your schematic and must, of course, be grounded. <S> The optoisolator is not doing much since the grounds are common- <S> it does prevent ground bounce from getting into the MCU if your layout is bad. <S> I would suggest a series resistor (eg. <S> 1K) going directly into the ULN2803 and leave out the optoisolator. <S> Or connect directly to the ULN2803 if you have good layout such as a ground plane and are sure the ULN2803 ground can't bounce more than a couple hundred mV below MCU ground. <S> The ULN2803 and the cheaper 7-output ULN2003A are probably the best way to switch or or a few small 24V relay(s), since they have good gain, are fairly robust and have the catch diodes built in. <S> Take care as to the current ratings if you are using multiple channels, particularly with the smaller surface mount packages- read the fine print and charts on the datasheets and not just the headline claims. <S> It's too bad there is not a compatible MOSFET array that was of comparable cost, but the existing parts are just too cheap and work well enough. <A> The big question here is what are your constraints? <S> Do you have free choice over what both sides of the relay coil are connected to? <S> or does third party equipment connect one side of the relay to some form of common connection? <S> Does the 5V supply to your Arduino share a common ground with the 24V supply to the relay? <S> If not then more complex designs may be justified. <S> Your design will not work, the ULN2803 is a NPN array, so it's only suitable for low-side switching. <S> Your use of the optoisolator is also rather pointless given that you have your 5V supply on both sides of the barrier. <S> Actually I am not sure what will be there. <S> it may be a relay or not <S> but it sure that I have to provide a (0volt to 24volt) <S> digital signal. <S> I have assumed that there might have a relay. <S> Yes, 5V supply and 24V supply will be sharing a common ground. <S> Personally in that case I would look at "motor drive" chips. <S> They can swing a signal high or low across a 24V range, are desgined to deal with inductive loads like motors and relays, can drive a fair bit of current and usually handle the level shifting problem for you. <S> I have used the L298n driver chip in the past, it would almost certainly have enough current drive for your task and it has four outputs, each of which could be used to boost a seperate logic signal up to 24V. Only issue I see with it <S> is it's an older bipolar design and has relatively high voltage drop. <A> You may want to look at opto22 modules. <S> They are pricey but easily reconfigured for multi-voltage digital <S> i/ <S> o on 5v micro-controllers. <S> old tech, but robust, mine are mostly salvage.
If you have free choice of how the relay coil is connected and your power supplies have a common ground then a simple low-side transistor switch as described in Olin's answer makes sense.
12V to 3V voltage regulator for sensor implementation, cost & power efficiency I am trying to design a system for a sap flow sensor with a heated needle in a tree. This particular sensor has a heater resistor of 50 ohms, and the application calls for a 3V input and ~0.2 W power. I am also using a data logger that requires a 12V input to log the sensor output. I can connect the 12V battery to the logger no problem, but I am trying to find the right way to handle the 12V to 3V conversion from the 12V battery (we're using batteries like these and will be replaced and recharged as necessary) I am starting to understand that a voltage regulator may be the right avenue, but I do not have experience building or buying these. The manufacturer that sells the sensors also can supply us with voltage regulators, but these are $500. These seem really expensive and beyond the scope of our budget. After a quick google search I see already-built voltage regulators that are less than 5-10% this price. What gives? Am I missing something here? I am also learning that these voltage regulators release heat based on the voltage drop and supplied current and some are more efficient than others. The sensor/needle will need to be constantly heated (i.e. supplied the above 3V) for ~18 hours each day and will not receive power for the remaining hours at night. These sensors will ideally be continuously logging for weeks to months and left in a forest. I will be monitoring these sensors periodically, but not every day. I don't really know how to evaluate purchasing or building cheaper voltage regulators for my application. I just want to be sure nothing get super hot or melts(?) for the duration of our research project. Does anyone have any suggestions how best to tackle my problem? For me, it is as much a technical problem as it is a budgetary problem. We require 10 set ups, so 10 voltage regulators at $500 each is too much for us to justify before looking into other options (e.g. other sensors, other research questions, etc). Please let me know if any other information not in here would be useful. Thank you! <Q> You can use a linear voltage regulator, or a switching DC-DC converter. <S> Linear: low efficiency, low noise. <S> 0.2W <S> at 3V is 67mA. A linear regulator will draw the same current, ie 67mA from the battery, and dissipate 0.6W as heat. <S> The heat won't make the regulator burn, as the power is very small, but it still wastes a large part of the battery energy. <S> Your battery is 3.4 Ah, and it's lead acid, so it is better not to discharge it too deep. <S> Let's go with 50% discharge. <S> So half of 3.4 Ah is 1.7 Ah, divided by 67mA gives 25 hours battery life. <S> Not that good. <S> Switching DC-DC converter: high efficiency, higher noise. <S> Let's use a crummy switching converter, with 75% efficiency. <S> 0.2W on the output means 0.2/75% <S> = 0.27W from the battery, which on 12V is 22 mA. <S> This is 3x less current, so you get 3x longer battery life. <S> The deciding factor should be how much power the data logger uses. <S> If it uses a lot more than the heating element, then optimizing this is a bit moot... <S> however if the data logger is very low power, then it's worth it. <S> Since this is a flow meter, the accuracy will depend on how accurate the heating power is, which depends on the accuracy of your regulator, so you need to keep this in mind. <S> I mentioned noise, because switching converters do generate a bit of high frequency noise. <S> If the data logger is properly designed it won't have any problems with this, but it is still a good idea to test the setup before going into the woods. <A> Voltage regulators (linear regulators) are very cheap components (a few $). <S> Because your application is battery powered it would be better to use a more efficient solution <S> (linear regulators just turn excess power to heat) like a small dcdc converter module. <S> DCDC converters in that power range are also very cheap but offer a much higher efficiency. <A> After a quick google search I see already-built voltage regulators that are less than 5-10% this price. <S> What gives? <S> For your application, small linear voltage regulators (LDO) would work and are quite cheap (at least not 500$ a piece), but you've found out that they do heat up rapidly as the voltage drop increases so they are not recommended here. <S> There are a lot of parts suited for your needs mostly from Texas Instruments, Microchip and STMicroelectronics. <S> They have a low-cost, require few external components, hence easy to use, and do the job under working conditions specified in their respective datasheets. <S> For example, I would suggest something like the LM2594 series from Texas Instruments that can provide up to 500 mA, way more than what your sensor requires : <S> At best, you would get something like 70% conversion efficiency, thus your battery would provide : instead of 16 mA, and your buck converter would dissipate almost 0.1 W. <S> You can browse TI's product line for buck converters and specifiy your input and output parameters, or even look for low-current high-efficiency converter. <S> They shouldn't cost more than 10$ a piece, even with external components. <S> What will be difficult however is to find a suitable package regarding your options for self-made circuitry. <S> Surface Mounted Devices components might not be as handy to use as through-hole ones. <S> Good luck!
The matter with this converter is the relatively poor efficiency with low output current. Just google "dcdc converter module" or something similar and you will find what your looking for. This should be taken into consideration for how long your battery will be able to power your sensor as well as your logger. Then you would need a step-down buck converter, as suggested by Tony Stewart, which does not work the same as LDO and thus do not heat the same way.
Why is it important, in terms of ESD protection, to ground a PCB to its case (if not insulative)? I have a 12V DC-powered SBC to mount inside a metal case. How important is it that I connect its ground(?) to the metal case on the interior? How is this going to protect against ESD events? From my understanding, whenever I touch the metal case, will I not be "exchanging" (thus equalizing) charges? Wouldn't connecting the case to the ground of the PCB inside allow the flow of this charge within the PCB? Also, would that not expose me to any kind of danger from the current flowing within the board, as the typical 12V AC/DC adapter doesn't have a connection to the mains ground, from what I see . I am a bit confused because I do not know how important it is to actually do the grounding, plus I don't really know how exactly to do it. Do I just find the ground pins and connect it through some wiring to some random point on the case? ( This looks like the case, with the 4 screws at the corners, which is where I will mount the board that looks like this ) <Q> Any "ground" of your circuit is just a local ground, it has no relation to mains earth/ground as there is no connection. <S> You do not have to connect the metal case to your circuit. <S> Note however that if you do connect it to your circuit's (local) ground you will be relying on the mains isolation of the adapter to prevent your metal box from becoming mains live. <S> If for some reason that mains isolation is compromised (for example a fault in the adapter) then your metal box becomes dangerous to touch. <S> Often it is preferred to use a mains adapter with a ground connection (3 pins at the mains side) and a grounded output meaning the - pole of the DC output is connected to mains earth. <S> Then as soon as you connect the power supply, your metal box is grounded. <S> This is what is used in nearly all professional measurement equipment: metal box which is grounded directly to mains earth. <S> However , looking at the metal box, it appears that it has a black coating which could provide some protection against direct human contact with the metal. <S> I think in your case (this mini-PC you're building) <S> you do not need to worry about the grounding, it is quite common to connect the case to the PCB's ground and power that from an adapter without a ground. <S> Regarding ESD: ESD has little relation to grounding <S> and really you should not worry about ESD. <S> The input and outputs of that (single board computer) <S> PCB will have sufficient ESD protection. <S> As long as you're not deliberately ESD-charging yourself and then discharging yourself through for example USB socket data pin using a metal pin or wire, then you do not have to worry about ESD. <S> So: just build your project <S> as everyone else would: mount PCB in metal case, power with the adapter you have, stop worrying about ESD. <A> You can reach in and touch the GND pins/fill on the PCB with a finger, at any time, safely. <S> IMHO <S> Once you have a sustained contact with GND, then you may perform whatever operations you need to do, safely. <S> IMHO <A> Having done about a dozen EMC compliance tests on various products and designed many systems myself, my confidence that this sytem would pass all the system tests with your choice of unearth bonded 12V supply is a very high risk of product failure to conform to all the EMC tests. <S> This is not JUST for ESD diversion, but also for unintentional radiation and susceptibility, <S> ie. <S> for the sake of good EMC performance <S> If you have plans to ship a lot of these, you better have a plan B when they fail. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> One must consider all interfaces, both human and cables to determine how to prevent unwanted ingress (EMI going in) and egress (EMI going out. <S> Susceptibility tests include 5k~15kV 100pF ESD, radiated ESD, pulsed RF on plane radiator or inside Faraday room, conducted CM noise from power lines, radiated CM noise ingress to high Z with interface cables seeing strong interference. <S> Both radiated and conducted {ingress,egress} tests <S> are often Corp Stds and IEC, FCC and other international standards. <S> There is no universal solution but if you follow the best practice used by PC's it will be bonded close to chassis and incming earth bond. <S> It can still be affected by ESD if IO cables do not have CM chokes and feedthru shunt caps. <S> Exposed surfaces can also still radiate RF. <S> There is no general solution for EMC design , just many principles to choose to shunting disturbances and unwanted intrusive microwave ESD transients and local radiated E fields or high current H field transients. <S> Get the Henry Ott EMC Book from your internet library or buy it. <S> NOTE: <S> T he power supply you choose does not have a large ferrite CM choke, often used but may be SMT on PCB inside, or not. <S> ( just like every VGA cable has)
Since your power adapter has no ground/earth connection, there really is no ground connection at all.
Maximum frequency for a FPGA-based square wave signal I have an understanding problem what is the maximum possible frequency for a square wave signal that can be generated. I am currently experimenting with a FPGA board (Red Pitaya), which has a 125Mhz Xilinx Zynq FPGA. When I am connecting the clock signal via a Binary Counter and Slice (Xilinx IPs) for the bit #0 and to an output pin, I measure about the half frequency (62,5Mhz). Here is the Xilinx Vivado block diagram (32bit Binary Counter in UP-mode, 1bit Slice Din From + Din Down To are both 0): I would have expected that I will see exactly the clock frequency on the output port. Can someone please explain me why the frequency got halved and what is the maximum square wave frequency that can be created by a FPGA? <Q> If you have access to a Phase Locked Loop or PLL, you might be able to. <S> Usually the external clock gets fed into an PLL and the internal clock is generated from that. <S> If your internal clock is 125Mhz and your using a regular counter (counting on only the rising edge), the fastest counting you will see will be at half of 125Mhz or 62.5Mhz. <S> Counters can be built that work on the rising and falling edge to give you counting at 125Mhz <A> If you don't feed the clock out with a DDR flip flop, then the max frequency you would expect to see is \$f_{clk}/2\$. <S> The reason for this is that the output can only change once for every complete clock cycle (one rising edge and one falling edge). <S> Additionally, this is what you would expect to see from a free-running binary counter... <S> bit 0 (the LSB) will oscillate at \$f_{clk}/2\$, the bit 1 at \$f_{clk}/4\$, etc. <S> If you want a higher frequency output, then you need to do two things: use a faster clock, and use DDR output registers. <S> I have successfully driven outputs at 250 MHz and 500 MHz using DDR output registers. <A> All Xininx FPGAs (from series 3,4,5,6,7 etc.) offer extensive digital clock management (DCM) blocks that obviously include PLLs/DPLLs. <S> In recent offerings these blocks are called MMCM - Mixed-Mode Clock Manager. <S> There are several blocks in each FPGA, allowing many clock domains in a design. <S> The Zynq/Artix FPGAs/SoC can have internal clocks running up to 800 MHz internally, down to 5 MHz, all easily derived from nearly any external clock. <S> The output capability depends on the selection of output buffer type, depending on buffer type and mode/strength selection. <S> I believe 200-300-400 MHz of square wave is easily achievable, at least they can do it for DDR interfaces.
You can't generate a frequency higher than the internal clock.
Common emitter, o.p. set by feedback resistor I am analyzing common emitter amplifier where operating point is set by feedback resistor between b-c. Voltage gain showed by symulator is much lower than (-)R2/R1 and input resistance is lower than B*R1 (B is beta, hfe). What is R3 impact? I am looking for exact formulas (for "by hand" calculating) for k and R_inp. Knowledge about R_out would be also educating. My goal is understanding voltage and input impedance drop in circuit like below: Predicted: k=U_Rc/25mV=6V/25mV=240 V/V, R_input=(25mV/Ib || 1k)*B || 82k=109k || 82k=47k Simulated: k=113 V/V, R_input=13k <Q> For this circuit simulate this circuit – Schematic created using CircuitLab <S> The input impedance is equal to $$R_{in} = \frac{(R_B+R_C)\cdot(r_{\pi} (\beta+1)R_E )}{r_{\pi}+ (\beta+1)(R_C+R_E) <S> + R_B}$$ Or google the Miller effect <S> How does a Miller cap physically create a pole in circuits? <S> or this Simple op amp question, finding gain and input resistance <S> AS for your second circuit simulate this circuit <S> \$Q_2\$ emitter current will be around \$700µA\$ (If I ignore the base current) <S> And \$I_{C1} \approx \frac{(V1+V2)- 2V_{BE}(1+\frac{R_5}{R_6})}{R_2} <S> \approx <S> 52mA \$ <S> Which means that the in a real circuit the \$Q_2\$ emitter current will be around \$800µA\$ <S> and \$Q_2\$ base current will be around \$I_{B2} = <S> 2µA\$ <S> hence \$I_{C1} \approx\frac{(V1+V2)- <S> (2V_{BE}(1+\frac{R_5}{R_6})+I_{B2}R_5) }{R_2}\approx\ 32mA \$ <S> So the AC small-signal parameters are: \$r_{e2} = \frac{26mV}{I_E2} = 32\Omega\$ and \$r_{e1} = \frac{26mV}{I_E1} = <S> 0.8\Omega\$ <S> The voltage gain will be around $$ A_V \approx \frac{R7||(\beta+1)r_{e1}}{R7||(\beta+1)r_{e1} + r_{e2}}\cdot\frac{R_2}{r_{e1}} \approx 221 V/V $$ <S> We get such big difference because of the BC547C model you used in the simulation. <S> In your model we see \$R_E = 0.6\Omega\$ <S> Which means, that \$Q_1\$ voltage gain stage is $$\frac{R_2}{r{e1} +R_E} = <S> \frac{200\Omega}{0.8\Omega + 0.6\Omega} = <S> 143$$ <S> Therefore the overall voltage gain is around \$AV = 143 <S> *0.9 <S> = 129 V <S> /V\$ <S> And the input resistance is equal around: <S> $$R_{IN <S> } \approx R_6||\frac{R_5}{AV+1}||[(\beta+1) <S> * (r_{e2}+R_7||(\beta+1)*r_{e1})] <S> \approx 12k\Omega$$ <A> The apparent impedance looking into R3 from the base of Q1 requires some thought. <S> Since we don't care about the DC currents and voltages at the bias point, we can think of Ohm's Law in this case as:     Ω <S> = dV / dA <S> Where dV is the change in voltage and dA the accompanying change in current measured in amps. <S> To find the apparent resistance of R3, start by analyzing the circuit at its quiescent point. <S> Then consider what happens when the base voltage changes a bit. <S> Figure out how the voltage at the other end of R3 changes as a result. <S> Now you have the change in voltage across R3, from which you can compute the change in current flowing through R3 onto the base node. <S> From the change in voltage of the base node, and the resulting change in current through R3 onto the base node, you can use the equation above to calculate the apparent resistance of R3 as seen from the base node. <S> I deliberately didn't work through this because it would be a good exercise for you to do. <A> simulate this circuit – Schematic created using CircuitLab <S> This is just off the cuff.. <S> you can work it out. <S> The assumption is R3 >> R2 > <S> > R1 , if Vin has Rs then AC gain is R3/Rs after HPF breakpoint <A> Some comments are necessary: 1) <S> You are (blindly) using an approximation for the gain (-R2/R1) which may NOT be applied here. <S> Before using any "rule-of-thumb" formula you must know the corresponding conditions/restrictions which do exist. <S> 2.) <S> Did you ever hear about the role and the consequences of negative feedback? <S> 3.) <S> My recommendation: Try to understand the working principle of transistor stages and the effects of negative feedback - and do NOT use existing formulas without knowing anything about their region of applicability.
In your first circuit, the resistor R3 provides negative feedback (in the second circuit R5-R6) - with consequences on the gain value as well as the overall input resistance (keyword: Miller effect).
Can I get a 150V DC output LM317HV-MIL Can I get a 150V DC output from the circuit below by using LM317HV-MIL? As the voltage input I will be using a 160V unregulated input voltage from a rectifier. If so, is there anything that I have to be careful such as power ratings, Vmax, Vce, etc. of the resistors, transistors, capacitors, etc.? Here is the datasheet: http://www.ti.com/lit/ds/symlink/lm317hv-mil.pdf Thanks for your help in advance. EDIT1: Datasheet says, " Since the regulator is floating and sees only the input-to-output differential voltage, supplies of several hundred volts can be regulated as long as the maximum input to output differential is not exceeded, or in other words, do not short the output to ground." What I did not get is if the input is 160V, I will need C1 have a voltage rating higher than 160V as well as C2 and C3. Is that right? Also, what should be the power ratings of the resistors R5 and R4. Could you help me to calculate the required power rating? For 150V, I calculate it as around 5W. What the R4? EDIT2: How about this? <Q> It is possible but not this way. <S> the 0V reference level for ADJ bias current must be level shifted up to say 140V using an "active zener" voltage divider regulator. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> Use 140V active Zener + <S> 10V LM317 design = 150V <A> In a word - NO. <S> It is rated for 60 volts input, but output has resistors and capacitors to ground. <S> The difference between input and output can be 60 volts minus 1.25 volts. <S> The LM317HV is called 'High-Voltage' because most regulators of that type have a 40 volt limit. <S> That is why in the application images it shows a output of 50 volts with an input of 60 volts or less. <S> This is a limit set forth in section 6.1 of the pdf. <S> Input–output voltage differential −0.3 60 V <S> Since the output has resistors and loads connected to ground, the device is essentially referenced to ground for voltage adjust and loads. <S> You are limited to the 60 volt MAXIMUM input. <S> Below is an 'Active' zener diode using a bjt to boost the load current. <S> For high voltage and high current Q1 becomes a bit expensive. <S> It can be replaced with a MOSFET if high power is required. <S> simulate this circuit – <S> Schematic created using CircuitLab <A> First, zener in series with capacitor (C1 and C3, as shown in EDIT2) will not work - <S> where is no path for discharge current until voltage of "-" pin drops to zero. <S> Use caps rated for Vin and Vout, and connect them directly. <S> Second, in case of output overload, voltage drop across LM317 may become as high as Vin, which will breake it. <S> This is why I think using this regulator IC in such configuration is not a good idea.
It can be done if you accept the risk... You can use a beefy zener diode to raise ground up 140 volts or more, but this becomes your new 'ground' reference and if it shorts the LM317 will short out as well.
Can I connect a heating element to a solar panel to heat a hot tub I’ve just moved into a house that has a hot tub (lucky me!). It uses a lot of power to keep it warm so I’d like to try heating it from the sun. Although a solar water might be more normal, I’d like to try heating it with a solar PV system. I live in Berkeley, CA and the google calculator thing tells me I’ll get 1756 hours of usable Sun. I can get used panels locally for $0.60/W. So my idea is to connect a panel directly to hot water heating element and put that in my hot tub. At this stage I’m looking for some validation on the overall idea, my particular calculations and any safety tips. Vmp|Imp|Pmax|Voc|Isc|Ideal resistance Solar panel 1|35.68|8.15|290.792|44.9|8.94|4.37791411| Using the Vmp and Imp I calculated the “ideal resistance”. I think it’s vital that the resistance of the heating element matches this pretty closely. I found a 600W 48V element which should have a resistance of 3.84 ohms which is pretty close (and I think gives me an efficiency of 87% based on (8.15 * 3.84 * 3.84) to get the power and dividing that by Pmax).I can do slightly better by getting a pair of cheaper and smaller mains heating elements 120V 1650W which have a resistance of 8.72 ohms or 4.36 for two in parallel. Which is now very close to my ideal! Question1: For this ideal resistance calculation, I’m assuming the panel will be operating at Pmax, but presumably the panel never will be (unless it’s directly facing the sun on a clear day). Should I be calculating a different ideal resistance based on more realistic typical conditions? Question2: What fuses and isolation switches should I have? I plan to have an isolation switch between the panel and the heating element (is something like this good enough). Do I need any fuses too? I can’t really get my head round how a fuse could help. I’m basically trying to short the panel out in the most efficient way possible, so a fuse will always be sized for more current than the panel could ever provide! Question3: Any tips on cabling that’s OK if it comes into contact with the hot tub water (which contains some chlorine). Thanks in advance for any tips, advice or warnings!Tom <Q> I apologize. <S> I did not read everything. <S> The reason is that you will, at best, convert 20% of incident sunlight into heat. <S> But a solar hot water heater may approach 80% or 90% efficiency, even for crude do-it-yourself (DIY) panels. <S> My suggestion is to build a simple hot water panel using black irrigation tubing. <S> Coil several hundred feet of tubing on a piece of plywood. <S> Put a pane of glass over it if you like. <S> Keep that in the sun. <S> Get one small PV panel to run a small 12V pump that pumps water through the tubing when the sun shines. <S> This will probably not heat the hot tub all the way up to usable temperature unless you put a bunch of them in series. <S> But it will make it will raise the baseline temperature noticeably. <S> Maybe a bait circulation pump or something like that will do the job. <S> You don't need a battery. <S> There is no point in running the pump when the sun is not shining. <S> Thanks to peufeu for pointing out that hot tubs (spas) are a potential risk area for Legionnaires' disease. <S> This type of heating could possibly raise the risk a bit because the water may never be heated hot enough for long enough to kill the bacteria responsible. <S> Conventional mains powered electric heating may be hot enough to flash kill the bacteria. <S> In either case, keeping the water chlorinated is advised to minimize risk. <A> For this ideal resistance calculation, I’m assuming the panel will be operating at Pmax, but presumably the panel never will be (unless it’s directly facing the sun on a clear day). <S> Should I be calculating a different ideal resistance based on more realistic typical conditions? <S> Unless you use a maximum power point tracker, you will get less than X% nominal power when the irradiance is X% of nominal. <S> Since you’re just trying to create heat, a shunt regulator would be acceptable. <S> Question2: <S> What fuses and isolation switches should I have? <S> I plan to have an isolation switch between the panel and the heating element (is something like this good enough). <S> Do I need any fuses too? <S> I can’t really get my head round how a fuse could help. <S> I’m basically trying to short the panel out in the most efficient way possible, so a fuse will always be sized for more current than the panel could ever provide! <S> The purpose of fuses is to prevent a fire in the event of a short circuit. <S> If your system does not provide enough power to start a fire at a short, they serve no purpose. <S> Question3: <S> Any tips on cabling that’s OK if it comes into contact with the hot tub water (which contains some chlorine). <S> If the resistance wire is in good thermal contact with the water it cannot get much hotter than 100C. <S> So you can use insulated wire. <S> I fully agree with the other answer that this is not an efficient solution and you should heat the water directly with sunlight instead. <A> Sadly the big flaw is that you want hot tubs in winter, when you have no spare solar power. <S> I have vacuum tubes to heat water (40 tubes for 4 people). <S> In summer these have 5kw excess heat from 11am onwards - but no desire for a hot tub. <S> In winter it can only just heat the water tank, and the PV panels make average 50W per 500W capacity. <S> (PV panels are really poor under weak sun). <S> Good flat water heating panels from China would be far and away the best solar choice, but realistically, a heat pump is better yet. <S> For the DIY enthusiast, you can carefully rip an old fridge apart without breaking the sealed piping, and turn it into a small heat pump. <S> My one can pump about 9kWh/day. <S> Old fridges are free (often just the auto defrost controller fails). <S> Catch: <S> you do get a god awful big pile of foam bits and plastic left over
It is really stupid to use photovoltaics (PV) to heat water.
How much power does a cell phone charger actually use? I was trying to figure out how much power I actually use when I am charging my phone. Here are the specifications of my charger: Input: 100/240 V, 50–60 Hz, 0.15 A Output: 5 V, 0.7 A I've heard that in order to calculate this, you need to pay attention to the input. $$P = V\cdot A = 240\ \mathrm V\cdot 0.15\ \mathrm A = 36\ \mathrm W$$ I charge my phone for 4 hours a day at most. In that case, I use 144 watt-hours a day, and 51840 Wh a year, or 51.84 kWh. And that seems awfully lot, considering that all the articles I've read about the power consumption of chargers stated that they used about 2 kWh a year. I know I charge my phone too much (I really need a new battery), but it still doesn't add up. Are my calculations wrong? And if they are, what is the correct number? <Q> It could be for example, some surge current when first plugging it in due to capacitors charging up, or just some huge margin. <S> Also, the average input current at 100V would be more than double that of when plugged at 240V. <S> Let's do the reverse calculations, from the output to the input <S> : 5V and 0.7A gives 3.5W output. <S> If you assume 50% efficiency, that's 7W on the input. <S> At 100V, that's 0.07A <S> and 0.03A at 240V. (Much less than 0.15A) <S> Added to that, your phone does not draw 0.7A at 5V all the time that its charging, so in practice, the power draw is a lot lower. <S> Power supply efficiency: This interesting article from 2012 tests a dozen chargers, from brand names to counterfeit ones, and the efficiency ranges from 60 to 80% (note: "vampire" indicates the no-load power consumption): <S> Let's say 2000mAh <S> 3.7V battery, so ~ 8Wh <S> 2 - Lets say you fully charge your phone every day. <S> 3 - Lets assume the charger circuitry in your phone has 80% efficiency and the USB PSU 60%. <S> So charging your phone wastes 50% of the energy. <S> That's 16Wh per day. <S> ~6kWh per year. <S> This does not take into account the power draw of the charger when your phone is not plugged in, but on the other hand I assumed pretty bad numbers for the rest of the points. <S> This article from 2013 by Forbes uses 5.45Wh as the battery energy, does not take power losses into account and arrives at a result of 2kWh. <S> Battery charging curve: You can see in the graph below that maximum current draw falls drastically after the first hour(s) of charge. <S> So even the numbers of 0.07A and 0.03A are the maximum for a brief time. <A> The input rating on mains-connected devices is not there to assess power costs, but to dimension wiring (both house wiring and accessories such as power strips, plug-in timers, and extension cords). <S> In your case, please refrain from connecting more than one hundred such chargers that are specified at a 0.15A input current to an (otherwise unloaded) circuit that is fused at 15 Ampere. <S> The manufacturer is expected, by electrical codes of various countries, to put such a rating on any device - the only thing it is supposed to guarantee is that the device, when intact, will not exceed that input current (inrush currents likely excepted, but not discontinous use eg from a thermostat-controlled device). <A> Just get a Kill-A-Watt meter and check it. <S> It probably starts out on the higher side and then ramps down in wattage. <S> My guess is it would start out at about 10 watts and ramp down to about 5 watts, regardless of input voltage (anywhere from 100V to 240V). <S> Kill-A Watt meters not only show real time wattage, but also line voltage coming in, power factor, frequency (such as 50 Hz - 60 Hz), input amperage.... <S> You can also tell it how much you pay for electricity (per KWh), such as $0.13, and it will calculate how much it is costing you to charge that phone per day, week, month, year. <S> They are really useful devices. <S> I have 2 of them and use them a lot. <S> Mine are for about 100-130V only. <S> I think they also have a 200-260V version too for overseas.
One way of guesstimating the power usage from phone charging would be: 1 - Estimate how much charge your phone holds. The input numbers are a maximum or worst case scenario that the manufacturer wants you to take into consideration, they do not reflect the power draw at 100% of the time.
Can 2 9v batteries heat an electric range heating element For an experiment I am trying to power the heating element in the link attached. http://www.appliancepartspros.com/frigidaire-range-surface-element-316442300-ap4356466.html My goal is to power it with the most lightweight battery possible. If this isn't possible, are there lower voltage heating elements that 9v batteries in series can heat up? <Q> That is a 240V (or thereabouts) <S> 2100W element, meaning it draws about 8.75A. <S> You could conceivably use 65 or 70 16850 batteries in series, which would weigh about 3.5kg for the batteries alone. <S> Some batteries allow discharge current in that range. <S> Many do not allow it safely. <S> 240VDC <S> with so much current and charge capacity is also potentially lethal, more so even than 240VAC out of the wall. <A> Any heating element for a "electric range" requires way too much power for a few of those clip-on 9 V batteries to power. <S> You don't have to look at volts or amps. <S> Just look at the power required, and the total energy such a battery can deliver. <S> Getting even a small electric range heating element to meaningful cooking temperature takes 100s of watts. <S> Realistic ones take kW. <S> There is a reason that a electric range is always a 240 V appliance, even here in the US where things are 120 V to the extent possible. <S> The current required at 120 V would be so high, that it's better to go out of the way to use twice the voltage and therefore allow half the current. <S> Stop and actually think about it. <S> If 120 VAC that can deliver 10 A without much trouble isn't good enough for a range, then how do you imagine a 9 V battery that can barely deliver 1 A for short amounts of time is going to work out? <S> Let's be really generous and say that you have such a tiny heating element that it only needs 100 W. <S> Now compare that to the power a 9 V battery can put out. <S> To get 100 W from 9 V would require (100 W)/(9 V) = <S> 11 <S> A. <S> Not gonna happen. <S> Not even close. <S> And, 100 W is a joke for a range-top heating element. <A> THis is incredibly naive. <S> Stove element specs: <S> e.g. 120V 12A means 1440 Watts, 10 Ohms. <S> So this means a battery must have a V*Ah capacity of at least 1.4kW for 1 hour capacity. <S> meanwhile a good car battery of say 50Ah and 12 V is 600 <S> Wh and you want to heat 1.4kW with a 9V battery? <S> nice try. <S> How old are you?
If you get 70% of, say, 2.5Ah then it might run for 10 or 15 minutes, enough to boil your tea and prepare some dehydrated food if it doesn't explode and take whatever structure it's in plus your face with it. As far as PP3 9V batteries, it would take quite a few of them in series-parallel to run that for any length of time and again, would be dangerous for shock at a minimum.
Capacitors with an LDO voltage regulator - how necessary is it? I’m planning on using an MCP1700 to drop the voltage of a lithium polymer battery from 3.7 V to 3 V. The battery will be connected to the regulator via a charging circuit ( https://www.sparkfun.com/products/10217 ). The data sheet for the regulator suggests a 1 µF capacitor on its input and output for stability. How important is this? I’m currently using a regulator without capacitors, and my device powers on and runs just fine. Does it simply make the regulator less efficient, due to less stability and it having to “chase its tail” more? What about on the input? Does the charger circuit take care of any needs? The device it's going into is a Game Boy Advance which already regulates its voltage a bit (it’s used to being powered by AA batteries), so I was considering leaving the capacitors off. <Q> The data sheet for the regulator suggests ... <S> How important is this? <S> About as important as that your circuit work reliably. <S> Trying to second-guess datasheets is a bad idea. <S> Only Microchip knows the limits of stability of the MCP1700. <S> Their engineers have analyzed this over many cases of of current, headroom, output impedance, temperature, and other parameters. <S> They have distilled the result of all this analysis down to a simple range of capacitance that need to be on the input and output for the device to reliably work. <S> Why would you not follow that? <S> When you violate any specification in the datasheet, all remaining specifications become null and void. <S> There is no longer any guarantee what the device will do. <S> One or a few individual devices seeming to operate correctly at some limited combinations of current, dropout voltage, temperature, source impedance, output impedance, etc, is not useful evidence of anything. <S> Ideally the input voltage has 0 impedance. <S> Since that's not possible, they tell you the minimum input capacitance to put right by the regulator to guarantee the input impedance the design assumes. <S> The output capacitance is part of the overall feedback loop, so effects stability. <S> The requirements vary considerably across regulators, especially LDOs like the <S> MCP1700. <S> Early LDOs were intended for tantalum capacitors on the output and actually relied on some minimum ESR (effective series resistance) of the cap. <S> Others specify a range of capacitance, with both higher and lower being bad. <S> One nice thing about the <S> MCP1700 is that there is no minimum ESR requirement. <S> You can connect a ceramic cap directly to its output. <S> In fact, you need to. <S> Do what the datasheet says , else you're a test pilot. <A> You should follow the recommendations in the datasheet. <S> If you don't, you risk oscillation. <S> The regulator starts to oscillate - the output goes up and down. <S> When I've had it happen, the regulator also got hot. <S> The datasheet of the MCP1700 recommends a 1uF capacitor on the ouput. <S> This is a minimum. <S> It also recommends the capacitor be located as close as possible to the regulator pins. <S> Often times you need to keep an eye on the internal resistance (equivalent series resistance =ESR) of the capacitor. <S> Some will oscillate if the ESR is too high (or too low.). <S> The MCP1700 appears to be fairly tolerant - the datasheet mentions using different types of capacitors that have large differences in ESR, and says they can all be used without problem. <S> It also recommends a capacitor on the input. <S> The example circuit shows a 1uF, but doesn't go into any detail about it. <A> Regulators without the specified capacitors can oscillate, and not regulate properly. <S> I've known it happen in a circuit built by a friend. <A> You might notice small oscillations, which aren't the best thing in a circuit. <S> PS: I really don't see a problem of using two 1 µF capacitors: they're not so big that it would cause problems at integrating them into the system. <S> Also you can find them even as SMD and just solder them between the legs of the 1700 and the problem is solved.
Unless the datasheet explains exactly what is going on and gives you guidance on different choices, the specifications are requirements , not options. Speaking in general, the input cap is to guarantee that the regulator sees some minimum impedance at certain frequencies. The capacitors should be as close as possible to the regulator leads.
Using battery to operate a DC load FOLKS, am a learner. This is the problem am trying to get around. what would happen if I use a 200amp 12V battery to run a dc standing fan of say 2amp power draw or a piano of same rating or any other dc load? Will the circuitry of the dc load have problem since the amperage from the battery is not regulated or will the load circuitry control the amp draw hence everything will be fine. Remember the dc load used to be operated via mains power pack but in situation where there is no power supply this comes handy. <Q> A battery behaves somewhat like an ideal voltage source . <S> That is, it will maintain a reasonably constant voltage between its terminals over some range of current. <S> A battery (or other power supply) <S> that is rated "12V, 200A" does not force 200A to flow in a circuit. <S> It forces 12V across the circuit, and the circuit will draw however many amperes it wants from the battery when 12V is forced upon it. <S> The "200A" rating of your battery means that if the current drawn by the circuit is 200A or less , then nothing bad will happen. <S> If a fan or a piano or any other device that uses electric power is rated "12V, 2A" then that usually means that it needs 12V in order to function correctly and, it will not draw any more than 2A when it is functioning correctly. <S> Beware the word "usually!" <S> Most electronic devices expect a constant-voltage power supply, and most power supplies are designed to supply a constant voltage. <S> Some applications (e.g., high power light emitting diode lamps, arc welding) need a regulated current, and some power supplies are designed to adjust their voltage output as needed in order to force a certain current through the circuit. <S> These types of power supply usually will be labelled for a very specific application, and you won't see the typical howevermany volts at somenumberof amps rating. <A> Actually the battery ratings are 12V and 200Ah and not 200A. <S> 200Ah means the charge stored in that battery. <S> ie. <S> a 200Ah battery can provide 12V 200A for 1hour. <S> If you connect a 12V 1A load across such a battery then the load will only draw 12V 1A current from it and the Battery can provide it for 200hours. <S> By using charge stored (Ah) and current rating of your load you can easily measure how long the battery will last for your load. <S> Hope this will help you. <A> <A> Think: What will happen if you connect a small 12 V lamp such as a car tail lamp to the battery? <S> The resistance of the load resists the current flow. <S> Ohm stated the relationship as \$ <S> I = \frac {V}{R} \$. <S> This means that the current that flows will be proportional to the voltage (which is fixed at 12 V in your case) and inversely proportional to the resistance. <S> Small loads have higher resistance than large loads so less current will flow. <A> Voltage determines how much current will flow through a load, the current rating determines the maximum that you can take before the supply (battery in this case) can't maintain it's specified voltage. <S> Some loads will only take the current they need, but very often a load will take more current as the provided voltage is increased. <S> So the most important parameter is the voltage of the supply.
The load will draw only what it requires to satisfy Ohms Law, which states that the current into a load is equal to the applied voltage divided by the load resistance.
What is "drive voltage" for a MOSFET? In the attributes of a MOSFET, Digi-Key lists several different voltages. I think I understand what most of them are, but there's one I don't understand: "drive voltage." Let's take this P-channel MOSFET as an example: So, there's "Drain to Source Voltage", which is 100V, which is the maximum voltage the MOSFET can switch. There's "Vgs(th)", which is 4V, which is how much the gate voltage has to change in order to get the MOSFET to switch. There's "Vgs(Max)", which is ±20V, which I'm guessing is the maximum voltage that can be applied to the gate. Then there's "Drive Voltage", which is 10V. This is the one I don't understand. What does it mean? <Q> Real MOSFETs are not perfect devices, they don't simply turn on or off with applied Gate-Source voltage. <S> The amount of "ON" current through Source to Drain is a function of applied GS voltage. <S> It is a steep function, but still a continuous one. <S> This is an example of this dependence, from a tutorial : Datasheets for MOSFETs are trying to simplify this functional parameter by supplying "corner" points. <S> The V"th" voltage is the voltage where the drain current is barely measurable, in the OP case it is 250 uA, which happens at 4 V. <S> The "drive voltage" (listed as 10V) is the voltage when the MOSFET is conducting to full specifications, and can deliver 8.4 A of current and having the specified Rds(on) resistance of less than 0.2 Ohms. <A> To complement what Stefan Wyss correctly said in his answer, I'll give you the rationale for that parameter. <S> Power MOSFETs are often used for switching, that's why a low R DS(on) <S> is important in switching applications. <S> Knowing at which voltage you can attain that R DS(on) is an important parameter because you can tell immediately, without looking at the curves in the datasheet, if your circuit could drive that MOSFET fully on or not. <S> For example, if you need to switch a 10A load with an R DS(on) of no more than 10 mΩ, you could search for those parameters. <S> But if that R DS(on) is attainable only at 10V, while you only have a 5V powered MCU with no other power rail, you know that that MOSFET is not suitable (or it will need additional circuitry to be driven). <A> In the linked datasheet, RDS_ON is specified as 0.2Ohms max. <S> (at Vgs = -10V).
The drive voltage is the gate-to-source voltage Vgs where the static drain to source on resistance RDS_ON is specified in the datasheet, usually at 25°C.
Confusion about the meaning of re and rπ In BJT small-signal models there is both r e and r π parameters. They both represent the dynamic resistor between the base and the emitter terminals. But I read that they are different by a factor of β as: r π = β × r e I know the concept of transconductance g m . It is the slope of the Ic Vbe plot at a fixed bias collector current i.e: g m =∂Ic/∂Vbe. And as definition r e = 1/ g m . So what I understand is that r e is the change in Vbe with respect to a change in Ic. Secondly r π is the change in Vbe with respect to a change in Ib. Since there Ic = Ib × β this yields to r π = β × r e You might think what is my question here. Even though the formulas yield this relation between r e and r π , I don't quite understand how they represent the same thing aka the "dynamic resistance between the base and emitter terminals". I mean their definitions are same but yet they are different things. They are both the dynamic resistance between the base and emitter terminals in my mind. But they differ by a factor of β. I'm really confused about the approach. Is it about where we look at the base from? <Q> \$\Large <S> r_\pi\ = \frac{d V_{BE}}{dI_B} = \frac{V_T}{I_B} = \frac{\beta}{g_m} = <S> (\beta+1)r_e \$ <S> On the other hand \$r_e\$ is an input resistance looking into the emitter terminal with the base terminal at AC ground. <S> \$ <S> \Large <S> r_e = \frac{dV_{BE}}{dI_E <S> } = \frac{V_T}{I_E} = <S> \frac{r_\pi}{\beta +1} = \frac{\alpha}{g_m} <S> = \frac{\beta}{g_m ( <S> \beta +1)} <S> \$ <S> Sometimes <S> because \$I_E \approx <S> I_C\$ <S> we can we can simplify our life and assumed that \$r_e \approx \frac{1}{g_m}\$ http://www.ittc.ku.edu/~jstiles/412/handouts/5.6%20Small%20Signal%20Operation%20and%20Models/The%20Hybrid%20Pi%20and%20T%20Models%20lecture.pdf <A> I don't quite understand how they represent the same thing aka the "dynamic resistance between the base and emitter terminals". <S> You are completely right . <S> The term re does NOT represent any resistance between the nodes E and B. <S> My suggestion: <S> Forget the term re and always use 1/gm instead of <S> re. <S> Some people say (and think... because they have read this somewhere) that the term re is something like a dynamic emitter-base resistance. <S> But this is wrong!! <S> The quantity 1/gm has "ohms" as unit (because it is the inverse of a conductance) but, in fact, it is not a resistive element at all. <S> The quantity gm is a "transconductance" and it does NOT describe the current-to-voltage relation between two nodes - and the same applies, of course , to the inverse 1/gm. <S> Hence, it is not a resistive element at all. <S> There is only one case, where it makes sense to write re=1 <S> /gm .... <S> in the common base stage <S> the input resistance at the emitter node is re=1/gm. <S> But still - it is the input resistance (betwen E and common ground) and NOT the resistance between E and B. Comment : A detailed analysis shows that the rather small input resistance at the E node can be explained as a result of negative feedback internal to the BJT (the relatively large E-B-resistance is reduced drastically to 1/gm due to negative feedback). <A> You are confusing two different models. <S> The hybrid π model includes a rπ element. <S> The T model includes a re element. <S> Circuits from https://leachlegacy.ece.gatech.edu/ece3050/notes/bjt/BJTBasicsSu10.pdf
\$r_\pi\$ is an input resistance looking into the base with emitter terminal at AC ground. The models are similar and the two resister elements represent much the same physical factor but are expressed differently because they sit differently in their respective models.
How do I check whether my GSM Modem works in some other country? I am a new to choosing RF modules and I am trying to choose a module that works in Qatar. I see on FrequencyCheck , Qatar is having GSM band of 900 and 1800. So, if I choose GSM800 C , having quad band 850/900/1800/1900MHz, will it work in Qatar? I am believing that when checking bands for say Qatar, you need to see whether 900 and 1800 are present in GSM modem? Is there anything, I have done wrong? Please guide me. <Q> It probably depends on a lot of factors other than mere frequency band compatibility only. <S> If your wireless carrier allows roaming to that country. <S> If your device is unlocked. <S> If the carrier in Qatar allows you access to their networks. <S> Not all networks share the same frequencies in any given band. <S> They are usually allocated blocks of frequencies exclusively for their usage and another carrier allocated another block to avoid interference. <S> They might also use different signaling protocols and so on. <S> Different parts of the world use different band combinations... <S> If that weren't confusing enough. <A> I would have done the same way. <S> Checking the available frequencies in the destination country and then what your Modem supports. <S> What might as well be important to consider: does the network you choose support your modem / <S> vice versa? <S> i.e. what network will you be using and does it offer GSM on the supported bands? <S> In case you use your local SIM in Qatar: do they have GSM Roaming in place? <S> hope that helps. <A> You could research the type of devices used in Qatar based on reports and advertisements and see if the same of same specification devices are available to you. <S> Cross referencing via available handset specifications would also be instructive. <S> Roaming agreements, choice of service provider or local network band limits may dictate which specifications are the most important. <S> So called "world band" and <S> other trade terms are used to designate devices with wide coverage options.
You can contact your cell carrier or modem manufacturer to check device compatibility.
Controlling 13 outputs with a mcp23017 or 74hc595 and two uln2003? I need to drive 13 20ma (constant) loads with a single microcontroller with only 5 available pins. My first thought was to just use a mcp23017 or some 74hc595's but after reading the datasheets it appears they both have low max current into vcc (125/70 respectively) so that won't work directly. I have a bunch of uln2003 chips so I was thinking of using those with the port a expander to drive the loads but it feels heavy for what I'm doing. Am I missing something simple here? The mcp23017 says it has max 150ma into vcc and 125 out vdd, could I do something clever like source 7 of the loads and sink 6 of them through one mcp23017? <Q> The 150mA/120mA are absolute maximum numbers and you should not get anywhere near those levels if you want reliability. <S> The output voltage is only guaranteed at 3mA source/8mA sink. <S> If the relatively high output voltage of the UL2003A Darlington outputs (maybe 0.7V typically @20mA) is not a problem for you <S> , that's probably your best choice to buffer the expander outputs. <S> Very cheap and robust part and 7 outputs in one small package. <A> You could use the port expander to drive discrete transistors (2n2222 would handle those loads no problem), in turn driving your load. <S> This is often done in consumer and industrial products where the financial or space expense of an overkill IC is not acceptable. <S> In my experience, digital IC outputs rarely drive anything but high-impedance digital lines, and something like a ULN or transistor is used at the end of the chain to drive the load. <A> Nothing stops you to do that. <S> The maximum power is not at least 1/4 reached and everything is in the specs limits. <S> Don't worry about the "absolute maximum" you're nowhere near. <S> The chip should work in parameters. <S> The I/O is stated as 25ma capability you're barely at the half.
You can also look at this chip or similar.
Solar Panel Not Charging Batteries in Series I live in a remote part of Tanzania with no mains electricity. We have had solar power for some time, but on purchasing a new inverter, battery and extra solar panels have run into problems. The problem can be simply stated. We have two N200 lead acid batteries both yielding 12-13V each. Connected in series we get 25v from the system. The inverter (Shiv Solar Comercial UPS 2000-24V) requires that the batteries be connected in series. If they are connected in parallel the inverter quickly triggers a ‘low battery warning’. But the batteries will not charge when connected in series. Each will charge on its own. So there does not appear to be a problem with any of the connections. Moreover both will charge together when connected in parallel. Nor does it make any difference which way around we connect the batteries in series. When I say that they do not charge I mean that the charging sign on the controller indicates that the batteries are not charging. Also the Amp level reads ‘0’ for both the solar panels and the batteries. The volts show a positive reading (batteries on 25, solar panels vary according to the sunlight). We know that single batteries charge on their own because the charging sign on the charge controller indicates that they are and the ampage is positive both for the panels and the battery (varying according to the sunlight). What would cause this problem? <Q> 12V lead acid batteries typically require around 13.8 volts to charge. <S> So in series your inverter needs to output at least 27.6 volts. <S> Less than that and your batteries may not fully charge. <S> I suspect your UPS may be intended for use with Lithium Ion batteries which have a lower charge voltage requirement. <S> A google search for the UPS you specified did not show any results with specs. <A> To charge a battery you need to put more voltage than it outputs on its terminals. <S> The charge controller will monitor the battery voltage and stop the charging when the voltage exceeds a preset value. <S> When discharging the charge controller will also disconnect the battery when the voltage becomes to low. <S> This means that you will need to adjust the settings of the change controller when changing the battery configuration from 13V to 25V. <A> Some details of your charging source will be required to further diagnose the problem.
It sounds like your charge controller is designed to charge a 12 volt battery bank, so will not charge the 24 volt bank you have with the batteries connected in series to supply your inverter.
Is there any sense in carrying assembled enclosed electronics in a static-shielding bag? Say I have a Raspberry Pi enclosed in a metal case, such as this . Would it offer any additional level protection if I put it in a static-shielding antistatic bag whenever I carry it around (e.g. before putting it in a bag or cardboard box)? Does this offer any additional level of protection, for example from ESD damage?Otherwise, does it, maybe, create some potential risk I may not be aware of? <Q> Would it offer any additional level protection if I put it in a static-shielding antistatic bag whenever I carry it around ( <S> e.g. before putting it in a bag or cardboard box)? <S> Yes, you do get additional protection. <S> Exposed potentials (such as those on connectors) can be a conduit for ESD. <S> If a potential is developed (especially the thousands of V/m that can be developed from clothing) across the part then connectors such as USB, or Ethernet can be affected. <S> An ESD bag will prevent these electric fields from affecting the inside of the bag. <S> (make sure you don't use the polypropolene (or pink bags) as they are intended for shipping, and the conductive layer wears off, use the mylar metalized bags). <S> That being said the connectors are partially connected by the shields on the outside of the conductors, an electric field or ESD event is most likely going to conduct through the shield (which is traditionally connected to ground on the PCB). <S> It really depends on how much the product is worth protecting. <S> The probability of you degrading an enclosed PCB is very low, but it's not zero. <S> If you value it then protect it in an ESD bag. <A> Once it's enclosed in a case, there's not much need to put it inside an ESD bag - these are used when there's bare PCB exposed. <S> The bag may add a very minor level of protection for the connector <S> sockets <S> however the device is much more likely to be damaged once it's in use out of the packaging. <A> It will help protect the paintwork, keep lint out, and maybe even protect it from liquid spills if it is closed.
There's no harm in putting it in an ESD protective bag, however the benefits of putting an already-enclosed product in one are negligible.
Maximum fuse rating before a MOV (varistor) I just watched some scary videos of MOV's catching fire and I've flee'd here to ask you guys for help. I understand that it's a good idea to put a fuse in front of a MOV, considering it fails short-circuit. However, is there a maximum fuse size that can be used before the MOV? I'm pondering the possibility of a MOV failing partially short-circuit which then runs away to become a fire hazard. i.e. the short might be enough to blow a 1A fuse but not enough to blow a 13A fuse. Would it be safe to rely on a varistor to blow a standard, household 13A fuse found in a mains plug? Would it permit too much power? <Q> Commonly, for example in multiple outlet powerboards that include a MOV for surge protection, a thermal fuse is also used. <S> The thermal fuse is in contact with the body of the MOV.When <S> the MOV starts to fail, its power dissipation and temperature increases, and the thermal fuse opens in that case. <S> Often, an indicator LED shows that the thermal fuse is OK. <S> When it goes out, it means that MOV has failed, the thermal fuse has blown, and surge protection is no longer available. <A> @coates <S> - I just realized I was thinking of thermistor inrush current protectors with regards to the load current. <S> The MOV protects the load from excessive voltage, but when it fails shorted there won't be any excessive current in the load, just in the wiring upstream from the MOV - I.E. your house wiring. <S> So the 13 amp should be ok in all instances provided the circuit breaker rating is not lower than that. <A> Choosing the right fuse when using a varistor is not really different from choosing a fuse when not using one. <S> A fuse should be rated according to the expected maximum current consumption of the protected device. <S> A fuse should be as small as possible, but as large as required for the device to operate without triggering it during normal operation. <S> If startup inrush current or sporadic current spikes are to be expected, a "slow" fuse will help. <S> It is common to have a pretty conservative safety margin like factor 1.2-1.5 to prevent a fuse from failing too early, but it really depends on the type of fuse and the application. <S> There are potentially more consideration and its not really a subject as trivial as it seems at first.
A fuse should blow as fast as possible in case of a failure to minimize damage.
Connect two lab bench power supplies in series safely Lets assume in European Union, that I have two power supplies, that each have 3 terminals. One marked +, second - and third GND.I assume that GND is connected to the protective earth of AC power cord and that PE can be disconnected from - on one of the power supplies.Is it possible to connect them both with safety against electric shock maintained? I imagine that I leave GND and - connected on the first supply,and I'll disconnect GND from - on the second supply, then connect GND of both of them to prevent shock from touching the chasis of the second supply. Next I connect + of the first supply to - of the second supply and take output voltage from + of the second supply. Lastly I plug them to the AC outlet and power them on. EDIT: Could someone please elaborate on how does connecting GND of my circuit on bare PCB to protective earth protect me from electric shock? <Q> The plus and minus terminals float, that is, have no internal connection to the earth ground. <S> The ground connection is normally an output. <S> As such, no matter how you connect the plus and minus outputs together both chassis will still be connected to ground. <S> Both ground outputs "should" already be connected together via the power line. <S> EDIT: <S> As Glen points out, depending on the nature of the power supply there may be a maximum voltage you can float the outputs to. <S> You should check the manuals if you have them. <A> Could someone please elaborate on how does connecting GND of my circuit on bare PCB to protective earth protect me from electric shock? <S> So this question is actually about electrical device isolation and earthing in case of fault. <S> It doesn't afford any protection in the case of a bare PCB. <S> Connecting PCB GND to earth doesn't stop you touching the hot terminal on your IEC input connector if you have one. <S> Some guys build nixie clocks that run off 200V generated by pumping a 12V supply. <S> All rules and safety precautions are thrown out of the window when you have the raw PCB exposed. <S> "No user serviceable parts inside" comes to mind. <S> European CE marking will save you from being totally vaporised if the encased circuit behaves as designed, and in a limited number of fault situations. <S> I often use two Korad three terminal 30V supplies in series, and there's no way I can think of to zap myself other than sticking 60V into my mouth. <S> That wakes you up. <S> As soon as you introduce another problematic device to your circuit, anything might happen. <S> The main point of earthing is to enclose the whole device in shield of metal. <S> If a wire comes loose then it shorts against the earthed case, resulting in either the internal /external fuse blowing, or the earth leakage circuit breaker triggering. <S> Simply connecting the PCB GND to earth is more of a noise reduction strategy. <S> I asked about the merits of metal enclosures in Are plastic enclosures safe for hobby mains voltage projects? . <A> Could someone please elaborate on how does connecting GND of my circuit on bare PCB to protective earth protect me from electric shock? <S> Most of the time, it is fine to leave low-voltage circuits floating. <S> However there are situations in which grounding your circuit can make sense. <S> To steal an example from another post, lets say you have a 200V boost converter to power some nixie tubes. <S> You know that the 200V is hazardous and you shouldn't touch it. <S> Now lets say that 200V rail inadvertently gets connected to mains ground, if your 0V rail is also grounded then the boost converter trips out from over-current, no big deal. <S> If your 0V rail is <S> not grounded <S> then suddenly your entire circuit is at about -200V relative to mains ground.
Normally, if you need an earth ground on your test circuit, you would connect it to one or other ground output on the power supply.
Small step down transformer fuse, primary or secondary? For a small 24V 1A transformer where should I place the fuse? Secondary 1A fuse or primary 100mA fuse (or above accounting for inrush current)? Mains is 230V. Also, the smallest fuse available in the market seems to be 200mA. Also, how about a 30V 6A transformer? I guess for a 12V 500mA transformer the answer is obvious, as I have no access to 50mA fuses for the primary. But how useful is a primary side fuse? It's not like the transformer will short out on its own, and it's not like the utility voltage will go up to extremely high levels for any length of time. So I am really placing the fuse to protect the transformer from a shorted load placed on the secondary (including shorted bridge rectifier), right? Added: Thanks for all the replies. These transformers are for one off projects. They are all EI core. So a primary side fuse with 150% rating at 230V would be: transformer required fuse actual fuse24V 1A 156mA 200mA30V 6A 1.17A 2A12V 500mA 26mA 200mA Is that correct? The minimum fuse I can get is 200mA. And above 1A is usually in 1A steps. I might not be able to get a 1.5A fuse. Also, I have no idea if these are slow blow fuses. The cartridge fuses seem to be tinned copper in a glass tube. I could potentially test the fusing current and time for the fuses just to be sure (fuses are cheap). How much current might a transformer draw at startup? I found somewhere (lost the link) that it may be a lot more (like upto 35A for a 5A transformer, so it is a bad idea to repeatedly switch on and off a transformer e.g. with a contactor). The small 12V transformer is possibly inductance limited. I was unable to draw more than 650mA from it at the rated voltage (12VAC). Is this how a class 2 transformer should behave? Or should 500mA have been the short circuit current? If I understand correctly, a primary fuse will protect the transformer from shorts in the winding. Shorts in the winding can arise due to overheating. Overheating can occur due to high current draw in the primary, or inadequate cooling. There are 2 reasons for high current draw in the primary: 1. repetitive inrush current due to repetitive switching on and off the primary side, and 2. high current draw on the secondary side. If I operate the transformer only with a manual toggle switch (not a doorbell), and if I have a suitable fuse on the secondary, then I have none of those problems. That leaves only inadequate cooling which can destroy the transformer winding. Is my thinking correct? Is it correct that the main reason to place a fuse on the primary is that a fuse on the secondary is no more necessary to protect the transformer? A shorted secondary will draw enough current to blow the primary side fuse. But this will not happen for a class 2 transformer. So a class 2 transformer might still burn up because it was operating for an extended time at slightly over maximum rating, if it lacked a secondary fuse. [Sorry for so many questions. I am definitely confused about this. My gut says to just go with 2 fuses and avoid headache... but on some sites they even say 2 secondary fuses!] added Thanks again for all the replies and clarifications. I found in my hands yesterday a brand new 30V 6A transformer. As soon as I plugged it in (no secondary load), the fuse on the primary side blew. It was rated 5A. Thinking it may be an old fuse, I replaced it with a new one. It blew again. The transformer as well as the mains wire to it was already warm. So I guess that answers my own question. Now for the hassle of returning the transformer... <Q> You should put it in the primary, to protect against transformer faults. <S> This may be optional if it is a Class 2 impedance protected transformer or has an internal fuse or thermal cutout. <S> Keep in mind that the output load (especially if it's the usual capacitor filter) <S> and the transformer itself will cause inrush surges at turn-on. <S> The latter can be especially bad with toroidal power transformers sans inrush limiting devices such as NTC thermistors (can be tens of amperes for a small transformer) and occurs as a result of when the power was last removed in the AC cycle and when it is reapplied (perhaps counter-intuitively, zero crossing is the worst case). <S> Continual surges can lead to early death of the fuse if it is not appropriately rated and of the appropriate type (often slow-blow is required). <S> The fuse has several purposes- to protect the transformer against a short on the secondary. <S> To protect the transformer against an overload on the secondary. <S> To limit the damage in case the transformer itself fails (think shorted turns and smoking), and (in some cases) to protect the mains cord from excessive current (from a short or overload). <A> I would suggest to use the fuse at the primary side. <S> The main reason behind this is that fuses are less sensitive to changes and come into role only when there is a drastic change in current value. <S> Moreover, just keep in mind that the fuse should be selected with a tolerance of 150% from the limit/maximum value. <S> For more clarity, just visit this link http://sites.ieee.org/fw-pes/files/2013/01/transfguide.pdf <A> It's not like the transformer will short out on its own <S> Don't bet on it. <S> Why do plugs have fuses in them? <S> Answer - to protect the infrastructure of the home i.e. the house wiring in the walls and therefore prevent a fire. <S> What your fuse does is both protect the house wiring AND, stop the transformer burning should it develop a fault or the load current rise too high. <S> Put it in the primary circuit. <A> Not using any primary fuse could lead to catastrophic failure in the transformer itself - transformer wires are typically insulated only by very thin and brittle lacquer, and a winding shorting on itself due to damage to that insulation will effectively act as a shorted low-voltage, ultra high current secondary, and heat up significantly. <S> Even worse, the lacquer insulation is not very resistant to extreme thermal conditions - many types of transformer wire <S> can (and sometimes are intended to) be stripped of their insulation by a very hot (say, 380-450°C) <S> soldering iron. <S> Also, depending on the core material used, a serious failure could heat the core above the curie point (though that is unlikely with 50/60Hz transformers and their iron cores), completely changing the magnetic properties and causing further escalation in some circuit variations. <S> End result of all these would be a cascading, catastrophic thermal failure. <S> Why not both - a primary fuse can be optimized to be permissive of any normal operating condition of the transformer, while one or more secondary fuses can make sure the load to the transformer is not faulty - especially when there are multiple secondary windings. <S> A lot of designs seem to rely on the overcurrent protection features of linear or switching voltage regulators used directly behind the rectifier+filter - which might be OK if you can rely on either the transformer's source resistance or the primary fuse to limit the current in case any of these components fails short. <A> If this is a pre-manufactured "wall wart" or "lump in cord" transformer, then leave it alone . <S> The assembly is UL listed (or equivalent listing agency, CE is not one). <S> The safety of that assembly has been accounted for, and you void its listing by altering it. <S> If this is your own device in your own chassis, for which you might seek UL listing, then UL publishes documents to say what they expect. <S> Those are good guidelines to follow. <S> A 1-amp transformer that fails internally won't draw 2 amps . <S> It will draw lots of amps , or will ground-fault , or will arc . <S> These are detected by the house's overcurrent protection (13A, 15, 16 or 20A depending on territory), its GFCI/RCD devices, or its AFCI, respectively. <S> If this is a one-off device, one answer is simply to fit AFCI and GFCI/RCD protection upstream of the device (and make sure to ground the metal chassis, to make ground faults more detectable, current returning via ground will cause a rapid trip). <S> On the other hand, a transformer is drawing 200% of spec has too much load on its secondary. <S> It can endure this for a short time, just as car starter motors do.
If the transformer either only has a single secondary winding, or could withstand any overload on any secondary winding without catastrophic failure, and if downstream circuitry does not need further protection, a primary fuse can be enough, but will need empirical and/or mathematical optimization that takes the transformer's efficiency into account.
Can I use resistors/capacitors to delay when a circuit turns on? I switched some electronic candles to be powered by a power adapter instead of batteries but when I power them up I noticed they all now "flicker" (which is a feature) at the same rate probably because they all use the same circuit. With batteries this isn't a problem because you'd turn them on/off at different times but now they all turn on at the exact same time when I plug it in. Is there a cheap way to delay these at different rates, possible with simple passive components? <Q> This is impossible to do well with only passive components. <S> It would require that your candles switch on/off at a precise voltage threshold, plus an RC circuit which is able to source any sensible amount of current with a delay of several seconds will have ridiculous component values. <S> Instead, you could implement one of the NE555 timer delay circuits, which can be easily found online. <S> Or you could design a circuit yourself. <S> You will need: an RC divider to create ramping up voltage <S> a comparator to transform that voltage into a digital signal a voltage divider to generate the threshold value for the comparator an active switch (BJT, MOSFET) which would switch the candle on based on the digital signal <A> Maybe something like that is good? <S> Put higher C values for higher delays. <S> You will have ~1s delay for each 50uF added. <S> Take a ~1V voltage drop on Q into account. <S> Use the link "simulate this circuit" then in "Run" menu "Time domain simulation" to see the results. <S> Use lower resistors and higher capacitors if your candles ar drawing more than 10mA. simulate this circuit – Schematic created using CircuitLab <A> The easiest way me be directly to change the capacitor value on the candle, which will change the behaviour of each candle. <S> If not, a RLC circuit may solve your issue! <A>
You can use a simple RC timing circuit for each candle and you can change the value of each capacitor to get the desired delay
How does a device (dashcam) recognize if it is connected to a computer or a power source? I have this A118 dashcam , which I want integrate with a Pi. I wish to record onto it mounted SD card when driving, and once home within WiFi range, to download the files on the SD card through the Pi to my home network. This camera, when connected to a 5 V source on my vehicle's cigarette lighter, the camera begins recording right away. When I connect it to my computer, it prompts (on the dashcam screen) whether to operate in "Mass Storage" or "PC Camera" mode. This video shows how a problem of a different camera was fixed by insulating the TX and RX terminals from the connection. How does the camera (or a regular USB device, like a phone too) know whether it is connected to a simple power source or to a computer? Also, how could I then use this fact to control the dashcam, so when out of my Wifi range, it records as it would when just power is supplied, and when in Wifi range to revert to "Mass Storage" so the Pi can access the video files and transfer them. I guess relays would work, but their large size does not make it practical. Would optocouplers be a better alternative, or are there other suggestions I may look into? <Q> The USB Battery charging specification is used by many USB devices to determine what type of port they are attached to. <S> The main types of ports are... <S> Dedicated charging port: <S> The charger indicates that it is a dedicated charging port by shorting the D+ and D- lines together. <S> Standard downstream port: A USB port that supports up to 500mA of charging current (for a USB 2.0 port), plus USB data. <S> The device enumerates on the USB bus to determine how much current it can draw. <S> The bMaxPower field in the USB device descriptor is used to ask the host for power. <S> Charging downstream port: A USB port that supports up to 1.5A charging curret, plus USB data. <S> The device determines that it is attached to a CDP by first toggling the D- line. <S> If the D+ line tracks the D- line then the device knows it is attached to some sort of charger. <S> Next the device does secondary detection by toggling the D+ line. <S> If the D- line stays low then the device knows that the lines are not shorted together so it must be attached to a charging downstream port. <S> http://www.usb.org/developers/docs/devclass_docs/batt_charging_1_1.zip <A> If you wanted for the device to alternate between the two modes you described, I could suggest using an USB 2:1 mux IC such as FSUSB43 wired to gpios of the Raspberry Pi. <S> Something like that: As @dwizum pointed out in the comment below, you would also need to add a transistor on the 5V VBUS line running to the dash cam to power cycle it, as switching D+ / D- only might result in undefined behavior. <S> To simplify, power cycling the VBUS line to the USB device when switching will force it to be ready for a new discovery. <S> From there you could easily write your own scripts running on the Raspberry Pi changing the states of those GPIOS, maybe with the help of WiringPi , based on different events such as the list of Wi-Fi access points available. <A> How does the camera (or a regular USB device, like a phone too) know whether it is connected to a simple power source or to a computer? <S> USB has 4 connections: 2 for the 5 V supply and 2 for data. <S> A power adapter generally does not respond to signals on the data lines (with the exception of fast charging protocols <S> but that's more level detection than data being transferred). <S> A PC does respond to signals on the data lines. <S> The camera can request a USB connection and then the PC will grant that request (or not). <S> Some information will be exchanged. <S> So basically the camera just "talks" over the USB data lines as soon as it detects power on the USB input. <S> If there's no response it must be a "dumb" power supply. <S> If there is a response it must be a PC (USB host). <S> Controlling the behavior of the camera depending on WiFi being in range is something that could be done by the software (firmware) running inside the camera. <S> In general you cannot and should not change this. <S> Get it wrong and the camera will become useless (inoperable). <A> You can try to disable/enable the Raspberry's USB ports depending on whether or not you want the camera to detect a data connection, To shut off power on USB ports (this shuts power on ethernet as well): <S> echo '1-1' | sudo tee /sys/bus/usb/drivers/usb/unbind <S> To turn power back on echo '1-1' <S> | sudo tee /sys/bus/usb/drivers/usb/bind <S> ( https://www.raspberrypi.org/forums/viewtopic.php?t=172313#p1217773 ) <S> IIRC, at least on <S> old Pi's this would not shut down the power lines of the USB ports but only the power to the USB/Ethernet chip of the Pi, effectively disabling any and all communication and enumeration on those USB/Ethernet ports; a device connected to one of the disabled ports will not be able to detect it is connected to anything other than a USB power source. <A> USB devices (and dashcams especially) are intelligent devices. <S> When they are connected to USB host, the host performs enumeration and issues all other USB interface activities. <S> And a USB device makes note of this. <S> When connected to a dumb charger, there is no USB enumeration/communication. <S> That's how the dashcam/whatever knows the difference. <S> Regarding the actual problem, why the dashcam doesn't record internally when plugged to functional USB host, this is a question of dashcam software design - it is designed that way. <S> Obviously when you cut D+/D- wires in the PC-to-dashcam connection (not Tx and Rx !!!), USB communication ceases, and the dashcam goes into the standard charger-powered mode.
To be very concise, USB devices make use of the D+ / D- lines to detect whether or not they are connected to a USB host or a charger.
On a relay coil, why use an MOV instead of flyback diode? I briefly encountered a designer who wished to use an MOV instead of a flyback diode with a relay coil. I don't know much about the application, but why would you want to do that? The only reason I can think of is that the coil is normally energized and seldom de-energized, and the MOV acts as a speed-up circuit for de-energization, burning the inductive energy faster than a flyback diode. That said, why not use a zener or a resistor, especially given that MOVs have limited lifetimes? What other options are there? <Q> Using a varistor or a combination of zener diode and a normal diode instead of just a single diode has following advantage: After turning off the coil of a relay the energy stored in the inductor should be dissipated (turned into heat) as fast as possible. <S> If this is not done the electromagnet lets go the contacts too slowly causing the contacts to wear much faster. <S> In addition the use case may require the relay release time to be as short as possible. <S> The energy of the coil is dissipated faster the higher the voltage across the varistor/diode. <S> For details see my answer to a similar question . <S> It compares the simulation of a circuit with just a single fly-back diode and a circuit with a diode and an anti-serial Zener diode. <A> As has been pointed out in other answers, the basic diode snubber arrangement extends the relay drop-out time and the speed of contact opening. <S> simulate this circuit – <S> Schematic created using CircuitLab Figure 1. <S> (a) Diode snubber. <S> (b) Resistor snubber. <S> The diode can be left out but doubles the power consumption of the circuit. <S> I checked a 24 V Finder relay in my stock and measured 800 Ω coil resistance and 2.8 H inductance de-energised and 9 H when the armature was pressed in. <S> At 24 V the energy stored in the relay would be \$ \frac {1}{2 <S> } LI^2 = <S> \frac <S> {1}{2} L{\frac {V}{R}}^2 = \frac {1}{2} \frac { <S> 24}{800}^2 = 4.5 \ \text <S> {mJ} \$. <S> We know from the maximum power transfer theorem that maximum power transfer occurs when the load resistance (R1) is equal to the source resistance (the 800 Ω of the relay coil). <S> The reader can prove to their own satisfaction by calcuus that the maximum time delay will occur when the relay is short-circuited at the instant of power-cut. <S> (For simplicity assume that D1 is ideal.) <S> Running this through a simulation results in the graphs below. <S> Figure 2. <S> The switches are opened at t <S> = 1 ms. <S> The time to drop to half-current for circuit 1a is shown by the blue line and occurs 7.3 ms after the switch opens. <S> The time to drop to half-current for circuit 1b is shown in orange and is 3.8 ms. <S> The relay will drop out at twice the speed for the resistor snubber. <S> ... <S> MOV instead of a flyback diode with a relay coil. <S> ... <S> but why would you want to do that? <S> It may behave faster than a diode and uses one component instead of two as shown in Figure 1b. <S> The only reason I can think of is that the coil is normally energized and seldom de-energized, and the MOV acts as a speed-up circuit for de-energization, burning the inductive energy faster than a flyback diode. <S> I agree with that. <S> That said, why not use a zener or a resistor, especially given that MOVs have limited lifetimes? <S> What other options are there? <S> I think we've covered this. <A> Using diodes in the connectors would polarize them so in connectors with surge protection, MOVs are used instead. <A> Reasons not to use only a MOV: <S> "Everyone" uses a diode. <S> I do not know any cases <S> where a diode isn't fast enough to protect the transistor (which is the diode's main function). <S> I think MOVs are more expensive than a simple diode. <S> Reasons not to use zener diode + resistor: a diode is cheaper <S> a zener diode isn't going to be faster than a diode <S> a diode is fast enough <S> You should ask that designer why (s)he wants to use a MOV while almost everyone else just uses a diode. <S> If the relay coil is fed with AC then maybe a MOV would be a solution but using AC to power a relay's coil is either rare or not allowed (for most relays as far as I know). <S> Next time, when someone suggests a weird/strange/non-standard solution, immediately answer: <S> "Great idea, I am curious, why would you do it like that?" <S> so that you can learn something new because who know, it actually might be a good idea. <S> If it is, the person should be able to convince you with facts.
If the MOV can be rated to break down just above the relay voltage then it may be close to the optimum relay load to minimise drop-out time. One big reason to use MOVs over diodes or diode combos is polarity or lack thereof. Solenoid valve coils in their basic form are non-polarized and their connectors are often designed to be reversed in position for physical placement reasons.
How can two 5 V sources be connected to provide more current than a single can? I am looking at this USB connector . It connects to two of your computer's USB ports in order to provide more current than a single port would be able to. From what I have heard, connecting two power lines directly is not advised as a slight voltage difference between the two can cause a current to flow between them and lead to problems. What kids of problems would a direct connection cause? And what are some ways this problem is remedied? <Q> What kids of problems would a direct connection cause? <S> Worst case: A user connects 2 computers (like laptops) directly together and damages the hardware. <S> Some products (with a fruit logo) have known problems when a USB port is externally powered while the device was off. <A> The PC USB ports are rated to 500mA each. <S> Actually they are also hardware limited to 500mA, if you sink more, the voltage will drop and/or the peripheral will be stopped by software and you will get also a warning on the screen. <S> Using a Y cable allow up to 1A current for the peripheral, one USB will limit the supply to 500mA, the other will source the remaining current needed. <S> Only one holds the data lines the other is just for power. <S> Both USB connectors must be connected to the same PC where the supply comes from the same 5V line. <S> Connecting to two different devices is not recommended. <S> The cable is made only to be connected with both connectors on the same PC. <A> This is why Y-cables are explicitly forbidden by the spec: <S> Use of a 'Y' cable (a cable with two A-plugs) is prohibited on any USB peripheral. <S> If a USB peripheral requires more power than allowed by the USB specification to which it is designed, then it must be self-powered. <S> It's true that such damage is unlikely to happen in practice, but if it does happen, you will not be covered by warranty. <S> E.g. I used to have a laptop which kept one USB port powered while hibernated, to let the user charge their phone or whatnot without having to start the laptop. <S> With such a cable, you would risk to damage the USB ports if you forget to unplug the cable before hibernating. <S> If you bought this cable, return it to the seller for a refund. <S> If the seller refuses, try to get chargeback on the grounds that you've been sold non-compliant hardware. <S> There are plenty of external HDDs which either can work from a single USB port or have an external power supply, so there's no need for such a cable if you use those. <A> Most of the PC mother board can provide at least 1A, some can even supply 2A current. <S> The manufacture usually use one fuse for several usb ports. <S> So have a look at the user manual of mother board before you buy any Y cable.
You got it right: using such a cable can overload USB power supplies and damage the hardware in some circumstances. The problem is remedied by refraining from using non-compliant hardware.
How can feedforward be used with PID for motion control In a motion control system where a motor accelerates, coasts, and decelerates (setpoint is position, not velocity!), what would be the benefit of using feedforward with PID, instead of solely PID? How would you calculate a feedforward value to add to the PID output? <Q> Once the motor has accelerated to full speed (coasting) you could potentially overshoot the target position if it is close-by <S> so, instead, you can use feed-forward to limit the full speed to a value that is based on <S> The knowledge of the starting position and The "distance" to target position <S> You might also choose to preset some PID values based on the distance you need to travel to optimize the algorithm rather than use one-size fits all mentality. <A> Feed-forward control usually means measuring disturbances that are direct inputs to the plant or process, and feeding these to the plant input (i.e. earlier in the forward path) through a feed-forward controller. <S> The feed-forward controller TF is, ideally, the inverse of the process TF (or at least the part of the process that's affected by the disturbance), and the resultant signal is negated and added to the plant input signal, thereby cancelling the disturbance affects predictively. <S> TF inverses are sometimes awkward to implement practically, and an approximate realisation is often necessary. <S> Feed-forward control is largely independent of, say, a PID controller in the forward path, so design of the PID controller is not affected by the inclusion of feed-forward control. <A> In steady state the integral will compensate, so it's only good for transitions. <S> So in some systems the controller performs quicker, in others it mat be unstable. <S> Like always, it all depends on the system. <S> Which is why rather than calculate it <S> you could just tune according to the measurements.
Feed forward means that your controller doesn't wait for the integral to build up, it also FORWARDS the setpoint with certain coefficient to the output of the PID.
Unobtrusive panel mounting for controls I'm in the middle of a "living room acceptable" project, and I'm looking to capture the spirit of a 1970s preamplifier (Quad 34, see below). My design has 6 LEDs, 4 push buttons, a latching mains button, and a rotary encoder . The rotary encoder has a threaded attachment, but this would only provide attachment at one side of the board. My original plan was to make a PCB with the front panel controls, and then use adhesive standoffs, but I don't think that the adhesive will sustain button presses over time. My question is how to attach the front panel controls securely, but without visible screw mounts on the front panel itself. I'm using a Hifi2000 case (picture below), which is not drilled on the bottom panel. The front panel is 4mm thick aluminium, and comes blank (aside from the countersunk corner holes). I don't have the tools to blind tap holes just, although this might a good time to pick them up if that's the accepted view. Thanks in advance! <Q> I suggest considering PEM -style blind fasteners. <S> Eg. <S> CSS-series <S> They are clinched into a blind hole. <S> You will need a suitable diameter end mill to make the blind hole. <S> A milling machine is best but a good drill press may work okay since you have a lot of thickness to play with. <A> I have seen plenty of equipment where there is an additional metal panel slightly behind the decorative front panel. <S> If you take that approach, it doesn't matter how ugly the controls' fixings are - <S> all the user sees are the buttons poking out through holes in the front panel. <S> The control fixing panel doesn't need to be attached to the front panel directly. <S> Mounting it to the base of the box should be strong enough. <A> Simon and Spehro have posted solid ways to solve this problem, but here's a slightly more ghetto option you could consider. <S> If you put 2 rotary encoders on your front panel, and not right next to each other, then the PCB will be held securely just by the nuts on the encoders.
Where appropriate, you can also attach small PCBs to the extra panel, for small switches that solder to a PCB, and for lamps and the like.
Easiest way to create electric light source from scratch Is it possible to make lightbulbs or any other electric light source without using high tech equipment? Is there something that could be created in small workshop? <Q> You need only carbon rods (welding equipment or extracted from common zinc battery cells for example), large resistor and somewhat powerful power source. <S> See for example description here . <S> (Image from this site ) <S> But be really careful if you try to reproduce this kind of light source yourself , it is quite dangerous for various reasons (fire danger, high voltage, production of strong UV light and noxious gases), see the warning in linked text too. <A> Yup Arc lights are the easiest by far. <S> 2B pencil leads at a 2A bench power supply is quite adequate. <S> This was my kids at it. <S> Actually at this point it has been turned into a spark transmitter. <A> Lime Light. <S> This is a ball of lime, heated with a high temperature gas flame. <S> Back in the day it was hydrogen and oxygen jets, directed onto the lime target. <S> The light is quite excellent. <S> We had great success with small cockle shells that had a bit of a bake out in the fireplace. <S> Then heated with a MAPP gas flame. <S> When the lime converts to CaO, and it hits temperature, it goes from dull orange, and bursts into white light. <S> Stunning. <S> This is the same effect familiar to users of Coleman and Tilley mantle lanterns - which would probably be a more efficient way to use H-O Making an electrolysis generator to run it off power would be standard stuff. <A> As long as your shop includes a vacuum pump, and you don't want long lifetime, sure. <S> Almost any conductor will give off light if you get it hot enough. <S> Problem is, the hotter it gets the more efficient it is, and it's easy to melt a wire which is glowing white hot. <S> Tungsten is what's used nowadays, and platinum will work pretty well, too. <S> Hot metal oxidizes quickly, so pumping out the air is a REAL good idea. <S> If you don't have a vacuum pump, you can sort of work around it by simply replacing the air with argon, which you can get at any welding supply place. <S> Keep in mind that Edison got a patent for a bulb using carbonized bamboo for a filament, which would last about 1200 hours, in 1879, and tungsten first showed up commercially in about 1906. <S> Not may folks think of 1879 as being "high tech", but YMMV.
Carbon arc lamp is probably the most low-tech kind of bright electric light.
Faradays law of induction - where does the energy for the current in second loop come from? Lets say each of the loops have the same resistance \$R\$ and the emf of the battery is \$V\$. Case1 : There is no second loop. Then if I close the switch for \$t\$ seconds, then the energy supplied by the battery is \$\frac{V^2}{R}t\$ joules. Case2 : There is second loop and we notice current briefly in the second loop when the switch is closed. Suppose this current is constant \$i\$ and exists for \$t'\$ seconds. Where does the energy \$i^2Rt'\$ dissipated in this second loop come from ? I can guess it must be supplied from the battery itself. But my textbook doesn't say anything about this additional energy drawn from the battery. Is there any formula for the energy drawn from the battery when a second loop is present ? <Q> In case 1, when you closed the switch, there will be a time period where the current ramps up to the steady state value. <S> This is due to the loop inductance. <S> It stores energy in the magnetic field. <S> When you open the switch there will be a spark across the contacts (case 1) that dissipates the energy stored. <S> In case 2, at the instant the switch is closed, the current flowing will be different to case 1. <S> This is because transformer action induces a secondary voltage and current will flow in loop 2 via the ammeter. <S> So now you have a short period of time where energy is delivered into loop 2. <S> This adds an extra current demand on loop 1 when the switch closes and is in addition to the ramping-up current seen in case 1. <S> Is there any formula for the energy drawn from the battery when a second loop is present ? <S> In case 1 with the resistance in loop 1 at zero then, when the switch closes there is a rising current (di/dt) = <S> V.L i.e. a rearrangement of Faraday's law. <S> This is altered into an exponentially rising current that ultimately limits at V/R when the loop has resistance. <S> The formula for this is: - This current creates a proportional magnetic field and some fraction of that field couples with loop 2 so <S> , this generates a voltage in loop 2: - \$V <S> = <S> N\dfrac{d\Phi}{dt}\$ where \$\Phi\$ is the coupled magnetic flux and N= 1 in your example. <S> That induced voltage drives current through the effective secondary inductance , the loop resistance and the ammeter. <S> All in series. <A> The power dissipated by the resistor in the first (left) circuit is less than \$V^2/R\$ because there is additional voltage drop <S> \$V_{ind}=L\frac{dI}{dt}\$ accross the line when current is switched on because of its inductance (which is, however, not shown in the circuit diagram as inductance). <S> This difference in power is radiated as electromagnetic energy and may (or may not) be picked up by the second circuit. <S> Note that you cannot apply KVL because the preconditions of lumped circuit approximation are not satisfied: <S> in this case \$\frac{\partial B}{\partial t} \ne 0\$ outside of circuit elements. <A> The electrons in the first loop push on the electrons in the 2nd loop, and as those move they push back on first-loop electrons, upping losses in the battery powered loop. <S> There is a E&M thinker --- Jefimenko --- who states "the use of turtles to model the universe is wrong. <S> Its electrons all the way down." <S> OK. <S> OK. <S> Jefimenko did not state <S> E&M worked exactly like that, but his book"Causality, Electromagnetic Induction and Gravitation" is worth a read.
The voltage and current (in loop 2) are taking energy from loop 1 in addition to the inductive energy held in the magnetic field for case 1.
How to detect when DC motor stalls so that it can be turned off? When a DC motor gets stuck and can't spin anymore, its current usage increases. What I want to do is to detect that current increase and turn off the motor. My motor current is 180 mA. Is there any way to use Hall effect sensors for that? Do I need arduino, or can I do it without programing? If possible, please direct me to a example circuit or article to explore more about this. <Q> detect that "current increase" and stop/turn off the motor. <S> Yes, that's possible. <S> Many real systems actually work that way. <S> This is often the case when the motor opens and closes something so that there are hard stops both ways. <S> When the moving thing gets to the end of its travel, the motor stalls and the current goes up. <S> The control system senses this and shuts off the motor. <S> Of course the motor and its electrical drive have to be able to handle the stall current for a few seconds at least, and you need a way to sense the current. <S> The mechanical system also needs to be able to handle the full motor torque without breaking or wedging. <S> is there anyway to use hall effect sensors for that? <S> Yes. <S> If your motor has Hall sensors to detect position, then you can easily determine when the position is no longer changing. <S> Hall sensors can also be used to sense current. <S> That can be useful when the current is high, like 10s of Amps or more. <S> In your case of 180 mA operating current, a series current sense resistor should be the first thing to look at. <S> do i need arduino <S> No. <S> No one <S> ever needs a arduino. <S> can do it without programing? <S> We don't know what you can do. <S> With enough effort, sensing motor current over some threshold can be done with analog electronics, even with vacuum tubes if desired. <S> However, using a microcontroller is the obvious and simple way to implement such a control system today. <S> Consider just the single issue of wanting to sense the current being over a threshold for long enough to not be a glitch, like 2 seconds. <S> Such timing can be accomplished with analog electronics, but is much easier and more flexible when implemented by firmware running on a microcontroller. <A> If worried about the current peak or the mechanical torque peak you can do it in reverse: limit the current to a bit more than what the motor needs in normal operation and watch for motor voltage to sink to detect the stall. <A> The best method I have used to implement is a servo control method with expected with encoder computed velocity and current feedback. <S> Since these are linear relationships and the acceleration is controlled by a constant current and speed is detected with acceleration computed , there is no doubt when a fault occurs from stiction, interference or other cause. <S> With a heat rise time constant, transient anomalies much shorter than this time <S> may be ignored <<1s <S> so this custom delay is filtered in the error limit detector before power is cutoff. <S> Since DC motors draw upto 10x the current and power on full start or brake, at least 2 measurements of current, speed and time must be detected and preferably 3. <S> If only 2 then more computations are needed. <S> If only using a PTC in series with the motor then some voltage loss and torque is compromised but is the cheapest solution. <S> There are reliability trade offs as the life expectancy of a Polyfuse is known to have limited operations. <S> and not to relied on for constant operation unless custom designed with supplier support. <S> Ref <A> Current is pretty proportional to torque. <S> As soon the fuse is blown, the LED will light up, and the small current through the LED will not be enough to move the motor. <S> It's simply another 10Ω resistor in series then. <S> You may replace the LED with an optocouple to detect the blown fuse with a µC. <S> The downside is you will have to replace the fuse each time you had a stuck failure, but maybe it's not so bad at all because these stuck failures also damage the mechanics and the motor commutator. <A> The high current of a stalled motor is similar to the high currentat startup (because both have the rotor stationary). <S> Usually,one wants the motor to take high current for short startup times, but not for longer stalls. <S> The easy way to do thisis with a thermal switch, often coupled to a red 'reset' button. <S> These switches resettable breaker can be made to accept overcurrent for a limited time, then switch off, until reset. <A> Well, current is one of the things you can very easily sense. <S> In the simplest case: a fuse will melt when there's overcurrent! <S> I don't think you want to replace a fuse every time that happens. <S> An automatic, resettable current breaker (like you probably have in your home to protect your circuits) would do the job, too. <S> Of course, winny is right, and normally, a motor is controlled by some kind of motor controller. <S> You could sense the current going into the motor e.g. with a current transformer or a shunt resistor, and use the resulting information to turn of the motor controller.
You could measure the current but… The simplest way to "detect" such a stuck failure is putting a fuse in the motor circuit, and a LED plus resistor across this fuse.
Relay sticking when switching mains for LED power supply I'm switching on an LED strip power supply using an Arduino, but my relay has just started sticking. The relay switches the mains for a 5V 20A power supply . The relay board is this style . The relay is apparently rated for 10A @ 250VAC, so I think should be fine for the continuous current, but I guess the inrush current when the power supply is first switched on is what's causing the relay contacts to fuse. I have another 4 of these relay boards spare, so I'm wondering if I can either a) Somehow limit the inrush current to the power supply so that I can just use one of these boards, or b) Figure out the inrush current so I can use a more suitable relay. If I go with b) - does anyone know of a relay that would be up to the task? Ideally 5v with the same package as the ones on those boards so I can do a straight swap, but I'm guessing the ones that can handle the higher inrush current are probably a bigger package, right? Edit:Here's a quick schematic of the setup: The reason I'm switching on the AC side instead of the 5V was really just for power saving, so that the power supply isn't on constantly, only when I want it on (when the Arduino signals D5 high). The relay is sticking in the on position - the output stuck on closed and when the whole thing was unplugged (both USB and AC), I managed to give the relay a few taps and it eventually unstuck and opened up again. <Q> In general, relays stick because the contact open when the voltage is high and a spark is generated across the gap. <S> This spark results in damages to the contact or welding. <S> This can be dangerous in certain environments. <S> I don't know how often your circuit turns on the relay <S> so check your specifications to make sure it can handle the switching. <S> For AC applications we try to make the make/break point near the zero crossing. <S> Care must be taken to select components which are rated for your application. <S> Update <S> The value of the R and C across the open can be calculated based on a simple equation which has been derived through experience where C = (I square)/10 with I equal load current. <S> The open voltage across the contact R = V/[10*I(1+(50/V))] . <S> formula by CC Bates. <A> I have faced this issue in past. <S> An easy fix would be to move from relays to solid state switches. <S> Use a standard triac with an optocoupler diac driver and you should be fine. <S> I used BTB16 600BW and FOD420. <S> If FOD420 is difficult to come by, MOC3021 can be used as well. <S> Since your output power requirements are less than 100 watts, the triac won't be supplying more than 1 A (in case of 110 V. <S> For 220 VAC line, it will be even lower). <S> I have tested the triac and it works comfortably without heat sink for currents up to 1 A. <S> You can follow this circuit: <A> There are relays with high inrush current capabilities upto 100A. <S> For example check out the below relays which are 16A <S> , 240AC rated (100A inrush) and comes in smaller size. <S> Pansonic https://www3.panasonic.biz/ac/ae/control/relay/power/dw/index.jsp <S> Omron <S> http://omronfs.omron.com/en_US/ecb/products/pdf/en-g5rl.pdf <S> The other option would be switch to SSR, however you may need to understand their drawbacks like false trigger, heat etc. <A> You can reduce the current surge and prevent the contacts from welding by adding an "NTC inrush current limiter". <S> This is probably being caused by a poorly designed LED power supply (normally there is one built-in). <S> Here is a training module on how to specify such a part (most likely they will specify a particular manufacturer, but you can search for others). <S> For it to be effective you have to allow enough "off" time for the NTC to cool in order for its resistance to go up <S> so the next time the contacts close the current will be limited. <S> They are designed to get quite hot at full load so the resistance drops to perhaps 1% of the cold resistance (and thus the losses are minimal when hot).
Search for spark suppression on the internet you will find literature on how to design a simple RC circuit to reduce the spark.
Indicate Heating, Burning and so on in Circuit Simulation Software Is there have any simulation software which is indicating other than current signals like heating, burning and so on with time by Power . Circuit simulating like real world behaviors of circuit. Component Heating or buring Wire or Track Heating or burring Have this feature in Proteus or Multisim software? <Q> In Multisim, you can use the " Rated " components to simulated thermal overheating. <S> All the components available in this set have thermal simulations. <S> You can adjust the thermal parameters in the component's properties. <A> The problem with simulating this is that the temperature rise depends on the physical shape and size of the system. <S> This is information that is not included in your general circuit simulation. <S> Take for example the following schematic: simulate this circuit – Schematic created using CircuitLab <S> Imagine the first schematic is of a system where the resistors are next to each other and in the second case the resistors are far apart. <S> To your software, these schematics are identical. <S> It doesn't know how close these resistors are, how they are cooled, etc. <S> All of this matters a lot for actual values of temperature. <S> There are options in different tools to add some information about this, as shown in Abdullah Baig's answer to this question. <S> However, these will at best give you a rough indication. <S> If you are in an enclosure with no airflow, you might find your temperatures get a lot higher than if that same component was in free space. <S> Not to mention that if you have more than one component getting hot, you need to really include the influence on each other to get accurate results. <S> With some, it is in the form of a seperate tool, where you would use the information you get from your spice simulation to determine the components generating the most heat and then tell the software that part of the model gets hot. <S> An example of this would be Autodesk CFD. <S> See the image below, where a component was connected to a metal wall. <S> This was the only component that got hot. <S> The power dissapated inside the component was then set. <S> The simulation software could then determine the steady state temperatures and airflow. <S> There are also more complex multiphysics simulation software, such as the software provided by Ansys or COMSOL. <S> However, this is not a simple tool to use; they are very expensive packages and full simulations take a good while to set up, and if done wrong the results are worthless. <A> Hotspot or temp. <S> rise is a product of thermal conductance or resistance ['C/W] times the V(t)*I(t)=Pd power dissipation in real-time. <S> The conductor radiator area and restriction of convection air-flow or inclusion of high-velocity air-flow and PCB copper area for SMT parts are strong design factors. <S> This requires you to enter the thermal properties into the design and the air mass, speed and direction. <S> Thus generally it is not worth the effort to model this. <S> Instead a 1st order T_rise= <S> Pd*Rja calculation is done for each suspect hot part and then verified during Design Validation Testing , DVT. <S> If you wish to see PD in real-time, may programs can do that part then use your own validated Rule-of-Thumb such as 10mm^2/W for a 60'C rise for open convection cooled conductors. <S> See the 4k resistor power dissipation Pd(t) graph and red colour-coded Power dissipation which has a slider you can adjust on Falstad's simulator.
There does exist software that can do this.
Analyze of 4-20mA circuit I'm looking at the 4-20mA circuit below and trying to understand it. For some reason I can't get this to click in my mind. Pressure sensor is a Metallux ME751 with a supply voltage of 9..35 VDC and it outputs 4-20mA. From my point of view (please correct me where I'm wrong!): LM317 together with the R1 creates a current limiter at 1.25V / 56Ohm = 22.3mA. This current then goes through Pres sensor which change it based on the pressure. 4mA for its lowest point and 20mA for its highest point. The R2 resistor I don't understand the purpose of, but R3 will give a voltage to the ADC of 0.88V @ 4mA and 4.4V @ 20mA. My questions: The pressure sensor needs a supply voltage of 9-35VDC, how do I know what voltage the pressure sensor gets? i.e. what is the voltage on the lowside of R1?? What is the purpose of R2? If I removed the LM317 and just supplied 24V to the Pressure sensor I would know it got the voltage needed. Would it still produce a 4-20mA current based on the pressure or does it need a constant current to work? <Q> The LM317 provides short circuit protection to the circuit, you can assume the voltage at the top end of the pressure sensor is more than 20V unless the pressure sensor tries to deliver more than about 22mA. <S> The 100 ohm resistor reduces the dissipation in the pressure sensor (may improve the accuracy a bit) and reduces the compliance range by a couple of volts (not necessarily a good thing, but as we'll see, it is not a problem). <S> Typical bridge pressure sensors are fairly temperature sensitive and reducing the dissipation improves accuracy and stability (they are typically temperature-compensated, of course, but that compensation is generally static and does not correct as well for dynamic changes). <S> The 220 ohm resistor is the important one for accuracy. <S> The voltage going into the ADC is 0.88 to 4.4V nominally (ignoring any loading from the ADC). <S> The pressure sensor is a loop-powered instrument, meaning that provided <S> it has enough voltage across it to work it will adjust the voltage drop across itself to supply the required current. <S> You say that voltage is a minimum of 9V. <S> If you add up the drops I mentioned above 20V- 2V - 4.4V it still has 13.6V. Even if the 24V supply is a bit low there is plenty of voltage for the sensor. <S> Note that there should be some protection on the ADC (not shown) because a direct short of the input to +24 could allow almost 200mA to flow (assuming a 5V supply on the ADC), which is more than enough to cause a lot of damage. <S> If there is a clamp on the ADC input, the 100 ohm resistor will limit the current, though it will probably burn up unless it is large (3.6W dissipation). <A> Q1: With a current limiter at the input <S> , the voltage sensor will see the full voltage of the supply minus some small drop across the limiter. <S> This is up to the current limit, after which the pressure sensor voltage would drop to whatever value needed to keep current at the limit. <S> Q2: <S> (is R2 a precision-value?). <S> Q3: <S> You don't have a constant current, you have 4-20 MADC. <S> So you need to rethink your constant-current premise. <S> All of the current that flows through R3, R2, and the sensor goes through the current limiter, which is variable (again: 4-20 MADC). <S> Generally, current loop transmitters supply their signals through one or more devices, such as computer points, meters, paper recorders, etc. <S> Since it is a loop, all devices get the exact same signal and without regard for variables such as signal wire resistance. <S> These transmitters are VERY common throughout the industry, <A> I suggest you remove the LM317 and R1, and apply 24V directly to the <S> + terminal of the pressure transmitter. <S> It will draw as much current as it needs up to 20mA <S> (typically an overrange condition is limited to 22~24mA). <S> R2 serves no purpose in a current source arrangement. <S> The current is dependent on pressure and the compliance of the transmitter. <S> Inserting R2 only steals from your compliance. <S> R3 is a burden or current sense resistor. <S> It's there to turn the current signal back into a usable voltage. <S> Left at the present value, your A/D will see voltages of (4ma * 220 ohms = 0.88V) at the lowest pressure and (20mA <S> * 220 ohms = 4.4V) at the highest pressure. <S> The resulting offset and span can be calibrated out in software. <S> Typically, the sense resistor is sized to produce 1-5V or 2-10V for use with A/Ds, for both convenience and to maximize the range of the A/D.
Speculation since you don't provide details on the pressure sensor, but it may be that there is a maximum voltage drop spec on the sensor and with just 220 that voltage drop could be exceeded at low currents. Also could be for ADC short circuit protection, or even to allow a signal to be read without breaking the loop
Activation of multiple LEDs with one or several transistors I have to activate four LEDs at the same time when the signal varies from 0 V to 5 V . I still have not defined the transistor I will use, but before that I would like to know the best way to do this, with schematic 1 or with schematic 2: Activate all the LEDs with a single transistor or each LED to be activated by a dedicated transistor. I know I should consider the current that will pass between collector and sender to determine which of the two methods to use, but I would like to know which one is the most correct. simulate this circuit – Schematic created using CircuitLab simulate this circuit <Q> Both will work well. <S> However, the second circuit is obviously more expensive to build (and takes more time to solder manually), so you will probably choose the first option (single transistor). <S> The second option (multiple transistors) can be a better choice when there is a lot of current going through the LEDs. <S> You can then share the current through multiple transistors, which can therefore be smaller (sometimes, 4 small transistors are cheaper than one big, and the heat can be dissipated more easily). <S> But given the currents involved in your case, it doesn't matter. <A> Either method works, but I would generally use the first because it is simpler and requires fewer parts. <S> If the signal is actively driven both directions, like from a CMOS digital output, then you don't need the resistor between base and ground. <S> In other words, you can lose R2 in the first circuit, and R10, R11, R12, and R13 in the second. <S> As you say, the transistor in the first circuit needs to be able to handle the combined LED current. <S> For four normal indicator LEDs, that is not much of a limitation. <S> For example, if these are red with 1.8 V forward drop, and the transistor goes to 200 mV in saturation, then there is still <S> 1.2 V left for a resistor to set the current. <S> Doing <S> that gets you the same LEDs lit with the same brightness, but with half the current used. <S> Green LEDs with 2.1 V drop are on the edge, but can work doubled up. <S> Two LEDs would drop 4.2 V. Again, figuring 200 mV for the saturated transistor, that still leaves 600 mV for the current limiting resistor. <S> Especially if you're not trying to run the LEDs at their limit, this can be a legitimate current savings. <A> Both circuits will work. <S> The first circuit is entirely adequate unless you value independent control of each LED. <S> The second circuit has the advantage that if desired you can turn individual LEDs on or off independently and the (obvious) disadvantage of requiring more components. <S> Almost any NPN transistor will work. <S> If the LEDs are white they will have ABOUT 3v on voltage. <S> So I per LED = <S> V/R = (5 <S> -3)/560R = 3.6 mA per LED or about 15 mA for all 4 LEDs. <S> Almost any small NPN transistor will work here. <A> Assuming that your LED require 20 mA each, circuit A will require a transistor that can drive roughly 80 mA. <S> Most transistors will be able to do the job without any problem. <S> On the second circuit, each leg of the circuit will require 20 mA. Again, this is not a problem for transistors. <S> From an engineering standpoint, circuit A is more cost effective since you need fewer components (thus reducing future board ''real estate'' and unit cost). <S> The second one's main advantage is the ability to control each LED individually. <S> One way that you could perhaps improve on circuit one would be to pair up two LED per leg and reduce the resistor accordingly. <S> That way, each leg will still be running at 20 mA, but you will reduce your total current by half and reduce the amount of voltage that is lost through each current limiting resistors. <A> This circuit is more efficient on parts, saving two resistors: simulate this circuit – <S> Schematic created using CircuitLab <S> It's called an emitter follower. <S> The voltage the LEDs see is the input voltage minus 0.6V. <S> For this reason, you need a CMOS output which can drive close to 5V. A TTL output may need a pullup resistor to get it to go to 5V. For a 5V supply, you want 220 ohm resistors for a decent brightness with red or green LEDs. <S> 560 will work but it will be dim. <S> Blue LEDs will need even lower. <A> From your questions, I get the feeling you misunderstand the circuits. <S> Both are "electrically correct." <S> If the question was: 1-which one is easier to build? <S> , <S> 2-which one has fewer parts (more reliable), 3-which one has more LED control?, etc. <S> then you would be able to decide which circuit you should use. <S> However, the amount of "current from the collector to the emitter," would NOT be a parameter to determine which circuit to use. <S> This parameter is used to determine the current capability of the single transistor or of the 4 "equivalent" transistors. <S> If you decide to use a single transistor, it obvious that this transistor should be able to handle 4 times the current of each of the "four" transistors. <S> For example, each LED needs 15ma, then you need a single transistor that handles 60ma (min.), OR four transistors that each handles 15 ma (min.). <S> I hope that this makes it clear, that the current capability of the transistor(s) is NOT the deciding factor, to select circuit 1 or 2.
Depending on the voltage of the LEDs, you might be able to drive two at a time in series with a single resistor.
What is the use of pull-down networks in CMOS gates? Below you can see the basic CMOS inverter. What I don't understand about this particular design is the purpose of the n-channel mosfet which is the part referred as pull-down network. What if we didn't put a NMOS in there? In low input voltages, we would have Vdd as expected but we would have ground voltage, which is zero, on output when we provide the network with high input voltage as well since p-channel mosfet would act like an open circuit hence blocking Vdd from reaching output cable. Thanks in advance. <Q> No, you wouldn't have ground voltage, you would have a floating or undefined voltage. <S> This could cause havoc with the input to the next stage if it is a CMOS input. <S> Its input impedance is so high that its input capacitance could hold it high when you switch off your arrangement. <S> It would also be susceptible to stray electrical noise and switch randomly. <S> simulate this circuit – <S> Schematic created using CircuitLab Figure 1. <S> (a) Shows one gate driving another. <S> Figure 1a shows your gate driving a second one. <S> Figure 1b shows a representation of your gate replaced with simple switches and driving the next gate. <S> All CMOS gates have some input capacitance. <S> It's in their nature due to their construction. <S> A capacitor tends to hold voltage across it unless there is some discharge path for it. <S> The input impedance of CMOS gates is so high (GΩ) <S> that discharge is very slow. <S> Figure 1c represents your proposed scheme with only the P-channel switch. <S> When SW5 is closed the input to the next stage is pulled high and that will work just fine. <S> The problem occurs when SW5 is opened: C1 is charged and with no discharge path the input to the second gate (M11 and M12) will remain high. <S> This could be solved with the addition of R1 as shown in Figure 1d but now notice that when SW6 is closed that R1 is passing current all the time. <S> This will waste power and CMOS is famous for its extremely low power consumption when not switching. <S> (The power consumption rises with frequency as all the input capacitors have to be charged and discharged.) <S> For fast logic it is necessary to charge and discharge the next stage inputs as quickly as possible. <S> The P-channel and N-channel arrangement of the standard gates achieve this very well. <A> I will try to make as simple as I can <S> When you remove the pull down MOSFET from the circuit and assuming the upper MOSFET is an open circuit the output line is now floating(Neither connected to ground Nor to Vdd) for most people this may be Okay since the output voltage is zero <S> but Actually there is no voltage at all it just like a piece of wire connected to nothing but <S> in The case where the pull down MOSFET is present the output is the zero reference Voltage. <S> Another important ability when you add the nmosfet is that the circuit can sink current <S> You can thing of this as follows when output is High current <S> goes form the upper MOSFET to the load so the circuit supplies the current <S> But when the output is LOW current goes into the circuit through the lower MOSFET to Ground <S> Now you have the current flowing in both direction from Vdd to the load when the Output is HIGH and from the load to ground when the output is LOW <S> This important feature won't be possible without the n-MOSFET <A> If you put LED (with resistor) to the output, it should shine or not depending on the input (and on where the LED is connected). <S> If you connect the LED between output and ground, it should shine, when the output is high (and input is low) and be dark otherwise - <S> it works ok, with both current desing and your modification. <S> (When the upper transistor is open, current goes from VCC via upper transistor, then LED to ground, LED shines. <S> If the upper transistor is closed, no connection to VCC, LED does not shine.) <S> If you put LED between output and Vcc, it should shine, when the output is low (and input is high), and be dark otherwise. <S> If input is LOW, the upper transistor is open, the output is HIGH, LED is between VCC and HIGH, so no current can go <S> , LED is dark - <S> it is OK. <S> No for input <S> HIGH (and so output LOW) - <S> the LED shoud shine. <S> The current schema ensure it, as on HIGH input the low transistor is open, so current goes from VCC via LED and low transistor to ground - LED shines. <S> In your modification HIGH input close the upper transistor, but as there is no lower transistor. <S> So current go from VCC via LED <S> and there is no path to ground, so <S> no current can go and LED is dark too - it fails. <A> What if we didn't put a NMOS in there?... <S> .. when we provide the network with high input voltage as well since p-channel mosfet would act like an open circuit hence blocking Vdd from reaching output cable. <S> Open p-MOS will make the output terminal floating. <S> It won't give you 0 the required output. <S> Now what you can do to make it work as an inverter is to connect a resistor from output to ground. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> In this circuit, current flow from Vdd to ground when p-MOS is ON. <S> This problem of static power dissipation can be solved by using an n-MOS instead of resistor. <S> Using <S> n-MOS ensures that only one MOSFET is ON at a time (except at transition) and hence no static power dissipation.
The pull down MOSTFET acts as a switch that connects the output line to ground which Is the zero voltage in your circuit.
Why aren't Stepper motors used in closed-loop systems and PID control? I know stepper motors are usually operated in open-loop systems. I'm curious to why they aren't usually part of closed-loop systems? Also why aren't PID control methods commonly used with stepper motors? <Q> The main point of a stepper motor is that you get discrete steps. <S> However, the cost is larger size and lower efficiency than a continuous motor of the same torque. <S> The advantage of discrete steps can outweigh the various disadvantages when the system can be controlled open loop. <S> If you're going to provide feedback and close the loop anyway, then the stepper motors gives you the worst of both worlds. <S> You might as well use a position encoder with feedback, or a motor with position feedback (like some brushless DC with Hall sensors). <S> Added As Dmitry pointed out in a comment, a control loop around something that can only be adjusted in discrete steps can very easily lead to oscillation. <S> The system will continually dither between the two steps adjacent to the exact answer if there is any undamped I response. <S> When the discrete steps are mechanical, that can cause higher power drain, wear on the parts, and undesirable user experience. <A> This is not actually particularly rare. <S> In industrial systems, stepper motors with encoder feedback are relatively common. <S> And for hobbyists, there is e.g. the Mechaduino project. <S> There are several benefits to using feedback with stepper motors: <S> Does not lose position when overloaded. <S> Can handle higher torque loads, because the feedback keeps magnetic force optimally aligned. <S> In open-loop stepper control, the maximum torque magnetic alignment would be when the rotor is 1 step behind the magnetic field. <S> But if the rotor falls more than 1 step behind, the torque starts decreasing and it quickly falls 4 steps behind and loses steps. <S> Motor runs cooler because the feedback adjusts control current depending on load. <S> The only drawback compared to open-loop stepper systems is the price. <S> However, the real competitor is closed-loop BLDC motors, which have advantages over closed-loop steppers: <S> BLDC motors need only 3 push-pull driver channels, whereas steppers need 4. <S> BLDC motors can usually handle a wider speed range, though this depends entirely on the design choices in the motor. <S> BLDC motors have less cogging , so they can achieve better position control. <S> This is the reason why in industrial projects BLDC motors are getting more and more common in closed-loop systems. <S> But for hobbyist, stepper motors with high torque can often be cheaper than BLDCs with similar torque, and it is also mechanically an easy upgrade from normal stepper motor. <A> Provided you don't miss a step , a stepper motor should give you a deterministic movement. <S> You can run it N steps forwards and N steps backwards and it will be in the same place. <S> This is because the steps are discrete. <S> Problems arise if it jams or you try to drive it too fast. <S> Many systems have a simple means of resetting to a known state through a limit switch. <S> e.g. floppy disk drives have a "track 0" sensor; on insertion the computer will drive the head backwards and forwards until it finds track 0. <A> I've worked with systems that achieved extremely precise rotational positions and rates by microstepping stepper motors that then drove a worm gear unidirectionally. <S> The key to that system is a linear encoder wrapped round the rotating part, which gives you you closed loop. <S> This was positioning a diffraction grating in a spectrometer. <S> Some motorised microscope stages also use a linear encoder close to the specimen. <S> In this application the load or its leverage may change by enough that the mechanism deforms or its backlash changes, meaning that counting steps from a reference switch no longer gives an accurate position. <S> This may or may not be used ion a closed-loop configuration <S> (i.e. we may just want to display the position to sub-micron precision, or we may want to move the sample in such steps)
Stepper motors also have a low upper speed.
LM358N single supply does not reach GND According to LM358 datasheet from TI it should be capable to reach GND when operated from a single power supply in linear mode. Thus I have decided to use it as input buffer to an ADC as shown: with 1.65 V implemented as: However it is not doing what I expect. In the following image CH1 is showing the + pin of C3 and CH2 is showing "ADC_INPUT": Any idea? <Q> LM358 datasheet says it is only able to sink a couple tens of µA when the output is close to 0V (see page 6, output current/sink). <S> If you check the internal schematics (page 13) this is quite obvious (Q13 can't pull the output below 1 Vbe). <S> This isn't a true rail to rail output. <S> It can only go to 0V if the load is something like a resistor connected to ground, in this case the opamp does not have to sink any current, so it works. <S> In your schematic, when the output is at 0V, the opamp output will have to sink 1.65V/10kOhm = <S> 165µA which is too much. <S> You need a true rail to rail opamp, or larger feedback resistor values (which will increase noise due to bias current). <S> Note: <S> LM358 was introduced in 1972. <S> It is still produced because it works fine in its application domain, and it is very cheap. <S> It's a timeless classic. <S> However, real rail-to-rail opamps that actually work well are a much more recent development. <S> Don't expect it to compare to a 50c modern RRIO opamp... also 50 cents is very expensive compared to the price of LM358... <A> Reference to the schematic shows that there is a limited current source that allows you to get close to the negative rail, but the datasheet shows that you can only get as close as about 200 mV. To get rail-to-rail you need a FET op-amp. <S> Read <S> this <S> for more information, it shows the current limitations as you approach the positive and negative rail. <S> Select a rail-to-rail op-amp such as the MCP6411 which can get you to within a couple of mV of the rails. <A> I would try grounding the output probe to see where the actual ground level is. <S> You might be at actual 0V there in the bottom ,but have clipped the signal by too much gain.
The LM358 is NOT a rail to rail op amp.
Combining a bootloader and user program into single flash-able binary I want to flash the UF2 bootloader for SAMD21 MCUs together with a compiled binary of a user program onto a SAMD21 MCU. From what I understand how any bootloader works, the bootloader sits in a specific address space in the flash (in case of UF2 it seems to be 0x0-0x00002000) and then after that address space the bootloader will flash the user program and execute it. Now it would be great if I can program my board with the bootloader and the default user programm all in once without needing to flash the bootloader with the programmer first and then connecting the board via USB to flash the user program. Can I somehow concat the binaries so the programmer can flash everything at once in a single operation? I planned on using https://github.com/adafruit/Adafruit_DAP with a Teesny for flashing. This works great using only the bootloader binary. <Q> You've inaccurately specified the bootloader address, and that's important. <S> If both are going into the same user flash bank, that would typically be the case. <S> But if the regions are distcontinuous, then you'd need a format like an Intel Hex or s-record file or a .elf <S> which can accommodate jumps to various addresses. <S> With a GCC style toolchain (as Atmel themselves now offer for their ARM parts) you can typically use the arm-none-eabi-objcopy (middle identification may vary) to manipulate and combine .elf, hex, and flat binary files. <S> For simple cases you can also combine flat binaries with cat (if no padding is needed) or dd (if it is), and combine .hex files with <S> cat or a scriptable text editor, possibly after stripping off any whole-file metadata. <S> For a typical program including the bootloader you are looking at, you'll find the actual memory assignments in the linker script (.ld) file, and you can find the usage of objcopy to produce a flat binary in the project Makefile. <S> Note that generally you want to build and link each of the bootloader and the application program as independent projects <S> ; you don't want the linker trying to share anything between them, except possibly for things you define at fixed dispatch addresses; otherwise it becomes near impossible to change one without requiring a rebuild of the other, which largely defeats the purpose of having a bootloader. <S> When I do bootloaders for ARM-based systems, I typically just have the bootloader parse the vector table at the start of the application program, mimicking what the hardware itself does on startup; that also makes it possible to simply copy the application program's vector table to the hardware start address and have the chip start directly into the application without a bootloader, which can simplify debugging. <A> 1) Depending on your toolchain, you may be able to take the binary of your application firmware that you get after compiling, and use the bootloaders linker file to link in the applications binary file to the correct address range. <S> 2) <S> You can use an SRecord tool like http://srecord.sourceforge.net/ . <S> There are command line tools to manipulate srec files and convert to binary and back. <S> I suggest creating a batch file so you don't have to do this manually every time you compile and test. <S> 3) <S> This is the most time consuming to implement. <S> But if you do a lot of bootloaders and have different MCUs and platforms, this could automate a lot and save you time. <S> You can create your own PC application that takes binary files or srec files and a configuration file. <S> Then it will combine the bootloader with the application and generate any other files you may want, like an encrypted file, inject an AES key into the image, push to testing, create log files, etc. <S> But this may not be the way to go the first time around. <S> Notes: <S> Note that i'm assuming you have already edited the application to support a bootloader, such as editing the linker file to start at the correct address you need it to go once it's combined with the bootloader. <S> Also that you already have the application re-locating the interrupt vector table to another location, and that the bootloader knows where to jump into the application and to verify the checksum of the application before booting it. <S> Once all that is done, then you can generate the binary file and combine it with the bootloader. <A> Take a look at SRecord - it was designed with this goal in mind. <S> It handles not only binary files, but also many other formats, such as Intel HEX and Motorollla HEX.
If the regions the bootloader and application programs would occupy are contiguous with at most a little padding to allow growth of future bootloader versions, then you can simply concatenate the binaries (with padding) and produce a single flat binary.
What does an RF coupler actually do? I've spent a few hours reading about the basics of RF directional couplers, but I am still having trouble understanding just the very basics of what a coupler does. To start with, I've had difficulty finding a good, simple explanation of what directional coupling is. I read through Radio Electronics , but the section on directional couplers doesn't give an overview of what it means to "couple." Could someone offer a simple explanation of what "coupling" is and what a directional coupler actually does? <Q> Here's a couple of ways of drawing a directional coupler in a block diagram. <S> (image source: Wikipedia ) <S> Most of the signal incoming at Port 1 (P1) will pass through to P2, since they're connected by a transmission line. <S> And most of the signal incoming at P2 will pass through to P1. <S> "Coupled" just means (partially) connected. <S> The key idea of a coupler is that a fraction of the signal coming in on Port 1 (P1) will be "coupled to" the output at P3. <S> Meaning the signal will be output from P3. <S> What makes it a directional coupler is that (ideally) none of the signal entering P2 will appear at P3. <S> Similarly, the output at P4 will be coupled from P2, but not from P1. <S> Often, the P4 output is terminated internal to the coupler device, so you don't have access to it, and then you'd use the second style of symbol from the image. <A> ThePhoton explains What do they do, but Why? <S> (excuse me if you understand this) <S> They let you (a) measure how much power is going out to an antenna, and (b) how much of that is reflecting back because the antenna is mismatched. <S> You can do this by having separate ports, one with a sample of outgoing and the other with a sample of reflecting, which you can measure. <S> You can't measure transmit power by just looking at the voltage because you never really know what impedance antennas are, and the voltage varies along the wire, so you must use the coupler for (a). <S> You must measure reflection (b) because if B is close to A, nothing is leaving the antenna, its all bouncing back, and turning to heat in the transmitter. <S> How is this magic possible ? <S> The current for outgoing will be opposite to the current for reflecting. <S> If we sample the current with a current transformer, then the voltage will be opposite. <S> Now we can arrange for the voltage on the line to cancel out the current sample in one direction, and add to it in the other. <S> (this is not exactly right, but should let you get your head around the idea) <S> Why do you call it Magic? <S> Well it is isn't it? <S> The waveguide component that does this is called a magic T and its just some pipe . <S> How do they do that? <S> There ain't half been some clever bastards <A> A directional coupler can be a splitter and a combiner as well, depending on how it is used. <S> When the coupled port is exposed instead of terminated with some R, then you have a 4 port bidirectional splitter with good isolation and low reflectance when match terminated. <S> To get wider bandwidths , there are various tricks. <S> A magnetic transformer is often used with bifilar wound hydbrid ferrite core is used. <S> ( commonly used for TV signals) <S> e.g. using 50 or 75 ohm port impedance. <S> Above is <S> a 3dB 75 Ohm splitter is also a DC-3 (meaning ideal 3db Directional Coupler , but actually 3.5) <S> Depending on mutual coupling impedance, the coupler can be a -3dB tap ( - 0.5dB loss) down to a -50dB tap with low instertion loss. <S> Also they can be equal power taps. <S> This one can split 5kW at one frequency. <S> Since they cancel forward power if terminated properly, with good isolation ( <S> ~ <S> -30dB ) <S> it can be used to combine two sources or split one source. <S> Isolation is the cancellation of Mutual coupling.
REF Directional Couplers are design as tapped transformers with 1/4 wave reactance inverters to cancel the signal in the reverse direction.
The effect of combined resistors? I need to convert 5v to 3.3v, easy. I need an 2k resistor though so i looked if two 1k resistors could achieve the same effect. I found pretty contradictory information on the subject though, could someone help me out? (sry im kind of a newbie in electronics) Source one: Are two (or N) resistors in series more precise than one big resistor? Source two: https://www.eecs.tufts.edu/~dsculley/tutorial/voltageDividers/voltdiv2.html EDIT: Yes, i am trying to power devices, an ESP8266-01 to be precise, the power will be coming from a Lithium battery. <Q> Well yes, you can combine in series two 1k resistor in order to make a 2k one. <S> However, if you want to draw some current from this new voltage point, you rather use a linear voltage regulator such as 7805 or a LM317 combined with resistor. <S> A little tips about resistors in series : <S> By using two resistors in series, the power is also split equally across both resistor. <S> The current passing through each resistor is still the same but resistor's value is twice lower, so the dissipated power for each resistor is also divided by two. <S> This can lead you a technical choice in some case of high current or cost restriction. <A> I need to convert 5v to 3.3v, easy. <S> You have not explained why you think this is easy. <S> It can be rather difficult in certain applications. <S> If you want to decrease the voltage to a load of fixed resistance then one resistor will suffice. <S> If the load current can change but a fixed voltage is required <S> then it is unlikely that one or two resistors will do the business for you. <S> A voltage regulator is required instead and this will adjust its 'resistance' to compensate for changes in the load. <S> I need an 2k resistor though <S> so i (sic) looked if two 1k resistors could achieve the same effect. <S> I found pretty contradictory information on the subject though, could someone help me out? <S> You need to specify what variation your application can tolerate and work from there. <S> Most circuits do not require great precision to work satisfactorily and standard E12 (12 resistors per decade) 5% or 1% tolerance are satisfactory. <S> Yes, i am trying to power devices, an ESP8266-01 to be precise, the power will be coming from a Lithium battery. <S> A resistive divider is not suitable. <S> The ESP8266 will have varying current requirements on power-up and during operation depending on what the CPU is doing and what outputs are on or off. <S> You need a low drop-out voltage regulator. <A> Actually, more resistors CAN be more precise than one resistor. <S> Assume <S> you have multiple resistors, say N, of 1000 ohm. <S> Each resistor has a tolerance (in %). <S> If you add multiple resistors of the same type (with the same tolerance), the chance you are ON AVERAGE closer to 1000 ohm is higher. <S> However, since this is statistics, it doesn't mean it is always true. <S> If you want to be sure, you measure it with an ohm meter and select a resistor that is close to 1000 ohm. <S> Also, an advantage of multiple resistors is that the heat is spread over more resistors (most default type of resistors is 0.25 W, probably less for SMD types). <S> So using 2 resistors gives you a bit more headroom. <A> ESP8266 specs: V10 1.7~3.6 V LiPo Specs: 3~4.2V <S> 3.3V LDO ideal https://www.digikey.ca/product-detail/en/rohm-semiconductor/BU33SD5WG-TR/BU33SD5WG-TRCT-ND/5720185 <S> Poor man's solution Silicon diode drop 0.65~0.7V with 0.1uF cap. <S> 5 to 3.3V logic inputs can use R divider. <S> 2k series, 3k shunt to 0V or similar to get 60~66% of input voltage.
If you just need a reference voltage then a pair of resistors will suffice.
Effect of switching frequency in boost regulator with switching load I have an objective to make a pulser for ultrasonic 1Mhz and 120V, for step up DC i used a boost converter with switching frequency 10KHz, 0.9 Duty Cycle and 12V supply, the boost converter work perfectly for static load like 1Mohm, but when i attach the converter for supplying my switching ultrasonic, the voltage from the converter was continuously decreased. below is the simulation and the circuit the green line is the supply from converter right before the zener diode, and the red line is voltage in R3, note that it is 1 MHz switching so it seems just like a solid shape. the green voltage dropped down when the switching circuit does the work, after a while the voltage will be below zener diode and the diode cannot maintain the output voltage. so how to maintain the voltage for supplying the switching load circuit do i need to increase the converter frequency to 1Mhz, same as the switching load? but when i do this, the voltage is slightly less than 10KHz converter. i have tried to increase C1 but the voltage still drop down but just with less step, so will huge C1 solve the problem? thank you so much for the help <Q> You could use a boost controller IC that has feedback divider at C1 and changes its duty cycle to maintain the set voltage. <S> This would eliminate the need for Zeners and increase duty cycle of the converter automatically once 1Mhz pulse load starts. <S> Texas Instruments over 100V output <A> M2, when conducting, shorts (well, through R1) <S> your output to ground. <S> This consume much more power than your static 1Mohm load (actually, ~7.5W at 50% duty cycle), and the converter can't keep up. <S> Put this transistor in series with the load rather than in parallel <S> , so there is no power wasted when the load is unpowered. <S> If the load doesn't allow this simple change (too resistive and some capacitance), use a totem pole. <S> Something like the circuit below could work, provided that you choose small mosfets with low gate charge (still withstanding 120V): <S> The simulation of the above circuit shows the supply doesn't need to provide more than 1W, and the control pulse current is reasonable <S> (e.g. a NE555 will be able to provide it). <A> You have a 2.2 ohm resistor in series with your 12 volt supply: <S> - This is going to reduce your perceived input voltage as you draw more load at the output. <S> Also, you need to remember that a boost converter blindly pushes energy per cycle to the output and it doesn't understand about regulating voltage. <S> Given that 90% doesn't leave much headroom <S> I'd be tempted to increase the switching frequency and lower the inductance. <S> A higher switching frequency means that you have a potential for delivering energy at a faster rate. <S> A lower inductance allows the inductor current to ramp to a higher level in a shorter time hence this also has the potential to deliver more energy per cycle. <S> Then, put it all together into a closed loop that regulates the output voltage by varying the duty cycle. <S> That is what commercial chips do.
If the energy you push each cycle corresponds with the energy taken by the load each cycle then it regulates but, as you draw more load current, the output drops unless you put more energy in and that means raising the duty cycle above 90%.
Why are accelerometers (and other MEMS devices) so rarely integrated into components? With the way things are headed, more and more functionality moves into a single chip each year. However, one thing that seems to remain completely untouched by this is MEMS devices like accelerometers and gyros. Despite many device classes practically requiring accelerometers, integrating MEMS into chips seems astonishingly rare, except for a few expensive (and weak) outliers by ST and Bosch. I assume the reason is technical. In particular I'm interested in the following questions: What makes them so rare? Do process differences have an impact on this? How do the components that do exist circumvent these problem(s)? <Q> If you meant your question as "why do we not integrate them into a full SOC", then I am afraid I do not really answer your question below. <S> Else: In addition to the reasons already given here is that they not just require extra steps, but compromises on steps. <S> The CMOS would not be as good as a dedicated CMOS process <S> either (for example, heating steps of your MEMS part would impact the doping profiles of your CMOS devices. <S> Many cutting steps like plasma etching, DRIE, etc, use large fields and can cause charge to damage devices). <S> However, it is done: take this example from the Melexis MLX90807 <S> /MLX90808 pressure sensors ( source ). <S> Because of this, it is often cheaper to just use different processes and connect in-package. <S> Here is an example fro mCube ( source ). <S> You can see two die in the top-left picture. <S> According to the source, the top die is connected to the bottom one with through-silicon-vias. <S> An example where bond wires are used to interconnect multiple die ( source ): <A> Even adding something like OTP to a device can mean an extra 4 or 5 process steps which makes the chips more expensive. <S> I don't know if EEPROM is just about cost effective or if they add these because otherwise they can't compete with micro-controllers which do have them. <A> There's no demand for them. <S> Yes, processes differ. <S> MEMS use process steps like DRIE and wet etching that aren't needed for normal ICs. <S> Including these steps is (extremely) costly. <S> The existing components don't circumvent this problem, they focus on being components where there's enough demand to (hopefully) offset the increase in price caused by having the extra process steps. <A> Because the accelerometers and gyros need a inertial mass, higher the mass higher the sensitivity of the sensor. <S> Higher the mass, higher the dimensions. <S> Including into a chip increases the cost more that any other peripheral.
In other words, your MEMS part will not be as good (or as cheap) when it is integrated with CMOS than it would be if it was done with a separate process. The same reason why you do not find DRAM memory inside controllers: the process steps to make these are too different from the standard CMOS process.
A question about digital transmission from a microcontroller For a half km digital transmission I want to use RS485 protocol. I want to sample an analog voltage by an uC like arduino and send this data digitally for half km to a receiver. I want to poll/retrieve the data by sending a character to the uC via the RS485 protocol. So for instance if I send character 'D' it I will receive data. This is to synchronize with the other com port inputs. But the uCs dont have RS485 interfaces. My questions are: 1-) Is RS485 a good choice for such long distance? 2-) First thing came to my mind was a TTL to RS485 converter. Does anyone have experience with that? Or is there simpler or better way? edit: I might need more than 5 of this setup and I want to receive the data synchronous at the PC end. So not a single port. I'm not experienced whether a wireless or wired digital protocol suits more for this. Would polling data solve the synchronization latency issues? <Q> RS-485 is easily controlled using a MCU UART plus an extra pin to control the data direction. <S> Generally you would add a driver (the SN75176 is the grand-daddy <S> but there are many others) <S> and it would be prudent to add ESD protection. <S> Galvanic isolation may be a good idea for such a long run. <S> You need to consider things like current induced by nearby lightning and the fairly narrow common mode range of the differential receiver. <S> Needless to say it needs to be properly terminated and you may be limited in data rate by the long run. <S> You can get an RS-485 to USB adapter for a PC <S> but you must avoid cheap ones that do not properly drive the bus differentially. <S> Some of them are quite appalling - they only drive the bus in one direction to avoid having to deal with data direction. <S> Fine for a few meters if there is no EMI, maybe. <S> You might want to look at alternatives such as fiber optic cable or wireless if this is a serious application. <A> RS-485 is a very good solution in this case (if you can afford the wire). <A> @Newage2000 - You can look at HC-12 module. <S> It has pretty good range. <S> Try using that module at lower baud rates so that you can get long range. <S> I personally using HC-12 module to transmit load values to my receiver at 9600 baud for a distance of 250 mtr. <S> For synchronization purpose why don't you use MODBUS RTU protocol. <S> Its my one of the fav protocol for long distance communication.
The part you are looking for is called an "RS-485 transceiver" or "RS-485 driver".
What is the purpose of two cylindrical holders in RJ45 female connector for PCB I am a beginner in PCB design. While using sensors for my project I thought it would be a great idea to connect my sensors using RJ-45 connector and in my device, I'm thinking of using a RJ-45 female connector for PCB. The female connector looks like this: To make the female connector firmly attached to the PCB board, the 8 pins are soldered to the PCB board. But, besides it, I don't know the use of these cylindrical holders. How to use it? <Q> These are strain relief fittings. <S> They spread the horizontal force that's exerted when you insert or remove the connector from the socket. <S> To use them, follow the datasheet layout for the part and simply put the corresponding hole in the PCB. <S> Those fittings will clip into those drilled holes and hold the part in place. <S> As pointed out by @DaveTweed in the comments, there are also the metal pins connected to the shield, which counteract the normal force trying to lift the connector upwards. <S> These pins should be soldered to the board, and probably connected to ground. <A> They hold the connector in place by snapping in and provide some strain relief. <S> When you make the footprint, it's better to use unplated holes for the locating snaps. <S> They should not have pads. <S> They don't need a net connection, so they don't need to show up on the schematic symbol. <S> The shell pins should have pads and net connections. <S> For example: Follow the datasheet recommendations as to hole sizes and exact positions, and pin numbering (or figure it out if it's not shown, as sometimes happens). <S> The above footprint would be a bit better if pin 1 was indicated, perhaps by a square pad. <A> They also serve to hold the connector in place while it's being soldered. <A> Not to be ignored if your PCB is of any value to you. <S> I recently ignored ensuring these mounts were secure and ended up trashing several boards when the cables connected to them were pulled on too tightly. <S> Although I was able to get the connector body to sit back onto the board, the wires inside had flattened such that they would no longer make a reliable connection to the CAT cable.
This helps prevent the electrically connected pins being damaged over time.
Can we derive all boolean functions using a 2x1 Multiplexer? It is possible to implement all boolean functions using a 4x1, 8x1 or a 16x1 Multiplexer. But is it possible to implement all boolean functions with a 2x1 Multiplexer? I think it is not, because how would it be possible to implement AND, OR, XOR, etc. I think only NOR can be implemented using a 2x1 Multiplexer. Am I missing any point here? <Q> Starting from a standard 2x1 mux: simulate this circuit – Schematic created using CircuitLab <S> You can write its output \$O\$ as a function of \$A, B, C\$:$$O <S> = A\cdot\overline{C} <S> + B\cdot C$$ <S> Starting from here, you have a lot of possibilities.$$A <S> = 1 <S> , B = 0 <S> \implies O = \overline{C}\\B = 1 <S> \implies O = A\cdot\overline{C} + <S> 1\cdot C = <S> A + <S> C\\A = 0 <S> \implies O = <S> B\cdot C$$ <S> So you already have not, or, <S> and. <S> I think you can work the rest from here. <A> Not just with only a 2:1 multiplexer, you'll need to negate a few inputs to get some of the functions like xor. <S> The can do and and or without gates <S> Source: <S> VLSI blog <S> Here is one for a xor function, but it requires a not gate. <S> Source: <S> VLSI Questions Remember that a mux is a collection of gates, a useful one. <S> It's important for you to know how to scale these down becasue you can simplify logic on FPGA's and ASICS and eliminate gates by coding correctly and understanding what the end design goal is. <S> On an ASIC, generally a fewer number of gates is better. <S> On an FPGA using fewer resources is better and usually an FPGA consists of a simple logic chain (like a mux combined with some other logic) and a memory element to form a cell or logic block. <S> Shown below is a truth table for a 2:1 mux, which can be changed to form many different functions: <A> A mux has the following boolean expression: <S> \$F = <S> SA+\overline{S}B\$ <S> Where F is the output, S is the switch signal <S> A is one of the inputs <S> B is the other input <S> So your question boils down to this: Can we make \$F = <S> SA+\overline{S}B_m\$ into <S> \$F = <S> AB_a\$ <S> Yes, the first term in the mux expression, ground \$B_m\$ and replace \$S\$ with \$B_a\$. <S> \$F <S> = <S> \overline{AB}\$ <S> With another inverted input we can use De Morgans laws, or we just do the same as \$F = <S> AB\$ and stick the inverter on the output. <S> I can continue with more gates. <S> But since I've already encountered a "no", it doesn't matter. <S> For clarity, no , you can't derive all boolean functions using a 2:1 multiplexer.
No, in the mux expression, there is only one inverter for one of the input variables.
Why is the output of the precision rectifier 0 when the diode does not conduct? From Wikipedia : "When the input voltage is negative, there is a negative voltage on the diode, so it works like an open circuit, no current flows through the load, and the output voltage is zero." When the diode is off, shouldn't V- be equal to Vin if we are assuming infinite open loop gain? In that case, isn't Vout = Vin instead of 0 when the diode is off? *** EDIT: To address some of the comments, open loop gain is the gain when no feedback is used. So even if the diode is off, there is an open loop gain A on the node directly in front of the diode on the output. This of course Doesn't reach Vout, but it's there. If there is an infinite open loop gain with no feedback, as is the case in the ideal d̶i̶o̶d̶e̶ op amp, then this equation must hold: Vout = A(V+ - V-) If the open loop gain is infinity, then Vout/A = 0 = V+ - V- --> V+ = V-. If the input resistance is also infinity, then there's no current going into Vout and it should be zero, but it's also Vin by virtue of there being infinite open loop gain. Edit 3: I've answered my own question below and removed my answer from the question. <Q> If the diode doesn't conduct, then no current flows through it. <S> The op-amp has high input impedance, so effectively no current flows into the inverting input pin. <S> So no current is flowing through the resistor. <S> Therefore, what is the voltage across the resistor RL? <S> When the diode is off, shouldn't V- be equal to Vin if we are assuming infinite open loop gain? <S> If the diode is not conducting, then you don't have a closed feedback loop. <S> If there is an infinite open loop gain with no feedback, as is the case in the ideal diode, then this equation must hold: Vout = A(V+ - V-) <S> This is simply incorrect. <S> V- is driven equal to V+ by having high open-loop gain, and a negative feedback connection . <S> High open-loop gain is not a sufficient condition to force V- equal to V+. <S> The equivalent circuit with the diode not conducting looks like this: simulate this circuit – <S> Schematic created using CircuitLab <S> There is no way for the op-amp's output to drive the inverting input in any way, towards the noninverting input or otherwise. <S> There is no negative feedback and there is no forcing of V- equal to V+. <S> What happens in reality is that the output voltage is limited by the power supplies of the op-amp, putting the op-amp in saturation mode where the open-loop gain is no longer very high. <S> But that isn't why the inputs aren't forced together. <S> If the input were 1 uV, and the gain 1,000,000, then the output could be 1 V, and it still wouldn't force the inverting input to 1 uV, because there is no closed feedback loop. <A> When dealing with opamps, we generally use the two rules: <S> Opamp inputs have infinite impedance <S> and The opamp will adjust its output so that the V+ input and V- input are at the same potential. <S> The only other thing connected to that node is the V- input, which is high impedance and can't source any current, so no current is flowing and Vout is at 0V (pulled down by the resistor). <A> The real problem I had was with the idealized model of the op amp that I was using. <S> Below the Open Loop Gain <S> A is a property of the op amp. <S> It does not change depending on the circuit configuration. <S> The problem with this model is that it does not capture the effect of the output on the input. <S> From the diagram above, you can attain: Using V+ = V2 and V- = V1, <S> Although you can manipulate the equation of the output voltage to attain V+ = <S> V-, there is no feedback to actually have the output have any effect on the input. <S> In this idealized model, it only captures the effect of the input on the output, but not the output on the input, so solving for the inputs given the output doesn't attain a realizable result. <S> There is no causal link from the output to the input. <S> There is only a link from the input to the output in this model. <S> The equation for the open loop gain cannot be used to determine the inputs. <S> That's really the confusion that I had. <S> Given this clarification, it should be clear that with infinite input resistance in the ideal op amp, that there is no current going through R_L, and that V- is not equal to V+. <S> Therefore, Vout (or V-) is pulled down to 0.
When the diode is off, that means that it's not conducting any current from the opamp output.
More accuracy from analog multiplication? Let's say I want to detect a voltage signal that's guaranteed to be between 0V and 1V through an ADC whose upper range is 5V. I can hook the signal up to the ADC directly, but then I'll only be using 1/5th of the ADC range. Or, I can multiply the signal by 5 through an amplifier to have the signal extend to the entire ADC voltage range. Then, I would divide the signal by 5 (using software) to get the signal back to a number between 0 and 1. Would this latter approach offer better accuracy? Intuitively, I would think that extending the signal to match the entire ADC range would offer better accuracy, but I wonder if I'm just fooling myself. <Q> From a bit more information in the comments, you are using an ATMega168. <S> This microcontroller has three options for the ADC reference voltage: <S> \$V_\mathrm{CC}\$ - usually 5 or 3.3 V. Internal 1.1 V bandgap reference <S> External reference (< \$V_\mathrm{CC}\$) <S> With the 10bit ADC, you then split this into \$2^{10}\$ bins (LSB). <S> To avoid the need to prescale your signal in order to use the maximum dynamic range of the ADC, you can also select a more appropriate reference. <S> In your case, the internal 1.1 V reference gives LSBs of ~1.1 mV and is very easy to use. <S> Simply set ADMUX[7:6] <S> = <S> b11 and put a capacitor on the AREF pin. <S> If you want to use an external 1.024 V reference, this gives LSBs of 1.0 mV; set ADMUX[7:6] <S> = b00. <S> Another advantage of using the bandgap or an external reference is that you are not directly using the noisy \$V_\mathrm{CC}\$ rail as your reference voltage. <S> Typical reference ICs will include lots of filtering, and will give you the lowest noise of the options. <A> It is a valid operation and often must be done (e.g. what if you want to measure a signal which is 0-1mv)There are ADC with built-in Op-amps just for this reason. <S> As always: beware of adding noise by amplification. <A> A 10-bit ADC can (in principle distinguish 2^10 = 1024 different input values, spaced approximately 5 mV apart, so if your signal ranges from 0 - 1 V you will only be able to distinguish about 200 different levels of your signal. <S> Amplify your signal to cover the full 0 - 5 V range and you will be able to distinguish 1024 different levels approximately 1 mV apart. <S> The catch is that the analogue signal amplification may introduce errors in your measurement: <S> error in the gain may mean that the signal is not amplified exactly by 5 but by (say) 4.93 or 5.02 an offset may be introduced so that a 0 V input doesn't give exactly 0 V out there may be nonlinearity , so that the gain is not exactly the same for all input and output voltages <S> there may be additional noise , either intrinsic to the amplifier or picked up from neighbouring circuitry or the general environment, which will alter what you measure any of the above factors may themselves drift over time or with temperature. <S> So the choice of whether to use an external amplifier or not depends on how confident you can be that the improvement in resolution will be worthwhile given the possible additional error. <S> As an obvious example, if you make a simple op-amp amplifier whose gain is set by a pair of resistors with 1% tolerance, you will only know what its gain is to within 1% (unless you calibrate or trim it). <S> As awjlogan's answer notes, with many ADCs there is an alternative option which is to alter the ADC's input range by selecting a different reference voltage. <S> Of course if you supply this reference voltage yourself, your measurement accuracy will only be as good as the external reference.
Amplifying a signal in the analogue domain to match the full-scale range of your analogue-to-digital converter will give you a measurement with better resolution .
What's the purpose of these two diodes in this circuit? What's to point of using these two diodes? Can't you just replace them with a resistor? <Q> This is a crude current source. <S> The two diodes are to create a voltage drop of approximately 1.4v, which is then applied across the transistor VBE and R21. <S> This gives approximately 0.7v on R21, or 10mA through it. <S> Those two diodes could be replaced by a resistor to give the same voltage drop, but then if the supply voltage varied, the current would vary more or less proportionally. <S> With diodes, the output current is substantially constant as the supply voltage varies. <S> It's only a crude current source as neither option with two diodes or a resistor gives you temperature compensation for the VBE of the transistor. <S> Where this form of circuit is used as a current mirror, diode R18 is replaced with a resistor. <S> The remaining diode R19 now compensates for the VBE and its temperature coefficient, and the voltage across the resistor R18 is now impressed on R21. <S> For even closer compensation, diode R19 is often made from a 'diode connected transistor', and better yet, is a dual transistor with T1. <A> Both diodes together produce a volt drop of about 1.4 volts, hence the base is at a voltage of (5 - 1.4) volts. <S> This means the emitter is 0.7 volts higher (due to the base-emitter region being a forward-biased diode) at 4.3 volts. <S> This forces 0.7 volts across R21 and means that a current of 0.7/68 amps (about 10 mA) flows through the emitter and then to the collector load (not shown in your picture). <A> This is a constant current source. <S> The two diodes will drop a fairly constant voltage with respect to supply voltage and current. <S> As a result, the voltage across R21 in series with the base-emitter voltage will have to equal about 1.4V. <S> As the base-emitter junction is in essence a diode, it too will drop about 0.7 V (or at least a fairly constant voltage with respect to current flowing). <S> Because of that, the voltage across resistor R21 will be constant. <A> You could replace the diodes with a resistor, but the stability of the current source would not be as great. <S> The voltage across each diode is relatively constant for small changes in \$I\$ caused by fluctations in +5 V. <S> Each diode is ~0.6 V, so a stable nominal voltage of 1.2 V is present at the base of the transistor. <S> Have a read up on current source design patterns. <A> Let's not forget the temperature dependency of the diode voltage. <S> In this circuit the output current has an NTC, which could be important. <S> A popular variant used to be to replace the 2 diodes with 1 red LED, for less temperature dependency. <S> Avoid zener diodes, they are very noisy. <S> Replace the other diode with a transistor with B-C shorted and you get a better current mirror. <S> Add more transistors, etcetera. <A> It reduces the voltage. <S> A diode makes sure that the voltage drops 0.7V, so using two diodes, results in a drop of 1.4 V. <S> It is called a constant current source. <A> This arrangement is called diode bias. <S> It is typically used instead of a voltage divider network to maintain the bias point regardless if the B+ voltage fluctuates.
If you replace one diode with a resistor then you get a basic current mirror, for less temerature dependency but more supply voltage dependency.
Is a fuse necessary after a power supply? I am working on a project with some 12V LED strips and am planning on powering them with a Mean Well LRS-150-12 power supply (12.5A @ 12V). My total LED strip load is about 10A. I was planning on wiring a fuse holder to the output of this power supply with a 10A fuse for protection, but I was just thinking, is a fuse actually necessary in this case? The power supply can output 12.5A which is just slightly more than the LED strips can draw. The wiring can handle 12.5A just fine. Is there a failure mode of a power supply that could cause more than 12.5A to be outputted, which would necessitate a fuse, or can I rely on the power supply limiting the current to 12.5A @ 12V which everything can handle so no fuse is necessary? <Q> I have that same exact power supply, and it has built in overcurrent protect - it crowbars hard and shuts off the output when overloaded. <S> It also has a built-in internal fuse on the AC input side. <S> No additional fusing should be needed. <A> A power supply doesn't exactly "output" more current. <S> It's voltage could perhaps rise, resulting in more current (if the load draws it). <S> As they age, they become less stable, but this is not as likely on modern supplies as it would be on ones made before the 90's. <S> Fuses are also commonly used to protect the supply . <S> If there is a short on the load side, either due to some sort of component failure or human error, a supply may over-stress and either burn-out (stop producing power) or burn-up (fire). <S> That being said, that datasheet you linked to states "short circuit / overload / over voltage/ over temperature" protection, so the device should limit its output to protect itself. <A> I think Meanwell take care about protection into their power supply, Still If something wrong happen at your circuit side which short the loop and cause to flow high current. <S> To take precaution in this situation Its better to use Fuse after output power which also make sure about protection for your power supply. <S> So Choose fuse as per your required rating which will make life easy. <A> You'd want fuses in the case of, say, 10 LED strips drawing 1A each, and each wired with wires rated for 1A (but not 10A). <S> In this case the supply is powerful enough to melt the wires if a short occurs, and per-circuit fuses are needed to protect the wires. <S> Since your wires are rated for the full supply current, this doesn't apply, so no need for a fuse.
According to the datasheet, your supply is short protected, so it doesn't need an extra fuse to protect it.
difference between reverse saturation and leakage current I searched a lot but I didn't find any answer For a PN junction diode is the leakage current when the diode is reverse biased Equal to the reverse saturation current?? If they are not equal so where does the excess current come from? <Q> In an ideal diode, they are the same. <S> The diode equation is $ <S> $I <S> = I_s \left[\exp\left( \frac{qV}{n k_B T}\right) <S> - 1\right]$$ <S> so if you apply a strong reverse bias ( \$v \ll 0\$ ), then the reverse current will be very close to <S> \$I_s\$ , the saturation current. <S> In a real diode, there may be other leakage paths aside from through the PN junction itself that allow current to pass, so the leakage current may be greater than the saturation current. <S> For a diode mounted on a PCB, there could be additional leakage due to surface contamination. <A> A quick answer to your question is no they are not the same. <S> On a IV Characteristic curve of a PN junction diode, you will generally have a very low reverse bias current (Leakage current). <S> This current is said to be 1uA in the most extreme conditions for a silicon small signal diodes. <S> The 'Reverse Saturation Current' is also called the 'Zener Breakdown' or the 'Avalanche Region'. <S> This current will drastically increase as the Reverse Breakdown Voltage is achieved and most likely destroyed your diode unless you have a high resistance in series to limit the current flowing through the diode in breakdown conditions. <S> If you are looking at a specifications for a PN junction diode, I would assume the reverse saturation current is specified as a maximum. <S> This will give you guidance on what resistor you should put in series with the diode to protect your circuit. <A> On a standard diode. <S> When its reverse bias the depletion region expands. <S> Tis effect causes the diode to become a capacitor (there are special diodes that are enhanced to work like this and used as a variable capacitor). <S> The depletion breakdown voltage is the voltage potential at which the diode will conduct in reverse bias. <S> Since the standard pn junction diode is not constructed like a zener diode (zener diodes actually have pn-pn arrangements on its die internally), it will short out in its typical circuit design due to the lack of current limiting. <S> Zener diodes have to be current limited (usually by a resistor in series) so it can maintain this reverse bias voltage potential without the current running away causing the diode to short.
The reverse bias leakage current is the insulation breakdown of this diode in its capacitance state.
Whats wrong with this circuit? I need an output of 882.3 mV in the highlighted node. According to my calculations the output must be that with Vin=15, R1=17K and R2=1k. So there must be something wrong with how the circuit is wired. What I’m not doing right? <Q> It's funny, I teach EE <S> and I recently gave a circuit quite similar to this to my student. <S> The problem here is all about matching impedance. <S> Because of the inverting amp, you have a virtual ground on the negative port of the op-amp. <S> With a small redrawing you can create a small model of what is going on: 17k in series with two 1k resistor in parallel that forms a voltage divider. <S> Thus, you're input impedance of your op-amp is greatly reduced. <S> Vout <S> = 1k//1k / <S> (1k//1k + <S> 17k) <S> * 15 = 0.5 / <S> (0.5 + 17) <S> * 15 <S> = 428.57 <S> mV <S> To correct this you can either A) put a voltage follower between the voltage divider and the 1k resistor of the summing amp or B) <S> increase all the 1k resistor of the summing amp to a much greater value. <S> E.G: 30k. <S> 30k // <S> 1k = <S> 960 ohm for the lower equivalent resistor. <S> 0.96 <S> / (0.96 + 17) <S> * 15 <S> = 801.7 <S> mV <S> You could increase the summing amp resistors even more if you really want to push the theory to the limit. <S> But, most often you try to keep feedback resistors in the 1k-100k range. <A> For this summing amplifier to work as expected, the sources have to have low impedance in comparison with 1k resistors. <S> The top source has low impedance, but the bottom source does not. <S> As a result, the voltage coming from the top source modifies the voltage coming from the bottom source. <S> To fix this, you can insert a voltage follower (which has a low output impedance) between the bottom source (17k/1k divider) and 1k resistor. <A> Why do you need this? <S> It is the output result ( gain and offset) that counts. <S> an output of 882.3 mV in the highlighted node ?? <S> = <S> - 882.3 <S> mV + 15/2V output from other path ?? <S> It is not the intermediate path that counts, but the combination of R ratio * R4/Rin(equiv) <S> No buffer is needed but you must define your gain properly and compensate for gain variation from R ratios and Req resistance. <S> This is not a fix, but a reason why your assumptions were wrong. <S> If you wanted to subtract 882.3 from the output then you should compute correctly, eliminate R1,R2,R3 and while R1=17k is the correct value!! <S> If the end-goal was to contribute -882.3mV to output from 15V input <S> then -R4/ <S> R1 <S> * 15V = <S> -882.3mV <S> with R4=1k <S> then R1=1k <S> * 15V / 0.8823V= 17k <S> so R2 is removed and R3=0
That virtual ground is the root cause of your impedance problem along with closely matched resistors.
choosing the right fuse for a PCB I am experimenting with making a PCB and have created some short circuits when wiring everything up which have fried one of the traces. i was wondering whether it would be a good idea to put a fuse in the next iteration to avoid breaking the whole PCB if i should make another mistake. could anyone recommend whether this is a good idea and if so, how would i choose the right fuse? the circuit runs of a lithium battery so 4.2v -3.3v thereabouts and i am not expecting current draw about 0.5A. Many thanks. <Q> Check out a resettable fuse such as a PTC: http://www.littelfuse.com/products/resettable-ptcs.aspx <S> The PTC comes in regular packages like 0805 and through-hole just like your other capacitors and resistors. <S> When the current through the PTC exceeds a certain limit it heats up and the resistance increases, reducing the current to your board. <S> Once you turn off the power and the PTC cools down <S> then the resistance decreases and after a while you can use it again, making it resettable. <S> It's not perfect so if you keep tripping the PTC repeatedly you may need to replace it eventually, but it's good for a couple of uses. <S> I'd recommend having a LED before and after the PTC so you can tell when input power is applied (first LED turns on), and when the PTC has tripped (second LED turns off). <S> To pick your PTC you need to look at: <S> The voltage used by the circuitry on your PCB <S> The hold current <S> , how much current can go through the PTC normally (your expected maximum load) <S> The trip current, how much current is needed to make the PTC start increasing resistance and limiting current to your PCB. <S> You can do a parametric search from most manufacturers to focus on the products they offer that fit your requirements. <A> There are trace width / temperature rise calculators you can use to do this. <S> An alternative to fuses are electronic circuit breakers that have the advantage of being more precise and act much quicker than a fuse. <S> Linear Tech, TI and others make ICs that do this. <A> You've probably already done this, but just in case: If your using CAD to design it (I say that because I once saw a guy design an etching mask on a blank PCB with a marker), sometimes the auto-route feature on Eagle or other CAD softwares will have issues and route something wrong or have a few traces too close. <S> I remember eagle once tried to auto label all of my wires as ground. <S> always double check and maybe allow more space between traces in the next iteration if in doubt. <S> I agree with the others,especially raisin-wrangler, I would always use a fuse of some type ( maybe add a crowbar circuit in the final iteration for added robustness if you want ), recheck your PCB wiring AND <S> I would also figure out a way to check the thickness of the copper cladding that's on the PCB. <S> I don't know where you got the copper clad boards from, <S> but I know <S> Some Chinese manufacturers often cut corners and have bad quality control. <S> So you could have gotten a PCB that has thinner cladding than you thought , which might throw the PCB thickness calculations out of whack thus causing the PCB traces to not be able to handle the current. <S> An example of Chinese quality: I once got a Chinese knock off solder station as a gift from a non-Elec. <S> Eng. <S> relative. <S> I took a look inside to find that some of the heatsinks for some finger-burning-hot T0-220 transistors were missing, the soldering iron and heat gun were not ESD safe like advertised and the heat shrink tubing on some connections had not had heat applied yet. <S> However, I'm guessing a micrometer could check the thickness of the cladding? <S> I've designed boards before, but have usually had a board manufacturer do the manufacturing in the past. <S> Nevertheless its an option to keep in mind when ordering boards on the next iteration. <S> Perhaps you could beef up the cladding thickness or select a different manufacturer of the copper cladded boards to combat a cladding thickness issue if it is present. <S> That's everything I can suggest. <S> Hopefully this helps. <S> Good luck on the next iteration. <S> EDIT: wanted to clarify on the copper clad board manufacturer part and put the micrometer part in bold
A fuse could help, but first the traces on the PCB should be designed to handle whatever the maximum fault current can be.
How is this simple circuit working? I'm trying to understand why this simple circuit below works the way does: As it gets darker over the photoresistor (RP) the LED gets brighter. I'm trying to understand it by following the path the electricity takes through it (from - to +). My theory is that when the room is bright, the electricity flows through the photoresistor and never actually gets to the transistor's emitter (so the LED stays off). When the room is dark, the photoresistor has near infinite resistance and thus the electricity is forced to go through the transistor (so the transistor is activated and the LED goes on). <Q> You are basically correct, but it is the base where the voltage rises as the room gets dark. <S> The emitter rises as well but is ~0.65 volt lower. <S> This means the gain/beta/hFE of the transistor is important as to how sensitive it is. <S> A old transistor with poor gain (10) acts as a load to the photoresistor, thus more darkness is needed to make the LED bright. <S> Todays GP transistors have a gain of about 100, and a MPSA28 Darlington has a gain of 10,000. <S> R5 looks to be 100K, which is fine for the transistor you have. <S> With a transistor of a gain of only 10, R5 might be as low as 10K, to supply enough drive current to the base. <S> With the MPSA28 R5 could be 1M ohm. <S> Darlingtons have a Vbe drop of ~1.3 volts. <S> The photoresistor has a wide dynamic range of resistance, so this is a good circuit to practice with in terms of transistor gain vs. bright/dark room, etc. <A> Your intuitive explanation is correct. <S> More formally, a transistor (the red NPN in that case) will start to transmit when the voltage on the base (in between the yellow resistor and the photoresistor) is above 0.7 volts. <S> The equation to calculate the base voltage is: Vb = Rphotoresistor / (photoresistor + Ryellow) <S> * battery voltage <S> Like you predicted, if the photoresistor value become really small compared to Ryellow, the Vb will at some point fall bellow 0.7 volts and the transistor will be completely cut off. <S> That is a simplified version of what could really be going on. <S> In reality, the base current will modulate the current that is passing through the Collector (the top of the transistor). <S> The smaller the photoresistor, the more current flow through B and more importantly through C. To conclude, the transistor can take different state: it can be cut-off (not letting any current flow between the collector (top) and the emitter (bottom), it can be in active mode (letting a current flow in between the collector and emitter proportional to the current flowing through the base) or it can be in saturation where the collector current for a given circuit is maxed out and an increase in the base current will not create an increase in the current circulating on the collector. <S> The LED can be powered in the active or saturation mode. <S> switching between saturation and cut off will act like an on/off switch. <S> To read further on transistors if you're interested: <S> https://learn.sparkfun.com/tutorials/transistors <S> I hope this helps you getting started <S> and I hope I was clear enough in my explanations. <A> Your circuit is the following: simulate this circuit – Schematic created using CircuitLab <S> Roughly speaking, \$Q_1\$ turns on when the base voltage exceeds about \$650\:\text{mV}\$. The LDR and \$R_5\$ form a voltage divider with the following equation: $$V_\text{BASE}= 3\:\text{V}\cdot\frac{R_\text{LDR}}{R_\text{LDR}+R_5}$$ <S> This solves out so that the LED is on (active) roughly when: $$V_\text{LDR}\gt 27.66 <S> \:\text{k}\:\Omega$$ <S> I've got your exact kit. <S> (Nice kit. <S> Love the people that helped create it.) <S> I get about \$5\:\textrm{k}\Omega\$ in bright light and get well over \$10\:\textrm{M}\Omega\$ in the dark. <S> So you can see that at some point your transistor will turn on sufficiently when the ambient light is dim enough. <S> Before that point, \$R_5\$ will still be able to supply enough base current to \$Q_2\$ to keep it ON and therefore \$D_2\$ will be ON . <S> Below that point, the LDR is sinking so much current that there isn't enough left over for \$Q_2\$. <S> So \$Q_2\$ gradually turns OFF when the ambient light is strong enough. <S> For a more "crisp" turn on/turn off behavior you can try the following schematic: simulate this circuit <S> The picture looks like this: You can adjust the threshold with RV.
If the LED is powered in the active mode, chances are that you will see a dimming effect before a complete power off if the light change is slow.
Is a copper pour redundant on the top layer of a multilayer (>= 4) board with a ground plane? In a multilayer board with a GND plane directly under the top layer, does adding a copper pour to the top layer give extra value in terms of reducing crosstalk and EMI? If all signal traces already have an adjacent GND plane, can a copper pour provide additional benefit? (Assuming that stitching vias are used appropriately, and there are no unconnected copper islands to act as antennas). <Q> In a multilayer board with a GND plane directly under the top layer, does adding a copper pour to the top layer give extra value in terms of reducing crosstalk and EMI? <S> If all signal traces already have an adjacent GND plane, can a copper pour provide additional benefit? <S> Can a Faraday cage work just as effectively with one wall open? <S> The picture shows that devices are protected from an external field in all directions i.e. the more sides of the "cage" you have, the more complete the protection. <S> It works both ways and not just against high voltages (incoming). <S> Local emissions (outgoing) of EMI are significantly reduced when using a "full cage" and this is what happens when you fill the "gaps" up on a PCB. <S> Consider also the "patch" antenna: - <S> It uses a ground plane and the top copper emits EM waves. <S> It relies on the dimensions to the bottom ground plane and the width of the top copper to obtain resonance at just the right frequency. <S> If that top-copper is surrounded by grounding copper then its effect is disrupted greatly. <A> Adding copper between signals to reduce crosstalk only works if the copper is effectively grounded at the frequency of interest. <S> For audio, it can potentially help. <S> But for high speed clocks, it will likely make the crosstalk worse since the fill copper has high impedance to GND (relatively speaking). <S> To reduce crosstalk, focus on leaving lots of space around the potential aggressor signals such as clocks. <S> The worst thing you can do is route them along side each other or directly over/under without a ground plane between. <S> Think of it this way. <S> Two traces next to each other act as terminals of a capacitor. <S> The gap between them is the dielectric. <S> A wider gap means less capacitance, and therefore less crosstalk. <S> Adding copper to the gap has the same effect as using a thinner gap (more crosstalk), unless that copper is grounded well. <S> And at high frequencies, it is just not possible to ground that copper well. <S> So there may be good reasons to flood the outer layers with GND copper. <S> It is often done. <S> But adding copper between aggressor and victim signals will probably not reduce crosstalk. <S> Use a large gap instead. <A> Thin copper (35 micron is the standard, or 1.4 mils) will be fully penetrated, thus offer NO SHIELDING to either displacement currents of E-fields or to the eddy currents of H-fields, for edgerates (rise times) of 1uS. <S> Having an extra layer should provide another 6dB attenuation, because the I*R drop in the foil will be cut in half. <A> For example, if you had a thick 4 layer board and the inner layers were spaced close to each other but far from the outer layers.
Depending on board stackup the top copper pour could potentially provide the smallest loop area for signals existing only on that layer.
Why we use two photodiodes as optoisolator or optocoupler? Why do we need two photodiodes in order to create an optoisolator or optocoupler? Many sources say that it is to compensate for the non-linearity of the diodes, but is there any explanation based on an equation or any scientific proof regarding this matter? <Q> I think you might be referring to an analogue signal opto isolation technique like this: - The op-amp on the left is driving an analogue signal across the optical barrier and, to make sure the photodiode on the right is getting the correct signal level, it uses a local reference photodiode and senses the light it emits. <S> In that way, if temperature (for instance) affects the LED light output, it can be compensated for. <S> They are pretty good (better than 1% linearity in many cases) but not as good as digitizing the signal and sending logic streams at high speed. <A> To make a simple opto-isolator, only one LED and one diode is required. <S> This is the normal, common type. <S> It can be used for digital signals, and crude analogue transmission, where the linearity of the signal getting through is not important. <S> If you want to transmit an analogue signal with good linearity, then a second diode is used in feedback to control the LED current. <S> Now the linearity depends on the balance of the two diodes, rather than the linearity of the LED and diode curves. <A> Normal run-of-the-mill optoisolators usually have one phototransistor, the rest have one photodiode. <S> There are is one kind of optoisolator with two photodiodes, as shown above: <S> The IL300 <S> These are matched so you can transfer an analog signal across the isolated divide with light. <S> Other than that if there are "two diodes" in a package they are modeled as one diode. <S> I have not seen any diode curves that have a double knee <S> and I don't see a reason for one. <A> As others have mentioned, the optocoupler could work with only 1 photodiode, the second diode's purpose is to get a reference for feedback and compensation. <S> What others did not mention yet is that the main reason for using 2 diodes is the large manufacturing deviation in CTR (current transfer ratio). <S> In the 2 diode optocouplers the 2 diodes are formed on the same silicon die, so they are much more similiar in these parameters (plus have always the same temperature, etc.) <S> so they generate pretty much the same current and thats why this construction is more precise.
If there were only one photodiode without the feedback photodiode it would be very difficult to drive the LED with the correct current to match the voltage on the other side of the divide.
Switching input voltage, with two 3,3V inputs I'm designing a circuit that can get its power from either a battery or a usb. The regulating of the battery and usb voltages is already done, and is regulated down to 3,3V.If both supplies is connected at once, I don't want them both to supply. If both are connected, I only want the USB to power the circuit. If only the USB is connected, only the USB should power the circuit, and if only the battery is connected that should supply the circuit. How can I do this with ex. the use of MOSFETS or diodes? Thanks in advance. simulate this circuit – Schematic created using CircuitLab EDIT: simulate this circuit <Q> There are a few ways to do this. <S> Personally, I think the easiest way is to get regulators that have a shutdown pin. <S> With the battery input, you can have a pull-up resistor on the SHUTDOWN pin of the regulator. <S> Have an N-channel MOSFET there aswell. <S> When the USB is active, it toggles the MOSFET and pulls the shutdown pin low, which will effectively disable that regulator, then you can use the USB power. <S> Here is a very simplified version of this. <S> It has all the information you need, but will still need a bit of work to make it applicable for your needs. <S> simulate this circuit – <S> Schematic created using CircuitLab EDIT <S> If you have a regulator with and active high disable pin, (as the example by OP) the above schematic could be edited as follows: EDIT 2 Schematic fixed simulate this circuit <A> The LTC4236 works below 3.3 volts so maybe consider this as an idea: <S> - There are two supply options on the left and the chip decides which one is to supply the load and it uses MOSFETs as a power OR gate. <S> This type of circuit avoids the diode voltage drop in one or both power lines. <S> The LTC4412 is more suited to supply voltages that are unregulated or different and will require a post regulator to convert to 3.3 volts. <S> I'm not recommending it verbatim but just suggesting that there are devices that can do this job and, if you are confident you can mastermind a version of this in discrete components. <A> In the past I have used the LTC4412 for these kind of dual power supply designs. <S> It is a specially design powerpath controller which automatically switches inputs. <S> The system designer will find the <S> LTC4412 <S> useful in a variety of cost and space sensitive power control <S> applica <S> tions that include low loss diode OR’ing, fully automatic switchover from a primary to an auxiliary source of power, microcontroller controlled switchover from a primary to an auxiliary source of power, load sharing between two or more batteries, charging of multiple batteries from a single charger and high side power switching. <S> Datasheet 4412 <A> In response to answer: https://electronics.stackexchange.com/a/369665/186464 : <S> It seems that with the battery only connected, it's output would be driving the shutdown pin anyways. <S> This would cause it to attempt to turn itself off whenever it's on.
A possible fix is to have the Shut Down pin driven from the input of the USB regulator, though this may have issues with power interruption if the regulator takes time to get to full voltage.
Simple current limiting on linear regulator I'm building a simple 9v linear supply using a 7809. The transformer is capable of the 300mA that might be drawn (guitar effects supply). I'm looking for a a simple way of limiting the output current. The regulator has a inbuilt current limit of course but that leaves me with a choice of 500mA or 100mA - too much or too little. Any suggestions? Putting the regulators in parallel seems wrong as it relies on them being very closely matched as the load is variable, but maybe that's a workable solution? Edit: Should have said that I'm thinking about a through hole device - My experience predates SMD. I'm just getting back into design after a few decades away and I'd like to avoid surface mount for this project, but realise it may not be possible. <Q> You haven't given any reason you need deliberate current limiting at all. <S> Just skip it. <S> It sounds like the transformer itself will limit the total delivered power. <S> I don't get what exactly you are trying to protect against. <S> The 7809 will protect itself because it has a thermal shutoff built in. <S> You didn't give specs on the transformer, but there's a good chance that it can handle a shorted secondary indefinitely. <S> And no, the 7809 does not do current limiting. <S> You are confusing the current capability of different 7809 variants with current limiting. <S> The current capability is the max current <S> the device is guaranteed to be able to output indefinitely, assuming you have ensured that all other parameters are met. <S> Note that this almost certainly includes a heat sink or some kind of cooling. <S> The 78xx series usually needs 2 to 3 V of input headroom. <S> At 2.5 V input headroom and 500 mA out, it will dissipate 1.25 W. Check the junction to ambient thermal resistance, but that probably means just sticking up a TO-220 package in free air isn't good enough. <S> Your real challenge will be designing the thermal system to deal with the heat produced in the 7809. <S> A transformer followed by a full wave bridge and a cap isn't going to keep the 7809 input voltage right at the minimum threshold. <S> The dissipation will therefore be higher than in the example above. <A> You could use a PTC (Positive Temperature Coefficient) resistor in serie with your linear regulator output. <S> PTC will prevent overcurrent by increasing its effective resistor value when it is heated (by an excessive current). <S> A few things to note <S> : 1) They tend to trip a bit before the rated tripping current2) <S> Once tripped, they may take a while to cooldown and reset3) <S> (if it does, then you have a design problem somewhere else). <A> By using a transformer that will withstand shorts on the secondaries there is no need for current limiting! <S> As this is a low current supply then just doing the maths on heat dissipation <S> is all that's needed.
Alternatives: usage of a fuse or a real resetable fuse if you think that it will happen often You can find a wide variety of PTC with various tripping current depending on your desired specification.
What is the name, if they exist, of PCB mountable 120 AC outlet connectors? I am working on a self device which will plug into the wall, similar to this Wifi extender . I am having trouble finding a way to attach the AC connectors to my design. I am considering mounting a connector directly on the PCB, something like this example . This one is a bit too large through (the black housing). Do pieces like the one I am looking for exist? Or what is another way I may consider making the AC outlet connection? <Q> If you don't mind using a power cord, I highly recommend using a PCB-mount IEC connector instead. <S> These are very common and readily available. <S> I recommend using one of the above options instead. <S> EDIT: <S> It looks like Heyco (a company owned by PennEngineering) makes PCB-mount mains blades: <S> https://www.heyco.com/Power_Components/pdf/PCB-Contacts.pdf <A> Make an enclosure like this USB power supply and then use the available ( google "interchangeable AC pins") slip on pins for different markets. <S> The forces on the pins are not transferred to the pcb. <A> Usually the manufacturer will use stamped metal terminals that are retained by an injection-molded case (made of appropriate fire-retardant resin) and connect directly to the PCB. <S> Both can be custom parts, but MOQ and/or tooling costs will be large. <A> How many are you making? <S> If able, I suggest making your device hang off a wall-wart <S> that somebody else has already gotten UL listed . <S> This will save you the risk of fire or shock, and the Byzantine, time consuming process of getting a mains power device UL listed ... <S> The first example (for single/small quantity) that comes to mind is the 5w or 10w Apple chargers, which output USB and are readily available in quantity 1-30 on ebay.
If you absolutely must have a device that plugs directly into the wall, I recommend building your Wifi extender into an enclosure with an integrated mains plug: Individual PCB-mount mains contacts do exist, but are fairly uncommon and difficult to source.
Capacitor as voltage source but why not as current source I have read from so many articles that capacitor acts as voltage source if it has some initial charge in it when connected to load. But why we consider capacitor as voltage source , why not consider as current source? <Q> When we describe something as an (ideal) ' <S> voltage source' or 'current source', we are really describing its behaviour when we connect it to a load. <S> In particular, we do <S> not mean that a current source only supplies current and not voltage, or that a voltage source only supplies voltage and no current. <S> Actually both kinds of sources can supply voltage and current to a circuit . <S> This seems to be a surprisingly common misconception. <S> For example, if we have a voltage source of e.g. 9 volts, and we connect it to a resistor, the voltage across the resistor will be 9 volts. <S> On the other hand, the current through the resistor depends on the resistance according to the equation:$$ I = <S> \frac{9}{R}$$if <S> we change the resistance, the current will also change according to this equation, but the voltage across the resistor will remain at 9 volts. <S> So a voltage source supplies the same voltage across any load . <S> If we connect a current source of 2A to the resistor instead, then the voltage across the resistor depends on the voltage according to the equation$$V = 2R$$but the current is now fixed at 2A. <S> So a current source supplies the same current across any load . <S> For a capacitor charged to e.g. 5V, when we connect it to a resistor we find that the voltage across the resistor is 5V and the current through the resistor is:$$ <S> I = <S> \frac{5}{R}$$If <S> we were to try this with different resistors, we would find that the voltage across the resistor would always be 5V but the current would change depending on the value of the resistance. <S> This is the same behaviour as our ideal voltage source, so we say that the capacitor behaves as a voltage source. <S> Of course, in practice capacitors tend to discharge quickly and the voltage would then drop over time, so the discussion above only really applies to the instant of time immediately after you connect the circuit. <S> However, even though the capacitor voltage drops with time as it is discharged, we still find that it supplies the same voltage regardless of the value of the resistor. <A> simulate this circuit – Schematic created using CircuitLab Figure 1. <S> Ideal components with ideal meters. <S> An alternative approach to understanding is: <S> An ideal capacitor can sustain a voltage indefinitely. <S> (In practice its leakage resistance will discharge it.) <S> It can't sustain a current indefinitely. <S> An ideal inductor can sustain a current into a perfect short-circuit indefinitely. <S> (In practice its internal resistance will dissipate the energy.) <S> It can't sustain a voltage indefinitely. <A> However, a current is drawn from the capacitor if the voltage is changing, making it both a voltage and a current source in that case. <A> Capacitance \$C\$ is defined by the relationship between current \$i\$, voltage \$v\$, and time \$t\$: <S> $$ i(t)=C{\mathrm d v(t) \over \mathrm d t} <S> $$ Or perhaps for this explanation it's better to write it like <S> so: <S> $$ {i(t) \over C} = { <S> \mathrm <S> d v(t) <S> \over \mathrm <S> d t} $$ <S> As the capacitance approaches infinity, the current required to change the voltage across the capacitor approaches infinity. <S> Or thinking of the capacitor as the source, it can supply or sink an infinite current without changing its voltage. <S> This is precisely the definition of a voltage source. <S> We don't consider a capacitor a current source because the math doesn't work out that way. <S> But this isn't the world being unfair to current sources. <S> The electrical dual of capacitance is inductance \$L\$, which is the same equation but with <S> voltage and current swapped: $$ v(t)=L{\mathrm di(t) <S> \over <S> \mathrm dt} <S> $$ <S> Analogously, as the inductance approaches infinity an inductor becomes a thing which can have any voltage across it without changing the current through it: the definition of a current source.
Because a capacitor stores charge, and the total charge inside a capacitor is proportional to voltage.
Transistor action, transistor as an amplifier On Using the transistor as amplifier, does the Current Gain stay constant by changing base current or R base? <Q> The current gain of a bipolar junction transistor (BJT) (one that has a collector, base and emitter) is the ratio of collector current (Ic) to base current (Ib) when it's not saturated. <S> For most BJTs, it varies sufficiently slowly with current that it's worth giving it the name 'current gain'. <S> It is also called beta, and hFE. <S> For typical BJTs, the beta is substantially constant (within a factor of 2 or so) over a large range of Ic from around 0.1% to 10% of rated Ic, in other words the useful or intended operating range of any given transistor. <S> It tends to fall quickly in the top decade of rated Ic. <S> There is also a strong temperature dependence of beta on the device temperature. <A> It is not 100% clear what you mean by "R base." <S> But the input impedance characteristics of the base do not change very much at all. <S> The current flowing into the base programs the collector/emitter voltage/current relationship. <S> So I would say that beta is enforced by changing the collector to emitter characteristics. <S> Not by doing anything to the base. <S> The base current is like the accelerator pedal in your car. <S> When you drive up a hill, the pedal does not push up against your foot harder. <S> The pedal is in charge, and when you push it down, the car speeds up. <S> Let us consider a transistor operating in a steady state with 1mA of base current and 100mA of collector current (Beta = 100). <S> If you attempt to increase the base current to 1.1mA, you will find that this is very easy to do and will not change the base voltage much at all. <S> The voltage at the collector, however, will drop rapidly until the collector current increases to 110mA, or until the collector voltage is lower than the base. <S> Whichever comes first. <S> Hardly anything in electronics is more responsive than a BJT operating in its linear region this way. <S> But if you try to increase the collector current to 110mA, the collector voltage will rise very rapidly indeed, and the base will never know the difference. <S> So to speak. <S> (I am ignoring the Miller effect which you can learn about later). <S> So the base current is like a servo-control that lets you change a much larger current with impressive command authority. <A> If you want to understand how exactly a BJT works you have to think of it as a voltage controlled current source not a current controlled source. <S> This means that the base-emitter voltage is what determines the collector current. <S> Base current is just a deviation from being ideal. <S> Actually base current is not what determines the collector current. <S> As mentioned earlier. <S> You cannot depend on this relationship Ic = HF*Ib. <S> When designing transistor amplifiers any design that depends primarily on Beta is not a good one. <S> Since HF is far from being constant. <S> It depends on many parameters like temperature,collector current,collector-emitter voltage and so on. <S> One reason to convince yourself with the fact that Beta is not fairly constant is by looking at any BJT's datasheet. <S> What you will find that Beta is given at various collector currents and assuming a certain temperature(usually 25 degrees) and fixed collector-emitter voltage. <S> More than that if all the previous parameters agrees with what given in the datasheet,Beta is given as a range not a single value because various transistors of the same type will have different beta values. <S> So one may ask " <S> So if the DC current gain is quite unpredictable. <S> Why it's so important BJT parameter?" <S> But as long as we can design circuits that reduces the dependence on these parameters and as long as we can do good approximations. <S> We can depend on them but with some limitations and caution so that bizarre behaviour is avoided.
As said in previous answers most electronic devices' parameters cannot be reliably assumed constant over a wide range of variations in surroundings and circuit parameters.
Joysticks for PCB design that are better to use than classical mouse I suppose there are some tools (joysticks or something) that professional PCB designers use instead of mouse for PCB routing. Would you be so kind to share with me your experience in that sense ? Thanks, Bojan. <Q> I suppose there are some tools (joysticks or something) that professional PCB designers use instead of mouse for PCB routing. <S> Why? <S> What's wrong with a mouse? <S> I've dealt with various PCB designers (the lab I worked for had about a half-dozen people doing it), and it was all done on PCs with mice. <S> Any PCB layout software will use a quantized grid of pixels, usually on the order of .001 inches or maybe less, and mice work just fine for dealing with such an array. <A> The mouse is sub-optimal for CAD work because it doesn't have means to draw straight vertical or horizontal lines independently; rolling the mouse is always off, which requires an additional move to correct position and therefore wastes designer time. <S> In deep past we used to have devices with two " Thumb Wheels " to control trace placement, horizontally, and vertically. <S> Another disadvantage of mouse as a CAD pointing device is that end actions usually require some click, which also usually affects the cursor position and places the end point slightly wrong, which again require additional "grab and place" corrective action and again is a waste of time. <S> In thumbwheel devices the actions were performed by other hand using designated control keys on a normal keyboard. <S> Unfortunately, these devices are no longer manufactured, I think. <S> But these days this article would probably point you to the best pointer for CAD.Still all of these pointers came from gaming area, and not specifically for CAD. <A> Learning keyboard shortcuts for a given program can increase productivity massively, particularly for enabling and changing the settings of snap-to, i.e. for when you are aligning components and tracks to a grid. <S> Some things I find particularly useful are disabling the secondary functions of the function keys on a keyboard (you don't want to start playing music when you're trying to turn a grid on!). <S> I actually switch from using a trackpad in general work to using a mouse for PCB design as I like keeping the sensitivity of the mouse higher than that of the trackpad. <S> Also click-and-drag I find easier with a mouse. <S> I suppose the point I'm trying to make is that with your own experience you'll find a set of tools that helps you work the most efficiently, it's about trying things out! <A> I would definitely recommend the SpaceMouse from https://www.3dconnexion.de <S> .I used them for many years in PCB design with Altium Designer. <S> You get best results if you use the SpaceMouse with one hand and a standard mouse with the other (strong) hand. <S> You have to get used a little bit to navigate with this 3D SpaceMouse, but once learned, you will never want to miss that again. <S> (Btw: I have no shares for this company/product, I‘m just a big fan of it :-)
In my limited experience of working with an expert PCB designer (expert by my own opinion), they worked very well with the keyboard.
Which electronic Switch to use with 5V as Triggering Signal and 12 V as actual signal? Which electronic switch should I use if I want to control 12 V,1A signal with a 5V arduino output signal? [12 V is high powered signal so can't use boosted 12 V output from 5 V Arduino signal - Image is below] Some specs: The switch should work instantaneously [Edit: 10-20 ms max] Only Triggering ON is needed. If an option is available through which we can only trigger on and later turn it off in any other way, that option is welcome too I have tried: - MOSFET but I guess it doesn't work for gate voltage 5V if 12 V signal needs to be passed through. - Triac & Optocoupler - it turns on alright but it's not turning off in any way I know I will really appreciate the help! <Q> Sounds like a job for a tip122 transistor. <S> Which is one of the standard driver transistors for coils and such. <A> I would suggest a CMOS transistor to allow for rapid switching from low-power to high-power. <S> The propagation delays are usually around 25 nS to 50 nS. SCR is another thought... <S> And if you are looking for further control of your actuator check this link out. <S> Interfacing TTL and CMOS Circuits <A> The circuit below is almost correct. <S> https://teachmetomake.wordpress.com/how-to-use-a-transistor-as-a-switch/ <S> Instead of connecting the input voltage to the board, use a separate 12V source. <S> Just be sure to use a common ground. <S> Bringing the pwm signal up above the transistor’s “on” voltage closes the switch and allows the 12Vs to flow. <A> For that kind of current you probably want a relay with a 5V coil. <S> You could use something like a TE <S> HF353 if you want to solder it into a PCB or there are a ton of larger relays with screw terminals out there.
You’re looking for an NPN transistor.
What is the purpose of the 10kΩ resistor in this circuit? Below is a simple circuit involving an Arduino, a push-button, and an LED. However, I don't quite understand what the purpose of the resistor is. Wouldn't the circuit function without it? Note: Since this question is concerning the behaviour of the circuit rather than the functioning of the Arduino, I've posted this here instead of the Arduino stack exchange. <Q> It just set a default voltage value to the connected node. <S> But, why such a resistor in needed? <S> Well, when the button is open, the voltage is not totally equals to zero due to antenna effect or surrounding component. <S> It is then possible that the Arduino input is trigger for no reason. <S> Note that the value of pull up or pull down resistors use to be around 10k - 100k. <S> If the value is to low, it's going to draw to much current when the button is close. <S> If the value is too high, the resistor will behave as an open circuit, making the pull down resistor useless. <S> As it is widely used in electronics, I recommend you to read some more about this concept. <A> This looks like a pull-down resistor . <S> a pull-[down] resistor is a resistor used to ensure a known state for a signal. <S> https://en.wikipedia.org/wiki/Pull-up_resistor <S> [They] are used in electronic logic circuits to ensure that inputs to the [microcontroller] settle at expected logic levels if external devices are disconnected or high-impedance. ' <S> Just because you have nothing at all connected to an input pin doesn't mean it is a logical zero.' <S> https://playground.arduino.cc/CommonTopics/PullUpDownResistor <S> [D]igital logic circuits have three logic states: high, low and floating (or high impedance). <S> The high-impedance state occurs when the pin is not pulled to a high or low logic level, but is left “floating” instead. <S> [...] <S> a microcontroller might unpredictably interpret the input value as either a logical high or logical low. <S> Pull-[down] <S> resistors are used to solve the dilemma for the microcontroller by pulling the value to a logical [low] state http://www.resistorguide.com/pull-up-resistor_pull-down-resistor/ <S> By the way, as your LED seems to lack a current limiting resistor, it will likely burn out pretty quickly, unless it has some integrated current limiting circuitry that is not visible in the drawing. <A> People tend to think that undefined is equal to zero. <S> Compare it to something in a store that has no price label: customers will joke it is for free ($ 0.00), but it is not: the price is unknown. <S> It is the same with voltages/potentials. <S> If the button is not pressed (not conducting) <S> the potential on input 7 is not defined . <S> It is tempting to say it will be 0V, but there is no reason for it to be. <S> By connecting it to 0V (gnd) trough a resistor it suddenly is defined: there is no current (where would the energy come from), so the voltage over the resistor must be 0V as well. 0 <S> +0=0V. <S> If we replace the resistor with a short circuit the voltage would be zero as well, as long as the button is not pressed (not conducting). <S> But what would happen once you press the button? <S> The left side of the button is at 5V, the right side at 0V (gnd). <S> The result is a short cut: the maximum current will flow from 5V to the gnd and you still do not have a defined voltage at input 7. <A> Pull-down resistor in a digital circuit can be seen in the figure. <S> A pushbutton switch is connected between the supply voltage and a microcontroller pin. <S> In such a circuit, when the switch is closed, the micro-controller input is at a logical high value, but when the switch is open, the pull-down resistor pulls the input voltage down to ground (logical zero value), preventing an undefined state at the input. <S> The pull-down resistor must have a larger resistance than the impedance of the logic circuit, or else it might be able to pull the voltage down by too much and <S> the input voltage at the pin would remain at a constant logical low value – regardless of the switch position. <S> Taken from below siteRead more  http://www.resistorguide.com/pull-up-resistor_pull-down-resistor/
It's a pull down resistor, its purpose is to set the voltage of the Arduino input to 0 V when the button is open.
VARIAC as DC motor speed controller from DC power source I'm not sure if this is is where I should ask this but is it possible to use the VARIAC as a DC motor controller from a DC battery source? The thing goes like this:The 48V, 3kW DC motor is connected to the VARIAC. The VARIAC is then connected to the 48 V battery source. The idea was actually from a Chinese guy and I'm not sure if it's possible. I have consulted with my professors and they don't believe it would work. I am also researching about this but there are not enough articles and forums to support this. Thanks for anyone with an answer. <Q> A Variac is actually an adjustable autotransformer, and is designed to adjust incoming AC voltage up or down. <S> It is also not an isolation device. <S> DC can't be transformed with a transformer, so it would be rather pointless to use a variac as speed control for a DC motor and a DC power supply. <S> You could get some crude control, if you were feeding the variac with 48VAC or so, ran the output to a rectifier, and then to the DC motor, but I suspect you would be much better control and performance with an off the shelf PWM controller for 48VDC. <S> It is likely to be much less expensive <S> then a 3KVA variac as well. <A> I have consulted with my professors and they don't believe it would work. <S> Professors are very, very clever people <S> *. <S> If they say it is not possible I would drop it. <S> In fact I also believe it is not possible. <S> Variacs are transformers and transformers are relying on inductance. <S> That is : they need a continuous changing current. <S> With DC you only get the resistance of the copper wire which is very low. <S> Maybe your Chinese friend is using the Variac as a giant potentiometer. <S> You don't want that as it will heat up! <S> *Which also occasionally make errors. <A> No. <S> A variac is a variable transformer, and transformers need AC for their function. <S> If you hook a variac up to DC, it's just a very low-ohmic variable resistor. <S> simulate this circuit – <S> Schematic created using CircuitLab With a variable resistor, you can create a lower DC voltage from a higher one, but at the price of having a non-neglible loop current across it. <S> For 10VDC and a typical variac of 1Ω, it's 10A, and will drop 100W on the variac alone. <S> So, this is a waste of electrical energy and may overload the variac. <S> If you put a higher-ohmic (and high-power) variable resistor in series with the motor, you could indeed limit the torque and thus, the speed. <S> Again at the price of wasting energy.
If you instead only connected the variac in series to the DC motor, it won't have any effect due to its low-ohmic nature.
Arduino: How does one extend the pins to accommodate multiple sensors? This is a fundamental question about the Arduino system. I've been trying to find answers all day, but keep getting answers either unrelated to the Arduino or completely off topic. I'm building a robot that consumes most of the pins on the Arduino for motor and IR sensor modules. The robot works great (Robot Starter Kit by OSEPP). Now I want to get on with adding several more sensors and an LED output module, but I've run out of pins. I've seen prototyping boards and shields that seem to extend the pin count, and I've read several articles on the address bus helping to uniquely ID all the components, but I'm lost at step one... How does one address various input / output connectors or pins on prototyping boards? Sorry for the noob question, but as with all tech, the simplest first steps are always the least documented. Any links to great tutorials would be greatly appreciated. <Q> There is no true way to expand pins, but there are techniques you can use to exchange processing power and data for more effective pins. <S> Using just 3 pins and 1 chip select (slave select) <S> pin per device <S> you can talk to many devices over SPI (serial peripheral interface). ] <S> 1 <S> If the devices you want to talk to do not support SPI you can use other ICs such as a shift register that talks to over SPI and give you more effective digital IO. <S> The above picture shows an example of two 8-bit shift registers daisy chained together. <S> Using 3 pins from the microcontroller you are able to control 16 LEDs. <S> You can multiply this effect even higher using a technique called multiplexing. <S> Instead of using shift register outputs directly, you can attach components into a grid and "select" a column and row. <S> In this case an arduino using 3 pins is able to drive two 16 shift register outputs which can drive 64 devices. <S> This is essentially how a keyboard works. <A> You first sacrifice some pins to talk to an I/O expander. <S> e.g. you use the two I2C pins to connect to a MC23017. <S> There are lots of tutorials how to do that, including software. <S> That gives you 16 pins <S> so now you have 14 pins more then before. <S> In fact you can connect up to 8 of those giving you 128 pins. <S> But at a cost: you need to write some I2C software to control those pins, read and write them. <S> That will be much slower that the other Arduino pins. <S> Thus you use those MCP3017 pins for 'slower' signals. <S> The MCP3017 also has in interrupt out pin but to use that you have to sacrifice a third <S> I/ <S> O pin of your Arduino. <S> The software for that is again a bit complex. <S> Howevere it allows you to 'respond' to evens on the MCP3017 inputs. <S> The trick is to just 'play' with the I/O expander alone, until you understand how it works and have some code how to control it. <S> Then add that to your robotics hardware and software. <A>
If you have a set of sensors that don't need to be running at the same time (or all the time) you could use a multiplexer to enable them when needed
method to handle concurrent GPIO interrupt sources? I have two GPIO interrupt sources running in two separate threads: GPIO pulses following line frequency(60 Hz) button press How can I use both these interrupts concurrently, considering my controller(ESP32) multiplexes all GPI0 peripheral interrupts into one CPU interrupt? Currently, the program allows only one of them to work at a time. Thanks <Q> I'm writing this without ever using an ESP32 (or any other dual core) or FreeRTOS. <S> So regardless of the GPIO the interrupt happens on, you end up in the same interrupt function, because there is only a single interrupt vector for GPIO. <S> But the ESP32 has some registers to tell you which interrupts are pending. <S> And you have registers which tell you which interrupt is enabled. <S> The combination of those registers allows you to decide which pins are causing an interrupt. <S> So based on this you can do different things depending on which GPIO triggered the interrupt. <S> I'm going to give you the idea, not an implementation, <S> so following is pseudocode: <S> if ((GPIO_InterruptPendingRegister & GPIO_InterruptEnabledRegister) == GPIO_0_Interrupt){ executeGPIO_0_Function(); // <S> or volatile GPIO_0_Flag <S> = true; // depends on how the peripheral handles this, usually needed Reset_GPIO_0_PendingFlag();}if ((GPIO_InterruptPendingRegister & GPIO_InterruptEnabledRegister) <S> == GPIO_1_Interrupt){ executeGPIO_1_Function(); // <S> or volatile GPIO_1_Flag = <S> true; // depends on how the peripheral handles this, usually needed Reset_GPIO_1_PendingFlag();}etc. <S> This way you can split the interrupt into multiple execution functions. <S> I prefer the way using functions, but I'm programming in C++ and try to avoid global variables. <A> First check if the firmware/SDK lets you split the interrupts. <S> You may need to jump through a few additional hoops to be able to do so. <S> Many times the arduino based SDK will dumb down the available options to make it easier on beginners and unify the experience one different boards. <S> And check the spec of the microcontroller to see exactly what will happen when interrupts come in while already handling another one. <S> Otherwise you can check what triggered the interrupt inside the interrupt routine and then set a volatile flag to handle it in your main loop. <A> Unless a device has per-pin latching of interrupt events, your best bet is probably to keep track of the last acknowledged state of each I/ <S> O port register [in latched_port , below], <S> and then do something like: // <S> Assume interrupts are disabled in this sectionuint32_t <S> port_now = <S> GPIOREG->inputs;uint32_t port_prev = <S> latched_port;latched_rising_edges <S> |= <S> port_now & ~port_prev;latched_falling_edges <S> |= ~port_now & port_prev;latched_port = port_prev <S> ; If any bit of interest is set in latched_rising_edges or latched_falling_edges , code should atomically clear the bit (perhaps by disabling interrupts, using linked load/conditional store, or other means) and handle the appropriate condition. <S> Note that if a pin state changes and then changes back before it gets observed by the above code, the transition should be lost. <S> Any time the system is going to go to sleep based on a pin-change interrupt, it should clear the pin-change interrupt flag, then check whether the port state matches latched_port , and only go to sleep if it does match. <S> That way, if the port pin changes before it was read, the code will notice that, and if it changes after it's read, the hardware will notice it. <S> Some platforms make it impossible to totally avoid race conditions, but good platforms will guarantee that events which occur between clearing the flag and reading the port state will get triggered by the hardware in addition to being reported in software. <S> Consequently, even if an event that occurs precisely when the port is being read doesn't show up in the read, it would still register as a hardware wake-up.
From my understanding of FreeRTOS (searching very quickly), you implement interrupt handlers on your own, but have to call some OS-functions from within.
Why do we choose apparent power rating as base in per unit analysis of a power system? Can you please tell me the reason behind choosing the apparent power as base of power in per unit method. Why don't we choose real power instead. <Q> Also apparent power is always more than real power. <S> Those factors make it generally more convenient to choose apparent power as the per-unit base. <S> The key is convenience. <S> There is no reason that some other base can not be selected if it is more convenient for a particular purpose. <S> You can always work out some example problems using real power as the base and then again using apparent power and judge for yourself which is more convenient. <A> The reason per unit is used is to make dealing with units unnecessary. <S> With this in mind, generation capacity, load demand, power rating of components are all listed as being in kVA or MVA. <S> Convenience and patterned thinking are the main reasons to choose Apparent Power as one of the Base definitions. <A> For me, aparent power is the power needed for some device for running (the demanding power) and active power is the part of that which is consumed. <S> Imagine that you have a very bad led bulb (in terms of cos phi). <S> If cos phi is 0.5 and your led bulb consumes 3w <S> you will need 6w of aparent power and thus, the electrical requeriments will be 6w. <S> To sum up consider always the aparent power. <S> David <A> That is because the copper loss in transformer or motor depends on current and iron loss. <S> The iron loss depends on voltage. <S> The total losses depend on VA rating that is mean its independent of the load power factor or real power.
The capacity of the generation, transmission and distribution components is determined primarily by the apparent power. It makes more sense to use the Apparent Power as the Base value rather than Real or Reactive Power; though, if you so desired, you could use either as the base.
how to place decoupling capacitors on a four-layer board for through-hole components? From what I've read online, for SMT components there should be traces from VCC/GND pins to the capacitor and then vias to the ground and power planes. The situation is a bit different for through-hole boards, because the VCC and GND pins will be directly connected to the ground and power planes. In this situation, are traces to the decoupling capacitor even needed? Can the decoupling capacitor not be placed close to the chip and simply connected to the planes with vias? <Q> The best way to place decoupling capacitors is to visualize the current loop that your IC will create. <S> The purpose of the bypass cap is to shorten this loop. <S> (Illustration borrowed from Macrofab). <S> The current doesn't really care whether it's traveling through a plane or a trace. <S> All that matters is the loop length. <S> Keep it short and you'll be fine. <S> You can assume that current will travel in a straight line through your plane to reach the bypass cap. <S> This isn't strictly true, but close enough for most purposes. <S> For a more detailed explanation see this Macrofab post. <A> I was told that you should connect your supply pins to the capacitor FIRST, and then connect the capacitor pins/pads to VCC and GND. <S> In order to prevent the planes/pours from connecting directly to the through-hole IC pins I usually place a cutout around the pad. <S> This forces any transients to "hit" the capacitor first before reaching the IC pins. <S> This ensures that the capacitor directly decouples the IC pins. <S> EDIT: <S> Please read the comments. <S> This has been a debated topic for decades and there are two main schools of thought. <S> Personally I follow the directions I mentioned above, but the comments describe the other side, and I am open to the possibility that they may in fact be accurate. <S> I have not done any sort of real-world testing to determine which method is "better". <A> Concerning the discussion about the "multiple decoupling caps with different values" topic in the comments of the question, I have found a chart that illustrates <S> this: a) is 100nF, 10nF and 1nF in parallelb) is 3x 100nF in parallel <S> You only should place multiple caps of different values if the caps have a high ESR that damps out the resonances or if you don't care about the high resonances but want to be low impedance at a specific frequency. <S> For broadband decoupling, b) is always better than a).
Many years ago I learned that you should not connect the IC pins directly to the plane and simply place the capacitor next to it.
How do I figure out max continuous discharging current of a battery? Looking into ordering a battery for a prototype I'm working on. The power rating for my product requires 4610.6mah to power it for 1 hour and I'm looking for a battery that can support its run-time for up to 10 hours. so 46000mah-50000mah would be ideal. Upon messaging 1 of the manufacturers they asked me "What is the max continuous discharging current of the battery you need?" This was based on LI-ION batteries and not LiPo. With me being a newbie to battery ordering can anyone provide me with an explanation as how I can find out the max continuous discharging current for a battery that is say 50000mah? <Q> If your product requires 4.6 Ah for 1 hour then all you can say is that the average current your product requires is 4.6 amps. <S> This is the average and not the peak. <S> The peaks may be very large (circa 10 amps) but may only last for sub milliseconds in time. <S> If you have reasonable capacitance on your circuit the battery may not see these peaks. <S> However, if in the period of 1 hour you have sustained currents greater than 4.6 amps, this is the number you should be telling the potential battery supplier. <S> So, to make it clear, you offer them informattion about the current (amperage) profile of your product so that they can recommend the best battery for the job. <S> can anyone provide me with an explanation as how I can find out the max continuous discharging current for a battery that is say 50000mah? <S> You are probably looking at this the wrong way round <S> but, if you need to know this, then the data sheet for the battery should tell you. <S> There is no generic answer to this. <A> You read the battery datasheet. <S> Either it will tell you the max discharge current, or it will tell you the capacity at a particular discharge rate, probably in the form C/20 where C means the capacity. <S> You know the current you need : 4.61A. <S> If it lists the capacity as 50Ah at C/10, that means 50Ah over 10 hours, or 5A, you're good. <S> If it lists the capacity as 50Ah at C/20 (common for lead-acid), that's 2.5A <S> so you might want a better battery. <S> EDT as Andy says, if your device draws bursts of higher current, you also need to know the max (not continuous, maybe called peak) discharge current of your battery matches whatever your load needs. <A> (i know that this is old <S> but i'm answering anyway for anyone who looks for this)since <S> you need it to run for 10 hours you will need more than one batteries in parallel so the discharge rate of the batteries adds up for each battery, for example <S> if you have 20*18650 cells at 2500mAh with a discharge rate of 5A each you will get a battery with 50Ah capacity and 100A discharge rate <S> so you'll be fine
If the battery data lists a continuous discharge current of 5A or more, you are good.
Connecting to an IR sensor to a microcontroller module without soldering pins I'm trying to connect an IR sensor to an Adafruit Feather Huzzah microcontroller module without soldering the pins on. The sensor has a power supply of 5V which I have connected to the USB pin of the microcontroller as shown below. I don't have access yet to a breadboard but I want to try and get some data as soon as I can. My first question is whether the electrical connections will work without soldering? Secondly, am I using suitable cables for the connection to the sensor since although it goes all the way in, it is quite easy to pull out. This may be a problem since they may come out during application. And finally, while writing this question, I found that the USB gets regulated down to 3.3 V so I need to use a power supply at 5 V. Is there a quick fix for this or will I have to just have to wait until the breadboard arrives and then connect it to a battery? Also, what are these cables called? <Q> My first question is whether the electrical connections will work without soldering? <S> Probably, but not very reliably. <S> the USB gets regulated down to 3.3V <S> so I need to use a power supply at 5V. <S> Is there a quick fix for this <S> Use the USB voltage directly instead of going through the regulator. <S> If necessary, cut the USB cable open, measure the wires, and use the ones with 5V between them. <S> Note that if you short the output, the USB output of the USB power supply or computer might get damaged. <S> And of course, if you apply 5V to inputs that expect 3.3V, the inputs may become very unhappy. <S> what are these cables called? <S> Many things. <S> Breadboard wires, jump/jumper wires, Dupont wires, to name a few. <A> No, this is not generally workable. <S> The jumper cables are okay for temporary setups. <S> The true meaning of "without soldering the pins on" in the text of your question becomes apparent when looking closely at the picture showing that you have not soldered the headers to the board. <S> This is a common beginner temptation which is unworkable; through hole header pins are made to be soldered and will achieve at best intermittent contact without that <S> (the solitary exception would be that a single, short single row header can be held at an angle with finger pressure for a temporary programming connection if mid-programming failure is known to be recoverable) <S> Once your headers are soldered onto the module, you can indeed use jumper cables if they are functional, make reasonable contact with the component pins as well, and the signals involved are relatively low speed such that the lead length does not become an issue. <S> Another handy solution is to use a wire-wrap tool and wrapping wire to connect to headers - the old style headers intended to support up to three wrapped connections were far longer, but ordinary length headers will support a single connection. <S> Or you can solder wires directly to the module instead of installing the headers. <S> But unless you are using something like spring contacts in a test fixture, you must solder either pins or wires to the MCU board , and then make appropriate connections from there. <A> For testing the cables will probably be suitable, for permanent applications or some proof of concept I would definitely recommend something a little bit more mechanically stable, by soldering it on some quick prototyping board <S> The huzzah feather has an usb pin which will be 5v if the usb is connected <S> USB - this is the positive voltage to/from the micro USB jack if connected note that eventhough you can get 5v directly from the micro usb <S> the GPIO pins of the microcontroller will still only handle 3.3V max <S> The cables are called jumper cables (male-male) (male-female) <S> (female-female)
The problem is that before you can use jumpers, you must solder the header pins to the module circuit board .
Making my own isolation transformer If I obtain the iron core from a microwave oven transformer and strip off all the windings then wind 2 coils, each being 20 turns with 12 gauge wire, will I effectively have made an isolation transformer? Can I use it with household power without tripping the circuit breaker? What do I need to do to make sure to not trip the circuit breaker? <Q> Yes, assuming the wire is insulated from itself and adequate creepage and insulation thickness and breakdown rating (for your purposes) is provided between primary and secondary windings. <S> With 20 turns it will only be useful for low voltage AC. <S> No, it will smoke and/or blow the breaker. <S> Wind enough turns to reduce the magnetizing current to a reasonable value. <S> That will likely be at least as many as were there originally on the primary for whatever your mains voltage is. <S> The magnetizing current is proportional to the reciprocal of the square of the number of turns. <A> Yes, you will have effectively made an isolation transformer. <S> However, there are insulation, creepage and clearance as well as electrical design considerations if you want to make it a safe isolation transformer for mains voltage applications. <S> If you don't understand those terms you probably shouldn't be playing with dangerous voltages. <S> You also need to be sure you are not saturating the core by calculating the max flux density or observing the current as you slowly increase the voltage with a Variac for example. <S> You can easily start a fire if you don't understand all this, so you should consider buying an off-the-shelf isolation transformer if you need one. <A> If I obtain the iron core from a microwave oven transformer and strip off all the windings then wind 2 coils, each being 20 turns with 12 gauge wire, will I effectively have made an isolation transformer? <S> Yes. <S> However, as the core of a typical microwave transformer runs at a maximum of about 1 volt per turn, it's only good for up to 20V AC. <S> Can I use it with household power without tripping the circuit breaker? <S> No. <S> It's only good for a maximum of 20v AC. <S> What do I need to do to make sure to not trip the circuit breaker? <S> Only strip the HT winding, and the magnetic shunts, and leave the mains winding intact. <S> The mains winding is intended for mains. <S> Then wind your new secondary within the vacated space. <S> You'll need approximately 1 turn per volt. <S> If you want mains-level voltage out, you'll need 115 or 240 turns, maybe a few more. <S> You can measure the volts/turn with a few test turns on the secondary, with the primary energised. <S> This is quite a popular way to make a DIY spot-welding transformer. <S> With 5 turns of very thick wire on the secondary, you'll have a 5v 200A transformer.
To know if you can use it as an effective isolation transformer (likely not with 20 turns) you either have to calculate or measure the magnetizing inductance to be sure that when you apply mains voltage and frequency across the primary you are not drawing excessive reactive power.
Which kind of LED shoud I use for I'm trying to make a cheap DIY LED nigtstand Lamp. I'm looking for recommendation on which kind of LED I should use to make enough Light to call it a "lamp". Ideally I would use a 9V battery to power the system. since the whole thing is for a workshop with multiple kids doing multiple lamps. I've look around on digikey and doesn't seem to find any SMD or TH LED that will do the trick for me. I bought a few of these . But the soldering is too hard for kids, and with the small test I made the light emittion seems really low. Any Idea on what I could use? Thank you. <Q> The CoB LED you tried is only 117 lm <S> /W. <S> If you search Digikey Optoelectronics > <S> LED Lighting - White and sort by Lumens <S> /Watt you will find an LED that does 229 lm/W. <S> Everlight 62-227ET/KK7D-3M5050X6Y62629U6/2T/EU <S> A 9V alkaline has about 550 mAH which would last less than 1 hour driving 229 lm/W LEDs with at the brightness of a 60 Watt light bulb. <S> If you want a warmer LED <S> the 3500K 80 CRI LED is 213 lm/W. <S> The 229 lm LED has an output flux of 40 lumens @ <S> 65mA and a forward voltage of 2.75v. <S> You do not want to run these at a higher current as the extra heat will decrease the brightness 10-20%. <S> For 800 lumens each lamp will need 20 LEDs and 1.2 Amp @ 2.75v, 600 mA @ 5.5v or 400 mA @ <S> 8.25V. <S> You mentioned you were looking for SMD LEDs. <S> Later you say soldering is difficult. <S> What you may rather use is an 8.8V Samsung Strip at $12. <S> At 550 mA it will give you 800 lumens. <S> Or a better option might be a $4 Bridgelux EB Series Gen 2 Strip powered by a $7 <S> Mean <S> Well LDB-300L Constant current Boost LED driver with a 9V input and 300 mA output which would give you ≈1000 lumens at the 300mA output of the LDB-300L driver. <S> Then an issue with battery powered LEDs is the brightness decreases as the voltage drops. <S> It is recommended at constant current regulator be used which is the equivalent of a variable resistor that auto-adjusts the current to whatever voltage. <S> I would recommend the ON-Semi NSI45060JDT4G . <S> For batteries I'd go with a 9.6V NiMH rechargeable battery pack (8 AA) which is good for about 600 recharges when discharged to 50% per charge. <A> All the good lighting LEDs that fit the bill are surface mount only, which is going to be a problem if you want kids to solder them in a workshop... unless you buy pre-assembled PCBs or MCPCBs or strips with the LEDs already soldered. <S> They are easy to find online, and the kids should be able to solder them easily, it's just two wires. <S> The strips can be cut to length according to your lamp design (check on the documentation where it can be cut). <S> Since these strips will use resistors to set the current, this isn't the most efficient solution, but it is a good compromise vs ease of building. <S> If the strip takes a 5V supply, the easiest is to power it from a cheap cellphone charger. <S> You can also use 4 AA rechargeable batteries, the light will slowly dim as the batteries discharge, but that shouldn't be a problem. <S> Forget about the 9V battery. <S> These are only for low current applications, also they are extremely expensive. <S> Another option would be to use some hig-power LEDs, which you would buy on star MCPCBs, but you will need a switching driver. <S> These aren't expensive, but it's still an extra part. <S> You can try aliexpress or banggood, there are tons of options. <A> Here is something a bit more modest in ambition. <S> I've taken two pieces of swag, a 5V USB power bank (bearing genuine FCC and UL markings) that probably contains a single 18650 battery (in a metal case). <S> It has a micro-USB charging port. <S> The case is about 20mm x 20 <S> mm x 95mm. <S> A 'free gift' from a seminar. <S> Paired with that is a directional reading lamp (a giveaway from Microchip) which contains 6 bright LEDs. <S> As you can see the light is nothing like the total output of a 60W incandescent bulb, but it is extremely useful, and is just as bright from a close distance. <S> I suspect the light contains only resistors and LEDs. <S> The optical diffuser works quite well. <S> The problem with 9V batteries is that they contain very little energy, and are also very expensive per kWh. <S> A rechargeable Li-Ion battery pack solves both those problems (the power bank supplies 5V regulated at up to 1A and is rated at almost 8Wh). <S> A commercial 60W-equivalent LED bulb consumes about 12W which is far more than the unit can supply, and if it could supply it, it would work for just a short time. <S> The reading lamp only draws 130mA, or about 22mA/LED. <S> So your project could consist of 6 LEDs, 6 resistors and a USB cord, plus maybe 3D print a housing. <S> The one shown appears to be an overmold over a gooseneck kind of things so it holds position. <S> There are ways to do that. <S> Spacing them out so that they don't overheat is part of the design.
A 9V battery is insufficient for a bright (60W equivalent i.e. 800 lumens) LED lamp. If you want a usable lamp on batteries, you'll need a high Lumen per Watt LED which gives the best battery life versus light flux compromise, and also a pleasant color temperature (ie, warm white, not cool white). I think the best would be to use flexible LED strips. At the 15-25mA level you can just pick the brightest 5mm LED you can find (or afford) and use a number of them.
Advantages and disadvantages to loops in VHDL unrolling The question is as follows: Identify and explain two potential advantages and disadvantages of loop "unrolling" While searching the internet I came across these two resources: Resource One Resource Two But all I could really discern from them is that loop unrolling allows parallelism to occur in the system and not really why this is a good or bad thing. Although I know that the whole point of an FPGA is allow things to run in parallel, a feature (loop unrolling) that makes this possible doesn't seem like an advantage. <Q> From the abstract of your second link: Loop unrolling is the main compiler technique that allows reconfigurable architectures [to] achieve large degrees of parallelism. <S> However, loop unrolling increases the area and can potentially have a negative impact on clock cycle time. <S> In most embedded applications, the critical parameter is the throughput. <S> Loop unrolling can therefore have contradictory effects on the throughput. <S> As a consequence there exists, in general, a degree of unrolling that maximizes the throughput per unit area. <S> To me, this directly answers your question. <S> But this comes at a cost of a larger fabric footprint (more FPGA area), which in turn complicates clock routing leading to more difficult timing closure. <S> If timing closure can’t be obtained, the system is forced to use a slower clock frequency, which conflicts with the goal of unrolling. <S> Therefore, you have to find a balance between the two to maximize the gain in performance. <A> It's the only way a synthesis tool can implement an entire loop either in a single clock cycle (in a clocked process) or combinationally. <S> So advantages and disadvantages over other (non-existent) methods of translating a loop are a moot point. <S> It can, as already stated, generate rather large hardware. <S> If that's a problem you need to find another coding approach, for example replcing the loop with a state machine to execute one iteration per clock cycle, for smaller (but slower) hardware. <A> 'Loop Unrolling' is a systematic method of achieving parallelism that can be automated. <S> In the bad old days, we wrote machine code, then assembler, then simple compiled languages, then rich languages with useful libraries. <S> This allowed us to write at a progressivley higher level, and let an automatic process take care of the translation to low level. <S> In the bad old days, we'd write VHDL, and then manually put several blocks in parallel to get the throughput, and manually schedule their operation, pipeline data, to get them to work. <S> Expressing our intention as a high level loop and then letting an automatic process generate the low level timing and dependency ordering is simply applying the same automation principle to hardware design. <S> Advantages - speed, accuracy, humans like to think at high level. <S> That's often correct, with early generation tools. <S> It takes time for the interface to the tools to become easy to use, for the tools to become trusted, and for their performance to improve to the point that no corners remain where human tweaking might still be warranted.
The idea is basically this: if you have a process which must iterate over many cycles, you can employ loop unrolling to parallelize the algorithm to reduce the number of required clock cycles. Disadvantages - humans have this nagging feeling that because 'this bit here' looks inefficient, they could do it better.
Should a trace be connected through multiple pins on a pin header? I'm designing a modular board, where the two modules are connected through pin headers. For mechanical stability I have more pins than traces and my question is that which is the better: route each trace through one pin and leave the remaining pins free or route the traces through multiple pins? In the case of power traces (e.g. ground) I think it shouldn't be a problem, but what about high frequency signals (e.g. gate drive signal)? Does splitting them on the pin header cause any problem (noise, signal integrity, EMI, etc.)? <Q> You don't need traces for mechanical strength. <S> The copper inside and around the hole make up all of the mechanical strength. <S> Adding a trace will not make any difference. <S> I don't know what you are going to 'hang off' your connector but even a 2x5 header is amazingly strong. <S> Just try to pry one off board: you will need a set of strong pliers. <S> Going to e.g. 20 or 25 pins does not add much. <S> For mechanical stability it would be better to use two, e.g. a small one on each side of the board. <S> Signal integrity depends very much on frequency. <S> If you have high frequency signals you should use connectors with the right impedance. <S> Also route direct from the source to the connector. <S> Avoid T-junctions. <S> Where multiple pins help, is when you want to void cross-talk. <S> Keep them apart. <S> If your connector goes to a flat-cable you might want to use signals on all even pins and ground on all odd pins. <S> On your cable you then get signal-ground-signal-ground. <A> This is quite common on power traces, not just "because there are enough headers" but it loweres contact resistance and current capability. <S> When done on high speed signals it can reduce the inductance, and increase the capacitance to other traces. <S> In other words, it could impact the impedance and risetimes. <A> The stability as you clearly know is related to how many total pins you allocated for your pin header interface. <S> So the question is really related with what to do with the spare pins. <S> I would leave one pin per "signal". <S> But for "power" and "ground" delivery I would allocate the remaining pins to allow for more connections. <S> For example it would be better if those header pins connect into the power and ground pours/planes on each end than to just run a thin trace up to the pins that are hooked together.
When you allocate the additional power and ground pins make sure to take advantage of the additional pins to connect into the power and ground on the two circuits in a more robust way. However, if you don't need it, there is no point to do so - just having some unconnected copper pad on unused pins will be fine. In that case you should not route those signals through multiple pins.
Will a 2000w Step Down Transformer be enough to safely power a Japanese Oven Toaster? I recently acquired a Japanese oven toaster, with a maximum power consumption of 1000w at 100v, and I would like to use this appliance in USA. I was told that for safety reasons I should get a step-down transformer with wattage at least double the appliance's wattage. Another source told me that if the appliance generates heat, I should get a step-down transformer with wattage at least 4 times the appliance's wattage. Do I really need 4 times the appliance's power consumption? For example, can I get away with using a 2400w or 3000w step-down transformer? <Q> The Japanese standard is 100 V, whereas in the US it is 115-120 V. <S> The higher voltage will cause more heating. <S> Power into a resistor is proportional to the square of the voltage. <S> Let's say worst case we compare 120 V to 100 V. <S> The resulting power ratio is (120/100) <S> 2 <S> = 1.44, or 44% higher. <S> If it were just 10% or 20% higher, I'd probably just try it directly. <S> 45% more power is enough I'd worry about over heating. <S> The heating elements may burn out, and they will get hotter than intended, but they will be on for shorter amounts of time to result in about the same oven temperature. <S> All that said, why not just get a toaster oven intended for the power voltage <S> you have? <S> They are relatively cheap, and don't come with the same risk of burning your house down. <S> Sell the Japanese oven in Japan and get a US oven in the US. <S> It may even be cheaper overall if you consider the cost and hassle of shipping it. <A> The recommendation is either excessively conservative or assumes lying on the part of the transformer supplier. <S> Appliances which have large heaters in them are easier to power since their power factor can be assumed to be close to 1. <S> I can state that no-name stepdown transformers are sometimes "optimistically" rated. <S> A step-down autotransformer good for 1000W can be made with a 120:20VAC 10A transformer, wired to buck the input voltage. <S> That's only 200VA, so a fairly small and light transformer (relatively speaking). <A> While you are not looking to make something, this can also be done with a triac, zero-crossing switch (moc3063), and skipping every 5th (110-115V) or 4th (120V) cycle (or 1/2 cycle). <S> You might also be able to use a simmerstat from a stove, and set it to 80% duty cycle. <S> Simmerstats have the subtle advantage that they also work by heating, so they compensate for the actual mains voltage. <S> (I am not sure what duty cycles a simmerstat can acheive i.e. does it do 80%?) <A> Double the wattage rating is being conservative, but makes sense. <S> Four times is just excessive, <S> You will end up with a big, heavy and expensive transformer. <S> The latter is often the big headline figure, but the transformer may only be able to handle it for a few minutes before overheating.
A universal autotransformer that handles 120/240 as well as 100/200 will be much heavier, but I see local suppliers offer 1500W no-name Chinese non-CSA-approved units for around $100 US so not insane (unless you are safety-conscious, of course). If this toaster oven has a thermostat, then maybe you can still get away with it. When you look at the rating of a transformer, check whether the seller is quoting a continuous rating or an intermittent rating.
Highside Driver leaking when GND is unconnected I am using an Infineon ITS4200S-SJ-D highside switch to control power to a resistive load. Internally the part is basically a PFET with some additional features. I have a 10k pulldown on pin 2, +12V on pin 5, and a 100ohm resistive load on pin 3. Everything works great except I notice that if I connect the load and the +12V before I connect the GND I get a leakage current to the load. I know that the simple answer is "always connect the GND cable first."But I'm wondering if someone can give me an idea for a simple circuit that I can add to prevent this leakage and keep the load totally un-powered until both of the power supply cables are connected correctly and I activate the input at pin 2. Here is the schematic. for troubleshooting I have disconnected the microcontroller activation line as indicated by the little red X. The problem I'm trying to solve is when the +12V cable is connected and the GND cable is unconnected I see about 15mA through the load. <Q> This is an Integrated Circuit, meaning that a lot of smart components are integrated within, including logic and ESD protective rings etc. <S> etc. <S> When dealing with integrated circuits, you don't arbitrary connect pins to live voltage, so simple rules of electricians do not apply. <S> You connect the IC in accord with manufacturer's specifications, to your cables, and then apply power. <S> Otherwise anything can happen, like unwanted triac-latch effect that shorts everything and smokes your circuit. <S> If you really need a "hot plug" capability, your connectors must be designed/selected to connect ground first, power next, and the rest after. <A> If you cannot fix the proper connection sequence, then the dual Pfet solution used on common battery management designs is needed. <S> Usually Low side switching is preferred, but here is an unprotected high side series complementary switch. <S> Vgs must be protected in automotive applications for 40V (?) <S> Joule load dumps and reverse 24V so Low side switches are often preferred. <S> We do not know your other requirements besides leakage. <A> You can try a resistor from output pin to GND pin. <S> Since the current consumption in stand by is 15uA this will bring the IC into the normal working voltage where it can completly turn off the pfet. <S> When active the resistor will add to the load. <S> Try something above 1kohm. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> All voltages are relative to bat1 GND R3 is added to fix the floating chip GND <S> If the leakage current is 15mA then Vout is RL x <S> 0.015 = 1.5V <S> If U1 is sinking the max current of 2mA then chip GND will be at 1.5V + R3 x <S> 0.002 = 3.5V <S> That leaves 12 - 3.5 <S> = 8.5V VS to chip GND enough for the chip logic to work in parameters and close the PFET properly. <S> After the PFET is closed the leakage current through the load will go down to the standby current of the chip, 15uA, OUT voltage to 0.1mV, chip GND voltage to <S> 0.1mV + <S> R3 x 15uA = 15.1mV
Because of ESD protection diodes on some protected switches, leakage current will exist.
Specifications to consider when selecting a polyfuse I am designing a power supply for a flight controller, and I am finished with the regulating and almost everything else. I want to have a polyfuse on both of my inputs, but I don't know how to pick the right one. I don't really know much about the power consumption of the application, as it can vary. But, the maximum output of the power supply is 1A. the maximum input voltage should not exceed 22.5V. I know that things to consider in such a fuse is I_trip and I_hold, and of course maximum voltage and current. Can anyone explain I_trip and I_hold to me? <Q> Can anyone explain I_trip and I_hold to me? <S> The fuse is guaranteed not to trip if the current is less than I_hold. <S> The fuse is guaranteed to trip if the current is more than I_trip. <S> You need to choose a polyfuse with I_hold larger than your maximum load current consumption, or it may nuisance trip. <S> You need to choose a polyfuse with an I_trip smaller than your power supply output if you want it to trip when a fault is presented. <S> Otherwise it may fail to trip, and cook your supply. <A> The I trip of a a polyfuse <S> is the current at which the fuse 'trips'; when it goes high-impedance. <S> Then, when it is in the high-impedance state, if the current through it goes below I hold , it will return to its low-impedance state (though not perfectly; it will still be higher resistance than it was at first). <A> Most important for protection is the interrupting capacity in amperes and the maximum voltage . <S> If you exceed either one, the fuse may not open or may be damaged. <S> Beyond that, you are interested in the worst-case current to open vs. stay closed (both minimum and maximum). <S> Itrip and Ihold Keep in mind that there is a tolerance and both will change with temperature (and with mounting, especially for SMT parts), so you should look at the curves and not just the rating at a certain temperature. <S> Read the manufacturer's application notes as well as data sheets. <A> Hold current is how much continuous current can flow through the PTC without tripping it. <S> This would be the maximum operating current of your circuit. <S> Trip current is how much current is needed for the PTC to start heating up, which is when its internal resistance increases and current flow is reduced to protect your circuit. <S> It is always larger than the hold current. <S> I would pick a trip current that protects your power supply (I_trip=1A) and then see which parts had a hold current that is high enough to suit the needs of your application. <S> There's a similar question with some discussion in the comments here if you need more information: https://electronics.stackexchange.com/a/369505/185972
You should evaluate the worst-case fault current and make sure it cannot exceed the interrupting capacity.
DC or Step motor I'm planning to do some DIY project, and I'd appreciate your help and advice in the matter. So basically I'd like to build an automatic window shade system. It is a simple shade, that you can pull up/down and close/open the blades, but I'm only planning to use the latter. I'd like to use a phototransistor to measure the intensity of sunlight and close the blades in proportion by rotating the hanlde on the shade. Fortunately it doesn't need much torque to turn it, and I would check and adjust the blades once around every hour, so it won't take much power, however I'd like to make as self sufficient as possible, so my idea to power it with a battery source (preferably a phone battery or notebook battery), and recharge it with a small solar panel. So I need to find a solution to rotate the handle with a low-power actuator. This is where my question lays. I'm not sure what kind of motor should I use for this: 1) Step motor: Pro: would be ideal, because I don't need high RPM no need for additional encoder to properly control tha angle of the blades few extra mechanical parts Con: more expensive more complex driver more roboust power supply 2) DC motor: Pro: cheap easier control lower voltage and current levels? (actually i'm not so sure about this :D) Con: needs additional encoder needs a complex gearbox to achiev proper torque and RPM, which can be a pain in the @ss to make... So this is my problem, what do you think? <Q> Out of your two suggestions, I would use the stepper motor. <S> You can easily and affordably find NEMA17 motors from ebay (or similar) along with associated dc driver and control by uC arduino etc. <S> Its no longer voodoo in terms of complexity as there are many examples of code on the net that should do just what you are asking for with little modification. <S> This will negate your requirement for a custom or large gearbox, and again, can be driven and controlled very easily from a uC. <A> Of your two suggestions, I'd posit that a DC servo (DC motor and gearbox would be the best and easiest to implement. <S> If you use a stepper motor you will need to measure the absolute rotation limits, use a much more complex controller and have to support much more weight. <S> There are plenty of cheap Nema17 stepper motors but they will weigh in the 400g range which may be somewhat difficult to manage and will require peak current in excess of 2A no matter what the actual mechanical load. <S> If you use a simple RC servo, it can be modified or built for continuous rotation, you will still need to measure your rotation limits but with less complex drive and much lower weight. <S> Typical servo weights are in 45-50g range and will likely draw significantly less than 1A peak in this application. <S> You don't need any holding torque for your application so the servo and controller MCU can go to a low power state suitable for battery power. <S> I'd suggest you look at the servos at a place like Servocity as reference, but you could consider something low cost such as this Hitech HS422 . <S> This servo can be modified with an external 10 turn pot which would seem ideal for your application, providing a 10 turn limit. <S> Servocity have lots of addon items such as Servoblocks and gearboxes if you feel so inclined, which would potentially make your mechanical build easier. <A> Consider what happens when the motor is not supplied. <S> Either your mechanics has to ensure that the axis cannot move or your motor must have a holding torque. <S> Only steppers have a (small) holding torque even if not powered. <S> A DC-Motor has absolutely none. <S> This is another (in my point of view: big) advantage of steppers. <S> The driver of a stepper is easy. <S> I cannot see why you consider it more complex. <S> There are many drivers available - with simple step signals or integrated motion controller. <S> There is certainly one that suits your needs. <S> What do you mean by "more roboust power supply"? <S> A DC motor easily draws 10Amps and more. <S> A Nema17 is typically less than 3A. Bear in mind, that the maximum coil current of the motor (e. g. 3A) is not the maximum current that the power supply must provide. <S> The driver for steppers is usually a chopper driver that behaves like a switching power supply. <S> The permanent current that is drawn from the power supply is about 65% of the maximum coil current. <S> So the driver of a 3A stepper draws only roughly 2A from the supply while in motion at full torque. <S> By reducing the current, you can easily adjust the torque, which is not that easy with DC-motors.
If you wanted to explore a potentially lower cost solution that uses DC, you might also be able to modify a servo to do this (see 360 degree or continuous servo modification).
What is the most painless way to get a high current negative voltage power supply from a positive? I'm designing an audio DSP and DAC board, and in the analog section, I'm using opamps that take in differential audio signal and turn it into single ended output. Because the signals are AC, they obviously swing below zero, so I will need a plus/minus power supply. Keep in mind, I'm a software guy, and I'm only doing this as a hobby -- not a pro hardware designer. I've been researching the internet for about a week, looking for solutions. So far, I've found: Charge pumps : These are awesome if it wasn't for the fact that they only supply maximum of 100mA. Driving 16 audio opamps will need more current than that. Buck/Boost inverter These suck. They require complex circuitry and can barely supply higher current output than the charge pumps. To me, this is the big and ugly solution. Cuk topology I don't have enough background in power electronics to fully understand the mechanisms for this one, but it still requires several inductors and some mess of external circuitry. They are also limited in their current output for the most part. Power modules This would be a plug-and-chug solution, but it takes the fun out of DIY, not to mention they are quite huge and take up lots of board space. I've seen some configurations where there is a sort of "half-rectifier" diodes arrangement used for generating negative supply, but I don't understand it. If someone with enough electronics background can explain to me an easy to implement and understand solution to generating a negative voltage supply, it would be fantastic. Here are my constrains: My input voltage is 12V. I want my output voltage to be between -12 to -15v (any value there will do) I want 1 A current output. I want minimal external components. A few is okay, max one inductor. Don't care about ripple, noise, isolation, temperature characteristics, or anything else. simulate this circuit – Schematic created using CircuitLab <Q> The inverting SMPS would seem to be the most appropriate simulate this circuit – <S> Schematic created using CircuitLab <S> When Q1 is on, current into L1 builds, storing energy in it. <S> When Q1 turns off, current continues to flow into L1, and it has to draw this current from D1, pulling charge out of C1, so pulling it to a negative voltage. <S> L1 current falls during this phase, as the voltage across it is negative. <S> This sort of circuit will happily deliver amps, even 10s of amps. <S> You can use a p-BJT or a p-FET for Q1. <S> Control consists of detecting the output voltage and changing/stopping the power switch drive. <S> The usual suspects, Analog Devices, Texas, Linear and Maxim, all have integrated power supply control parts that can be configured to work in this topology, if you don't want to build it from scratch. <S> For a particular high load or low ripple application, you can parallel two of these converters driven in antiphase, or even more converters driven in different phases, to get a smoother current delivery waveform into the output filter. <A> You could use an old-fashioned LM2596 adjustable to make a -12V supply, with at least 10V in you should be able to get about 1A @12V out (5V version schematic shown). <S> Follow the design information in the datasheet to the letter and you should be okay. <S> In particular make sure the inductor meets the requirements and that the PCB layout recommendations are followed. <S> Protection for an automotive electrical system source is additional, and I'm not covering that here. <S> Personally I would definitely consider using an isolated 12-15W DC-DC converter for the negative rail. <S> Just wire the output to get negative polarity (and put a diode across it to prevent reverse biasing as D3 above). <A> The least painful way to power analog electronics with + <S> -15 V rails at 1 A is to get a DC-DC converter into +-15 V, 30 W overall power. <S> Isolated converters are fine, you need to check for ripples, or filter them out with additional LDO. <S> Try Digi-Key, something like "Mean Well" DKA30A-15, or many similar. <A> From your 12v create a half rail- <S> simplest, 2 resistors. <S> Your output will swing 0-12 around the 6v point. <A> So you get inverted power. <S> But be sure: this only works if you need -12V and ground and NOTHING <S> MORE.Extra: No additional components needed.
If you really ONLY use the -12V and ground on your device (and not the other +12V too) you can simply use the device -12V, connect it to ground and the device ground connected to +12V. Capacitively couple the input to remove the DC swing below 0.Bias up the input of the opamp (after the cap) to 6v.
Capacitor dielectric and current flow A capacitor has insulating material between plates and this insulting material does not provide any electrical or conducting path between capacitor plates. But still, capacitor allows DC or/and AC current to flow through it, How? <Q> I think I hear the sound of a can of worms being opened. <S> It's called displacement current <S> - it is a time varying electric field that gives rise to the same phenomena associated with regular currents. <S> For the casual onlooker it might as well be real current. <S> It's embodied in Maxwell's equations. <S> Wikipedia on the subject <S> Another electrical phenomena that apparently should have real current but doesn't is the radio wave. <S> Again all down to Maxwell and displacement current. <A> That looks like a current flow. <S> With dielectrics one typically uses a polar medium. <S> That is, the molecules in the dielectric are asymmetically charged, so while overall being neutral one end is more positive than the other. <S> Electrically, that makes the gap between the plates look much smaller and so increases the capacitance. <A> One way to visualize this is to imagine as one electron is pushed onto one plate, an electron that was already existing on the other plate is pushed off.
Ignoring the dielectric for the moment, if you build a charge on one plate it will repel similar charge from the other - basic electrostatics.
Measure the power consumption of a circuit with Arduino I need to measure the power consumption of a circuit I have built.The components are as follow: Lipo battery 500mAh Accelerometer RTC RedBear Nano 2 Usually I measure the consumption using an Arduino and its analogical pin. The level of accuracy is enough. In this case my idea is to attach to every component a relatively small resistor and see which is the voltage of this resistors. Comparing this values to the battery voltage I should get an idea of how much power consumption I have. Is that correct, am I missing something? The picture shows the configuration I wanna make, the green annotation represents the measures I will take with an Arduino. The Arduino code I am using for a single analog pin is the following: int Re = 1000; void setup() {Serial.begin(9600);}void loop() {int sensorValue = analogRead(A0);float voltage = sensorValue * (5.0 / 1023.0);float current = voltage / Re;Serial.print(millis());Serial.print(",");Serial.print(voltage, 10);Serial.print(",");Serial.println(current, 10);delay(500);} EDIT:What I am trying to measure is basically how much time my circuit can be on. Thus, let say that 2 or 3 days of variance in the result can be manageable. <Q> You'll get very poor results using this methodology. <S> Since you are sensing current in the low side the signal you create will subtract from the sensor/MCU Vdd. <S> The signal you develop across the sense resistor is in series with any signals between the sensors and the MCU ... <S> for example the I2C interface. <S> I'd suggest if you're using a separate MCU for the power measurements that you use an INA219 or its three channel variant the <S> INA3221 to measure the currents using a high side sense resistor. <S> There are breakout boards readily available on Ebay/Adafruit, and you can easily modify the sense resistor(s) to measure much lower currents. <S> If all you want is an estimation of the battery lifetime, then you don't need to measure each individual portion of your project. <S> You could use a single high side sense resistor and an op-amp or better still an INA169 to feed you ADC. <S> You could even use a sensitive multimeter and a large filter cap on the Vdd to measure the current (and use a power supply instead of the battery so you can increase the voltage). <S> This would allow you to make an estimation. <S> If all you have is an Arduino Nano and some resistors (from your comment), then the only way to get any worthwhile result is to program the ADC to use the Internal 1.1V reference. <S> This at least will give you a better range on the ADC. <S> Refer to the Nano <S> schematic and the ATMega328p datasheet , section 28. <A> It should work, provided you are adding another Arduino to do the measurement and not attempting to use the block marked "Nano" in your diagram. <S> The ADC inputs, even in differential mode, should be between GND and Vcc, so they are negative with respect to the Nano ground. <S> Of course if the current draw is not steady you may get inaccurate readings depending on how you sample the data, since you have no anti-aliasing filter preceding the ADC. <A> The typical Current sensor is only 50mV drop at peak current, so amplification is needed to improve the accuracy of the measurement to use the dynamic range of the ADC. <S> Then a mux can share this amplifier and input pin but require a serial or parallel 2 bit address. <S> However until you define your SNR and accuracy specs, this is just another hypothetical solution. <S> Keep in mind pulse noise and sampling rate with Nyquist demands and filter to <= <S> 1/3 of the sampling rate. <S> This results in a common gain filter mux. <S> for multiport current sensing.
The Vdd for the sensors and MCU will vary because of the signal developed across your sense resistor so measuring the battery voltage is inaccurate.
How to amplify 0-10V 100Hz-1µHz sine wave to drive 24V 5A LED module? For an experiment on photosynthesis, I would like to amplify a 0-10V 100Hz to 1µHz (~a day) sine wave from a function generator to drive a 24V 3A LED module. I already did that with a square signal and a MOSFET as amplification system and everything worked fine. For the sine wave, I can't use MOSFET, so I was looking at OPamp but I read in some various places (here for example : Very low frequency instrumentation amplifier ) that, as far as I understood, classical OPamp based systems were not well suited for low frequency and DC amplification. I also thought to an other option which could use a higher PWM base frequency and then modulate the duty cycle to simulate the sine wave. Would you have any advice to guide my search ? Thank you ! <Q> Classical op-amps work just fine down to DC. <S> However the input noise does increase at low frequencies. <S> At sufficiently low frequency, we stop calling it 'noise' and start calling it 'drift'. <S> This employs an auto-calibration loop round two amplifiers internally, to null out the drift as it happens. <S> However, it's quite unusual to have an application that is so sensitive to drift that you need to go to the expense of this type of amplifier. <S> A good compromise between the el-cheapo amplifier and the chopper stabilised is a 'low drift' amplifier with a specified input drift and input offset voltage tempco. <A> For an LED the op-amp will work perfectly down to 'DC'. <S> Your problems, if any, will likely have to do with the power supply and thermal considerations. <S> Linear control of a 72W load could require the amplifier to dissipate quite a bit of power, depending on your supply voltage and what the LED I vs. Vf curve looks like. <S> It's definitely not going to be a small chip, it will be something with a large heat sink and perhaps a fan. <S> You mention a sine wave, which is bipolar. <S> To state the obvious, LEDs only emit light, they can't emit dark or suck light, so you will, at best, be dealing with a sine wave + offset voltage so the sum stays greater than or equal to zero. <A> The ideal way is to use a MOSFET controlled boost regulator with current sense feedback . <S> With PFM and PWM the dynamic range of current intensity can be controlled by the resulting out filtered DC current limited only by the linearity of the emitters and of course the plant. <S> For further accuracy a photo diode array feedback could be used at the desired target. <S> Synthesis of the current control input is easily done commercially with 10~100% range but <S> a special design can achieve 0 to 100% <S> It is irrelevant to discuss Op Amps here since there are many ways to achieve this after specs are defined.
If you want an amplifier with the lowest possible noise down to DC, then use a chopper-stabilised op-amp.
Volts and amperes explained I'm trying to understand electricity better, but all I found was those stupid water pipe analogies. Can you explain it to me in terms of actual electricity? What is voltage, the speed of the electrons flowing through the wire? Somehow this makes little sense to me but I don't know. Is amperage then just the "flow through", how many electrons pass through? Where does the energy of the electrons come in, if at all? Thankyou! <Q> Current is the charge passing a particular point per time. <S> The common unit of Ampere is one Coulomb of charge passing by per second. <S> EMF (electromotive force) is the push that makes charges flow. <S> You can think of it a pressure that pushes charges and causes current to the extent that the charges can move. <S> A common unit of measure is the volt. <S> One volt can push one ampere of current thru a resistance of one ohm. <A> What this means is that the voltage at a point is a measure of how much potential energy an infinitesimally small charge(small referring to the magnitude of charge, not size) <S> would have if you were to bring it to that point. <S> Voltage is always a relative measurement, meaning that it doesn't make sense to identify how much voltage you have without also describing a reference voltage. <S> (In electronic circuits, this reference voltage is usually your ground.) <S> The SI unit to measure this attribute is volts. <S> The SI unit for this flow rate is given in amps. <A> What would voltage look like, if we could see it? <S> The MIT open-source project published some video animations of the physics behind voltage: Positive and negative charges being pulled apart , creating a pattern of voltage in space. <S> Pos and neg charges falling together again , where voltage decreases to zero. <S> (Also lots more ) <S> In those two videos, pretend that the two points are two wires viewed end-wise. <S> In that case the two videos would reveal what happens whenever we connect two parallel wires to a variable power supply, then turn up the voltage starting at zero. <S> When set to significant voltage, the wires have an intense field between them, and can strongly push the charges found inside any resistor. <S> Voltage is the "dual" of magnetism: fields of voltage appear between the wires connected to a power supply. <S> Note the voltage-field down between capacitor plates, versus the fields of magnetism in the cores of inductors. <A> Current is easy - it's just rate of change of charge i.e. how many electrons are passing per second. <S> What is voltage <S> I can use a mechanical analogy to show what it is and how, in the newtonian mechanical world, it is not very significant: - First relate the quantities energy (W), mass (m), velocity (v) and momentum (p) \$W = <S> \dfrac{mv^2}{2}\$ and <S> \$p = <S> mv\$ <S> Therefore: - \$W = \dfrac{mp^2}{2m^2} = <S> \dfrac{p^2}{2m}\$ <S> Now, if we took the rate of change of work with respect to momentum we get: - \$\dfrac{dW}{dp} = <S> \dfrac{2p}{2m <S> } = \dfrac{p}{m}\$ <S> Then, substituting p = <S> mv we get \$\dfrac{dW}{dp} = <S> v\$ <S> So, in newtonian physics/mechanics, velocity is the the rate of change of work with respect to momentum. <S> Huh? <S> You can do the same with electrics where: - Work = energy = \$\dfrac{Cv^2}{2}\$ and Momentum <S> \$\equiv\$ <S> charge = <S> \$Cv\$. <S> Does this get you any further to understanding what voltage is? <S> Does it get you any further to understanding what the rate of change of work with respect to momentum is in a mech world? <S> About the only thing that immediately springs out is that charge is equivalent to momentum. <S> Good luck. <A> This might help. <S> Say you had a reservoir of charges on one side of a resistor (with really high resistance) and ground on the other side which had very few charges. <S> The voltage difference between them would be pushing hard on the electrons to try and shove them into the ground which had few charges. <S> However, the resistor is difficult to move electrons through as it has a very tight atomic structure; so difficult that it impedes the voltage difference from pushing very many charges through at a time. <S> Thus, the current (a sort of charges per second) through the resistor would be low despite the voltage difference between the reservoir and the ground being large. <S> Another interesting thing for you to look into, if a circuit is supposed to be a closed loop <S> then why can the power grid run from the generators to ground? <S> Where is the loop? <S> ^^(If <S> you want the reason spoiled I can edit this answer)^^
Current is a phenomenon describing the flow of charge, and the amount of current represents the charge flow rate. The voltage of a system is a measure of the electric potential of the system.
Lm317 input connected to output? I am figuring out the schematic of an existing e-bike controller. Specifically I am trying to replace an lm317t with a custom made switch regulator that outputs the same voltage. But first I want to understand the current and existing layout. And I am actually failing on this. With the help of the multimeter I have come up with an schematic which seems to match with what other people has come up as well: full board schematic here: https://github.com/KingQueenWong/bmsbattery_s06s_controller_hardware/blob/master/S06S-Controller.PDF Now, I am really puzzled. When I switch on the board VOut is 15V (according to my multimeter), as expected (it is a well known design where the output is known to be 15V). But how that can be if VIn is connected to VOut through a resistor? To prove my logic I have moved that to LTSpice: And as expected, the VOut is basically the VIn plus the resistor drop. I have checked that the schematic matches with reality 100 of times, and it does (except if I am missing more part, which could be, it is a dense board). How can this be? What could I miss? I have opened an issue on that github project, hopefully someone can help. <Q> I can think of two reasons for a 3k bypass resistor: <S> To provide a discharge path for the capacitors when the power is switched off. <S> To reduce the power dissipation in the LM317. <S> With a 36 V supply the maximum current through the 3k resistor for a 15 V load would be \$ <S> I = \frac {V}{R} = \frac { <S> 36 - 15}{3k} = 7 \ \mathrm {mA} \$.If the load draws more than 7 mA then the output voltage from the resistor alone will be < 15 V. <S> With the addition of the LM317 it can now pass the remainder of the current required to bring \$ V_{OUT} \$ back up to 15 V. Power dissipation in the 3k resistor will be \$ P = <S> VI = <S> 21 <S> \times 7m = 147 \ \mathrm{mW <S> } \$. <S> This seems low relative to the power handling capability of the LM317 <S> so I suspect that reason 2 is not the right one. <A> The resistor is a fairly high value, and so it will not affect regulation provided <S> something is drawing a few mA either from Vout or from the 5V supply. <S> Note <S> the latter has its own parallel resistance of 750R; with (15V - 5V) <S> across it, that suggests 13mA must be drawn from the 5V supply to keep it within regulation. <S> This 13mA will keep the 15V supply in regulation for input voltages up to (15V + 13mA <S> * 3k) = <S> 15+39 <S> = 54V, a reasonably safe value from a nominal 36V battery. <S> Add an adjustable load resistance to your simulation and prove this for yourself. <S> Leaving 2 questions : <S> why? <S> what keeps the 5V supply drawing at least 13mA? <S> I'm going to guess, that (2) will involve something like a 5.6V zener diode across the 5V rail so that, in the event the 5V consumption falls below 13mA, the 5V supply rises to 5.6V and turns on the zener. <S> If you have that circuitry, you might want to try and find that zener, or measure its current consumption as you adjust the supply voltage (carefully! <S> from a current limited PSU). <S> (EDIT : from the complete schematic, I'm not seeing that zener. <S> Possibly the designers added up the currents of all the loads on +5V and concluded they would exceed 13mA, but not by enough to drop the supply below the CPU's minimum voltage if the 7805 failed. <S> I'm guessing they just adjust R59,R60 until it works) <S> Which leaves (1). <S> This is part of a vehicle. <S> It is intended to remain safe under all predictable circumstances. <S> Possibly including the failure of one or both voltage regulators, under which circumstance it must retain enough control (e.g. powering the MCU via a 5.6V 13mA supply) to shut down the vehicle instead of accidentally going to full throttle. <S> I emphasise these <S> are guesses. <S> I don't know enough context. <S> You have some : the board powered by VOUT and the 5V supply. <S> But the full story is probably only known by the design house and the certification laboratories they used. <A> The full circuit is a quite interesting cut-to-the bone implementation, especially the cost-cutting discrete implementation of a 3-phase bootstrapped MOSFET bridge driver (1/3 shown) <S> Here about 60 (!) <S> cheap parts are used to perform most of the functions of an expensive integrated bridge driver chip (or 3 half bridge drivers). <S> Most of the functions. <S> I suspect that's what the 3K is for. <S> As others have said, there is enough loading in the full circuit to keep the +15V supply from rising out of regulation. <S> I think the 1.5K resistors across the 78L05 are probably to reduce the power dissipation in the chip.
I don't see any LV lockout features implemented, it's possible that under some combination of power-down conditions the bridge driver supply should be brought down relatively quickly before the MOSFETs are damaged from being driven partially on.
How is crystal frequency set? When you purchase a crystal to use as a clock, the company is asking you exact frequency to set it at. I remember needing a crystal that was 4x the NTSC color carrier and they were asking me how many digit precision I needed. What is the process to 'set' the crystal output so precisely? <Q> Coarse tuning is done in the grinding process, where the thickness of the quartz wafers is established. <S> I once visited a manufacturing facility; the grinder operators were using ordinary shortwave receivers to monitor the broad peak of electrical noise that the batch of wafers emitted due to the grinding action. <S> When it reached a point slightly higher than the target frequency, they would stop. <S> This process is much more precise, and each crystal can be individually calibrated. <A> I believe there could be some confusion. <S> When you use a crystal as a "clock", you need "clock generator" for this. <S> To get a real quartz crystal tuned to customer's specification, the order must be for many thousand units. <S> It is very likely that OP means "programmable crystal oscillator", there are thousands models, see Digi-Key for examples . <S> These devices are made in the standard SMT ceramic cases, 4-pins, 3x5mm or smaller, just as the usual fixed-frequency crystal oscillator chips. <S> However, the programmable ones have some base oscillator, and a PLL circuit, with ability to externally program its parameters to almost any desired frequency. <S> The typical output range is 1 Mhz to 110 <S> Mhz. <S> The chips usually have programmable non-volatile memory, re-programmable maybe only two or four times, and frequency can be specified down to 10-digit accuracy or something. <S> When purchasing, you can specify your own frequency (that's where they can ask for this), or you can purchase a PC-based programmer for this, and program you values. <A> Since you said it was a 4x NTSC crystal, it was likely a standard part made in bulk. <S> How they select the precision there is an issue of binning . <S> For this process, the factory produces a batch and then tests the crystal frequencies. <S> Due to random process variations, the frequencies will have a distribution (a spread) across the ideal frequency. <S> If you order a highly precise crystal, they will pick it out of the stock of crystals lie close to ideal. <S> They will charge you more for this. <S> If you can tolerate a wider variance, they will sell you those that lie further away at a discount. <S> For example, this crystal datasheet says you can order the product in tolerances of ±10, 20 or 30 ppm. <S> This is common in a wide variety of processes, e.g. LED color and brightness, CPU speeds/number of cores, DRAM & FPGA speeds, etc.
Fine tuning is done during the plating process that puts the electrodes on the wafer; adding metal brings the frequency back down.
How to fix a 'PCB' without mounting holes inside a case (or on a PCB)? I want to use several of the 'filled PCBs' below, or other ones, but the question does not change. How can I fix such thing in a case, or on a proto/veroboard PCB (like the picture below)? I thought about: Glueing: but since the case (including the components) will be moved a lot, it doesn't seem a good way. Using tie wraps, in this case it might work because it can be put around the yellow component, but what if I want to use another component that does not have a nice yellow box? Using one of the above methods with spacers to prevent contacts with the protoboard. I don't need a professional solution, but I want a solution that doesn't break or getting loose after being 100 times moved neither. Update I asked a similar earlier question . However, this was about a temporary solution, in which I expected components need to be changed/added. However, in this case it's about a fixed/known setup. So I hope that a more professional (or at least 'better') solutions exist. <Q> Use a box with card guides, (ie grooves in the walls) and fit a PCB card guide <S> Now the board / boards are horizontal and closing the lid locks everything in place. <S> Search for "P.C. Board Card Adaptors" or "Allows mounting of PC boards horzontally within the enclosure." <A> An Adhesive that has high bond strength, yet not brittle made of Polyurethane is about the best. <S> Some UV cured Silicones are often used in Industry. <S> I have found this Polyurethane to be an very economical (cheap in bulk) and very reliable adhesive to improving the vibration isolation of components and rigidity of a structure. <S> It is not brittle and has exceptionally high adhesion qualities far better than hot glue which might be a quick fix as well. <S> The down side it <S> the cure time for the low VOC versions <S> avail. <S> now is 1 to 3 days till fully cured if there is exposure to air. <S> Test a couple of sticks at the same time <S> and you will be surprised at the strength. <S> I also use it for carpentry such as mounting drawer slides where screws are not possible. <S> Here is a commercial solution from Dymax to prevent broken solder joints. <S> You do the same with the Polyurethane subfloor adhesive, and also use it to adhere the corners inside the container, although the dispenser is more bulky. <S> If you look in any PC power supply, you will get the idea for securing any parts that can move first. <S> Apply to each moveable part with <S> at least ~ <S> 1 mm and the surface area determines the holding strength. <S> Allow 1hr to get firm and 1 day to cure or so. <S> Commercial solutions use accelerators. <A> It's a bit unclear, but I'll interpret your question as asking how to mount one of the boards in your top picture on one of the boards in the bottom picture. <S> You say this will be "moved a lot", but it is unclear if you mean the individual sub-assemblies need to be movable within the larger device, or of the larger device will be subjected to vibration. <S> I'll assume the latter. <S> It looks like the board modules have thru holes for the external connections. <S> My first reaction is to use those holes to mount the module onto the prototype board. <S> Line up the holes with where you want to connect on the bottom board, insert a wire thru both boards, and solder. <S> To keep other parts of the top board from shorting to the bottom board in places other than the intended connections, use a insulating layer of cardboard or fairly rigid paper. <S> In electronics assembly there is something referred to as fish paper that is used for that purpose. <S> If you need additional mounting strength, use gobs of hot glue. <S> If you are just inter-connecting multiple modules without adding parts of your own, then connect them with wires and mount the board on something non-conducting with lots of hot glue. <S> Note that these modules are not designed for vibration. <S> The two large electrolytic caps seem to be just hanging from their leads. <S> That won't last long in a high vibration environment. <S> You can make it more rugged by using hot glue or epoxy, but beware of adding too much thermal insulation in places that get hot. <S> Ultimately, these are not the components you should be using in a high-vibration environment. <A> I am assuming that's an AC-DC isolated power supply. <S> There should be at least 4 connection pads, two at the end shown (DC output) and two more at least at the other end (AC input). <S> If those holes are ~1 <S> mm diameter you can mount the board on short pins inserted through the holes and soldered into your perf board. <S> Either round pins (eg. see Mill-Max) or use the pins from some 0.1" pitch headers (0.025" square, so they are a bit loose in a 1mm hole). <S> Cut them off in singles and use the plastic to space off and support the PCB from the bottom. <S> If you pick the right pins and sockets you can even make the boards plug in, however you'll have to find a way to retain the board. <S> Note: <S> The holes that can be seen are filled with solder right now. <S> Below you can see a similar product (but safety agency approved and from a reputable supplier) that happens to be inside a plastic housing, but the mounting is accomplished via the pins (perhaps stabilized with a bit of adhesive on the bottom): <A> 3M VHB (Very High Bond) <S> double sided acrylic foam tape onto the relatively flat bottom side of the PCB. <A> NOT an acceptable technique, however, to mount a heavy and potentially mains connected (or able to touch anything mains connected <S> should it come loose <S> ) module as shown in the first picture. <A> What I did for a small PSU board was solder header-type pins to the voltage in and out pads of the PSU (so 4 pins), secure the PSU board to the main PCB with double-sided sticky foam tape and solder the pins to the main board, which was Vero-board. <S> The soldered header pins obviously stuck out below the PSU, in order to be soldered to the main PCB. <S> This worked well.
One could also solder stout wires to big and grounded solder joints or to the ground plane, then either make loops at the ends and screw down the loops, or just solder the other end to the carrier board (if mounting to a prototyping PCB) . If you have a decent desoldering tool, clearing them out is dead easy.
Where does energy go when not enough voltage is applied to charge a battery? Currently I am working on creating a DC motor that when manually cranked, or spun, will charge a rechargeable battery. Through some research I found the only way to charge a rechargeable battery is by supplying more voltage than the battery currently has to the battery. My question is, if I spun a DC motor to create a current that is 2.0V into a battery that is 1.2V what happens to the energy (spinning DC motor) when the voltage slows down to below 1.2V? <Q> In general, to charge a battery, you need to apply a slightly higher voltage to the battery than the current battery's voltage. <S> So if the battery is 1.2 V, you will need to apply more than 1.2 V. <S> For example if you would apply 1.3 V then that would make current flow from your 1.3 V source into the 1.2 V battery. <S> Since the current flows into the battery that means that also energy is flowing into the battery. <S> It is important to limit <S> that charging current so applying 2 V without any series resistance to limit the current might cause the charging current to become too high and damage the battery and/or DC motor. <S> It depends on the situation though, if your DC motor is small and can only supply say <S> 1 A but <S> your battery is very large and can handle a 10 A charging current, then obviously there would be no issue. <S> If you try to charge with 1.2 V then almost no current would flow as the voltages of the source (your DC motor) and battery are equal . <S> If you would apply no power to that DC motor, obviously the 1.2 V of the battery would make it spin. <S> The battery would be discharged. <A> Short answer: <S> The energy will be absorbed by the rotor shaft as kinetic energy, thus accelerating it. <S> Long answer: <S> To unravel the mistery, we must model your situation first. <S> The DC motor can be modelled as a voltage source in series with a resistance: By connecting the motor directly to the battery you are making the following circuit: <S> The motor voltage is proportional to the shaft speed \$\omega\$:$$V_{motor} = <S> K \times \omega$$ <S> The energy entering the battery comes from the motor voltage, which in turns comes from the mechanical energy required to move the motor shaft. <S> On the other hand, if the battery voltage is greater than the motor voltage, current will flow from the battery to the motor, effectively discharging the battery. <S> The energy leaving the battery will be absorbed by the motor voltage and converted in mechanical energy. <S> This mechanical energy will accelerate the motor shaft until its speed makes the motor voltage equal to the battery voltage, stopping the current flow (strictly speaking, the motor voltage will rise until being slightly lower than the battery voltage). <S> In this situation the motor will be running using the battery's energy. <S> If you want to prevent this scenario, a simple solution is using a diode in series to prevent a reverse current flow: <A> A motor and a generator are more or less the same device, just optimized for a different application. <S> So ask, what happens if a battery is connected to a motor, and where does the energy go? <S> Ideally, the chemical power out of the battery <S> (voltage times current) equals the mechanical power generated by the motor (angular velocity times torque). <S> What the chemical energy becomes depends on what's connected to the motor. <S> For example, if a brake is connected to the motor you get friction, and thermal energy. <S> If a pump is connected to the motor you could pump water uphill, making gravitational potential energy. <S> If a flywheel is connected to the motor you could increase its speed, making kinetic energy. <S> In practice some fraction of the energy is always lost to friction and resistive losses in the wires, motor windings, and internals of the battery, making thermal energy. <S> If the motor is locked such that it can't spin, angular velocity and thus mechanical power must be zero, and all the chemical energy goes to heat, just as would happen connecting a resistor across the battery. <S> Only the resistor is the long length of wire in the motor winding. <A> Short answer: nothing. <S> At 2.0V a current is flowing through the coils to charge the battery. <S> The current flowing through the coil creates a magnetic field that opposes the magnetic field of the rotor, resulting in a force on the rotor opposite the direction of motion, slowing it down. <S> Once you drop below 1.2V, the current stops flowing (assuming you have a diode or something similar). <S> With no current flowing the force against the rotor goes away and the rotor will turn forever if we ignore friction. <S> The energy hasn't gone away, it's just stored as kinetic energy of the rotor, similar to a fly-wheel. <S> If we include friction, then the kinetic energy is slowly converted to heat and dissipated.
If the motor voltage is greater than the battery voltage, current will flow from the motor to the battery, charging it.
Computer architecture why is MemRead used? Why is a control signal MemRead needed for the Data Memory element if whenever the output Read Data is not desired it will be multiplexed out via MemtoReg ? Wouldn't having MemRead always enabled just cause Read Data to always output whatever is currently stored at targeted address, making it readily available to be used if required, or ignored if not required via the multiplexer? Does Data Memory , being sequential, only execute on a clock edge and cannot complete two tasks at once like this? Isn't it true that combinational elements such as the ALU always output f(input1, input2) regardless of clock edge? <Q> Wouldn't having MemRead always enabled just cause Read Data to always output whatever is currently stored at targeted address <S> Yes, it would output whatever is stored at the targeted address, but the targeted address might be from the last <S> write operation. <S> or ignored if not required via the multiplexer If the multiplexer is set to 0, the address will be output. <S> If you want to hold the read value constant while write operations are happening, you would need to set MemRead low, and the mux selector, MemtoReg high. <A> Yes, if it's static RAM, it could just send whatever is addressed to the multiplexer always. <S> However, if it's DRAM, then it needs periodic refresh cycles. <S> If the refresh is generated internally in the "memory" black box, then giving it both a read and a write signal allows it to know when it can safely take time off to do a refresh step. <S> Another explanation would be that it has to do with timing. <S> Perhaps the memory needs several cycles to work, and the data path can be used for something productive meanwhile (assuming that the memory latches the address internally)? <A> Not all processors have a MemRead signal. <S> It's generally useful for memory-mapped registers. <S> Sometimes, specific memory addresses are connected to special hardware (instead of memory) and reading them might cause something to happen. <S> For example, you might have a FIFO buffer, which returns a different value each time you read it.
Having a MemRead signal ensures that if the address happens to be equal to the FIFO buffer's address, but the memory is bypassed (MemtoReg is 0), it won't accidentally count as a read.
Differential amplifier and op-amp What are the differences between a differential amplifier and an op-amp? Both have two inputs. How do they differ from each other? <Q> However, over the years the distinction has become a bit cloudy. <S> For instance, this is also called a differential amplifier: - <S> Basically it's an op-amp with a differential input configuration. <S> Then there is the difference amplifier that I would say is the more correct way to describe the op-amp circuit above. <S> There is also the Instrumentation amplifier (really just a difference amplifier): - <A> I view a differential amplifier as having 1) current source 2) two matched transistors (or tubes) having 2 outputs that are transconductors 3) most likely one or two current-to-voltage converters, such as resistors <S> Most opamps have 1 and 2, with lots of additional circuitry to implement the (3), provide frequency-response shaping to make easy the use in feedback loops, the addition of short-circuit protection, etc. <A> I'm a digital designer, not an analog one, but I took plenty of analog classes in school, so hopefully this still applies... <S> A differential amplifier is any amplifier that responds to the difference of two signals. <S> Therefore, all op amps are differential amplifiers. <S> An op amp is a differential amplifier that has high gain, high input impedance, and low output impedance. <S> It can have a single ended output, or differential output.
A differential amplifier traditionally has differential outputs: - Opamps almost without exclusion have a single output.
Will this water level indicator circuit work for my project? I have only rudimentary knowledge of electronics so I ask for your forbearance. There are many water level indicator circuits, of the type shown below, listed online and demonstrated on YouTube. The circuit clearly works when demonstrated with a bucket of water or a plastic bottle but my question is, is it a practical solution for a 5,000 litre tank? I have taken note of the learned comments regarding corrosion and that gold contacts would be the best for this kind of circuit, etc. My intention is to use a series of stainless steel screws arrayed along the outside of a PVC tube, with the wires kept dry inside the pipe and only the stainless screws making contact with the water. As for corrosion, would pulling the probes out of the water every now and then and cleaning them make this a bit more viable? Am I correct in assuming that the current going through a few litres in a bucket, is not the same as current going through a lot more water, especially if the tank, which is 1.8 metres high, is full? Should it be viable, what modifications would one need to make to the circuit? Up the voltage perhaps? Thanks in advance for any and all comments and advice. Regards Edit: - Thank you to all for the very comprehensive answers. You have convinced me that the project is likely to create more problems than I will be able to deal with at my level of knowledge. It is also a reminder that when something seems to be too good to be true, it usually is not true. I think I may attempt an electro-mechanical solution consisting of floating magnets and reed switches. I will have questions, so there is bound to be a new post on that subject in the not too distant future. As a matter of interest, partially in response to Phil C's answer: All other conditions being ideal, if locating a single negative electrode at the bottom of the tank would possibly be too a long path with increased resistance in such a big volume of water, would there be any advantage if one placed a second tube running parallel to the pipe with the sensors, with a negative electrode directly opposite and within a few centimetres of each sensor? Would the current follow the shortest path? Just curious. Thanks again to everybody Regards <Q> I can see how your circuit can appear to work in a bucket, but it is not well scaleable, nor good for long term use. <S> There are a number of problems: <S> The current required thru the water is relatively high. <S> There is one transistor gain between the water current and that thru the LED, but that's not a lot. <S> There will be problems with high-resistivity water and long distances. <S> The current is always in the same direction. <S> This causes assymetric corrosion, which leads to a battery effect. <S> Depending on details, that battery effect may eventually cause readings to be missed or cause false readings. <S> There is no thresholding to indicate definite on and definite off. <S> The LEDs can be partially lit. <S> There is not even a attempt to limit susceptibility to common mode noise. <S> You didn't say anything about the 6 V supply being isolated. <S> That means there can be unintended current paths to elsewhere. <S> This is a bad idea. <S> For more details on sensing water resitively see my answer https://electronics.stackexchange.com/a/33938/4512 . <A> You would be correct in thinking a longer path between contacts through a liquid will lead to an increase in resistance. <S> Whether or not this is going to be an issue will largely come down to the specific purity and temperature of the water, and will probably require experimentation. <S> Warm salt water will have dramatically greater conductivity and corrosion rates vs cold distilled water, for example. <S> You can overcome the distance with higher voltage, however you may also have to adjust the biasing resistors accordingly. <S> You'll also want to be quite sure you are using an isolated voltage source and never touching the water or sensor when it's charged. <S> Your solution to corrosion prevention seems a reasonable place to start. <S> A periodic cleaning and inspection can never be a bad idea as well. <S> If corrosion becomes a real issue, you may want to look into a sacrificial galvanic anode . <A> I assume the use of AC is to reduce the corrosion on the probes A to F. <S> However, the circuit won't work properly on the negative half-cycles of the AC supply. <S> The transistors will have a negative base voltage, and the LEDs will be reverse biased. <S> The LEDs will probably protect the transistors from damage, but the result will be rather flickery lamps. <A> My first instinct is to use small FETs to reduce electrode current. <S> You would want gate pulldowns to reduce suseptability to noise. <S> They should have a fairly large value to (again) keep electrode current low. <S> Sealing the screws might be trickier than you think. <S> Many adhesives do not have good water resistence long term. <S> Titanium screws (or rods) might be better than SS <S> (Amazon).A problem is the PVC tube would get coated with slime over time. <S> This would probably leave all the lights turned on. <S> A Teflon tube might work better but would have other problems. <S> You might want a different electrode configuration.
The high current will cause corrosion more quickly than a low current.
Indicator LED pulling up line I have a simple circuit: (Note: RN4 is currently 180 ohms. The label got left off the image.) When the 339 is setting an output low, the output is only dropping to about 2.3v, and not 0. Not low enough for the 74LS240 to recognize it as low. If I short the cathode of an LED to GND, then the 74LS240 works as intended, obviously. At first, I realized that my pull-up resistors (RN5) may not even BE needed, thanks to the LEDs. However, removing it from the circuit drops the output to about 1.5v. The LEDs have a forward voltage of 2v, and use 20mA. (Part: https://www.digikey.com/product-detail/en/kingbright/APT1608SYCK/754-1124-1-ND/1747841 ) Am I trying to overdrive the LEDs? Would increasing the resistance of RN4 help? And is RN5 even necessary? <Q> Looking at the BA10339 datasheet , it is not capable of sinking 20mA. <S> You should not attempt to sink more than 6mA unless you are selecting parts, and it is doubtful you could ever sink 20mA on even the best selected devices. <S> RN5 would appear to be unnecessary, but you'd only get a pullup to about 2-2.5V <S> so I'd suggest you leave it in. <A> The comparator is open-collector so the output voltage is dependent on the pullup. <S> The LEDs you have (in series with the resistors) will probably pull the outputs up high enough without RN5 (2.4V for 400mV of noise immunity) <S> but if you were to switch to an HC240 or a different color of LED it might not be enough under all conditions ( <S> maximum input current required is 100uA). <S> Personally I would leave them in there, though perhaps you could increase the value to 20K. To get standard LSTTL 400mV noise immunity under the low condition you must limit the current to a maximum of 4mA at 25'C - the worst-case Vce(sat) is 700mV over temperature which is really marginal - 100mV of noise immunity. <S> Let's say you limit it to 3.5mA total nominal, and allot 250uA for R5 (20K). <S> You need another 200uA for the LSTTL input in the low state, so that leaves us with about 3mA for the LED, so about 1K for RN4. <S> That may or may not be bright enough for your purposes, but you can give it a try. <S> Switching the LS240 to an HC240 would probably make things better, but you'd definitely need RN5. <A> The LM339 specifies an output low voltage of 0.7 V max, at a current of 4 mA. <S> It also lists a typical output low voltage of 1.5 V at 6 mA, so theLM339 is not capable of driving the LEDs with 20 mA while producing an output voltage of 0.8V, as required by a TTL input. <A> Did you not read the datasheet specs? <S> Output Saturation Voltage <S> (Low Level Output Voltage) <S> I SINK = <S> 4mAtemp <S> typ max Vol 25 <S> °C 150 400 mV Full - 700 mV RN5 array is not needed or used. <S> 74LS240 specs: Iin= –0.2 mA @ <S> Vin = 0.4 <S> V <S> Vcc = MAX, RN4 array may be >= <S> (5V-2V)/(4-0.2)mA <S> = <S> 790 <S> Ohms (min) <A> For a LED with 150 mcd brightness you don't need 20 mA, 1/10th or even 1/20 of that will be just fine for board indicator purpose. <S> Use 3.3k for RN4, and something like 47k for RN5 to keep inactive output in high state.
And stop using 74LS, use something newer, LVC.
Easy connectable/click system between enclosures I'm planning to make some devices which I want to easily connect together. Normally cables are used, but I wonder if there exists something like a 'clicable' connector, where the output of one enclosure 'clicks' into the input of another enclosure. Like a connection without or with a very short and solid 'cable'. Of course I can use a cable from one component/microcontroller from one enclosure to the other, but than I cannot detach them. I want to have a detachable solution, without the excess of a cable. Pins needed: GND (by default) VCC (that would save an adapter for the second device) TX (to transmit the signal) Maybe RX (for some acknowledgement, but maybe not necessary because of the short distance). So 3 pins would do probably. The transmission speed is probably 250 kbs, but maybe I extend it later to 1 mbps max. <Q> 3 Formats come to mind: <S> 1 - Pogos and magnets (Image is from http://www.foxlink.com/ ) <S> When you mentioned "click" the magnet action came to mind. <S> This is the least exerted force one, and also easiest to unplug. <S> Not very dense, a bit expensive. <S> Some examples of products which use this are LitteBits and the old Macbook charger. <S> 2 - Board to board / Mezzanine connectors <S> This is probably the highest density option, missing the "click" action. <S> Potentially the stiffest connection. <S> (Image is from http://www.hirose.com/ ) <S> 3 - Edge connectors <S> I bet you remember these? <S> They are cheap on the PCB side (and I personally have found to be expensive on the connector side unless you use PCI-express). <S> Also missing the "click" factor. <S> (Image from Wiki Commons) <S> Other alternatives <S> Or just use pin headers protruding from the enclosure. <S> Also, as in the MacBook charger, if you get at least N*2-1 connections, you can make the connector orientation indifferent. <S> (As in, instead of VCC, GND, TX, you do VCC, GND, TX, GND, VCC, so you can flip it.) <A> If I were to want to join two or more enclosures side to side in an inexpensive and rugged way I would consider the use of standard low cost D-Type connectors. <S> These very conveniently can be mounted on the facing sides of the enclosures using male and female flavors of the connectors on either side. <S> These connector types can be procured with many types of back side interface types. <S> There are ribbon cable types where a ribbon can be attached and then terminated to internal circuits at the other end of the ribbon. <S> Finally there are PCB mount types in both right angle mount and vertical mount where the connector can be mounted directly to the internal circuit board and protrude through a hole in the side of the enclosure. <S> The 9-pin size I show above should be applicable for your requirements. <S> These are also available in 15, 25, 37 and 50 pin varieties as well. <A> In general it seems you want things called board to board connectors. <S> Look around on the web site of any decent distributor, like Mouser or DigiKey.
Solder cup pin tails can have wires soldered to them to join to internal circuits. I've also done a short-term project with springs and magnets in cheap a pogo-ish way - very cheap and has the "click" action. You can also look around on the web sites of obvious suspects that manufacture such things, like Molex, Tyco, etc.
why we pay electricty bills? In ac supply positive cycle is equal to negative cycle then given voltage is taken and fed back to mains then why we pay electricity bills? <Q> You are billed for Power. <S> Power is Volts <S> x Amps <S> When V is +ve, A is +ve, + <S> V x +A = <S> +Power <S> When V is -ve, A is -ve, -V <S> x -A = <S> +Power <S> So Power is always positive on both half cycles, and you will always get a power bill. <S> But you don't have to pay it... <A> In any electrical circuit voltage is taken through a load and fed back. <S> That does not mean the work was done for free and would break the first law of thermodynamics if that was true. <S> You are billed for energy, not voltage. <S> Power = <S> Voltage <S> * Current. <S> Your home does not consume voltage, but the more devices you power the more current you draw. <S> That is why you are billed in kWH (Kilowatt hours). <S> Watts are a measurement of Power. <S> Watts consumed over time is a unit of energy. <A> Negative x negative = positive power <S> Positive x positive = positive power <S> i.e. YOU get billed.
Power is voltage x current and, if the voltage is negative then so is the current.
Why is phase margin considered more important than gain margin in dc-dc converters? Control theory text books say both gain margin and phase margin give information about relative stability. These quantities also give an idea about the corresponding closed loop system's transient response. In dc-dc converters analysis, all the papers and books are talking only about phase margin(~45 deg) to keep the loop stable and to achieve a reasonably good transient response. Why is gain margin not given much importance in dc-dc converter analysis? <Q> For many DC-DC converters there is a "fairly" resonant low pass filter involved at the output and, it changes its phase angle "fairly" rapidly from 0 degrees to 180 degrees over a short part of the spectrum. <S> Here's the general idea using L=100 uH and C=100 uF with an effective inductor series resistance of 0.3 ohms: - Calculator source . <S> So in this area it's possible to experience instability (due to the feedback system that tries to maintain Vout at a constant level). <S> The phase angle changes 180 degrees so it can convert negative feedback into a borderline positive feedback. <S> The solution is to apply a phase lead circuit "inside the loop" that prevents the phase angle reaching close to 180 degrees while the amplitude is still greater than unity. <S> This lifts the baseline phase angle (approached at higher frequencies) to something much less (and more stable) than 180 degrees. <S> Note that the silicon amplifier used in the feedback loop will fall to unity gain usually many times higher than the cross-over point of the filter. <S> That unity gain point is where the gain-margin is defined and so it should be largely unrelated to the cross-over point of the LC network. <S> So immediately, the preferred "talk" is about phase margin and countering what the LC circuit does to the phase angle. <S> The load on the output might be fairly light and this will raise the height of the resonant peak and thus the point at which gain passes through unity will shift to a higher frequency but, for the change in phase angle, this will occur close to Fn and it will be this part of the spectrum that gives the biggest headache to a designer. <S> In other words we know what the worst case scenario is - the phase rapidly changes hence, we talk about using a phase compensator to stop that phase angle becoming 180 degrees. <S> This type of application lends itself for discussing phase margin rather than gain margin. <A> For example how much overshoot and ringing you can expect due to load transients. <S> It can also tell you if there's more performance to be had by increasing your loop bandwidth (because the phase margin is high). <S> Typically many designers use 45 degrees as the absolute minimum acceptable phase margin over component tolerances, etc. <S> and 60 as a typical target. <S> Gain margin is important as well, but it doesn't give as much information about the response of the system. <S> It tells you how much variation in system gain you can put up with before the system becomes unstable. <S> A typical target might be 12dB. A typical design approach is to use a model to design the compensation targeting a certain phase margin. <S> Then simulate maybe using Monte-Carlo techniques, checking to be sure you meet your minimum phase margin and a reasonable gain margin. <S> If either is off iterate the design. <S> Finally measure the response in the lab to be sure it correlates. <A> In general, for all systems with feedback the phase margin is more important (more critical) than the gain margin. <S> The explanation is relatively simple: The phase margin (resp. gain margin) <S> gives you the additional (unwanted) phase shift (resp. <S> additional gain) which will bring the closed-loop into the region of instability. <S> And the probability that anywhere within the feedback loop an additional (hidden) phase shift would occur (e.g. due to unknown capacitive effects) is much larger than the chance of any unwanted gain enhancement. <S> Hence, the phase margin is a much more critical stability indicator than the gain margin.
In general, though there are exceptions, caveats, and subtleties, phase margin tells you more about what the response of the system will look like.
How can cellphones be charged and used at the same time? All of us are probably used to using our phones while they are charging. This is why manufacturers make longer cables – so that the consumer can have the facility of using and charging the question at the same time. My question is this: Assuming a cellphone consists of battery with the 'phone' (camera, screen, etc) connected in series, how can we charge it (which would require that current flow in the opposite direction of the battery terminals – we were taught this in physics class – you need to apply a voltage more than that of the cell and in the opposite direction to charge it) and use it (which would require that the current flow in the same direction as battery terminals) at the same time. My attempt: (two possible cases) The above thinking is wrong and somehow the manufacturers managed to use and charge the battery at the same time. While charging, the battery does not provide current at all and the current from the wall socket is divided into two currents – one for charging and one for operating the phone. Which one of the above explanations is correct? Or, is there a third, more complicated explanation? If explanation #1 is correct – is this achieved in a simple way or do I need to get a degree in electrical engineering to understand this? If explanation #2 is correct – when the phone is being charged and used at the same time, the rate of charging is noticeably slower. Shouldn't the current drawn from wall socket be increased to make it charge at the same rate? <Q> Basically, the charging source, battery, and load are all connected in parallel. <S> If the charger supplies more current than the load requires, the excess current will be used to charge the battery. <S> If the load requires more current than the charger can supply, the battery will supply the excess. <A> Explaination 2 is correct. <S> And your intuition about drawing more current from the wall socket is correct, but there's a step in between: the USB charging system. <S> There's hardware in the wall-wart which has to convert 120V AC power to the 5V DC power that USB uses (and thus is used to charge your phone). <S> That hardware could heat up and break (or even cause a fire) if too much power is drawn. <S> The designers of USB limit the current that can be drawn across a USB cable. <S> The initial spec limited you to 500mA of 5V current, though later upgrades to the USB specification permit the 1A and 2A "fast" chargers that we see today. <S> Regardless, the phone is not permitted to draw more power from the wall, even if it wanted to. <S> To meet these rules, the phones have regulatory hardware which ensure it doesn't draw more power than it is permitted to. <S> If it can't get enough power to do everything it wants, it will simply charge the battery more slowly. <S> In some extreme cases, with power hungry phones with GPS turned on and applications using the CPU, this can actually consume so much power that the battery doesn't get to charge at all! <A> Your explanation #2 of the process of charging while working is correct. <S> A battery is either in charge mode, or in supply mode. <S> This is achieved via complicated electronic circuitry containing analog switches and up-down DC-DC converters. <S> Regarding your concern about the rate of charging while working, the #2 is also valid. <S> However, a phone knows that the supply (wall charger or else) has limited abilities, and simply can't draw more current than the charger can supply by a standard. <S> The intelligent IC has a special means to restrain its current needs. <S> The input current is split between system supply (used for phone functions), and battery charge. <S> One typical line of intelligent chargers used in portable devices is produced by Texas Instruments (formerly Benchmarq), the BQ2xxxxx line. <S> Here is an example of typical block-level architecture of the BQ24296 IC <S> Now you need to decide yourself what kind of engineering profess is needed to make this kind of circuit. <A> you need to apply a voltage more than that of the cell and in the opposite direction to charge it <S> No, you have to apply a voltage more than the voltage of the cell <S> but in the same direction as the voltage the cell produces. <S> Getting back to the question of how devices can be used and charged at the same time. <S> The simplest approach is simply to connect the load, battery and charger output in paralell. <S> If the charger produces more current than the device consumes then current flows into the battery. <S> If the charger produces less current than the device consumes then current flows out of the battery. <S> Afaict <S> this is what most phones do. <S> It does have a couple of downsides though. <S> Current taken by the device will reduce the current available to charge the battery. <S> At peak currents the battery may even start to discharge with a charger connected. <S> The device generally will not work without a battery connected. <S> Lithium ion chargers have to have undervoltage protection for safety reasons. <S> So if no battery is present the charger will detect an initial voltage on the battery of zero and will refuse to supply the system. <S> The other option is to have a bypass path that bypasses the battery completely. <S> Afaict this is what most laptops do. <S> Note that the term "charger" in this post refers to the device that controls the charge voltage/ <S> current so that the battery is charged in a safe manner. <S> In devices with lithium ion batteries this is nearly always built into a device. <S> The external brick that users often reffer to as a "charger" is just a DC power supply.
While it is true that you cannot charge and discharge the battery at the same time, it "looks like" you are doing so, as the battery will change between charge and discharge automatically as the load demand or charging supply vary.
Arduino watchdog with 555 Timer and a MOSFET I want to protect an Arduino from stop running using a 555 timer. I saw some projects that use the Arduino RESET pin to do that but there are cases that my Arduino project still stop working even when I do a reset using the RESET pin. So I used the circuit below to cut the 5v line of my Arduino. I choose the 5v line instead of the ground because I have only one 5v pin and more than one ground at Arduino. My problem is how can the Arduino reset the 555 counter? How can I pulse the 555 to prevent it from disable the Arduino? If I connect the D2 Arduino pin to the Threshold/Trigger/Capacitor pin like I saw on some projects, and keep the capacitor charged, it works when the Arduino is running but if it disables it never turn on again because the Arduino don't allow the capacitor to charge again and it stays forever off. simulate this circuit – Schematic created using CircuitLab <Q> These microcontrollers used in Arduinos typically contain a so-called Watchdog , which fulfills exactly the role of your 555, but is already integrated, thus needs zero additional components (and thus, sources of failure), uses an amount of power that is, even with lab equipment, pretty much impossible to measure, whereas the classic 555 is a true power hog, can be way more accurate, will reliably reset your system exactly once until it is started again (which you typically do early on in your firmware), is designed and tested by experts for production in the millions to billions <S> and I'd thus expect it to be way more reliable than your own analog circuit and <S> leaves your Arduino in a defined state instead of violently disconnecting it from power, which leads to a brown-out situation with currents flowing in directions noone foresees. <S> So, abandon the 555 approach and simply learn how to use the watchdog. <S> It's superior in any aspect I can think of. <A> A watchdog, as described by Marcus is the better solution than a 555 timer. <S> The way that I use a 555 timer is by using a pulse (based on your program) out of the Arduino in your case into the reset pin of the timer. <S> As long as your program is running the 555 gets reset before it "goes off". <S> If you program stops running, then it doesn't get a reset and trigger the processor reset when it times out. <A> Some mentioned using the watchdog. <S> I must say that while the watchdog is present it too has failed me multiple times. <S> A hardware reset watchdog is the only sure way. <S> I too am looking for a solution like this but my solution targets pulling down the reset pin. <S> Now if a hard reset such as that doesn't reset the arduino then you may have another more serious problem. <S> P.S, the FET you are using is that logic level? <A> There are easier ways of doing this. <S> These are easier than using a 555 because they are very low power and have configurable time periods. <S> One example is the TI TPL5010 <S> but there are many. <S> When working on a very low power applications sometimes the external watchdog IC uses less current than the internal WDT.
There's the internal watchdog timer (WDT) in the Arduino, but there are also dedicated watchdog ICs.
Vss and Vdd pins' position on microcontrollers I am starting to work on some designs with MCU-based boards, or sometimes just looking at companies' products involving MCUs such as Espressif, Udoo, NXP... I have noticed a puzzling similarity between those MCUs, be it ARM Cortex, PIC or AVR family processors: the power-supply pinout. I have looked up topics about the benefits of having multiple Vdd and Vss pairs, but what i find disturbing is their immediate proximity, i.e. they are next to each other. While there should be little problem with reflow oven or wave soldering in assembling processes, when it comes to SMD hand soldering this gets quite tricky for assembly or repair. It is really easy to short Vdd and Vss with the latter method and unless visible or checked after assembly/repair, one might badly damage its MCU or power-supply and start the board's design anew in the worst case scenario. Hence my question really is: are there some benefits or silicon chip design constraints to why such layout is common place on our beloved MCUs? I have little to zero knowledge about silicon chip design or manufacturing. Or is this a way to ease the placing and routing of bypass capacitors? <Q> As you say, it is a complete non-issue for high-volume manufacturing, which is where the vast bulk of such chips goes — and those are the customers that the chip makers pay attention to. <S> Hobbyists don't buy nearly enough chips for them to even notice. <S> But yes, there are real advantages to this arrangement, both on the chip and on the board. <S> On the PCB, you get the best performance out of the decoupling capacitors if their connections are as short as possible, and putting the pins on the chip next to each other makes this much easier. <S> It also helps avoid congestion with signal connections here, as well. <A> Are there some benefits or silicon chip design constraints to why such layout is common place on our beloved MCUs? <S> Major benefits. <S> Each pair powers a subsection of the chip, you could say "one side" on a QFP. <S> Each pair takes on a block of IO pins and peripherals. <S> For example on many chips Vdda takes care of the "sensitive part", the ADC and clocking. <S> While the others are just " slow " GPIO and timers. <S> Some chips connect them all internally, some vendor measure each power pair with their peripherals during characterization, this way they can measure how much current each peripheral or only the core consumes. <S> This means they are still separated internally. <S> The benefit of routing them outside next to each other is that you have the most effective decoupling. <S> This is especially necessary in leaded chip where there is inductance in the package. <S> (LQFP, SOIC, QFN). <S> Less so for BGA and WLCSP, these move into an whole other level of power distribution. <S> With planes and their impedances. <S> It is really easy to short Vdd and Vss with the latter method and unless visible or checked after assembly/repair <S> Just add flux. <S> It's "magical" properties will easily prevent or remove bridges. <S> People often underestimate flux. <S> Use a flux pen, or flux syringe. <S> Use a thermal camera when bringing the board live. <S> If there is a power supply short, you will notice immediately. <S> For your own designs, just make sure your power supply is short-circuit proof. <A> Putting high-current pins like Vdd and Vss <S> close together is essential for minimizing EM radiation. <S> The current loop must be as small (narrow) as possible. <S> Using the corner pins (7&14, 8&16) was a huge historic mistake. <S> Shorts are easily found with a millivolt meter. <S> Just use a current-limited power supply, e.g. 1 A, and find your short where the highest Vss and lowest Vdd meet. <S> I have seen this work even on low resistance ground planes and bus bars.
Power and ground are distributed on the chip in metal layers on top of the silicon, and these connections interfere the least with signal connections if they run parallel to each other to the greatest extent possible, and this includes the external contacts.
Encoding version or configuration on PCB I need to encode information about either version or configuration on the board/electrically, so the firmware can detect which board layout is used. What options are possible and what are their pro/cons? <Q> Off the top of my head, two easy solutions come to mind. <S> Have n lines attached to the GPIO of your microcontroller. <S> Tie these high or low depending on your board version. <S> This would give you \$2^n\$ board configuration options. <S> This would use n pins on your microcontroller. <S> Static current draw would be negligible. <S> This would only use a single microcontroller pin. <S> This has the disadvantage that there will be static current draw through the divider. <S> It would also be prone to BOM errors, while the first suggestion is hard wired to the board. <S> Both of these suggestions do have a weakness in that the end user could easily alter them, say to open up "locked" features. <S> This may not be a concern for you, but something to bear in mind. <A> I have used a shift register with pins tied high and low to encode board revision before now, if you're already using SPI for something on your board <S> it's trivial to read it. <S> If you need to be able to change ID at run time then using jumpers rather than tying the inputs with traces would be a good idea. <A> Some options I can think of:- <S> SMD PADS/ O OHM Resistor Links. <S> Use a binary system for hardware configuration to reduce pin count for your processor. <S> Jumpers. <S> The board would 2xN connector pins adding a jumper to the right pin would let you select your configuration. <S> A mistake is easier to resolve. <S> This maybe a little costly and use more board space depending on jumper. <S> If you have EEPROM on the board then it may be possible for you to embed the configuration into memory. <S> Is it possible to have you change the firmware itself using a #define or similar? <S> Then you don't need board space and extra pins for version detection. <A> They also allow the microcontroller to write that information during board test (e.g. calibration data). <S> Many have a write-protect pin or one-time programmable bit to prevent further changes. <S> Other advantages include useful features such as guaranteed unique serial numbers. <S> This option is used in many systems, such as oscilloscope probes and batteries, due to only needing a single data line. <S> The EEPROM can even be powered from the data line itself. <S> The main disadvantage is cost. <S> The cost isn't high, but on mass produced products a few cents can matter. <S> An example of such an EEPROM is the DS2431, which stores 1kb.
Have an input to the microcontroller's ADC and use a voltage divider with different values depending on the board configuration. One wire EEPROMs are a nice solution because they only require one GPIO but can store a large amount of configuration information.
Are there any true direct-current motors? The "DC motors" that I'm aware of use a DC power source, but they have a current running through a coil that changes direction based on the angle of the motor. Therefore, they current inside actually alternates as the motor rotates by switching the current (electromechanically with a brushed motor, or electronically with a brushless motor). But are there any motors which are trully direct-current? By this I mean that the internal currents never change direction. <Q> Yes, there are Homopolar motors. <S> They are not very practical, but they do work. <S> You can make one with a permanent magnet, a battery and a paper clip. <A> http://www.electricstuff.co.uk/bbmotor.html <S> I have built one of these. <S> They can rotate at an impressive speed. <A> In the end (likely even with the homopolar motor mentioned), with an electromagnetic motor (the ball bearing motor mentioned is thermal!) <S> , there will be AC effects at play, even if polarity is not reversed. <S> Any motor design that would run off a perfectly steady field as generated by a DC driven electromagnet could have that electromagnet replaced with a permanent magnet*, violating accepted scientific facts about energy conservation. <S> A DC electromagnet in motion relative to a permanent magnet <S> will in effect experience changes in reactance, modulating an AC current in sync with the motion onto the circuit. <S> *A DC electromagnet not interfered with by other magnetic fields uses no actual power to keep the field in existence - <S> all the power usage is by resistive losses. <S> Compare real-world superconducting electromagnets - you energize them, short circuit them, then switch the power off, and they continue being magnets indefinitely. <A> In certain range some motors may be called DC in your sense. <S> Voice coil is one of them. <S> Like this <S> https://youtu.be/QFMQwspj_6Y <S> Brushless motor in a sense too: total current of all coils is controlled to be dc for given torque. <S> Here: https://youtu.be/bQYEavwFGy8 <S> But the term comes in fact from the kind of power supply required for the motor. <S> Ac motor, dc motor... <A> In a DC motor with a commutator, the current does not change direction. <S> The path through the rotor windings changes but the overall direction stays the same if you could observe the path from the outside. <S> The magnetic field produced by the rotor current moves very little as the rotor rotates. <A> A solenoid is a linear motor which can be actuated using DC. <S> If you reverse the polarity, it will drive in the opposite direction (assuming it's working against a permanent magnet field). <S> Solenoids are used as the motive force in relays and speakers, so they're actually very common. <S> Speakers are usually driven using an AC signal, however.
A ball bearing motor can run without alternating current - https://en.m.wikipedia.org/wiki/Ball_bearing_motor