text
stringlengths
83
79.5k
H: RGB LED Strip - several question from newbie I've just bought 5 meters long 12V analog RGB LED strip and I'd like to turn it on! There're 60 LEDs per meter so, totally 300 LEDs and each LED consumes 20mA. Here're my questions. From internet guide like this(https://learn.adafruit.com/rgb-led-strips/usage), power is directly connected to white line then where is ground? (single LED have 4 legs - Red, Green, Blue and Ground, isn't it?) If I have 12V DC Adapter and it throws more than 6A current, can I use it without resistors? If the adapter throws more than 6A current, what happen to remained current? just gone away to somewhere? Can I use higher voltage adapter if I use proper resisters? thanks in advance and sorry for my bad English! :( AI: Yes, But the cathode (negative part) of the diodes in adafruits example is connected to R/G/B. Then, when you apply power to the common anode (positive side), the pin (R, G or B) you pull low to ground will light up. Your adapter doesn't just push out 6A; it is able to provide 6A at 12V. You can power any 12V device with it requiring less than 6A. Say you connect 3 diodes in parallell that consumes 20mA each, the output of the adapter will only measure 60mA. If the circuit powered by the adapter requires more than 6A, your adapter will start heating up and break. Yes, but I guess you have to read up on some basic skills before trying this, i.e be really sure of how the circuit is connected before calculating the size of your resistors. Too low R = broken circuit. Too high R = non functioning circuit.
H: PIC16F57 - problem implementing wake up signal on key stroke I have designed a simple RC5 remote control using a PIC16F57 and the classic rows-columns scan over a 4x4 matrix keypad. The previous version of my firmware continuously scanned the keypad to find a keystroke but the batteries consumption was to high (obviously). Now I'm trying to implement a wake up system in which the micro sleeps all the time and wakes up only when the user press a key on the matrix. The problem is that the 16F57 can only wake up on 1) low logic level on MCLR or 2) watch-dog timeout. The latter could be feasible but it would imply polling the keypad every, let's say, 100msec. The first solution is the best but I couldn't make it work. The solution was addressed here: http://www.t-es-t.hu/download/microchip/an528d.pdf It's an official Microchip document so it should work. However I implemented the circuit and it doesn't work. The micro goes sleep but doesn't wake up (all the scanning lines are at logic level low before going sleep so they should discharge the capacitor). The proposed solution uses a 47K resistor to pull-up the MCLR pin but in the official datasheet of the 16F57 they recommend a <40K resistor for correct usage. I tried to use a 47K and the pic didn't start so, thinking of a typo, I used a 4.7K which resulted ok to start the pic (although it didn't solve the wake-up problem). The voltage across the capacitor should drop to a near zero to trigger the MCLR pin and cause a wake up but it seems that the scanning line, even at a logic zero, can't discharge the capacitor. Do u have any clues how to solve the issue? thank you! P.S. the capacitor in the schematic doesn't have the "+" sign so I assume they want a non-electrolytic capacitor. AI: The example circuit is given as this: The important factor here is the voltage which the \$\overline{MCLR}\$ pin sees, and when. Under normal operation the voltage should be high enough to register as a logic HIGH. When you want to reset, or wake up, the voltage must be low enough to register as a logic LOW. With SW1 open, the voltage at point \$A\$, assuming \$V_{CC} = 5V\$, would be (once the capacitor \$C\$ is charged up) 5V. That is regardless of the value of resistors. Maybe 47KΩ causes too little current to flow to charge the capacitor fast enough? Unlikely, but possible. Try reducing the value of the capacitor (or try temporarily removing it altogether - it's not a component that's critical to the operation of the chip, only the wakeup system). When you close SW1 with RB2 low the resistors R1, R2 and R7 form a voltage divider. The voltage at point \$A\$ would be \$V_A=\frac{R2 + R7}{R1 + R2 + R7}×V_{CC} = \frac{4800}{51800}×5 = 0.463V\$. That should be low enough to register as a logic low. In the datasheet a logic low for \$\overline{MCLR}\$ is defined as \$V_{IL} = 0.15×V_{CC}\$, so for a 5V supply it would be 0.75V. However, reducing R1 to 4.7KΩ would massively change that voltage: \$V_A=\frac{R2 + R7}{R1 + R2 + R7}×V_{CC} = \frac{4800}{9500}×5 = 2.526V\$ That's way too high to register as a logic LOW, so a reset will never happen. So you need to ensure that the ration between R1 and R2+R7 (and of course R1 and R3+R8) is correct. If you reduce R1 you must also reduce R2 and R3 accordingly. Maybe going to R1=10KΩ and R2 / R3 = 1KΩ might bring it back into line with the datasheet.
H: Systems and signals - integration with dirac's function and step function I'm taking the introductory course to systems and signals and the mathematics of integration using the step function and Dirac's function and For the first integral, I just don't know how to deal with u(t-4), the step function. The other two questions i don't even know how to start. Thanks, any help would be appreciated AI: u(t-4) means that the integral is equal to zero till you reach 4, so compute the integral from 4 to infinity. the last question, it's about convolution of h(t) and x(t). for x(t), t<0 always x(t)=0, t=0 x(t) = 1 and t>0 x(t)= -1. draw x(t), you have h(t). convolve them.
H: Temperature stabilization with PWM , PID controller with delay system I am doing a project to control the temperature with PWM. I use peltier, thermistor,mcu and h-bridge mosfet. I want to reach a temperature with an error less than 0.05 and stay at that temperature without much (at most 0.05 C) oscillation. My first aim is to reach that temperatures in room temperature (no other effects than room temperature). Lets consider cooling mechanism, in room temperature, for example 14'C requires .285 PWM (out of 1) ,13'C requires .330PWM, and 20'C requires .180PWM. There is no linearity between them, and also changing PWM does not provide linear current change, ex: 1.0 PWM provides 2.15A, 0.5PWM provides 0.6A, and 0.2 PWM provides 0.16A across the peltier in room temperature. My first cooling algoritm:Initially constant=0 Keep PWM 1.0 until temperature is close to set temperature (t_set) by 2, then lowering the PWM with, PWM=constant+ (temperature-t_set)/2, after temperature is set to a temperature constant=PWM, and then PWM=constant+ (temperature-t_set)/5 and so on. And the system reaches steady temperature after 10-15 seconds after the PWM is changed, when PWM change >0.1 First question: How the mcu can can learn the PWM value that keeps the temperature constant? ( ex: 13'C requires .330PWM) Second question: Is it possible to use PID algorithm to stabilize PWM value at set temperature without knowing the constants at first question? Third question: If I find a good way that mcu to learn PWM values to keep temperature constant at different environments, and If I use good PID coefficients, do the PWM coefficients works for any environment, or are the PWM coefficients environment specific, ie: heat sink medium and differnt temperatures. Thanks in advance. --After 6 hours, from the answers Q1- Learning that coefficient (I think) requires some algorithm when there is no PID. Q2-Yes, with good PID coefficients it perfectly stabilizes, error term will be 0 and the only integrator term keeps the system stable, in noiseless environment. Q3- If good PID coefficients are used and with educated (??) guess some level of stabilization can be accomplished. To achieve good results in different environments (I think) it is needed to develop a auto tuning PID. My design criteria are keeping the temperature error minumum and keeping the reaching time for stabilization low (if possible). From the result if it is approprite to ask here my fourth question is: Q4: Which methods do you suggest me to find Ki, Kp and Kd coefficients in different environments (auto tuning PID coefficients when the mcu starts or restarts). AI: Q1: The controller will find the PWM value to keep the temperature at the setpoint if the PID is reasonably well tuned. If it not tuned well, it may oscillate around the setpoint or be very sluggish in approaching the setpoint, and also slow to respond to demand changes (such as a change in ambient temperature). Q2: Yes, if you make an educated guess as to the values it is possible to get stable control with a try or two. Or use a self-tuning algorithm. And/or a manual method such as Ziegler-Nichols. Q3: They will work reasonably well for some range where things stay more-or-less linear. If you triple the wattage of the Peltier, for example, you'll probably get a lot of overshoot. In most applications (not all) the tuning parameters are fixed numbers for a given range of setpoints (perhaps all valid setpoints). It's not always possible to get the control you need with a single control loop, sometimes nested loops are required. I've gotten control down to the \$\mu K/\sqrt {Hz}\$ level but it's not easy. Your 0.05°C may be difficult or not so bad, depending on what the system looks like.
H: when to use auto correlation and when to use fourier transform In communication, if we don't know any prior information about the signal, we perform an auto correlation say Rx(T) and take the Fourier transform of Rx(T) to analyze the power spectrum. Supposing if my signal is known do i need to perform auto correlation , or simply i can take a Fourier transform, and then calculate the power from it.? Am I seeing it right? or am I missing something here.? thanks in advance phani tej AI: It all boils down to the question whether the Fourier transform of the signal exists or not. If you model a signal as a stochastic process then you can't take its Fourier transform because normally it doesn't exist. But if you consider a real-world signal (which usually has finite length) then the Fourier transform (usually) exists and the two operations (autocorrelation + Fourier transform, Fourier transform + magnitude squared) are identical. In that case the (deterministic) autocorrelation is $$R_x(\tau)=\int_{-\infty}^{\infty}x(t)x(t-\tau)dt=x(t)*x(-t)$$ where \$*\$ denotes convolution. Noting that the Fourier transform of \$x(-t)\$ is \$X(-\omega)=X^*(\omega)\$ (because \$x(t)\$ is real-valued), you get for the Fourier transform of the autocorrelation $$\mathcal{F}\{R_x(\tau)\}=X(\omega)X^*(\omega)=|X(\omega)|^2$$ So either computing the autocorrelation and taking its Fourier transform or computing the signal's Fourier transform and taking the squared magnitude give the same result. Note that this is true whenever the Fourier transform of the signal exists.
H: What is the purpose of a capacitor in the feedback path of a unity gain buffer? First time using this site, I'm an EE student and have been studying opamps. So far in class we have only discussed 'ideal' opamps, but I saw an opamp with this layout and was wondering if anyone could clarify what 'C1' and 'R1' are used for? I have been trying to look for answers online, and believe I have a good understanding of what 'R1' is doing, but I have been unable to find any answers for what 'C1' is accomplishing. This is not a assignment, just my own curiosity. AI: R1 and R2 being equal (R) means that the offset error due to input bias current (but not input offset current) is eliminated. If an equal current Ib flows out of each input pin then each pin will be higher by Ib * R and if the impedance at V_in is much lower than R, the two cancel out. simulate this circuit – Schematic created using CircuitLab The capacitor (if chosen to be large enough) reduces to a neglible value the phase shift in the feedback due to input capacitance of the op-amp (with R) that could reduce the phase margin and potentially cause instability. So it eliminates a problem that is caused by using R in the feedback rather than a short.
H: How to up-convert PWM frequency without using a microcontroller? I am trying to drive a motor H-bridge, but my control system can only support a 400 Hz PWM signal (black box, can't change it) which gives the motor an extremely loud 400 Hz whine as you would expect. Is there any way to take the 400 Hz PWM signal and convert it directly to a 25 kHz PWM without passing it through a microcontroller (they are verboten for this project)? I can't put the input PWM into an RC filter because I need to preserve the system's time response. Any ideas? I did a search on Digi-Key for any IC's that could do this, but came up empty. AI: I found a potential solution! It turns out that there exist PWM-driven DAC chips like this one: LTC2645. If I combine that with this analog-driven PWM generator chip I've used previously (LTC6992), I can drive a new PWM at an arbitrary frequency based on the input duty cycle! The downside of this approach is that there is still a 2.5 ms delay because the DAC only updates after a full period. I'm leaving the question open for now in case someone can find a solution with less input delay.
H: SMPS: What is current mode instability (aka “sub-harmonic oscillation”)? In peak current controlled switching power supplies, there is a phenomenon called “current mode instability” aka “sub-harmonic oscillation”. What is that? Can't seem to get a good explanation of this.... Bonus: (To mitigate this side effect, they recommend using something called "slope compensation".) AI: Rather than going into the mathematics of this, it's quite easy to see this graphically. Consider a peak current mode controller operating at <50% duty cycle. Then you can see below that perturbing the system results in the perturbation decaying and the system returning to steady-state operation. But at >50% duty-cycle the system does not return to steady state operation. Instead, it enters a "sub-cycle oscillation" mode. Simple as that. See source for a more detailed explanation.
H: Replacing capacitor from unworking TV with some other capatitors which has not the same value I am repairing (trying to repair) my TV. I found 1 capacitor 25V \$1500\mu\$F which i think is bad (it has some weird shape at top) I don't have any capacitors with that value but I have some similar to that 25V \$470\mu\$F x3 35v \$1000\mu\$F Can I replace the bad one with this 35V \$1000\mu\$F, or can I combine them (serial or parallel)? AI: If you put your three 25v 470uF caps in parallel, you'll get a 25v 1410uF cap with 3 times the current rating and 1/3 of the ESR (equivalent series resistance) of the individual caps. Depending on the application, this will be close enough capacitance (original tolerance is probably +/- 20% or so) and the lower ESR could be nice too...unless your jerry-rigged setup dwarfs the caps' ESR with its own actual resistance.
H: Convert positive square wave to positive-negative I am looking for a way to convert a square wave coming from a microcontroller with voltage range from 0V to 5V, to a voltage range from -12V to +12V. The frequency of a square wave will vary from few Hz to few MHz. Thanks in advance! AI: Use an op-amp, powered from +/-15 V rails to both amplify and level shift the 0 to 5V square wave: - The circuit above is called an op-amp summer (or adder or mixer) in that two analogue values are mathematically added. If V1 is the input waveform centred at 2.5 volts, the action of applying - 2.5 volts to V2 will result in the output, Vout being level shifted to make a square wave symettrical about 0V. Choosing Rf appropriately will ensure the square wave amplitude is 24 volts p-p. Use a fast op-amp to preserve the speeds of the edges of the sq wave. One more thing, the circuit above inverts the square wave so if duty cycle is important, this will appear inverted too.
H: Bike light blink speed adjustment I am trying to construct a circuit to control an LED in a bike light kind of circuit. This circuit must be designed so that a button press can change the current setting of the light. So for instance first click turns on the light on slow blinking, one more click goes to fast blinking, a third click to continuous light and a fourth to turn it back off. I have been trying to Google my way to an answer, but can't seem to find any reasonable circuitry or inspiration to design such circuit. Hope someone can be of help pushing me in the right direction. Thanks in advance AI: Here's a circuit which should accomplish what you want. It uses a dual 555, namely a 556 with two different rates. A CD4022 is used to count the button pushes. A pair of NAND gates debounces of the push button input, so the counter doesn't advance erratically. The first two outputs select one of the two rates using AND gates. The third output is steady on. The fourth output resets the counter. The outputs for states 1, 2, and 3 are diode-OR'ed together, to operate an N-channel MOSFET Q1 which turns on the LED. Right click and select View Image for a large picture. Since this is a battery-operated circuit, battery life must be taken into account. While the LED is off, the 4022 counter, AND gates, and NAND gates draw only a few µA of current, so they have little effect on battery life. However the 556 is actively generating two different pulse trains and drawing up to 500 µA (assuming a low-power 556; standard ones can draw several mA). So there is a high-side P-channel MOSFET Q2 that supplies power to the 556 only if the counter is on count 1 (slow flash) or 2 (fast flash). If either input to the NOR gate is 1, the output is 0, turning on the FET.
H: Are those two filters equal? Are those two filters equal to each other in their functionality? Of not, what is the difference between them mathematically speaking (zeros, poles, etc)? Also, what is the difference in their function? Essentially I want to simplify the op-amp filter to something without active components. And I wanted to ask around and see if I got it right. Note: the selection of components is only for illustration, and the op-amp can be any other pamp model. simulate this circuit – Schematic created using CircuitLab AI: To complement Olin's answer on why this is impossible with only passives: The frequency response for the op-amp circuit is (assuming an ideal op-amp with negative feedback): \begin{equation} G = \frac{-i (C_3 R_2 \omega - i)}{C_3 R_2 \omega (C_4 R_1 \omega - i)} \end{equation} With the transfer function in s space of: \begin{equation} G = \frac{C_3 R_2 s + 1}{C_3 R_2 s (C_4 R_1 s + 1)} \end{equation} Notice that you will have a pole at \$s = 0\$ (with 1 other pole and 1 other zero). This is a constant amplitude component which relies on the greater than 1 gain of the Op-Amp (for my model the gain tends to infinity). However, passive networks can't have any gain greater than 1 by definition because they can't introduce net energy into the circuit. Thus this filter response can never be reconstructed using passives. Here's the frequency response of the op-amp filter: If we ignore low frequency part and only consider the high frequency response, you effectively have a first order RC low pass filter with a cutoff frequency of about \$10^6 \frac{rad}{s}\$.
H: 2-bit branch prediction accuracy I am trying to solve this problem, the answer should be 15/20 = 75%. However, I am not sure how this was calculated and want to understand the underlying concept. A program core consists of five conditional branches. The program core will be executed thousands of times. Below are the outcomes of each branch for one execution of the program core (T = taken, N = Not taken). Branch 1: T-T Branch 2: N-N-N Branch 3: T-N-T-N-T Branch 4: T-T-T-N Branch 5: T-T-N-T-T-T This behavior remains the same. For dynamic schemes, assume each branch has its own prediction buffer and each buffer initialized to the same state before execution. What is the prediction accuracy for the 2-bit predictor, initialized to weakly predict taken? (Answer is at the beginning but I'd like to understand the concept of the calculation.) AI: First off, I think it's important for you to specify when you do these types of problems (and clarify by asking your professor) which type of 2-bit predictor is being used, because there are 2 types. The first type makes a transition from a weak state to the alternate weak state on failure. The second type makes a transition from a weak state to the alternate strong state on failure. For this problem, I am assuming it is the first type, which transitions from a weak state to the alternate weak state upon failure. That is the type shown in the picture below: Consider what happens in each case individually: WT = weakly taken ST = strongly taken WN = weakly not taken SN = strongly not taken Branch #1 Predict WT - T : 1/1 Predict ST - T : 1/1 Total : 2/2 Branch #2 Predict WT - N : 0/1 Predict WN - N : 1/1 Predict SN - N : 1/1 Total 2/3 Branch #3 Predict WT - T : 1/1 Predict ST - N : 0/1 Predict WT - T : 1/1 Predict ST - N : 0/1 Predict WT - T : 1/1 Total : 3/5 Branch #4 Predict WT - T : 1/1 Predict ST - T : 1/1 Predict ST - T : 1/1 Predict ST - N : 0/1 Total : 3/4 Branch #5 Predict WT - T : 1/1 Predict ST - T : 1/1 Predict ST - N : 0/1 Predict WT - T : 1/1 Predict ST - T : 1/1 Predict ST - T : 1/1 Total : 5/6 Total of all branches : 15/20
H: T-flip-flop without using a clock Is it possible to create a T flip-flop without using a clock? I really need one, but I can't use one with a clock because it requires a signal shortener. AI: You can just wire the toggle input to a high level and then your signal goes into the clock input, this way the output toggles as soon as there is a rising edge on the clock input.
H: Replace 12V 5A power supply with battery I am buying a rgb led strip with the following technical details: Voltage: 12 volts Wattage: 60 watts I want to connect this strip to a battery and don't know what will be the right one. I need the battery to last for 2 hours. I been doing research and this are my assumptions based on what I have researched. Please let me know if I am wrong. I know that volts * amp-hour = watt-hour If I plot the technical details into the formula then I know that I will be needing 5 amps per hour. I now need a battery of 12 volts that can output 5 amps per hour. When looking into the internet I see a lot the term Ah which means amps per hour. Based on this needs I found this battery: Elk ELK-1280 12V 8Ah Sealed Lead Acid Battery. I read that if a battery has a capacity of 2Ah then if you discharge it at 2 amps per hour it will drain in one hour. If you discharge that same battery at 1 amps per hour (half of that) then it will last twice. If you discharge it at 4 amps per hour then it will last 30 minutes. I assume that 8Ah means that if the battery where to use 8 amps in an hour it will drain in that hour. But because I will be using 5 instead of 8 then I know that I will be able to have the battery last longer about 1.4 hours. All the batteries with this capacity that I am looking for are often big and heavy. Then I came across Hiyadeal Portable 12V 9800mAh Li-ion Rechargeable Battery Pack. That battery is only 1 pound! That battery claims to deliver 9800mAh or 9.8 Amps per hour. That means that if I where to use this battery because I only need 5 amps then it will last for about 2 hours? AI: Let's clear up some terminology first. An Amp is not a discrete quantity of energy. It is actually a quantity of electrons per time. Therefore, you don't say "Amps per hour". I like to use the analogy that Amps of current is like speed in your car. If you drove your car for an hour at 60mph (pardon my English unit assumption) and someone asked you about your drive, you wouldn't say "I drove 60mph per hour". That would be silly. Instead you would say "I drove 60mph for an hour." It's the same with current. A battery doesn't supply 5 Amps per hour, it provides 5 Amps for an hour. Furthermore, a battery that has supplied 5 Amps for an hour has provided 5 Amp-hours (5Ah) of charge. An Amp-hour is an actual discrete quantity. It represents the capacity of the battery. So you need a battery that can provide 5 Amps for 2 hours at 12V. That's 10 Amp-hours total. More specifically, since it's 12V: $$5A*2hours*12V = 120Wh$$ Of course, you would never want to buy a battery that can only provide exactly the capacity you need. You want some capacity in reserve. So let's double it and say you probably want a 240Wh battery. That way, you'll only use 50% of the capacity in one session. The Li-ion battery you mentioned in your question has a 9800mAh capacity at 12V. That works out to 117.6Wh. Almost enough to last for two hours with a 5A current draw. As long as you understand what you're doing with a Li-ion battery, that should work, but I would recommend putting two in parallel to double the capacity. When you put two batteries in parallel, their voltage stays the same (12V) but the total capacity doubles (9800mAh * 2 = 19.6Ah). EDIT: Looking at the website for that Li-ion battery, it is not clear what its continuous current capability is. It may not be able to supply 5A of current continuously without overheating. Without a datasheet or more technical specs, it's probably not safe to use. One other note, batteries are not perfect energy sources. As you discharge them, their voltage lowers, their internal resistance increases, and their ability to supply current decreases. The more current you draw at a time, the more these negative effects occur. What all that means is a 10Ah battery may not actually supply a full 10Ah before the battery is flat. This is another reason to get a battery that has a larger capacity than the math dictates.
H: How to measure coils without inductance measuring device? I have a multimeter that can measure capacitance, resistancr, voltage and current. If I have a known coil and unknown coil, can I measure the ratio between the inductance of the two coils? Is it possible to determine the inductance of an unknown coil? AI: Place the known and unknow inductors in series and apply a known AC voltage across the pair of them. Best to use an o-scope for this but it's not beyond impossible to use the multimeter on AC measurement. The sum of the voltages across each inductor will add up to the voltage applied across them both. If the two inductors are equal then the voltage across either will be the same. The smaller inductance will have a lower AC voltage. Use the voltage ratio to determine the ratio of the inductors. For instance a 2H coil in series with a 1H coil will have twice the voltage across it compared to the 1H coil.
H: Do logic families use different type of transistors? Do the logic families such as TTL and CMOS represent only different logical structure? Or do they also use different type of transistors? Latest microprocessor chips with millions of components use CMOS. Is that only because CMOS "operating logic" is superior or also because CMOS family use entirely different transistors? So far I understood is there are transistors which are used in analog circuits and there are tiny ones which are used in IC chips. I guess analog use TTL level transistors? The transistors in ICs use many different logic families such as TTL and CMOS. So there are different transistor manufacturers for all these? AI: Here is an awfully incomplete answer : By doping, oxyding, metallising a slice of sillicon, you can create on the surface several types of components : wires, bipolar transistors (aka BJT), metal-oxyde transistors (aka MOS), resistors, inductors, capacitors... (but it is often easier to create a transistor than these passive components). Components are created at once by applying patterns and exposing the die. Transistors are not 'pick and placed', even for analog integrated circuits. Bipolar transistors used in TTL gates are 'current controlled' and work very differently than MOS transistors which are 'voltage controlled'. TTL (transistor to transistor logic) is traditionally defined as logic levels and I/O characteristics, which were (in the '70s-'80s) optimal for bipolar transistors working with 5V power supply. It is now possible to build with MOS transistors chips compatible with the TTL logic levels. Logic gates can be created with bipolar and MOS transistors, but, nowadays, MOS is used almost exclusively for creating logic circuits like microprocessors, memories... Bipolar transistors (and j-fets) are currently mainly used in analog components (for example operational amplifiers). It is possible to mix bipolar and MOS on a single die, but the additional number of steps and constraints makes that technology more expensive and reserved to specialty component (for history, the first Pentium used BiCMOS which mixes bipolar and CMOS, this technology is nowadays used for analog or mixed signal components like ADC/DAC)
H: How to find the expression for Vout? I have that circuit and I need the equation of Vo, I've been told that I can solve it by the Kirchhoff method but I'm not sure. Is there a way that the expression looks like Vo=K(V2-V1) ? AI: Opamp circuits like this can be solved with a few assumptions: 1) The circuit is linear and therefore superposition holds. This means you can solve for the output in terms of one input at a time, with the other input at zero (volts, in this case). 2) The opamp is ideal and therefore has infinite gain. This means a) the - input is driven to be equal to the + input by the negative feedback loop around the opamp (formed here by R2 and R1), and b) the input impedance is infinite, so no current flows into the opamp + or - terminals. Solving this circuit: First set V2=0. You'll find Vo = -R2/R1*V1. Why? The current flowing from the output to the - node must equal the current flowing from the - node to the input source V1 (by KCL and Rin+ being infinite). And V+ = V- = 0V since we assumed V2=0 and V+=V-. (Vo - 0V)/R2 = (0V - V1)/R1, solve for Vo: Vo = -R2/R1*V1 Second set V1=0. You'll find Vo = R4/(R3+R4)*(1+R2/R1)*V2. Why? VA= R4/(R3+R4)*V2. V-=V+=VA. Then use KCL as above, (Vo - VA)/R2 = (VA - 0V)/R1, solve for Vo: Vo = VA*(1+R2/R1) = R4/(R3+R4)*(1+R2/R1)*V2 From superposition, we can sum these two for the total output from both input sources: Vo = -R2/R1*V1 + R4/(R3+R4)*(1+R2/R1)*V2 Also, you'll recognize these as the equations for the "standard" inverting and non-inverting op-amp circuit gains: Vo = -R2/R1*Vin (same as V1 above) Vo = (1+R2/R1)*V+ (no voltage divider, directly driving V+).
H: Can a transistor's emitter and collector be used interchangeably? I'm trying to understand the standard TTL NAND Gate in TTL level. But confused with the transistor Q1 operation in the diagram below: Apparently when A and B are together HIGH, the Q1 base-emitter junction is reverse biased. Collector-base junction is on the other hand forward biased. So the current flows through R1 and turns on the transistor Q2. So far so good up to here. Here is my question: How can a BJT(probably npn) transistor such as Q1 can operate in such way? I mean when I learn about transistors the base emitter collector connections are very important. But from this Q1 I conclude that one can use base and collector interchangeably. Is that right? AI: As I'm sure you've learned, a BJT is composed of two back-to-back P-N junctions. Knowing this, allow me to redraw Q1 for you, using the diode model of a BJT: simulate this circuit – Schematic created using CircuitLab When the voltage on either of the emitters is below the threshold set by Q2 and Q4, the appropriate emitter diode is forward biased and current flows through it. When both emitters are above the threshold, current flows out of the collector instead, activating Q2 and in turn deactivating Q3 and activating Q4, pulling the output low.
H: EAGLE PCB, how to specify an out-of-board component? This might be a very basic question. I have a schematic where some of the components are outside of the board. For example, for a power supply, I have a switch and a transformer that are on the schematic, but I want them to be placed outside of the PCB, for this I want to place the appropriate pads to allow some wires to be soldered. What's the right way to do this? Thanks! AI: Simply create a new device whose footprint (package) matches the pads you want to solder to on the PCB. Your off-board transformer can be represented as a transformer-looking symbol on your schematic with pins connecting to components elsewhere on the schematic. But you can make its package drawing as just the necessary number of pads in a row. When you place the device in your schematic, it will manifest as just solder pads on the PCB layout.
H: How should this code look like in verilog? I am designing an ALU to add at state 000, I have to assign control signals for a mux, carry in, and operands so that it works. so, i wrote an if statement in the controller module, and the TA told me that its not verilog, but I thought I saw a youtube video with verilog if statements like that. If this code is not verilog, then how should its verilog counterpart that implements the same functionality look like? sorry, i can't find a clear picture, the website i upload pictures blurred this one for some reason. I also can't copy paste because right now i can't connect to my school's server to access the programs. AI: That code is not verilog. It looks like it is probably C. However, it is possible to use an if statement in verilog. Looks like the only thing you need to do to make that code into valid verilog is to replace the { and } with begin and end. However, you may need to put it inside an always block of some sort for it to work correctly.
H: Why do they separate some parts of PCBs through making wide holes? I have seen several PCB that they have wide holes in some their parts (especially the supply of circuits parts). for example take a look at this picture: and on the board: Not sure but I think it is related to the noise, Is it correct? If so, it's not acceptable to me because other parts of PCBs aren't conductive then how it can transfer the noise? If so, how much it can be effective? And my last question is, do they have any special name? AI: It's for better high-voltage safety. Unrelated, because it's not noise. Very. Air is a much better insulator, and it doesn't get wet/have a conductive film form. Basically, a circuit board can get dirty and/or wet. This makes the surface of the board slightly conductive, and once it's a bit conductive, electrochemical action can make it very conductive, and then you get a free fire. Isolation slots / creepage distance cutouts/air gaps.
H: Physical significance of group delay What is the physical significance of the group delay of a system/filter?. Why is the slope of the phase response critical in a communication system. AI: As already pointed out in other answers, the group delay (at a certain frequency) is the delay of the envelope of a narrowband signal centered at that frequency. Note that the term group delay is only meaningful for a few special signals (see also this answer). In general, it's more useful to directly consider a system's phase response. The relevance of phase in communication systems is that a non-linear phase on the channel causes intersymbol interference (ISI), i.e. the symbols get mixed up in time and influence each other, and cannot be detected properly anymore by the receiver. ISI is usually mitigated by using an adaptive equalizer prior to detection.
H: LED that emits light in different direction Is there such a thing as an LED that emits its light horizontally ("to the side") when mounted on a PCB instead of the ususal "up" direction? If so, what are these called, and do they use the same standardized footprints as normal LEDs (1206, 0805, etc.)? AI: Yes, many, many of them (I see 900 or so individual types in stock at Digikey). The naming is not standardized. It could be "right angle" (RA) or "side view" (SV) or even "side firing". For example, more-or-less at random, here is a Panasonic one: I don't think the recommended footprints necessarily conform to the standard ones, but some probably do. Here's a photo from the catalog showing the way it goes. BTW, there are also LEDs that emit light toward the mounting surface (usually with a protruding lens that fits into a hole in the PCB).
H: Voltage limiter with LM358 I have a problem with circuit, because I don't know how to design a voltage limiter. I connect to the input (In) sensor that generates signals with range of 240mV to 940mV. Next, The signal output with sensor is amplified voltage by LM358 operational amplifier. The maximum voltage output can be 1000mV. When sensor generated 940mV signal, I have output voltage of 1060mV. How do I limit the output voltage to maximum 1000mV? AI: The circuit you show is a non-inverting amplifier with a gain of + (1 + 1.2K/9.1K) = 1.132, so you would expect it to output about 1064mV with 940mV in. If you want it to output 1000mV with 940mV in then you need to reduce the gain by changing the resistor ratio. For example, you could increase the 9.1K resistor to about 18.8K which would give about 1000mV out for 940mV in. On the other hand, if you wish the output to increase linearly and stop at 1000mV as the input voltage increases, then you really do need a limiting circuit. This is independent of the gain requirement- IOW it does not determine the slope or zero intercept of the output voltage, rather it determines where it changes direction and becomes flat with increasing input voltage. The easiest way to do that is with something like this: simulate this circuit – Schematic created using CircuitLab For output voltages from the left amplifier that are less than V1 (1000mV), the middle amplifier is railed at the positive supply, so D1 is reverse-biased. When the output of the left amplifier exceeds 1000mV, the middle amplifier maintains a voltage of 1000mV at its inverting input by sinking current through D1 and R1. The right amplifier simply acts as a unit-gain buffer since the output impedance of the limiter is relatively high.
H: Is it possible to design cascaded LC filters with inductors sharing the same core? I want to design an higher order LC filter for filtering out a power signal. In the theoretical design, the inductors are supposed to be on separate cores. But in practice, it will be very costly and space consuming. Is it possible to wind the inductors on the same core (e.g.; a toroidal core)? If it is possible, what must be the proper dot-convention between these inductors? simulate this circuit – Schematic created using CircuitLab AI: No, this will not give you what you want because all the inductors will be coupled at nearly 98%. Any voltage across L1 will be mirrored across L2, L3 etc.. The filter topology shown is a low pass type so I'm assuming the power signal you wish to remove is higher than what you wish to pass. The higher frequency power signal will, due to the first filter capacitor being a low impedance to that frequency, appear largely across L1 and either inverted or of the same phase across L2 and L3. No matter what you do, with near 100% coupling and the capacitors being low impedance to the power signal you wish to remove, the final inductor will produce virtually the same power signal at the output as seen at the input minus a few percent due to winding losses etc..
H: Can some pins of the same port on AVR MCU's be declared as inputs and some as outputs? Can some pins of the same port of AVR MCU's be declared as inputs and some as outputs? If yes, then I am not able to understand how this works since we have to compare the pins of the port and also assign the values to output pins. It would be very nice if you provide even a simple program for this in C. AI: Yes. The DDRx register sets the direction of individual pins. A bit set to 0 configures the pin as input, and set as a 1 configures it as an output. The PINx register contains the values read from any pins set to input. The PORTx register is written to for setting the state of any pins set to output. DDRB = 0x01; // Set pin 0 as output, all others as input on port B if (PINB & 0x02) { // Check state of pin 1 on port B PORTB |= 0x01; // Set pin 0 on } else { PORTB &= 0xFE; // Turn pin 0 off } Note the use of bitwise operators there to modify the existing value in the PORTB register, rather than writing a whole value. That allows you to set or clear an individual bit in the register.
H: Low pass filter design with transimpedance and difference amplifiers I have a DDS chip with complementary current outputs that I need to filter. I'm using a design like this: I need a different cutoff frequency, however - 2 MHz instead of 50 kHz. Note that I'm not using the particular op amps specified in that schematic - I'm using the LT6207 instead. I understand the basic operation - TIAs followed by a differential input amplifier - and after reading the active filter design techniques chapter for Op amps for Everyone, I think I understand the basics of active filters, but I'm stumped as to how to apply those principles to this design. Unless I'm mistaken, it consists of a first order filter (the TIAs) followed by a third order filter, which violates Op amps for Everyone's prescription that only odd order filters contain order-1 stages. Thus, their calculations and coefficient tables don't seem to be terribly useful. How can I calculate the component values to adjust my filter for a new cutoff frequency? AI: First you will need to find a suitable opamp which, at 2MHz, is not the 5534. GBW should ideally be 2 orders of magnitude more than your cutoff, or at least 100MHz (or close) and keeping it stable may be an issue. Second, you can scale R-C networks to change the frequency. So for example, R1 sets the gain of the input stage and R1C1 set the frequency. You may be able to simply scale C1 as 50/2000 * 2200pf, or 56pf. (Ditto C2) (You may have to reduce the stage gain, in which case reduce R1. 82 ohms and 560pf would work or some intermediate value keeping R1C1 constant.) Ditto the passive 1st order stage R3,R4,C3 scale together so you could scale C3 to ... 560pf. The relatively low resistor values here should be fine at 2MHz. The last stage (2nd order) is a little more complex because if you scale the time constants differently you will also affect the Q, or peakiness of the stage. But again the resistor values look fine so I would simply scale the capacitors, C4=680pf, C5,6=200pf (ideally 205pf). And simulate as Andy says. If it doesn't behave as expected, compare the original unscaled simulation with the scaled version. Look at each stage e.g. U1 output, separately. The opamp characteristics will interact with these ideally scaled component values and the response may not be quite as expected especially if GBW or the output slew rate is too low.. A breadboard will introduce further stray capacitances and inductances, and the PCB layout will be slightly different again...
H: Inductor burning out in a GPS bias tee circuit I've got a tracking device that uses a Telit GE864-GPS combined GSM/GPS module. The GPS antenna is connected to the Telit module via a bias tee circuit, as shown below: http://upload.wikimedia.org/wikipedia/commons/6/6c/Bias_t.png The RF only port is connected directly to the antenna input on the Telit module. the RF+DC port is connected to the GPS antenna itself (A Siretta Alpha 7 -> Datasheet: here as you need to login to download it from their site.), and the DC port is connected directly to the board's 5V PSU (a 5V, 3A switching regulator). The capacitor is a 22pF 50V NP0 cap (Farnell) and the inductor is a 47nH, 400mA inductor (Farnell). I'm running into a problem on several units where the inductors are failing due to overcurrent and burning out. Unfortunately, I'm having trouble determining what the cause of the overcurrent it. The antenna itself only draws 22mA max at 5V according to the datasheet so in theory, the inductor should be more than capable of handling that. I've had a couple of units running continuously on the bench and out of 9 units, one failed after a week of continuous running. I then transferred that antenna to another working board, which worked fine for a few weeks. Then the system was powered off for a few days, then turned back on and the inductor failed a few minutes after powering on (glowed red for a few seconds then died). I've since transferred that antenna to a third board and the antenna continues to function. The remaining boards have all worked fine during this period. I'm struggling the figure out what is causing the inductor to fail. It could be the antenna, but it's odd that I get this momentary power surge (which lasts for a few seconds until the inductor burns out) but the antenna then continues to work fine. I could potentially prevent the problem by sticking a resettable fuse in front of the inductor to prevent any surges from blowing it, but I'd love to find out what the cause of the problem is. Any thoughts? AI: You should always use a current limiter (typically about 50 mA) to feed a bias tee for a GPS antenna. There are just too many ways to create a temporary short when connecting cables, etc. It sounds like your antenna has a faulty cable or some other internal fault that causes intermittent shorts.
H: Implementing High Pass Filter in Simulink I am trying to implement the following block diagram using Simulink in Matlab. I am having trouble getting the high pass filters to work properly. To do the filtering, I am using the First and Second order filters from the SimScape toolbox. Using a step source I am getting a sort of result, but I cannot work out how to adjust the cut off frequency for the first order and damping ratio for the second order filter. Are these the best blocks to use, or is there a better one. If so, how do I tune the filters to work as I require? AI: Those blocks are fine to use. You vary the cutoff frequency via the TimeCostant input block. Please note the cutoff is in \$\omega\$ so for 50Hz cutoff you will need to enter in the period of \$\frac{1}{2*\pi*50}\$ Try the "Plot Freq Response" checkbox to check the step-response & view the bode plot for a particular filter setting A similar process exists for the 2nd order filters, but with the additional damping factor
H: Are there other ways in which 60Hz noise can get into your system? Are there are other ways in which 60hz can get into a system other than ground loop ? AI: Yeah lot's of ways. Besides those already listed... If there is a cylindrical inductor in the circuit. (loops can be other than in just the ground line.) Room lights sometimes.. though more often this is capacitive coupling from florescent lights and at ~20-50kHz. Vibration (usually at 120 not 60Hz... I assume harmonics are included.) The best way to check is to move your circuit around. And see what happens. Things get worse as you move toward the source, inductive things will have an orientation dependence. you can block electrostatic things. At the ridiculously low sub microvolt level, I've seen capacitve coupling between wires carrying power to different circuit fragments. (Though this was not 60Hz.)
H: 2.5mm Jack to USB data Cable I was recently diagnosed with Type 1 diabetes. With the need to test my own blood upwards of 8 times a day I have a ton of data to keep track of. My testing unit has the ability to upload its data to a mobile (OTG) or PC (USB). Sadly, the company who makes the unit does not ship either cable. They are an expensive accessory. I have enough parts, and should be able to make this, however it's proving difficult. The USB cable of theirs has windows drivers built into the cable. I was able to get a helpful person at the manufacturer to send me those. That person also told me that OTG wouldn't require drivers. The photo of both cables on their website show the unit end of the cable as being a 2.5mm (3 ringed) audio jack. So far I cut open a male USB, I also did the same with the end of an old 3.5mm headphone jack. I then purchased a 3.5mm to 2.5mm adapter. But I'm struggling with the wiring, and trial and error is not producing any results for OTG or USB. I'm also a little concerned that I'll damage my phone, laptop or blood glucose unit. Although all seems to be well after my tinkering. My USB has Green (Data), White (Data), Red (5v), Black (Earth) and some sheilding by the looks of it. My 3.5mm headphone cable has Red (Normally right audio), Yellow (Normally left audio) and White (Earth) I also have a USB to OTG adapter Note that my adapter has 4 rings, like an ipod shuffle cable or headphones with a mic. I'm assuming that's not introducing any crossed wires as using it for audio still delivers full stereo. Here are some pics Am I missing something in my approach? If not, how can I figure out which wires connect to which? I would be happy with either a working OTG or USB cable. My tests have shown no response in the mobile app, and only generated USB malfunction errors in Windows (as expected). Edit: Thanks for all the really good info. I have contacted CareSens for a NFC unit. I will update here when I find out more. This was going to be a fun project during my time off, but it looks like it's a bit more complicated than I first thought. AI: Based on the manufacturer's youtube video for the app compatible with the cable: This is a video guide for SmartLog(Blood Glucose Management Software) App represensted by i-SENS. SmartLog App is a smart phone application which helps patients with Diabetes to monitor their health conveniently anywhere anytime. This app works with CareSens N NFC meter. CareSens N and CareSens N POP meters can also be used when using FTDI cable. A FTDI cable typically refers to a USB to RS232 (TTL level Serial) IC FT232 (or other generations of the FT232 chip) created by FTDI. They also make other USB bridge ICs with similar functions. Connecting a USB cable straight through to a 2.5mm plug will most likely cause a problem. as you have already seen. If it's a simple straight through connector, it will have Ground, TX and RX. FTDI's official 3.5MM cable uses Tx {To device from PC}, Rx {From Device to PC}, Gnd (Tip, Ring, Sleeve, respectfully). With your multimeter, you can confirm the 2.5mm pinout by doing a continuity test between each section of the adaptor and your 3.5mm cable wires, then confirm the signal by checking for voltage between the three wires. The voltage it runs at is a concern because using a 5v signal on a 3.3V port might be bad. Of course it could be more complex. TI calculators used a 2.5mm port for their Graphlink cables. It was able to connect to a serial port, but required 6 pins, resistors and diodes between. If you had a cable to hack up, or even a meter to hack up, it would be easier. They occasionally pretty much aways give the device away for free, check with your doctor or the manufacturer's local sales rep. Update: Based on the two links below, the pinout is more likely to be Tx from Device to PC, Rx From Pc to Device, Ground (Tip, Ring, Sleeve). Like a defacto standard amongst Diabetes Meter manufacturers. You need the USB to serial IC for the OTG cable, but you could use a serial port for the PC instead (I am not liable if you fry your meter). http://pinoutsguide.com/Electronics/bayer_contour_pinout.shtml http://www.diabetesforums.com/forum/topic/65566-abbott-freestyle-freedom-lite-data-cable-how-to-some-other-info/ Reading data from a glucose meter
H: What is cut-in voltage of a transistor? Some literature talk about cut-in voltage but couldn't find a clear explanation. AI: It's not an officially recognized term by any standards body, but in the south-eastern United States (and possibly elsewhere) "cut-in" (cut-on) is the colloquial opposite to "cut-off" (cut-out). It is used by many in everyday life in reference to light switches -- "cut-on the lights" = "turn on the lights". Ergo, this is the informal name for the threshold voltage that is the transition point between the cut-off and active regions of the transistor.
H: Purpose of T flip-flop in this circuit (LED) In this circuit I try to toggle a LED on and off when a switch is pressed. Given the nature of the T flip-flop, when the switch is triggered, it toggles the clock and since T=1 always, it essentially reverses the state of Q, so in other words, it toggles the LED on and off. OK, the LED has its connection to the power supply, that means it has to connect to GND in order to toggle ON. Now what does this mean? When the TFF output is 1, the LED will turn ON? Or OFF? When TFF output is 0, the LED is OFF? Or maybe a 0 potential is like Ground, that means when TFF Q=0, the LED is ON? AI: When Q is high the potential difference between Vcc and Q its small, so the LED is off. When Q is low, the potential difference between Vcc and Q is higher, so the LED switches on.
H: Calculating gain of multiple antenna system Some radars have thousands of antennas, there are also some routers that have multiple antenna systems. But I want to know how to calculate total gain of multiple antennas in a system? Is it simply equal to the number of antennas times gain of one antenna? What about beamwidth of the resulting system? If for example I use 64 antennas in a system, all are omni directional, is the total system still omni? AI: I've never heard of radars using thousands of antennas before but the reasons for antenna diversity is well known. Several antennas can increase the probability that, no-matter what direction a transmission is arriving, and no-matter how that transmission is polarized, it will be received correctly. This usually means, for each antenna, an amplifier and demodulator i.e. it can be quite complex and there is no apparent multiplication of antenna gain. In fact, depending on the mechanical configuration of the antenns, there can be a reduction in gain for each antenna due to the proximity of the other antennas.
H: 4 iPad Air charging circuit indicator led not working I developed this circuit in order for it to be connected to 4 ipads at the same time the current they use to charge when they are on low battery goes around 1.8Amps, That its working as intended, however the part that has the led indicator for a blown fuse indicator doesnt seem to be working the female headers are connected to a dual SUB female port which are used to connect the lighthing connector, however after removing the fuse the current should flow through the led and 470 ohm resistance , and yes i have a voltage of 3.5v in each led but it doesnt seem to be enough current for it to turn on , i would like any advice about this topic Pins 1 and 2 carry the 5volts to each usb female port AI: I don't like the idea of the LED in parallel with the fuse. Better would be the low side of the fuse pulling up the gate of a P MOSFET to keep it in off mode, and when the fuse blows a resistor pulls it low to turn the MOSFET on - and the MOSFET then drives the LED: simulate this circuit – Schematic created using CircuitLab Explanation of the circuit: In this configuration Q1 is simply a "High side" switch. When the gate is held at the same potential as the source (i.e., F1 is intact) Q1 is switched off, so no current can flow through it. When F1 blows the gate is pulled down to 0V by resistor R1. The potential difference between the gate and source is now -5V. As long as this is below* the threshold voltage Q1 will switch on, allowing current to flow through R2 to the LED. The LED lights up, and no current at all flows through the output to the iPad. You have to be sure to use a P-channel MOSFET with a suitably high* threshold voltage, some somewhere around -2V would be ideal. *Remember, we are talking negative voltages here. In this context the threshold is high when it's nearer 0V and low when it's at say -10V. So a "high" threshold would be -2V, and a "low" gate voltage would be -5V. You have to think upside down for P-channels.
H: I need help with verilog code, I am in trouble? I am basically setting different control signals for the ALU to perform operations in verilog. But I have tried all possible ways of writing what I want but in vain, can you help me out. How should I set these control signals at particular 3 bit alu states; This is my code, i have all possible assignments; (sorry, its inverteed and i don't know how to rotate it because the website i upload pictures on automatically rotated it this way) Initial declarations; input [1:0] op, src, srl, dst_ram_mux, dst_q_mux; input inv_s, inv_r, sel, dst_ram_en, dst_qen, dst_y, cin, reg_wr, cp; 95 always @(i[5] or i[4] or i[3]) 96 begin 97 if( i[5]==0 && i[4] == 0 && i[3] == 0) // this is add S+R 98 begin 99 cin <= 0; 100 assign sel = 0; 101 inv_s <= 0; 102 assign inv_r = i[5] & i[4] & i[3]; 103 op[1] = i[5] & i[4] & i[3]; 104 op[0] = 0; 105 end The 'end' for the always is way below at line 327, not seen here The errors for all assignments; AI: Read the error message: A net is not a legal lvalue in this context Procedural blocks can only assign registers types (Verilog:reg,SystemVerilog:logic/bit/reg). The assignment cannot be done to a input either Combinational logic should have blocking assignments (=) only, not non-blocking (<=) You should not used procedural continuous assignments (assign inside a procedural block) Every assigned bit must have an assignment for each condition. Otherwise a latch is inferred. An easy strategy is to assign default values to all registers at the top of a procedural block, the remaining code overrides the default. Other Guidelines: Bit expatiation is not necessary: i[5]==1 && i[4]==0 && i[3]==1 --> i[5:3]==3'b101 Use auto sensitivity list for combination always @* (or SystemVerilog's always_comb) Long nested else-if comparing the same values bits can use a case statements always_comb begin /* default assignments: e.g: cin='1; op='0; */ case(i[5:3]) 3'b000 : begin /*S+R code*/ end 3'b001 : begin /*S-R code*/ end 3'b010 : begin /*R-S code*/ end // ... Other conditions ... endcase end
H: How can I use the presence or non-presence of an 120VAC input to actively discharge a bias power rail? I'm designing a power supply that has an input of 100VAC to 300VAC. On the primary side on the main transformer, I have a 15V rail to power the control chip (a FAN6920) and a gate drive chip (a FAN7382). On this 15V rail, I have roughly 400uF of capacitance. Because of this amount of capacitance, the hiccup time of the supply is about 10 sec. That's the time it take for the 15V rail to decay down to about 5V, at which point the control chip will attempt to start back up. This is acceptable during an actual fault (e.g. an over voltage condition on the output or the output shorted), but this hiccup time is also present when turning the line off and then back on within that 10 seconds. The supply is used to power lights, so as you can imagine, no one wants a potential 10 second delay when they hit the light switch. To that end, I'm trying to figure out a way to design a circuit that senses whether the AC line has gone away, and if so, to pull down the 15V rail quickly, while at the same time not impacting steady state operation. simulate this circuit – Schematic created using CircuitLab My first attempt at this is above. This idea is that C1 will charge to 10V when the line voltage is applied, holding M2 on. Holding M2 on will hold M1 off. At the same time, C2 is charging to 10V. When the line voltage is disconnected, C1 discharges much quicker than C2, allowing M2 to open up, and allowing C2 to change the gate of M1, turning it on and rapidly discharging the 15V rail through a 10 ohm resistor. However, in practice, C1 doesn't discharge nearly quick enough. It maintains enough voltage to keep M2 on for several seconds, so it doesn't really buy me anything (and also, the charge of C2 decays enough that it can't turn M1 on at that point, anyway). I can't change the time constant of C1 and R2 by much because the voltage across C1 will start drooping significantly when the line crosses 0V. I am not tied to this topology by any means; this was just my first pass at a solution. And while I've tried a few other things, nothing has really worked, so any suggestions would be appreciated. Thanks. AI: The circuit you've shown (assuming there is 120VAC connected to an unseen bridge rectifier with the '-' connected to circuit common) 'looks' like it should work. Obviously those diodes cannot actually be 1N4148s since they're rated at only about 75V. The time constant of R2/C1 is less than 10msec so there is no way it should take seconds to discharge (even if you allow for the gate capacitance on the MOSFET- presumably you're not actually using that part number, but something much smaller anyway). If there was enough leakage from the main supply capacitor through the main bridge rectifier that could explain it (so the problem would be 'off the page'). Perhaps if you split the (off the page) bleeder resistor for the input filter into two resistors, each to the common, rather than one resistor across the line..
H: LaunchPad development board talking to itself using a CAN bus I have one Texas Instruments Tiva-C Series TM4C123GXL LaunchPad and two MCP2551 transceivers. I am trying to send and receive messages via a controller area network (CAN) bus. Is it possible to do this using only one LaunchPad? AI: The TM4C123 has two CAN peripherals, but the Launchpad board seems to expose only one of them (CAN0) on its headers. At first glance that would suggest that you can't do it from one peripheral to another. Two possible solutions spring to mind: Most CAN modules support loopback mode, i.e. a module can be configured to receive its own transmission. If you can access just one of CAN1's pins, either Tx or Rx, then you could use CAN1 to transmit to CAN0, or CAN0 to transmit to CAN1, but not the reverse. Either solution is probably adequate for testing, and in both cases you wouldn't need to bother with the MCP2551's.
H: Circuit Protection re: Relay Coil Is the flyback diode adequate protection in for the microcontroller in the following circuit? simulate this circuit – Schematic created using CircuitLab Will my circuit experience over voltage conditions on the 5V rail despite the flyback diode? My 5V is generated by a step-down switching regulator if that matters, and that switcher circuit has a 220uF capacitor on it's LX node. AI: No energy goes directly into the power supply in this configuration- on turn off, the current just recirculates in the diode and coil until it dies off through the coil resistance and diode forward drop. Turn-off is indistinguishable from a resistive load from the point of view of the power supply. The only issue is if the sudden removal of a load (doesn't have to be a relay, a resistor would behave the same) will cause the supply to overshoot too much (a small blip is inevitable), or undershoot too much at turn-on (turn-on is a bit gentler than with a resistor because of the coil inductance). Chances are it will not bump much with 220uF on the rails but it depends on how much current the relay coil draws and how the power supply behaves. You can look at it with an oscilloscope and see. 125 ohms -> 40mA is not much current. Also depends a bit on how sensitive your circuit is.. if you're using the 5V rail for an ADC reference (ugh) you might see the blip.
H: What would make me choose Verilog or VHDL over schematic design on CPLDs or FPGAs? I have absolutely no background in programmable logic, I use mostly microcontrollers in my projects but recently I needed to work with video and the microcontroller is just too slow for what I needed so I started playing with CPLDs. I was able to get good results with the CPLD only using schematic design but when searching for info on CPLDs I came across many examples using VHDL and Verilog. I am curious about what could make me want to define my device in one of these languages. What can they do that schematic design cannot? Are they used mostly for functions? Until now I have only used CPLDs, do FPGAs designs benefit more than CPLDs from using these languages? AI: Schematic design is only useful when you're only tying together a few off-the-shelf modules (counters, adders, memory, etc). But implementing an actual algorithm (say, a cryptography hashing algorithm) is nearly impossible to do without an HDL (like VHDL or Verilog), since there's no way to describe a system at a behavioral level with schematic symbols. Most projects are done in behavioral-style HDL because they're too complex to be synthesized by hand and drawn using logic primitives schematically. CPLDs are generally used for glue logic and less used for processing, and generally logic is easy to implement schematically, so I think you're right when you suggest that FPGA-based designs benefit more from using an HDL.
H: Electric field around tape So, there's a tape with width of 2a, -a on the -y and a on the y, and it very long, penetrating the the plane of picture, it's charge density (dQ/dS) is σ=σ0 * y /a , σ0 is a constant. What is the electric field in point A(a.0)? I tried solving this using charged disk, expressing electric field over polar coordinates etc., that is when there's a uniform charge. But I have no idea how to express y using shapes. What to do? AI: I think you must use the superposition principle of the field in this case, and consider the problem as a distribution of charge along a line from a to -a, because the contribution to the field of the charge along the z axe is 0, the field in this case is always parallel to the surface xy. The problem is to build the right integral considering a dE and a dL (along the y axe). Note: there is a little mistake, I put r=x^2+y^2 instead r^2=x^2+y^2, I have forgot to put the ^2 on the r, but I have taken into account in the rest of the calculation.
H: Get clean 9VDC power from 9VAC using a LM317T I'm having trouble with this design, I have this circuit below, but I already have the 9vAC transformer, so I just need to convert the current to DC, so: If I remove the Vadj part of the LM317T on the circuit below and keep everything else at it is, would that still keep the current clean or I would be removing something important? note: I'm not experienced in electronics at all, sorry about it :( Thanks for your answers : AI: The Vadj pin on your LM317 is vitally important to the circuit. Without it connected correctly you'll likely have the same noisy DC supply, just 1.5V to 2V lower than whatever is coming out of the bridge recitfier. The normal method of using a LM317 is much like your diagram, but could use a few less resisors. The way it operates is to regulate the voltage between its Vout & Vadj pins to 1.25V. So how does this circuit produce 9V you may ask? The 1.25V is put across a resistance (in your case R1a & R1b in parallel). Since you now have a voltage across a resistance, there must be current flowing through that resistance - and ohm's law tells you how much (in your case it would be just under 5.2mA). That current has to flow somewhere and in this circuit it flows down to ground through R2a & R2b. There is also a little bit of current flowing out of the LM317's Vadj pin (it needs some current to run its inernals) and this current also flows down to ground through R2a & R2b. Since there is current flowing through that resistance, ohm's law once again tells us what the voltage across it must be (7.63V). Now we've worked out that there is 7.63V from ground to the LM317's Vadj pin, and we know that the LM317 regulates the voltage between its Vout and Vadj pins to 1.25V, thereore the voltage at the output is the sum of the two: 8.88V. How 'Rick Barker' gets to 9.35V is a mystery to me ... Why he uses sets of parallel resistors (R1a||R1b & R2a||R2b) to achieve such an arbitrary output voltage is also strange. I would probably have used a 240 ohm for R1 and a 1.5k ohm for R2 to achieve an output of 9.14V. The 10uF 'bypass' capacitor improves the 'ripple rejection' of the circuit (makes it 'cleaner') and the diodes are there to protect the LM317 from any reverse current being forced through it from either the output caps or the bypass cap if the input is somehow shorted to ground.
H: How to shorten fall time on high-side BJT drive? I have built a PCB with a set of high-side BJT drives shown in the schematic below. I'm using 8 of these to drive the columns of an 8x8 RBG LED matrix. While debugging the board with my oscilloscope (with the load, i.e. L1 and R4, disconnected), I noticed that the circuit was showing a much longer fall time than I expected. I got 660us while I expected a fall time below 1us. Below are a series of scope shots I took. Switching at 250Hz (T=4ms): Switching at 1kHz (T=1ms): Switching at 2kHz (T=500us): I'm switching the drive using an MCU through the MCU_OUTPUT signal and the scope shots were measured at the PROBE label. The problem is that I need to switch the drive at around 14kHz, but above 1kHz, it doesn't even get to 0V during fall anymore. So above a certain frequency, the drive doesn't turn off. Well, I only (sort of) understand how BJTs work in simple switch and amplifier configurations, so I'm puzzled with these results. I tried googling for it, but I don't even know what search terms to use. I'm stuck. My questions are: Why is the fall time so much longer than the rise time on this circuit? The fall curve looks like that of a capacitor discharging, but I don't have a capacitor in the circuit. Or do I? How can I shorten the fall time on this circuit? Can I shorten it by changing the resistor values or the transistors? I'm hoping I can learn something new about transistors with this opportunity. Update: Testing with the load connected I took Michael's answer into consideration and took another set of measurements with the load now connected. The scope shots are below. The results were much lower fall times, in the order of 660ns. That's 1000x lower than the original 660us I was getting with the load disconnected. Switching at 2kHz with load connected (T=500us): Switching at 14kHz with load connected: The end result is that the circuit I built is capable of switching my loads at the required frequency. It's just that I was making an incorrect measurement with the load disconnected. AI: Trying to evaluate your fall time with the load disconnected is not a useful measurement. As the PNP transistor turns OFF its collector terminal goes to a high impedance. That leaves the load to be the scope probe impedance which is likely to be 1Meg or 10Meg ohms. It is no wonder that it takes a long time for that size of load to discharge the small capacitance of the collector circuit and the scope probe capacitance. Instead you should be looking at your switching time with the actual load hooked up. If the actual load is not available then at least add a test load resistor from the PNP collector to the GND rail. Size the resistor to dissipate power equivalent to the normal load that the circuit is meant to drive. Doing this you will see the real fall time and rise time of the circuit. Update: To get my point across take a look at the LT Spice circuit simulation below. I've drawn the circuit with a load consisting of a 10Meg ohm scope probe in parallel with 22pF of capacitance to simulate your actual scope probe capacitance plus some for the PNP collector terminal and the wiring. These pictures clearly show that the long fall time you are seeing is due to the fact that you have the load disconnected as I said above. It has next to nothing to do about the LED characteristics or the PNP saturation as another answer suggests.
H: What happens if I supply 18V to a 12V lighted switch? I am fairly inexperienced with electrical engineering and usually just wing small things I.E. a current project. Basically I have a project box, with a 12v arming switch with a red light in it. Currently I do not have the momentary switch installed but those parts will come in soon. At the moment I only have the arming switch wired up. It is running off of 2 9v batteries, making the total voltage 18v. Note I have little technical/book experience as far as understanding electrical work (I.E. do's and don'ts, I don't know the do's and don'ts so. Basically my question after my ramble is what's happening inside the switch with more than enough volts to function? Is it bad? Is questionable? I saw a post earlier saying that some devices can go over the voltage on said device a little with some exceptions to sensitive devices. EDIT @Jyelton Thank you for your feedback. I have corrected the title to something more appropriate. If it isn't to your infinite liking, I can try a few more title ideas. EDIT @Ignacio Vazquez-Abrams Thank you I will read it. **EDIT Added photo. EDIT Thank you Jyelton for pointing me in the right direction. I am not the brightest man. Title changed too "What happens if I supply 18V to a 12V lighted switch?" AI: I take from context you have a lighted switch that expects 12V, but you didn't specify whether the switch uses an LED or something else, like an incandescent bulb (older style). Two 9V batteries can also supply 9V if connected in parallel. Because you stated 18V, it's apparent they are connected in series. Note that had you omitted the voltage, specifying a quantity of batteries alone is not enough information to know the supply voltage. One of the first don'ts of electrical engineering is Don't supply higher voltages than a device is designed for. This is especially true when working with higher power devices. Connecting something designed for 110V mains into a 220V supply could be disastrous. In the case of your device, let's assume the switch contains a red LED and a current limiting resistor. A red LED typically has a forward voltage (\$V_f\$) of about 2V, and forward current (\$I_f\$) of about 20mA. This means that the remaining 10V needs to be dropped on the current limiting resistor. Ohm's law states: $$R = \frac{E}{I}$$ This means that we can determine the value of the resistor by knowing the voltage across it (E) and the desired current through it (I). $$\frac{10}{0.02}=500\Omega$$ Thus, a lighted switch that includes a red LED designed for 12V will also include a current limiting resistor of approximately 500Ω. If you supply 18V instead, we can calculate the new current. The LED will still drop about 2V, leaving 16V across the resistor. $$I = \frac{E}{R}$$ $$\frac{16}{500}=0.032A$$ The LED has about 32mA instead of 20mA. Is this bad? Not necessarily. Some LEDs can operate at 40mA or more. It depends on the LED. Information about what it can handle and for how long is provided in datasheets. Datasheets are product specifications that manufacturers provide to show the tolerances and usage of any given electrical component. Your switch might have a datasheet with specifications about the current rating of the switch in general, but might omit information about the internal LED specifically. Let's assume the LED is basically okay with 32mA. It will be brighter, and may not last as long as it would with 20mA. In other words, it will dim appreciably faster. After months or years of continuous use, it may be more dim than it otherwise would have been at 20mA. Turning our attention back to the current limiting resistor: A "typical" common through-hole resistor can dissipate 1/4 watt (250mW). How much power does the resistor actually need to dissipate under normal circumstances? Using numbers from before: $$P = I\times E$$ $$0.02\times 10 = 200 mW$$ How much is it dissipating with the higher voltage supply? $$0.032\times 16 = 512 mW$$ Now we have a problem. What is the actual power rating of the internal resistor? The manufacturer might have used a higher 1/2 watt resistor, at greater expense, for an additional margin of safety/quality. Maybe not. Resistors dissipate power as heat, so the higher voltage results in additional power that is bled off as heat. If the resistor isn't rated for the higher power, it will eventually fail. Failure modes of resistors might be open or short, so once it fails the LED will either be permanently off or have insufficient current limitation, glow very brightly for a brief time, and also fail. I saw a post earlier saying that some devices can go over the voltage on said device a little with some exceptions to sensitive devices. This is true. For example, a typical LED might have specifications that include various current specifications at different duty cycles. Perhaps 20mA at 100%, 40mA at 50%, and 100mA at 10%. Beyond 100mA, at any duty cycle, it isn't guaranteed to operate within the specifications given. The extra voltage or current that a component can handle is dependent on several things. How well-built is it? What sort of heat-sink or power dissipation is in effect? Is it sensitive to rapid changes? An analogy: You can probably safely move 12 tons across a bridge rated for 10. The risk and cost of failure is quite high, though, so you probably wouldn't take the chance. You might be able to power a 12V device with 18V, but not for as long. The risk is perhaps a few dollars of wasted expense if it fails. As an addendum, if you want to stick to 18V, you could add another resistor to drop the voltage further and limit current to the lighted switch. It would help to measure the current (at 12V) with a multimeter, so you can better determine what's contained in the switch. Another option might be an inexpensive linear voltage regulator like the LM7812 or TI TL780-12KCS. A more efficient option would be a switching regulator (buck regulator). If the prospect of including additional components is unwanted, you could switch to 8 AA-size cells in series:
H: Effects of C Rating on Battery Life A polymer lithium ion battery is rated at 3.7v, 6600mAh and a maximum discharge current is specified at 3.3A. I take it this means the battery can be discharged at 3.3A and last for two hours since 6.6Ah/3.3A = 2 hours. However, in addition to the above specifications, the battery has a nominal capacity of 6600mAh at 0.2C discharge. How does this extra bit of information affect my above calculation? I.e. How will it affect the battery life for a given current draw? AI: What the extra bit of information means is that to realize the full 6600mAh capacity of the battery you would have to limit the discharge rate to 1320mA. That gives a typical usage time of 5 hours at that load. When you increase the discharge rate you will change several things. Battery cell temperature Total realized capacity Overall lifetime of the battery
H: How can I bind a local variable to AVR's rXX register? I need to have programmable pause with precision as high as possible. To accomplish this I have the following GCC code: void delay(unsigned char d){ volatile unsigned char i=d; while(i>0) i--; } Which is compiled to: 1cc: 89 81 ldd r24, Y+1 ; 0x01 1ce: 81 50 subi r24, 0x01 ; 1 1d0: 89 83 std Y+1, r24 ; 0x01 1d2: 89 81 ldd r24, Y+1 ; 0x01 1d4: 81 11 cpse r24, r1 1d6: fa cf rjmp .-12 ; 0x1cc <__vector_1+0x2c> (I'm showing just the loop core code). This leads to the fact that the precision is 7 cycles which is not very acceptable. However I see that the compiler made his job not as fast as possible: If the i variable would be r24 register I will save 3 operations and the code would be almost twice as fast. So how can I tell to the compiler that I want this variable to be in a register? PS. I'd consider to pause with programmable number on nop's. But I can not imagine how this can be achieved. AVR has no instructions to branch to calculated address. As far as I know stack is not directly accessible in AVR (if it would I could push needed value to the stack and execute ret instruction to jump to the needed program address - it is also a tricky job but it would be at least considerable). UPDATE After I changed volatile to register keyword (as was described in one of the answers) I've got the following code: 14e: 81 50 subi r24, 0x01 ; 1 150: f1 f7 brne .-4 ; 0x14e <__vector_6+0x1c> So I reduced the cycle from 7 to 2 cycles. Which is far better than I could expect. AI: Don't declare your variable as volatile. That pretty much forces the compiler to use a memory location, and to access it on every loop iteration. Use register instead.
H: How can I render my 2.4GHz antenna directional? With barely no knowledge in this field, I would like to render my antenna used with Bluetooth BLE devices more directional. I tried to shield the antenna with different kind of metals with no luck. Is there someone to point a way in order to render my antenna directional? Perhaps surounding with something? Thanks AI: Since the wavelengthn is quite short (~10 cm) it's very important that the reflector (that can be a can, as proposed) is placed carefully, in a way that the reflected signal is as much as possible in phase with the directed. You achieve this by having the reflecting surfaces at a distance that is multiple to half a wavelength. You can try to tune it by measuring the signal strength while varying the reflector position, but I wouldn't expect great improvements unless you use a specifically made antenna.
H: Sending multiple channels with bluetooth I have ordered my HC-05 BT modules. My question is this: Is it possible to send multiple channels over bluetooth. For example, stereo sound has two channels. I think i have seen people do this but i'm not sure. If it is possible, could you please provide some more information on how its done? Thanks! AI: The HC-03/05 are Bluetooth modules were designed for serial communication. Note that these implement the classic version of the Bluetooth stack, not the Low Energy 4.0+ version of the standard, By using two complementary modules, one master and one slave, you will be able to pair them and connect two independent serial streams (full duplex), one stream in the direction master to slave and the other stream in the direction slave to master. An alternative to the previous is connecting another device (for instance, a mobile or a PC bluetooth dongle) to one of these modules which will act as master/slave. The AT command set available for these modules, as far as the documentation goes, does not allow multiplexing: sending multiple streams (more than one), simultaneously, in a certain direction (for instance, master to slave). A possible solution is to do the multiplexing yourself in either end of the communication, not in the bluetooth module, but outside of it, Let's say you connect a mobile application (running Android or iOS) with one of these modules. You could easily create your own message format for the serial communication, prepending an integer number which will indicate the number of channel. A simplistic and very compact message format suitable for serial communications is the TLV (Type-Length-Value), which you may use for such an application, http://en.wikipedia.org/wiki/Type-length-value
H: How do I solder to these pads? Quick question. I'm trying solder some wires onto the 5 pads (top right of board) in the image. What's the best way to achieve this? I cant get the solder to stick to the board and I have no flux. I have to be careful because there's components on the other side. I tried to use pin headers on a breadboard, and rest them on, but their not the standard sized pins. Here's an image: AI: These look like gold-plated pads, but it's hard to tell due to the poor quality of the picture. Gold solders very easily, as does any other metal that will be the surface of a pad on a PC board with about that color. Having no flux is no exuse. Get some. Actually any reasonable solder for electronic purposes will have flux core, so you don't really need anything more for this problem. Still, it's not a bad idea to have some flux around for general use. By using solder with flux (however you achieve that), it should be easy to solder small wires to the pads. I'd probably use small 30 gauge "wire wrap" wire. Added: With the updated picture, I think it's even more likely those are gold-plated pads. Again, gold is very easy to solder to. Make sure to strip the insulation from the wire only a short way, not more than the diameter of a pad, prefereably a bit less. Be extra careful that the uninsulated part of the wire doesn't extend past the edge of the pad it is soldered to. That prevents it from shorting to other wires or that strip above the top of the pads. This is all quite doable.
H: How to run a 6v 4amp motor at slower speeds for long periods of time (2 hrs)? I am trying to get a project done for Halloween. I am running a 6V 4A motor (from a powerwheels) but need it to run slower. I tried using an adjustable charger and ran it at 3V to slow down the motor but it wasn't turning the motor because the amperage on the charger is less than 1. I need to run the motor for a long period of time which is why I am not using the battery that is designed for it as it will only run for maybe 30 minutes. What are my options for this. The only charger I have found at 4 amps is a 16V charger. How can I achieve this, what are my options? thx AI: I hate to bring bad news, but this is not as easy as it probably seems. Let me explain some things about your typical inexpensive Lead-Acid battery charger. First, they usually have no filtering at all and do not provide a very good power source. Many employ only a 1/2 wave rectifier, a series power resistor, or just rely on the internal resistance of their inexpensive transformers. They just are not designed to directly run a motor. A charger need only have a slightly higher "peak" voltage than the 6V battery, maybe 7.5 V under load, but to drive a pure resistive load or motor with no battery, its effective or "average" voltage may only be about .318 of that, which amounts to about 2.4V (.319 x 7.5, assumed). To make matters worse, that 1/2 wave rectified DC is a pulsing voltage, which is more like AC in many respects. A form of pulsating DC called PWM (pulse width modulation) would normally be a good thing for your purpose, since this is the way speed is controlled in those toy cars. But that is done with an electronic circuit that can control the pulse width. Your pulsing DC from the charger cannot be easily controlled. So two approaches. One thing you can do is start with a combination of the charger and an actual 6V battery, probably a gell-cell. It may not need to be as high a capacity as the one in the powerwheels, but maybe something small like a 4 Amp-Hour battery. The combination of the charger and battery will result in a more steady DC voltage, similar to the way your car constantly charges your battery with pulsing voltage from your alternator, so the battery can then deliver nice "motor friendly" DC to electric motors in your car (wipers, blowers, etc). And now you have a battery that is charging, at least somewhat, so the total run time may be significantly higher. That will help get your motor running. But now you have to "concoct" a speed control, and that's where it gets more difficult than you may have anticipated. if you had more time (you only have about a week now) you might be able to find a REAL PWM speed control from another "power-wheels" (if it has speed control), that is ready to be thrown away. Perhaps an "as is" one from a thrift store. The truth is, most of those toys are discarded when the battery will no longer hold a charge, and the parents see how much batteries can cost. Another approach, if you do get a heftier charger (or maybe yours on the higher voltage setting) and it gets the motor moving without the added battery, AND... you just need it a little slower, you could add series resistance between the charger and the motor. A series resistor as a speed control, will have several disadvantages. It won't give you steady speed under varying loads and worse, it also might run hot (meaning a burn or fire hazard!) Finally, such a power resistor won't be something you can pick up at a local radio shack, and even if you could it would be impossible to know the ohmic value you needed. If I had to come up with such a resistor in a hurry, I'd go to a thrift store and get an old toaster, or something cheap with coil type heating elements. Such heating coils are made of resistive Ni-chrome wire, and are usually a pretty low resistance. With some heavy duty clip leads, you could play around with adding series resistance from one of the coils units until you find a length that will slow the motor to the speed you want. It will also quickly reveal how slow you can make it before it stalls. Now honestly, I almost am afraid to suggest the above. It sounds temptingly easy but don't forget... a resistor you make from a heating element might get hot. Hot enough to burn somebody or worse, start a FIRE!!!!! It all depends on how long a length of heating coil your ideal resistance is spread over, and it would be wise to keep that heating coil in the appliance rather than tying to re-enclose it in your project box. Otherwise, you could end up with a much scarier Halloween display, especially if it starts a fire or burns someone in your house! Anyway, I've rambled long enough, and I'm sorry if I've discouraged you in doing this project. On the other hand, maybe you'll be able to get something useful out of this and that you make sure to be safe and sensible if you try anything like I've suggested. Good luck! :-)
H: Are all sequential circuits based on cross-coupled NAND or NOR gates? So far, all the sequential circuits I see in the textbook use cross-coupled NAND or NOR gates. Is it possible to design a sequential circuit without them? AI: By sequential I assume you mean a (bit) storage cell? A static storage cell must have two elements: positive feedback, to maintain a stable state forever an input that can overrule the feedback (in both directions!) Cross-coupled NAND or NOR gates have both properties. (The cross-coupling is the positive feedback path.) There are more complex building blocks that can also have these properties (two multipexers for instance), but one could argue that those are themselves composed of NAND and NOR gates. An other circuit that has this property is an amplifier (call it a non-inverting gate, or two inverters in series) with a weak feedback, and an input that can provide a strong drive to high or low (or be in high impedance, letting the feedback do its work). Whether this counts as a double NAND gate with feedback is IMO a philosophical question. In the non-static world there are options that store something for a limited time, and then read it back before it fades away, and restore it to its original level. You could see this as a positive feedback loop in the time dimension. DRAMs work this way, but various older techniques too, like storage screens and mercury delay loops. In the physical world there are some constructs that are bi-stable without an obvious feedback loop. Think of a ferrite core that can be magnetized in one of two directions, or a latching relay that uses a pulling coil to be stable in two positions. The essense here is that there are two lower-energy levels, separated by a high-energy barrier. Within the digital world I think the answer to your question is YES, but the above examples shows that there are other implementations.
H: Make Bypass with Switches I have the diagram below, but I don't understand how the switches are hooked up. Is that an special switch, or I can achieve that with an special connection? Thank you! AI: That's two switches connected together that can be in either of two positions. It is a DPDT (double-pole, double-throw) switch.
H: How to prevent applying power to I/O pins before BBB ready? From the Beaglebone Black SRM Rev C.1: "DO NOT APPLY VOLTAGE TO ANY I/O PIN WHEN POWER IS NOT SUPPLIED TO THE BOARD. IT WILL DAMAGE THE PROCESSOR AND VOID THE WARRANTY. NO PINS ARE TO BE DRIVEN UNTIL AFTER THE SYS_RESET LINE GOES HIGH." I want to connect a sensor to ADC input. When I apply the power to BBB and to the sensor in the same moment, there is a danger that the signal from sensor comes earlier as BBB is ready. What is the best way how to prevent from this? I can imagine following: a) Control a transistor with SYS_RESET signal to switch on the power for the sensor? b) put "something" between the pin and the sensor? AI: If the sensor is supplied from the same voltage source as the microcontroller, generally there is no problem. It's not a matter of the board being "ready" so much as never applying voltage to an input that exceeds Vdd of the microcontroller. The actual specification is: -0.5V to IO supply voltage + 0.3 V So if the IO supply voltage is 0V the input voltage should not be more than 0.3V or less than -0.5V. If such a voltage is applied without limiting the current, it's possible to damage the microcontroller. Alternatives include adding some series resistance to limit the current or buffering the input with "something" tolerant of voltage applied when power is off. There are digital buffers that are designed for this purpose (they also translate voltage levels), and for analog circuits you can use an op-amp buffer with some input resistance to protect the op-amp.
H: PCB trace width calculation Take a look of this product: http://www.hobbyking.com/hobbyking/store/__68694__HK_Pilot_Power_VI_Module_Distribution_Board_And_Dual_UBEC_ALL_In_One_120A_and_10s_.html It says is a 45 by 45 mm PCB, gold plated. It is just a power distribution board, two input pads where you solder the battery leads and 8 output pads. What I don't understand is that it says can handle up to 120 Amps, using any online trace width calculator, a trace in order to be able of handling that amount of power needs to be almost 60mm wide... How can they handle that amount of current in that small form factor? AI: They are using power planes, maybe even with double-thickness copper layers too (70 microns / 2oz, rather than the usual 35 micron / 1oz Cu thickness), so the power path to the outputs is not going to be high resistance, and therefore not waste much power as heat loss, and therefore will not get hot and explode and otherwise be unable to "handle" the amount of current shown. 120A for 8 outputs is not too bad, each contact (which looks like just exposed mask on copper planes with holes for thermal relief) only needs to handle about 15A each which is entirely possible with nice fat wires going out to the rest of the set-up. I would be worried though, first about the size of the battery needed, and second about your safety, if 120A loading was a common thing in your system. You must also understand that using a trace width calculator makes certain assumptions, for example what the ambient temperature is, what the acceptable rise in temperature of the traces is, and in some cases how long the trace is, and finally the thickness of the trace which is usually measured in micrometers or ounces/square foot (oz). If you allow up to 30-40 degrees Celsius increase in temperature of the traces (which is usually fine for power related systems, which are often rated to 120-150 degrees) you can get away with very thin (2-3mm) tracks for carrying 15A, let alone how much you can do with a whole power plane (could be modeled as a 30-40mm wide trace!).
H: A question on pull up resistors I'm wondering why pull up resistors in text books are told such that they pull up the voltage to \$V_{CC}\$. Here is a diagram: When the button is open what will be the input voltage to the micro controller? \$V_{CC}\$? No voltage drop at \$R_1\$? AI: If the button is closed then the MCU input pin is shorted to ground. There is a path from \$V_{CC}\$ to ground with resistance \$R_{1}\$ and a current flows through \$R_{1}\$. By Ohm's Law $$V = IR$$ so the current \$I\$ through \$R_{1}\$ is $$I = \frac{V_{CC}}{R_{1}}$$ and is non-zero. If the button is open and the MCU input pin has a high impedance then very little current will flow through \$R_1\$. Since \$I \approx 0\$ in this case the voltage across the resistor is approximately \$0\$. The voltage at the MCU input is therefore "pulled up" to \$V_{CC}\$. Without the resistor (i.e. \$R_{1} = 0\$) the MCU pin would simply be shorted to \$V_{CC}\$ and could never be "pulled down" by the button switch. If the button switch was closed then the current drawn from \$V_{CC}\$ would be $$I = \frac{V_{CC}}{R_{1}} \approx \frac{V_{CC}}{0} = \infty$$
H: Output of a NAND gate Above is a TTL totem pole output NAND gate. There is a 120 ohm pull up resistor there. Since it is called pull up, can we say that the HI output will be connected to a very high input impedance? If so what can it be as an example? Aren't NAND gates in an IC are connected to each other by being ones output is other's input? I mean in the figure the output will be the input of another gate right? If so HIGH will not be 5V since there will not be input impedance unless it is not connected to a very high resistance. Where is this NAND gate's input coming from and where is the output going to? If the output is 5V isnt it high for a new TTL gate input and if is not 5V why do we call the resistor pull up in there? AI: The primary purpose of the 120\$\Omega\$ resistor is to reduce the current spikes when the output switches (when Qo and Qp are both on simultaneously for a brief moment). See, for example, here. It's a component part of the (active) pullup circuit, but it's not a 'pullup resistor'. Totem pole outputs like this one use an active pullup, which is Qp, Rc and Rcp. When Qs is 'off', the base of Qp is pulled to Vcc by Rc, so the effective pullup resistance is limited by the collector resistance Rcp - so it's about 120\$\Omega\$, meaning that for a 50pF load, the time constant is about 6ns. Without the collector resistor it would behave more like a few ohms (1.6K divided by the current gain of Qp). TTL inputs are defined as 'low' if they are less than or equal to 800mV and 'high' if they are greater than or equal to 2V. TTL outputs will be 400mV or less when low (and sinking 16mA or less), and 2.4V or more when high (and sourcing 400uA or less). That drive capability guarantees each TTL output the capability to drive 10 TTL inputs with a guaranteed noise margin of 400mV or greater.
H: Does a typical mobile adapter draw current when no load is attached? Summary: I am comparing the trade off of wasting my time daily plugging and unplugging multiple chargers at multiple sockets. I need to know approximately how much Amp is my adapter drawing every second when in no load (have not attached my mobile/tablet). Will it be mostly 0? On in the ballpark of <10 mA, <50mA, <100mA? Charger specs : (AK717) OP: DC 5v 2amp branded IP: AC 240V .3A AI: Yes, it will draw current. It will also consume energy (what you pay for on your electric bill). Modern mobile chargers consume perhaps 0.01kWh/day according to this book.(see page 68 in the book, not PDF, numbering) - measurements below indicate that contemporary chargers tend to do 2-5x better that that.. That's not a lot- you can calculate what it costs and/or what percentage of your total energy usage it is. At $0.10/kWh, 0.005kWh/day represents about 20 cents a year. If it takes you 5 seconds per day to plug and unplug, you're receiving an after-tax ROI of 40 cents an hour for your time. The current draw may be rather higher than the energy consumption would imply because some of the current is reactive.. however it cannot be less. Here's an excerpt from a set of actual measurements, made by Ken Shirriff: As you can see, the ones made by responsible manufacturers are generally 200mW or less, which would imply a current draw of a mA or two (maybe 1/10 of that) depending on reactive power, and depending on whether it was connected to a 120VAC or 230VAC mains. As Professor MacKay concludes, I would say it's a waste of time to unplug a modern mobile charger for a person living normally in a developed country. There are far bigger energy fish to fry.
H: Logic low not low enough I'm having an issue where the "low" level being output from one device isn't low enough for the device on the other end to interpret it as such. I'm guessing I'm not the first person to have this problem, but I haven't been able to find a solution. Here are the details: I'm trying to interface between the ALDL connector in my car and a Teensy++ 2.0. ALDL uses a UART-like protocol at 8192 baud, except transmit and receive are on the same wire. The circuit I'm using (from here) is below: When the "Receive Control Pin" (a regular, software-controlled, digital IO pin on the Teensy) is low, the ALDL data line should be able to drive the Teensy's receive line. When it is high, the Teensy's transmit line should be able to drive the ALDL data line while the Teensy receive line is held high. So far, it hasn't been working. I think the problem is that unless the ALDL data line is brought very close to ground when low, the Teensy's receive line doesn't read it as such. To test this, I disconnected the ALDL line and manually jumpered it to ground. The Teensy's receive line dropped to 0.93V, and it read a byte. Then, I jumpered the ALDL line to 0.45V (from a voltage divider). That time, the Teensy's receive line only went to 1.65V, and it didn't read anything. The little documentation I found said the ALDL line can output as high as 0.8V when low. Is there any way to modify this circuit or build a different one to avoid this problem? Edit: The ALDL signals are at a 5V level. Specifically: Transmit Low level output voltage: 0.8V max High level output voltage: 4.0V min Receive Low level input voltage: 2.0V max High level input voltage: 2.8V min AI: This will reduce the input voltage to your board by about 0.5V. simulate this circuit – Schematic created using CircuitLab
H: How are processors tested before going to production? No matter how much experience an engineer has, or how many engineer works on the design of a processor or a microcontroller, we are human at the end, and it is possible to make mistakes. Before sending a processor design to production, how are they tested so the processor works correctly? Are they designing the whole processor in FPGA? or is the whole design checked and debugged by software? (I am considering the complexity of x86 processors, ARM, PIC etc.). Thinking about 1970s with the design of 8086, they didn't have that much technology. AI: All of the above, and more. First and foremost is the re-use of existing "blocks" that they know work (unless they're departing from existing designs radically). This may be blocks they have used before, or blocks imported from third parties, like ARM. Then there's software emulation and evaluation - simulations and such. Yes, they may well use FPGA - maybe not for the whole chip, but to prove certain blocks of the design are right, before then putting them all together into a finished package. Finally are the engineering pre-releases. This is a small run of test chips sent out to willing third parties to try them out, find bugs, and feed back to the manufacturer, who will fix the bugs and do another short run. For instance, I have some PIC32MZ engineering pre-releases here. They're the 4th release, yet they still have big bugs in them. There have been (I think) 2 releases since then again. No amount of simulations and testing of each part of a chip can fully account for how the chip as a whole will operate when etched into silicon.
H: +5v and -5v power I'm building an analog switching circuit which is controlled by an arduino. My circuit requires 25 4066 quad-analog switches. To get the required analog voltage range for the switched inputs, I need to provide +5v and -5v input power to all 25 of the 4066's. I have tried to use a 1044 charge pump to get -5v, but it can't power more than one 4066, it seems. I only tried the std. 1044 circuit as provided in the data sheet. I also need to be able to provide switch control voltage of +5v and -5v to the 4066s to turn on and off the switches. I am not sure that the Arduino pin's LOW output of 0v will be low enough to completely switch OFF the 4066 in the negative part of the analog signal. Could anyone help me by providing an idea for a circuit that do all that, or maybe suggest a way forward? Thanks so much, Bob AI: The charge pump chip you mention can handle 10mA or 20mA without issue, so perhaps you're powering something else from the rails that is drawing a lot of current, or there is another problem of some kind! The 4066 switches should draw almost no current if the logic level inputs are at Vee or Vdd (aka Vcc). If you connect the control inputs to mid-supply (0V), they can draw excessive current (it's kind of the worst-case condition) because both transistors will be on at once, and they won't be at the proper levels to work anyway. The 4066 lacks logic level translation (control inputs should be -5 to +5 in your application), so I suggest chucking them and using 4316 parts, which are similar but will use 0/5V logic levels at the control inputs. Total current draw should be less than 4mA for all 25 units, even under extreme conditions (+125°C). If nothing else other than the switches is using -5V you should certainly be able to use the charge pump easily. Otherwise, if you've got other stuff going on, you can consider a DC-DC converter or an inverting switching regulator, but it may not be necessary. If you're really intent on using the 4066 switches, you can convert level with something like this (for low frequencies) simulate this circuit – Schematic created using CircuitLab But 100 of these will require 300 parts and will draw 10mA from the -5V supply if they're all 'on' (okay, you could use pre-biased duals and networks and cut the number of components down to 75 total, but that's still a lot of parts).
H: Interfacing switches with microcontroller Im trying to interface momentary push-button switches to my Stellaris EK-LM4F120XL. Im using a positive logic interface, to momentarily set pin as HIGH if the button is pressed. A 10K resistor is connected to GND from the switch, which is then connected to Vcc, 5V. The selected pin is connected to this junction, setting the pin as LOW when no current flows and a 0V signal is at the pin. Then when current flows the voltage at the pin is Vcc and is set HIGH. Using a multimeter this works flawlessly.. Although, when debugging - the output isnt triggered as desired.. My activation code in main is as follows.. if ((GPIOX_DATA & 0xXX) == 1) // IF THE PORTS' DATA REGISTER, AT PIN, IS HIGH, GPIOX_DATA |= 0xXX; // SET THIS PORTS' DATA REGISTER, AT PIN, TO HIGH (The control of setting the pin via the data-register works fine, eg on-board LEDs..) It is my understanding that you cannot write to an input pin - therefore its value is set by its logic-level. If it has a threshold voltage similar to TTL or CMOS, the active 5V on the pin should be setting it as HIGH - therefore == 1. My init code sets the input pin as - DIR as input AFSEL to regular DEN to digital.. Ive even tried adding disable analog thru AMSEL, clear port control thru PCTL.. Just to test the control, I want to turn on an on-board LED while button is depressed.. Am I missing something..? AI: When examining a single bit in a byte (or register) using & it's important to remember that the result of the & will be a masked value, not the value of the bit you're interested in. For example, if you have the value 0b10110101 in a register and you want to examine bit 2, you could mask it out with 0b00000100: 0b10110101 0b00000100 & ========== 0b00000100 = 4 So the result is, in decimal, 4. In your if statement you are comparing the results of the & operation with 1. That can only ever be true if you happen to be examining bit 0 in your register. If you change your comparison either so it's comparing the masked value to the value of the mask then it can become true for the value you're actually examining. Better still, drop the comparison altogether: if (GPIOX_DATA & 0xXX) // IF THE PORTS' DATA REGISTER, AT PIN, IS HIGH, GPIOX_DATA |= 0xXX; // SET THIS PORTS' DATA REGISTER, AT PIN, TO HIGH In an if comparison you're only interested in a true or false state. In C a false state is defined as 0, and a true state is defined as any other value but 0. So say the equation GPIOX_DATA & 0xXX results in 4, that is a true value, since it's not 0.
H: Can I increase inductance using permanent magnet ? I know that when I insert a ferromagnetic core inside an air-cored coil, the inductance increases. What if I inserted a permanent magnet with a cylindrical shape into an air-cored coil, does the inductance increase or decrease or still constant ? Is there any effects other than the inductance ? AI: If the permanent magnet is a lump of iron then it is also a ferromagnetic core. If it's magnetised so that it is saturated (off at one of the flat ends of the B-H curve) I'd expect its permeability to be lower than the unmagnetised core, and that will reduce its effect on the inductance. Hmmm, that must be how those so-called "permeability tuners" worked - move a magnet closer to a ferrite coil, saturate the ferrite, tune your TV that way... Lossier (because of that part-saturated core) than a straight capacitance-tuned circuit but it used to be popular in cheap consumer electronics in the 1960s? 70s? Someone was looking for an alternative to a voltage variable capacitance just yesterday... maybe this (control DC current and hence magnetisation in a separate winding on the same core) might answer his purpose?
H: Voltage wave form across a DC motor driven by a transistor with pwm Above is the simple implementation for a DC motor control with pwm. I was expecting to see a square wave with a Vmax when Q1 is ON and zero when Q1 is OFF like the one here: standard pwm But what I saw in oscilloscope is different. The OFF stage is not zero and even increasing when pwm is increased. And when I stall the motor with my hand the OFF stage then really becomes zero. But not when rotating. Here is the video where i adjust the pulse with frequency: DC motor voltage on scope Why is the voltage is not going to absolute zero during Q1 OFF, instead it is increasing when duty cycle is increased. Ok Q1 is on the volatge should be there but why still there is voltage when Q1 is OFF and why it is increasing with pwm's duty cycle? Plus as I said before the wave form becomes exactly a pwm with zero for OFF stages "when I stall(stop) the motor with my hand" (when stall a bigger current passes and voltage decreases). AI: Back-EMF. Remember the motor is also a generator. Except when it's stalled. Why does the generated voltage have the same sign? The magnets are the same way round, the motor is rotating the same way, so the generated voltage will have the same sign. Understand one important thing about an electric motor's operation : that back-EMF is always there when the motor is running. While Q1 is on it subtracts from Vmotor, so that the faster the motor is running the less voltage is applied across the windings, so it draws less current (and therefore power). So as you slow the motor with your hand, the back EMF reduces, and the motor takes more current (and you can feel it making more torque from that current). Stall the motor and it will take surprisingly high current, and may eventually burn out. As you say, Vwindings = Vmot - Vback_emf; When you increase Vmot, Vback_emf stays the same so Vwindings increase. But the winding resistance is the same, so the current increases. This increases torque, so (normally) the motor speeds up. THEN Vback_emf increases with the speed, reducing Vwindings and current. So the motor regulates its power consumption at a given voltage, to suit the load (friction etc). And while Q1 is off you can measure the voltage and it gives you a pretty good speed measurement. Current will only flow through the diode when the diode is forward biased. Which it isn't because the generated voltage is < Vmotor. However the diode certainly isn't wasted! Another property of the motor winding is its inductance. This doesn't matter when computing the motor's speed and power. However it matters when current stops flowing, due to either the switch Q1 turning off, or the commutator inside the motor breaking current flow. Current through an inductor stores energy (making the magnetic field) and releasing that energy can create enormous voltages (you can maybe see the sparks inside the motor!) and these would pull Q1 collector up to several hundred volts and quickly destroy it. Unless you fit the diode, which turns on and safely conducts that energy to Vmotor instead of making HV spikes.
H: How does an speaker amplifier have to be build for a given DAC output signal? I am working on a project "cat projector" which shall "shout" at the cat when she jumps on the table in the living room. For the logic I use an Arduino board which plays/streams the sound at 22.1kHz from a SD-Card and using the MCP4821 DAC to generate the signal. This works perfectly fine (as you can see on the measurement). The output on the DAC is between 0-4V. The measured output signal of the DAC is shown here: I plan to use a regular 8Ω speaker with 0.2W or 1W. I also have a 5V source and a 9V source which I can use for the amplifier (both sharing the same ground). The DAC is powered from the 5V source. Here a circuit which already contains the exact output signal from the measurement. simulate this circuit – Schematic created using CircuitLab What is a good amplifier circuit, to convert the DAC output (0V - 4V) into a suitable signal for the 0.2W or 1W speaker? My best (failed) solution so far was this one: simulate this circuit Final Solution Just for documentation, this is the working circuit I ended up with. It is using the LM386N-1 with a 8Ω, 0.2W speaker. The sound quality is usable, with small distortions on high frequency tones. Using C1/C5, there is no hearable noise if the DAC is turned off (0V level). The actual measurement looks like this: The yellow signal is measured in front of the speaker. The blue signal is measured at pin 3 (input+) of the amp. Note the different scales: Yellow 1V, blue 50mV. AI: Google "LM386" and take one of the examples in the datasheet: With the default 20x gain you will probably need ~ 1:40 attenuation between the DAC output and the LM386 input. Use a log potentiometer for the 10k to set the attenuation, once you know the correct setting you can swap it for two resistors.
H: LEDs in parallel, strange current consumption I just wired a blue LED on a breadboard with the anode to an Arduino Uno's 3.3V rail and the cathode to a 220 ohm resistor to ground. Then I measured the current consumption using my Fluke 87-V and it was 1463 microamps. Here's the strange part: I then added another blue LED, exactly the same type, in parallel to the first one. This, too, was using a 220 ohm resistor. I expected the current consumption to double to 2926 microamps or so. Instad, the measured current consumption was 2121 microamps. Can anyone explain this? Update: Just added a third blue LED, same type, in parallel, 220 ohm resistor, and the current drawn is now 2681 microamps. Wtf? Update 2: I just switched my Fluke to the mA range and now I get 5.41 mA drawn with 3 LEDs in parallel. With two in parallel on the mA range I get 3.61 mA and with just one I get 2.02 mA. All measurements in DC mode of course. So I assume my Fluke is broken since it gives different readings on the uA and mA modes? AI: There's nothing strange going on here. With a 3.3V supply, and a blue LED, there is very little voltage across the 220 ohm resistor(s). simulate this circuit – Schematic created using CircuitLab Your Fluke meter (when set to measure current) has quite significant internal resistance, which is higher on lower current ranges. This resistance adds to the 220 ohms/n (where n is the number of LEDs), and explains the lower reading on the lower current ranges. There are times when you can ignore the voltage drop of an ammeter (or the loading of a voltmeter) but this is not one of them. Another effect is that the output port pin also has some internal resistance (which again adds to the parallel resistors) so you expect the current to drop if you're driving the LEDs with a single port pin.
H: register without clk I'm designing a small system in VHDL using the datapath and contorller method. Is it okay if I design registers that don't have a clock input (load data on the rising edge of the load signal) as they are being controlled by the control unit which is going to be running on the same clock signal; just to use less wiring. Something like this: PROCESS (load, reset) BEGIN IF RISING_EDGE(load) THEN temp <= d_in; ELSIF RISING_EDGE(reset) THEN temp <= (OTHERS => '0'); END IF; END PROCESS; d_out <= temp; Is there anything wrong about the design above? I want to make a shift register too; load on the rising edge of 'load' and shift on the rising edge of 'shift_right' input signal, wich would look something like this: PROCESS (load, sh_r) BEGIN IF RISING_EDGE(load) THEN reg <= d_in; ELSIF RISING_EDGE(sh_r) THEN reg <= reg (n-1) & reg (n-1 DOWNTO 1); END IF; END PROCESS; d_out <= reg; AI: You "can" do it but it would be highly discouraged. The correct thing to do is to learn how to design your logic so that everything (or at least large separate partitions of the logic) run on a common clock rail. Then learn to use clock enables to allow the "load", "clear", "increment", and "shift" type operations to happen on the next clock edge. Design these clock enable terms to be one clock wide pulses. There is no real downside to this type design because virtually all FPGAs that you would target your design to have global clock networks that distribute the clocks to all the logic cell flip-flops that is separate from the allocatable logic routine resources. The up side to this type design is that it greatly simplifies the analysis and meeting the setup and hold timing. If timing does get tight it is much much easier to convert fully clocked designs to use either a slower clock to meet timing or to pipeline critical logic sections to split delay paths across two clocks. Do it from the outset and it will be something that will be valuable experience for every future design that you would do.
H: Multiple voltages power suply, high current I'm trying to design a battery back-up power supply for my home network devices. I need these: 48 V / 40 A 24 V / 10 A 12 V / 2.5 A 5 V / 5 A I got a 48 V / 60 A industrial power supply with battery backup (four 12 V car batteries in series) and need to divide the voltages. After digging through Google and Electrical Engineering Stack Exchange, I want to use a bunch of diodes (like 1N4007, but of a type able to withstand the current) and simply take out needed voltages somewhere between these like this: The second option is high current transistors like BC547B driven by zener diodes, but I'm not really sure if that would be better than the first option. Is my idea OK, or I should do it another way? AI: This is a no-go. The power which you have to dissipate in the diodes will be enormous. diodes between 12V and 5V dissipate 7V @5A = 35W diodes between 24V and 12V dissipate 12V @7.5A = 90W diodes between 48V and 24V dissipate 24V @17.5A = 420W Total amount of dissipated power (in diodes) = 545W The diodes able to withstand such power need to be extremely big, the absorbed power will all be transfered into heat so you would need giant cooling fans or a very big airflow. This kinds of power really need to be converted by a switch mode conversion which will give you an efficiency in the order of 85%+. Instead of dissipating 545W in the electronics you now only have to dissipate 15% of the output power, so 295Wx0.15=44.25W Still a lot but way more feasible. So you better go looking for three switched mode PSU for 48V>24V, 48V>12V and 48V>5V
H: Will the current flow through the diode? This question originates from a difficulty to understand fly-back diode current in DC motors. In the above figure which logic is ok: 1) 9V-2V = 7V, so diode is reverse biased and current will not flow. 2) diode is applied 2 volts forward bias in a loop so current will flow from the source V2 Which logic is valid? AI: The diode will only see the 2 V forward, so the current will flow. The diode is directly connected to the 2 V generator so everything outside doesn't matter (excepted short-circuit and so on of course), if you can measure 2 V at the generator then there is also 2 V at the diode. But you'll not have 2 V at this point, you'll have the diode drop (0.6 to 0.7 V for silicon and 0.3 for schottky diodes for example) or a fried diode if the current is too high... EDIT (Since the OP has edited his question my answer just above is no longer valid): The diode will only see 2 V in reverse (or -2 V in the conventional reading direction of a schematic), so the current will not flow. The diode is directly connected to the 2 V generator so everything outside doesn't matter, if you can measure 2 V at the generator then there is also 2 V at the diode. So you'll have 9 V accross the whole thing, -2 V accross the diode and +9 + -2 = 7 V accross R1. EDIT² (answer to the secondary question: Where will the current flow when V1 = 9 V and then V1 = 0 V?) Since the diode isn't conducting there is only one current path and it will be from V1, through V2, then trough R1, then to GND when V1 = 9 V. When V1 = 0 V (connected to GND in other words) the path will be the same but the current will flow in the reverse direction (but the diode will still be reverse biased and not conducting, don't forget the diode is still directly connected to the generator V2 so everything outside doesn't matter). From a different point of view: if you think that V2 is like a battery, when V1 = 9 V you recharge it through R1, and when V1 = 0 V then you discharge it directly through R1. EDIT³ (new schematic and new secondary question: Where will the current flow when Q1 is closed and then opened?) With this new schematic when Q1 is closed (let's assume it's a perfect transistor) the path and current direction will be the same as in my edit² when V1 = 9 V. When Q1 is opened there is no path where the current can flow so there is simply no current flowing.
H: How long does ultrasonic rangefinder last I've built a parking sensor in my garage that uses the HC-SR04 ultrasonic rangefinder and an arduino to measure how far the car is from the back wall. The one thing that I'm worried about is if the sensor will continue to work for a long time. When it senses an object, it senses distance 10 times per second and once there's a period of inactivity, I scale it down so that it senses distance once per second. So it will be sensing once per second pretty much all the time, which is like 86000 per day, or 31 million times per year. Anyone know if these sensors go bad over time or if they're rated for a certain number of senses? Thanks for any advice! AI: First off, sensing the distance once per second may be too slow even for a parking application. Consider that 2 mph is equivalent to over 2.9 feet per second. Almost 3 feet is a large distance in a garage. In any event, I don't think you have to worry about the reliability of the sensor. Quartz watches run continuously for years without any problems. If the watch is analog, that means the parts associated with moving the second hand are operating once per second 24 hours per day or 31 million times per year as you have pointed out. Garage door openers have object sensors to prevent accidents that are also on continuously and last for years.
H: Is possible to use wave guide to decrease beam width? If I use a normal 1/4 monopole antenna "30 MHz for example" and cover it with metallic wave guide has a narrow beam width, should the gain increasing according to this formula below? $$G = 10 \; log \Big(\dfrac{32400}{H \times V}\Big)$$ AI: Rule of thumb: physically larger antennas have narrower beam width for the same frequency. If you want to make a 30 MHz monopole more directional, you can't just cover it with a piece of metal. One solution would be to get a bunch of antennas and build a linear array, where the array factor would give you the gain. This array will need to be at least several meters long. Adding a reflector behind the antenna would increase the gain a little bit, about a factor of two. Bottom line, if you want a high gain at 30 MHz, you're going to need a REALLY big antenna.
H: Voltage standards? Like 3.3V, 5V etc What exactly are the main voltage standards called for all the common voltages we see? 3.3V, 5V and 12V are some of the most common DC voltages but what are they known as exactly and what's with their significance? i.e. Were they picked as it sounded like a nice value or for an electronically significant reason? AI: 3.3 volts was chosen as a JEDEC standard. Electronics had moved on from the the old 5V (TTL) and 4000 series CMOS (3 - 15V). Technology changed and industry moved toward a lower voltage: e.g. Transistors got smaller, so the threshold voltage is lowered, a need for faster circuits, lowering the voltage will reduce the time it takes to change logic levels, TTL logic is being phased out, less demand for 5V compatibility higher packaging density so power usage is a concern and so on. As a world wide industry agreed standards are important to ensure product compatibility. The 12V probably comes from the use of battery power - most cars using a '12V' lead acid accumulator. Trucks tends to use 24V and aviation has its own standards. As far as I am aware 12V was never an electronics standard, it was simply in common use as was (is) 9V.
H: Diodes block voltage? I understand the basics of a diode, a diode allows current to flow in only one direction, but how? By blocking any opposing voltages source so that no current can flow in opposition? And of course, a diode has its limit. If there is a voltage in opposition that is higher to what the diode can handle it allows current to flow in opposition. What about the current that is allowed to flow through the diode is it reduced? For example: Current is supplied by a power supply it flows through a diode in forward direction, if the current was 10A before passing the diode will it still be 10A throughout the diode? If the opposing voltage existed does it reduce that 10A? And how can I relate the forward bias to this? AI: What about the current that is allowed to flow through the diode is it reduced? For example: Current is supplied by a power supply it flows through a diode in forward direction, if the current was 10A before passing the diode will it still be 10A throughout the diode? If the opposing voltage existed does it reduce that 10A? It really isn't clear what you're asking but really, all you have to do is to look at the IV curve for a diode. What is an IV curve? It gives you the current through the diode versus the voltage across the diode. Qualitatively, it looks like this: Now remember, either the voltage across the diode is positive or negative. If the voltage is positive, there is forward current through the diode. If the voltage is negative, there is a small reverse current until the breakdown voltage and then there is a large reverse breakdown current. That's really all there is to it. If there is a 10A forward current through, there is a certain positive (forward) voltage across period. a diode allows current to flow in only one direction, but how? There is an enormous amount of material, from the beginner to advance level, on the web describing the operation of the PN junction. What specifically do you not understand? Your question, as is, is too broad. Study the operation of the PN junction and then, if it isn't quite clear, ask a specific question.
H: voltage drop when using voltmeter it's a theoretical question. is there any voltage drop when measuring a 12v battery with a multimeter(voltmeter mode)? so if we get 12 Volts reading near the battery, does this changes if we extends the cables of multimeter to 1 km ?? AI: A typical DMM has a very high (but not infinite) input impedance, typically ~10Mohm or bigger. Now suppose you have very long leads. This will also have some finite resistance. Forming a voltage divider (I'm moving all of the resistance due to leads to above the multimeter. Mathematically this is equivalent to having two leads with 1/2 the length on each side): \begin{equation} V_{out} = \frac{R_{DMM}}{R_{DMM} + R_{leads}} V_{in} \end{equation} Computing the equivalent lead resistance for 1km 24AWG wire on each side, we get \$R_{leads} = 166 \Omega\$. Then with a 10Mohm dmm resistance, \begin{equation} \frac{V_{out}}{V_{in}} = 0.9999834 \end{equation} Or an error of 0.00166%. You'd be pretty hard pressed even measuring this error with most multimeters, and errors from other sources will swamp any errors due to the voltage drop in the leads. There is slightly more error if you add in the battery's internal resistance, but still not significant.
H: Is there anything besides power factor that determines the max CFL that can be used in a socket compared to the max incandescent for that socket? When shopping for lamps recently, I've noticed that the sticker on the socket says something along the lines of "To reduce risk of fire, use maximum 60 watt incandescent or 13 watt compact fluorescent." My question is, why does the maximum wattage vary for different types of bulbs? Shouldn't the socket be able to handle 60 watts, no matter what is drawing it? I've searched on the Internet, and although the question has been asked before on various websites, most of it seems to be uninformed speculation, or people who don't even understand the question. (Hence why I decided to ask a forum of electrical engineers.) The best answer I've been able to find is that it's because the power factor of a CFL is significantly less than 1. That makes sense to me. So it seems like a "60 watt incandescent" socket is really a "60 VA" socket. However, even if the power factor of the CFL is 0.5 (and my impression is that it's usually more like 0.6), then a "60 watt incandescent" socket should still be able to use up to a 30 watt CFL safely. So, why does the socket say only a 13 watt CFL is safe? How does the manufacturer calculate this? Is there something else that needs to be taken into consideration besides power factor? AI: The problem isn't the current the socket can handle, it's the heat. There is some very good informations here about CFL safety and so on.
H: Why there are live and neutral wires attached to house's wall sockets If AC voltage is alternative, why there are two (Suppose there is no earth wire) wires attached to the wall socket: live or hot, neutral wires? And I think that in small home generators there is no need to specify which wire is the live wire? I've read that the neutral wire is connected to the ground. Where it's connected, I mean at the house or somewhere else ? AI: There must be two wires for a complete circuit. Now, in a balanced AC circuit, both wires provide an alternating voltage with respect to ground (earth). When one wire is positive, the other is negative. However, in an unbalanced system, one wire is neutral, which should ideally be at 0V with respect to ground, and the other is hot which alternates positive and negative with respect to ground. In either case, both wires have (ideally) equal and opposite current. If I'm not mistaken, in the USA, the neutral and ground are connected together at the meter base (service entrance). For a generator that isn't referenced to ground, the AC voltage is simply across the 'hot' and 'neutral'. There are devices for converting unbalanced AC to balanced AC power.
H: High Power Supply over a distance I'm working on a project and have been stopped in my tracks part way through. I am designing a system that will power an RC over a distance. So I have a generator, and around 300 meters of cable to a low power system. Since I want to use lighter wires I plan on ramping my voltage very high at the generator, passing it down the wires at a much smaller current, and then finding a way to transform the power down for usability, and then of course return. I dont care about power loss, if the system is only 50% efficient then its still successful. My issue is that I cant find a way to make the power usable at the low end, without using a classic inductance transformer, which will weigh too much, (i only have about 2 kg to work with). Is there a basic concept that I'm missing for changing voltage at the low end? Also if it matters I need 2kW on my lowside to power my motors... AI: You can use a higher frequency than the standard 50 or 60 Hz to reduce the volume and weight of the transformers (for example the aircraft industry use 400 Hz as the standard in airplanes). Personally I'll don't go beyond a few kHz to avoid all kind of problems but it's just a rough estimation (and you might need a higher frequency than that to pass 2 kW with a 2 kg transformer), do the math to be sure. Also, if the frequency is relatively high for the wire thickness, think about using litz wire for the transformers windings, you lose on the volume but you win on the weight. To drive the first transformer you can use a H-bridge (or even just a half-bridge with a center tapped primary on the transformer) and a crude astable since the efficiency isn't a concern. You can do better by approximating a sinus with multiple taps on the primary but it gets far more complicated. On the other side, after the second transformer, just be careful about the switching speed of the diodes if you want to rectify the current (classic rectifying diodes might not be fast enough), use schottky diodes if you want to be sure to have no speed problem ever.
H: Is the quoted range of an RF module based on two identical modules? Take for example this 433MHz transceiver module. It's quoted range is 300m. What does this value mean? Is this the distance when the signal strength dies down to 0%? Does this mean if I were to buy two of these (one for transmit, other for receiving), I would get a theoretical range of ~600m? AI: There are two things to consider about radio transmissions. One is the power output and how far that can be expected to be reasonably detected and the 2nd is how much bandwidth you are using because this limits the signal that is needed by the receiver. Starting with the receiver, at a given data rate it can be expected, at ambient temperatures to successfully receive. -154 dBm + 10log (data rate). So, at 1000 bps the anticipated signal strength needed will be -124 dBm. At 1Mbps this increases to -94dBm. Given perfect conditions a transmission will attenuate at 32.5dB + 20log(MHz) + 20log(kilometres), so at 1GHz and 10km, the output power from the transmit antenna is reduced by 32.5 + 60 + 20 decibels = 112.5 dB reduction and if you were transmitting 1000 bps at 1 watt, you'd probably be ok with minor obstructions and reasonable line of sight. You should be able to estimate what the real distance of your actual radio modules are now and report back how they stack up against the marketing claims.
H: Detect a missing PWM signal in the smallest possible board space I have a motor control board that basically has zero space left, and the customer wants to add a fault flag to tell if their 2 kHz PWM input signal is lost. So basically, I need to detect a lack of edges over a few milliseconds, using a small number of very small components. There is no microcontroller on the board, and I have maybe 10 square millimeters I can scrape together for it. I had the idea to use a watchdog supervisor IC, but I can't find a small one that is active high and has the right timeout period. Now I'm leaning towards something with a 555 timer or maybe an RC filter that fills from 5v and gets drained whenever there's an edge. AI: This circuit should do what you want, within your space requirments. At 2 kHz, pulses will arrive at 500 µS intervals. I set the timing for the 74123 multivibrator to timeout at 2 ms. You wanted an active high output when the pulses disappeared, by unfortunately, in small packages like this, there is no \$\mathsf{\small \overline{\text{Q}}} \$ output, so I had to include an inverter. Otherwise that would have come for free. Both the 74123 and 7404 are in BGA type packages. The SN74LVC1G123, in a YZIP package is 0.9mm x 1.9 mm, or 1.71 mm². The SN74LVC1G04, in a X2SON package, is 0.8 x 0.8 mm, 0.64 mm². Since they are BGA, they can be placed as close together as the pick and place machine will allow. The two caps and resistor all come in 0201 packages, which are each 0.6 mm x 0.3 mm, say 0.9 mm x .35 mm footprint on the PCB. So the total for all three is 0.945 mm². Thus the total area for all five components (excluding room for traces) is approximately 3.3 mm².
H: ATMEGA328p ADC keeps returning 1023 I'm trying to configure my ATMEGA328p to measure temperature using the TMP36GZ temperature sensor. However, the 10-bit ADC keeps returning 1023. I've tried disconnecting the temperature sensor (it should return 0 at this point for the ADC reading), but it still returns 1023. I'm not exactly sure what I'm doing wrong in my code: volatile uint16_t TMP36_VoutADCReading = 0U; void TMP36_Init( void ) { // Set the ADC prescaler to 128 (i.e., 16MHz/128 = 125KHz) ADCSRA |= ( 1 << ADPS2 ) | ( 1 << ADPS1 ) | ( 1 << ADPS0 ); // Set the voltage reference from AVcc (i.e., 5V). ADMUX |= ( 1 << REFS0 ); // Turn on the ADC. ADCSRA |= ( 1 << ADEN ); // Do the initial conversion (i.e., the slowest conversion) // to ensure that everything is up and running. ADCSRA |= ( 1 << ADSC ); } void TMP36_ADCRead( uint8_t channel ) { // Clear the previously read channel. // ADCSRA &= 0xf0; <-- This was causing the bug. ADMUX &= 0xf0; // <-- This is the fix. Thanks IgnacioVazquez-Abrams! // Select the ADC channel to be read. ADMUX |= channel; // Start a new conversion. By default, this conversion will // be performed in single conversion mode. ADCSRA |= ( 1 << ADSC ); // Wait until the conversion is complete. // while( ADCSRA & ( 1 << ADSC ) ); <-- This is probably also correct. while( ADCSRA & ( 1 << ADIF ) ); // <-- Added. Thanks Adithya! // Obtain the ADC reading from Vout. TMP36_VoutADCReading = ADC; // Clear the ADIF flag. ADCSRA |= ( 1 << ADIF ); // <-- Just added. Thanks Adithya! } int main( void ) { // Disable all interrupts for the time being. cli(); // Initialize the TMP36GZ temperature sensor. TMP36_Init(); // Enable all interrupts. sei(); while( 1 ) { // Compute the distance. uint8_t channel = 1; TMP36_ADCRead( channel ); // At this point, TMP36_VoutADCReading = 1023 } } In terms of connections, I'm trying to read the output voltage from pin PC1 on the ATMEGA328p and I have AVcc connected to VCC and pin 22 (i.e., GND) connected to pin 8's GND. I have disabled setting the voltage reference from AREF, so AREF isn't connected. Any help would be greatly appreciated. UPDATE: IgnacioVazquez-Abrams pointed out that ADCSRA &= 0xf0; should have been ADMUX &= 0xf0;. I've since modified the code above. Also, thanks Adithya for the suggestion you made about checking the ADIF flag! I'll take it into consideration. AI: The solution provided by IgnacioVazquez-Abrams was correct. Apparently, I was incorrectly clearing the lower 4 bits in ADCSRA when I should have been doing it to ADMUX. I've updated the code above to reflect this and the errors I've made in the code have been commented out (they are still there for reference).
H: Creating Custom Component + Pattern - Diptrace Right now I am creating the schematic and the final pcb layout of my circuit in Diptrace so that I can etch the PCB myself. I am going to use LM2985-3.3 SMT LDO from Texas Instruments in my circuit to step down the 5V supply. This IC is available on SOT23-5 package. Since I could not find this component in the default libraries, I am attempting to create my own. Couple of questions In SOT23-5, what does 23 and 5 stand for? The chip dimensions in the datasheet are not exact, but a pair of min/max. Why is this so ? While drawing the component, which one do i take into account? Lastly, any good link to a good tutorial for creating custom component/pattern in Diptrace? AI: The "SOT" is a "Small Outline Transistor", with 2mm distance between outer pins on one edge. The "3" portion refers to the number of pins on the package, so an SOT23 is a 2mm small outline transistor with 3 pins. The SOT23-5 is actually an incorrect designation, and should really be SOT25, though SOT23-5 is commonly used. In this case the -5 refers to a 5-pin version of the SOT23, which would be a 2mm small outline transistor with 5 pins, which by the above numbering scheme should be SOT25. Chances are you will have a generic SOT23-5 or SOT25 footprint in Diptrace since it is one of the most common size of surface mount transistors / small devices around. If you do need to make a new footprint you shouldn't be working from the chip's dimensions, but from the provided recommended footprint or "landing pattern" in the data sheet. If a footprint isn't given, and it's a standard size like SOT25, then they assume it will fit any generic SOT25 footprint. By the way, I use TI's SOT25 LM(something) regulators all the time (I forget the number off hand, might be the same ones), and just use the default SOT25 footprint in my PCB software and they work perfectly. I haven't used Diptrace, so I don't know how to create footprints in it.
H: Noise Gain of Op Amp Why is the noise gain of an op amp always constant at $$1+\frac{R_1}{R_2}$$ and independent of configuration, unlike signal gain? AI: There are two unwanted opamp properties - effective at the input nodes of the opamp: Noise and input offset voltage. When the opamp has negative resistive feedback, both voltages (noise, offset) are amplified with the factor (1+R2/R1). This is obvious (typical non-inv. gain formula) if we allocate these voltages to the non-inverting terminal only (assuming no signal input voltage at this node). However, it is easy to show by calculation that the result is the same if such an unwanted noise or offset source is located directly at the inverting terminal (between the inv. input and the common node where the feedback resistors meet). Calculation (edit): Assuming no signal input (non-inv. input node and R1 grouded) and a finite output voltage Vout, the corresponding voltage at the common point of R1 and R2 is Vo=Vout*R1/(R1+R2). Solving for Vout/Vo=1+R2/R1 gives the relation between Vout and a corresponding voltage Vo between the common point and the "virtual ground" potential at the inverting input node.
H: What is the path taken by the back emf current? ! Where will the current flow through? If ON current(back emf "current") will loop through A B and C If OFF current will(back emf "current") loop through x y and z AI: Where you may be confused is that there are actually two back-emfs - the voltage generated by the motor when it is spinning, and the voltage caused by inductance when the PWM switch opens. A DC motor can be thought of as consisting of a DC generator whose voltage is proportional to rpm, a resistor which represents the resistance of the windings and brushes, and an inductor which represents the armature inductance. Consider the equivalent circuit below. When the motor is spinning it generates a DC voltage in opposition to the supply voltage. The difference between the supply voltage and generated voltage is impressed across the motor's internal resistance, which determines how much current it draws. As the motor speeds up the voltage difference gets less so current draw reduces, until it is receiving just enough current to maintain a constant rpm. If 50% PWM is applied then the motor 'sees' 50% of the supply voltage on average, so it drops to half speed and the generated voltage is nearly half the supply voltage (slightly less due to voltage lost in the resistor). During PWM ON time the motor receives full supply voltage, so you might expect the instantaneous current to rise dramatically. However this doesn't happen immediately because the inductance apposes any current increase, generating a back-emf voltage which adds to the generator voltage (polarity is + at the top of the inductor and - at the bottom). During PWM OFF time the switch is open, so motor current cannot get back to the supply. However once again the inductor opposes current change, this time generating a back-emf voltage in the opposite direction (with polarity as shown by the + and - symbols in the diagram) with sufficient amplitude to maintain current flow. At this point the flyback diode becomes forward biased and motor current flows through it. The intention is to maintain a constant current through the motor even though it is being continuously switched on and off. In practice the inductor can only slow down current change, not completely eliminate it. However if the PWM frequency is high enough then the current ripple will become a triangle wave of low amplitude. simulate this circuit – Schematic created using CircuitLab
H: Why isn't this LM2917 circuit working to turn off a transistor? It was suggested to me that I should post a new question (original question here: Minimal Hall effect sensor circuit to keep something off after certain RPM achieved). The below schematic is for turning off the transistor Q2 once a certain RPM is achieved. I do not have an oscilloscope, only a multimeter to test. The sensor I'm using for U2 in the schematic is one of these: Hall effect sensor Unfortunately there is no datasheet for it, but it is a very common NPN sensor. I confirmed that sensor works by placing a magnet in front of it and away from it. I'm using a 200K pot for R1 and R2 to set a low RPM threshold, and placed a magnet on the end of my drill to spin it, and no matter what, the transistor Q2 doesn't turn off like it should. I'd appreciate any help as to help me get this circuit working. AI: Okay, I see a few things. First, the LM2917 has an internal (nominally 7.56V) Zener diode across the power supply rails. If it's really an LM2917 (not an LM2907) and you've really got it connected that way, more than about 7.5V on the power rail will destroy the chip. Now, on to the design details. You've set the threshold for comparison at 0.5 of the supply voltage using R3 and R4. According to the datasheet, the output voltage of the tachometer section is: \$V_O = V_{CC} \times f_{IN} \times C1 \times R1 \times K \$ where K~= 1. (give or take 10%) So for \$V_O/V_{CC} = 0.5\$, \$R1 \times C1 ~= 0.5/f_{IN}\$ If I use 500RPM as your desired threshold (and assuming only one pulse per revolution),then we have 8.3Hz \$R1 \times C1 \approx 0.06\$ So a sensible value for C1 might be the given 1uF, and the resistors in your schematic would set the threshold at about 361RPM with the pot centered, and 500RPM should be within range. So far, so good. Now, the desired ripple and response time (trade-off between the two) determines the value of C2. If I plug the values into this equation from the datasheet (assuming 7.56V Vcc and assuming I didn't make an error and assuming desired ripple of 0.1Vp-p) I get \$ {{C1} \over {C2}} \approx 0.04\$, so C2 should be about 25uF. Naturally the response time will be fairly long with this value, but since there's no specification I'll just note that, you can refine it at your pleasure. Finally, they mention that the maximum frequency it can handle will be determined by another equation (see below), and plugging in the values I get 23.8Hz (1400 RPM+). You can analyze or test what happens if that is exceeded and see if it is acceptable for your application. Oh, and (yeah, I said finally) the output saturation voltage is probably low enough to turn off Q2 safely, but I'd prefer to see a couple resistors in there or a MOSFET in place of Q2 so that 1V out won't turn the transistor on. TL;DR: You need a series resistor to Vcc, and enough input voltage to make it regulate (no resistor and you'll kill the chip with supply voltage more than 7.5V or so). Increase C2 to tens of uF and check response time is acceptable Make sure it doesn't misbehave at maximum RPM
H: Can a current be induced in an HDMI cable that runs parallel to a 120v AC cable for 15 feet? I just went to go unplug an HDMI cable and got shocked from the end of it! The only possible causes of this that I can think of are that the receiving or sending end of the long (50ft) HDMI cable is introducing a live current into the line, or that an electrical current is being induced in the HDMI cable because it runs side by side (parallel) to a 120v AC extension cable for 15 feet. Should I be concerned? What are the first steps I should take to diagnose this? For reference, there was a Sony PS3 connected to one side, and an HDMI Splitter to the other end (http://smile.amazon.com/dp/B00B46XUQU) If you need any clarification, please don't hesitate to ask! AI: The coupling could result from a Y-capacitor in the HDMI switch power supply. A Y-capacitor is placed between L-GND and N-GND and often used to filter out common-mode noise and to establish a common ground reference (with respect to "earth"). If the outlet / plug does not provide proper grounding (only N and L connected) and you touch GND on the HDMI cable, there might be a small current between flowing from L-GND-YOU-EARTH. Y-capacitors are tested to applicable standards to qualify them as safe. They never fail as "short" and there are typically only a few uA flowing, but it is enough to feel a tickle.
H: Reducing transistor switching time I am currently required to study different ways of reducing the transistor switching time. From what i understand, the two most used methods are speed-up capacitors and Using a negative, non-linear voltage reaction to avoid saturation. Unfortunately, i don't really understant how either of them work and I haven't been able to find any useful resource online. Could anybody explain them to me or point me to some useful material ? AI: When transistors saturate there is stored charge in the base that must be removed before it will turn off. One way of doing that is to use a speed-up capacitor, which helps to suck the charge out of the base by increasing the drive current during switching. More information in this on-line source (source of the below image). It's usually better to prevent saturation rather than trying to deal with it after it occurs, and a popular method is the Schottky transistor - which is an integrated structure combining a BJT and a Schottky diode from collector to base. The Schottky diode prevents saturation by diverting base current to the collector when the transistor gets close to saturation. It's a modification of the Baker Clamp, which performs a similar function without requiring Schottky junctions. See the Wikipedia article I lifted those images out of for more information. As you can see from the above diagram, the structure of the Schottky transistor is extraordinarily simple and compact (not much different from a regular transistor) so it was very popular in the era of bipolar logic- the 74LS family (and 74S where high speed was required) was very popular in its time.
H: What's the difference between virtual circuit switching and circuit switching? Circuit switching's packets take the same route as virtual circuit switching's do. So, how do I distinguish between virtual circuit switching and circuit switching? AI: In the good old days of cables that consisted of a large number of copper wires, and switching stations with relays that effectively implemented a big crossbar, circuit switching meant that the provider put all the switches in the position that made a real (electrical) circuit from one client to another. The two literally had a cable for their own private use (for as long as then connection was established). Virtual circuit switching gives the clients the impression that they have a dedicated cable, while in fact they are allocated time-slots (or frequency bands, or some other shared slice) in all the cables that make up the connection. This better matches the current economic reality that a cable is very expensive, but has a bandwidth that far exceeds the needs of most clients, hence sharing is economical. The difference between a virtual switched circuit and plain packet switching is that for a virtual circuit all the steps that make up the connection are determined when the connection is established, and the buffers and bandwidth at each step is claimed and thus guaranteed. For (plain) packet switching there is no such circuit creation: each packet finds its own way through the network, and has to hope that sufficient buffers and bandwidth is available at each step.
H: Identifying a four-pin IC labelled EL 8+7 G8025 I want to know the purpose of a component named "EL 8+7 G8025" which was found inside a Nokia charger. AI: Possibly an EL817 optocoupler, but I'll reserve final judgement until I see the photo. If it's a semiconductor the only common 4-pin parts used in this sort of application are bridge rectifiers and opto-couplers. There are other 4-pin parts such as common-mode chokes, but they look different. Bridge rectifiers look more like this:
H: Capacitor with n electrodes In my book it says that the capacitance in a capacitor with n electrodes is (n-1)*Co, Co is a capacitance of a two parallel plates capacitor. I know how to distribute charge when there are 3 parallel plates( two of them are connected to single Q,and the third which is in the middle to -Q), and I get 2*Co, but I can't figure out how to distribute charge when there are four of them. AI: Assuming the plates are connected in an interleaved fashion as normal, there are n-1 gaps with n electrodes. Each one acts as a capacitor in parallel with the others. Here is an image from this website. You can see that there are 11 plates and 10 gaps resulting in effectively 10 parallel capacitors of area equal (approximately) to the area of the dielectric slabs.
H: I need 2 vcc pins on the arduino? I need to connect the vcc pin to a bluetooth module but then I need to sue it again for a relay module what do I do? AI: You just use the same pin twice. You can connect as many items to the 5V pin as you like as long as you don't draw more than around 750mA absolute max (the regulator is rated at 800mA, and the Arduino itself takes about 50mA or so of that). Note that as you increase the current draw the regulator will get hotter, so if you want to use higher currents it would be worth investigating using an external 5V power source.
H: Why it has used BPSK modulation after OFDM? I am quite new to OFDM modulation. I am reading this from a tutorial. In one of its parts, for showing amplitude variation of the OFDM signals, there is a graph that has used 8 sub-carriers and BPSK modulation as below: Now I have faced to this question, that we are using OFDM modulation here, so why we have used BPSK modulation? Do we double modulate the signal? I cannot understand the use of BPSK in this example. Any help? AI: OFDM isn't a modulation technique. It stands for "Orthogonal frequency-division multiplexing" and is a way of splitting the spectrum into discrete channels for sending data. Each of those channels, which is just a single frequency carrier in its own right, requires the data to be modulated onto it. In this example BPSK is used.
H: Why does oscilloscope still shows the signal even though its GND is not connected? if i connect oscilloscop's + probe to the components's plus side it still shows the signal. But how can this happen without connecting the GND ? AI: In most cases the o'scope ground is connected to the mains earth, and your circuit's ground too, so there is a ground connection. If either ground is not thus connected there is still a relatively large capacitive coupling.
H: Using a MOSFET or BJT instead of solenoid I'm trying to convert all relays and solenoids to transistors in a circuit to make it solid state. I have a small (150cc) 12V DC starter motor that is currently turned on by a small transistor turning on a solenoid, but now I want to use a larger transistor to be able to do the solenoid's work. Would there be anything wrong in doing this? I realize I need to measure the motor's current draw while it is under load to pick an appropriate sized transistor. If this would work, would you recommend a MOSFET instead of a BJT for this application? I should also put a 1N4007 flyback diode on the motor's terminals as well, correct? Thank you for your input. AI: A MOSFET may be a better choice for the following reasons: Today's power MOSFETs are amazing devices with options for extremely low ON resistance and quite high current capacity. The MOSFET uses a voltage control input which can be easier to drive in a high speed manner to reduce switching time loss in the device. There are even devices commonly referred to as Smart FETs that have built in gate drivers and fault control circuitry. Deploying these devices simplifies the driving aspects and helps to protect the high current FET device from overloads.
H: Analyzing input/output characteristics of a diode circuit In "Fundamentals of Microelectronics" textbook. The question number 27 of chapter 3 is: The part b of the question is: And the solution of b from the solution manual of this textbook is: Can anyone explain simply how did he got the solution ? AI: Assume the input voltage starts at 0 and then slowly increases. For all positive input voltages, D2 will be off and can be ignored. Until D1 turns on, the circuit is a simple voltage divider so the output is R2/(R1+R2) times the input voltage. When the voltage across D1 rises to its turn on voltage, it will turn on and short R2. Thus from that point on the output voltage equals the input voltage (a slope of 1) with an offset equal to the D1 turn on voltage. At what input voltage does D1 reach its turn on voltage? When R1/(R1+R2) times the input voltage reaches the D1 turn on voltage. That is given by (R1+R2)/R2 times the D1 turn on voltage (R1 and R2 act as a voltage divider but now the voltage of interest is across R1). This explains the positive half of the graph. The negative half is done in a similar fashion. In this case, D1 will never turn on and can be ignored. For small negative voltages, the slope will be the same as for small positive voltages since both diodes are off (R1/(R1+R2). When the negative voltage rises enough to turn on D2, the output will remain at the D2 turn on voltage since D2 is now acting as a battery across the output terminals. At what input voltage does D2 turn on? When the output voltage reaches its turn on voltage, i.e. when R2/(R1+R2) times the input voltage reaches the D2 turn on voltage. That voltage is given by -(R1+R2)/R2 times the D2 turn on voltage.
H: How will the diode act after its junction is penetrated? Above is a circuit diagram with 2 sources V1 and V2, a switch SW, a diode D1 and a resistor R1. The points X,Y,A,B,C,D,E,F are terminals of the components indicated with red dots. If the switch is OPEN as in the figure, the diode D1 is reverse biased and no current will flow. Lets say the switch is closed(SW CLOSED) and opened in a very short amount of time which is enough to penetrate the p-n junction so that V1-V2 = 10V is applied in that duration to the ends of diode and the diode is forward biased for that short time. And then lets assume suddenly the switch is opened(SW OPEN) again and kept always opened from then on. Here is my question: Will the p-n junction remain penetrated and will a current flow through the points C,B,A,D,E,F in order? Or will it block the current since it looks like it is conencted as reverse biased? AI: A diode has a limited bandwidth, reversing voltage will take time to react. However it is not that big current is flowing in the opposite direction, it is more like the capacitance of the diode is charging in this time, limiting the bandwidth. The story about the DC motor switching is just that the charge within the inductor of the motor needs to go somewhere, the current can not be suddenly stopped. If you do not use the diode the voltage will peak because of the inductance of the motor possibly blowing the transistor. Because of the diode the charge of the motor inductance will be "shortcircuited" over the motor-coil itself and the voltage will just ripple a little.
H: Inverted PWM with ATTiny10 On a 10MHz ATTiny10, the following code generates the same 40kHz 50% duty PWM on both pins 0 and 1: DDRB = (1 << PB0) | (1 << PB1); //Output on PB0 and PB1 TCCR0A = (1 << COM0A0) | (1 << COM0B0); //Toggle OC0A and OC0B on compare match TCCR0B = (1 << CS00) | (1 << WGM02); //Clear on compare, use unscaled clock OCR0A = (1000000L /40000 / 2) - 1; //Overflow twice per 40kHz period OCR0B = (1000000L /40000 / 2) - 1; //Overflow twice per 40kHz period I want pin 1 to be exactly inverted: both pins should be PWM 40kHz 50% duty, but inverted of each other. How can I achieve that? AI: Use wavegen mode 14, set COM0Ax to 0b10 and COM0Bx to 0b11, and adjust ICR0, OCR0A, and OCR0B to give 40kHz 50% DC.
H: Calculate Paging System I have this problem to solve and I have the answers, but I'm trying to understand the concepts behind it. A paging system has the following parameters: 2^32 bytes of physical memory; page size of 2^10 bytes; 2^16 pages of logical address space. 1. How many bits are in a logical address? 26 bits 2. How many bytes are in a frame? (?) 3. How many bits are in the physical address specifying the frame? 22 bits 4. How many entries in the page table? 2^16 5. How many bits in each page table entry? Assume each page table entry contains a valid/invalid bit. 23 bits AI: Ok, let's break it down: Physical: 232 Page Size: 210 Number of Pages: 216 How many bits in a logical address? That's the page address bits plus the number of pages bits. The upper portion of an address is the page number (16 bits), and the lower portion is the offset within that address (10 bits), so the whole address size is 26 bits (1026 bytes). How many bytes are in a frame? A frame is where a page can be mapped into memory, so a frame has to be the same size as a page - 210 bytes. How many bits are in the physical address specifying the frame? Well, you have 32 bits of physical address, and a frame is 210 big, so that leaves 22 of the bits (32 - 10) for the frame's base address. How many entries in the page table? The page table is the full list of pages, whether mapped or unmapped - so there are 216 entries in the page table, since there are 216 pages. How many bits in each page table entry? Assume each page table entry contains a valid/invalid bit. If each page maps to an entry in the page table, and that table is a list of the addresses at which the pages are mapped in physical memory, then each address in the table must be the size of answer 3 (22 bits) plus one bit for the valid/invalid bit, so 23 bits. Is that clearer?
H: Controlling an RGB 5050 LED strip with Arduino and potentiometers I recently found and old amplifier with the speaker taken out of it and thought it would look nice as a light feature. The switches and potentiometers are still in place but have removed the power supply. After finding this project from MAKE Magazine (http://makezine.com/projects/android-arduino-led-strip-lights) I was wondering instead of using an android device to control the LED strip, if I could possibly re-purpose the pots already on the amp box to control the LED's. Possibly one pot for each channel such as R G B. Is there a way to do this? And if so, what would the code be? Any help or tips are appreciated :) AI: This is doable and quite a simple task, very well suited for a beginner. You should work out the details and write the code yourself, or you won't learn anything. Adafruit has a good tutorial on how to do the "dimming" of the individual colors. Use an n-channel MOSFET instead of a BJT. The used technique is called PWM. The Arduino software does the hard work for you, all you have to do is call the AnalogWrite function from your code. The Adafruit page has some sample code too. Then you need to "read" the values of the potentiometers. You can use the analog pins of the Arduino and the AnalogRead function for that. Again, Adafruit has a nice tutorial, that shows how to hook it up. Now you just have to figure out how to combine this into one script. It isn't very hard if you understand the individual parts. You'll shortly find out that controlling R, G and B individually isn't very interesting. In general the resulting color will be hard to predict (for a human) and good looking transitions difficult to make. I suggest you treat the potentiometers as HSV input (a different color representation than RGB), it is much more natural in many aspects. Converting from HSV to RGB is a matter of a few calculation steps, but you'll find plenty of implementations on the internet (e.g. this).
H: Which diode to use on my RC switch debounce circuit? I am choosing parts to build an analog RC switch debounce circuit. I plan to implement the circuit described here: http://www.ganssle.com/debouncing-pt2.htm (see "An RC Debouncer"). (source: ganssle.com) These are the other parts I plan to use for the circuit: Voltage supply: generic AC/DC wall wort adapter, output 5.0V DC 1A R1: 82K, 2W - http://www.digikey.ca/product-detail/en/PR02000208202JR500/PPC82KW-2CT-ND/597440 R2: 18K, 2W - http://www.digikey.ca/product-detail/en/PR02000201802JR500/PPC18KW-2CT-ND/597334 C: 1 µF - http://www.digikey.ca/product-detail/en/FK24X7R1H105K/445-8517-ND/2815447 Schmitt Trigger: 74AHCT14 - http://www.digikey.ca/product-detail/en/SN74AHCT14DR/296-1474-1-ND/404972 Switch: http://www.digikey.ca/product-detail/en/40-2390-00/506PB-ND/185671 What part should I buy for the diode? (Also, please point out any other mistakes I've made if you come across them -- my first time building a circuit. :3 I'm interested to see if it's a mistake to use a 1A AC/DC adapter or if my 2W resisters are correct for this circuit...) AI: Use a 1N4148 for the diode, assuming through-hole. For the resistors, 1/4 W is more than adequate. The power dissipation is 25/82K = 0.3mW if you hold the switch down. The adapter should be fine if it outputs 5V with no load (most will).
H: What is the need for a pull-down resistor in this schematic? here at the second page: http://www.skyeinstruments.info/index_htm_files/W200P%20Windvane.pdf there is an external 470k resistor in parallel with the measuring device. it seems like the manufacturer wants users to connect this before measuring. but doesnt data acquisition boards and other measuring devices have already huge input impedance? what is this resistor for? AI: [This does not contradict what EMFields wrote above. This is just another point of view.] The purpose of the pull-down resistor is to give the output a known state when the wiper is in the gap located at the North. Have a look at the figures from p.2 in the datasheet. Assume that the wiper is at NW. The output would be around 90%. Now assume that the wiper is turning clockwise from NW. The output will be growing. Then the output will reach 100% when it reaches the point T1 on the circuit, which is at 358.25°. The output will stay at 100% as the wiper keeps going clockwise between 358.25° and 358.85° . At 358.85°, the wiper becomes an open circuit. If there is no pull-down (or pull-up), the output would be floating. It would act like an antenna for interference an leakages. The reading is unstable. The measuring equipment may even see 2.5V because of leakages and think that the vane is pointing South while it's actually pointing North. So, the pull-down gives the output a determined state when potentiometer is open circuit. Why 470kΩ ? I think, it's a ballpark number, and it's driven by a compromise. On one hand, you'd like a strong pull-down to reduce the effects of interference. Strong pull-down means smaller resistance value. On the other hand, the pull-down is in parallel with the lower leg of the potentiometer, and it's introducing non-linearity into the measurement. So, a weak pull-down is desired. Weak pull-down means larger resistance value.