text
stringlengths
83
79.5k
H: Where does the power absorbed of this capacitor come from? In my circuits book, the voltage across a capacitor is given as \$v(t)=100\cos({2\pi60t})\$. Because \$i_{ab}=C\frac{d}{dt}v_{ab}\$, we naturally compute the current as \$i(t)=-120\pi\sin({2\pi60t})\$. The book concurs. It is easy to understand that for any given two-terminal component, \$p=vi\$, or in this case, \$p(t)=v(t)i(t)\$. However, the book gives the answer to \$p(t)\$ as \$-18,850\sin({2\pi120t})\$. However, WolframAlpha gives the link as \$-6000\pi^2sin(240\pi t)\$. I have no idea where \$\pi\$ dissapears off to. I have no idea where \$18,850\$ comes from. I would be most grateful to anyone who could get me out of this jam. AI: You have $$p(t)=v(t)i(t)=-100\cdot120\pi\sin(2\pi 60t)\cos(2\pi 60t)= -50\cdot 120\pi\sin(4\pi 60t)=\\=-6000\pi\sin(240\pi t)=-18850\sin(240\pi t)$$ I think you entered one factor of \$\pi\$ too many in WolframAlpha. Note that I used \$2\sin(x)\cos(x)=2\sin(2x)\$.
H: Pressure gauge with analog output I have a circuit that needs to electrically output a pressure value and display it using analog dial gauge. First I wanted to use regular round ammeters but they don't look like "real" pressure gaugeish. Have a look to get an idea about what I mean Needle in a pressure gauges is usually mounted in the center and have a much more wider travel sector. The best I can think of is to get an auto tachometer, print a new dial face with pressure scale and remove all unnecessary control electronics from the tachometer leaving only galvanometer and a precision resistor inside. Then I plan to drive it with PWM. There is another type of tacho that uses a small stepper inside. This should be also fairly simple to drive. I don't want to reinvent the wheel, so want to ask if anybody knows about a product that does exactly same job, i.e. pressure gauge simulator? AI: If you haven't already decided on which pressure transducer you want to use, chances are you can find a manufacturer who can fix you up with something sporting a pressure range and a remote readout that suits you. If not, there are lots of nice analog panel meters around with dial faces you could modify and with their pointers rotating about the center of their dial faces like you want, like the one below,say, and a few more here
H: How can an input signal to an FPGA be determined as the clock signal? How can I determine a seemingly arbitrary signal applied to an FPGA to be the clock signal? Conditions: 1. There is no other clock signal available (as an input to the FPGA) for sampling this input.2. Assume, this should be the highest speed clock. 3. The source of this signal can be anything, can be generated elsewhere in the circuit and then applied to the FPGA or can be generated only for this block. (In my opinion, the source does not matter.) AI: This is rather like asking "how do identify which electrical potential is the ground". Both "ground" and "clock" are designations rather than physical properties. You choose a signal and use it as the clock. Now, there are various properties of signals usually used as clocks which a human using a scope would use to identify a clock. High frequency square wave with 50% duty cycle and no modulation or variation? Looks like a clock. You could automate that check if you had another reference clock to sample the signal with. But there's no strict requirement for those, provided the edges are clean and minimum pulse widths are met. You could have strange duty cycles or very slow clocks; clocking microcontrollers off 32kHz signals in semi-sleep mode is sometimes done. Not all systems have a minimum clock frequency. Some very old systems had handcranks which could be used to generate clock pulses, allowing the operator to single-step a program for debugging.
H: Generate 10A for stress testing How could I, a cheapskate hobbyist, generate large currents around 8–10 Amps to run through a short circuit? That is, the objective is to stress test a very low-resistance circuit going through relays, wires, and connectors, all rated for 10 A / 250 V or more. For example, would it be feasible to build a high-current, low-voltage switch-mode supply? The load circuit's total resistance will be less than 1 Ω — hopefully a lot less, since at 10 A that would still consume 100 Watts. I know that people have rewound transformers for huge currents and tiny voltages to melt metallic objects, but that seems hard to do and to control (though I suppose a dimmer on the primary side would do it). I realised that I could just power a toaster, hot air gun, etc. from mains through the circuit. I would first measure a suitable combination using a power meter, so that the load is e.g. 2300 W when I want 10 A (at 230 V). But this will make noise and heat up my home, so the testing would have to be relatively short-lived. I'd still be interested in a more elegant, laboratory-style solution :-) AI: Yes, it's feasible to make such a supply. In my experience bench switching supplies don't like to output less than a volt or two, but such a supply could be designed. A faster, and probably cheaper, approach might be to repurpose a cheap PC power supply. A $15 supply would likely be able to output 15A on the 3.3V or 5V rail, so if you add a series resistor you can get a more-or-less constant current. The PC supply provides isolation for safety, so even if you made your own supply it would be a convenient place to start.. You have to ground a wire to get the supply to start and to provide some load (10W resistor) on the 5V rail - do a search for details. If you use a chassis-mount 0.33Ω or 0.5Ω 50W resistor that will cost about $5 so total cost could be under $20 especially if you scavenge the supply. Be sure to bolt the resistor to a suitable chunk of metal to act as a heat sink, perhaps using a small 12V fan powered from the PC supply. If you are dead set on making a SMPS for whatever reason, I suggest you start as above, but use the 12V output and a decent controller chip such as an LT3800 which uses external transistors. It's not as easy as it looks, and it doesn't look all that easy. If you add a 0.12 ohm 15W sense resistor it can be coerced into outputting 10A constant current, but add a diode and resistor to keep the output voltage from getting too high with no load. With a few more parts to shift the feedback voltage upward, the sense resistor could be reduced to a smaller, lower power, part. If the latter makes no sense to you, there will probably be difficulties (many ruined parts) in getting this to work. 10A is a fairly high current and even small inductances can cause problems.
H: Output of Inverting opamp with single supply I have the following circuit I'm looking into (it's actually a section of a larger design) simulate this circuit – Schematic created using CircuitLab V1 has an input range of 0 to 4V. Vout I suspect, would be 0V for the entire duration. However, when I simulate both here and using LTSPICE, I get a non zero answer. I am unsure as to why. It would seem that I am in fault since two simulations do not give me a non zero answer(although the simulation done here and on LTSPICE are also different from each other) and this circuit is "known" to work. What am I missing ? edit Updated schematic with R3. AI: This is actually a useful circuit- for low frequencies it acts as a precision rectifier. For inputs < 0V, the output is -0.5*Vin For inputs > 0V, the output is +0.5*Vin (if loaded with a 15K resistor to ground or a virtual ground, which I suspect your inverting stage has-- 15K and 30K to yield an output voltage of -|Vin|). Edit: You always get a positive output voltage from this circuit fragment. The 15K you mention is just to allow the op-amp to swing very close to the negative rail (ground). If the input voltage is less than zero, it acts as an inverting amplifier, the op-amp output drives the diode anode to a voltage equal to -0.5*Vin (the op-amp output itself will be a bit higher to account for the diode drop). If the input voltage is greater than zero, the op-amp saturates at the negative rail (ground) the diode is reverse biased, and the circuit looks like a 15K resistor. Hence, if you load it with 15K it will have an output of 0.5*Vin (voltage divider). In the below top schematic, the shown (different) Vout = -|Vin|. Of course the second op-amp requires a negative supply, but the first one does not. In the below bottom schematic, Vout = +|Vin| and neither op-amp requires a negative supply. simulate this circuit – Schematic created using CircuitLab
H: Can I turn Radio waves into light? Wikipedia says that the frequency of light is 300 THz. I've made a radio waves transmitter that transmits about 100 MHz. If I increase the frequency of the transmitter to 300 THz, will the antenna produce spark or light ? Can I do this circuit practically o_O ? Is there any transistor or IC that can oscillate 300 THz ? Can I find an inductance ( coil ) of 0.0025 pH and capacitor of 1 pF ? I know that it is a science fiction question but please, don't make fun of me :) AI: 300THz transmitter? (the band between infra red and microwaves) - with a lot of technology and know how perhaps. See http://www.rpi.edu/terahertz/about_us.html 300THz transistor/IC - no. Use discrete inductors and capacitors at these frequencies? No. At very high frequencies conventional capacitors and inductors are replaced by other devices (see resonant cavities) In theory there is only one basic difference between a 'photon' of radio waves, light waves, far infra red waves, microwaves, ultra violet waves, x-rays etc. and that difference is the energy the photon. This energy can be calculated using the simple formula: E = hf where E = energy in joules, h = Planck' constant (6.626 × 10−34 J·s) and f is the frequency of the photon. If you crunch the numbers you will see that the photonic energy of a radiowave is millions of times smaller than that of a visible light photon. Light emitting 'transmitters' (into optical devices) use electrons jumping from one energy level to another rather than using a 'tuned circuit'. It turns out that the energy gap is just the right amount to give a visible light photon. There is no 'one technology fits all' that can produce photons of different frequencies (energies) across the entire spectrum. Even solid state devices become more exotic as you demand higher and higher frequencies and circuit boards start take on the appearance of complex plumbing. Can it be done? Perhaps. New developments in nanotechnology may well produce a single device capable of converting the energy from radio wave photons into TeraHertz , infra red or visible light photons etc.. They've already developed nanotube transmitters and receivers using graphene. see http://berkeley.edu/news/media/releases/2007/10/31_NanoRadio.shtml Unfortunately my crystal ball is on the fritz at the moment so I can't see in the future.
H: tlc5947 LED driver without constantly occupying uC pins I am working on TLC5947 chip to control 24 RGB Leds to create different patterns with them. My concern is, I have to keep giving command to SIN, SCLK, XLAT pin of microcontroller every loop to keep my pattern repeating again and again. My microcontroller is also doing other stuff, like talking with sensors, controlling external peripherals etc. Wanted to know if there is any way/hack in hardware/ software by which I can repeat the sequence using LED driver IC while keeping my micro-controller unoccupied? AI: The usual way to handle this sort of thing is with a periodic timer interrupt. Say your loop needs to repeat every 50msec, set up a hardware timer to interrupt the processor, do your display update and return from the ISR (Interrupt Service Routine). If your current coding style includes wasting zillions of cycles in delay loops, it gets rid of that. Chances are you're using fast hardware SPI to talk to the chip, so cranking out 72 bits of on/off data won't take long, maybe < 100usec, so with a 50ms interrupt, 99.8% of your processor bandwidth is still available (virtually 'unoccupied' for practical purposes) To the "other stuff" that you are doing, your processor looks to be somewhat (depending on how much time your ISR takes) slower and a bit more jerky in its operation (it goes away for a bit at times). It's usually not too difficult to code for that.
H: Electronic component for tapping I'm in need of electronic component that is able to be tapping, giving a type of massage on the skin. I did some search and can't find anything that is as big as the tip of the finger with the nail. Do you know about something? I'm thinking of using some type of ATTiny controller to control the rhythm and the sequences. I was thinking of some electromagnetic type of a pump or servo that could be used but didn't find anything. Thanks a lot. AI: One very useful keyword/phrase you could use for searches is "haptic actuator". Haptics includes both vibration motors and resonant actuators used for tactile feedback. This is a good TI application note on it. From the same supplier, a typical pager motor:
H: How does this construct drive the RESET pin low? I've seen this in a bunch of ATMega / Arduino reference designs: The RESET pin is pulled up high with R10, pulled low with a switch (S1), but then tied to the DTR line from a UART breakout via C27 - a small capacitor. This last bit is how the Arduino bootloader triggers the reset, but what's actually happening here? How does DTR going low translate to the pin triggering? AI: The LOW signal on the DTR creates a potential difference of around 5V between the two sides of the capacitor. This allows the capacitor to charge up. It does so through the 10KΩ resistor. The capacitor starts empty, so the voltage is seen as 0V on the RESET pin. That rapidly rises back up to 5V at a rate of \$R×C\$ (that is the time taken to charge up to 63.2% of full), so \$10000×0.0000001 = 0.001s\$ or 1ms. When the DTR line goes HIGH again it then creates another pulse in the opposite direction (going higher than high) which gets absorbed by the internal ESD diodes in the chip. Here's a simulation:
H: Ball Tracking, possibly with BLE I'd like to track a ball during a game using wristbands on players and a chip in the ball. I'd like the type of ranging given by Bluetooth low energy (immediate, near, mid, far) so that I can tell post-game who had the ball at a given time. If BLE is the right solution I'm trying to figure out how chips would exchange the ranging distance. Would the chip in the ball need to be smart-ready (dual mode)? The phone would be on the sideline, so it can't be the in-game tracker of the ranges. AI: I've done some experimentation with BLE range sensing and I've found that it is not very accurate. It is based on RSSI - a received signal strength indication - and the received signal strength is affected by a lot of things apart from distance. For example, putting a BLE device into your pocket so that some of the RF energy is absorbed by your body causes a similar decrease in RSSI as moving it 10 meters away in free space. Also the radiation pattern from a device is not even in all directions, so 3 meters in one direction may give the same rssi as 8 meters in another, etc. One way that this is got around in beacon type applications is in taking several readings over time and taking an average. This is not ideal in your case as you need fairly instant results. One of the ways in which low-energy is achieved in BLE is by not communicating very often. I.e. a peripheral device may communicate with a central device only once a second or so. This is what gives keyring type devices that can be on for a year. You get to choose these intervals when you design a system so in your case you can probably have a shorter interval and turn the devices off when no one is playing. BLE works as a hub-and-spoke type network where devices are either a central or a peripheral. A peripheral can establish a link to only one central (but broadcast packets from a peripheral may be received and ranged by any central). Ranging is from each peripheral to the central. You don't need a dual mode chip in a BLE system, you can have an entirely BLE implementation. Common embedded BLE chipsets (Nordic Semiconductor, TI, CSR) can all operate in central or peripheral mode. I'd be tempted to use a simpler ranging system between your wristbands and your ball. Maybe iR, ultrasonic or other radio techonolgy would do the job. You could interface this to a BLE device and use that to communicate scores, who has the ball to a smart phone
H: Capacitor leakage and design for low energy battery powered devices For the design of a portable battery operated device, I have some power circuitry which requires a DC-DC converter and some other regulators, battery charger IC etc. While in the process of selecting capacitors for the power system design, I noticed some leakage currents which were quite high, such as 220 micro Amps. If my battery is exposed to this kind of leakage current constantly, I'm sure there will be storage/long term usage issues. What capacitor chemistry/types do you guys use for battery operated devices, but still for use in power filtering/supply roles? The battery charger IC has reverse blocking diodes/FETs built it, so I can assume that on the input side (external power input) it's okay for leaky capacitors. What do I do about the battery-side of the system? Rely on ceramic capacitors? The sort of parameters I was looking for were 16-20V rated (for the input side) and 6.3V rated for the DC-DC converter output, and ripple current ratings up to 1A AI: Ceramics are usually the first choice for capacitors. One of their several advantages is very low leakage. The only reason not to use ceramics is if you need so much capacitance that they would take up too much space or cost too much. At 16-20 V, you can get 10s of µF from ceramics. If that's enough, there is no reason to look further. If not enough, first try paralleling a few, then try specifically designing the circuit to require less capacitance. If none of those work, then you probably need to use electrolytics and live with the higher leakage current. Note that leakage is probably specified at the worst condition, which will be highest voltage and highest temperature. Maybe the datasheet will tell you what leakage is at lower temperature, but you may have to contact a application engineer from the company to get definative specs. That's probably a good idea anyway, as they may be able to suggest other things you can do to minimize leakage. Again though, the first reaction should be to solve the problem with ceramic capacitors.
H: Correlation and filtering I am trying to get an understanding of white noise and how it can be filtered out, etc. For that I'd like to understand correlation. What would the autocorrelation of white noise look like? If I am not mistaken, it should look like a delta function at t=0 since at all other values there is no correlation at all. Is this correct? What about when this is added to a signal. Say you have a sine wave and you add white noise. What would happen if you autocorrelate this signal? Would the noise disappear or would it just stay the same or what? And what if you simply cross-correlated a white noise signal with a sinusoid. Would the correlation always be zero? How is the phase affected? And finally, the main question this all builds up to: How is correlation used to filter out noise from a signal? What has to be known about the signal for this method to work? AI: What would the autocorrelation of white noise look like? If I am not mistaken, it should look like a delta function at t=0 since at all other values there is no correlation at all. Is this correct? This is correct. Of course if you calculate the autocorrelation from samples taken over a non-inifinite time span the mean will be 0 for \$t \ne 0\$, but will be some noise in the output. What about when this is added to a signal. Say you have a sine wave and you add white noise. What would happen if you autocorrelate this signal? Would the noise disappear or would it just stay the same or what? I'm not 100% sure of this, but I believe autocorrelation is a linear process. So you would get an output that is the sum of the autocorrelations of the noise and the sine wave taken individually. This would be a delta at t=0 due to the noise, plus a \$\pi/2\$ shifted sine wave due to the sinusoid. Again there would be artifacts if you don't have an inifinite span of samples to calculate from. And what if you simply cross-correlated a white noise signal with a sinusoid. Would the correlation always be zero? How is the phase affected? The cross-correlation would be zero. I'm not sure what you mean about the phase. What is the phase of zero?
H: Noisy Voltage Rails (Vcc, Gnd) - Noise Isolation for Automotive Circuit I have an audio (mic, speaker) circuit that I am currently powering off of a 12V car adapter that is fed into a 10V switching DC regulator to power the rest of the circuit. I have noticed a horrendous amount of noise on the mics and speakers when running off of this circuit, even with the appropriate bypass capacitors from Vcc to Gnd in place, carefully tuning the DC-DC switching converter (buck-boost), and so on. After breaking out my oscilloscope, it seems there is a lot of noise on the Vcc and Gnd rails that affects the entire circuit, and the noise is not present when I swap out the 12V car power source for an external 12V battery solution. What would be the best approach to eliminating this noise source entirely? I am already providing a regulated power output, but it seems that the noise on Gnd is impacting everything else in the circuit, even with a regulated power source. I could create a separate Gnd for the rest of the circuit, but am not certain as to how this would work with my switching power supply if it doesn't share the same Gnd as the circuit it powers. I have also considered using a flyback regulator, as it isolates the circuit it supplies via a transformer, but I'm not 100% sure if this will resolve the case of a noisy external Gnd. Thank you. AI: Automotive power is one of the more notoriously annoying sources of noise there is. You need to imagine a lot of high voltage, high frequency spikes happening on the power, this couples and radiates into your set-up, where up-flanks can be so fast and strong they couple into your VCC through your converter, as the converter has only a certain amount of noise rejection. The down flanks can push so hard they will show up in the ground you see at your device. And even more complex annoyances to do with coupling and propagation of noise sources. The only way to get rid of those and know exactly why you do what you do is to look for a tutorial about automotive power noise filtering and seeing which of the explained steps you have not yet taken yourself. But a good start would be to include a common-mode input filter coil on the entirety of your power that's rated for automotive filtering. Many inductor factories make them, I like Würth Electronic, but that's also because they have a very permissive sampling regimen. After that, obviously you put a nice strong capacitor: Capacitance able to provide the current needed to your circuit for about 1ms of full drop-out and low ESR to get out as much noise as possible. You may also put an input diode onto the system to protect even better against full "disappearance" of power for about 1ms, so that you don't power other stuff from "your personal capacitor". After that capacitor you can add another inductance on the positive rail, followed by the input capacitance required for your regulator. Edit1: Schematic coming up to clarify... Edit2: Sorry, forgot to save the edit once I was done calling :-S simulate this circuit – Schematic created using CircuitLab
H: What determines the maximum rotational speed of a hard disk drive? Through my background research I understand that the limit on the rotation of a hdd is largely the product of heat and the specs of the physical disk, but I am puzzled by the round numbers advertised for speed. In other words, why do speeds jump from 4200rpm to 5400rpm to 7200rpm and then 10000rpm? What is it about these numbers? Why not go from 5400rpm to 6600rpm? It seems like companies competing to be the fastest would be happy to advertise even incremental 100rpm bumps. AI: Disk drive rotation speed is only one of several properties which determine disk performance. The seek speed of the heads, and the number of bits on a track that can be written or read, are also very important. Further, there is a chain of systems which need to be optimised. Specifically the host disk drive interface and Operating System (OS). I think rotation speed is somewhat historical; disk drive speeds were set a very long time ago. I remember we bought a 10,000rpm disk for a PC in the mid '90's, when technology costs were quite different. I suspect that those disk speeds are retained for reasonable reasons. Those numbers are rpm, revs/minute. Convert them to revs/second: 4,200rpm = 70rps 5,400rpm = 90rps 7,200rpm = 120rps 10,000rpm = 166.7rps * 15,000rpm = 250rps Those numbers largely look quite simple, round numbers except one. With quite a significant improvement from one to the next. A disk drive rotation speed determines rotational latency, how long it'll take on average before a block can be read. The faster the better. However, it also translates to the speed that data can be read or written through the disk drive hardware interface. I think it makes sense to have a relatively small number of different transfer speeds to ensure the host disk drive interface can 'keep up' reliably and isn't too expensive. Also, the disk's electronics must support the data transfer speed. If that is the case, then a small speed bump on rotational speed isn't helpful. Either the data isn't read or written any quicker (so the host disk drive interface is okay), in which case the recording density is lower than a slower disk. A slightly faster disk stores less data per track. That seems like a poor product offering for a small improvement in latency. Or the data is read and written more quickly, so the machine needs a faster host disk drive interface. It makes sense to only offer a few different disk dive interfaces, with a small number of tested, guaranteed speed ranges. If I were a host disk drive interface manufacturer, I would prefer to test at a few specific speeds, and guarantee those, rather than test every different disk speed possible. So a small speed bump may require a more expensive disk drive interface, and it may also need a way to 'squirt' the data out faster than it read it. So for a small speed bump, either the electronics seems to have gotten more expensive, or the disk stores less data. Neither seems like a useful product. Worse, in the 'olden days' the operating system was fully responsible for deciding where a file's disk blocks went, in order to get maximum performance. The OS might not lay down blocks on a track sequentially, which would give the highest speed write or read. Instead it might have a block gap, or even interleave a files blocks within a track so that the CPU had time to deal with the application reading or writing a file. Having a small number of disk speeds would make it simpler for the OS designer to measure and optimise performance. *) The obvious round number for 160rps is 9,600, but that looks a lot like a common baud rate, so marketing probably want to avoid that, and 10,000 looks so much better :-)
H: Why is the + sign commonly used as logic OR operator? A few days ago I was asked, why it is pretty common to use the + instead of the v symbol as the boolean OR operator in digital logic. His argument was, that it is totally counter intuitive to use + for OR, because it is more likely to be interpreted as AND from general usage/context. From Wiki: In logic and mathematics, or is a truth-functional operator also known as (inclusive) disjunction and alternation. The logical connective that represents this operator is also known as "or", and typically written as v or +. I did some research and came up with the origin of the v sign. It comes from the Latin word "vel", which means "or". One thing that adds up to the confusing nature is, that + means 'and' from a historical standpoint. According to this and this it was invented around 1360 as and abbreviation for Latin "et" ("and") resembling the plus sign. However, I have no clue who came up with + in the boolean algebra and why it seems to be preferred to the v in digital logic / engineering context. AI: One word: Distributivity Multiplication is distributive over addition, and so is logical AND distributive over logical OR. On the other hand, multiplication is often used without a symbol (2a instead of 2*a), and logical AND is very similar. If both A and B must be true, it's simple and intuitive to write AB. It is very handy in constructing truth tables and algorithms based on them. $$f = A + BC$$ even someone with little experience will notice at first glance, that f can occur when A is true, or when both B and C are true. Compare it with $$f = A \vee B \wedge C$$ If you don't use this for a few days, you'll have to wonder again, was v the OR and ^ the AND, or vice versa? Even if you don't forget them, it's much clearer and easier to read if you just use multiplication and addition symbols, especially as they cannot be confused. In boolean logic there is no addition or multiplication, so their symbols can be re-used. The fact that 1 * 0 = 0 and 1 + 0 = 1 and in boolean algebra we have chosen 1 to mean true and 0 to mean false also helps identifying which operator is which. Symbols in mathematics are just that: symbols. They have a meaning because we assigned a meaning to them, so it's better if we choose symbols which can easily be remembered and their usage in other fields are similar.
H: How do I simulate a physical push button from an AVR I've been messing a bit with EL wire that I purchased from amazon, I dissected the control unit and it appears to consist of a transformer, timing circuits(s) and a push button. When you push the button it toggles through the different modes (solid, blink, blink fast). I want to try and control the wire in a very basic manner from an arduino. I simply want to toggle through the different states. How would I apply voltage or PWM across the contacts of the pushbutton to simulate a push AI: The closest thing to simulating a real push button would be to use a reed relay, such as these. This particular one with a 5v coil voltage is available from Digi-Key for $1.10; there are others available with 3.3v coil voltages. The advantage of using a reed relay, is you just wire the contacts in parallel with the original push button, and don't have to worry about how it fits in with the rest of circuit. The following circuit can be used to drive the relay: The wire on the left (going into the base resistor R2) comes from the AVR output pin. The pull-down resistor R1 keeps the transistor off in case the output pin on the AVR is put into an high-impedance state (e.g. when the microcontroller is reset).
H: Excessively high temperature reading with LM35 I am really new to electronics and I am just experimenting at the moment with a breadboard. My question here is related to the LM35 temperature sensor and Arduino micro controller. I am getting a very high reading through the sensor of 448 degrees Celsius. Obviously this is way off. The conversion formula I am using is: inputvoltage = (5.0*inputvoltage*100.0)/1024.0; I am feeding 5V into the sensor from the Arduino and I am getting a 0.50 voltage reading on my multimeter between 5V in and output. Do you think the sensor might be faulty? Any help on this issue would be great! EDIT: Some people have asked for my code from the arduino so here it is: int tempPin = 0; void setup() { Serial.begin(9600); } void loop() { float temp = (5.0 * analogRead(tempPin) * 100.0) / 1024; Serial.print(temp,1); Serial.println(" degrees C "); delay(1000); } This schematic shows the really simple configuration I have. I have added a picture of my setup if anybody can spot something I can't. AI: 4.15V from Vout to GND with short wires and 5V supply is totally wrong. Either you have the connections wrong or the LM35 is toast. Please double-check the connection vs. the datasheet. I suspect just because of that particular voltage reading that you may have the connections mixed up. Edit: Thanks for the photo. Looking at the part from the front (the part with the markings) from left to right, the pin order is: Vs, Vout, GND = +5, Vout, GND In your photo I see +5, Vout, GND as it should be. So it it's reading more than 10mV/°C at Vout with the blue wire disconnected from the Arduino (and 5V/0V on the orange and black wires respectively) I would say it's dead. Perhaps the power got momentarily reversed on it?
H: S parameters of a capacitor I am struggling to understand S parameters. As an example, I am considering the S matrix of a capacitor in series with a transmission line. It has two ports, so must be represented by 2x2 matrix. But the form of this matrix eludes me. I thought I could deduce it from the reflection coefficient, giving $$ S=\left( \begin{array}{cc} \frac{Z-Z_0}{Z+Z_0} & 1-\frac{Z-Z_0}{Z+Z_0}\\ 1-\frac{Z-Z_0}{Z+Z_0} & \frac{Z-Z_0}{Z+Z_0}\\ \end{array} \right) $$ where \$Z=1/i \omega C\$, but this doesn't seem to give the right answers. Is this correct? Or have I misunderstood the concept? AI: When calculating the S-parameters, you should terminate all of the ports that don't have stimulus applied. So, in your situation, to calculate \$S_{11}\$ and \$S_{21}\$, you'd be working with this circuit: simulate this circuit – Schematic created using CircuitLab Notice that the current passing through the capacitor from port 1 to port 2 is \$i_1\$ and \$-i_2\$ at the same time. Now you can easily calculate \$i_1\$ and \$i_2\$ using the series impedance rule: $$i_1 = -i_2 = \frac{v_s}{2Z_0+1/j\omega{}C}$$ And you can also calculate \$v_1\$ and \$v_2\$ using the voltage divider rule, $$v_1 = \frac{Z_0+1/j\omega{}C}{2Z_0+1/j\omega{}C}v_s$$ $$v_2 = \frac{Z_0}{2Z_0+1/j\omega{}C}v_s$$ Then you can convert these voltages to the incident and reflected wave variables at each port by $$a_n=\frac{1}{2}\frac{v_n+Z_0i_n}{\sqrt{\Re\left({Z_0}\right)}}$$ $$b_n=\frac{1}{2}\frac{v_n-Z_0^\star{}i_n}{\sqrt{\Re\left({Z_0}\right)}}$$ (which get a lot less hairy when you start plugging in numbers, since your \$Z_0\$ is purely real) And then you have $$S_{11}=\frac{b_1}{a_1}$$ and $$S_{21}=\frac{b_2}{a_1}$$ I'm pretty sure this will show you that your equations for the off-diagonal parameters aren't quite right. You might be thinking that \$S_{11} + S_{21} = 1\$ because of conservation of energy, however this isn't correct because the travelling wave parameters are not proportional to the signal power but to its square root. To get the correct conversions from Z-parameters to S-parameters, see the Wikpedia page on Z-parameters.
H: Contactless electrical connection I will have a carriage sliding over a round metal shaft and the linear bearings will not necessarily be conductive. I want to calculate the position of the carriage by measuring the resistance from of it to a fixed point on the shaft (with a -0.3 to 0.3V 24Bit ADC and a very high resistance sense resistor). My problem is that I will need an electrical connection between the carriage and the shaft. A brush is an obvious choice but I would like to avoid the friction and wear that would be caused by that and I would therefore need a contactless method of gaining an electrical connection between the two. Induction immediately springs to mind but from what I can see from research is that it won't really help me, is this correct? Any other ideas? AI: An electrical connection is, by definition, not really contactless. For measuring resistance you need (continuous) current to flow, and for that you need a connection. You can work with capacitive or inductive coupling, but that needs AC. For your problem you can try to use TI inductance-to-digital converter, e.g. the LDC1000 (there is also a not-so-expensive EVM available). With that you can mount a small coil on your carriage, and just by the changes in its relation to the shaft the measured inductance changes. And since it has 24 bit resolution this might be sensitive enough (depending on your resolution requirements).
H: concept for true random number generators I have an idea. Lets say we have an unpowered TTL set-reset flip flop with both inputs tied to 5v(logic high). When we apply power to the flip flop, it goes into a quiescent state, so there is no telling what the output would be. Basically, we have a one bit random number generator. Now for my question. Modern processors and microcontrollers have the ability to generate pseudo-random numbers. Of course, these aren't truly random. But if my flip flop scenario generates true-random numbers, then why don't designers use this concept, but with more flip flops? AI: They don't use that concept because, unfortunately, it doesn't work-- the start-up state of a FF won't be very random at all. Quoting from "Cryptographic Hardware and Embedded Systems -- CHES 2003: 5th International Workshop Volume 5" Making a truly random number generator is not easy.
H: Selecting diodes for HV full bridge rectifier I'm using a current-fed Royer self resonant circuit to generate 1kV DC output voltage. The transformer is producing a sine wave of 100kHz/2kVpp (Cap-Royer = 100nF). At the output of the transformer I added a full bridge rectifier consisting of four BY203 HV diodes (2kV, <300ns), now I see that after adding the bridge rectifier the idle supply current of the Royer converter doubled from 25mA to 50mA, without adding a load! By coincidence I found that adding a 20pF capacitor in parallel to one of the diodes is reducing the idle current to 27~30mA, but adding capacitors to two diodes (U$15, U$17) brings it back to the high current. Is the problem here maybe that the diodes are not fast enough? I couldn't find diodes with lower recovery time for the high voltage >1.5kV. What effect is causing the parallel capacitor to reduce the idle current? AI: It's possible that with the secondary open circuit, its natural resonant frequency (due to secondary leakage inductance and parasitic capacitance between windings) is somewhat higher than 100kHz (the switching frequency). When you add the diodes you are also adding capacitance to the secondary and lowering its resonant frequency, possibly to closer coincide with 100kHz. This can mean that you now find it easier to to generate higher output voltages and in fact your AC output voltage may have doubled (take care on this of course because you may destroy the diodes and final output capacitor). What you ought to do is try and determine the secondary AC voltage before and after adding the diodes (which are OK speed wise and reverse recovery wise). Adding yet another capacitor possibly re-tunes things differently and current drops.
H: What does RADOM stand for in this datasheet? I found the following sentence in the datasheet of a FMCW module: FMCW ramp is visible at the outputs caused by self-mixing effects, near objects and cover (RADOM). My search results are flooded with information about the city Radom and the firearm. Is it something like a term for a collection of radar obstructing materials? EDIT: I see the suggestion RADOM standing for radome as both a comment and as answer. However, I wouldn't expect capitals if they mean radome. Is there any reference to these two being one and the same? The context suggests RADOM being some kind of obstruction. As far as I know, radome polymers don't count as obstruction (that's why they're radome, invisible to radar). AI: Is it something like a term for a collection of radar obstructing materials? No, it's supposed to be an RF transparent cover for the antenna(s), and it's traditionally called a "RADOME". Because it's not completely transparent it reflects a little non-Doppler shifted RF into the receiver, which causes the problem (akin to "ground clutter" for a pulsed RADAR) the data sheet was referring to.
H: Double tap push button which resets if not pressed twice in quick succession? I'm new to electronics, so don't know where to begin - I'm trying to create a push button which needs to be pressed twice in quick succession, to actually power on a device. Pressing it just once, or having a long gap between presses should be equivalent to not pressing the button at all. Is there a way to do this ? How would I get started ? AI: There are many ways to do this. In most modern cases, this function would be a few lines of code in a microcontroller that is already present and is (for example) woken up by any closing of the switch. A simple way to do it without a microcontroller is with a CD40106B hex Schmidt trigger gate and a CD4013B dual-D flip-flop that are both powered on continuously. You'll also need three RC circuits (so about 7 resistors and three capacitors). The time constants are: Debounce the switch. Needs a pullup resistor, discharge resistor, series resistor to ST input (1K-10K is okay for this purpose) and a cap to ground (1uF ceramic is okay for all these). Should be maybe 20-50msec, so 20-50K. Time the space between presses. Needs a series resistor to output, series resistor to input and a cap to ground. Time is up to you, probably < 2 seconds, so 500K-2M. Time power-on reset. Needs a series resistor to Vdd, series resistor to input and cap to ground. Time should be something like 100msec, so ~100K. Clock both FFs from the debounced pushbutton (rising edge, so you need two ST inverters). D input of the first FF is tied to Vdd, so output goes high on the pushbutton press. Feed the Q output through delay (2) and through two ST inverters to self-reset and to the D input on the second FF. Delay (3) goes to the reset input on the second FF so that power is off when first applied (there is a brief instant after power is applied where a single press of the switch may turn the power on depending on the state of FF 1. Another gate would get rid of that, or connect the cap to Vdd rather than ground. Something like this fairly straightforward circuit: (the ST "Not 5" is unnecessary, it's there because the FF symbol does not show the /Q output). The unmarked inputs are Reset. Set inputs must be grounded. simulate this circuit – Schematic created using CircuitLab R8 deliberately slows the turn-on of Q1 so the battery (generously bypassed by C4/C5) won't glitch if there are caps in the controlled circuit.
H: SRAM vs MicroSD I have very little SRAM in my datalogger (10 kb), so I have to flush my buffer to MicroSD every 0.5 seconds. Would it make any difference in power usage if I added more SRAM (which is very difficult unfortunelately), and flush to SD every 30 seconds? Or do SRAM and MicroSD both use about the same power, and will it be nonsense? AI: I think you'd be wasting your time by adding anything additional. It sounds to me like what you're doing at the moment is working perfectly well. Your SD card only consumes appreciable power when you're writing to it, and the average power, i.e. the amount of energy consumed, is proportional to the amount of data you write, not how fast or how often you write it. Adding a RAM buffer will increase your average power consumption (because you'll be powering the RAM), and it won't reduce the power consumption of your SD card. The larger RAM buffer would also leave you at risk of losing more data in case of a power outage or battery failure. An addendum: I wouldn't use more than 1kB of buffer space to do what you're doing - enough for two sectors on the SD card, or two 512B buffers. When the first buffer fills, write it to the card. While the write takes place, the second buffer starts to fill. When the second buffer fills, write it to the card while you start filling the first buffer again. This technique is sometimes called ping-pong buffering. It's space-efficient in terms of RAM and it ensures that you will never lose more than 1kB of data if your system fails.
H: AC switch & power supply reverse engineering Below is schematic of self-powered(by passing little current not enough to operate) switch reverse-engineered from PCB. simulate this circuit – Schematic created using CircuitLab Zener diode(D7) seems like 1N47 but not sure. This is connected in serial with load. (one to mains live and one to load) I omitted fuse and inrush current limiting varistor How does this exactly work and is there a name for this circuit? As far as I understand: R3 and C2 is for smoothing D1, D2, D5, D6 is diode bridge C3 is for smoothing D7 is for limiting voltage When S1 is closed, current flows into R1 I can't figure out the purpose of D3 and D4/C1, R4, D8, D9 and S2/L1 and how it limits current(resistor value seems too small). Also how can I calculate current? AI: This circuit actually has two separate power supplies. The transformer is a current transformer, and it, along with the bridge rectifier (D1, D2, D5, D6), supplies power to the circuit when the main triac is switched on, making use of the load current to do so. D3 and D4 serve to limit the voltage across the primary side of this transformer, mainly bypassing any high-frequency transients that the inductance of the transformer would block. However, when the main triac is off (no load current), this transformer does not supply any energy to the control circuit, so a second power supply based on C1, R4 and D8 uses "leakage current" (limited by the impedance of C1) to keep the circuit alive. But this supply can't work when the main triac is on, since there isn't enough voltage drop to drive significant current through C1. Filter compontents C3 C4, D7 and L1 are common to both power supplies.
H: Two different outputs from same type of IC's Hello Electrical engineering community. I am using motor drivers to get 5v to 12v and I am controlling each motor with each IC L293D. Each motor driver is controlling each motor and the outputs is taken from only one side of the IC. 12v battery -> 7805 voltage regulators -> two L293D IC's with 12v given and the output is taken via diodes to resist back emf-> 100 rpm 12v DC motors.(the other two output pins of the IC are left floating). Everything is working fine but from 1st pin I am getting an output of 10.23 and 0.72.. and from the second IC I am getting an output of 9.1 and 0.61. I don't understand why is there a difference of 1v. Sorry I can't upload a picture of the ckt or make the question in more detailed manner as I am using my phone. Any help would be appreciated. I don't understand what tags to be given AI: You seem to expect that each exemplar of a particular chip type behaves the same, but that is a misconception. What you can expect is that each exemplar behaves within the specifications guaranteed by its datasheet (if you use it within the limits that are also stated in said datasheet). (But take care: different manufacturers might produce chips with the same type number, yet the each have their own datasheet, which might not fully agree!) For the TI L293D the relevant part of the datasheet is shown below. It states that the maximum voltage drop (for a current of 0.6A) over both the high side and the low side of the output drivers is 1.8 Volt. Note that it does not state a minimum, so the drop voltages you observe are all in accordance with the datasheet. Side note: strictly speaking these values are valid for Vcc2 = 24V only, but it is likely that they apply for other reasonable Vcc2 values. The fact that the datasheet mentions these figures for 24V only is an indication that this chip was never meant for low voltages, and indeed it doesn't perform too well at lower voltages. But it is cheap and widely available... PS the D after the L293 only means that the chip has built-in freewheel diodes. It has nothing to do with the voltage drop of the drivers.
H: Difference between Lithium Polymer batteries of varying capacity and cell amount I was looking to purchase a LiPo batteries online for a side project. Upon shopping around, and reading up on LiPo batteries, I have a fair understanding on what the numbers/letters on the battery packs (i.e mah,S,C, etc). However, I noticed a wide variety of battery packs on sale, ranging from a 5000mah 3S LiPo battery pack to a 4500mah 4S and 5000mah 6S LiPo batery pack. My question is, is there any rule of thumb when it comes to mah ratings and the number of cells in a battery pack? For example, given the examples above, I would assume that the 5000mah 3S refers to the entire (3 Cells) capacity of the battery pack, with the same applying to the 6S battery pack. However, why then is the 6 cell pack more expensive than the 3 cell battery pack? If I were to divide the mah rating equally among the number of cells in a battery pack, the 3cell pack would have 1666.67mah per cell, which is FAR more than the 833.33mah per cell in a 6cell battery pack. OR, am I mistaken and the 5000mah refers to each individual cell in a battery pack, therefore the 5000mah 3S battery pack would have a total of 15000mah, and the 6S battery pack would have 30000mah in total, which would make it's higher price justified. Could someone clarify this please? AI: What you are missing is the voltage. You're paying for energy storage, not for mAh. If you put n cells in series, the mAh does not change, but the energy stored is n times as much, because that's how much more voltage you have. Since they're in series the current (mA) through each is the same. Some batteries are rated in W-h (watt hours) which is directly proportional to the energy stored (1 W-h = 3,600J),
H: Orphan polygon not filling I'm trying to have an area of my PCB with the same geometry on the top and bottom copper layers, but I'm having trouble with the polygon on the top layer. I placed vias on the bottom contacts (which will be soldered to two-lead package), and set the 'orphans' setting on the top polygon that overlap the bottom contacts, but they don't fill when I ratsnest the PCB. Is there any other setting I'm missing? AI: If I remember correctly, I had the same issue once. I figured that the polygon cutout would destroy anything underneath it, regardless what rank it had. There are basically two ways of solving it: 1. Create the outermost cutout so that it only affects the area you want. The cutout would then have a shape of an almost closed letter C. 2. Don't use a cutout at all. Just stack the inner polygons on top of the pour. Use ranking(*) in the combination with a different signal name to automatically create the isolation around those polygons.
H: How does the impedance that voltage "sees" while traveling down a tranmission line affect how the current move down the line? It is well known that the voltage sees different impedances while traveling down a tramission line, and this impedance is a function of the intrinsic impedance of the line Zo and tangent of wave frequency and the length away from the load according to: But my question is, since the voltage sees different impedances at different position along the line, why is it that power is always delivered to the load (i.e. an AC line that spans many Kms)? If voltage source truly sees different impedances down the line, then why would it deliver any power to the load at all since eventually somewhere on the line the impedance would be infinity? AI: Think about the signal on the transmission line as being made up of a forward-travelling wave and a reverse-travelling wave. At any given point on the line, the ratio of voltage to current in each of these two independent waves is determined by the characteristic impedance \$Z_0\$ of the line. The forward travelling wave was initially created by the power source driving the line. The reverse-travelling wave only exists because something caused reflections of the forward wave to return back up the line. Reflections only occur when there's some change in the line geometry, a circuit attached to the line, or a mismatched termination. If voltage source truly sees different impedances down the line, Your formula for \$Z_{in}\$ applies to one specific situation: There is a mismatched termination on an otherwise ideal line and you want to know the ratio of voltage and current (due to the combination of forward and reverse waves) at some location up the line from the termination. It accounts for the fact that the phase of the forward wave is different at this point on the line then where it encounters the load, and that the phase of the reverse wave has also changed as it traveled back down the line to where you're measuring. It doesn't mean that the characteristic impedance of the line is changed in any way: The voltage/current ratio in the forward wave is still determined by \$Z_0\$ and the voltage/current ratio in the reverse wave is still determined by \$Z_0\$. And if there isn't a discontinuity or geometry change at this point in the line, there won't be any additional reflection created because \$Z_{in} \ne Z_0\$ at this point on the line. ... then why would it deliver any power to the load at all since eventually somewhere on the line the impedance would be infinity? The apparent input impedance will only go to infinity if the load has reflected 100% of the energy in the signal (\$|\Gamma_L|=1\$). In this case, in fact there can't be any energy delivered to the load, because all of the energy is reflected back in the reverse wave.
H: Including a short in a real-world circuit In theory, the voltage across a wire is zero, so any components bypassed by a short circuit can be ignored when analyzing the circuit. A real wire, however, is not an ideal conductor. Is there any real-world situation where you would have a circuit where a component is deliberately short-circuited? AI: I worked with a guy who liked to do this: simulate this circuit – Schematic created using CircuitLab In normal operation the LED is short circuited. If the fuse blows you've got a nice indicator to tell you why your circuit suddenly stopped working. I can't say I'm 100% sure of the wisdom of continuing to run current through the load once it's had a fault that makes it blow a fuse though.
H: Switched reluctance motor inverter I've been doing some research on switched reluctance motors, and the papers are always talking about driving them with inverters. Why would you use an inverter as opposed to just using a single switching element to turn the coils on and off? AI: The thing about SR machines is you need to decay the current in the coil fast at the point of commutation otherwise you will be generating torque that will attempt to impede rotation. If you were to fire each phase of an SR machine with a simple chopper circuit then the current will freewheel via the anti parallel diode and decay slowly (relatively speaking) via the zero-volt-loop you establish. Exaggerated decay. Now consider the other 3 phases being fired to facilitate torque generation. There are periods where there would be torque (as current would still be flowing) that would reduce the shaft torque. (NOTE: it can be done with a single switch per phase as a form of a chopper but you need a split supply with split caps and a higher voltage rail to pull the energy out of the coil) If you were to use a single phase H-bridge per phase you now have the ability to not only create positive volt loop (to charge the coil), a zero volt loop (to maintain the current) but a negative voltage loop (to decay the coil fast). If you then realise an SR machine doesn't care about current polarity when the coil is engaged (+ve current and -be current both setup flux that the rotor will react to) you then could remove 2 switches and 2 diodes from a classic single phase H-bridge. Why is it called an inverter? Well the resultant waveform is AC
H: Project Parameters as variable In Altium I can't for the life of me figure out how to make the Project parameters show up in my schematic template. I have a variable string called =Title which I'd like to set in the project parameters, but it doesn't show up. I know I can set it up in Document parameters, but I want it to be in the project since its global to the entire project and not just the specific sheet. Anyone quickly know how to set it up ? edit The question may not have been clear. In my schematic template, I have a string whose value is "=Title" without the quotations. I have gone to the Project Paramaters tab {Project-Project Options-Paramters} and have created a new paramter. For the name property, I have called it Title and for the value I have called Test123. What I expect to have happened was my special string to convert to Test123. It does not. I have changed the Name property to =Title and .Title and it still does not change. If I change the Document parameters, I am able to change my special string into Test123. Hopefully that's a bit more clear. AI: I figured it out. You can't use any of Altium's stock/unchangeable Document parameters names in Project Parameters. So "Title" in Project Parameters will not supersede "Title" in Document Parameters.
H: Attenuation in speaker crossover design In the loudspeaker crossover circuit below, I believe the purpose of the resistor is to attenuate the signal to the second speaker (the tweeter). However, in circuits I've seen that are supposed to perform attenuation only (l-pads), there are two resistors, one parallel as well as series (see second image). Is the parallel resistor not required in the crossover, because the 0.4mH inductor is serving this purpose? AI: The second form is typically used to implement a "constant impedance" attenuator, replacing the 2R2 resistor in the sketch. A first pass at designing the crossover network might assume the load is simply the tweeter, and thus uses the tweeter's impedance (typically 8 ohms) as the load resistance. The filter network is then designed and optimised to work into that load. (For example, the product of L and C determine the crossover frequency via the usual equation, while their ratio - with a load impedance of 8 ohms - determines the damping. The designer then chose 2u7 and 0.4mH as giving the response he wanted. Then it turns out that the tweeter is a bit more efficient than the woofer, so the speaker sounds too shrill, so you need an attenuator to correct it. The simplest attenuator - a series resistor - increases the load impedance to 10.2 ohms, thus reducing the damping factor of the filter. (You might hear an exaggerated shrill sound at the crossover frequency, for example). The second form - a constant impedance attenuator, or L-pad, allows you to choose R1 and R2 such that the attenuation is the same, but the load impedance remains 8 ohms thus preserving the original properties of the filter. In practice, while the second form is theoretically better, it is more complex and expensive, the simpler one may be adequate. Furthermore, loudspeaker design is not such an exact science, there are no perfect drive units, and cabinet design (shape of baffles etc) modifies the frequency response. So it may even happen that the simpler filter compensates for an imperfection elsewhere in the system and both sounds and measures better than the theoretically better solution. But without extensive measurements and/or listening tests, you can't tell.
H: Order of resistor/capacitor in bandpass/highpass filter Is there any particular reason to prefer one of these filter designs over the other? Theoretically, they are the same. Practically, does changing the order of the resistor and capacitor have any effect (except, perhaps, on physical layout)? AI: Yes, in certain circumstances there is a difference between the two. Consider the case where the amplifier operates in large electric fields, and the impedances are high (e.g. megohms). Then, every millimetre of wire or PCB track between the highest impedance components and the "virtual earth" (negative input) is an antenna picking up noise. So place the highest impedance component adjacent to the opamp and the lower impedance one further out to minimise the area and minimise interference. Then you have to ask which of R1 and C1 is the higher impedance component... I can't answer that without knowing the context; but a couple of examples may help. 1) Lots of low frequency interference at say 50 or 60Hz: comparing R and Xc you probably find the capacitor is the high impedance component, and the resistor placement is less critical. 2) High frequency interference (e.g. in a switch mode power supply or RF transmitter) . Xc is small, and R is the high impedance component. 3) Special case of 2) The amplifier has a lot of gain at HF and tends to form an unintended UHF oscillator : introduce a new resistor between the circuit node and -Vin, as close to -Vin as possible. This resistor is small (a few hundred ohms maybe) and is known as a base stopper (or grid stopper, or gate stopper, depending on the amplifier!) But there are many cases where it simply doesn't matter.
H: Use 555 for additional 40KHz PWM in Arduino I need to transmit infra red signals using IR LED from my Arduino device. The IR signals consist of PWM 40 kHz periods and "silence" periods of various length (typical IR remote signals). I know there is IR remote library that uses internal clock registers, but unfortunately, my device has all PWM pins already used. I need to power the IR LED with a regular PIN. As far as I know it's not possible to achieve exact 40 kHz on digital output PIN with software only. So I would like to include 555 circuit between Arduino digital output PIN and the IR LED so that the high state of digital PIN caused blinking of the LED at 40 kHz. I'm not sure how the wiring should look like. I was thinking of using this schematic: (Source) And attaching +5V to Arduino output PIN, but I feel this solution is not perfect. Is there any better way to connect 555 to Arduino output pin? Update: I used solution described by akellyirl below and it works perfectly. I used R1=1000Ohm, 2000Ohm potentiometer as R2 and C1=C2=10nF. Pulses triggered by arduino pin connected to Reset pin of 555 of length between 400 and 1600 microseconds are properly interpreted by my Technics HiFi. AI: That schematic is poorly drawn and hard to understand. See here for a good tutorial. Anyway, you should use Arduino to control the RESET pin (pin4). High enables the Oscillator , Low disables it. Also, it would be far better not to drive the LEDs directly from the 555. See this related question for more info on how to do that.
H: Cable for transmitting 4MHz 3V3 signal I am building a device on breadboard where there are 2 ICs: a microcontroller and some auxillary IC, they should communicate via SPI with a 4 MHz clock. Because I don't have enough place on my breadboard, I plan using two breadboards, microcontroller on one and other IC on other. The question is, can I transmit 4MHz 3V3 signal over a jumpre wire, just like on the photo: Will the signal be deteriorated? Where I can find some rule-of-thumb info about cables and their band-pass frequencies? AI: As Majenko pointed out, don't worry. there is no problems for 4Mhz 3v3. I myself working with 6Mhz SPI. it depends on your speed and the length of your wires. longer wire = slower speed and vice versa
H: Mounting AC-DC converter on PCB I need to figure out how to physically mount the following AC-DC converter to a PCB to be used as part of a regulated power supply. The pin height is min 3.0 mm. Should I mount it as a through-hole component, a surface mount component, or have a header that this component is plugged into? AI: Shown on their datasheet is this picture on page 3: The recommended footprint is for through-hole mounting and it is referred as a SIP package which stands for single inline package. It would be best to mount it this way but if design did absolutely not permit for this then you could probably lay long rectangular pads on a PCB and mount like a SMD component. Beware you may have to de-rate the thermal properties of the IC as it was likely tested while through-hole mounted. You could always use a header but that would only be warranted if you felt you would need to replace or change this component often.
H: Automatically measure voltage over a wide range There are voltmeters that can measure voltage over a wide range without the need to switch the range manually. I'm quite curious how do they do it, because I'd like to make a tiny device capable of the same, up to 1000V. I was thinking about utilising a capacitor - if you connect it to voltage on one side, you'll get opposite voltage on other side, but high current will not flow. simulate this circuit – Schematic created using CircuitLab The change in potential should be measurable, shouldn't it? If that's not the way, what is? AI: As a alternative to the common approach that clabacchio has already explained well, you can use very high resolution A/Ds that require 10s of ms per reading when the result is only to display to a human. You generally want to update a digital display in the 2-4 Hz range, so you have at least 250 ms per reading. There are delta-sigma A/Ds available that claim over 20 bits. Let's say 8 real bits is good enough, which gives you 1/2 percent resolution. If you arrange the highest voltage of interest to maximize the output of a 20 bit A/D, then you can read a voltage 1/212 lower and still get 8 bits. For example, if you want the meter to read up to 1 kV, then it will still be able to read 1/4 volt with 1/2 percent resolution. If that's good enough, then no range switching is required. The only "auto ranging" would be in how the result is displayed to the user.
H: Why are sound waves the best choice for many location detectors? I'm currently working on my high school final project, which is basically a radar. I'm using the SRF05 detector to detect objects that are near the surface of the device. My current assignment is to learn and summarize all the different components that will be assembled at the end. (UART, MAX232 74HC244 etc., if you want to know.) My teacher told me that the more I will know about these components, the better I will do at my work, and in the exams. Why are sound waves the best choice for the SRF05? Furthermore, why ultrasonic ones? What are the benefits of using sound waves, but not invisible light waves, heat or any other means that can do the job? Light, for example, travels much faster, thus creates a better result and will probably be more effective than sound. AI: Basically, sound is slow. Using sound you can easily time how long a wave takes to travel to your object and reflect off it, thus giving you a fairly accurate distance. Light goes too fast for that, unless you are looking to measure the distance of the moon, say. And why ultrasonic? So you can't hear it. Imagine how annoying it would be if you were forced to hear it all the time? BeeeEEEeeeeEEEEEeeeEEEEEeeeeeEEE...eeEEEEeeEEEP
H: Getting MCLR error in Proteus on PIC18 in a really simple circuit I'm simulating this circuit below in Proteus 8.1. It basically consists of a switch that, when pressed should send a signal to port A, and then port B should light a LED. I am using PIC18F4550, and the exact error I am getting is: $MCLR$ is low processor is in reset. How can I solve this? AI: One obvious problem is that you don't have power connected to the processor. You also left the PGM pin floating. Since nothing is connected to the oscillator pins, you have to make sure the processor is configured to run from the internal oscillator. Otherwise, a 10 kΩ pullup on MCLR to Vdd is fine.
H: What happens to a DSB signal if I use an envelope detector instead of Low Pass Filter What happens to a DSB signal Modulated signal if I use an envelope detector instead of Low Pass Filter ? I am interested in knowing how the output signals vary in case of a envelope detector. I know that I get the signal back in case of a low pass filter. Thanks for your time. Envelope Detector Low Pass Filter I used instead of the above envelope detector to retrieve the signal This was the message signal : 2 volts pk-pk cosine wave 100 Hz Carrier signal : 20 volts pk-pk 25khz note that the when the low pass is connected the envelope detector is removed DSB Modulated signal OUTPUT From the Envelope Detector OUTPUT from the low pass AI: What you call envelope detector, consists of the detection diode and a low-pass filter. This is one way of demodulating an AM signal, more precisely, it is called asynchronous demodulation. If you do not connect the diode, and only you process the AM signal with a low pass filter, you get the modulating signal, to which is added the carrier signal. Watch the third oscillogram well. It is the component of the modulating signal to the signal shaping, while is added a proportion of the carrier signal, attenuated by the filter. The correct operation, is to use the envelope detector. The problem we are having is that the modulating signal is too high (amplitude), so when you make the detection and filtering, unwanted components appear, causing the distortion you see in the second oscillogram. In the first oscillogram, one can see that the modulation index is extremely high; you should decrease the amplitude of the modulating signal and use the envelope detector to demodulate the transmission.
H: Power Conducting Stepper Motor? I have a question that I'm not really sure how to ask, so here goes: So I know there's such a thing as a power conducting slip ring motor, which I assume allows the passthrough of power through the motor to power additional devices. I'm looking to see if there's such a thing as a power conducting stepper motor, or some way to hack such a thing into life. My project requires the use of 3 motors in total - two stepper motors and one regular motor. I have to use the stepper motors (I think) because I require precise control over the angles for each, and the angles have to be able to traverse 360 degrees (not necessarily more than that, but having a little give in either direction would be good). The motors will be connected in parallel, and are set up like the following: (power source) ===> (motor 1) ===> (motor 2) ===> (motor 3) The device itself will work very similar to this (animated GIF): http://giant.gfycat.com/ClearcutMajesticCirriped.gif Where the first motor rotates over one axis and the second motor rotates perpendicularly. Each of those two motors require precise angular control, and again would need to go at least 360 degrees (as quickly and precisely as possible) but not necessarily more than that. Motor 3 does not, as in the gif it just spins relentlessly. I'm new to motors. AI: Your understanding of slip rings seems correct. There are many companies that make slip rings. So answering specifically to those is 'off-topic' for electronics.stackexchange. You might have to read through several pages of web-search results to find them. Typically, slip ring costs increase rapidly the more separate contacts you need. So 4 power signals for one stepper motor, and two for the inner motor might be much more expensive than only two for power. It may also cheaper and easier to get a multi-circuit slip ring with two 'power' connections (for power and ground) and several 'data' connections. Edit: One use for slip rings is connecting the buttons and airbag on a steering wheel to the rest of a car. So automotive slip rings are a mass-produced; they would be a low cost, relatively robust part. So you might find something to experiment with from a car 'junk yard'. It might be low-cost to get something there, and experiment with it, before trying to find 'exactly' what you need. You might consider putting the control electronics 'on each motor', so that you only have to get power and ground through the slip rings. Then the electronics 'on the motor' would use that power to drive the motors power connections. So the first/outer motor would be connected directly to its controller. Power and ground would be fed through a 2 power-circuit slip ring. The controller on the second/middle motor would take power and ground, and convert that into a signal to drive the motor. Power and ground would be fed through a second 2 power-circuit slip ring. The controller on the third/inner motor would take power and ground, and convert that into a signal to drive the motor. I assume the electronics on each motor would need to understand its position. That might be done using a gyroscope sensor on the motor controller, or use a low-cost radio.
H: Connecting two power supplies with almost like voltages to an amplifier in parallel I have recently been working on a custom sound system in my living room. For the subwoofer, I am using a 1000W amplifier. This is currently running off of a 12V computer power supply that outputs around 650W (The power supply shuts off at a certain volume because of lack of power). I have another power supply (not a computer power supply) that is 500W but has a voltage of 13.5V, not 12. I've read that this voltage is actually better for running car audio equipment and I am using another 13.5V power supply for the head unit to power the highs and mids. I am wondering if it would be possible for me to connect these two power supplies in parallel to increase the power to this amplifier since they are both safe voltages. Would this be possible? Would I need to use a resistor to match voltages? Or is this just not a good idea altogether? Update: This is car audio equipment so high power ratings should not be a shock. AI: Let me put this as an answer rather than a continuation of comments. Adding diode to supplies, something like this. Now you'll want some beefy diodes, maybe 30 to 60 amps. And probably Schottkies, maybe something from this page. With heat sinks. RE: power supply adjustment. Hopefully there is some adjustment so that you can set the voltage for each supply to be about equal. (Actually you'll want the voltage after each diode under load to be equal.) Getting exactly 12V is not important. I do worry, that I'm giving advice to a musician and not an electronics "geek". I hope you understand what you are doing. Do you have a way to measure the voltage? Do you know why I picked the diodes I did? And why the heatsink?
H: AC source in parallel with resistor problem For an AC source of for example +-12 V, can a connected resistor at any instant, have 24 V across it? Because my textbook has a problem in it involving such a source and says (hint: consider the source as a 24 V battery)and I am trying to make sense of why this is valid. Edit: no there is nothing at all. Just a source connected in parallel to a resistor and it's asking me to calculate the minimum resistor value if the resistor is valued at 0.25 W. The source provides a voltage of +-12 V and to calculate the resistance you would have to take the source as being equivalent to a 24 V source (according to book) then (24^2)/0.25=Minimum resistor value. I just don't understand why you can take the value as 24 V. AI: Just a guess but this question may be referring to a split supply e.g. from a centre tapped secondary of a transformer. It is very difficult to give a definitive answer to questions without the full background.
H: Issue getting relay to trigger, coil voltage might be insufficient I have a simplisafe home alarm system. All components of the alarm(keypad, base station, sensors, alarm) are wireless, so there are no wires running to any sensors. I wanted to add an additional siren with some bark, not another wireless mediocre "siren" from the manufacture. I needed a way to trigger a relay to turn on the additional wired siren I purchased, so I turned to taking apart the wireless stock siren. I probed around on the circuit board and found a pair of circuit pads, which were labeled(T6 & T9) But had no wires connected to them. The pads provided battery voltage (6V) when the wireless siren was going off. So I thought I was all peachy, but when I connected the relay coil to the terminals I found out that the wireless alarm would not operate at all. Is there some kind of diodes or something that needs to be installed inline with the relay to allow the wireless siren to function, and also inturn be able to energize that relay coil ? With the relay not connected, the alarm continues to work properly. I can get a picture of the wireless alarm circuitry, I am not very familiar with the components to name them. AI: If I had to guess, I would bet that T6 and T9 are probably testpoints on the PCB for use by the engineer or technicians at the factory. And I'd double-down on my guess that those testpoints are connected to digital outputs from a microcontroller. That's just a guess. But if I'm correct, then attempting to source any significant current out of a MCU's digital output pin will result in failure. Depending on the size of the relay you're using, the coil could need several tens or even hundreds of milliamps. That's more than a typical MCU can source on a digital output. However, you're not out of luck. If the test points truly go high or low based on the alarm status, you might be able to use the voltage to drive a transistor to do the heavy lifting. You would just need to construct a small circuit on some protoboard (or whatever) that looks something like this: simulate this circuit – Schematic created using CircuitLab M1 is an N-channel MOSFET that needs to chosen such that it can handle the current that the siren will draw. R1 protects the MOSFET's gate from transient spikes and R2 is a pull-down resistor to turn off the transistor when the circuits are not connected. I'm assuming you have access to a regulated 6V source that's part of the alarm circuitry. If you don't, you can use the 12V battery to drive the relay's coil, but you'll need to get a 12V relay. Also, I've drawn the ground points as all tied together. However, the battery's ground does not necessarily need to be tied to the alarm circuit's ground. They can be isolated if you so choose.
H: How does the MAX232 double the voltage? MAX232 Datasheet Hi, I am currently a student so bear with me please! I'm currently using a powering the MAX232 with 5V DC, and when I measure from VCC to lets say, pin 3, I am getting a voltage reading of around 13V on my voltmeter. Using a power source that is higher than 5V. What is going on? I know it says in the datasheet that there is a voltage doubler, but I am not quite sure how voltage doublers work, other than we need the capacitor. AI: It uses one charge pump to double the supply voltage, and the second charge pump to invert it. The idea behind the charge pump doubler is that capacitors are first charged in parallel, then they are switched such that they are connected in series. (Source of picture: datasheet for ICL232, which is similar to MAX232.) As an aside, I've seen hacks where +10V and -10V generated by the MAX232 were also used as supply rails for OpAmps. It's not the best power supply, and it's got switching noise from the charge pump. But it may still work, if the analog section is not very sensitive, and it needs a negative supply rail, and there is no other option for generating the negative supply rail.
H: Which files to version control in mplabx nbproject directory? I just discovered the files in the directory nbproject are required for MPLABX to realize a .X directory is a project. I don't want my teammates to continually struggle with having to update every single time I make a small change, like recompile. What are the minimum files I should I add to my version control system? Screenshot of what I think are too many files to manage a project: AI: We use Mercurial for our embedded projects at the office, including MPLAB X. I came up with the following guidelines for the team when Mercurializing MPLAB X projects: Version all of the source files in the project root directory (duh) Version the Makefile in the project root directory Inside \nbproject, version the following: configurations.xml project.properties project.xml Inside \nbproject\private, version everything: configurations.xml private.properties private.xml This works well for us where we have varying operating systems and varying versions of MPLAB X. Cloning the repo and opening it works, MPLAB X will recreate the missing files and away you go. The only nuisance will be having to select your own programmer/debugger in project config, but there's no avoiding that - MPLAB X tracks the tools by serial number. Before starting all this, we also figured out that we need the compilers to be installed in a common location (C:\Microchip\MPLABXC16\vX.XX, C:\Microchip\MPLABXC32\vX.XX, etc.) because depending on 32-bit or 64-bit O/S they end up in \Program Files or \Program Files (x86) which was problematic. I don't think this is still necessary with the above versioning scheme - YMMV.
H: Calculating total resistance for resistor network circuit I'm very lost in my ECE class right now and I was hoping someone could help me out and explain what they're doing. I was asked to calculate the total resistance. After getting that, I was asked to calculate the \$i_2(t)\$ in terms of \$R\$ and \$i_S(t)\$. I am so lost and any help in explaining this to me would be greatly appreciated. AI: To find the equivalent resistance across terminals \$a\$ and \$b\$ first set the independent sources to zero. In this case you have a current source so when it is set to zero it is equivalent to an open circuit (if it was a voltage source then it would be equivalent to a short circuit). Your circuit now looks like this: simulate this circuit – Schematic created using CircuitLab \$R_1\$ is in series with an open circuit so it can be ignored. You have three remaining resistors. \$R_2\$ is in series with \$R_3\$ so their combined resistance is \$2R\$. This resistance is in parallel with \$R_4\$ so $$R_{eq} = 2R \parallel R_4 = 2R \parallel R = \frac{2R^2}{2R + R} = \frac{2}{3}R$$ To find \$i_2(t)\$ you can use a current divider. Since \$a\$ and \$b\$ are open terminals the current through \$R_3\$ is simply \$i_2(t)\$, and the equivalent resistance in this path is \$R_3 + R_4 = 2R\$. By KCL at the node between \$R_1\$, \$R_2\$, and \$R_3\$: $$i_S(t) = i_1(t) + i_2(t)$$ The current divider at this node gives $$i_2(t) = \frac{R_2}{R_3 + R_4 + R_2}i_S(t) = \frac{R}{3R}i_S(t) = \frac{1}{3}i_S(t)$$
H: Digital out, output low voltage, no load I'm controlling a home-built current regulator, using a PIC microcontroller (PIC12F1572). The regulator is implemented using an op-amp and mosfet, and works well. The input to the regulator is a voltage 0V to 0.25V, with zero corresponding to 0A and 0.25V corresponding to 0.5A. I'm thinking of controlling the current regulator directly from the PIC, by having a resistor based voltage divider connected to an output pin on the PIC, to yield between ~0V and 0.25V. According to the datasheet for the PIC, the output low is guaranteed to be at most 0.6V. With my voltage divider, this means ~0.03V to the current regulator, or approx 60mA out. However, I want it to be able to shut off completely. The output low quoted in the datasheet is valid at 8mA, so when (practically) unloaded, it should give lower voltage. Do I dare assume that the output low voltage will always be very close to zero in practice under these conditions? Or am I inviting trouble? AI: You are misinterpreting what the datasheet says. Fortunately. Vout low is the voltage at specified current when load is from output pin to Vdd and the port is pulling the pin low against the pullup load. When you are driving a ground referenced divider the load is from pin to ground. The port is "perfectly happy" to turn off essentially completely and allow the load to pull the pin to ground - but it will in fact (probably) help with an active pulldown. . There MAY be some issues with bias and leakage currents (usually associated with input modes) if you are aiming for the last few microvolts, but in your application it will reach true-enough ground. Datasheet (which you should always provide a link to) is at http://ww1.microchip.com/downloads/en/DeviceDoc/40001723C.pdf See ~= page 251 RELATED: Worst case specifications should be used for design BUT the conditions under which they are specified should be noted and where these do not match your conditions suitable adjustments may be made. With due care :-). If you did care about Voutlow then you also need to note the conditions under which it is specified. P251 in the datasheet says Vout low max = 0.6V (as you note). BUT they also state the loading conditions under which this is true. AT 8 mA with Vdd = 5V = (5V-0.6V) / 8 mA = 550 Ohm load or 6 mA at Vdd = 3.3V = (3.3-0.6)/100 Ohm load or 450 Ohm load or 1.8 mA at Vdd = 1.8V = (1.8-0.6)/1.8 mA or 667 Ohm load. While port pin resistance is NOT linear with load it is liable to be somewhat linear with load. If you use higher load resistors (to Vdd) than above you can expect approximately proportionately lower Vout.
H: Thevenin equivalent resistance of circuit with diagonal resistors I'm trying to find the Thevenin equivalent for part A of this circuit: I begin by opening the circuit at the dotted line of part A. Then I try to find \$V_{oc}\$ across the two terminals that are open. I can see that the 47kΩ is in series with the 18kΩ since no current flows to the open circuit, and that the 15kΩ is in series with the 33kΩ. However I'm having a lot of trouble redrawing the circuit. Not really sure about how to make it look simpler. Any ideas? AI: You must redraw the circuit to obtain the Thevenin's voltage: simulate this circuit – Schematic created using CircuitLab Then you must find the voltage between node b and node c. Passivating the source Vi, you find the equivalent resistance: simulate this circuit Between node b and node c.
H: What does lumped element mean? Can anyone explain me the meaning of lumped element and lumped circuit abstraction in detail. What does lumping or discretizing matter mean? AI: Two theories (really one!) There are basically two ways of looking at an electrical circuit: electromagnetic theory (Maxwell's equations) and the theory of lumped elements. In fact the theory of lumped parameter circuits, is a simplification of electromagnetic theory, since the latter involves a hard mathematical work for analysis or design of an electrical circuit. The simplifications. In the lumped parameter theory, it is assumed that all conductors interconnecting the circuit components are ideal (zero resistance). Another simplification is that all actions of magnetic induction, can be represented by an ideal element, called Inductor. By element called resistor, all energy exchanges that occur irreversibly are represented. Finally, the element called capacitor, represents interactions where electric energy is stored as potential energy. Ideal components Obviously, the ideal components do not exist, but while taking into account the condition of the working frequency; a coil, for example, can be modeled with good approximation by an inductor. As the operating frequency increases, the capacitive effect on the coil, due to proximity of the conductors from each other, are made much more noticeable. This capacity is not a capacitor connected to the coil (as concentrated element) but it is distributed on the coil. When I can apply the theory of lumped parameter? This theory represents a very good approximation when the physical dimensions of the circuit are much smaller than the shortest wavelength is expected to process. That is, when the higher frequency (shorter wavelength), this theory begins to fail, if the circuit dimensions are comparable with the wavelength. In this case, use the electromagnetic theory. When the physical size of the circuit, is comparable with the wavelength effects start appearing, such as induced currents, to the full extent of the circuit, and also vary with the distances of the conductors that connect the components. In this case, it can not be considered to all effects of magnetic induction can be represented by a single component (i.e., an inductor), but the inductor, is distributed throughout the circuit. A similar analysis can be plotted for the case of a capacitor. Summary. Concentrated Parameters Theory, is a simplification of electromagnetic theory, which applies when the physical dimensions of the circuit are much smaller than the shortest wavelength of work. Three ideal elements are defined to represent the exchange of energy between the electromagnetic field and the medium: resistor, inductor and capacitor. These elements are considered physically implemented by an object (lumped!) And are connected by ideal conductors.
H: How to remove energy from inductor using semiconductors? So I have this coil and I'm driving dc current through it. This coil has inductance and thus stores energy from the dc current. I have to remove this energy before I can change the polarity of my h-bridge to prevent dangerous voltage rises. How can I efficiently remove this stored energy from the coil immediately after it has been disconnected from the current source? Would just using a bipolar capacitor in series with small resistor and paraller with the coil like this? simulate this circuit – Schematic created using CircuitLab AI: Just parallel the inductor with back-to-back Zeners, or a TVS, like this: Or don't do anything at all if the MOSFETs you're using have parasitic diodes which can take the current hit from the inductor when you switch. Or, if they don't, you could do this:
H: Boost Converter Efficiency goes down as Duty Cycle goes up? simulate this circuit – Schematic created using CircuitLab I have tested a boost converter under different duty cycles. I know the voltage is related to the input voltage by V = Vin/(1-D) where D is the duty cycle. But for some reason, as I increase this duty cycle with my input voltage kept constant, the power efficiency of the converter goes down. I am using a function generator to make the MOSFET switching, and a DC voltage supply for input. (something like this: http://shop.rabtron.co.za/catalog/bench-power-supply-c-46_374.html) Can someone tell me why the power efficiency of a boost converter reduces as the duty cycle is increased? EDIT: I put a circuit to make the question more clear. I actually did not bother to check the type of diode or MOSFET, and it seems like that would've been important... AI: The main power losses in a boost converter can be summarized as follows: Power switch switching losses (e.g. MOSFET, BJT. Hereafter I will refer to the Power switch as the MOSFET) MOSFET conduction losses. DIODE switching losses. DIODE conduction losses. Other conduction losses (e.g. inductor resistance) The efficiency of a converter is given by: eff = Po/Pin = (Pin - Plosses)/Pin. As the losses change the efficiency therefore changes. One can not make a blanket statement as to why the efficiency reduces or losses increase as the duty cycle increases because then one would need to know all five loss parameters as a function of current, voltage and switching frequency. However, a simplified explanation of this phenomena is that the MOSFET conduction losses are unequal to the diode conduction losses. As the duty cycle increases, the MOSFET will conduct for a longer period and the diode for a shorter period. This in turn alters the power losses in the circuit. If the DIODE happens to have higher conduction losses than the MOSFET for example, then as the duty cycle changes, causing the DIODE to conduct for a relatively longer period than the MOSFET, then the efficiency will decrease. This is a simplified explanation, but the main principle is that as you change the duty cycle, the operating conditions for each element in the circuit change. Since the losses for each device depend on it's specific operating point, then changing the duty cycle changes the losses.
H: Schematic symbols: dot or bar to indicate negative logic A question of style or consistency: considering below schematic symbol which notation to indicate a pin with inverted logic is preferred: Dot and bar above pin label (possible double-negation?!) Dot only, pin label without bar No dot but bar above pin label AI: The ultimate answer here is "Do whatever your coworkers do". They're the ones who will need to understand it after all. That being said, 3 is the clearest and most difficult to misunderstand, and probably the best general practice for that reason when you don't have a coworker to ask.
H: I2C Communications with Arduino My Engineering Design and Development (EDD) class is working on a high altitude balloon (HAB) and my friend an I are in charge of data collection. It looks like we are going to use an Arduino (Uno or Due based on needed ports) and sensor breakout boards for logging data. As I was browsing our possibilities, and I wasn't quite sure if running multiple I2C devices on the Arduino was realistic. For example, in viewing the tutorials for an accelerometer (3-axis) and a gyroscope (3-axis), I found that both require the use of the SDA and SCL ports on the Arduino. If I have read correctly, each device has a different I2C address, and you can use them in the same port, but I wasn't sure. If that is possible, how do you know what the address is or how to assign the address? Is there a maximum limit of I2C devices that an Arduino can handle? I have reviewed How to connect multiple i2c-interface devices into a single pin A4 (SDA) and A5 (SCL) on Arduino? but I'm not quite sure this answers my questions fully. AI: The accelerometer address is 0x1D by default and can be changed to 0x1C with a bit of soldering(Found in the Address Select Jumper section of the guide you linked). The gyroscope address is 0x69 by default and can be changed to 0x68(Found in section 6.1.1 of the datasheet, and the I2C Address Jumper section of the guide you linked). The Arduino can theoretically support as many I2C devices as can be acquired without having two that share an address. Note also that accelerometers and gyroscopes are often packaged together on a single chip, which may be easier to work with. I've used the MPU-9150 with good results.
H: Relay "sticking" We are experiencing a problem where the mechanical switch of a SPST NO relay (COTO 9007-05-01) is not opening back up when the coil is de-energized. Current keeps flowing through the switch until we give the relay a (somewhat gentle) flick. We measured voltage and current on an o-scope (a Tektronix current probe for the current), and everything appears to be in order: On/Off voltage connected to coil appears good, On/Off current through the coil appears good, on-current through the switch well below rated current, open voltage across the switch well below the rated voltage, no unreasonable spikes, the coil has a fly-back diode installed... We even replicated our setup with different everything (including relays) and got the same results. Any suggestions on what to do/check? AI: I am in agreement with @BruceAbbott's comment, above. I suspect that although your static load current is well within the relay's capability, the surge current when it closes, probably due to charging caps and/or firing up an SMPS, is welding the contacts. I suspect this because I have seen precisely the behaviour that you're describing, down to the sharp tap on the relay body causing the contacts to release. My solution was to cause the device that I was switching (that was powered by an SMPS) to soft-start using an LCR network between the output of the relay and the input to the device. If the cause of your problem is SMPS inrush current, and you have control over the SMPS, you may be able to put it into a "soft start" mode, either because it has the capability and just needs to be configured to use it. Alternatively, try my solution. Apologies, it was 10 years or so ago, I can't recall exactly what I used; a small series resistor (<10R) and large inductor (100uH?) and various smallish caps (1-10nF) to ground sounds vaguely familiar.
H: Why does a headphone attenuator need separate resistance for each side instead of a shared resistor for both? I have a Shure headphone attenuator and opening it up it looks like there are separate pins on the pot for the left and right speakers (the pot has 5 pins, which I believe are left in/out, right in/out, and ground), like this: (I have no experience creating schematics and I'm not sure what I should be using to represent the input or how to represent the 5 pin pot, but I've tried to convey what I'm talking about) simulate this circuit – Schematic created using CircuitLab Why is the resistance applied separately to the left/right sides, instead of using a pot with 3 pins and applying between both speakers and the ground, like this? simulate this circuit My reason for wanting to understand this is that I want to modify a 4-pole TRRS headphone extender to create a fixed-resistance attenuator compatible with headphones with a remote/microphone and I'd like to understan the circuit on my existing attenuator. AI: If you do as you say there will be interaction between the left and right channels. Any signal in one channel will result in a voltage across the resistor that will then excite the other channel. Stereo systems go to great lengths to minimize crosstalk between channels. Ideally there should be less than 1% of the signal in the left channel getting into the right channel and right to left (this is about -40dB).
H: Voltage regulator I have a few RC planes and I want to use them upgrade them for night flying. I would like to add EL Wire and/or Arduino + NeoPixels. I am more of a software guy than an electrical engineer so I am struggling with some basics. Using an extra battery to drive my circuits is too heavy. I need to tap into the existing battery to get power. EL wire typically uses an inverter that is powered with 3V (2 AA's) My Arduino setup is using Adafruit Trinket 5V and 5V NeoPixels. What is the best way with little weight to draw 3 & 5 volts from 3.7V (1s), 7.4V (2s), and 11.2V (3s) LiPo RC batteries? Another big question is amperage. I understand too little is a no go but, when is too much a concern? AI: The best way is to use a switching regulator, stepping down from 7.4V or 11.1V (depending on what voltage battery you are using). Don't tap into the battery to get a lower voltage, as this will unbalance the cells. Small lightweight switching regulators designed for RC models are readily available. They are usually called a 'BEC' (Battery Eliminator Circuit) and are commonly rated for 3A output - more than enough for your purposes. To avoid having to use another regulator to get 3V, get an EL inverter that is designed to run from 5V (eg. Align Driver For Cold Light String BG71011A). Alternatively you could just stick with LEDs, which are easier to use and more reliable. To get the best effect for night flying I recommend shining the LEDs onto parts of your model rather than pointing them outwards. That way you get better coverage with fewer LEDs, and a softer light that won't blind you! If your model runs from a single 3.7V cell then you probably need to keep it as lightweight as possible, so just run everything directly off the battery. If you must have 5V to power an Arduino etc. then use a step-up regulator (eg. TURNIGY Voltage Booster for Servo & Rx (1S to 5v 1A)). I'm guessing you probably don't want to do that though, because models powered by a single cell are usually so light that the extra weight will seriously affect their flying ability.
H: How do I find the corresponding level of those audio samples? I am trying to self-study this problem for a future exam. The writings in red are solutions to the question. I have a problem in number part e of the question where they find the corresponding level of the samples from the audio signal's equation. We have 256 discrete levels, and five samples. I did not understand in part e why does the value of the sample 3V corresponds to the 255th level. and why -1.248 corresponds to the 74th level, and so on... Any help? AI: I see, the 2nd sample of the cosine wave is -1.248 volts and this would be between the 74th and 75th quantize levels (effectively 74.752). With ADCs you usually round-down to the nearest integer. This makes it the 74th level. This is based on dividing the full 6 volt range by 256 to get a quantize step size of 23.4375 mV. Take -1.248, add 3 volts to it to get the range of voltage above -3 volts (binary 00000000). The 2nd sample is therefore 1.752 volts above -3 volts. Then divide 1.752 volts by 23.4375 mV to get 74.752 (quantize step number as a non-integer) - then round down to get the 74th sample.
H: How are crossing lines implemented on microchips? I always imagined the photolithographic microchip manufacturing to be a 2D layer creation process without layering, thus creating a topological problem for circuitry when you have some \$K_{3,3}\$ or \$K_5\$ in it, which would certainly be the case for any non-trivial design. And there are papers out there talking about producing "3D" chips with multiple layers to save space, thereby adding to the confusion. Yeah, that's sad, but that is what I learned in school, a bunch of mysterious riddles. It's no wonder people start conspiracy theories about aliens catering those technologies to us. So how can we build complex processors and chips just using a 2D topology ? AI: It turns out that there are layers, but people sometimes skip those when talking about how a microchip works. The process that introduces layers is called Back end of line, or BEOL. It basically works like this: Create the 2D chip layer using photolithography Apply an insulating layer Drill holes into that layer Apply a conducting layer, also filling the created holes and create circuit paths or interconnects Repeat those steps as often as needed and your manufacturing process and maybe other considerations such as thermal design allows
H: How can moving my foot possibly affect electronics meters away? I'm curious about a strange effect I observed. I was designing a device, which sleeps most of the time and can be woken up by a loud sound signal, like an opening door, a clap, etc. The relevant part of the schematic: simulate this circuit – Schematic created using CircuitLab The ambient noise is picked up by an electret mic, amplified, and sent to a digital input on the MCU. The trimpot serves for sensitivity adjustment, so the user can tune the sound pressure level that should trigger the device. All this is very crude, as the pin threshold is not strictly defined, and the pot is not in the usual "divider" configuration (the gain selection is not linear), but that is not the issue. When I soldered this, I noticed it didn't work; it wasn't picking sounds unless they were very loud, so I increased the amplification to absurd levels (trimpot turned to the limit, think of 19990 ohms on the right side and 10 ohms on the left side). Even at that levels, clapping hands only registered as 300 mV pulses. While walking around the room, pondering on what can be wrong, I noticed that the oscilloscope was picking enormous signals on the opamp output, up to 5 volts. Thinking that must be the noise of my walking, I experimented more, and discovered that even in a completely quiet room, just lifting my foot of the ground produced that signal. It wasn't the sound of it, just the movement. And I was 2-3 meters away from the circuit. In a sense, the slight act of lifting my foot (or just altering its position) got registered by the sensor; whereas flipping a light switch, making a big noise with hands, etc. did not. In the end I found what the problem was. The sensor I was using is a ECM30B. It has the traditional two pins, along with a metal tab protruding from the casing, that also seemed that needs to be soldered. Usually these mics have the ground pin and the casing inherently connected. But this one wasn't. When I connected them, the circuit behaved as expected, and with the huge amplification it picked even minute sound noises. In a sense, the circuit was open at the "X" point. Not really, since the ground pin of the mic was soldered to ground, but just the casing was floating. With this in mind, what could have been the effect that captured my foot moving meters away (even considering the enormous amplification), but ignored similar movements with my hands? AI: The case of your microphone is probably electrically connected to the flexible membrane inside the microphone, and is responsible for grounding it, while the "ground pin" is only used to provide the return path for the FET preamplifier. In normal operation, both need to be grounded so that there's a complete circuit to drive the gate of the FET. With the case "floating", the microphone is no longer senstive to sounds, but it does become very sensitive to external electric fields of any sort. Walking around, or even just lifting your foot, can create large amounts of static electricity, particularly in a dry environment, and the field associated with your body was affecting the case of the microphone. Your body might have a potential of several thousand volts, and it only takes a few mV to drive the gate of the FET.
H: Where can I learn Switched Mode Power Supply Design? Recently I've had terrible luck buying those little DC-DC boards from China off of eBay. We've been trying to build projects where we have some sort of wobbly input DC off of a car or solar, batteries and things. So I've started trying to learn how to design and build my own DC-DC SMPS circuits. I'm very new at this, so I'm looking for something that I can use as a calculator (input Vin and Vout, etc) but also I need to understand what's I'm doing and what's going on. To start with I've decided to take one of our projects which needs an SMPS and build it, something which these little boards off of eBay would probably be unsuitable for. Project: A portable, battery powered audio amplifier. I'm going to buy a DIY amp board, deliberately choosing one which requires a high voltage to run (http://goo.gl/Idwos8 or http://goo.gl/11S6TJ perhaps) and are cheap so I won't get upset if I blow it up. Then, take something cheap and wholly unsuitable to run it off, such as 4xAA batteries. So, about ~6V in and I need ~30V out. So there we go, where can I get a design which lets you calculate how to build a 6V to 30V SMPS? Once I've done that I need to then build something useful. I though I'd start with a 12V VRLA battery, step that up to 36V. Problem then is how do I, you know, make it not melt when there is hundreds of watts happening? AI: If you are keen to learn lots there is a free version of a book called Principles and Elements of POWER ELECTRONICS By Barry W Williams Google for it. It is very good and maybe overkill for you right now. However, reading certain sections lightly might help. I am still plowing my way through it to update knowledge I learnt 25 years ago. From Adam Davis's comment. Here is a link that you could download the book in various chapters. Book Link Again to pull good information out of the comments here is a link to more info about types of modern Power supplies. Has the added advantage of an online PSU calculators of various subtypes, Buck, Boost etc. PSU Calculator Site
H: Simplest analog circuit to compare two song signals? I am trying to build a simple analog circuit that compares how similar two song signals are. One signal is the song sung by me, for example, and the other signal is the reference song signal. Since simplicity is very much wanted, I do not expect it to be very accurate or "formal". As long as it can give me a rough measurement how close the song sung by me is to the reference song , I am perfectly happy. At first, I thought about making an analog circuit doing Fourier transform/series and then comparing how far the two signals' frequency components fall, but the responses suggest that it would not be easy. So I am open to any ideas/implementations now! The components available are opamp, diode, resistor, capacity, MOSFET, BJT, NAND gate, NOR, gate, D-flipflop, and counter. AI: Cross-correlation is a measure of similarity of two signals. The Fourier transform uses this property to Transform signals versus orthogonal (Sine and Cosine) reference frequencies, expressing the Fourier transform as a linear combination of Sines and Cosines. Therefore you could simply use a correlation circuit whose inputs are i) the signal of interest; ii) Cosine of varying frequency. Repeat for Sine (ideally in parallel). Then you have measurement of correlation from which you can calculate the Magnitude and Angle as usual. To see how it works, consider a signal containing the component cos(W1.t) and correlating it with the test signal cos(W1.t) ; i.e. the same frequency. As correlation is simply multiplying and integrating the product will be cos^2(W1.t) = 1/2 + cos(2W1.t). Assuming you test various frequencies across whole integer cycles, this will be the only component that integrates to a non-zero value (i.e. has a DC component). That's how the FT and DFT work. I've found a very informative article on the link between the DFT and correlation, that really describes it very well.
H: What is this part (label is 23LCVB I/P JWD 1336, 8-DIP package)? I found this part in a box with random parts. Mostly they were voltage regulators, opamps and transistors (both BJT and FET). The closest match I found was this SPI SRAM, but the part number didn’t match completely. AI: It's definitely a Microchip 23LCV1024. Section 6.1 of the datasheet shows the markings on the top line of the DIL8 as "23LCVB".
H: Zigbit ATZB-24-A2 SMD to DIP socket I'm looking for solution how to mount Zigbit ATZB to prototype board without making individual PCB with pin outputs. Do you know any socket adapter with pins spacing like this? Or any other solution for this? AI: The question lacks a specification of the prototype boards pin pitch, but I'll give it a shot anyway. You could use a pitch adapter from the Zigbit ATZB's 1mm pitch to 2.54mm, like this: http://www.proto-advantage.com/store/product_info.php?products_id=3800027
H: Link Capacity and the Shannon-Hartley Theorem I'm reading Computer Networks: A Systems Approach by Peterson and Davies. One of the examples demonstrates the relationship between link capacity and the Shannon-Hartley Theorem. We can find the channel capacity by the formula: $$C = B \log_2 \left( 1+\frac{S}{N} \right)$$ In the example of the book, they define bandwidth of the channel to be 3000Hz and the signal to noise ratio to be 30 dB, which they say would imply that S/N = 1000. $$C = 3000 \times \log_2 (1001)$$ However, I don't understand how a signal to noise ratio of 30 dB is equivalent to 1000? How is this worked out? It's not explained in the example. AI: In the formula, S/N is the power ratio of signal to noise. If this ratio is expressed as 30 dB, then we have 10log(S/N) = 30 which results in a value for S/N of 1000.
H: What's the thermal time constant/capacitance of a 1/4W resistor? I can't find it anywhere, what is the thermal time constant or thermal capacitance of a standard discrete 1/2W resistor? A table with other resistors of different power ratings would be nice, too. AI: OK a table of volumetric heat capacity for @gbulmer. Material Heat capacity (J/(K*cm^3)) at 300K. Aluminum 2.42 Copper 3.4 Iron 3.5 Al2O3 3.0 G-10 2.7 Nylon 1.7 Addition: Guesstimate of time constant for through hole resistor. So let's just assume the whole thing is made from ceramic, say Alumina. Thermal conductivity is k = 30 W/(m* K) = 30mW/(mm* K) (millimeters will be easier for me) And make the diameter 2 mm (area = ~3mm^2) and the length 6mm. Then thermal conductivity (end to end) is R = 1/k * l/Area = 67 K/W. Then the heat capacity is 3J* volume (cm^3) = 18 mJ/K. Now we need to scale the thermal resistance by some amount. I'll guess 1/2 (say 30K/W) but this is most likely not enough. (I'll over estimate the time constant.) Then the time constant is 30k/W*18mJ/K = 0.54 seconds. So that seems OK, but maybe high. As an interesting aside I once tried to measure how much of the heat in a through hole resistor comes out through the leads. The answer was basically zero, except with very small heat input... and the numbers were still "in the noise". Through hole resistors are meant to cool by convection around the body.
H: Diode Logic Gates For some reason, I understand transistor logic gates, and I am able to solve problems, but for some reason I do not understand the and / or logic gates constructed by diodes. If someone can explain it to me using circuit analysis, I would appreciate that. AI: All you have to remember, is that current flows through a diode in the direction of the arrow. In the case of the OR gate, if there is no potential (i.e. logic 0, or ground) on both inputs, no current will pass through either diode, and the pull-down resistor R\$_{L}\$ will keep the output at ground (logic 0). If either of the inputs has a positive (logic 1) voltage on its input (In 1 or 2), then current will pass through the diode(s) and appear on the output Out, less the forward voltage of the diode (aka diode drop). The AND gate looks more challenging because of the reversed diodes, but its not. If either input (In 1 or In 2) is at ground potential (logic 0), then due to the higher potential on the anode side due to the positive voltage from resistor R\$_{L}\$, current will flow through the diode(s) and the voltage on the output Out will be equal to the forward voltage of the diode, 0.7v. If both inputs to the AND gate are high (logic 1), then no current will pass through either diode, and the positive voltage through R\$_{L}\$ will appear on the output Out. -------------------------------------------- As an aside, diode logic by itself is not very practical. As noted in the description of the OR gate for example, the voltage on the Out terminal when there is a logic high (1) on either of the inputs will be the voltage on the input minus a diode drop. This voltage drop cannot be recovered using just passive circuits, so this severely limits the number of gates that can be cascaded. With diode logic, it is also difficult to build any gates other than AND and OR. NOT gates are not possible. So enter DTL (diode transistor logic), which adds an NPN transistor to the output of the gates described above. This turns them into NAND and NOR gates, either of which can be used to create any other kind of logic function. Sometimes a combination of diode logic and DTL will be used together; diode logic for its simplicity, and DTL to provide negation and regeneration of signal levels. The guidance computer for the Minuteman II missile, developed in the early 1960's, used a combination of diode logic and diode transistor logic contained in early integrated circuits made by Texas Instruments.
H: Amplitude and phase spectra of fourier series If I have even and periodic signal \$x(t)\$ that has cosine fourier series $$ x(t)\sim\underbrace{\frac 12}_{a_0}+\sum_{n=1}^{\infty} \underbrace{\left(\frac{6\cos \left(\frac{n\pi }{3}\right)-6\cos \left(\frac{2n\pi }{3}\right)}{n^2 \pi^2} \right)}_{a_n} \cos \left(\frac{n\pi t}{3}\right)$$ because for even function my \$ b_n=0 \$ coefficient vanishes so \$ C_n = a_n \$ If I want to construct amplitude spectra I plot \$a_n\$ with \$n=0, \pm 1\, \pm 2\,...,\$ right? Like this? $$\begin{array}{c|c} n & a_n \\ \hline 0 & 0.5 \\ \hline \pm1 & 0.61 \\ \hline \pm2& 0 \\ \hline \pm3& 0.14 \end{array}$$ But how about the phase spectra. Phase or \$ \theta=\arg(C_n)=\frac{\operatorname{Im(C_n)}}{\operatorname{Re}(C_n)} =\arctan \frac {-b_n}{a_n} \$. But in my case there is no \$b_n\$. Doesn't my fourier serie have phase spectra? AI: If you calculate some more of them, you will come to the conclusion that almost every odd coefficient \$a_n\$ is a real positive number, except for \$a_3, a_9, a_{15}...\$, \$a_{3+6k}\$, where \$k\$ is a non-negative integer. These are all negative. (And every even coefficient is zero.) For those, which are positive numbers, the phase is 0 degrees/radians; for those, which are negative, the phase is -180°/\$-\pi\$ radians, because negating a periodic signal is equal to shifting its phase by -180°. Be careful using arctan, as it has a value range of \$\pm 90°\$ but both 0° and -180° has the same tangent value, zero. Here I plotted the values and the phase spectrum from \$n=0\$ to \$n=21\$. Edit: The first image is obviously not the amplitude (as it can't be negative), just the values of \$a_n\$ from 0 to 21. My bad.
H: Participation of DC component in total average power of signal My task is to calculate participation (in percent) of DC component in total average power of signal from photo: I represented this signal as complex Fourier series: $$u(t)=\frac{1}{2}+\sum_{n=-\infty,n\neq 0}^{n=\infty}\frac{1}{2n\pi}e^{j\frac{\pi}{2}}e^{jn*500t}.$$ Average power of signal is calculated using formula $$P=\lim_{T->\infty}\frac{1}{T}\int_{\tau}^{\tau+T}(f(t))^{2}dt$$ but how should I use it here? And how to calculate participation of DC component? Thanks in advance. AI: This question is likely asking you to recall Parseval's identity, which is stated as $$\sum_{n=-\infty}^\infty |c_n|^2 = \dfrac{1}{2\pi}\int_{-\pi}^\pi |f(x)|^2 \, dx$$ where \$c_n\$ are the coefficients of the Fourier series of a periodic function \$f(x)\$ with period \$2\pi\$. You can see that the right-hand side of the identity is proportional to the average power of the signal. So, with some manipulation of the scaling factors, you can use this to assign a portion of the power of the single to each of the fourier components. Note 1: I assume that your signal repeats on every interval of time T (that is, \$f(t+T)=f(t)\$). The way you've drawn it,it looks like the signal is 0 outside the region \$0 < t < T\$, but that would make it a non-periodic signal and it wouldn't make sense to talk about its Fourier series representation or average power. Note 2: Notice that in your formula for the average power, you are have two different variables named T. One which you take to the limit of infinity, and one built in to the definition of the function f. Since f is periodic with period T, you don't need to take a limit and you can just use $$ P = \dfrac{1}{T}\int_\tau^{\tau+T} f^2(t)\, dt$$ for any \$\tau\$ of your choice.
H: Code Security of ARM Cortex M4 MCU What are the main methods the code inside a certain ARM Cortex M4 MCU (TI LM4F120H5QR etc) can be extracted after deployment? Is it possible to completely stop a third party from stealing the code in it? AI: Complete is never possible. You can just raise the effort & cost. It has nothing to do with 'cortex m4', but everything with the manufacturer's implementation of the chip. Your chip has the usual set of read/execute protection bits. I doubt much is known in the (open) literature about the detailed weaknesses of such a new chip. Very generally speaking, such a 'run-of-the-mill' protection scheme is OK against individual hackers, most countries, and low-budget competitors. It probably won't hold against a large corporate competitor (IBM/Apple/Google sized, especially if they own a chip fab), the CIA, or the combined effort of the hacker community. A notable way to protect your code is to hide as little as possible, so reduce the population that will take part in hacking your product. If the 'combined hacker community' wants to do something with your device that you don't really object to, make sure they can do that without totally hacking your device. That will substantially reduce the combined effort put into hacking it. What the mechanisms will be that can be used to circumvent the protection scheme of this particular chip can't be predicted, but you can read how other chips have been cracked for an idea of the range of methods. Just a few: out-of spec power supply voltages and/or cycling careful monitoring of supply current decapping the chip and disabling the protection scheme by UV light, or by cutting lines decapping and reading the electrical charges (or currents) in the memory array
H: Replace mechanical switch with transistor? MOSFET? Relay? If I have a switch in some consumer electronics that I take apart, and want to replace a mechanical switch with a digitally controlled one, which component should I use? The only problem I see with MOSFET/transistors is don't I need to know if it is going to be a high side switch or a low side switch? What if I don't have access to the whole circuit when choosing? Just wondering if there is a rule of thumb for choosing which method to replace a switch I'm missing. AI: Without knowing the exact details regarding the circuit connections that the switch was connected to it is not possible to give a generic answer as to what semiconductor components could replace the switch. What you can do though is to select a relay that has contacts with ratings similar to the switch. Ratings being the current carrying capacity of the contacts and the open circuit voltage rating of the contacts. And whether specified for AC or DC service. With the relay in place you can now control the relay coil as suitable to your remote control system and be totally isolated from the device which is being switched.
H: AD620 voltage noise and ADC SNR calculation I want to calculate theoretically my effective resolution from C8051F350 in-built sigma delta ADC with different interface options like ISL28134, ADA4528, ADA4898, OPA211, mcp6v07. I want to know their noise in 0.1 to 10 Hz range. Shown below is my ADC interface.(it will be different if I use ad620) Actually its a old schematic My LPF before ADC will have cutoff of 10Hz. So when I look at datasheet of ad620 it gives Noise peak to peak at different gains RTI, my question is why did noise reduce at higher gains.? My second question is, I know my ADCs rms noise at different PGA gains so how should I combine that noise with the noise of interface circuit to find effective resolution? Also is it possible to get differential o/p from AD620, and will it be beneficial to reduce noise? Can someone give me math to find ADC ENOB with above interface circuits. AI: Why did noise reduce at higher gains? I assume you are referring to this figure: - And if so then the input noise does appear to decrease with higher gains. However, if you look at the data in the table below: - You will see that the voltage noise in the graph comprises two noises - real input noise and real output noise - total noise (referred to input) as shown in the graph is a combined version of the two. So, when you have a gain of 1 the dominant voltage noise is output noise and if referred to the input (gain of 1) remains the same figure. At a certain gain, both noises will contribute equally and that will be approximately at a gain of 8. At a gain of 10 and at 1kHz, the input noise of 9nV / rt(Hz) will be 90 and the output noise will remain the same at 72. These are then vectorially added like so: - \$\sqrt{90^2 + 72^2}\$ = 115 And, as you can see, the referred input noise at a gain of 10 (at 1kHz) is about 11 or 12 on the graph. I know my ADCs rms noise at different PGA gains so how should I combine that noise with the noise of interface circuit to find effective resolution? You vectorially add all the noises as per how I did it above (\$\sqrt{A^2 + B^2}\$). Also is it possible to get differential o/p from AD620, and will it be beneficial to reduce noise? The AD620 is what it is - if you want a differential output then you have to add an op-amp inverter to create that extra output. Whether it will be beneficial depends on the ADC used and I remember going thru the data sheet (of biblical length) and losing the will to live during the process. Can someone give me math to find ADC ENOB with above interface circuits? Here is some background - you need to understand SNR first and, for an ADC it is asssumed the signal input p-p voltage is at about 95% full scale and a sinewave. If your input ADC range is 2.5 volts then the RMS value of the 95% signal is about 0.84 volts - this is the signal. Why 95%? Because the theoretical full range of the ADC can never be guaranteed for every device (due to offsets and gain errors within the device). SNR is therefore your signal divided by the total noise into the ADC. This kind of also gives you the ENOB but it doesn't take into account non-linearites in the ADC producing harmonics of the input signal - commonly called distortion. You then end up with what is called SINAD - signal in noise and distortion as the replacememt "quality figure" for assessing one ADC against another. ENOB = \$\dfrac{SINAD - 1.76 dB}{6.02}\$ I'd encourage you to read this fine paper by ADI.
H: Choosing an SMD LED size I am designing a PCB an need an LED on it. I'm going to direct the light from the LED using a light pipe, so I need it to be as bright as possible. The question is what size I should use? All the other components on the PCB are 0805. Does the brightness of an LED depend on how large the component is? I.e. can I get brighter LEDs if I choose a 1206 footprint? Or are 0805 and 1206 LEDs the same brightness? AI: The brightness is not defined by the footprint, but by both what is inside the LED and the lens style. The data sheet will provide a number of milli-candelas (mcd) for different currents. The data sheet will also provide a viewing profile - a map of how the light is emitted from the LED. For working with a light pipe you want to be looking for an LED that has as tight a viewing profile as possible so the maximum amount of light is fed up the pipe and not spread around the interior of your unit.
H: CS4234 has two I2S data I/O lines? I have an application where I'll be sending audio data to a codec. The CS4234 fits my needs very well, although with other I2S codecs, there have only been one data in line for the communication. The CS4234 has two input data lines and two data out lines (SDINx and SDOUTx). Since I only have one processor that will be communicating with the CS4234 codec, do I need to terminate or do something with the other input/output lines I won't be using? I don't think I need to do too much since the 2nd SDOUT line is also an address bit set pin (which brings up the question how would the chip know its using two SDOUT lines if the address bit isn't set...odd) "Bonus" points if you can explain what they mean by low latency data AI: According to the datasheet, SDINx signal have an internal pull-down, so you can leave the pin unconnected. For the AD2/SDOUT2 you'll need to put a pull down or pull up resistor as it will set the I2C address. And as you don't use the SDOUT2, you will only have your pull up/down resistor. Latency is the time between the signal enter the chip and when it will go out. The "normal" path is in blue on the previous figure. You can do a lot of transformations on the signals but the latency can be high. 4.6.3 DAC1-4 Path The DAC1-4 path includes a programmable group delay which delays the output audio signals to allow the DAC5 output to operate in feed-forward fashion, adjusting the voltage rails of the tracking power supply in anticipation of the coming audio signal The group delay can be between 0 and 500 µs to adjust with the DAC5. And the detail for Low-latency path in green: 4.6.4 Low-Latency Path A low-latency path is provided to allow four user selectable data signals to be routed around the group delay block and interpolation filters of the DAC1-4 path. These four signals can be present in any of the 32 slots on the two TDM streams on SDIN1 and SDIN2. Finally from the characteristics: The DAC1-4 path is quite longer than the low-latency path (11/Fs against 2/Fs in single speed mode) due to the interpolation filter. The DAC5 path is adjustable to have a latency equal to the DAC1-4 path or the low latency path. Be careful to the Note 24 which state that you need to add the "Group Delay" (first block of blue path) to the specified delay. EDIT : (forgot the address at startup) For the AD2/SDOUT2 signal, when the internal reset signal of the chip is going inactive a small circuit will check the "value" of the AD2 input. This only occurs at the startup phase of the chip, after the startup is finish, the pin will be "tied" to SDOUT2 signal. This is a kind of a mux working at the startup. Many chips having an I2C bus use this trick to allow users to configure the address without adding multiple address pins. Some will even use +VCC, GND, High-Z, pull-up or pull-down "sense" to offer up to 5 configuration of address with one pin.
H: Sum toroidal transformer outputs I`m planning to buy a toroidal transformer for driving an LED. The LED needs 36 V and around 1 A. I found a toroidal transformer which has a 230V Input and two 18V 0.83 A Outputs. Can I simply sum the outputs by connecting both positive outputs and both negative outputs to my LED? AI: No, you cannot "just" anything with a transformer, until you are sure about the make-up of the secondary windings. For example a 18-0-18 make-up, which is common in transformers for lower power amplifiers, means it has 2 windings of 18V, but they are already put in series inside the transformer. Yet again, if you have {18V} {18V} as separate windings, it is not uncommon to have two wires of the same colour for each winding. If you want to put them in parallel you will need to make sure you connect the right two wire to each other. If you connect them in reverse your transformer will see a very strong short-circuit and 1. consume a lot of power with no output, 2. eventually burn out. Also be aware that a transformer has no "plus" or "minus". What comes out of the transformer is an AC voltage, meaning it goes from + on one wire and - on the other, to the other way around at 50 to 60 times per second. LEDs don't like reverse voltage at all. So connecting an AC to a LED will always degrade its lifespan, even if the AC voltage is under its breakdown limit. So you need to rectify the AC voltage. Some care may have to be taken by not taking the full 0.83A as well, but with design margins on the transformer, that's probably less important. If you just rectify your LED will still blink. If you want to minimize that, the schematic below is the safest bet. If you know what's going on with the transformer you can save on one rectifier by combining the windings before rectifying, assuming they are exactly the same otherwise. If you are not sure, just use the two rectifiers to be absolutely sure you don't make mistakes. The chosen capacitor gives reduced effect on the blinking, but does increase the effective DC voltage. In this case by about a factor 1.33. If you double the capacitor the blinking will be gone entirely and the effective DC voltage will be 1.4 times the AC voltage. simulate this circuit – Schematic created using CircuitLab So as drawn: Vdc = 18V * 1.33 = 23.9V (with load!, without load it's the same as the next one!) With double capacitance: Vdc = 18V * 1.4 = 25.2V
H: How does a CPU choose a path? This is the most baffling question of all other concepts. I ask my teacher "How does the computer choose a path?" "They program it" "How do they program it?" "..." I have a basic understanding of how a transistor works, how the CPU handles things, and the latter, but how does the CPU physically choose a path!? I want to learn the college level stuff, but google is not helping!!! All I get are these novice translations! Please help because I'm crying over not knowing the answer. Literally. EDIT: I need a thorough answer explaining what is going on in the hardware please. AI: I'll make a brief attempt to explain the Datapath implementation, since it is a large topic. CONTROL WORD : Control Word is basically the input code ( You can say, The master code) which controls what operation the computer will perform. A General control word will consist of an opcode, specifying a particular operation, like add or shift, followed by a few parameters like location of operands or the operand itself etc. In this figure, the control word wont be directly visible, so I have added another figure. Be careful, the second figure is not directly related to the first one. Here a simple control word is shown. ---> DA stands for Destination and specifies the location where the result of computation will be stored. ---> AA and BA specify the location of operands A and B. ---> MB, MD are the Mux B and Mux D enable input (More on that later). ---> FS is the function select, and specifies what function the unit will perform. Now back to figure 1. ---> A select and B select inputs are applied to Mux A and Mux B, which select the data inputs from the registers R0 through R3. ---> The input B is then passed to Mux b, to decide whether it is needed or not, because some operations only require a single operand, like shift and increment. ---> The A input and the output of Mux B ( which consists of either input B or a constant, as seen in the figure) is then applied to ALU. Note that B input is also applied to the shifter. ---> The opcode or Function select determines what operation will it be. At this point, the output of both the shifter and ALU is applied to Mux F, which selects whether it the output of ALU or Shifter which is needed. The Mux F select maybe a part of opcode. ---> Finally, the result passes through Mux D, and then it is applied to each of the registers for storage purposes. Which register to store in is decided by the And gates which enable Loading operation, with the address of the registers applied via decoder. I hope this explains it.
H: Why do microwave ovens, with metal walls, not blow up? Why does a microwave oven with metal (?) walls work fine, but if I (theoretically) put a metal spoon in it, "bad things" may happen? Maybe these internal walls are not conductive? AI: Metal in a microwave is really not a big problem. The walls of every microwave ever made are metal, the window contains metal mesh, mine has a metal shelf and a metal base for the turntable. The general guideline of "do not put metal objects into a microwave" does make sense - metal in the oven has to have a certain shape, size, alloy, distance from other pieces etc. or it will really do unpleasant things like arc and get dangerously hot. The rules are complex and as the average microwave oven owner doesn't have a post-graduate degree in physics with at least a minor in high-energy radio it's just easier to say "no metal." People who really do know better will also know that they can ignore the note on the box, but the lawyers can point to the note on the box after your attempt to home-sinter aluminum powder burns the kitchen down.
H: Difference amplifier show fixed voltage on its output I'm using a difference amplifier as shown on this page: I double checked my resistors values, I have RA=10k and RB=56k. I'm using a 5V reference and a 0V ground. On the actual board, I have V1=0.1V to V1=0.4V (this is adjustable) and V2=0.5V. However the output is always Vout=3.85V, even when I change the V1 voltage. I double checked the resistors and LM324 pins, and see nothing wrong. I also measured V+=V-=0.684 when V1=0.4V and V+=V-=0.542 when V1=0.1V How could I determine what is the cause of the problem? Do you have any idea at what the problem could be? AI: Hmm so the opamp supply pins are +5 and ground? The 3.85 V output suggests the opamp is hitting the positive rail. V(+) should always be 0.5V * 56k/66k. Check all the pins and such and make sure you haven't mixed up the inputs. Then try a new opamp maybe you let the magic smoke out of this one and didn't see it. :^)
H: Why doesn't the MCU's pin go high on time? I have a STM32F103 and I downloaded this program to it(a simple blink program): /* Includes ------------------------------------------------------------------*/ #include "stm32f10x.h" #define SYSCLK_FREQ_72MHz /* Private functions ---------------------------------------------------------*/ GPIO_InitTypeDef GPIO_InitStructure; NVIC_InitTypeDef NVIC_InitStructure; void GPIO_Configuration(void); void delay(uint32_t a){ while(a){ --a; } } /******************************************************************************* * Function Name : main * Description : Main Programme * Input : None * Output : None * Return : None * Attention : None *******************************************************************************/ int main(void) { GPIO_Configuration(); /* Infinite loop */ while (1) { delay(0x44AA200); GPIOB->ODR ^= GPIO_Pin_0; } } /******************************************************************************* * Function Name : GPIO_Configuration * Description : Configure GPIO Pin * Input : None * Output : None * Return : None * Attention : None *******************************************************************************/ void GPIO_Configuration(void) { RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB , ENABLE); /** * LED1 -> PB0 */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_Init(GPIOB, &GPIO_InitStructure); } I expected that delay(0x44AA200); works for 1s but but when I run it, this delay take 6s!! Why? Is it related to the 3 stage enhanced pipeline? this is the RCC configuration and I thing everything is ok: and this is the assembly code: AI: You are executing your loop 72000000 times. You seem to think that each loop will take one clock cycle. However, at minimum, even the simplest loop with a counter will take multiple operations: De-increment, compare, conditional jump. Also, not all assembly operations take just one cycle. In this case, you have two assembly operations in your loop: 0x080000562 SUBS r0, r0, #1 0x080000564 BNE 0x080000562 The SUBS flag subtracts, (SUB fragment), and sets conditional flags (S fragment). The BNE does a branch (B fragment) if not-equal (NE fragment). The STM32F103 is a Cortex M3 based processor, which means it uses the ARMv7-M architecture. Looking up the Cortex M3 architecture assembly listing, we see: Operation Description Assembler Cycles Subtract Subtract SUB Rd, Rn, <op2> 1 Branch Conditional B<cc> <label> 1 or 1 + P So the subtract operation takes 1 cycle, and the branch takes either 1 (if the branch is not taken), or 1 + P if it is. P in this case is: "The number of cycles required for a pipeline refill. This ranges from 1 to 3 depending on the alignment and width of the target instruction, and whether the processor manages to speculate the address early" In total, assuming P is 3 in this case, this only results in 5 operations, so I'd assume that either you're seeing a five second delay, not six, or it's possible the addition of the S fragment to SUB causes it to take another clock cycle (but I'm just guessing there).
H: Is this a dual cap? As you can see below , this cap is marked 8 + 8 uf. Does this indicate that it is a dual cap? There only seem to be two actual terminals, as you can see here , although there are also three lugs around the rim. Can anyone help me understand what this component is and what the terminals are? AI: Yes, it is a dual capacitor. One of the terminals is common between the two capacitors in the package. The case acts as the third terminal, but you will need to see the capacitor datasheet to find out which terminals are connected to which capacitors.
H: newbie question: can I plug a 250v power strip into a 120v power outlet (and then connect three 120v power adapters to the power strip)? I'm sorry if the question is too dumb, but I was wondering if I could connect a power strip rated for 250v into my home's power outlet (120v). I wanted to connect 3 power adapters rated at 120v to it (that would then power up some effect pedals I have for guitar). Could the wire gauge inside the power strip be a problem? Because I thought that since the rated voltage support is higher, there shouldn't be any problem (I mean, resistors and eventual caps wouldn't catch fire, but would they some how underpower my power adapters?). Please correct me otherwise. Thank you! AI: The answer may be both yes or no, depending on some details. You will get a yes answer if, and only if all of the below are yes: Your adapters are all guaranteed to be rated at the voltage that comes out of the wall socket (I believe to read in your question this is the case, but be 100% sure). The power-strip you mention does nothing fancy. i.e. it has only pieces of metal and wire intended to let you go from one outlet to multiple outlets, no internal electronics that may behave weirdly on a voltage below rated. A neon-light in a switch is okay, they're too stupid to cause problem ;-) The current you will draw is less than the current the strip can distribute. For point three, if the strip only has a wattage rating, I = P/V, use the highest voltage it can operate at to be safe, so 250V. So if it says 2500W, it can handle 10A. Which means for your adapters, try and stay at or under 1000W (100V * current) and you'll have used a little margin in both calculations and will stay on the safe side. EDIT: Point 2 can get a no and the end-answer still be yes, but within the range of (over-)equipped power-strips there are sooooo many different functions and functionalities that it's a bit senseless to add all the options, since I'm not in the mood to write a 110 point list.
H: Ripped off connector with no trace left My friend's phone (ZTE F101) had the miniUSB connector ripped of the board, and when it broke it also pulled the pad. All 5 pads of the connector don't have traces and instead they have micro-vias right in the middle to the inner layers. We don't care about the USB connectivity, but without the connector the phone can't be recharged, so we are trying to restore the GND and the +5V pins of the connector ignoring D+ and D-. The ground connection was easy to restore by simply connecting it to the ground plane available everywhere, but can't figure out where to connect the +5V. I found an interesting spot on the other side of the board (relative to the miniUSB connector) where there is a big cap with one end connected to ground, and the other connected to a possibly SOT23-3 diode (marked with "S 5") as seen in the second picture, which made me believe that's where all the juice goes. So I connected to that cap, my little jumper wire connected to the +5V from the miniUSB connector, but it didn't work. The phone does not indicate that is charging the battery. Does anyone have any idea what else to try, or recognize any voltage regulators in the picture? AI: The only things I can advise in this are as follows: Try to see if the original micro-via still contains sufficient metallisation to measure with a multimeter. Find a place where the resistance to that micro-via is as good as zero. Test with a lab supply by touching the micro via with +5V while measuring the voltage on that pad (if it's not a mentionable drop, it might work). Noting that: Maybe you can still solder to the micro-via, although its connection to the inner layer may be damaged and create a higher than advisable resistance. Usually the +5V goes directly to a power management chip with passives surrounding it (coils and caps) to control both charge and the power flow to the electronics. You may have already broken something by willy-nilly forcing 5V on some part that may have been meant to create a low-drop 1.8V, or even lower.
H: Troublshooting noisy smps I had a working design of a buck switching regulator based on a TPS62125. It worked fine, with minimal (<100mVpp) noise. I made some changes to my design, seemingly unrelated to the switcher. The result is audible noise from the switcher (a high pitch whine, that gets louder as draw increases), as well as this lovely waveform: Here's my current layout: The only changes I made to the switcher directly is adding room for a 250uF electrolytic cap (problem persists with and without it), adding a .2mF supercap elsewhere in the design, but off this power rail (problem also persists with and without), and adding a footprint for C33, but not populating. The amplitude of the noise does not seem to be affected by load. Where do I go from here? How do I troubleshoot this? I thought I spotted a short between the two pins of the IC that lead to the two pads for the inductor. It doesn't look like there's an actual bridge while looking with a loupe, but could this be the source of the problem (pins are too close because of excess solder, creating some sort of stray capacitance)? The only other thing I can think of is that it's possible that I installed a wrong capacitor for the input or output caps (did this by hand). Would that produce these results? Could it be a bad inductor? AI: Just maybes: If any of these prove useful I'll come back and tidy up the answer. Otherwise no great value. You've got a lovely pickup loop across R16 - why are FB R's across other side from both Vout and FB pin? | C22 is in middle of that loop - noise filtered by C22 MAY be inductively coupled into loop. Install C33 (small). Temporarily move C22 physically and tack on in next best locn away from FB loop. IP and OP caps could cause problems if well off values shown. Data sheet does NOT say so but possible it is unstable if output cap ESR does not fall in a certain range. Varies with load. Check. What sort on in & out caps? Ceramic? C33 = transient response speedup. Diagm says DNP. Is it populated? Try it. What happens with small C33? What is load. How does op waveform and amplitude change with load?
H: SPI not working, ATmega328 only sending 1 byte I am trying to get SPI working on an ATmega328. This is my code: #include <avr/io.h> #include <util/delay.h> #include <avr/interrupt.h> #define ACK 0x7E #define LONG_TIME 10000 //Initialize SPI Master Device void spi_init_master (void) { DDRB = (1<<PORTB5)|(1<<PORTB3); //Set MOSI, SCK as Output SPCR = (1<<SPE)|(1<<MSTR); //Enable SPI, Set as Master } //Function to send and receive data unsigned char spi_tranceiver (unsigned char data) { PORTC = 1<<PORTC2; PORTC = 0<<PORTC2; SPDR = data; //Load data into the buffer while(!(SPSR)&(1<<SPIF)); return(SPDR); //Return received data } //Main int main(void) { DDRC= 0XFF; spi_init_master(); spi_tranceiver(6); //spi_tranceiver(6); //spi_tranceiver(6); } This is the output from the logic analyzer: Notice those two comment lines. spi_tranceiver(6); If I remove those comments, I should get, from the logic analyzer: 3 times the amount of clock pulses for the blue layer. 3 times the amount of data sent, and; 3 times the amount of PORTC2 pules. This is not the case. I get the below: The device I am trying to SPI with isn't configured correctly. Does this matter? AI: It looks like you have the parantheses in the wrong spot while waiting for the SPI transaction to complete. Because the ! operator has a higher precedence than & it will be trying to do a bitwise not of the SPSR register first. Instead you want something like this: while (!(SPSR & (1<<SPIF))) ; At the moment presumably that wait is returning immediately so the SPDR register is getting set three times in rapid succession without enough time for the data to be transferred.
H: Negative feedback capacitor in Op-Amp comparator circuit This is a part of a circuit of a big device. I'm interesting why need for C1 capacitor? OA2 is a general purpose opamp. Power supply for the opamp is +15V/-15V, sorry for mistakes in the picture. simulate this circuit – Schematic created using CircuitLab AI: This is a typical use of a conventional Operational Amplifier working as a Comparator. Lets's first describe it intuitively: If we left C1 out of the circuit (disconnected), we have an Op-Amp with no feedback (negative or positive). Under this condition, the output of the amplifier will be the difference of its inputs multiplied by the open loop gain. So, as soon as the positive input becomes a little bit more positive that the negative input (plus minus the input offset voltage error), the output of the amplifier will "saturate" towards the positive power rail (+15V). On the other hand, when the positive input has a voltage slightly lower that the voltage at the negative input, the output of the amplifier will "saturate" towards the negative rail (node 3). As the negative input is set by a simple resistor voltage divider and the positive input is the voltage generated on R2 by the current of the photodiode, this circuit is a simple light intensity detector/discriminator, The comparator threshold can be "programmed" by setting the ratio \$\frac{R4}{R3+R4}\$. The photodiode gain factor (transimpedance) is set by R2 alone. However, the big question is what happens when/if the positive input stays close to the threshold voltage set at the negative input. What happens if the input signal of the photodiode (at R2) is noisy? The answer is that you will get a series of fast pulses at the output, swinging rail to rail. Not a good thing if you want to get a clean output signal. Or the Op-Amp may start oscillating due to the fact that the high frequency gain of the circuit is unbounded. Now, let's do the math and see how a simple low value capacitor used as negative feedback element can improve greatly our circuit: The gain of a non-inverting single Op-Amp circuit is given by: \$H(s)=1+\frac{Z_2}{Z_1}\$, where \$Z_2\$ is the feedback impedance (in our case, the capacitor), and \$Z_1\$ the equivalent paralell combination of \$R_3\$ and \$R_4\$, which we will call \$R_p\$. \$H(s)=1+\frac{Z_2}{Z_1} = 1+\frac{1}{R_p Cs} = \frac{R_pCs + 1}{R_pCs} \$ The gain at DC (zero frequency), according to the previous expression, will go up to "infinite". In reality, the DC gain will be limited by the open-loop gain of the Op-Amp, typically about >100000. So, our circuit is still working as a comparator, as its low frequency gain is huge. Note that as you increase the frequency, the gains starts decreasing, until it becomes one at very high frequencies. This is great, as now our circuit will become less sensitive to high frequency noise when the input is near its threshold. In summary, Adding a small feedback capacitor to an Op-Amp working as a comparator, will decrease the high frequency gain of the circuit, making it more stable. This is mandatory for any Op-Amp working as a comparator, as many/most Op-Amps may oscillate if the high frequency of the circuit is unbounded. However, with the simple circuit shown above you will still have some unwanted swinging at the ouput, in case the noise is very high and the input signal stays close to the threshold for "long" period of time. In order to increase the robustness of the circuit in that situations, you need to add a little bit of controlled positive-feedback, making it behave with hysteresis (http://en.wikipedia.org/wiki/Hysteresis). I found some interesting notes on basic comparator circuits, fairly well written and explained, http://www.hbcc.edu.sa/facpages/syedmuhammadasad/data_files/eeet%20201/ch13.pdf
H: What do ripples in frequency response curve of filters depict? I am trying to understand the frequency response curve of various types of filters (Butterworth, Chebyshev etc). The curves are shown here for reference : One thing I do not understand is what do the ripples in passband show. The curve is clearly Gain vs Frequency. So all the ripples show is that the gain of filter varies slightly with the frequencies in the passband. How is that suppose to create a problem ? We will only get an output which is varying in amplitude. It would have created a problem had we been getting a distorted output, which was possible only when the filters introduced a distortion, and I dont think it has anything to do with gain at different frequencies. Based on above assumption, why would one not simply opt for a filter with steepest rolloff (elliptic in the figure) , without worrying about the ripples in passband ? Edit : It seems I am not able to properly express my doubt. Here is another attempt : Many articles on filter design mention "Butterworth response is maximally flat, while others like Chebyshev and elliptic have ripples". My query is what has this "maximally flatness " or presence / absence of ripples anything to do (if at all) with the purity of applied signal. Purity in the sense, I apply a signal of a particular frequency, and I get an exact replica back. Will the situation be different in case of different filter types, ie , will I get some spread out or mis-shaped waveform if the filter response has ripples? If that is the case, then how can this be inferred from the frequency response curve alone , because frequency response curves only show that the gain of the filter varies with frequency ; they dont speak anything about what the shape of wave will become if the curve has ripples or not. My doubt arises because the texts generally differentiate between various filter responses by citing something like "Chebyshev response differs from butterworth because it has ripples in the passband". Additionally, if all of the above is not true, ie ripples bear no relation to altering the shape of input, then what do they signify ? ( One of the users made and attempt at that. If possible, please extend or elaborate a little) I am talking of only a simple situation with just one input (let alone many inputs). Maybe someone is kind enough to point me to some resources which show response of these filters to a single sine input. Thank You AI: The ripples in the pass band are typically an unwanted side-effect of producing a higher order filter that has a steep roll-off. If the ripples are too big and I'm using the filter for an audio application I'll probably hear the shape of those ripples in the music so yes, mainly they are undesireable. The ripples do usually show something - they indicate to me that the higher/steeper filters are probably constructed physically (and mathematically) from a series of 2nd order filters.
H: Microcontrollers Is there any other way of interfacing a push button with a LED but not directly with the micro controller? I would like to operate the LED in both method(push button as well as micro controller signals based on wireless, blue-tooth etc.). Here the no of pin usage is important. AI: This would work, but it is quite frankly insane. Just use two pins on the MCU, one for the switch and one for the LED. simulate this circuit – Schematic created using CircuitLab
H: How to maximize inductance of a homemade coil? So how can one maximize inductance of a homemade coil made out of copper wire? I assume adding a ferromagnetic core to the coil increases inductance? Also how can we calculate this inductance roughly? AI: More turns increases inductance and packing the turns closer together (so that they all share each other's magnetic field) maximizes inductance for a given number of turns. Using a ferromagnetic core helps all the turns of the wire share each other's magnetic flux. If the ferromagnetic core becomes a full loop - then the inductance increases dramatically as the "gap" reduces to zero. Ultimately, on an ungapped core inductance is proportional to turns-squared. It's also proportional to the magnetic permeability of the material. If the ferromagnetic core is conductive this can dramatically reduce inductance at AC frequencies because the core acts as a shorted turn - this is why power transformers have cores made of insulated laminates of iron.
H: Amperage measurements using a analog multimeter I got this $15.00 Multimeter with Amperage measurement. Do I need to put the test probes in series on the circuit? The maximum range on the multimeter is 250mA. The black probe is connected to the 10A Max socket. AI: Your use of "mains" hints that you are British? If you are in the UK you will be dealing with 240VAC which is a) very dangerous and b) not measurable by this DC ammeter. If you want to measure AC current in anything mains-powered you want a clamp-on ammeter - no bare connectors to electrocute you and it's highly unlikely the measuring device will ignite. You also need a breakout cable - you need to put the clamp around just the hot wire or it won't work. Any specialty shop that sells clamp-on ammeters will also have the cable, if it's not included in the package. If all you want is the operating and standby wattage of common appliances, it's usually on a label near the power cord. Note that "operating" is usually maximum - for a TV that's full brightness and decently loud.
H: Radar maths I and Q components I have just started work with radars. I read that incoming signal in case of Doppler radar is frequency shifted. On adding it to original signal we get Doppler shift. But we don't do it directly. First we make I component (by mixing incoming signal with LO signal) then Q signal by mixing original signal with phase shifted LO then do I + jQ. This I understand is to determine the direction of motion either towards or away from Radar. I am attaching excerpt from book. Can anyone please explain how this one signal in each waveform becomes zero? AI: Keep in mind that the value of fD can be positive or negative. The sign of fD has no effect on the I signal (cos(x) = cos(-x)), but it reverses the sign of the Q signal (sin(x) = -sin(-x)). The 90° phase shifter delays the Q signal — its output is Q90(t) = -sin(2πfDt - π/2) = cos(2πfDt) when fD is positive, but it becomes -cos(2πfDt) when fD is negative. Therefore, when fD is positive, the upper adder outputs cos(2πfDt) - cos(2πfDt) = 0, but when fD is negative, it outputs cos(2πfDt) - (-cos(2πfDt)) = 2 cos(2πfDt). Similarly, when fD is positive, the lower adder outputs cos(2πfDt) + cos(2πfDt) = 2 cos(2πfDt), but when fD is negative, it outputs cos(2πfDt) + (-cos(2πfDt)) = 0.
H: Memory alignment is always power of 2 I've found the memory alignment is always equal to power of 2. Google said that such amount of alignment allows modern computers to perform read more fast. Ok, what exactly problem we would gain if we set amount of alignment is power of 3? To be more specific I would like to know what exact hardware architect aspect require the alignment to be a power of 2. AI: Modern computer memory is conceptually addressed as bytes, but the real hardware transfer is done in a multiple (a power of 2) of bytes. To do this, the last few bits of the address do not take part in the actual transfer, but are (optionally) used inside the CPU to select one (or more) of the transferred bytes. A consequence of this scheme is that what is transferred is a block of bytes (the size is a power of 2) that is aligned at a multiple of the block size. If the CPU wants a data block that does not fit this constraint, more than one block read is needed, and the CPU must reshuffle the content of the blocks to get the data it needs. A CPU can do without such reshuffling hardware (and the associated loss of time) by requiring that data is suitably aligned. In short: 2^N alignment matches what is easy and fast in hardware.
H: Hooking up two voltage regulators for more power? I have two LM317's, which I am wiring up as a current source for two high power, 10 watt LED's. The 317 can operate @ 1.5 amps maximum, so I plan to build two of these circuits. The problem I am running across is the output pin has continuity with the metal casing, and I wanted to use one heat sink. The metal casing touches the screw, so there is no way I can put an insulator in between, the screw will still make it short. So can I have both output pins touching, and run everything together, assuming each LED takes the same amount of current? AI: To give an official answer: No, it's not okay. With today's production you can give it a try in a small experiment, in the hopes the margins on the internals are small enough to make the share go between 40/60 and 60/40, but for long term or unmonitored use: No! Too many risks. See @IgnacioVazques-Abrams' comment about insulation materials used to mount TO220 packages with sufficient insulation. Apart from that, the same risks apply to the LEDs, unless you add balancing resistors there as well. Supposedly this is okay, as you are using linear current control, so 'wasting' another half volt in an extra resistor won't be hurting too much. To give the full explanation, let's assume one LM317 has a 1.215 reference and the other has a 1.225 reference. If you then add them together at the adjust and output points one device wants to put Vadj+1.225 on the top of the resistor, the other Vadj+1.215. This starts out with them competing a little and then slowly the balance most likely goes more and more to the higher voltage one, heating it more than the other, then the balance can get further out of whack, until the high valued one would have to insert 2.5A into the whole of it, which it will not for long, if at all.
H: LiPo protection circuit IC I'm making a power board for my robot and I am looking for some advice regarding LiPo battery protection ICs. I might need to draw a fair bit of current (9A), though if I get the programming right, it shouldn't be a problem (will probably be around 3A max). Anyway, I was looking at using DS2764 from Maxim (datasheet), and it seems nice aside from the fact that I don't think I can use the 14.7V packs (need 12V output) I wanted to get :) Plus the current is limited to 2.5A. It also has the 2-Wire Interface that I don't plan using, so it's a bit of a waste. Next, I started looking on Digikey for some LiPo protection devices, and now I'm confused: let's say I have a 14.7V LiPo battery, which means it's 4S I think. So technically there are 4 cells in there, but I don't have access to all 4. So when sorting the ICs, should I look for ones that say 1 cell (because that's the number of connections I have) or 4 cell? The 4 cell ones seem to always want inputs from all 4 cells... Do you have any suggestions for something that can handle the current (I'm using a fuse anyways, so just as long as it has a fairly high limit it's probably ok) and the voltage? I know it's quite vague, but I don't really know where to look. AI: An important question to ask yourself: Can I really not access the cells' individual wires? Your best option is accessing the wires to all the cells, usually battery packs have balancing connectors, with in it wires to connect to the joints of each set of cells. This is done, because LiPo cells are much more sensitive to cell-to-cell imbalance and will waste away much faster if you do not check the cell balancing regularly, preferably each time you charge and/or discharge. Alternatively you also should make sure no single cell ever discharges below a level of about 2.5V. The 4 cell chips do all of that for you, if you choose an appropriate one. They will stop current flow when any one of the cells is depleted, in stead of when the entire pack reaches a lower limit, and they should be chosen to have some balancing feature, to alow you to fully charge all the cells. A 1 cell device will only work with one single cell, because it expects the upper limit of 4.25V and lower limit of 2.5V, connecting a full pack of 4 cells to its terminals will at best just not work, but most likely turn it into a ball of smoke.
H: Fourier series - frequency shift of function Let's say I represented some function $$f(t)$$ in terms of complex Fourier series. Then if I want to calculate complex Fourier series of frequency shifted function $$f(t),$$ can I use result I got for "non freq. shifted" $$f(t)$$ to get complex Fourier series for frequency shifted $$f(t),$$ or I have to start with calculations from beginning? AI: I believe its better to do the calculation again just to be safe. But unlike in time shifting where the Fourier Coefficients are multiplied with a exp(-jkwo*to) the Coefficients in frequency shift remain the same but get shifted by the specific amount of shift. Suppose you are shifting the original signal by M then and the Fourier coefficients of the original signal is given by say Ak. Then in case of the shifted signal with coefficient Bn=Ak-M. It would be helpful if you clarify and make the question more specific.
H: Transistor: Mix both GND I Googled a little bit about transistors and I figured out I have a general understanding problem. Can I simply connect the emitter of the transistor to the GND of my microcontroller that controls the transistor but also to the GND of the 12V I try to control with the transistor, to close both circuits? Would the circuit shown below work? simulate this circuit – Schematic created using CircuitLab AI: The circuit you show in your scheme will not work. Chances are that the transistor is damaged. For a transistor connected as a switch, it is normal to place the load in the collector circuit, as I show below simulate this circuit – Schematic created using CircuitLab This is the basic way to connect a NPN transistor in the output of a microcontroller to activate a load. When the output pin is in high, the transistor will conduct, feeding the load, in this case an LED. The value of the base resistance depends on the supply voltage of the microcontroller and the maximum current that support. The value of the collector resistor depends on the source Vcc, and the load that would like to activate. This way, you can share the GND connection between the microcontroller and the power supply to the load.
H: Sin signal from PWM I wrote a program in order to use Pulse Width Modulation to simulate a sinusoidal signal. Added a low pass filter to get rid of the noise and the traces of it being a discrete signal. Added a half wave rectifier in order to delete the negative part of the signal, however it only deleted 20% of it instead of the intended 50%. Questions: Why is this happening, how do I get rid of the other 30%? Does it have something to do with the high frequency of the PWM? What could I do to increase the output AC voltage from 3V to 10V or 100V? (I do know voltage multipliers) but I'm looking for another way. Can this be used to power up circuits without damaging them? How can I add 10A of current to my final AC output? AI: To answer all your questions: See the explanation by @JonRB, in short saying: You are making a wave going from 0V to 3V with the arduino, because the arduino does not possess a negative rail to work with. So you need to make the signal relative to a ground, in stead of its current DC offset of about 1.5V How do you do that? You can do two things: A: You can generate a virtual ground, at about 1.5V and relate all your measurements to that and have your diode conduct into a resistor connected to that virtual ground to make it act as a rectifier. Note, however that you'll still lose about 0.7V off the signal, because that's the voltage the diode drops, or "needs to work". B: You can decouple the DC away from the signal with a capacitor: simulate this circuit – Schematic created using CircuitLab The resistor is there to pull the capacitor on the other side to a DC level of ground. The capacitor doesn't allow DC voltages to impose anything on the other side, but to a moving signal it becomes a frequency-dependant impedance. Note, that this will dampen lower frequencies, because the impedance of the capacitor is higher at lower frequencies. The larger your capacitor is the better lesser it will inhibit lower frequencies, so if you can get 10uF or 47uF. If you want 50Hz to be the lower limit (for audible for example) the drawn values will easily suffice. You need an amplifier for that. For such large increases you should look into audio amplifiers or power amplifier design manuals. But I'd advice the latter only if you have a very firm grasp of signals, frequencies, transistors, op-amps, capacitors and inductors. Alternatively you could increase the voltage you are switching with your PWM stage. For this you need an external power source at the voltage you want your peak-peak swing to be and a decent transistor half-bridge (BJT, MOST or IGBT) rated at the working voltage and currents. That depends on the circuits you want to power and what for. I'm getting the impression that you want to build some sort of Power Frequency Driver/Chopper. I am not going to re-itterate a full how-to on building those, but you should really consider googling those if you want to not do something very dangerous (in terms of damage or health). Also note this is a difficult and long road compared to hooking up an Arduino to a set of filters. See point 2: Amplification before or after AC filtering.
H: Why is it wrong to connect an oscilloscope in parallel with a circuit element? I was told that it is incorrect to measure the DC voltage across a circuit element using an oscilloscope by putting the probe on one side and the ground clip on the other. I am supposed to connect the probe to one side, take my measurement, and then do the same with the other side and then subtract the numbers. Why is it incorrect to bridge the circuit element with the oscilloscope? AI: If you want to measure the voltage across a circuit element which has no direct connection to ground, then the method you describe is required. Otherwise, the ground clip on the oscilloscope, which is connected to ground, will create a short circuit in your device. The short circuit will interrupt the proper operation of your circuit, thus you will not be measuring what you want. At worst, the short circuit could cause damage to one or more elements in your circuit. Many dual-trace oscilloscopes can be set up to perform the subtraction automatically by means of connecting the channel 1 probe to one side of your circuit element and the channel 2 probe to the other side. Select the inverting function for channel 2 and the channel 1 minus channel 2 function so that the oscilloscope then displays the difference between the voltages of the two probes. This difference is the voltage across your circuit element. There are limitations on the performance of this mode but it relatively easy to do. An actual differential amplifier is needed to get more accurate results.
H: Is it possible to calculate the load resistance in a full bridge rectifier when given only power, inductance, and input voltage? I'm given a full bridge rectifier circuit with values for power, industance, and RMS input voltage: [P = 380 W, L = 85 uH, Vs = 115 V]. The question states to 'select' output resistance for a simulation, but I am unsure if it's possible to calculate this. It might be that it is asking to select an arbitrary number. I'm guessing that it can be calculated using: $$ R = V_s^2/P = 34.8 \varOmega $$ I am wondering if the voltage drop across the inductor can be omitted at steady state. Is this the correct way one would determine the load resistance? AI: Assuming negligible losses in the inductor and rectifier and a low value for C, your calculation is good. As the source is 115V I'm assuming the frequency is 60Hz, so L has a reactance of 0.032&ohm; - insignificant compared to R. Assuming silicon diodes with suitable ratings the rectifier should be dropping about 1.4V - again an insignificant amount. The capacitor is a wild card - if large enough to hold the voltage up between peaks then DC output voltage could get close to 160V, and R might have to be much higher (67&ohm;?).
H: Voltage drop when servo activates Background This is a follow up to an earlier question I asked - I have an ATmega2560 running a number of sensors and servos. There are two separate SMPSs running off a single 12V battery, one generating 3.3V for the ATmega and the digital stuff, one generating 5V for the servos. When measuring current consumption at the battery (only place I can easily splice in), I see a baseline of about 3mA @ 12V until the servo kicks in, then consumption varies from about 50mA to as much as 200 (@ 12V). When the servo kicks in, I see something like this: And then when it's shutting down, I see something like this before it stops: Accompanied by a low rumbling noise coming from the servo, with it vibrating, but not moving. The SMPS is a TI TPS562200, rated for 2A, with an inductor rated for 3.1A. I recorded the scope reading above running this from 8xAAA batteries in series. The servo has a 470uF electrolytic cap next to it. Regulator circuit + layout: Servo driver (I've played with different cap values from what's there) Question Is the voltage drop at startup a concern, or normal servo behavior? Is the second waveform the servo trying to reach a position it can't get to? I'm starting to think that because the waveform seems to be fairly well-formed, which makes me think it's some sort of sampling/adjustment/seeking action going on. AI: You have several things to worry about in this setup. A schematic of what you have exactly would have helped to target the advice more to the exact problem, but here goes: First of all, you may not necessarily need insanely large capacitance, but you need capacitance with a low ESR (Equivalent Series Resistance). If your 470uF capacitor has a large resistance the regulation of the buck converter will improve and the peak current capacity of the capacitor will increase, solving the problem from two ends. That's not to say you may not need a higher value if you don't want a dip at all. Secondly, you need a low ESR capacitor on the input of each converter stage as well, to make up for resistance in batteries and/or wiring, so the converter has a local store of energy to pull from when the output suddenly needs 1 or 2 ampere for the motor's cold start. From the datasheet I expect the response of the regulator to be quite sharp, so it should be searched in the capacitors first. If you cannot get or afford a very low ESR capacitor, you can combine two or three lower value capacitors, as their ESR will be used in parallel and as such the total ESR of the capacitor-group will be much lower. The second picture does seem to show a retry/restart of the motor and the regulator's response to that transient current. It's likely the servo has a little margin when the power to the motor falls off. More advanced servos are better tuned to prevent from showing behaviour like this.