text stringlengths 83 79.5k |
|---|
H: Thevenin equivalent and op amp
I have some problems obtaining the thevenin equivalent with op amp. The next example is in Fundamentals of electric circuits of Sadiku. Can you help me get thevenin equivalent from the example?
AI: First deal with the op amp. It has a gain = -Rf/R1 so that the voltage feeding into R2 is -vi * Rf/R1.Note that the op amp will invert the signal voltage. The output resistance is taken as zero for a perfect op amp.
C is in parallel with R3. This needs to be reduced to a single impedance.
And at that point you should be able to easily reduce the circuit to a Thevanin equivalent. |
H: Power source select for Raspberry Pi
I'm creating a board which takes an external power source to drive motors which are controlled by a ULN2003A connected to the Raspberry Pi GPIO.
It would be nice if when the external power source is connected it could provide power to the Raspberry Pi itself through the 5V GPIO pin.
I appreciate this would require a voltage regulator, a polyfuse (to replace the one I'm bypassing that would normally protect the Micro B USB power input) and an ultrafast rectifier for reverse polarity protection.
My question is whether or not it is possible to detect that the Pi is already powered through USB and therefore block the back powering feature (to avoid having two sources connected).
Ideally if the user were to yank the Micro B USB cable the back powering would just kick in and take over. And likewise if the Micro B USB cable we re-inserted to disable it again. I don't really see how that could be possible so maybe it isn't!
AI: It seems that what you are attempting is quite similar to what is implemented in the Arduino. See e.g. Arduino Uno's schematics. It requires a few external component (a MOSFET to serve as a switch, a diode, etc). to be implemented. I'm not familiar enough with the Raspberry Pi, so I dont know if this scheme could be implemented without modifying the board. |
H: What is Atmel's 2x5 ICSP connector called?
I'm looking for a male connector that fits in the left female connector shown in the image. My goal is to break each lead out to holes on a breadboard. What is that kind of 2x5 connector called?
Searching for ICSP connectors doesn't help me.
AI: Those are 0.100", or 2.54mm pitch headers. They are sold in long strips of single or double rows and you can break off however many pins you need. There are also versions with shrouds and various keying mechanisms to prevent backwards connection.
Here's the basic type:
Shrouded types (like starblue mentions in comment) look like this: |
H: Using Bessel function graph to finde out side bands
If I am not wrong, using Bessel function we can estimate the side bands of a carrier? Is this correct? If so, what are the steps to find these values from the graph?
For example if modulation index is 2 and amplitude of the signal is 2volt what are the first few side bands?
AI: Amplitude of the signal is irrelevant once you have defined the modulation index. Use this table as an easier guide but remember it applies only to sinewaves as the modulating waveform: -
For a mod index of 2.0, your carrier will appear to be 22% of what it was unmodulated and there will be sidebands of amplitude 58%, 35%, 13% and 3% of the original carrier amplitude. The first sideband occurs at a distance equivalent to the modulating frequency away from the original carrier. 2nd s/b at 2 x distance etc.. |
H: 12v to 300v Boost Converter - Ideal Inductor for 9kOhm load
I'm currently working with a MAX1771 chip, the design can maintain a stable voltage up to around 15kOhm and is as follows: 12V to 300V DC-DC Boost : Disregard NMOS and DIDODE Value
The inductor currently being used is a SRN1060-151M, unfourtanately it has a peak current of 1.25A and a saturation current of 1.8A. My guess is that the low saturation and peak current are causing problems with lower loads. I'm rather inexperienced with actually ordering proper parts and mostly ended up getting parts that fit the initial specs (matched values and picked low DC-resistance).
I take it that for a 9kOhm load I would need an inductor that can handle up to 3A. The NMOS is a STD8NM50N which can handle up to 5A and the DIODE is an EGL34G-E3/98GICT-ND.
Can anyone recommend an affordable inductor on DigiKey that can get the job done? Or changes to the circuit that may assist in making the 300V with 9kOhm load possible?
EDIT: 9kOhm load not 3kOhm, my bad.
AI: Amendment following question correction
Two informative things in the MAX1771 spec: -
If you know the inductance (150uH) and you know the maximum on time (12us) and you know the minimum switch off time (2.8us) you can take a stab at calculating how much power you can transfer.
In 20usec, how much energy can you put into the inductor? In 20us + 2.8us you can assume that energy may be transferred pretty much totally (near, better than 90% I'd say). The cycle repeats every 22.8us i.e. 43,860 times a second.
What are the joules per second - this can be calculated now.
OK in 20us the inductor current will rise to V dt/L because V= L di/dt. Plug the numbers in and I get I to be 12V x 20us / 150uH = 1.6A.
What is the energy? It's 0.5 x L x I^2 = 192uJ. But this happens 43,860 times a second therefore the power is 8.42W.
Your circuit cannot deliver a power greater than 8.42W and if I took losses and only 90% energy transfer it looks more like 7.5W.
You want 300V across 9kohm and that is an output power of 10W - you don't just want an inductor that doesn't saturate you want a lower value inductor. Why? A lower value inductor will attain a higher current and it's current squared that gives you the energy to push to the output.
100uH - current peaks at 2.4A and energy in one cycle is 288uJ. Power is therefore up to 12.6W.
This would be my recommendation - try 100uH and if it's still a little bit light on power (due to inefficiences) try a better FET with less-than the present 0.7ohm on resistance. Bear in mind it's really tricky to estimate how much energy stored in the inductor can be thrown across to the output so the inductor may indeed have to be lower that 100uH and I feel you are starting push the chip to its limitations and you may need to reconsider a chip upgrade. |
H: Low Pass Filter that can quickly turn on or off?
I may be pushing physics here so please tell me if I am. I have a signal I'm trying to anti-alias at 50Hz (sampling at 100Hz). The problem is my input signal is essentially an Amplitude Modified square wave that matches the sampling frequency with a very short duty cycle (~2-5%, settable). I'm timing my samples so that they only read the pulses at their peak after a settling time ts. I just realized though that my 50Hz cuttoff passive AA LPF will filter out the square wave and make ts far too long.
We've been banging our heads against the wall on this one, but here's what we want (don't know if it exists):
A Low Pass Filter that can be turned on or off quickly. Desired sequence of events is as followed:
Signal input is at 0V (off duty cycle). Filter can be on or off during this time.
Filter is turned off so signal can quickly rise to it's max amplitude (on duty cycle).
After ts, Filter is turned on again so that it is now being filtered at that higher level taking whatever value the signal is at as a sort of initial value.
After a few ms, the signal has been sampled by the ADC and the filter is turned off so the signal can return to 0V.
I dream of the circuit that can accomplish it, but cannot figure out how to pull it off. Does this exist? If so, what should I be googling?
AI: The easiest and most effective way of doing this is not to filter your signal but start taking plenty of ADC samples as soon as you hit the area you want to sample. Carry on sampling until the pulse is about to change and stop sampling.
Average your ADC samples - that's all you have to do and if you can't take "enough" ADC samples, get a better ADC. Alternatively, if you can use samples on the next peak, accumulate values and average over several peaks.
There are analogue solutions but these involve comparators and tunable low-pass filters because the filter has to be in-circuit all the time and all you are able to "move" is the cut-off frequency (when the signal reaches the bounds of what you want to sample). Use the power of a decent ADC.
Moving the filter frequency - use a switched capacitor filter and bring down the clock to create the required low pass filter when the signal has stabilized.
Alternative idea - Use your signal (once it has achieved stability) to charge a capacitor with constant current (V to I converter). The voltage attained on the cap divided by the time to get to that voltage is dv/dt - you know the cap value and therefore you can calculate what the average current was over that time period (I = c dv/dt). The average current is the average voltage applied to the V to I converter. Timing and sequencing is necessary to start the V to I then when you have taken your reading you need to discharge the cap to zero before the next cycle begins. It's called an integrating ADC - look it up. |
H: Some doubts about PCB USB connectors
I'm trying to make a PCB where I have USB connectors, but I'm really new into this and I'm trying to solve a few questions online about the theme, if you could guide me online through the theme that would be great. For this purpose, this systems is a USB sensor with 2 USB connectors (one male for PC connection and a female for bus extension) and, besides the sensor and MCU, will have switches to let us cut the VCC line of USB.
The main issues in my mind are:
What's the difference between the several USB connectors materials? I found some that say they have shield, others are gold plated and there are so many that I just quit looking online for everything
For mechanical resistance, is there any special type of connector? (this board will have switches and one of the connectors could be connected to the PC USB).
Is it cheaper (this is for a school project, but we might try to sell it after) to make a USB Male connector using only PCB (like this) or buy and solder a connector?
Basically I'm trying to find some kind of "USB connectors in PCB for dummies" guide, but Google isn't helping me that much.
EDIT
The "bus extension" will be for VCC and GND and that's just for sharing the power switches that I talked above, there is no hubs involved in this.
AI: Note "bus extension" in this situation will only work if the device it's going to is purely passive (doesn't use the data lines) or you have a hub on the board.
0) Yes, it always takes absolutely ages to find the right parts and import them into your PCB tool. And there are always way too many of the wrong sort of parts.
1) "Shielded" connectors are the normal sort with a rectangular metal casing. Pick one of those. Not having a shield might give you interference problems (probably won't, but it's such a pain to diagnose). It also makes the mechanical connection more solid.
Gold plating is an affordable luxury that stops the contacts corroding. Less of an issue for contacts that are hidden away from fingers, but still nice to have if you care about longevity.
2) Through-hole is generally stronger than surface-mount. Some have extra plastic or metal mounting lugs to really lock it to the PCB.
3) The PCB-only connector requires that you get a PCB made of the required thickness. It sits a little more loosely in sockets, but it works and is very cheap. It also looks cheap. Connectorless USB on a PCB |
H: Is voltage a delta? Can it always be treated as a potential difference from a reference point?
I've always considered voltage to be absolute, i.e. something that is there or is not there. However, the more I think about it, it seems to be more like a delta.
For example, let's say we have a supply that lists its pins as (A) -50V and (B) 0V. If we treat pin (A) as "ground", i.e. as if it were 0V, can we treat pin (B) as +50V?
Another example might be that pin (A) is +10V, and pin B is +25V, so the potential difference is +15V. Can we treat this the same way as if it were 0V and +15V?
AI: You are always using/measuring the difference in potential between two points.
There is no absolute zero in voltage (like there is with temperature), although it is common practice to define earth as 0V. This is not absolutely necessary, you can use any potential as reference. |
H: Intentionally mis-use the USB port on an Arduino?
I want to take an Arduino and after programming it on the PC like normal via USB, push a button or something and change its mode so that the behaves differently. Is this possible? I'd like to interface with this:
Pins are +1.5V, clock, data, ground. Blue box on top is what I'd like to replace with the arduino. They're using a mini USB connector for the serial connection. Looks like a mutant form of SPI as the clock is from the box (with readout) to the slide and the MISO data comes in reply with clock pulses from the slide. (update: it uses a 21 bit protocol with 9kHz clock and the code from Yuriystoys is almost plug and play)
I'm working on reading the info while in parallel to the connection via wires I soldered to the board's pads.
Update: I ended up soldering a through-hole USB A socket onto a Prototyping board and using that. I routed +3.3V to pin 1, set up a voltage divider for the clock (D6) 330/470Ω on pin 2, routed pin 3 to MISO (D7), and connected ground to pin 4. I'm sure this is physically/electrically impossible to implement using the existing USB port on the board.
While I did get the results I was looking for, the capacitance based scale's reading technology would slowly drift, rendering results inaccurate over time. I need repeatability and drifting .002" in 10 minutes won't cut it. I am reworking this using a 1 micron glass slider scale from DroPros.com and will maintain fixed position in EEPROM between calibrations.
TFT display is Adafruit 1.8" TFT with SD card and 5-way joystick input. An indispensable i/o shield in my opinion; easy to program, easy for user input, and quite versatile.
AI: So the usb port is being as a general connector, not as a USB standard device? If so, just get a usb port or cable and wire it to the Arduino outputs.
If it's being used as an actual usb slave device, then that's alot more complicated.
Either way, if you want to use the existing usb port, you would need an arduino that uses a AVR ic as the usb port, and reprogram it so that it can do two functions (not simple). The older arduinos use a FTDI FT232R, a dedicated usb to serial IC that would not work well with what you want to do. |
H: What are these symbols?
Well I have these schematic of a vaccum tube amplifier, and I'm having some problems to understand some symbols.
What are these symbols in red?
What does exactly CW mean? It should be a logarithmic potentiometer but have that strange down arrow.
AI: RT1 is probably a negative tempco resistor. It has a high resistance value when it's first plugged in, reducing inrush current. But after it heats up it has a low resistance to minimize power loss.
R11 is a potentiometer. The arrow near the "CW" indicates which way the wiper moves when the screw is turned clockwise. |
H: How to choose between Mealy and Moore state machine
I know the basic differences between Mealy and Moore FSM (Finite state machine). What I want to understand is the following:
Pros and cons of using Mealy over Moore and vice versa
In which situation Moore is more suitable than Mealy and vice versa
The figures of merit for comparison could be latency, throughput, area (state encoding FF's), power etc.
AI: From a discrete logic & HDL perspective:
Mealy machines (generally) have fewer states. Mealy machines change their output based on their current input and present state, rather than just the present state. However, fewer states doesn't always mean simpler to implement.
Moore machines may be safer to use, because they change states on the clock edge (if you are using DFF logic for present and next state), whereas Mealy machines are faster, because the state is dependent on the input. Thus, the state can change asynchronously. This comes down to predictability vs raw speed.
When it comes down to it, it's difficult to draw hard lines where one machine would always be better than the other.
It really comes down to the specific task at hand. Does one want to have a synchronous or asynchronous machine? Is speed paramount? Will there be potential unstable (bouncing) signals? Are both the inputs and present state readily available? The answer to each of these questions determines the type of machine that would work best.
It's worth mentioning that for a hardware implementation, Mealy machines require less hardware in their circuits, but when working with an HDL and RTL scenario, the actual amount of discrete hardware may not be terribly important. |
H: Identity of TI mystery chip: CM060B
I am having trouble identifying one of the two ICs on my dog's ultrasonic collar tag. The lettering on the 16-pin SOIC package was obscured by some sealant which I had to scrape away, leaving the markings quite faint, so it's possible I'm misreading them (and thus far I have found it impossible to get them to show up at all in a picture).
I can make out a TI logo, and there are three lines of markings which appear to read:
CM060B
49K _G4_ <-- That's an underlined G4
A995
The usual Google technique leads to lots of "In Stock!" and "Register to receive a quote" pages, but no datasheets.
Anyone know what this might be?
EDIT: The second IC on the tag is a quad two-input NAND gate. There is also some sort of crystal or oscillator in a tall, thin metal can (about the dimensions of a resistor but with both leads at the bottom); this appears to be the source of a very steady 40kHz sine wave. See What is this component on my dog's door opening collar? for a wide shot of the PCB with the glue still covering the IC in question.
AI: Is it possible that you scraped off part of the part number printing and that the part is actually like:
...implying a part number CD4060B ? |
H: Attempting to Understand Transistor Specs and Pick One
I'm trying to find a transistor that will power on with very low input. The entire circuit is running on 3.3 V, DC and needs to use little current (Max 50 mA). The resistance between the power supply and the "base" of the transistor will vary between 50kΩ to 120kΩ when on. Here's an image showing the circuit:
In the image you can see 2 of 4 sections that will be present. They are all the same.
What transistor should I use?
AI: Don't use a bipolar transistor. Use a MOSFET instead.
Their on resistance is on the order of milliohms (so virtually zero voltage drop across the transistor)
Have high impedance gates (no current flow into the gate)
Come in numerous packages (easy to breadboard).
simulate this circuit – Schematic created using CircuitLab
For your application, and with the circuit I included, you'll need to look for the following parameters.
N channel enhancement MOSFET
Logic Level gate with less than 3.3V drive voltage
Your current will be low, be mindful of it, but I'm not seeing any on Digikey that will not work for you.
The maximum \$V_{DS}\$ will no matter much either. The lowest I'm seeing is 5V. You'll be fine there.
For starters, here's an example. |
H: How do receivers know what to output to radio speaker or TV screen?
I understand that receivers are often used with mixers which take the sum and difference of two signals to make an output signal. How does a radio signal of say 102.5 MHz know to tell the speakers to output a person singing, a guitar with distortion, and a drums all at the same time in the range of 20-20,000 Hz? In the same vein, whenever a TV receives a signal for a channel of 150 MHz, how does it know what pixels to light up on the screen? This may be an obvious question and I'm just not making a connection, but any further explanation would be appreciated.
AI: First you have to decide how represent your signal. Sound is easy: a microphone gives you a voltage proportionate to sound pressure. If we send this signal (with amplification) to a speaker, you get a reproduction of the sound. But how do we represent this signal as a radio signal?
The answer is modulation. Perhaps the easiest modulation to understand conceptually is upper single-sideband modulation (SSB). Say your audio signal consists of frequencies from 20 Hz to 20,000 Hz. To modulate these as a radio signal, you just shift all the frequencies up. So, maybe you decide to shift them all up by 100 MHz. Now your audio signal is represented by radio waves instead of sound waves, at the frequencies 100,000,020 Hz to 100,020,000 Hz.
The receiver does the opposite. If the dial is set to 100 MHz, then it will receive the radio waves as a voltage from an antenna. It will shift all these frequencies down by 100 MHz, and then the output voltage is your audio signal.
SSB is easy conceptually, but it's not the easiest to implement electrically. Easier to implement would be amplitude modulation (AM). Frequency modulation (FM) is used for FM radio.
The signal being transmitted, the audio signal in our example so far, is called the baseband signal. If you want to send video, your job becomes more complex, because you have to somehow represent video as a time-varying signal. In the recently-past era of analog TV, this was done by breaking each frame into a raster, and having the signal represent the intensity at each point along the raster scan. Then you add to that some information to allow the receiver to synchronize its raster scan to the transmitters, and maybe more information to allow for color, and maybe yet more information to have sound at the same time. There are several standards that define the process in detail, which may vary by region.
Having accomplished the task of representing your video as a baseband signal, you can then select a modulation to translate it up to radio frequency. The receiver reverses the process.
These days, most things are becoming digital. Here, the baseband signal isn't an analog signal, but rather a stream of bits. One can then use any number of digital modulation methods to send these bits as an RF signal. |
H: Measuring the mic signal of a computer headset
my colleague and me have hit a brick wall - and are hoping somebody can help us out here :)
Following scenario: We record some data using a computer with an NI card and some signal transducers. We need to record audio from a mic of an headset synchronously. First thought: Build a patch cabel for the headset. Measuring the mic signal to GND - no problem. However, the signal is offset by about 2.65V. My guess this is the necessary voltage for an electret microfone.
To get rid of the offset we then thought to measure the voltage between supply and mic signal. However the difference is 0 - a look with an oscilloscope confirmed that. Can anybody help explain, why supply as well as mic signal on a headset carry the signal information?
AI: An electret microphone on a headset is typically wired up thus:
Measuring the signal between V+ and Output (or Ground and Output) should give the sound waveform from the microphone. The resistor from V+ forms a voltage divider with the on resistance of the MOSFET within the microphone capsule, with the current through the MOSFET, and thereby the voltage at the Output, varying with sound.
If measuring between the supply line before the bias resistor, and the Output in the above schematic, shows no waveform, the probes are probably loading the microphone too much. Electret microphones have very high output impedance, so a lower impedance probe would attenuate the signal to nothing.
Also, the voltages involved are small, in millivolts, so it would be useful to set the oscilloscope to a more sensitive range. |
H: What is the purpose of parallel RC network in the bridge rectifier output?
Can anybody explain the necessity of the RC network shown in the figure. I found this in circuit for a logic power supply using Fly-Back converter?
AI: With capacitors in series they theoretically share half the supply voltage between node1 and ground. If that voltage is (say) 100V and you only have 63V rated caps, you can place them in series to get 50V across each cap and prevent each from damage. That's the theory.
In practice, it is advisable to bias the midpoint at half voltage with the two resistors to overcome differences in leakage currents on each cap offsetting the theoretical midpoint. The resistor values can be quite high but they do need to be significantly smaller in value than either of the equivalent worst-case equivalent leakage resistances of the caps. |
H: Leading Power Factor effects on electrical System
If power factor comes in leading & showing -0.95, is there any effect on electrical system? If yes, then please tell me what would be the effects and how long we keep power factor in leading??
Keeping power factor in leading shows more KW & less KVA? Is it correct or not.
AI: Keeping power factor in leading shows more KW & less KVA? Is it
correct or not.
This is incorrect. If the real power load is 10kW, at unity power factor the kVA is 10kVA. If PF = +/-0.95, on a real load power of 10kW, kVA is 10.52kVA.
Leading PF is caused by a net capacitive load and the effect of it is the same as a lagging PF (inductive load); the supply current is higher than for a truly resistive load.
You can keep PF leading (or lagging) as long as you want but it isn't an ideal situation because some electricity companies have a policy to charge you for use of reactive power in order to supplement the cost of putting bigger cables into their feeders to factories - higher current means bigger cables. |
H: 5V 1A from 24VAC transformer with grounded secondary
I built a power supply for a micro-controller board that requires 5VDC and peak of 1A (typically sits at 500mA). The power supply has an input of 24VAC. I used a bridge rectifier and an LM2575-5 switching regulator to get 5V 1A. All good, worked well.
Problem is I've now found out that the 24VAC input transformer must to shared with some external devices in the same system (controls equipment), and they use a 24VAC transformer with the secondary neutral grounded. This made my bridge rectifier go bang!
I don't want to have to use a separate 24VAC transformer, so I was thinking of using a half-wave rectifier. I've found that the LM2575 regulator will accept about 8V to 40V input and is about 75% efficient. To overcome the ripple from the half-wave rectifier, the smoothing capacitor would need to be huge.
Surely there's a better way to do this! Maybe a half-wave rectifier isn't the right way to go about this? I'd really appreciate some advice and suggestions.
Disclaimer: I'm not an EE, just a tinkerer... In case that isn't already obvious ;-)
Edit: Here's a circuit diagram.
simulate this circuit – Schematic created using CircuitLab
AI: To overcome the ripple from the half-wave rectifier, the smoothing
capacitor would need to be huge.
For your current circuit you have a 47uF capacitor and if it were half wave rectified your capacitor would need to increase in value but probably only needing to double in capacitance. I'd consider doing this because it's your easiest solution.
If your output transformer produces 24VRMS then the peak voltage it will generate before and after the extra ground would be exactly the same at 34V. With a full wave rectifier your resulting peak of DC would be about 32.5V and for the half wave solution it would be about 33.2V.
With 47uF fitted the bridge ripple would only be about twice that of the half wave solution so I would say, for it to dip close down to the 8V lower operating area of the switcher, you probably haven't got enough capacitance to start of with.
It's also worth remembering that if the ripple is kept lower, the switcher input voltage will be on average, higher and more significantly the current it takes from the rectified supply (half wave or full) will be lower because IT is a power converter and when the net voltage is higher it draws less current - make use of this benefit and increase the capacitance to say 330uF, 50V.
Panasonic Series: FK Type: V 330uF, 50V is 12.5mm diameter and 13.5mm in length. Is this really huge? |
H: Using LDO with Outboard Pass Tranistor
I need a power supply capable of supplying 7.5V at 6A using linear devices. To minimize power dissipation at this current level I have decided that using a LDO would allow me to lessen the power I need to dissipate by allowing me to have a lower input to output voltage.
I have selected to use the TL1963AKTTR. To acheieve the required current I think I should be able to use a PNP transistor such as the TIP2955 to boost the current similar to how it is shown in this circuit.
EDIT: Sorry, would this work as I expect
AI: This is the circuit you are proposing: -
I've put a circle in red around the 1 ohm resistor because this is important about your concept. To activate the TIP2955 you'll need at least 0.7V across the 1R resistor and now your attempts to make a LDO circuit are reduced because.
With 0.1A flowing, the regulator drop out is added to 0.1V across the resistor
With 0.5A flowing, the regulator drop out is added to 0.5V across the resistor
Have you taken this into account?
EDIT - following advice offered on an edit suggestion (which somehow disappeared) I'll add to the scenario. What I said above still stands but as the demand for more load current increases, so does the base emitter voltage on the TIP2955 (at 6A this may be in the order of 1.4V). And, for a 6A load, it is likely that the Hfe of the transistor will be about 30 (typical) implying the base current will need to be about 200mA. The 10R base resistor will need to pass this current and therefore, in adddition to the 1.4V required by the base there will be 2V across the 10R resistor - this equals 3.4V - all required to be generated across the 1R series resistor. This implies a 1R current of 3.4A and of course this is not viable through the regulator chip (1.5A max). In short this circuit will never be able to provide a 6A drive to the load.
If you got rid of the 10R resistor and replaced it with a short, you'll still need to produce 1.4V across the 1R and this just about means the circuit will work with 6A BUT, it's on the edge and there has to be a better way of doing this. The CE saturation voltage is not that good at 6A either so I'd abandon this idea and look for alternatives. |
H: Difference between If-else and Case statement in VHDL
I want to understand how different constructs in VHDL code are synthesized in RTL.
Can anyone tell me the difference between If-Else construct and
Case statement constructs of a process in VHDL in terms of how the code is inferenced into RTL circuit by the synthesis tool ?
Do consider the case of multiple nested if-else and mixing
case-statements with if-else construct inside a process.
Also when to use which construct ?
PS: I have seen a related question "Multiple if statements in process in vhdl" but that doesn't answer my question in anyway.
AI: Can anyone tell me the difference between If-Else construct and Case statement constructs of a process in VHDL in terms of how the code is inferenced into RTL circuit by the synthesis tool ?
The if-elsif-else construct infers a priority routing network:
simulate this circuit – Schematic created using CircuitLab
This corresponds to
if bool_expr_1 then
sig <= val_expr_1;
elsif bool_expr_2 then
sig <= val_expr_2;
elsif bool_expr_3 then
sig <= val_expr_3;
else
sig <= val_expr_4;
end if;
The case construct, on the other hand, infers a big ol' mux:
This corresponds to
case case_expr is
when c0 =>
sig <= val_expr_0;
when c1 =>
sig <= val_expr_1;
when c2 =>
sig <= val_expr_2;
...
when others =>
sig <= val_expr_N;
end case;
Obviously these are very simplified designs with only one value expression, resulting in one output.
Do consider the case of multiple nested if-else and mixing case-statements with if-else construct inside a process.
Per the above, you can see how they would nest/mix.
Also when to use which construct ?
Since if-else infers priority, it should be used when more than one input condition could occur. Using case, one the other hand, is appropriate when the inputs are mutually exclusive. |
H: Is there an instrument that can measure the capacity of lead acid batteries
Background
I have an electrical scooter with 6 x 12Volt lead acid batteries (72 Volts total), which are now in such a condition that they can barely get me to my work and back. I got a bunch of used UPS batteries from a friend, and want to check their capacity and compare them with the batteries that are currently in my scooter.
I roughly think I know how to measure their capacity, after loading them I should discharge them at a certain rate and see how long it takes before the voltage drops below a certain threshold. I'm not sure about the exact numbers though, and I'm also not quite sure how I should discharge them at the same rate as my scooter would typically do (power a heater or something like that?).
Question
Is there a device/machine/instrument that can do all of that for me? Load the battery, discharge it at a constant rate and log the results.
If not, I guess a UPS hooked up to a computer could be programmed to do the job? Any ideas?
AI: Yes, there are lead acid battery testers that will tell you the condition of each battery. They are often used by UPS service technicians during preventative maintenance checks to check on the health of each battery in a large series string.
Here are a couple examples:
http://www.cadex.com/technology/our-technologies/spectro
http://www.bkprecision.com/products/electrical-battery-testers/battery-capacity-analyzers/600-12v-sla-battery-capacity-analyzer.html
The good ones probably cost more than a set of replacement batteries for your device, but if you can find a UPS dealer or service tech, they may be able to test your batteries for a small fee. |
H: eagle cad - defining orientation of footprints of components
I prepared a PCB layout on Eagle Cad 6.4
Here below is the end version of the PCB
As you can see the the layout is printed as the MCU will be placed from the bottom layer. However, I would like to place the MCU on the top layer and solder the legs on the bottom layer. Could anyone explain me what do I need the change on the layout so that the MCU could be placed on the top layer and foot print of its leg would be on the correct orientation on the bottom layer?
EDIT:
The layout that was printed on the paper
AI: In Eagle, just place the component on the top layer, not the bottom. Since it is a through-hole part, Eagle should allow you to route from the opposite layer. You will need to double check the print settings so that the vias line up on both layers (possibly using the 'Mirror' print option in Oceanic815's answer). |
H: High voltages Transmission lines?
I am having a doubt in why are the transmission lines are sent at a very high voltages? I also went through quite a few sources which said that it is to decrease the losses in the lines. BUt I am not quite satisfied with the solutions, can somebody please let me the answer for this in detail. Your help is much appreciated.
AI: The goal of high voltage transmission is to minimize power losses.
What causes power loss?
The main enemy is Joule's first law, or \$I^2R\$ losses. The resistance of our transmission line causes a loss in power with square proportion to our current.
How do we fix it?
Say we want to transmit some amount of power, we'll call it \$P\$.
We know \$P=VI\$. This means that 1 volt and 1 amp has the same amount of power in it as 1000 volts and 1 milliamp.
Now, to minimize our \$I^2R\$ losses, we need to minimize both \$R\$ and \$I\$.
\$R\$ is hard to change. We have 1000s of km if not more of wire we'd have to change. Also, \$R\$ is a direct relationship, whilst \$I\$ is in a square relationship, so changing \$I\$ has a bigger effect. What's easier to change for our AC power system is \$I\$.
We do this with a transformer. An ideal transformer allows you to put in some amount of power at a given voltage, and receive the same amount of power out at a different voltage.
Now because \$P=VI\$ that means it also changes our current. \$V\$ and \$I\$ are in an inverse relationship in power, if \$V\$ goes up, \$I\$ goes down.
Thus, we increase \$V\$ to decrease \$I\$. By making the voltage on the power line higher, we lower the current, which thereby lowers our lost power \$I^2R\$.
For a given power we want to transmit (\$P = VI\$), a higher voltage means less current, which thereby means if we use a higher voltage, we minimize currents, minimizing \$I^2R\$ losses.
Why don't we jack the voltage way up?
So we increase the voltage and decrease the loss, so why not crank the voltage as high as we can? It turns out that too high actually increases our losses, due to a different effect. Eventually, we reach a point where the air surrounding our wire starts to ionize.
Ionization causes air to stop acting like an insulator, and allows current to flow. This process is known as coronal discharge, and means eventually we start losing some power as there is a new path to ground or another transmission line present due to the high voltages. It also slowly degrades our wire as atoms are pulled off the surface of the wire.
If we went even further, we'd eventually hit electrical breakdown, which means we now have arcs flying through the air. Arcing is extremely bad, and will both degrade our wire rapidly, as well as give what is for all intents and purposes a short, causing rapid power loss. |
H: How to sense when a plant needs to be watered?
Im trying to design an embedded system that detects when a plant needs more water (mostly the kind of plants you have in at home in a pot)
What kind of sensors would you recommend?
AI: If you use two probes, made of different material, and they're in the moist environment, you'll have a battery. You can measure this tension to know how dry /wet the soil is.
That's how those soil moisture work, without batteries. You can attach it to any eletronic device (like automatic watering, or something like that). |
H: What concerns are there with running high frequency traces?
I am working on a project where i will be laying out some traces that will be handling Gigabit Ethernet traffic. I know that putting these traces on the outside layers (Top or Bottom) is a bad idea, with noise and other EMI issues, but what other issues should i be concerned with?
I'm assuming that the trace width will be a factor, the board in question is currently 4 layers, standard 1.6mm thick FR4 with 1oz copper thickness on top/bottom with 0.5oz copper thickness for the internal traces.
There are two pairs of TX+ TX- and RX+ RX- for gigabit, should all four of these pairs be routed on the same internal layer, or should i route them on separate layers, for example TX1+ TX1- and RX1+ RX1- on layer 2 and TX2+ TX2- and RX2+ RX2- on layer 3?
How should i run grounds around these signals, between each signal, around the block of signals, and should i put ground planes above and below these traces?
Also, i probably shouldn't run the traces directly from the MCU to the connector, but I'm not really sure about what sort of inductors or coils i should use. By the way, the connector is about 10cm away from the MCU.
AI: Start with the vendor's data sheet. They have lots of details.
Make sure each leg of each pair is the same length.
Since the signals are differential, EMI, etc. tends to effect each of + and - the same, so it isn't as bad as you expect.
Keep in mind gigabit Ethernet uses all 4 pairs bidirectionally, so don't read too much into the RX and TX names.
You need a transformer between the MCU and the connector.
You can put the pairs on the same layer. If so, just keep the pair to pair spacing more that the spacing within the pairs.
Do run over a ground plane.
Don't run over a split in a plane. |
H: Most compact high voltage source for making long arcs
Out of curiosity, I have a question about high voltage electricity sources. Hypothetically, the requirements are that the source must be no larger than a water bottle (although smaller is better), and that the source is capable of producing an arc at least 1 meter in length (longer is better). The source doesn't have to be able to output continuously and can be pulsed, although the time between pulses should be no longer than 1/2 of a second. I am aware that tesla coils can produce large sparks in small packages, but I do not know if they would be the best option for the hypothetical situation or if they are even capable of meeting these criteria. Perhaps some sort of capacitor array?
AI: You will need 3 × 10^6 V (three megavolts) to achieve a spark in dry air. That's rather a lot.
However, people have built hand-held Tesla coils that achieve roughly what you're asking for: http://www.rmcybernetics.com/projects/DIY_Devices/plasma-gun-2.htm (and they'll even sell you the parts!) As "Guess Who" points out, it's quite a challenge to avoid insulation breakdown inside your device.
This exploits the tendency of charged sharp points to spray ions into the air, reducing the breakdown voltage considerably. |
H: Can one use PiFace for A/D conversion?
the PiFace is advertised as the shield "connecting the Raspberry Pi to the real world" and they claim that this includes things like temperature sensors. I know how to read the temperature using an AVR microcontroller and the A/D converter, but I cannot see that such a converter is present on the PiFace. Am I missing something (I'm not a native english speaker, it may actually be the case that I don't understand what I've found). The inputs I found seem to be just capable of being switched on and off, and the examples I've seen are also restricted in that sense.
AI: There is a small data sheet for the PiFace here on Farnell. There's a schematic linked to from this post.
It has digital inputs and outputs only, no ADC. Most sites advertise it using 'PiFace Digital I/O Expansion' as its full name, with no mention of analogue.
You don't need to use PiFace IO expansion to read temperature sensors, the gpio will do, as in this adafruit tutorial on reading a DS18B20. |
H: Using an NPN vs a PNP transistor
Is the following circuit electrically sound? My recollection is that the right way to do it is to use a PNP transistor on the high side and an NPN transistor on the low side. Will it work if they are both NPNs? What differences in performance are there?
simulate this circuit – Schematic created using CircuitLab
A, B, C, and D are 0 - 5V logic signals from a microcontroller. Obviously the truth table of the two circuits is a little different:
A B D1 C D D2
0 0 OFF 0 0 OFF
0 1 ON 0 1 OFF
1 0 OFF 1 0 OFF
1 1 OFF 1 1 ON
Something feels inappropriate to me about Circuit Topology #2 though, do you agree? Can you explain why? or why not? When is it absolutely necessary to use a PNP transistor rather than an NPN transistor?
AI: Remove R5 and you will have what you describe. The configuration of Q5 is called common collector or emitter follower. Essentially, the voltage at the emitter is the voltage at the base minus 0.6V, but the emitter current can be much more than the base current, because the gain of the transistor will draw more current from the collector. Thus, it's a current amplifier.
Remember, the base-emitter junction is a diode. So, the emitter will be about 0.6V below the base if you forward bias it. With R5 removed, you can pull the emitter up to \$V_{cc} - 0.6V\$. With R5 present, you won't get it as high, since some voltage will be dropped when current flows in R5.
Since there are things that will limit the current in the emitter leg of Q5, you don't need R5 to limit the base current, which isn't true of Q2 or Q4, which have their emitters shorted to ground, or Q1, with its emitter shorted to \$V_{cc}\$.
See Why would one drive LEDs with a common emitter?
There isn't much difference in performance. In circuit 1, the anode of D1 will be at \$V_{cc} - 0.2V\$, whereas in circuit 2, it will be at \$V_{cc} - 0.6V\$, so the LED current is a bit higher in circuit 1, assuming R1 and R4 are the same value.
Circuit 2 has the advantage that the base current goes towards powering the LED, but since the base current is small, this isn't a big effect.
The last subtle difference is that in circuit 1, Q1 enters saturation, which will charge the base-emitter capacitance. When you then turn it off, this capacitance has to discharge before Q1 really goes off, adding a bit of delay from when your MCU output goes low to when the diode gets switched off by Q1. Q5 never enters saturation, because the emitter voltage is brought up to just the point where the transistor enters saturation, but not more. So, no turn-off delay. The delay is very short, and probably not significant until you are switching at least 50kHz. |
H: matching input and output impedance in an audio circuit
I have searched many places but have failed to get a clear and convincing explanation about why we match input and output impedance in audio circuits. For example: lets consider a simple audio circuit where microphone is connected to amplifier and then to a speaker. So here, what are input and output impedances and why is it important or why do we care about matching the input and output impedances? Please enlighten me. Appreciate it!
AI: We typically don't match impedances in audio circuits. For example, the output impedance of an audio preamp is typically relatively low whilst the input impedance of an audio power amp is typically relatively high.
The output impedance of an audio power amplifier is typically very low whilst the nominal impedance of a speaker is of the order of 8 ohms.
While any EE is probably familiar with the maximum power transfer theorem, which shows that maximum power transfer occurs when the load equals (or is conjugate to) the output impedance, it does not follow that the the output impedance ought to match the load.
In the first case, the output impedance is fixed and the load is the variable. In the second case, the load is fixed and, in that case, maximum power transfer occurs when the output impedance is zero, i.e., it is not desirable to match the impedances. |
H: the . hex file we burn goes to flash memory or RAM or EEPROM of Atmega8?
The flash memory of atmega8 is 8Kb.
Is this the maximum size for the .hex file, or it the max memory which i can allocate to variables in my code?
If none of the above is true, than what is memory allocation structure of Atmega8? To which memory does .hex file goes to?
AI: In standard use your code goes into the 8 Kbytes of Flash memory and variables go into the 1 Kbyte of SRAM. Note that because a hex file represents a single byte as a pair of hexadecimal characters and contains some other information it will be over twice the size of the actual code that will be loaded, so a hex file a bit over 16K should load.
The most reliable place to find out of much Flash and SRAM your code uses is from the compiler. If you're using Atmel Studio 6 in the build output area if you scroll up you should see something like:
Program Memory Usage : 540 bytes 0.8 % Full
Data Memory Usage : 0 bytes 0.0 % Full
So the program memory use shows how much of the Flash will be used and data memory usage shows how much of the SRAM will be used. |
H: Memory modelling and Memory module in Verilog synthesis
I am using a synthesis tool and when I am synthesizing a verilog file
module test();
reg reg1;
reg [1:0] reg2;
reg reg3 [1:0];
reg [1:0] reg4 [0:4];
endmodule
It's giving an error to "use memory module" with the help of a option.
So what I need is to make a memory module. I tried to read this link but it didn't help me very much.
How can we create a memory module that can be used with the above test case. I am new to verilog. So can't understand what "Memory.list file" in the link
means.
AI: I am not sure why you need a special option, the use of memories are pretty standard for use inside modules. Unless you are trying to imply a special low area/power cell similar to a ram.
For a standard memory it is just the same as having multiple regs. memory does not imply RAM the same way reg does not automatically imply flip-flop.
The 'memory.list' is a plain text file which contains the values which you want to load in to the memory, this is not required if you just wanted to reset the memory and have every element at 0.
memory.list should look like :
//Comments are allowed
1100_1100 // This is first address i.e 8'h00
1010_1010 // This is second address i.e 8'h01
@ 55 // Jump to new address 8'h55
0101_1010 // This is address 8'h55
0110_1001 // This is address 8'h56
The use of the file would then follow :
module memory();
reg [7:0] my_memory [0:255];
initial begin
$readmemh("memory.list", my_memory);
end
endmodule
alternatively :
module memory();
reg [7:0] my_memory [0:255];
integer i;
initial begin
for( i=0; i<256; i=i+1) //Can be statically unrolled
my_memory[i] = 8'h00 ;
end
endmodule
If using as a bank of flip-flops with async-reset:
module memory(
input clk,
input rst_n,
input [7:0] addr_wr,
input [7:0] data_wr
);
reg [7:0] my_memory [0:255];
integer i;
always @(posedge clk or negedge rst_n) begin
if (~rst_n) begin
for( i=0; i<256; i=i+1) //Can be statically unrolled
my_memory[i] <= 8'h00 ;
end
else begin
my_memory[addr_wr] <= data_wr ;
end
end
endmodule |
H: Is it possible to convert radio waves to some small DC power?
Is it possible to generate a small DC power from Radio waves?If yes then how?
AI: Yes, it is possible. In fact, crystal radios work on this basis. With a reasonable antenna and a powerful enough AM station, they can drive a high impedance headphone to well-audible volume using only the power received by the antenna.
The basic trick is to us a transformer to step up the low RF voltage picked up by the antenna. Antennas tend to be rather low impedance, like 75-300 Ω. The output of the transformer would be at a higher voltage, although also at a higher impedance. The higher voltage is important so that the forward drop of a diode is small compared to the voltage, and therefore doesn't loose too much power when rectified.
In a crystal radio, the secondary of this transformer had a capacitor accross it to form a tuned circuit that resonated at the desired radio station's frequency. This capacitor was adjustable so that different radio stations could be received. |
H: How to isolate a soil moisture sensor
When using a soil moisture sensor in a plant to measure water indoor, how can we avoid dangerous water and electrical interaction.
In general, when there's water in the plant
When watering the plant, and accidentally dropping water on the wire connection
This is the sensor of interest so far (open for other recommendation). It seems kinda odd to be powered on 35mA!
http://www.robotmesh.com/soil-moisture-sensor?gclid=CMvW6bSz9bcCFWJqMgod9hYAfA
What I have in mind is to add a 50mA fuse between the power supply and the power input to the sensor itself
Power Source: Possibly 4 AA batteries
AI: As discussed in comments, providing that the power source is capable of low amounts of power and there are no components that are likely to store energy (that can generate a spark) there will be no ignition or surface temperature side-effects that could ignite even the most volatile of gases such as hydrogen (19uJ) to ignite in the perfect gas-oxygen mix.
The cable feeding the sensor will have inductance but it is likely to be less than a ten microhenries BUT what is the chance that hydogen will be around? It would need a minimum of 40uH with 1A flowing from the battery pack to be potentially unsafe. This circuit would then need to be broken to produce a spark. No chance. If hydrogen is present then what sort of plants are you cultivating?
You might have some petrol around but you'd need a lot bigger energy spark than for hydrogen (the most volatile of the gases to sparks) but you could ignite petrol with a surface temperature of 250ºC however, this is unlikely to be produced by the sensor circuit and the 4AA batteries.
If you can't ignite the most volatile of gases and fluids with energy or hot surfaces you won't ignite anything known to man.
If you don't believe look up Intrinsic Safety techniques and look out for iginition temperatures of the most volatile gases and also check for hot surface temperatures.
Here is a simple site that should convey the basic principles |
H: How can I integrate microphone and speaker into my microcontroller project?
Having never worked with mic and speakers in the past, I am experimenting with these. I already made a simple circuit with a mic (electret condenser microphone) and speaker. I used the above mic with simple amplifier stage and then computer speaker. It works well.
Now, I am thinking of building a simple microphone, speaker and microcontroller circuit. The idea is basically to feed in the input from mic to microcontroller and then output the audio signal to the speaker.
For that I think I need to first convert the analog signal from the mic to digital values using AVR's ADC. After that I need to output the analog values to the speaker. Since this is my first time, I need advice on how to build a working circuit. What should be the sampling and playback rate? Do I have to worry about codecs, etc? (I don't know how large raw audio data can be.)
I am planning on using Arduino first since it's easy and quick for prototyping.
Any help is appreciated as always! :)
AI: Your sample rate must be twice the maximum frequency of interest. This is the Nyquist–Shannon sampling theorem. If you want hi-fidelity audio, your maximum frequency is the limit of human hearing, about 20kHz. Human voice is less demanding: telephone networks work up to about 3400 Hz.
You will find that the AVR's ADC isn't terribly fast, and you don't have much resources to process the data. So probably, your hardware limitations will dictate the sample rate for you.
You probably don't need to worry about codecs. A codec encodes and decodes an audio stream. A common thing to do is compress the audio for more efficient storage or transmission, but it doesn't sound like you are doing either. There are codecs that encode and decode for reasons other than compression, but I can't think of any that would be relevant here. Your computing resources are very limited on the microcontroller anyway, and you won't have much time for encoding or decoding anyway. |
H: Can I convert a toggle switch to momentary switch using a transistor and capacitor?
After searching online for an answer to how to convert a toggle switch to a momentary switch I found the circuit below. I've simulated it and it works in CircuitLab.
simulate this circuit – Schematic created using CircuitLab
I'd like to do the same thing using a transistor instead of a relay but so far I haven't been able to make it work in CircuitLab. Can I convert a toggle switch to momentary switch using a transistor and capacitor?
AI: I believe something like this would work for you:
You will have to play around with the cap and resistor values in order to achieve your desired timing and intensity for the lamp. |
H: What's the importance of source impedance termination?
Given a circuit like this:
simulate this circuit – Schematic created using CircuitLab
What's the importance of R1? One can guess that it's to make the output impedance of BUF1 equal to the impedance of the transmission line, but why is this important? What happens if R1 is omitted? How does what's on the other end affect this? Maybe it's a matched load, open, or short. Maybe it's a transmission line with discontinuities in it.
AI: The idea is that signals propagate at a finite speed, that is to say a certain signal takes t time to get from one end of the transmission line to the other line. The cable also has some intrinsic capacitance/inductance per unit length, which can be approximated with a characteristic impedance (assuming loss-less):
\begin{equation}
Z_0 = \sqrt{\frac{L}{C}}
\end{equation}
This is the impedance initially experienced by the source when the signal changes, with the signal level acting like a voltage divider circuit between R1 and Z0:
\begin{equation}
V_s = V_{in} \frac{Z_0}{R_1 + Z_0}
\end{equation}
When the signal propogates to the end of the cable, it will realize that there's nothing to dump the signal energy into. The signal must go somewhere, so it bounces off the far end and returns to the source. When it reaches the source, the source voltage will be twice the original \$V_s\$, which will flow back through R1 to the source.
If \$R_1\$ = \$Z_0\$, \$V_S = V_{in}\$ and the entire transmission line has reached steady state because no more energy can be injected into or absorbed from the line. This is ideal because the line has reached steady state in ~2t (one t to get to the target, and one t to get back to the source).
If \$R_1\$ is too large, \$V_S\$ will still be larger than \$V_{in}\$ so the source will continue to dump energy into the transmission line, and the transmission line's voltage will slowly step up as the signal bounces back/forth.
If \$R_1\$ is too small, \$V_S\$ will overshoot when the signal gets back. In this case, a falling edge wave will propagate down the line because the source is trying to absorb the excess energy pumped into the line, and again the voltage will bounce back/forth till steady state is reached.
In the latter 2 cases the target voltage could bounce above/below a certain digital logic level multiple times so the receiver could get false data bits as a result. This could also be potentially damaging to the source because the reflected signal may rise induce excess stress on the source.
Now what happens if we attach something to the other side, like a resistor \$R_2\$?
Now the target can absorb energy, and only a fraction of the original signal is reflected. If \$R_2 = Z_0\$, we again have matched impedances and no signal is reflected.
If \$R_2\$ is too small/too big, we'll end up with similar reflection signals as above, except the signal is inverted.
Using \$R_1 = Z_0\$ can still be used to prevent repeated bouncing, but the steady state signal voltage will be the result of the voltage divider between R1 and R2. If \$R_2 = Z_0\$, there is no reflection so the value of R1 doesn't matter. We might as well pick R1 = 0 so the target voltage is the same as the source voltage. As supercat pointed out, you could also have the source drive a signal twice the magnitude the target is expecting and still use \$R_1 = R_2 = Z_0\$
I wrote an online transmission line simulator to play around with which demonstrates source termination. I found it useful for visualizing these signal propagation waves along the transmission line. Pick a large enough R2 and you can approximate an open, like the case you have. This only models loss-less transmission lines, but is usually accurate enough. |
H: What is input and output impedance of an opamp?
I have never understood input and output impedances of an op-amp. If anyone can explain what these two terms mean in an op-amp I'd highly appreciate it. Thank you!
http://www.eecs.tufts.edu/~dsculley/tutorial/opamps/opamps5.html
AI: The short answer: input impedance is "high" (ideally infinite). Output impedance is "low" (ideally zero). But what does this mean, and why is that useful?
Impedance is the relationship between voltage and current. It's a combination of resistance (frequency-independent, resistors) and reactance (frequency-dependant, inductors and capacitors). To simplify the discussion, let's just assume that all our impedances are purely resistive, so impedance = resistance.
You already know that resistance relates voltage and current by Ohm's law:
$$ E = IR $$
or maybe
$$ R = \frac{E}{I} $$
That is, one ohm means that for each volt, you get one ampere. We know that if we have a resistor of \$100\Omega\$, and we have a current of \$1A\$, then the voltage must be \$100V\$.
The concept of "input" and "output" impedance are very nearly the same thing, except we are concerned only with the relative change in voltage and current. That is:
$$ R = \frac{\partial E}{\partial I} $$
If we are talking about the input impedance of an op-amp, we are talking about how much more current will flow when voltage is increased (or how much less current will flow, when voltage is decreased). So say the input to an op-amp was \$1V\$, and you measured the current required from the signal source to develop this voltage to be \$1\mu A\$. Then you changed the source such that \$3V\$ appeared at the op-amp, and the current was now \$2\mu A\$. You can then calculate the input impedance of the op-amp as:
$$ \frac{(3V-1V)}{2\mu A-1\mu A} = 2 M\Omega$$
Typically, a very high input impedance of op-amps is desirable because that means very little current is required from the source to make a voltage. That is, an op-amp doesn't look much different from an open circuit, where it takes no current to make a voltage, because the impedance of an open circuit is infinite.
Output impedance is the same thing, but now we are talking about how much the apparent voltage of the source changes as it is required to supply more current. You've probably observed that a battery under load has a lower voltage than the same battery not under load. This is source impedance in action.
Say you set your op-amp to output 5V, and you measure the voltage with an open circuit1. The current will be \$0A\$ (because the circuit is open) and the voltage you measure will be 5V. Now, you connect a resistor to the output, such that the current at the output of the op-amp is \$50mA\$. You measure the voltage across this resistor and find it to be \$4.99V\$. You can then calculate the output impedance of the op-amp as:
$$ - \frac{5V - 4.99V}{0mA - 50mA} = 0.2\Omega $$
You will note that I changed the sign of the result. It will make sense why, later. This low source impedance means the op-amp can supply (or sink) a lot of current without the voltage changing much.
There are some observations to be made here. The input impedance of the op-amp looks like the load impedance to whatever is proving the signal to the op-amp. The output impedance of the op-amp looks like the source impedance to whatever is receiving the signal from the op-amp.
A source driving a load with a relatively low load impedance is said to be heavily loaded, and a voltage signal will require a high current. To the extent that the source impedance is low, the source will be able to supply that current without the voltage sagging.
If you want to minimize voltage sagging, then the source impedance should be much less than the load impedance. This is called impedance bridging. It's a common thing to do, because we commonly represent signals as voltages, and we want to transfer these voltages unchanged from one stage to the next. A high load impedance also means there won't be much current, which also means less power.
The ideal op-amp has infinite input impedance and zero output impedance because it's easy to make the input impedance lower (put a resistor in parallel) or the source impedance higher (put a resistor in series). It's not so easy to go the other way; you need something that can amplify. An op-amp as a voltage follower is one way to transform a high source impedance into a low source impedance.
Lastly, Thévenin's theorem says that we can transform just about any linear electrical network into a voltage source and a resistor:
In fact, "source impedance" can be defined as the Thévenin equivalent resistance, \$R_{th}\$ here. It works for loads also. But unless you already know Thévenin's theorem, that's not a useful thing to say. However, understanding what source and load impedances are, Thévenin's theorem means you can calculate an impedance for linear networks, regardless of complexity.
1: this isn't actually possible, because you must connect both leads of your voltmeter to the circuit, thus completing it! But, your voltmeter has a very high impedance, so it's close enough to an open circuit that we can consider it such. |
H: What is the reason for adding a buffer stage?
I was following this microphone and speaker circuit and I could follow mostly but got confused when the author introduces a DAC buffer.
http://www.instructables.com/id/Arduino-Audio-Output/?ALLSTEPS
This isn't the first place I have seen engineers putting a buffer stage in amplifier designs. I want to improve my understanding of how these unity gain buffers are useful in circuits. i.e what goal do they achieve? How important is it to put buffer stages in amplifier circuits and exactly when should we take introducing buffer stage into consideration? Appreciate it!
AI: A buffer can serve many purposes in a circuit. There are other uses besides what I mention below, but these are some fairly common ones you might encounter.
One common use is as a time delay in data transmission. It can take a bit of time for a chip to recognize the change in a signal's voltage level and react to it (such as a digital HI to LO transmission). The amount of this slight propagation delay varies from one device to the next. Sometimes it is a few nano seconds, sometimes it is much more. Also, it does take some time for the signal to propagate through the copper from one part of the circuit board to another. When there are one or multiple data signals moving from one part of the circuit to another, it may be necessary to delay one so that they arrive in a specific order or at exactly the same time.
Buffers can be used as momentary data storage. Similar to the time delay, there are situations when you need a small amount of time to store a data bit such as pipelining, but this example can be a bit difficult to explain, depending upon your knowledge of computer architecture.
Another example is signal isolation. Because a buffer is essentially a signal repeater, it can be used to isolate the signal from two parts of the circuit. This is the specific use in your example, as noted by Ignacio in his answer. In this particular case, the DAC (digital to analog converter) is sensitive to loads. A load can be anything from a resistor, speaker, IC input, or even just a piece of wire. This "sensitivity to load" means the signal may change (distort) if too much or too little of a load is seen at the output of the DAC. To prevent this, a buffer chip is used to repeat the signal from the DAC output. The output of the buffer can be connected to whatever you want (within its own limitations) without affecting or distorting the output from the DAC in any way.
Lastly, a buffer can be used a signal amplifier. This is very similar to the previous example, but the reasons for using it can be different. While the output of some chip might not be extremely sensitive to loads, it may only be able to supply a few milliamps of current. In this case, you may want to use a buffer with a larger output current rating to amplifier the original signal so it can be used to drive some larger load. |
H: Meaning of negative voltage
When solving for circuit consists of ideal voltages and conventional resistors I get that one of the resistor's voltage is negative- does it mean the resistor delivers power, or the polarity of the resistor need to be changed?
AI: Voltage is measured relative to something.
Say you measure the speed of a train coming toward you. If it is approaching at 50 km/h, you could express that as a positive value: +50.
If you again were to measure its speed as it leaves, from the same point of reference you would say it is departing at 50 km/h, but you could express this as a negative value: -50.
Voltage is the same way, depending on what your reference point is to ground, you might measure voltages as being either positive or negative. |
H: How can current-limiting supplies be possible?
Knowing Ohm's law, the current drawn is directly proportional to the resistance. In some power supplies, you can limit the current. Let's say the voltage is 12 volts, it supplies 1 amp, and the resistance is 8 ohms. The current going through should be 1.5 amps, but the supply can only deliver 1. How can this defy Ohm's law, and limit the current?
AI: What you do with a current limited power supply is set to maximum properties. The power supply will regulate its output voltage in such a way that the lowest condition is met.
I drew a graph for how a current limited power supply will act with varying resistance connected. Consider a 12V power supply limited to 1A.
The X-scale varies the load resistor from 1 to 30Ω;
The left Y-axis and red line represents the ouput voltage of the power supply. Clearly when the resistor is too low, the power supply output voltage drops, to fulfill the 1A max output;
The right Y-axis and green line represents the output current. Once the maximum output voltage is reached the output current will drop inversely proportional with the resistor value.
You can clearly see voltage regulation taking over from current regulation at R=12Ω |
H: What is a maintenance free battery?
I have searched on Google but can't find anything. Could anyone please tell me what a maintenance free battery is? Perhaps some examples of maintenance free batteries and any good sites for further research could be provided.
AI: The term "Maintenance Free Battery" is typically applied to sealed lead-acid batteries such as used for UPS units.
Traditional lead-acid batteries for automobiles needed the battery electrolyte topped up from time to time with distilled water, whereas the maintenance free ones neither need, nor support such maintenance. |
H: how to make frequency divider?
Can anybody show me how to make divider by 3 frequency using flip flop and logic gate ?
Does anyone here have any good suggestions ?
AI: Start with a basic divide by 4 circuit.
when it gets to the 4th count (A = '1' AND B = '1') reset it and it starts again at zero |
H: What is the purpose of the thin wire at the top of power transmission lines?
I know a power transmission line carries usually two sets of 3 phase conductors. But I have noticed a relatively thin wire at the center-top of the power transmission line. What is the purpose of this thin wire?
AI: Wikipedia says they are ground wires to protect the live wires from lightning. |
H: Programmable differential amplifier
I would like to measure signals up to 5Mhz, between different ranges -2,2 and -36,36, I could use a differential amplifier with level shifting like here.
What is the best way to change the gain of the amplifier? Is it a good idea to use a mux/switch controlled by the ucontroller?
AI: A mux or analogue switch can be used to control amplifier gain by switching in various combinations of different resistor values.
It is also possible to change the gain of some amplifier circuit topologies by changing the combination of some resistors that connect to GND. With these it is easy to selectively make the GND connections by using small nFETs or NPN transistors.
Yes it is possible to control such circuits from a microcontroller. As with any circuit, especially analogue circuits like this, you have to make sure that the added circuit connectivity in the amplifier's gain control loop does not add too much extra coupling or feedback to the circuit to introduce instability or oscillation. In the case of the microcontroller connections into the circuit you have to use care to make sure that the possibly noisy digital GND of the MCU does not contaminate the grounds of the analogue circuit and upset the signal quality above an acceptable level. |
H: Altium: reuse schematic AND pcb layout
I want to build a circuit with many repeating pieces of schematic/pcb layout, and I want to reuse both schematic & pcb layout. Altium offers to reuse schematic, or reuse pcb separately - via snippets and circuit sheets.
But is it possible to reuse both? I.e. when I place another instance of subcircuit to schematic, PCB layout is also automagically copied - and it's all automatically updates when I modify subcircuit... Copying & pasting manually does not work - as it will be a nightmare to maintain if I would need to modify cubcircuit (I will have ~200 instances and ~2000 discrete components total).
Could you suggest how to do it? We've found a script DesignReuse which does exactly this - but unfortunately it does not work in Altium 13: https://code.google.com/p/altium-designer-addons/downloads/detail?name=DesignReuse_v3.3.zip&can=2&q=
AI: Like this?
http://wiki.altium.com/display/ADOH/Snippets
Cannot test it right now, but it should work in AD13 as well. |
H: Use of current division
"Calculate V (across the current source) and the current flowing down through R1."
simulate this circuit – Schematic created using CircuitLab
Does the voltage source also produce current, so that the current flowing to the parallel resistors is the sum of 40mA and the current produced by the voltage source? (For knowing which value to input into current division formula)
AI: Does the voltage source also produce current, so that the current flowing to the parallel resistors is the sum of 40mA and the current produced by the voltage source?
If two components are in series, then the current through them is equal. That means the current through the voltage source is equal to the current through the current source. |
H: transmit data wirelessly under water?
I am looking into constructing a small submarine with a Raspberry Pi. This is just for a hobby project but my idea is to have it communicate with the surface wirelessly. I know that normal radio waves will not work very well so I was thinking of using some type of Ultrasound device where a transmitter/tone generator is placed in the water and the submarine has a receiver/microphone that can pick up the sound waves transmitted.
I have read that sound waves are easily transmitted underwater so this is where I came up with this idea. I am wondering if anyone has already done a project like this in the past or knows where I can find more information on it? I have never really worked with sound/wireless transmission so its all very new to me. Any help is greatly appreciated!
AI: Device is called ultrasonic transducer and it's freely available on a market.
For communications you will need MFSK modem
http://acomms.whoi.edu/umodem/
http://cseweb.ucsd.edu/~kastner/papers/oceans10-low_cost_modem.pdf
or write your own protocol and software.
Note that communication will be short range, if it's ROV and you don't consider it to be AUV it's better to use simple Ethernet cable.
Military submarines also use for underwater communications ELF, VLF radiowaves, so you might also consider this option for AUV, but data rate is very low on this type of systems. |
H: 16X2 character LCD changes contract intermittently and doesn't work with raspberry pi
I've been following adafruits RPi tutorials (and bought their starter kit)
I had an Sparkfun LCD Kit lying around. (It has an HD44780 controller LCD, a 10K trimpot and a 16 pin male header)
I soldered the header to the LCD, not all that well. I followed the tutorial step by step. This page has the wiring and I started bit by bit.
Symptoms : When I connected the trimpot and turned the knob a random bunch of boxes go dark and then they just slowly lighten and disappear. Even when it happens is intermittent. Sometimes I turn the knob, nothing happens, sometimes it lights a few boxes and on their own they dim out.
Below is what is looks like.
This is the schematic of the whole connection. I doubled checked it a couple times. Nonetheless I ran the code the show stuff on the LCD and it just blinks a little randomly.
Is something wrong with the LCD? I messed the soldering?
Is there a possibility of my connections being wrong?
Could the trimpot be the wrong way in? (I tried both ways)
Could you help me narrow this down please?
AI: Looks like a bad LCD. You can try resoldering your connections to the LCD, they look poorly done. The joints should look like this:
http://smartduino.com/wp-content/uploads/2012/11/SMRTM501.jpg
See this guide for troubleshooting bad solder joints:
http://learn.adafruit.com/adafruit-guide-excellent-soldering/common-problems |
H: a good way to detect disconnections on the PCB traces
I make home-made cheap PCBs (I use toner transfer, then acid etching method now, but I might use UV etching someday). I wonder what is the best (and cheap) way to control if there is no problem on connectivity of the traces?
I control the connections by a multimeter, but it takes too much time to check all the connections with it especially if I make 10 or more PCB at a time. Sometimes I see that there are very tiny gaps that disconnects the paths and too hard to see them by bare eye. Is there any spray or can I use camera (webcam) to detect the broken paths, or any smart method?
AI: The problem of broken (or shorted) traces exists in any (especially DIY) PCB fabrication technology, whether toner transfer or high end photolithographic film process - The difference being the trace widths affected, of course.
Validating trace integrity of multiple boards can be done in a DIY environment by using a home-grown bed-of-nails testing rig, consisting of a bunch of pogo pins on a rigid base, and perhaps a row of LEDs to indicate respective trace continuity.
(source)
Adafruit has a tutorial on how to set this up.
If it is for a small run with through-hole part spacing and 0.1" trace distances, and the rig is unlikely to be needed again, a functional bed of nails can be set up using a breadboard and some effort.
Even the most expensive fabrication facilities have at least random sampled board integrity testing as an offered service. If anyone tells you a technology change will guarantee no more broken traces, they are merely advocating their preferred approach, without basis in fact. |
H: How do I connect non-I2C devices to an I2C bus?
I'm quite new to electronics and just trying to do my first Raspberry Pi based system: one diode, one pressure sensor and LCD 1602 with keypad shield (the one for an Arduino board). The way I'd like to connect all the devices is using I2C (the Raspberry Pi doesn't have much GPIO).
And here comes the question: How can I possibly connect non-I2C devices to the I2C bus? I heard about different expanders, like the MCP23017, will that solve the problem?
AI: It is possible that the question represents a misunderstanding or miscommunication of the kind of connection desired: Not something to be connected to the I2C bus itself, but to be controlled via some intermediary I2C to GPIO device, which further is connected on the I2C bus.
The idea of non-I2C devices being connected to an I2C bus is meaningless. The I2C protocol has specific requirements, for the I2C master to address the slave device, and for communicating data in either direction.
The LCD mentioned in the question, for instance, works on a different set of communication protocols, using multiple GPIO pins, and (from the description) most likely does not recognize I2C. There are however I2C LCD modules available, which incorporate I2C slave functionality on board - either through an LCD controller or a dedicated microcontroller with I2C slave communication code. Instead of the basic LCD module mentioned, such an I2C display module would be required for use on an I2C bus.
I2C bus expanders cannot magically create I2C functionality on a connected device. What I2C bus expanders can do, however, is provide additional GPIO pins, which are then controlled by code from the Raspberry Pi or microcontroller through the expander, which itself responds to I2C commands.
Perhaps that is what is desired - in which case, sure, it will work but not as described: A GPIO-driven device such as the LCD module or an LED can be wired up to the expander's GPIO pins, and the expander is the device that is connected to the I2C bus. |
H: Any sequence asynchronous counter
While I can understand the logic behind synchronous counters that can implement 'any-sequence',I'm not sure how I would go about doing that with an asynchronous counter.
For example one that produces a 2->3->5->8->13->2->3->... sequence.
Any tips?
AI: Asynchronous means you don't have a clock signal to control the counter. There is no arbiter that will tell you when the outputs are valid. This implies that subsequent stages cannot tolerate any glitches in the counter. This in turn means you want only a single bit to change between two counts. For every current combination of output levels, you can uniquely identify the next step.
In Dutch it is called a univariante code, I don't know the proper English translation for it, but means that between every step only a single bit will change. Wikipedia writes: "two successive values differ in only one bit". Gray code is a well known example for this. As at every moment only a single bit will change, you still get a stable counter which runs at the maximum speed of the silicon. It also means you cannot use just any arbitrary sequence you like.
If you want an arbitrary sequence, you can use output logic for your outputs but you will get glitches: illegal temporary values caused by difference in port propagation delay.
A sequence like this is easy to design using a Karnaugh map. Just make a loop without interruptions of your desired length. Here is an example 12 stage code I just made up. |
H: PCB drilling - drill bit material selection
I am planning to buy a bench drill (something like that one) to make small hole, 0.5-1.0 mm.
I recently used a Bosh drill and 1mm steel drill bit to make a hole on a FP4 fiberglass board, but the drill bit broke on the second hole drilling process.
Now, I will buy 0.6 mm drill bit but I am not sure what material it needs to be. Could anyone who knows these equipment tell me what material the drill bit should be made of, so that I can use the same drill bit for long? and what do you think about "Tungsten Carbide"?
AI: Whatever size drill press you use, from a small Dremel press mount to a floor-standing shop drill press, you want to make sure that the chuck does not wobble. I originally used a cheap benchtop drill press, but the chuck wobbles about 1/64" (.4 mm), which is inadequate for most PCB drilling.
You should look for carbide bits instead of high speed steel (HSS). Tungsten carbide is great for PCB, but they are brittle. They won't become dull as quickly when drilling FR4 PCB material. Having a good press that doesn't wobble helps a lot in avoiding broken bits.
For holes < 1mm, sometimes even the Dremel can be too unsteady, and break bits. You might want to look for a "jewelers drill press" which is designed for small precision work.
One example is the Microlux mini drill press that Micro Mark sells, though you can find similar ones for sale on eBay. |
H: Two signals alternately on the left and right of a frequency
I was listening to the WebSDR of Twente University, just outside the amateur band, and saw these signals. The x axis is frequency in kilohertz, the y axis is time, where the whole axis shown is about 15s.
It occurred to me that the two signals are alternately left and right of the line on 13,971kHz. Would that be a coincidence, or is this some kind of transmission technique? If the latter, how is it called and how does it work?
The line seems to be unrelated, it's still there although the signals are gone.
AI: That looks to me like two unrelated USB signals, with a carrier that happens to be in the middle. It could be coincidence, or perhaps this is a pilot carrier to make tuning easier. Were you able to listen to what was being said? That could be a big clue.
Here's another USB waterfall sample:
(many more good samples at source)
The asymmetrical shape, and the concentration of power at the low end, corresponding to the \$f_1\$ formants of human speech, gives it away. |
H: Do the logic gate inputs of 74HCXX integrated circuits exhibit a high impedance?
Do the inputs of the 74HC374-SMD D-type flip flop have high impedance inputs? In datasheet is stated that it has buffered inputs, I assume that means high impedance, right?
In other words, do I have to put resistors in the input pins?
AI: With the 74HC series and other logic families that include a large number of devices rather than the individual datasheets repeating the basic characteristics of the logic family normally the manufacturers publish some form of family guide. For example from NXP Semiconductor:
74HC/T HCMOS Family Specifications
Page 28 shows some more detailed information on the inputs of the 74HC series and mentions a current flow of only a few nA. There's also the host of other information you might be used to seeing in a complete datasheet. |
H: LC filter sizing 50Hz AC to good DC (RMS to DC)
I'm using a LTC1966 for a RMS to DC converter. My capacitor is a 10 µF. When measuring with an oscilloscope, I have a small ripple which I want to remove.
My result from ADC to the program shows a ripple of ~8-9bits, and it is to much.
Input to the circuit is a 230V 50Hz source. I've tried to add an 1 µH inductor in series with no luck. Do I need a 0.1 µH?
Note of interest: the output of LTC has a high output impedance of 85kohm and my ADC acctually doesn't want anything higher than 10kohm, but somehow it works.
LTC1966: http://cds.linear.com/docs/en/design-note/dn288f.pdf
10 µF cap: http://se.farnell.com/avx/taja106k006rnj/capacitor-tant-10uf-6-3v-10-1206/dp/197014?Ntt=197014
So, what's the easiest way to reduce my ripple to produce the perfect DC?
AI: With RMS to DC conversion you will get ripple because (using traditional methods) the waveform is squared mathematically, then averaged then the square root is taken. It's the averaging process that is the weak link in the process and I guess it will be on this chip despite it using a sigma delta approach. The spec sheets recommends this for ripple reduction: -
If you can't use op-amps and you don't want to live with a long latency, maybe doing something in code will work. There are some clever filters that can be implemented or maybe you can just look for max and min and take the average of those values? Another idea might be to synchronize to the incoming AC so that you always take a reading at a repeatable point and hence this should give you a stable point in the RMS output?
By the way you'd need a big inductor to get anywhere near what the op-amp circuits can do. 1H (not uH) and 10uF will give you a 2nd order cut-off of 50Hz and your ripple (100Hz) will still be hardly affected - you'd be looking for something like a 10Hz LPF and that would need 25H and 10uF - an op-amp is easier. |
H: Detect car +12V using Arduino
I am looking to detect 12+V from a car wire using an Arduino.
I have found the following schematic:
I know how crazy automotive voltage can get so I just want to make sure the schematic I found above will accommodate the crazy random currents that the car could produce.
Also, wouldn't I need some type of heat sink taken that I am stepping down a +12V to 5V or less? That, in my mind, would produce a pretty good amount of heat?
AI: Knowing that all sorts of weird stuff can happen in automotive power circuits, and not being especially knowledgeable in those systems, I'd err on the side of caution and use an opto-isolator.
simulate this circuit – Schematic created using CircuitLab
Pin 1 = Car 12v R1
Pin 2 = Car Ground
Pin 3 = NC
Pin 4 = Arduino Ground
Pin 5 = Arduino 5v R2
Pin 6 = NC
With this scheme, your Arduino and the car aren't connected electrically at all. At worst, the optoisolator is destroyed, and you can replace it for less than a dollar. Put it in a socket and you won't even need a soldering iron to perform the repair.
R1 was selected such that input voltage transients up to 120V won't exceed the maximum forward current of U1. D1 avoids exceeding the maximum reverse voltage of U1 if the input voltage is inverted. The value of R2 isn't especially critical, so it might as well be the same value as R1.
You won't need any heat sink. Heat is the result of electrical energy being converted to heat, and power is the rate of energy conversion. Power \$P\$ in an electrical system is the product of current \$I\$ and voltage \$E\$:
$$ P = I E $$
So, the voltage itself doesn't make heat: it also depends on how much current is flowing. In both these circuits, the current is low enough that the power is small and no heatsink is required. |
H: Sensing 12v inputs in 3.3v system
Sorry if this has been asked before, but I searched for a while and didn't find anything that exactly answered my question.
I would like to sense the "dummy lights"(oil, neutral, etc.) in my motorcycle with my mBed. The bike runs of a 12v battery and the mBed senses at 3.3v. Now I know I can use a step-down to sense the output, but because it's a noisy system don't I want to use a optoisolator?
AI: If everything is at a common ground, then a simple resistor divider might be good enough. However, there can be nasty spikes on the 12 V power. If these spikes can get to the 12 V signals you are trying to detect, then you should include some additional clamping circuitry.
All around, a opto-isolator might be a good idea, especially if this is a one-off where you're not worried about volume production costs. You probably don't need the common mode isolation the opto provides, but it is a simple way to just not have to worry about ground bounce and the nasty power spikes. I'd go with the opto solution to play it safe. It's really not that much more complicated or expensive. |
H: Current carrying conductor axially through a copper ring
What effect would a copper ring around a current carrying conductor have on the current in the conductor? How can I go about mathematically modelling the current in the conductor?
Details : The conductor in question is a electrode roughly 2 meters in diameter. It slides into the copper ring roughly the same diameter but very small in length compared to the electrode and is therefore a ring as you stated and not a tube. By half efficiency I mean the current in the electrode is much less than what it normally runs at. The ring was originally stainless steel and was then replaced by this copper version. After this and some other changes the decrease in current was noticed. It was suspected that the copper is having some form of coupling effect or transformer action with the electrode thus limiting the current. The ring was then divided into 6 parts and rejoined this time insulted from one another inhibiting current flow in this ring. The reduced current was still observed in the electrode. This to me is a pretty clear indication that the copper ring in fact has no effect and I merely want to confirm this hypothesis. I'm assuming capacitive effects are not of a concern either as the ring is small compared to the conductor and the AC power supplied to the electrode is of low frequency. Another observation that is convincing me that the copper is having no effect is that if a transformer action or some form of coupling was occurring between the electrode and the copper, the current induced in the copper would definitely be visible in the form of temperature because at such high currents, even with low resistance, the heat in the copper should be very high.(I2R). Would you agree with this?
AI: A conducting ring around a wire going thru its center won't have much effect at all on the impedance of the wire.
I think you are confusing the electric and the magnetic fields. Current thru a wire makes a magnetic field going around the wire. If you put a ring around the wire made of a magnetic material, like iron or ferrite, then it will effect the impedance of the wire. The ring is then in line with the magnetic field around the wire. The magnetic material will have a lower magnetic permeabiliy than air, which in effect increases the inductance of the wire for a short distance near the ring.
There are devices which operate on this principle. Sometimes you see a lump in the power cable shortly after coming out of some device. That lump is exactly such a ferrite ring. This effectively adds series common mode inductance to the cable, which helps block RF produced from the device getting onto the cable where it can radiate or conduct the RF onto the power line.
Since copper doesn't have significantly different magnetic permeability from air, putting a copper ring around a wire doesn't do much of anything. |
H: PCB boards: Epoxy resin vs Epoxy glass
I see these PCB material types often: FR4 epoxy resin, FR4 epoxy glass. I see epoxy resin is cheaper than epoxy glass (at least the price that I see from couple suppliers).
I wonder if there is a major difference between epoxy resin and epoxy glass, e.g. the way they are etched and transfer toner, or do they need different treatment on the manufacturing process? What are the main advantage or disadvantage to use epoxy resin?
AI: Like Jim said, it sounds like your vendors are using two names for the same thing. FR4 is a flame-resistant glass-epoxy composite material. The "resin" is the epoxy prior to curing, and the "glass" is a matt of fiberglass strands that gives the composite strength.
There are dozens of products out there that are generically sold as "FR-4" by fab shops that want to keep costs down by buying from whichever laminate manufacturer offers the lowest price at a given time. For hobby projects, it's mostly safe to treat these materials as equivalent.
One distinction to be aware of, especially if your design is using lead-free soldering process, is "high-temperature FR-4". This refers to a key property of epoxy called the glass transition temperature. Above a certain temperature, the cured epoxy will undergo a phase change that causes it to change volume (expand or contract) significantly (like 1%-2%, I think), which you don't want to happen.
With lead free solder, a higher processing temperature is needed compared to tin-lead solder, and high-temperature FR-4 should be used with this process. |
H: Clean 12v car power
I am looking to get a constant, clean 12V from my cars 12V line. I am wondering if all I am in need of to pull this off would be a simple 12V fixed regulator?
The 12V would be hooked up to a pico motherboard (19v max input), 7" LCD monitor and an Arduino.
I did find this schematic here:
So would a simple regulator be good or not? Will it need a heat sink?
AI: The 12V on your vehicle will probably drop below 12V while you start the engine. That, and the noise/spikes on top of the 12V means a simple linear regulator like the one you have in your diagram won't do what you want or expect.
Your circuit is for an input of 12.8V to 30V and it produces an output which is 12V and a little less noisy. If the input voltage (specified at 12.8V) fell a few hundred milli-volts the output would do the same and probably more so, for a 12V input you might only be getting 11V out and, the circuit is no longer regulating. It is providing some input noise rejection but probably not enough as you might expect.
The next question is how low can you tolerate the supply to fall below 12V before the pico motherboard, 7" lcd monitor and and arduino don't work. If it's 10V then you might be OK but not during the period when you start the engine because the input voltage could drop to below 8V - then you'll only be getting about 6 or 7 volts from the circuit.
Ideally, and without fully understanding what you really need I'd go for a buck boost regulator and there are plenty to choose from Linear Technology amongst others: - |
H: N MOSFET Issue in Battery Charging Circuit
My project uses a USB connection to charge a LiPo battery. The LiPo has built-in circuit protection. Everything works fine when hooking the +5V line straight from the USB hub to the battery's positive terminal, and connecting the grounds.
I want to use an LED to indicate that the USB cord is plugged in. The LED should be turned off when the USB cord is unplugged.
I thought using a N MOSFET would be a simple solution - the +5V line from the USB going into the drain, the battery connected directly to the source, and the gate pulled up from the +5V USB line through a resistor. Then I can simply add an LED and resistor on the +5V USB line, which would light up when the USB line was being powered and wouldn't see the battery voltage when the USB isn't plugged in (because the gate would be at zero potential).
Here's my circuit:
I am using the nMOS contained within this IC: FDC6333C.
Unfortunately, the datasheet doesn't explicitly name the pins as 'drain', 'source', and 'gate'. I know there are many different MOSFET symbols used, and I am currently assuming:
pin 1: gate
pin 5: source
pin 6: drain
current should flow from drain to source
The IC's pMOS pins are not being used and aren't connected to anything.
The USB port supplies 5.16 V.
I noticed the following behavior, which I am trying to make sense of:
The LED remains lit when the USB cord is unplugged. I assume this is due to the internal diode within the MOSFET allowing current to flow from the battery to the LED.
I see a 1 V drop across the transistor even when I do not have the battery attached. This puts the 'battery' line at a mere 4 V, which would be unable to charge the battery up to it's max value of 4.2 V.
Switching the source and drain pins seems to provide expected behavior. The LED does not light up when the USB cord is unplugged. With the battery unplugged, I only see a 0.3 V drop across my transistor, which is an adequate voltage to otherwise apply to the battery to charge it.
Here is the data that I took over all possible permutations of USB and battery being connected and different source and drain arrangements:
My initial conclusion is that my interpretation of the datasheet was incorrect - namely, that pin 5 is the drain and pin 6 is the source.
Is the fix really this simple? Or am I missing something more fundamental here? Is there a simpler way to achieve my goal? I am a relative n00b, so all help, advice, and criticism is appreciated.
AI: Let's start with what appears to be the obvious - you have drawn the mosfet symbol and you have indicated the direction of the parasitic diode. Now what does that diode tell you about the direction of current flow when the USB is removed - it should tell you that your FET is either the wrong way round or not suitable for this type of circuit because it will discharge the LiPo into the LED when the USB is not plugged in.
The simplest way to charge the LiPo is to use a schottky diode from the 5V with cathode to the LiPo. This cannot feed current back to the LED when the USB is removed.
However, the problem you now have is that there is a small diode drop but, from what I know about LiPo terminal voltage (which isn't much) is that they operate somewhere less than 4.5V so maybe it will charge OK with the inbuilt protection.
Maybe you could post a link to the battery you are using so this can be confirmed.
More detail about why the FET drawn is inappropriate It's an N channel FET which is fine for switching loads and batteries but it would switch on to low values of on-resistance in the negative terminal of the LiPo because you could raise the gate to the positive LiPo terminal and turn on the FET properly. However, the parasitic diode would still be forward biased when the USB voltage is removed so you can't win on this with a simple FET circuit methinks. |
H: Noise problem with buck/boost switching regulator
I am designing a electrical device for a research project (I'm a PhD student, but unfortunately not EE!). More info on the device can be found at http://iridia.ulb.ac.be/supp/IridiaSupp2012-002/
The last prototype had a problem with the power supply, and thus I tried to overcome the problems by designing a new and better one. As the device is powered by a Lithium-Ion battery, I decided to use a LTC3536 buck/boost switching regulator: http://cds.linear.com/docs/en/datasheet/3536fa.pdf
I basically used the reference implementation (page 1 of the datasheet) for a 1A/3.3V power supply as seen here:
(source: ulb.ac.be)
There are three separate ground planes: PGND, coming from the battery, GND, the normal ground, and AGND for analog sensors etc.
This is the board as I designed it in Eagle. I already noticed some deviations from the reference design, for example, C3 and C4 should be places a lot closer to the LTC (U3):
(source: ulb.ac.be)
This is the output that I see on VCC (with or without load, Vin=4.7V)
As you can see, Vpp is huge! It's smaller for Vin<4.3V, but still quite substantial.
(source: ulb.ac.be)
I did a bit of trial-and-error by moving C3 and C2 closer to the LTC, and adding in another 1µF cap to C7. This didn't help much. I then replaced C7 with a 220µF cap instead of the 22µF mentioned in the datasheet. With this, Vpp is ~200mV. This is a lot better but still a long way from what is specified in the datasheet. Additionally, this is only the case for Vin>4.3V; below this threshold Vpp is still over 2V. I guess it's the boost vs. the buck regulation that makes the change, but I don't really see how I can correct it.
Now the questions:
I was wondering if I made a mistake that is obvious to the trained eye?
Why is Vpp so huge, when the noise given in the datasheet is only 40mV?
Is there another way to fix this other than randomly dropping in different output capacitors?
AI: I think you'll have problems with your layout. C3/C4 MUST be closer to pin 1 (EDIT this should read pins8/9 not pin1). When I say closer I mean living on it! Ditto C7 - it needs to be camped right on pin 7. Now I've never used this part but this is standard procedure for this type of device.
Think about the current pulses flowing from pin 7 to C7 and the length of track between it and the IC - probably 20nH of track.
The ground return of C7 - where is it going? It's going right back to the wrong ground pin (signal ground). C7's ground should be as short as possible to pins 5 and 13 as possible without breaking trespass laws. And this should be your star-point for keying off signal ground. Signal ground should then go to your feedback components and not pass any load or C7 current at all.
I would decline testing this PCB if it was handed to me. Sorry for being abrupt but these are golden rules on switching circuits: - |
H: Why is speech malformed when listening to a USB signal with an LSB receiver?
When you listen to an LSB (Lower Side Band) signal with your radio set to USB (Upper Side Band) or vice versa, the speech you hear is malformed. What causes this behaviour?
AI: The spectrum is reversed. Nice images at Wikipedia
LSB is short for Lower Side Band and
USB is short for Upper Side Band.
Normal AM transmissions are Dual Side Band,
but with filtering you can create Single Side Band (either LSB or USB).
Basically with AM modulation the audio spectrum is 'shifted' right with an equal amount as the carrier wave to the USB and then mirrored from USB to LSB, with the carrier as mirror.
Or you can reason that negative frequencies the give an identical signal as positive frequencies and hence when you start to shift it up the spectrum by amplitude modulation you get two lobes, USB and LSB. |
H: Selecting dsPIC33FJ programming pins
I'm getting ready to print up a board for a project using a dsPIC33FJ256GP710A. I've currently got it running on a EasyPic Fusion devboard.
I see that there are a bunch of pairs of PGED's and PGEC's available to choose from for layout convenience. I also see that there are config bits that need to be set for which ones you pick.
So, lets say I plan to program the dsPIC on board, using PCED3 and PGEC3. Until I set the config bits, how will the chip know that that's where the programmer will live? How can I set the config bits until the chip knows where to look for the programmer? I suspect that the chip will program from any programming port pair, but will only debug from the configured pair. That said, I've been searching data sheet which sent me to the Family programming reference, http://ww1.microchip.com/downloads/en/DeviceDoc/70152c.pdf, and I can't satisfy myself that if I try to get the answer by setting the programming ports to something other than what the built-in programmer is tied to that I won't brick my $25 daughterboard with the PIC on it!
AI: Its doesn't make any difference until you start debugging. However, always review the errata for your particular chip to be sure that all pairs work. There are a handful of MC parts where one pair won't work.
I didn't see anything in the errata, but check anyway. |
H: Reasons of more than one ground pin in L293
Why in L390 they provide four pins for the ground and the heat sink? For heat sink,is only one pin is not sufficient? Here is the datasheet
http://www.ti.com/lit/ds/symlink/l293d.pdf
AI: Increasing the number of pins in such IC designs serves at least two purposes:
Greater conduction path for heat to be drawn away from the IC substrate into the PCB's copper for better thermal dissipation
Lower impedance for the IC's ground current to run to PCB ground pour, by putting multiple pins in parallel.
A peripheral advantage is greater flexibility in designing a PCB layout. |
H: Why ceramic IC packaging?
As someone with no background in electronics whatsoever, I wonder:
why are ICs packed inside ceramic or plastic? I thought we wanted the heat to go out as fast as possible, and ceramic is a good thermal insulator.
AI: In IC packages it certainly is desirable to dissipate heat with the lowest possible thermal resistance.
However, at the same time, electrical insulation and protection from oxidation / corrosion are also desirable, at least for discrete components that are likely to be handled or exposed to the environment.
An insulating packaging such as ceramic or plastic allows this insulation and protection, while permitting heat dissipation through controlled paths, such as integrated heat sinks or heat sink tabs in some packages, or just through the pins in others.
Many IC packages are also sold as bare die, or wafer level chip scale (WLCSP) packages, for the circuit assembly process to directly connect to the PCB. The bare chip is then environmentally protected using epoxy potting or similar protection coatings, after soldering or bonding of the lead bumps to the circuit board.
Such bare packaging of course requires more sophisticated assembly equipment than the much larger IC (and larger contact pitch) packages do, so they aren't for everyone. |
H: understanding how a motor is controlled with an L293D and raspberry pi
See update, picture of robot below.
So today I hooked up a motor and made it spin with my raspberry pi and an L293D by reading this tutorial.
This is what the circuit looks like (larger pictures):
It work's and I'm pretty happy. My end goal is to understand this and build something that can control two motors and I'm set to build a small bot :)
My issues:
If I'm not mistaken in this circuit, the enable pin on the L293D is getting a PWM signal for the speed of the motor it drives.
From the software page I can follow what the python is doing but I don't see where it says that pin 18 on the raspberry GPIO should be enabled as PWM? The docs say that Pin 12 supports PWM ? How does this work?
What if I didn't care about speed? Can I just use an regular GPIO pin for output a high on the enable of the L293D? With the Pi I'm assume that would out a 3.3v? And if I'm looking at the datasheet correct the enable pin can take upto 7v as a high? (What speed would it run on?)
Also again, if I didn't care about speed control, I could hook another GPIO to the second enable and control another motor also right. And I can then control each of they're directions?
Update:
Thanks @Passerby and @JImDearden I got it to work. No PWM, but just two motors. Like @Passerby says, I need three GPIO's for each motor. One for enable/disable and two for direction.
Here is what I made :) And it's wifi network controlled (with a wifi dongle attached) The cable is just a USB power cable :)
AI: From the software page I can follow what the python is doing but I don't see where it says that pin 18 on the raspberry GPIO should be enabled as PWM? The docs say that Pin 12 supports PWM ? How does this work?
Not knowing the specifics of the RPI GPIO Library that Adafruit uses, but looking at the page you link to, it enables it with set("mode", "pwm"). As it says, The Python program first sets-up the two GPIO pins to be outputs. It then defines the same convenience function (“set”) that we used in Lesson 8, to write to the PWM Kernel Module. This is then used to set the parameters for PWM. The RPI hardware PWM is enabled through that library.
What if I didn't care about speed? Can I just use an regular GPIO pin for output a high on the enable of the L293D? With the Pi I'm assume that would out a 3.3v? And if I'm looking at the datasheet correct the enable pin can take upto 7v as a high? (What speed would it run on?)
Yes, you can do that. It would run at 100%, because you simply toggled the pin on. The voltage at the pin is not what sets the speed, but simply how fast you turn the pin off or on in a given time period that does. Like flipping a light switch on and off fast enough that it seems like the lights are only half on.
Also again, if I didn't care about speed control, I could hook another GPIO to the second enable and control another motor also right. And I can then control each of they directions?
Yes, but you would actual need three gpio to control both directions of one motor. 1 for the motor enable (on/off), and 2 for the motor 2 direction. Exactly as it is now, except without pwm. |
H: Why are microcontroller WiFi modules expensive compared to USB WiFi adapters?
I recently bought a WiFi adapter for my Raspberry Pi for about 8 USD. At the same time, WiFi modules for Arduino and similar microcontroller boards cost several times as much.
What is fundamentally different between a USB WiFi module and one sold as a peripheral to micocontrollers? Is it just the economics of high-volume/low-cost, or something fundamentally different in the hardware?
(I've heard about the TI CC3000 WiFi chip that is supposed to be under $10, but I haven't found any place that sells just the chip.)
AI: That is because they are not the same. Arduino/Launchpad/Hobbyist target boards are aimed at small microcontroller sales, which does not have a lot of volume, so price breaks are minimal. And microcontrollers often need more memory than is available for some of the things. A mass produced device can narrowly tailor it's processor to the task at hand.
But one of the biggest things, is that the wifi (or ethernet) chips aimed at hobbyists is that they incorporate more than just the communication protocol. Some also handle the tcp/ip stack, which is very memory intensive and hard to code. Some allow for simple serial (uart or spi or i2c) communication between the microcontroller and the wifi chip, while it does the rest. You are paying for added value.
And finally, most of the time, hobbyists are buying completed boards, not raw chips. Some of these wifi chips, like the TI CC3000 require reflowing, because they have pins underneath or bga packages. They are not easily hand soldered. |
H: Bit error rate calculations for a photodiode receiver driven from a laser
I'm having problems understanding how the following specification for a photo-diode (with built-in amplifier) rationalizes the bit error rate: -
Circled in red are two important figures. One is NEP (noise equivalent power) and the other is minimum receivable sensitivity. The way I figure it works is like this but please correct me if I'm wrong: -
NEP is typically 310nW and note 3 says this is for a single-ended measurement and therefore I assume that for the diff outputs of the device, the power is doubled to 620nW. From this I conclude that the noise voltage out is sqrt(50 x power) = 5.6mVrms.
Next is the minimum receivable sensitivity of -25.5dBm. Laser jargon talks about a 10dB extinction ratio which means that the logic levels transferred via light are 10dB apart so I naturally assume that -25.5dBm is for logic 0 (dimmer) and -15.5dBm is for logic 1 (brighter). These, in mW terms are simply 0.0028mW and 0.028mW.
Now, if I look at photo sensitivity, this tells me how to convert these to voltages. The figure quoted is single-ended and therefore light powers convert to 4.2mV and 42mV respectively. These double up because the output is differential to a peak to peak output of 76mVp-p.
So now, I have rms noise (5.6mV) and p-p signal amplitude (76mV)
Here is where I may also be going wrong. I can convert the noise to a p-p value by assuming it is Gaussian and, for instance if I used 6.6sigma (99.9% "coverage"), the rms voltage becomes 37mVp-p. This is approximately 50% of the signal p-p amplitude and as far as I can tell will be high enough in amplitude to produce bit errors.
Any smaller than 50%p-p and it isn't quite enough to do bit-damage. I used 6.6sigma and this means the noise signal is below 37mVp-p for 99.9% of the time. For those occasions it is greater than 37mVp-p, 50% of those times the amplitude of the symbol may be enhanced and 50% of those occasions the symbol will be destroyed. I therefore conclude that the BER rate is 1 in every 2000 bits.
However the spec (in the picture) says BER = 10^-10 and this is totally at odds with my calculation.
My calculations suggest a bit error rate of 1 in every 2000 and the spec suggests 1 in every billion.
Where am I going wrong?
AI: The one thing that jumps out as odd, is that photo sensitivity in V/mw which tells me that you can't just use P=V^2/R to get from noise power to noise voltage.
Since it also talks about "noise equivalent power" that tells me that they are referring the output noise voltage back to an equivalent optical power (presumably to cater for different load impedances or something) or maybe that's just the most convenient form of specification for comparing different optical sensors. However, that suggests you should apply the "photo sensitivity" to the noise power to generate your noise voltage.
Which makes the rms noise 1.5*310e-6 or more like 465uv.
Does the BER make more sense if you do that? |
H: Detecting button press over computer network
I would like to make a networked device (along the lines of hotel room service call) that has multiple input lines that may be uniquely identified on a computer on the network.
I found a product with similar functionality.
I assume the device will require a microcontroller interfaced with an Ethernet I/O controller? Do I need to have an OS to generate TCP/IP message packets that may be detected on a PC? Kindly suggest a block scheme I can follow to do this.
AI: It's not clear to me what it's exactly what you want. I think it's like the following: you have a number of lines which will have to be interfaced by a microcontroller, and this microcontroller sends a signal to a computer. The computer processes this signal.
For the microcontroller part, you can use a chip with integrated ethernet like the PIC18F67J60 Olin mentioned. You can also use a smaller (easier to program) chip with an external ethernet chip like the ENC28J60. You can write software for the microcontroller using Microchip's TCP/IP stack, Olin Lathrop's TCP/IP stack (see under "Networking Example Firmware") or the implementation by Matthew Schinkel in Jalv2.
Since the microcontroller sends a signal to the computer, it's the easiest to make the computer the server and the microcontroller the client. That would mean you need some sort of server on the computer. I'd recommend you to go for an HTTP server, because there's the most information available for it. For linux, you can use a LAMP server - for Windows, use WAMP or XAMPP.
You'll have to make some server-side script that processes the request from the client. The client has to call that script. You could, for example, make the client request /button.php?button=17 when button number 17 has been pressed. Then, the server-side script could be like this:
<?php
if (!isset($_GET['button'])) { // Check if ?button exists
die('The button variable is mandatory.'); // If not, quit
}
$button = (int) $_GET['button']; // Cast ?button to an integer
if ($button == 0) { // Check if it was an integer
die('Invalid button number.'); // If not, quit
}
// Do stuff with $button
Here's a block scheme:
Let me explain this.
The Buttons & other IO form the input for the microcontroller you're going to use. This would be the buttons you're going to interface, but could also be other things, like I2C / SPI devices, or whatever.
You can get information from this IO with basic chip programming. The chip has to read values from the inputs.
The chip (could be a PIC) with ethernet (could be built-in) processes the input information, and transmits it to the IP of the server, say, 192.168.0.10.
For this, it has to be sent to the router on IP 192.168.0.1 first using the TCP/IP stack. You won't notice this on the chip. It's just like you contact the server directly.
The router processes the packet and sends it to the server on 192.168.0.10. You don't have to make this, the router does it by itself.
The server gets an HTTP request and needs to process it. It sends a response back to the router on 192.168.0.10, which forwards it to the chip. This isn't shown in the block scheme because it isn't needed in this application: data has to be sent from the chip to the server, but not back.
The data from the chip can be used by the server to show it on a screen, store it in a file, or do something else with it. That's entirely up to you.
You can also, as Olin suggests in the comments, use a TCP server instead of an HTTP server. This is possible and more efficient (which is a theoretical pro, you won't notice it). I'd recommend a starter in networking to go with an HTTP server. There are loads of information on the topic and it's very easy to get started with. If you know stuff about networking already, you can build a TCP server as well. Neither of the two servers would be more complex to implement on the client-side. |
H: Why do we need an isolation transformer to connect an oscilloscope?
My professor always insists that I provide power to an oscilloscope thorough an isolation transformer. What is the necessity of this? What is the risk if I don't connect it?
AI: You should never float a scope with an isolation transformer! This is reckless and dangerous advice from your professor, and he/she needs a reality check.
The accepted procedure for doing work that requires isolation is to ISOLATE THE UNIT UNDER TEST, NOT THE TEST EQUIPMENT.
Why?
It's much easier to remember that the unit under test is what's unsafe and needs cautious handling, not your oscilloscope
If you hook a communication cable up to your floating scope (USB, GPIB, RS232), guess what - it's NO LONGER FLOATING. (All of these cables have earth-referenced returns)
As soon as you connect that floating scope return to a potential, all of the exposed metal on the scope is now at that potential. Major shock hazard.
If you cannot float the unit under test, use an isolated differential probe to do your measurements, and keep both the UUT and scope earthed. No measurement is worth the safety risk.
A battery-operated scope may seem like a good idea in this circumstance, but only if it has dedicated isolated inputs. A battery-operated ordinary scope with non-isolated inputs will still suffer the problem of the exposed metal floating up to whatever potential you connect the ground to. That's why all of the manuals for the battery operated scopes clearly say "This scope must always be earthed, even if you're running off the battery" - if you choose to ignore this, it's at your own risk. A scope with dedicated isolated inputs should still be earthed as a good practice. It's essentially the equivalent of using external isolated differential probes with an ordinary scope.
I work full-time in power electronics and have tens of thousands of dollars of lab equipment at my bench. If anyone is caught floating their scope, the float is immediately corrected by the test engineering team, the means of float is seized (most often this is a line cord with the ground prong removed) - disciplinary action is a possibility. Numerous senior/principal engineers have fried their PCs and their entire set of GPIB-connected bench instruments by trying to float the test equipment and forgetting about the GPIB interface. (No one has died yet - thankfully) |
H: Why is a railway's third line or overhead line DC and not AC?
As the title states, in the rail industry, why are the majority of railway's third line or overhead line in DC volts and not AC volts? My initial guess would be that it is in AC since it is easier to distribute AC over long distances. I do know there are a few overhead lines that are 25KV AC, but the majority are 600-750 V DC.
EDIT: I found this article which explains the difference a little bit, but it still doesn't explain why the majority are DC.
AI: Railway infrastructure is expensive. It is relatively rare to create totally new tracks and when you do, they most often conform to the engineering norms of the existing tracks (gauge etc) to allow for flexibility in rolling stock usage etc.
Therefore decisions about electrification were made in the 19th century (e.g. 1890 in London). At that time, speed control of large motors was probably easier for DC than for AC where the speed is linked to AC frequency.
Also at that time DC distribution had advantages over AC.
Subsequent technological revolutions are generally hampered by the need to maximise return on very long term investment in large-scale infrastructure.
An interesting case is London's Thameslink which has trains that operate on overhead 25KV AC for the northern part of the journey and on third-rail 750V DC tracks for the portion of the journey south of Farringdon station. The costs of introducing incompatible infrastructure can be considerable. |
H: What is the point of the transistor to drive the relay coil
In the circuit the relay is controlled from a manual switch on a 12v bus. I can't understand why you would want to add the extra components of the transistor and diodes to the circuit? ie why are D4, R1, T1, D1 needed? Thinking about cost and component count here.
AI: The transistor and the resistor might be needed because the input can not supply enough current to drive the relay. D4 protects the transistor from a negative voltage at the input.
D6 protects the transistor from a negative power, and prevents spikes to enter the power rails.
A relay that is switched off produces a current pulse that must be dissipated somewhere, otherwise it will destroy the transistor. D1 could be intended to protects the transistor against this pulse, but IMO it is placed wrong: the diode should be in parallel with the relay coil.
I can't see any purpose for D3, unless it has something to to with components connected to the vertical wire that are not shown.
All in all this looks like a circuit produced by a committee with too much open agenda's and some closed ones too. |
H: How does an antenna radiate (how do currents flow through the wire)
I don't understand how antennas radiate a signal.
I understand the basics of antennas (wavelength, electron E field, etc.), but I simply don't understand how a current can go through a wire that doesn't have negative pole.
Can you please explain that to me?
AI: I'm guessing you don't understand how current can flow if there is no complete circuit. Let's take a simple quarter-wave dipole as an example:
simulate this circuit – Schematic created using CircuitLab
How can any current flow, since there is no complete circuit from "-" to "+" of V1?
Consider this: relative to the speed at which the waves in the electromagnetic fields propagate, the dipole is long. It's true that current can't flow, but it doesn't know that until it gets to the end of the wire. As the current approaches the end of the wire but has no place to go, the charges pile up until they are pushed back in the other direction. By the time it's back, it's travelled \$\lambda/2\$ or experienced a \$180^\circ\$ phase shift. The voltage at V1 has also changed by this point, and so the current is constructively adding to the new currents being produced by V1. If it were not for some of this energy being lost as radiation, the energy in this antenna would grow without bound.
Why the energy radiates is complicated. The long answer is "Maxwell's equations". If you don't want to understand all the gritty details of that math, then here's a simple, incomplete understanding: the current in an antenna is associated with a magnetic field, and the voltage is associated with an electric field. An antenna is an arrangement such that at some distance away from the antenna (the far field) these two fields are mutually perpendicular and in phase, and what you get is a self-propagating wave like this:
Red is the electric (E) field, and blue is the magnetic (B) field. This is the sort of wave that would be emitted by a dipole aligned with the Z axis. |
H: Run out of electrons
If electricity is a flow of electrons in a wire then eventually all electrons will leave the beginning of the wire and reach the end of the wire. Is that possible? Why if not? What will happen then if yes?
AI: A battery is a device which has a bunch of electrons on one side of it and a lack of electrons on the other side. When you put a wire between the contacts, the electrons run to the other side until there is charge balance. Then, you're right, no more electrons will flow. You have to recharge the battery or get a new one. Note that even when you "run out" of electrons in the charge balanced case, all of the electrons are still there, they're just in a different position. Some are left in the wire; most are back in the battery just in equal amounts on each side of the battery.
In short, you're right though.
With AC power, you're pushing and pulling electrons 60 times a second in order to extract work out of them. In that case, all of the electrons are always there and don't really move unidirectionally unlike the battery case. |
H: Why are circuits drawn like this(see picture) and not closed?
And how do you analyze them if they have a voltage source in the middle of the circuit? What is the Vin supposed to mean if there is a battery source? Thank you in advance!
AI: It's a simplification and Vin and Vout are simply references. Basically they're probe points. It's used in order to determine transfer functions of systems. Transfer functions are useful because the resulting equation that you get out of them can give you an idea of how it will impact a signal propagating through them.
A transfer function is H(x) = Vout/Vin. This is useful if you're messing with frequency and AC systems because then you can use frequency transforms to get a system into the frequency domain and then each stage of say a filter can be easily understood. In this way, you can build and understand how a multi-stage filter would act upon a signal/system.
In this case for what I'm assuming is homework or school work, they're just trying to get you used to the format. Basically, with this notation, they'd ask you how does Vout look given Vin where Vin is a variable.
To analyze them, in your head (or on paper) sweep Vin from -infinite to 0 to infinite and determine at what various inputs Vout would transition. For the first case, determine at what points the diodes would turn on and how that would limit the output. In the second case, determine the same thing: when the diodes would turn on and how that impacts the output. |
H: Which layer does UART belong to?
I am a little confused by UART protocol. Can we map it to any layer in OSI model?
Certainly, it's not physical layer because it doesn't talk about voltage levels. Is it datalink layer?
AI: Most interfaces that are integrated on microcontrollers only cover the
data link layer, with the physical layer being implemented externally
(with some exceptions). In some cases one and the same data link layer
might be combined with different physical layer implementations to
create different interface standards.
The oldest and still most predominant asynchronous interface is the
UART (Universal Asynchronous Receiver Transmitter). Some
implementations support both a synchronous and asynchronous mode -
then it is a USART (Universal Synchronous Asynchronous Receiver
Transmitter). The same thing with just a different name is the Serial
Communication Interface (SCI). With reference to the OSI model, a UART
implements the data link layer (layer 2). The physical layer (layer1)
is covered by several driver standards that all utilize the UART data
link layer, among the most popular are RS232C, RS485 and RS422.
Please click the link below if you want the rest of the article.
Asynchronous Interface Overview. UART and LIN Bus |
H: Electrical Code issues with light switches and Arduinos
Are there any electrical code issues with placing an electronic circuit inside the light switch box of a house?
I am planning on adding a WIFI (8266) and relay control to a light switch.
Does anyone know if there are any code issues with placing electronic circuits in the same box as the light switch?
I live in Texas if that makes any difference.
Thanks
Paul.
AI: The USA National Electrical Code (NEC) requires that anything installed in a device or wiring box of a power distribution system must be listed by a nationally recognized testing laboratory such as Underwriters Laboratories or Intertek's ETL SEMKO. States and lower jurisdictions base their codes on NEC. |
H: Cyclone V external memory group pins DQ/DQS
I'm trying to understand the functions of external memory pins in Cyclone V (5csema5af31c6n)
I do understand that colums HMC Pin Assignment for DDR3/DDR2/LPDDR2 shows pin functions for external memory implementation (using hard memory controller). But for what DQS x8 and DQS x 16 colums? Is this some interface? Why some functions are duplicated? Can't understand it even reading Cyclone V handbook (chapter External Memory Interfaces in Cyclone V Devices) and External Memory Interface Handbook.
Pinout file for 5CSEMA5AF31C6N
AI: There is two way of handling DDR Memory on a Cyclone V featuring a HPS and a HMC:
Using the HMC (Hard Memory Controller) sitting in the FPGA part
Using the HPS's memory controller (which is also available with FPGA not featuring a HMC)
This explain why on columns "HMC" you have two sets of DDR signals, one beginning by B_xyz is for the HMC and the other one beginning by HPS_xyz is for the HPS controller. This is easy to understand I agree.
But there is also a third way to control DDR memory, through a soft memory controller, in the FPGA part (with ALTMEM_PHY IP I guess), thus you can use I/O pins for this controller. I/O pins are general use and can't achieve high DDR frequency, but Altera tried to optimize the internal routing of these pins to achieve a decent memory speed.
Thus As this is the FPGA part and general I/O you can choose your own pinout... within limits. These limits are specified by the DQS x8 or DQS x16 column:
All pins of a DQx group should be in a DQx group of the pin list. If we take a DQ[0...7] / DQS-DQSn0 group and you want it on group DQS4B of the DQS x8 column, then:
DQS0 = AB15 (DQS4B)
DQSn0 = AC14 (DQSn4B)
DQ[0...7] are placed as you want between DQS4B pins: AG13, AJ6, AG12, AK8, AK9, AH14, AJ9, AH13.
I'm currently using a Cyclone V SE but without HMC and without soft memory controller, so please contact Altera for more details or try some pinout in Quartus. |
H: Are chicken bits left in space-qualified ICs?
A chicken bit "is a bit on a chip that can be used by the designer to disable one of the features of the chip if it proves faulty or negatively impacts performance."
Would space-qualified logic components leave this feature in, or would the final design "best practice" of space-qualified IC take redundant features controlled by a chicken bit out of the final die?
My guess is that, if a feature with undesirable performance is left in the final die, the chicken bit could be susceptible to a bit-flip by an SEE (single event effect) or other radiation effects, thus running the risk of activating the undesired feature, and possibly affecting the mission in space.
AI: The definition of chicken bit in Wiktionary is incorrect, and the extension by OP [as hardwired] is even more wrong.
The chicken bit is a configuration bit (software configurable! and usually undocumented) that is incorporated into a design to disable a WORKAROUND of some issue discovered during bring-up of early silicon stepping. The bit is usually incorporated because the pre-silicon validation/verification of the workaround is usually incomplete at the moment of tape-out of a new chip stepping (typically due time-to-market constraint), and all consequences and possible side effects of the workaround are not known yet, as compared to much more verified initial design. The chicken bit is a way to undo the entire workaround in cases when some new side effects would be discovered in process of more thorough and complete post-silicon validation.
As such, the chicken bit is no different from other configuration bits for other hardware features, and should not cause any special concern. In modern designs the essential configuration bits are protected by various special lock-unlock-sync mechanisms, so the run-time effect of SEE events on hardware configuration is minimized. |
H: Trouble reading analog input
I have connected a photo-resistors terminal to atmega320'S ADC0 (PC0) PIN, the other to 5V and the third to ground via resistor
I'm powering my atmega with 3.7v. My goal is to output the value of ADC0 on DC6 pin using PWM. I have the following code:
#define F_CPU 8000000UL
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
initPWM();
initADC();
while(1)
{
startConversion();
OCR0A = ADCH;
_delay_ms(20);
}
}
void initPWM()
{
DDRD = 0b01100000;
TCCR0A = 0b10100011;
TCCR0B = 0b00000001;
}
void initADC()
{
// Internal 2.56V voltage reference
// set ADC0 as the ADC input channel
ADMUX = 0b11000000;
// enable ADC
// set prescaler to 128
ADCSRA = 0b10000111;
}
void startConversion()
{
// enable ADC
// start conversion
// set prescaler to 128
ADCSRA = 0b11000111;
}
I tried to output both ADCH and ADCL via OCR0A, but the light intensity of the PD6 doesn't change, but if I set 0CR0A to 255, it glows super bright so PWM is working. I tested photoresistor with multimeter and I'm getting 0.6v to 1v between the ground and ADC0. Any suggestions?
AI: Turns out the problem was loose pin on the ADC0, the code and setup is correct. Sorry everybody. |
H: Using a lower pot value for motor bidirectional controller
I'm looking to make a bidirectional motor controller. I would like to use the following diagram. What values should the resistors be in order to use pot(S) of smaller value than 100k and the circuit still work?
Can someone please explain the formula when using different pots value.
AI: Ordinarily you could just scale the resistors and capacitor and it would work, but 1K is about as low as you should go with R1.
What you can do is to transfer some of the resistance in R3 into R1.
So, for example, to use 10K pots you could reduce R3 to zero (short), leave R1 at 1K, reduce R2 to 1K, and increase C1 to 1000uF.
For 20K pots, R3= 1K, R1 = 1K, R2 = 2K, C1 = 470uF.
...and so on. I woukd not suggest going much lower than 10K.
The reasoning behind this is that the capacitor charges through R1+R3+R5, but discharges through R2+R4. To keep the times similar to the original circuit you want the products of the total resistances and C1 to be the same as in the original circuit. You should be able to verify that my numbers are correct. |
H: How is NTSC analog video written to a Video8 tape, or analog tape in general for that matter?
I am trying to recover some videos on a Video8 tape and was wondering how in general how analog video was written to tapes. I've been researching the NTSC specification and it seems like there are these vertical and horizontal sync signals. I am wondering if these signals are written to the Video8 tapes during record, or if only video frame data is recorded and the sync data generated upon playback by the playback device?
A little bit of old school electronics, but it would be helpful if any of you more experienced folks have any idea.
AI: This is just a short recall of what I remember.
The H sync tip, and chroma burst are stripped off and then restored with a standard sync tip after reading. Since the sync tip corresponds to past the the edge of the tape with some guard edge, there is a precision servo to sync the spinning head and tape speed to the standard rate derived from the Hsync standard rate. The chroma burst is inserted with the sync tip during playback.
There are two sets of gapped heads on the heliscan drum with gaps to correspond to the horizontal blanking interval (BHI)
Since the chroma burst is harmonically related to the H sync as well as V sync and tape speed, there are several servo PLL's to regulate tape speed and heliscan drum recording/playback head to synchronize all the signals back to the standards Hsync frequency.
The video signal itself is also converted from AM carrier to baseband to FM to tape and the reverse back to RF out on CH 2 or 3 or composite video out which is compatible with monitors on 75 Ohms.
ref |
H: Why aren't smartphone batteries parallel?
So I'm thinking, imagine a phone with a 3000mah battery. Then if we divide that battery in two, we get the same capacity but those batteries can now be charged twice as fast. What's the mistake with this thinking?
AI: It depends where you think the limitation of the charging rate is coming from.
If you think that 'a battery' can be charged at 'X amps', regardless of the capacity of the battery, then yes, two small batteries could be charged twice as fast as one larger battery.
But it doesn't work like that. Charge rate limitation tends to be in terms of C, the battery capacity. If you split a battery with capacity C into two, then you end up with two C/2 capacity batteries. Each of these smaller batteries takes the same time to charge, because you can only run half the amount of current into each. |
H: 12v low power, high brightness solution - urgent
I need to quickly come up with a way of lighting a trade show booth from a 12v marine battery for 8 hours. My original idea to light the booth was to use a power inverter hooked up to an 80Ah battery and use 120v AC LED bulbs totaling ~45w.
The math on paper looked good but after doing a dry run this evening with a brand new battery, the whole setup lasted a little over 3 hours before the inverter reached the low voltage cutoff and shut down. Obviously I'm losing a lot in the conversion from DC to AC and back to DC or the specs for the bulbs / inverter are way off.
I urgently need to come up with a solution (by tomorrow morning) that will work based on the size battery I have and the amount of time I need it to run. Would I be better off just getting some 12v automotive LED bulbs and keeping everything 12v?
AI: Your problem is using LED bulbs combined with using an inverter. LED light bulbs' internal AC to DC converters are adequate but cheap, and do not tolerate anything unexpected very well. And what they expect is a 50Hz or 60Hz relatively clean sine wave at around their rated voltage.
Your inverter is almost certainly of the 'modified sine wave' variety. This type of inverter works by adjusting the output voltage in 4 large steps. This is, at best, vaguely reminiscent of a sine wave, but its really just a bunch of half-step square waves. For a lot of applications, or even most, this is fine.
Unfortunately, LED light bulbs do not react positively to this abuse. If they are given a modified sine wave like the output of your inverter is giving them, they will literally poop all manner of horrible harmonics directly into the eager mouth of your inverter. This will make the inverter hemorrhage watts in the form of waste heat, while making the bulbs also run hotter and there is even a risk that they will be damaged by these harmonics.
Your math is fine, just remember to add in an extra 200W of harmonic losses, and you get that magic 3-4 hour figure :).
The idea is sound except for this unfortunate 'gotchya'. Possible solutions:
Use a pure sinewave inverter. These are more expensive than modified sine wave inverters, but really not by all that much these days. If time is the most important factor and dropping another $100 or so is acceptable, this is probably your best bet. You can buy them at most retail stores that carry inverters. They may be a bit overpriced at these locations, but I like to think of it as the 'I need it NOW!' tax.
Use an isolation transformer between the output of your inverter and the LEDs. The transformer will 'sine-ify' the squarish output of the inverter and put your LED bulbs at ease. Not sure how easy it would be to find one in a hurry though.
There are other solutions but they all require buying things off mouser and waiting days, so I won't bother mentioning them. I think the best route would be to just get a pure sinewave inverter, one of good quality. Drop that in with your existing setup and you should get 8 hours no problem. Yes, there are conversion losses, but it should be, and this is absolute worst case (it ought to be much better than this), 20-30W tops in addition to the 43W load. Even at 75W, 80Ah is plenty for an 8 hour run time. |
H: Calculate 12v Battery Runtime When Using Only 3.6v
What is the best way to calculate the runtime of a 12v battery if I am using 12 - 1 watt LEDs using 320mA @ 3.6v? Can someone post the formula?
AI: Ok, we have:
12 LEDS with Vf=3.6V and Iftot=320mA when in parallel (If=24mA per LED).
12V battery with let's say 1000mAh (you haven't specified the capacity)
The battery voltage will be regulated down to 3.6V with voltage regulator
Assuming you use a switching regulator with 100% efficiency we can calculate:
Ibat = Vf / Vbat * Iftot = 96mA
Thus the battery would last:
t = 1000mAh / 96mA = 10.41h
Since a switching regulator has more like a 80-90% efficiency, expect 10-20% less.
If you use a linear regulator like the LM-series, the difference between the input and regulated voltage is dissipated as waste heat. Then it would just be:
t = 1000mAh / 320mA = 3.12h
And your regulator would get pretty hot (P= 12V - 3,6V / 320mA = 2.7W). |
H: What is the magnetic field due to an electromagnet at a point that is not along its axis?
For e.g. at a point below(or perpendicular) to a cuboidal/cylindrical core electromagnet?
I am confused whether the magnetic field for an iron-core electromagnet is limited to the axis passing through it because if that is the case how can it be used for the various applications that requires applying force on other metals?
Please specify the method to calculate the field,if any.
I am a beginner so kindly pardon any mistakes.
AI: For analyzing the magnetic field from a coil at some distance, the fall back position is the biot savart law. Here's the simple example alluded to in the question: -
And, for the magnitude of the fields off-centre I've found that the only way to practically do this is go back to the basic biot savart law: - |
H: What is the difference between DCM and PLL in e.g. Xilinx FPGA?
Some FPGAs have both DCM (Digital Clock Manager) and PLL (Phase Lock Loop) for use in internal clock generation.
Xilinx Spartan-6 FPGA Clocking Resources UG382 (v1.10) documentation describes a number of features for DCM:
Eliminate clock skew
Phase shift a clock signal
Multiply or divide an incoming clock frequency or synthesize a completely new
Condition a clock, ensuring a clean output clock with a 50% duty cycle
Mirror, forward, or rebuffer a clock signal
Clock input jitter filtering
Free-running oscillator
Spread-spectrum clock generation
However, to my understanding all these (or at least the majority, maybe not the "Free-running oscillator") are also available when using a PLL.
So, what is the difference in using a DCM vs. a PLL in an FPGA design?
AI: Xilinx use the term DCM for their enhancement to what they used to call a DLL, or Delay Locked Loop.
This (DLL) was a tapped delay line fed from the original clock signal, by selecting different taps, you could get different delays on the output clock signal. As the delays are unpredictable, logic compared the outputs from different taps until it found which tap number gave a full clock cycle delay - it was "unlocked" until it found the right tap. Then it updated that tap number as the delays drifted (e.g. as the input frequency changed or the chip warmed up) then other delays (e.g. 90 degrees, 180 degrees, were computed from that.
So it provided vaguely PLL-like behaviour without any analog circuitry, which was difficult to achieve in their processes at the time. Downside was that the jitter spectrum was different from a PLL as the delay was always an integral number of taps.
If you cascaded DLLs or DCMs, the second one will probably work, but a third one may have dificulty locking up due to the jitter imposed by the others.
The DCM is based on the same idea but provides other functionality such as clock frequency multiplication.
Newer FPGAs offer both DCM (DLL) and PLL but I expect the DCM is still easier to produce. |
H: Difference between wire wound and ceramic chip inductors
I have two boxes of SMD r.f. inductors. One lot are wire wound, and the others are ceramic chip. What is the difference in construction? From peering at them with a microscope I see that the wire wound ones are, umm, wound with wire. But how are the ceramic chip ones made? What do they look like inside? I notice that the \$Q\$ for the wire wound ones is higher. Are there any other important differences in usage?
AI: The internal structure is similar to that of a multilayer ceramic capacitor:
The wirewound type has less capacitance between windings, leading to a higher self-resonant frequency. Also lower DC resistance (so higher Q) and a higher DC current rating. The multilayer type can support higher inductance in a small package.
Either type can be made with 'air' (actually ceramic, but it has similar magnetic properties but higher dielectric constant) or ferrite, with the former suitable for very low inductances. |
H: Why does the current intensity decrease when I connect two voltage sources in series?
I actually connected lemons with batteries and I found that the voltage of lemon and the battery (i.e. the bottom left circuit) is 3.8V while the current intensity in the top left circuit is 0.1mA!
The question is why the current intensity in the top left circuit is 0.1mA while the current intensity in the top center circuit is 1.56mA and the current intensity in the top right circuit is 0.013mA?
simulate this circuit – Schematic created using CircuitLab
AI: Mainly because the lemon is far from being an "ideal" voltage source — it has a considerable amount of internal resistance, which limits the current that can pass through it. |
H: Charge on plates of two capacitors in series are not equal
I have a simple circuit below with two capacitors are initially charged to Vo1 and Vo2 respectively. The two capacitors are in series however the charge on plates are not equal.
Could anyone tell me what is wrong here?
PS:
It seems that no one understands my confusion. Lets me express it again. What I want to check is the charge on plates of two capacitors (with initial charged voltages not zero) are the same. However from the calculation, you can see the expression for Q1 and Q2 are different. So in general, they are not the same. I would like to know why they are not same even the two capacitors are in series.
AI: So Q₁ is the total charge on C₁. Q₂ is the total charge on C₂.
This charge will be due to any initial charge ( Q₁(0) = V₀₁·C₁, Q₂(0) = V₀₂·C₂ ), and the charge flowing through the capacitors because of the switch, which we can call Q. So Q₁ = Q + V₀₁·C₁, Q₂ = Q + V₀₂·C₂.
There is no reason why Q₁ and Q₂ should be the same - for example, if V₀₁ = V₀ and V₀₂ = 0, then no current will flow when the switch is closed, Q = 0, Q₁ = C₁·V₀, and Q₂ = C₂·0 = 0.
This one is set up with V₀₁ = 2V, V₀₂ = 0V and V₀ = 4V which ends up with V₁ = 3V and V₂ = 1V, so Q₁ = 3 Q₂:
simulate this circuit – Schematic created using CircuitLab |
H: FIltering ADC input
I would like to filter signal on ADC input. My question is if I can add before input ordinary RC filter. I suppose that this is not good idea. I have to limit number of operational amplifiers on the board so it can't be isolated by buffer amplifier.
If resistance is too big the internal (S&H) capacitor will not fully recharge. Capacitor from RC filter will be parallel with capacitor from S&H and it will change the capacitance of sampling capacitor? Am I right or not ?
cheers
AI: When not sampling, the filter capacitor will charge to the filtered vin value. Now when you sample, charge will move from the filter cap to the hold cap. The resistor is there but doesn't have much to do with it. If the filter cap is large compared to the hold capacitor, then the voltage will change very little and the hold capacitor will charge very quickly. |
H: Can I safely toggle the CS pin without sending any data?
Update: I've tried the solution I proposed in comments in practice (utilizing E pin on the 138 IC during changing target device) and it did indeed work. Read the whole thing if you want more details.
simulate this circuit – Schematic created using CircuitLab
I am trying to multiplex several SPI devices using a 74HC138 3-to-8 multiplexer. My program logic changed from typical "set CS low, SPI out, set CS high" to something like:
void selectDevice(int n) {
digitalWrite(mux0, n & (1 << 0));
digitalWrite(mux1, n & (1 << 1));
digitalWrite(mux2, n & (1 << 2));
}
selectDevice(3); // my device
spiOut();
selectDevice(7); // dummy, not used
It works perfectly if there's just one device I'm talking to. However, there are some problems when two or more devices get used that way.
This brilliant answer has this:
The CS line goes low, the clock cycles and essentially shifts in input bits and shifts out output bits, until the transaction finishes, at which point the CS line goes high. When their CS line is high, slave devices don't communicate: they ignore the CLK and MOSI lines, and put their MISO pin into a high-impedance state to let someone else use it.
This would make sense, but seems to directly contradict with the 74HC595 shift register behaviour for low->high ST_CP (so my CS) pin transition:
contents of shift register stages (internal QnS) are transferred to
the storage register and parallel output stages
The behaviour table and functional diagram basically state that ST_CP is irrelevant when the data comes in on SH_CP/DS, and it will be stored in the shift register. That would mean that if I write some data to other devices, and then briefly toggle the ST_CP pin, I'll write this garbage out! (assuming output always enabled).
As I see it, this is precisely what my selection code is doing, because the bits don't actually flip immediately; the multiplexer will go through other pins. Does that mean I need a separate pin to disable (make high) all of the mux outputs during the switching? Am I understanding this correctly?
AI: The HC595 doesn't have a CS input, it's not an 'SPI' device, though with care it can be driven from an SPI master. Data is always clocked into the shift register with the clock line. The Latch input can be coerced into doing some of the job of a CS line, like transferring the S/R data into the output latches, but it can't be used to disable the S/R input.
There are several ways to drive HC595s from an SPI master.
a) Connect all the devices in a long chain, and shift valid data into all of them.
b) Have a seperate clock line going to each group of 595s, with shared data and CS, so the data in their S/Rs is not disturbed, so can be latched into the outputs.
c) Or have a seperate CS/latch line going to each 595 group, with shared clock and data, so that although rubbish is shifted into the S/R, it doesn't get latched to the outputs, and when you do want to update them, you shift in valid data.
Depending on your SPI library, this may entail some manual bit banging to separate the groups. |
H: Low amps high volts vs high amps low volts?
What is the difference between the two?
Why would you use say, 5 volts and 2 amps, over higher voltage and lower amps?
AI: Going off of your post content rather than the title, I think you are asking why use higher voltage and lower current vs lower voltage and higher current to drive an equal amount of power.
It is often more efficient to use higher voltage and lower current. Wires often have an ampacity rating, which is how much current they are rated to handle. If you double the voltage and keep current the same, you can use the same wire to drive a load twice as big.
However, there are often practical limits to how high of a voltage is used. At higher voltage, certain safety considerations come into play. Wires and other components have voltage ratings, and going above those ratings may cause the electric field to overcome the dielectric strength of the insulation, leading to a loss of insulation and an electrical short.
There are more complex reasons why certain devices, such as microcontrollers, all use 3.3V or 5V. This Quora post has some good explanations. It seems that transistors in use at the time had a voltage drop of 0.7V and many useful combinations of transistors required at least 3V. Also, if these devices use a higher voltage, more space would be required to insulate internal components, or material with a higher dielectric would have to be used which may not be cost effective. |
H: Does AC OR DC flow?
I'm reading about transducers and have a related question.
Is the audio signal flowing through the voice coil of a loud speaker AC or DC?
AI: WE try to never put DC through a speaker coil. The design intent is for only AC to flow through a speaker and never DC. See: Why are DC signals bad for loud speakers? |
H: Two resistors in series
I know the summation equation for two or more resistors in parallel or series, and I know two parallel resistors will give more power.
But sometimes I saw some circuits that used two resistors in series, and I am wondering why that method was used and why they didn't use one resistor with a higher value (equal to total series resistors)?
Such as the following circuit diagram, two 33 kΩ resistors used in series. So why doesn't it use one 68K resistor?
Give it better results? I mean, noise filtering or something else?
Note: This circuit is an AC dimmer for a microcontroller.
AI: It's the voltage rating on the resistors that is important here. They are powered from rectified 230 V AC and they need to have the correct voltage rating to suit their application. Two resistors in series having an individual rating of 200 V gives a total voltage rating of 400 volts (near enough if you ignore tolerances on values).
Take a look at the good old MRS16 and MRS25 range from Vishay: -
With 230 V AC present, the peak could be as high as 325 volts without even considering line transients. Clearly two resistors should be used. And, for SMT resistors this might be useful to consider: - |
H: Period for this astable multivibrator (nor gates with limiting diodes)
I was able to find the period without the diodes which was T=2RCln(3)
But I am unable to find the expression when we connect the two diodes. (Our course says it is :
T= RCln( (VDD+Vd) /vt).
I am unable to find out how we obtained this expression)
This is the circuit:
Please explain how to get the expression of the period of this circuit, and thank you.
AI: This is how it works. (even though I disagree with this academic example)
2nd stage pumps max current into diode, while saturated and charges cap so input reaches Vdd+Vf, ( depending on diode and ESR of CMOS family) then diode turns off and decays by natural logarithm to threshold \$v_t\$ ( exponential decay) thus the half period becomes...
\$\frac{1}{2}* \frac{1}{f} =T\$ (=7.87us in my simulation)
\$T= RC*ln((V_{DD}+V_f) /v_t)\$
thus 100k*100e-12*ln((5+0.579V)/2.5V)= 8.03us with an discrepancy of 1.6%
Note the diodes I modeled here drop 580mV with 30mA spikes which can be a source of error as well as Vt and component tolerances.
Other details
The assumptions behind this model are flawed in so many ways, in reality with SCR Latchup effects if you exceed the absolute max input voltage. (Vss+0.5 and Vcc-0.5V) which is added for some ESD protection. I think they should ban this design for reasons of ESD diode stress, EMI egress, potential CMOS latchup and spurious oscillations on faster devices, , but don't sweat it
The actual CMOS devices come with Schottky diodes in two stages . They must be small to have react fast so they are all rated for 5mA max which is less than the drive current possible for some CMOS drivers. So this circuit is poor design to follow, but can be improved to protect ESD diodes or add much bigger Schottky diodes. But then this is not very efficient and causes large current spikes)
I had to add 50R output to simulate 74HC gate output impedance and add 50pF to prevent spurious oscillation just before toggle.
But to analyze the circuit , looks at the differentiate pulse which decays to Vcc/2 then toggles polarity. So the Peak Voltage at the input of 1st gate (in simple theory) is Vf+Vdd and thus this decays to Vdd/2 for the Time constant
From my experience , I can ballpark estimate the ESR of any forward diode such that if it is rated for 5mA @0.5V ( the absolute max outside Vdd,Vss before latchup will occur) this is equivalent to an ESR of <=100 Ohms at rated current.
Thus in my simulation with 100pF cap and 50R ESR and 100R diode the Cap "dv/dt" charge time current spike is 15 ns wide with 2~3ns rise time. ( which spews spectrum from clock rate up to 1/15ns=66Mhz and then harmonics above that to 1/(2~3ns)= 333MHz to 500MHz.. Nasty crosstalk....
Some diodes in newer devices may be rated for 20mA steady absolute max.
A simpler circuit uses a Schmitt gate Inv or NAND with 1 gate and a feedback R and C input to gnd with a triangle wave on input from 1/3 to 2/3 Vdd instead of a differentiated diode clipped signal decaying across Vdd/2 +/- 30% over temp |
H: How to solve current source prb W/O using Nodal Analysis?
I have the full solution to this problem, but it is using nodal analysis.
I am not a fan of Nodal Analysis. Is there a different approach to this problem?
AI: Yes there is an alternative to this problem. First, note that you have three resistors in parallel with each other. Put 4k in parallel with 10k which gives you 2.857kOhms. Then, take 2.857kOhms in parallel with 3kOhms and that will give you 1.463kOhms. Finally, you can multiply 1.463kOhms to 10mA and you will get a voltage of 14.6V. The current is in the opposite direction as conventional current flow so the voltage potential will be -14.6V across 10kOhms resistor. The potential voltage will be the same at all nodes.
simulate this circuit – Schematic created using CircuitLab |
H: LTspice unlogical DC offset
I have a Problem with an LTspice simulation. Specifically, I am designing an 12V bridge amplifier. The Problem in my simulation is that there is an DC offset which partially defies logic as far as I can tell. I attached a screenshot of the schematic for reference. Please Note that this is a first draft!
As you can see, there is an 700 and then some mV DC Offset at the Inputs of the LTC6248 OP amps, behind the decoupling capacitors C1/2 at the outputs of the LT1994, which should not be there as far as I can tell. The capacitor should block all DC parts from U1 and the inputs of U2/3 should not generate a Voltege that large (thinking about the opamps dc offset here...)
The problem occurs with LTspiceIV and XVII,which are very picky as of late (XIIV in general, has anyone else trouble with LTspice as of late?) and also with different opamps and with ideal op`s. All models are from Linear and came with LTspice, no 3rd party libs used. So I am at a loss here and hope that anyone has an Idea where the DC offset comes from.
AI: You need resistors to ground on these inputs to keep the input dc bias from just charging up the capacitors. In other words it's bad design and won't work.
They may be limiting at 0.7 volts because the model has internal protection diodes in place. See note 2 in the data sheet: -
Note 2: The inputs are protected by back-to-back diodes.
This means that if the inverting input is at 0V then the non-inverting input is clamped one diode drop higher. |
H: Reflow soldering issues
I've been using a halogen oven with a home made controller as a simple reflow oven. The controller uses a thermocouple to measure and control the temperature profile.
The problem I have is that I'm getting inconsistent results depending on the component. As a test I made a simple board with 8 resisters and 8 LEDS. In this case I've put a little solder on the pad using a soldering iron, positioned the components on the pads and then re-heated in the oven. I cleaned the board with liquid flux before applying the solder and again after applying solder (In one case - I had similar results when I didn't do this second clean)
The resistors have all come out fine. They are positioned well and the solder looks good. The LEDS however all come out terrible. They all just about have proper electrical contact so the board "works" but they are very poor indeed.
The components are all about the same size and have similar contacts. There was no difference in the preparation. The LEDS are very slightly thicker I suppose. They are within 1cm on the board and I don't believe would have significantly different temperatures.
I'm wondering if anyone has any explanation or suggestions about how to improve? Maybe I need to increase the temperature? Or hold the temperature a little longer?
AI: If you must use solder instead of solder paste then you really need to ensure that there is plenty of flux on and around the pads when you reflow. Without the flux the solder won't flow into the components properly.
Solder contains flux in the core, but that burns off as you melt it onto the pad leaving just (almost) pure solder behind. You need flux for the solder to flow onto the metal of the component.
Solder paste is made from millions of little tiny beads of solder suspended in flux. If you're going to reflow you really should be using paste. It's not expensive (well, it is, but you use such small amounts a little goes a long way). Personally I use a nice low-temperature one (138°C melting point) with my home made "toaster oven" reflow oven (ChipQuik SMDLTLFP) in a syringe.
Here's an LED I reflowed earlier today using my homemade oven:
BTW, the pad layout for the LED above is exactly as specified in the datasheet for the LED. Check with the datasheet for your LEDs that the pads you are using are suitable. If they are spaced wrongly (and they look like they may be) then reflowing may be problematical at best.
It's even good for fine-pitched QFN:
I wouldn't even think about doing those with normal solder without having the board swimming in flux when I reflowed. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.