text
stringlengths 83
79.5k
|
---|
H: MOSFET Diode design
I'll start this off by simply saying I am not an Electrical Engineer. I am, however, an embedded programmer who has had some experience with circuit design and setup (give me 1's and 0's and I can make them dance...but Analog is black magic...).
Some background that might help understand what's going on here. I work in my spare time to help a local theater out as one of their Technical Directors. Long ago, they built a rig that's used in several productions and special events. The rig is specifically an aluminum chassis on rails, above the stage, that is remotely operated. The rig allows tech members to lower down props on stage while the show is running. A prop is simply attached to a tether and lowered down to the stage by a small DC motor. The motor runs in only one direction - down. The rig then jaunts off stage and is prepped for the next use. By it's, rather interesting, design, the motor is taken off and placed back on several times (it's changed out for different items, not enough space on the rig for everything).
Now, I originally designed the control circuits a long time ago and they have worked beautifully since then. However, I finally have the time and money to help them out by upgrading it. In that process, I'm trying to solve all the electrical puzzles I haven't found the right answer to.
The original design is DEAD simple...n-channel MOSFET attached to a uC (view the lower image, but remove A/B/C/D). This has worked constantly. However, every time a motor is plugged in, while the device is still powered, the unit will completely reboot. I initially thought this may be due to an inrush of current from attaching the DC motor coil, but I'm not knowledgeable enough to know if it's that, or the lack of a fly-back diode. Or, worse, something is happening to the uC. After several trips through google and this site, I've seen several suggestions made, but I can't discern which is accurate or the best solution for this. Even worse then that, I don't know how to properly size any of these components (I'm sorry, help!).
For additional information, the motor being attached is always 3v-3.3v and 1A to operate. The motor's can be changed on the fly, so I can't give an exact value here on the properties of each motor (the rig must be blind to this), but those 2 requirements are always met. The motors are also controlled by PWM via the uC.
Here's the proposals I've seen:
So let's go down the list.
'A' was suggested to prevent latch-up of the uC when the field collapses on the motor. I...guess that make's sense, not sure if that'll help or hurt me.
'B' is a standard fly-back diode for when the field collapses to prevent back-fed EMF. Is this the correct place to put it? How does one size the diode if this is correct?
'C' is a dual-zener fly-back that was also suggested. This requires more parts, so I'm not sure if there's anything beneficial here.
'D' is a varistor installation to prevent the inrush. Would that prevent my uC from rebooting when the motor is plugged in? How does one size it?
Are any of these designs correct? Do I need to add in a TVS for ESD? And more importantly, if any of these are good choices, how does one choose the part? I know to look for certain items in a data sheet, but the multitude of additional information bits just does my head over. What's important and what's not?
Finally (it's a tome, I know...) we have the last bit that I'm adding in this year.
This was a request by the director. He want's to be able to 'drop' certain items rather than use the tether. To do this, he currently has a poor stagehand connecting a rather large magnet to a car battery. The magnet is spec'ed at 12V at 0.66 Amps (EM175L-12-222 from apwelectromagnets.com) for a holding force of 110# (complete overkill, but safety related). The above circuit, I believe, will do what's needed. The uC will send a 1 down the line (MAG1/MAG2, Armed is a safety, will also be 1) and the magnet is energized. When I want to 'drop', I write a 0 on MAG1/MAG2, sending the H-bridge in the opposite direction, forcing the magnet to push the prop away (it has a tendency to 'stick' at the moment if the magnet is left on for too long, magnetizing the prop plate). Would this design work? Do I need to add the same or different protections from above since the EM field on this is going to be much larger when the H-bridge switches?
I sincerely appreciate any help I can get on this. I wish I could disclose more about the theater, the show, and other information. I am however under a contract that prevents me from doing such without the directors approval (working on it!) Any assistance is greatly appreciated, and I will attempt to get you added to the show pamphlet if the director approves.
Again, thank you for reading the story of the MOSFET, or the more popular title, Harry Potter and the prisoner of Diodes.
Edit per Tony's Questions:
Power is from an A/C line converted to 12V via an on-board power supply (100W, DPS-100AP-11 A by Delta Electronics), which is then converted down to 5V and 3.3V via linear regulators capable of 5A each (AZ1084CD-3.3TRG1 via Diodes Incorporated for the 3.3v supply, LM1084ISX via TI for the 5v supply). External cabling is not shielded, and consists mainly of standard 2-terminal speaker wire (on the cheap unfortunately). Cable lengths vary from a few inches upwards of 10' depending on the rig setup at that time.
AI: I think for hot switching motors I would be looking at something like this.
simulate this circuit – Schematic created using CircuitLab
D1 provides the rail a measure of isolation from any back driving that might occur when you connect the motor. You may need to use a higher rail to compensate for that diode drop though. You may want to consider replacing that diode with a more active element that only gets turned on before the main transistor and has less drop.
C1 adds some local charge storage to offset the initial inrush load.
D3 of course is for the flyback event.
TVS diodes D2 and D4 are there to cope with any static discharge that may occur when you plug in the motor. Note they are centrally grounded such that if both motor wires are high voltage vs your ground they both have a conductive path back to ground.
R1 limits the turn on current from the micro and also helps protect the micro from any capacitive coupling of ESD events.
You could add an inrush current limiter, or provision to add one, in series with D1 if you deem that to be a problem. However, since you are using low voltage motors, you do not have much headroom.
Grounding also needs to be looked at. Your system needs to be connected to the stage ground and that connection needs to be as close to where the motor connections are as possible. The grounding for the micro etc. needs to spur off that ground point on it's own.
You may also need to consider optically isolating the drivers from the micro. Since there is a lot of hot switching going on, presumably by folks who don't overly understand the delicacy of the action, more isolation is better. Current limiting would also be a good inclusion, since a short across the motor connection is also a probable event.
As for the magnet design.
If you really MUST go that way, a suitable full bridge driver would suffice. There are many devices available for this and example circuits abound in this forum and elsewhere so I wont expand on it further here.
HOWEVER: The wisdom of using an electromagnet for this purpose is faulty. Should said magnet turn off at the wrong time there is a real danger that something will be dropped at the wrong time causing property damage or worse injury or even death.
As such, if it was me, I would refuse to implement it on ethical grounds. You need to dig your heals in here.
The dropping mechanism needs to be fail-safe in nature. That is, loss of power should never permit the item to drop. Also, while being manipulated and installed the thing should be locked in place for the safety of the crew and performers. Use of some form of over-centre, solenoid actuated, mechanical releasing mechanism, possibly with an additional locking pin, is a must. |
H: Boost converter drops voltage to 0 V when activated.
I have built an automatic watering system using an Arduino board and a boost converter for powering the 5V DC pump (1-3W), but I have a problem. Each time the pump is activated, the DC-DC converter (bough from here) shows that the voltage drops to 0V, although the pump still works and I'm not sure if this is normal or not. I am powering it by a 2.6 Ah 18650 LCO battery and it should be enough power in it to drive the pump.
The question is... why does it drop to 0V when the pump is turned on?
And moreover, if I try to connect also the Arduino board to the same power, the voltage drops from 5V (which I set manually) to 4.8V and I can't change it anymore in the booster.
Is there something wrong with the switching or is it a normal behavior of a DC-DC Boost Converter? If not, what can be the cause for this drop?
Please see the diagram of my system and the components below :
AI: Each time the pump is activated, the DC-DC converter (bough from here) shows that the voltage drops to 0V, although the pump still works and I'm not sure if this is normal or not.
Since you say that the pump still works (and is therefore still receiving power from that Ebay boost converter module) then the display on that module must be misleading you. The output from the boost converter cannot be both zero (as shown by its display) and non-zero (as shown by the pump operating) at the same time!
Unfortunately it is impossible to diagnose the reason for this behaviour with certainty as neither you, nor the readers here, have the schematic for that module, the firmware for its display MCU (see below) and the ability to make all the necessary measurements.
This situation of "why does the module from Ebay / AliExpress behave like that?" is the price paid for using those cheap modules. :-( As I have mentioned on other answers, since buyers can't realistically get the necessary support from an Ebay / AliExpress vendor, then buyers have to either reverse-engineer the module themselves and provide their own support - or else accept that they will never know why strange things happen. :-(
The question is... why does it drop to 0V when the pump is turned on?
The output doesn't drop to 0 V, because if it did then the pump could not operate - but as you have pointed out, the pump does operate even when the display on the boost converter module shows 0 V.
Using an oscilloscope (to be able to see the peaks) or a multimeter (which can only show slow changes) would allow you to see more about what the output voltage is actually doing, to avoid being misled by the display on the boost converter module.
According to the images in that Ebay listing, the 7-segment display on that boost converter module is driven by an STM8S MCU (similar to many stand-alone 7-segment voltage displays also available on Ebay). We don't know whether that could get confused or behave incorrectly, with certain types of loads... Perhaps the current peak when starting that pump is a problem for that boost converter module?
There are two components missing from the diagram supplied, which might have an impact on the behaviour you describe:
Missing flyback diode across the motor (add one, to prevent damage to the MOSFET - although it might already be too late to avoid damage to the MOSFET which is already being used).
Missing bulk smoothing capacitor (e.g. hundreds of uF) close to the motor. That will help to reduce the peak current load on the boost converter.
Also:
The IRF520N MOSFET (Infineon datasheet, Vishay datasheet - I don't know which brand you have) is not the most suitable for this job. It is not a "logic-level" MOSFET and at a 5V Vgs, it is not fully saturated (i.e. it is operating in the linear region) and will only be able to pass a limited current (and will heat up more while it's doing that). The datasheet shows optimal switching at around 10V Vgs, which you cannot achieve from the output of an Arduino.
I would also suggest adding a pull-down resistor between the MOSFET Gate and Gnd, so that it isn't floating before your Arduino sets that pin as an output. A small Gate drive resistor might also help, especially when driving MOSFETs with large Gate capacitances directly from an MCU.
These topics have been handled before in other questions and so can be researched there. |
H: Understanding OpAmps in TINA simulation
I have a hard time to understand why two different opamps in a substractor configuration deliver highly different output in a TINA simulation.
At the end I try to implement a high impedance differential aplifier (instrumentation amplifier), which second stage is a subtractor, and I got very different result with different opamps in simulation.
So I first read some basics here: http://www.ti.com/lit/an/slyt213/slyt213.pdf.
They explain an instrumentation aplifier as well as simple substractor and in regard to the later there is a formula for Vout which contains only the values for input voltages and external resistors.
So I think then, the particular opamp model does not matter at all for this configuration and DC operation.
Now in TINA I made a DC operation point simulation, for an ideal opamp, for TL082 and for LM7321. The schematic shows my configuration.
simulate this circuit – Schematic created using CircuitLab
Now with an ideal opamp I get the correct 50mV at the output, with LM7321 and 9V supply I get something around 45mV which I suppose is stil OK, but with TL082 there is 1.52V at the output (but the circuitlab simulation results in exactly 50mV). What do I miss? Is it a buggy spice macro in TINA or is there something else in TINA or in the datasheets I should consider or am missing?
I would like to use TL082 because its cheap and I have already some in stock bought as "general purpose opamp".
Please educate me a little :-)
AI: Since one of your requirements is to work away at your TL082 stock pile, the easiest solution is to add a negative supply rail.
The TL082 can tolerate supply voltages of up to +- 15V.
The input commmon-mode range is narrower than the output swing, so your negative supply needs to be low enough so that 0V is within the allowable CMR of your amplifier. Minimum guarantee input CMR from the datasheet is 4V above Vee. So you must add a negative supply rail of at least -4V to meet CMR.
Perhaps choosing more a more common value like -5V or -9V is even easier, as you may have a 79xx laying around. |
H: Power amp element's purpose
From 100 watts OTL amplifier circuit using transistor MJ15003-MJ15004:
What is the purpose of C5 capacitor?
Why are there 3 diodes used? Not 4?
AI: I'm not convinced the DC bias is stable or even centered at 45V out but C5 is definitely a Bootstrap Cap to shunt the AC current across R12 and thus raise it's equivalent input impedance.
Given the high open loop gain offered by Q3 , crossover distortion is less of an issue than the pop created during power on. |
H: What type of transformer should I use to convert 24VAC to 12VAC (or vice versa)?
I'm working on a project that combines a board from an electric organ with one of those cheap Chinese tube amps. The board requires +12V/-15V DC and the amp requires 12VAC.
I don't want to power the final product with two wall warts, because that would be fiddly and annoying.
The amp converts its 12VAC to ±30VAC internally, and my first thought was to power the amp off a 12VAC wall wart, then tap off the ±30 on the amp's board and power a 7812 and 7915 off of this (rectified first of course). But connecting them up causes a huge voltage drop, so it seems that this isn't going to work.
The current idea I'm working with is to power the whole project off a 24VAC wall wart, which will run the 7812/7915 combo fine, and also can step down at 2:1 to 12VAC for the amp.
My problem is that I can't find a 2:1 transformer suitable, but it seems impossible that such a thing doesn't exist. (The only 2:1 transformers I can find are huge, built to take 240V to 120V. This would work in principle but it would bring up the size/weight of the project by at least an order of magnitude which isn't ideal, to say the least.)
I bought some of these 78604-1C but they fry on 12VAC+ input. (The datasheet I have isn't forthcoming about a maximum voltage, which I am also confused about)
Is there a specific thing I should be searching for that will turn my 24VAC to 12VAC in a small package?
Or, is there some other way of solving this problem that explains why this type of transformer is so hard to find?
AI: simulate this circuit – Schematic created using CircuitLab
Figure 1. (a) 12 to 24 transformation without isolation. (b) Fully isolated 12 to 24 V transformation.
Transformers are very flexible and versatile.
My problem is that I can't find a 2:1 transformer suitable, but it seems impossible that such a thing doesn't exist.
You should be able to find a dual 120V:12V transformer quite easily and use this with the mains side disconnected. If you feed 12 V in on the secondary you will get mains voltage on the primary but you just need to make sure that it is properly isolated. i.e., You don't have to use it.
In Figure 1b I have sketched just one of many arrangements that are possible depending on the transformers available. Here we are paralleling the 12 V "primaries" and series connecting the "secondaries".
Watch your VA rating overall. Also watch your winding current and make sure you don't exceed the design value. |
H: MOSFET for directly switching 24 Volt loads - any reason not to use the IRL8743PBF?
I am searching for the best solution for using a Raspberry Pi 3 to control a 24 Volt load at modest amperage.
It seems like the best choice is the IRL8743PBF because it can be switched to fully-conductive by a 3.3 Volt logic signal and can handle at least an amp of current flow without a heat sink. Plus it can plug into a breadboard.
Specifications Datasheet (PDF)
I've found that it can be purchased in 5-packs via the slow boat for $2.55 with free shipping HERE.
Question: Is there any reason not to use this one?
AI: Judging from the IRL8743PBF datasheet you linked, you might be in for a bumpy ride if you drive them straight from a logic pin.
You say it "can be switched to fully-conductive by a 3.3 Volt logic signal", but that's not true. To get its rated 3.2mΩ, you have to use a 10V Vgs signal, see "Rdson" in the table on page 2. At 4.5V Vgs, you're guaranteed 4.2mΩ. There is no guarantee specified for 3.3V.
However, judging by fig.3, the current is about 5% at 3V, suggesting a 20-fold increase in Rdson (let's call it 100mΩ). Looking at fig.12, you can see the Rdson is off the charts for Vgs=3V.
You mentioned a load current of 1A. If my estimated ~100mΩ is correct, that's 100mW dissipated at 0.1V drop, which sounds perfectly reasonable, but all this is based on estimates from typical values. Not facts of worst-case values.
You're probably better off driving them from a higher gate drive voltage (4.5V will do. You can't use the 24V, too high), with a NPN transistor driven by the Raspi to shunt the gate to ground. See the circuit from this EE.SE answer from Majenko for an example:
Another concern with the choice is the maximum Vds voltage which, at 30V, is very close to your 24V. Any significant overvoltage spike (e.g. caused by inductive kickback) could kill the transistor. Be sure to protect against that (e.g. with clamping diodes).
Another warning: the "slow boat" option has a relatively high chance of giving you fake parts that don't quite deliver the promised specs. Better buy from a trusted source if you don't want that risk. |
H: Can you short out a current source?
I know that you can short out a voltage source by placing a wire in parallel with it so all the current the source drives goes to the wire instead of to another branch with a resistor.
But can you short out a current source? I never saw my professor do it.
For example, can you go from this:
To this:
???
AI: Certainly the current source in your first circuit is useless. Its terminals are the same node, so it does not interact with the rest of the circuit, just circulates current back to itself. You can delete it from your analysis — or split at that node into two independent circuits, one with the shorted current source and one with everything else — and get the same result.
However, this is not usually considered analogous to shorting out a voltage source. A shorted ideal voltage source is a contradiction, and a shorted non-ideal voltage source will either destroy itself, shut down, or reach a current limit which reduces its output voltage.
The analogue of this in a current source is an open circuit. If you disconnect one or both terminals of a current source (or break the circuit elsewhere), then it is impossible for the specified current to flow, so this is a contradiction with an ideal source, and a non-ideal source will reach a voltage limit (“compliance voltage”) and thereby fail to supply the specified current.
(And for completeness: the fourth case is a voltage source in an open circuit — which, like the shorted current source you drew, does nothing and can be deleted from the circuit.) |
H: Sign across resistor, circuit with diodes and fuse
Okay, so I had shown with arrows the signage in question, shouldn't it be other way? Otherwise KVL
$$ V_s = I_{fuse} (50) + 1.4 \color{red}{+} I_{fuse} R_{L} $$ isn't correct...
Also, in the problem, $ I_{fuse} $ shouldn't exceed 0.1 A, otherwise fuse will "blow".
AI: Edit: Apologies, I misread the polarity they'd given. Yes, this is wrong. The plus and minus signs on Rl are the wrong way round. Other than that, their working is correct.
No. As long as you're consistent, and you stick with the passive sign convention, it doesnt matter what direction you choose to represent your current. In this case, everything in their working seems correct. |
H: 13Bit Encoder interface for microcontroller
I am running out of time and seeking a proper solution.
What I am willing to achive is getting the position of the encoder / motor shaft. To keep track of the movement. (Currently I am running 10 turn pots, but hey are going to wear out eventually and if there is a built in encoder why not to use it?)
The configuration is the following:
HiWin Motor (Builtin 13Bit encoder) -> HiWin D2 Drive -> A A' B B' Z and Z' lines coming form the drive.
They are differencial +-5V
The link for the motor controller:
http://www.hiwin.com/pdf/d2_drive_user_manual.pdf
Manual says:
Output pulse of feedback (buffered encoder or emulated encoder)
RS422
The waveform of signal "A":
I have got the following parts on hand:
SP3495EEN-L
SP3496EEN-L
ST485ECDR
ST485CDR
These are transcievers with various speeds from EXAR and STM.
I would like to get this work either an Arudino or a TM4C microcontroller (which has a built in Quadrature Encoder Interface).
My questions are:
Are any of these parts will do the trick?
As this is a serial communication I will simply receive a message containing the position?
What would be a better solution (Some other ICs to get? Maybe a different approach?)?
Edit: *typo
AI: All of your parts will "work", in the sense that they will allow simple communication between the encoder and your Arduino. They will not, however, do what you want.
The labels on the encoder lines establish that they are quadrature encoded with a home line which will become active once per revolution. This is not serial communication in the same sense as, for instance, RS232. Instead, a transition on either the A or B lines indicate that the encoder has moved by 1/(2^13) revolution.
It is entirely possible to use such a protocol directly. What you do is feed both the receiver A and B lines into IO lines of the Arduino. Monitor both lines and if either changes determine the direction from the state of the other line and update the shaft position.
Of course, you may or may not be able to keep up with the computation requirements. If the shaft is turning at 60 RPM, or 1 rps, then you'll get a change every 125 usec. Furthermore, if you're doing anything else with your Arduino, and you're monitoring the encoders by polling, you'll risk missing a transition while performing those other tasks. You can get around this by setting the two lines as interrupts. See, for instance, here or here
There are dedicated quadrature encoder chips, but I'll leave such fundamental search tasks to you. |
H: Ethernet to SPI converter Differential line importance?
I hope someone can shed some light in this, I am laying out a Ethernet to PI zero HAT and will be using the enc28j60 controller from microchip. People have reported getting 2.8mbps up and down speed on average with cheap modules form china with same chip.
My question is will impedance matching and differential parts make a big difference on traces 14.20 mm in length?
Copper 0.035mm T
Trace width 15 mil
trace <> trace space 4 mil
FR 4 material
1.55mm thick
2 Layer
When I do the impedance matching and calculations this will give me 107 Ohm Differential.
Or will I be better off just running normal routes and adding O ohm resistors in-line just in case there is a problem?
Example of matched traces
Example of unmatched traces
AI: At 10 Mbps (which is, if I recall correctly, the only line rate that those chips support) you don't even have to bother with getting the impedance right due to the length of the traces. Just route it differentially and don't bother with the length matching. And don't add resistors, that's not how you fix a bad impedance match - for that you need either a re-spin with fixed dimensions or a matching network. |
H: ORing 2 power supplies for 3.3V output
Is it possible to add two independent power supplies together to achieve a steady 3.3V powers supply? One power supply will be running from a 9V battery and the other is a 12V source. They both don't have to necessarily run together i.e. the if the 9V battery is just connected, it should still supply 3.3V. I have a buck converter that can output a steady source of 3.3V (LM2576-3.3V) and can handle a wide range of voltages (up to 40V). Is there some kind of passive voltage adder circuit that I can use that has some power protection diodes?
AI: If you don't care about efficiency, use two diodes, like below:
simulate this circuit – Schematic created using CircuitLab
Otherwise use:
Ideal/smart bypass diodes (such as SM74611) instead of D1 and D2.
Some ORing FET controller such as LM5050 + nMOSFETs.
Some some autoswiching power mux.
If, instead, you must have 2 separate 3.3V regulators, then use something like a TPS2113 (2.8 to 5V autoswitching power mux). |
H: Amplify PWM signal from 0-5V to 0-10V
I'm trying to amplify my PWM signal from 0-5V to 0-10V. As the nature of my project is a flyback converter, I thought that using a logic level mosfet with gate inputs from Arduino was enough to switch it but I was proven wrong. I've got a pwm from china on the way but it is only able to go 0-5V 100khz. I've learn from the kind users here that the mosfet requires 0-10v for the mosfet to be able to do fast switching. Is anyone able to point me the right direction in pulling up the amplitude perhaps recommend a solution? I read about D amplifiers but I have a square wave output already. Thanks in advance !
AI: Use a MOSFET gate driver, such as a MCP14A0151.
It is compatible with almost any logic ouput level (TTL, CMOS 5V, CMOS 3.3V), and ensure fast switching.
Of course you need a 10V power supply. |
H: How do I figure out the voltages at these 3 nodes of a circuit?
To start, imagine the branch containing the current source as a node, a point currents flow in and out of. This gives us: $$i_3+i_4-i_1-i_2=12mA$$.
We also know by summing all currents flowing in and out of Node1 that: $$-i_1-i_2=12mA$$.
From these 2 equations, we know $$i_3=-i_4$$.
We know $$i_3=\frac{V_2}{6000}$$ and $$i_4=\frac{V_3}{3000}$$. So we can conclude that $$V_2=-2V_3$$. (V2 is the voltage at node 2)
We need another equation invovling V2 and V3 to solve them. If we look at the battery, we see that: $$V_3-V_2=6$$. We solve these 2 equations to get V2=-4V and V3=2V. Now we need to find voltage at node1, V1.
To do that, we look back to the equation summing all currents coming in and out of node1: $$12mA-i_1-i_2=0$$. We plugged in the expressions for i1 and i2 in terms of V. We have:$$0.012-\frac{V_1-V_3}{4000}-\frac{V_1-V_2}{2000}=0$$
Solving it and plugging in the values we got for V2 and V3, we have $$V_1=14V$$.
NOW there is a problem with these values for V. I tried testing them by plugging into the equation for summing currents at node2. $$i_2+i_5-i_3=0$$.
$$i_2=\frac{V_1-V_2}{2000}=9mA$$
$$i_5=\frac{V_3-V_2}{1000}=6mA$$
$$i_6=\frac{V_2}{6000}=-0.667mA$$
AI: When you have multiple sources in a linear circuit, whether these sources are independent or controlled (see here for more details), the superposition theorem is often your friend. In this example, I have chosen to determine the voltage at node 2. I will draw two small sketches where a) the 12-mA source is set to 0 A (open circuited) while the 6-V source remains and b) the 12-mA source is back in place while the 6-V source is reduced to 0 V (short circuited). You end up with the below sketch:
For the upper sketch, the voltage at node 2 (that I call V21) is simply the current source multiplied by the parallel combination of the 6- and 3-\$k\Omega\$ resistances. Then, when the current source is open-circuited, the node voltage across the 6k resistance is the circulating current (\$\frac{6\;V}{6\;k\Omega+3\;k\Omega}\$) multiplied by the 6-\$k\Omega\$ resistance. The node voltage is the sum of these two sub-values. From there you have the voltage at node 3 (you subtract 6 V) and for node 1, a simple KCL gets you there. The below sheet shows the step and the resulting values are confirmed by the quick simulated dc point. |
H: Solar cell power output comparison without MPPT
I am interested in measuring the relative power output of a solar cell when it is placed behind glass and other materials. For example, one might guess that the cell's power output is reduced by 70% when placed behind frosted glass.
One thought I had to measure this was to use a very small resistor. Going by this diagram for the cell (Maxeon C60), we can see that we don't want voltage going over ~0.5 V, or the current drops. A small resistor ensures we stay in the constant-current region of the cell:
Assuming an absolute maximum current of 10 A, that means we need a 0.5 / 10 = 0.05 Ohm resistor.
Since $$P = \frac{V^2}{R}$$ we can see that e.g. if we measure half the original voltage, our power output is 25% of the original.
Does that make sense? I am wondering how accurate this will be. Are there any cases, like very low light, where this can break down? Thanks.
AI: That will describe the power produced by the cell in your arrangement, but not the power the cell is capable of producing.
To do that most accurately would require MPPT tracking of some sort (which could be as simple as turning a wirewound pot while continuously logging V and I, and finding the peak in a spreadsheet or Python script).
But a simpler way would be to observe from the graph above, that independent of the illumination (within the ranges on the graph) the current remains relatively constant below 0.5V. So, measure current and multiply by 0.5 to get approximate power.
If you're interested in illumination ranges below the graph, you would have to establish this relationship still held, by separate measurements. |
H: TPS56221 Open Drain PGOOD
The datasheet says the PGOOD signal is open drain but I want to use a 3.3V microcontroller to read PGOOD
with the internal pulldown resistor, when PGOOD is asserted - will the voltage at the pin be 12V (my input voltage to the TPS56221)?
The example design in the datasheet has PGD tied to BP through a 100k resistor - why do they do this?
For my case using the 3.3V logic level microcontroller should I untie PGOOD from BP and use a voltage divider to get 3.3V ?
Thanks in advance!
AI: For your application connect the PGOOD output to a pullup resistor to your 3.3V supply and tie the signal also to the input of your MCU.
If you do not have an available 3.3V connection for the PGOOD pullup you can indeed use a combination pullup to the TPS56221 BP supply and a pulldown to GND to limit the upper voltage level of the PGOOD signal. Use the formulas for a voltage divider (considering that the PGOOD signal is not pulling to GND) to compute the appropriate resistor values. Make sure you do not use too low of resistor values so that you do not put excessive load on the BP supply pin.
An open drain output from the TPS56221 means that the device can only pull the PGOOD signal to ground (which it will do whenever the output voltage is not within an acceptable range). It relies upon an external pullup resistor to some voltage level to produce the high level of the signal when the output voltage comes into range. The reason that open drain signals are used in this instance is specifically so that the PGOOD can be adapted to the logic levels of whatever control/monitoring system is in use whether that be powered from 1.8V, 2.5V, 3.3V or even 5V. |
H: Do NRF24L01 modules have to use the same SCK-Frequency to work together?
I have two Atmega 328p Microcontrollers connected to NRF24l01 modules. The first one uses a SCK-Frequency of 2Mhz and the second one a SCK-Frequency of 4Mhz.
Sadly the Connection doesn't seem to be working.
Do both modules have to use the same SCK-Frequency to work together? Why or why not?
AI: They don't have to use the same frequencies. SCK frequency determines how fast the master (your Atmega 328p) can read/write from the nRF24. It does not determine how the nRF is configured or what is the over-the-air speed.
It may make a difference only if your are sending LOTS of data from a master that uses faster SCK and the master with slower SCK just can't read it fast enough. A logic analyzer (even the $8 kind) helps a lot with SPI debugging. |
H: PNP Transistor to switch between Voltage Regulation and Battery Charging
I am relatively new to circuit design and would appreciate your feedback on this :)
I am designing a power supply circuit that uses the TI TPS61030 voltage regulator. It features a 4A internal switch connected to ENBL. The regulator is ON if ENBL is high (+BATT) and OFF if ENBL is low (GND).
The power circuit also features a Li-Po charger (MCP73871), which uses USB power to charge the battery. It also has allows simultaneous battery charging and system power output, which is a feature I want to bypass.
Essentially, I want the system to power down as soon as the battery starts charging – when the USB is plugged in. The flow chart below summarizes the desired behaviour.
I chose a PNP transistor with an R1 of 4K7 and and R2 of 47K. I then worked out the logic, shown in the table & equations below. When VBUS is GND, the circuit between the base and emitter acts as a voltage divider. Otherwise, I used Kirchoff's law.
So here are my questions:
Will this work as illustrated in the flow chart?
When the usb is not plugged in, will VBUS be at 0V? and thus a voltage divider circuit exists between the base and emitter?
P.S. J4 is to bypass the transistor in case I wanted to charge and power the system simultaneously. VE < VB > VC (USB ON) -> Cut-off VE > VB < VC (USB OFF) -> Saturation.
Thank you in advance!
AI: No, when the USB cable is disconnected net VBUS is floating. Its voltage has no defined state. You can add a pull-down on VBUS so it is approximately zero.
However an NPN transistor would be a more suitable choice here.
simulate this circuit – Schematic created using CircuitLab
This is essentially the same schematic as yours, however the EN-pin switching is being done on the defined VBUS state versus the disconnected Hi-Z one.
The override switch as configured in your schematic allows you to disable the regulator at any time. If you however want to override the USB disable function you are adding, all you need is a SPST switch.
Aside, with the PNP option, your also burning 500 uA continuously during the operate from battery mode (if you added a suitable pull-down on VBUS, but that may already be there internal to charge IC). In the NPN case, the override consumes no quiescent current when USB is disconnected. |
H: What does "a 40 kHz wave modulate with a 1 kHz sound" mean?
what is mean when say "a 40 kHz wave modulate with a 1 kHz sound"?
which of AM or FM Modulation means?
AI: Figure 1. An audio signal (top) may be carried by a carrier signal using AM or FM methods. Source: Wikipedia.
In electronics and telecommunications, modulation is the process of varying one or more properties of a periodic waveform, called the carrier signal, with a modulating signal that typically contains information to be transmitted. Most radio systems in the 20th century used frequency modulation (FM) or amplitude modulation (AM) to make the carrier carry the radio broadcast. Source: Wikipedia - Modulation.
In Figure 1 the 1 kHz sound is represented by the top trace.
The second trace shows the effect on your 40 kHz wave when "amplitude" modulated. (Amplitude is the size / peak to peak / magnitude of the waveform.
The third trace shows the effect on the waveform when "frequency" modulated. Here the frequency changes +/- a certain amount as the modulating signal varies. When the modulating signal is 0 V then the FM signal will be 40 kHz. |
H: Linear vs. Switching Regulators
I'm trying to choose a voltage regulator, and considering I will have a relay on my PCB it seems a switching regulator is the better choice for the coil noise. Example Reference
I found a lot of schematic examples over the internet, and a lots use a switching regulator when have relays. I don't know if it is coincidence, or it is really better for the coil noises.
Is it really true?
How can I choose a good switching regulator to help with the noises? A higher switching frequency will be better?
My PCB operates in 3.3V, and I'm considering use this regulator MCP16311. If I use a Vin 12V or 5V it will make any diference with the noises handle?
Edited: By noise, I'm referring electrical noise caused by the relay coil operation, which can makes the microcontroller reset
AI: There is no general truth, switched regulators aren't always the best choice.
Using a relay by itself has nothing to do with the need for a switched regulator. What is the case is that a relay uses some current when activated. Depending on the relay this increased supply current can be a good reason to use a switched regulator.
For circuits with a low supply current, for example less than 10 mA, using a switched regulator makes little sense. The power loss due to a linear regulator will be small at 10 mA or less.
For large currents, for example 100 mA and higher, it starts to make sense to use a switched regulator as the power dissipation of a linear regulator is becoming significant and you might need a heatsink. This might add more cost than using a switched regulator.
Of course it also depends on the difference between regulator input and output voltage difference. When the difference is small, a linear regulator might be a better choice.
Switched regulators produce ripple at the output voltage this is due to their switching nature. I would not call this "noise", a better word is "switching noise". Noise is inherently random and this ripple is not.
Most circuits especially digital/logic/micro controllers are quite immune to this ripple so there is little need to worry about it. Usually only analog circuits like RF circuits, filters, ADCs are sensitive to this ripple so then a linear regulator or additional supply filtering might be needed. It is also possible to us a switched regulator to for example, drop from 12 V to 5 V and then use an LDO (linear regulator) to drop 5 V to 3.3 V for a sensitive circuit.
If the a signal (not noise!) from the relay resets the micro you have a design issue! You should use a flyback diode across the relay's coil and add a decoupling capacitor near the relay and near the micro. This has nothing to do with linear vs switched regulators but everything to do with proper design. |
H: Two Stage Amplifier Circuit Analysis Q
I'm trying to analyze the below circuit. It's a textbook problem (Malvino's Electronic Principles) and the answer is given in the back (8966), but I am unable to reach that answer or approximation.
The goal is to figure out what is the total voltage amplification of the below circuit:
The Op-Amp part is pretty easy, since it's simply a non-inverting amplifier with a feedback configuration, so the amplification is (47k/1k + 1 = 48).
For the transistor, I'm having a difficult time. Particularly, the 1k resistor is throwing me off. I think it's in series with the voltage divider biased circuit, so I am approaching the analysis like this:
\$I_E = (15(10/33)-0.7)(1/5600) = 36.4 mV\$ (assuming 1k, 22k, 10k resistors form a voltage divider)
\$r'_e = 25 mV/I_E = 36.4 ohm \$
\$r_c = 6800\$ assuming the input impedance of the 741c is very high
\$A = r_c / r'_e = 186.8 \$
Total Amplification = 186.8 * 48 = 8967 which gets me pretty close to the textbook's answer.
I don't know if my analysis is correct though. I tried to simulate the circuit in LTSpice, but I got a larger voltage drop across the 1k resistor than my analysis would suggest so I just wanted to see if anyone would approach differently.
Thanks
AI: It is not a voltage divider. For AC signals we assume the capacitors to be a short, both 10uF caps are large enough for this so assume they're shorts.
So the AC input signal is directly on the base, do the 2 base resistors then still matter? Nope
Same for the 5.6k emitter resistor, it is shorted by 10 uF. So for AC this is a common emitter circuit. Only the 6.8k collector resistor matters for the gain.
The other three resistors are only for setting the DC biasing point. |
H: Some questions about BJT in saturation region
In below circuit I sweep Vb from zero to 5V Vcc.
And I obtain the following plots for the currents:
I have a bit problem with understanding two things in saturation region:
1-) Why/how does the Ic decreases with Vb after the saturation point?
2-) How can I quantify/formulate Ib at saturation region?
AI: The collector current in your circuit decreases because, when the BJT is in saturation, by definition, the junction B-C is forward biased.
Therefore you'll have that the collector voltage will be just \$V_C=V_B-V_{BC}\$.
As a result, the current in the resistor Rc will be:
$$I_C=\frac {V_{CC}-V_C}{R_C} = \frac{V_{CC}-(V_B-V_{BC})}{R_C}$$
Therefore the higher \$V_B\$, the smaller \$I_C\$.
To answer the second question, simply use KCL at the BJT. You know that \$I_C+I_B-I_E=0\$ (assuming base and collector currents entering the BJT. Emitter current exits the BJT). Hence \$I_B=I_E-I_C\$. In fact in your plot, \$I_B\$ is the difference of the other two currents.
As a first order approximation, you can assume constant \$V_{BC}\$ and \$V_{BE}\$. This allows you to calculate \$I_C\$ and \$I_E\$ easily. |
H: Running a surround system on a 12V battery
Hello all engineers. I've recently started a portable music box project.
For someone like me with very limited knowledge about electronics I got what seemed like a brilliant idea.
I've got several sound systems laying around. They're all functioning perfectly when connected to an electrical outlet in the wall.
Question:
What is needed to run my surround sound system on a 12V battery?
Specifications on the sound system
The ones I'd like to try this project with are the "Logitech Surround Sound Speakers Z506". The back reads: INPUT 120-240V ~50/60Hz 800mA.
Looking forward to any answer - using a well functioning sound system with the build in amp in a new environment seems so much easier than me screwing up the electric impedance calculations.
update:
My question was answered, Thanks Chris and Michael. I'll not pursue the original idea, but do it properly instead. Hat off
AI: If you can find an inverter that takes 12VDC and produces a fake 120VAC waveform that should get the idea off the ground. Such inverters are not 100% efficient however - expect something more like 65%.
If your sound system takes 120VAC at 0.8 amps that corresponds to a power draw at 96 watts. An inverter at 65% efficiency would require an input power of 96/0.65 = 147 watts of energy from the battery. A battery at 12V to supply that power would be delivering a current of 147/12 ~= 12 amps.
As you can see it would require a really decent sized battery to supply this level of power for any length of time. Assume that the battery was one that you discharge at 0.1C (where C is the amp-hour rating of the battery). That would require a battery with an amp-hour rating of 120AH.
Amazon shows a 12V 120Ah sealed lead acid battery at $230US. Such battery weighs almost 73 pounds. I will leave it to you to decide if that qualifies as "portable". |
H: Are there types of standard coaxial cable with a propagation velocity of 0.9c? What would be the application?
Reading this answer I was surprised to hear that there are "excellent" kinds of coaxial cable with a propagation speed of 0.9c; 90% the speed of light.
The bargain basement number is about 2/3c, and coaxial cable with a faster propagation velocity would have to have a lower dielectric constant. Assuming \$v/c\$ scales as \$1/\sqrt{\mu_r \epsilon_r}\$ as it would in free space, that would mean the cable would have a relative dielectric constant of 1.2 for example.
Does this exist as a standard product? If so, are there applications where having "excellent cable" with such a high propagation velocity would be important? Or would it be a side-effect of other desirable properties of the dielectric?
AI: Air lines still exist, with velocity factor very close to 1.0. These are AFAIK mainly used in old-fashioned VSWR measurements. The advantages are that the dielectric constant of air is fairly stable and well-known, and that you can insert a probe (a tiny antenna) into the middle of the transmission line without damaging the dielectric.
ePTFE (aka "Teflon foam") dielectric typically gives a velocity factor of about 0.85. These cables are, in my experience, used because they maintain low loss to fairly high frequencies and their phase delay is quite stable under variations of temperature and flexure, not specifically because of the high phase velocity. I've used them in test and measurement applications, and I imagine they're also used in things like radar and avionics.
I found a reference saying that "foam polystyrene" dielectric gives a velocity factor of 0.91, but I have no experience with such cables, and I don't know what applications they're favored in. In fact I couldn't (with 2 minutes googling) find any vendor actually selling them. |
H: How to view and customize beta of a transistor in LTspice
If I need to set beta to a custom value, is it possible to make a customized transistor with a beta of my choice? In other words, can I edit a ready or generic transistor's beta and save it as a custom transistor? How can I do that?
AI: The other answers are OK, but there is a much easier way to do what you want, and it is not documented in the official guide.
It is the AKO "mode" (AKO stands for "A Kind Of") of the .MODEL directive.
If you define a model like this:
.MODEL MyModelName AKO: 2N2222
MyModelName will represent an NPN exactly equal to the 2N2222. For example:
.MODEL PN2222 AKO: 2N2222
You can also vary some parameters from the "base" component:
.MODEL MyBJT AKO: 2N2222 (Bf=400)
makes MyBJT a 2N2222 with a gain of 400.
Here is an hastily conceived simulation that shows what I told you:
As you can see, I just changed the value of Bf for the "AKO model" and this reflected on the output characteristics as you would expect from that change.
This trick (AKO aliases) can be found in the undocumented LTSpice page of the LTwiki. |
H: Motion-detection alarm - how to make alarm persist?
This is a basic question. I have a motion-detector, but when it detects motion I don't think the output voltage persists. So it can trigger my transistor to trigger a buzzer I have, but after the motion passes all the voltages would die back down and the buzzer wouldn't ring anymore. I want, when the motion trigger happens, for the voltage across the buzzer to persist so that the buzzer keeps ringing until someone manually comes over and turns it off.
How can I make it so that when the trigger happens, the voltages persist?
Either forever or a really long time (several minutes). Is there a component that would allow this to happen? Would like to avoid using a microcontroller for something this simple. Thanks!
AI: You need a latch circuit.
Figure 1. A two-transistor latch circuit. Source: Learning About Electronics.
How it works:
On power-up both transistors are off.
When a positive pulse arrives on the input current flows into the base of the lower transistor - let's call that Q1.
Q1 turns on shorting C to E.
Current is now drawn from the base of Q2 (which is PNP type) so it turns on too.
Current now flows through Q2 lighting the LED.
Current also flows back to Q1's base through the 1k resistor. Now if the original input signal is removed Q2 keeps Q1 on which keeps Q2 on which keeps Q1 on ...
To reset the circuit you just need a normally closed push-button on the positive supply or in the 1k branch. |
H: Transimpedance amplifier circuit for water conductivity
I'm trying to understand the application of the water electrical conductivity measurement circuits based on transimpedance amplifier.
Here the picture of general TIA configuration
And here what I'm talking about
In the second picture, the op-amp is feeded with dual supply.
Two metal and equal pins are dipped in the water and connected to the battery as shown.
Will the current be flow in correct way like figure 1 to accomplish TIA?
p.s. Just to be simple I used a battery as current source, this question is not about the perfect water electrical conductivity activation signal.
AI: Assuming that:
You connect the ground as shown below.
You use a dual supply.
Then, thanks to the the negative feedback, the inverting input will be at a virtual ground. Therefore the voltage applied to the "water" will be the same value as the battery.
What you will measure is:
$$V_{OUT}=-R_1 \cdot I$$
Where \$I\$ is the current flowing out of the battery, as indicated.
As suggested in the comments, do not use a DC voltage, use AC instead. You can either:
put an AC voltage in place of the battery
OR you can remove the battery (replace it with a direct connection to ground) and put an AC signal to the non inverting input (instead of ground). The negative feedback will have the inverting input to assume the same (AC) voltage as the non inverting one. |
H: Do LEDs require more power to function as they age?
I have a strange issue with the LED backlights of the LCD monitor i'm using. I have had it for about 5 years and up until this time have run it at only 10% brightness to reduce eye strain. However recently I have had an issue where some of the LEDs that make up the backlight will switch off leading to dark areas of the screen.
The problem is getting progressively worse. I bumped the brightness to 25% when I first had the issue a year ago and that caused the problem to go away, more recently I have bumped it up to 50% when it reoccurred but today it did it again and I now have to run it at 75% brightness which is starting to cause eye strain.
Is this an issue with the LED requiring more power to run as the semiconductors wear? does running LEDs at low power for years on end do extra damage? Or could it be another problem that I could fix?
AI: The problem you are seeing is related to the construction of LED backlight circuits which require lots of LEDs. Often on poorly designed or "cheapo" designs there are LEDs or series strings of LEDs that are connected in parallel. See the typical diagram below for reference:
The problem comes into play here when the forward voltage drops of each string of LEDs are not the same. The string with the lowest forward voltage takes most of the current and is thus the brightest. In the worst case one string has a forward drop so much higher that it will not even light.
In your case what you are most likely seeing is that as the monitor has aged the forward voltage drop of some strings has either dropped or increased. Your having to increase the brightness level has to do with increasing the net drive to the parallel strings so that even those with the higher voltage drop are still able to light enough so you can see them.
A much better design for a backlight LED array will use a separate current source or sink for each of the series string. The schematic below shows an example. This of course adds cost and a monitor manufacturer in a competitive market may choose the simpler circuit at the loss of overall quality.
This forward voltage drop phenomenon can be seen in the cheapest LED flashlights where they try to use many extremely cheap LEDs in place of a much brighter single LED. An example flashlight, as seen below, will show some LEDs start to flicker or simply stop lighting at all as the battery voltage reduces as it discharges. When LED flashlights first appeared most were built this way but as the technology has improved most devices you find today will be using the single LED. |
H: Is there a way to save state in a very low power way?
I basically want to determine if power has been totally disconnected in a low power device I am making that uses an Atmega328 chip.
The theory is that when power gets first applied the ATmega will power up, calibrate and take some readings then power down again. The rest of the circuit will still be powered until the chip wakes up again and takes more readings.
What I need to be able to determine is if the battery was disconnected or not. If it was, I need to do a calibration again; if it wasn't, then I just take a reading as normal.
Is there any way of doing this which takes as little power as possible?
AI: System power is disconnected and then reapplied, the ATmega will start from the reset vector, as usual (due to the power-on reset).
So you can perform your inizialization routines in the very first part of your main() function.
When you finished doing your periodic measurements, do not remove power to the ATmega. Instead, put it in power-down or power-save mode through the sleep instruction.
This will draw less than \$1 \mu A\$ @25°C. When the wakeup interrupt occurs (e.g. timer expiration, external pin etc.), the interrupt will be executed and the program will restart from the instruction that follows sleep. In this way you can avoid any external hardware. |
H: I got two different results for the current in one branch, what is wrong with my KVL equations?
The two circuits are equivalent.
Using Kirchoff Voltage Law.(KVL)
For Loop1, I have: $$12+3000i_1+2000(i_1+1)=0$$.
For Loop2, I have: $$5000i_2+2000(i_2-1)=0$$.
Now, there are two ways to find the current in the middle branch,i3. i3=i1+1=i2-1. But the i3 I got using these two ways are not equal. i1=-0.4024A, and i2=0.286A.(Calculated from the above two equations).
AI: I think you've struggled long enough on this. Let's follow your own guidance, but we need to make a small modification in order to make it work out.
But first a note:
You should use the included schematic editor. A picture of pencil drawings is nice, but the editor makes it absolutely clear for anyone to read and it also makes it easy to number things on the schematic (it does it for you.) I'd have appreciated the addition, anyway. I mention this because you might want to consider the time of those from whom you ask for help. (I will draw it up using the schematic editor, consuming time you should have spent instead of me.)
simulate this circuit – Schematic created using CircuitLab
I've also taken the time to also note the two unknown node voltages on the schematic: \$V_X\$ and \$V_Y\$. There is a reason for this, which will become a little clearer as I develop the equations. I've also labeled your current source as \$I_3\$, just for clarity's sake (because of \$I_1\$ and \$I_2\$, which are your two branch currents.)
So what are the equations from this??
$$\begin{align*}
0\:\textrm{V} + 12\:\textrm{V} + I_1\cdot R_1 +\left(I_1-I_2\right)\cdot R_2-V_Y&=0\:\textrm{V}\label{loop1}\tag{Loop $I_1$}\\\\
0\:\textrm{V} +V_Y+\left(I_2-I_1\right)\cdot R_2 + I_2\cdot R_3 &=0\:\textrm{V}\label{loop2}\tag{Loop $I_2$}\\\\
\left(I_3=\right)I_1-I_2&=1\:\textrm{A}\label{given}\tag{Given}
\end{align*}$$
That's three equations and three unknowns. (Note that \$V_X\$ isn't really necessary here, since you are doing this via a branch current method.)
What did I do differently? Well, you have no given information at all about the voltage across the current source. It will have to "adjust itself" to generate whatever voltage is necessary in order to force the rest of the circuit to comply with its current source requirement. So the voltage across it is a "compliance voltage" that is needed here. We don't know what it is and because we don't, we can't actually calculate a sum of voltages around the loop without noticing this fact.
(The voltage across the current source might be \$0\:\textrm{V}\$ or it might be something else, entirely. We just don't know. So it must become a variable.)
Calling out \$V_Y\$ does allows us to now produce the equations for \$\ref{loop1}\$ and \$\ref{loop2}\$, finally. We also know \$\ref{given}\$, by definition.
If you solve those simultaneously for \$V_Y\$, \$I_1\$, and \$I_2\$, you will have your answers. Mostly, I just wanted to point out the mistake you made in writing things up in the first place.
There are other approaches towards simplifying things. (For example, \$R_2\$ could be removed because it does not affect \$V_X\$. It only affects \$V_Y\$. Removing \$R_2\$ would cause \$V_Y=V_X\$, but it would not affect \$V_X\$.) But it's not necessary as the above shows you. You can use the method you've been taught to use without using shortcuts to get there.
In short, yes you can use KVL in the presence of current sources. |
H: Is connecting a grounding rod to the positive side of a battery wrong?
I have a 12 V battery being charged by a wind generator. The installation instructions show the grounding rod on the negative side. I have been having power issues with the batteries draining to quickly. When trying to troubleshoot the issue, I have found that the grounding rod is connected to the positive terminal. Could this be causing a problem?
AI: Yes, it could absolutely be causing a problem assuming the negative side of the generator has a path to ground also, which is possible. Your battery could be draining through the earth connection back to the grounded negative side of the generator. |
H: Incomprehensible high level interrupt behaviour
I am a newbie and trying understand how high level interrupts are handled by a microcontroller. I am using a LPC1347 with Cortex M3 CPU. I understand how edge interrupts works but level interrupts has unexpected behaviours.
Until now I thought that a level interrupt is a notification that a device needs attention. As long as IRQ line is asserted we get an interrupt.
LPC1347 has different behaviours. Firstly I have to clear IRQ status which toggles the level type. For example if I set interrupt to high level and change the state of pin to high I get first interrupt, then I clear interrupt status and the interrupt type automatically toggles to the low so the next interrupt occurs when the state of pin toggles to the low. As a result I always have two interrupts; when the state of pin toggles from 0 to 1 and from 1 to 0.
Is this only a different concept of level interrupt handling or do I not understand it correctly?
AI: You always have the possibility in the first interrupt routine to not reenable interrupts till you exit the service procedure. Then when you change the interrupt condition (within the service routine) clear out the pending interrupt status that pops up. |
H: What do they mean by "short-circuited" here?
"Short-circuit inductance is the inductance when one of the primary winding or the secondary winding of the transformer is short-circuited and measured from the other winding."
I can't understand the part of the sentence in italic. What do they mean by "short-circuited" in this context? Even the image given in the Wiki page doesn't make much sense.
As far as I know, if an inductor is short-circuited it means there is connecting wire across it (i.e. the potential at both ends of inductor is same)
Source: https://en.wikipedia.org/wiki/Short-circuit_inductance
AI: Just in case you do not read and speak our ordinary Mathjargonish well, I give more visual explanation:
The wire at the right is the short circuit. The short circuit inductance is what the inductance meter shows.
This test gives some numerical data of how far the transformer is from an ideal one. In ideal transformer the short circuit inductance is =0. In practice it's greater. To actually get some useful info, the wire at the right should be removed and also check, how much the inductance is without the short circuit. Ideally it should be infinite.
ADDENDUM due the comment:
The derivation of the formula for the short circuit inductance unfortunately needs the phasors or differential equations. Here the formula is derived in the simplest case (=no losses taken into the account):
The short circuit inductance has taken the place of the inductance in inductor's general equation between voltage and current.
Without the short circuit in secondary one can measure L1. Measuring the short circuit inductance is a way to get the k. |
H: How can find the voltages at 2 nodes with 1 equations and 2 variables?
simulate this circuit – Schematic created using CircuitLab
At node 1, we have:$$0.001+i_1-i_4-i_5=0$$.
At node 2, we have: $$i_4+i_5+i_2=0$$.
$$i_1=\frac{0-V_1}{1000}=\frac{-V_x}{1000}$$(Vx is the voltage across R2)
$$i_2=\frac{0-V_2}{6000}$$
$$i_3=0.001A$$
$$i_4=i_1+i_3=-i_2-i_5$$
$$i_5=\frac{V_1-V_2}{1000}=\frac{V_x}{1000}$$
Use the equation at node 1, to find an expression for i4 and plug that into the equation at node 2: $$i_1+0.001+i_2=0$$
$$\frac{-V_x}{1000}+0.001-\frac{V_2}{6000}=0$$
But there are V2 and Vx to solve in one equation.
AI: You have too much variables and arrows (not wrong, but unnecessary). I redrawed the circuit:
You obviously missed that the voltage over R4 can be expressed in terms of Vx. This is Kirchoffs voltage law.
I have written the current equations for nodes 1 and 2. There are 2 unknowns and 2 equations.
Hopefully clear now. |
H: Controlling a circuit through a cat5 cable
What I am trying to do is to digitally send a signal through a cat5 cable. I wan't to send it digitally so people can't just come along and put a voltage on the wires to activate the circuit. I would like the signal to come from the main control board. Thanks.
AI: Depending on your skills, budget and time schedule, then anything we suggest might be too complicated, expensive or time consuming etc. for you to use in your design. However I'll mention one technology which fits your stated desire to "send some bytes" through the cable, to operate the lamp attached to the "Main Box".
You could use the Holtek HT12E (encoder) and HT12D (decoder) to send a coded data stream along the CAT 5 cable. Obviously you would use a matching address selection (effectively that is your code) on both the encoder and the decoder.
Often the HT12E and HT12D are used for wireless links e.g. IR or wireless via OOK modulation modules. However, the "data out" pin of the HT12E encoder can be directly connected to the "data in" pin of the HT12D decoder.
The encoder would be in your "Portable Box", and the switch which you showed would need to also be either fitted to, or at least connected to, that box in order to trigger the encoder to send its coded data stream. A power source would either be in the "Portable Box" or power could be sent to the "Portable Box", along dedicated wires in the CAT 5 cable, from the "Main Box".
In the "Main Box" would be the decoder and, depending on the type of lamp, the exact behaviour desired (e.g. if the light should stay on only when the switch is operated, or whether it should "latch on" for some period etc.) and the power source you provide, then some ancillary components may be needed between the decoder and the lamp.
As a minimum, even if your "Portable Box" contained its own power source for the HT12E encoder, there would need to be two wires used in the CAT 5 cable - the "data wire" linking the encoder and the decoder, and a shared Gnd reference between the two boxes. If the power for the "Portable Box" was coming from the "Main Box", then another wire in the CAT 5 cable would need to be dedicated to that.
Depending on the length of the wire and therefore its capacitance, you would likely want to choose a slow oscillator frequency for both the encoder & decoder, as the data waveform will be distorted by the effects of the cable capacitance.
It might become necessary to add a differential driver (at the encoder) and receiver (at the decoder) - e.g. RS-422 or RS-485 - to increase the reliability of the data reception.
If someone can open either box, or can attach an oscilloscope or logic analyser to the cable, then the code can be discovered & defeated. However within the limit of "not expensive" then this approach is something to consider.
(There might be other encoder/decoder device pairs which are also suitable - I suggested that pair as they are well-known & have public datasheets.) |
H: Pair of single test lead wires to solder type barrel plug: how do I strain relief the connection?
My plans for power supply test leads have me wanting to have at least one set of leads that has 2x bananas on one end and a barrel plug on the other to allow me to plug in prototype PCBs without having to fuss around with finding the right wall wart and plugging it in instead. I'm debating between individual test lead wires (silicone insulated) and parallel-lead low-voltage "zip cord" of the type used for the outputs of wall-wart type DC supplies for the wiring material for these leads, but that's a bit out of scope for this question, as I have a more specific problem with the single-wires approach.
In particular, I am wanting to use this barrel plug:
in conjunction with a pair of these test lead wires in appropriate colors:
Terminating the actual wires is simple: the Switchcraft 767 plug has holes in the contacts that I can put the wires through then solder. However, how can I strain-relieve this connector to the pair of wires exiting it? Is the included boot useful for this purpose, or should I ditch it and go with a different strain relief approach?
AI: The spikes in the connector are intended to be crimped overtop of the cable insulation to strain relieve the connector. The holes are to accept the wire and solder.
The boot is not useful for strain relief as is, but it will prevent sharp bends that can cause the cable to fail.
This kind of DIY connector cannot be compared to a molded connector in terms of strain relief. You could get some of the benefit by filling the boot with hot glue before assembly but it might take a couple tries to get it right, and it cannot be fixed most likely if it breaks. |
H: STM32F4 Shorting Out
I had some trouble with home assembly of some PCBAs. I've got an STM32F411xC (datasheet here).
Anyway, After reworking it a bit, and some issues elsewhere on the board were uncovered (all related to oversights with soldering technique), the first board was toast...Missing pads and so on..
So, I moved to the next clean board, and started fresh...One component at a time, and testing along the way for continuity, resistance, etc.
The first and most technically troublesome part to put down was the STM32F4 in a 64 pin LQFP, so I dropped that thing down and took a reading across the 3.3V rail and GND, and everything looked good...wide open.
So, imagine this...I only have the STM32F4 on the board, that's it...I put 3.3V on the board from an external supply, and it shorts out, 350mA before the current control kicks in. Now, I've got 26kohm between 3.3V and GND after removing power...
So, after a day of double checking pinout, orientation of the chip (found here), the thing I tried was pulling up the VCAP1 pin and leaving it floating...So, I read a little about it and see that VCAP1 is pretty serious when it says to hang 2x2.2uF or 4.7uF off of it, so I do that...
I get a new IC, desolder the old one, put it down, measure resistance between power and ground, make sure all the pins are really connected to the board well, ring out all the VDD's and VSS's AND slap down two 2.2uF caps on VCAP1.
I turn it on, and still, short circuit.
What the heck is going on here? This circuit is so simple, it's two components...The STM32F411 and a pair or 2.2uF caps...
I'm tellin' ya...You hook this circuit up, it'll short right out and get real hot, real quick. What is the GOTCHA here that I'm missing?
AI: The minimum circuitry for an STM32F4 includes:
- NRST pull-up.
- BOOT0 pull-down.
- Decoupling capacitor for each power pair.
- Vcap.
- Vbat.
Also. Why is Vcap connected to Vbat and Vref? You're shorting the internal regulator?
You have seen this image, right? |
H: Question on flip-flops
I came across a question which says the following,i don't understand the question and how to come up with a solution
In fig,the data word to be stored is S=1001
a)If LOAD is LOW,what does Q equal after the positive clock edge?
a)If LOAD is HIGH,what does Q equal after the positive clock edge?
It'd be really helpful if someone explains the solution,I got the basic knowledge about flip-flops
AI: The LOAD signal here functions as a Synchronous Active-Low Reset. As long as LOAD is 0, the flops will get loaded with 0 on clock's positive edges. When LOAD is high, whatever value that's present on {S3 S2 S1 S0} will get loaded into the flops on positive clock edges. |
H: 2-input CMOS NOR gate circuit operation
Someone please explain to me how the circuit below operates as NOR gate. I have created a truth table next the diagram based on my understanding of basic MOSFET switching. For the output to be equal to Vdd, transistors Q1 and Q2 should be conducting while Q3 and Q4 must be non-conducting. It appears to me that the output can never be HIGH.
IN A | IN B | Q1 | Q2 | Q3 | Q4 | OUT
---0-----0----ON--ON--OFF--ON-----0
---0-----1----ON--OFF-OFF--OFF----0 (floating?)
---1-----0----OFF-ON--ON---ON-----0
---1-----1----OFF-OFF-ON---OFF----0
AI: Pay attention to the transistor polarities, and draw them correctly. It looks like Q1 and Q2 should be P channel, and Q3 and Q4 N channel. You've got them drawn every which way, and even inconsistent with themselves.
Details matter in engineering. Once you correctly show the transistor polarities, the operation of the circuit should become obvious. |
H: Vibration motors burning out under PWM control
I have 16 dc vibration motors bought from Ali, rated at 0.1A, Vdc 3-9v.
In fact they consumed 0.15-0.18A from 9V. Starting resistance varied from 20 to 30 ohms.
I connected all 16 motors to PCA9685 16-channel pwm controller that runs at 1.6 kHz. I have 8 identical pcb boards as shown below, each pcb is connected to its pair of motors. The power source V1 is supplying all boards and is capable of 11A / 9V.
The diode and capacitor is near the motor. Each motor is connected by two copper multi-strand non-shielded wires, 1.6 mm sq diameter, 16 ft. length.
During testing I had been having blown fuses and motors with degraded resistance (almost short circuited). Not all of them, not in one time. I haven't observed any spikes on power source terminals.
Some motors heated more than the others. I've got two motors at 60°C but quickly disarmed them. Others were not more than 10°C above ambient temperature.
As a safety measure I programmed soft pwm transition, lowered maximum duty cycle, lowered the power source voltage to 8V. So far looks like it helped.
The actual questions are:
What else can I do? I have a low budget so I cannot implement current sensing. Do you think linear voltage regulators could help to protect the motors?
From your experience, can you say that the motors were doomed to burn in my setup or not?
simulate this circuit – Schematic created using CircuitLab
AI: Start at 0 and slowly increase the voltage on a motor you haven't yet burned up. Find the voltage at which it starts rotating. Then consider maybe 1.5x of that the limit.
It is very unlikely that one of those little vibrating motors can actually take 9 V indefinitely without frying. |
H: MOSFET trio/quartet viable option?
I need to supply 10-15A at variable voltage without anything getting too hot. Is it good practice to use several MOSFETs to handle larger currents?
I am currently using an IRF9630 P-FET with an Rds_ON of 0.5-0.8 ohms, but will likely use something better for my finished device.
I am aware that FETs aren’t 100% identical, but I’ll check to make sure they output the same voltage down to two decimal points. A quartet handling 15A would each have a W_dissipate of 3, assuming a terrible Rds_ON of 0.8 ohms.
Cluebats?
Edit: Olin has schooled me, but I need more schooling. My FET absolutely must not fail closed, or some things will be destroyed. How do you guys protect hardware from this kind of malady?
Cluebats... my skull is thick.
AI: FETs have a positive temperature coefficient of resistance, so can be paralleled. However, that just means one FET won't run away, take most of the current, and blow up. It doesn't mean they will share the current equally. There are some options:
Use a single FET and PWM. Depending on the load, you may need a LC filter to smooth the pulses.
Another way to look at this is to use a switching power supply to make the desired voltage. You'd be controlling the reference voltage input to the switcher.
Use BJTs with individual emitter resistors instead of FETs. BJTs have a negative temperature coefficient of their saturation voltage, so can't be paralleled directly. You get around this by giving each BJT its own emitter resistor. If you're going to add a resistor and operate them out of saturation, BJTs are probably easier to use in this case due to the relatively tight range of B-E voltage. The G-S voltage of FETs will vary more. |
H: Multiple buttons connected to reset pin
I'm building a battery powered device based on ESP8266. There are few buttons (lets say 4 at the moment). After pushing any of them ESP should perform some action and go to deep sleep mode. Next press of any of these buttons should wake ESP up so it can perform another action and go to deep sleep mode again.
So what I need is to put RST line to low for a while (about 100us) on any button press but keep proper GPIO low as long as button is pressed.
I came with the following idea:
simulate this circuit – Schematic created using CircuitLab
Unfortunately it doesn't work very well. There are two issues: one is that it's not reliable - for unknown reason voltage on RST drops low enough only when I press SW1, it used to work for other switches too but it stopped after some time (oscilloscope shows that it drops to about 2.0V). The other issue is that there is a voltage spike on RST line when I release the button - it goes to about 6.6V because capacitor is discharging. Maybe these spikes damaged other (electrolytic) capacitors because I tested my software mostly using SW1?
Do you have a better idea how to reset ESP with multiple buttons and still be able to detect which one it was? I'd like to avoid anything which draws power when not used or would take much PCB space (it's very limited).
AI: Try wiring up your switch circuit as shown below. This is not the ideal circuit since the low level time of RST is similar to your original circuit but may be good enough for your application. A better circuit would introduce a low pin count comparator to give a full logic level pulse to the RST pin.
Use BAT54A diodes in SOT-23 package to reduce package count (2 diodes per package). Select the resistor sizes and capacitor value to provide suitable timing. This circuit should be substantially smaller than all the 100uF capacitors you have now. Also add the diode shown in the upper right to clamp any push up voltage to a Schottky diode drop above the 3.3V rail.
The better type of circuit would follow a design more like shown below. This will give a nice clean RST pulse at the time the switch is pressed. Add additional switches in same manner as shown above.
Note that this does not give any consideration of switch bounce. If you have switch bounce and do not want to have repeated fast reset pulses to the MCU then additional design work is required. |
H: AC RMS current measurements with oscilloscope
I am going to measure the AC current(three phases), with a current probe, of a large machine, with an oscilloscope. The scope I am using has the following two options:
RMS: RMS (Root Mean Square) value of the
voltage of the complete displayed waveform.
AC: RMS value of the AC part of a periodic
signal, calculated over all periods on the
display. The AC result is is derived from
the DC and AC+DC results.
Can someone tell me the differences of the two measuring types?
AI: The difference of the two measuring types is as described. One takes into account the DC component as well as the AC component. The second only takes the RMS of the AC component. In most cases, only the AC component is of significance. In a large AC machine, the DC component should be small and can be ignored. Your current probe probably can only respond to AC signals anyway. |
H: Soldering question
Yesterday I soldered quite some things, but I'm still a beginner.
I noticed that sometimes it happened that sometimes I use to much solder. When trying to remove it, I heat the pin with solder so it melts, and when pulling back to clean the tip to remove the excessive solder, I notice that the remaining solder on the pin just after I remove the solder tip 'grows' and leaves some kind of circle/ball-form, as if there is some air inside it. I don't think this is very good (also the result looks like a ball.
I think this is because the flux is gone after the first try.
I tried solder wick but don't get very good results with it. Would adding flux with a flux pin help? (I ordered it, but haven't received it yet).
Of course the 'real' solution is to not use too much solder (I use already 0.5). But maybe there are better tips how to 'fix' pins with too much solder.
My soldering iron: Soldering iron
My solder: solder; size: 0.5 mm
AI: As others have said, practice makes perfect. There are lots of videos on the web but unfortunately they don't all offer great advice. This series is great, John Gammell is a master. It would help if you told us what kind of iron/station you have and which lead alloy you are using.
You can do a lot of research (here's a good summary). Keep in mind that soldering is as much an art form as it is a science. People will argue up and down on which solder and flux to use like their lives depended on it. Ultimately, everyone develops their skills and finds their own preferences.
However, you can't go wrong with a Sn63/Pb37 solder with No Clean (NC) flux at a diameter of 0.020". Look for Kester, AIM or MG Chemicals for their solder line up. Order whatever is most convenient. Just stick with name brands and don't use cheap stuff ordered from the bargain bin in China.
Here are some things to consider:
Make sure your iron is powerful enough for the type of soldering you do. Large point-to-point soldering has different requirements for SMD or small TH. Ideally you have a temperature controlled station.
Make sure you have an appropriately sized and shaped tip for the work you are doing.
Make sure your tip is properly cleaned and not oxidized. Smother it in solder and then clean it in an wire-mesh waterless cleaner like this one
Make sure you apply flux generously. Flux is your friend :>).
If you have a station, set the temperature to ~360C. If you are dealing with large ground planes, you will either need a larger tip or a slightly higher temperature. Consider preheating the board first. |
H: Battery balancing circuit
I am facing the following problem. I need to power my device (RC airplane) with 2 separate battery packs 12 V each in order to extend the capacity. Connecting them in series will not work, as the power stage is not prepared for that. When I connect 2 battery packs in parallel, and there is a difference in their voltage, they will charge each other, thus a large current will flow making them explode even. I thought of a simple fix for that, it is visible in the below schematics:
simulate this circuit – Schematic created using CircuitLab
With those 2 diodes I loose some power as voltage drop, but there is no current flowing between the batteries.
What If I wanted to add a "voltage" balancing circuit in between them? Lets say if one battery is voltage is only 9 V, because its discharged a little bit, then the 12 V should charge it with set by me current, ie 2 A max. One could design a circuit for that but it would take some time and its not worth for this application I believe. Instead, I wonder either there are such IC's readily available? Bidirectional chargers of some sort? Could not find anything my self, but maybe I dont know how to name them?
I would appreciate all help regarding this problem.
AI: You are much better off making ideal diodes using MOSFETs
Replaces a Power Schottky Diode
Internal 20mΩ N-Channel MOSFET
0.5μs Turn-Off Time Limits Peak Fault Current
Operating Voltage Range: 9V to 26.5V
Smooth Switchover without Oscillation
No Reverse DC Current
But the simplest solution is a better Schottky Diode Array $6 with a heatsink
These are common cathode. |
H: Inverse formula for parallel resistance
I'm currently trying to get a 200kΩ resistance from scrapped materials or new ones but there's a limited range. (There isn't a good supply of components in my city and we can't spare too much time at the moment)
Is there any inverse formula to get the combinations of resistors where their final resistance value is N ?
We don't want a lot of resistors in series but if we lack a solution we will go after that.
AI: Easiest way to catalog and do this quickly is to stop using resistance values and use conductance instead.
Mark the resistors you have with their conductance value and then add those to get whatever conductance value you want.
e.g. 200k = 5uS (S = seimens not seconds)
=> 1Meg = 1uS , and 250k = 4uS
=> 1M||250k = 200k
People seem to forget that the traditional parallel resistor equation does exactly the above.
That is; convert each value to a conductance (\$G = 1/R\$), add them together, then convert them back (\$R=1/\Sigma G\$). |
H: Can I approximate an "intelligent charger" just by charging one battery at a time?
There seem to be two main classes of domestic battery chargers - "intelligent" chargers which charge batteries individually, until some measurement(s) of the batteries determine that charging should cease, and dumb chargers which charge all batteries at the same rate.
These terms are marketing-speak and have no real formal definition. However, is it possible to approximate the functionality of an intelligent charger, simply by charging one battery at a time?
I am mostly interested in domestic batteries with NiMH chemistry.
AI: It depends on the charger(s). There is no official or technical definition of "dumb" and "intelligent" when it comes to chargers. It's mostly marketing speak. One man's "intelligent" can be another man's "dumb".
In a technical context those terms are nearly meaningless, especially when they stand without any context whatsoever.
In order to have a meaningful technical discussion about chargers, we first need to know what battery chemistry we're discussing, and then, we need to discuss specific features and categories of features, related to charging that particular type of battery.
Some more or less random examples of terms that would be more conductive to a meaningful discussion:
constant current mode, or current limiting
constant voltage mode
float charge, or trickle charge
cut-off voltage, or temperature cut-off, or (in the case of NiMH and the like) voltage drop cut-off, etc.
different forms of battery diagnostics, detection etc.
cell balancing (in the case of multiple cells being charged in series) |
H: Why don't three-phase transformers use toroidal cores?
When looking at different transformer core designs, three phased, I never see any core designed as a circle or torus.
Why is that so? Will it not work as well as the common B-shaped core?
AI: Three coils, in magnetic series as you've drawn them, will not make a 3 phase transformer. There would be only one value for flux which would be common for all three coils, as each coil surrounds the entire core cross section.
In a real three phase transformer, each coil surrounds only part of the core, so that each coil can operate at a different flux.
A three-leg three phase transformer makes a saving in iron over three single phase transformers by sharing some or all of the iron return path. |
H: Series MOSFET switch
I am trying to construct a simple MOSFET switch to control the input line of a linear regulator, but I am quite baffled as to how this works from the simulation I have done. The pulse input simulates a microcontroller drive, and I've simulated the input impedance of the regulator with a big resistor.
I was expecting the output to go to close to 0V when the drive pulse is high.
The images show my test circuit and the gate and output voltage waveforms, can anyone shed any light on what basic error or misunderstanding I have made in my circuit or simulation?
AI: Googling "pmos high side switch" results in tons of wrong schematics, as they mostly come from questions on SE asked by people why have the same problem ;)
Here's a good one:
With VCC as the input voltage, you want the PMOS gate to be:
At VCC to turn it off
At VCC minus say 10-12V to turn it fully on, but never below VCC-20V as that would exceed the max Vgs and kill the MOSFET.
The NPN transistor works in saturation and pulls a current through R1 and R2. This sets the PMOS gate to the voltage you want. Adjust the R1/R2 divider to get the right voltage. The zener D1 is not really necessary, as the voltage divider will do the job of limiting Vgs... |
H: Dirty electricity
In the book "Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future" by Ashlee Vance it is mentioned that at Elon's house there was a problem with "dirty electricity" that was causing devices to overheat.
I've experienced this in a variety of places with my own devices.
In one case, while traveling abroad, my devices would not work at one of my host's house it was so bad. In fact, his top of the line U.S. blender he had just purchased burnt out within 2 weeks. I didn't have this problem at all with my other host's house in the same country, so I know it's not simply a voltage conversion issue.
What exactly is "dirty electricity", what causes it and is there a simple way to prevent it from doing damage to your electronics while traveling or at home?
AI: First, if you're travelling, take care to look at your electrical devices' specs. Electrical standards change the voltage and frequency of the mains. Just because it isn't a "voltage" issue, doesn't mean your blender won't burn up. The wrong frequency can burn out motors.
The main is supposed to supply a sinusoidal of a certain frequency, amplitude, and power factor, \$A*sin(\omega t + \phi)\$. Anything that deviates from this is a flaw.
Things can cause this to deviate from this ideal. Large motors can (strongly) affect \$\phi\$ (therefore changing the power factor) and introduce noise. Non-linear loads can cause harmonics.
Power factor will cause the resistive elements, like the wiring, to heat up (through \$I^{2}R\$) without contributing to work.
As to the blender: harmonics, if not filtered by the device, can burn out electrical motors. |
H: Is it posible to use AM/FM antenna as GPS antenna?
Having installed a tablet (Nexus 7) in the car dashboard, the GPS receiving signal seems to be too weak (specially in places with lots of buildings/trees around). So I thought about opening the tablet and connect the built-in GPS antenna contact points in the SoC with the car built-in antenna.
However the GPS and AM/FM signal frequencies are different, so I guess the car antenna would be designed just for radio signals, making it not work with GPS.
In addition, the car antenna is located in the very top of the vehicle, so over 1 meter wire would be necessary to make a connection with the tablet, which makes me suppose I would need some kind of amplifier due to power loss in the wire
So, I wonder if that is possible and, if it would be effective
AI: Yes it would work.
No it would not work effectively.
There are antennas designed for GPS applications. Or you could get a USB or Bluetooth GPS module and connect that to your tablet. |
H: Will the fuse blow for long time use?
I have a small pump rating at 96 Watt, and the input is 12V DC, max current 8A. The product also comes with a 250V 8A glass fuse. Because the pump is 8A and the fuse is also 8A, does that mean the device will draw 8A current flowing through fuse when working on full loading. Will the fuse be always hot and can easily blow when the device is continuously working for a long time?
AI: Like all electronic components, fuse:
they must be derated.
have their own lifetime (especially as a function of the overstress - transients).
For instance, littlefuse recommends a 25% derating:
NORMAL OPERATING CURRENT: The current rating of a fuse is typically derated 25% for operation at 25ºC to avoid nuisance
blowing. For example, a fuse with a current rating of 10A is not
usually recommended for operation at more than 7.5A in a 25ºC
ambient. For additional details, see RERATING in the previous section
and AMBIENT TEMPERATURE below.
Operating temperature is also an important factor. The higher the ambient temperature, the hotter the fuse will be, the sooner it will melt.
Repeated surge also will determine the fuse lifetime, as reported in this article (J. McLinn, "The Simple Fuse", IEEE Reliability Society 2008 Annual Technology Report.).
The higher the current spike, the smaller the number of surges the fuse will withstand.
This is the case of your pump: despite it's rated at 8A continuous load, it will probably have a larger inrush current.
By the way, remember that if the current of your load has large high-frequency components, the equivalent fuse series resistance will be larger, due to skin effect (i.e. it will likely blow earlier at the same RMS component). This might not be your case though. (It's rather a problem if you PWM a load, like an heater). |
H: Providing power to MCU
I have an ESP32 that I want to power from an external source. It's a dev board and have an USB input for programming and 5V, but moving past my prototype, I want to ditch the USB (I have a separate power supply board that will power two MCUs)
The Arduino boards have a vIN pin for this purpose. My setup works if I connect the 5V output from the Power supply board to the 5V pins of my ESP32 and to the vIN of the Arduino board.
Im just curios if this is "safe" or the right way to to it. Ive always thought of the 5V pin as 5V "out", not "in".
AI: Applying 5 V directly to Arduino 5 V line
Yes, it is usually "safe" in that it should not break anything.
The 5 V is neither an input nor an output. It is a supply and that 5 V needs to be provided by something. Normally that's the 5 V from USB. It can also be the output of a 5 V regulator which gets its power from an external 7 - 12 V supply (Vraw).
But since you simply replaced the 5 V line from USB with a different 5 V line, there is no real issue. |
H: Relay replacement for my UPS - compatibility confirmation
I've got a UPS that stopped working and found out the relays(Bestar) got busted. I would like to confirm this replacement relay(Songle) I've found online if it is going to work. I'm open to any comments or suggestions. By the way the UPS uses three relays.
AI: The original says 12A for 120VAC while your replacement says 10A at 125VAC. That's a reduction in capability, which means it's not a straight drop in.
To see if the relay is used to switch 120VAC you will need to trace the circuit and see what it switches. If it switches DC then the switching part will be fine. If it only switches less than 10A it will also be fine.
Another part to worry about is the coil current. If the current needed to hold the relay closed is higher then other components will get stressed.
It is also possible that the original relay has an integrated flyback diode and the new one doesn't or the other way around. If the relay is installed such that an integrated flyback is forward biased you will short out the coil. If the flyback is missing then it will need to be added.
There are probably more things I am missing here, but you can see there are a lot of things to worry about when swapping out components for similar products. |
H: Li-ion TP4056 with protection, avoid voltage drop at the output
I have checked some behaviour in TP4056 boards (with protection circuit) that I don't like at all. (See schematic diagrams at the end.)
When you use the TP4056 module with the protection board, you will get a dropout voltage of 0.4 - 0.7V in the output.
That is because the forward voltage of the reverse diodes of the MOSFET of the FS8205A.
DW01A pin 3 is for overcharge control and is connected to pin 5 in FS8205A
DW01A pin 1 is for discharge control and is connected to pin 4 in FS8205A
Also, overcurrent protection use the DW01A pin 1
The TP4056 already protects against overcharge the battery, so what about a bypass between FS8205A's pin 6 or 7 and FS8205A's pin 1 or 8 (see datasheet.)
We will lose overcharge protection of DW01A, but we have already the TP4056's one.
We will change over current protection as the Ron of the MOSFETs of FS8205A that DW01A will see, will be the half, so we will change over current protection from 2.5A to 5A (I think both of them are useless, 2.5A is usually a lot for our projects.) You can "repair" it by putting in a resistence of 30mOhm or bigger instead of the direct bypass.
With this modification we will get the real battery voltage in our output only losing the overcurrent protection (more or less,) won't we?
I hope you understand me, what do you think ?
(source: instructables.com)
AI: u will get a dropout voltaje of 0.4 - 0.7V in the output
I doubt that. Actually I'm quite sure it is simply not true.
The DW01A datasheet (page 8, section 11.1) confirms this:
Normal condition ... M1 and M2 are both turned on.
Also: Most phone batteries have a protection circuit similar to what you show. On phones with removable battery the protection circuit is inside the battery. Accepting a 0.4 V drop due to this protection would severely limit the battery life.
So I think you're forgetting that both MOSFETs must be on when the battery is in use. Perhaps you're thinking that only one MOSFET is on at any time. This is not the case!
Why use to MOSFETs in series then?
Well, both MOSFETs can only block the current in one direction due do the drain-source diode. So two MOSFETs in anti-series have to be used so that current can be blocked in both directions.
I think you should simply do what everyone else does and that is simply this:
simulate this circuit – Schematic created using CircuitLab
This is how it is supposed to be used!
The overcharge protection of the DW01A is not the same as what the TP4056 has! You want both. The TP4056 charges until the battery is full and then it stops charging. The DW01A's protection is there to prevent fire/smoke when the TP4056 does not stop charging (for whatever reason). Some cheap Chinese gadgets rely on the DW01A to stop the charging but actually that's a really bad idea. The DW01A stops the charging at a much higher voltage than any decent charger. So the battery will be overcharged all the time and wear out more quickly. |
H: 2 DC motors connected in parallel to H-bridge move with different speed
First of, since I come from web programming world, I'm pretty new into electronics and maybe some of the things I'm doing are wrong or could be done better, so any hint is highly appreciated.
I'm building a robot/crawler with 4 wheels. Each wheel is directly connected to a 6V 210RPM Motor DC with encoders.
I have a dual-way motor driver with 2 H-bridges
The driver is powered from an LiPo 2S battery 7.4 V
2 right motors are connected in parallel to one H-bridge and 2 left motors to the second H-bridge of the driver.
I'm controlling the motors through an arduino UNO by sending PWM signals to the PWMs of the driver.
Since the motors have encoders, I could read the rotations of one encoder from each side (one from left and one from right) and adjust dynamically the PWM for the other side, by taking the slower side as a master and the faster one as a slave, to force them move in sync.
The problem I have is that the motors which are connected in parallel move with different speed, although they receive the same voltage / PWM signal. Also their specs are identical.
I understand that mechanically they are not identical and different factors can affect their performance, but how to solve this problem? Is it possible?
Here are my ideas:
Does it make sense to read the encoder values from both motors connected in parallel? I think not, because if I'd try to lower/increase the PWM - both would be affected and the faster motor would still be faster.
Maybe attaching a resistor to the faster motor and trying to find a good value for the faster motor to slow it down up to the moment when it rotates in sync with the other one. But then this would work only if their speed difference is also proportional.
Last idea is to match them by the least speed difference and to connect in parallel those pairs which are closest to each other.
Maybe there are other proper ways to solve the problem which I have no idea of. But from the big amount of similar projects I found in internet, I guess they have a solution for this. Or maybe nobody cares that the front wheel of the right side would rotate slower than the back wheel from the same side?
AI: DC Motors will always run at different speeds.
If you have two motors in parallel on one driver and are only sensing speed from one of them then the other motor's speed will be unpredictable if and when the motors are not mechanically connected. There is no real way to correct that using electronics without adding separate drivers and feedback for each motor.
If the motors are driving wheels that touch the ground and the torque difference between them is not great enough to cause the "tires" to slip this may not be a problem since the contact with ground will act as a mechanical coupling between the motors. Note: That is how the drive wheels on your car stay at the same speed despite going through a differential gearbox. Loss of ground contact can cause some odd effects though.
Otherwise it is prudent to run a timing belt, or other mechanical linkage, between the motor shafts to keep them together. If your crawler has tracks this is a non-issue.
In some cases it may be possible to share the driver over both motors. That is, have a switching arrangement that channels power to each motor a percentage of the time, giving more percentage to the slower motor. However, that would of course reduce the performance of each motor by 50% when both are at speed. But that gets complicated and does not buy you much compared to having individual drive to all four motors. |
H: A question about using active filter to mitigate both differential and common mode noise
There is a single ended floating source connected to a data-acquisition device. The system is categorized as single ended earth grounded. Here is the recommended wiring as I use:
Now imagine the source is unbalanced and causing common mode noise and also imagine there is differential noise from the source as well. Would an active filter take care of both in this case?
Below is the details of wiring in my mind so far:
(please left click to view the diagram)
By using the active filter as above would the common mode noise due to unbalanced source be cancelled along with the differential noise?
AI: You start with a single ended signal from the sensor.
The sensor is grounded on one side, that's OK
The filter is for single-ended signals so that is OK as well.
Then you use a COAX cable which can only be used with single ended signals and that is what you do, so OK as well.
Now it gets a bit more tricky if there are (unwanted) signals flowing through the ground connection. The ground connection (COAX) will have some series resistance (all wires do) so any signal flowing there will add to the signal from the sensor (and there you have the reason for going fully differential).
Then you suddenly treat the signal as if it is differential because you feed it into a differential input amplifier. This is not wrong but also not OK.
But here you can probably get away with it since here the differential amplifier circuit will simply see a "wrong" differential signal since the bottom input is grounded. The amplifier will look at the difference between the inputs and that is equal to your signal. So this will work.
But with this you do lose the benefit of differential signals and that is the suppression of (common mode) disturbances. However, you are using a COAX cable which shields against these disturbances.
Connected like this the differential amplifier cannot even filter out the common mode signal because the signal is not differential!
Also if you want to use a proper differential setup then you have to:
add a single to differential converter circuit after the filter
replace the COAX cable with a 3-conductor cable (2 signals + 1 ground, the ground and shield could be the same).
In a fully differential solution the only currents flowing through the signal cables are the signals themselves. A current through the ground cable is no issue as it will not add to the signal. |
H: Using TLE2426 as opamp rails supplies
I want to power two opamp rails with +-12V.
For that I want to use this component to obtain +/-12V split supply from a 24V single supply.
But I came across the following statement:
TLE2426 splits the opamp rails and references signal ground but not
output ground.
What does that mean? Can I use use TLE2426 to power rail-to-rail opamp rails?
AI: That device is a virtual ground maker. That is, it creates a reference point half way between the rails. You would supply your op-amps with 24V and Ground and use the output of this device as your signal/analog ground.
Something like this.
simulate this circuit – Schematic created using CircuitLab
Note internals of the rail-splitter is simply a voltage divider and a unity gain op-amp buffer.
As such it can't source or sink more than 20mA so do not use it for higher currents.
Addition: Note the circuit can be equally labelled as follows.
simulate this circuit |
H: Current Probe on CRO?
Is it possible to measure waveform of current with current probe connected to analog oscilloscope? Or is that possible only with digital oscilloscope?
Are there any other instruments out there that can display waveform of measured current?
AI: Yes, current probes are commonly used and have 'scope connectors.
Figure 1. A Fluke 80i-100s AC/DC Current Probe provides fully isolated measurement of cable current.
This probe probably uses a Hall sensor inserted into a slot in the split core.
Figure 2. A home-made Hall current sensor. The wire to be monitored is passed through the core centre. The chip measures the flux density across the core gap and an output voltage is generated proportional to the current.
If only AC is being measured a passive coil-type clamp-on CT probe is available. These will be less expensive and don't require batteries.
Figure 2. A Rowgowski 'scope current probe. Source: GFUVE.
Current probes are also available for PCB current measurement. See my answer to Finding a faulty chip that draws too much current.
Or is that possible only with digital oscilloscope?
The probe won't know what it's feeding. The oscilloscope won't know what is feeding the signal. Either type of oscilloscope just sees a voltage varying with time.
Links to other related answers of mine on this topic:
Unipolar Hall current sensor signal conditioning for 5v ADC.
Measuring Current in Combination Circuit with a Shunt |
H: Charge a 200v capacitor to 200V with a 5V Power Supply
If for example I have a 200VDC capacitor and I need to fully charge it to 200VDC. Can I do so with a 5VDC power supply and if I can how would I do this?
AI: One way I can think of is:
Use the 5 VDC power supply to build an oscillator.
Step up the resultant AC voltage using a 400:5 transformer.
Rectify the resultant output.
You'll now have a 200 VDC supply, which is capable of providing a lot less current than your original power supply. Thus, you can charge your capacitor to 200 VDC. I think this must be a standard way of stepping up DC voltages and must have a standard name. If any reader knows this name, please put it in a comment. |
H: Help with 16:1 Mux IC Wiring
I have these ICs
and I want to wire them like the sparkfun 16:1 mux breakout board.
Here is what I have so far. Is this correct?
However I feel like these are not the same as the actual ICs. Also another quick question, how many of Mux can I daisy chain?
Thanks in advance :D
AI: Here is what I have so far. Is this correct?
Looks fine to me. Another option would be to share the COM pins and drive EN on the multiplexers to read from one at a time, but what you have is fine.
However I feel like these are not the same as the actual ICs.
The Sparkfun breakout boards you're referring to are essentially "pure" breakouts. The only additional things on the breakout board are:
A pulldown resistor on the EN pin, which is unnecessary if you're driving that pin, and
A decoupling capacitor on VCC, which you should have in your circuit as well. (Just connect a small ceramic capacitor between the VCC and GND pins on each IC -- 0.1 µF is about right.)
How many of Mux can I daisy chain?
Plenty. :) You'll run out of input pins on the Teensy long before you hit any fundamental limitations of the multiplexer. |
H: Questions about clamp meters
Are clamp meters as accurate as multimeters?
Could I replace a multimeter with a clamp meter?
What can clamp meters do that multimeters can't?
What can multimeters do that clamp meters cant?
AI: Clamp meters are good for measuring higher currents. Standard multimeters can typically measure current but require breaking the circuit and are good for measuring amplitudes less than an amp ( milli or micro amps). Some clamp meters have almost as many features and ranges beyond current by attaching leads- allowing you to measure voltage and ohms. Make a list of your requirements and then compare your list to meter specifications and capabilities. The only defining requirement for me is if I need to measure milliamperes, which typically clamp meters don’t have good resolution and standard multimeters are better suited for. |
H: Better procedure for 'recovering'an STM32F103C8T6?
I have a STM32F103C8T6 (aka blue pill) and worked with it.
Sometimes - due a reason I don't understand - after debugging it (using Eclipse), the connection is lost and I cannot start a new debug session.
The only thing to do is the following time consuming procedure:
Close Eclipse
Start ST-Link Utility
In the menu ST-LINK/Firmware Update, selecting button Device Connect (to see if the ST Link stick can connect).
In case of an error, reinsert it (Windows shows Unknown USB Device) and redo the previous step
In case of no error, it shows the version: V2.J27.S6 STM32+STM8 Debugger
Than on the STM32 I have to press and hold the reset button
Select the menu option Target/Erase Chip
Release the button (in time, otherwise repeating the previous step)
Than the chip is erased.
Than start Eclipse again and I can continue
This is already a very tedious operation... is there a better solution?
Or by what reason the debugging session causes the STM32 to lose the ability to start a new debugging session?
And even than in some cases I get the following error when trying to debug:
23:23:02 : Can not connect to target!
If you're trying to connect to an STM32W1xx device, please select Normal or HotPlug mode from Target->Settings menu.
If you're trying to connect to a low frequency application , please select a lower SWD Frequency mode from Target->Settings menu.
23:23:03 : No target connected
The Eclipse project configuration file fragment:
# use software system reset
reset_config none
set CONNECT_UNDER_RESET 0
AI: I found the problem of one of the questions, so I added it for other people's reference, since it is a non-trivial default:
When using the STM32CubeMX which I do, whenever a project is made, by default the following item is selected:
SYS, Debug: No Debug
This causes that the following code is generated in HAL_MspInit:
__HAL_AFIO_REMAP_REMAP_SWJ_DISABLE();
As soon as the debugger passes this command (which is one of the first commands in HAL_Init which is called in main(), the debugger loses connection and even a new debug session cannot be started.
It can be easily fixed with setting to
SYS, Debug: Serial Wire
(which is also called SWD: Serial Wire Debug, and is supported by ST Link 2).
This causes that the following code is generated in HAL_MspInit:
__HAL_AFIO_REMAP_SWJ_NOJTAG();
And debugging works as usual. |
H: Help understanding voltage limits in a PNP transistor
As seen below, I have a circuit that turns on +12V to the EN pin of a LM53601 buck converter when the +6V DC component in a car speaker wire is detected (bridged output). This works fine.
But I am a bit confused when reading the specifications for the PNP and I need some help understanding how much voltage the 3906 can withstand. In my current circuit, the +12V from the battery has TVS diode protection, clamping the voltage at 36V. It also has a 200V Schottky in series.
Will a transient of 36V at Q2 emitter destroy it?
AI: 36V causes 35V/3k base current which is ok and is < 40V max
But reverse voltage will exceed Vebo of -5V and damage it instantly and grounding the output will fry it when active high. |
H: Understanding time-response of photodiode circuit (LTspice)
I'm trying to get an idea of the time response of a laser-gate I'm building; so, I wanted to do some basic simulations in LTspice based on this thread:
Adding Photodiode to LTspice
Attached below is my circuit and voltage response at the oscilloscope.
I'm confused because I figured the time response was going to be on the order of RC, ~10 ms for the given scope impedance and filtering cap, whereas this simulation seems to suggest it's only a few microseconds.
Is my understanding of the time response wrong? Or am I doing this simulation incorrectly? Thank you.
AI: Your 'filtering' capacitor and scope impedance form a high pass filter which 'differentiates' the square wave to produce a spike on each edge that decays exponentially. However with a time constant of 10ms the effect on a 1us pulse is unnoticeable.
What you are seeing is a low pass filter with a time constant of ~1.7us, caused by the internal Base-Collector capacitance of the phototransistor interacting with the load impedance. The rising edge is fast because the photo current is high enough to discharge this parasitic capacitor quickly, but when the current stops the capacitor can only recharge slowly through R1.
A time constant of 1.7us implies a capacitance of 1.7us/100k = 17pF. LTspice's model of the 4N25 has this:-
.model NP NPN(Bf=610 Vaf=140 Ikf=15m Rc=1 Cjc=19p Cje=7p Cjs=7p C2=1e-15)
Cjc is the Base-Collector zero-bias depletion capacitance, which at 19pF is close to the value I calculated by 'eyeballing' the graph. |
H: How does the lead polarity work on a D'Arsonval galvanometer?
Following an illustration of D'Arsonval movement such as the following...
I notice that the N polarized part of the coil is connected to the positive lead and the S polarized part of the coil is connected to the negative lead. Why is the galvanometer configured this way? Does the meter always have to be configured this way?
AI: The orientation N and S of the movement electromagnet are determined by the direction of the current and the winding direction. This can be easily remembered using the right-hand grip rule.
Figure 1. The right-hand grip rule: with fingers wrapped in the direction of current flow the thumb points in the direction of the field (N). Source: OneSchool.
With a little thought it can be seen that the illustration in the question is correctly drawn and that the north pole of the momement is at the top.
I notice that the N polarized part of the coil is connected to the positive lead ...
Not quite right. The N isn't "connected" - it is a result of current flow and winding direction. There is no electrical connection as the wire is insulated.
Figure 2. Another D'Arsonval galvanometer movement diagram showing the springs. Source: Engineer's Edge
As current is increased the like poles repel introducing a turning moment which acts against a spring to give a rotation proportional to the current. |
H: Load cell temperature compensation
Can someone explain to me how this (as advertised) full bridge load cell works?
I'm aiming for good temperature stability and I understood a full bridge load cell configuration should reject error from temperature variation based on the fact that you're measuring the difference between two elements.
This particular load cell varies by about 1% per 1°C.
I'm struggling to see how this configuration is an improvement over a single, 2-wire resistive element at all.
AI: Let suppose you have this kind of gauge:
This is a half leg of the Wheatstone bridge, it has two gauges positioned 90 degrees apart with respect to each other. One gauge measures the elongation due to applied force, while the other doesn't change the resistance.
Because of thermal elongation, both gauges elongate in both directions, so the second gauge is there for this temperature compensation.
Very good cells are built with materials, body and gauge, with similar/equal temperature elongation coefficient, this further makes a load cell temperature stable.
Don't expect from cheap cell, like in the picture, some very accuracy and stability, it's not just about to glue the gauge on piece of metal. |
H: BGA break out and impedance control
I'm connecting two BGAs (0.8mm pitch) which are DDR3 signals. Vendor recommends 40 and 80 ohm for SE and diff traces.
My PCB manufacturer suggests the following specifications for the diff traces:
Width: 10 mils
Distance: 7 mils
Thickness: 0.67 mils
Dielectric: 5.1 mils
di.constant:4.2
For single ended, the trace will have to be even wider. Breaking out from the BGAs, this is clearly not possible. I am new to PCB design, but it seems to me that 12 mils traces are rather huge relative to the size of the ICs.
The only information I've found about this width change and the challenges of breaking out/fanning out in this relation is simply "it's complicated".
I'm using Kicad and the number of available simulation tools is limited. How can I make sure that the impedance is controlled within reasonable accuracy?
AI: For SDRAM interfaces, the exact impedance of the wires is not important. Actually, very few designs I know even care about this. Most you will see is a 10-30R series resistor to keep reflections at bay. This works, because the wire length is sufficiently short that reflections decay quickly.
What you should care about though, is that the length of the wires match. To be more precise, the lengths on different layers should match up per layer. This is because the delay a signal will see is dependent on the environment of the wire. This changes on each layer (different distances to GND plane and such). Hence, to keep the overall delay constant over all wires, you have to keep the length on each layer for all signals the same.
Using this simple rule, and trying to keep the tracks short (2-5cm should be enough for most designs), have the signals always directly above or below a GND plane, will get you a working design. If you go over 4-5cm, I would add a 10R 0402 (at most 0603) resistor in series. |
H: Voltage output of AC current clamp
So I'm using a Fluke i200s current clamp in combination with an oscilloscope to measure the AC current. Normal current clamps have a current output, but this one has a voltage as output. Now my question is does this clamp has the same working principle as the others(like a transformer with one primary winding), and just measures the voltage instead of the current. Or does this clamp works differently, and how?
AI: Figure 1. The Fluke I200S current clamp.
simulate this circuit – Schematic created using CircuitLab
Figure 2. The internal wiring.
Now my question is does this clamp has the same working principle as the others(like a transformer with one primary winding), and just measures the voltage instead of the current.
It is a true current transformer but with a shunt resistor built in. The current will create a voltage drop across the resistor and this voltage is monitored by the oscilloscope. |
H: Is embedded C the same for all MCUs?
I was coding for Atmel ATmega 32 chips. Now I have shifted to the ARM Cortex-M family.
Is there any difference in coding between AVR and ARM, or does it depend on the compiler? How I would learn programming for ARM MCUs?
AI: There is some similarity (obviously ANSI C is pretty much ANSI C) but the differences in hardware will result in a great increase in complexity in most cases when you use an ARM or other 32-bit processor. It's not that you can't do simple programs that directly access hardware on an ARM but usually there are hardware abstraction layers and middleware and maybe an RTOS to contend with in order to get a program running that was the reason you wanted to use an ARM in the first place.
A few things are probably a bit simpler- but there are also memory alignment and memory barrier issues to deal with. And threading issues if you use an RTOS (which is pretty much what you deal with anyway when you use interrupts but with different terminology). The bus structure is far more complex. You'll likely want to consider using DMA or other complex peripherals.
You'll have to adapt to the naming conventions used by the middleware provider if you want to use their USB stack, Ethernet stack etc. It is said that
"There are only two hard things in Computer Science: cache invalidation, naming things, and off-by-one errors"
Here is an ASF (Atmel Software Framework) example of writing to a port (blinky):
in main.c:
ioport_set_pin_level(LED1_GPIO, IOPORT_PIN_LEVEL_HIGH);
in ioport.h
static inline void ioport_set_pin_level(ioport_pin_t pin, bool level)
{
arch_ioport_set_pin_level(pin, level);
}
in ioport_pio.h
__always_inline static void arch_ioport_set_pin_level(ioport_pin_t pin,
bool level)
{
Pio *base = arch_ioport_pin_to_base(pin);
if (level) {
base->PIO_SODR = arch_ioport_pin_to_mask(pin);
} else {
base->PIO_CODR = arch_ioport_pin_to_mask(pin);
}
}
Also in ioport.h:
/** \brief IOPORT levels */
enum ioport_value {
IOPORT_PIN_LEVEL_LOW, /*!< IOPORT pin value low */
IOPORT_PIN_LEVEL_HIGH, /*!< IOPORT pin value high */
}; |
H: Mathematically I have enough power but the power source don't seem like enough
Lets say i want to reach a certain wattage of 2,500 W. But I run it off a power source which maxes out at 5 A and 20 V. But I step the voltage up to 500 using a coil or transformer and now 5A × 500V is 2,500 but thats a lot of power from a small power source. Is stepping the voltage up really going to allow me to get 2,500 W of power from 5 A and 20 V or am I calculating this wrong? I'm new to electrical engineering and it seem strang that I can have such a power increase just by increasing voltage/amps.
AI: Your 20 V, 5 A supply is capable of 100 Watts of power (V x I). You cannot get more power from the supply, whatever you do.
You can, however, convert the voltage. In the case of AC, you use a transformer. In the case of DC, there are many different conversion methods.
But, the maximum output power must always be 100 W! So, if you convert to 10 V, you can only get 10 A. If you convert to 1 V, then you can have 100 A. But the power won't increase. V x I can't exceed the original 100 W.
In the real world, each conversion will also have some inefficiency. So you'll actually end up with less power than you started with. |
H: I need help to find this component
I found these at the entrance of an analog input, so I think these are ferrite beads with a metal ground case but I need the part number. I searched several component websites but I couldn't figure it out (Mouser, Digikey, Farnell). I checked the manual and it doesn't have a schematic or BOM.
I have found that the case is connected to ground with a series resistance of 0.4 ohm. The inductance is 6uH and the IC on the right is an AD7190.
AI: It is some kind of EMI feedthru filter with capacitance to ground, series inductance and series resistance.
RLC at various frequencies might give more clues.
Considering they seem to come in pairs, I am surprised they do not have CM SMD chokes. But what about the SOT between pairs? This is just a 4 channel single-ended ADC. What cable lengths are connected to inputs?
I'm not sure you want a single ended 10A feedthru (gnd ) filter for an ADC high impedance input that may have large CM noise. Yet @JohnD was successful in finding specs. |
H: Computer PCIE slot power in parallel with external power supply?
I have an output card for my computer it is in the PCIe slot of the PC. From there it goes to a break out box. Where Pins 1 and 50 are power (5v) and 49 and 99 are ground. If i turn on alot of the pins on the card at once, there is not enough amps to power everything.
Can i take an outside 5v power supply and can connect it in parallel with the 5vs coming out of the break out box/output card?
AI: Yes and No, think about it for a minute. Lets say that your PC supply is exactly equal to the voltage of the external supply. Unless the PCI card has separate Vcc's you are effectively connecting the PC supply to the external supply, if the voltages are exactly the same, then no current will flow between the supplies an you'll be fine and you can parallel the supplies. This works in an ideal case.
(You also need to connect the grounds together.)
However, in the real world the supplies are not equal, source resistance (including cable resistance) will create an imbalance in voltages. Lets say one is 5.05V and the other is 5.15V. You'll get current transfer between the supplies based on the resistance between them. If the cables and source resistance is under an 1/10 ohm (which isn't unreasonable) then you'll have 0.1V/0.1Ω = 1A (as an example) and one power supply will be dissipating power in the other and that is bad.
So the answer is no, unless you have some way to match the voltage exactly (if you had an external control pin to regulate the voltage or the supply had some kind of control loop then this would work) OR if the Vcc's are seperated then the answer is yes. |
H: Opamp demonstrates slew rate much lower than specified in datasheet
TL,DR: Use a comparator, not an opamp. See Frosty's answer below.
I'm trying to make a pulse waveform generator with variable duty cycle. The 555 timer is used to generate a sawtooth waveform, which is then compared to a constant voltage from a voltage divider. The schematic works in principle, but for some reason the output of the opamp has a very low slew rate.
This is the schematic:
Vcc is 5 volts. R1, R2 and C1 are such that the width of one tooth of the sawtooth waveform is roughly 200 microseconds (I'm seeing that with the scope). However it takes roughly 10 microseconds for the output of the opamp to go from 0 volts to 4 volts.
The opamp in question is TL072, which, according to its datasheet has a typical slew rate of 13V/us. There's also a graph that is showing "Normalized slew rate", which is roughly 1V/us at +/-15V power supply.
Am I misunderstanding what slew rate really is? Shouldn't this amplifier go from 0 to 4 volts in about 0.3 microseconds?
UPDATE: The circuit behaves as described with no load.
AI: There are several contributing factors to the poor performance of the circuit:
1. Insufficient supply voltage
Minimum Supply Voltage for the TL072 is listed as 10V. Using only 5V is well below this minimum.
2. Insufficient supply voltage headroom
The TL072 is not able to drive its output up/down to either voltage rail so expecting it to output 1V under Vcc is not realistic. See this question for more details.
3. Improper component selection
You should be using a comparator in this circuit and not an opamp. While the diagrams and basic function of an opamp and comparator are similar they are not substitutes. See this question for more information. |
H: How to find the equivalent resistance of this circuit?
I know that finding the equivalent resistance depend on whether resistors are in serie (R1+R2+...+Rn) or parallel (1/Req=1/R1+1/R2+...+1/Rn), but i don't know how to apply that to find the equivalent resistance of this circuit (not including Ra):
simulate this circuit – Schematic created using CircuitLab
My solution:
simulate this circuit
R3, R1 and R2 are in parallel so:
1/Req=1/R3+1/R1+1/R2 so Req=3.299 Ohm.
I assumed that R3 isn't in parallel with R2 and R1, so I calculated Req in different ways:
Req=(R1//R2)+R3+
Or: Req=(R1//R3)+R2
Or: Req=(R3//R2)+R1
I know this may be the most ridiculous question you have seen today, but i'm very beginner in electronics. Any help would be apprieciated.
Thanks for reading my question.
AI: The two possible solutions are as follows.
The first diagram is Ra in parallel with R2. Then R3 is in series with the result. Finally, R1 is in parallel with the result.
Ra || R2 = 0.99
0.99 + R3 = 10.99
10.99 || R1 = 5.15
Notice that in the second diagram the voltage of the supply is lower.
This is called a Thevenin equivalent.
For a Thevenin equivalent first, remove the load and calculate the voltage across where the load was. In this case, R2 and R3 form a resistive divider.
V1 * (R2 / (R3 + R2)) = 0.090V
Then second, short the supply (turn it off or reduce it to zero for a voltage supply and calculate the equivalent resistance. With the supply sorted R3 is completely bypassed. This leaves R2 in parallel with R1.
R1 || R2 = 0.9 ohms.
Finally, take the voltage and resistance and set it up in the manner shown.
simulate this circuit – Schematic created using CircuitLab
To keep current the same though Ra first you need to calculate what the current in Ra is. Then find the resistance needed to keep the same current. First Ra and R2 are in parallel.
R2 || Ra = .99
Then the result is in series with R3. (R1 is ignored because it is directly across the supply and does not affect Ra)
R3 + 0.99 = 10.99
The current is then V1 / 10.99 = 0.090A
Then you do a current divider to see what part of the current is flowing through Ra and what part is flowing through R2.
0.090 * (R2 / (Ra + R2)) = 9.09e-5
Now set up an equasion with X equal to the needed resistance. The total voltage drop in the circuit should be 1V.
9.09e-5 * 1000 + 9.09e-5 * X = 1
Solve for X to get 10121 ohms.
simulate this circuit |
H: How to determine full-load RPM of an induction motor at any arbitrary frequency?
Lets say an induction motor's spec sheet states the following:
1/ 50 Hz, 2-pole, full-load rotations-per-minute (RPM) = 2850.
2/ 60 Hz, 2-pole, full-load RPM = 3450.
Can we extrapolate this information to find out the full-load RPM for other frequencies (i.e.: 20 Hz, 30 Hz, 40 Hz, etc.)?
(SPECIFIC EXAMPLE)
Like for instance,
as per here,
the synchronous speed of the motor under 50 Hz is 3000 RPM.
The full-load RPM then, is 95% (2850 / 3000) of the synchronous speed.
Doing the same thing for 60 Hz @ 3600 RPM,
the full-load RPM is ~95.8% (3450/3600) of its synchronous speed.
Would it be reasonable to make an assumption that under different frequencies,
the full-load RPM is ~95% of its corresponding synchronous speed?
EDIT From a suggestion by @Transistor,
I am using a "VFD-B" variable frequency drive on my induction motor.
(manual, website)
AI: You can, but it makes little sense.
An induction motor behaves the same as a transformer, if you reduce the frequency, you had to reduce the voltage applied, too, otherwise the core —both the outer shell and the rotor— get overexcited and heats up.
If you reduce the voltage, the torque/speed characteristic shrinks proportionally in the torque direction. The actual full-load speed depends on the working point made from crossing the load characteristic with the motor characteristic.
So if an induction motor is built for 240V 50/60Hz, in reality it's a 240V 50Hz motor which would also work at 60Hz. |
H: 28F010 flash in a 80C186 System
I am reading a datasheet on the 28F010 flash.
The datasheet states that for reading it behaves like a ordinary EEPROM but in order to alter memory content the command first the command must be issued.
So then in datasheet there is a diagram where 28F010 is connected to a 80C186 processor.
My question is how CPU will be able to write this flash memory?
When we access the address for writing the CPU will generate standard signals on it't bus. CPU will not generate any command for writing because he doesn't know about the flash.
So i guess if 28F010 is connected to 80C186 the CPU will be able to read this flash only.
Am i correct?
AI: It's possible to write to the flash, but it can't be written to like normal memory. Write accesses to the 28F010 flash, as with many other flash parts, aren't treated as normal memory accesses. Instead, the values of the data lines during a write are treated as a command. A specific programming algorithm is required, which is explained in Figures 4 and 5 of the 28F010 datasheet.
Writing code to execute this programming algorithm should be possible, so long as there are no other memory accesses being made to the flash memory. In an 80186 system, this would probably mean that the programming algorithm would need to be executed from system RAM, and interrupts would need to be disabled. |
H: How can I go about making temporary test connections in pcb while prototyping without soldering?
I recently ordered some PCB bits from Adafruit to assemble a widget. I want to make temporary connections between different PCBs, but am not convinced I want to solder and then desolder and resolder wires while I am testing and prototyping.
My initial thought was that there might be some sort of cone-like connector I could shove through the pads that would make temporary contact, but can't seem to find anything.
Is there a solution to this problem? I could use the headers that came with the PCBs but then I'd have to desolder those or buy new PCBs once I had the wiring diagram figured out, which is something I'm also not keen on doing.
AI: I'll try to answer the questions which aren't already covered in the old question kindly mentioned by Transistor:
How can I make connection on pcb (circuit board) holes without solder (for prototyping)?
I could use the headers that came with the PCBs but then I'd have to desolder those or buy new PCBs once I had the wiring diagram figured out, which is something I'm also not keen on doing.
You don't have to desolder the headers from the small module later. One approach is to solder standard headers (male or female - your choice, there are benefits to each) into the small modules you buy from Adafruit (or wherever).
While prototyping, you can use "Dupont cables" to make connections to other PCBs, or you might plug the small module (with its headers) directly into a breadboard.
When you have decided on the final design, you fit equivalent opposite-gender headers onto your final PCB / perfboard or whatever. Then plug the small module with its headers, onto those opposite-gender headers which you have soldered onto your final board.
When you are planning this, think about which gender of headers are most suitable for you on each side (module and final board), and which way "up" you want the small module to be, when fitted to the final board.
This is similar the approach used for TI BoosterPacks, Arduino Shields etc. where you "stack" boards using opposite-gender 0.1" pitch headers. |
H: Do ICs sink their input current?
I know this question may be very stupid, but it comes from a true beginner, and a Google search came up inconclusive.
When porting high or low the input pins on an integrated circuit (particularly CMOS), are the input current sinked or sourced ? To me it makes sense that they would be sinked, but I am not finding the information on it, as googling with the terms 'sinking' or 'sourcing' just brings up pages about those terms.
AI: It depends on the technology.
Standard TTL sources current when pulled low. CMOS can have pull-ups or pull downs that will source or sink current respectively.
Also, be aware that with CMOS devices there is also input capacitance. That means while switching they sink on high edges and source on falling edges. As such when driving an input with say a high frequency clock, there is significant currents involved in both directions. |
H: What is the effect of a triac on a torque/speed curve?
I am trying to understand the impact of a triac based speed control on the torque/speed curve of a motor. For as easy example, let's use a corded drill as an example. If I pull the trigger all the way the motor gets the full waveform and the torque/speed curve will look like a typical universal motor:
(image source)
Now let's say I only squeeze the trigger down 50% so that the waveform now is chopped up by the triac. What happens to that curve?
Another way to ask the question is does a triac change the speed more, the torque more, or both in some proportion?
AI: With reduced voltage, the curves for all the motors except the AC induction motor will move downward with approximately an equal speed reduction for every speed. For the universal motor, that approximation may be a bit crude.
For the induction motor, reduced voltage will reduce the torque at every point approximately proportional to the per-unit voltage squared. |
H: Is this an SMD Pulse transformer?
I have two of these units. The one that looks fried actually worked just with some cleaning, and the other one won't power up. I check all the SMD Transistor and resistors and I am getting power to the unit. The fuse checked good. The only thing left is this that I thought it might be the pulse transformer since it seemed to have some winding underneath it.
On the pictures, the blue arrow points to the power plug or usb. The red arrow points to the unknown to me SMD component.
What is this component and does it do?
How do I verify if it's working fine?
Thank you
I can't post more than 2 links
The picture at the bottom you can see the winding kinda of. I couldn't take any better picture than that.
AI: What made you think there would be pulse transformer on the power pins? The most sensible solution is a CM choke. These are made to reduce noise on high impedance lines. |
H: large current through power mosfet in LTspice
I use some mosfet and BJT for a simple power path management in circuit. When Vprimary is larger than zener(indicate primary battery is healthy), Vprimary is connected to Vsys through M1 and M2 to supply power. When Vprimary falls below zener voltage, Q2 and M3 is biased so that Vbackup is connected to Vsys through M3 to supply power.
The problem is that the current throught the three mosfet seems very large, why?
I think maybe LTspice's modeling about mosfet body diode not correct, however, use one mosfet from TI, the result is almost the same...
update
Thank you. The large current is caused by M1&M2 and M3 both conduct, shorting Vprimary and Vbackup. Followed by your advice, M1&M2 no longer conduct during M3 conducting.
However, there's still momentary large current which is caused by Vpri->Vbak or Vbak->Vpri power source switching. I think it is caused by zener diode and the finite voltage source impedance. For example, during Vpri rising from 0 to 12V, the 9.1V zener diode will conduct when Vpri reachs 9.1V, causing M1&M2 conducts and shorting Vpri and Vbak through M1&M2&M3. Because of the 0.5ohm source impedance, the voltage on zener may below 9.1V. The large current will disapear once Vpri rises much larger than 9.1V. The duration may decrease if source impedance is decreased from 0.5 to 0.1ohm.
AI: The reason the current is large through your top 2 PMOS pass transistors, is because they are almost always turned on.
See an annotated version of your schematic,
As you can see following the red line, there is a current path from \$V_{pri}\$ to ground when \$V_{pri}\$ is greater than 2 diode drops. So, M1 & M2 are turned on almost all the time.
You can size R1 & R5 so the \$V_{GS}\$ is below M1's threshold voltage. A starting point is making R5 larger, like a 100k, and R1 smaller. |
H: VCC filtering for magnetic sensor on flat cable
I'm designing an application for this magnetic angular sensor:
https://cdn.sparkfun.com/assets/4/7/8/0/1/MA700.pdf
Because this is precise and sensitive piece, I'm thinking if I should have additional VCC filtering. Any thoughts welcome!
This sensor IC will sit on a tiny PCB, which will be connected to main controller board with SPI flat cable.
Should I place capacitor on the main board just before the cable?
Should I place capacitor on the tiny PCB?
Should I have inductor in addition to capacitor?
Should I not worry about it at all?
AI: Put the capacitor as close to the device as possible on the small board. You might want a series inductor (also on the small board before the capacitor). Do not omit the 100nF capacitor shown in the datasheet, put that capacitor closest to the part and a larger capacitor a little further away from the sensor chip than the 100nF (1uF is probably a good choice if you are not sure).
All of this depends on the amount of conducted EMI on the power input wires.
If the power is really bad, put a higher voltage on the power input to the board (possibly 5V) and put a high PSRR LDO on the small board to generate the 3.3V power rail for the sensor chip.
Shielded cable and connectors are probably a better solution than an additional capacitor and inductor. |
H: Question regarding transistor codes
I needed a 2N 2222A transistor. And from a electronics shop I got the transistor with following symbols,
KSP
2222A
-1426
I have already searched and know that KSP is the name of a manufacturing company.
KSP - Components, Semiconductors, Capacitors
I want to know what the last digits mean?
I also do not know whether it's NPN or PNP.
AI: A simple google search of "KSP 2222A" would have returned on the first line this datasheet, which clearly states what a KSP 2222A is.
It's basically the 2N2222A in plastic package (exactly the same specs), therefore is an NPN.
The 1426 is likely a production date-code. 2014, 26th week.
Note:
The 2N2222 (without A), instead, has smaller ratings (breakdown voltages) and performance (smaller fT) with respect to 2N2222A and its plastic version PN2222A-KSP2222A. |
H: Help identifying a transformer with yellow bobbin and clarifying its purpose
I've a small yellow taped transfomer. It has 6 terminals and one of the input and output terminals are shorted. It has a number (14) on one of the sides. I'd like to know the input and output terminals and also the use of this transformer.
AI: Mosquito taser, here's a possible circuit solution:
Source: this forum
The transformer is used to make a high voltage from the 3 V supplied by the batteries. The transformer also provides feedback to the transistor so that it starts oscillating which is needed to make AC from the DC of the batteries. Transformers only work on AC so that's why that is needed.
Making the transformer part of the oscillation circuit also helps in cost saving (now only one transistor is needed) and also making sure maximum power is put through the transformer as it will saturate and that partly keeps the oscillation going.
These transformers usually do not have any part numbers, they're made for this purpose (bug zapper) only. They might even be made to order, the bug zapper manufacturer just tells the transformer factory what it needs and how many. |
H: Read and Write multi variable (Struct) from/to external FRAM memory over SPI by ATMEGA Using Code Vision
I am working on a project to read some data from ADC and store them in external FRAM over SPI.
I have 8 different float values which need to save when the power is off or other specific situation and after power get on read each value and continue from saved variables.
So my question is if I save them in array ot structure how can I write and read them from FRAM.
Thanks in advance.
AI: SPI memories on AVR microcontrollers are not memory mappable: you can't tell the ATMEGA that you have connected a memory, and let it map the device in the memory area, and take care of all the commands required by the read/write operations.
Instead, you have to manually create your functions readByte/writeByte, to read and write a single byte to the FRAM through the SPI.
Then, you create the functions readBuffer/writeBuffer, and pass the pointer of that structure, and the sizeof that structure (and the destination address in the FRAM, of course).
Still, working directly on an external SPI memory will be extremely slow. A better idea is to work on a copy in the internal RAM, and then adopt one of the following strategies:
copy the structure just before the AVR is turned off or it goes to sleep mode (you might need some hardware to detect when power is being removed, and have some reservoir capacitor to actually be able of saving data to the FRAM).
copy the structure when a write operation occurs (slower, but does not require additional hardware).
In any case, when the device is powered, you must copy the data from the FRAM back to the internal RAM.
EDIT:
As you said, you have already the functions that write and read a byte to/from the FRAM. You just need to create a function that read a larger amount of data, and writes a larger amount of data. Then you can do the following:
void writeBuffer (uint16_t address, uint8_t *data, int16_t size)
{
for (; size>0; size--)
{
writeByte (address++, *data++);
}
}
void readBuffer (uint16_t address, uint8_t *data, int16_t size)
{
for (; size>0; size--)
{
*data++ = readByte (address++);
}
}
Then to read the structure:
readBuffer(address, (uint8_t*) &yourStructure, sizeof(yourStructure));
To write:
writeBuffer(address, (uint8_t*) &yourStructure, sizeof(yourStructure)); |
H: How to build Li-ion over-discharge protection board
I have an Arduino board with a pump attached to it, and for powering both, I'm using a 18650 battery cell with a DC-DC Boost Converter. I plan to leave it working even when I'm not home, and I know that if the battery over discharges, there will be trouble, so I would like to design an over-discharge protection board.
I can see from this video that it is not a big deal to build one, however, I don't have a battery alarm buzzer. Is there any way to build such a protection board without that part?
Or is there any simpler way to build such a circuit with the components that I have: a relay (JQC-3F(T73)), some diodes (N4007 type), capacitors(22, 47 and 100uF) a potentiometer, a bunch of resistances (from 1mΩ to 51 kΩ) and transistors (PNP-8550, NPN-8050 and IRF520).
I'm attaching the scheme given by the person that made the video:
AI: Since you have a 5 V relay (which appears to have a 2.2 V drop off voltage) you might be able to do this:
simulate this circuit – Schematic created using CircuitLab
This will only work if:
the relay will latch on with a little bit less than 5 V (most relays will)
the relay will switch off at around 3 V
You have to close sw1 to start the thing up. You could use a piece of wire instead of a switch.
The relay coil will keep itself powered as long as the battery has enough voltage. When the battery voltage drops too low, the relay will fall off and switch off everything.
Do note that this is still a "hack" solution, when powered the relay will draw current and thus slowly (in a couple of days perhaps) discharge the battery. |
H: Microcontroller ATMEGA328P ports
Hello I am fairly new to microcontrollers and would like to know how would one know if a port is analogic or digital? in function of their I/O ports.
Thanks in advance
AI: The datasheet shows which port is digital only, and which is analog or digital.
Both graphically:
And in a table (shown only in part, see I/O multiplexing on the linked datasheet): |
H: Is it possible for an opamp to oscillate at a frequency greater than its GBP?
I was installing a tl3141 into a headphone amplifier circuit and it appears to break into ~250mVp-p oscillation at 8-10MHz on the lower half of the waveform when fed a 1kHz sine wave.
Is that even possible given the specs of the opamp (GBP 1.1MHz, Slew rate 1.3V/μSec)? Given the measured oscillation the output would have to swing at somewhere around 2.75V/μSec which is well beyond that spec.
AI: Some Class AB power amplifiers use a composite PNP/NPN transistor pair to drive current on the low-side swing. LM380, and your TL3141 use this topology. For the LM380, appnotes caution that 5-10 MHz oscillations can be experienced, known to audio insiders as "low-side fuzzies". A Zobel network is suggested as a cure (A series RC from output to ground). Good high-frequency power-supply bypassing can help too.
EDIT: From "Audio HANDBOOK National" (1976),
...The classic class B is merely a PNP and NPN capable of huge
currents but since the IC designer lacks good quality PNP's, a number
of compromises results. Figure 4.1.4b shows the bottom side PNP
replaced with a composite PNP/NPN arrangement. Unfortunately, Q2/Q3
form a feedback loop which is quite inclined to oscillate in the
2-5MHz range. Although the oscillation frequency is well above the
audible range, it can be troublesome when placed in proximity to an RF
receiver. Among the stabilization techniques that are in use, with
varying degrees of success are:
Placing an external RC from the output pin to ground to lower the gain of the NPN. This works pretty well and appears on numerous data
sheets as an external cure.
Utilizing device geometry methods to improve the PNP's frequency response. This has been done successfully in the LM377, LM378, LM379.
The only problem with this scheme is that biasing the improved PNP
reduces the usable output swing slightly, thereby lowering output
power capability.
Addition of resistance in series with either the emitter or base of Q3.
Making Q3 a controlled gain PNP of unity, which has the added advantage of keeping gain more nearly equal for each half cycle.
Adding capacitance to ground from Q3's collector.
These last three work sometimes to some degree at most current levels.
simulate this circuit – Schematic created using CircuitLab |
H: Total Cable/Splitter loss calculation for Gain value compensation
If there is an 8 port splitter attached to cables feeding an array, is the total Cable/Splitter loss = S21 measurement for each port (with terminations on others) OR I have to add the S21 value of each port?
This is confusing me.
So I expect -9dB for an 8-way.
I get -10.5 in my S21 measurements. (For each port, with slight variations from one port to the other)
So is the total loss for all 8 ports feeding array is the difference between 10.5 and 9dB (i.e. 1.5 dB to be added to Gain) or I'm completely wrong?
Another Q: If I only use 2 ports of the 8 way splitter... does the expected value become -3dB? Or it always remains -9dB regardless of port terminations?
Your explanations would be greatly appreciated.
AI: The -9 dB figure is only in the ideal case - if the network is lossless. However, in practice, there will always be losses - how much depends on the quality of the device as well as the frequency.
In addition, you need to ensure that your test setup is calibrated. These kinds of measurements should be done using a VNA and phase stable cables, propper torque on the connectors, and calibrate it before measuring at the frequency and power you desire to use using a STOL-calibration. You could easily lose 1.5 dB just in cables and connectors if they are not calibrated out.
To answer your second question: No, you will still get at least 9 dB loss. The splitter cannot tell what load is connected - and if you use only 2 ports and terminate the others with Zo, it will still put the same signal power into the load. Of course, nothing stops you from using a 4-to-1 combiner to combine 4 ports back to one, but you will find additional losses, and there is the matter that you are better of just using a 2 way splitter in the first place.
What happens when the other ports are not terminated? Who knows! This depends on the topology. |
H: How to calculate the output impedance of the BJT in a Common Collector Amplifier?
The book I am reading from (Electronic Devices and Circuits by David A Bell) analyzes the Common Collector circuit by using a H-parameter model as shown.
My confusion is in understanding the output impedance of the transistor. By looking at the circuit, I find the output impedance of the BJT to be RE(since [RE||{1/hoc}]~RE). But the book seems to disagree. To find the output impedance of the transistor it looks like the AC input source has to be shorted, the current due to hrcvo (which is ~vo since hrc~1) should be taken as Ib now and then the Ie corresponding to this Ib is used to arrive at the output impedance as shown below.
Why should we do all of this and not just take RE as the output impedance? I understand that there is a feedback from the output to the input of the amplifier but isn't the value of RE (and hence Ze) independent of that since we choose it to properly fix the operating point of the BJT?
AI: The trick with the CC circuit is that there's local feedback going on.
Look at this schematic:
The output impedance is an indication of how much the voltage at \$V_{out}\$ would change if I draw a little bit of extra current out of that point.
What happens when I do that?
I'm drawing some extra current from the emitter. What would the emitter voltage do? It is not a hard voltage, it cannot supply unlimited current so the voltage at the emitter will decrease a little.
Now what happens?
That drop of the emitter voltage increases \$V_{BE}\$ a little. Increasing \$V_{BE}\$ means that the transistor is "opened further", it will supply more current from the collector.
This extra current from the collector is crucial as it flows to the emitter and tries to compensate for the extra current I was drawing there. This causes the CC circuit to have a very low output impedance. When designed properly this output impedance will be much lower than the value of \$R_L\$ (in your drawings it is \$R_E\$).
So you must take this effect of the collector current into account because it is significant.
As an experienced circuit designer I already know that the output impedance is roughly equal to \$\frac{1}{gm} = \frac{1}{40I_c}\$. At \$I_c\$=1mA that would give 25 ohms, which is generally much lower than the value of \$R_L\$
You might also want to look at this derivation which does not use the \$h\$ parameters. |
H: Using FET as SPST switch to feed H bridge with boosted voltage
My board uses TTL logic, I have a motorised pot that moves too slowly at 5V. At 9V it performs well, I have little LM2577 replacement modules that output the boosted voltage well, but they consume about 30mA at idle, so I only want it on (and in turn powering the motor) when the motor is supposed to move.
The design below shows essentially what is desired.
I'm having a bit of trouble figuring out how I should incorporate this design using a FET or BJT, (have a selection of PNPs and NPNs). Of course I'm open to other design suggestions or ideas.
Thanks!
AI: You could try this circuit
simulate this circuit – Schematic created using CircuitLab
Remove the two 4.7kOhm resistors, and connect the diodes to A2 and A3. When at least one is at 5V, then it means that you want one of the following conditions:
Forward (A3 high, A2 low)
reverse (A2 high, A3 low)
brake (A2 and A3 both high)
Then, the BA6208 must be powered. The two diodes + R1 form an OR gate, and therefore turn on Q1 if at least one of A2 or A3 is high. The collector goes to 0 V, then the PMOSFET turns on.
If both A2 and A3 are off, Q1 is off, its collector is pulled high to 9V and M1 is off too.
Still, I don't know if continuously applying-removing power to the BA6208 might damage it. A better solution would be the following:
simulate this circuit
Then, your program will enable/disable the power, by outputting A4 high/low.
You should implement a software retriggerable monostable, that is:
Do I need to move forward/reverse or brake? Put A4 high and reset a timer.
Have some seconds elapsed since the last forward/reverse/brake operation? Turn off the power, by pulling low A4.
NOTE:
In each schematics M1 must be a 5-V logic level MOSFET. |
H: Emitter follower augmented input current
Hello, I have this emitter follower augmented ( I think that's his name in english)
but I don't know from where is the beta+1 on the Iin ecuation?
AI: Q3 is in forward active mode because the base-emitter junction is forward biased and the base-collector junction is reverse biased.
In this mode we have the very well known characteristic
$$I_c = \beta I_b .$$
Since the current coming out of the emitter is (by KCL) the sum of the base and collector currents,
$$I_e = I_b + I_c = I_b + \beta I_b$$
and thus
$$I_b = \frac{I_e}{1+\beta}.$$
(Note: circuit theory purists would normally take \$I_e\$ to mean the current going in to the emitter, so there'd be some sign changes in the equations above) |
H: Why the voltage across emitter resistor comes out to be Zero while doing the ac analysis of a differential amplifier
As I am trying to understand the half-circuit method of doing the ac analysis of a differential amplifier by going through the derivation available online, I've found that the voltage across the emitter resistor is zero and depending on this fact, the difference mode gain of the differential amplifier is found out.
Now my question is that why the voltage across emitter resistor of differential amplifier comes out to be zero and I am not able to find any proper explanation or derivation anywhere. Please help me with the Half-circuit derivation process of the differential amplifier ac analysis.
AI: You haven't posted a schematic but I think I know what you're asking.
In short, what you're seeing is what's called a "virtual ground". That simplifies the math a lot for a differential amplifier small signal analysis. You want to keep the differential input close to zero so that the transistor stays in the amplification region.
This a differential pair:
And when doing the small signal analysis, you get:
See how the DC sources have become zero for the small signal anaylis. Also, you mentioned an emitter resistor. For this example there was a current source, but the important part is to keep an eye to what happens to the node denoted as 'P'.
Apply KVL around the \$v_{in1}\$ and \$v_{in2}\$ loops to get:
$$ v_{in1}-v_{\pi 1}=v_P=v_{in2}-v_{\pi 2}$$
Anc KCL at the P node:
$$ \dfrac{v_{\pi 1}}{r_{\pi 1}}+g_{m1}v_{\pi 1}+\dfrac{v_{\pi 2}}{r_{\pi 2}}+g_{m2}v_{\pi 2}=0$$
And if the transistors are closely matched (pi resistors and transconductance approximately equal), \$v_{\pi 1}\approx -v_{\pi 2}\$. Then you could use those equations to find that,
$$v_P=0$$
You can find full derivations in the Fundamentals of Microelectronics book by Razavi.
You could also get a graphical feeling for this:
The Y-axis shows \$V_X\$ and \$V_Y\$, these are simply the output signal of both transistors. The differential output is then \$V_X-V_Y\$. They are capitalized because the represent the bias or DC state of the transistor, you don't want to disrupt the bias point. That's why the input signals (\$v_{in1}\$ and \$v_{in2}\$ should be small enough so that it won't steer the bias point somewhere not intended.
Back to the graphic, note that the X-axis represents the differential input. So, right the center of the plot, where \$V_{in1}-V_{in2}=0\$ you can see how I drew a red line. You want to stay close to that point so that you get a linear response or better said, amplify your differential input in a linear fashion. Your gain would be the slope of that red line. The farther away from the center of the plot, the less linear range you get.
You would wisely keep the difference \$V_{in1}-V_{in2} =0\$ or \$V_{in1}=V_{in2}\$ so that you take full advantage of the linear range. Again notice the capital letters here this a DC components of the input signal.
For differential amplifiers, you superimpose a small signal to each of the DC components in this manner \$V_{in1}+v_{in1}\$ and \$V_{in2}-v_{in2}\$. As you can see, these signals are complementary (you increase one and decrease the other by the same amount).
The signals being complementary become obvious when you try to find the difference again: \$V_{in1} + v_{in1} - (V_{in2}-v_{in2})=0\$. If \$V_{in1}=V_{in2}\$ then \$v_{in1}=-v_{in2}\$.
After this, you could take advantage of utilizing the half circuit and simplify the analysis:
Just like the input signals, the voltage at node P has a DC and an AC component, \$V_P+v_P\$ and what becomes zero is the AC component, \$v_P\$. That's a virtual ground or ac ground. For this example, I had a current source but the same applies to the node if there had been a resistor. |
H: Some questions about a comparator circuit used as a buffer
I want to hardware-trigger a module from a separate remote data-acquisition system's analog output. The module's hardware-trigger input is optically isolated to prevent grounding problems. And the module's manual mentions the following as well:
And the data-acquisition system's DAC analog output can max source 5mA.
It seems to me that if I can send a single pulse voltage signal with the amplitude between 5V or 10V to the module I can trigger it. But since the current might be an issue for the DAC, I decided to use a buffer for the trigger signal.
So the following circuit buffers the pulse signal with providing higher current.
R8 is for pull-down when the DAC's connector is unplugged.
R9, D1, D2 are there for reverse voltage protection.
C1 might help for high freq. noise
R1, R2, R3 sets the reference with a hysteresis around 0.5V.
R7 and C2 is to mitigate noise at Vcc of the comparator.
The rest is open collector resistor and PNP transistor to ease the opAmp output current. Here is the sink current info of the comparator(6mA min, 16mA typical value):
Below is the plot by LTspice showing a red 5V input pulse and the blue voltage at non-inverting input Vn(indicates the hysteresis). Other green plot shows the output current of the comparator.
I want to use this circuit for 5V to 10V pulse inputs to obtain a trigger voltage around 12V. It seems in simulation it works for how I want.
1-) But I don't want to cause a delay more than 10ms between the input and the trigger. How can I quantify it? I heard that a large hysteresis can cause delays. Is the best way to check from simulation?
2-) I cannot find the max current that the comparator can source in data-sheet. That's why I used a transistor at the output. Can one help me if he can find/see that?
3- Is there anything fundamentally wrong with this circuit.
AI: 1-) But I don't want to cause a delay more than 10ms between the input and the trigger. How can I quantify it? I heard that a large hysteresis can cause delays. Is the best way to check from simulation?
That should not be an issue. The device itself has a response time aroung 1uS. Hysteresis wont be a problem if you do not have any filtering capacitance in there. Your only possible cause of delays would be too high a capacitance at C1 or a slow fall/rise time at the base of the transistor if your resisters are too large.
2-) I cannot find the max current that the comparator can source in data-sheet. That's why I used a transistor at the output. Can one help me if he can find/see that?
That device, like most comparators, is open-collector output. As such it does not source ANY current. This is important to remember since you need to calculate your hysteresis using R3, R4 AND R5 when the output is high.
3- Is there anything fundamentally wrong with this circuit.
Fundamentally, I don't see anything glaring. It may be serious overkill though that could easily be accommodated with a couple of transistors. With this circuit I might consider decoupling the top of the reference voltage divider using another 100R/1uF filter as you did for the comparator rail just to keep that a little quieter. I might attach the top of R5 there too.
Simpler Transistor Circuit.
simulate this circuit – Schematic created using CircuitLab
D1 just raises the threshold voltage a bit. |
H: How much power does a receiver antenna obtain from a radio station?
I have this problem where a transmitting antenna radiated uniformly in all directions at a radius of r. The station broadcasts at 10 kilowatts. How much power is obtained by a receiver antenna 20km away? The antenna of the receiver is 50cm^2. I am unsure of how to set up an equation for this problem, I know the distance and power, but how would I set this in a equation to find the power obtained by a receiver?
AI: If the antenna radiates in all directions (isotropic radiator), you can consider it as the center of a sphere, where the radius is the distance to the RX.
If there isn't attenuation on the path, the power remains the same, then divide by the sphere area and you got power/area relation.
Knowing antenna's area, you can calculate the power received. |
H: Resistance on Vcc and input pins CMOS
Sorry if my the answers to my question is just "look up the specs of CMOS", I wasn't able to find it, only data on the manufactoring process.
Doing research on a project, being new, I found a forum thread about someone wondering about some CMOS specifications. The numerous answers on this thread feel conflicting to me, excluded the "never leave unconnected wires" rule of thumb.
My questions then are : Are external resistances required for input/outputs/Vcc pins, or are there internal resistances ? If internal resistances are used, how much current are the chips designed for ? Does it depend on the chip itself ? Then what specification should I look for ? Why are there max current on output pins and not min currents too, if the internal resistances are huge (0, and x amps) ?
Sorry if it feels I just need a complete guide on CMOS technology, I wasn't able to find a good one, and sorry too if my questions are simply dumb.
AI: Are external resistances required for input/outputs/Vcc pins, or are there internal resistances?
simulate this circuit – Schematic created using CircuitLab
Figure 1. Various CMOS input configurations.
(a) If the input voltages stay within the power rails - \$ 0 \leq V_{IN} \leq V_{CC} \$ then no series resistance is required.
(b) If the input voltages can go outside the power rails then a series resistor on the input is required to limit the current through the parasitic input protection diodes.
(c) and (d) If the input can be disconnected then a pull-up or pull-down resistor should be used to pull the input to \$ GND \$ or \$ V_{CC} \$. See "Floating Inputs" below for more.
Adding resistance to the \$ V_{CC} \$ pin would be most unusual and never done in standard circuits.
If internal resistances are used, how much current are the chips designed for?
Internal resistances generally are not used. The input resistance is that of the insulated FET gates and this is > 10 MΩ.
Does it depend on the chip itself?
It depends on the logic family as each family will use a standard building block for an input.
Then what specification should I look for? Why are there max current on output pins and not min currents too, if the internal resistances are huge?
simulate this circuit
Figure 2. A simple CMOS inverter. When the input goes high M1 turns off and M2 turns on pulling the output low. When the input goes low M1 turns on and M2 turns off pulling the output high. Note that the parasitic input protection diodes are not shown.
The input impedance (resistance, if you like) is very high. This is indicated in the FET symbol by the gap between the gate and the conduction path: there is no direct current path.
The output impedance is much lower. Again, we can see that the only resistance on the output is that of M1 or M2's fully on resistance. This low output impedance is a characteristic of most amplifiers. A small input signal drives a stronger output signal. This is a requirement for "fan-out" too so that one output can drive the inputs of multiple other gates.
To answer your question, the maximum output current is limited by the current carrying capacity of M1 and M2 transistors. There is no minimum current. The outputs can be left open-circuit.
Floating inputs
CMOS inputs should never be left floating. This is because the input impedance is so high that the input could float to an undefined level between 0 and \$ V_{CC} \$ and the logic state would be undefined. With reference to Fig. 2 again, the danger is that at some input voltage both M1 and M2 will be turned partially on simultaneously. This could result in passing a significant current through the chip via M1 and M2 causing heating, waste of power and possible destruction. The solution is to pull up or down as shown in Figs. 1c and 1d. |
H: Current over CAT6 ethernet cable
How much current can a CAT6 cable reliably handle? I want to use 3 of the cores for +5V and 3 cores for GND. I'm wondering at what current I need to think of another power solution.
AI: At 5V you'll probably run into voltage drop issues before you run into current limitations (if the length is more than a few meters).
Some CAT6 cable is rated as low as 60°C, and some is AWG 24, so if your ambient could be as high as 50°C. the current limitation might be as low as 2-3A. See, for example, this and this.
Edit: If the length could be as long as 10m, and assuming AWG24 size-- resistance is nominally 84 ohms/km so 0.84\$\Omega\$/10m, so three in parallel, round trip, would be 0.56 ohm at 20°C. If 5% voltage drop (250mV) was acceptable, that would be a current of 440mA maximum, so maybe 350-400mA maximum allowing for temperature. |
H: How long would an original gameboy last on a modern lithium battery?
The original Gameboy was famous for it's battery life on 4AA batteries. My HTC One smartphone can last about as long as the GB did back in the 80s.
So how long would an original gameboy last if powered by a modern lithium phone battery?
AI: Let's compare the energy densities of the battery types:
Alkaline battery, 1.8 MJ/L
Lithium-ion, 2.36 MJ/L (best case)
Lithium battery, 4.32 MJ/L
Therefore, if a Gameboy lasted 10 hours on Alkaline batteries, in theory it would last 40.3 hours on Lithium (primary, non-rechargeable), or 20.4 hours on Lithium-ion batteries that occupied the same physical space.
If you used a phone battery, it depends on its size and capacity. Most phone batteries aren't as large as four AA batteries, so you would have to go by the capacity of the battery. Four AA batteries (in series for 6V) have a capacity of around 2500 mAh at 100 mA discharge rate. (The Gameboy Wikipedia entry indicates it requires about 0.7 watts which is a little more than 100 mA at 6V.)
An HTC One battery is a Lithium-polymer battery at 2300 mAh, which I'll assume is 3.7V LiFePO4.
Since the voltages are different, there would have to be some conversion which would introduce efficiency losses, but we'll assume 100% for now.
The four alkaline AA batteries then are 2500 mAh * 6V = 15000 mWh.
The HTC One battery is 2300 mAh * 3.7V = 8510 mWh.
Based on this, you'd get roughly half of the runtime using your phone battery. |
H: Looking for robust reversible prototyping solutions
I've recently started making use of Arduino and Teensy microcontrollers to build various one-off pieces of equipment for my work in a neuroscience lab. Often I find that, after a device has worked well for one project, it needs to be tweaked for the next project in small ways I hadn't anticipated.
My options then come down to: (a) unsolder everything and re-build, (b) buy the same components again and re-build, or (c) build on a solderless protoboard like this Twin Industries product to start with, and just add/reroute the few connections when necessary.
Options (a) and (b) can get too time-consuming (TBH I'm not that great with a soldering iron). But with (c) I always seem to end up with something too fragile to be relied on (knock it once, and I have to hunt down the loose connection).
Does anyone know of a more robust solderless prototyping system? I don't mind if my prototypes end up the size of a shoe boxes rather than cigarette packets, containing the electronic equivalent of Duplo rather than Lego. I'm just looking for something both flexible and robust. I've contemplated making a board that breaks out every Arduino pin to touchproof biomedical connectors but I'd need a way of interfacing small components too. Are there better solutions out there already?
AI: I might think that until someone else finds you another solution my answer will be look at what is called VERO Board and Component Sockets. VERO is a manufacturer, but it is now also made in many varieties by others and often it can be found by that term.
It's basically PCB material with 2.54mm (0.1") spaced holes to fit many of the through hole type components without having to bend anything. Then every component has a socket, from the olden days.
DIP sockets, TO92 sockets, etc.
When bought in bags the sockets or socket strips (20 to 40 pin long strips that you can cut to size to hold chips) are affordable enough at larger distributors or on eBay.
That said, I have to say I have not used reversible engineering in the last 15 years due to a personal lab holding the tools to make double sided surfacemount boards with 8mil (8/1000th inch) size traces and a stock of parts to match. So I am both spoiled and out of the loop. But 20 years ago I started with those sockets and VERO board myself. |
H: Fullwave rectifier theory
Why is it that in full wave rectifiers do you divide the secondary coil by half as stated in this book:
(Source)
What concept am I missing?
AI: what concept am I missing?
If you use a rectifier bridge (four rectifiers), you don't need a center tap. However, if you have only two rectifiers, you need a center tap otherwise there is no path for current.
Consider the following diagram
If there were no center tap, and the load were in series with the diodes, there would be (essentially) no current since one or the other diode is reverse biased during the entire cycle. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.