text
stringlengths
83
79.5k
H: Solar panel MPPT and battery charging I'm trying to understand solar panel Maximum Power Point Tracking theory and how it is done practically for charging battery banks. I think I understand MPPT in a general sense: the solar panel has VI curves which define a specific load in which you will extract the most power. These curves change with environment conditions like light levels, temperature, etc., so the tracking algorithm tries to dynamically find the best load value. It's usually not practical to just change the actual end load that we want to power (and often can't), so we use a switch mode power supply to adjust the output voltage, changing the output current. To balance Pout = Pin (assuming ideal switcher), the panel's current draw changes, and this is how we adjust the operating point on the panel's VI curves. So my question is this: We are changing the output voltage to get the maximum power, but don't batteries typically need a specific voltage to charge them efficiently? Is it better to shoot for MPP of the solar panel or shoot for optimal charging conditions for the battery? AI: Solar panel I-V characteristics are highly non-linear; this results in a Power-Voltage plot featuring a maximum at a given Voltage Vmpp across the panel. As you pointed out in your question, it happens that the IV curve changes over time according to the light irradiance and temperature, and Vmpp changes, too. That's the reason why methods to track Vmpp are sought: squeezing as much power as possible from the source, i.e., the panel. Between your panel and the storage element (battery, supercapacitor) there is an harvesting circuit, based on a (switched) DC-DC converter topology (e.g., boost); MPPT techniques are implemented inside this circuit to keep the input voltage of the harvester (i.e., the output voltage of the panel) as close as possible to Vmpp. Therefore, when you target MPPT, the focus is on optimal power transfer from the source to the harvester (which -in turn- will actually introduce some loss itself, yep!). As RoyC puts it, optimal battery charge is another story. Maybe the schematic below will help: the photovoltaic panel is modelled as a current source in parallel with a diode (representing the PN junction); the goal of MPPT is to keep the voltage V as close as possible to Vmpp. simulate this circuit – Schematic created using CircuitLab For clarity, I have drawn one possible implementation of a Boost-based solar harvester. The IC I put in the schematic is a Schmitt trigger comparator whose task is that of keeping the voltage at its non-inverting terminal as close as possible to Vref. One can set Vref = Vmpp in order to achieve our goal. simulate this circuit Now: how can we generate Vref = Vmpp? Even in this case there are different possibilities: for example, an additional timing cicuitry can be designed to disconnect periodically the solar panel load, so that a peak holder can 'capture' the panel open-circuit voltage Voc. It can be seen that Vmpp is usually an approximately constant fraction of Voc, irrespectively of the the environmental conditions. By knowing the ratio Vmpp/Voc, a voltage divider can be used to obtain Vmpp starting from the stored value of Voc. Considerations about the schematic above: this is just an example of implementation: it should be noted that an external control logic is not required to switch the MOSFET on and off; instead, the comparator output accomplishes this task, which is very useful in applications where power-draining microcontrollers cannot be afforded; the low-power comparator draws its supply from the harvester input terminal; since this has some fluctuation (mostly depending on the inductor value and on the comparator's time delay) an RC filter can be used to smooth it. Other possible harvesting solutions include the use of microcontrollers implementing some sort of 'Perturbe & Observe' algorithm: as shown in another answer, in this case the operating conditions are changed a little bit while monitoring the response of the input power.
H: Solving Currents in BiCMOS Darlington Pair Using KVL and assuming that the BJT is in forward-active and that the MOSFET is under saturation and using the given, I was able to generate three equations with three unknowns: 1) \$\frac{3V-2V}{1000Ω}=I_D+I_C\$ 2) \$I_D=(10^{-3}\frac{A}{V^2})(V_{BE}-0.6V)^2\$ 3) \$I_C=(0.1(10^{-15})A)(e^\frac{V_{BE}}{0.026V}-1)\$ . The problem is that, based on my calculations, the above system yields:\$V_{BE}=1.6V, I_D=0.001A, I_C=-4.8658(10^{-17})A\$. Does this really mean that \$I_C\$ is negative and that the npn BJT \$Q_2\$ is actually not in forward active mode or is there something wrong with my method/equations? AI: Well for this circuit we have \$I_D + I_C = \frac{V_{CC}-V_{Out}}{R_L} = 1mA\$ Additional we knows that \$I_S=I_D=\frac{V_{BE}}{R_B}\$ So we we assume \$V_{BE} = 0.6V\$ we have \$I_D= 0.6mA\$ and \$I_C=0.3mA\$ therefore \$V_{BE} = V_T*ln\left(\frac{Ic}{Is}\right)= 0.7469V \$ (I assume Vt = 26mV). So we have a new value for Vbe, so, the new value for Id and Ic is: \$I_D = \frac{0.7469V}{1k} = 0.7469mA\$ \$I_C = 0.253mA \$ so again we can find new value for \$Vbe\$ \$Vbe =V_T*ln\left(\frac{Ic}{Is}\right)= 26mV *ln(\frac{0.253mA}{0.1fA}) = 0.74254V \$ and the new \$I_D = 0.74254mA ;I_C = 0.25746mA\$ values. And once more I repeat the iteration \$Vbe = 26mV *ln(\frac{0.25746mA}{0.1fA})=0.742995V \$ \$I_D = 0.742995mA ;I_C = 0.257005mA\$ The new \$Vbe\$ value is \$Vbe = 0.742949V\$ At this step, I end the iteration process and conclude that \$Vbe = 0.7429V\$. And \$I_D = 0.7429mA\$ and \$I_C=0.2571mA\$ Since we know the MOS drain current \$I_D\$ we can find \$Vgs\$ \$V_{gs} = V_{th}+\sqrt{\frac{I_D}{0.5k}} = 0.6V+\sqrt{\frac{0.7429mA}{0.5m}} =1.81893V\$ And finally \$V_{BIAS} = V_{BE}+V_{gs} =0.7429V+1.81893V = 2.56183V\$ In all this, calculations I ignore the BJT base current. EDIT To get exact solution you need to solve this: $$I_C = 1mA - \left(\frac{I_C}{\beta}+\frac{Vbe}{1k}\right);I_C = 1*10^{-16}*e^{\frac{Vbe}{V_T}}$$ And if I plug this into computer I get \$ V_{BE} =0.742718V; I_C=0.254735mA \$
H: Finding times in first cycle with given voltage I have the question "The instantaneous value of voltage in an a.c. Circuit at any time t seconds is given by: $$V = 100\sin(50\pi{}t - 0.523)\ \rm{V}$$ Find: The times in the first cycle when the voltage is -40V." Here is my attempt: My final answer is t = 5.949 ms however the solutions say that the answer should be 25.95 ms. Where have I gone wrong ? AI: You have: $$\begin{align*} V_t &= 100\: \textrm{V}\cdot\operatorname{sin}\left(2 \pi\:\operatorname{rad}\cdot25\operatorname{Hz}\cdot\: t - 0.523 \operatorname{rad}\right) \end{align*}$$ And you want to solve for \$t\$ where \$t\ge 0\$ and \$V_t=-40\:\textrm{V}\$. So, let's set \$x\$ as follows: $$ x= 2 \pi\:\operatorname{rad}\cdot\:25\operatorname{Hz}\cdot\: t - 0.523 \operatorname{rad}$$ Then we have: $$\begin{align*} -40\:\textrm{V} &= 100\: \textrm{V}\cdot\operatorname{sin}\left(x\right)\\\\ \frac{-40\:\textrm{V}}{100\: \textrm{V}} &= \operatorname{sin}\left(x\right)\\\\ -0.4 &= \operatorname{sin}\left(x\right) \end{align*}$$ Before going any further, the value of \$x\$ has multiple solutions. The solutions are: $$\begin{align*} x&=2\pi\cdot n + \operatorname{sin}^{-1}\left(-0.4\right)= 2\pi\cdot n - 0.411516846 \operatorname{rad}\\&=2\pi\cdot n +\pi- \operatorname{sin}^{-1}\left(-0.4\right)= 2\pi\cdot n +3.5531095 \operatorname{rad} \end{align*}$$ Combining this information, we have: $$\begin{align*} 2 \pi\:\operatorname{rad}\cdot\:25\operatorname{Hz}\cdot\: t - 0.523 \operatorname{rad}&= 2\pi\cdot n - 0.411516846 \operatorname{rad}\\2 \pi\:\operatorname{rad}\cdot\:25\operatorname{Hz}\cdot\: t - 0.523 \operatorname{rad}&= 2\pi\cdot n +3.5531095\operatorname{rad} \end{align*}$$ These solve out as: $$\begin{align*} t&= \frac{2\pi\cdot n - 0.411516846 \operatorname{rad} + 0.523 \operatorname{rad}}{2 \pi\:\operatorname{rad}\cdot\:25\operatorname{Hz}}=\frac{2\pi\cdot n +0.111483154\operatorname{rad}}{2 \pi\:\operatorname{rad}\cdot\:25\operatorname{Hz}}\\\\ t&= \frac{2\pi\cdot n +3.5531095 \operatorname{rad} + 0.523 \operatorname{rad}}{2 \pi\:\operatorname{rad}\cdot\:25\operatorname{Hz}}=\frac{2\pi\cdot n +4.0761095\operatorname{rad}}{2 \pi\:\operatorname{rad}\cdot\:25\operatorname{Hz}} \end{align*}$$ That's the full answer. But for values of \$t\ge 0\$, you find the following for the first two answers with \$n=0\$: $$\begin{align*} t&=709.723801\:\mu\textrm{s}\\\\ t&=25.949319\:\textrm{ms} \end{align*}$$ I hope that helps out. As you can see, the trick is mostly in taking very careful steps and not to move too rapidly towards a quick "calculator" solution, which would find the first answer, perhaps, but not the second (which appears to be the desired one.)
H: Square AC adapter wire connector I've never seen this type before and don't know what type of connector I need to add to the wires to connect to it. I've looked on Google and haven't seen it. What type of connector is this (the green thing in the photo)? How do I add the appropriate connectors to the wire so they can plug in? AI: I don't guarantee that this is the correct one because i can't measure it but this is similar to what your looking for. https://www.digikey.com/product-detail/en/on-shore-technology-inc/OSTTJ0231530/ED2875-ND/1588450
H: 9v to 12v using buck booster I'm a computer science student with very very less electrical knowledge, I need to boost 12v with 1-2A from a 9v box type battery, on searching I found XL6009 buck booster can step up voltage, can I get enough Amps on using it? AI: I need to boost 12v with 1-2A from a 9v box type battery, on searching I found XL6009 buck booster can step up voltage, can I get enough Amps on using it? No you can't. The problem is not the XL6009 because it can supply up to about 4 A. The problem is the 9 V battery. I''m assuming you intend to use a 9 V PP3 size like this one: This type of battery cannot supply enough power. You need about 12 V 1 to 2 A which means 12 W to 24 W. This type of battery is intended for applications up to like 1 or 2 W maybe. So you need to choose a different type of battery, for example 8 AA cells in series and even that would be pushing the limits. If you need to increase the voltage then instead of looking to build something using an IC like the XL6009 I strongly recommend to use a ready-made module. You can find these on ebay, for example: this one. Building a PCB with a switched converter and all the right components without experience is a recipe for problems if you ask me. You need some experience to do this properly. Modules like the one suggested are cheap and easy to use, giving a much better chance of success.
H: Why is the efficiency of this LED driver circuit so low? I created an LED driver board based on PAM2863ECR http://www.diodes.com/_files/datasheets/PAM2863.pdf The board includes three identical driver circuits to drive three LEDs. I'm not able to wire the three LEDs in series in this application. There is also a regulator and switch to adjust intensity. The board is typically powered from 6 NiMH cells, so the voltage is normally 6-8V. The board works fine and intensity changes as expected, however I'm not getting the efficiency I expected. I never expect to get the max value claimed on the front page of the datasheet (97% for this part), but I expected at least 80% which is what I based the battery life estimates on. Instead I'm only getting about 64%. Running a single LED at full output draws 930mA at 1.54V (1.43W), while drawing 340mA @ 6.6V from the input (2.24W), giving just under 64% efficiency. This is about the same efficiency throughout the input voltage range. I also changed the inductor to different values of the same series part, from 22uH to 68uH, and the result didn't change. This is a 2-layer board, and I thought maybe 4 layers with ground and power planes might help, but I can't see it making that much difference. I'm attaching a PDF of the schematic (in some readers you can click on the parts to see part numbers), and images of the PCB layout. Any suggestions on what I could try to improve the efficiency? If not, any suggestions on replacement driver chips that you've seen good efficiency from? Schematic EDIT: Diodes: https://www.digikey.ca/products/en?keywords=MBR140SFT1GOSCT-ND Inductors: https://www.digikey.ca/products/en?keywords=SRN6045TA-470MCT-ND Image of the schematic if you prefer it to the PDF: EDIT 2: I have done some additional testing. First I tried adding caps across the LED. It gave no measurable improvement in efficiency. I then ran a sweep of the input voltage and saw efficiency drop by about 1% with Vin at 9V compared to 6V. I rewired the LEDs in series and saw a huge increase in efficiency, up to about 86%. Finally I changed the 47uF inductor with a 33uF type having 50mOhm DC resistance. This brought the efficiency up a little more, close to 90%. AI: I'm thinking 4 Batteries may be better than 6. Efficiency improves when Vin is close to Vout. The minimum for the driver is 4.5 V. A fully charged cell will put out between 1.25 and 1.4V. You do not want to discharge them down to under 1.2V to avoid deep discharge which will significantly reduce lifespan. By reducing the number of cells you may also avoid deep discharge when the voltage drops below 4.5 and the chip shuts down. Better efficiency, better battery life, and less batterie$. Not a bad deal Running the Emitters in series you will raise the forward voltage closer to Vin improving efficiency, you will eliminate two inefficient sources of waste. Greatly improve efficiency, reduces watts by 1 Watt, improve battery life significantly, lower the cost and reduce the PCB real estate. You efficiency calculations do not seem correct. 930mA @ 1.54 volts = 1.43 times 3 circuits = 4.29 Watts. And that is just from the IR emitters. So add the expected 20% inefficiency absorbed by the driver and you are at 5.1 Watts. That is twice your input Wattage. For more than you ever wanted to know about batteries check out Battery University BU-215 should be useful to you. In light of the IR revelation, A lower input voltage would help if you can't run them in series. You are at 6:1 in/out ratio. You do need a good output cap. From pg 8 of datasheet: as the ESR of this capacitor appears in series with the supply source impedance and lowers overall efficiency... A minimum value of 10μF is acceptable if the input source is close to the device. Your input is 6x output. Why do you use 3 separate drivers and drive them all with the same intensity? It would be much more practical all around to put them in series. The datasheet recommends a minimum of 33uH. You may be better off with 47uH. Are you sure about the 1.54V forward voltage? That sounds very low even for an amber or red LED unless being driven low by excessive heat. What is the temperature? Any other color than red, red-orange, or amber I would not believe that voltage.If real what's the part number? Their reference design uses a Wurth 744770133 33μH,3.2A, 64 mOhm Max, Qty 1 Digikey: $4.53. Your max efficiency @980mA is specified at about 85%, 97% is for 2 LEDs @ 1Amp, using a 47uH inductor. This looks to be the least expensive 33uH(with a better resistance than Wurth) that Digikey has for a 33uH:Taiyo Yuden NS12555T330MN 33µH, 3.16A, 49.8 mOhm Max, Qty 1 Digikey: $1.96 UPDATE I was looking at the specs on the "LED" you are using. It makes zero sense. Specifically: MCD=70@750mA, MCD=75@1000mA There is something wrong with this supplier. They know not what they sell. MilliCandela is a luminous measurement. Luminous only applies to human visible light. Plus it should state the steradians (sr) at that Intensity or Irradiance (their spec does not differentiate between the two). The proper measurement is is mWatt/sr (Radiant Intensity) or µMoles/sr (photon, quantum). A page from my paper "Understanding LEDs" They do not mention the manufacturer, probably someone on or buying off Alibaba. ColdfusionX is an eBay Store. I would take a serious look at OSRAM IR Emitters,aka LED, (even as much as I hate Siemens). Check out SFH 4714 and SFH 4715 RE: 3 LED String vs. 3 Drivers: "They" need extraordinary justification. I cannot image ANY reason for doing so if the current through each LED will always be the same. Failure rate is very low if the temperature is kept reasonable. If reliability is an issue, then lower the current and increase the number of Emitters.
H: Accidentally punctured a small li-ion battery, any medical harm from the smell? I accidentally made a small puncture in an old li-ion battery while replacing it in my phone (it's stuck on pretty tightly with adhesive). A couple of sparks, but no flames. It has been safely disposed of. The damaged battery emitted a sweet smell after it was punctured, so I immediately went outside to complete the removal. I feel fine and everything, I just want to be sure; is there any potential harm that could come from briefly inhaling the fumes? AI: Not that I'm aware of. I've done the same from time to time. Acute exposure has never been problematic. What's inside is some kind of organic solvent that's proprietary. Knowing that and what we know about toxicity of organic solvents, your body may accumulate these over time if you have repeated exposure resulting in illness years down the line. If this is a one time thing, don't sweat it. Just don't make it a habit.
H: Parallel circuit-find value of resistor I have a parallel circuit with 7.5 ohms as total resistance,75 volts, with 2 resistors. R1=10ohms,R2 is unknown. How can I find the value of R2? AI: Since \$R_{tot}=\frac{R_1\cdot R_2}{R_1+R_2}\$ it follows from simple algebra that \$R_2=\frac{R_1\cdot R_{tot}}{R_1- R_{tot}}\$. In this case, that means \$R_2=\frac{10\:\Omega\cdot 7.5\:\Omega}{10\:\Omega- 7.5\:\Omega}=30\:\Omega\$. The voltage you mentioned isn't required. I'd recommend that you commit both parallel resistance formulas to memory, as well. But use some algebra and prove what I said is right. You may need the practice.
H: Strange circuit at power input I came upon this circuit at the power supply input: The power is usually supplied by the VBUS pin. Now, how dows the circuit work? What is its purpose? I think it is a sort of ideal diode, but can you explain the theory behind? Also what happens if I apply the power (5V) directly on the DCIN net? If you are curious, this is part of the Orange Pi Zero schematic AI: U25 transistor of pin 1,2,6 is connected to function as a diode such that pin 2 and 6 would be one E-B diode drop below VBUS. Transistor of pin 3,4,5 with base to pin-2 would turn on when DCIN-5V is one E-B drop above. Thereby turning off the MOSFET. The net effect is if DCIN-5V is higher than VBUS, then Q10 is turned off. Otherwise Q10 is turned on. Acting like an ideal diode with low drop out as you said.
H: AC Circuit Having Only Capacitor In my book, it is written that at any instant, PD across the Capacitor Plates = Applied EMF ---------(1) Assuming that it's a pure Capacitor of Capacitance C, I think if Voltage across Capacitor becomes equal to the Applied EMF then, it means that the capacitor is fully charged and thus, no current will flow. Also, how can it be true that the given statement (1) is true at any instant? As per the Phasor Relationship between Applied EMF and Current in Circuit, the Current is 0 at π/2 and at odd multiples of π/2 where the Applied EMF corresponds to its Peak Value.So Capacitor becomes fully charged at these instances. Thus, what i think: PD across Capacitor Plates = Peak Value of Applied EMF Where am I wrong? AI: Where am I wrong? I'm sorry to tell you you're wrong end-to-end. You're missing the whole point of the analysis (the wording of the book doesn't help either). "P.D. across the Capacitor Plates = Applied EMF" is just a fancy (and confusing for any newbie) way to say "Let's apply an AC voltage to the capacitor and see what happens then with other magnitudes like current through it". I.e.: simulate this circuit – Schematic created using CircuitLab Putting things this way makes easy to answer this question of you: [...], how can it be true that the given statement (1) is true at any instant? Well, it's true because we're forcing it to be like that so we can see what happens then with the current through the capacitor. Next step is finding how V and I are related. One could expect that if we force the potential between the capacitor plates to vary with time, then the current through the capacitor will somehow a similar behaviour. We recall, as does the book, that: $$ Q=CV $$ and $$ I=\dfrac{dQ}{dt} $$ So with the help of a little math, finally we arrive at: $$ I={\omega}{C}{\xi_0}\sin({\omega}t+\frac{\pi}2) $$ Which, in a mathematical sense, means that current is also sinusoidal and that there is a \$\dfrac{\pi}2\$ phase difference between V and I. However, what does it mean in a physical sense? Well, somehow your intuition about it wasn't bad after all: the Current is 0 at π/2 and at odd multiples of π/2 where the Applied Emf corresponds to its Peak Value.So Capacitor becomes fully charged at these instances That's it! When the capacitor is fully charged, no current flows to it. When it's fully discharged, maximum current flows to it in order to charge it. And the capacitor oscillates through those states all the time while we keep applying an AC voltage to it. EDIT: After reading your comment to my answer, I understand where your problem is: your mathematical approach is flawed. You look at the instant value of \$V\$ and think than you can take an interval of time \${\Delta}t\$ small enough so \$V\$ can be considered constant, that is, \${\Delta}V{\approx}0\$. Then you assimilate this situation with DC (which is also wrong because in DC you charge the capacitor through a resistor, which is absent here) and deduce that if \${\Delta}V=0\$ then \$I=0\$ so no current flows. You then extrapolate that deduction to every possible \$t\$ and conclude that no current flows at all and that the capacitor must be fully charged at all times at the peak value of the applied EMF. Well, this is mathematically wrong for a number of reasons: If you're dealing with intervals, then apply them to ALL magnitudes involved. Your flaw resides in considering \$I=0\$ when you should be considering \${\Delta}I=0\$ instead (which isn't true either, continue reading to see why). When looking at what happens around any arbitrary time \$t_1\$, your \${\Delta}t\$ is an increment to that \$t_1\$. The same thing goes for \$V\$ and \$I\$: your \${\Delta}V\$ will be an increment to \$V_1=V(t_1)\$, and \${\Delta}I\$ will be an increment to \$I_1=I(t_1)\$. Think of \$V_1\$ and \$I_1\$ as initial conditions at the start of interval \${\Delta}t\$. It's wrong to assume \$V_1\$ and \$I_1\$ are equal to zero. Also, it's wrong to think about \${\Delta}V\$ as the difference between the applied EMF and the voltage at the capacitor. As it has been said, there is no difference between the applied EMF and the voltage at the capacitor, it's just forced to be equal. For very small \${\Delta}t\$ intervals, you'll have \${\Delta}V{\approx}0\$ and \${\Delta}I{\approx}0\$. But that doesn't mean at all that the concatenation of time intervals where \${\Delta}I{\approx}0\$ will yield \$I=0\$ and from there conclude that "no current flows, so the capacitor must be charged and \$V\$ must be constant". It's wrong to think like that. Differential Calculus and Infinitesimal Calculus tells us how to deal with things when \${\Delta}t{\rightarrow}0\$. And someone smarter than you and me already used them to work it up for us to build upon it: $$ I=\dfrac{dQ}{dt} $$
H: In ADS, how can I change the electrical length on a transmission line to depend on the frequency sweep? I'm setting up an S-Parameter test on a transmission line, but I want the electrical length to change and depend on the frequency. How can I go about that? The variables that I can put in are all constant-I can't figure out how to make non-constant variables. I also tried putting in a sweep plan, but I can't figure out how to use it as a variable in the transmission line. AI: This effect is called dispersion, and ADS is able to model it. However, you might have trouble with it. The way that dispersion works is limited by the laws of physics, and the ADS simulator attempts to obey these laws. The consequence is that electrical length versus frequency cannot change in an arbitrary way. Using ADS for this type of analysis requires an understanding of dispersion and how it is constrained. This is an advanced topic. Start with the Kirschning and Jansen formula.
H: Do conductors in the reactive near field of an antenna cause loss? I was reading about the reactive near field of an antenna here part of the relevant portion of which is quoted below: "Because of this energy storage and return effect, if either of the inductive or electrostatic effects in the reactive near field transfer any field energy to electrons in a different (nearby) conductor, then this energy is lost to the primary antenna. When this happens, an extra drain is seen on the transmitter, resulting from the reactive near-field energy that is not returned. This effect shows up as a different impedance in the antenna, as seen by the transmitter." I am unsure if I understand this correctly, or at least its implication in the real world. Does this mean that putting any sort of metal near a transmitting or receiving antenna will cause some extra loss in the form of inductive and electrostatic coupling? Would these losses come from the Faraday Effect and essentially using energy from the electric field to charge a nearby metal like charging a capacitor respectively? Does this mean that in the real world antenna and RF designers must ensure that there are no metals or any other conductors within the reactive near field of their antennas? Am I wrong in my understanding, or is perhaps the effect just too small to matter practically? AI: Do conductors in the reactive near field of an antenna cause loss? Not necessarily. Consider a well-designed dipole antenna; you can place an array of "other elements" around it and turn the dipole into a Yagi-Uda antenna: - The Yagi-Uda antenna uses "other elements" constructively to produce an EM emission directed towards a particular direction. These extra elements are in the near-field of the dipole-section of the antenna. The EM radiation becomes focussed like this: - Attribution: By Chetvorno - Own work, CC0, https://commons.wikimedia.org/w/index.php?curid=54323935 If the placing of these elements isn't accurately controlled then you get alterations to the electrical impedance seen at the terminals of the antenna. In fact some Yagi-Uda designs utilize this and convert the natural 73 ohms of the dipole (the driven part of the antenna) into something radically different. The implication of this is that ad hoc placement of perfectly conducting material around a dipole antenna will significantly change the electrical impedance. Basically, the antenna becomes detuned from its optimum frequency; the presense of conducting material lowers the electrical impedance and the dipole becomes what is known as "short". Consider the dipole and what happens when you operate it not at the perfect resonant point: - When the length of the antenna corresponds to half a wavelength (nominal operating point for a dipole) the real impedance is 73 ohms and the reactive impedance is zero. If the antenna is "shortened" by the presence of conducting elements, the "real" part of the impedance falls rapidly towards zero ohms and the reactive part becomes capacitive, rising rapidly in impedance as length shortens. Given that the electrical power delivery system to an antenna relies on impedance matching, you can see that an increase in power loss is inevitable. It's not irreconcilable; you could place a transformer and inductor at the dipole terminals to convert impedances and maintain the same power delivery but extra losses are inevitable. The biggest of these is the antenna conduction loss itself. Once the conduction losses of the antenna start to become a significant percentage of the electrical radiation resistance, you are on the downward slope. Consider also the placement of a really big conductor close to a dipole. Let's call that really big conductor "earth". The graph below shows how the resistive impedance changes as the dipole is raised a distance above ground: - If you placed the dipole only a small distance above ground (0.2 wavelengths or less) you can see that the impedance is significantly reduced and gets smaller as ground approaches. The bottom line of what I'm trying to say is that the wiki article is correct but, it is secondary to the bigger picture that I've tried to outline above. Losses due to impedance mismatches (brought about by localized conductors/materials) are much more significant than the actual dielectric or conduction losses in those materials.
H: How to calculate the required torque or HP of single phase induction motor to carry a massive object? I need to know the power of a motor in Hp required to move a vehicle of about 300 Kg. The vehicle is equipped with gear assembly and required to run at 20 to 25 Km/h. The electric motor that is i used in vehicle is single phase induction motor( 1440 rpm , 50HZ , 220V, IHP) . I want to to know how much HP of the motor will be required to carry a almost 400Kg kg with a person . ( 300kg of vehicle and 100 kg for two persons) How can we calculate the required torque to move a massive object by means of gear assembly ? AI: Calculate separately the powers you need for acceleration (simple Newtonian physics) hill climbing (ditto, once you decide what speed you want up what gradient), rolling resistance (you'll need to research that, for the ground surfaces you're crossing. It depends on speed, ground surface, type of tyre, wheel size etc, you'll find plenty of info online to get you started) Air resistance (again, some research needed, but you can estimate a Cd and you know the frontal area from the bodywork design. Again there's plenty of info online) Losses in the gear mechanism Add these together and you have a minimum figure for the required power, you probably want to add 10% to 50% as a safety margin. (As you probably don't need full acceleration uphill, exercise judgment whetehr to add both of these numbers, or the larger of the two). Torque (Nm) is simply power(W) / rotational speed (radians/second). Torque at the motor for a given velocity obviously depends on wheel size and gearing.
H: LM5134.MOSFET driver Spice model not working in LTspice I downloaded the Spice model of the LM5134 MOSFET driver from the download page, created a symbol and created a schematic to test the model. You can download the zip archive containing the schematic, model and symbol here. In the following I attached a screenshot from the schematic and a graph, which shows the voltage over time of the LM5134 pin OUT. In my opinion, the graph should show an output of 12 volts and not ~0V. Since I'm new to LTspice I'm not sure that I implemented the model correctly. Could somebody please review my model? AI: First of all why do you short the output pin via R1 resistor? In LTspice \$10m\$ is interpreted as \$10m \Omega = 0.01\Omega \$. Also we can find in data-sheet this information: In your circuit \$V_{DD} = 12\$ therefore \$Vin > 0.67*12V = 8.04V \$ LM5134B is a TTL version After I fix this the simulation look like this:
H: Distribution of Current in Kirchoff's Junction Law I know that Kirchoff's law says that the incoming current is equal to outgoing current. But I want to understand his: suppose we have 4 wires like the one in diagram. So let us consider current i1, comes to the junction and gets split into three direction towards i2, i3, i4 and similar is the case with current i2 but then why we imagine only the current i3 and i4 as outgoing current whereas current is also going to i1 and i2. May be I am missing something but I am stuck on this problem for very long. AI: It's just an example. You may imagine a different case or example if you want. Any of those current may be inflowing or outflowing, as long as total current inflowing equals total current outflowing. Also, currents inflow or outflow depending of the conditions in other nodes. If there is a negative voltage difference with respect to another node and an impedance low enough (i.e., finite) to it, then there will be an inflow of current.
H: Why are OR gates using transistors different from OR gates using diodes? There are two ways to make an OR gate: and: But with diodes it looks easier to make than with transistors, isn't it? What are the advantages of the transistors version and drawbacks of the diodes version? AI: "There are two ways to make an OR gate" and they are both crap unless combined with other (voltage amplifying) stages. In both circuits the output voltage will be 0.6V lower than the input voltage, hence the need for apmplification stages. The difference is where the current comes from: for the diodes version, all output current must be provided by the input(s). For the transistor version the inputs deliver only the base current, which is (very) small compared to the output current. And BTW the base resistors are not needed.
H: Impedance of BNC vs output impedance of function generator I'm a bit confused on output impedance of function generator and coaxial cable impedance. Consider a function generator with output impedance of \$50 \Omega\$. Suppose that I connect to it a BNC \$50 \Omega\$ coaxial cable and then i connect it to my circuit. I can think of this configuration as in picture simulate this circuit – Schematic created using CircuitLab My question is: how big is \$R_{int}\$? \$50 \Omega \$ or \$100 \Omega\$? And what does contributes to \$R_{int}\$? The function generator output impedance or the coaxial cable impedance or both? AI: There are two ways to represent this, one which corresponds to an ideal model, and one which is realistic. The idea model: You have an ideal voltage source (with zero output impedance) with a \$50\Omega\$ resistor in series (\$R_{int}\$), and so the total output impedance is 50Ω. In your schematic above, the voltage source is ideal, and so \$R_{int}\$ would be \$50\Omega\$. The realistic model: The voltage source is not ideal and has some output impedance, and then the series resistor is selected so that the total output impedance is \$50\Omega\$. For instance, let's say there's an op-amp in there (quite likely). The op-amp has some output impedance, \$R_o < 50 \Omega\$, because it is not an ideal voltage source, and then the series resistor \$R_{er}\$ (internal to the function generator, not internal to the op-amp) is selected so that \$R_o + R_{ser} = 50 \Omega\$, and thus the total output impedance is \$50\Omega\$. If you are modelling circuits in a simulator like LTSpice, you can do this two ways: you can add a \$50\Omega\$ resistor to an ideal voltage source, or you can set the series resistance of the voltage source to \$50\Omega\$. When designing a real circuit, more care is necessary and you must carefully read the datasheet to determine the output impedance of your driver. simulate this circuit – Schematic created using CircuitLab To sum up: ...And what does contributes to \$R_{int}\$? The function generator output impedance or the coaxial cable impedance or both? The internal impedance of the voltage driver and a resistor inside the function generator contribute to \$R_{int}\$. The cable impedance does not contribute to this. The function generator's output impedance will be \$50\Omega\$.
H: Is it bad to let an oscilloscope trace go off screen? Lets suppose we are talking about a reasonable modern scope such as a Rigol DS1054Z. I want too look at the ripple at the top of a 5v square wave. I'll change the volts/division and offset so that the top of the square wave is centered on screen. In this scenario the bottom of the wave form is way off screen. Is this bad practice? What does the analog front end do when the waveform is off screen? AI: In general it is not bad practice to offset the waveform to measure a small part of it. As other posters have mentioned it can affect the accuracy of measurement. Good scopes can often do 8-10 screen heights of offset but I've used some that suffer problems with only 3-4 screens of offset. There is usually a specification for the amount of allowed offset. In the case of the Rigol DS1054Z it is described as Offset Range: This is the allowable offset that will still meet the specifications described elsewhere in the specification. Usually the sort of effects I see are the baseline wander but you may also see changes in dynamic response. Make sure that the probe is compensated correctly if you are offsetting a significant amount or you may get an error in voltage measurements - I've been bitten by that a couple of times wondering why voltages are not what I expect. kevin Rigol DS1054Z specification
H: Matching JFETs for differential amplifier application How to choose a properly matched pair of JFETs for differential amplifier? Is it enough to measure their Idss? AI: To be on the safest side both \$I_\text{DSS}\$ and \$V_\text{P}\$ should be checked and matched, it is well known that those two JFET's main parameters usually spread widely. What is less known is that they are strongly correlated, at least for same manufacuter and lot. A look to this \$I_\text{DSS}=f(V_\text{P})\$ scatter plot done on over 200 different JFET may clarify ( source viva-ananlog.com) matching for \$I_\text{DSS}\$ will most likely accomplish good \$V_\text{P}\$ consistance too, and viceversa. Then you have to known your circuit requirements, how much unbalance you may tolerate and eventually include some trimming if not confident.
H: What are Hall sensors used for in a brushless DC motor? I'm trying to buy a brushless DC motor for a hobby project, and I found a nice one, which lists the information table I pasted at the bottom of this message. As you can see at the top of the table you can choose between one with, and one without a Hall sensor. So I was reading up on Hall sensors, and I read that Hall sensors can measure the strength and direction of an electromagnetic force. And (as far as I understand) this can be used for measuring the position and speed of rotation within a Brushless DC motor. My questions are: Am I correct in what I say above? I also need a rotary encoder for my motor. Can a Hall sensor be used for the same purpose as a rotary encoder? Can a motor with a Hall sensor be reversed or does that have nothing to do with it? Or am I wrong here and is the Hall sensor used for something completely different? AI: The Hall effect sensors provide a positive indication of rotor position (it has the magnets on it for your type of motor). This allows the 3-phase coils to be driven appropriately (commutated) in sequence depending on rotor position. You could read this for some help. Sensors add capability for both higher starting torque (much higher) and higher RPM. In a sensorless 3-phase motor the torque at zero speed (high slip speed compared to rotor position) is much less than with a sensored motor (commutated in sequence with rotor). This is the main benefit for sensored drives but the controllers are specifically designed to support sensed commutation. If you use the sensored motor then you can detect 6 states (with 3 sensors) and so could use them as a crude 60 degree encoder. You'd have to generate the position signal with an MCU unless your controller provided outputs. Here's a paper discussing high resolution rotor position sensing using Hall effect sensors if you are willing to do some DSP work. Whether you buy sensored or sensorless BLDC motors they can be driven CW or CCW.
H: Flow of preemptive multitasking execution of program I am reading this article about preemptive multitasking and I didn't understand few things in the article: The explanation says Figure 1 shows the execution timeline for two tasks and an ISR. First, the ISR preempts the lower-priority task. But that ISR's execution makes the higher-priority task ready to use the processor again. So the scheduler selects that task to run after the ISR, further delaying the return to the preempted task. Note that the processor considers the lowest-priority interrupt in a system more important than its highest-priority task. Figure 1: , My questions are : Shouldn't the exit from high-priority task be done by returning back to the ISR and then returning back to the low-priority task? How is the lowest-priority interrupt in a system more important than its highest-priority task? AI: 1) the diagram show the execution of 'user' (task + interrupt) code, not necesarily how the swithing is done. In some systems all switches (except maybe the interrupt activation) involve a switch to the tasking supervisor, and only then a switch to the next thread. 2) all interrupts have a higher priority than all threads. Interrupts are supposed to handle things that can't wait, and take very little time to handle. Taks are supposed to handle things that take longer and can wait (a little).
H: High-side driver IC use of diode in the npn transistor BE I would like to know why is used a diode between the BE of the npn in this circuit. The npn is used to boost the current to deliver to M2 gate in this bootstrap circuit. Is it maybe needed to get rid of the accumulated charge during ON operation of the npn itself? (conductivity modulation) Here another high-side and the diodes are still present AI: Without the diode (= no connection), what would be the path to discharge M2's gate?? And without the diode (= shorted) there would be no role for the NPN transistor.
H: Do Step-Down Transformers Increase Total Power Consumption? Firstly I am not at all experienced in electrical matters so forgive any wrong terminology. Here's the situation: I recently moved out of US to a country that uses 220v. We have a single phase step-down transformer that provides 120v to the entire house. There are a few appliances that we would like to order with the option of either 110 or 220 versions. (220 versions are more expensive) What I would like to know is, is there an increase in power consumption if I am to run an appliance through the step-down system vs the direct 220 sockets? eg. 300w food dehydrator 110v version run through transformer vs 300w 220v version plugged into native wall socket Another way to ask the question would be; Is the total power consumption of a 600w machine run through a step-down transformer 600w? Or is it more? Thanks for any insight you can provide on this! AI: For an ideal transformer, power in equals power out: it's 100% efficient. For a realistic AC line step-down transformer, power in is a little bit more than power out: it's not quite 100% efficient, but it should be close. Thus, if you plug a 300W load into a step-down transformer (assuming the transformer is rated for more than 300W), expect it to draw a little more, perhaps 325W - 375W depending on quality of construction.
H: ATmega328P firmware flashing interrupted - is it fixable? I am working on some PCB with an ATmega328P on it. I use a Pogo connector because we have to program and test the PCB outside. I program with usbTiny, (mosi/miso/rest/clk/power) Anyway, many times during programming I move a little bit which disturbs the Pogo pin contacts and get a verification error. Then I start again and flash it successfully. But sometimes, after a movement and a mismatch on verification, I can not flash it any more, like now. I get : avrdude: initialization failed, rc=-1 Double check connections and try again, or use -F to override this check. An error occurred while uploading the sketch I got extremely tired from manufacturing again and again :( and I am sure the chip is still OK. This will probably happen again. I have read that there are ways to save it, like serial programming or oscillator. How exactly can I do this with serial? VERBOS: Using Port : usb Using Programmer : usbtiny avrdude: usbdev_open(): Found USBtinyISP, bus:device: 020:013 AVR Part : ATmega328P Chip Erase delay : 9000 us PAGEL : PD7 BS2 : PC2 RESET disposition : dedicated RETRY pulse : SCK serial program mode : yes parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 ByteDelay : 0 PollIndex : 3 PollValue : 0x53 Memory Detail : Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00 signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00 Programmer Type : USBtiny Description : USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/ avrdude: programmer operation not supported avrdude: Using SCK period of 10 usec avrdude: initialization failed, rc=-1 AI: It seems likely that you have inadvertently changes the fuses to one of: Disable /RESET Different clock speed or clock source Disable SPI programming To recover this you need to use a "high-voltage" programmer that involves holding /RESET at +12V whilst specific sequences of commands are sent through most of the other pins. This may be difficult with your "pogo pin" arrangement. It may even be impossible if putting 12V into /RESET damages other circuitry (eg. if you have a pull-up resistor that would bleed 12V into the 5V line). I have a post about using another Arduino to do high-voltage programming here. You can see that there are a lot of wires, and it may not be practical to do what with pogo pins. You can also use an AVR Dragon board to provide the necessary signals and pin-outs. However this would require that you either remove the chip and place it inside the programmer, or run something like 18 wires to the board, similar to the earlier solution. I suggest, whilst testing, that you solder on a 6-pin header suitable for doing your SPI programming. That will eliminate the pogo pins, and give you a reliable contact for programming. Once you have debugged it the production models won't need that. What about external oscillator? You could use my chip detector sketch which would help show if the chip is unresponsive, or has merely had some fuses changed (eg. clock source). Example output from the sketch: Atmega chip detector. Entered programming mode OK. Signature = 1E 95 0F Processor = ATmega328P Flash memory size = 32768 LFuse = FF HFuse = DE EFuse = FD Lock byte = CF Bootloader in use: Yes EEPROM preserved through erase: No Watchdog timer always on: No Bootloader is 512 bytes starting at 7E00 Bootloader: 7E00: 11 24 84 B7 14 BE 81 FF E6 D0 85 E0 80 93 81 00 7E10: 82 E0 80 93 C0 00 88 E1 80 93 C1 00 86 E0 80 93 ... 7FE0: E7 DF 80 32 09 F0 F7 DF 84 E1 DA CF 1F 93 18 2F 7FF0: DF DF 11 50 E9 F7 F4 DF 1F 91 08 95 FF FF FF FF MD5 sum of bootloader = 0F 02 31 72 95 C8 F7 FD 1B B7 07 17 85 A5 66 87 First 256 bytes of program memory: 0: 0C 94 35 00 0C 94 5D 00 0C 94 5D 00 0C 94 5D 00 10: 0C 94 5D 00 0C 94 5D 00 0C 94 5D 00 0C 94 5D 00 20: 0C 94 5D 00 0C 94 5D 00 0C 94 5D 00 0C 94 5D 00 30: 0C 94 5D 00 0C 94 5D 00 0C 94 5D 00 0C 94 5D 00 40: 0C 94 80 03 0C 94 5D 00 0C 94 C9 00 0C 94 5D 00 50: 0C 94 5D 00 0C 94 5D 00 0C 94 5D 00 0C 94 5D 00 60: 0C 94 5D 00 0C 94 5D 00 E5 01 11 24 1F BE CF EF 70: D8 E0 DE BF CD BF 11 E0 A0 E0 B1 E0 E0 E9 F8 E0 80: 02 C0 05 90 0D 92 A2 32 B1 07 D9 F7 11 E0 A2 E2 90: B1 E0 01 C0 1D 92 A2 3C B1 07 E1 F7 10 E0 CA E6 A0: D0 E0 04 C0 22 97 FE 01 0E 94 42 04 C8 36 D1 07 B0: C9 F7 0E 94 1F 02 0C 94 46 04 0C 94 00 00 08 95 C0: FF 92 0F 93 1F 93 06 EA 11 E0 C8 01 40 E0 52 EC D0: 61 E0 70 E0 0E 94 FA 00 C8 01 0E 94 44 03 C8 01 E0: 60 E0 71 E0 0E 94 75 03 91 E2 F9 2E E0 E0 F0 E0 F0: F0 92 57 00 E4 91 C8 01 6E 2F 40 E1 50 E0 0E 94 Source for sketch on GitHub - in "Atmega_Board_Detector" folder.
H: What is a reference frequency for electrical length? There is an option for the transmission lines in ADS which says "Reference Frequency for Electrical Length" What is that supposed to be? In the transmission line equations, I don't know of any reference frequency. Is it \$\beta\$ or is it \$l\$? AI: The electrical length is \$\frac{\beta{}l}{2\pi}360^\circ\$ (assuming ADS wants this parameter given in degrees, a detail I don't recall). For example, if the transmission line length is equal to one wavelength long, you'd specify the electrical length as \$360^\circ\$. But ADS will assume the physical length of the line is not magically changing depending what signal is sent through it, meaning that the electrical length changes in proportion to the frequency. Therefore you must also tell it at which frequency you are specifying the electrical length, so that it knows how to adjust this parameter when simulating at any frequency. For example, say you know the electrical length is 360 degrees at 100 MHz. You specify in the model that the electrical length is 360 degrees and the reference frequency is 100 MHz. Then ADS knows that that means 180 degrees at 50 MHz or 720 degrees at 200 MHz.
H: Benefits of using an External A/D converter with ATmega128 I am new to electronics and working on my first project. Can someone explain why you would use an external A/D converter instead of the on board one? According to Mplabs the ATmega128 has a 8-channel 10-bit A/D converter? is it just less accurate? AI: It would typically come down to some aspect of performance. If you want 12, 16 or even 20 real bits of result your 10-bit ADC will be woefully inadequate. In some cases it might be functionality- reference range, or differential input, or maybe an on-board PGA (programmable gain amplifier) or current sources. Probably conversion speed is not going to be a reason because the AVR is not all that fast, but you might want a large analog bandwidth for undersampling an RF signal.
H: In ADS, what are the differences between the lumped components and the lumped component models? I'm trying to put in some ideal inductors and capacitors into my schematic, but there are two options: "Inductor" and "Inductor Model". What are the differences between the two? AI: A model is not a circuit element. It doesn't have any terminals that can connect it to wires. It just collects some parameters so that actual circuit elements can be made alike by referring to the model. It's not common to use models for passive elements, but it's very common to use them for active devices like BJTs, MOSFETs, or diodes.
H: Applied Power on TVS Diode I need to calculate the Applied power on a TVS Diode, what I know is P=U*I, I am applying 5v voltage on the TVS Diode but I am wondering what should be the Current value? Should I use the Leakage current as it is reverse Biased? also can this be applied on any type of reverse biased diode? AI: Yes. You are right. In simple terms power dissipation is simply the product of the applied reverse voltage and the reverse leakage current. The reverse leakage current varies exponentially with the temperature. Hence the power dissipation will be proportional to the temperature. Here is one Example of computing reverse losses in a diode in a typical application. Another example from one of the TVS diode datasheet from Vishay: For simplicity, you can take worst case reverse leakage current and reverse voltage to get power dissipation during normal operation.
H: Hold Time Violations with Shift Registers/Ring Counters I have read (and been told) numerous times that for a shift register, the clock should run reversely to the data (e.g. http://www.edaboard.com/thread103493.html). Main Question: Is this definitely also true for Ring Counters (or LSFRs)? I am building a block like this, where the output is again connected to the input ("ring counter"): Each square consists of a D flip flop and a 2-1 MUX which initializes the register from D when LOAD is high. This is just a tiny example, in reality it will be between 20 and 30 registers. Now I am facing unexpected problems which I think are due to hold time violations. I nailed down one problem when initializing the register with "11000...1". In the first cycle, all data is consistent. However, in the second cycle, the content is "01100....0" instead of "111000...0". The clock of the last register is the fastest, so it switches from 1 to zero first (which is the output and also input to the first register). However, the clock of the first register is much delayed and hence stores the new value 0 rather than the old one, 1. So I doubt that this rule applies to ring counters/LFSR. If this is the case, what is the correct way to implement a ring counter to minimize hold time violation issues? AI: There are two ways to do this and a lot depends on the technology of the D types. When the D type has a significant hold time then you need to run the clock as you have shown and making ring counters or other circular shift registers will be impossible unless you add an extra flop or latch at the high end of the register to temporarily store the top or end bit until the clock reaches the other end. Even with this you are faced with a race condition of clock propagation against the last D flop propagation delay+first flop setup time. Most technologies today have a low or zero hold time requirement. In this case you can concentrate on getting the clock to the all flops at the same time using a "clock tree". In this you drive multiple flops from one buffer, if you cant drive all the flops from one buffer you use multiple buffers and balance the fan out of each in an attempt to keep propagation times the same.
H: PIC18 Assembly Handling 16 bits I've got a colour sensor that is semi-functional at the moment. I am fairly new to Assembly, PIC especially, and I am confused as to how to handle a "high" and "low" address for a number. Let me explain. When I read from my colour sensor, I have to read from a high and low address. This much is not a problem, rather my issue is processing this number after I read it. The tutorial that I followed does something like this: colour1 = (addrH << 8) | addrL ... Which makes sense: we have 16 bits, left shift 8 to place the high bits then or to handle the low bits. My question is, what is the best way to do this in assembly? I've ignorantly tried something like this SHIFT_8L macro count rlncf addrH movlw b'11111110' andwf addrH,1 decfsz count bra SHIFT_8L movff addrH, WREG iorwf addrL, 0 movwf final endm But really, all this is doing is just moving addrL into final. Ultimately I am going to have to multiplexing to see which colour dominates and so what's the most efficient way in doing this? Thanks! Edit 2017/02/21h47 I am using the PIC18F4620 and am interfacing with a TCS34725 Colour Sensor. AI: On a 8 bit machine, you don't need to shift things around by 8 bits. Just move them into the appropriate byte in the first place. What you seem to be missing in the code snippet you show is that the accumulator and all data bytes are only 8 bits wide. Shifting a byte left 8 times will just clear it regardless of the original value. To do the equivalent of the C code you show: ; In the variable definition section: ; color1 res 2 ;reserve 2 bytes of RAM for the variable COLOR1 ; Later in executable code: ; movff addrL, color1+0 ;copy addrH:addrL into color1 movff addrH, color1+2 Using color1 later would be done one byte at a time. To add it with another 16 bit value, for example: Use ADDWF to add the low bytes, store the result, Use ADDWFC to add the high bytes, store the result.
H: Interfacing Switch Input with Seven Segment Display using ARM 7 I am trying to detect a switch input so that, if the switch is pressed, a number is incremented on the seven segment display. For example if the seven segment display shows 0, and the switch is pressed, the SSD will now show 1. If pressed again, it will show 2 and so on. My seven segment display is connected on P0.0 to P0.6 MY switch is on P0.9 How can I detect each time the switch is pressed? I am trying to increment a variable k in my program so that each time the switch is pressed, k is incremented, and thus I will be able to perform different functions each time the switch is pressed. However this part is not working properly. I am thinking something similar to the following program. However, I must be overlooking something as only the first button click is working. When the switch is pressed, 1 appears on the display. Nothing happens when it is pressed again. #include <LPC21xx.h> #define a 0x00000001 #define b 0x00000002 #define c 0x00000004 #define d 0x00000008 #define e 0x00000010 #define f 0x00000020 #define g 0x00000040 void small_delay (void); void infinite (void); int main (void) { int k = 0; unsigned int SW1; PINSEL0 = 0; //Set P0.0 - P0.15 as GPIOS PINSEL1 = 0; //Set P0.16 - P0.31 as GPIOS IO0DIR = 0xFFFFFDFF; //Setting P0.9 as input for SW1 while (1) { SW1 = IO0PIN & 0x00000200; //switch connected on P0.9 if ( SW1 == 0x00000200 ) //when not pressed { } if ( SW1 != 0x00000200 ) //when pressed { k++; if (k == 1){ IO0SET = b; IO0SET = c; //displaying number 1 } else if (k == 2){ IO0CLR = c; IO0SET = a; IO0SET = b; IO0SET = g; //displaying number 2 IO0SET = d; IO0SET = e; //small_delay(); } } } } void small_delay (void) { unsigned int i, j; for (i=0; i<1000; i++) { for (j=0; j<1000; j++) { } } } Any suggestions or pointers on what I could improve, would be appreciated. AI: Two issues I can see. Firstly when setting the display to show a 2 you don't first clear the display so all of the segments that were lit remain lit. Secondly my guess is that you are seeing switch contact bouncing issues. When a switch or button closes the contacts touch, bounce apart, touch again, bounce apart etc... this can go on for several milliseconds and will look like lots of very fast button presses to the software. The techniques to avoid this are known as debouncing, you can either implement them in hardware (a low pass filter on the input pin) or software (wait for the value on the input to remain stable for a fixed length of time) or a mixture of both. For details on how to implement this sort of thing see google or search here for debouncing.
H: How to control thermal printer from micro-controller and choose it The project is to print barcode and some text with thermal printer using micro-controller. Initially I chose RP58 which has this command set and serial port. So to control the printer, do I just have to send bytes according to the command set, only? (Since I'm buying new one, I want to confirm). And in the document, "2.LF" is to print data in "print buffer", but I couldn't find command to set data in print buffer. But I guess, If I send "ON" using "47.ESC = n" command, printer might receive data into print buffer. How does printers usually receive their printing data (or texts). Since I'm using printer for development purpose, do you have better suggestions? I'm looking for printers, which are cheap, easy to acquire and work with using controller. AI: Although I have not used that specific printer, I'll answer based on previous experience with similar printers. So to control the printer, do I just have to send bytes according to the command set, only? You should also consider the interface handshaking, to avoid over-running the input buffer of the printer. That's why it is best not to send commands "blind" to the printer, but check the state of the hardware or XON/XOFF handshake (whichever you configured on the printer), before sending commands or data. Since the printer uses an RS-232 serial interface, not logic-level, you will need to use suitable interface ICs for the data and handshaking signals from your MCU. See the printer's user manual for more details about the handshaking signals used by the printer. On the download page of the manufacturer's website for that printer, the "58 Driver & Tool" download for the RP58 printer family contains a Windows utility in the "PrinterTool" folder, to set hardware or XON/XOFF handshaking, serial data rate, and other initial printer settings. And in the document, "2.LF" is to print data in "print buffer", but I couldn't find command to set data in print buffer. To send printable characters to the printer, you just send the relevant ASCII bytes e.g. send the byte 0x31 followed by Line Feed (0x0A) to print the character "1" on the paper. Again, take care about the handshaking. But I guess, If I send "ON" using "47.ESC = n" command, printer might receive data into print buffer. I expect the default state when starting the printer, would be that it will be "online", so that this command is unlikely to be necessary unless you have sent the "offline" command first. How does printers usually receive their printing data (or texts). As I explained above - just send the ASCII characters, followed by LF (0x0A) when needed. Since I'm using printer for development purpose, do you have better suggestions? I'm looking for printers, which are cheap, easy to acquire and work with using controller. That is a shopping question and so it is off-topic. Remember, readers cannot know what is cheap for you, easy to acquire for you, and all your other purchasing considerations (e.g. good technical support, on-going hardware availability etc.).
H: Center tap transformer How can I convert a 113B13 transformer to a center tap transformer? Is like this, for example: - primary coil: 1 and 2 pins. - secondary: 3 and 6, where 4 and/or 5 is the center tap? Will this work? AI: Connect pins 4 and 5 together, and it becomes the center tap. Between 1 and 2 would then be the primary.
H: Measuring computer power usage I am trying to optimize the power usage of a custom application (C#) running on an embedded computer (Intel i7, Windows 7). To do so, I am measuring the current that the system requires while running the application. This current fluctuates; every second I get a different reading using a regular multimeter (Fluke 175). This makes me wonder about the accuracy of the reading. 1) If I would calculate the average of these readings, would this be a good indication of the power usage? Or would I miss high frequency peaks / dips in the current? 2) Could this be solved by taking multiple measurements per second using some sort of current sensor with a microcontroller and averaging the values? 3) If so, what would be a good rate to take measurements at; 10Hz? 1000Hz? 4) Could adding an RC-filter between the current sensor and the ADC of the microcontroller help in some way? This is my first question on StackExchange, please let me know if I'm making any mistakes. Edit: The goal is to get a realistic power consumption estimation so we can improve and predict battery life. AI: If you are trying to calculate things like battery lifetime, then you want the average current or power, depending on how your power supply system works. If the voltage is constant, then simply averaging the current and multiplying this by the fixed voltage yields average power. The problem you are running into is aliasing. Sampling every second does not give you a valid picture of the current since that current apparently has significant frequency components above 500 mHz. The solution is to either sample so fast that there is little content above half the sampling frequency, or low pass filter the result to remove the content above half the sampling frequency. The latter is easier, and all you need if you just want to find "average" current consumption. Put a low pass filter between whatever is producing the current signal and where it is sampled. For example, let's assume you are using a low-value current sense resistor and are measuring its voltage with your voltmeter that samples at 1 Hz. For example, two poles of R-C filtering at 100 mHz should help a lot. Each could be realized with a 10 kΩ resistor in series followed by a 160 µF cap across the signal. Try that and see if it gives you the right combination of not being too jumpy, but still responsive enough.
H: Is electrical induction achieved more efficiently by coiling a wire than using a cylinder? I'm currently learning the concept of electrical induction and came up to a realization that if we use a cylinder or a huge strand of wire/conductor instead of coiling tiny wires, we should be able to achieve the same (or probably greater) electrical induction. What should be the obvious and scientific difference and implication for this? Sorry, newbie question here. AI: Faraday's law of induction says simply: - Induced voltage = \$N\dfrac{d\Phi}{dt}\$ where N is the number of turns. So, if you have many turns you get more voltage. This is usually the main motivator for winding many turns but, one turn is fine and can be just as good (and sometimes better) if the frequency is high enough because notice that \$\dfrac{d\Phi}{dt}\$ tells you that induced voltage is also proportional to frequency. However, one further important fact is that a solid sheet conductor in a varying magnetic field will be very inefficient due to eddy currents induced in the sheet. This is why transformers use insulated laminations or ferrite (low conductive materials) in their construction. These eddy currents sap the field and reduce induction.
H: How does "slightly" altering the physical construction of an antenna change its impedance? Inspired by Phil's comment on this answer... Bending the dipole to make it more like a V can also serve to get the impedance to 50 ohms. Likewise, bending the ground plane leads for a 1/4 wave whip alters the the antenna's impedance. Backing up a little bit, my understanding of antenna matching is to get the impedance at the feedpoint of the antenna equal to the impedance of the feed line. With Ohm's Law being V=IR, the antenna should be (or can be) designed such that the voltage and current of the standing wave produces the desired impedance. I have 2 closely related questions: Specifically regarding Phil's comment, why does bending a dipole antenna change its impedance? What's the "mental" model of how an antenna's impedance is determined? I'm trying to get a better intuition of how slightly changing an antenna (like bending the ground plane leads) changes the impedance AI: why does bending a dipole antenna change its impedance? This is quite a simplistic answer. An antenna has to "interface" with free space. Free space has an impedance defined by \$\sqrt{\dfrac{\mu_0}{\epsilon_0}}\$. This turns out to be near-enough 377 ohms when you plug the numbers in. It's the same as a transmission line - it has \$\sqrt{\dfrac{L}{C}}\$ that defines its high frequency (usually > 1 MHz) impedance. So. if you adjust the dimensions of a piece of coax you get a different value for the characteristic impedance. If you adjust the antenna mechanically you are adjusting it's ability to deliver 377 times more E field to H field. This isn't necessarily a killer because all that your electrical circuit sees, is a radiation resistance that is somewhat lower than (say) 73 ohms for a dipole: - Notice that 73 ohms is when the diploe is 0.5 wavelengths long and that there is no reactive component. Altering the shape of the dipole inevitably means increasing capacitance and effectively shortening the effective length thus, the impedance can alter quite a bit. What's the "mental" model of how an antenna's impedance is determined? It's something I've struggled with for years and in the end I come back to the ratio of E field to H field and how that relates to impedance of free space. If you bend the dipole in on itself (I'm not talking about a folded dipole) then it has more end-to-end capacitance and the E field will reduce. That's how I see it anyway but, for more complex antennas it's a different story.
H: what is the best way to re-route multiple parts in same package and choose connectors with Diptrace I am using Diptrace to route a board with over 1200 pins. It's a fairly dense board with lots of SMD devices and I am using some resistor and capacitor networks, as well as dual MOSFETS and a large cable connector. I have the luxury of using whatever connector on the cable I want, and the resistor and cap network pins are fairly interchangeable for me. For instance, they are all 10K resistors and I can exchange them for whatever other adjacent resistor or capacitor that is more easily routed. So my question is when using Diptrace (or even in another package) to do the routing, is it acceptable or usual to just change the nets on the board when routing, or should I go back to the schematic and change the pins there and re-sync the layout with the schematic? Or is there a way to set Diptrace up so that any pin can be used as long as the part is the same? How do you handle this? Or is there another better technique? AI: Sure, this is a pretty standard feature in a lot of PCB design packages. It's generally referred to as "Back Annotation." While I haven't used Diptrace, both PADS and Altium Designer provide this feature, though I used it very sparingly. According to the Diptrace FAQ: If you have made changes in PCB, use Back Annotate feature in Schematic (select "File \ Back Annotate \ ... " from main menu) to bring changes from the board into the circuit. This should update your schematic with the changes you've made while routing the board. The key is consistency. If you're not diligent about updating the schematic to reflect any changes you've made in the layout, then it's pretty easy to get lost. I will also say that I've tended to use forward annotation (updating PCB with schematic changes) more than back annotation simply because it seemed to be easier for the software to handle, but it's definitely worth a try. Just make sure to back up your board files first!
H: Correct Term for "shorting a resistance to start a diesel motor" I'm currently translating some German technical terms for my English-speaking co-workers. The terms all relate to the Mercedes-made flame-starter for a diesel engine. I've come across the term "Startanhebung", which (from my understanding), describes a process in which an in-series resistance is shorted to trigger an amplification circuit to increase its power output in order to start an engine. For example, this process is supposedly necessary when attempting to start an automobile engine with a low battery voltage (e.g., 10 V). I have a background in electrical engineering and a minimal understanding of technical German, but engines - especially diesel engines - are foreign to me. Does anyone know what the correct English term would be for the process I've described? Or does this process even make sense? AI: According to a "German Automotive & Technical Glossary" I found, "Startanhebung" can be translated as "starting enrichment". (source) To me that sounds more like something to do with the fuel mixture, though.
H: What is the best way to generate a negative supply rail using a microcontroller? I need a ±5V symmetrical voltage to power 5 amps, 4 op amps and 1 in amp (TL081 and INA118). I would like to use only the 5V voltage of the microcontroller (an Arduino this case). Is it possible to use the 5V Arduino output to power the 5 amplifiers (symmetrically) and one more IC (with only 5V positive) that I will use? What is the best way to do this? (Generate a voltage of + 5V and -5V). I intend to power the Arduino with a 9V battery. Is that too little for an application similar to that? If I choose to use a single TL084, instead of 4x TL081. Would that make a difference? If you can not do this, what do you suggest? AI: A common method for generating a negative supply rail for operation- and instrumentation- amplifiers (which don't require a lot of current) is with a capacitive charge pump. A classic part for this is the TC7660. The MAX232 can be re-purposed for this too, because it generates ±10V in order to transmit the true RS-232 levels. There is also a way to get negative voltage from microntroller I/O and discrete components. (source)
H: What is the highest achievable update rate for a civilian GPS receiver? I'm interested in knowing the maximum achievable update rate for a civilian GPS receiver. Specifically Receivers that depend exclusively on GPS satellites (e.g. not including IMU-based movement estimation to interpolate) The hypothetical limit (i.e excluding feasibility concerns, e.g. processing power) Update rate after lock (e.g. TTFF) The fastest civilian receiver chips I've found have an update rate of 50Hz, such as the Venus838FLPx. According to alex.forencich in this stackexchange thread, it might be "rather high": It's difficult to pin a position update rate on the satellites as it's all in the receiver. The satellites simply transmit orbital ephemeris data and the time of day at 50 bits per second and a CDMA chip rate of 1.023 MHz, all precisely phase locked to an atomic frequency standard. The GPS receiver maintains a lock on the CDMA spreading code and uses that to determine the time of arrival differences between the satellites. Getting a lock in the first place takes a while, but after that the position can be updated at a rather high frequency. I'm not sure what the upper limit on that is. And this is of course unrelated to the CoCom speed and altitude limits for civilian receivers. That's what I've found. AI: The constraining factor is the lowpass-filtering after despreading. If we assume -204dBW/Hz noise power density (~ 17°C noise temp), we can only allow around 25kHz of noise bandwidth before it reaches the L1 power of -160dBW. Our integration time must be at least 1/25.000s to detect the signal from the noise background (assuming omnidirectional antenna). This is the theoretical limit for a full strength signal. The product of integration time \$T\$ and tracking loop bandwidth \$B_n\$ must be significantly less than unity for the loop to be stable, so at most 25kHz bandwidth are possible (in real-world-receivers, you will often find \$T=10^{-3}s\$ and \$B_n<=18Hz\$). The relative timing of received signal and local replica can only change (meaningful) at a rate of \$B_n/2\$, making more frequent position fixes useless. You can cheat by using a directional antenna, but in order to compute azimuth and elevation, your antennas position needs to be fixed, and that kind of contradicts the purpose of a navigation system. Now back to reality: shortening the integration period of makes the position fixes more noisy. Given the link budget of an off-the-shelf unit, more than 50 fixes/s is a waste, unless you have really strong signal, all you get is (phase-)noise. And theres a high computational burden, it will eat battery like hell.
H: Why is my SN74LS08N overheating? I have an SN74LS08N, and I am connecting 3V to the VCC and connecting the other end to ground. I'm not using any of the AND gates. I am only powering the IC. It reaches 120°+ in less than 10 seconds. The datasheet says that it requires a minimum of 4.75V, yet with less than that, it reaches unreasonable temperatures. I am not using any resistors. Apologies if I am missing something obvious, I am a first year EE student. Thanks in advance. AI: First... Disconnect everything but power and ground. Make sure power's on pin 14 and ground is on pin 7. Power it with 5V. Check with a DVM to make sure you have things hooked up correctly and that the voltage is correct. The chip should not heat up. If it does, try a different chip- the original one may have been fried. Once you have a nicely quiescent, powered up chip that doesn't try to immolate itself you can start adding logic inputs and looking at the outputs. Make sure that the inputs are within data sheet spec (DVM again, at least for the DC levels- scope is better). Once you see the outputs from the AND gates acting like they should, hook them up to the next stage. The key to troubleshooting these kind of problems is to break them down to their essentials and add stages only after what you start with is working properly.
H: Help Understanding How Long It Will Take To Heat My Wire I am trying to find out how many Amperes I will need to reach a certain temperature in a certain time (Milliseconds) I need a thick wire to slow the melting of the wire. "Nichrome is the wire I'll be using" now in the American Gauge. I want to use 12 as its thick but not too thick and on Wikipedia, when I was checking how many amps I will need to reach a specific temperature using that gauge type it said I will need around 39.03A to reach around 1400F but in what time period will I reach that? Thicker wires are much slower to heat up but smaller wires are very weak. P S I am very new to the American Wire Gauge so forgive me if I'm wrong. I need a thicker, more sturdy wire that can put in a high PSI environment and still reach temperatures of 2-4 millisecond. The problems i see is thicker wire don't have as much resistance and a smaller mutil-twisted smaller wire. Is there away i can change that and still reach my desired temp of 1400F? AI: James Clerk Maxwell popularized this method of dimensional analysis; in fact, before him, dimensions were a mishmash, unstandardized, and such analysis was impossible. I'll give you silicon, which has specific-heat about 3X higher than tungsten. At 2 picoJoules/(cubic_micron*degree Centigrade), suppose we want to short the output driver of a microcontroller? That driver is 100 micron * 100micron (its a powerful transistor), with 0.1 amp short-circuit ability. Assume 2.5 volts. How long before the transistor reaches 1,025 degrees Centigrade? starts at 25C. Our power is I*V = 0.1amp * 2.5 volts = 0.25 watts, or 250Billion picoJoules/second. The volume of silicon? Assume we'll only heat the top 100microns of the Integrated Circuit during our experiment (that depth has a thermal TimeConstant of 114 microseconds, and in that time "most" of the heat remains in that 100micron thickness. Our total volume is 100*100*100U or 10^6 cubic microns. What is our rate-of-change-of-temperature? we want degrees/second as dimensions for our answer. The only bit of info we have with seconds is the power: 4 seconds/joule We want to cancel the "joules" so multiply 4seconds/joule by specific-heat of silicon $$4 seconds/joule * 2 picoJoule/(cubicmicron * degree Cent) $$ Our rate of temperature rise is $$8 picoseconds/(cubicmicron *degree Cent)$$ And we have 1Million cubicmicrons of silicon. We need to cancel 'cubicmicron' in our answer, so multiply the answer by 10^6 cubicmicron, and we get $$8 Million picoseconds/degree Cent$$ or $$8microseconds/degree Centigrade$$ We wanted 1,000degree Cent increase in temperature, thus 8,000 microseconds or 8 milliSeconds is the answer. We initially assumed ALL THE HEAT would remain inside 100*100*100 micron cube. In 8 milliSeconds, heat will have moved outside the cube. A different method is needed for a correct answer. And thank Maxwell, also the investigator of viscosity, for this method.
H: Voltage across current source in an open circuit My question is after steady state(ie. when capacitor is fully charged and behaves as an open circuit) is achieved what would be the potential difference across the dependent current source? How do I find it? AI: Assuming your v1 is constant and the current source 2v1 (times some suitable dimensions) is also constant your capacitor voltage will charge forever and the voltage across the current source will be approximately equal to the negative of that. It will climb until the current source headroom is reached or the capacitor (or other circuit component or connection) suffers a high voltage breakdown.
H: Edge-triggered flipflops - keep CP high or low, most of the time? I'm using 74HCT574 Octal D-type flipflops in a homebrew-cpu project. http://assets.nexperia.com/documents/data-sheet/74HC_HCT574.pdf These flip-flops latch their input on a +ve edge on CP. I could either: keep CP high, then pull it down for the clock cycle before I want it to latch. keep CP low, then pull it up for the clock cycle after I want it to latch. Option 1 looks easier to write microcode for, as CP is pulled down in the same cycle as the input is set-up for the flip-flop. Are there issues with using option 1? How do professionals use the CP input on flipflops? (If any still do, since we have $2 CPLDs and MCUs.) AI: If you have a pull-up or -down resistor on the CP signal, you could save some power by making the idle state the state where no current flows. If there is noise in your environment, and you can predict its effect (this is unlikely to be the case), then you could reduce the risk of disturbances by making the idle state the state that is less affected by the noise. But otherwise, it does not matter at all. For normal CMOS inputs and outputs, low and high signals behave pretty much symmetrically. For TTL, the levels are not symmetrical, but that does not matter if you interface only with other (TTL-compatible) CMOS devices. Use whatever makes the rest of your circuit or your software simpler.
H: What does the 2/0 directionality mean I am trying to use adum1200 isolator. I want to know what they mean by 2/0 directionality AI: The number of channels alone does not completely specifiy how you can use the chip. The ADUM1200/ADUM1201 web pages show the difference: ADUM1200: Dual-Channel Digital Isolator (2/0 Channel Directionality) ADUM1201: Dual-Channel Digital Isolator (1/1 Channel Directionality)
H: GL868 Modem Reboot problem I am working on a IOT based Project which uses GL868 Modem & minimizing power consumption is very important goal for me now. One way of minimizing the power consumption is to turn off GL868 Modem when it is not used. This can be done by issuing following command: AT#SYSHALT=1 This successfully shutdowns the Modem. When I need to use the modem again the RESET Pad of GL868 must be tied low for 1Sec & and then released. But after the reboot the Modem fails to Register to the Network. I issued AT+CREG? command to check if modem is register to the network or not. The modem is registered to the network if we get result as +CREG 0,1 when we issue AT+CREG?, but instead I get result as +CREG 0,2 which indicates that Modem is not registered, but it is currently searching a new operator to register to. Can anyone help me to find the cause of the problem & solution for it? Here is the link for the datasheets: Hardware user guide: https://jt5.ru/files/pdf/gl868/telit_gl868-dual_hardware_user_guide_r0.pdf Software user guide: http://www.adaptivemodules.com/assets/telit/Telit-Modules-Software-User-Guide.pdf AI: Found it! I was not giving enough time for modem to initialize after reboot so that it can find the right operator to register to. It takes some time for modem to register to the network. So when we issue AT+CREG? command to modem it will reply back with +CREG 0,2 indicating it is searching for operator for registration. After reboot of modem, we need to wait for some time before we can start using modem or we can continuously query for registration using AT+CREG? until we receive +CREG 0,1.
H: A simple bit-math question on register bit manipulation I read in a tutorial such descriptions: DDRD |= (1 << DDD0); // sets bit DDD0 to 1 within register DDRD PORTD |= (1 << PORTD0); // turn on PD0 I can understand step by step the following example: SREG |= (1 << 7); Above means take 1 = 00000001 Shift it to left 7 digits so it becomes 10000000 Now expression becomes SREG | 10000000 So far so good but how about again the following: DDRD |= (1 << DDD0); How can we analyse it step by step? If I take DDD0 as zero then 1 becomes again 1 as 00000001 and expression becomes DDRD | 00000001. Is DDD0 simply the number 0 here? AI: I presume you are using an Atmel AVR with avr-libc based on the register names. In which case if you refer to the <libc>\include\avr\ directory, you will find files named after the processor. For example if you take the ATMega328p, there is a file called iom328p.h. Inside it we find a whole lot of things like: #define DDRD _SFR_IO8(0x0A) #define DDD0 0 #define DDD1 1 #define DDD2 2 Notice how DDRD is nothing but a special address for the DDRD register - imagine having to create a pointer to that register, having to look up it's address each time. It's much easier to #define it to a readable name. Consider you want to write to the third bit in the DDRD register. You could do any of the following: DDRD |= 1<<2; DDRD |= 4 DDRD |= 1<<DDD2; You will notice how DDD2 is simply #defined as the number 2, so it is identical to the other lines. It is however much more readable - especially if you want to refer to the datasheet which uses the same names for bits. You might wonder - ah but I'll never ever want to look up that bit as I know it is 2. Well consider another example. Lets take the timers. We have for example: #define TCCR0B _SFR_IO8(0x25) #define CS00 0 #define CS01 1 #define CS02 2 #define WGM02 3 #define FOC0B 6 #define FOC0A 7 Now lets say we want to set the WGM02 bit to be a 1. We could do either of: TCCR0B |= 1 << 3; TCCR0B |= 8; But those are very unreadable - ridiculously so. Who know what 1 << 3 is in the register - we'd have to look it up in the datasheet. On the other hand: TCCR0B |= 1 << WGM02; is immediately obvious which bit it is setting. Additionally there is an element of portability here. Many of the AVRs have the same timer module but have bits in different places - WGM02 might be in bit 1 in another AVR for example. If you moved to a different device later on, you would have to go through every random magic number, look up in the old datasheet what bit it corresponds to, match that with the new datasheet, and change the constant. Whereas if you use the #define, you know what bit it is without looking in the old datasheet, and you may not have to change it at all because the new #define will take care of it. TL;DR; You are massively overthinking things. It is done purely for neatness and to make things easier to follow not harder.
H: From the basic principle to the actual dc generator, where are the 'coil loops'? I've studied the basic principle of the dc generator which is with the single loop example. Right here it's the example for the motor but the generator works the other way around. I'm aware of how it works anyway. My problem is I fail to see the loops in the following diagrams and the actual generators.From the pictures I've seen I only see coils going from a slot to the commutators. The image on the right is the actual image and the one on the left is used for ease. Let's take coil A for example. It goes from slot 1 to the commutator and from commutator to slot 3. So is coil A actually 2 coils? Where is the loop of coil A? I've been searching for quite some time but I can't find an explanation. Is the coil going behind the picture and coming of slot 3 to make a loop? Maybe I don't understand how the coils are placed. Again, my problem is the transition from the basic example to the actual generator. You can clearly see here coils wrapped around and not loops. Is each one connected to the wrapped coil across? AI: Ignore Fig 4.7, it's only a kind of schematic, showing teh electrical connections not the physical reality of the coil. Looking at Fig 4.9 and taking coil A as you asked, it appears as a tiny circle in slot 1, and another tiny circle in slot 3. So it is going into he page in slot 1, and coming out of the page in slot 3 (or vice versa). The other two circles in those slots represent coil C. EDIT : see comment for how Fig 4.9 actually works. And rather than try to keep up with the evolving question, I'll point out that when you analyse the windings in the photo you'll find the coils are arranged in sets of 3 (every third coil is connected together) - you'll need to learn a bit about 3 phase AC electricity before you understand this one.
H: How to test the voltage of a speed sensor and identify the +ve, ground and signal wires using a DMM? I am a novice and would like to identify each of the wires going to a speed sensor. Below is a photo of the connector from the mainboard (left) to the sensor (right): Is it possible to identify the signal wire from the colours? How can each of the wires be identified using a DMM? That is, should I "intercept" the wires between the connectors and look to find a steady voltage between two wires? What about the signal wire, what should I be looking for? Will a DMM be able to identify the signal wire? This is what the service manual wiring diagram shows: AI: Normally most of speed sensor have 3 wire 1. Positive wire 2. GND wire 3. Signal wire Now about your question you can't determine exact voltage level of signal wire using DMM because it's interrupt signal & it's voltage level rise only for some mill seconds. but you can determine which wire is +ve, -ve & signal using voltage deference between each wire (from main board side). First of all unplugged connector and from mainboard (left in your picture) determine: Voltage diff between light blue & green wire(if it's 12V this means one wire is +ve) Then voltage diff between light blue & dark blue wire(if it's 12V this means dark blue is +ve) Now using jumper wires connect each pin of mainboard to the sensor board (except middle one as most of time it's signal wire). if you rotate the sensor module (eg. bike tire) & see the some voltage(as it's interrupt signal it's voltage rise only for milli sec) then this means middle one is signal wire. You can also determine the speed as well using Arduino interrupt and voltage divider (if the signal voltage level higher then 5 volt) Note: I recommend you use oscilloscope etc to determine the exact voltage of signal.
H: Need helps on multi range AC voltmeter I'm planning to make a multi range voltmeter, ranging from 10,50,110,220,330,440,550, and 660. This is my first time making high-voltage things. Here is my current scheme The input freq is 50hz. I'm using ADUM1401 as isolator. Here is the question: I'm pretty sure about the resistor (R6-R13) size, but not about the capacitor. Is the capacitor still needed to (maybe) minimize noise or else? Or perhaps I can remove it because the input freq. is constant (50hz), thus the capacitor (which I think act as a LPF) doesn't needed. I've tested this circuit on 20Vac input, but I'm still in doubt to test it with high voltage input, because I think there are no safety components (such as fuse), while (correct me if I'm wrong) the isolator is just to kept the MCU boards safe. Is there any chance the op-amp blows up? Before it's too late, is there anything that I should add or remove anything in this current scheme in order to avoid noise or voltage drops and get a proper measurement result? Thanks in advance AI: It's easy to protect this regardless of the isolator insulation. The input resistors limit current, but NOT voltage; especially because the gizmo will sometimes be turned OFF (thus, no negative feedback) you ought to consider clamping pin 2 of the op amp to ground (i.e. pin 3) with a diode pair. That pin (under bias) won't be far enough from ground potential to send any current into the diodes. Input resistors (R4, R3, R2) might burn up if the diodes DO conduct, a fuse in series with the input would be a reasonable precaution. Fuse resistance can be small and not affect the calibration. It won't stop lightning, but random dirt and sparks can bridge insulation, and a little preparation is cheaper than a repair.
H: RDA5807M FM antenna question I am trying to use RDA5807M to build a radio. My circuit is basically the same as the reference design in data sheet. I know the design uses the GND of earphone as antenna. But I don't understand the function of F1, F2, C1 and L1. I chooses to remove them from my circuit and the circuit works well. What if I put them back? Will the antenna work more efficiently? Another question, why the LC tank consists of C1 and L1 is 107MHZ? AI: F1 and F2 are inductors that are designed to have relatively high impedance at VHF .This is to stop valuable RF signal being wasted .It also stops RF getting into the AF output pins of the chip .If you went close to a transmitter tower strong RF could cause distortion ,Instability ,Malfunction of the chip.L1 and C1 form a tuned circuit that broadly accepts signals in the FM band and attenuates out of band RF energy .This is a simple receiver and one low Q tuned circuit is better than nothing .If it was not present the chip would have to deal with pretty much all RF signals and overload would be more likely. L1 C1 is normally tuned midband when you have a fixed tuned circuit .You might want to make C1 variable and peak it on your favourite station .The surrounding circuit does have some detuning effect .The overallparasitic capacitance tunes it slightly lower .
H: Supply an Arduino via the magnetic energy created by a mains wire? I'm a software developer trying out some electronics projects so this might be a stupid question but here it goes: Is it possible to put a coil around the mains wire (220V/50Hz) that would be able to power a small Arduino circuit (5V/15mA) by induction only? I've seen some power consumption monitoring devices that seem to be powered that way so I believe that such power supply is possible but I don't know what to search for in order to find eater schematics or complete circuit. AI: No, wrapping a coil around a straight wire does not make a transformer. To derive electric power from a magnetic field, the field has to go "thru the hoop" of a coil of wire. The magnetic field around a straight wire is circular around that wire. If you wrap another wire around the first wire, that second wire is essentially following the magnetic field, not making a loop for it to go thru.
H: How many bits are addressed through one CAS command in DRAM? From what I understand one column and row pairing corresponds to 64 bits from the DRAM chip, but this makes me think that one would then incur the CAS Latency (~18 clock cycles in DDR4) for EVERY transfer. I feel like this is obviously not the case or else DRAM would be severely limited by the CAS delay and not the available bandwidth. Thanks for the help! AI: How many bits depends upon the width of the memory chip, you can always put more in parallel to get more data at the same time. So each access cycle is whatever the width of the chip is. It can vary but generally you can access multiple row addresses without having to set the column again as long as it's the same. If the rows are all in a block then you can be even faster and do a burst where the chip itself auto increments the row address internally. In a PC (my knowledge here is out of date here so apologies if it's changed since) the DRAM is always accessed in bursts of 4 cycles, each burst has a fully qualified address with both CAS and RAS set. However other memory controllers can act very differently and can make better use of the potential speed benefits depending upon their application.
H: Detecting Switch input in ARM 7 and multiplexing two seven segment displays I am trying to multiplex two seven segment displays, once a switch input is detected. If a switch is pressed then the seven segment displays should show 1 If pressed again, 2, then 3 and so on. My problem arises when I reach number 9 since the next switch input will show 10. 1 on the first SSD and 0 on the second SSD. Below is a snippet of my code with regards to how I am detecting inputs from 1 - 9. int k = 0; unsigned int SW1; PINSEL0 = 0; //Set P0.0 - P0.15 as GPIOS PINSEL1 = 0; //Set P0.16 - P0.31 as GPIOS IO0DIR = 0xFFFFF9FF; //Setting P0.9 as input for SW1 while (1) { SW1 = IO0PIN & 0x00000200; //switch connected on P0.9 if ( SW1 != 0x00000200 ) //when pressed { k++; IO0SET = T1; IO0SET = T2; if (k == 1){ IO0SET = T1; //switching on left seven segment display IO0CLR = T2; //clearing the right seven segment display IO0CLR = a; IO0SET = b; IO0SET = c; IO0CLR = d; IO0CLR = g; //displaying number 1 IO0CLR = e; IO0CLR = f; small_delay(); } } I am following the same structure for the 10th switch press: else if (k == 10){ IO0CLR = 0x000000FF; //turn off all the segments as well as both common anodes. Then your outputs will be ready for the new segment patterns to be set up. IO0SET = T2; //switching on first display IO0SET = b; IO0SET = c; //displaying number 1 small_delay(); //calling short delay IO0CLR = 0x000001FF; IO0SET = a; IO0SET = b; IO0SET = c; IO0SET = d; //displaying number 0 IO0SET = e; IO0SET = f; IO0SET = T1; small_delay(); IO0CLR = 0x000000FF;} The problem with the second code I provide is that the seven segment display only displays 10 once. That is, first 1 is shown on the left display and then 0 on the second display as required, however this is performed only once and does not go on until the next switch input is detected. One solution this problem which I have come up with is that I included a while statement after the if else such that: else if (k == 10){ while (k == 10) { //rest of code This actually does what I want it to do, and keeps multiplexing both seven segments, showing number 10, however the problem in this case is that it does not step out of the while loop to accommodate for the next switch input. How can I multiplex both displays until the next switch input is detected? Any ideas/suggestions would be greatly appreciated. AI: Two options: The correct way to do this would be that your counting code just counts, it doesn't set the display it sets a variable. You then have code running on a timer interrupt that reads the count variable and displays the number. If the number is over 9 then this timer can switch between digits as needed. The second way is to only set one digit each time through your loop int digitToDisplay = 0; // track which digit we need to display next while (true) { // loop forever if (buttonPress()) // count button presses count++; // no need to do this every time, could be only when count changes but I'm being lazy int topDigit = count / 10; // split value into separate digits. int bottomDigit = count % 10; setDisplayOff(); // avoid glitches by turning all LED pins off displaySelect(digitToDisplay); // select the display digit to drive if (digitToDisplay == 0) setDisplay(bottomDigit); // set the pins to display a number else setDisplay(topDigit); if (++digitToDisplay == 2) // next time we display the other digit digitToDisplay = 0; } I've assumed a few functions, bool buttonPress(void) which returns tru if the button has been pressed, void setDisplay(int value) which sets the correct IO pins active to display the given value from 0 to 9 and void setDisplayOff(void) which turns off all the leds. By setting the IO lines in a separate function you keep the big messy switch command (or if...else if...else if...) away from your core logic, this makes the logic a lot easier to follow since it now all fits on the screen at the same time. Update - Just in case your dislike of functions and switch commands is due to a lack of familiarity with using them here are the function definitions. These either need to go before main() or you need to declare them in advance and then put the code after main(). I also moved the display select into a function so that all of the IO is out of the main code. You'd need to fill in the remaining values of the switch but it should be fairly obvious how. void setDisplay(int value) { IO0CLR = 0x000000FF; // all pins low (probably redundant but best to be safe.) switch (value) { default: // outside the allowed range. Ignore it. (or display an E I suppose) break; case 0: IO0SET = a; IO0SET = b; IO0SET = c; IO0SET = d; IO0SET = e; IO0SET = f; break; case 1: IO0SET = b; IO0SET = c; break; case 2: IO0SET = a; IO0SET = b; IO0SET = d; IO0SET = e; IO0SET = g; break; } } void displaySelect(int digitToDisplay) { if (digitToDisplay == 0) { // right hand digit IO0CLR = T1; // always clear first. IO0SET = T2; } else { IO0CLR = T2; // always clear first. IO0SET = T1; } } void setDisplayOff(void) { IO0CLR = 0x000000FF; } // detect button press with basic de-bouncing // button must have been down exactly 5 calls to this function to return true. int buttonPress(void) { static int downCount= 0; // static = value isn't lost between calls. //switch connected on P0.9 int currentButton = ((IO0PIN & 0x00000200) == 0x00000200); if (currentButton) { // button is down if (downCount == 5) { // button has been down for 5 counts downCount++; // increase the count so we don't trigger next time return 1; } else { // some count other than 5 if (downCount < 5) // increase if it's less than 5 downCount++; } } else // button is up downCount=0; return 0; }
H: What type of connector is this I've bought a 12VDC pump for a CNC machine I'm building. I want to get a connector that will fit this plug so that I can run it from my power supply source. The problem is that I don't know what these connectors are called in order to buy a suitable plug. Anyone know what this type of connector is called? AI: You should always indicate the pitch (spacing between pins), when asking for a connector identification. Anyway, I am pretty sure it is 2.54 mm and these are 2510 series connectors (a part number originally from a company named OST: datasheet). You can find a lot of those on ebay/alibaba (just google "2510 connector"). But it is actually difficult to find a "reputable" vendor offering exactly those. However, they should be compatible with Molex KK series.
H: \$V_{BE}\$ decreasing with \$V_{CE}\$ at constant \$I_B\$ in a BJT common emitter? I took measurements on a TIP31 common emitter BJT transistor. The circuit was the one in picture I observed a fact which seems quite unusual. Keeping \$I_B\$ constant, for different values of \$V_{CE}\$ I measured the corresponding \$V_{BE}\$. Plotting \$V_{BE}\$ vs. \$V_{CE}\$ it is clear that \$V_{BE}\$ decreases if \$V_{CE}\$ increases. This fact should be in contrast with input characteristics I found, like this one Also using Multisim for a simulation, I find that \$V_{CE}\$ should increase with \$V_{BE}\$ at \$I_B\$ constant. Is this behaviour really unusual or could there be an explanation for it? AI: That's referred to as the Early effect. The effective base width is modulated by the voltage on the collector. Its major effect is to increase the collector current. BJT non-ideal effects
H: Arc Lighter Circuit Design I'm trying to understand why this arc lighter circuit is designed this way. This is my understanding of this circuit: the PWM signal is 50% duty at around 18kHz. That generates a square wave at the primary of the transformer, which is stepped up into the kV range at the secondary. Is it necessary to have a BJT and MOSFET together in this circuit? Could you achieve the same results if you remove the BJT and just place a current-limiting resistor at the MOSFET's drain? AI: My 2 cents as to why it was design that way is because the PWM driver might not be able to supply the necessary BJT base current which in this case seems around 75mA, I assuming that the PWM source is most likely coming directrly from a microcontroller. So they use the MOSFET to drive the circuit with the BJT on top to provide the necessary break down voltage (notice that the mosfter max vds is only 30V) of the inductive kick that will be experience when the MOSFET is shut off. You could replace the MOSFET if you could find a PWM that would supply the necessary BJT base current so the collector current is kept the same and BJT that provides the same amount of breakdown voltage as the 2 parts together. You could additionally try to find a mosfet with high Vds breakdown voltage, low Rds(on) ,high current carrying capabilities logic level drive, this might prove difficult to find, hence the 2 device approach.
H: Charging and discharging a Leyden Jar? A Leyden Jar was one of the first capacitors ever. This guy re-builds one. He connects the outer connector to ground. That, i can understand. I can also understand tribocharging by rubbing the (insulative) PVC pipe. But why is he connecting the PVC to ground?! AI: Smoke-and mirrors. The ground connection to the PVC pipe is meaningless. Poetic effect maybe? (Another mistake in the video is that the name of the unit is farad. The name of the person is Michael Faraday.)
H: Feasibility of a wind-up radio? I am wondering about the feasibility of a wind-up radio, meaning a tactical radio transceiver with 2-watt and 5-watt settings that would be powered by a rechargeable battery attached to a dynamo so it could be recharged by turning a crank. How much talk time would you get per minute of cranking? About how long would it take to recharge a typical handset battery to full from empty? This is relevant because in a lot of war zones there is no regular power and disposal batteries may be hard to come by. I am looking for estimates and ball park figures for a typical design figures of merit. AI: After doing some more research on this, I found that hand cranked tactical radios are a well-known thing and that among others Barrett makes hand cranking systems. These are not small systems though and the hand crank is more for a base station situation. Midland used to make a hand cranked survival radio called "Basecamp", which is a 5 watt system: Users say that you have to crank it for about 2 minutes to get an hours use.
H: Lipo battery protection circuit. Is this a good approach? I want to build a circuit for a quadcopter where MOSFETs are connected to the primary and secondary battery. When the voltage falls below certain value in the primary battery the voltage monitor triggers the P channel MOSFET and cut the supply from primary and simultaneously the N channel MOSFET connected to the secondary battery turns ON and supplies the power. Batteries are rated 22 V Max current is 250 A. AI: If you insist on using the batteries separately I would recommend something similar to this, although it can also be done with N-FETs on the low side simulate this circuit – Schematic created using CircuitLab The schematic below should work for inverting the output signal for control of the primary pack. The actual values for components should be evaluated based on actual circuit needs(Gate voltages on specific MOSFETs, filtering needs, etc.) simulate this circuit
H: PCB design for current shunt monitor I was looking at the INA225 datasheet and wondering how to appropriately design the PCB for this device. My question is rather simple, the shunt resistor will be far away from the microcontroller and there will be switching regulators along the way, and I want to avoid using an external ADC, so I have two options: 1) Place the INA225 close to the shunt resistor and route the analog output to the microcontroller. 2) Place the IN225 close to the microcontroller and route the kelvin connection like one would route a differential pair. I'd like to know which one is better considering since the signals may pick up a lot of noise along the way. If possible, please provide explanations on why one approach is preferable over the other. AI: The standard rule of thumb when amplifying sensors is to put the op amp as close to possible to the sensor, because the op amp has a lower output impedance than the sensor and so a given noise power will produce less noise voltage. With a shunt resistor, though, the output impedance of the shunt is likely lower than than that of the op amp. This would argue for the long trace being between the shunt and op amp. However, the signal amplitude from the shunt is also much smaller, or else you wouldn't need an amplifier. Since any noise on the amplifier input will be multiplied by the gain, the tradeoff becomes a matter of comparing the impedance ratio with the gain. All the typical advice about reducing noise still applies, of course, and will likely matter more than the amplifier placement: low-pass filtering, shielding, attention to grounding and current loops, etc. Your noise is going mostly to depend on the bandwidth you need for the current measurement.
H: Paralleling mosfets to handle more current while driving a DC motor? I would like to drive a 180W, 24VDC motor with a PWM signal using mosfets such as follows: simulate this circuit – Schematic created using CircuitLab The motor is inside a control loop with negative feedback which regulates the speed of rotation by acting on the PWM output. Given a mechanical load, the speed of the motor can be regulated by varying the applied voltage. The variation in the voltage supplied to the motor is achieved by varying the duty cycle of the pwm output. So far all my efforts have been focused on designing the control system with the analogue PID controller. Suppose the motor is rotating at a speed w which requires a 10V voltage and a current of around 2A. In this case I can see at least two problems with this approach: The mosfet is dissipating 14 * 2 = 28 W. Not acceptable unless using a heat sink The diode is dissipating 1.8 * 2 = 3.6 W. As for the first problem, my solution would be use more mosfets in parallel in order to share the motor current. The number of parallel mosfets would be designed to handle the worst case scenario. However, I have never used mosfets in parallel and since I know that no two transistors are the same, I am afraid the current will not be shared equally (as in a resistor current divider) resulting in a possible overload of one/two mosfets. What are the critical points to consider while paralleling mosfets for this particular application? Furthermore, in case the "current sharing dilemma" is solved, should I put a resistor in series to each gate when sending the PWM signal to each mosfet? As far as the diode is concerned, I would look for a diode that can withstand more current within the worst case scenario current for the motor which should be around 10 A. Is there a better way to do this? If you think there is a better way to achieve the same goal, please do provide your solution. This is a hobby project and I need some constructive feedback/critics. PS: when I talk about worst case scenario current I mean the nominal current under (a heavy) load. In case of high currents due to blocked rotor or short circuit, I plan to add a fuse for protection. AI: Yes, you can parallel MOSFETs, they are good at current sharing due to the positive temperature coefficient of their on-resistance, but... You've made an error in the power dissipation estimate. In PWM operation, the MOSFET is either fully on or fully off. The motor acts as a low-pass filter, and "sees" the average applied voltage, the supply voltage times the PWM duty cycle. So at 24V supply and 40% duty cycle, the motor would behave as if 9.6V dc were applied. I should mention that the PWM frequency should be high enough to keep the current ripple to a reasonable level. When the MOSFET is on, the voltage across it is due to its on-resistance, 0.16 ohm at 25 deg C according to the data sheet. This is called conduction loss, and it varies with the current and the duty cycle. For example, at 2A 40% duty cycle the power would be 2A squared times 0.16 ohms times 40%, around 250mW. (This could more than double at higher temperatures; in any case, the power will be far less than 28W.) During this time, diode current is zero. If conduction losses are too high, you could select a MOSFET with lower on-resistance. When the MOSFET is off, the current is flowing through the diode, and the MOSFET is dissipating no power (but the diode is). There will be some switching loss as well, in both the MOSFET and the diode. Switching loss is a function of switching speed, which in turn is a function of the gate driver. Driving the gate harder reduces switching losses in the MOSFET, but can give rise to ringing due to parasitic elements. For best operation, parasitics must be minimized, so a tight layout is critical. You will definitely need a diode with a higher current rating than the 1N4148. At 24V, I'd suggest a Schottky type for lower forward voltage drop.
H: Producing different types of tones using the 555 timer I'm learning how to work with the 555 timer (astable mode) and decided to make a simple synth. The sound from a square wave is rather harsh so I'm trying understand how to modify it to make different types of tones. I'm a bit confused on how exactly to do this. If I have the 555 timer running in the astable mode at a frequency of 136Hz and I want to produce a sine wave from its output, as far as I understood I need to 'bend' each HIGH from the 555's output with a capacitor and inductor, correct? I can easily find a matching capacitor using an oscilloscope to bend the HIGH signal like this: but I don't understand how to calculate the inductor value so I can 'bend' the beginning of the HIGH signal as well to make it appear like a sine wave. How can I calculate the inductor value? Is there a way I could modify each HIGH from the 555 timer in a 'linear' fashion to produce output/tone similar to this? or is this achieved by merging different layers of tones into a single one? What terms can I use to learn more on modifying the square wave in order to produce different types of tones? Thanks! AI: First, if you are trying to make something musically interesting with the 555 timer, your best bet is to have a look at the Atari Punk Console. On to the questions: a 555 timer actually produces two easily accessible waveforms: a square wave and a pseudo-triangle wave. Let's look at the astable circuit: simulate this circuit – Schematic created using CircuitLab Running a transient simulation of the circuit gives us the following: The pseudo-triangular waveform observed here is from filtering of the square-wave to produce a more "pure" tone, removing the high frequency content of the square wave and moving it closer to a sine wave. In musical synthesis this is referred to as subtractive synthesis as it removes content from the signal to produce the output, here achieved by the low pass filter from the RC subcircuit. (Note this can't be directly listened to without buffering because changing the impedance ruins the oscillator). To get to a sine wave, you would have to have a high-order filter just above the fundamental of the square-wave to remove all harmonics. This would be challenging to do for a synth as the fundamental changes and therefore the filter would have to change cutoff frequency as well, which is challenging to design. A direct answer to your question on how to get a sine wave would be to stack several RC stages in series and that would filter the output enough to produce something close to a sine. You may need a buffer (e.g. from an op-amp) first. simulate this circuit The above schematic gives the following output: This is not a perfect sine wave but is much closer than the "triangle"! The circuit is three stages of a low pass RC filter forming a 3rd-order filter. To calculate the cutoff of the RC filter you simply use $$ f_\mathrm{c} = \frac{1}{2 \pi R C} $$ For a cutoff of 132 Hz you could use a 10n capacitor with a 120k resistor, but you can tweak the values to what you have available and how accurate you need it. To create more complex signals you need more sophisticated synthesis techniques. These are often easier to implement in software as to generate the waveform you reference one could simply draw it into a wavetable synthesiser. To create that exact waveform in hardware (without a microcontroller or similar) would be difficult but could be done with analysis of the frequency response and some approximation using an appropriate synthesis technique (e.g. amplitude modulation, frequency modulation). Finally, if I were you and were trying to build a basic synthesiser using 555 timers, I would look at combining oscillators and filters. By taking a single 555 and controlling the pitch (continuously) and mixing it with a second oscillator you can create some weird sounds. Look up how to make a buffer and a summing amplifier with an op-amp and you will be able to make a huge amount of different sounds. Good luck!
H: Arduino + 6V Solenoid Valve I'm wanting to control a 6V Solenoid valve from an Arduino using only a single power supply. To do this I was planning to use an external 9V power supply. There are a few issues I am not quite sure how to resolve 1) Providing power to both components via a single power supply. Whilst the Arduino can accept up to 11V input it is not able to power "high" voltage external components. What would be the recommended route for this scenario? I have taken a look at the Motor Shield v2 however it does not appear suitable for this scenario. 2) Confirmation of Solenoid power requirements, the specification for the Solenoid valve only mentions a voltage and power consumption. Solenoid Specifications: Voltage: 6VDC (continuous), 6-12VDC subject to duty cycle Power Consumption: 1.6 Watts - at 6VDC Using the above specification I've calculated that a current of 267mA should be supplied to the Solenoid, using a 23 Ohm resistor (or whichever is nearest commercially available) would give the desired outputs. 3) Apart from a MOSFET used to control the on/off signal to the solenoid and a flyback Diode to reduce the change of voltage spikes reaching the Arduino. Are there any other components I would be missing? Thanks, AI: You don't power the solenoid by connecting it somehow to the arduino. You connect the circuit consisting of the solenoid, voltage limiting resistor, flyback diode and MOSFET in parallel with the arduino. You'd connect the +9 V to both the arduino DC positive and the solenoid, and you'd connect the ground to both the arduino DC negative and the MOSFET drain pin. A solenoid which dissipates 1.6 W at 6 V will indeed draw 1.6/6 = 267 mA. However, using a 23 ohm resistor for dropping the 9 V supply voltage to 6 V won't work; 23*0.267 = ~6 V. You calculated the resistance of the solenoid, not the extra resistance needed for 9 V operation (which is 11.25 ohms, 0.8 W). That should be all you need, but I'd add a capacitor (0.1 - 10 uF) between the 9 V supply and ground for good measure, to prevent voltage transients from coupling to the microcontroller on the arduino board. Be sure to use a "logic level" MOSFET with a gate threshold voltage (Vgsth) below 3.5 V. In summary, the circuit I propose: simulate this circuit – Schematic created using CircuitLab
H: re-attach battery driven gamepad to PC power supply There are times at that I get mad about empty AA batteries or accumulators losing their capacity too early. And since the gaming computer is running anyway, I thought about using one of the molex connectors to run a wire out of the computer casing and use it as power source for the currently battery-driven gamepad. The plan: Molex connector gives 12V/5V, convert the 5V to 1.4V My tests: AA akku, Multimeter, Gamepad: the gamepad drains roughly 60mA power supply, Multimeter, electronic parts: 5V of power supply are converted to 3.3V by a MCP1702-3302; the remaining 1.9V shall be reduced by ~30 Ohm resistors in series. As the power supply is switching power to the 5V and the MCP1702 is also switching to 3.3V, I added a 10V/2200 microFarad capacitor at the end, before running power to the gamepad and connecting is to ground. Result: The gamepad's power Led is fading/blinking, the device is not working. I understood that resistors reduce power and current, thus I took the current into account: R= U/I = (3.3V-1.4V) / 0.06A = 31.67Ohm Measuring the resulting voltage with the gamepad attached was driving my multimeter crazy. Is my approach okay? Does the capacitor flatten the switched power enough to simulate a battery? AI: You don't want to use a simple resistor to drop your voltage because this is very dependent on current draw. And your controller is drawing varying amounts of current, depending on which buttons are pressed, and LEDs, etc. For example, the controller might be drawing 60 mA when idle, but much more when active. If it draws more, this will cause the resistor to drop more voltage, and the circuit could starve. What you want it to use a voltage regulator that outputs what you need. To use the same family of parts that you are currently using, try a MCP1702-1502 instead of your MCP1702-3302. If it turns out that the device uses more than 200 mA, perhaps if it vibrates (?), then even the MCP1702 won't be able to provide enough current.
H: What is a term for voltage that does not involve the unit? Basically the title. What is the term that means the same thing as "voltage", but does not invoke a specific unit (in this case, volts)? AI: "Electrical potential" is the term you're after here (not to be confused with electrical potential energy stored by opposing charges at a distance).
H: can I use a Miller Solar engine for RF applications? I'm thinking of using a Miller Solar Engine to power a Arduino clone with a RF transmitter. i.e., solar panel + super capacitor + low-power Arduino + RF95W. However, I read that MSE's are ground-switching solar engines, and I'm not sure what that means. Would this be suitable for RF applications? This is the part of the documentation that concerns me: One thing to note is that the MSE1/MVSE is a “ground switching” solarengine. That is, it acts by turning on/off the ground line to the circuit it’s driving. It shouldn’t prove to be a problem with most circuits, but it may be worth remembering while troubleshooting. Could I use a LTC3225 supercap charger instead? AI: The 'Miller Solar Engine' is a device for turning on and off a heavy load, like a motor or lamp, in solar powered toys. Part of the fun is that you don't know when the capacitor will be charged enough to give you a few seconds of movement or light. I'm sure the amusement wears fairly thin after the 307th burst of activity. A supercap cannot be over-volted without damage. The only way the 'MSE' attempts to control the maximum voltage is to turn the load on at the threshhold voltage. From the descriptions, the threshhold is 2.7v, which will be too high for some makes of supercap. If the load cannot absorb the excess current from the solar panel, then the capacitor voltage will continue to rise anyway. This is not what you want for a low power radio. With its low input current when the input power supply is removed, the 3225 looks a better bet, assuming the panel output voltage is compatible. When dealing with a solar powered link, you have to be aware of the need to do an orderly shutdown (depending on the link protocol) when power vanishes unexpectedly. Having supercaps mitigates this to some extent by giving you a minimum time for that, once the panel power has disappeared. You would need to sense the panel voltage separately to the capacitor voltage to be able to make use of this warning.
H: Why do single op-amp DIP packages have 8 pins, rather than 6? Single op-amps often come in 8-pin DIP packages, with 5 of those pins being standardized (or maybe it's just de-facto) like in the ones below. (source: linear.com) Older op-amps such as the LM741 (first image) have a very bad sense of what is 0 volts, so they require offset null pins to manually adjust them. Some newer op-amps such as the TL071 are much more accurate, but still make use of extra pins by having this feature, while their dual and quad siblings do not have this feature. Some modern single op-amps have three unused pins, and forego the offset null completely. So why don't many modern single op-amps come in 6-pin DIP packages? They would still conform to the standardized layout, and fit in 8-pin DIP sockets. But they would take up less space in circuits designed for them. edit: For examples such as TL071, I can that they would put the offset null on it despite it's absence in it's dual and quad siblings so that there's an option for those that do want to adjust it. But even then, many of these are available in different packages, so why not 6-DIP? That still doesn't explain it for the single op-amps that don't have offset null. AI: Historically, it was more efficient to put multiple instances of the same function into the same chip, so DIP packages usually had at least 14 pins. The JEDEC MS-015 standard never had defined packages smaller than eight pins: (Note that 10-, 12-, and 26-pin packages are also missing.) With nobody actually manufacturing six-pin packages, the first one to do so would have had additional costs that would have been larger than just wasting two pins of an eight-pin package. In other words, creating six-pin DIP packages is just not worth it. There actually are many (opto)isolators that come in six- or even four-pin DIP packages (e.g., 4N25, PC817), but the manufacturing of isolators is somewhat different (typically, LED and phototransistor overlap vertically) and therefore does not allow easy reuse for chips with 'normal' dies. Packages other than DIP are commonly manufactured with fewer pins (e.g., SOT-23-5, SC70-5), so op-amps are also available in those.
H: SPI (3 wire) implementation using PIC I am trying to connect my PIC to RTC. The RTC I am using is DS1302 with only one pin for both (Input and Output). I am trying to simulate it using PROTEUS. The problem I am facing is how can I connect PIC two pins i.e. SDO and SDI to one pin (I/O) of RTC? ScreenShot is here Edit: I Have read the datasheet of 16fxxxx and couldn't find the configuration for 3 wire system. AI: It is hackish, but how about connecting a resistor between the SDO pin and the junction to the SDI pin, 4k7 or so should be ok. Then when the RTC is using the pin as an input to will read the data from SDO, when it is an output it should override the resistor and drive the SDI pin. You will want to look carefully at the guaranteed logic levels, but you should be able to get this to work.
H: Understanding Circuitry from a Datasheet I'm having a little difficulty understanding this section of a circuit from the datasheet for an MC33035 BLDC Motor Driver. Some info: Pin 7 is enable, send pin high to enable motor Pin 8 is a 6.25v source Pin 14 is a fault pin, active low during a fault (at VCC (pin 17) not during a fault) I'm assuming during a fault "Latch on Fault" is closed, pushing the reset button would therefore send pin 7 high, re-enabling the motor. However, following this logic then "Latch on Fault" would be open when the motor is running - but how is pin 7 sent high? Or is it default high, closing the switch next to it pulls it down, or if "latch on fault" closes it pulls it down? What is the 47uF cap for? Any help greatly appreciated. AI: It looks like "Latch On Fault" is an optional switch via which you can set the behavior to display in case of a fault. It does not change with the fault state. The logic is quite simple: Pin 14 is low on fault, pin 7 is high for enabled. Now if you connect these pins, e.g. via a closed switch, once a fault is detected it also disables the motor by pulling enable low. If the switch is open, a fault will not disable the motor. The reset button pulls the enable pin high again, overriding the fault signal of pin 14. (For this logic to actually work, during fault pin 14 must stay low even when enable goes/is low.)
H: uart TTL problem My Setup I have an Arduino Mega connected with my PCB and both boards exchange data using UART TTL @ 57600 baud rate. Both have their own separate power supplies (5 Volts each; Mega is powered via my laptop USB and the PCB has it's own isolated power supply). I have connected both their grounds along with Tx/Rx pins. Because of the application requirement, the Mega often restarts the PCB by switching off it's main supply (which is fed via Relay) and then switching it back on after around 5 seconds (making sure all the charge has effectively drained). Observations I have noticed that when the Mega cuts off the PCB's supply, the circuit still remains powered (at around 2 volts). I suspect this is because the Tx pin of my Mega supplies sufficient current which keeps my board alive. The Problem Now this setup works fine almost 70% of the time. But there are occasions when after the power up, the PCB can no longer communicate via UART (i receive nothing on my Mega's UART port), maybe because the micro-controller isn't reset properly, and it somehow messes up with it's silicon. But i am not sure, this is just a guess. Anyways, in such cases, i have to manually reset the power supplies of both my circuits after which they work flawlessly. How can i prevent this? I have tried applying 10K current limiting resistances, but it adds to the propagation delay and ruins the communincaiton (i suspect this is because i am using a high baud rate). I haven't experimented with pull-ups/pull-downs as of yet, but i'll run the tests and post an update tomorrow. I have tried to find a solution, but i am not sure where exactly to find a solution. This isn't exactly a ground-loop problem. Or is it? Please suggest. AI: If the problem is caused by the power through the Tx pin (which is definitely possible), then you can solve it by disabling that pin before powering down. Just configure it as a (digital or analog) input.
H: Soldering issue? I am currently soldering a new Analog Axis for a friend and the tin to help ground the solder to the joint has burned off and now the tin either goes to the tip or the solder itself. I have no idea how to get the tin to "stick" to the board now. Any help would be very appreciated! Thanks AI: As others have said, make sure your soldering iron tip is clean. Use a damp sponge or paper towel and wipe off any old, burned flux. Once you've done that, make sure you're using solder meant for electronic soldering. I use 60/40 solder with rosin core flux. Adding rosin flux to the connections you are trying to solder will help the solder flow onto these parts more easily. Do not use acid core flux- that's for plumbing. Put a coating of solder on the parts you want to join. Make a mechanical connection if you can (twist wires, etc...). Heat the joint, not the solder. This helps eliminate cold solder joints. Don't move anything until the solder solidifies. All of these suggestions are best practices, but sometimes 'good enough' is, well, good enough. There's a number of howto guides on the net- here's one.
H: If the integrated circuit die is very small what is the role of the extra circuit packaging? I noticed that the actual integrated circuits of processors, GPUs, ROMs, specific integrated circuits and other ICs are very small but they usually come in a package that is much bigger. What is the purpose of the packaging? And what are the materials that IC packages are made of? AI: What is the purpose of the packaging? Protecting the IC against light (light will induce current flow in a PN junction) Protecting the IC against moisture Together with the leadframe take the connections of the IC further apart. These can be as closely spaced as 100 um which is too close for standard cheap PCB manufacturing. The leadframe + package expands this to something more usable like 0.4 mm up to 2.54 mm (DIP/DIL packages) Make the IC easier to handle by humans. A DIP package can easily be used and exchanged in a breadboard or in a socket. And what are the materials that IC packages are made of The leadframe: tinned copper or metal so that it can be soldered easily The black part: usually molded plastic, sometimes a ceramic material. Some ICs can be bought in a CSP (Chip Scaled Package) which actually means no real package at all, on top of the chip a redistribution layer is made (which spaces the connections to what the PCB can use) and the IC is then mounted directly on the PCB. This technique is also called "flip chip".
H: maximun number of inputs on a opamp adder circuit With 4 timers of a mcu I am generating 4 square signals , each of them have an amplitud of 3.3v and are generated at diferent frequencies (8KHz 9KHz 10KHz and 11KHz), to generate a multitone signal I am adding them with an op amp adder circuit, everything is OK, but I would like to try with more of 4 signals if it is possible, What would be the maximum number of input signals for an adder circuit?, the op amp is working with 3.3 volts (ad822). AI: The more inputs you add, the more noise the op-amp produces - this is because the noise (regard it as in series with the grounded non-inverting input), gets amplified each time a new input is added. Consider the non-inverting op-amp amplifier: - Now, regard Vin as the op-amp input noise with respect to 0 volts but it gets amplified as shown in the formula. Regard R2 is one limb of your mixer. Every time you add a limb, R2 gets smaller and the noise on the output gets higher. For instance, if you have one input, the output noise might be X but, with 10 inputs the output noise will be 10X. It's not normally a show-stopper but it's something to take into account and anyway you did ask! Clearly, the sum total of all the input voltages x gain has to produce an output voltage that avoids clipping or slew limiting as well.
H: Minimum battery capacity I am working on a project that it has to work at 2.5V-0.3mA, 12h a day during almost 2 years. The probleme is that I don't understand something. I did some calculation of the minimum capacity of the battery and I ended-up with some weird results. Imagine we want a 9V battery. We have 2.5V-0.3mA during 12h a day, it's 0.009Wh/day. During 365 days*2 years, it's 730 days. So finally my battery has to have a capacity of : If I want an admissible discharge of : - 50%, I have : 0.009*730/9/0.5 = 1.46Ah - 80%, I have : 0.009*730/9/(1-0.8) = 3.65Ah Wy does the battery has to have a higher capacity if I want to discharge my battery to 80% of its capacity than 50% ?EDIT :Does that mean if I take a 1.46Ah battery my system will stop to work at 50% ? Therefore at 4.5V ? I think I'm missing something...Thank you ! AI: The charge of a battery is not from 0V to xV, it depends on the chemistry of the battery, for example, a 3.7V LiIon battery will be 100% at 4.2V and 0% at 3.3V, so you assumption about being 50% of charge at 4.5V is not correct. For your calculation you should just use: Ah=(Wh*tHours)/(BatteryVoltage) This will give you around 730mAh, then you must calculate the efficiency of your DC DC converter for an input of 9V to an output of 2.5V. RealAh=Ah/Efficiency Another thing to get in mind is that for such a great time the battery might self discharge, so you should know it's self discharging rate and add it into your Ah calculation.
H: Examples for AC circuit analysis with AC voltage source in parallel with DC current source? Where can I find examples of AC analysis of circuits with AC voltage source in parallel with DC current source and resistors? I could only find examples involving capacitors and inductors. AI: I assume you are looking for "real" examples of such circuits. One class of circuits having both ac and dc sources could be ac amplifiers. For instance, the input stage of a simple mic pre-amp circuit has an ac source (the mic) in parallel with thevenin DC source created by the the two 47k voltage divider resistor.
H: Which load resistor value for amplifier? I have build this circuit succesfully but I need more volume. This is an audio chip with animal sounds. I tried to remove the transistor and connect the out pin to a class d amplifier breakout. I get only a very low volume then. My idea is to amplify the sound first with the S8050 transistor, and then connect to the amplifier. When I remove the speaker from the circuit from the spec sheet I need to replace that with a load resistor. I have however no idea which value to pick. The output will then be between the load resistor and the transistor (right?) I use a 8 ohm speaker. AI: A little bit of googling would have found this circuit Nothing special about the audio amp used (HT82V793) so just about any audio amp should do.
H: How electricity consumption works I am trying to understand how appliances can consume different amounts of electricity at different times. For example my laptop will consume different amounts of electricity depending on how much work it is doing. But how does it actually request more electricity? AI: simulate this circuit – Schematic created using CircuitLab
H: Help me understand electrical fields better I have a hypothetical scenario that would help me better understand (I hope) electrical fields and propagation of electrical fields better. So let's have a super simple circuit with one voltage source and one resistor: simulate this circuit – Schematic created using CircuitLab I understand that Ohms law says that I=U/R so using that we would see 50mA flowing through the whole circuit. Now I have the hypothetical scenario: lets make this circuit veeeeery large. Large so that the wires would be 10 times the length that speed of light can travel in one second. If we presume that the wires are made from perfect superconducting material and have no losses in themselves, how fast will electrical field establish itself at location where our resistor R1 is (be at 5V). Would current flow unobstructed the whole length with the same current strength until it reaches the R1 resistor and would it only at that time "reduce" itself to 50mA when it is impeded by R1 resistance? AI: You are imagining a 'transmission line'. Put a switch in series with your voltage source. When you close it, a wave of 5v and some current will progress along the lines at the speed of light (assuming bare wires in a vacuum, slower if there's air or plastic around). The impedance of the lines is determined by their geometry. The impedance defines how big the current wave is that progresses along with the voltage wave. If the two lines are fairly close together, say 1mm conductors 10mm apart, the impedance will be about 300ohms, something like the old style FM balanced feeder line. If each wire has thin insulation and they're twisted together, then the impedance will be somewhat lower, 50 to 100 ohm range. What happens when that wave eventually reaches the 100ohm resistor depends on the line impedance. If they're equal, then the current and the voltage waves will be in just the right ratio to be correct for the resistor as well, and the wave will be totally absorbed, leaving a voltage of 5v on the resistor, with the right current through it. If they don't match, then a smaller wave will be reflected, to take up the portions of the wave that don't match. The wave will continue to bounce between voltage source and load, until eventually the reflection losses attenuate the waves to insignificance, leaving only the DC flowing between source and resistor.
H: Rotate multiple PCB designators in Altium? I am copying rooms in a PCB from the right side of a board to the left. Rotating everything in the room is easy - select the objects, Edit > Move > Rotate Selection. But now all of my designators are upside down: I don't like this. I figured out how to use the Find Similar Objects function to select all the designators in the room, but Rotate Selection does nothing to them. Any ideas, besides individually rotating 14 designators? I'll have to reposition them anyway, but at least if I could rotate them in one shot, that would be something. AI: If you can get them selected then you can change their rotation parameter using the PCB inspector. You would have to do the horizontal and vertical ones seperately though. Given you are planning to reposition them manually anyway i'm not convinced that this will save much time over just hitting space to rotate them while you are dragging them into place.
H: protection circuits I was wondering if anyone could help explain how these work? I know they are missing information, but I wanted a general idea on how they are meant to function. Why place two diodes facing each other? How does the diode protect against reverse polarity? How does this one work? I guess I don't understand the diodes to ground and battery etc. Like if a battery is in reverse does the diode go into reverse breakdown and current runs to the GND? I would appreciate any help in this subject. AI: Depends on what you want to protect and what from. It matters what the impedance of your load is. Typically if you want to protect the inputs of a device you put two diodes like this: simulate this circuit – Schematic created using CircuitLab If the signal V1 goes 0.7V above Vcc D2 will turn on and allow the current to go through D2 and lower the voltage. If it goes 0.7V below ground then D1 will turn on and shunt the current. In this way you can "protect" inputs of devices from voltage. Back to back diodes only turn on when the reverse breakdown voltage is met, which is in the 10's of volts. The other two circuits don't offer any protection in the context that was given in the original question. There are also ESD or TVS diodes that protect against large short voltage spikes and turn on when a voltage of hundreds of volts is across their terminals. They shunt ESD spikes which are in the 1000's of volts away from sensitive electronics. When using diodes watch the thermal ratings, if a current larger than the device can handle or the thermal rating is exceeded then it will destroy the device. Resistors can be used in series to limit current.
H: ESR in Electrolytic capacitor vs Voltage rating I would like to know why in an electrolytic capacitor the ESR decreases as voltage rating increases. And why the current rating increases as voltage rating increases. Thank you. AI: Your assumption that "all" capacitors of same C and case size have lower ESR with higher V rating ( it is not universal). This depends on construction of l/A or foil length and cross-sectional area , A which for fairly high V ratings may use slightly thicker foil for longer foil wraps with a bigger gap and end up with the same ESR. However let's assume the foil thickness or cross-sectional area is constant in small high density low voltage caps. ESR is commonly rated in low ESR Caps where the ESR * C = T calculation typically <=10us, But not general purpose caps. ESR is not given and the ESR * C = starts around 100us and increases with component size is rated instead by D.F., dissipation factor @120Hz. A designer should realize this component is (usually) intended for bridge rectifiers with the standard 60Hz test method rather than high frequency SMPS demanding lower ESR. Lower ESR High V caps may be rated by their ripple current (Arms) instead of ESR along with D.F. but some Mfr.'s may also include ESR. How can current ripple increase with Voltage rating? High V rating increases Ripple current rating due to construction of thicker foils and larger area with larger gap voltage for the same package size. But in the smallest case size, with low V ratings, the minimum foil thickness may already be the smallest possible, so the reverse trend does not apply and instead length of wraps is increased with dielectric gap. How can ESR reduce with increased Voltage rating? An electrolytic with increased voltage rating must increase the gap, d between the conductors at the expense of the capacitance gap loss for the same size body. This is normally done using the same foil wrapped in a cylinder with a longer length and bigger dielectric gap to achieve a higher voltage rating and the bonus is a larger conductor area, A, hence a lower conductor resistance , R. The capacitance for parallel plates with any dielectric insulator between has the properties of the conductive foil plates and the breakdown voltage of the dielectric of any insulator medium between. Facts: All insulators are dielectrics and they all have a fairly linear breakdown voltage in parallel plates with gap displacement. All conductors have Resistance, R, proportional to the length of the electrodes and is inversely proportional to the cross-sectional area, A for a given electrode or plate usually made of foil or metalized plastic. \$C=\frac{\epsilon A}{d} ~~~~R=\frac{l}{A}\rho ~~~~~ V_{max} = kd~ ~~ \$ \$ k = \$dielectric rating [V/mm or kV/m] , l = conductor foil thickness \$ C= \$ Capacitance \$ [F] ~~~\epsilon =\$ permittivity \$A=area~,~ d=gap\$ Side question, How do you choose a Cap? Given variables for C, ESR( or D.F. or Imax), V, case size, cost , max Temp, leakage R, vendor quality (brand reputation), vendor technology (Family type) & cost and you may have design specs for; Cost, MTBF , C value, SMT or THT , ESR, etc then decide on design Rules of Thumb for voltage margin, current margin, ESR aging, C aging, Ambient Temp range, and desired MTBF then depending on your "bias" for above needs (cheap or reliable or best performance or just good enough) , increase your margin for Voltage, Imax, ESR and C to improve temperature rise which directly affects aging. Other than solder process & design defects, a capacitor is most likely to fail first in any design. A hot one or stressed for current and large mW dissipation in a thermal insulating package will result in poor reliability So voltage and current margins are key to any design Rule of thumb, such as >=50% margin depending on your pressure to reduce cost and maximize MTBF.
H: Time domain reflectometry (TDR), pulse shape Considering this coax cable open end reflection. What are the correct explanations for the flatter rise time, the rounding of the first reflection, and the much smaller what I assume to be secondary reflection? EDIT: Cable: ~100m 50ohm "m17/028-rg-58" Scaling is 500ns/div. Signal: 100kHz square wave. EDIT 2: Suggestion: EDIT 3: AI: The slower edge in the reflection indicates that high frequency signal components are in the reflection are attenuated compared to the low-frequency components. The main reason for this is likely that the coax is lossier for the high frequency components than for the 100 kHz fundamental. A chart I found online indicates typical RG-58 has 6.6 dB/100 m loss at 30 MHz, and 16 dB/100 m loss at 100 MHz, for example. Remember that your reflected signal passes through the cable twice (so you need to consider 200 m worth of loss) when using these figures.
H: Use BBB analog inputs with 0..5V or 0..10V I plan to use the BeagleBone Black analog inputs for sampling of analog data. But there are some major problems for this: BBB allows a maximum of 1.8 V analog input voltage while I have 5 V or 10 V max there are two lines AGND and VDD_ADC where I don't know how they are involved here and what to do with them my knowledge in electronics is very limited My only idea: a voltage divider with two resistors (that's within my range of knowledge), but there I see some problems: resistor tolerances which make measured data inaccurate in case of tolerances being at the wrong end it may be possible the maximum 1.8 V analog input may be exceeded and the BBB can be killed when I choose values of resistors in a way where this can't happen, I lose a part of the limited 12 bit sampling range So...what could I do to solve this? How can I measure 0..5 V or 0..10 V ranges with the 0..1,8 V ADC range of the BBB? It would be really nice when somebody could provide a schematic I could use for setting up my hardware (yes, soldering some components is within the range of my electronic possibilities ;-) Thanks! AI: Use a voltage divider to attenuate the signal. Sometimes its advantageous from an impedance perspective to buffer the signal with an amplifier (but is harder to wire). The attenuation is for 0 to 5V in the schematic. You can use the link to calculate it for 10V. Input protection is included on most devices, but usually cannot handle large currents. If the source connected to the ADC has large currents, you can protect inputs of downstream devices with diodes or other methods If resistor tolerances are an issue, then use better resistors (they can be bought in 0.1% or sometimes 0.01%) which is sufficient for most applications.If you need more absolute accuracy, then you'll have to calibrate the resistors. You can find the accuracy by using the resistance tolerance and plugging into the equation: $$ \frac{Z_2}{Z_1+Z_2} = \frac{5.6k}{10k+5.6k} = 0.359$$ And then you plug in the highest and lowest tolerances for a 5.6k resistor with a 1% tolerance you would get 5656Ω and 5544Ω $$ \frac{5656}{10100+5656} = 0.358$$ so if both resistors were at their maximum tolerance you'd be 0.64% off in your software with 1% resistors. One problem with microcontroller ADC's is they are more susceptible to noise because the voltage range is smaller and usually have a lower resolution. simulate this circuit – Schematic created using CircuitLab Vin would be from the 0 to 5V range and Vout would be your 0 to 1.8V range I forgot to answer about the power. The beaglebones VDD_ADC is just the digital 1.8V line with an inductor and capacitor for a filter (to filter out digital noise) The AGND is a separate ground to give a return current that is noise free also. So any analog signals\circuits should be referenced from AGND. The VREF is also tied to the VDD_ADC so the ADC's are going to be noisy. If you really need accuracy switch to a dedicated ADC and reference.
H: unknown component in mini cooler I am modifying a mini cooler/heater and there is one component whose role I don't understand. The Peltier cell is attached to a heat sink on one side and is in contact with a metallic block on the other side. On top of this metallic block there is a black plastic cylinder with two incoming wires. The two wires are set at 0 V both when cooling and when heating. What does this unknown component do? Thank you. AI: My guess is that the device is a thermal limit switch. The device opens the circuit up once a temperature level has been reached. The main purpose of it is to ensure safety and prevent a possible fire. The photo below is a thermal limit switch commonly found in your furnace
H: Signal Change When Oscilloscope is Added Thinking this should be obvious, but having trouble identifying a fix: I use multiple channels on an NI PXI DAQ card for RSE voltage measurements. I need to verify the voltage readings returned by the DAQ card with an oscilloscope. Without the DAQ card input running, the Scope shows similar data. If I run the DAQ acquisition at the same time as the Scope, i see periodic blips that happen at the same rate as the card multiplexes between its input channels. A) Why would I see these blips on the scope? B) What can I do to eliminate them? Details: The AI connections and Scope probe connections are made at the same location. A higher DC Coupling impedence results in a higher amplitude of the blips. Switching to AC coupling has no effect. The blips are seen even if the circuit is not being driven by a signal. Thank you! AI: Think about how the input multiplexer works... If it is implemented with solid state analog switches, then these are really FETs. FET gates are capacitors. Switching the FET involves charging this capacitor. This injects a spike into the mux inputs and outputs. Depending on circuit impedances, it will result in more or less voltage. Most analog switch datasheets include a "charge injection" specification for this very reason. Now, even if it is implemented with relays, consider the fact that the switch connects your probe point to a circuit inside the DAQ board, and this circuit has capacitance. When switching, current has to be drawn from the probe point to charge stray capacitances to the voltage being probed. You can't measure something without changing it. However, I would presume the NI engineers did their job properly, and inserted enough delay between the mux switching and the ADC acquisition to let these transient phenomena settle before digitizing the input voltage.
H: Modulation signal getting distored when connecting demodulator Good day Guys, I have a question regarding output signals of a specific stage getting distorted when connecting the next stage. In my scenario, I am working on an AM modulator and demodulator of a 10kHz square wave with a carrier frequency of 850Khz, currently, my Modulation is working and producing a nice modulated signal. Before implementing my demodulator I run my modulated signal through a Gain stage ( Operational Amplifier ) to amplify the modulated because of its low peak values that are influencing the accuracy of the Demodulator. When I send the demodulated signal through the gain stage (without the gain stage output connected to the demodulator) I get a nice amplified signal. However, my problem comes in when I connect my demodulator to the output of the Amplifier stage, the output from the Amplifier stage changes to a very weird looking signal. The modulated, amplified (without demodulator stage connected) and amplified (with demodulator stage connected) can be seen in the figure below, So my question is why does this distortion happen, and how can it be fixed? I am terribly sorry if it is due to noobies mistake! If have attached a screenshot of my Circuit below, AI: The problem seems to be in how you are powering your LT1468. You have powered as a single ended source since V4 is no way referenced to ground. Use 2 Voltage sources reference to ground, one positive or one negative. Additionally you can change your amplifier setup to work as a single-end mode.
H: How to prevent MOSFET from operating in high resistance part of linear mode? I'm using several MOSFETs to control various loads, e.g. pumps, lighting, ventilation etc. In the implementation, I have several driver circuits on one board (simple emitter follower, which gives good switching speed with a gate voltage of ~5V; using pull-ups were too slow/inefficient), with jumper cables to a board with several MOSFET circuits. Each circuit is like the schematic. While testing, I touched the signal cable and it caused the MOSFET to turn on, but it got extremely hot in just half a second of on-time. Now I'm worried that a small failure in the driver circuit, e.g. if MCU is disconnected and the signal wire somehow picks up a small voltage, it will be amplified into the MOSFET gate, causing a meltdown in just a short period of time. Could this start a fire? Or will the device just fail closed? Ideally the circuit would not even allow the MOSFET to operate in high resistance part of the linear mode. Can I improve my circuit to avoid gate voltages less than, for example, 4V? Is there a way that I can detect/prevent overheating (besides a complicated setup of sensors). simulate this circuit – Schematic created using CircuitLab UPDATE: Pull-down on signal Adding a 10k pull-down on the base of the BJTs caused the noise to no longer turn on the MOSFET. QUESTION: However, it didn't really answer the core of my question, which is more that I'm worried about situations where a MOSFET may turn on ever so slightly, yet able to conduct, causing extreme heat and consequently potentially starting a fire. I can't use a fuse, since the problem is not overcurrent. Perhaps a thermal fuse mounted to the MOSFET, but that seems rather unorthodox. Is this a non-problem that I'm overthinking? AI: A simple, modular, and robust way to get better behavior from a circuit when the input is in an invalid state is to place a Schmitt trigger between the exposed input and the driver. A Schmitt trigger is (almost) guaranteed to produce a logic high or logic low even if the input is at an invalid intermediate level, weak, or floating. Note that the integrated MOSFET driver that anrieff's answer mentioned has an internal Schmitt trigger in its input logic (denoted by the ⎎ symbol). If your existing circuit is adequate at the actual job of of driving the MOSFET when the input is 0 V or 5 V as intended, then you can add a Schmitt trigger in the form of an inverter, buffer, or other logic gate that has a Schmitt trigger input, preceding your driving circuit. As a further example of their use, Schmitt triggers are also commonly used in microcontroller inputs to protect the internal logic — ordinary logic gates can misbehave, and even draw excessive current and overheat, when the input is invalid, whereas a Schmitt trigger turns an invalid signal into some valid signal. Another hazard specifically for driving MOSFETs (or any power transistor) that is not solved just by using a Schmitt trigger is if the input is is commanding the driver to switch on and off rapidly (whether this is deliberate, as in PWM drive, or accidental noise). Then the MOSFET will spend more of its time in the middle of switching, and so dissipate more power. To reduce this you must either avoid such frequent transitions reaching the driver (probably the better option, if needed at all, in your application since your loads might also be unhappy) or ensure that the driver switches very fast (low rise/fall time).
H: PCB Design Power Plane Question I undesrtand that ground plane should be continuous so return current will follow right path so no delay and additional noise voltage along with the reduction of empedance which is good and necessary thing especially for high speed.(If anything wrong or lack in this part please let me know) What bothers me is this: Ground plane has many functions but why do i have to allocate a second layer for vcc plane. If i do then i wont have enough room for wiring in 4 layer since 2 of them already gone for vcc and ground. Cant i just allocate one layer to continuous ground and use rest for proper trace wiring. And I will draw vcc traces thicker based on current required. I am confused because everyone says allocate power plane besides ground but in high level designs i saw like this a10-proto kicad there is no power plane only continuous completely allocated ground plane and other layers are for wiring. And they wired power traces with thick wires. Could you provide me some insight please. AI: The ground plane is most important, as you recognized. Not only does it allow the shortest return path, but the lowest impedance, and it also creates minimal loop current which reduces EMI. The next most important is often the power plane(s). Usually, once you go to 4-layers, and assign two of them as ground and power, it frees up a lot of routing on the top and bottom layers that you don't need to use the middle planes for routing. But if it gets tight, yes you can use the power plane for routing some traces. Often you will have circuits with multiple power rails, and in that case usually the power plane is split into different domains, e.g. the MCU may sit on a section of the board where the power plane is at 3.3V, where other parts of the board are at 12V for I/O. If the density of the board increases to the point that you find you need more internal layer routing, it might be advisable to go to 6 or more layers. Again, for most low to medium density boards, having two layers just for routing is usually enough, if your routing strategy is sound. So if you feel you need additional layers and you aren't packing 0402 or smaller parts close together, then maybe there are better ways to route the traces. If you do want to put some routing on the power plane (and you can also use the ground plane but I would try to avoid that), just be careful that you aren't cutting of or overly-restricting current paths. And finally, yes, you could just use one ground plane and three routing layers, if you feel you need more routing area but not enough to justify 6-layers. So you would just route the power traces as you would normally on a 2-layer board. Or you could route your signals, then do a copper pour of the power rails in the remaining area. Remember again to check the current paths. Usually you route the power traces anyway to be sure you can get sufficient trace widths through everywhere, and maybe do a DRC, then pour the remainder. EDIT: Further explanation of the return path. Current will return along the path of lowest impedance. In DC or low-frequency circuits, impedance is essentially just the resistance, so current follows the path back with the lowest resistance. This is usually a ground trace or ground plane. Current doesn't jump through the air to return on a power trace just because it's closer. However, when dealing with higher frequencies, impedance is more than just resistance, it includes inductance and capacitance. Now, the capacitance of a trace will be influenced by a nearby power plane. If you want to calculate characteristic impedance for example of a 4-layer board with internal ground and power planes, the calculation considers the closest 'reference' plane, which could be either. So if it is a symmetrical stack up (with equal height from top to first plane as from bottom to second plane), then the impedance of a given track would be the same. But this assumes the tracks are carrying high-frequency signals, such as USB, Ethernet, etc. This is where perhaps the confusion in what you have heard or read comes from. It's sometimes difficult to expand basic electrical theory from the Ohm and Kirchhoff laws, to high-frequency AC circuits, from the DC or time domain, to the frequency domain.
H: How to interpret thermometer sensor reading values? how to interpret values for this sensor: The value is 12 bits, so values can be as much as much as 4096. The temperature range is -40 to +125 Celcius. What is the meaning of -9.05 LSB/degreeC? user manual p33 AI: At 25°C the 12-bit extended register should hold 1852 (all numbers are base 10). For each degree C above 25°C the reading should decrease by an average of 9.05. So for 45°C the reading should be 1852-9.05*20 = 1671. Similarly it will increase by 9.05 average for each degree C below 25°C These are nominal numbers and specified as being uncalibrated, so they will vary from unit to unit. The nominal (uncalibrated) temperature T in °C for a given count x is: T \$ \approx \frac {1852-x}{9.05} + 25 \$
H: Is it okay to cut a 2 row 8-pin DIP socket for IC to stripboard connections? I have a fatal short circuit (connecting 0V to 5V) on a very tedious stripboard project because I was given an 8-pin 2-row DIP socket (shown below) that has a short circuit between pins 2 and 3 (the two middle pins on the left-most side) instead of an 8-pin 2-row DIP socket where none of the pins are connected to each other. Do I have to de-solder all ten of the sockets I have used and solder new ones in (painful) or could I simply manually cut the socket between pins 2 and 3 with some sort of razor blade (please recommend a better tool)? Edit: it was suggested that no sockets are manufactured with short circuits so I am guessing there must be something wrong with the board. I have S-C, O-C and continuity tested the board (as well as made some extra track breaks) and still I cannot see why the top most rail is shorted to the bottom most rail... Most of this board was not by work but it is my task to finish it off (groan). Topside and bottomside pictures shown below (shorted pins shown in red): AI: Thanks to all the comments I realised there was a short under the correcting wires on the underside of the board. Note to self: Manufacturers are not evil and do not produce shorted sockets. Thanks again to all the commenters and the helpful tips!
H: Number of not gates in multiplexer I'm reading a page on multiplexers that has the following image. I says for constructing one it used 7 not gate. But looking at the image I don't know why three of them are needed. Could't you just cut down on the number of them by making a connection such as what I've done in red bellow? Is there something else I'm missing here? AI: Yes, that could be removed and it would logically be correct, but there are a couple practical reasons why you wouldn't want to do that. Those NOT gates are functioning as buffers for the signal coming in. This way, your single input signal doesn't need to drive a whole bunch of AND gate inputs. While this isn't a big deal for CMOS logic since input current is negligible (or at least very small) and doesn't affect the output voltage as much, TTL logic is more sensitive as it requires current to be drawn through the outputs. Three or four AND gates from one signal could be problematic as it will try to draw a lot of current. Even for CMOS inputs, which look close to a capacitor, the edge shapes of the incoming signals will be affected when they drive more gates (this is one reason why chips such as "clock buffers" exist and are very useful). Too many gates and suddenly your signal doesn't have enough time to finish driving every gate low before it starts to go high again (your waveform then starts to look like this and doesn't ever get all the way low or high) because it has to charge and discharge all those capacitors, making what effectively is an RC filter on your signal (R is the output impedance of your driver). The other thing about using those as buffers is it makes the inputs all look the same electrically. Your ~E input drives 8 AND gates while the other inputs drive around 4. This means that you need to compensate for each individual input when interfacing to the circuit, rather than being able to use the same output circuit to drive the inputs. With those buffers, all of the pins, including the D pins, look the same as any other pin and make designing with this logic block easier to do. I think it all comes down to "it makes it easier to design to use this particular circuit."
H: Elusive SR Latch: 74118/19 – Hex SR Latch with common reset I am working on a circuit where I need to hold a few signals until my MCU reads them. Basically the MCU would read these lines at regular intervals (minutes? hours?) and if a line changed state at any stage during this time, it has to be recorded. I am opting for an SR latch, to be cleared by the MCU once the read has been completed. In this scenario a common reset channel on the IC would help maximizing the numbers of available latches in the same footprint (and make the circuit more elegant and simple). I have found a very elusive 74118/19 (possibly NOR vs NAND). However is practically impossible to find good supply of it and even a datasheet. Question: Do anybody have an idea of an IC that offers this capability (SR with common Reset)? Backup question (maybe deserving its own question): Any suggestion on how to implement this otherwise? Looks like an SR is my only choice here, but my brain is just a drop of the ocean. Thank you all for your help! EDIT – to clarify a few points in the design: CHEAP AND SIMPLE DESIGN This is meant to be a quick, cheap and low complexity design. The most complex part (by design) is planned to be the MCU. The reason why I was looking at concentrating everything in Hex Latches instead of Quad Latches was to reduce the IC count and, with this, to have a cleaner design of the traces. As far as possible I want to keep it digital and without any high frequency line anywhere (or, better said, well confined in their own "realm": MCU, comms module and voltage regulation sections). MCU DEEP SLEEP VS INTERRUPTS I'd rather not give too much confidence at these MCU interrupts management. On top of that, when I will get into power-optimization for the MCU I may end up having to choose between keeping the interrupts alive or saving power. I want to keep it flexible, both capability and power-usage wise and this requires balance. AI: You may be looking for this: CD4043/CD4044 3-state SR latch with common enable. You might way to use the common enable in the CD4044 to implement the solution you're looking for. Connect all 4 R inputs to Vcc (HIGH), then use E as a common reset. For this to work you need a pull-down resistor on every output. Some MCUs inputs can be configured with internal pull-ups/downs, so you might be able to do this with no additional parts. Most MCUs inputs can't be configured with internal pull-downs, only with pull-ups. So you may then want to consider another alternative. Use CD4043 instead of CD4044, then connect all 4 R inputs to GND (LOW) and use E as an active low common reset. You will then need pull-ups on every output instead of pull-downs, so just use the pull-ups of the MCU inputs by configuring it accordingly. Why does this work? If you look at the truth table of CD4044: When E is HIGH it's equivalent to set all 4 R inputs to HIGH (= you get the same output from either E or R). When E is LOW all the outputs will be in high-impedance (open circuit) and the pull-downs of the MCU will force a LOW on them regardless of the S inputs (= it effectively acts as a reset). You can derive a similar deduction for CD4043.
H: Tekpower TP-3003D Switch Between Constant Current and Constant Voltage I understand that the Tekpower TP-3003D power supply has two modes: constant current and constant voltage. There is no switch or button or anything obvious to select one mode over the other. How is this done? It appears to be stuck in constant current mode. With no load on the supply, I set the voltage to 12 volts. Once a load is put on, the voltage drops to around 9 volts and the current is around .47 amps. Adjusting the voltage while there is a load on the supply does nothing; the voltage remains unchanged. AI: A lab power supply like the Tekpower TP-3003D usually behaves like this: If the load is lower than the set maximum current, provide a constant voltage. If the load is higher than the set maximum current, reduce the voltage so that the set maximum current is flowing. There are some others which will switch off the voltage completely if the load is higher than the maximum current, but modern ones have the constant current mode. So in your situation, the load at 12 V is higher than the set maximum current (0.47 A), so the voltage is reduced to a point where just this current can flow. In your case that is around 9 V. In order to get the voltage up, increase the current limit, not the voltage. As you allow more current, the internal regulator will increase the voltage to get that current flowing. But it will not exceed the set voltage once it reaches that level. Usually you can see the set maximum current if you turn off the output, adjusting voltage and current while the output is active should be performed carefully. Especially don't change the voltage when in constant current operation, you won't see what voltage you set, if you turn up the maximum current, you might have set the voltage too high and damage your device. Also make sure that your device is connected the right way, if it isn't supposed to take so much current, you can easily have a short circuit somewhere or hooked it up with reverse polarity. The current limit of my bench supply saved quite a few electronics from premature death...
H: Batteries and running time If I have a system working at 2.5V-0.3mA powered by two CR123 3.7V-2000mAh.Is my system going to last the same time if I put my batteries in parallel or in series?Because if I want it to last 12hrs a day during 2 years, at 3.7V (parallel) I need a 1780mAh battery (I have 2*2000=4000mAh) and at 7.4V (series) I need a 880mAh battery(I have 2000mAh).In both case in parallel and in series it will work.But in which case is it going to last longer?Thank you in advance ! AI: You actually answered your own question in there..... When you have them in parallel, you get 4000mAh, and in series you only get the 2000mAh. So with that you can see quite clearly that you get more mAh when they are in parallel. If you wanted to know which one will last longer then you have all the required information right there in your question..... Just take the mAh you have and divide it by what is required. Whichever comes out with the highest number is the one that will last longer. 4000/1780 = 2.247 2000/880 = 2.27 So there isn't actually that much of a difference in this case. Pretty sure this is the answer you were after unless I have missed something from the question? A good place to calculate battery life is HERE
H: AC motor 3 wiring how to connect to EU plug Hello electronics stackexchange, a friend gifted me an electric motor he didnt need any more. It looks exactly like this ans also has (nearly) the same numbers on it : https://www.aliexpress.com/store/product/390210-001-390209-001-12V-server-fans/1913237_32589390473.html I have use for this one, but am not sure how to connect it to my power supply (Germany, EU Plug). Is this an more or less easy task or am I better off just not touching it? Greetings AI: It looks like a three-phase motor but the Aliexpress listing says both 12V and 230V which is unhelpful. It might be that if you dismantled the fan-duct housing you would find the motor inside has more helpful markings. When friends offload their dusty old junk on to you, there is often a good reason they never found a use for it. You need some other parts Rough translation: Ducted Fan thingamajig 30A electrical whatsit Controller/Tester gadget positive and negative leads electrical supply Like this $15 3-phase 360W DC 12V Brushless High-Power Motor Speed Control PWM Controller 30A
H: In step up transformer which side have high inductance? I plan to use 1:10 center tap step up transformer, in my circuit design. But I have one question, which side have high inductance in step up transformer? (Primary or secondary) Give me some hint of inductance of transformers. AI: As the inductance of a winding varies as the number of turns squared, the high voltage side will have higher inductance. With a 1:10 ratio, the high voltage side will have 100x the inductance of the low voltage side. Do be aware that inductance in power transformers is quite poorly controlled. In most circumstances with a power transformer, it's not the thing you use for the first order design. You do specify an ideal transformer in SPICE with the inductances however.
H: If electrons move slowly in an electrical circuit then what signal or energy is it that travels at the speed of light? I am reading "Radio Theory Handbook" and am confused with the statement that says that electrons are moving through the wire at snails pace.But it goes on to say the "electrical effect" is instantaneous. I assume he means the speed of light. Then what is this mysterious electrical signal in the wire that moves at the speed of light? Is it the EMF? By definition electricity is the flow of electrons. But yet the electrons are said to travel slow? There cannot be a contradiction. I am asking for help in clarifying this. Thank you. There is another question " Is voltage the speed of the electrons? This is not the same question. I am not asking about voltage. I am asking about the apparent contradiction given the fact that electricity which is the flow of electrons has an almost instantaneous effect while the electrons themselves more very slowly. Although it is not the same question there was enough useful information there and along with all the excellent responses that my question has been well explained. AI: The electrons zip about at random due to thermal energy (more properly at the Fermi energy, once you start thinking in quantum terms). However that random motion has no net effect on the large scale, other than to generate Johnson noise. Superimposed on this random motion is the drift velocity, which is a snails pace, due to the macroscopic current. Each 64g or so of copper has a faraday of charge in its free electrons (96500 coulombs), so they don't have to move fast to create a large current. The electric and magnetic fields move at the speed of light in the insulating medium around the wire and this is what carries the signal and controls everything - the current in the wire responds to the electric field, starting at the surface and working down into the bulk of the metal according to the skin-effect. At radio frequencies all the current is carried in the outer most few microns of the conductor, pretty much all the action is in the space or insulator around the wire (or inside the waveguide)
H: varistor with reverse operaton Varistors are known to use for over-voltage protection, as they have high electrical resistance at low voltage which decreases as the voltage is raised.(wikipedia). But is there any electrical component or simple solution to function reversely?! In contrast, A non-linear resistor to have low electrical resistance at low voltage and high resistance at high voltage? or simpler closed-circuit when no voltage, and open-circuit when voltage greater than any constant applied? AI: A positive temperature coefficient (PTC) thermistor, though it won't reach open circuit.
H: AM Demodulation of Square wave Good day Guys, I am working on an AM Modulator and Demodulator circuit using the diode method. My modulation signal is a 10kHz Square Wave and I have a carrier frequency of 850 kHz. My modulation works just fine, according to my general knowledge, however, my demodulator is currently outputting a very weird looking wave, it resembles a square wave but is not close enough to know it was one, at first sight, my question is how can I improve the demodulation? I have attached a screen shot of my circuit and the various outputs(Input Signal - Blue, Modulated signal - Red, Demodulated Signal - Green) below, Note 1: I am using LtSpice. Note 2: This circuit is just for me to learn how the modulation and demodulation works, and thus it has implemented ideal diodes and none practical component values. AI: R8 (1 Mohm) and C4 (15 pF) have a time constant that is too long for decent 10 kHz demodulation. Try lowering R3 to 1 kohm. You will get more carrier ripple coming through but the square wave shape will be much improved. Regards your modulator, it is a very practical use of a simple diode to achieve AM but your inductor is too small and your capacitor is too big for a practical design to use as a bandpass filter at 800 kHz. Try raising the inductor value by a thousand and lowering C by a thousand, then recompute R4 to be about a kohm. That output filter and its Q is fundamental to optimizing the modulation shape in this type of diode modulator.