text stringlengths 83 79.5k |
|---|
H: Component with an impedance that has a negative real part
Is there an electrical component such that its impedance has a negative real part ?
Fact: Any electrical component made from resistors, inductances, capacitors (connected in possibly complex ways using series or parallel connections recursively) must have an impedance of a non-negative real part.
Proof: Suppose that there exists a way to connect the components (R,L,C) in a possibly complex ways using series or parallel connections recursively to get an impedance with a negative real part. Choose the connection of R,L,C that uses the least number of connecting wires. Let's call this component COM.
AI: Using simple devices L's, C's, and R's by themselves, you cannot get a negative resistance. It takes either an active device (see Scott's answer) or some physics happening in an individual device.
There are at least three primary devices that hold historical significance that have this characteristic which are the Back diode, the Gunn diode and some tunnel diodes.
All of these devices have regions of their I-V curves that exhibit negative resistance. You must bias the signal to span these regions of interest and not go beyond.
Here is a snip from "American Micro Semiconductor
The back diode was used for envelope detection in early radar speed guns.
The Gunn diode operates on a different principale and is called a Transferred Electron Device (TED). These are typically used in oscillators, when paralleled with a device of opposite characteristics the combination oscillates at millimeter wavelength frequencies.
Here is a semi-complete list of types of devices that all have negative resistance; (Source: - Complete guide to semiconductor devices by Kwok K. Ng);
Tunnel type: Esaki Diode, Backward Diode, Back Diode.
TED Type: Gunn Diode, Transferred electron Oscillator (TEO), TEA A=Amplifier.
Resonant-Tunnelling type: Double barrier diode, RTFET.
Resonant-interband tunnelling type. Single barrier tunnel diode.Real-space transfer diode (RST).
Metal insulator semiconductor switch type: MISS, MIS Thyristor (MIST) MEtal-Insulator-semiconductor-Metal (MISM) switch, Metal Insulator Semiconductor-Insulator Metal MISIM switch. Planar doped barrier switch (PDB), Double heterojunction optoelectronic switch (DOES)ledistor, Lasistor.
Ammorphous Threshold Switch type: Ovonic threshold switch. Heterostructure Hot-electron diode (HHED) |
H: How are air-core inductors typically constructed?
I'm considering learning to build air-core inductors for power applications.
For example, I presently want a .5-1 mH choke capable of handling 50 amps for two seconds. Winding my own air-core seems like it might be a cost-effective solution, but I'm not clear on how large coils like that would be physically constructed and held together.
I've used cable ties before, but that's a cheap and quick solution, not something I'd want to use for production, especially in any sort of high-vibration environment.
Is there a standard way such things are typically built?
Edit: these chokes are intended for use in ~600 VAC systems, so the insulation is going to have to have some pretty high withstand ratings.
AI: It is as simple as using a form or armature over which you roll your wire. Once it's on the armature and wound up you can glue it together or even paint it with an epoxide paint that will give it strength. However, you will have to account for heat production. In some cases you might want to leave the coli on the the winding armature, if you've chosen the \$\mu_r\$ to be ~ =1 this could also be save.
If you are using litz wire you'll probably have to leave it on the armature.
There are companies that sell brackets and clips for this sort of thing. the term you will be looking for and here is a link to a page giving hardware. there are lots of competitors. |
H: Is the registry file made from SRAM?
I study computer engineering and I read Hennessy's book about Computer Organization where it's described how the microprocessor does pipelining and that the microproceossor has on-chip cache, as much as 8 MB on-chip cache in a modern microprocessor such as AMD's Opteron. Is that on-chip cache made from SRAM or what are the physical characteristics of a modern registry file and its 2 caches, instruction and memory? Is it the same material in the L1, L2 and L3 caches?
AI: They are going to implement it such that it uses the minimal number of transistors possible while still meeting performance targets. For microprocessors, this usually means that, yes, it will be a form of SRAM/latches. I'm being ambiguous because there are so many different ways of implementing latches. The only reason why you would not call SRAM and latches the same thing is that they are optimized for different performance and that subtly affects the transistor layout. But you could design and layout the whole design only using latches for everything.
Also, most logic flows and design in microprocessors use latch based double clocked schemes for performance and timing reasons. So latches are abundant in the cell library.
There are processes available that integrate DRAM with standard logic but these tend not to be used in microprocessors due to cost and yield issues (due to the complexity of additional process steps)
Is it the same material? - yes this is all on the same Si substrate the question should be it is the same cell library. Yes. |
H: Arduino Uno starter's kit and project
Recently i bough an Arduino Uno, along with a breadboard starters kit (those two were bough separate) and i am trying to configure my first project. Looking to the breadboard instructions, if i am not mistaken, i am supposed to remove the ATmega328 from the Arduino and use the other one (the one included in the kit).
Question is: 'Can i leave it as is and then tell the program which one to use?'
I am a bit confused in that part since i am not really experienced in electronic engineering.
AI: Each of these chips is programmed with a bootloader. The bootloader allows you to program your arduinos. This link says that the Optiboot bootloader is the one thats used in the UNO. In which case, both chips are the same and can be swapped.
However, if you are new and learning, I wouldn't swap them. As Jey was saying, there is the potential to damage the chip by removing it, static discharge etc... |
H: What is a baudrate and what is an Xtal Frequency?
I'm programming my LPC1313 MCU with Flashmagic on my mac and I am asked to put in the baudrate along with the Xtal frequency. I'm not sure what those are and when I looked in the data sheet I found no information about it. What do those terms mean in terms of a microcontroller and how can I determine the Xtal frequency and the baudrate of the LPC1313 MCU?
AI: Did you try Wikipedia?
In telecommunication and electronics, baud (/ˈbɔːd/, unit symbol "Bd") is synonymous to symbols per second or pulses per second. It is the unit of symbol rate, also known as baud rate or modulation rate; the number of distinct symbol changes (signaling events) made to the transmission medium per second in a digitally modulated signal or a line code. The baud rate is related to but should not be confused with gross bit rate expressed in bit/s.
Ostensibly, there is some serial protocol you are configuring, and you have to say how fast it should go.
"Xtal" means "crystal". The clock for your MCU is probably controlled by a crystal oscillator. The MCU can only interpret units of time relative to this clock, and you have to tell it how fast the crystal you are using is, probably so it can convert the baud rate you've configured in "symbols/second" into "symbols/clock pulses". |
H: Calculate minimum voltage to turn off/on solid state relay
I have an AQZ204 AC/DC type solid state relay AQZA204 datasheet
Basically I want to calculate the minimum supply voltage required to turn the relay on
and the minimum supply voltage required to turn the relay off. These are similar to Pick/Drop voltages of mechanical relays or must be on voltage, must be off voltage..
I'm using 31.5 volt DC supply, with a series 4.7k Ohm Resistor to the input LED of the relay.
The data sheet is a little confusing to me, it saids the LED max dropout voltage is 1.5V so I calculated around 6.38mA forward current for the LED:
31.5VDC - 1.5Leddrop = 30VDC/4700 = 6.38mA
I'm confused by the IFon current being 3mA max?
So I can test the relays to see if they are in spec.
AI: The IfOn Max current is the current that the least sensitive relay should require to turn in - most will turn on at lower currents, but you should supply at least 3 mA to ensure that any relay will be on. The Ablosute Maximum LED current is 50 mA, so it is safe to supply more than 3 mA.
For turn-off, there is IfOff Minimum of 0.4 mA - most units will turn off at a higher current, but the most sensitive may stay on with currents as low as 0.4 mA, so you should ensure that the LED current is below 0.4 mA when you want the thing to be off. |
H: Question about laser driver
If you go to this link you see a nice laser driver for a small laser...didn't he mean to put that diode in series with the + and - or is it supposed to be parallel and I"m just not understanding for some reason?
http://www.rog8811.com/LM317%20components01.jpg?0.35312663627278806
also his reasoning there:
http://www.rog8811.com/laserdriver.htm
Plus isn't the diode possibly unnecessary since the laser is a diode and assuming it can handle the voltage?
AI: The 1N4001 diode is included for reverse-power protection. As the linked site says, the diode "protects LD if batteries are inserted the wrong way round".
In normal operation, the diode is reverse biased and will have very little effect on the circuit operation.
But if you accidentally miswired something, or hooked up your power backwards so that you were trying to push current the wrong way through the laser diode, the 1N4001 diode could save the laser from being destroyed (assuming your power source has enough internal resistance that it doesn't just blow up the 1N4001 and the laser).
Laser diodes are generally optimized for efficient light output rather than ability to withstand high reverse voltages, so protection circuits like this are often needed to improve the reliability of laser diode circuits. |
H: Difference between data retention in flash and in EEPROM
In a security recommendation (Mobile Operating System Protection Profile, §4.2.1 FCS_CKM_EXT.4.1), the following instructions are given to securely wipe a cryptographic key from memory:
For non-volatile EEPROM, the zeroization shall be executed by a single direct overwrite consisting of a pseudo-random pattern (…).
For (…) non-volatile flash memory, the zeroization shall be executed by a single direct overwrite consisting of a single direct overwrite with zeros (…).
In plainer English: you can erase data in flash by simply zeroing it, but for EEPROM you must overwrite with a random pattern.
I have no other information to infer what difference between EEPROM and flash is meant. I guess the technologies would be the ones in typical smartphones since this is the type of device that this security document addresses.
What is different between overwriting data in EEPROM and overwriting data in flash memory, that would explain the different requirements?
[Related: Where do these rules come from?]
AI: If you speak in general terms the primary difference between flash and EE prom is simply architectural with respect to the data access, the actual write/erase mechanism is identical at the cell level. What circuits wrap around those cells for moving the bits to and from the cell, how parallel the operation is and how many happen at the same time is where the real differences lie. So an accurate statement would be , if you've implemented a FAMOS or FGMOS cell can you make a flash or an EEPROM chip from that, and the answer would be yes.
But be aware it will be hard to compare various EEPROMS to Flash devices simply because of the differences in the process technology, the process capabilities and it's wear resiliency.
EEPROMS tend to be small and so tend to be more robust and designed for longer term storage which affects the process design. On the other end you can see that there is multilevel Flash with is optimized for bit density. this is yet another optimization.
All floating gate cells are characterized by their usage of Fowler-Nordheim (F-N) Tunnelling for the injection of the charge into the floating gate through the Gate oxide. F-N tunnelling in turn is characterized by Quantum Mechanical tunnelling through a triangular potential well under high electric fields. The point here is that tunnelling is inherently damaging to the gate oxide and leaves residual evidence. The solution recommended above is to ensure that each cell is worn out the same amount so you can't go back read the evidence of what was there - when put that way it does really seem like such a good idea.
Very few people/labs have the ability to strip apart a die and read the residual damage in the floating gate device that has been erased. It is possible, certainly, but it won't be through probing the device and it would be very difficult. It would be best to capture the device with charge still in the gate (but this poses different problems in itself). |
H: What is the unit for resonant frequency?
What is the unit for resonant frequency? where \$\omega_0 = \frac{1}{\sqrt{LC}}\$? Is it just \$HF^{-1}\$?
AI: In the simplest way possible:
L is in henries (H) - \$\Omega \cdot s\$.
C is in farads (F) - \$\dfrac{s}{\Omega}\$
Multiply both and you have \$s^2\$. Take the square root, you have \$s\$. Invert it, you have \$\dfrac{1}{s}\$, that is, \$\frac{rad}{s}\$.
If the expression is written as \$\omega_0 = \dfrac{1}{2\pi\sqrt{LC}}\$ the resonant frequency is in hertz. |
H: Parameterized Instantiations and Module Instantiations
Is instantiations used above are very much similar to instantiation used in C++?I am new to verilog, yet in the stage of learning it.Like we used a instance of class in C++ at various places, so is it similar to using parametric and module instantiation?
like
//Module Defination
module and4(a,b,c);
input[3:0] a,b;
output[3:0] c;
assign c=a&b;
endmodule
//Module Instantiations
wire[3:0]in1,in2;
wire[3:0]o1,o2;
and4(in1,in2,o1);
and4(.c(o2),.a(in1),.b(in2));
so with the first view it is clear that we are using different instance of and4 to make different objects as we do in C++, but i am still doubtful that what i am thinking is wrong or right?
AI: In Verilog if you instantiate a module twice you are telling your synthesis tool to actually create two separate circuits. You could imagine a synthesis tool that works by picking out actual 7400-series logic gates and robotically placing them on a breadboard, and hooking up wires between them.
In your case, the tool would actually pick out a 7408 quad AND chip, and wire up two of its gates according to the nets you assigned.
In the case of simulation, of course, you're just telling the simulator to simulate a circuit with two AND gates, rather than build an actual circuit. |
H: Soldering IC directly to stripboard
I picked up my first "from-scratch" DIY electronics project in a long time, building a 2-tone door bell on stripboard with a basic 555 circuit.
For the most part everything went well. I assembled the circuit and measured up before going out and getting a snug fitting plastic enclosure (since it will be mounted close to the door).
I made one vital mistake, I forgot to include the 555 IC in my measurements, which is now protruding from the IC holder I soldered in - and now the 9v battery is poking out of the enclosure and blocking the lid!
I feel I have three options:
Meticulously unsolder the IC holder and solder the 555 directly to the stripboard
Run the 9v battery clip outside the enclosure and strap the battery to the outside of the box
Re-measure and buy a slightly larger enclosure
I'm not experienced at soldering; my current efforts have been reasonably neat but the components have had to cope with some excess heat as I occasionally fumbled with the solder. I'm very tempted to give the resoldering a go, but does anyone have some advice on how to keep the component cool while I solder the pins? Are there any other things I should watch out for when soldering an IC without a holder?
AI: For the IC holder (called an IC socket normally) the most difficult part will be desoldering it without some some form of solder sucker. Personally I'd cut away the plastic section with side-cutters and then remove the pins one by one considering you don't want the socket. Then either user a small hand-held solder sucker (they only cost a few dollars) or if you don't have one maybe push through a piece of wire while applying heat to clear the hole of remaining solder.
For soldering the IC directly it's easy to be paranoid but DIP packages are often wave soldered which involves dipping in solder and making every connection at once and the pins themselves will dissipate a lot of heat before reaching the die of the chip. Just to be a bit extra cautious as you improve your soldering technique maybe just wait 15 seconds or so between each pin to give it a while to cool down. You should find the top of the chip will barely become warm, it if is just wait a while until it cools down.
I suspect the trickiest thing is likely to be removing the socket without tearing off the tracks on the stripboard. That's why destroying the socket and removing pin by pin is probably easiest. |
H: Interrupt being called before complete execution of ISR
What happens when an interrupt is called again before the execution of the ISR is completed?
AI: In most normal cases this either can't happen or there is no harm. Every architecture I can think of disables interrupts in such a way the the interrupt that was just taken can't happen again until the software re-enables it -- usually. Some processors have a non-maskable interrupt, which may be handled differently. Ignore those for now.
On simple processors that have a single interrupt, interrupts are usually globally disabled when a interrupt is taken. That allows the code immediately at the start of the interrupt to know it can't be interrupted. That is useful since often various things need to be done in the interrupt routine that must appear to be atomic. Many processors have a means to re-enable interrupts combined with returning from the interrupt routine in such a way to guarantee that the interrupt routine need not be written to support re-entrance. For example, the PIC 16 has a global interrupt enable bit (GIE in INTCON). This automatically gets cleared when the single interrupt is taken, and the special instrution RETFIE can be used to return from the interrupt and set GIE at the same time.
Things get a little more complicated on processors that have multiple interrupt priorities. The purpose of priorities is specifically to allow high priority interrupts whether in a lower priority interrupt routine or not. There is usually a field in some register that is the current priority level. When a interrupt is taken, the existing priority level is saved along with other state (like the return address), then the priority is bumped so that only higher priority interrupts can occur. Any one interrupt routine can't be re-entered unless the code deliberately diddles the priority level, but all but the higher priority interrupt routines have to be written considering that they can be interrupted. This is usually not a problem in preforming operations that need to appear atomic since the other higher priority interrupts will usually deal with different hardware and state. It does mean though that you can't rely on sequential instruction timing in low priority interrupts. These are all things that need to be taken into account during the system level design of the software.
Now back to non-maskable interrupts (often called NMI). These are by definition interrupts that can't be turned off ("masked" off) by the software. This means that on some architectures the NMI interrupt routine could possibly be called re-entrantly. This is something you have to be aware of as the system designer. Usually you connect the NMI input to a signal that you know can't trigger with a very short interval. Since the NMI interrupt handler is the highest priority in the system, you also know it won't be interrupted and therefore can know that it will always execute within some maximum time.
Also keep in mind what a interrupt really is. You may think of being "in" a interrupt in some code, but often interrupt code is nothing special to the processor. To use the PIC 16 example again, interrupt is not a lasting condition but a single event. When the interrupt condition occurs and GIE is set, the processor effectively executes a call to location 4 and clears GIE. That's it. The processor is done with the interrupt. Whether you view code at that location as a interrupt handler or whether you think it is "in" a interrupt is strictly your own abstraction. Ordinary foreground code can clear GIE too, so running with GIE off doesn't make something interrupt code. If you happen to execute RETFIE some instructions after enterting the routine at 4, execution will return to where it was when the interrupt occurred and GIE is re-enabled. To you that may be "leaving" the interrupt routine, but the processor does nothing different before or after that instruction and has no state telling it that is is "in" interrupt code. |
H: GNU Radio with USRP
I have a problem transmitting a voice file from GNU radio to USRP. My problem is the simulation was working fine but when I transmit data from GNU radio attached with USRP to its receiver only noise is heard. Could anyone shed light upon it?
AI: The guys over at the GNURadio mailing list are a great source of information for beginners, I've posted a number of messages over the last couple of months and always found the answer I was looking for (sometimes not directly though). |
H: MOSFET is not turning off when the gate terminal is grounded
This figure shows a small portion of my circuit:
The maximum Vgs of the MOSFET is 20V. The MOSFET is initially turned on and now I want to turn it off. For that I am grounding the terminal A to ground through a resistor of 1k. But it is not turning off. If I do this without the 1k resistor it is turning off. What could be the possible reason?
AI: If you attach A to ground, you have, in effect, this:
simulate this circuit – Schematic created using CircuitLab
Since the gate current of a MOSFET can be assumed to be zero, we can think of this as a voltage divider, and see that the voltage at the gate of M1 is 2.7V. This isn't low enough to turn the transistor off.
Probably, you want to remove R6, or make its value very much less. A MOSFET, unlike a BJT, has a very high gate impedance, and so does not require a resistor to limit the current. |
H: Differences between OLED, LED, LCD, and TFT Screens
I have heard about these different types of screens on DIY websites and in consumer electronics. What are the differences in these types of screens and what are their advantages and disadvantages?
AI: LCD: liquid crystal display. Works by adjusting the amount of light blocked. Usually has a backlight but might not (clocks, calculators, Nintendo Gameboy). The green-black ones can be very cheap and are a mature technology. Response time can be slow.
TFT: is a type of LCD with a thin film transistor attached to each pixel. All computer LCD screens are TFT since early 2000s; older ones had slower response times and poorer colour. Cost is now very good; power consumption is fairly good but dominated by the backlight. Has to be manufactured out of glass.
LED: light emitting diode. As the name suggests, emits light rather than blocking it like LCD. Used for red/green/blue/white indicator lights everywhere.
Some manufacturers advertise "LED" displays that are TFT screens with a white LED backlight, which is just confusing. Ones that are real LED screens are usually OLED.
OLED: organic LED (rather than silicon or germanium based like regular LEDs). Comparatively recent technology, so cost still quite variable and not available in really large sizes. In theory can be printed on plastic, resulting in lighter flexible displays with good brightness, good power consumption and good response time.
Best power consumption of all of these is a monochrome infrequently changing LCD display with no backlight. |
H: How can electromagnetic interference from a USB charger cause a capacitive touchscreen to malfunction?
Electromagnetic interference from a USB charger can cause a touchscreen on a mobile device to malfunction, with symptoms such as reduced sensitivity or spurious touches. As an example, see http://forum.xda-developers.com/showthread.php?t=1784773.
From an electrical standpoint, how can EMI from a USB charger cause a capacitive touchscreen to malfunction? I can understand how EMI can cause radio communications to fail, but I don't understand how it would cause a touchscreen to malfunction.
AI: Touch screens have transmit (Tx) and receive (Rx) electrodes which are drawn in transparent indium tin oxide (ITO), forming a matrix of crossed traces with each Tx-Rx junction having a characteristic capacitance. The human finger is basically a ground that alters the mutual capacitance between the RX and TX electrodes. This network is very sensitive to changes in charge (i.e. capacitance changes).
Typical chargers use a flyback circuit topology. The interference waveform they generate is complex and varies considerably between chargers, depending on circuit details and output voltage control strategy. The interference amplitude varies considerably depending on how much design effort and unit cost the manufacturer has allocated to shielding in the switching transformer.
Typical EMI parameters making this interference hard to filter include:
Wave shape is complex, consisting of pulse-width modulation square wave
followed by LC ringing
Frequency rates 40–150 kHz under nominal load, with pulse-frequency or skip-cycle operation dropping frequency to < 2 kHz when very lightly loaded
Voltage levels up to one half input peak voltage = Vrms / sqrt(2)
These interference voltages are coupled capacitively from sources that are both internal and external to the touchscreen device. These interference voltages cause charge movement within the touchscreen, which may be confused with the measured charge movement due to a finger touch on the screen.
This form of EMI has many coupling paths which can disrupt the TX/RX electrode capacitance measurements: internal (poor shielding in device), external parasitic (finger-device introduces closed ground loops, etc). Poorly designed chargers or poorly shielded devices (or both) can exhibit touch screen problems. |
H: Help identifying component on Sainsmart 4-Channel Relay board
http://www.thesunrain.com/Amazon/4%20relay%20board/4-ch%20relay%20module.pdf
In the Schematic there are 4 Items Labeled U1,U3,U5,U7
They look like small black boxes on the actual boards. I can't really tell what they are, it looks like some sort of LED icon and then a transistor? If so whats their purpose? These are Mechanical Relays btw.
AI: These components** are opto-couplers. Their purpose is to convey the digital signal while providing galvanic isolation. If galvanic isolation is required, VCC and JD-VCC should come from separate power supplies, which are in turn isolated from each-other.
** U1, U3, U5, U7 in the schematic.
Galvanic isolation is used to:
stop high voltage events from getting into vulnerable areas
block conducted EMI on the signal lines
allow the isolated parts of the circuit to float with respect to each-other
P.S. critique of the schématique
For what it's worth, the schematic could have been drawn better.
Isolated grounds should have different symbols to make it more obvious that there are isolate grounds in the circuit. Isolation barrier should be drawn as a line.
There are 2 connectors on the board with "J?" designators.
It's better to have a separate power connector for each of the isolated sides. Where's the ground pin for the right side power supply?
No revision number. No part number. |
H: Multiplex 125kHz RFID antenna
I'm looking to follow up on a question (asked by another) that wasn't answered to my satisfaction in another question.
RFID Antenna Array
I am successfully using the ID Innovations ID-2 chip to read 125kHz RFID tags. Furthermore, I have sucessfully tested connecting antennas with RG-58 coaxial cables with SMA connectors up to 8' in length. I now need to use need to use multiple antennas to scan in different locations using the same ID-2 reader IC.
I hesitate to use traditional analog multiplexers because the signal sent from reader to antenna is extremely analog, and ranges from a few mV to over 100V and I'm worried that the properties of MUX ICs will destroy the signal to/from the antenna.
I basically need a "2-pole,4-throw selector switch" that i can control with some I/O pins from an Arduino or other microcontroller.
Can anyone point me in the right direction? someone suggested using mosfets in comments on the other question? Thanks in advance!
I will make whatever board i develop to do this available as open source hardware.
ID-2 Datasheet
Update: I would use something like an analog switch IC if it didnt seem like the signal would exceed the maximum voltage of the IC. Am I wrong?
Update2: Found some Solid State Relays that look like they might be the best of both worlds. Im going to go ahead with these for now. http://www.mouser.com/catalog/catalogusd/646/1981.pdf
AI: No, that analogue switch won't do given your signal requirements. Because of the need to keep integrity as high as possible I'd use relays. You'll need a relay that is 5V logic driven and has decent contacts. You'll need to switch both legs of the circuits unless of course you can make a decent claim for one of the legs being a solid 0V.
For the relay type I'd strongly consider using a sealed reed relay.
I'd use this type here. It's features are
standard footprint
single pole single throw (two needed per antenna)
200V contact
500mA switching
500 ohms coil (10mA to drive direct from logic)
There are two pole versions but unless space was a big issue I'd work with these. You'll need two per antenna meaning a drive capability of 20mA from your logic. This should not be a big issue.
Remember, if you use transistors to drive the relay coil, add an anti-parallel diode across the coil. |
H: MOSFET: Why the drain and source are different?
Why the drain the source terminal of the MOSFET function differently while their physical structure is similar/symmetrical ?
This is a MOSFET:
You can see that the drain and source are similar.
So why do I need to connect one of them to VCC and the other to GND ?
AI: Myth: manufactures conspire to put internal diodes in discrete components so only IC designers can do neat things with 4-terminal MOSFETs.
Truth: 4-terminal MOSFETs aren't very useful.
Any P-N junction is a diode (among other ways to make diodes). A MOSFET has two of them, right here:
That big chunk of P-doped silicon is the body or the substrate. Considering these diodes, one can see it's pretty important that the body is always at a lower voltage than the source or the drain. Otherwise, you forward-bias the diodes, and that's probably not what you wanted.
But wait, it gets worse! A BJT is a three layer sandwich of NPN materials, right? A MOSFET also contains a BJT:
If the drain current is high, then the voltage across the channel between the source and the drain can also be high, because \$R_{DS(on)}\$ is non-zero. If it's high enough to forward-bias the body-source diode, you don't have a MOSFET anymore: you have a BJT. That's also not what you wanted.
In CMOS devices, it gets even worse. In CMOS, you have PNPN structures, which make a parasitic thyristor. This is what causes latchup.
Solution: short the body to the source. This shorts the base-emitter of the parasitic BJT, holding it firmly off. Ideally you don't do this through external leads, because then the "short" would also have high parasitic inductance and resistance, making the "holding off" of the parasitic BJT not so strong. Instead, you short them right at the die.
This is why MOSFETs aren't symmetrical. It may be that some designs otherwise are symmetrical, but to make a MOSFET that behaves reliably like a MOSFET, you have to short one of those N regions to the body. To whichever one you do that, it's now the source, and the diode you didn't short out is the "body diode".
This isn't anything specific to discrete transistors, really. If you do have a 4-terminal MOSFET, then you need to make sure that the body is always at the lowest voltage (or highest, for P-channel devices). In ICs, the body is the substrate for the whole IC, and it's usually connected to ground. If the body is at a lower voltage than the source, then you must consider body effect. If you take a look at a CMOS circuit where there's a source not connected to ground (like the NAND gate below), it doesn't really matter, because if B is high, then the lower-most transistor is on, and the one above it actually does have its source connected to ground. Or, B is low, and the output is high, and there isn't any current in the lower two transistors. |
H: ZPUino soft processor
I was going through http://papilio.cc/index.php?n=Papilio.Hardware and realized that they mention ZPUino Soft Processor but I am unsure of what this is exactly. I know that it is an soc according to http://www.alvie.com/zpuino/downloads/zpuino-1.0.pdf but what exactly is its role on the fpga-board ? Why do we have a separate ide for it (ZPDuino). I thought we have to write everything for an fpga in verilog or vhdl. What is this c like syntax? Even in the quick start guide for papilio they genrate a bit file using c like syntax(http://papilio.cc/index.php?n=Papilio.P1QuickstartSketch). So what exactly is it and what does it do?
AI: A processor such as the AVR is implemented using digital logic so it's also possible to load a similar design into an FPGA that behaves the same way. They are often referred to as soft processors and no doubt the original design for the soft processor would have been done using a traditional HDL. Once someone has 'done the hard work' you can load up the design into the FPGA and write software using C or any other language you would normally use for that processor that has been created within the FPGA.
It's probably not a bad way to initially get up and running with the board but if you stick with just treating it as a 'FPGA AVR' you really won't get any benefit, an actual AVR would be cheaper and more efficient under most circumstances.
Where soft processors are most useful is when combined with HDLs such as Verilog or VHDL to perform additional functions that an AVR alone might not be so good at. An example might be capturing a video frame that arrives at 50MHz and buffering it, and then using the CPU core to take the image and transfer it over a GSM module taking care of all the protocol intricacies that are handled more easily with traditional C code.
Note that I'm just using the AVR as an example you're probably familiar with, the ZPUino may well have a different instruction set but either way when you create a processor within an FPGA it's possible to target a compiler at it and use traditional programming languages. |
H: Can we place silkscreen inside the footprint?
Can we place silkscreen inside the footprint for through hole PCB? I guess it eliminates "visual congestion". What are the problems associated with it??
AI: You can put silkscreen markings anywhere you want on a board. There is nothing special about being "inside" a footprint of a particular part. It is quite common to put markings inside the board area of a part. Just keep in mind that these will be covered up when the part is installed, so such marking are only of use during assembly or when looking at a bare board.
Silkscreen should never cover pads, but every board house I have used automatically clips the silkscreen layer to only where there is soldermask. It's not good to rely on this since registration may not be as tight as the clipping. Don't do it yourself, which leaves the board house clipping as a extra layer of protection against screwups. |
H: What happens at the end of a transmission line?
Let's say I wanted to make a widget containing a relay to switch between two antennas. There is a coax transmission line coming in from the transmitter, and two going out, each to a separate antenna. Inside is a relay which switches the center conductor, and the shields terminate into a metal enclosure around the relay:
simulate this circuit – Schematic created using CircuitLab
Let's further say that this is operating at HF, so the enclosure is very small relative to the minimum wavelength this device will encounter in operation.
At point A, there is an impedance discontinuity. The coax was \$50\Omega\$, but inside, it will be something else. At point B there's another discontinuity, as we transition back to \$50\Omega\$. So, there must be some wave reflection happening here.
What effect would this have on the transmitter? Would it result in a horrible SWR, or no? Why?
AI: Probably very little effect at all as long as the dimensions are small. Coming from the left hand side, there will be a reflection from point 'A' followed closely by an (almost) equal and opposite refection from 'B'. As long as the distance from 'A' to 'B' is small, these reflections will effectively cancel-out.
As an example, let's say the impedance inside the switch is 100Ω. The reflection coefficient at 'A' will be 0.333 and at 'B' it will be -0.333. If the enclosure width is say 200mm, the time between these reflections will be around 1ns (very small at HF).
Reflections will continue to 'bounce' between 'A' and 'B' and each time there will be some energy coupled into the transmission line but these will occur 2ns apart and will be attenuated each time due to internal losses.
We can draw a reflection diagram showing the effect of a unit step travelling down the line. The vertical axis represents time and the horizontal axis distance. With the example figures, there will be some overshoot at the transmitter lasting a few nanoseconds. Please excuse the amateurish diagram!
Edit :-
Following supercat's suggestion, I have added another sketch showing the resultant waveforms at the source and load. The step width is the round-trip time across the switch and back.
However, whilst this kind of diagram is useful to gain an insight into what is going-on, trying to calculate the actual overshoot amplitude is not too helpful. Effects such as finite rise and fall times, multiple reflections inside the switch ( eg, each side of the relay contact) and other effects will mostly smooth the theoretical transitions. I have not even addressed line attenuation and other losses, nor have I estimated the actual impedance of the relay switch which would be non-trivial. At best you can only estimate a worst-case scenario. |
H: Books/tutorials on programming a microcontroller
I'm relatively new to programming with Microcontrollers. I bought an LPC1313 MCU and an FTDI RS232 cable from newark. I later found out that I would need to construct a PCB with 6 pin headers inorder to make the MCU interface properly with the cable. I have no idea how to make that. Are there any books or resources that I can read or look at to get an idea of how to make that?
AI: Pick 1:
Buy an evaluation board
Buy a suitable break-out board for the package purchased
E.g.
Buy a generic proto board with suitable footprint.
Maybe?
Put the LPC1313 to one side, buy an Arduino and use that instead.
as Brian K suggests in a comment below.
The Arduino suggestion, though in many ways similar to the first option above, is a good one in that there is a very large community of Arduino users who provide support to people new to electronics. |
H: How to multiplex a two-way data line?
I have a use-case where I need to control 4+ sonar sensors with a pic 628A microcontroller. The pic is also responsible for controlling a GPS and LCD so pins are scarce. The sonar sensors each have a single signal pin. To operate them, you pulse this pin which produces an ultrasonic chirp and then wait for it to go high again which indicates that an echo was detected. The time between the initial pulse and the response pulse corresponds to the time of flight of the chirp.
I would like to be able to multiplex all of the sonar sensors onto a single bus, but am not sure how to accomplish this. I would like to use only basic components if possible (not specialized IC's) because my main purpose of this experiment is to get a better understanding of the basics. Since the signal channel must allow for both input and output, I do not think bipolar transistors will work. I have considered using FET's to multiplex each signal line, but I am very inexperience with this stuff and would appreciate some direction.
AI: What you want is an 8:1 multiplexer/demultiplexer. You can get them as an IC, but I don't know if that falls under your idea of a "specialized" IC or not. It's the kind of thing you would use in a freshman digital logic class.
If that's not basic enough for you, the block diagram still shows you what you need to build.
The bottom half is your MOSFETs. The top half is called a decoder if you want to get that in a single IC. You can also get the inverters and 4-input AND gates as separate ICs, or you can build those from transistors if that tickles your fancy. Depends how hard you want to make it on yourself. |
H: Using an Opto-Isolator to detect 120VAC on a Microcontroller
I am designing a system where I need to know whether or not 120VAC is present on a specific wire.
The system is in line with a fuel pump system, and I need to check to see whether or not the pump is getting power, if not, make an alert that the Emergency Shutoff Switch has been pushed.
The line could be either 0v (Open), 0A @ 120VAC current (Pump powered but not running), 8A @ 120VAC (Pump powered and running).
I really only need to detect whether or not there is 120VAC present.
I have found multiple sources saying that I could use an OptoIsolator, would this suffice?
And how would one wire it? Is it as simple as 120VAC in, 5v out? Or is there additional circuitry that I require?
AI: A opto-isolator is appropriate, but no, you don't just wire 120 V into one. The input of a opto-isolator is just a LED, or sometimes two LEDs in parallel with opposite polarity. The LED usually emits IR, so drops around 1.2 V and can handle maybe up to a few 10s of mA. The output is usually just a phototransistor that allows current to flow thru it when it receives light from the LED.
Since this power is low frequency, you don't need fast operation and can use relatively little forward current. Let's say 2 mA peak thru the LED is enough. You can easily find optos that have a current transfer ratio (how much current the output transistor can pass divided by how much current you run thru the LED) of 1 or more. That means the output transistor tied between ground and a 10 kΩ pullup will produce a good enough digital signal.
The peak voltage of a 120 V RMS sine wave is 170 V. A 82 kΩ resistor in series with the LED will light it well enough in that case. It should also be rated for at least 200 V. The LED can't handle 170 V in reverse, so you can put a ordinary diode rated for the voltage in series with it, like a 1N4004. That also cuts down on the power dissipation in the resistor since it is only conducting half the time. In this example the resistor only dissipates 90 mW with the diode in series. The limiting factor for the resistor will be its voltage standoff capability.
There are various tricks to reduce power consumption, like using a capacitive voltage divider before the resistor. If 90 mW is OK, then I'd just use the resistor and diode. |
H: How do I choose which version of the IC MT8870 should I use?
I am following this guide to hooking up a phone to a circuit, depending on the DTMF tones. However, when I went to buy one, I realized there were lots of different "editions"/models.
Which one should I choose? Does it really matter in my case? To make this question more useful for future visitors, how did you get your answer?
Datasheet for MT8870
AI: The first page of the datasheet explains the suffix codes except for the "-1".
E is 18-pin PDIP
S is 18-pin SOIC
N is 20-pin SSOP
R is tape/reel, for P+P equipment, otherwise it comes in tubes
Obviously if you want through-hole you pick some sort of DIP.
The "-1" suffix is explained under "Applications" as being appropriate for CEPT signaling rather than BT. |
H: Generating a 10 volt rail from a High Voltage Supply with unknown Ground Potential
I have a sticky situation where my power supply is coming from a charged capacitor with 200 volts across it. Because of the way it was charged, I can't guarantee that the negative side of the cap is at "ground" potential. All I can depend on is that there is a 200 volt difference. It could be that one side of the cap is 10 volts and the other side is -190volts. As a result of this, I'm nervous about trying to mix other control circuitry that uses a different ground potential, so what I want to do is simply use the 200 volt circuit to run the control circuitry.
From what I know all I have to do is use a voltage divider to generate a third voltage leg that has the 10 volt difference I want for my control circuitry. Then I should be able to run IC chips (like NE555) and mosfet gates off the 10 volt difference without any problems. It also shouldn't matter whether I make the 10 volt difference relative to the low side or the high side.
Is all my understanding correct? Are there any problem areas I could run into when trying to divide high voltages to much lower voltages? What if I had an even higher voltage supply such as 1000 volt? Can I still divide it like this to run ICs and mosfets?
Here's a pic to help illustrate:
AI: To supply \$200mA\$ at \$10V\$ from \$200V\$, there must necessarily be \$200mA\$ at \$190V\$ somewhere else, if you are converting the voltage by any linear method (like a voltage divider).
$$ 200mA \cdot 190V = 38W $$
That's a big resistor, transistor, or something, with a big heatsink. Not at all hard, but quite big, and warm.
Probably, you will want a non-linear voltage converter, like a buck converter. This will be much more efficient, and won't need to be big with a large heatsink.
If your control circuitry, and everything connected to it, is connected to only your \$10V\$ output, then it doesn't matter if that \$10V\$ is \$200V - 190V\$ relative to ground, or \$5V - -5V \$ relative to ground. After all, "ground" is just where you stick the "ground" symbol in the schematic, and the electrons can't see that.
But, if you are already using a buck converter, you could get one with an isolated output. Typically, these will use a transformer to couple the power from the input to the output, and the feedback will be done through an optoisolator. Thus, the output of the buck converter is floating, meaning, it has no reference to anything on the input side. You could then, if you wanted, connect your control circuit's ground to some other ground, and not be worried in a voltage difference between these grounds making some large current flow and making smoke.
Even if you don't connect it to something else, that floating output has the nice feature that when someone touches it, maybe accidentally, and that someone also happens to be touching some other potential (say, the Earth, which is connected to a lot of stuff), the output voltage will "float" to their potential, and then there won't be any difference, and they won't be shocked.
It's quite likely that any 200V to 10V buck converter you find will be isolated, for safety. So, perhaps by happy accident, you don't have to do anything special to solve both your problems. |
H: Voltage translation with resistor and LDO explanation
Could someone explain the voltage translation "Magic" that is happening in the circuit in the link below?
Voltage Translation Magic!
The YRPBRL78G13( blue on the left ) is a 5V design and the cc3000 module is a 3.3V design.
I can't understand how the arrangement of LDO and pullup (pulldown?) resistors would achieve voltage translation.
I've tried simulating this, and as far as I can tell this shouldn't work.
All help is appreciated!
AI: Another possibility could be that the pins on J1 that interface with J4 are not really 'outputs'. If its in a tristate/input or if its driven low (yes this is an output), then J4 never sees anything to do with 5V. Its all done via the the 10k pull up and J1 since little current through its pins.
Because J1 is a 5V device, as Ignacio Vazquez-Abrams pointed out, the threshold for a HIGH would be about 2.2V which and since the J5 would ouput 3.3V, its enough. |
H: electric chewing gum prank circuit diagram
I'm new to electronics.
I'm trying to find out how this works out of curiosity.
http://www.amazon.com/gp/aw/d/B0050UNNQS
Does anyone have a circuit diagram for the circuit?
Is the current safe for such a prank?
Internal picture:
EDIT: Merged question from Trever Thompson
Help here would be greatly appreciated:
This question has been asked several times on this site and elsewhere, and it seems as if the posters became satisfied with inaccurate answers.
How on earth do the electric shock prank pens/bubble gum work?
I have no intention of shocking anybody or recreating this circuit, I am simply baffled by how it operates. I have verified that all purported explanations readily available online are inaccurate or incomplete.
The above image shows the only two components in the circuit. I do not know for a fact what the white component is, but I have to assume it is a high value capacitor.
The above image is a literal layout of the circuit. The 50k load is the user's hand. Both switches are closed upon pressing the button. The switch is before the capacitor. This is based on closely observing the circuit and is 100% accurate unless someone can prove otherwise. I tested this with varying capacitance and inductance values and was unable to induce a significant current in the load for more than dozens of miliseconds. When testing I moved the virtual switches from the ground to the positive wire. When I move the switch after the capacitor I can have a long lasting current through the load, but the voltage/current are very low.
Edit: It is beginning to appear as if the white piece (Shown as cap above) is an active component/IC. There may not even be a capacitor in this circuit.
What I know:
The device behaves as follows: When the pen is held and the button is pressed a mildly painful electric shock is felt. After about 3 seconds, the pain gradually decreases until it is not longer felt. Upon releasing and pressing again the full shock is felt once again, even if only released for the slightest moment. The button and grip are the electrodes.
It uses 4 1.5V button cells in series (with high internal resistance)
The shrink wrapped component is a tightly wound step up transformer. The secondary uses extremely thin wire. It apparently is an autotransformer, as it has three leads and is wrapped around one ferrite column.
What I think I know:
I measured the frequency on the primary with a primitive oscilloscope. It was equal to a couple hundred hz, which is reasonable considering the pain of the shock.
If the frequency is ~200hz, the capacitor (if the white component is a cap) would have to be over 100uF non polarized. This may be possible as I have discovered high capacitance low voltage smd caps. The primary inductance would have to be several mH.
The turn ratio would (I believe) have to be at least 1:90. This surprised me because I read that most autotransformrs have a low ratio. I then encountered higher ratio custom ones (which is more reasonable if varying wire gauges are used).
What I want to know:
What the white component is. Is it merely a capacitor? Does it serve other functions?
How on earth does this circuit work. It seems so simple and then again I can't explain or emulate its behavior accurately in a simulator...
Help will be greatly appreciated, as this has kept me occupied for a long time.
AI: Here's a little circuit that might fit the bill
The battery charges the capacitor (C1) through a resistor (R1). When the switch is operated the charge from the capacitor is dumped into the primary of the transformer. This produces a damped oscillation (LC circuit). The transformer secondary has a lot more turns than the primary and so the VOLTAGE part of the short burst of alternating current in the primary will be magnified by the turns ratio. The current part will be diminished. The total energy delivered to the 'shock' can be estimated from the energy store in the capacitor. (0.5 * C *V^2). For the values given = 0.5 * 22 * 10^-6 * 9^2 Joules or 891 micro joules - pretty harmless. The transformer is a small audio output type but others can be used such as the trigger transformer for a flash tube (hacked from a cheap camera) or you could even wind you own on a ferrite ring. |
H: Passive integrator circuit in PSpice
I'm trying to draw a plot of a passive integrator circuit. I think it's not correct as it should look like this:
but mine looks like this (it's Vout/Vin on the right):
I also don't know what voltage source should I choose (Vac/Vsin/Vpulse?) - I used pulse (as I saw it in a tutorial).
AI: The graph on the right showing your voltages is fine but are you aware the graph is Vout divided by Vin. Try displaying just Vout - this should show you exactly what you want to see. |
H: Analogue and Digital Voltage Rail
What's the difference between an Analogue and Digital Voltage Rail?
Why their grounds have to be different?
AI: There is no reason their grounds must be different. However, it is often the case that they are, to reduce noise. Digital circuits, by nature, draw current in surges, each time they switch. These currents flow through the supply rail and also ground.
Usually, "analog circuit" implies somewhere there is a signal relative to ground, and a desire to measure it without a lot of noise. But, if all these current spikes from the digital circuits are flowing in the analog ground, then the voltage at analog ground will change with the current, because the ground has non-zero resistance and inductance (\$E=IR\$). Since all the analog signals are defined relative to this "ground" voltage, if there is noise in the ground, there is noise in the signals.
Example:
simulate this circuit – Schematic created using CircuitLab
\$I_{dig}\$ represents the current drawn from the power supply by the digital circuitry. This will consist of just switching noise. Of course we try to filter this with capacitors across the power supply rails, which reduces the noise significantly, but can't completely eliminate it.
\$V_{sig}\$ is an analog signal we wish to measure. \$V_{measured}\$ is an analog device that measures it.
\$R_1\$ is the resistance of the ground trace.
As this current (\$I_{dig}\$) flows through the ground trace shared with the analog circuitry, a corresponding voltage is created across \$R_1\$ by Ohm's law: \$V_{noise} = I_{dig} \cdot R_1\$. From the perspective of our device measuring the signal, this noise is in series with the signal, and it has no way to separate them.
However, if the digital circuitry were connected to a different ground trace, connected to the analog ground trace at only one point, then the current from the digital circuit (\$I_{dig}\$) couldn't flow through \$R_1\$, and the problem is avoided.
simulate this circuit
Now there is no current in R1, so no voltage, so no noise.
Keep in mind, this logic applies equally to the positive and negative sides (ie, ground) of the supply rails. Current can only flow in a circuit, that is, from the battery, through the component, returning through ground, then back to and through the power supply.
Separating the digital and analog supply rails can prevent currents from the digital circuits flowing in the analog supply rails, but if they share a power supply, the power supply voltage might still have noise added to it, since it is not supplying a constant current. Consider what the circuit looks like with separate supply rails, but conductors that aren't perfect:
simulate this circuit
Again, these aren't actually resistors, but represent the small resistance of the wires, internal resistance of the battery, etc.
Your power supply will always have some small impedance, \$R_{bat}\$, and the supply voltage will change according to the current flowing through the supply. Good analog circuitry will be designed to be insensitive to the power supply voltage for this reason, and if you look in an op-amp datasheet, you will find the PSRR, or power supply rejection ratio, which specifies the extent to which changes in the supply voltage don't affect the output. |
H: Eagle Cad - redefining terminals of a component
I use default BC337 transistor from the eagle-cad's library, terminals are: 1- Emitter, 2 Base, 3 Collector. however, datasheet of the BC337 that I am using defines the terminals differently 1 collector; 2 base; 3 emitter.
how is it possible to redefine the terminals of the component on Eagle Cad 6.0?
AI: Yes, open the library, go to library->device. Find the device. On bottom right hit new, select the package (probably the same package, TO-92) and give it a variant name (like BC337-alt). Go to connect and connect the pins the right way.
When you place the part, you now have the option of the alt or the original version. |
H: Basic question about diode voltage drop and resistor position
I'm new here and also new to electrical engineering so no fancy stuff yet, still tinkering with basic components such as resistor, led, caps and batteries. I think I caught up with the bad side of conventional + and - so I'd like to impose a few question.
I was reading this book "All New Electronics Self-Teaching Guide, 3rd Ed" by Kybett and Boysen to remembers bits what I've learnt so far. On Ch 2 about diode, I stumbled on the idea of the voltage drop in diode. In a series of resistors, it's pretty straight forward, it's a ratio of resistors' value, higher value drops more voltage, etc.
But when a diode is introduced after the resistors, you have to decrease the source voltage with the voltage drop of the diode first before you can measure the new voltage drop of each resistor. Why is this happening? Is it pretty bizarre to count backward first as the current move from + to -.
Also I've seen several examples where a resistor is introduced before anode, which I think is logical and introduced after cathode which is plenty weird as resistor is used to limit the current going into the led but in actual reality, both do just fine(I tried both ways). Is this because of positive charge and negative charge? Because P-N junction, holes and p stuff?
AI: Junction diodes are constructed from a single crystal of semiconductor material that has been altered to form a PN junction.
Semiconductors fall somewhere between the conductors (metallic elements) and non conductors (non metallic elements). Generally speaking pure (intrinsic) semiconductor is an element with 4 electrons in its outer shell and is pretty useless electrically. It is neither a good conductor or a good insulator. The first semiconductors used Germanium. Devices today use Silicon.
The reason semiconductor materials are useful is that we can easily alter their electrical properties (especially conductivity) by adding or DOPING them with (very) small amounts of other elements. These doping atoms fit into the crystal lattice but their different electron structure alters the way electrical current can flow through the material.
Making P type and N type semiconductors.
N type has lots of 'extra' electrons because the dopant had 5 electrons in its outer shell - 1 more than (intrinsic) semiconductor.
Similarly P Type has gaps or HOLES in the outer electron shells because the dopant only as 3 electrons compared to 4 of the (intrinsic) semiconductor.
When the PN junction is made the material in the 'middle' is neither P or N type as all the free charge carriers are swept to one side or the other. This is known as the DEPLETION layer. (a bit like no-man's land between two opposing armies)
This depletion layer is the source of the voltage drop across the diode.
To get current (flow of charge) through the diode the charge has to 'jump over' this barrier (its more technical than that but let's keep it simple). It needs an extra bit of energy to do this.
Now energy is charge x voltage. The value of the charge is fixed - its simply the electronic charge - 1.602 X 10^-19 so the only charges that can cross the barrier must have have energies of more than the barrier. As the charge is fixed and unchangeable we simply talk about the barrier voltage. For Silicon this is about 0.6 volts. For Germanium this is about 0.2 volts.
The barrier acts like a small battery of 0.6V connected in the OPPOSITE direction to the current flow. (Conventional current - positive to negative). You can only measure this when current is flowing through the diode.
Photodiodes can generate actual voltage but that's another matter.
This means that for every diode in the circuit we will lose 0.6V when they are conducting (forward biased). (This increases slightly with current value)
In a series circuit with resistors it does not really matter if the resistor comes before or after the diode. The current passing through resistor and diode is the same. The total voltage drop across the resistor and diode will be the same.
The LIGHT EMITTING DIODE has a much larger voltage drop (about 1.5V - 3.0 V) than a 'normal' diode. It uses this extra energy to output light. |
H: Question about sign
I need to answer this question using PSpice:
It seems it's -15mA, BUT in the exercise, the current source is < (I understand it's + < -)
in Pspice I set it to < as well, but there is - < + in the schema.
Is it 15mA or -15mA?
AI: If the question is "what current thru L?" then the answer is clearly -5mA.
15mA flows thru the combination of 1k5 // (2k+1k) and because 2k+1k is twice 1k5 then two-thirds of the current flows through the 1k5 with the remainder (5mA) flowing through 2k+1k. This current also flows backwards through the inductor (0 ohms) therefore it is -5mA.
The capacitor, the 20V source and the 1k resistor to the left of the current source are totally irrelevent to answering this question.
If the question is something else then I'll delete this answer. |
H: How to trade off connection styes in mixed gnd systems( power gnd and signal gnd)?
I am using a motor driver L6235 from ST:application note.On page 6, it gives me a layout suggestion:
it says that the SIGNAL GND and POWER GND should be connected in a single point: the negative part of C6. I think the reason is that signal and power part should have the same voltage reference and a single port has enough impedance to seperate noises from power GND. Is it reasonable?
And my question is that what if I have three L6235 in one system. They have the same logic supply and power supply.And if I have only one single point for POWER and SIGNAL GND, it will have following drawbacks:
and if I have multi-point connections it will have equal voltage reference, but the impedance between POWER GND and SIGNAL GND will be small. the noise may go to SIGNAL GND.
So, how do i make choices?
AI: Given that you want three motor controllers I have taken the liberty of re-drawing the circuit from ST: -
Note the wire in red from the logic supply going directly to the star point on the right of the circuit. You'll need to ideally do this for controlling three motors from the same MCU.
The diagram you have for the three controllers in parallel is better than the three controllers in series and using the start point ideology is better still. Therefore, with reference to the modified ST circuit, all three motor controllers should be conected at the star point and the MCU also.
To prevent further issues with the motor drive circuit I'd feed MCU control pins to each of them through 1k resistors too. Each motor controller should utilize a local earth plane for local GND connections with this earth plane making one connection into the previously mentioned star point.
This may be regarded as overkill but if you want it to work faultlessly I'd take this route. |
H: What are the things to notice before actually connecting a PWM motor circuit?
I have simulated a PWM motor control circuit in Proteus, now I want to bring it to life and connect a circuit in real world.
Here's my PWM circuit in Proteus:
And the code:
unsigned int duty_50;
void main(){
ADPCFG = 0xFFFF;// initialize AN pins as digital
PORTB = 0x01;
TRISB = 0; // initialize portb as output
duty_50 = PWM1_MC_Init(5000, 0, 0x01, 0); // Pwm_Mc_Init returns 50% of the duty
PWM1_MC_Set_Duty(duty_50, 1);
PWM1_MC_Start();
while(1);
}
In simulation, this circuit works fine,
And I already bought the components I need:
1.dsPIC
2.L293D driver IC
3.DC Motor(Which needs 1.5V and 120 mA)
4.board
I want to use these components and power supply machine to connect these components in real world, but I don't know if there might be problems. Is there something I should pay attention to before connect the real circuit so that I won't make some mistakes and burn some components?
AI: Yes, there are things you should notice. Unfortunately, is boils down to "you should have a complete knowledge of electrical engineering." So instead, I will offer two pieces of advice:
you will necessarily break some things in learning
use a current-limited power supply to reduce the number of things you break
A current-limited power supply is one that supplies as much electrical power as it can, without exceeding limits you set for voltage and current. Usually, the supply operates at the voltage limit you set (say, 5V). When you make a mistake and short out the supply, an ordinary power supply will dump as much current as it can into your circuit to try to maintain a 5V output, thus vaporizing your stuff. A current-limited supply will reduce the output voltage to avoid exceeding the current limit you set, thus your stuff may merely get warm rather than being vaporized, allowing you to clear the fault and try again, without another trip to the store to buy a new microcontroller. |
H: Completing a circuit, how is the necessary voltage determined?
When you have some device, like a TV, why is there a necessary Voltage-or current for that matter. Whenever I see circuits, it always says to find the current from the voltage and resistance given, so presumably with any battery there should be a current. Why do some things require bigger current and bigger voltages? And how would one calculate the voltage required? Furthermore, even with some deemed insufficient Voltage, there would always be a current, so I don't know why a device wouldn't work.
AI: The reasons vary greatly, but I think a good way to summarize them is this: a device does more than simply passively draw current. Often times the actuators and transformers in a device rely on electrostatic phenomena, so in order for it to accomplish a task, a varying range of voltages is required for various devices.
For example, the CRT of a television: the deflection plates use an electric field to deflect the electron beam to a given pixel:
The voltage applied to the vertical and horizontal plates determines the angle of deflection--the greater the voltage, the greater the deflection. So a larger screen would require a higher voltage in order for all the pixels to be reached.
This is just one example, but you get the gist: in most electronic devices the actuators are driven by voltage. Even when they're driven by current, such as with speakers, the signal is usually transmitted throughout the circuit as a voltage.
Another thing to consider is the behavior of transistors. Transistors, which drives all the switches, amplifiers, active filters, and logical elements of a circuit, have a threshold voltage. This is usually fairly small, around 0.7 volts or lower, but if a transistor does not receive at least this voltage on either of its channel terminals, the transistor will essentially be in an "off" state, functionally indistinguishable from a transistor with no voltage applied at all. |
H: Importing Drawings ( DXF ) in Altium
I'm having trouble importing DXF / DWG into Altium.
I followed the procedure outlined in the Altium wiki
File-->Import (selected my dxf) and nothing shows up on my mechanical layer.
I've tried multiple DXF files that I have used in the past.
I'm using Altium Version 13.3.4 (Build 28908)
Any tips or workarounds ?
AI: You are trying to place the DXF drawing on a mechanical layer?
There are two issues here:
One, there are two import commands on the file menu:
You want the top one.
Second, I've seen this issue with scaling errors. You can make your drawing 1000x too large, or 1000x too small very easily, depending on some bizarre vagaries of how your CAD software exported the drawing. Basically, DXF/DWG files don't actually define what the unit they use is. As such, if you export with the unit set to inches, and import with the unit set as mils (the default), your entire drawing will end up squished into a point:
I've also had much better luck with DWG import rather then DXF import, for reasons I don't fully understand. If you can export your drawing as a DWG, you may have more luck. |
H: Preference of NAND & NOR gates
What's so special about NAND & NOR(apart from being universal gates) that most books on digital design try to emphasize design using these gates?
Is it easy to manufacture or something?
AI: NAND and NOR are preferred because they are smaller and use less power in a CMOS process than equivalent AND or OR gates. NAND and NOR gates can be created with 4 transistors, while AND/OR require 6.
An AND/OR gate is laid out in a cell library generally as a NAND/NOR followed by an inverter.
AND Gate (OR is similar) |
H: Sharing the low voltage rail of unknown potentials... How to make Proper Floated Voltages?
I asked a previous question about running circuitry off a high voltage supply with unknown ground potential. The question is here: Generating a 10 volt rail from a High Voltage Supply with unknown Ground Potential
Based on the excellent answers, I realized I may have been making it a bit hard on myself. I have a new question:
Let's assume we have a high voltage source as a large capacitor bank at 200 volts. I have a 12 volt battery I want to use to run an NE555 and a mosfet that is switching the 200 volt circuit.
But let's make it more complicated by assuming I can't guarantee that the 200 volts across the cap is +200 and 0. It might be +100 and -100 (or even +10 and -190), whereas my battery might be +12 and 0 relatively speaking. I need to guarantee that I have 12 volts between the gate and source of mosfet so as to not damage it. The question is: If I simply connect the 12 volt battery right into the circuit, will its low potential automatically match up (Float?) to the low potential on the high voltage circuit, thus guaranteeing a 12 volt difference to between the Gate and Source of the mosfet?
And for a more advanced system: What if the 12 volts isn't even supplied by a battery? What if it's just another capacitor bank?
And for a really complicated system: What if I use the 12 volt and GRND rails from a Switched Mode Power Supply like a homebrew ATX power supply? I tried something like that a long time ago. But I was using rectified power from the 120v 60Hz Mains and filtering it into a capacitor. Then I attempted to share the ground rail with an ATX power supply and I ended up destroying the power supply (smokes and sparks!). I never did find out why, but it might have had something to do with the fact that my SMPS and main circuit voltage were both sharing the mains... thoughts?
AI: But let's make it more complicated by assuming I can't guarantee that the 200 volts across the cap is +200 and 0. It might be +100 and -100 (or even +10 and -190), whereas my battery might be +12 and 0 relatively speaking.
You can pick any node in your circuit you want and declare it to be "ground" for that circuit. So you can pick the more negative terminal of your capacitor and call that ground. Then you know the positive terminal is +200 V (relative to the ground that you defined).
If I simply connect the 12 volt battery right into the circuit, will its low potential automatically match up (Float?) to the low potential on the high voltage circuit, thus guaranteeing a 12 volt difference to between the Gate and Source of the mosfet?
Yes. If you connect a net of an isolated circuit into your circuit, you then make the potential of the two connected wires equal. In this case, you make the voltage of the negative terminal of the 12 V battery 0 V by definition.
And for a more advanced system: What if the 12 volts isn't even supplied by a battery? What if it's just another capacitor bank?
What really matters is Kirchoff's Voltage Law. If you add up all the voltages of the branches around a loop, they must add up to zero. The law doesn't care which node is labelled as ground.
And for a really complicated system: ...
Without a schematic of what you connected, nobody can tell you why that situation caused a problem. |
H: Examples of DRM on embedded systems
I'm tasked with implementing a DRM on an embedded system. The device would have a limited number of times which it can run, after which it would be disabled, until it syncs with a computer with an internet to be allowed to run again.
For inspiration, I would like to know of embedded device that have similar DRM security and the way they implement it. I have found examples, but would like something on the market.
AI: There's a pretty good description on wikipedia about how FairPlay works, the DRM that iTunes previously used. It's a fairly straightforward combination of public key and symmetric key encryption.
The main addition for embedded systems is the use of code protection schemes built into microcontrollers. Basically, you program a bit that prevents you from reading the code back out. In order to change the code you have to erase it completely first. That prevents someone from just substituting their own encryption keys into the code. Also, if you need unique device keys, those usually have to be programmed individually into EEPROM. |
H: How do European to American outlet change frequency?
So for the transforming of voltage, a transformer could get a european outlet from 240 to 120 volts. How do these switch the frequency though, do they have to convert it into DC and then generate a signal back to AC? Or is there an easier way? Or do they just leave it at 50 hertz assuming everything is going to work properly?
AI: Unless the frequency is critical to the operation of the device there is no attempt to change the frequency so all that is needed is a transformer with a 2: 1 ratio. Most devices simply change the AC to DC at a lower voltage. As the two frequencies are quite close there is usually no problem with circuit values. |
H: Understanding short circuits (in Arduino) and identifying electronic devices
I'm a programmer and I recently purchased an Arduino Uno and I've very scared to short circuit it. I've been playing with http://www.falstad.com/circuit/ and have been able to create a few LED sketches and a piezo buzzer circuit.
So far, I've stuck everything behind a 470Ohm resistor. I have two problems.
First, how far can I reduce my resistor but maintain board integrity? Bonus, what should I look for in Falstad's circuit app? Possibly current over a certain threshold?
Second, what are some good ways to identify scavenged supplies so I can build safer circuits? Such as unmarked piezo buzzers, LEDs, and motors.
I've been doing research these past two days and discovered resistance lowers current not voltage. In order to lower voltage I can use a voltage divider
AI: First, how far can I reduce my resistor but maintain board integrity? Bonus, what should I look for in Falstad's circuit app? Possibly current over a certain threshold?
You need to check the maximum (source, sink) current ratings for the pin in question and divide that into the voltage you will be using. That will give you the lowest possible fully safe resistance.
Second, what are some good ways to identify scavenged supplies so I can build safer circuits? Such as unmarked piezo buzzers, LEDs, and motors.
Study them. Find datasheets, catalogs, brochures... anything you can get your hands on. And don't be afraid to plug package markings into a search engine if you can find any. |
H: Is a negative resistor a superconductor that does not require being cooled down to get 0 resistance?
Title explains it, is it possible to create a superconductor using negative resistor oscillator / amplifier? As superconductors are conductors with 0 resistance. Isn't an amplifier a superconductor?
Or is what I am asking for wrong? I just need to learn.
AI: You could, theoretically, make a circuit that acts like it is a superconducting wire (or very close, anyways). This would require active electronics, which would take power, and as such it wouldn't be superconducting from the perspective of efficiency.
You really seem like you need to do a lot more reading. For example, you seem to not understand the difference between an amplifier or a superconductor.
Basically, a superconductor is a conductor with zero resistance. Period. It does not amplify, or really change the energy you put into it in any way.
An Amplifier, on the other hand, is basically a power-controlled (e.g. current or voltage input) power-source (e.g. current or voltage output).
Critically here is that an amplifier requires another power source, from which to derive the additional power it produces (and efficiency losses as well, but let's not go there).
At this point, the question becomes "what do you mean by get a superconductor".
If you mean "can I create a circuit that when measured in certain ways looks like a superconductor", the answer is yes. However, this circuit will require power to function, and internally does not superconduct. It would simply be compensating for the non-superconducting losses introduced by the internal wiring, and would require the commensurate amount of additional power.
If you are actually asking "can I create a room-temperature circuit that will conduct energy without any losses or requirement for external power", the answer is no. If you can demonstrate room-temperature superconductance, it comes with a complementary Nobel Prize! |
H: Does the system COM port baud setting matter for Arduino?
I have a custom arduino board that is basically like any ATMega328P based setup. I'm using the FTDI friend from Adafruit to communicate with it and when the drivers for it are installed you can see in Device Manager (Windows 7 SP1) that the baud rate is set to 9600.
However, in my Arduino sketch, I have the baud rate set to 115200 and I can communicate with it at that speed from a python script.
So, does the setting on the driver properties actually matter?
Main reason I'm trying to figure this out is that this is for a kit that will be sold and I want a setup that will work for anyone with the default driver install. I'm quite happy if it just works by whatever you set in software, but just wanted to be sure that this was the case.
AI: I don't have a good reference for this but when you setup a serial port within Windows using the Win32 SetCommState API (which sets the baud rate among other things) it doesn't show the currently selected baud rate in the device manager. That is a low-level Win32 call that Python, .NET and other platforms will still be using for serial communications.
I believe the traditional reason for having the baud setting within the device driver was just as a default for applications that didn't specify it. An example that comes to mind is when serial printers were more common piping data from a file or a command-line application to a COM port was useful.
While presumably it still functions that way, which you could confirm by typing a command such as copy test.txt com1: after changing the device manager settings, all modern applications I've seen for quite some time tend to explicity set the baud rate and other settings. So in summary I don't think you have anything to worry about, 9600 seems to be the default setting for most serial device drivers but most applications override it anyway as they open the port. |
H: Impedance of differential inputs on AD converters
I'm currently trying to attach a rather fast ADC/DAC-converter chip to an FPGA to receive and transmit RF in the future, but getting the converter to run and attaching a signal generator and an oscilloscope for testing is my main goal right now.
I'm coming from the digital world. I did all kinds of digital circuits and used an AD converter for easy tasks with a microcontroller, but when it comes to analog high speed signals which are differential and sensitive to several factors like impedance and so on, I have basically no idea what I'm doing.
The chip I want to use for this project is the AD9862. It's rather old but they are not very expensive, easy to solder, and they have been used by Ettus Research in several models of their USRPs which I'm using as a reference platform. If you have a suggestion for a better chip, please tell me!
Now the main thing I'm concerned with is the whole analog domain. The AD9862 has 2 differential inputs which can be optionally buffered (which is what I should do, right?) and the datasheet says the input buffer has a constant impedance of 200 Ohm. Now what I want to do is, just take those two AD-channels out to an unbalanced SMA connector with 50 Ohm impedance to connect a signal generator or a radio frontend later. So, I need a Balun for that.
Ettus did that too. They have several daughterboards which you can attach to the baseboard to have different frontends connected to the AD-/DA-Converter. Now, if I look at the BasicRX Daughterboard (was: easiest daughterboard) which does exactly what I want, I see that they are using a Balun called ADT1-1WT. If I look that one up, the datasheet tells me, that it has an impedance of 75 Ohm. Isn't that totally wrong? I thought I need a 50 Ohm unbalanced to 200 Ohm balanced transformer.
Also the input is terminated with a 50 Ohm resistor and the output which goes, directly without any more components except a connector, to the AD (VINP_A/VINN_A and B) is series terminated (right? Or is that a low pass filter with the 10pF capacitor? I read on a mailing list somewhere that the values for a low pass filter are wrong in this schematic BTW) with 50 Ohm. That doesn't match at all with the 200 Ohm input impedance of the AD input. It would be awesome if somebody could explain that to me! For me all of the values are totally off.
Also, what about the traces on a PCB? They also need to have the right impedance to prevent reflections and standing waves. So I need to match them, I guess? So the output of the balun should be differential traces with a differential impedance of 200 Ohm going to the AD input and on the other side of the balun, I need a 50 Ohm trace going to the SMA connector?
If somebody could shed some light on this for me, that would be awesome! These are all things you only seem to learn at university if you take electrical engineering as a major and I took computer science and this is all just an amateurish hobby for me, so I'm kind of lost right now :(
AI: The AD9862 has an input impedance of 200 ohms typical and that is of some interest but not of major importance when it comes to the outside world interfacing. Generally speaking, a chip input impedance of infinity is easier to work with - in this way it can be ignored providing the chip doesn't sit more than a few inches away from the resistor/components that terminate the incoming line.
I say a few inches, but that really does depend on the frequency(ies) you are receiving. Let's say max frequency of interest is 300MHz - it has a wavelength of 1 metre and a rule of thumb says that if your pcb tracking is less than one-tenth of the wavelength then you are not going to have problems feeding 10cm (4 inches) to the chip from the line terminator.
Other folk may say less but it is just a rule of thumb. So the chip PCB tracks being matched to a certain impedance are not that critical either providing the rule of thumb is met. The fact that the chip has an input impedance of 200 ohm slightly helps this - a distributed load termination (instead of a single 50 ohm or 75 ohm termiantor) is allowable too (rule of thumb etc).
Now the balun. Yes it says it is a 75ohm balun but at the end of the day it's a transformer with nothing normally inherently 75ohm or 50 ohm ish about it. It says it is a 1:1 impedance device which means to me that if there is 50 ohms (or 75 ohms) on one side of the transformer, this impedance is reflected to the other side for the normal range of frequencies that it is intended for.
The impedance on the chip side of the balun is 200 ohms (chip) + 50 ohms (R4) + 50ohms (R5) = 300 ohm. Again, this is not going to work as well as an impedance of 75 ohm but it probably won't make a massive deal - it's not optimum but it's very difficult to tell from the balun spec how far off optimum it will be. My guess is that it's not perfect but you probably won't deteriorate signals by more than a couple of dB.
This 300 ohm is reflected onto the primary side of the balun and becomes in parallel with 50 ohms (R3). The net impedance looking in to the circuit is now about 43 ohms. I have to say that clearly this would be nicer if it were closer to 50 ohms BUT, I don't know the impedance of the cable this circuit is intended for. It could be 50 ohms and in which case there will be a tendency for standing waves and reflections up and down the cable but nothing so severe it will kill operations. The cable could be 45 ohms cable (not unheard of).
If you are making a circuit, I'd use a 62 ohm for R3 and the impedance presented at the input would be about 51.4 ohms.
Remember, the most important part of this design is to match the impedance of the cable to prevent serious reflections. It doesn't matter if the matching impedance is distributed between R3, R4, R5 and the chip providing the PCB traces are not excessively long AND the PCB traces needn't be designed to be exactly 50 ohms providing the lengths are short. |
H: pcb etching paper and copper board
I would like manufacture a very simple one layer board to learn how a PCB is manufactured. I prepared the layout of the circuit on Eagle Cad, and am planning to use acid etching method: use iron to transfer the toner to the copper board. I already bought the following items:
Acid: sodium persulfate
Etching paper: Film paper (http://www.farnell.com/datasheets/1640461.pdf)
Board material: FR4 Epoxy Fibreglass (http://www.farnell.com/datasheets/52206.pdf)
I bought these items some months ago, I also prefer to buy stuff from Farnell or ELFA as they are convenient for me for some matters and I don't have local stores that I can shop such equipments.
As I search more about how to implement the etching method, I notice that the etching paper(film) that I have is for UV etching method. But I still wonder if I can use it on my production (iron toner transfer, acid etching, ... and it is the only etching paper available on Farnell)? If it is not the case, I see many paper suggestion (Glossy, Carbon 20, Bond) that puzzles me what to use, some even suggest to use magazine papers.
The second question, "photo resist" is printed on the board material (above) that I have. One side of the board is copper coated. I wonder if I can still use that board on my production process? If it is not the case, what material do I need to use, I see many materials like FR2, FR4, epoxy resin, FR-3, CEM-1/2/3/4, G-10....?
Would you suggest any other materials/equipment I should have apart from etching tray, sand paper, plastic glove, iron, hand-driller?
AI: First, what you call paper isn't paper, it's a type of plastic! There's a possibility that it will melt if you try to transfer it using clothes iron.
Next, the document for the board doesn't mention that it's covered by anything, but if it actually is and you really want to use toner transfer, you'd need to get rid off the cover using developing solution. If you manage to get the real datasheet for the board, you should be able to get recommended solution there. I just use 10 g of NaOH in 1 l of warm water.
You also need to expose the board as well. First a quote from Wikipedia:
Photoresists are classified into two groups: positive resists and
negative resists.
A positive resist is a type of photoresist in which the portion of the photoresist that is exposed to light becomes soluble to the
photoresist developer. The portion of the photoresist that is
unexposed remains insoluble to the photoresist developer.
A negative resist is a type of photoresist in which the portion of the photoresist that is exposed to light becomes insoluble to the
photoresist developer. The unexposed portion of the photoresist is
dissolved by the photoresist developer.
You need to get documentation for your board or try your luck and determine if you need to expose it before developing or not. If you do need to expose it, just leave it in the direct sunlight for a few hours and then drop it in the developer. After it's developer, rinse it in water and the photoresist should be gone.
If the other side is not coated, I don't see a reason why it wouldn't work well for toner transfer.
After that, you need right paper, right clothes iron (or laminator) and right printer. That's why there are so many recommendations! Different combinations of those will provide different results.
I haven't experimented with magazine paper yet, but from my experience the thicker and glossier paper is, easier it will be to transfer the toner from the paper to the PCB. Also you need a good heat source to transfer the toner from the paper to the PCB.
In my experience, if you don't know what you need, go for FR4. Currently it seems to be the "default" PCB material.
Finally, since you said you don't have any resources locally and aren't in a rush, consider ordering a done PCB. It will be probably be cheaper than complete investment of making the PCB yourself. |
H: How can I get more amps from a voltage regulator?
I'm a noob that is just getting started.
I'm using an LM317T to generate 6V but I need a little more amperage. Can I just double my LM317T and resistors configuration and put them in parallel?
simulate this circuit – Schematic created using CircuitLab
Ignore the resistor.
AI: TI's datasheet shows to ways to increase the current output of a 317. The first one is basically what you're suggesting:
Notice the 0.2 Ohm resistors at each output. These allow for differences in the reference voltage between the 317 chips.
The second one uses external transistors instead of paralleling 317's:
This concept can also be done with a single external transistor as shown here: |
H: Purpose of the logic gate configurations on the Kenbak-1
I was just looking through the schematics of the Kenbak-1 computer (long story), and I found this:
simulate this circuit – Schematic created using CircuitLab
I hurt my brain a little bit trying to figure out what that flip-flop does, but mostly why those two NAND gates aren't just inverters... and why the one on the bottom (and the inverter next to it) are even there.
What's the point?
(Note: I haven't had my coffee yet.)
AI: The Flip Flop divides the clock by two, and makes a perfect 50% duty cycle clock.
I think the NANDs are surplus in already available packages on the board, so why not use them if they are fit for the job? They may also function as a fan out buffer (increase output current).
The NOT2 inverter looks like it is an open collector (in contrast to the NAND) type with a pull up resistor.
Unsure why the diode is there.
Part numbers may support this theory. |
H: Simple circuit to give a pulse to a IC pin once?
I have an IC that is activated when pulsing a pin high, the pin should be keep floating after the pulse. The circuit is powered using a battery, and that IC then wake up everything else (Regulator, MCU, etc).
I'm looking for something like this:
Battery -> Pulse to the pin -> IC wakes up -> IC wakes up everything else
I'm trying to guess how to do that in simple terms, I mean without adding even more complexity to the circuit.
I have tried bridging the pin to the + of the battery manually for a moment (< 1 sec) and it works, but only after removing the + from the pin.
So the question is: How do I create a brief pulse using simple components? It is possible?
AI: The difficult bit is keeping the pin 'floating' afterwards. I offer this as a possible solution.
When the circuit is switched on the voltage across C1 cannot change immediately so that the negative terminal is pulled up to the supply voltage (leading edge). R1 gives a path for the capacitor to charge and the voltage across R1 will fall with time. After 1 CR time constant this voltage will be approximately 1/3 of the supply.
Q1 will initially be turned ON but as the capacitor charges the voltage across R1 falls. Q1 will be turned OFF after a short period of time.
The diode is in there for when the power is switched off.
When Q1 is turned ON Q2 is also turned ON as the voltage at its gate will fall near to 0 across R2. This will pull up the RESET pin to the positive rail for the short time period set by C1 R1.
After Q1 (and Q2) are turned OFF there is no connection to the RESET and so the pin will be floating. |
H: How to create high voltage dividers without blowing up resistors
I figured out that it took around 75 volts to light up a neon bulb I had. I want to make a high-voltage meter with a few bulbs specifying certain amount of volts. So as a first test, I just hooked up two 22 mega ohm resistors in series to create a random voltage divider. The divider burned up and the resistors got damaged. How can I create a divider to display different voltages for different neon bulbs and how can I prevent high-ohm resistor damage?
The high-voltage power source that I supplied was a ZVS flyback driver with a 12 volt battery and I estimate the voltage of about 2K.
AI: Use the same technique used to increase the voltage rating of capacitors: put them in series. 1 watt metal film resistors usually have a voltage rating of 350 volts, so do the calculations to cascade as many as you need for the required total resistance value, but so that any given resistor only "sees" a voltage across its terminals that is within its rating.
Also keep in mind that with neon bulbs, the "striking" voltage is usually higher than the "keep alive" voltage, and a minimum current is required to keep the bulb illuminated before it shuts off and the voltage must again be raised above the striking voltage. The voltage divider will need to be designed to provide enough current to the bulb at the keep alive voltage to prevent it from extinguishing, but still allow the voltage to rise high enough to strike the discharge. |
H: Detect logic signal in a long distance. What type of interface to use?
My daughter board uses a comparator(LM339) to output logic 1 or 0 under a 3v3 supply. The cable connecting daughter board and main board is at least 1.5m. Luckily, the frequency is not fast but the environment is full of EMI. So I want to use some technologies to improve accuracy of detection. I search the internet and find some solutions from NI:
line driver, open-collector or push-pull
But I do not know the differences among them when used in this application. And any other solutions? like a differential communication (may be too much for this application). Please give me some suggestions.
AI: For transmission of signals over very long cable runs in EMI-rich environments, the go-to standard in industrial applications is the current loop. As pointed out by @Haneef, Wikipedia also has a page on Digital Current Loops, albeit with hardly any useful details.
The source signal is converted to a regulated current drive, of a specified range, the most common being 4-20mA, and 10-50mA.
As the current in the loop will be constant throughout the loop, this mechanism has high EMI tolerance. The minimum current in the specification (4 or 10 mA in the above cases) also provides a way to detect cable breaks or remote transmitter failure.
There are standard 4-20mA and 10-50mA current loop driver ICs available from many of the major IC manufacturers, that can take analog or digital voltage inputs. These ICs are specified for a variety of signal bandwidths, so one can choose the least expensive one for the cable length, power supply voltage and desired bandwidth, for one's application.
That being said, a 1.5 meter cable run is not really considered a problem even for standard 5V-TTL voltage signals, easily handled by shielded cable, unless the cable passes right next to some truly massive EMI source, such as HVAC equipment, large switching systems, or transmission power line equipment.
For 3 digital signals, the kind of shielded twisted pair cable used for Ethernet, or for shielded USB cables, is commonly available and inexpensive. Each of the digital signals should be applied to one of a twisted pair of cables, with the other wire of the pair in each case being connected to signal ground. This attenuates common mode interference massively, over and above the protection provided by the shield ie conductive braid wrapped around such cables.
See this page for illustrations of types of shielded (and unshielded) twisted pair cables, thus: |
H: Learning how my circuit works (PWM a 5V USB fan)
I'm new at electronics (my new hobby) and got a lot of good responds from you guys so hope you can help me out with this one as well.
I got this an USB fan that I wanted to modulate by controlling it with some PWM.
First I did the following
simulate this circuit – Schematic created using CircuitLab
D5 is the Arduino digital pins outputting the PWM. It gave a lot of noise - so thought that it might have something to do with the capacitor (C1). Just for fun I moved it around and it worked! The LED was not flickering anymore so I added another LED to see the output (like a control).
simulate this circuit
It works and I should be happy (I am :D ) - but I have some questions I hope you can help me with.
Why didn't my first attempt work _____ ? (would it work with a
MOSFET?)
Is the capacitor adjusting my PWM to a linear voltage that
partially opens the transistor _______?
Is the diode (D2 1N4007) placed correctly to protect induction _? (noticed that the swapping the wires of the fan does not change the rotation direction - it just don't rotate..)
Suggestions are very welcome since next step is to put it on a pref-board
AI: I'm thinking that for some reason PWM was faster than your transistor (which means it would behave the same with a FET)... So as you suggest in #2...
From your schematic, there is reason to believe that the capacitor and the LED are just holding the voltage at (VCC - VLED), which just turns on the transistor at the maximum current allowed by your resistor. If you want to be able to control it via PWM, use an RC filter to smoothen out the voltage. In simpler terms, switch the places of the resistor and the LED.
Yes, the diode has been placed correctly to prevent inductive kickback (at least, to the battery), however for full inductive flyback protection, you should move the diode to being across the fan.
Here's an image of what it should look like once you've made all of the changes:
But otherwise, good work! :) |
H: Measuring and Replicating Electrical Codes from heating controller
I'm wondering if the fantastic electronic engineering community can assist with a little project I'm attempting. I have a Rinnai tankless hot water heater that is controlled via a hot water controller (2 wires running to it, low voltage), such as the one shown here. I'm wondering what the best course of action would be to be able to measure the signals being sent from the controller to the heater, and replicate them. For example, I'd like to develop a web interface from which I can control the hot water heater, and when a button is clicked on the interface, a corresponding signal (which I measured previously) will be sent to the heater.
I know it's not a lot of information, but I'm wondering if anyone could point me in the right direction.
AI: Replicating the signals will depend entirely on the method used to encode them so it will make sense to concentrate on that first. As Jim Dearden suggested in a comment it would be worth asking the manufacturer, they might be forthcoming or they might treat it as proprietary and confidential.
Failing that the usual piece of equipment to use would be an oscilloscope and the best choice would be a digital sampling oscilloscope with a reasonable deep capture length so you could capture and record a decent sample of the signals for viewing.
Dedicated / high quality scopes can be expensive but on E-bay a search for "USB oscilloscope" you'll see some ranging from $25 upwards. Some of the cheaper ones only offer up to 3KHz bandwidth which may or may not be fast enough depending on how the signal is encoded, while the data rate is probably low it might be modulated onto a higher speed carrier to get power and data over the same cable. I'd suspect though any of the units that can measure in the MHz range would be more than sufficient.
Another "almost free" option would be to try using the soundcard on your PC as an oscilloscope. I'd probably only recommend doing this using an old laptop or USB soundcard in the event things "end badly". There are several projects for this floating around on the Internet and they might or might not work well enough for this purpose. Here's an example I found:
http://www.ledametrix.com/oscope/
You'd only need to build one channel of that using a pair of resistors for what you're doing. I'd recommend though for a start changing the 82K resistor to a 1M odd because sometimes "low voltage" is used to refer to anything below 50V. If you can see a reading but it's very small maybe try halving the resistor a few times to get a decent range. The two resistors are just forming a voltage divider to get the signal input a reasonable range for the line input on a sound card. There's a simple voltage divider calculator here so you can see how it works:
http://www.electronics2000.co.uk/calc/potential-divider-calculator.php
The sound card may not have a fast enough sampling rate to capture the signal but it may be worth trying for a start. One additional disadvantage to using a soundcard is that you won't know the actual voltage of the signal accurately, but you could for example get a fairly good idea by comparing the readings against what you get from say a fresh 1.5V battery. |
H: Why would the VCC/GND pins of an ATtiny26 not be aligned?
In the following pinout diagram for an ATtiny26 microcontroller, a 20-pin IC:
The VCC/AVCC and GND pins aren't aligned. Surely it would be easier for PCB design to connect these by going straight across rather than having to cross (requiring vias, a second layer, or complex routing).
Why would these pins be switched as so?
AI: One very good reason, as I learned myself from a recent prototype, is reversing the physical layout of the IC in a circuit.
I plugged a through-hole version of this microcontroller into a socket backwards, and spent about an hour with an oscilloscope trying to determine why pins were not behaving as expected.
When I discovered the IC was in backwards (and recovered from the desire to shoot myself), I realized I was thankful that a polarity reversal hadn't rendered the IC useless. With the pins backwards in this arrangement, the chip actually receives VCC and GND correctly in both directions.
In IC's with VCC on pin 1, and GND on the opposite corner, they heat up and generally fail very quickly when inserted backwards. |
H: How can I find an AVR chip with built-in RF transceiver?
I'm going to build a couple of small devices that communicate wirelessly. To simplify construction, I've decided to look for a chip (preferrably on a breakout board) that combines a programmable microcontroller with an RF transceiver module.
I've found the nRF24LU1+, but I'd prefer an AVR microcontroller since I've used those before and know how to program them. How can I search for such chips/board? I've tried search terms such as "avr rf module" and "combined avr rf", but have only managed to find RF modules.
AI: Atmel has dedicated single chip solutions for wireless communication based on the AVR ATmega series.
They also have other architectures (such as ARM), which can be found generally from their MCU Wireless Solutions page.
If you're looking for a 2.4 GHz breakout board (evaluation kit) you might be interested in something like the RZRAVEN.
(Other evaluation kits.) |
H: Does a ground fault compromise the whole circuit?
(this image taken from http://www.allaboutcircuits.com/vol_1/chpt_3/3.html)
Based on this picture, would a tree across the bottom wire of the circuit (the solid wire, not the dashed wire representing earth) cause the person to be electrocuted? Am I correct in thinking the tree would cause a voltage drop?
EDIT: To clarify, what would happen if a resistor was added to the bottom, solid wire?
AI: I assume the neutral wire is still unbroken after the tree is across it, in this case nothing would happen. The tree is already at ground potential, as is the neutral wire, as is the person. If the neutral conductor is broken then there will likely be an introduced earth fault impedance (either tree or person) and the load would see a voltage drop. If the person becomes the lowest impedance to earth then he will likely be zapped. |
H: Error when compiling "Does not name a type"
I want to inherit my own class from LiquidCrystal that creates some custom characters during initialization. Here's the code I've written so far:
MyProject.ino
#include <LiquidCrystal.h>
#include "MyLiquidCrystal.h"
MyLiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup()
{
lcd.begin(16, 2);
lcd.setCursor(0,0);
lcd.print("Welcome");
}
void loop()
{
}
MyLiquidCrystal.h
#include <LiquidCrystal.h>
#include <Arduino.h>
namespace MyProject
{
class MyLiquidCrystal: public LiquidCrystal
{
private:
void createCustomChars()
{
byte smiley[8] = { B00000, B10001, B00000, B00000, B10001, B01110, B00000 };
this.createChar(0, smiley);
}
public:
MyLiquidCrystal(uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3)
: LiquidCrystal(rs, enable, d0, d1, d2, d3)
{
createCustomChars();
}
};
};
I'm getting the following error at line MyLiquidCrystal lcd(8, 9, 4, 5, 6, 7);:
MyProject:5: error: 'MyLiquidCrystal' does not name a type
I've been googling for a while now but couldn't figure out what's going on.
Any help would be appreciated!
AI: Try removing namespace MyProject from the header file. That's not required and means that it's not finding the class located outside the namespace. Alternatively you can use the new namespace prefix in your main project as another answer suggests. |
H: How to add additional I2C sensor module on Arduino
I have tried the GY-521 sensor on Arduino by using the guide from (http://playground.arduino.cc/Main/MPU-6050). It worked well. Can anyone guide me on how can I add another GY-521 module please? I am planning to use a total of four of them connected to my Arduino Uno. How do I define the additional sensor modules in the program?
AI: The GY-521 sensor breakout is an I2C slave device. As long as you can obtain (or configure) the additional sensors as I2C slaves with different slave addresses, they would be controlled the same way as the first one, other than having separate communication initiation for each of the sensors, and then reading the data back from each sensor by its I2C address.
Unfortunately, the MPU-6050, the Motion Processing Unit IC in the GY-521, supports only two I2C slave addresses, so at best you would be able to find (or modify) break-out boards to support these two addresses (by the logic level applied to pin AD0 / pin 9 of the IC). If you actually need more than 2 devices at the same time, look at other similar devices and their corresponding breakout boards.
The physical wiring involves all the modules being connected in parallel on the same pins you have used already to control the first module, also known as an I2C bus. This would only work if only one of the modules has its pull-up resistors enabled. On the schematic for the module, these pull-up resistors are marked R4 and R5, 4.7 kiloOhms each.
On the GY-521 board shown in the link provided in the question, the pull-up resistors appear to be 2.2 k each, as seen below:
The actual board you have would need to be examined, to verify which specific little SMD parts are the pull-up resistors on it: Not too difficult to do, since they are tied to the SDA and SCL header pin pads.
On all but one of the sensor boards, you would need to de-solder those two resistors carefully, without messing with any other parts or other solder junctions on the board. If you are not accustomed to working with SMD components, it might be better to start by practicing on some scrap boards salvaged from condemned printers or other hardware, first.
It is a bit much to ask someone to write the code for you, but there are several Arduino tutorials on communicating with multiple I2C devices sharing a bus. Search on the same site you found the guide for this module. |
H: KVL equivalent versions
How do the first two statements (quoted below) logically correct when the third is viewed as voltage drops are only across resistors and the voltage rises are only across voltage sources? Where is the equivalence between those three versions?
The book says:
KLV has three equivalent versions: at any instant around a loop, in either a clockwise or counterclockwise direction,
The algebraic sum of the voltege drops is zero.
The algebraic sum of the voltege rises is zero.
The algebraic sum of the voltege drops equals the algebraic sum of the voltege rises.
AI: The algebraic sum of the voltage drops is zero.
The algebraic sum of the voltage rises is zero.
For these to work, you need to be considering each branch voltage as a signed value, measure them all in the same direction around the loop (clockwise or anti-clockwise), and sum all of them together.
If you take just the "voltage drops" that are actually drops, it can't possibly sum to zero. The sum of a bunch of positive numbers can never be zero.
These two versions are equal because if the sum of the drops is \$\sum_n{v_n}\$, then the sum of the rises is \$\sum_n{-v_n}\$ and -0 is equal to 0.
The algebraic sum of the voltage drops equals the algebraic sum of the voltage rises.
For this to work, you are splitting up branches according to the sign of the branch voltage and considering the "drops" and "rises" separately.
You have
\$\sum_j{v_j} = -\sum_k{v_k}\$,
where all the vj are positive and all the vk are negative. |
H: Beginner resources device design/assembly
During the summer I would love to get into electrical engineering. As background, I'm a computer scientist and as such, I have a fairly decent grasp of basic circuit design and electricity, which means I don't have to start entirely from scratch. I have however no experience with developing micro circuits or anything of the kind.
As an end-goal I would like to design/assemble ARM powered devices, using existing components. I am however aware that this is not a task for a beginner.
My problem is, that I'm not entirely sure where to start, or to what extend I need to educate myself in electrical engineering to accomplish my end-goal. I could buy a BeagleBoard or an Arduino to practice with, but I'm not sure if that would be of use to me or not.
What should I start learning first with my end-goal in mind and what tools should I obtain to assist me?
AI: An Arduino is a great way to get into the world of embedded devices and systems, which is what I think you are (mostly) referring to. With Arduino, you already have all of the components assembled for you, which is the hardest part, in my opinion. You can then become familiar with the important aspects of embedded devices, such as interrupts, memory-mapped I/O, etc. There are lots of choices, and you can work with a ATMega or ARM core processor, depending on the board you choose. I'd personally recommend beginning with the ATMega, (as comes on the UNO), as you can find lots of information for low-level operations later on.
Once you feel comfortable using the integrated IDE, you can switch to something more advanced, and program using just the barebones (registers, low-level syntax, etc). There are plenty of tutorials showing how to use eclipse IDE with Arduino. It's important to become familiar with the barebones, as most board-level microcontrollers will require you to interface with them in this manner. Many use C, but depending on the compiler and development environment you choose, you can also use C++, assembly, etc.
Finally, when you are ready, you can then move up to your end goal: creating your own embedded system using just the bare microprocessor. This is difficult, as you'll need to set up a lot of the basics that the Arduino already takes care of, such as the hardware clock and serial interface (most Arduinos actually use another ATMega processor to take care of the serial), but once all is said and done, it's very rewarding. |
H: Microchip DIY starting from Verilog
Given the Verilog description of a chip, what are the steps necessary to implement it in hardware and how would a person DIY something like this?
For a specific reference. I was looking at the wikipedia webpage for MMIX that says:
Hardware implementations
As of July 2010, no known hardware implementations of the MMIX instruction set architecture exist. However, the fpgammix project implements MMIX in Verilog, making it possible to implement using a field-programmable gate array.
How can one go from the Verilog of MMIX to the actual hardware using a home setup? (I have no idea what a field-programmable gate array is)
AI: From your description, I'm getting the hint you are looking to physically construct the HW with discrete components from a Verilog description so I'll address this first:
Taking on the task to build your own hardware really isn't a useful or practical task to take on. The reason is because your understanding in microcontroller hardware and architecture won't be that much greater if you can physically construct the hardware or architecture. Also, it would get so tedious in doing even trivial things. Constructing HW physically also has no functional benefit.
Above is an example of a single "NAND" gate constructed physically. I'm showing this as an example. You would need 5 components simply to accomplish the most primitive logic.
If you are interested in building HW, you should make your HW designs through FPGAs (the field programmable gate arrays you mentioned). There are plenty of development boards that hobbyists can interface with. These boards can help you get started in HW design very quickly.
An FPGA is (for sake of simplicity) an "empty" microcontroller, with no architecture or hardware. You design the hardware through some sort of design environment, and the design gets uploaded to the FPGA. This is a great hobbyist style FPGA board that I've personally used:
Mercury Nova FPGA |
H: 8051 interrupt priority level significance
I am working with P89V51RD2 which is a 80C51 micro-controller. It has Eight Interrupt Sources and Four Priority Levels.
In the above table, there is a column Service Priority which sounds like Fixed-Priority interrupt servicing. And then there are two bits for setting priority of individual interrupts(Interrupt Priority) which makes 4 levels.
I couldn't find the explanation for Priority Bits in the datasheet. What exactly is the purpose of these priority bits?
AI: In this MCU the interrupt priority levels allow you to assign each device interrupt source to one of four interrupt priority groups. Devices generating interrupts in a higher priority group are capable of causing an interrupt to occur even if the MCU is already processing an interrupt in a lower priority group.
The Service Priority level within a particular group is used to determine which device will get first chance to interrupt the MCU when more than one device in the same group are asserting an enabled interrupt request at the same time. Interrupts within one group are processed serially in the Service order until all interrupts in that group are completed.
When interrupt processing within a higher priority group is completed then interrupt processing within a lower priority group will be allowed to resume. If new lower priority group interrupts occur while a higher priority group is in process then those have to wait until the higher group is completed. If a lower priority group is in process and interrupts in a higher priority group occur the processing for the lower group is suspended so that the higher priority group can be processed.
Context state for any suspended interrupt is held on the stack for the program counter location similar to the way the program counter for the main line program is held when an interrupt occurs. Any common registers in use, such as A, B or DPTR, need to be also saved to the stack if they are in turn used by the higher priority interrupt service routine. The same would also be true for the R0-R7 registers if a single/shared bank mode is in use for the registers. The 8051 architecture does have four register banks and sometimes certain banks are allocated for interrupt usage at certain priority levels. This can save a lot of extra stack pushes and pops when a high priority interrupt needs to process in a very short period if time.
Highest priority interrupt levels are normally used for extremely time critical service routines where latency needs to be kept to an absolute minimum. Hand in hand with that highest priority interrupts are often those that are coded with the smallest amount of execution time - although this is not always the case. |
H: Physical Wire Size Confusion
I'm going to get this wire for a simple project, and I need to get some heat shrink for it. My problem is that I can't figure out the diameter of the individual insulated wires. There are going to points in the project where the cable is going to be split, and soldered onto LED leads.
The problem is that I can't figure out the diameter of the individual insulated wires. I think it's .145", according to the datasheet.
I think this heatshrink will work, with the wire above, but I want to triple check before I order.
AI: According to this selection guide, you should pick a tubing size which is ~20-30% larger than the thickest diameter object which the heat shrink will cover. Additionally, you want the minimum reduction ID to be smaller than the minimum diameter object so you'll get a snug/tight fit.
I'm assuming this is the tubing datasheet you're interested in: FIT-221B-3/16
I was not able to find the wire in question, but let's assume that your statement about a 0.145" diameter for the wire + insulation was accurate.
The tubing has a minimum expanded diameter of 0.187", which is ~29% larger than the wire (including insulation).
The maximum recovery ID is 0.093", which is more than enough to securely cover the insulated portions of the wire (0.93" < 0.145").
There are still one outstanding questions to answer:
Presumably you actually want to solder the wire to something (in your case, an LED). This means there will be portions of the wire without insulation, and there will be some lead thickness which needs to be taken into account.
Let's take for example this red LED. It has square leads with a maximum side length of 0.525mm, or 0.0207".
Suppose the wire thickness was 8 AWG, 0.145" total thickness (quite thick insulation). Then the cross-sectional profile looks something like this:
Ignoring the solder, the thickness of the wire and the LED lead is:
\begin{equation}
\sqrt{(\frac{0.1285 in.}{2} + 0.0207 in.)^2 + (0.0207 in.)^2} + \frac{0.1285 in.}{2} = 0.1517 in.
\end{equation}
This is still ~23% smaller than the tube expanded ID, so we're good here. Likewise, the minimum recovery ID checks out too because the wire itself is larger. Adding on solder might make it a bit tight of a fit, but it should still fit (just don't glob on too much solder).
Now on the other end of the spectrum, suppose we have a 22 AWG, 0.145" total thickness (quite thin insulation). This time the cross-sectional area looks like:
And the minimum diameter is now 0.046". This time, we will have problems because the reduced heat shrink won't tightly wrap around the section containing the wire and the LED lead. In this case, we would need shrink tubing with a shrinkage ratio of 4:1.
So in conclusion (tl;dr): It might work, but you'll need to know more about the wire dimensions, as well as what you're attaching the wire to. For the 22 AWG case you'll need a much higher shrinkage ratio to tightly wrap the actual joint. For a thicker wire, say 8 AWG the proposed tubing should be fine. There could be other factors as well such as heat shrink tubing material properties, but I doubt for the majority of projects these are a major concern. |
H: Find the RMS value of the periodic triangular current, if Im=1A, T=1s
Find the RMS value of the periodic triangular current, if I_m=1A, T=1s.
Could you tell me step-by-step how to do this? It's not a homework, I just want to find out how to solve this problem.
AI: RMS means "root mean square", in the order root(mean(square(paramter)).
First, square the function. The find the mean: that requires analysis (calculus). To find the mean value of a function \$f(x)\$ on some interval \$[a, b]\$, you integrate the function on that integral: \$\displaystyle\int_a^bf(x)dx\$ and then divide by the interval: \$\displaystyle\frac{1}{b-a}\int_a^bf(x)dx\$.
The waveform you are working with has a lot of symmetry. Basically, you can divide it into up and down ramp segments: each one has the same mean square value. So write the function for just one of the ramps (without loss of generality, the first one that passes through the origin). This is of the form \$y = Ax\$. When you square that you get \$A^2x^2\$. Integrate that from \$x = 0\$ to the value of \$x\$ that produces the peak and do the division to get the mean square value.
After that, the root means square value is just that: the (square) root of the mean square value. |
H: fpga clock strategy
I have a current design where the input clock is 54MHz, but for some part of the design, I can do with a much slower clock.
Is it better design to clock all the "slow" logic (state-machines ect.) with a divided clock?
I was thinking this would achieve lower power consumption, and more relaxed timing constraints, since the period is bigger.
AI: You can create as many clocks as you want, and you can use PLLs or DCMs to create arbitrary clocks. The question is whether you need to, or if you should be doing it a different way.
I find that I end up running as much logic at a common or "core" clock frequency, say the 54MHz that you are using, but I need to trigger certain processes to run periodically. Say a 100ms debounce, a 10kHz PWM update, a 1s timer tick for wall clock, you get the idea. Instead of generating these clocks, I instead run everything at the core clock frequency and generate arbitrary clock enable signals.
You generally don't want to create divided clocks for several reasons. Logic-generated clocks are jittery, the tools may end up routing these "clock" signals along routing paths intended for logic (since they're generated from logic) and as mentioned above and by others, PLLs and DCMs are much better options if you really need to generate a different clock.
Clock gating is what you want. The device primitives have an additional clock enable signal which "gates" the clock signal, allowing to propagate into the primitive or not. When the clock enable is negated, the FF doesn't see the clock and effectively holds its state as if the clock pulse never occurred. When the clock enable signal is asserted the FF sees the clock normally and things proceed as expected. Clock enables are designed specifically to control an FF's access to its clock and as such don't have issues with generating runt clocks. They also don't take up any additional resources, so use them.
e.g. generating a clock in logic. This is bad, don't do this:
process gen_100ms_clk (clk, rst)
variable ctr: integer range 0 to 5399999;
begin
if rst = '1' then
ctr := 0;
out <= '0';
elsif rising_edge(clk) then
if ctr = ctr'high then
out <= not out;
ctr := 0;
else
ctr := ctr + 1;
end if;
end if;
end process gen_100ms_clk;
This code has the out signal toggle state every 100ms; This signal would be a poor choice to use as the clock signal of a new process, such as here:
process do_100ms(out, rst)
begin
if rising_edge(out) then
...
end if;
end process do_100ms;
This is bad because the FFs in the do_100ms() process are using a signal created through the logic in the gen_100ms_clk() process.
Instead, use a clock enable, as shown here:
process gen_100ms_ce (clk, rst)
variable ctr: integer range 0 to 5399999;
begin
if rst = '1' then
ctr := 0;
out <= '0';
elsif rising_edge(clk) then
if ctr = ctr'high then
out <= '1';
ctr := 0;
else
out <= '0';
ctr := ctr + 1;
end if;
end if;
end process gen_100ms_clk;
Now gen_100ms_ce() creates an out signal that is high for 1T every 100ms. This is a great way to signal to your code that it's time to do something:
process do_100ms(clk, rst)
begin
if rising_edge(clk) then
if out = '1' then
...
end if;
end if;
end process do_100ms;
Now your do_100ms() process is running at the same 54MHz clock as everything else and it uses a proper clock enable to trigger whatever you want to happen every 100ms.
Take a look at the RTL output of your toolset; you'll see that the primitive used in your do_100ms() process will use its clock enable signal.
This method also achieves power savings since there will be large swaths of logic that stay "static" for long amounts of time even though the global clock net is wiggling away at 54MHz in your case. Once every 100ms in my example above, all the clocks which are gated with the 100ms enable become active for 1T and then are static again for another 99.9999815ms. :-) CMOS consumes very little power when it's not changing state, so the only power consumption in the logic with the gated-off clock is in the leakage currents of its logic.
You can extend this into a full-out means of power management. You create clock enables for all the subsystems and your power manager negates the clock enable for whichever subsections you dont' want powered. |
H: Why is this MOSFET getting very hot?
I'm using an IRFZ44N power MOSFET to drive a DC motor (24v, 4kgcm, 2A, FLRPM 500.) I found from the datasheet that the IRFZ44N has an ampere rating of 49A and still it is getting very hot.
Here is the schematic:
The IRFZ44N is driven from a PWM of 244 Hz. I found that it only gets hot at low duty cyclex. At higher duty cycles the MOSFET is not heated at all.
What might be the possible reasons?
AI: While I was writing this answer, @Connor posted an answer covering most of it. In any case...
There are a few things that need to be addressed in the presented circuit.
Eliminate C2 entirely: The MOSFET is being used in a switching topology, not for linear amplification, C2 completely subverts the sharp switching desired for minimal power loss. The IRFZ44N needs to be switched as rapidly as possible between fully conducting and fully blocking states, for least power wastage i.e. heat.
The maximum current available to charge the gate at the high-going edge of the gate input (from PWM signal) is limited by R3 = 4.7k ==> Ig < 5.1 mA. This current charges up the substantial gate capacitance at each rising edge for Vgs to rise, and is way too low. This will cause Rds to rise very slowly, and while in this rising part of the graph, the MOSFET will waste a lot of power as heat.
Reduce R3 as far as the optocoupler's collector current rating will allow, or better yet:
Use the optocoupler to drive a BJT or smaller FET with very low gate capacitance as a switch to allow far higher gate charging current to the power MOSFET.
Apply the same rationale to the discharging of the gate capacitance on each falling edge of gate input. For the very high PWM frequencies indicated, a push-pull gate driver, either an integrated device or made of discrete components, is typically used instead of a passive gate drive such as shown.
If the rather high PWM frequency mentioned is not really needed, consider moving to a far lower PWM frequency: 500+ Hertz is often good enough, but 20-30 KHz is typical, so as to be beyond human hearing and therefore PWM noise from the motor. The higher the frequency, the greater the percentage of time the power MOSFET will be in its intermediate transition stage, rather than on or off. Therefore, more heat.
Edit: 244 Hz as updated by OP is much more realistic.
The higher temperature at low duty cycles is again due to capacitor C2: It is being unable to charge up to the gate's switching voltage during the too-brief high pulses of the PWM signal. The Vgs to aim for is not the Vgs(th) of 2 to 4 Volts, but 6+ Volts, where the curve begins to flatten out in Figure 3 of the datasheet. With higher duty cycles, the capacitor does manage to breach the desired Vgs most of the time. |
H: What are the major advantages of using a closed-loop over an open-loop and vice versa?
I'm trying to gain a better understanding on the pros and cons using closed-loop or open-loop motor control. Also trying to better learn when it's more sensible to apply each one
AI: If you understood what those terms meant you wouldn't be asking this, so I'll explain open loop and closed loop.
Open loop means you pick the set point of a system and whatever comes out comes out. No system is perfectly "stiff", so the output will vary somewhat, sometimes quite a lot, depending on load.
Closed loop is when something is actively watching the output and adjusting the set point to whatever it takes to get the desired output.
Think of the gas pedal in your car. From gas pedal to car speed is a open loop system. You can push the pedal down to a fixed spot, and the car will go faster or slower depending on whether it's going up a hill or not and what else it has recently done. Now consider cruise control. That's puts feedback around the open loop gas pedal to car speed system to regulate the speed. It watches the speed and effectively steps harder on the gas when it notices the car slowing down, and lets up on the gas when it goes faster than desired.
The advantage of a closed loop system should now be obvious. You get to control the parameter you really want to control (the car speed in this example), and it automatically gives the system the right input (the gas pedal setting) to achieve the desired result. Of course this comes at the cost of extra stuff and complexity.
Closed loop control systems also need to be designed carefully so that they are stable. For example, if the cruise control always slammed the gas pedal to the max whenever the car was a little below the set speed, and completely let up when a little above, you'd have a very jerky ride and it would put a lot of stress on various parts of the car. Usually there are some tradeoffs the designer can make between the maximum error, the speed of response to changing conditions, and stability. |
H: Can Atmega 32 development board be used to program atmega 8 as well?
I wish to buy a development board thus wish to know if this is possible? I'm a beginner so which development I should use? Any suggestions are welcome.
AI: An AVRISP mkII or equivalent, and ordinary breadboard, some 0.100" headers, and ordinary components (resistors, capacitors, a crystal if you want to run faster or more accurately than the built-in RC oscillator) can program any MCU in the ATmega or ATtiny series. |
H: How to connect ASD bios chip
In my little box full of various electronic components I've found an AMIBIOS chip from 1995. The actual chip data are the following:
Vendor: ASD
Number: AE29F2008-12
Another number: 9846
I want to connect this chip to the Arduino and play with it. I'd like to turn it into permanent memory for some small variables like time or current process step.
Because my search for a datasheet was unsuccessful, I now hope there is some general rule to how 32 pin bios chips are supposed to be connected. Is there any? If not, what are the steps I should take to find out what pin does what?
If you know something about my specific chip, please post in comments.
AI: Apparently it's a Winbond W29C020C. |
H: Designing a Morse code transmit/receive shoe
Thank you for considering my general question, which I assure you is serious!
I want to build -- or have built -- a magnificent shoe that can convert taps (front of the shoe) into Morse code and transmits it (two taps of the heel) to a remote computer to then run a "define: " query in Google. Then, upon automatically receiving the definition translated back into Morse code, receive the code transmitted from the computer to a small vibrating unit inside the shoe, which will play out the definition in a series of Morse code vibrations. The one tap of the heel will be for 'spaces'.
What do you think? Is this achievable if I consult with a physical electrical engineer and a shoe-maker?
(the purpose is for a magic trick that I am working on)
AI: It would take a lot of engineering to make this work properly and effectively, and that won't be cheap, but the basic operation you describe should be achievable. |
H: How does SOLOSHOT work?
Does anyone know how SOLOSHOT works?
I'm interested in exploring cheap ways of tracking an object relative to another object. So my brother sent me a link to this product and I'm having trouble figuring out how it works.
Basically, the user has an arm band and the camera tracks this user.
I have found a few things:
it doesn't work too well when the user covers the armband
it takes about 8 minutes to boot up
it does not need LOS
it works best if viewing from 200 ft away
it works even when traveling 140 mph
My initial guess is GPS and a radio signal to talk to each other which would make sense with the criteria 1-4 listed above (I remember my GPS units needing to find satellites for a couple minutes when booting up), but can GPS really track your position that fast?
More information about what this sensor is: http://soloshot.com/index.php?module=product&action=product_details&pid=87
AI: It's probably differential GPS, although it might just be two independant regular GPS recievers (hence the minimum suggested distance). All of the product photos show it outdoors, another requirement for GPS.
GPS can work at extremely high speeds once it's acquired a good lock; consumer units are not "allowed" to operate at more than 512m/s (about 1800kph) to prevent their use in amateur guided missile systems.
The communication between devices might have an effective speed limit, disguised by using linear prediction, so if you're cornering in a Formula 1 car it might not be entirely reliable. |
H: Device can be powered at 6V or 12V, which is better? Why?
I got this camera and need to power it. Docs say that I can power it both at 6V and 12V, but laconically say also that it should be better to power it at lower voltage, so 6V.
Can anyone explain me why lower voltage is better?
Since I expect that power usage in both cases should be the same, I actually though that 12V should be better, because it needs a lower current. Am I missing something? Any clue?
AI: I suspect there's an internal voltage regulator to regulate it to 5-6 volts. For compatibility, they added this voltage regulator so you can also power it with 6-14V. Internally, it's regulated to a lower voltage.
That would mean the voltage regulator dissipates half of the power in heat when you use 12V, and heat is bad (not only because it's a waste of energy, but also because it might harm other components). Therefore, a lower voltage would be better.
Disclaimer: I only suspect there's a voltage regulator inside, I don't actually know it. |
H: If voltage is measured between two points on a wire, with no resistance in between is the voltage zero?
I have a series circuit. Let's say the battery has a potential difference of 10 Volts.
On two points of the wire before the current hits any resistors, I attach the readers of a voltmeter. Since there is no resistance, and the formula for voltage is V = IR, does this mean that the voltage would read zero in between those two points?
But how can this be - we know there is 10 volts of current flowing through!
The example my teacher gives is that electricity is like a running river. The voltage is the force of the running water. Pile rocks in middle of the river and this is the resistance. But if you don't pile rocks and measure at two points, that doesn't mean that there is no power (read: voltage) in the river's flow.
Can someone please clarify?
AI: You seem to have voltage and current conflated.
Voltage is more properly called electromotive force. It does not, in itself, flow, or transfer energy.
Current (usually measured in amperes) is a measure of how much electric charge is moving per unit of time. Current is also not, in itself, a flow of energy.
The flow of energy is called power. To have power, you need both current (\$I\$) and voltage (\$E\$). The power is equal to the product of the two:
$$ P = IE $$
It helps to think about this in terms of analogous mechanical systems, since we can observe mechanical systems directly with our senses. Mechanical systems also have power, where it is equal to the product of force and velocity:
$$ P = Fv $$
If you have force but no velocity, you have no power. An example would be a rubber band stretched between two stationary supports. The band is exerting a force on the supports. This tension is potential energy. But, nothing is moving, and none of that energy stored in the stretched band is being transfered to anything else.
However, if the band can move the supports, now we have velocity. As the band moves the supports, the energy stored in the stretched band will be converted to kinetic energy in the supports. The rate at which this energy transfer happens is power.
Voltage is a force that moves electric charge. Current is the velocity of electric charge. Resistance is how easy it is to move the supports.
Here's a mechanical system that's more analogous to your circuit:
We have a rigid ring, attached to a motor that applies some force to turn it. Also attached to the ring, we have a brake, which resists the turning of the ring. For this analogy to be proper, this has to be a brake that provides a force proportional to the velocity of the ring moving through it. Imagine it's coupled to a fan, so as the ring turns faster, the fan turns faster, creating more aerodynamic drag.
If the motor is applying a force of \$1kN\$, then the brake must be applying an equal force in the opposite direction. If the brake's force is not equal to the motor's, then the ring will experience a net force that will accelerate or decelerate it until the brake's force is equal, and the ring turns at a constant speed. Thus, if the force of the motor is constant, the speed of the ring is a function of the strength of the brake. This is analogous to Ohm's law.
What other forces are acting on the ring? Since we are considering an idealized system with no friction, there are none. If you were to insert strain gauges at points A and B, you would measure a difference between them. B is being compressed as the motor shoves the ring into the brake against its resistance, and A is being stretched as the motor sucks it out of the brake.
But what's the difference between B and C? there is none. If that's not intuitively obvious, consider that you must cut a gap in the ring and insert your hand so this machine can smash it. Is there a point at which you'd prefer to do this? No, your hand will be equally smashed regardless of where you do it on the left side of the ring.
The forces measured by the strain gauges are analogous to voltage. We can only measure voltages relative to some other voltage. That's why your voltmeter has two probes. Wherever you put the black lead is defined as "0V". So, the scenario you present in your question is like measuring the difference between B and C: it is zero.
This seems a little weird, because we know there is a compressive force on that entire side of the ring. It seems like that should be good for something. But consider this: the weight of all the gas in Earth's atmosphere results in a pressure at sea level of about 15 pounds per square inch. Does this mean we can make a machine that's powered just because it's exposed to this pressure? No. In order to do work with this atmospheric pressure, we need a difference in pressure. Without a difference, we can't make the air move. Consider again the definitions of power above, and it should become clear how this is true. |
H: HDMI standard: Color depth = 1
I have to transmit B&W images (about 30fps) with resolution of 1980x1080 pixels. I would like to use a HDMI link between the generating device and the imaging device (to have standard connexions and signals). Is the HDMI standard specification take into account the B&W? I mean is HDMI able to use a lower frequency transmission rate that take into account this particular signal?
A low frequency rate is required in my application since I have to transmit the signal over a length of 10m to 15m.
Is HDMI standard foreseen such signals?
Regards,
AI: No, there is not a HDMI format defined for black/white images. The video section is compatible with DVI-D. This was specified to replace the analog VGA signals, which had the same bandwidth no matter whether black-and-white or colored (in fact, B/W may be argued to have more high-frequency content :-)
However, I use a 35 foot HDMI cable from my receiver to my TV, and it works; I've seen people do 75 feet by putting a HDMI amplifier in the middle. |
H: How do I (optimally) connect Elk-924 (high sensitivity relay board ) to DSC PGM output (sinks to ground)
This sounds like a very specific question, but I think it boils to a generic one -- not at all specific to this equipment. But it will take a bit of backstory to get there.
My background, btw, is software. Electronics is a new and recent hobby.
First the equipment:
http://www.elkproducts.com/product-catalog/elk-924-sensitive-relay
(Apologies, can't add picture due to insufficient reputation... you'll have to see the PDF.)
This relay board is powered by 12v and is triggered by what they call a 'highly sensitive' input trigger (T- and T+) that requires very little amperage.
• Operating Voltage:12 or 24 Volts D.C.
• Trigger Current: 1.2 mA @ 12 Volts D.C.
• Trigger Voltage: 5 to 24 Volts D.C.
The second is a DSC PC1864 board. This board has an AUX (12v) output along with several "PGM" outputs that basically sinks the terminal to ground under certain programmable conditions.
My primary goal is to close the relay under a certain PGM condition. My secondary goal is to power the relay through the same power source that I'm switching. Why? The DSC board has limited AUX power capacity and there's no reason to power the relay from the board if I don't have to. 60ma is almost 10% of the AUX's capacity, and there are other devices already on there.
The power source I am switching is to a camera, so let's call that CAM. It has its own 12v power transformer, not at all associated with the DSC board.
So this is what I did:
I connected the Elk's POS/NEG terminals to CAM +/-. I also connected CAM + (and camera) to the relays, the camera directly to CAM -.
I then connected the T- terminal to the DSC's PGM terminal. I found the camera stayed on all the time, measured voltages, and quickly realized -- OH -- I'm dealing with relative voltages. The T- isn't isolated from the POS/NEG source. Negative on each board has relative voltages, of course, and not a common ground. (right?)
So I connected the DSC's AUX +/- to the Elk's POS/NEG, and T- to the PGM terminal, and it works perfectly.
Question:
If I still wanted to achieve my secondary goal of not powering the relay from the DSC panel, and only connecting the trigger (T-) to the DSC panel -- how could I accomplish this with minimal fuss? (I mean, obviously I could get another smaller relay powered by DSC's AUX+/PGM-, which closes CAM+/T-, but that's silly.) Is this a job for an opto-isolator?
And how do I properly size the component?
Thank you!
AI: If you want a common ground, you have to connect one. You should be able to power the Elk from the external supply, as long as you also have a connection from the Elk's NEG to the DSC's AUX- or one of its COM terminals. Don't connect both positive supplies to the Elk, just their grounds.
If you have trouble making that work, then you can look at an optoisolator. If you intend to keep the Elk, any opto that can handle the trigger current will do (note the 1.2 mA is a minimum). |
H: XLAMP MK-R by Cree power source
I was wanting to use the MK-R for a project of mine but after consulting the datasheet I burned up my first 10$ LED and wasn't sure why.
I had an LDO providing 11.5V anode to cathode via gator clips. I ran the anode line through my multi-meter and verified it was pushing 450mA before the LED smoked and burned out (stayed lit for about 15 sec).I was trying to disconnect the clips real quick as I saw the smoke it was indeed burning extremely hot. I'm wondering what I am missing here from the data sheet as these LED's should take 1250mA with a Vf of up to 14V and dissipate 15W of power. Am I not understanding something in datasheet correct?
AI: As I see, there are two problems:
Your LED is getting 11.5V @ 0.45A. This means it's consuming ~5W on energy. Part of this energy is converted to light, part of it to heat. What part of the consumed energy goes to light depends on the LED, it's usually 15% ... 25%. The rest of the consumed energy is converted to thermal energy. This thermal energy has to go somewhere. If the LED is mounted on a PCB, the PCB draws the heat away. If it's not the LED melts itself into selfdestruction.
High power LEDs have special pads on the case itself designed to transfer heat away. The datasheet of you LED states: thermal resistance: 1.7°C/W. This is the thermal resistance between the PN junction inside the LED and the thermal pad.This means that per every Watt of energy going through the pad , the temperature difference between the junction and the pad is going to be 1.7°C But the thermal resistance between a pad not connected to anything and the air surrounding it is very high, so the LED and pad quickly heat up, not being able to transfer the heat away. For this pad to be able to draw heat away it needs to be thermally connected to something that has a low thermal resistance between it and the surrounding air. The simplest way to thermally connect a pad is to solder it (since metal conducts heat very well) and the "something" that draws the heat away is usually a PCB. FR4 is not a good heat conductor, so usually the thermal pad is soldered to a polygon, and if that's not enough special aluminium-core PCBs are used.
Here are some articles that go into more detail on this subject: a b c. This wikipedia page also has some good links.
A LED needs to be powered by a current source, not a voltage source.
Each LED is unique, its precise forward voltage changes from device to device, varies with temperature (it usually decreases as the temperature rices, this is why connecting diodes in parallel to increase forward current is useless), and for one LED it may be 11.5V, for another one (of the same type) it may be 11.3V. Again, a LED should be driven with a current source, NOT a voltage source. |
H: Electronic component which produces a clear clicking sound
A surprisingly hard thing to search for as most references are to defects with other components.
Are there any such devices mass produced? or any good alternatives.
I've considered over-driving a relay and short spikes to a piezo but I'd doubt the life-span of the first and dislike the result from the second.
AI: If you're looking for a physical sound, a lot of projects, like this one, use a solenoid. Another option would be a clock or metronome mechanism. Otherwise, you're pretty much stuck with synthesizing or sampling a sound and outputting it through a speaker. |
H: Why do electric companies measure in watts, when they be measuring in joules?
1 Joule is defined as 1 Watt of power working for 1 second.
When the electric bill comes, it says "you've used 5000 Watts, therefore pay us $100".
However, from what I understand, if I turn on a 5000 Watt oven for even three seconds, you can say I used 5000 watts. However, for the purpose of measuring how much energy I used, wouldn't it be more correct to say I used 1500 Joules?
Why then does the electric company measure in watts when really they are charging you based on a combination of the power used and the amount of time you used it for?
AI: No, the electric bill does NOT say "you have used 5000 Watts". Look at it more closely. It says that you used 5000 kiloWatt-hours. A kilowatt-hour is one kiloWatt (1000 Watts) for one hour. That is a measure of energy, and is the same as charging for Joules. One kiloWatt-hour equals 3.6 MJoules. Or put another way, they do charge by the Joule, just that they express it in more relevant units for most homeowners. |
H: What components can an FPGA replace/emulate?
I've been under the impression that FPGAs were merely, well, field-programmable gate arrays, but I've seen some example schematics with resistors, capacitors, and such in them. As such, can an FPGA serve only as a replacement for 7400-series ICs, or also for resistors or other passive components?
AI: FPGAs can replace digital logic as well as (in mixed-signal FPGAs) a few analog components (mostly larger bits like ADCs/DACs, comparators, PLLs, etc.).
The analog/passive equivalent is the FPAA, and there are a few examples already in existence such as Lattice Semiconductor's ispPAC line. |
H: What separates a "good" eye diagram from a "bad" one?
I'm running some USB verification testing at work, and the Agilent oscilloscope I'm working with returns a nice summary of pass/fail statistics along with a pretty eye diagram. Since the pass/fail is indicated within the scope, I don't need to do a ton of analysis on these diagrams.
I've looked at quite a few of these in the past few days and it's made me curious:In general, what separates a"good" eye diagrams from a"bad" one? In a lot of the tests I've run, the device failed, but the eye diagram looked very similar to one that passed.
I can understand a diagram where there are blatant crossings through the eye, but what other factors are taken into account when looking at these diagrams?
AI: The eye you show is firmly in the category of "good" eyes. There's nothing there that should cause an error any more often than once every 100,000 years or so.
Some things to look for:
Are you sending real data while measuring the eye? An idle pattern or similar behavior could create an eye that looks much cleaner than the eye would be with real data.
Is there any external interference that could be causing intermittent degredation in the eye (that wasn't captured in this case)?
For comparison, here's some "bad" eyes, taken from Google image search.
This is a case of substantial random noise:
The lower eye here shows a strong duty cycle distortion:
This eye shows a substantial intersymbol interference (ISI). This eye would probably still achieve 10-9 or better bit error rate (but then it looks like it comes from a noise-free simulation):
The eye on the right here shows ISI with a shape that's characteristic of \$\sqrt{f}\$ attenuation (which typically comes from skin effect loss).
The red eye shows the effect of a reflection in the transmission line:
These eyes show strong jitter effects, maybe caused by a clock-data recovery circuit being made to work beyond its capabilities: |
H: Concerning broken headphone wires
I am planning to fix my broken headphones. They don´t really work in my laptop unless I twist the plug-in wire to a certain position and hold them there. I think it´s just a broken wire somewhere close to the plug-in? I was thinking of cutting the wire close to the plug-in and solder the wires to a new plug-in. Do you think my assumptions are correct? What are the best tools to use for this task?
AI: Its unfortunate that these headphone jacks are all too often designed to fail. If you take the time, you can learn to repair them and even make them stronger than before.
Materials
You will need wire strippers/cutters, a replacement jack with wire slots, electrical tape, a soldering iron and some solder. The replacement connector should be able to unscrew, revealing the wire slots and solder points. They can be purchased very cheap and are much better to use than an old connector that is not made for replacing.
Preparation
Cut the cable near to the faulty jack. Strip the outer sheath about 1/2". There will likely be three colored wires covered in enamel. First, separate the colors and then you will need to remove the enamel. This can be done using a bead of hot solder which will melt the enamel and tin the wire. Or if you have acetone/nail polish remover and mineral spirits those work well too. If none of those works for you, you will have to carefully scrape off the enamel with steel wool or a knife. This is the most tricky part, but if you don't remove the enamel, the headphones won't work perfectly.
Soldering
Next you have to match each color with the tip, ring or sleeve of the headphone jack. For this type of connector, the tip is left channel, ring is right channel and sleeve is common. Generally the red wire is right channel, the blue wire is left channel, and the bare copper one is common. If the stereo orientation is wrong, reverse the red and blue connections.
Reinforcement
After testing the audio and L/R orientation, you may need to reinforce the wire with electrical tape and epoxy. Epoxy can be put over the solder joints so that when the cable is pulled, the tension is put on the epoxy instead of on the soldering joints which could make them weaken and break over time. With electrical tape, the idea is to put it thicker near the connector and taper it off. This way, if you pull the wire sideways, the wire will bend like a fishing rod, distributing the load over a few inches instead of just one point. |
H: AMW ribbon cable
I'm a software developer with a little hobby project involving an embedded system.
I have a debug board hooked up to another printed circuit board. The connection between the two boards is via this little ribbon cable as pictured below and here. If you can't see the picture, the cable is a flat ribbon cable that is about a 1/2 cm wide, 10 pins, and has "AWM 20624 80C 60V VW-1" printed on it.
I started having some trouble with the debug board and observed that a couple of the exposed wires (pins) on the other side of the cable were starting to peel off or were bent back. So I'm searching for a replacement.
Googling for AWM 20624 mainly just yields a lot of E-Bay ads - mostly from Asia. And many have a different number of pin configurations. I was hoping to find the right one locally or by mail order in the US. Perhaps AWM is just a brand name and this type of cable has a more generic name that is more easily orderable.
Suggestions on how to obtain?
AI: Check out Element14. Navigate from all products to "Cable, Wire & Assemblies" then "Cable Assemblies" and then finally "FFC / FPC (Flat Flex)" (http://au.element14.com/ffc-fpc-flat-flex). You can then select 10 connectors and the pitch spacing to 0.5mm and you should find what you need assuming the length is between 50mm to 229mm. |
H: Fastest boot time comparisons between RPi, BeagleBone Black, UlinuXino, etc?
I can find many tables comparing the specs of the latest development platforms like Raspberry Pi, BeagleBone Black, and UlinuXino. However, as all of them run some flavor of Linux, there is going to be some boot time involved before one can launch an application. I have yet to find anyone that compares the boot times of any Linux distro on each of these platforms. Would anyone here be able to point me in the right direction?
AI: I don't know any such comprehensive comparison, but hopefully such boards can be compared. Take a look in the processors, as I could find:
Beaglebone black: AM335x 1GHz ARM® Cortex-A8
Raspberry Pi: ARM1176JZF-S 700 MHz (BCM2835)
Ulinuxino: ARM926J 454Mhz
As a baseline, you can have measures from a model B Raspberry Pi with a class 10 SD card; it takes (always with a minimal networkable SO):
3s to boot Marshmallow Entertainment System (not sure if it is modB nor class10 nor networkable)
~11s to boot ArchlinuxARM
~11s to boot Slitaz
>15s to boot Raspbian (personal experience)
Of course there are overclock possibilities etc. A hint about the application or precise requirements would help. |
H: difference between single double and three phase
If single phase is 230 V and 3 phase is 440 v then what about for 2 phase?
And why is it so?
AI: Here is what wikipedia says about two-phase power.
Two-phase electrical power was an early 20th century polyphase
alternating current electric power distribution system. Two circuits
were used, with voltage phases differing by 90 degrees. Usually
circuits used four wires, two for each phase. Less frequently, three
wires were used, with a common wire with a larger-diameter conductor.
Some early two-phase generators had two complete rotor and field
assemblies, with windings physically offset by 90 electrical degrees
to provide two-phase power. The generators at Niagara Falls installed
in 1895 were the largest generators in the world at the time and were
two-phase machines.
The advantage of two-phase electrical power was that it allowed for
simple, self-starting electric motors. In the early days of electrical
engineering, it was easier to analyze and design two-phase systems
where the phases were completely separated. It was not until the
invention of the method of symmetrical components in 1918 that
polyphase power systems had a convenient mathematical tool for
describing unbalanced load cases. The revolving magnetic field
produced with a two-phase system allowed electric motors to provide
torque from zero motor speed, which was not possible with a
single-phase induction motor (without extra starting means). Induction
motors designed for two-phase operation use the same winding
configuration as capacitor start single-phase motors.
Single phase and 3 phase are unrelated to 2 phase described above. Basically, 3 phase is what the power stations produce now and ultimately this gets distributed as 3 single phases to our homes: -
There are three line voltages shown in red that are 120º apart in phase orientation. This can be seen as three single phase voltages (blue) and if you did the trigonometry you'd see that the length of red is sqrt(3) times bigger than the length of blue hence, if you have 230V phase voltage, the line voltage would be 398V. Here's how the voltages look in time: -
Going back a few years when the UK had 240V, the line voltage was 415V and sometimes 440V line voltages were referred to ans they yielded a phase voltage of 250V. |
H: How can I determine the voltage insulation rating of magnet wire?
As an extension of my previous inquiry into air-core chokes, I'm trying to determine the voltage insulation rating of magnet wire, without much luck. Few of the audio air-core choke manufacturers list that data, and none of the magnet wire manufacturers I've checked give it either. For example, this company lists the type of insulation used, and its thermal properties, but nothing about its voltage withstand ratings. This appears to be common practice. I see references to insulation grades (1, 2, or 3), which seem to be how many insulation layers are present on the wire, but I still haven't found any voltage rating for those grades.
How can I be sure that the insulation on magnet wire will not break down under a given voltage? Am I not looking in the right place for this rating? Am I looking at the wrong kind of magnet wire for high-voltage applications? Are we required to build chokes such that consecutive windings of magnet wire are close enough in voltage that the insulation rating of the wire doesn't matter?
AI: Quoting from the great Wiki
"Like other wire, magnet wire is classified by diameter (AWG number or SWG) or area (square millimetres), temperature class, and insulation class.
Breakdown voltage depends on the thickness of the covering, which can be of 3 types: Grade 1, Grade 2 and Grade 3. Higher grades have thicker insulation and thus higher breakdown voltages.
The temperature class indicates the temperature of the wire where it has a 20,000 hour service life. At lower temperatures the service life of the wire is longer (about a factor 2 for every 10 °C lower temperature). Common temperature classes are 105° C, 130° C, 155° C, 180° C and 220° C."
Calculation of breakdown voltage (Test acc. To IEC 60851.5.4.2, cylinder)
The breakdown voltage depends mainly on the thickness of the insulation (see formula below), but also on the bare wire diameter, the application temperature of the coil and the type of enamel.
Calculation of average values Ds:
Ds = t x Vμ [Volt], with
Ds : breakdown voltage
T : increase due to insulation,
t = da – dnom, : wire diameters with and without insulation
Vμm = volts per micron insulation (dependent on type of insulation)
Example:
Test with cylindrical electrode (round wire)
dnom 0.071mm (bare wire nominal diameter)
da = 0.083mm (wire with coating)
t = da – dnom = 0.083 – 0.071 = 0.012mm = 12μm (thickness of insulation between wires)
Vμ = 205 V/μm, therefore
Ds = 12μ x 205 V/μ = 2,460 V |
H: Differences, uses, and theory of volatile and nonvolatile memory?
I understand the basics of volatile and nonvolatile memory. Volatile memory requires a constant power supply to retain data whereas non-volatile memory does not require a constant power supply to retain data. What I would like to know is this: are there any other major differences in terms of performance, speed, size etc? In addition, what uses do each play in a computer? Lastly, how does each work? Thanks in advance for all answers and comments.
AI: Yes, you understand the definition of volatile and non-volatile memory. From that alone you'd think non-volatile is always better. However, in the real world that is not true since the different technologies for making these memories cause other attributes to appear beyond volatileness.
Tradeoffs that various different memory technologies force on us include:
Read speed.
Write speed.
Cost.
Size.
Power consuption when idle, reading, and writing.
Operating lifetime.
Number of lifetime reads or writes.
and that's just what came to mind quickly. Obviously, the ideal memory is fast to read, fast to write, costs little, is small, takes little power, lasts a long time, and can be used many times. There is no one technology that does a good job in all these areas together. Volatileness is just one more entry in the list of parameters to consider.
In something like a microcontroller intended to be embedded into a circuit that needs to turn on quickly, having the main program memory be non-volatile is imortant. That today generally means it will be slow to write, have a finite number of lifetime writes, and will forget its content after a few 10s of years. Obviously we'd like to not have these drawbacks, but nobody knows how to make a memory that doesn't have them for the size and cost required in a micro.
The data memory in a micro could be arbitrarily written and read in a loop millions of times in seconds, possibly going on for years, so a technology that doesn't have a finite number of lifetime reads or writes is important. To get that, we give up the ability to retain the values when power is removed.
There are all kinds of memory technologies that optimize some of these parameter, inevitably at the expense of others. Some common technologies:
CMOS static RAM. These are really logic circuits optimized to hold bits. They are fast, have effectively infinite lifetime reads and writes, take little power when not being accessed, and have a long operating lifetime. On the other hand, this memory is volatile, and the cells are relatively large, which makes them expensive with high densities not attainable.
EEPROM. Actually that's not strictly speaking a technology, but today (this could easily change) these memories are commonly implemented with floating gate MOSFETs. Their main attribute is that they are non-volatile. Density is high, so cost is low, but they get physically worn out a little bit every time the charge on the gate is changed, which is what writing or erasing does. |
H: balun transformer design
The schematic shows a balun (unbalanced i/p to balanced output).In the design one condition is input impedance must be equal to output impedance since its 1:1 transformer and it has to follow impedance and turns ratio theory. My query is, on the output side if I have 50 ohm trace impedance instead of 25 ohm, what will be the effect. Is it going to further reduce my output power?
What else can be the effect if the impedance (i/p and o/p) is not matched for 1:1 transformer?
simulate this circuit – Schematic created using CircuitLab
AI: If the transformer is ideal, then the problem will be the same as if you attached any \$50\Omega\$ source to a \$25\Omega\$ load. The transformer is not relevant. That is, a portion of any power arriving at the transformer from either direction will be reflected. This could be power generated by your source, or power reflected by your load.
Note that the power reflection, in itself, doesn't reduce your output power. The reflected power will bounce around until it finds a place to go, either radiated as EM energy, or converted to heat by resistive components. However, your voltage source might not like it very much, depending on what it is. The reflected power might result in voltages outside of its specifications, or if it operates on feedback, it may become unstable. The ideal voltage source in your schematic, however, won't care.
If the transformer isn't ideal, then you are introducing additional impedances into the circuit. The windings of the transformer have some capacitance. There is some magnetic flux not shared by the primary and secondary which appears as a series inductor. And of course, the windings have some resistance. The extent to which these are significant depend on many parameters, like the construction of the transformer and the operating frequency.
If you can't alter your source or load to match, then you could use a transformer with a turns ratio of:
$$ T = \sqrt{\frac{R_S}{R_L}} = \sqrt{\frac{50\Omega}{25\Omega}} = \sqrt{2} \approx 1.4 $$
Another possibility is an L-section of a capacitor and inductor to achieve a narrow-band match, just as you would if the transformer were not there. |
H: Why are smartphones and tablets ARM based?
Why don't these devices use Intel processors like laptops do? Why are they restricted to ARM?
Also for Windows 8, do they want ARM just for tablets and smartphones or is it also for laptops/desktops (is that even possible)?
AI: Today ARM processors have a big advantage in mobile devices: they need less energy in order to work. This is very important in smartphones and tablets because the technology of the batteries is always the same and so if you want to increase the autonomy of these devices you need components that use less power. For now, Intel is some steps behind in power usage, so manufacturers prefer to use ARM CPUs in mobile devices. This is mainly due to the retrocompatibility of the x86 architecture that Intel is forced to maintain. This involves a higher number of transistors and the more transistors, the more power needed. Intel is investing a lot in this sector and today some devices are starting to use its processor (Motorola RAZR i, Samsung Galaxy Tab 3 10.1).
For now Intel processors have better performance and so are preferred in laptops and desktops to ARM. ARM is growing fast and I think that in the future its processors will also be used in laptops (that have more benefits than desktops in reduced power consumption) and finally in desktops.
For now Intel wins in performance and ARM wins in consumption but they are working hard to reduce their gaps. Intel also has the best manufacturing process in the world and this is a great advantage that allows to them to reduce the gap from ARM in power consumption. |
H: What are the functional differences between monolithic and disc ceramic capacitors?
I've inherited an older part numbering scheme, in which ceramic capacitors are divided into disc and monolithic types. Is this actually a firm division in their characteristics? If so, what are the differences? Is that nomenclature common, or are other names used more often? Are there other classifications of ceramic capacitors in addition to those two?
Edit: If I have two capacitors, a monolithic and a disc, of equal voltage and capacitance, why would I use one over the other?
AI: If by monolithic, you mean the multi-layer chip caps (sometimes labled MLCC), that's what all the high density ceramic caps are.
The traditional disc caps are basically just a slab of ceramic with plate on each side, radial leads attached, and dipped in epoxy or maybe ceramic for coating. These are low capacitance devices (100 or so pF) but can be very high voltage. Sometimes they are also called safety caps.
Also, there are disc or cylindrical shaped caps that are really MLCC structures with an electrode around the outside edge and the other electrode in the middle. These are used as feed through caps in housings of EMI filters, or maybe even as part of a transmission line termination.
Wikipedia has a pretty good write-up of capacitors here.
Edit:
The question of the disk cap and MLCC having the same voltage rating and capacitance and having to choose between the two occupies a very small space in the Venn diagram. MLCCs were derived from disc technology to overcome limitations in capacitance and allow wider use of ceramic dielectrics which are comparatively easy to fab. The main things the disk has going for it are the high voltages and rugged construction. A single wafer of ceramic is going to take more abuse than a stack of thin layers of ceramic. The choice would come down to things like that.
If you needed a rugged part, or a part that could not be surface mounted you would choose the disc (I know you can get leaded multilayer ceramics, but its a disappearing market). If you needed a part with low ESL and more compact size you would choose the MLCC. It's pretty clear which is usually more desirable.
The uses for disc type caps really are those for which it has an advantage, like high voltages from 3kV to 6kV where you might need a low dissipation coefficient or NPO type stability. MLCCs don't offer much competition at those higher voltages. |
H: Understanding AND logic gate
I drew an AND gate as follows which mimics this diagram:
(source)
I understand how current flows between A and B(when both inputs are logical 1) because there is difference of voltage, maybe 6V, and AFAIK A and B are possibly connected making a circular circuit(at least via earth).
But I don't understand how current can flow from some signal sources to two transistors to manipulate transistors. There seems no difference of voltage regarding i1 and i2. I want to know the entire circuit diagram including the signal sources.
PS. Are there 3 separate circuits containing i1, i2, A-B, respectively?
AI: You mention:
But I don't understand how current can flow from some signal sources to two transistors to manipulate transistors. There seems no difference of voltage regarding i1 and i2. I want to know the entire circuit diagram including the signal sources.
So, if I understand correctly, you are confused as to how the inputs to the base of the transistors work. I will answer this.
The connection to the base of the transistors are left ambiguous because there are different applications possible to activate each transistor. For instance, you could use manual switches connected to a voltage source or a micro-controller to control the base pins. They are also left ambiguous so the focus is left to the logic of the circuit, and not how it is set up.
However, you were curious as to how such a circuit could be created, so I drew a very primitive example (I assumed you have npn transistors).
simulate this circuit – Schematic created using CircuitLab
This could also be done with a micro-controller as I've mentioned before. You forgot to add R1 in your diagram that you drew, which is very important because otherwise, Vout will be fixed to GND.
When both switches are logic: '1', current flows through R1 and creates a voltage at the R1 node. When either switch is open, the respective transistor becomes inactive. No current will then flow through R1. When no current flows through R1, the voltage drop over the resistor is zero, therefore the voltage at the Vout node is zero.
I hope this helps, however, I'm unsure what you mean by are there 3 separate circuits for i1, i2 and A-B. |
H: How can I electronically measure tilt/compression of a pliers or alligator-clip?
I would like to electronically measure the width (really the compression/extension) to which an object's constituent blades have been stretched. Or alternatively, I could measure some other parameter which I can then map to the displacement by data calibration.
In particular, I am dealing with a miniature tool (a few cm long) whose outline resembles an alligator-clip (or pliers). So consider something like either of the objects in the below image.
How can I electronically track/measure the below spacing to a resolution of about 0.1 mm over a full-scale extent of ~10 mm?
I cannot think of any transducer or phenomenon that I could map to this movement and get such fine resolution. For example:
Perhaps I can measure parallel-plate capacitance -- would that be accurate enough in this scenario?
Or maybe I could place a spring between the two jaws and measure the compression -- but how would I measure the compression of the spring?
CV isn't a viable option because I wish to make the sensor compact enough that that I can log the data wherever I wish.
EDIT: Updated with illustration added based on @Michael Karas's Answer and @Matt Young's suggestion.
AI: I think you want to look into small strain guages. Strain guages are a resistive element that changes resistance in relation to very small changes in the longitudinal stress introduced into the senesor element. These are generally made of a thing plastic type carrier material with loops of resistive material printed upon it. Generally a sensor is comprised of two resistive elements in series like a voltage divider. These are then wired into a bridge circuit that is monitored via an instrumentation amplifier.
The sensors often are made up with a stick on glue to attach them to substrate. In the case of something like your allegator clip you could use two sensors just attached along the outside length of the allegator clip assembly. |
H: Amperage in a USB AC-to-DC power converter
so it was my understanding that USB was standardized with 5 volts (V) at 1 Amperage (A), but I've seen wall adaptors with 5V and different Amperage including 1A, 1.1A, 1.5A, 2A, 2.1A, and as much as 3.3A before. Some of them had extra USB ports, but not all of them did. Does the higher Amperage increase charge speed? And if so, is there a standard tolerance of devices which charge via USB? For example, is 5V@2.1A "OK" for charging most tablets or phones, but >3.0A@5V could cause damage?
In addition, if Amperage is set by Voltage and Load, don't many computers pull more depending on what is being done? I don't mean just Null-Operations (NOP) versus addressing, but whole sections of the machine might not be on / on stand-by if not needed. Would this mean the wall adaptor is rated by an average, not what it actually puts out?
AI: Some USB devices can use more current to charge more quickly.
Some USB devices require more current than the USB 2.0 standard provides.
The standard USB 2.0 current is 0.5 A.
You won't damage your device with excess current; it will only provide as much current as the device will draw. See this question for more detail |
H: Pulling power off a battery stack at different voltages
If I'm powering a device with a series-connected stack of rechargeable batteries, can I pull different voltages at different points and route them to different components? I need to run a 12V solenoid, an Arduino (6V-12V recommended), some stepper motors (around 5 or 6V), and possibly a servo (though that can probably come straight off the Arduino).
If I have, for example, four 3V cells, can I grab 6V from two of them and 12V from all four at the same time, or will that do bad things to the cells' relative charge? Space and complexity are constraints here, so adding a regulator might be possible but would make things more complicated.
Alternatively, would using higher-capacity cells adding up to 6V and a boost converter to get the 12V work? I'd be concerned about current, but my fears might be baseless.
AI: Your scheme of tapping off the batteries at different points will work. However nothing is for free. The batteries used in both the 6V circuit (let's call them Bat1) and the 12V circuit (call them Bat2) will see more power drain than the two used for just the 12V circuit.
The problem arises when you want to recharge them in series. Bat2 which will have more energy than Bat1 will raise the voltage of Bat1 + Bat2 faster than normal. Often this causes the charger to back off the current, which ends up leaving Bat1 undercharged. They cycle can worsen over multiple uses leaving Bat1 either undercharged or overcharging Bat2.
This is why most electronics derive the power they need from the batteries keeping the charge and discharge paths identical.
You could choose either to boost the 6V or regulate the 12V. Typically the decision is made by which circuit needs the most power delivered to it. In your example if the motors take 2x more current than the rest of the design, then it would make sense to optimize the delivery of the supply to the motors. If everything is about equal, then it comes down to looking at the cost/efficiency of linear regulation (less EMI and simpler) versus boosting it (noisier and more components). |
H: Interface-like definition in Arduino?
I'm writing a new Arduino project that uses an 16x2 LCD Crystal Display with a KeyShield. I would like to construct a menu structure in which the user can navigate using the buttons.
I'm new to Arduino but I do have 5 yrs experience in C#. What I would like to do is the following:
Define an interface called Screen and inherit each Screen from it such as LanguageScreen, TurnOffAfterScreen, MainScreen, etc. Each specialized Screen implements a method called drawScreen that will take care of the screen content.
Now I would like to have a class named ScreenController that handles the navigation between the Screens. In this class I'd like to store the screens in an array Screen screens[3].
When user presses the Select button on the KeyShield the Controller would call the next Screen's drawScreen method something like this:
void showNextScreen()
{
currentScreen++;
screens[currentScreen]->drawScreen();
}
Is this possible to do in an Arduino project? Am I expecting too much? :)
AI: class Screen {
public:
virtual void drawScreen() = 0; // Needs to be implemented by each subclass
virtual ~Screen() {} // Destructor
};
class LanguageScreen : public Screen {
public:
virtual void drawScreen();
};
class MainScreen : public Screen {
public:
virtual void drawScreen();
};
void LanguageScreen::drawScreen() {
// Draw language screen
}
void MainScreen::drawScreen() {
// Draw main screen
}
MainScreen mainScreen;
LanguageScreen languageScreen;
Screen *const screens[2] = {&mainScreen, &languageScreen};
int currenScreen = 0; |
H: Scopes and probes
I have a descent set of probes that are rated at 100MHz, overkill for my current scope, only rated at 15MHz, but I am looking at a couple of different options for used scopes right now, some rated as high as 400 MHz. Unfortunately, most of these don't come with probes, and if they do there is only 1 (For a 4 channel scope). As long as I am looking at a signal that has fewer than 100MHz, would it be an issue to use the lower rated probes with a scope that can easily support more than that?
When you exceed the rating of your probe what happens? Do you just loose definition on your signal?
AI: It is safe to use a probe with less bandwidth than your oscilloscope. The probe acts like a lowpass filter so if you do use it to display a signal with greater bandwidth than the probe, the signal display will be degraded; e.g. a square wave will begin to look like more like a sine wave depending on the difference between the signal frequency and the probe bandwidth. Also, a low bandwidth probe may have more capacitance than a high bandwidth scope is designed for. That will make it difficult to compensate the probe and will also degrade the display. Unfortunately, probes rated to work with oscilloscopes having bandwidths on the order of 400 MHz can be rather expensive. However,it may pay to get one probe that can make full use of your oscilloscope's bandwidth and settle for less on the other probes. That will depend on the types of signals that you will be observing. |
H: Thermistor temperature dispersion
I am designing a thermistor circuit to determine if a nozzle is becoming plugged or flowing freely. My idea is to use a low resistance thermistor and resistor to form a voltage divider that when powered would become hot, and immerse that into the stream of water. The water flowing by with the nozzle unplugged would keep the thermistor cooled to a certain temperature and when the nozzle started to become plugged the flow past the thermistor would decrease and allow the temperature to rise.
I am looking into designing the circuit and buying all of the parts but I have absolutely no heat transfer experience and don't know how sensitive the circuit needs to be. To have a low enough resistance so the circuit actually heats up I am planning on using a 33 ohm bias resistor and a 33 ohm thermistor.
So my question is how do I calculate what voltage I would need to feed into the voltage divider to heat the circuit up to say 100 degrees C, and how do I calculate say how much heat there would be dissipated if the thermistor at 100 degrees C was immersed into a 3/8" diameter PVC pipe with a flow of .5gpm?
AI: It is going to be difficult to calculate the voltage/wattage necessary for this. I suppose it could be done, but why not do it by the "seat of your pants"?
My unscientific opinion says you would need on the order of 100+watts to raise the temperature to 100C at any miniscule water flow, and you probably won't find a thermistor rated anywhere close.
I propose to adjust your method as follows. Use two thermistors, one set up with very low self heating as a reference (placed upstream), and one similar to what you propose with 33 ohms, which at 10V would equal 0.75W, which should be enough self heating to do what you want. Be sure to calculate all temp ranges (including accidental open air possibility)so you don't go over the watt rating of your chosen thermistor.
You may be better off using a PTC for this application, it could self limit current. |
H: In a USB cable, is it OK to swap the D+ and D- wires?
I heard that D+ and D- are differential signals, does it matter if I swap them when connecting a USB device to the computer?
AI: Summary
When entering and exiting the idle state, the polarity is important and swapping the D+ and D- lines will cause problems.
Data Transmission
USB data is NRZ-coded such that "One" is represented by no change in physical level, and "Zero" is represented by a change in physical level (see figure below). Therefore, inverting the signal (for example, by swapping D+ and D-) results in no functional change during data transmission. But there may be problems before and after data transmission which can kill communication with the device.
Exiting Idle State
The host includes 15 kΩ pull-down resistors on each data line. When no
device is connected, this pulls both data lines low into the so-called
"single-ended zero" state (SE0 in the USB documentation), and
indicates a reset or disconnected connection. A USB device pulls one
of the data lines high with a 1.5 kΩ resistor. This overpowers one of
the pull-down resistors in the host and leaves the data lines in an
idle state called "J". For USB 1.x, the choice of data line indicates
of what signal rates the device is capable; full-bandwidth devices
pull D+ high, while low-bandwidth devices pull D− high.
While the data is NRZI-encoded, the synchronization sequence and EoP are defined in terms of fixed states (J/K/SE0). When D+ and D- are switched, the J state is switched with K and SE0 is still SE0 (both lines low). So the sync sequence and EoP will become incorrect on inversion. In USB 1.x, if D+ and D- are swapped, a full-bandwidth devices get recognized as low-bandwidth and vice-versa. So the device will not even communicate at the same speed as the host.
Entering Idle State
A USB packet's end, called EOP (end-of-packet), is indicated by the
transmitter driving 2 bit times of SE0 (D+ and D− both below max) and
1 bit time of J state. After this, the transmitter ceases to drive the
D+/D− lines and the aforementioned pull up resistors hold it in the J
(idle) state.
With a D+/D- swapped driver, the host will see the sequence (SE0, SE0, K) instead of the correct (SE0, SE0, J). The host might then fail to recognize the end of packet, which would cause problems.
Conclusion
If the device and host adhere strictly to USB specifications, swapping the D+ and D- pins will result in a failure. Its conceivable that the designer of the host foresaw such a failure mode, and built in compatibility for it. But whether or not such a swapped cable would be functional in practice, it certainly would not adhere to the specifications.
Another member, Andrew Kohlsmith, experienced this when the pins of a USB hub were accidentally swapped. The problem manifested itself as connected devices not showing up. The USB device would show it was powered but it was not recognized at all by the computer on the upstream side of the hub (which was wired correctly to the host).
Source: wikipedia
Edit: thank you to those who commented. I added emphasis and details from your helpful notes. |
H: How do I pick the right resistor for an optoisolator given a desired current?
This is a follow up to this question, but isn't specific to the other one. This is both an ohm's law question and a 'how does one interpret data sheets' question.
I want to minimize the current I use to hold open a relay via a trigger (which only requires 1.2mA) that I need to isolate. If I use, say, an NTE3083 optoisolator to trigger this relay, how do I pick the proper resistor for the optoisolator's input? The datasheet says the NTE3083 will trigger as low as 1mA.
But the datasheet doesn't give a definitive forward voltage. It gives a 60mA forward current, and then has a table that also mentions 1.15V-1.5V and 20mA as part of its characteristics.
If my source voltage is 12V, and I want, say, 2mA to be conservative, how do I get there from here?
Do I just drop the voltage and current (R of the optoisolator would be constant?) by scaling down current and voltage? So if I want 2mA, divide by 10: 20mA/10 and 1.15V (or 1.5??)/10? And then calculate the resistor?
((12 volts) - (.1 volts)) / (2 milliamperes) = 5950 ohms
Is that the right approach?
AI: the datasheet doesn't give a definitive forward voltage
It does: The 1.15 Volts typical, 1.5 Volts maximum specified at 20 mA is the LED's forward voltage specification: It never is a precise voltage, LED voltages can vary greatly between units even within a single batch.
For calculating resistance for minimum current, in the absence of input Vf versus current graphs in the datasheet, use the minimum forward voltage rating for calculations: Vf falls with decreasing current through the LED, but not linearly as the question indicates.
So, for 1 mA: (12 - 1.15) / 0.001 = 10.85 kOhms, use a standard value resistor of 10k.
Note that even if one uses the maximum Vf from the datahsheet, the results are 10.5k, not much difference.
Note:
With the CTR of the device specified as 200% minimum, 400% typical, a 1 mA input current would allow a nominal 2-4 mA of Collector Current to flow at the output if there were no other current limiting on the output circuit. This may not be sufficient to hold open the driven relay.
The input current will need to be increased to meet the required output current for the relay. Hence the above 1 mA "desired" current as specified in the question may well be invalid and irrelevant. |
H: Can a 1.3W rated SOT23 MOSFET deal with 0.9 W peaks?
I have a TL431 LDO voltage regulator that uses a tiny P MOSFET in a SOT23 case rated at maximum 1.3W (IRLML6401TRPBF). Can it handle 0.9W bursts of 1 second every 10 seconds without a heatsink?
I would put multiple MOSFETs in parallel but current won't be distributed evenly.
AI: Use two in parallel - they will current-share because as a MOSFET heats up its on resistance also rises (unlike bipolar transistors). Also mount them with some decent copper on the PCB.
Below are some relevant facts from the data sheet: -
On the upper graph I've cheekily modified the safe operating area and this basically tells me that for a 1 second pulse the limit is somewhere around 0.9W (which is your limit).
The middle table tells me that the junction of the device will warm up about 100ºC for 1W being dissipated and this reminds about point (3) and the amount of copper around the device that restricts this to only 100ºC.
The lower picture tells me that whatever the duty cycle is, a 1 second pulse might as well be infinitely long - the thermal response will be virtually 100% over a period of 1 second. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.