text
stringlengths
83
79.5k
H: Op amp voltage regulator using N-Mosfet I am trying to make a voltage regulator using an op-amp and a MOSFET: schematic http://no4nwo.com/images/724278393.png I'm really new to electronics. Why is \$V_{DS}\$ always so low ? AI: Connect the inverting input to the MOSFET source /output - that's the first thing. Also If your zener voltage is too high you may get additional problems if: - The op-amp isn't a rail-to-rail output type The MOSFET Vgs(threshold) is too high be able to sustain the output under load conditions Here's a similar circuit: - This uses an NPN BJT - to use a FET connect an N channel device with source to the circuit output and drain to positive supply.
H: Controlling multiple triacs with microcontroller for light dimming: where to use optoisolators I want to control (dim) multiple mains lights using triacs and a microcontroller. (One triac per light). I want to keep both the costs and component count as low as possible. Is it necessary to have multiple optoisolators? (One per triac?) Under normal operation, could the triac gates be at significantly different potentials, for example when some lights are on and some or off, or perhaps during non-zero switching due to transient spikes due to the inductance of the lights? I would probably use a transistor (PNP) between the uC and triac, which would saturate to trigger it. The gate-side anode would be connected to neutral, as would the uC's ground. I understand that the live part of the system should be isolated from interfaces such as programmers, as per this question. Such isolating would be less costly than one optoisolator per triac, so I'd prefer to isolate this way rather than one opto-isolator per triac. AI: The basic triac driver circuit sinks current into the gate (trigger) input, to ground. If you can connect the grounds of all involved triacs together, you an use one microcontroller to drive all triacs (via a suitable drivers, of course). I hope you realise that this makes your microcontroller circuit 'life' (= connected to the mains), so unless you have an isolated programmer it will make your debugging process tedious. I have my doubts that this approach will save you much, because optoisolated triac drivers are small and cheap. The snubber R + C are likely to be your largest components (unless you need to cool the triac). Maybe you can combine the snubbers into one filter for all channels.
H: Generate sine wave in VHDL, with the use of 10-bits DAC I want to generate a sine wave with 20Mhz frequency, using a FPGA (Cyclone 3 EP3C10E) and an external 10bit DAC converter (http://www.analog.com/static/imported-files/data_sheets/AD7533.pdf). I have a vague idea that DDS or Cordic algorithm will work, but I dont know them very well. Would you plz suggest some sample codes for it? AI: You can try to generate a single period the sine wave in matlab first, extract the samples, store them in the RAM (or BRAM) and let the FPGA play it the cyclic way, sending the data to the DAC. In matlab you should do sin(2*pi*F*n*T) Where F is the required sine frequency, T is the period time of the generating clock and n may run from 0 up to the number which give you 2*pi which is full sine period. n is basically the number of samples you have of the required sine wave using the generator clock. You may need to refer to nyquist theorem to see you are good.
H: How to protect my power supply output? I want to protect my power supply ouput and I know that there are foldback solutions suggested by LM723 circuits, but I'd like to understand what is happening inside the circuits. Consider the simple concept in the circuit below. I used a simple resistor to protect my output. The problem is shown in the image below: As you can see in the right circuit I don't have efficient behavior, how should I replace the block on the right to make such a chart? AI: You don't give details of the output voltage of the supply or the required value of the 'regulated' voltage output so the following is a generic answer. Assume the output (unloaded) is 12V and you require a 9V regulated voltage and a short circuit current of 70mA and you don't want to use a regulator IC. First step is to fix a reference voltage. A small current passes through the Zener (say 10mA.) If the Zener voltage is 9V6 then for the assumed values this means the resistor drops (12 - 9.6) = 2.4V and at 10 mA this gives 240R for its value. The Capacitor is there to smooth the voltage and has a value of 10 - 100uF (not critical) The current available to take from the zener is too small to be used directly so we need to amplify it with a transistor. The transistor drops about 0.6V between the base and emitter leaving 9V at the output. The problem is that if the output is short circuited it will destroy the transistor so we need to limit the current. The second transistor is only turned on when the current flowing through the limit resistor produces the turn on voltage (0.6V) For 70mA this will be 0.6/70 * 1000 = 8R6. When this voltage is reached the second transistor shuts off the first transistor and the output voltage falls. IC regulators contain much more sophisticated circuits and for a cost effective solution I would go for them every time.
H: Open-drain microcontoller ports I want to understand the concept of open-drain ports like port P0 of the 8051 microcontroller. Why do we need to connect pull up resistors to the port P0? I have basic knowledge of MOSFETs and other electronic devices. AI: Ignoring the ins and outs of how mosfets work. The output acts like a switch to ground. It cannot produce a high (+5V) signal by itself. The pull up resistor is used so that when the switch is open the output will be high. When the switch is closed the output will be low (0V)
H: Extremely Cheap Geeky Code System I'm hoping to create a really geeky 'capture-the-flag'-style checkpoint event. The goal is as follows: Team A goes to Checkpoint 1 and, using some kind of device, scans a chip left at Checkpoint 1 or some code on a piece of paper to spit out a code. Team B, at the same checkpoint (Checkpoint 1) will get a code unique to that team Team A at Checkpoint 2 gets a unique code once again. I think the idea is somewhat conveyed here. The idea is that I have a master sheet of all the Team-Checkpoint code combinations but, to the teams, everything is random and can't be guessed. An issue is that each 'device' for a team, to be economical, will have to be around $15-$20, which is incredibly restrictive, obviously. My original idea was to have an RFID tag at each checkpoint and build an RFID reader with an LCD screen that modified the RFID tag based on some team-specific thing, but I couldn't find an economic way to do this. The goal is to build something cool and geeky so any neat ideas are appreciated, I guess there's no "correct" answer, but the $15 is restrictive... Any ideas? Thank you very much! AI: I think your description is far from clear, but I think I get the picture. My first Idea would be to use the mobile-phone-with-camera that every child seems to have nowadays to scan a barcode or something similar. You'll have to write the app(s) and print some barcodes, but otherwise 0 hardware cost. My second idea would be using infrared. If you can implement the detection in the flags you could use existing IR remotes (maybe with all but one button disabled) for the players.
H: Source and sink current If I am connecting ICs to both sides of a led matrix, the ICs need to be able to source and sink enough current to light the LEDs? Or just sink? Let me explain my question with an example: In this diagram, I select which row is illuminated on LED1 through IC12 (a shift register). The column is selected through a demux (IC14). The LED matrix current is sunk through IC13, a ULN2803 transistor array. I know that the ULN2803 (IC13) can sink enough current to light all LEDs. However, IC12 can only source 25mA, and lighting all the leds in a row would take around 100mA. Do I also need to put transistors in the source side of the LED matrix? If not, then what is the recommended setup for what I'm trying to do? Please bear with me that I'm a beginner. If my question is not clear, please indicate so that I can edit it. AI: If you are selecting a column via a 4515 de-multiplexer, ONLY one column is active therefore it is impossible drive more than 1 LED in the same row at any one moment in time: - This means, if 25mA will drive 1 LED sufficiently then that's all you need. EDIT Passerby has made a very good point about the drive capabilities of the 74HC4094 - basically, in a nutshell, the max supply current is 50mA which means that if all 7 row outputs were selected at once, the maximum current deliverable per line is about 7mA and this is somewhat less than what the OP was expecting. There is another serial device that could suit and this is the 74HC595 and its maximum supply current is 70mA; this will deliver 10mA to each of the 7 LEDs but the OP has to decide if this is good enough. I think the 74AC164 may just do the job however - it has 25mA outputs but I'm struggling to find the max supply current spec - anyone any ideas? Anyway, here's a small diagram that shows it driving a 7 seg display with about 13mA per line: -
H: check resistance is bigger then a constant? As a part of a bigger project, I want to build an high resistance detector that will respond with a logical pulse 0- under 50KΩ 1- more then 50KΩ what would be the most power efficient way of doing it? I thought about using this one some how, but I'm stuck here. AI: If you want a logical pulse, you might want to consider some type of circuit that changes state across a relatively fine boundary, so you can be as precise as possible. For instance, you could create a simple voltage divider that is connected in series with your load, and put a BJT with the base connected between the voltage divider such that it turns on when the load is 50K Ohms. Since a silicon BJT generally turns on at 0.7 volts, just select the values for your circuit to accomplish this based on your voltage input. If your probe has a 5V input, you could stick a 300K Ohm in series and when the load rises to 50K, it will create a ratio of 0.14 (50/350) of the input voltage, or 0.714 volts at the divider, enough to turn on the BJT. Of course this isn't extremely precise, but this is just one way. This could also be done with zener diodes. Granted this solution is not a pulse, it is a level output. It could easily be made a pulse with a timer or a uC. An ATTiny85 is only $2.
H: Good high-gain amp chip In a previous question, I asked about an audio-induction loop, and how I would amplify it. I am wondering what chip I should use to drive a 8 ohm speaker and what the circuit would look like. I mentioned the tl082,(an op-amp I have a lot of) but that didn't seem to delver enough power. I want to power this with a 12 volt battery. AI: LM380 is quite widely used: - Here is the data sheet
H: Slow clock edge causing issues with D flip flop behavior I'm trying to use a D flip flop and a pushbutton as a simple switch. My goal is this: every time I press the button, the output of the FF will switch state. I put a circuit together in a simulator and it worked fine. I implemented a debounce circuit for the switch that works nicely on its own, with my scope showing a fast and smooth rise with no bouncing. Essentially, I have the switch pulled low and attached to the CLK input. When the button is pressed, the clock is pulled high, triggering the FF on the rising edge of this signal. The ~Q output is connected straight to the D input. When the FF is triggered by the clock, ~Q takes on the opposite value of D. Therefore, the FF should switch values on each button press. Because the FF is only triggered by the rising edge of the CLK signal, I don't have to worry about D changing faster than I can release the button. All good in theory (and in my simulator). So I bought a D FF and hooked it up to my breadboard, attached my button and passives, threw an LED on the output and ... it's wonky. It would either turn on or turn off upon a button press, with a somewhat equal probability. I examined the CLK signal with my scope and believe I found the culprit. As the clock edge falls, it reaches a certain voltage and then goes through a ton of small oscillations. It seems that these oscillations keep registering as "rising edges" on the CLK signal, which would rapidly change the value of ~Q (and consequently, D). I interpret this as the reason why I can't predict the output of the current set-up - because I have no idea how many dozens of oscillations occur during the falling clock edge. Examining the ~Q / D lines shows similar oscillating behavior upon the CLK going metastable. I've tried attaching capacitors on the CLK, D, and ~Q lines in all sorts of combinations to try to smooth out the behavior. Nothing has worked. It seems the metastable state is ruining my circuit, which I've read a bit about and understand it to be a pretty serious issue in digital logic. Are there any tried and true methods to eliminate this metastable behavior? Or any suggestions to pull my CLK signal down hard enough that it doesn't want to oscillate? Any suggestions are appreciated. I'll keep plugging away. AI: You have unfortuantely run into a relatively subtle problem with this particular flip-flop. (BTW, this is not metastability; that's a different problem.) It's designed to operate at high speed over a wide range of supply voltages, and one of the compromises made in its design is that it has a rather strict requirement on the clock input transition speed. If you look at section 9 of the datasheet, the input transition rate is given as 10 ns/V maximum. This means that you need to make the clock rise or fall by 5 volts in no more than 50 ns in order for the chip to operate correctly. With an RC time constant of 10 ms, you are about 6 orders of magnitude too slow.
H: When is it appropriate to galvanically isolate components/subsytems? As the question implies, how do you determine when it is appropriate to galvanically isolate parts of the same electrical system from one another? For example, I'm currently constructing a tube amplifier that has a significant amount of digital electronics in it. Currently, the digital part and tube part are powered off of separate windings from the same transformer - However, they are both referenced to the chassis earth (as in each respective circuit has a single wire running from their respective power supply ground to a single point on the chassis - does this even count as galvanically isolated?). My mongrel amplifier also houses a digitally controlled high voltage regulator section, so I can adjust the voltage to my tubes. For no specific reasons in mind, other than "I don't want my lowly digital signals interfacing with potentially 400 volts!", I decided to stick a cheap isolated DC/DC brick with 1000v internal insulation into the design, as well as a digital isolator, to isolate the onboard DAC from my other digital crap. Attached is an eagle board design view of the offending area, so you can see what I'm ranting about. (sorry, not enough rep for inline images). The poorly drawn black-dotted line indicates the intended 'isolated' area. I think my justification for doing this at the time, is that in the likelihood that a component fails on the HV regulator and HV is placed upon any of my poor low voltage components, my digital components on other boards (and there are a LOT of them), would remain safe, rather than be obliterated as the surge propagated through. I don't actually know how true this is, hence the question. Would you consider it appropriate to isolate these two systems in this manner, would you do something different, or would you not even consider isolation necessary at all? In what situations would you consider isolation mandatory? AI: Your post was way too long to read, but it seems to be asking about isolation when a common ground is used. If various subcircuits share a common ground, then they are not isolated. Put another way, everything that shares a common connection is all one circuit. Therefore adding isolation between sections of such a circuit is pointless unless there are other reasons than a misguided attempt to "isolate" parts of the same circuit which are inherently already not isolated. Your confusion seems to come from the fact that you have some parts of the circuit that run on 5 V and some parts that use a 400 V. That means you need to pay attention to high voltage issues and make sure the low voltage circuitry and any external user-touchable parts don't get exposed to the high voltage. For example, there is nothing wrong with using a voltage divider to scale the 400 V down to 4 V so that it can be measured via the A/D input of a microcontroller. The micro sees only the 4 V, so it will be fine. You do have to make sure you observe proper spacing, get a resistor rated for the voltage, consider the output impedance of the divider, and make sure the resistors can handle the power dissipation. However, that's no different than if you were measuring 20 V, just that some of the numbers are higher. In some cases it may be convenient to use components with isolation to transfer signals around this circuit. But, that is not for the isolation itself but to allow for arbitrary common mode offset between the input and output sections.
H: Current mode PWM Controller I'm analyzing a power supply design. A Current mode PWM controller is used to step down the i/p 45-57 V/350 mA to 5 V/3 A. The design uses this part, http://datasheets.maximintegrated.com/en/ds/MAX5974E-MAX5974F.pdf I read the datasheet but I couldn't understand, how exactly the stepping down is taking place? and how the o/p current is determined? AI: Start with the numbers you quote - 45-57V (lets average it to 51V) @ 350mA - this is a power into the circuit of 17.85W. Power out is 5V * 3A = 15W. This tells me that the circuit has a power efficiency of about 84%. So, if it were a black-box and you got out 5V at 3A but needed to put into the black box nearly 18W, would this make it clearer where the 3A comes from? The stepping down is taking place in the transformer. I'm going to continue using the term "step-down" for the rest of this explanation even though strictly speaking it's the primary inductance and secondary inductance that do the business of energy transfer - see the circuit below: - Transformer (T1) has a primary coil and secondary coil and, energy is gained in the primary coil by briefly connecting it across the supply, Vs by the FET (circled in red) and a resistor labelled Rcs. The primary energy is in the form of magnetic flux and when the "red" FET switches open circuit the magnetic flux energy has to go somewhere. This is where the "blue" fet comes in. The transformer secondary (being closely coupled to the primary) can take this flux, convert it to current and push this current into the 4 x capacitors on the output. But it can only do this if the blue FET conducts after the red FET stops conducting. Because T1 is "step-down" (i.e. secondary winding has fewer turns than the primary winding) the ampere-turns generated by the primary gets turned into bigger amperes for fewer turns in the secondary. Again I ask the purists to forgive me on my terminology. I'm not going to go into the fine detail of the chip other than to say the pulses that turn the FETs on and off determine how much energy is stored in the magnetic field so that the output voltage remains regulated across a range of acceptable load currents.
H: voltage divider before inverting opamp simulate this circuit – Schematic created using CircuitLab I am taking a -8 volt signal and using a resistor divider to make it -3 volts by using a 16.5k ohm resistor as r1 and 10k as r2. I am feeding the -3v into a single supply opamp (+5 and gnd) in the inverting configuration with unity gain (using two 10k resistors) in order to obtain 3 volts. Will the resistor divider before the unity gain non-inverting opamp effect my unity gain? Essentially i am taking a signal that goes from -8 to 0 and i want to turn this into 3v to 0 for input into a ADC. AI: Yes, the divider definitely will affect the gain calculation, because its equivalent source resistance (Thévenin resistance) of 6.23 kΩ is in series with one of your 10 kΩ gain-setting resistors. The overall gain will be -0.2325, rather than the -0.375 that you're looking for. If you want an overall gain of -3/8, it would be simpler to forget about the voltage divider and just set up your opamp with 20 kΩ input and 7.5 kΩ feedback resistors. Also, be sure to use an opamp whose common-mode input range includes ground.
H: How can I modify this circuit for a higher gain? Here is an image of an amplifier circuit. How can I modify this for a 10-50 times more gain. I put a wire from pin 1 to 8, but I didn't get enough gain. AI: Leave pin 1 to 8 open. Add another gain stage ahead of the LM386. simulate this circuit – Schematic created using CircuitLab This non inverting amplifier has a gain of \$A=1+\dfrac{R_f}{R_i}\$. Gain can be increased by increasing the value of the feedback resistor. Add the LM386 gain stage and total gain becomes \$A=20(1+\dfrac{R_f}{R_i})\$. The voltage divider and capacitor add a DC bias to the the non-inverting pin. This will allow it run from a single supply, and acts as a 50 Hz high pass filter. Do not forget to add C2 as well. Without it, the amplifier will just slam the positive rail. However, if this is for that induction loop you keep talking about, I doubt you will ever be able to get enough power out of an LM386.
H: Why don't more devices incorporate full-wave rectifiers as reverse polarity protection? Recently, I was introduced to the idea of using a full-wave rectifier, in order to protect against reverse polarity damage in DC devices. I hadn't even considered using a rectifier in an already DC circuit, but now that I think about it, why doesn't every device that has the potential to be damaged by backwards power and ground connections use this idea? I can't wrap my head around why something that could easily protect the circuit whilst simplifying the setup wouldn't be included? AI: There is no reason why a DC polarity reversal should take place, and the warranty can basically blame it on the user. If the device is battery powered, the use of a standard, convention-adhering battery holder with clear markings should prevent such a thing from ever happening. Even users who don't look at markings are trained to put the flat part of an AA battery against the spring, and slide the nub against the leaf contact. 9V batteries have gendered connectors; no way to screw up short of deliberately making a temporary wrong-way contact while the power switch is on. The 99.999% of the users who are able to engage two brain cells cells together when installing a battery don't want to sacrifice battery life for the sake of the remaining 0.001%. If the device has an AC adapter, then a polarity reversal can never happen if the original AC adapter is used. If a different AC adapter is used, which has a compatible DC barrel jack, but which puts out opposite polarity, or perhaps AC, that's the user's responsibility. Chances are that by the time users have lost the original AC adapter, the item is out of warranty. Possibly, they are not even the first owners, and so do not have the original receipt. So the chances are low of the company having to replace the item or provide a free warranty repair because of damage caused by a wrong polarity (or voltage, for that matter) aftermarket AC adapter. Internal DC power supplies that run strictly on AC via an AC power cord obviously have no need for DC polarity reversal handling; the only way it could happen is that someone assembles the circuit wrong.
H: What actually is the output current of a boost conveter? What I understood at least at a basic level the operation boost converter, the inductor supplies output current when the switch is OFF. When the switch is ON the the load current is taken current by the output capacitor. Update Is the classification of DCM and CCM is based on the nature output current or nature of inductor current ? But during switch ON state, the inductor current has nothing to do on the output current ? or what I understood is wrong? Can anybody please explain this ? AI: What actually is the output current of a boost converter? Hopefully the diagrams below will explain the output current and the difference between continuous and discontinuous operation. Look at the blue traces in both continuous and discontinuous modes - this is the rectifier or diode current (what you refer to as CR1). The diode current is the current into both capacitor and load resistor. When the average current is not constant the output voltage would either collapse to zero or rise until something went "bang". In reality, it is the average current that flows into the load because without a load, a non-zero average current would continue to push the output voltage up and up. Output load resistor current is therefore average diode current
H: unable to understand write policy in Cache memory I am studying write policies in cache memory ( for first time ). I am able to understand the 'write-through' but i am not able to understand 'write back' and the problems associated with it . Please can anyone explain me the 'write-back' concept clearly . AI: In a write-through cache every store operation from the processor simultaneously writes the new data into the cache-line and into the backing store (the next larger cache or the main memory). In a write-back cache a store operation from the processor modifies only the cache-line, so the cache-line contains the most recent data while the data in the backing store is stale. The write to the backing store happens only when the cache line in question gets replaced because it is needed for some other line at a different address. The pictures on the wikipedia page about caching are okay. In a write-through cache every line is in only one of two states: valid or invalid. Thus when you need to fetch a line that is not in the cache you just throw out a line to make space for it In a write-back cache every line can be in one of three states: valid, invalid, or dirty. When a read-miss occurs and you need to throw out a line to make space for the new line, the line you need to throw out may be dirty. If the line you need to throw out is dirty, you need to write it to the backing store before you can bring in the new line. This means that at the time you are processing a read-miss you may need to do two operations with the backing store instead of one. If the same cache lines get written many times then write-back caches can dramatically reduce the number of times you need to send writes to the backing store. You just keep making modifications to the dirty cache line until the line needs to be replaced and then write back only the last values written to each location in the line.
H: Resistive sensor reading ADC I have to make an ADC conversion with an ATXmega MCU, in an air quality application. The input is a voltage divider between a voltage reference. The sensing resistor vary in relation to a gas concentration. I read the voltage between a load resistor and ground. Since the conversion is not high precision (12 bit) we don't want to wast any bit. The sensing resistor can reach the max value of 60 k: in this case the V on the Load Resistor will be at minimum. The solution we found is to subtract this minimum voltage from the Vin with an op amp. And now the questions: The voltage divider interact with the resistors of the diff op amp circuit (https://en.wikipedia.org/wiki/Differential_amplifier)? Will it be useful to place a unity gain buffer on between the Vref_min and the negative input pin of the op amp? Is this idea is achievable with a normal low noise op amp like this? http://it.farnell.com/texas-instruments/tl072ip/ic-op-amp-jfet-pdip8/dp/1459704 ? simulate this circuit – Schematic created using CircuitLab Here the schematic. I have to put an unity gain buffer instead of "???" node? Is the circuit ok? AI: If you have a reference voltage of (say) 3V, the range your input will see is: - 3V * 10k/13k = 2.307V (sensor at 3kohms) 3V * 10k/70k = 0.428V (sensor at 60kohms) If you used a 50uA current excitation and a grounded sensor, the range your input will see is: - 50e-6 * 3k = 0.15V (sensor at 3kohms) 50e-6 * 60k = 3.0V (sensor at 60kohms) With a current excitation the percentage of your 3V reference range used is 95%. With voltage and resistor excitation you only get 63% of the range. If your reference voltage is lower or higher, the above "range" statements are still true. Here is an example. An ADC input is directly connected to the sensor. The sensor is fed with 50uA via the PNP transistor. The 50uA is measured across "R" and compared with "V" by the op-amp. The op-amp keeps the current through R at a value that generates a voltage "V" across it. Values could be R=10k and V=0.5V or R=20k and V=1V. Op-amp should be chosen that has close-to-either-rail IO performance like an AD8605 (used many times by me in this same configuration for strain gauge excitation). Here's a quick DC simulation for 60k and 3k loads: - Transistor used is BC547C or BC847C for those with good eye-sight. Note that due to small base currents in the transistor, the current isn't 50uA but 49.846uA with 60kohm load and 49.849uA when loaded at 3kohms. Note also the voltages across the sensor - 2.991V on 60k load and 149.5mV on 3k load.
H: How do I read the markings on a Mitsuba capacitor? I'm trying to identify a suitable replacement capacitor for use in a relay. The relay is by Mitsuba and uses a Mitsuba capacitor, which appears to print different notation on it than I have found in guides or SE questions so far. My guess is this is a 3uF capacitor based on the markings, which seeks a bit strange given its size (~2cm long by ~1cm in diameter). Here are the markings: 85(degrees) 8 (2) 3U There is also an encircled "4 " down the side, but not where the printed strip indicating the negative pin is. AI: Though I can't provide a definitive answer, I would vote for 3uF as well. I found some example of 10x20mm 3uF capacitor on internet (e.g. here), so this seems to corroborate this hypothesis.
H: What is reference voltage in a D/A converter When I searched on the internet what I got as an answer for the above question is that the reference voltage means the highest voltage tha D/A can output. But my lecturer at college did a calculation as below. An 6 bit A/D has values 110101. Reference voltage is 0.25V. Then he multiplies each bit with the two to the power of corresponding to the position and multiply it with the reference voltage. The final value (Vout) is 13.25v. If the definition at the beginning is correct this can't be true since this value is greater than the reference voltage. What does reference voltage mean according to this context? AI: The reference voltage (generally known as Vref) is usually the maximum voltage value that the D/A converter can reach. This value depends on what is connected to the Vref pin. In your case what you mean as the reference voltage is the minimum step of your DAC and it corresponds to the number "000001". What you mean as the reference voltage is the resolution of the converter.
H: what happens in a seperately excited DC generator when load increased A book about electrical machines states as below what happens in a generator of this sort when the load is increased? When the load supplied by the generator is increased, IL (and therefore IA) increases. As the armature current increases, the lARA drop increases, so the terminal voltage of the generator falls. What I don't understand is what is meant by increasing the load? If the load is increased shouldn't the current through it (IL) decrease? How can IL increase when the load is increased? AI: "Load" is a term for how hard the device has to work to power whatever is attached to it. "High load" means the output power is high, "low load" means the output power is low. You can increase the load by, say, connecting a second device to the output of the generator. Assuming the voltage is constant, the current will be higher (since there are now two deices powered by the generator). That means that the equivalent resistance of both deices in parallel will be lower than that of a single device. So, increasing the load means decreasing the resistance of the load. This may be counter intuitive, but usually devices are not rated in resistance - they are rated in input current or power, so the "load" follows that. If I have a 1kW load attached to the power supply and now increase it to 2kW, the current will increase (assuming the voltage stays constant).
H: Is this a polarised capacitor So I went to a local electronics retailer, Communica in Cape Town yesterday. I had a small shopping list including: 10x 10µF Ceramic Capacitor 10x 0.1µF Ceramic Capacitor The vendor didn't have any unpolarised capacitors, so he gave me the ones, as in the photo attached. I immediately but respectfully commented, that this is a POLARISED electrolytic capacitor, and the sales chap cut me short, saying, it's unpolarised. Am I subconsciously smoking something here? I admit I haven't been involved in electronics too long to have earned any badges, but I'm pretty sure that both the salesmen I asked are wrong. I need the caps for decoupling in a USB + PIC32 MCU circuit (see image below), so I also think that 100V tolerance is a bit overkill, 10V will probably do, right? AI: Let's see: We have name Jamicon printed on the capacitor as well as NP. A simple search of Jamicon capacitors brought me to the website of Jamicon Electronics Corporation. Going to Capacitor->Product search menu brings us to the search interface. I don't see any NP series capacitors, so I went to advanced search and used voltage and capacitance as inputs. It didn't produce any relevant results (the TK series, which it produces isn't what we have, from the datasheet description), so I went back to the basic search and checked capacitor descriptions. I noticed term bi-polar in some of them and downloaded datasheets for the first one I saw. As it so happened, the datasheet was for NK series capacitor. The datasheet showed a picture of capacitor with NP mark and had Non Polarity in big letters on the first page and Standard non polarity series for using in polarity reversal circuits. in description. So I guess that the capacitor isn't polarized. Also note that it doesn't seem to have the traditional polarized stripe on the body. I hope that the thought process explained here will help you in future searches for part descriptions.
H: How to create EMI? I want to subject my product to large amounts of EMI to see what happens. I figure I need the EMI to be broad-spectrum to be sure it will have the best chance of wreaking havoc. However, I don't have any specialized equipment for generating or even measuring EMI, so what are some cheap ways I can do it? Some ideas for generating EMI; no idea if these will be effective: Using jumper cables and a car battery to make sparks (DO NOT do this in the vicinity of the battery itself because car batteries offgas explosive fumes) Turning a heavy motor such as in an air conditioner or refrigerator on and off One idea I read for sensing EMI is: Listen to an AM radio tuned off-station Any better ideas than these, especially as far as ways to generate the EMI? AI: Tazer. Buy them from Amazon.com for as little as US$11. The correct method for doing this is with expensive lab equipment that costs tens to hundreds of thousands of dollars. Anything less is a major compromise, to the point that you might as well have a Tazer. We do our own ESD testing, which is similar to using a calibrated Tazer. And we will put our devices near known common RF emitters (Microwave oven, CB Radio, WiFi, Cell phones from various manufacturers). Of these tests, the ESD testing is the most informative. Otherwise, we leave the EMI susceptibility testing to official labs, since we almost never fail this test.
H: Why is my audio amp picking up AM and FM radio stations? I built an audio amp out of the LM386 on a previous question. I when I have nothing connected, I picked up FM radio stations, as well as AM Very loud and clear. Why is this happening? Why AM and FM? How can I prevent this? Although it is very cool that I picked up the stations, I don't want to have any interference. I live in Evergreen, Colorado (just west of Denver), and I am picking up 105.1 FM as well as 850 KOA AM Yes I am sure that the one is FM because I heard them say "KOOL 105!!!!" AI: Radio frequencies from AM stations get into audio amplifiers not only through the inputs, but also via the outputs. The speaker cabling can serve as an antenna to pick up radio signals. This is is coupled back to the output of the amplifier. But the amplifier has a negative feedback loop which feeds the output back to the input. So the output is really just another input. Production amplifiers usually include a Boucherot Cell on the output, often an output inductor after that. Both of these devices can help block incoming RF, even though it's not their main function. The Boucherot cell is simply a capacitor in series with a resistor, placed between the output and ground. Common values are 0.1uF and 10 ohms. You can see this in many amplifier schematics. Edit: I see there is a 10 ohm/0.047uF cell in the amplifier; did you install that in the built circuit? When you say "nothing connected", of course you have the speaker connected, which is how you hear the radio stations! There is also the possibility that the circuit itself is picking up interference. There is a reason why amplifiers are built built into metal boxes and why fuss is made over any internal wiring and in particular grounding! If your power amp is just bare components on a breadboard, don't be surprised if it is susceptible. Radio waves are falling on your nest of wires and components. You have high gain in your circuit, and nonlinearities, so these oscillations are amplified and rectified. There is also the power supply connection. A single-supply amplifier like the LM386 is very susceptible to noise coming in over the power supply. You have to bypass the power supply very well. A single large capacitor may not be enough; you need a small 0.1 uF ceramic close to the IC power pins.
H: Is there a prebuilt PCB that does the equivalent of a wall wart for a similar price? I am working on a project, and I need to convert 240V AC power to 5V DC to power a microprocessor. I can't use a wall wart, and I am looking for a PCB that will do the same as one - for near the same price. Everything I have found that even remotely resembles what I am looking for (pretty much just the innards of a wall wart without having to actually take apart a wall wart) is really overpriced. Any help? AI: Shopping questions are generally discouraged but I'll answer by saying your search term is "AC DC converter". Digikey offered a bunch of subgroups in the answer, and I selected "Power Supplies, Board Mount". http://www.digikey.com/product-detail/en/VOF-6-5/102-2212-ND/2441885 is $14, down to $11 in quant. http://www.digikey.com/product-detail/en/BP5063-5/BP5063-5-ND/658569 is $8. To add a bit more value than just the shopping aspect: Be prepared to spend a good deal more on AC inlets, fuse drawers, and such. Be sure to spec out enough output power on the power supply you choose. Also, the addition of an internal power supply can really change the flavor of a prototype. You'll need a bigger box, and make sure you think about this in 3 dimensions, not just two, our your box may not be tall enough. Murphy's Law says the power supply will get in the way of every connector.
H: Bidirectional level shifter circuit problem Ok, so here is my problem: I am trying to create a small 3.3V to 5V signal level shifter, using a BSS138 transistor. This is my source for the circuit: a SparkFun circuit. This is my circuit: As you can see, I have one bidirectional and one unidirectional line. On the left is the Low Voltage (3.3V) part and the right is the High Voltage (5V) one. When I connect the TX_LV to the Gnd line, the TX_HV turns to 0V. When I connect the TX_HV to Gnd, it does happen on the other side as well. But the BSS138 transistor seems to act as a 20kohm resistor when closed (I even measured it with my multimeter - it was about 19.7kohms). This results in approximately 4.1V on both the LV (Low Voltage) and TX_LV lines (which should be 3.3V) when 5V is applied to the HV input and neither TX_LV and TX_HV are connected to Gnd... This is quite a problem as I want to connect a Raspberry Pi to an Arduino via Serial port and I don't want to damage my Raspberry Pi by putting 4.1V on its pins. Could anyone please tell me how to fix this or what could I use instead of this solution? AI: You need to connect LV to a 3.3V source for the circuit to work properly. If it's floating up to 4.1V, it must not be connected to anything.
H: Calculating battery life of Arduino + XBee Project How do I calculate battery life of Arduino and XBee project? Here's my information: Battery's voltage: 3.6, capacity: 780 mAH Current draw of Arduino + XBee when sleeping = 28,5 mA Current draw of Arduino + XBee when wake up + transmitting data = 66,6 mA I have sleep cycle 7.5 seconds, so every 7.5 seconds will wake and polling data for 100 milliseconds How can I predict my battery's life? AI: The device is not sleeping 1.3% of the time. \$ 66 \times 0.013 + 28.5 \times 0.986 = 28.9mA\$ average load. \$\dfrac{780mAh}{28.9mA} = 27 \; hours\$, assuming you get every ounce of the 780mAh out of your battery. You should probably derate that number by at least 20%.
H: Can a designer get hold of the PCI Express specification without being a member of the PCI SIG group? I want to get hold of the PCI Express specification which is available here . But when I try to download it, it asks me to login as a member - which requires membership at $3000 per year. Is it possible to get hold of the specification without being a member, or having to pay this very high fee? AI: Technically, no. Of course people will pirate lots of things they shouldn't. You get more than just access to the spec for that $3K. You get a PCIe Vendor ID number, which is required if you want to make a product that uses PCIe. But... Do you really need the official spec? Probably 90% of the spec is only useful for people who are designing chips (not even FPGA's). Do you really care about the low-level signal encoding, or the more esoteric state machines? If not then there are books on PCIe that will likely be more useful to you than the spec will be. PCI Express System Architecture is one such book that can almost replace the spec, but there are many others.
H: What's a simpler way to switch between power sources? I want to make a device that allows the user to switch between two different power sources (a wall mount and batteries). I could perform this circuit using two DPDT switches, but I would need to switch the two switches each time I want to change sources. Is there a simpler way to perform this function without using relays? Here's a schematic of my device as a reference: AI: The easiest solution (Initially suggested by @PeterJ) Would be to simply switch only the power connection: simulate this circuit – Schematic created using CircuitLab Alternatively, you can probably get away with just using some schottky diodes: simulate this circuit Wow, Circuitlab is a clumsy tool. It doesn't have entry/exit ports? Or Schottky Diodes? Really? But if you're really loading your RPi or it's USB ports, the drop in the diodes could be large enough that you get brownouts, which would be a real pain in the ass to diagnose. The best solution, I think, would be to put the diodes before the voltage regulator. This would mean you would have to have a higher power supply voltage (>7V), but it would solve the problem with the diode Vf described above.
H: Why would a modern digital clock rely on mains frequency? I am in the military, stationed in Djibouti, Africa. We generate 240V/50Hz power on base, but some buildings also have 120V outlets, which I assume is transformed somewhere else on base, probably at the diesel generating station. I also assume that it is 50Hz as well (see below). We just received a new coffee pot with a 120V plug and a clock/timer: After two days of setting the clock, hoping for hot coffee when we arrive at work, and finding that the time on the display was incorrect, I realized that the clock is probably 5/6 slow due to the fact that the power is 120V/50Hz instead of 60Hz. A bit of timing confirmed that the clock is, indeed, ten minutes slow every hour. I would have thought that the internal clock would be a simple quartz clock running off rectified DC, but that wouldn't (I assume) affect the frequency of the crystal. I'm guessing, then, that the clock is a different A/C circuit. Is there a reason (cost?) that the clock relies on a 60Hz signal? AI: Why? You hit it exactly, it's designed on a budget. Mains frequency over long time scales is often very well regulated; the graph on this Netherlands page shows a drift of no more than 40 seconds over 70 days; more than accurate enough for a dopey coffee clock alarm/timer. You can see the short-term variation does bounce around, for example in this neat little real-time gauge of the UK power grid. As far as how it likely uses the mains frequency in a logic circuit (or with a micro), it's probably pretty trivial. Just run it (or likely the output from the transformer) through a couple passives (high value resistors), maybe a diode (or rely on internal clamp diodes), and bam, clock. If it's being designed on a budget it's probably not isolated, so you can get away with all sorts of fun cost-saving methods.
H: How can I effectively reduce the voltage needed to activate a transistor? I have built a circuit which basically connects the line out (audio output) of a music playing device to a set of LEDs (actually a huge strip of around 200 LEDs), so they flash in time with the music (from internet tutorials - I'm a bit of beginner). simulate this circuit – Schematic created using CircuitLab My circuit works very well using my laptop as the audio device (connecting my circuit to the headphone jack on it). But when I use something smaller such as an iPod, the lights barely turn on at all. I've tried using a Darlington Pair (below), but that makes the issue worse. This is why I think the issue is that the audio line out is not reaching the 0.7 volts across the base and emitter that the TIP31C transistor needs to activate (the Darlington Pair means it now needs 1.4 volts to activate). simulate this circuit From my research, it looks like using an op amp might be the way forward, to amplify the audio line out signal before the TIP31C transistor. Would somebody be able to suggest one, and which inputs I should connect to? I've also read that Germanium transistors only need 0.3v across the base and emitter to activate, would that be useful? AI: In short: you can't. The 0.6V threshold for a BJT is a consequence of the physics of silicon P-N junctions. A germanium transistor would work, but you will have to mail-order it, and it will be expensive. A rail-to-rail op-amp indeed may be an option. However, another solution is to make the voltage of your audio signal higher, rather than making the transistor threshold lower. You could do this two ways: Make the emitter voltage lower simulate this circuit – Schematic created using CircuitLab Now, the audio signal is 0.6V higher than the emitter. Of course, you'd have to come up with a way to get a 0.6V power supply, and probably adjust it to get just the action you want. There's another way... Add a DC bias to the signal simulate this circuit Here you can adjust the pot to add some amount of DC bias to the signal to get the sensitivity you desire. The capacitor serves to isolate this DC from your audio source while allowing the AC signal to pass. This is called capacitive coupling. R4 exists to limit the base current in case R1 is adjusted too far. There's no point in biasing the signal above 0.7V since that would mean the transistor is always on, so R4 also makes the useful adjustment range of R1 wider. Also, notice in both cases I've added a resistor to the transistor base. You don't want to make this mistake.
H: How do I verify if a conductive mat is getting "Earthed" Explaining to me about electricity is like explaining to your Grand-Ma about it. So please be kind and gentle :) I bought an Earthing Mat from "http://www.amazon.com/dp/B003RLOBOK". It includes a conductive mat to which I connect a white-wire whose other end goes into an earthing point on my wall. As long as a person's body is in contact with the mat, he is getting earthed. But how do I verify/measure if the conductive mat is getting earthed correctly? (in effect I am getting earthed correctly). I called up an electrician over to my house who demonstrated and verified that the white-wire (connected to mat) is getting earthed. After inserting one end of the white wire into the earthed socket, he touched one wire of a bulb (with 2 loose wires) to the other end of white-wire. The bulb lit up and he said that white wire is getting earthed. But he didn't know how to verify the conductive mat. All he said that this looks like rubber and should not work. I come with an almost zero electrical knowledge. So how can a novice like me verify if the conductive mat is working as it should. AI: Earthing mats do look like silicone rubber, but are made of, or coated with, some flexible conductive material. Therefore appearance alone is insufficient to assume it is not earthed. If you have one of the screwdriver type mains testers, it is easy to verify earthing: (source) Grab the metal clip at the back of the tester firmly using the mat as a glove - without directly touching the clip with any part of the body - and insert the screwdriver head into the live point of any mains socket that is switched on. If the mat is earthed, the tester will light up, as the tester works by earthing itself through the clip, then through the human body or other earthing connection. Of course, also check if the tester lights up at the socket in the first place, by touching the clip with your hand.
H: Reading signals in a car 9-14.5v and translating to arduino HIGH / LOW I have a project that requires me to trigger certain events in an Arduino based on certain electronic devices in the car being switched on and off. I essentially need to read a 12v HIGH state in the car as a 5v high state via an Arduino, but as the cars voltage will fluctuate between 11 & 14.5 v and suffer from transient spikes, I would like to do this as simply and safely as possible. Currently, my thoughts are a voltage divider with some form of transient spike protection (zener diode?), but I am open to better suggestions! I need to read 3 separate 12v HIGH events (main beam on, lights on, indicators on) to effect changes in intensity on a set of high brightness DRLs. AI: I would consider opto-couplers. That would give you very good trasient protection.
H: Safety Relay Coil resistance I have a Dold Safety relay OA5621OA5621 data sheet on page 2 of the data sheet it lists standard variants: I have a 24 volt relay, OA5621.52 with 2NO/2NC contacts. I can't figure out what Rsp means, is it the contact resistance or coil resistance? I need to find the coil resistance, is it 3753 ohms or 960 ohms? AI: The coil resistance is 960 Ω, which is consistent with the nominal voltage (24 V) and power (0.6 W). R = V2/P. I have no idea what those other columns are about.
H: AQZ204 Solid state relay I have an AQZ204 AC/DC type solid state relay AQZA204 datasheet I'm using 31.5 volt DC supply, with a series 4.7k Ohm Resistor to the input LED of the relay. The data sheet is a little confusing to me, it saids the LED max dropout voltage is 1.5V so I calculated around 6.38mA forward current for the LED: 31.5VDC - 1.5Leddrop = 30VDC/4700 = 6.38mA I'm confused by the IFon current being 3mA max? Basically I want to calculate the minimum supply voltage required to turn the relay on and the minimum supply voltage required to turn the relay off So I can test the relays to see if they are in spec. AI: As I read it, the IFon Max rating of 3 mA means that even the least sensistive unit will switch on with 3 mA, while most will switch on at 1 mA (or even less). IFoff Min of 0.4 mA and Typical of 0.9 mA says most wiil turn off if the LED current falls below 0.9 mA, but some may stay on until the current drops below 0.4 mA
H: Transformer for Flyback power supply I am designing an isolated DC-DC converter with an input of 12V and an output of 5V@12A, at the moment, a flyback seems like the best option. I have read several books regarding the subject and I am proceeding to the implementation; however, I haven't been able to find a transformer that meets my requirements (I have searched on Mouser, Digikey and Newark to no avail). I suppose I've been searching incorrectly, since most of the transformers I have found can only manage up to 2A. I currently have no limitation regarding frequency or turns, but I would like to find the perfect match. So, where can I get the transformer I need? (Do have in mind that I require a website that can ship to Mexico) AI: Sourcing a transformer a major challenge/headache during the design of an isolated power supply. The more power is required, the harder it is to find an off-the-shelf magnetic. Majority of the power supply transformers are batch-built. Usually magnetics manufacturers' web sites have better search/filtering tools than distributors like DigiKey and Mouser. Here are my go-to places for shopping for off-the-shelf magnetics: Pulse Electronics Coilcraft Würth the supplier listed in the BOM of the reference design Lead times may be long too.
H: UART is garbled when running at more than 9600 bps I'm connecting 2 MSP430F5529-based boards (running at 1 MHz) using UART and MAX3232 (MSP430F5529 -> MAX3232 -> cable, a few cm long - will be longer in our final application -> MAX3232 -> MSP430F5529). It works as long as the bit rate of the UART is under 9600 bps. If this is raised, I start getting many errors (usually the MSB is flipped). If I remove the MAX3232 and connect the boards directly, the problem goes away. It doesn't happen if I loopback, too. I am running the MAX3232 at 3 V, which the datasheet says is enough: Transmitter outputs will meet EIA/TIA-562 levels of ±3.7V with supply voltages as low as 2.7V. What am I doing wrong? My code on the TX side is: void UART_Initialize() { UCA1CTL1 |= UCSWRST; UCA1CTL0 = UCMODE_0; // UART UCA1CTL0 &= ~UC7BIT ; // 8 bits, no parity, 1 stop bit UCA1CTL1 |= UCSSEL_2; // Source 1 MHz UCA1BR0 = 104; // 104 ~= 9600 bps UCA1BR1 = 0; UCA1MCTL |= UCBRS_0 + UCBRF_0; // Modulation P4SEL |= BIT4 + BIT5; UCA1CTL1 &= ~UCSWRST; UCA1IE |= UCRXIE; } void UART_send_data(unsigned char character) { while (!(UCA1IFG & UCTXIFG)); UCA1TXBUF = character; } unsigned char UART_get_char() { while (!(UCA1IFG & UCRXIFG)); return UCA1RXBUF; } void UART_shutdown() { UCA1IE &= ~(UCRXIE|UCTXIE); UCA1CTL1 = UCSWRST; } int main() { unsigned char received_data; P4OUT = 0x00; // Disables the watchdog WDTCTL = WDTPW + WDTHOLD; // CPU clock to 1 MHz UCSCTL0 = 0x00; UCSCTL1 = DCORSEL_3; UCSCTL2 = FLLN5_L; __enable_interrupt(); UART_Initialize(); while(1) UART_send_data(0x55); } On the RX side the code is similar except for main() (which just receives the value and compares to 0x55). AI: Definitely sounds like a timing issue. I think your clock is running too fast and instead of bit 7 being sampled, the following stop bit (HIGH) is shifted into the shift register.
H: Post-Transformer RMS Voltage for This Circuit? I am confused here. For the below circuit: simulate this circuit – Schematic created using CircuitLab Ripple voltage is given as 1V peak to peak, Vo = 15V DC. I have assumed a 0.7V drop across any given diode. Please note that I was a little hasty in my construction. I do not know the values of the capacitors or resistors yet. The transformer line has 60 Hz frequency. I'm trying to find the transformer rms voltage to the circuit where the turns of the transformer are not known. I calculated: 2*16V + 1.4V, since there are two diode drops, the center tap configuration giving two instances of the maximum load voltage, which is 15V + 1V ripple. This gives 33.4V, which, dividing by sqrt(2) for rms gives about 23.6V (rms). However, the given answer is 22.9V (rms) What am I missing in my calculation? Any clarification would be greatly appreciated! AI: If you want 30Vdc, the peak AC voltage has to be 30V + 2 diodes = 31.4Vpk. The RMS is this divided by sqrt(2) = 22.2V RMS. This takes no account of ripple. If you factor ripple into the equation then you can assume the 30V is in fact 30V +/-1V. This equates to half the supply being 15V +/-0.5V i.e. 1Vp-p ripple. So now the peak AC voltage is 31V + 2 diodes = 32.4Vpk. The RMS is then 22.9V. As this appears to be the "correct" answer I can see that when you added onto the 30V the peak ripple you used twice as much - remember the ripple is peak-to-peak and only half of that counts towards pushing up the peak AC voltage.
H: PMBus licensing I have just (20 mins ago) started looking at the possibility of using PMBus in future products and have come across the PowerOne licensing issue (referenced by electronicdesign.com), but also other info that says the bus is an open technology... I am unclear as to who exactly needs to license to use this in a product. E.g. if we wanted to produce a power supply that used PMBus enabled POL devices or PMBus controllers I'm guessing the device manufacturer needs to be the one licensed and not us, is that correct? If we wanted to implement an MCU in our theoretical PSU, as an PMBus device/controller would we then need to license it? Going back to the first case where only pre-licensed devices are used, if the bus master was a computer then the computer would require programming as a type of PMBus master controller - would that require licensing? Has been suggested that the license is only on POL regulators, is that the case does anyone know? AI: The meat-and-potatoes of the licensing issue is as follows: (I am not a lawyer) Power-One holds a patent that covers their Z-One point-of load converter: U.S. Patent No. 7,000,125 Power-One sued Artesyn over a point-of-load product that was never released to the marketplace, based around PMBus Patent 7,000,125 was interpreted to cover the following: A digital power control system for programming, controlling, and monitoring an array of Point of Load regulators using a data bus for communication with and control of the Point of Load regulators, where: Point of Load Regulator is a dc-dc switching voltage regulator designed to receive power from a voltage bus on a printed circuit board, and adapted to power a portion of the devices on the board and to be placed near the one or more devices being powered as part of a distributed board-level power system. Artesyn lost and had to pay $100 (one hundred dollars) Power-One maintains that any POL converter with digital control and/or communication needs a license Some quick searches show me that several companies have entered into licensing agreements with Power-One concerning digital power: Microchip International Rectifier Powervation TDK-Lambda CUI ZMD AG Intersil / Zilker Labs Texas Instruments (etc.) SO ... if you're using an off-the-shelf PMBus controller in a POL application, check that the manufacturer has a license. If you're spinning your own custom solution with a microcontroller, I suggest using a micro for which the manufacturer has a license. That, and call a patent lawyer. Seriously. This patent business is exceedingly nasty.
H: Using a transistor to add to max current output from a opamp? I thought I understood transistors but now I'm confused again. I have a basic opamp circuit to amplify the input of a electret microphone. The output of the opamp will vary within 1-4V. Now I want to connect this output to a load (laser) and this modulate the light intensity via the mic. The driver of the laser is not a constant current one, and output does change if input changes, thus modulation is possible. The thing is that I cannot connect the laser directly to the output of the opamp circuit because the current flow will be to high (+-300mA), so this means I need to use a transistor right? So I thought I can just connect this output to the base pin of the transistor(2n2222), the load from +5V to collector, and emitter to ground. The base input then controls the current over the proportionality. So basicly a input of 1-4V on base must control the collector current also from 1-4V but allowing a larger current to flow. I read that the base-collector current must not be the same and this shuts down the transistor. I tried a basic circuit and obviously it didn't work. AI: A couple of circuits that spring to mind. The first was actually for controlling the light output from a laser (amongst other things). Incidentally the laser was used to shine at a turbine blade spinning in a turbine and the optical cable had a return path for reflections back to a photodiode to monitor the timing of the blades: - The crux of this circuit is the emitter resistor and the feedback control from the op-amp. If you have 1V on your +Vin input (5V before pot divider) then providing you have a collector load, the current will be 100mA. If you have 2V, the current through the laser will be 200mA. With 4V on the +Vin input there will be 400mA through the laser. Make the emitter resistor bigger for lesser currents and of course dispence with the pot-divider on the +Vin input. The 2nd circuit is this; it's a power output stage to an op-amp based arounf an NPN BJT transistor and feedback to the opamp to provide regulation: - Quite simply the feedback on the op-amp tries to maintain the emitter at precisely the same voltage as Vin. This will give you the power for driving your laser. Things to watch - the laser forward voltage needs to be accounted for as does the heat dissipation in the BJT and the emitter resistor in the 1st example.
H: LEDs conduct in reverse direction! In my circuit, I have the L1 ~ L8 LED as indicator LEDs on the even number pins of my header. TEST rail is connected to a +5V rail which can be turn on or off depending whether I want the indicator LEDs to turn on or off (the problem described below exists in both configurations). A ~ H are controlled by a microcontroller which grounds the pin when I want to turn an LED on. That part of the circuit works as I have checked that it does indeed short to ground when I pull the pin low in the program. On the odd number pins on my header, I plan to attach some kind of output loads powered by a +15V rail that can supply higher current. Right now, I just have bright LEDs as load, but it ideally could be any other actuator. The problem is that for some reasons, the current seems to be able to pass through the indicator LEDs and provide a path to the ground. As a result, there is always some voltage across an output LED which causes it to stay on all the time. The output LED would simply become brighter when the signal pin is pulled to the ground. I tried removing the "Test LED". After doing that the output LEDs will still turn on dimly as long as one of the signal pins is pulled to ground. Does anyone know why the indicator LEDs don't act like a normal diode? Is there something wrong with my design or something wrong with the particular LEDs that I bought?? AI: LEDs do not typically have much ability to withstand reverse voltages. In fact, the datasheet you linked to does not even attempt to give these LEDs a rating. When you connect an LED between a +15V source and a +5V source, you are putting 10V of reverse bias across it, and it isn't surprising that it passes current. If you want this circuit to work as intended, you need to put a regular signal diode in series with each of your indicator LEDs to block the reverse voltage.
H: How do I 'scope a mains appliance? I am trying to study the operation of a single plate Induction Hob. I wanted to use an oscilloscope to measure some of the low voltage digital signals on the microcontroller inside. So I attached the ground lead of the 'scope to a pin labelled 'GND'. But when I powered up the hob, the fuse inside exploded. I guessed that this is because the GND line is actually bouncing up and down with the AC supply. Is it possible to use a 'scope to measure signals inside a mains device like this without something exploding or risking damage to the oscilloscope? I don't have a schematic for this appliance, but it's likely to be pretty similar to most other induction cookers, like this one: In the top left you can see the AC come in, then there's a bridge rectifier with the negative terminal defined as ground. AI: Your 'scope lead is safety (as named in North American standards) what you need to do is to take two probes, one on channel A and the other on channel B and use the A-B function (that is what it is for). I take the ground clips, clip them together and use electrical tape to ensure that they don't come apart and short anything inside. You can buy a differential probe but that tends to be very expensive and is mean for very sensitive work. Just looking at A-B is good enough for probing around in the device you describe.
H: Digitally Switching a Single Source into 128 Channels I have a device I'm building that uses a single high-precision current source (driven by a DAC for various arbitrary waveforms) to drive one of 128 channels. The current level will be on the order of 20uA Building 128 redundant current sources is expensive and unnecessary, and a typical 74595/596 shift register won't work because I need to "pass through" the current source to the channel. Current idea is to use 128 triacs switched by either an fpga (with many pins) or daisy chained 595's and a micro, connected to the common current source. Only one will be open at a time. As the current source and the controlling device are all off the same reference I don't believe I will need to use optoisolators although that will be determined when prototyping I have 3 questions. Is there a standard way to do this that I'm unaware of Will using triacs with such a low current source cause issues with noise or switching Are there low power triacs in small form factors (preferably smd) AI: How about something like this: simulate this circuit – Schematic created using CircuitLab Essentially a Pass Gate (aka Transmission Gate, aka an Analog Switch) per channel. That's an NMOS and a PMOS transistor and you'd want to ensure the were complements of one another, and you'd need 256 control signals, 128 NMOS transistors, and 128 PMOS transistors, but I imagine this would probably be your lowest cost approach if you really need to do what you've described. You'd obviously need to incorporate some sort of FGPA or CPLD or MCU with a lot of I/O expansion to get the control signals, and a custom PCB of course.
H: Switch and Pushbutton Combo In a circuit I'm designing I want the user to be able to switch the power off and on (with an SPST style switch), as well as depress a push-button (push-to-break) that will temporarily disable the power - effectively a reset button. Ideally I would like to combine these actions into the same physical switch. Does anyone know if such switches exist? What would I search for to find them? Edit: I would like to combine SW1 and SW2 in the below circuit. simulate this circuit – Schematic created using CircuitLab AI: If I understand correctly, the NKK M2027 (On-On-(On) SP3T) should do what you want. Just connect the circuit to terminals 2 and 4.
H: How is lithography actually used to "print" transistors? In one of my classes, we skimmed over lithography, but mostly the optics side of things (the diffraction limit, liquid immersion to increase angle of incidence, etc). One point that was never covered is how the light actually dopes the silicon, and creating a transistor. I've tried to stumble around on the net but every article is either way over my head, or way too vague. In short, how does a focused beam of light directed at a compound like silicon lead to a "printed" transistor, for lack of a better term? AI: There are multiple steps but the basic process is that you use a photoresist. At the beginning of a process step, a photoresist is "spun" on to the wafer. It is a very literal thing, they spin the wafer while dripping the polymer onto the surface which spreads out into a thin layer of precise thickness. This is cured and then placed into a photolitographic machine, which projects an image onto the wafer that leaves latent images in the Photoresist (AKA PR). The PR is developed (some resists are negative and some are positive, which means the exposed areas stay or the exposed areas are eliminated). the development process removes the parts of the PR that are to be removed leaving behind the desired pattern. The PR can define areas that are etched (removed) or windows through which ions are implanted. Implanting is the process through which the Si is doped. Once the area is implanted, the remaining PR is removed and the wafer is thermally treated to anneal the implant damage. In between litho steps are depositions, growths, etches, wet baths, plasma treatments etc.
H: How could I build a headphone stereo to mono converter? I have a friend who is permanently deaf in one ear but has normal hearing ability in his other ear. When he listens to music with headphones or earbuds, he can't hear one of the channels which degrades his listening experience. I'd like to build him a compact stereo to mono converter. Ideally, it would have an input 3.5mm stereo jack and an output jack that delivers the converted mono sound. I've tried the simple circuit below using two jacks where I connected the channels using resistors, however, his devices detect the short circuit and won't play the sound. Using sufficiently large resistors I can get past this, but the volume is too low to be usable. I think I should use an op-amp, but I am not sure which configuration is the best. Should I use a summing amplifier? Do I need a 9V battery to supply power, or could I run this on AA or AAA batteries using rail-to-rail op-amps? Which op-amps should I look for / avoid when it comes to audio quality? I don't have many restrictions on what I can do. I'm an Engineering Physics student and I have access to nearly any circuit component, a 3D printer, a machine shop, and a PCB mill through my university. AI: I think, before over-complicating stuff with an op-amp, try this: - It could be that the short circuit detection is using DC to decide whether it is shorted. The dc blocking caps shown are 10uF and in case these do not allow enough bass, be prepared to raise their value to 47uF. You might also need to have bleed resistors from each input line to shield just to activate the output - try 10k on these.
H: How does this soil moisture sensor work? I found information on how a capacitance moisture sensor works, but I couldn't find any information on how the following sensor works. What is the theory behind this sensor? AI: A likely mechanism for the operation of the sensor is by creating a Galvanic Cell battery out of the probe electrodes, with the moisture in the soil acting as the electrolyte / "salt-bridge". From the Wikipedia page referenced above: The "sensor probe" would consist of two dissimilar metals such as Zinc and Copper, which @JimDearden correctly surmises in his answer. However, the actual current flow due to Galvanic redox reactions is what would create the energy to deflect the needle of the sensor, rather than conductivity of the moist soil alone. The moisture here works merely as an electrolytic medium for the electrochemical reaction. This sensor would fail if used in distilled or otherwise very pure water, or moisture containing no dissolved salts / electrolytes.
H: ARM Power/Exponential Function I'm trying to code an exponential function for use on a PWM signal. My question is, does anyone know how to do a power function on an ARM cortex-M (STM32F4 in this case, which has an FPU) microcontroller. Or would a taylor series approximation do the trick better. I know this is question is very much programming related but as its related to microcontrollers I thought it would be ok to post here(?), plus it seems questions on stackoverflow get lost very quickly. AI: Generating a PWM signal in an embedded application generally involves a limited number of bits in the counters used to generate the signal timing. This could be as few as 8 bits or 10 bits depending upon your PWM hardware. Keep in mind too that the binary representation of the PWM values establishes a fixed universe of values in the embedded application. You can use this to your advantage in finding a solution to this problem. The idea is to use an off-line calculation tool such as a spread sheet to compute whatever range of exponential function that you desire. This can be used to produce a look-up table of data that you then place onto the microcontroller code as a constants table. Limited bit width PWM's make the table size be practical. If you happen to have a 16-bit PWM then the table can still contain 16-bit target values but the table size can be limited to a practical size without needing 64K entries. In this latter case the target software uses linear interpolation between the table entries to find target PWM values. This technique is known as piecewise linear interpolation. You will find this table look-up approach much less compute intensive than trying to calculate complicated floating point formulas in real time on your microcontroller. Sometimes the performance improvement gained is essential for applications that require the PWM value to update and track an input at with minimal latency.
H: FIFO wrfull asserted when FIFO is not full I have an issue with Altera FIFOs. It seems that the full signal wrfull gets asserted even when the FIFO is not full. My FIFOs are of size 8. The SignalTap traces below show the read levels of my FIFOs (rdlevel) as well as the wrfull signals: What could explain that the wrfull signals are not behaving properly? AI: I haven't used Altera, or the FIFO you are using, and the signals you have in your picture makes no sense to me. But I have designed many FIFO's and maybe I can still give some insight into what you are seeing... Many FIFO's have a strange notion of "full". Specifically, "full" is when there is one less words than what you think there should be. A 16-word deep FIFO can only hold 15 words. Or a 64 word FIFO can really only hold 63 words. In these FIFO's, the RAM used is 16 or 64 words but the logic used to calculate the full-ness will signal FULL at one less. Attempting to put 16 or 64 words into that FIFO will result in bad stuff. Not every FIFO is like this, but most of them are. Some FIFO's, particularly ones with a separate read and write clock, will take time for data written to it to appear on the read port. Sometimes a surprising amount of time. To put it a different way... Let's say that the FIFO is completely empty, and you start writing to the FIFO as fast as possible. You might be able to write several words to the FIFO before the "FIFO Not Empty" signal goes active. This means that you can't start emptying the FIFO until later than you might expect. Which means that you might have more words in the FIFO than you anticipated. Which could cause it to fill up. The length of time for a written word to appear on the read port varies depending on the internal architecture of the FIFO. Sometimes it is within a clock cycle. Other FIFO's could require several write-clocks plus several read-clocks. Requiring several write-clocks and/or several read-clocks brings up an interesting issue. There are many FIFO's which don't behave well with discontinuous clocks. That is, a clock that just isn't continuously running. If it takes 3 read-clocks to bring the write data to the read port, and you only give it 2 clocks then the data is not going to get there. The data will accumulate in the FIFO and never get read. You can actually get into a state where the FIFO claims to be both empty and full at the same time! Empty, because the data has not gotten to the read port yet. And full, because there is no more room in the RAM to write new data. So, those are some reasons why the full flag might be going active when you don't expect it to. But you must also consider that you are just doing something else wrong. There's a bug in your code, or you have a noisy clock, or you have incorrect timing constraints. Those are real possibilities that I can't diagnose remotely.
H: What do the different cables of the RS232 cable mean? I learned that the TTL-232R-3V3 cable that I bought to program my MCU has 6 differently colored ports. What do each mean and do they represent specific things? AI: It should be one of those: http://www.ftdichip.com/Products/Cables.htm Most likely: http://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_TTL-232R_CABLES.pdf [Page 10/11]
H: Are there strong but insulative screws? Common through-hole power semiconductor devices, like TO-220 and TO-247, can be mounted to a heatsink by running a screw through the hole in the device. However, on TO-220 the hole is often electrically connected to one pins of the device. TO-247 often isolates the hole from the device backplate, but this isolation is not guaranteed, and often fails below 1500VDC. I frequently need 3kV withstands. We often use clips to hold the device to the sink, which can help the problem, but makes construction more problematic, and may still have insulation problems. Shoulder washers are also used occasionally, but again, that makes construction more complex. Life would be simpler if we could use insulated screws. The only ones I'm aware of are nylon, and good luck getting any torque out of those! Are there any screws (M3, M4, #6, #8, or similar) which are made of an insulating material, but which still have sufficient mechanical strength to hold a device to a heatsink? Especially in high-vibration environments? AI: To insulate transistors from a mounting plate, I typically use metal screws with an insulating pad as I describe in my answer here: how to electrically isolate a PCB from a heat sink. But if you really want to use non-conductive screws, have a look at fiberglass reinforced plastic ones such as Isoplast. I haven't used them personally and they don't make any specific claims as to shear strength, but they look a lot stronger than nylon.
H: Connecting my RS232 Cable to my NXP - LPC1313FBD48 I recently bought an LPC1313FBD48 Microcontroller and an FTDI TTL-232R-3V3 cable. How can I connect the cable to the MCU? I cannot fit the pins of the MCU into the ports of the cable. Would I need copper wire to connect the cable ends to the pins of the mcu? AI: That looks like an LQFP-48 package. As you have aptly observed, most devices are physically incompatible. You will either have to design and make a PCB, or obtain one someone else already designed. The product page has a number of demo boards, like this one: (source: nxp.com) These usually have the pins available as .100" headers or something similarly large and easy to access. They also usually contain all the peripheral devices (a crystal, reset button, maybe a voltage regulator, maybe some LEDs for status indication) you'd want to play with the device. Some have more specific peripherals (USB, Ethernet, sensors, displays...) Search the internet. There are hundreds. There are also PCBs available for common surface mount packages that break the pins out into .100" headers, to which you can then attach standard .100" pitch connectors (your cable has one such connector). Some (though not the one pictured) have the headers arranged in two rows, designed to attach to a breadboard or fit in a DIP socket. You can also solder tiny wires onto each pin if you have good tools, eyesight, and a steady hand. I wouldn't recommend it, though. Besides being tedious work, it will be a mess.
H: Is it common for internal pull-up resistors to fail? or what would cause them to become intermittent? I have a board based on an ASIC ARM Cortex-M3 that after months of work suddenly started to report spurious button presses. The ASIC is not our design, but a reputable company's. The buttons schematic is given below. The pin is configured as input with pull-up resistor enabled. The resistor's value is about 30KOhm. When measuring the pin-side with a DMM, I see the value floats around. Sometimes it is 3.2V (=VCC, chip range: 2.1V to 3.6V) and other times jumps around floating between 0.6V to 1.0V. There are no issues of humidity/condensation (9% RH), no dust or other objects on traces. And this is the ONLY board that suffers this. Other manufactured clones of this board work without any issues (so far anyway). The only thing I can think of is that something is making the internal pull-up flicker. Is it common for the internal pull-ups to give way? What else could be causing this? R9,R12 are 2.2Kohm, and C10,C11 are 33nF. AI: It looks like you've made some effort to isolate your input pins from the switches, but still, an overwhelming ESD event may have damaged some part of the pin driver/receiver circuitry on the chip (and not necessarily the pullup device in particular). If you want to make this more robust, you could consider adding external clamping diodes, a ferrite bead, or even a transistor buffer between the switch and the pin.
H: How do I convert a signal of 3v to 2v to a signal of 0 to 5 v I'm measuring input voltages between 2v and 3v (3v volts corresponds to a reading of 0 and 2v corresponds to a reading of 10,000) on the analogue in of my arduino. I would like to measure the voltage at the highest possible resolution of the arduinos A/D converters.Using an operational amplifier and common resistors how would I convert a voltage range of 3V - 2V to a corresponding 0v - 5v for the arduino inputs. I tried Using the simplified method on this page Scaling Voltages With Op amps |Gain| = Output Range / (Vin.max – Vin.min) so gain would be 5 Gain = Rg / Rin so Rin = Rg/Gain picking a 10k resistor for Rg i get Rin as 2k Voff = Vin.max * ( |Gain| / ( |Gain| + 1 )) so 3 * (5/(5+1) - this part confuses me, I would think that the offset is simply 2 because I know that the lowest voltage I need to measure is 2V Voff = Rbot / (Rtop + Rbot) * Vref and here is where I get lost AI: I would suggest just using a lower reference voltage rather than altering your signal. By using a lower reference voltage, your 1024 discrete points are spread over 0-3V rather than 0-5. In most cases, using the default reference voltage is fine, but sometimes the extra precision is needed. In order to do this, use a voltage divider with Vout=3V or slightly higher than the maximum voltage you ever expect to see, and connect the input to the VRef pin on the Arduino. An example of a voltage divider would look something like this: simulate this circuit – Schematic created using CircuitLab Remember, the formula for a voltage divider (should you have forgotten or don't know) is \$V_{Out}=\frac{R_2 V_{}in}{R_1+R_2}\$. It's a good idea to use larger resistors so that you can keep your current draw to a minimum.
H: Vias in a footprint using Eagle I have a fairly complex footprint which I have created in Eagle. Particularly the complexity comes from the number of vias required for the footprint (this is an RF part). Initially I tried to drop the vias using the through hole pads as a replacement, but when I do this, it will not allow me to select the layers which it goes through, instead it just penetrates the entire board. This component will be placed on a 4 layer PCB. Ultimately my goal is to only have the vias go from layers 1-2 and not completely through (1-4). Should I be using the via tool in the actual board layout? If so I'm not sure there is an easy way to place the vias after the part is placed in the layout. Maybe in the footprint I should use markers, and replace the markers with vias in the layout. Here is a link to the data sheet and the footprint: BPF-A127+ AI: Apparently, Eagle doesn't allow vias in footprints (only pads). Markers will work to check alignment, but for creating them you can write a script that takes the part designator as parameter, and uses it to extract location and rotation to place the vias at the correct coordinates. Something like place_bpf_vias(part_designator) Because the vias are not linked to the part, you will have an issue when moving it, so first select it with the vias as a group.
H: Showing three functions with Decoder 3-8 I`m trying to show 3 function with 3-8 decoder with only OR gates. The following functions are: F1 = A'BC' + AB'C' + ABC F2 = A'B'C' + A'BC F3 = ABC + AB'C' + A'BC' + A'BC so what I did is: I need to know if I did it right or there is something wrong in my decoder. AI: If you connected them: A -> i-0 B -> i-1 C -> i-2 It looks good to me. Note that: F3 = F1 + A'BC So F3's OR gate only needs to be 2-inputs, at the cost of latency.
H: Thevenin equivalent of a circuit I'm trying to solve this problem, and i seem to be unable to solve it, part of the reason being that the there is a dependent current source in here, so I can't find the Thevenin equivalent resistance and voltage, I did find out the Ix current value of 5 Amps tho. simulate this circuit – Schematic created using CircuitLab So I would like to ask, if anyone knows the steps to simplifying a circuit with dependent current sources, independent voltage sources and resistors, into a Thevenin equivalent circuit. I tried to use Kirchoff's current law, to find voltage at nodes and then using that I calculated the value of the current flow, but I am not able to find out how to find the Thevenin equivalent resistance of the circuit, which is the very last step I need to take to get the Thevenin equivalent of the circuit I'm trying to simplify. Got the circuit now! The Question was: Find the Thevenin equivalent of the circuit to the left of terminals A and B (do not include the load resistor RL) AI: I think Thevenin (or Norton) equivalent circuits do not consider variable sources. The same refers to non-linear resistors (and other elements in AC scope). But I understand what you mean: you would like to have something like these. In your case you should first select all the elements that are not dependent on other and do not alter other elements, and simplify them. The next step is to find all independent voltage/current sources. Now combine non-linear static elements, like resistors. The combination of a linear object and a non-linear object is also non-linear object (but there is a theoretical possibility that two non-linear functions make a linear one). At this moment you get: combined resistances that are (generally speaking) non-linear and do not alter anything and independent and dependent sources, and the elements that alter sources. If possible, combine independent sources. That's the hardest task now: to combine independent sources with dependent. The Kirchoff's laws might be necessary here. UPDATE According to your circuit, this is not that difficult as it seems on the first sight. Please forgive me there are no exact calculations as I did them last time almost 20 years ago... First of all, take a look at the non-ideal current source I1. Because it has R1 in parallel you can convert it to a non-ideal voltage source, which has resistance in series. This voltage source would have internal resistance 1 Ohm too and voltage R1 * 4Ix that is 4*Ix volts as R1 = 1 Ohm. I will name this new source as V2. At the moment on the left side of the circuit you have non-ideal voltage source V2 (equivalent to I1 current source), its internal resistance (equivalent to R1), than voltage source V1. The R1 resistance is gone as it became internal load of voltage source. More reading about source transformation. Because in the same branch there are two voltage sources you can combine them. So it is E = V1 + V2 which leads to (4 Ix - 10) V (- because V1 is in opposition to V2). Now we have the first part of our task, the source. Now we're going to find equivalent resistance, and, moreover, we need to drive out Ix from source equation, because after combining resistances to one there will be no Ix. As we know from Mr. Kirchoff, the load current (the one in R3), say I, divides in two: Ix and IL (IL flows through R3). The Ix is U2 / R2 and IL is U2 / (R3 + RL). You can write down proper equations yourself :). Now you can find relation between Ix and IL (you need IL in equation of voltage source) and make E function of IL. If this source is no more function of Ix, you can combine other resistances to one equivalent. Do not forget source E internal resistance (the one driven from R1). Please note that this method will lead you to have voltage source that is a function of load current (so in fact load resistance RL). This is normal as U2 depends on this load (that's why I've written at the very beginning it is not true Thevenin method).
H: How to implement HD74HC32 (quadruple 2-input positive-OR gate)? I'm struggling to implement the HD74HC32 (quadruple 2-input positive-OR gate) package: My breadboard looks as following: Notes: 1.8 volt power supply, sufficient according to the HD74HC32 datasheet 1A is located at the left bottom Vcc connected to [+] and GND connected to [-] 1Y connected to LED Anode LED cathode connected to [-] I tried every possible combination, with and without resistors, but I cannot get the gate to work. The LED even stays on while 1A and 1B are disconnected. How do I get this OR gate to work as expected? The following question looks alike, but I just can't get it to work :( Connecting AND Gate Chip to an Integrated Circuit My reputation is too low to embed images, that's why linked directly, sorry! AI: On CMOS IC's like the one you are using, unused input pins float high. This means that if nothing is connected to them, the circuit will act as if they have a Vcc input applied to them. To resolve this, connect inputs you want to have a value of '0' to ground.
H: Most efficient way to convert 6 V to 5.5 V My goal is to design a USB charger for my phone/tablet when I don't have access to the power grid. I've used a LM317 with a 12 V, 5 A·h SLA battery but it does not provide enough capacity due to the power dissipation of LM317: $$(12~\mathrm{V} - 5.5~\mathrm{V}) \times 700~\mathrm{mA} = 4.55~\mathrm{W} \approx 5~\mathrm{W}$$ The LM317 burns about 5 W as heat. I need to convert 6 V from my battery to around 5.5–5.6 V (AC USB charger voltage at 500 mA load) to charge more efficiently and decrease battery weight (half the cells, half the weight). I've tried designing a op-amp regulator with a MOSFET but the VGS threshold is just too high for the op-amp to turn it on—it takes a VCC of about 8 V which starts to increase my heat losses to unacceptable levels. AI: If by "best" you mean "most efficient", then you want a switched-mode power supply, or more specifically, a buck converter. Efficiencies above 70% are common, and above 90% is possible with careful design and selection. With such a device, you may indeed be able to use a 12V battery without any more loss than you would have with a 6V battery. The LM317 is a pass transistor driven by an error amplifier, essentially an op-amp plus a transistor. An op-amp plus a MOSFET is not very different, and you will not improve on the efficiency of an LM317 with any combination of op-amps and MOSFETS that don't involve rapid switching, and probably an inductor. Without switching, you have a linear regulator, and the only place excess voltage can go is into heat. Electrical power is the product of current and voltage: $$ P = IE $$ and as long as you have any device with a voltage across it and current flowing through it, you are converting electrical energy into something else, usually heat. Non-linear regulators avoid this problem by rapidly switching between periods of high voltage and low current, and low voltage and high current, except in an energy storage device (an inductor) which can store the electrical energy in something more easily recovered than heat (a magnetic field).
H: Can you turn on / off LEDs from a webpage (javascript) via a microcontroller (arduino)? I would like to use an Arduino microcontroller (with whatever shield necessary) to control LEDs. My challenge is how to get users to interact with a javascript-driven webpage to send a signal to the microcontroller to blink an LED. AI: The software could combine the arduino examples blink with webserver. The hardware to run the web server on the arduino would be either the Ethernet or WiFi shield. Alternatively, you may want to run the server on another machine and use the USB serial link from that machine to the arduino to control whether the led is on. The web server could set a variable when a url is posted to, and that variable could determine whether or not the blinking occurs. Ask at stack exchange or google for the javascript side to use ajax to post a value to a url when the user does something, or use a simple form with checkboxes to start with.
H: Finding the total energy of the network in steady state i got a network below in steady state im trying to find the energy in the network by the capacitors and inductors. simulate this circuit – Schematic created using CircuitLab My attempt to the solution was: 1) i open circuited the capacitors, and short circuited the inductors 2) i used nodal analysis, grounded the bottom node 3) i made Va at the node between the 2H inductor and the middle 3ohm resistor 4) Vb is the node between the 3H inductor and the middle 3ohm resistor 5) Va is 5V, i got my Vb to equal to 16/3V 6) now im stuck cus i do not know what to do next AI: HINT In DC steady state, the voltage at the top of the 5V supply and the top of the 4 ohm resistor will be the same. Then your circuit just looks like this: simulate this circuit – Schematic created using CircuitLab Use Thevenin's theorem to simplify the voltage divider on the left hand side, and you'll get a circuit containing just a voltage source, a current source, an inductor, and resistor. The current through L1 will be 6A, so you can calculate the energy in that inductor. The same current must flow into the Thevenin equivalent voltage source, so you can easily find the current through the first inductor by equating powers: \$V_{th}*6A = 5*I\$ and solving for I. This will be the current through the first inductor. The voltage across the capacitor in steady state will be 5 volts, so you know the energy in it. Add them up to get the total energy in the circuit.
H: Can a speaker be damaged but not blown? If one plays too loud of a sound through a speaker, it can blow - i.e. become visibly torn or stop working entirely. However is it possible that the loud sound will damage it partly and result in the speaker operating at a less loud level; can a speaker blow just a bit? AI: Sure. Speakers are essentially large coils of wire, and when they "blow", it's generally that the coil is taking too much current and isn't being cooled enough, and is damaged. If the speaker is completely destroyed, this may be that the wire in the coil is broken or shorted, so that it doesn't operate. However, one can imagine a scenario where something else in the speaker is damaged, such as the surround (the rubber coil that allows the cone to vibrate freely) or the spider (cloth "guide" inside the speaker, behind the cone) or leads leading into the cone are damaged, but the coil still operates. Any of these issues have the ability to reduce the volume level of the speaker. It's worth noting that it's usually not the "loud sound" that damages the speaker, it's the large inrush of current that the voice coil cannot handle, the excursion of the cone (moving farther than designed for), or natural wear and tear on components.
H: Easiest & cheapest way to use embedded filesystem on SD card I want to build a cheap, basic project which logs data to an SD card that can be removed and read using a normal card reader in a computer. Requirements are fairly basic so performance is not critical but simple would be good to enable a smaller device. What is the best way to implement this? I guess something like FAT16? Are there free libraries for something like this? AI: Have you looked at the openLog datalogger? It probably already does what you want. It uses an ATmega328P, a microSD card socket, and not much else. It has a very simple serial command set. Normally, anything you send simply gets written to a text file on the SD card. It supports FAT16 and FAT32 using sdfatlib. Image credit: Sparkfun.com It's open source, so if you want to modify it, you should be able to do so pretty easily.
H: Flyback transformer - ambiguous schematics and other issues I'm currently using this schematic for a flyback transformer: (source: eleccircuit.com) As you can see, there's a big problem - neither the schematic, nor the website describing it, give the value of the capacitor. It says ".01", but gives no units. http://www.eleccircuit.com/efficient-flyback-driver-circuit-by-ic-555-irf510/ Is the website. Anyone have any ideas what the unit could be? I used a 100pF capacitor in place (since I don't have a 10mF/nF/pF). I don't know if this could be a cause. Since I don't have any 10K potentiometers, I used 2 10K resistors instead. Not sure if this could have affected it either. I used a large steel screw (about 8mm diameter, 8cm long), wound bifilar, for the core. I do recall something about using something straight for it, maybe I'm wrong. The only other possibilities I can think of could be poor assembly (bad soldering or unintentional shorts), defective components, or a bad schematic. FYI, despite my tests, it hasn't worked at all (as in absolutely no arc, not just a small one, which to me suggests the type of core isn't the cause), although there is some current flowing in it since some components have heated up (but not melted). Anyone know which of the above factors could be the problem? AI: This part of the circuit is just a simple 555 astable with variable mark/space ratio. The capacitor, along with the resistance values sets the frequency. The transistor is there to drive the mosfet which simply switches the current on and off through the primary of the transformer. The transformer steps up the voltage depending on the turns ratio. The capacitor will be .01 microfarad (or 10nF as Andy correctly gives). By using a 100pF capacitor the oscillator will run at too high a frequency (100 times more than the original design). I also agree with Andy that the transformer (and its design/construction) is your real problem. My real concern about this question is that if your knowledge of electronics is this limited then building this type of circuit could be fatal. High voltage is not not an area a novice should tamper with.
H: Powering a custom Arduino compatible - 5V regulator or no 5V regulator? I'm building a custom Arduino compatible with an ATMEGA328P. Would it be better to get a 5V power supply that plugs into the wall to power the project and gives me a barrel jack, then connect that directly to the uC, or should I instead use something like a 9V power supply, then use a 7805 to regulate down to 5V? AI: You should go with the 5-V external supply and put a capacitor between 5 V and GND near the ATmega to reduce noise in the power. With the 9-V supply, you still need to have a wall wart but you also have an extra component on the board. Also, don't use a linear regulator if you do decide to use 9 V. Since you're going from 9 V to 5 V, you're dissipating (9-5)/9 = 44% of the input power as heat.
H: How to build a smart wall I want to build a smart wall where people can touch a 2 sqft region of the wall and it will detect who touched it and which cell they touched. The wall itself is made of plywood and I have access to both sides. You can think of it like turning the wall into a giant board game, where I have some server behind the wall and when it's a player's turn, they tap a couple of areas to move their game piece. The resulting move is displayed on their mobile phone, so it does not need to be displayed anywhere on the wall. Given my requirements: ~50cm omnidirectional proximity detection Ideally I can place it on the back of the wall, rather than in front. I only have control of the wall itself, setting up additional sensors elsewhere in the room is not feasible. Uniquely identify each player for stats tracking. Players can wear some sort of bracelet if it helps the sensor, but it should not be much heavier than a LiveStrong bracelet; the hands must remain totally free. As cheap as possible. My budget is < $30 per 2 sqft cell. How can I build this smart wall? AI: RFID Bracelets, with readers behind the tile, assuming they are 2 sqft each. Connected to a bluetooth or web enabled microcontroller (or an arduino or similar) or computer to handle all the backend and display updating.
H: What is the RMS reverse voltage for diodes? in The datasheet 1N4001 Vr RMS 35V 1N4007 Vr RMS 700V What is the meaning of RMS reverse voltage? AI: Clabbachio is correct for a sinewave and that is how the datasheet specifies the voltages. It is the peak voltage that should never be exceeded as this will breakdown the diode junction. Other voltage waveforms will have different values for peak and rms. (for example in a power converter where signals are switch pulses.) The r.m.s. value can be quite low compared to the peak voltage. In these cases the diode must be chosen to withstand the peak reverse voltage.
H: 16MHz Crystal with 2p load capacity: What load capacitors are necessary I found a nice and cheap crystal on AliExpress which I want to use with my ATMEGA328 microcontroller. Its load capacity is only 2pF. Normally I would say, that the 2 capacitors from the crystal to ground with 4pF should work fine. But isn't the parasitic capacity of the soldered part that high, that maybe no additional capacitors are needed? Is exactly this the idea of a crystal with 2pF load capacity, that no additional capacitors are needed? I do not have an oscilloscope, because of which it is difficult for me to test when it is oscillating. AI: Don't rely on parasitic capacitance. Put the two capacitors in there and you can adjust them later if you need to. You won't be able to probe the crystal directly because it's parasitic capacitance usually kills high Q resonators. You can however tell if the processor is running when configured for the external crystal oscillator. Once you have the processor running drive an I/O line up and down to an LED (once a second or something) to watch for any failures in the oscillator. Hit it with some cold spray and see if it dies. Likewise heat it up to see if it dies. That will give you an idea of how tolerant your design is to temperature variations. If this is a one-off that you are just playing with then that's probably as far as you need to go with fault tolerance testing.
H: An ethernet PHY chip speed support I found ENC28J60 Ethernet PHY chip. The specifications say that the Physical Network Type is '10BASE-T' on the one hand, but on the other hand the data rate is '10 Mbit/s, 100 Mbit/s, 1000 Mbit/s'. As far as I know, a 10BASE-T chip can not support a data rate of 1Gbit/s ! Moreover, the 10BASE-T doesn't support Full-duplex, but the specifications say that the Communication Mode is 'Full Duplex, Half Duplex'. Please help me solve this contradiction. AI: From the datasheet Fully Compatible with 10/100/1000Base-T Networks Integrated MAC and 10Base-T PHY Supports One 10Base-T Port with Automatic Polarity Detection and Correction Supports Full and Half-Duplex modes So, it is 10mbps FD (and yes, 10baseT supports full duplex, at least some cards do) and, as all 10baseT devices is compatible with newer networks.
H: Can I control a 12V motor from arduino using an H-bridge? I want to control my 12 volt geared DC motor from my Arduino Uno. I want it to be able to rotate both directions as I'm intending to use it for a robot. Can I use the L293NE H-bridge in this case? The following diagram shows the pin connections. For this I'll have to externally supply the IC with 12 volts, but will I be exceeding the maximum voltage rating for the IC? I dont really want to blow up the IC in the midst of all that circuitry. Please tell me if there's a more suitable h-bridge for handling 12-volts, or another approach to my problem. AI: To answer your question whether you will damage the L293NE IC, no you wont damage it if you provide 12V. Take a look in the datasheet, there is a section stating the recommended values for each pin. So pin 8 which is the one you will be powering your motors off, can take up to 36V.
H: How to correctly manipulate the I/O pins of PIC chips? I learned a concept that when changing bit value of PIC I/O pin, PC would first read the value of the I/O port, and change the value, and write the changed value to the register. I validate this argument by using this circuit: The code I wrote in mikroC for PIC: void main() { TRISB = 0; PORTB.F0 = 1; PORTB.F1 = 1; while(1) ; } I learned that because LED D1 only need 0.7 V, so RB0's voltage is about 0.7V. When my program set RB1 to 1, PIC first read the value of port B, get 0000 0000. And since RB0 is 0.7V, it was interpreted as low. So after changing the value(set prot B as 0000 0010), only D2 is on. So I connect resistors between LED and IO pins, and changed the code: void main() { TRISB = 0; PORTB.F0 = 1; Delay_ms(500); PORTB.F1 = 1; while(1) ; } At the beginning of simulation, the circuit act as I expected, voltage of RB0 is 4.5V. However, after the 500ms delay, only D2 is on. It seems weird to me, I thought D1 and D2 would be on at the same time.(Read should get 0000 0001, so after changing, port B should be 0000 0011) AI: PICs have the annoying gotcha of having ANSEL default to ones, which means that ports that can act as analog inputs are so by default. This will force digital reads to zero (see port diagram below taken from the PIC16F833 datasheet to understand why), and that is probably why RB0 gets cleared when setting RB1 with a Read-Modify-Write operation. In main, clear ANSEL before accessing PORTB and try again. By the way, LEDs usually drop more than 0.7V, ~2V is common, so it is possible that the first experiment succeeded for the same reason that the second one failed.
H: Understanding rc time constant I get that if you put a resistor in series with a capacitor and add DC voltage, the cap will take longer to charge up. How can I calculate, how long it takes for the capacitor to charge up/discharge with the given capacitance and resistance and how can I calculate the voltage at a given time? AI: The voltage across a capacitance \$C\$ at time \$t\$, which was initially at voltage \$V_0\$, which is discharging through a resistance \$R\$, is given by: $$ V(t) = V_0 e^{\frac{-t}{RC}} $$ Charging a capacitor with a battery of voltage \$V_b\$ through a series resistor is similar: $$ V(t) = V_b(1-e^{\frac{-t}{RC}}) $$ From these equations, you can see as time goes on, the capacitor voltage approaches its final value (\$0V\$ for discharging, \$V_b\$ for charging) but never reaches it. So, if you want to know how long it takes to (dis)charge, you first have to decide at what point to call the capacitor (dis)charged. Let's say we want to define 99% discharged as "discharged". How long will this take? Say we had a capacitor charged to \$1V\$; when it is "discharged" it will be at \$0.01V\$. We can substitute these values into the first equation and solve for \$t\$: $$ 0.01V = 1V\cdot e^{\frac{-t}{RC}} $$ $$ \require{cancel} \frac{0.01\cancel{V}}{\cancel{1V}} = e^{\frac{-t}{RC}}$$ $$ ln(0.01) = \frac{-t}{RC} $$ $$ -ln(0.01) RC = t $$ $$ 4.6 RC \approx t $$ \$RC\$ is the time constant, so this tells us that after about 4.6 time constants, the capacitor will be 99% discharged. The same is true for charging.
H: How are electronic musical greeting cards made? I remember that long time ago, when I was a kid (in the 80s) there was some electronic greeting cards that when open up, start playing simple tunes through a small piezo-electric speaker. A quick look at the board reveal a small black chip and some circuits under: I'd like to know how is the small black chip implemented? (There is never any information or label written on it.) Is the chip made using same technology as modern microprocessors (CMOS technology, but with a very large nm process since size here is not an issue?) I'm also puzzled by the fact there is no crystal oscillator or capacitor on the board, which might have been useful for generating the square waves for the speaker. AI: These sound chips were and still are a creation of Seiko/Epson corporation or one of its subsidiaries. It was a spin off product from the extremely low power CMOS processes that they developed for the watch business. The design of the IC itself is actually a 4bit uProcessor with mask ROM for the different "tunes". They also provided more expensive OTP (EEPRom) based units for experimentation before changing the mask. I'm sure that there are a number of companies that could make these and searches on "greeting card music chip" show lots of Shenzhen references. They are purchased as KGD (Known Good Die) in waffle packs and then glued to the PWB (PCB), wired bonded to the pads and covered with epoxy. I'm sure now a days you could get them with bump bonds.
H: Cascade DACs to get higher resolution I got a RAM-DAC with 3 channels and 6 bits for each channel. The device in question seems very straightforward to use with a modern MPU like an AVR. The resolution is a bit low, so I thought about cascading the three channels with a R-2R-ladder. Does that work with current-output-type DACs? AI: Simply put: No. It doesn't work that way. In theory, yes. In practice, not so much. There are two main issues: Noise, linearity, and timing. Nose is the easiest to understand. Noise in the first DAC will be added to noise in the second, resulting in more noise. Next is linearity. The DAC has more than just noise on the output. Let's say that you have a 2 bit DAC, so it outputs 4 levels. It should output 0%, 33%, 66%, and 100%. Instead it might output 0%, 25%, 82%, and 100%. This will make combining the output of the DACs together more difficult to do while increasing accuracy. Timing is also difficult. And by that, I mean getting the various DACs to output the correct data at exactly the same time. If one DAC outputs it's new value slightly ahead of the 2nd DAC then you could end up with noise and spikes where you don't want any. Use the correct DAC for your application and you will be much happier.
H: what is Tau in this very simple circuit? \$\tau = RC = 100 \cdot 22nF \$ or \$1000 \cdot 22nF\$? or should I add both the resistors together? AI: After a "long time" the capacitor will charge to a voltage that is slightly less than 12V. This voltage is approximately 10.909V and this value is determined solely by the potential divider formed by R2 and R1. It rises exponentially towards this voltage at a rate governed by both resistors and the capacitor. If it were just a single resistor (R1) with no parallel resistor (R2), \$\tau\$ would be \$C_1\cdot R_1\$. But it isn't; R1 is effectively reduced in value by the effect of R2. This new value of \$R\$ is the parallel combination of \$R_1\$ and \$R_2\$: $$\tau = C_1 \frac{R_1 \cdot R_2}{R_1 + R_2}$$ Notice that R is the product/sum of the individual resistors R1 and R2. Another way of looking at it is converting V1, R1 and R2 to its Thevenin equivalent. It might be worth googling that if you weren't aware of it.
H: Changing the orientation of the capactior in a simple integrating op amp How does the terminal relationship i=c(dv/dt) change if you switch the orientation of a capacitor from +/- to -/+. Here is the "normal" model that I have been studying. simulate this circuit – Schematic created using CircuitLab Here is the "reversed" model simulate this circuit I think the sign would just be negative of the previous. AI: No, you will get the same result in both cases, which is 0. You can see this is true by definition since the output is grounded. Even with the output not grounded, flipping the capacitor won't make any difference. The polarity of a capacitor does not decide the polarity of the voltage applied to it. It only decides which polarity of applied voltage will cause the capacitor to blow up. This is assuming a type of cap to which polarity matters, such as electrolytic or tantalum. In your circuit, the right side of the capacitor will always be at or lower than the left side due to the fact that only positive voltage is applied into the integrator. This particular integrator inverts as a side effect of its topology. Note that this circuit won't work unless the opamp has a negative supply. Without a negative supply, the opamp can't swing below ground and therefore can't make the expected output voltage.
H: How can I check input of USB? I have following wire as shown below, one end has male USB connector and other end has four wires. I know, when connected to laptop, the RED one acts as voltage source and BLACK as ground. If I give 2 bits data input to GREEN and YELLOW one, is there any software or API for (Python, C or any other language) to know about state of those two wires ? I mean to check if GREEN or YELLOW one have a voltage or not. Please guide me if I am asking the wrong question. AI: No, you cannot sense the USB wire state directly. USB is a much more complex interface than that, it is no comparison to the old style serial and parallel ports that could be used for direct I/O with a simple driver program. A complex handshake is exchanged with the PC even before the first byte of 'real' data/payload can sent. Maybe your PC has a parallel port that can be used? Or you should use a USB to GPIO converter which are broadly available for varying prices (both extremely high and extremely low).
H: How to translate Change in Duty Cycle? Morning! I have a sensor, output of which is change in Duty Cycle of current. Now, this sensor is to be used with a MCU. My knowledge of sensors with change in duty cycle as output is limited. So,i have the following question: Would the change in Duty Cycle of current translate into change in duty cycle of Voltage if a resistor is attached at the output of the sensor? Given such a case, what's the deciding factor for Sinking output vs Sourcing output? In this case, its a Wheel Speed Sensor, output of which is change in duty cycle. Thanks for you consideration!! AI: Would the change in Duty Cycle of current translate into change in duty cycle of Voltage if a resistor is attached at the output of the sensor? yes, of course Given such a case, what's the deciding factor for Sinking output vs Sourcing output? If you have an output with a full driver (not for instance an open collector / sink only driver) you could attach the resistor to ground to get a voltage signal that is time-wise identical to your current signal (high when current is is sourced), or you could attach the resistor to Vcc to get the inverse (low when current is sunken). What to prefer is a matte of system design. My guess is that you have an open-collector type sensor, in which case you will have to connect a resistor to Vcc, because the sensor can only sink current. BTW, are you sure it is the duty cycle you are interested in? Wheel speed sensors are often of the magnet/hall-sensor or LED/fototodiode type, which produce pulses at a frequency proportional to the speed. The duty cycle may change too, but is in most cases not what you should be measuring.
H: How do I configure a external RTC that uses 3-wire SPI for the LPC 2387? Here is the link to the datasheet of the RTC PT7C4302. I can do it with MISO, MOSI, but SISO I have no idea how to do. Some similar code examples would be great. AI: You need to tie the MOSI and MISO lines together and follow the protocol in the product's datasheet which will ensure a half-duplex mode of your SPI peripheral. Note that the RST signal is high when you talk to the RTC so you need to invert your CS somehow. MISO tied to MOSI might make it hard to talk to other devices on the same bus. One way to avoid issues would be to bit-bang the interface. I suppose it's not possible to use another RTC?
H: Interfacing TinyAVR with bluetooth and passing message I'm looking into interfacing the TinyAVR micro controller (not sure which one will work yet) with a Bluetooth module either the CC2540 or the nRF8001. I want to have the TinyAVR micro controller use the Bluetooth module to send out a small message like 0xf for example, which my computer would then read and display on screen. My goal is to see if I can make kinda a hardware echo. Is it possible to interface these two units? If they can be interfaced what is required to get this to work? AI: Connecting the two will be possible but those are both chipset level solutions and will require significant expertise in PCB design and firmware programming. Without sounding condescending it sounds like a beginner question so although they are more expensive you'd probably be better of with a module that offers a simple serial interface and won't require any PCB design. An example of such a module is the RN42-XV Bluetooth Module from Sparkfun, I just picked that out as a quick example of one that is reasonably priced and should be easy to use. They and other suppliers have many modules along similar lines. For those you can connect using a UART and send serial commands to setup connections much like you'd do with a modem. Another solution may be an Arduino BT board, I've never used one but Arduino boards typically have lots of example code to help you get started quickly.
H: Are Data Cards simply L1 (Physical Layer) Devices? I was just wondering, how many levels of the TCP/IP (OSI) Stack reside within a modem or a 3G data card and other similar networking devices? These devices do have a physical (MAC) address, which indicates that they have a Data Link MAC sub-layer, but what about LLC? What about the rest? AI: TCP/IP is not, strictly speaking, an OSI network - the OSI model only maps exactly onto the OSI network protocols (X25, X400 etc). There's also an iceberg hidden in your question of which the data card is just the tip: the 3G data network the card connects to ("UTRAN") is not a simple thing and includes several sorts of link. It's almost entirely transparent to the user: from an end-user or operating system point of view, it provides a point-to-point link with an IP address on each end. The user's end may appear as a PPP modem-style link, or an ethernet-style link with a MAC address. The MAC address is there for convenience and may not be globally unique (I have several Sierra Wireless cards on my desk all of which report the same MAC address to Windows "ipconfig"). Although it looks like Ethernet to the operating system, it isn't anything like it at lower layers. This part of the link is essentially made up by the modem card's drivers pretending to be an Ethernet device. All wireless modems have a substantial amount of link control mechanism ("LLC") in order to find a radio network, register on it, ensure billing security, allocate radio timeslots, and roam between cells. This is "out of band" from the point of view of TCP/IP. The links from the modem to its base station, the base station to the operator core network, out to the data network operator (which may not be the same as the radio network operator - see "MVNO" such as GiffGaff), and onto the public internet are all encapsulated up into one "link" with an IP address on each end but not anywhere in between.
H: Widely available IC for encording and Decoding DTMF data I am planning to do some research in data transmission over the air. For this I am interested in DTMF encoding and decoding. Is there a widely available IC to achieve this? A circuit diagram using the same ic would be a better answer. An arduino solution would be even better. AI: Holtek Semiconductor have traditionally had a wide range of DTMF encoders and the Holtek HT9170 may be a good option for a decoder while the Holtek HT9200 is an option for the encoder. The datasheets contain examples of connecting to a microcontroller and they are quite easy to use. Holtek products often don't seem to be carried by a lot of larger suppliers but I just checked and they still seem to be commonly available from smaller suppliers so you shouldn't have much trouble tracking them down.
H: What is asked by this question re cache memory? I've a difficulty understanding what is asked by this questions: Can you explain in more detail? AFAIK the associativity determines the number of sets and the size of the set determines the number of bits that is not the tag. Is that correct? Then the block size determines the number of bytes per row of each set. Here we got block size 4 words i.e. 4*4 bytes = 16 bytes. Which is 2^4 so there are 4 bytes per row of each set. Since there is only one set, the size of the set is 16 KB = 2^4 * 2^10 * 2^2 = 2^16 = 16 KB data. But I don't understand the third sentence "Each block has 4 X 32 or 128 bits of data plus a tag." Why is the number of bits an other than the size of the data? AI: The question does indeed make some implications which may not be too obvious. I would infer: 16KB = 4K words ==> 1 word = 4 bytes = 32 bit. 1 block = 4 words ==> 1 block = 4 * 4 bytes = 128 bit Verify: 16KB / ((4*4 bytes)/block) = 1024 blocks -- check. For each block(/line) of the cache there is some "administrative" data needed for the logic to know "what's cached where". This is the "tag". In the given example it is already calculated that for each block (128 bits) of data there will be (32-10-2-2)+1 = 19 bits needed for this administrative information, which means there is an overhead of (19/128) ~ 15% of extra storage required.
H: 8:1 Multiplexer With 5 Parameters of F(A,B,C,D,E) = ABCD +B'CDE+BC'D' I am trying to create a multiplexer 8:1 with 5 parameters of the function $$F(A,B,C,D,E) = ABCD +B'CDE+BC'D'$$ what I did its to right it as minterms so what I get is: $$ F = ABCDE + ABCDE' + AB'CDE + A'B'CDE + ABC'D'E' + A'BC'D'E \rightarrow m(31,30,23,7,24,9)$$ now what I need to do? I need some advice how to continue. Thanks! AI: The approach you're taking only works if you have a 32:1 multiplexer with 5 select inputs. If what you have is an 8:1 multiplexer with 3 select inputs, you need to get creative. Note that inputs A and E only appear in one term each, and they're never inverted. This means that you can connect BCD to the select inputs (B is the MSB) and create the desired function by connecting A to the 7 input and E to the 3 input. You also need to tie the 4 input high and all other inputs low. simulate this circuit – Schematic created using CircuitLab
H: What is In-circuit debugger and In system programmer On many boards I have found that there is a circuitry called In-circuit debugger and In system programmer. What are these and how they are related to JTAG? I understand JTAG is also a kind of hardware debugger. Shall appreciate if someone can enlighten me. AI: ISP (or ICP) means that it is possible to download a (new) application program to your microcontroller without removing it from its circuit. (Contrast this to the stone-age style of removing a chip from its socket, putting it in the programmer to be programmed, and then putting it back in the circuit to be tested, only to discover the next bug..) ICD means that, while the chip is in the target circuit as described for ISP, you can set breakpoint(s), run the program, halt the program, examine and change variables, etc. JTAG is a (hardware) communication mechansim beween a host and target system. IIRC it was originally designed for testing complex hardware. Many chips (most notably ARM chips) use it as (an) interafce to their ISP and/or ICD functions.
H: How is "Overtemperature shutdown/protection" implemented for ICs? IC data sheets often give some informations about the circuits over-temperature protection. Lets take a Microchip LDO (MCP1702) for example: "...If the power dissipation within the LDO is excessive, the internal junction temperature will rise above the typical shutdown threshold of 150°C. At that point, the LDO will shut down and begin to cool to the typical turn-on junction temperature of 130°C. If the power dissipation is low enough, the device will continue to cool and operate normally. If the power dissipation remains high, the thermal shutdown protection circuitry will again turn off the LDO, protecting it from catastrophic failure." How exactly this is achieved on the chip-level? Especially the hysteresis behavior. AI: In short: a comparator-with-hysteresis compares a fixed voltage with a temperature-dependent voltage and shuts down the series transistor while it trips. A fixed-voltage source is fundamental part of any voltage regulator. A temperature-dependent voltage source can be as simple as a diode. The challenge for IC designers is to make the temperature-independent voltage source! a comparator with hysteresis is a fundamental circuit: positive feedback is the key.
H: How to connect sensor to PC? I have made a sensor that produces a 4 bit output. I want to perform some logic based on patterns. I was thinking if somehow I could give that 4 bit input to my computer, I could then write code to perform logic. But, the problem is, I have no idea how to do this. How can I give a 4 bit input to the computer? Can I use USB or some other hardware? AI: You can use any IO port available on your computer. PCI(e), USB, Ethernet, parallel ports, RS-232, PS/2, game port, Firewire...you could use any of them, provided they are fast enough for the rate of data you must transfer. If you want easy, the parallel port is the way to go. These are trivial to interface to TTL. Though, they are quite uncommon these days. RS-232 is also pretty easy. You can use MAX232 to generate the +/- 12V signaling, and a UART (included in most microcontrollers) to build circuitry that speaks RS-232. Serial ports are also becoming quite uncommon. One solution is to use a USB <-> RS-232 IC like those made by FTDI, either by including one of their ICs in your circuit, or buying a pre-made cable with the FTDI IC included. This is how the Arduino implements its "USB" connection. You can also use the RS-232 control lines as a bit-bang interface if you don't need high speeds. There are also any number of data acquisition peripherals. Some have PCIe interfaces and are extremely fast and expensive. Some cost a few dollars on eBay and may have a USB interface. Without knowing more about your requirements it's impossible to make a specific recommendation.
H: MOSFET as a voltage controlled resistor This question might be too localized, but I try. Is it possible to replace a variable resistor by a MOSFET, under conditions shown in the following schematic? If yes, can someone propose a MOSFET type or the required MOSFET parameters. simulate this circuit – Schematic created using CircuitLab Update What I am actually trying to accomplish is to replace R2a by something simple that I can control with a microcontroller (DAC). I am hacking an existing device and can not replace the resistor R1. AI: Yes, BUT: Technically the MOSFET can operate as a variable resistor, but there are two main issues: In the ohmic region (which is quite narrow, in terms of output voltage) the linearity is poor, and it also depends on input voltage. It won't be very easy to tune it to behave like a proper resistor. MOSFETs' output resistance is usually not an accurate value, and it will be hard to get the exact value from the datasheet. What you can do is to measure it for various input and output voltages, and to create a table with the values. But if you don't need it to be accurate, you can use the graphs in the datasheet. Another choice can be to use an integrated VCR.
H: What is the point of this MOSFET? In the image above, could someone please tell me what the MOSFET is doing? From what I gather, it is there for switching between the VCC_in and the regulated voltage, in conjunction with the SDA and SCL lines. However, if all the components are receiving the regulated 3.3V from the voltage regulator (IC1) then why is the MOSFET needed? Is it if you were to be using a microcontroller which runs off 5V, and thus the SDA/SCL lines are also at 5V? Thus they need to be switched down to 3.3V? I'm trying to recreate this design, but the input voltage is already regulated to 3.3V as the PIC I'm using is powered and needs 3.3V anyway. I've taken the regulator out I'm wondering if I can take the MOSFET out too. AI: They're bidirectional level shifters. You can remove them only if the 3V3 pins are 5V-tolerant and if the 5V pins can accept 3V3 signals properly.
H: Need a protection diode if only connected by common ground? I have many solenoids running on 25VDC. Some are controlled by MOSFETs which are powered by a 5VDC circuit, and others are controlled by physical switches in the 25V lines. The 5V and 25V circuits have a common ground. I put protection diodes on the solenoids that are MOSFET controlled, but I'm not sure if I need them on the switch controlled solenoids? I've been running into a weird phenomenon where if I activate the switch controlled solenoids enough then the MOSFET controlled ones will start randomly firing in unison, and the only reasoning I can come up with is that the surge from the solenoids is going over the common ground or something and messing with the MOSFETs. If I do need a protection diode on the switch controlled solenoids, would it be possible to just put one in parallel with their busses to protect all of them? (ignore the upper switch connected to the transistor, that's not what I meant by switch controlled. the upper switch is actually an arduino out with a 10k pulldown resistor) AI: You do need the protection diodes. When you activate a solenoid, it creates a magnetic field. This is what causes the mechanical action. This magnetic field also represents stored energy. How much? Well, a solenoid is an inductor. The energy \$E\$ stored in an inductance \$L\$ with current \$I\$ flowing through it is: $$ E = \frac{1}{2}LI^2 $$ When you interrupt the current by opening the switch or turning off the MOSFET, the magnetic field goes away. But if it's stored energy, it can't just vanish. It must be converted into an equal amount of energy somewhere else. Another property of inductors is that the current through them can't change instantly. It changes at a rate proportional to the voltage applied to them: $$ \frac{dI}{dt} = \frac{V}{L} $$ If the inductor can't find a place to keep the current flowing, then it will make one, perhaps by making a spark across the switch or frying a transistor. The diode is there so that the inductor only needs to make 0.6V to keep the current flowing. The current can then flow in a loop around the inductor and the diode until all the energy has been converted to heat by the resistance of the diode and wire in the inductor. simulate this circuit – Schematic created using CircuitLab If you close SW1 for some time, a large current will be flowing in L1, limited only by its internal resistance. When you open the switch, that current can keep flowing through D1. The voltage across the inductor will be about 0.6V, because this is what it takes to forward-bias a silicon diode, and the current will die down at a rate given by the 2nd equation above. You can not share one diode like this among several inductors. The point of the diode is to give each inductor a place to dump its stored energy that doesn't affect something else. If you are sharing diodes then you aren't doing this. There seems to be another problem with your circuit: the gate of Q1 is floating when J1 is open. That is, it isn't connected to anything. This will make it very sensitive to stray electric fields (like, the really big one set up when S2 arcs across J2 because there's no diode). I bet you can also get it to turn on and off randomly by touching it with your finger. Add a resistor of maybe \$10k\Omega\$ so that it's either definitely on or off (it's hard to tell which you intended) when the switch is open.
H: Working of a GPS one of my friends is thinking of a startup in which we will use GPS technology . The thing is we are thinking of making a cheap gps receiver indigeneously but i am not able to find good links on the internet regarding the in-depth electronic working of the GPS receiver . I have understood the concept of how gps is used to locate a location . AI: You'll never be able to make a GPS cheaper than the IC solutions that are out there without dumping some money into spinning silicon dies. But in general GPS is a spread spectrum signal at 1.575GHz. You have to receive the signal then use a variety of PRN (pseudorandom) codes to correlate to the spread signal to de-spread it. (Not trivial). Once you've done that you can receive some of the timing information. However all GPS satellites share the same frequency so your receiver has to process multiple PRN codes on the same signal to find more satellites. Once you have at least 4 you can start processing position information. Trilateration is the most common technique. I've written tools to trilaterate in 3d. The solution is about 3 pages of algebra but it is the simplest. More modern receivers use more complex solutions and there are simulation packages for Matlab you can buy. Wikipedia has a good overview.
H: Relay Protection (Mechanical) In what ways can a Hobbyist with Electronics extend the life of a mechanical relay and overall make it safer to use? Or is it really not worth it as in Damage it going to occur regardless? Maybe using a Capacitor or something to store charge and let it drain out naturally? or is this not really possible using a mechanical relay? Lets pretend for a moment Solid State Relays are out of the picture. AI: Typical relay failure mode probability: Failure to Trip 55% Spurious Trip 26% Short 19% As you can see, relays most commonly fail in the "stuck open" position where the mechanical switching element fails to close and the relay fails to carry a current. Relays are less likely to unintentionally close or remain closed after the switching current is released. However, high voltages and current can actually spot weld the relay in the closed position. A major cause of early life failures in relays is mechanical wear of internal switching elements. In fact, the life of a relay is essentially determined by the life of its contacts. Degradation of contacts is caused from high in-rush currents, high sustained currents, and from high voltage spikes. The source of high currents and voltages, in turn, are determined by the type of load. Inductive loads create the highest voltage and current spikes because they have lowest starting resistance compared to operating resistance. This is especially true for lamp filaments and motors, which is why derating is more severe for these types of loads. The life of a contact can be further degraded if contamination or pitting is present on the contact. Physical wear can also occur to other elements within the relay. Some relays contain springs to provide a mechanical resistance against electrical contact when a switching current is not applied. Springs will loose resiliency with time. Relays can also fail due to poor contact alignment and open coils. So in order to protect the relay, just avoid contamination of the contacts, high in-rush currents, high sustained currents, voltage spikes, and inductive loads. Found this nice PDF (brought to you by the military): http://www.navsea.navy.mil/nswc/crane/sd18/Public%20Documents/ProductArchive/Relays.pdf
H: How to determine Frequency response in BJT What do I want to look for on a BJT datasheet to find out the maximum operating frequency before distortion occurs? Or perhaps the question should be: How do I know how fast a transistor can cause the main current to change in response to a change in the base signal current? Also, is there a noteable difference in PNP and NPN BJTs in this regard? I read that P-Channel mosfets generally have higher slew rates than N-Channel, making them favorable if you need extremely fast response. Is there any rule of thumb like that for BJTs? AI: In the datasheets of the BJT transistors, common emitter cutoff frequency, \$f_T\$ is usually given. At this frequency the magnitude of the common emitter current gain equals to one, \$\beta_{f_T} = 1\$. As a rule of thumb for BJT's, we can say that a BJT transistor as an amplifier is usable up to the frequency \$f_u = f_T/10\$. The distortion depends not only on the characteristic of the transistor (such as \$f_T\$), but also on the circuit the transistor is biased to. For example, the capacitors being used to block DC currents reduce the upper (and also lower) usable frequency of the transistor.
H: Designing a synchronous counter with d flip flops I have to design a counter with two inputs: x and y. If y = 0, the counter behaves like a 3-bit ring counter, and if y = 1, it behaves as a 3-bit Johnson counter. If x = 0, it counts up, and if x = 1, it counts down. I may only use D flip flops, and any logic gates I require. For reference, here are the state tables of a 3-bit ring and Johnson counter (in that order): So naturally, I created this big table of states: Since there are two inputs, and three states, each following state depends on five bits. Therefor the K-maps for Q1+, Q2+ and Q3+ (which are actually D1, D2 and D3 for the flip flops) are maps of five variables, making this somewhat complicated. The question is: is there a way to do the minimization with k-maps in a simpler manner (perhaps I am missing something)? Or, if there is no way to simplify the minimization, then is it wiser to use k-maps of five variables or perhaps another method (quine-mccluskey maybe, or something completely different)? AI: A design simplification is to first design the up/down Johnson and ring counters independently. Then just place a mux that selects Q* of either one depending on y. simulate this circuit – Schematic created using CircuitLab
H: Netduino or Raspberry PI for my requirements? I do not want to start a religious war, and believe that neither of them can be better in all circumstances. So, let' consider my circumstances. My problem is that I am a software guy with no knowledge of hardware and Google is not my friend today, so I hope that I can get some advice here. In order not to start a religious war, let's confine it to which is more suited for my personal requirements, which is hopefully a question which can be answered (as opposed to a general "which is better?" which obviously cannot be answered). It is, now that I come to try it, difficult to formulate exact requirements as I initially want to "play around and see what I can do", but here is as much info as I can give to help you to help me. I do not want to take the effort to learn both systems as I have little free time. SO I seek advice which will help me to make a decision and stick with it. I have 30+ years coding experience, am happy with both Windows (for Netduino's C# and .Net, although I have little experience either), and with Linux. I have no fear of new new concepts (in s/w) or programming languages. But I am not very good with h/w, although I can handle serial port comms and an Atmel up board with no o/s (interrupt driven programming) I am well versed in telemetry and SCADA, and am now becoming interested in "the internet of things", and aim to implement sensors/controllers for those. After a few hobby projects, I might attempt a commercial project (so, think of licensing) I need something that can be ruggedized to IP67, but guess that they both can. I am not too concerned about price, probably more about flexibility. I would hate to build up knowledge of one system after 5 to 6 projects and then find that there is something that it cannot do, which the other can. Since I know nothing about h/w, I am concerned about connecting peripherals. Does each peripheral have standard connections, or does it vary. Does one or the other system have more off the shelf" peripherals available? Which can support the most peripherals simultaneously (or does that not make sense, with break out boards, USB, serial bus (MODbus), etc?) Also, CANbus support would be nice, but is not a hard requirement. I do not require the display capabilities of the Raspberry Pi, not will I attach a keyboard. Strictly monitoring and controlling and communicating with a remote PC. which has the wider support base (especially on the s/w side)? while I am happy with Ethernet, I would not like to rule out WiFi or even Zigbee communications Running on very long life battery/solar power might be interesting, but is not a requirement. I hope that you can see that this is a question that can be answered, and invite counter questions asking me to further explain what I hope to achieve. AI: Based on some of your comments (CAN bus, MODBus), I would have to say the best choice between a rPi and a Netduino would have to be neither. Basically, neither the Raspberry Pi nor the Netduino (I think - it uses a CLR. I don't think they can make that deterministic) can offer deterministic timing. If you're going to talk interesting protocols, you have to be able to offer deterministic timing in order to generate the proper bit-times. Your other option would be to hang a specialty interface chip off an SPI port (something like a MCP2515 for CAN, I don't know if there are similar devices for modbus), but that would be a lot of work, and unless you already have a in-depth knowledge of how CAN/whatever bus works, would probably be more challenging to debug. However, as it is, the rPi offers Serial, SPI, and GPIO (and not much of any of them). I'm not immediately familliar with the Netduino, but I would imagine it's similar. It's also worth noting that there is no kernel GPIO driver for the rPi available as far as I know. As such, talking to the GPIO requires running as root, and twiddling bits at a specific absolute memory address (I think you can do some stuff with /sys/class/gpio, but I haven't experimented with that). Really, what I think you should do is buy some Atmel or PIC24/dsPIC devices, and play with those. Almost all low-level hardware stuff is pretty much universally done in plain-old C, so that's what you should focus on. Realistically, while all various microprocessors do have their quirks, they are more similar then they are different, and skills like knowing how to read and understand MCU datasheets are very generalizable. Things like running on top of Linux (rPi) or the CLR (netduino) are just additional abstraction layers that make it harder to actually understand exactly what the hardware is doing, and being able to tell precisely what the MCU is doing is often essential in understanding how the MCU works/what is going wrong, as well as interfacing with other pieces of hardware.
H: State Diagram Issue - Equivalent Situations How do I know according to the following diagram if I have a equivalent situations, how do I recognize it? for example we will examine S2 and S3. I would like to get an advice how to do it. Thanks! AI: Just check if there are states where: Outputs are the same for all possible inputs, and that "Next states" are also the same for the same input combinations (except where the next state is just jumping from one equivalent state to the other, which is the same as no state change at all).
H: Li-poiy battery charge hold over time I am developing a driver for a Li-Poly battery. This is the first time I am dealing with such battery. Does these types of battery always rise to the maximum voltage of 4.1 (based on the datasheet and measurement) even after several charge discharge? i.e. after 500 times. I know by experience it cannot hold the same amount of charge over time, but can it always rise to the max voltage specified? Thx AI: Chargers usually do a constant current phase and then a constant voltage phase, and stop when the current to maintain the target voltage is small with respect to the initial charge rate. The target voltage is the same per series cell, regardless of age or charge cycles. So yes, for a battery that is still in fair operating condition, its voltage should be able to be taken to the same target voltage (usually 4.2V).
H: Whats the principle of a PLL used as demodulator of a FM signal? I didnt quite understand te following: A basic PLL consists of the following parts: phase detector low pass filter VCO If you input a 1MHz sine the PLL will try to lock on it by controlling the VCO. According to what i've found it's possible to demodulate a FM modulated signal. Assume: Input signal for example: (Carrier: 1Mhz sine and signal of 50Khz). you get 2 side-band frequenties with the carrier frequention (0.95Mhz, 1.0Mhz and 1.05Mhz). I want to demodulate the 50Khz signal from the input signal. From what i've found a DC signal from the Phase Detector is fed to the VCO to keep the PLL locked to the input frequency. My assumption was (i might be wrong) that when you input a signal with multiple frequency components the PLL keeps "re-locking" and the DC voltage fed to the VCO is the same as the difference of the frequention components of my input signal (so 1.0Mhz - 0.95Mhz = 50Khz). edit: Ye, there are some misconceptions in my story. With AM modulation you get the frequency components i was talking about (Dual Side-Band Full Carrier). With FM modulation you have the following formula: \$v_c\$ = carrier, \$v_m\$ = modulator \$v_c = V_c \sin(2 \pi f_c t)\$ \$v_m = V_m \sin(2 \pi f_m t)\$ \$f_c\$ depends on the modulator voltage so \$f_c = f_c + k*v_m\$, where k is a amplifier factor. the complete formula becomes: \$v = V_c \sin(2 \pi (f_c + k v_m) t) \rightarrow v = V_c \sin(2 \pi (f_c + k V_m \sin(2 \pi f_m t)) t)\$ AI: With FM you get much more than two sideband frequencies. The sidebands you describe sound more like AM (amplitude modulation) sidebands. You may want to supply a link where you get this information from or re-check your information. Next, in your final paragraph you might be getting confused. At any one moment in time the FM signal you describe will have a frequency that is somewhere between two limits. The limits are called the deviation meaning that's how much the carrier deviates +/- from its nominal centre frequency. That deviation is nothing to do with the modulating signal's frequency but has everything to do with the modulating signal's amplitude. The bigger the peak amplitude the bigger the deviation from the nominal centre frequency. If the PLL is designed correctly, and its low-pass filter permits the VCO to track the carrier within the deviation limits, the low-pass filtered signal (that feeds the VCO) will represent the signal that caused the original modulation i.e. the PLL is an FM demodulator. You also mention "keeps re-locking" - this is not something that should happen in this type of circuit - the PLL will remain locked to the modulated carrier. There will be a slight error in the instantaneous lock because you need an error to drive the mechanism that tries to maintain lock but, this error will be small and this error is not regarded as the PLL losing-lock. You might also be getting confused with what happens when the spectral content of FM is analyzed. Yes it has several components of frequency but these do not occur together at any one instant - the spectral content is a time averaged evaluation of what the carrier is doing - moving about following the amplitude of the input modulating signal.
H: How to realise bidirectional ports in FSMC function of STM32? I am using FSMC(Flexible static memory controller) function of STM32:reference manual.On page 494 of referencec manual, the data bus should be bidirectional. It is reasonable but i have no idea how to realise it in STM32 because it has only two modes: input and output mode(on page 166). After refering to examples from ST, i know that the data port should be considered as ouput push-pull mode as shown below, /*data line configuration*/ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_14 | GPIO_Pin_15; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOD, &GPIO_InitStructure); So,can anyboy tell me how can STM32 realise bidirectional port using output push-pull mode? AI: Have a look at Section 9.1.4 on page 157: 9.1.4 Alternate functions (AF) It is necessary to program the Port Bit Configuration Register before using a default alternate function. For alternate function inputs, the port must be configured in Input mode (floating, pullup or pull-down) and the input pin must be driven externally. Note: It is also possible to emulate the AFI input pin by software by programming the GPIO controller. In this case, the port should be configured in Alternate Function Output mode. And obviously, the corresponding port should not be driven externally as it will be driven by the software using the GPIO controller. For alternate function outputs, the port must be configured in Alternate Function Output mode (Push-Pull or Open-Drain). For bidirectional Alternate Functions, the port bit must be configured in Alternate Function Output mode (Push-Pull or Open-Drain). In this case the input driver is configured in input floating mode If you configure a port bit as Alternate Function Output, this disconnects the output register and connects the pin to the output signal of an on-chip peripheral. If software configures a GPIO pin as Alternate Function Output, but peripheral is not activated, its output is not specified. If a pin or a bus is supposed to be bidirectional for an Alternate Function, configure it as an Alternate Function in Output mode and the input configuration happens automatically. If the pin is supposed to be an input for an Alternate Function, configure it in Input Mode. If the pin is supposed to be an output for an Alternate Function, configure it in Output mode. When you're using a pin as GPIO, you have to choose between Input mode or Output mode.
H: Rectifying induced current without using any semiconductors Consider a 1:1 transformer. Short DC pulses are applied to the primary (input) coil. Once it's positive current pulse, once it's negative current. It's not strict alternating current (i.e. two successive positive pulses are possible). I want to block negative current on the secondary coil without using any diodes. Is it possible at all? I thought about two possible solutions: connect secondary (output) coil to the solenoid densely wound around a permanent magnet. This way the current flowing in one of the directions will see the resistance, because it will be harder for it to build magnetic field that is in opposition to the magnet's field. Is it the right thinking? connect secondary (output) coil to DC voltage source so there will be constant DC current in the coil. Positive induced voltage will pass, adding to the existing DC bias. Negative induced voltage will be blocked by the opposite current - or - will it subtract from the existing DC bias? I'm looking for a way to pass positive pulses through the transformer and block the negative ones without using any semiconductors. Clarification Duration of all consecutive pulses is constant. Input voltage is also constant, between 1-5V, but it may drop after being passed through many transformers connected in series. "Transformers" are supposed to be microfabricated (printed) on PCB as pairs of inducively coupled microcoils. Many of them will be connected in series. It's currently not possible for me to microfabricate semiconductor elements, including any diodes (only copper wires are possible). Also, any vacuum tubes will be too big to use them. One possibility is to use microwires that are routed to one or few external components, but I don't want to mount an external diode for every microcoil, because there may be many of them. AI: Long ago before diodes, DC was made from AC by synchronous commutation. This usually meant a motor spinning at the AC frequency with contacts driven by the motor shaft so that connections from the input AC to the output DC were effectively flipped twice per line cycle so that the output was always presented with a positive or zero voltage. You could possibly do something similar with relays switching on and off at the right times to capture only the positive spikes of your pulses. However, why not use diodes? That is the obvious and simple way to fulfill your other requirements.