text
stringlengths 83
79.5k
|
---|
H: LM317 and PWM grounds
I have a question regarding the LM317 and PWM. My circuit receives +12v and has three grounds (R,G,B) that are PWM. I need to drop the voltage down to 3.2 volts from the 12 volt source.
NOTE: I know this could be done with resistors, but that is not what I want to do. Also, I cannot change the 12 volt source or the grounds.
Here is my circuit:
I am using a LM317 to take the 12 volt source and dropping it down to 3.2 volts. The issue I am having is when I run the LM317 to ground after the R1 resistor. Since R, G, and B are PWM grounds, will that impede the LM317 and not result in a nice 3.2 volts?
AI: Your circuit as listed will not work. The red LED may come on, and may be damaged, the others won't. If the circuit works as you think it ought to, either the blue or the green (almost certainly the green) LED will burn out. Your overall circuit apparently looks like
simulate this circuit – Schematic created using CircuitLab
where the 3 transistors are your PWM drivers.
First, your LM317 resistors are set up to provide 2 volts, not 3.7.
Second, the regulator will only work when at least one of the LEDs is driven ON, and the LM317 turn-on behavior is not specified for high-speed operation. But let's assume, with no justification, that the regulator does, in fact, turn on cleanly.
Third, with one or more LEDs on, the bottom of the 330 ohm resistor will not be at ground. Instead, it will be held at (roughly) .7 volts. This is based on the Vishay 1N4148 data sheet http://www.vishay.com/docs/81857/1n4148.pdf which indicates a forward voltage of ~0.5 volts for an Iadj of 50 uA, plus an estimated 0.2 volt drop on the selected PWM transistor. This will produce a regulator voltage of about 2.7 volts. Assuming that the red LED needs 2 volts, this will produce a voltage drop across your 15 ohm resistor of about 0.7 volts, and an LED current of 50 mA. You have not specified your LED, but this may be too much.
Fourth, with a nominal regulator voltage of 2.7, and a 0.7 volt drop in the diode/PWM switch, the blue and green LEDs will effectively have about 2 volts applied to them, and this is not enough to turn them on.
Fifth, if you change your resistors to give you a nominal 3.7 across the blue and green LEDs, you risk one or both of them burning out. Note that green LEDs usually have Vf slightly lower than blue, so if the voltage for the blue is just right, the green will draw much more current, dissipate much more power, and self-destruct. Driving an LED from a fixed voltage with no limiting resistor is a classic way to destroy an LED. Go read up on it. In fairness, the diodes will (to some degree) act as current limiters, as will the PWM switches, but you cannot count on this as being sufficient.
As you have noted, using one resistor per LED can result in an awful lot of resistors if you have a large number of LEDs. True enough. And you can try to play tricks with your circuits to use fewer resistors. But you need to ask yourself if a simpler circuit is worth dead LEDs. And keep in mind that LEDs do not have perfectly consistent Vf/brightness curves, so even if you can keep from killing LEDs, you can count on uneven brightness across your display.
You MUST control LED current for each LED. |
H: Looking for capacitance and voltage rating - How to read electrolytic SMD capacitor labels
I need to replace an SMD capacitor on a board. The printing on it says
F1
560
2.5z
I have googled intensely but have been unable to find information on how to read such a codes.
I need to find out its capacitance and voltage. I think it could be 560uf, but I need to be sure of that and still have to find out the volatage rating.
Also would it be ok to replace an SMD electrolytic capacitor with a standard through-hole electrolytic one of the same capacitance and voltage rating?
I am adding picture of the relavant part below:
Inside the red square is the capacitor I need help with
Inside the red reactangle on top there are two other SMD capactor presumably from the same manufacturer. I posted these as well in the hope it may help to find out the manufacturer of the cap I need to replace.
Can somebody please help me?
Thanks.
AI: I think you have a (warning, PDF) Lelon series VEZ 560µF, 2.5Volt VEZ is a low ESR series.
The markings are as follows:
F1 - Date code. I couldn't find a key for the date code.
560 - 560µF
2.5Z - 2.5Volts, Z is the short code for the VEZ series.
Here is a list of PDFs for the various Lelon capacitor series. |
H: permittivity and conductivity vs. attenuation
Is there any direct relationship between permittivity of a medium and attenuation of an EM wave? What about conductivity vs attenuation?
edit: Ok for instance an EM wave traveling in sea water. I get that due to conductivity the ions would induce an opposite E field to cancel out the EM wave thus attenuating the wave, but I'm really confused on an intuitive understanding of the permeability of a medium.
AI: If the permittivity of the medium is a perfect dielectric, then there is no attenuation of the EM wave as it propagates through the material. The idea is that the wave does not expend any energy to pass through the dielectric. Things get a little tricker if you have a dielectric subject to polarization, but if you're looking for a very basic understanding.
Perfect dielectrics have no attenuation.
Dielectrics with any kind of loss, conductivity, have some attenuation.
If you are dealing with a complex permittivity, this will have a direct relationship to conductivity.
\$\hat\epsilon = \epsilon\prime - j\epsilon\prime\prime\$
The complex part of the permittivity is the electrical conduction in the material. |
H: How to read firmware from Altera's FPGA (Cyclone IV) with USB Blaster?
I'm starting to investigate Altera's Cyclone IV FPGA to use in my projects. Now I borrowed from neighboring company a real device with USB Baster Rev.C. I'd try to use one instead of evaluation board which I don't have for the moment.
Before I will put any code into the device I'd like to download original firmware to make me possible to return the device to it's initial state at any moment.
However after I connected USB Blaster to the device via JTAG and run Programmer I did not find any "Read" button (as I usually see on AVR programmers GUIs):
Brief search in Internet did not help.
EDIT 1
It looks like there are additional memories on the board:
I used to connect via X4 (pointed with a big red arrow).
AI: To read the device configuration, you have to connect to X5 instead of X4 (as pointed out by @Simon Richter). Change your settings to match what is shown below:
Click "Start" to read the configuration. When it finishes, you can set a file name and then click "Save File" as below: |
H: Where did these Ohms come from?
I am new to electronics and am tyring to figure out something that is a bit disturbing to me. I am trying to figure out the amount of resistance I need to put in series before an LED, and the equation I keep coming across is:
$$R = \frac{V_S - V_{\text{LED}}}{I_{\text{LED}}}$$
Where \$V_S\$ is the source voltage, \$V_{\text{LED}}\$ is the forward voltage for the LED, and where \$I_{\text{LED}}\$ is the forward current for the LED.
If my \$V_S = 5\$V, \$V_{\text{LED}} = 2\$V and \$I_{\text{LED}} = 15\$mA, then I calculate \$R\$ as follows:
\begin{align}
R &= \frac{V_S - V_{\text{LED}}}{I_{\text{LED}}}\\
&= \frac{5\text{V} - 2\text{V}}{15\text{mA}}\\
&= 3\text{V} / .015\text{A}\\
&= 200\Omega
\end{align}
However, double checking my math at the LED center, if you punch in 5, 2 and 15 in those fields, it will tell you that you need a \$220\Omega\$ resistor, and this worries me that either:
I've been away from arithmetic for too long, or
there's something else that I'm not considering here.
Is this web tool broken, or am I missing some important info/understanding here? Where did these extra \$20\Omega\$ come from?!?
AI: The calculator is using 5% precision resistors, aka E24 resistors, but in such a way that it is impossible to exceed the given current. With a 200ohm 5% resistor it is possible to have a resistance as low as 190ohm which would result in a current of 15.8mA, thereby violating the 15mA constraint. |
H: Opamp constant on
I have a weak signal (from a photo-diode) which I need to amplify to drive an LED. I try to accomplish this with an OpAmp TL081 and the circuit given in the image.
What the circuit does: When there is no signal (even if the photo-diode is not even connected), there is a voltage at the LED (about 2.63 V). When the photo-diode is replaced by 0 Ohm resistor, the voltage at the LED increases marginally.
What the circuit should do: When there is no signal, there should be no (or little) voltage at the LED, when there is a signal from the photo-diode, there should be about 3.36 V at the LED.
As possible error sources I identified:
mistake in the circuit design
mistake when soldering everything together
corrupt element (e.g. burned IC)
Question: Is the circuit design ok? Addon: If yes: did I miss any other possible error sources?
I think the used schematic is like this (if I got the wiring to the OP Amp right, which is not given in this schematic):
Edit: Orientation of photo-diode was wrong in the diagram, as pointed out by the answer of Andy aka (Thanks!). (At least it was right in the build circuit and therefore not the reason of the problems, but of course this needed to be fixed.)
AI: If you still want to use the TL081, you'll need to use 2 power supplies. You can use a +/-5 combination, but assuming you want the LED to shine with a brightness proportional to the input I suggest +/-12 to +/-15 volts. Assuming +/-12 volts, your circuit should look like
simulate this circuit – Schematic created using CircuitLab
Note the addition of a couple of capacitors to the op amp power inputs. These will act to prevent the op amp from oscillating due to wiring effects. They may not be necessary, but they should always be used, just in case.
The R3/D4 is provided to limit the bias voltage on the photodiode, and may not be necessary, but you will need to check the data sheet on your photodiode. Look for reverse voltage. Some photodiodes will work with a full 15 volts on them, but some will not.
I have not shown your zero pot (R3 in your schematic), but it should go to pins 1 and 5, with the wiper to the -12. |
H: Connecting shielding for high and low voltages
I have design a power distribution PCB with high AC(230V) and low DC(<10V) voltage power rails. Both are going to be connected to my board by separate cables. Each of those cables have shielding wire, i.e. a high voltage cable have four wires, three for phases wires (connected in delta configuration so there is no neutral wire) and shield (I am sure I'm not confusing shielding with PE if someone could ask). Similar situation with low voltages, few hot and ground and single shield wire.
Should I keep shielding for high and low voltage on separate layers or can it be connected to the same PCB layer?
AI: Typically you want to completely isolate the AC voltage from the rest of the circuit. This is a safety issue, and it's done to make sure no harmful AC voltage leaks into the DC circuits. Most people would even recommend isolating the neutral line because there could be harmful current on that wire as well. This is usually done with a transformer. The delta-connected AC will go into a transformer. The output of the transformer goes into the rest of the supply circuit or whatever it is. You said this was a power supply, so this will most likely be a step-down transformer.
The DC lines should be isolated as well, depending on the use-case. If you are running DC power to many different devices, or chaining supplies together (which you mentioned), you will want to isolate the DC outputs to avoid ground current loops. Chaining boards together introduces the possibility of different ground references. When two ground levels have different voltages, a current will flow. This can cause noise in your DC circuits. Over short distances, this effect is minimized. You need to decide if you need to isolate DC outputs. Usually this is done using a transformer with multiple taps, which gives you multiple isolated AC outputs, which are fed into separate power supply circuits. If you don't care about noise or ground currents, you don't need to isolate the DC outputs.
To answer your original question, I would not connect the shields together. Typically with power supply circuits you want to completely isolate AC power sources for safety reasons, and isolate DC power sources for noise reasons. |
H: 3V6 Zener Diodes With Very Poor Accuracy
I have a question about the regulation accuracy (or lack of) of a 3V6 Zener diode. I wanted to confirm that I wasn't doing anything stupid.
I set up the standard test circuit shown below.
No load except for the DMM. The two Zeners in question are: BZX55C3V6 (3V6 - 500mW) and 1N4729A (3V6 - 1W). Both Zeners came from separate suppliers. \$V_{CC} = 5\$V and is relatively stable (total variance no more than 40mV).
I know that Zeners need a minimum current to regulate properly and I worked out the optimum current through the combination of \$I_{zt}\$ from the datasheet and the following "rule of thumb" calculation: $$I = \frac{(P/V) \times .7}{4}$$
Taking the 1N4729A as an example, the \$I_{zt}\$ is roughly 70mA.
Working out the current limiting resistor we have: $$\frac{5 - 3.6}{70\text{mA}} = 20\Omega$$
When I tested the zener with a \$20\Omega\$ resistor I get a \$V_z\$ of just over 4V! In fact, as I increase and decrease the resistor value, the Zener voltage increases and decreases along with it. It's like the Zener resistance isn't decreasing as the current increases, which is not what I'd expect. What's odd is that the BZX55C is showing more-or-less the same behaviour although with different resistors. Is this normal?
AI: The problem is how you are modeling your circuit, because the series resistance you are using is so close the zener resistance, it must included in the circuit model. As shown in the circuit below which models the behavior that you are seeing of a voltage reading of about 4V from the zener diode
simulate this circuit – Schematic created using CircuitLab |
H: Precisely drawing component footprints in EAGLE
Whats the recommended way for placing components accurately and quickly when creating EAGLE parts?
For example in the drawing below, using grids with 0.01 grids will give us the control needed for components with separation such as 10.16 but scrolling 1000 0.01 grid spaces is quite tedious.
Source: http://www.mouser.com/ds/2/400/cc-e-524996.pdf
AI: Use the move command.
Select the pad, via, or part you want to move. Type move (> x y), where x and y are the absolute coordinates you want the part to be moved to.
The most difficult part is choosing an origin on your part. It can be anywhere, but for your linked part I would probably use pin 1 as 0,0. Then make pin 2, select it and type move (> 0, 10.16), then pin 3 will be 10.16+5.08 for the y coordinate (Eagle unfortunately does not accept basic math inputs).
Recognize the (most common) common denominator.
If you set your grid to 5.08 things will be even easier. Then you can place pin 1, copy from it to make pin 2 and move up by two grid positions. Pin 3 is one more. Pin 7 is seven across, pin 6 is one up from that, etc. Things will continue to move in grid increments, so using the move command to move pin 10 down by 3.68, then drag it over by one grid tick, copy it and move five over for pin 9, etc. |
H: Why are caps configured this way in EMC filters?
Every EMC filter I've seen has capacitors between the AC lines and earth, configured like this:
simulate this circuit – Schematic created using CircuitLab
Why are the caps not configured like this?
simulate this circuit
What is the advantage of having the extra cap from neutral to ground? It seems like it would reduce the capacitance to ground, and thus the effectiveness of the filter. Is it a safety issue, in case the capacitors fail short? But isn't avoiding that the point of using Y-rated capacitors?
AI: Safety standards (UL, CE, etc.) place a limit on the amount of leakage current allowed to return on the earth ground. By using the 4 capacitor arrangement, the line-to-line filtering is made independent of the line-to-ground filtering. i.e. you can make the line-to-line capacitors a larger value without increasing the ground leakage current. Then the value of the single capacitor to ground can be set to not exceed the leakage current limit.
Clarification: By leakage I do not mean dielectric leakage. I mean AC current flowing through the capacitor because it is a capacitor. In the three capacitor topology, unless the three capacitors have exactly the same value (unlikely) and the AC line voltages are perfectly balanced relative to ground (unlikely) there will be AC current flowing in the ground wire which must be limited. |
H: Temporary SMD Adhesives?
When I do prototyping I solder my PCBs by hand. That works fine most of the time, but I run into a problem when I have to solder chips with fine pitch (Google for VQ100 to get an idea of what I'm working with). The problem is not the soldering by itself but keeping the parts in place once the pins are aligned to the pads.
Now I'm looking for an adhesive that lets me temporarily stick a large SMD component onto the board so it does not slip away as soon as I touch the pins with my soldering tip.
During a Google search I found a log of SMD adhesives, but all of them are resistant to PCB cleaning substances. I need the exact opposite. Something that lets me temporarily stick a part onto the PCB and dissolves fast in PCB cleaning chemicals (I use isopropyl alcohol if that matters).
Something with the sticky properties like thick honey would work except that I'm looking for a more professional solution.
I'm certainly not the first one to look into this, so there must be a ready made product out there, right?
AI: Have you tried bog standard thermal glue? They are not particularly strong, and the component can be slid with modest force to release from adhesion. The glue can be scraped off fairly easily, I don't know what solvent would remove it, but I can't imagine it would be easy to find one that does it. An alternative idea would be using a magnet or suction device to hold onto the component, and then position it with a clamp - or in fact just use a clamp of sorts on its own. I believe the suction and/or electromagnets are what is used in automated PCB manufacturing robotics for placing the components.
Why do you need to remove the device after soldering? I'm missing something here. Once it's soldered, why would you need to remove the adhesive? |
H: Could a 4 pole 3.5mm jack be used to power a RGB LED?
I'm hoping to make my LED pluggable into a jack of some kind. Could a 4 pole 3.5mm jack be used? Could each pole carry 3v-5v?
Here's the LED: http://www.tandyonline.co.uk/5mm-full-colour-rgb-led-common-cathode.html
Thanks
AI: Technically, yes, it would work. But it's probably not a good idea. Here's how this family of connectors tends to perform, including TRRS, TRS, and TS of any size:
They're typically used with analog line-level signals that can reach up to +-15V in some cases, so voltage is not a problem for you.
They're not suitable for high currents because of the small contact area. If you're running 1A or less in total, it's probably okay, but I'd want to verify specs if my estimate got above 100mA. I say "in total" because the common return has the same rating as any other contact.
They're not suitable for hot plugging or unplugging without careful analysis because they rake the contacts across each other. If you imagine a plug or unplug event in slow motion, think about the different circuits that are made each time a jack's contact crosses a boundary between the plug's contacts. |
H: Find system behavior: P or I type?
In control theory, how do I find out of which type a system is? P-type or I-type (P = proportional and I = integral)
Consider the following nonlinear system with x as output:
$$
\dot{x} = A(x) + Bu
$$
$$
y = x
$$
Is this system of I-type because of 1/s (integrator)
$$
x = \int\dot{x}
$$
Or is it not that simple to claim of which type the system is?
How is it done?
EDIT
I am using a PI controller. And the complete state space representation using A(x) is (a, b and g are constants > 0)
$$
\dot{x} = -a\sqrt{2gx}+bu
$$
AI: For single input , single output linear systems we define 'type' according to the number of integrators (number of free 's' in the denominator) in the open loop transfer function. A type zero system would have zero integrators, a type one, one integrator, and so forth.
The significance of classifying system types gives you an idea of how the system will behave to a specific type of input signal if you apply simple, proportional feedback to the open loop system.
For a type 0 system with step input you would see a finite steady state error, proportional to the loop gain.
For a type 1 system with step input you would see a zero steady state error.
This page provides a more complete summary (table) for type systems (denoted by N) and the expected output.
For nonlinear systems you cannot generally apply the same principles so a 'type' is not defined.
For type you might be confusing the 'type' of control compensator (filter): P, I, PI or PID types which more often refer to the control compensator that's applied in the control loop to control a system. As an open loop transfer function yo determine type (0, 1,2 , etc.) you can consider the compensator together with the plant as the open loop transfer function - to define the type you would get after closing the loop. |
H: LD1117 not providing fixed 3.3V
It is my first question on this site and I'm probably doing something wrong, try to be gentle! haha
I want to provide 3.3V to my ESP8266 module from my Arduino, but people say this WiFi module requires more current than that 3.3V pin can provide. So I'm getting 5V from Arduino and turning it into 3.3V through LD1117 (just as it is done here http://iot-playground.com/2-uncategorised/17-esp8266-wifi-module-and-5v-arduino-connection).
simulate this circuit – Schematic created using CircuitLab
This is the little guy.
The problem is I can't get it to provide 3.3V. With no Resistor Load, output is 4.2V.
With low Resistor Load (1k Ohm) just for the purpose of testing voltage does not keep at 4.2V, it drops, but it shouldn't, right?
simulate this circuit
I'm starting to think that maybe providing 3.3V directly from the Arduino isn't that bad of an idea. Can someone guess what I am doing wrong with this LD1117? Thanks in advance!
AI: Due to the constant revision of part numbers and datasheet for the ST LD1117 over several years, it's hard to 100% prove that you have the Adjustable Version. The current Datasheet shows the topcode LD1117AV as the TO-220 package, but has only shows the 3.3V fixed regulator available in that package.
But some googling found an example of the 3.3V fixed regulator.
Notice the obvious LD1117AV33 on the IC, meaning this is the LD1117 To-220 Fixed 3.3V regulator option, likely made in Week 49 of 2013.
As such, you have the adjustable version, and by tying the "GND" pin, really the "ADJ" to ground, it defaults to the 1.25V internal reference voltage, and regulates to 1.25V ± 0.07V, under load (suggested as 10mA minimum. A 1KΩ Resistor is not enough for 10mA, so you might see some ripple or out of regulation voltage.)
To make it 3.3V, you need two resistors. A 1K from VOUT to ADJ, and a 1.64K from ADJ to Ground would give 3.3V out. Use a LD1117 calculator if you want to use different value resistors. |
H: IC to replace 4 FETs (switches)?
I have 4 data lines that I want to put to high-Z if a pin (let's call it EN_OUT) is high (or low, if necessary), otherwise connect through. I've successfully done that by putting an N-FET on each line (gate to EN_OUT). For space considerations, I'd like to replace that with a logic IC that I'm sure exists... I'm just failing to figure out what it would be called :)
The closest I've come is a 4x1:1 de/mux like the NXP 74HC4066, which is fine but it has an enable pin for each circuit and is a tiny bit larger than I'd like. I was hoping there'd be one with a single EN for all 4 circuits.
Can someone give me a nudge on what that would be called? Thanks.
AI: I am not sure if this is what you are looking for but if it is simply a space problem then the smallest you will probably get is a simple tri-state buffer. Here is an example: http://www.ti.com/general/docs/lit/getliterature.tsp?genericPartNumber=dm54125&fileType=pdf
I have never personally used this model so do some more research before actually putting it in something but this is my nudge |
H: Objections to use an RCA connector for antenna in broadcast FM receiver
Due to budget & space restrictions, I am thinking about replacing a PCB BNC connector used to attach an external FM antenna. It seems to me an RCA connector could be an option, given its good shielding, low impedance and the (relatively) low frequencies involved. But I was unable to find better arguments for & against it in my searches, or any examples of anyone using it. Would it have a good (or at least acceptable) performance? If not, any recommendations?
BTW, the antenna at the other end is the typical monopole, 100R.
AI: It will be fine. RCA connectors are found inside some TVs. I have this on 88-108 broadcast FM, and without doing measurements it is fine. Measurements weren't done because I didn't have access to suitable VHF test gear 25 years ago. The plug is still fine. |
H: How does one calculate the input impedance of a tube based preamp?
I'm finding tons of information and equations on calculating this for solid state devices, but nothing for good old fashion particle accelerator based amplifiers :P
Currently I'm revamping the K270 guitar preamp to use components that are readily available. See the original design here: http://s13.postimg.org/patw5krxj/k270.png
This is my current progress: https://123d.circuits.io/circuits/852190-jan-6418-vaccum-tube-valve-preamp
Here is a snapshot at the time of writing this:
The problem I think I might run into is that my guitar's pizeo pickup requires a ridiculously high input impedance on the other side of the cable. I've been reading about jfet based piezo preamps and it's not uncommon to see people have 5 - 10 mohm input impedances on their piezo preamps.
1) How do I go about figuring out what the input impedance of my current circuit is?
2) How do I raise it if necessary?
AI: The input impedance is almost entirely set by R2/R1, so it's about 47K || 1M or about 47K.
You can increase R2, for example to 5M and leave out R1.
A tube behaves much like a JFET (which, in turn, is like a depletion-mode MOSFET with a diode from gate to source). |
H: voltage current converter by op amp circuit
I am trying to convert 5V to a constant current source
for op amp I use AD822.
for 250 ohm I use 180 ohm, so I should get a current of 28 mA.
I verified when Rload = 0, 28 mA across negative terminal to ground.
But when I put Rload to circuit, 680 ohm, my current exceeds 28mA as Vcc increase.
Can anyone please point where might be the error?
AI: The "operating output current" for an AD822 on a supply voltage of +/-15V is limited to 20mA (see page 9 of the data sheet).
Absolute maximum rating for the device is +/- 18V.
Either lower your expectations for this device or choose a more appropriate op-amp or an op-amp BJT combination. |
H: Is it OK to put LEDs in parallel?
I wonder if it's a good idea to put LEDs in parallel, as below:
I've heard that it might not be because the voltage threshold won't be exactly the same for each LED, so they'll shine all with very different brightness and you don't have a way to balance that. Is that true? So does it mean it's a bad idea?
AI: It's not a good idea. Look how a (generic red) LED conducts current when you apply a voltage to it: -
At 2 volts, the LED is taking 20 mA. If the LED was manufactured slightly differently it might require 2.1 volts or maybe 1.9 volts to push 20 mA thru it. Imagine what happens when two LEDs are in parallel - if they "suffer" from normal manufacturing variations, an LED that only needs 1.9 volts across it would hog all the current.
The device that needs 2.1 volts might only receive 5 mA whilst the 1.9 volt device would take maybe 35mA. This assumes a "common" current limiting resistor is used to provide about 2 x 20 mA to the pair.
Now multiply this problem out to 8 LEDs and the one that naturally has the lowest terminal voltage will turn into smoke taking the best part of over 150mA. Then the next one dies then the next etc... |
H: Intel IA-32 Protected Mode HW-Tasks: IRET return from interrupts within a nested HW-Task ( EFLAGS.NT=1 )
The INTEL manuals tell us that when a HW-task has been switched to using a 'CALL' instruction the destination task is considered a nested task:
The processor
copies the segment selector for the current TSS ( task A ) to the previous task link
field of the TSS for the destination task ( task B's TSS )
sets the EFLAGS.NT = 1
task A task B
v .
. / v
v / .
. / v
v / .
./ v
CALL .
.\ v
v \ .
. \ v
v \ .
. IRET
v
The 'nested task' should eventually return to the calling task ( task A ) by means of an IRET instruction. When software in task B uses an IRET instruction return, the processor checks for EFLAGS.NT = 1, it then uses the value in the previous task link field to return to the previous task ( task A ) if the flag is set.
However nothing is to stop an interrupt occuring while execution is in progress in task B.
Now when the handler tries to return to the interrupted thread in task B, it would do this with an IRET. Since the handler is executing within task B, it would seem that the processor checks the EFLAGS.NT and since it will still be set ( i.e. 1 ) returns to task A, rather than returning to the next instruction of the interrupted thread within task B.
WHAT HAPPENS WHEN:
task A task B
v .
. / v
v / . /.
. / v / v
v / . / .
./ v/ interrupt handler
CALL . v
. .
v v
. IRET
v EFLAGS.NT = 1
. Get the previous task link in B's TSS?
v OR
Go to the return address on the stack?
I would expect the following behaviour
task A task B
v .
. / v
v / . /.
. / v / v
v / . / .
./ v/ interrupt handler
CALL . v
.\ v \ .
v \ . \ v
. \ v IRET
v \ .
. IRET
v
In other words first a return is made from the interrupt which occured during task B ( consumes 1st IRET ) then a return is made to the 'calling' task ( task A ) which uses a 2nd IRET.
Would this be reasonable?
If so how does the processor 'know' that eventhough EFLAGS.NT=1, it must return to the interrupted thread in task B itself; or in other words it is dealing with a simple interrupt return in within task B and that it should not return to task A ?
What am I missing here?
AI: Have a look at the Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 3:
6.12.1.2 Flag Usage By Exception- or Interrupt-Handler Procedure
When accessing an exception or interrupt handler through either an
interrupt gate or a trap gate, the processor clears the TF flag in the
EFLAGS register after it saves the contents of the EFLAGS register on
the stack. (On calls to exception and interrupt handlers, the
processor also clears the VM, RF, and NT flags in the EFLAGS register,
after they are saved on the stack.) Clearing the TF flag prevents
instruction tracing from affecting interrupt response. A subsequent
IRET instruction restores the TF (and VM, RF, and NT) flags to the
values in the saved contents of the EFLAGS register on the stack.
An exception entry will save an exception stack frame (including current EFLAGS), and then tweak the (new) EFLAGS to ensure correct and safe execution of the exception handler. |
H: Identifying 40Hz frequency shift
I have a signal that is at 4 kHz. This signal shifts by 40 Hz depending on some user input. I like to detect this change in software as fast as I can. What should be the ADC frequency I should use?
I currently plan to sample at 40 kHz and use a window of 10 ms to do an FFT to find out this shift. But before I build the system, I like to get a second opinion.
AI: To restate your problem, you have a input signal in the frequency range of 3960-4040 Hz, and want to determine this frequency on the fly. Many microcontrollers can do this quite simply.
The highest frequency of interest is 4.04 kHz, which has a period of 248 µs. That's a "long" time for even a small and cheap micro. At the other end, 1/3.96kHz = 253 µs, so you want to determine the period of the signal over a range of 5 µs. You didn't say what resolution you want, so let's say 1 part in 50, which means you can get what you want if you can measure the period down to 100 ns.
This is all quite doable in many microcontrollers, which have the ability to take a snapshot of a free running timer on a particular edge of a input signal. On 8 bit PICs, this is one of the things the CCP (Compare, Capture, Pulse-width modulation) module can do. On 16 bit PICs it's called the "Input Capture" module. Either way, you end up with a 16 bit timer snapshot every cycle of your incoming signal.
To determine the period of the previous cycle, simply do a unsigned subtract of the new capture value minus the previous. This works whether the timer wrapped around during that cycle or not, as long as the period doesn't exceed the timer's wrap time. If you clock the timer at 10 MHz, then you will get values from 2475 to 2525, with the subtract yielding the period in units of 100 ns.
You don't say what you want the freqency for, but perhaps you can use this period directly. If you really need frequency (think about it carefully, you may not), then you do the divide. Even with the micro only running at 10 MHz, you have over 2000 instruction cycles per input cycle, which is plenty for a divide. On a 16 bit PIC, you can do the divide in hardware in only 18 cycles.
Either way, I'd do a little low pass filtering on the measured periods before doing any other processing. This will make your system less susceptible to jitter and can even reduce the quantization noise a bit. Keep in mind that a band-limited 3960-4040 Hz signal can't change its frequency that fast. Apparent changes in frequency above some limit are guaranteed to be noise. |
H: Flash IC/ CMOS RAM/ microSD in TFT LCD
I have seen cases where TFT module contains flash or SD card on module. What is the need of flash in LCD?
In simplest way, we connect RS,RD/WR,CS,RESET pins and 7/8/16/24 bits data pins of controller to LCD. So, why this memory provision is there on board.
AI: Images take up a lot of space. Putting them in some kind of external storage allows you to use a system controller with less program memory since you're not wasting this valuable space on images. Additionally, the images can be easily changed without any need to recompile. |
H: Logic Level Shifter
I am trying to connect two devices on a PCB. One operates with 3.3V digital high and the other works with 5V digital high. I actually grouped the input and output pins (There is no bidirectional pins). The ports have minimal current levels like 10mA. However, the speed of the channels are very important. I totally have 60 pins and try to build a small PCB. Do you recommend any logic level shifter for my work?
P.S: I saw lots of level shifters but my aim is to find the most basic one with the highest channel capacity. I seek a solution from your previous experiences.
AI: the most basic one would be a few resistors. As always, google is yor friend. Here a thing that I found.
If you go for a resistor divider, speed will be reverse proportional with the flowing current. So If you have some energy saving considerations to make, it will not be too fast.
Of course, speed is relative. In my 8-bit designs, 1MHz is ridicolously fast. In a Media Application, I would rather have something like 300MHz.
EDIT: You ask specifically about integrated level shifters, do you? I misread your question. A good way to find something for your needs would be to search a big distributor like Farnell/DigiKey or Mouser. They have parametric search engines where you can search for number of channels and price. With this you would find the most basic(read cheap) for a given number of channels. |
H: Audio conversion to digital format
I am confused in my understanding in implementation of voice guide for one of the instrument. I am trying to implement voice guide while operating one instrument. Audio data will be saved in memory ( No mic provision since data will be saved hard coded )
Hardware consists of DAC connected to controller and DAC's has inbuilt amplifier ( Please refer TLV320DAC Texas IC )
http://www.ti.com/product/TLV320DAC3100?keyMatch=TLV320DAC&tisearch=Search-EN-Everything
So, my question is how to get audio signal in digital format to save in memory?
Can we connect controller without DSP support to this DAC?
Please someone explain.
Thank you.
AI: A DAC or Digital-to-Analog Converter, converts digital bits into analog voltages, so that's what "plays" the already-recorded data. To generate this data, you could use an ADC or Analog-to-Digital Converter to convert analog signals (voice) into digital data.
You may be able to use a computer to record the audio into digital form, and use that in programming the device initially. There are many ways to encode voice data, ranging from uncompressed (raw values called PCM), all the way up to psycho-acoustically encoding (compression of perceived information) such as MP3 or AAC. The latter are more complex, but use less data. |
H: What is the name of this AC power outlet?
I have these power outlets on the ceiling in a (newly built) house in Sweden, they are meant for lamps. I could not find any information on them, what is their name?
Power outlet with plug. The hole/pole distance is around 11.5 mm center to center.
Size comparison with CEE/Schuko plug
AI: You have a lamppropp which plugs in to a lamputtag, which I take to mean "lamp plug" for a "lamp outlet."
The link contains pictures of both, including a lamputtag that is a dead ringer for yours.
Now you know what to ask for when you go to the hardware store, or when you shop on line for one.
Those connectors seem to be a specialty of Sweden, designed to make it easier (safer) for a non-electrician to connect a ceiling lamp.
That said, this would probably have been better on the DIY Stackexchange site. |
H: Push-pull Amplifier Class AB
I am new to electronics and I am trying to build an audio amplifier with an input signal of 100mV @ 60 hz using 12V as VCC and expect an output of 70-75W power.
I have the following circuit:
I copied this one from my notes and simulated it just to find out that it does not amplify. I believe there is something wrong with the biasing. What could be the problem?
AI: Its not the biasing - in fact there is no problem.
That circuit is not a voltage amplifier, its a current amplifier - the key feature being that both of your transistors are configured as emitter-followers (gain ~ 1).
What you have there is a common configuration for the output stage of an audio amplifier because it can drive lots of current into your speaker.
You need to add a voltage gain stage in front of it in order to amplify your 100mV signal into something that the output stage can use.
The easiest way is to cheat and use an opamp... |
H: Complexity vs Space in Schematic
I got a screw terminal with the following pin configuration:
X1
+-------------+
| (X) (X) (X) | 1 = 24V 2 = SIGNAL 3 = 0V
| | | | |
+--|---|---|--+
1 2 3
My "requirements":
Convert 24V SIGNAL to 12V logic
Add bypass capacitor for supply
At the moment my schematic looks like this:
I need the design as compact as possible but I don't want to confuse myself in future.
What do you think: is the above schematic easy understandable or is it already too complex?
And what is commonly more important in a schematic: simplicity or sheet "space"?
AI: As drawn, there's no doubt about how things connect.
If you'd like to make it more obvious what is going on then I'd draw one of these two ways:
simulate this circuit – Schematic created using CircuitLab
Electrically, it is the same. From looking, though, it is obvious that you have a voltage divider on the Signal line and that your capacitor does nothing but bypass the 24Volts.
The second is a little more compact, but the divider is still obvious.
In the end, it usually comes down to how much room you have to fiddle with when drawing your diagram. Sometimes you have to squeeze something in, then you place the parts where they'll fit. But, in general try to follow conventions when placing parts in the diagram as it makes it that much easier to read for the next guy (who may be you in a couple of years.)
Clarity is the deciding factor. The clearer, the better. Sometimes this even means using less space on the diagram by logically grouping things instead of having connections run every which way. |
H: Syncronization Flip-flops
I've a doubt about clock domains and synchronization FF. I'm working on a FPGA and I've two clock domains. In the firs clock domain there is a clock frequency of 125 MHz, in the second the frequency is generated by a PLL that has in input the 125Mhz and it generates a 12.5 MHz.
Are syncronization FFs, between the clock domains, needed for signals that goes from one domain to the other ? I know that when the signals are asyncronous or unrelated I must put syncronization FFs, but in this case the frequencies are related. Is it safe to eliminate the FFs ?
Thanks
AI: Since you use a PLL to generate your 12.5MHz clock, the phase relationship will be kept by the synthesis tool, whatever it is. This means the timing analysis will properly report any path between the two clocks and will tell you if it can't satisfy the setup/hold relationship. The clocks will also likely be edge-aligned, but this depends on the PLL's configuration.
It is easy to perform a clock-domain transfer between an edge-aligned 12.5MHz to 125MHz. If the source setup within 8ns, the 125MHz will latch the value without problem. The other direction is also easy, except you must keep any value for 10 125MHz clock-cycles to make sure the slower clock latch the new value (the tool won't verify this).
It is sometimes preferable to consider the two clocks asynchronous. An example case would be if the clock ratio is 11/13, it may be impossible to satisfy timings between the clocks. In that case, just consider them asynchronous, put false path constraints and use FIFOs, synchronization registers or any other technique to transfer data.
In your case, consider them synchronous, it shouldn't be difficult to meet timings if they are edge-aligned or if their phase relationship isn't utterly bad. Also be sure to verify the timings report, if the cross-domain paths aren't there, then you know there is something wrong. |
H: embedded programming flashing program
Hello All,
I'm new to this board and looking for some opinions. I've searched the board a bit and found similar questions but not quite what I'm looking for. I'm looking for some help deciding on an SoC to use for embedded system applications.
I've taken a intro embedded systems course at my University, however the normal professor left the semester before so a CE grad student was forced to teach the class. As a result I feel like I didn't get the best education from it. In the course we used a smartfusion SoC, I feel like I know that board pretty well however I don't want to go out and spend over 100$ just for the board. Also I'd rather not have to interface the MPU to an FPGA.
Before the end of the semester and doing a lot of research I hastily bought a Rpi 2. Doing a bit more research and playing around with it, I've come to the conclusion it isn't the best board for baremetal C. A lot of the code is already given to you when what I want to do is write the code and drivers myself.
In the end I want to get into robotics with whatever platform I'm using. My question is this... should I stick with the Rpi and just learn to rewrite some of the libraries or should I get a different board such as the beaglebone? Another issue I have with the Rpi is if I want to do baremetal C, then flashing the MPU is a pain, so preferably I would like an IDE to debug and flash my code.
For now the embedded system design is just a hobbyist thing, but in the future I'd like to be able to actually work as an embedded designer. I want to get close to the metal as opposed to high level abstracted away design. Ahead of time, thank you for your responses.
AI: I suggest you get a Discovery Kit for STM32 F4 Series with STM32F407VG MCU like this one. This is an absolute steal for $14.88. The 32-bit ARM Cortex-M4 processor has 1 MB of flash and a 192K of RAM. It also includes two PWM's for motor control.
You can expand the I/O using this STM32F4 Discovery Shield. It allows the addition of up to four Click boards, such as Bluetooth, Wi-Fi, and dozens of others. Unfortunately, no H-bridges -- but there is a prototype Click board where you could wire your own. |
H: Can you help me find the part number for this push button cap?
I've been searching high and low for the part number and manufacturer for this button cap. I've tried it out and it works perfectly for my project. Note: I do not want the button itself, as I've already found one that fits the "springiness" level that I need (Omrom B3F-5050, if you're curious -- they don't require as much force to press as others -- 1.27 N). Please note that these have a low-profile and slightly rounded/domed top (kind of shaped like a circular pill).
Here's an Amazon link for the cap I'm trying to find. I would like to be able to buy more of these, potentially in large quantities, but just the cap.
EDIT:
In order to make this question more useful for others, I'll reword it a bit: I'm looking for round, low-profile buttons to fit the Omron B3F-5050 push buttons. Any suggestions would be highly valued. I find that most button caps are tall, and sometimes folks need buttons that are lower-profile. The domed top is a "nice to have", but the low profile is most important.
AI: It looks like you have to order them from an Omron supplier, and I'm not sure they've got caps like you want. I find many different caps that will fit your switch at Mouser, and I'm pretty sure you can get them from other suppliers as well. Whether you like Omron's caps is another question.
This is a link to the Omron datasheet for the caps.
If the Omron caps aren't what you want, then you'll need to look for a dealer who sells Amico parts - that's who made the ones on Amazon. I'm not finding them, though.
Assuming the Amico caps really fit the Omron switches, maybe someone else's caps will fit as well.
E-Switch has caps much like the ones on Amazon. Maybe they also have switches like you want, and caps as well. E-Switch seems to have an enormous selection of caps. |
H: How to read this transformer label
I have the following transformer that takes in 117V and steps down to 12V and 9V. However, I don't understand the label. "PUR" and "RED" are listed as 117V, does that mean PUR is power and RED is ground? Or is PUR power and BLK ground (since its 0)? Basically, which two wires do I connect to the power outlet wires? And what about the secondary wires? I'm new to transformers so I don't want to take any chances by wiring it up wrong. Thank you.
AI: It does not do 12V from 117V. or 234V. It does do twice 9V from either 117V or 234V.
In labels like these, you normally read them left to right. One side is primary, the other is secondary. So if it's a label like this, or very similar, the wires noted on one side together supply all the power that goes in, while all the power that can come out gets taken out by the wires noted on the other side.
In your case, presumably you want to put circa 115VAC in, since you are not referring to 230VAC at all. But to be sure, I'll handle both cases.
If a label on one side says "115 - 0 - 115" it means that side has two directly connected windings, like in this image on the top-side:
simulate this circuit – Schematic created using CircuitLab
In this case, you can connect 115V across one winding, or 230V across both. These transformers are a bit silly, since if you use them as 115V transformer, you are not using a bunch of copper that the manufacturer put on: inefficient.
So, what your manufacturer did was say: "Hey, why would we connect them at one point? If people have choices to make when wiring it up anyway, why not let them do all the connecting?"
Why?
Because now, you can connect the two windings in parallel on 115V and in series on 230V. The 0 and 117 just indicate which wires to connect together in which case.
The same happens on the secondary side, they give you two completely independent windings, so you can put them in parallel for 9V and in series for 18V.
If you can imagine the two transformers in the next picture to be linked together magnetically/inductively, you can see it like this:
simulate this circuit
Since no winding is connected to any other, you can connect them up any way you want. But of course, it would be silly to connect a 117V winding to a 9V one. And in many transformers they are no longer safety approved if you do put a mains AC voltage on a secondary winding, even if it makes sense to do so from your engineering point of view. That's because they have extra plastic between primary and secondary, but not between each secondary, so the guaranteed separation will no longer be guaranteed.
So, you can put 115V on it, by connecting the two "117" windings together in parallel, connect both "0" wires on that side (BLK & YEL) together, and connect both "117" wires (PUR & RED) together. This way you know that with 115VAC you can also put all the power into the transformer that you need to be able to take out without something getting too hot.
If you want to connect it to 230V, simply connect the "0" of one winding to the "117" of the other and put the mains 230VAC on the two wires that are left. (for example: Connect PUR and YEL together, and put 230VAC on BLK and RED).
The same tricks can be done on the 0-9-0-9 side to make one strong 9V or use them separately for two half as strong 9V's or in series for one 18V.
The VA rating of a transformer means Volt-Ampere, and is often given as the amount you can take out on the secondary. It is just the numbers multiplied. A 40VA transformer with one 10V output will be able to handle 4A on that output. A 28VA transformer with two equal 14V windings will be able to output 1A on each. Etc.
If a transformer like this is 18VA, for example, it will probably be made (unless a datasheet or label clearly notes otherwise) such that each 9V winding can handle a maximum of about 1A. So two parallel will be about 9V, 2A. Two in series will be 18V, 1A. So, unless something notes otherwise, this transformer is 12VA total, is 6VA per output. (= 6VA / 9V =~0.67A).
To be sure about the 6VA per output you could Google the number on the label, but if all the parallel wires have the same copper (or other metal) thickness, it's reasonably likely the windings share the rating equally.
And so also: Always make sure you have both primaries powered in either of the set-ups mentioned above if you want to be able to take all power out, because just like the secondaries, either winding will only be capable of about half the maximum power. |
H: Would an analog mux be able to output various voltages?
So from my understanding, an analog mux such as CD74HC4067E will be able to output diferent voltages based on its inputs.
Thus for an example if I connect 4V, 3.3V, 2.2V and 0V to a 4:1 mux with 00, 01,10,11 being the selectors for each of the above voltages respectively. What would it output if I select 10?
My understanding is that it should output 2.2V or whatever is connected to that corresponding channel. Sorry for the basic question, I just want to be sure before I buy the chip.
AI: Yes, you can do this, but there may (or may not) be a problem. You cannot use your selected voltage as a power supply. Look at figure 1 in the typical performance section. The effective resistance in the switch will be in the range of 60 to 90 ohms. And the maximum current you can pass is 20 mA.
Even at 10 ma, a resistance of 60 ohms will cause a voltage drop of .6 volts, so in your example, if the load is drawing 10 mA, the output voltage will be 1.6 volts, rather than 2.2 volts.
This may not be a problem. For instance, if you are monitoring several power supplies with a high-impedance A/D converter, input impedance better than 10 k ohm, your measurement will be accurate to ~ 1%. But if you intend to actually power a circuit, you'll need to be very careful. |
H: How to populate unused flash for an armv7a processor?
I have a decision on how to fill unused memory in a flash device. I've heard of populating with reset instructions as a safe way to handle rogue pointers, etc. Is there a concept of an assembly reset instruction for armv7a processors? Is there an industry standard on how I should fill the contents of this flash? Default erased 0xFF values?
AI: I do not think there is an industry standard. However:
Code
Conveniently, all 0xff is an undefined instruction for both arm and thumb encoding (according to objdump). That means if your program counter happens to wind up in empty flash space, your system will take an exception. Your exception handler can then reset the system to recover.
Data
Also 0xffffffff conveniently is an odd number. This means that when dereferenced as word-sized pointer, it will trigger a bus fault. This exception you can also handle to reset your system. |
H: ULN2803A PWM LED High Watt/Ampere
Reading the ULN2803A datasheet, especially the part "Figure 13. ULN2803A as Inductive Load Driver" and after various fails to properly drive 12v RGB led strips, as i can't find the proper mosfets. i was thinking to get more of those ULN2803 and use them like a "mosfet".
500-mA-Rated Collector Current
Total substrate-terminal current –2.5 A
This means if i connect one pin of my 3.3v or 5v microcontroller to all 8 intputs , and all 8 outputs (gnd) to the leds , basically solder them all together, i get a max of [email protected]=30W on one ULN2803A.
Using PWM on 3x ULN2803A, doing the same as above, would allow me to get [email protected]=90W Led strip to run properly.
Would i be able to properly power the 2x 5m led strip or less, assuming i have 7.5A@12v=90W and the strip consumes 7.2W/m*10m=72W, without problems (except the obious voltage drop on a 10m strip)?
Said that, if it's correct, the ULN2803A is for 3.3v & 5v and so has already all the protection and logic stuff inside, so i don't need any resistors, diodes, transistors or whatever to protect my Microcontroller?
Basically i just need to connect the Arduino(5v) OR Raspberry (3.3v) signal pins to the ULN2803A inputs, the GND of the led strip to the outputs and the ground to the microcontroller and 12v powersupply.
simulate this circuit – Schematic created using CircuitLab
note.: i use a industrial 12v 10A/5A(with a shorter led strip) power supply if everything is clear
btw if i connect the Raspberry that has very low output (20-40mA) on one single 3.3v PIN
how much current sucks each ULN2803 input?
II(on) Input current VI = 3.85 V, See Figure 6 0.93 1.35 mA
So if max is 1.35mA, let's say 1.5mA*8inputs=12mA there are no problems to power them all with just one pin???
And regarding the length of the strip this would also allow me to easely gie power at every 1-2 or 3m to have a nice stable 12v....And so i would have no voltage drop.
What about PWM on 8in and 8out... it could create some errors on the linearity of the PWM signal???
"No, your totally wrong, the reaspberry has not enough mA to power all 8 inputs with one PIN" or "Yes, you can handle 7.5A at 12v and the Raspberry is safe" would be enough as answer.
I'm not a electronical enginer. So sorry for my low knowledge about electronics.
Are my assumptions correct?
AI: I can only answer part of your questions.
1) I simply don't know how much current a Raspberry pin will put out, and Broadcom is very short on information. I recommend this: buy one 2803, hook it up with all the inputs tied together but no load, and measure the voltage at the inputs.
2) I can guarantee that with all the inputs tied together, you will draw less than 12 mA with an input of 3.3 volts. How can I say this? The spec you listed gives an input of 3.85 volts, not 3.3 volts. Lower voltage will give you lower current. But measure it. If the Raspberry cannot provide close to 3.3 volts when driving all 8 inputs, you may have extra problems with point 3.
3) Yes, you can pull 2.5 amps with one chip. I don't recommend it, but you can do it. If you do, you MUST provide a decent heat sink for the 2803. If you just use a bare IC you will burn it out. You should assume something like 1.3 volts across the 2803, and at 2.5 amps, your total power will be about 3.3 watts. The thermal resistance to ambient for this chip (section 7.4 in the data sheet) is 74 degrees per watt, so the heart of the chip will reach (3.3 x 74) + 20 degrees, or about 260 degrees C. Per the data sheet, the maximum is 125 C.
If your input voltage is low, the outputs will not turn on as hard, and the voltage drop across the outputs may be greater. In that case, the power dissipation of the chip will be higher, and you will need a bigger heat sink. But this is something that you will need to experiment with to find out. I suspect you'll be OK, but I'm not giving any guarantees. |
H: How to choose components for a circuit
I designed a simple circuit:
that I would like to put components on - the point of the circuit is to light the LED when the voltage source is above 4 volts (it won't be more than 5), so I am looking for a transistor which would have a sharp on/off state at a fixed voltage (say .7 volts, so I can put in some numbers)
at 5 volts, I will put a 330 ohm resistor for R3 to limit the current to 5v (max) /330 = 15ma across the LED (rated for 20mA)
at 4 volts, I want the voltage for the transistor to be .7V, so I will choose R1/R2 = (4-.7)/.7 = 47:10, or 47k for R1 and 10k for R2, which at 4v would give me roughly 70uA for the transistor (if this is not enough, I can increase it by lowering the resistance values)
all of the above can be tweaked, but now I am not sure how to choose a transistor such that this would work - I can go with either pnp or npn transistors by re-organizing the components, but I don't know what else to look for or how to go from here
P.S. if anyone wants to edit the schematic, it's available here
AI: Solution without the zener (as suggested above):
2 Common emitters in series give more than enough gain so the transition voltage from LED off-on will be extremely small.
Oldfashioned fun with transistors, look, no microcontroller needed :-) |
H: RC network (Filter) output calculation
I have an RC circuit with a transfer function
$$
h(s)=\frac{1}{1+0.0033s}
$$
Is it possible to calculate theoretical output of this network for a set of input voltages? For this how do I solve this equation? Any clue for what transformation to apply and how?
AI: The system represented by this transfer function can react to any number of input functions (like a ramp, a sine wave or any other function you could think of), so the output depends on the transfer function of the system (which we have) and the transfer function of the input signal (which we do not have).
Assuming the "set of input voltages" you referred to are just DC voltages of different values, the input function which translates that is the step function. Physically it can be a DC source being turned on at a given moment. Your system (mathematically, at least) is equivalent to this one:
simulate this circuit – Schematic created using CircuitLab
In the time domain the step function works as follows:
\$ d(t)=1\qquad,\,t>0 \$
\$ d(t)=0\qquad,\,t<0 \$
In the frequency domain (which is what we're working with here, since the variable is 's') we have (by the Laplace transform):
\$ D(s)=\dfrac{1}{s} \$
The output can be obtained straight in the time domain (by using the convolution operator) or in the frequency domain and then converted to the time domain by applying the inverse Laplace transform:
\$ v_o(t)=h(t)*v_i(t)\$
(convolution)
\$ V_o(s)=H(s).V_i(s) \$
Having established that the input is a voltage step:
\$ V_i(s)=V.D(s)=V.\dfrac{1}{s} \$
\$ H(s)=\dfrac{1}{1+0.0033s} \$
\$ V_o(s)=V.\dfrac{1}{s}.\dfrac{1}{1+0.0033s} \$
Taking the inverse Laplace transform we obtain:
\$ v_o(t) = V.(1-e^{-t/0.0033}) =V.(1-e^{-t/RC})\$
The simulation of the circuit presented before (that represents the function you asked about), for a DC voltage of 10V is below:
By changing the voltage (to answer your question) the curve remains the same but the final voltage is the voltage of your DC source.
You can see that the formula for \$ v_o(t) \$ is exactly the one presented in the graph.
I hope I could help you! |
H: Why do we need to use `avr-objcopy` after `avr-as`?
New to assembly, I'm surprised to see that we need to use avr-objcopy after invoking avr-as, in order to obtain an Intel Hex file, so where does this come from ?
AI: The *-as is the GNU Assembler utility, used to produce binary object files *.o. This format is incompatible with the Intel Hex format, which is basically plain text file, containing the binary data encoded with its textual representation. objcopy is capable of extracting the binary information in one format and translating it to another. And it is what it does. |
H: Why isn't this astable multivibrator oscillating?
This is the schematic for a modified astable multivibrator I've built. I incorporated the diodes in order to get a sharper rise time, and therefore produce actual square waves.
Principle of Operation (As I Understand It):
One transistor will turn on first due to minute differences in the gain of the transistor. Assume Q1 turns on first.
1) Q1 Turns on.
2) The left side of C1 is at .7V. The right side of C1 is at 0V.
3) C1 charges through R3 at \$T = R_3C_1\$.
4) When C1's right plate achieves .7V Q2 turns on. Because Q2 was previously off, the right side of C2 was at rail voltage during the previous state. Since the right plate has dropped 5V the left plate also 5V. The negative voltage at C2's left plate is coupled to Q1 holding it off.
5) R4 charges C2 from negative rail voltage to +.7V at which point the states switch and the process repeats.
Unfortunately, this oscillator is producing a standard voltage. This is confirmed by a simulation.
What's the problem? What are the errors in my thinking?
EDIT
See related question here.
AI: The basic circuit is OK but the resistors R3 and R4 are much too low in value. I would expect them to be about about 10 times the collector resistor (500 ohms as it consists of 2 1K resistors in parallel) so 5 k or so. The transistors are so heavily biased into conduction that the cross-coupling (C1, C2) cannot turn them off. |
H: Replacing a SMD inductor, alternatives?
Trying to fix a board that had a SMD inductor. it was labeled L1 on the silk and there was no marking on the part, and I have no schematics. ...or there may have been markings, but someone tried to fix the board before me and plastered the thing on solder. no way I can salvage that part... pic included at the for laughs. (the only part I could read the labeling was R3. probably because it is the less dense than solder so it floated :)
[L1 is right next to C6 there on the right. under that unsightly blob of solder.]
It is used on V+ from the broken USB connector, and then goes to those Resistors/Caps on the right side of the picture and then to the ICs.
I'm going to solder wires and trhu holes compoenents to substitute the damaged ones (because I have nothing SMD here)
Can I just bypass that if I use a USB cable with a ferrite core? ... I confess I'm not really sure what a SMD inductor does there. I always assumed USB had a standard frequency on the power line. is that not the case?
Edit: found the schematics for the USB chip this board uses. The inductor is the one marked L1 on the evaluation board. http://www.nxp.com/documents/user_manual/D12PCKitMan.pdf
there is not spec there. BOM just says "ferrite bead"
AI: Ferrite beads are a common feature on the +5 & GND lines of USB.
They're typically "needed" to filter conducted noise in/out via the USB cable.
By "needed", I mean to pass national/international EMC emissions/immunity regulations.
For a 'quick n dirty' fix, I wouldn't hesitate just to jumper it out.
If you really want to replace it, a ferrite bead in the 60 to 600 ohms @ 100MHz range would probably be adequate. The package appears to be 0805, but photos can be deceptive!
As it's a USB application, at least 500mA current handling ability.
So here's some options for you:
Digikey Ferrite Bead Listing |
H: Output 2 PWM waveforms with 90 degree phase shift
So far, I was able to get two outputs at the correct resolution (35 kHz-75 kHz at a resolution no worse than 0.7 kHz) using the code below. I'm wondering, now, how I can get a phase shift between the two PWM outputs (which both use the 16-bit Timer1 and ICR1).
I tried writing the line TCNT1 += 1/freq/4; in between the last and second to last lines of code (OCR1A=... and OCR1B =...), but this did nothing.
//set port B to output
DDRB |= 0xFF;
// wgm mode 1110 (fast pwm w/ TOP = ICR1
TCCR1A |= 1<<WGM11;
TCCR1B |= 1<<WGM12 | 1<<WGM13;
//set OC1/A and OC1B on compare match w/ ICR1 , clear them at bottom
TCCR1A |= 1<<COM1A1 | 1<<COM1A0;
TCCR1A |= 1<<COM1B1 | 1<<COM1B0;
//pre-scaler = 1
TCCR1B |= 1<<CS10;
ICR1 = 16000000/freq; // input compare value = (clock freq) / (desired freq)
// 50% duty cycle on OCR1A/B
OCR1A = ICR1/2;
//TCNT1 += 1/freq/4; //this line did not do anything
OCR1B = ICR1/2;
AI: If your application only requires waveforms with 50% duty cycle, then you can use the toggle compare output modes to generate a pair of signals with adjustable phase shift between them.
The toggle modes will toggle their respective output each time there is a compare match, so by adjusting the 2 output compare registers relative to each other, you change the phase relationship. You adjust the frequency of both signals together by changing the TOP for the counter.
Make sense?
Here is some demo code for an Arduino Uno. It will output 50KHz square waves on Arduino Pins 9 & 10, and cycle though phase shifts of 0, 90, and 180 degrees - pausing on each for one second.
// This code demonstrates how to generate two output signals
// with variable phase shift between them using an AVR Timer
// The output shows up on Arduino pin 9, 10
// More AVR Timer Tricks at http://josh.com
void setup() {
pinMode( 9 , OUTPUT ); // Arduino Pin 9 = OCR1A
pinMode( 10 , OUTPUT ); // Arduino Pin 10 = OCR1B
// Both outputs in toggle mode
TCCR1A = _BV( COM1A0 ) |_BV( COM1B0 );
// CTC Waveform Generation Mode
// TOP=ICR1
// Note clock is left off for now
TCCR1B = _BV( WGM13) | _BV( WGM12);
OCR1A = 0; // First output is the base, it always toggles at 0
}
// prescaler of 1 will get us 8MHz - 488Hz
// User a higher prescaler for lower freqncies
#define PRESCALER 1
#define PRESCALER_BITS 0x01
#define CLK 16000000UL // Default clock speed is 16MHz on Arduino Uno
// Output phase shifted wave forms on Arduino Pins 9 & 10
// freq = freqnecy in Hertz ( 122 < freq <8000000 )
// shift = phase shift in degrees ( 0 <= shift < 180 )
// Do do shifts 180-360 degrees, you could invert the OCR1B by doing an extra toggle using FOC
/// Note phase shifts will be rounded down to the next neared possible value so the higher the frequency, the less phase shift resolution you get. At 8Mhz, you can only have 0 or 180 degrees because there are only 2 clock ticks per cycle.
int setWaveforms( unsigned long freq , int shift ) {
// This assumes prescaler = 1. For lower freqnecies, use a larger prescaler.
unsigned long clocks_per_toggle = (CLK / freq) / 2; // /2 becuase it takes 2 toggles to make a full wave
ICR1 = clocks_per_toggle;
unsigned long offset_clocks = (clocks_per_toggle * shift) / 180UL; // Do mult first to save precision
OCR1B= offset_clocks;
// Turn on timer now if is was not already on
// Clock source = clkio/1 (no prescaling)
// Note: you could use a prescaller here for lower freqnencies
TCCR1B |= _BV( CS10 );
}
// Demo by cycling through some phase shifts at 50Khz
void loop() {
setWaveforms( 50000 , 0 );
delay(1000);
setWaveforms( 50000 , 90 );
delay(1000);
setWaveforms( 50000 , 180 );
delay(1000);
}
Here are some scope traces of the 0, 90, and 180 degree shifts respectively... |
H: Printing the self designed PCB
I have designed the PCB on Eagle. Most of the components are SMD pakages. This is for the first time i have designed the PCB. I want to print this PCB in the industry (Chinese industry) but i have no idea how this works. What else do i have to mention except schematics and PCB layout. I have designed my own libraries so i am bit confused. I am sending design file with my friend and there is no way to contact any of the officials from the industry. Any suggestion would be appreciated. Thanks in advance.
AI: Follow this tutorial to generate your gerber files. Then zip all the generated files and send them to manufacturer (or upload the zip to their website.) You don't need to send schematics or board drawings; gerber files are sufficient. This website is an example for online pcb quato. They review your gerber files and inform you if something is not OK. |
H: The base resistor of the transistor with speed-up capacitor
I've designed a relay driving cuicuit like this
Under DC the current is limited by R1. R2 is added to limit the current flow through C1 and the base of the BJT when the Q from 0 to 1. Is resistor R2 neccessary? And how to calculate its value?
AI: The resistor R2 is there to protect the CD4013 chip. If it is not present, the chip's output transistors will see a very low impedance to ground (through C1) for a short period of time when they change state and this could damage the chip.
To calculate a safe value, look at the maximum output current from the CD4013 and size R2 so that this is not exceeded when C1 is a short circuit.
As other commenters have stated, a relay is so slow to respond that a speed up capacitor won't have any appreciable affect on the performance of the circuit. |
H: What is a Namespace in SSD?
What is a namespace in NAND or NOR based Flash Memory?
Is it a range of addresses of NVM? If yes, then is it specified by SSD Manufacturer?
AI: Namespace is actually the list of LBAs(Logical Block Address) in an NVMe Dev. It is usually Vendor Specific & is embodied in the NVMe device. Take an example of Intel® Solid-State Drive DC P3700 Series. It says 781,422,768 total User Addressable Sectors in LBA Mode in 400GB capacity. Also, a complete table is given for namespace identification. |
H: Electrical symbols, what does a dot before a triangle mean?
Good day.
Trying to recreate a circuit, but I'm not sure what the dot BEFORE the triangle means. I know after it means invertor, does before just mean it's inverted BEFORE, instead of after? Rather confused, and not having luck searching.
Really appreciate the help.
AI: Just another way of drawing a logic inverter ("NOT").
The triangle-with-bubble is an inverter: logic high input yields logic low output, and vice versa. Usually the bubble is shown on the output, but in a mixed-logic system, the bubble can be shown on the input instead.
When the bubble is on the input instead of the output, that indicates that the input is an active-low input. |
H: Anti Aliasing Filter and the bandwidth selection
I am currently analyzing the raw measurements of a sensor with the sampling frequency of 400[hz]. According to Nyquist theorem, the bandwidth must be less than a half of the sampling frequency, which means less than 200 [Hz]. What will happen if I select the bandwidth as 50 [Hz] or 100 [Hz]?
(I have already tried to design two low pass FIR filters with the same characteristics, but different bandwidths, one 200 [Hz] and the other one 50 [Hz]; I noticed that for the bandwidth of 50 [hz], the pass band gain is not 1 anymore).
Thank you
AI: The FIR filter can only be applied to the signal after it has been digitized, which is too late. You have to apply the anti-aliasing filter before the ADC. That is to say, you need an analog filter.
As far as bandwidth, that depends on your other requirements.
If you know that there's only noise above 50Hz, then you could use a 50Hz lowpass as your antialiasing filter, and reduce the noise at the same time.
Using a lower cutoff also makes the analog filter easier to build. A filter that is sharp enough to remove everything above 200Hz but not mess with lower frequencies (much) would need several carefully calculated stages, and might be difficult to build correctly (oddball part values and what have you.) If you use a cutoff of, say, 100 Hz you could get by with a simpler analog filter than if you really, really need frequencies up to 200Hz. |
H: Replacing the Arduino voltage regulator
I want to replace the onboard AMS1117-5.0 (broken) with a LM7805.
However, the pinout is different between the two voltage regulators; AMS1117: Gnd, Vout, Vin vs LM7805: Vin, Gnd, Vout.
I would like to know what is the best practice of how to approach this? Line-up the Vin and cross the Vout and Ground pins and add some insulation so they dont make contact. How do the experts at EESX do this?
Follow-up: adding the lm7805 using jumper wires works fine with the 12v DC input i have. It is a temporary fix until replacement ams1117 arrive.
AI: Why do you need to change over to a 7805? If you're gonna be bending pins up and using jumper wires, you're cruisin' for a bruisin'. A quick look at the data sheets leads me to believe there is no good reason to switch, other than the possibility that this is all you've got on hand?
If it must be done, here's how I'd do it: bend the large ground tab so that the LDO will sit at a large incline off the plane of the board. Tack it on, then solder your jumper wires from the pads to the appropriate connections.
I do not recommend doing this, just sample a replacement part. You'll get it for free, and have the satisfaction of a job well done. |
H: What is the use of 'event in vhdl?
In vhdl code for synchronous counter, I replaced following part
process(clock)
begin
if(clock'event and clock='1')then
count <= count + 1;
end if;
end process
with
process(clock)
begin
if(clock='1')then
count <= count + 1;
end if;
end process
result remains same. Then why 1st way of coding using clock'event is always recommended. ?
AI: The sensitivity list is mainly a concept used by simulator to schedule the execution of processes. A synthesis tool will usually discard the sensitivity list.
What are the results when running the above code snippets through a synthesis tool? The implementation without 'event will infer a latch, because that's what a synthesis tool "sees" when looking at the code.
Results of Xilinx XST for if clk'event and clk = '1' then:
Adders/Subtractors : 1
8-bit adder : 1
Registers : 1
8-bit register : 1
Results of Xilinx XST for if clk = '1' then:
Adders/Subtractors : 1
8-bit adder : 1
Latches : 8
1-bit latch : 8
The results above where obtained by synthesizing an 8 bit up counter.
EDIT (2015-06-11): In IEEE-1076.6-1999 "IEEE Standard for VHDL Register Transfer Level (RTL) Synthesis" the expressions which "shall represent a positive clock edge when used as a condition in an if statement" are explicitly defined as:
RISING_EDGE( clk_signal_name )
clk_signal_name'EVENT and clk_signal_name = '1'
clk_signal_name = '1' and clk_signal_name'EVENT
not clk_signal_name'STABLE and clk_signal_name = '1'
clk_signal_name = '1' and not clk_signal_name'STABLE |
H: What does this schematic of an Op-Amp and Capacitor mean?
I'm still learning about electronics and electricity.
But I'm puzzled by this question from a past exam.
I'm not sure if any voltage is getting across the capacitor, since Vin and 3v are seperated by the capacitor. Maybe if it was an AC Voltage, but I'm not sure even if that can pass through a capacitor.
I tried calculating Vout and ended up with a negative saturated Voltage.
I have no idea if this is correct.
Any help would be greatly appreciated.
My calculations
AI: That's not a capacitor. It's a battery.
Capacitors look like the following
Notice how the they the plates (horizontal lines) are equal lengths.
The value of this battery is 3V. The node (right side of the battery) is Vin. |
H: Solder wire antenna on XBee Pro u.fl
I'd like to buy one XBee Pro with Wire Antenna, and another with an u.fl connector. The problem is that, on the only website I can buy them, the U.Fl one costs 20 € less than the one with a Wire Antenna: I wish I could keep these 20 bucks.
On the other hand, I've already got two unused XBee with Wire Antenna: I wonder whether I could unsolder the U.Fl connector of one XBee Pro, and instead solder the wire antenna of one unused XBee.
So, Could I just replace an U.Fl connector with a Wire Antenna ? Won't this lower the range ? Are the XBee w/ ufl connector different from XBee w/ wire antenna, except for the antenna/connector ?
AI: The main consideration here is the frequency of operation - if the unused XBee and the one with the U.FL connection operate at the same frequency, you'll be fine. It won't make an appreciable difference whether you attach a U.FL antenna or if you solder the other wire antenna on.
See here for a similar answer. |
H: Why is the signal inverted in a common emitter amplifier?
Why is the signal inverted in a common emitter amplifier?
AI: Why signal is inverted in a common emitter amplifier?
In simple terms: -
If base voltage (input) increases, base current increases.
If base current increases then collector current increases
For a fixed collector resistor, when collector current increases, collector voltage (output) decreases
Therefore output is inverted to input. |
H: Is stalling a DC Motor with rated current safe for the motor?
I know that stalling DC motor can cause overheat because of excessive current.
If i will limit the current to the rated current of motor, is there still issue to damage the motor ?
to be more specific I have 24v worm geared motor and I want to stall it for 3-5 seconds with rated current. I think the gears will get warm, but how critical will it be for the motor.
AI: It depends but it should be okay. The main failure mode in the motor is due to the resistive heating of the windings when current is flowing through them. Since the resistance does not change with speed, the heat generated will be the same whether stalled at rated current or at full speed with rated current.
One issue to consider is that in most DC motors only two coils are energised at any point in the cycle (the six step pattern for 3-phase motors). If the motor is rotating this means that each coil only operates at a 66% duty cycle. When stalled two coils will conduct 100% of the time so the heat generated will not be spread evenly around the rotor. This will also apply to the current flowing through the brushes. Depending on the motor design it may be worth derating the current because of this.
Also note that if the motor relies on forced cooling you will clearly have to derate the current due to the loss of airflow.
Regarding the gear this will not have any issues. The torque output from the motor is directly proportional to the current and since you are limiting this to rated, the gear will be fine provided it is designed for the rated torque of the motor. |
H: How to apply the Fourier Transform to this?
I have the equation \$5\cos(t)e^{-3t}u(t)\$ and the Fourier Transform of it is $$\frac{5(3+j\omega)}{(3+j\omega)^2 + 1}$$ I can't figure out how to arrive at this answer.
Using the FT pairs table, I have \$\cos(t)=\pi[\delta(\omega-1)+\delta(\omega+1)]\$ and $$e^{-3t}u(t)=\frac{1}{3+j\omega}$$
Using the property of multiplication I get: $$\frac{5}{2}\left(\frac{1}{3+j(w-1)}+\frac{1}{3+j(w+1)}\right)$$
I just can't figure out how we go from here to $$\frac{5(3+j\omega)}{(3+j\omega)^2 + 1}$$
AI: As you mentioned:
$$\operatorname{FT}(\cos(t)) = \pi[\delta (\omega-1) + \delta (\omega+1)]$$
$$\operatorname{FT}(e^{-3t}u(t))=\frac{1}{3+j\omega}$$
The multiplication in the time domain is the convolution in the frequency domain with factor \$\frac{1}{2\pi}\$:
$$\frac{1}{2\pi}\pi[\delta (\omega-1) + \delta (\omega+1)] * \left(\frac{1}{3+j\omega}\right)=$$
$$=\frac{1}{2}[\delta (\omega-1) + \delta (\omega+1)] * \left(\frac{1}{3+j\omega}\right)=$$
As convolution of a function \$f(\omega)\$ with \$\delta (\omega-a)\$ is \$f(\omega-a)\$:
$$=\frac{1}{2} \left(\frac{1}{3+j(\omega-1)} + \frac{1}{3+j(\omega+1)}\right)=$$
$$=\frac{1}{2}\left( \frac{3+j(\omega+1)+3+j(\omega-1)}{(3+j(\omega+1))(3+j(\omega-1))} \right)=$$
$$=\frac{1}{2}\left( \frac{6+ 2j\omega}{ 9+3j(\omega+1+\omega-1)-(\omega+1)(\omega-1) }\right)=$$
$$=\frac{3+ j\omega}{ 9+6j\omega-\omega^2+1 }=$$
$$=\frac{3+ j\omega}{ (3+j\omega)^2+1 }$$
Add the factor \$5\$ we omitted in the beginning, and you will get your result. |
H: Use 4-pin S-video cable connector on RGB LED?
I'm hoping to make some 4-pin RGB LEDs (R, G, B, GND) easily hot pluggable, so I'm wondering if 4-pin S-video connectors could be used.
Now, 2 of the pins on a S-video connector are GND, so would it be a good idea to abuse it and connect it to one of the colours? I'm just trying to cause minimal damage if it is plugged to another device with a S video female, and vice versa.
Here's the LED
AI: S-Video isn't very common anymore, at least in the 'states. But still, it could happen. Is this for cable-mount, panel-mount, circuit-board mount? How about something like this?
(source: digikey.com)
Get two of them for each LED.
Trim the LED leads flat.
Insert and very gently solder the LED into socket #1. Keep it cool, plastic will melt.
Solder socket #2 to your circuit board.
Connect them together.
Low-profile, easy, fast. It's up to you to make sure it's connected the right way. There are "keyed" variants of these also which make them only connect one-way. |
H: Fourier Transform using pairs table
I'm trying to find the Fourier Transform of: $$t^2e^{-2t}u(t)$$
I know that from the FT pairs table, $$ FT(te^{-2t})= \frac{1}{(2+jw)^2}$$
So I assume that we can just use the multiplication property and do $$\frac{1}{2\pi}\left(FT(t)*\frac{1}{(2+jw)^2}\right)$$
However when I try that, I do not get the correct answer, which should be $$\frac{2}{(2+jw)^3}$$
Am I missing some kind of trick I can apply here?
AI: Here we can use the property stating that $$\operatorname{FT}(t^nf(t))=j^n\frac{d^n}{dw^n}\operatorname{FT}(f(t))$$
In our case \$n=2, f(t)=e^{-2t}u(t)\$. So \$\operatorname{FT}(f(t))=\frac{1}{2+j\omega}\$. The second derivative of it would be \$\frac{2j^2}{(j\omega+2)^3}=\frac{-2}{(j\omega+2)^3}\$, and I will leave it to you to calculate. Multiplying it by \$j^n=-1\$, giving us \$\frac{2}{(j\omega+2)^3}\$ as expected. |
H: How do I work out the time when given current in a RC circuit?
So this exam question looked straight forward, but I can't get the right answer.
I'm trying to find the time, from when the switch is close,that the current will equal 2mA.
I've used a few formulas but none give the right answer.
What am I doing wrong?
Also the tau and time confuse me a bit.
Any help would be greatly appreciated.
My calculations
AI: This is a rather poorly set question- no information is given as to the initial condition of the capacitor. If the 10uF cap happens to be charged to 12V the current will be 0 before and after the switch closes.
Anyway, what they want you to do is to assume the initial voltage on the capacitor is 0V.
You should then be able to write down the equation for voltage on the capacitor as a function of time (memorize this- it's the solution to the differential equation if you want to do it from first principles).
$$
V_c(t) = 12 (1 - e^{-t/\tau})
$$
where \$\tau = RC\$.
Since you know that the current is \$(12V - V_c(t)) \cdot 2.2k\$ you can solve for when current is 2mA.
Alternately you can recognize that
$$i(t) = I_0 e^{-t/\tau}$$
where \$I_0 = 12V/2.2K\$ (you have this)
so
$$
t = -\text{ln}(2mA/I_0)* RC
$$
and the answer is 'b' 22ms
To get the above line, divide both sides by \$I_0\$, then take the ln() of both sides and solve for t. |
H: Why does a BJT act as an amplifier in the linear region?
I'm covering BJT's in my semiconductor class and in lecture, the professor said that BJTs are used as amplifiers in the linear region. I'm confused because I thought the gain was proportional to the base current.
By that logic wouldn't the highest gain be in the saturation region?
Can someone clear up this confusion?
AI: If you´re just going to switch a large current on/off with a small controlling current (at the base) then you want the transistor to go into saturation.
But if you want the collector current to follow, for instance an oscillating signal at the base, then you want the transistor to stay in the linear region. |
H: Difference between DC-DC Switching "Controllers" and "Regulators" and "Converters" please?
I'm looking for a switching regulator for my design, and I head over to Digikey... Now I'm curious what the general difference is between these categories:
PMIC - Voltage Regulators - DC DC Switching Controllers
PMIC - Voltage Regulators - DC DC Switching Regulators
They both seem to contain very similar devices and I'm just not seeing the distinction.
AI: Switching regulators and switching controllers are very similar, and essentially perform the same function. Both of them are DC to DC converters.
Both switching regulators and switching controllers can be obtained/configured in either buck (output voltage < input voltage), boost (output voltage > input voltage), or both topologies.
The buck/boost mode is useful for battery operated circuits, for example you might have a 3.3v circuit, powered from a 3.6v battery which is initially charged up to 4.2v. The battery voltage drops to 3.3v while in buck mode, and then falls further below 3.3v where it uses boost mode.
The circuits uses a combination of one or more FETs represented by the little switches in the diagrams above) and an inductor to carry out their work.
Switching regulator ICs contain all of the necessary hardware, except for the inductor and a few resistors and capacitors, inside the one chip. In particular, the switch mode FET is inside the regulator. As a result, these chips can't handle too much current, usually only an amp or two, otherwise they would get too hot. Here is a typical circuit for a 24v to 3.3v 2A buck type switching regulator:
With switching controllers, the switching function is done external to the chip. This allows for much higher currents than switching regulators, since the controllers themselves don't have to handle the current -- just the external FETs which can be sized as necessary for the task. Here is a typical circuit for a 24v to 3.3v 8A buck type switching controller:
$$ $$
Switching controllers also offer a lot more configurable options, which is why this circuit is considerably more complicated than the previous one. |
H: How to determine servo signal encoding
I have a TowerPro SG90 servo which matches the "JR" brand wiring discussed here where the servo's 3 wires are as follows:
Red is +
Black is -
Orange is signal
According to that article:
The motor of an analog servo receives a signal from the servo amplifier (inside the servo) at 30 times a second. This pulsing signal tells the servo motor when to start rotating and which way to rotate.
To me this means that the signal wire expects signals that are encoded with both directional and positional information. I'm wondering where I can find the correct signal encoding for my particular servo, or any other servo for that matter. The manufacturer site does not provide any data sheet.
AI: Thought I'd put it in an answer since that's all it is.
Position "0" (1.5 ms pulse) is middle, "90" (~2 ms pulse) is all the way to the right, "-90" (~1ms pulse) is all the way to the left.
Datasheet: http://www.datasheet4u.com/datasheet-pdf/TowerPro/SG90/pdf.php?id=791970 |
H: Circuit in neither series or parallel (is wye-delta transformation necessary?)
I have been trying out this one problem and I just want to know if I am on the right track, because it feels like a large amount of work based on such a simple circuit and it is getting quite messy. I have attached the picture of the problem along with my work thus far.
This is not listed under the wye-delta transformation under the problems section, which is in fact after this section, so that is another reason for my uncertainty. I feel like I may be misunderstanding some concept. Anyway, I appreciate the help.
I feel like ground is indicated by the bottom node, such that 10 + 4 + R are all in series, but that still confuses me as to where to go from there.
Using the method suggested: R = 20 = 60 || 14 + R = (60(14+R))/(60+14+R); R ends up being 16 Ω, which is correct. Are there any other methods for conceptual understanding?
Diagram:
AI: Most of these sorts of problems are drawn in a way to confuse the student.
I would re-draw your circuit like so:
simulate this circuit – Schematic created using CircuitLab
R 5, 6, and 7 are in parallel, and all 12 Ohms, so the equivalent resistance of that group is 4 Ohms.
R5,6,7 plus R3 is 14 Ohms, which is in series with the unknown R4, so the circuit simplifies to
simulate this circuit
Since we want an equivlaent resistance for the whole circuit of 50 Ohms, R2 (60 Ohms) in parallel with R3 (14 Ohms) and R4 (unknown) in series must equal 20 Ohms
The remainder of the solution is, as they say, left as an exercise for the student. |
H: how big my track should be to handle this current
I've read before that each 1 mm\$^2\$ of copper can handle up to 1 A. Is that true? Is there an easier formula than the one used on online calculators that requires temperature and such?
To give more details, I have 3 main points in my circuit where current is going to be at most 500 mA which are now unrelated (to make 1.5 A in total). My tracks' width is 0.02 in which is 0.5 mm. My width is going to be most likely 1 mm (or maybe less, depending on the etching equality which I cannot guarantee) so with my calculations I'll have around 0.5 A with no factor of safety.
My questions are:
Are my calculations correct? Is there a better way to do them?
Any tips or suggestions?
AI: Here's a VERY simplistic analysis:
An inch of a 20 mil wide trace of half-ounce copper will have a resistance of about 0.05 Ohm, and a surface area of 0.02 inch. If you ran an amp through it, you'd have 0.05 Volts, so 0.05 Watts, 50 mW. At a constant current, power would be proportional to length, and so would surface area.
For comparison, an old one Watt axial-leaded carbon composition resistor is about 0.6 inch long and 0.23 diameter. Call that 0.6 x 0.75 in surface area, or less than half a square inch. The circuit board will conduct heat away from your trace more effectively than air would from the resistor.
This really doesn't seem easier than an on-line calculator.
This one seems to work fairly simply: http://www.4pcb.com/trace-width-calculator.html
I put in your requirement of 0.5 Amp, assumed a standard 0.5 ounce copper, and allowed 20C rise (more than the default of 10). Assuming also you start at 25 C room temperature, you get a 15 mil wide trace, whether your trace length is one inch or ten.
You can order boards with heavier copper (1 and 2 ounce per sq ft are not unusual), and the resistance will go down appropriately. |
H: Explaination of high current zener transistor regulator circuit
This is a high current zener TRANSISTOR regulator circuit. I want to know
What does "high current" mean here?
How is this circuit working as a zener regulator?
What is the purpose of transistor here?How is it working?
What is the main component in the circuit diagram?
What is the purpose of capacitor here?
Why is the purpose of resistor here?
AI: Assuming you don't know what to search for, I'll give you this to read for starters.
What does "high current" mean here?
"high current" means that you can draw the maximum current provided from the input with a proper transistor
How is this circuit working as a zener regulator?
the transistor can provide constant emitter voltage, because it has constant base (reference) voltage. for more, read the next link.
What is the purpose of transistor here? How is it working?
Read this
What is the main component in the circuit diagram?
what do you mean by main? they are all required
What is the purpose of capacitor here?
Usually, the output capacitor is set for high current startup load and for further voltage smoothing
Why is the purpose of resistor here?
Read this and this |
H: Pull-up or pull-down at the optocoupler output
For a normal optocoupler with a LED and a phototransistor, we can put the load resistor (RL) at the emitter or the collector of the phototransistor, just like this
But for a high-speed optocoupler with some other digital logic inside, like HCPL-060L, it seems the pull-down version should not work, right?
AI: As you can see in the datasheet, this optocoupler uses a (Schottky-clamped) transistor between the output and ground pins:
This output is designed to be used with a pull-up resistor.
The chip requires that its supply voltage (VCC relative to GND) stays constant, and the output transistor is switched on by raising its base above GND, so it is unlikely that you could manage to do anything interesting with the GND pin. |
H: LM324 Difference / Instrmentation Amp 1mV Signals
I need to amplify 1mV signal from a wheatstone bridge (no DS available). 5kg max weight; output is 1mV/Kg @ 5V. The resistances are 880+880 and 749+749.
Currently I only have LM324 and LM358. And can procure quickly OP177 (others will take a week, which I dont have)
I have tried a standard difference amp (gain 470, 100 and then 1). I have tried the 02 op amp difference amp and finally an instrumentation amp all constructed from a single LM324 chip. The op-amp configurations are from TI SLOA034 http://www.ti.com/lit/an/sloa034/sloa034.pdf. I have used 10k 1% resistors (for unity gain) and 470K, 1K as and when required.
Simulation on Proteus (below) (and the feedback on LM324 on stackexchange) leads me to the conclusion that that it is the opamp that can't perform.
My questions are:
Have I understood the problem correctly (op-amp to blame)?
What parameter limits the the performance of LM324 in such applications?
What is the theory behind the problem?
What is the eventual solution?
Can I use OP177 to fix the problem?
Thanks.
EDIT:
The problem is depicted below in the picture (on the real circuit it behaves almost similar - the o/p volts are in the range of 0.3 - 0.5V the i/p difference is 1 - 2 mV).
In words it is as follows:
The S- input is at 2.500V. The o/p of the amp is reasonably correct +17mV.
The S+ input is at 2.515V. The o/p of the amp is reasonably correct -13mV.
The input at the non-inv pin of the final amp is 1.266V. [Correct]
The input at the inv pin of the final amp is 1.488V. [Incorrect - since both inv and non-inv should be at the same potential, op-amp golden rule. Meaning the o/p is not correct]
The output of the final amp is at 0.4896V. Incorrect, as per the eqn of an instrumentation amp it should be 03 times the i/p difference i.e 3 x 15mV = 45mV.
Hope it is all clear now.
AI: This is a discrete implementation of a classic 3 amplifier Instrumentation amplifier, where the key specifications are Common Mode Rejection Ratio, Input Offset Voltage, input offset current and effective resistor match. Other specifications may be important in a particular application, but these are the dominant issues for standard instrumentation amplifier applications.
The common mode rejection ratio is required to be high particularly at the DC offset from the bridge (usually Vcc/2, and that is one reason that many amplifier parameters are primarily measured at this input voltage) so that small deviations between the two inputs are properly amplified. The input offset current translates into an effective input offset voltage due to source impedance imbalance.
The input offset voltage must be very low, as this is amplified by the gain of the amplifier into an output offset voltage. At a gain of 470, the LM324 typical Vos will yield an output offset of almost 1V (and at worst case over 4V).
The common mode rejection ratio of the amplifier is dominated by the resistor match and therefore needs to be closely controlled.
In this case, the amplifier is simply not suitable for this application. You should use a proper instrumentation amplifier (or a 3 amplifier configuration with suitable specifications).
The INA series from TI (originally Burr-Brown) are excellent choices for this type of application, as are offerings from Analog Devices, Linear Technology, Maxim and other TI parts (most from the National Semiconductor range they acquired).
I have not read the specifications for the other amplifier you specified (OP177), but hopefully this information will help you to evaluate the suitability of the device in this application.
HTH |
H: Avalanche diode circuit analysis of the current load
I have no idea how to work out this past exam question.
I'm kinda sure is that the diode is an Avalanche diode, but I'm not even sure how Zener diodes or this work.
All I think I know is that with a reverse bias voltage they wont break down? And they let some current pass through.
First I thought the IL would be zero, and also because of the voltage follower, Op Amps don't let any current flow through right?
I also tried to calculate total current and I don't know how with a diode in the circuit.
Any help would be greatly appreciated.
My calculations
AI: You make things too complex !
Quick answer without me writing anything down: Il = 4.7V/2.2kohm so roughly 2 mA
More detailed analysis:
The 4.7 V diode is a zener diode, avalanche or however it works doesns't matter.
What matters is that in forward it would behave as a normal diode. But it is operated in reverse, the kathode is at the upper side and the battery supplies 9 V through a resistor to this kathode. This means that there is enough voltage (9V) for the zener to "zener" at 4.7 V. It will now behave like a 4.7 V DC voltage source ! So at the zener's kathode we will have 4.7 V
Yes but R2 I hear you asking. Ha, that's a trick to confuse you ! The other end of R2 is connected to the input of an opamp and what do we know about inputs of opamps ? In general they have a very high input resistance ! Ergo, no current can flow through R2, so basically we can ignore R2, the 4.7 V will still make it to the + input of the opamp.
Now the opamp, I see that it has a negative feedback, the output is fed back to the - input. In such configuration the opamp will try to make the voltage difference between it's inputs 0 (zero). So let's assume that the opamp succeeds in doing so, then there would be 4.7 V also at it's - input and since that is connected to it's output also the output would be at 4.7V. Such a configuration where the output of an opamp is fed straight back to the - input is called a (voltage) buffer. It just copies (buffers) the input voltage at the + input.
So the 4.7 V ends up across R3 therefore
I(R3) = Il = 4.7 V / 2.2k ohm = 2.14 mA |
H: Proteus ISIS Fast simulation
I want to display my output on 3 seven segment displays, I am doing that by serially switching them on and off.
I have taken some help from here :
http://www.avr-tutorials.com/projects/atmega16-based-digital-clock
When I start the simulation, it is showing a warning message:
Simulation is not running in real time due to excessive CPU load. Also, the digits are flickering.
I cannot understand, what should I do so that I get a constant display.
AI: Here's a link to a EDABoard forum thread that explains the error you are experiencing:
Proteus Error" Excess CPU load simulation cannot run in real time"
So it is simply a message from the simulator that it cannot simulate your design in real time and as a consequence it will simulate it at a slower rate. That explains why your display is flickering. On a hardware implementation you would not see that as it would be running real time. |
H: What happens when a power metal film resistor is exposed to higher power?
What is the worst thing that could happen if a power metal film resistor rated for 2W is exposed to 15W due to a short in the circuit? I have seen smoke being emitted but switched off the power supply immediately. If I hadn't, what would have been the end-game? I am using this particular Vishay resistor: http://www.vishay.com/docs/28729/pr010203.pdf
AI: These resistors, according to the data sheet, have "Defined fusing characteristics". This means that the components will act like a fuse at some level of overload and go to open circuit.
There are graphs, starting on page 12 of the linked data sheet, that show the time to interruption as a function of overload power. You did not specify the ohms value of the resistor that that you are using in your circuit but the graphs for the PR02 part series would show you the range of time to interruption (going open circuit). So lets say for example if you were using a 1 ohm PR02 resistor the fusing time can range from about 0.35 seconds up to 20 seconds when the overload is at 55W.
At less than 55W overload the vendor is not willing to specify what the fusing characteristics would be. The most likely scenario is that the resistor would get smoking hot and could very well allow damage to other parts of the circuit. The resistor is supposed to be built in a manner that it will not sustain flaming (at least the coating is flame retardant) but the generated heat could very well cause adjacent non-flame retardant materials to catch fire. |
H: Why is serial EEPROM preferred over parallel EEPROM?
In the wikipedia page for EEPROM: http://en.wikipedia.org/wiki/EEPROM it is given that "Parallel EEPROM devices typically have an 8-bit data bus and an address bus wide enough to cover the complete memory" and also "Operation of a parallel EEPROM is simple and fast when compared to serial EEPROM". In that case why are serial EEPROMs becoming more popular than the parallel EEPROM?
AI: It is very simple. Number of pins and cost of packaging.
EEPROM devices are primarily used to store parametric data or characterization constants for a device. The typical scenario is to write very seldom and read typically once each time the host device boots up. For this type of application the relatively slow writing times of EEPROM are of little concern. And the reading time to load at most a few K-bytes of data from a serial device (SPI or I2C) is not normally an excessive time impact.
There is another factor that has played into the popularity of serial devices over parallel devices. That has been the migration of MCU devices from older microprocessor units with parallel busses to the much more prevalent modern types that have all their program storage memory and data memory built right on the chip. Often there is no longer a parallel bus option directly available. And in most applications there is very little interest in using up scads of pins to bit bang to a parallel peripheral. |
H: why there is no quad 1-to-4 demultiplexer?
I have 4 input signals to route on 4x4 outputs. it's not a 1-to-16 demux what i'm looking for. Outputs must be selected 4 by 4.
is there any demultiplexer that can do that on one IC ?
I didn't find quad demultiplexers, I only find dual ones.
like: this
AI: In the days when it made sense to put such simple logic on its own chip, the standard package was the 0.1inch pin spacing DIP. Standard packages were 14 and 16 pins, later 20 pin packages were added; anything larger than this was an expensive oddball.
So count up the pins you'd need for this circuit:
16 inputs
4 outputs
2 selects
probably an enable or output tristate (G) pin for expansion
2 power supply pins
Probably 25 but an absolute minimum of 24 pins.
So you're looking at an expensive 28-pin package and a vanishingly small market compared to the commodity parts, which do the same job in two 16-pin parts.
Simplify your inventory, reduce costs and live with the tiny extra board space.
When PALs and later FPGAs came along, you could roll your own (with no Enable!) and the same 24-pin part (probably a 22V10) could fill several roles on the same PCB, so you could buy in enough quantity to make its high price acceptable. |
H: I'm looking for a specific replacement PCB module connector
I wonder of anyone here may be able to help. I've been looking for some time now for a replacement for an old (c. 1980s or early 1990s) PCB module connector. I'm looking for anything similar in order to connect these modules to the PCB. I've tried looking for the part no. and also tried image searching. What I am trying to do is connect these modules to updated and modified PCBs, but to do that I need to find a similar connector type.
The actual connector.
The module.
Detail of connector showing terminal block.
If anyone can help me identify and find a replacement for this connector, I should be very grateful. Many thanks!
AI: Are you really sure you searched for everything?
((EDIT: I do not mean to be mean there ^^, I just meant: Searching can mean a multi-stage process))
First search for "Siemens NTIO" brought this in the top 3 results.
Which then as a document name and unit descriptor has a full Siemens internal product series number (K21-06.50) and the identification of "NKOD"/"NKODH" and "NKID"/"NKIDH".
Searching for those letters and/or internal product numbers leads me toward a myriad of websites with names like "http://www.hobbielektronika.hu/", hosting PDFs about modules or connectors. This particular website seems to sell a load of stuff, but I can't read it. But if they have the PDFs, chances are they have something or will likely know (e-mail or call!) how or where to get stuff.
It does seem to be a Landis & Staefa proprietary internal type, but with 100's of websites particularly pointing at repair or hobby use, I'm betting in any corner of the world there's going to be a few. Since I don't know which languages you speak, the last half of that path is up to you.
As a first hint, these people seem reasonably professional and have a lot of stuff in similar series, they hosted a NKODH module PDF in the first search I did after the PDF, which also showed the NTIO module connected to it.
Same EDIT as above:
I also opened an RS-Online which came up in the search, they have a lot of visually similar Siemens stuff. I had a meeting so I posted before I walked all tabs. But I hate their website, so I didn't try to find anything there, but you could try to. |
H: Does biphasic wave mean current is bidirectional?
Does biphasic wave mean current is going bidirectional in a circuit?
AI: From what I can see, yes, the current flows in two directions during different parts of the defibrillation impulse. That is, there is a polarity reversal.
See the diagram on the linked site: |
H: How to bypass S-type connector for connecting a servo to an MCU/SoC
I have a TowerPro SG920 servo that I'd like to connect to an MCU/SoC (Pi or Arduino).
However, the servo has an "S-type" connector (see pic above) and its 3 wires (red, black and orange) are bound/glued/stuck together. In reality I need the three wires to go to 3 different locations, so can I just cut off the connector and pull the wires apart? Or does some kind of special care need to be taken?
AI: In reality I need the three wires to go to 3 different locations, so can I just cut off the connector and pull the wires apart?
Yes. If you don't want to cut the connector off, you can lift the locking tabs and pull the wires out. The connector is a standard 0.1" header.
Alternatively you can use a standard 0.1" header to make an adaptor or extension cord without cutting the original. |
H: Why does my PWM amplitude vary with duty cycle?
I'm controlling a 4-pin PWM fan from a 5V PIC and before going too far I'll say that everything is working fine but I'm just not understanding what I'm seeing on my scope.
The fan has a 12V supply and an internal pull-up on its PWM control line, so I'm driving it from the PIC's PWM output via a 2N7000 MOSFET. This is the schematic:
During testing, I hooked up my scope with one probe on the fan's PWM line (i.e. the drain of Q1) and another probe on the output from the PIC (i.e. pin RC5 or the gate of Q1).
So with a 25KHz PWM with 90% duty cycle (active low from the PIC because it's inverted by Q1), I get the following, which looks ok (the top yellow trace is the fan's PWM and the bottom blue trace is the PIC's PWM):
However, as I reduce the duty cycle, for example to 30%, the amplitude of the fan's PWM drops:
And at 15% duty cycle:
Like I said, it's all working ok, I just can't understand where this drop is coming from. I took a few measurements and plotted in Excel, which looks like this, with duty cycle on the x axis and the voltage across the drain and source of Q1 on the y axis:
I don't think it's a measurement artifact of the scope because the PIC's PWM shows a solid 5V at every duty cycle, but I don't see why the behaviour of Q1 should change just because of a different duty cycle. So is this something unknown that's happening inside the fan's circuitry or have I misunderstood something?
The technical data for the fan shows a performance curve like so, which is of a similar nature to my Excel chart:
If anyone can help me to understand what's going on I'd be very grateful. Even if just to say that it's something unknowable inside the fan, at least I'd know that I've not done anything wrong.
UPDATE
Ok, just to round this off, I removed the fan and added a 100K pull-up to +12V instead and indeed I do now see the full 12V at every duty cycle. For example, compare this with the previous 30% trace:
So it seems that the fan itself is doing something to alter the pulled-up voltage depending on the duty cycle on the PWM control input. I'm happy with that but if anyone has any insights into what the fan maybe doing and why, it may be useful information for future reference. FWIW I can't find anything on the manufacturer's web site that gives this sort of detail.
AI: It might be possible that the PWM input is only a controlling input for the fan which means that some hidden circuits inside the fan do the "real" controlling of the fan and maybe also vary the voltage together with the duty cycle. I've seen something like this before. |
H: Serial XOnXOff handshaking
I have the following code running on an atmega328 (ArduinoUno).
#include <stdint.h>
#include <avr/interrupt.h>
#include <stdbool.h>
#include <util/delay.h>
volatile bool receiveQ = true;
volatile bool transmitQ = true;
ISR(USART_RX_vect)
{
uint8_t byte = UDR0;
if( !receiveQ && byte != 19)
{
return;
}
switch ( byte)
{
case 19:
receiveQ = true;
transmitQ = false;
break;
case 17:
receiveQ = false;
transmitQ = true;
break;
// process incoming data
default:
break;
}
}
void transmitByte(uint8_t byte)
{
while( !(UCSR0A & 1 << UDRE0));
UDR0 = byte;
}
void transmitString(char *pstr)
{
while( *pstr != 0)
{
transmitByte(*pstr);
pstr++;
}
}
int main(void)
{
UBRR0H = 0;
UBRR0L = 103;
UCSR0C |= 1 << UCSZ01 | 1 << UCSZ00;
UCSR0B |= 1 << RXEN0 | 1 << TXEN0 | 1 << RXCIE0;
sei();
while( 1)
{
if( transmitQ)
{
transmitByte(19);
transmitString("data");
transmitByte(17);
transmitQ = false;
};
_delay_ms(1000);
}
return 0;
}
I want it to implement XOnXOff handshaking, and my question is if I am doing it correctly.
When I set up communication with PuTTY, I first see "data" that is sent by the Arduino. I then send XOff (Ctrl+S), some data, and XOn (Ctrl+Q), following which the Arduino sends the next "data". And I can keep doing this again and again.
The reason I am wondering if I'm doing this correctly is because I have to manually send the XOff and XOn bytes from PuTTY when transmitting data, although I have set the flow control to be XOnXOff.
However, PuTTY strips the XOff and XOn bytes and only gives "data" when it is receiving data.
Update
The secnario is for real-time feedback control. During each time period, the serial input to the atmega328 is the reference signal. (If no new data is received it uses the previous data.) The serial output from the atmega328 is the sensor value (which is also used by the controller.) I am using the XOn and XOff characters to signal when to start sending the data and when transmission is complete.
AI: As @pjc50 says in a comment, Xon/Xoff is flow control, not block-control.
If a receive buffer is full, the device with that buffer sends "Xoff" to the other device to make it stop talking for a while. So your putty will send "Xon" when initiating, then only send "Xoff" when the port's buffer is full, after which it sends "Xon" again when there's room for new data. It's likely your Atmel is much slower in handling data than your PC, so as an effect it is unlikely the PC will ever decide to send Xon/Xoff to the Atmel on its own.
That said, I do sometimes write logger firmware that "pumps" out data at 1MBit+ and then windows specifically will start whimpering. I have never tried whether it then sends Xon/Xoff, as I often then migrate to direct USB communication, becuase I need the stream, not some "chopped" simile. In Linux, however, I have not had any buffer issues up to 5Mbit on serial interfaces.
EDIT:
As a side note: I have seen many worse things in the world than using Xon/Xoff for handshaking rather than flow control, so comparatively you wouldn't be that bad. But semantically you should use other special characters for block-handshaking procedures. Such as SOH, STX, ETX, EOT, ENQ, ACK, NAK, SO, SI, CAN, EM.
You are also allowed in Ascii to use DC1 through DC4 for whatever you like.
See the Ascii Control Table for more fun names and numbers. |
H: Does JPEG compression is lossy or not?
As I know, generally, the JPEG is consist of DCT, Q ,Huff.
But I'm not sure which one is lossy? all of them? of just Q?
I think Q is lossy but else not. I just want to know that.
AI: The quantization stage is the lossy one, a number of bits is assigned to a certain DCT coefficient. The ones which are not noticeable to the human eye are assigned the least amount of bits. |
H: What is the relationship between DMX and RS485? Are there any breaks in the protocol in relation to one another?
As far as the DMX is RS485 and at what points one moves away from the other? breaking the standard/protocol?
AI: Basically RS485 is a description of a bidirectional communications hardware interface in which devices speak a known, but adjustable baudrate and byte/character encoding is very similar to RS232. How you could send data-packets is described in versions or adaptations of the standard, but it's not very strictly adhered to. RS485 is commonly 2 wire for bidirection, but may some times be 4 wire with one pair in and the other out. But often when that happens it's more likely to be referred to as RS422 as this standard strictly defines those 2 separate pairs.
The DMX standard uses that RS485 (or, for clarity RS422 would be better) standard for its hardware medium description, but that's where it ends.
The DMX standard is very strict: Each pair is unidirectional (like RS422), it uses longer mark and space times between datablocks than specified in computer Serial communication. It then pumps out the bytes pretty much in a similar fashion, grouped per "frame". Its speed is strictly defined at 250kBaud. No device bearing the DMX mark may use any other speed. Addressing is done purely based on the position of a byte in the frame, so to get channel 64, you need to send all the channels before it too. Though there is also a frame number, which can be abused, but that is very commonly not supported by any existing hardware.
So that is a very well defined standard for the software/data level that's incredibly strict compared to RS485/RS422.
So, in fact, only the cabling specification is strictly the same, because DMX prescribes/suggests the use of slew-rate limited drivers designed for the 250kBaud, in stead of general ones that might be able to handle into the Mbits, to prevent some extra noise on lower quality cable (never trust an audio engineer with your electrons!)
EDIT:
So to conclude, it mostly extends, but if you want to see it as "breaking", you could say that the slew-rate (= sort of the rise-time and fall-time) limitation is a kind of breaking as RS485 was probably intended to be as flexible as possible. On the other hand, DMX chose a nice round number at what was then the top of the range and added protections to avoid pick up of "ridiculous" frequencies, that we would now consider for actual data. |
H: Comparing industrial vs. off-the-shelf analog input
Industrial controls are expensive and my company current spends a great deal of money installing them to monitor some rudimentary signals on equipment.
For instance, we're trying to monitor:
temperature from some thermocouples (https://cache.industry.siemens.com/dl/files/991/25545991/att_70599/v1/et200s_2ai_i_4wire_st_manual_en-US.pdf)
vibration (https://cache.industry.siemens.com/dl/files/033/25546033/att_105646/v1/et200s_2ai_tc_hf_manual_en-US.pdf)
Temperature we're monitoring to about the nearest degree (not much precision required) whereas vibration (inches/second) needs more precision (standard value may be something like 0.0048 ips with alarms triggered at 0.400ips).
My question is this: would off-the-shelf hardware like the Arduino/rPI/etc. have the precision to measure these same sorts of signals for a radically lower price point?
AI: Generally it's not the ADC capability that you're paying for. At the end of the day the actual ADC will be working the same way whether you have an Arduino or an expensive PLC.
What you are paying for is what is around the ADC:
Stable / filtered reference voltages
Low noise instrumentation amplification
(sometimes, depending on application) galvanic isolation
(sometimes, depending on application) environmental isolation
Longevity.
Standards.
Most of which you could theoretically achieve with an Arduino (or a Raspberry Pi if you added your own ADC system to it since it doesn't have one of its own), but by the time you have developed the system to give the same kind of performance and stability as the expensive PLC you'll probably find that the costs amount to considerably more than the PLCs.
And then when your system goes wrong, who do you turn to? When your boss says "It's not working" you would then have to find out why and get it working again. Or you can turn to Siemens and say "It's not working" and they can fix it for you. If you have left the company, who is going to keep your system running for the company?
Many environments and industries have strict regulations around what equipment can be used. Getting your equipment certified for use in, say, a petrochemical environment costs vast amounts of money. Probably more than the total you have ever spent, or are likely to spend, on PLCs etc. |
H: NPN transistor: collector current flowing to emitter without connecting base?
I have a circuit where a LED has its cathode connected to the collector of my C8050 (or SS8050) NPN transistor, with the emitter grounded.
Even though the base is left floating, the current is still flowing freely to the emitter.
Applying any current/voltage to the base doesn't change anything.
Here's the circuit:
Is this how it's supposed to work? Why?
What can I do to use this transistor as a switch correctly?
(EDIT: I tried the same circuit setup with two different C8050 transistors, with the same result)
AI: 8050 transistors are made with the Japanese and the American style pinouts- it is not a JEDEC or JIS registered part.
Looks like the one you happen to have has the Japanese pinout.
E C B |
H: Automatic distinction between PC-USB and Wall Adapter-USB
I want to ask if it's possible and an advice on how to make an automatic distinction between an PC-USB port and Wall-USB adapter. I've a battery charger IC (for example http://www.mouser.com/ds/2/405/bq24074-556796.pdf) where I can set max. IN current. I have no problems to set it to 500mA, but I'll always charge the battery at 500mA in PC and Wall-Adapter. But I want to charge the battery at 1-1.5A when I connect it to Wall-Adapter and when I connect it to a PC I don't want to fry PC usb port and charge battery at 500mA. Something like in a smartphone. I thought about sending some data via usb to know if it's an PC or Adapter but I need something more safety and always working.
AI: There are two main ways that USB high current is indicated (Apple's way and everyone else.)
Apple uses a resistor divider to set D+ and D- at various voltages to indicate between 500mA and near 2A charge. 1.1 and 1.5A I think in there. I would have to think if this puts a kink to below if you use an Apple charger.
Everyone else shorts D+ and D- together. Many USB charge controllers handle the detection on the USB data lines. If you are making a one of device, that is an easier route.
For your own detection, tie D+ to VCC with 10k resistor. Tie D- to GND with 100k resistor. Read D-, if high you can pull high current. If low, you can't.
For your Mouser linked chip: Pull EN2 low with 10k resistor. Connect D- to EN1 to enable full current if data lines shorted or 100mA if not. |
H: Metal Film Resistor: Coating Reliability
I am using this Power Metal Film Resistor - which as per the datasheet, is coated with a "red, non-flammable lacquer which provides electrical, mechanical and climatic
protection". Now, on my PCB, I have two vias to GND placed underneath the power resistor placed for thermal relief in case the resistor gets heated up. Maybe that was my mistake, but the interesting thing is, part goes in to the field and is returned because smoke starts emitting from the resistor. On debug, I realize that the lacquer coating of the resistor had been chipped a little exposing the metal body of the resistor. There was very little clearance b/w the resistor and the PCB and in this particular case, the resistor happened to touch the via - boom! short to GND and resistor began heating up.
Questions:
In this failing part, there might have been friction with another object or some mechanical stress that caused the coating to chip off, thereby exposing the potential problem (promixity to GND via). However, in other parts, assuming there is no friction - should I still expect the coating to come off, either due to normal ageing or due to moisture or thermal stress, etc?
It seems dangerous in general, if the coating of metal film resistors can come off due to mechanical stress - thereby exposing the metal body of the resistor to contact with say, the enclosure for example. Is this a known problem - how is this dealt with or prepared for?
AI: You should not depend on the lacquer for insulation. It could become damaged.
Allowing a lacquered resistor to be in contact with (or even close to) a metal object is not good design. Any potential danger is avoided by preventing contact entirely.
Occasionally you would see toy-type or other low-end consumer products that had haphazard assembly of lacquered through-hole resistors such that they could rub together and short. Not so much a safety issue (plastic enclosure proper clearances and creepages for safety) or it wouldn't pass safety agency standards, but the safety guys don't care if the thing stops working. |
H: Estimate the bandwidth required to transmit 1Mbits/s of data using a modulation scheme which comprises 32 different frequencies and 2 amplitude levels
Estimate the bandwidth required to transmit 1Mbits/s of data using a modulation scheme which comprises 32 different frequencies and 2 amplitude levels
Yes, this is a homework question that ive been trying to do. What i have so far is the following:
I think 32 frequencies implies that i have 32 symbols, and therefore i have 64 bits, i saw somewhere that the number of bits is always 2*(number of symbols).
bps = 1Mbps = baud*bpb from here
=>baud = 1Mbps/64 = 15625
and i also saw somewhere that Band Width = 2*baud = 31250Hz
Is this correct?
-Thanks.
AI: There are two roads: one that lets you understand what's happening, and another that is fast. Let's start with the firts.
please note: I'm assuming 1Mbitps = \$2^{20}\$bps and not \$10^6\$bps.
Your transmitter would divide the bitrate across 32 modulators: each modulator would see a reduced bitrate, i.e. 1Mbps/32 = 32768bps = 32kbps. Since you have two amplitude levels the baud rate and the bit rate correspond: each of your modulators works with a 32kbaud rate needing 65.536kHz of bandwidth (of noiseless channel, Shannon would add). Your total bandwidth is then your number of channels times each channel's bandwidth, i.e. 64kHz*32 = 2.1MHz (approx.).
Now for the fast way: you have a bit rate of 1Mbps, all your modulator's symbols are the same, i.e. 1 bit per symbol, so you can just double your bit rate and get the bandwidth:
2*1Mbps = 2*1.048M = 2.1MHz |
H: Homemade capacitor - crafting and testing
I'm a laic when it comes to electronics, but I want to venture myself in creating things with my own hands.
Looking for that, I found a tutorial that teaches how to make a capacitor with foil sheets and wax paper.
I need to know the formulas and all the variables and how I can safely test it to learn it's capacities (no site that I visited showed any of this.)
AI: If you take two sheets of dielectric (perhaps PET) and two sheets of aluminum foil and roll them into a cylinder you'll get almost double the capacitance of an equivalent area of parallel plate capacitor, because both sides of most of the plates are used.
The capacitance is about
C= \$\frac{2\epsilon_0 \epsilon_rA}{t}\$ where
A is the area of the plates (in meters squared)
\$\epsilon_0\$ is the permittivity of free space 8.8E-12 (fundamental constant)
\$\epsilon_r\$ is the dielectric constant of the plastic 3.4 (look this up)
for wax paper it's similar- 3.7.
t is the thickness of the dielectric in meters (foil thickness does not matter for capacitance, except it makes the capacitor bigger)
You can look up the dielectric strength of the material to get an estimate of the voltage capability (don't get too close to the limit). PET is 400V/mil (1 mil = 0.0254mm). Wax paper is reportedly 30-40MV/m.
So if you roll up 2m x 0.2m pieces of foil and PET 0.004" thick you'd get a capacitor of capacitance ~240nF good for at least hundreds of volts. You can work it out for the wax paper situation once you know the thickness.
You can safely test it with a capacitance meter after making sure it is discharged. Making the dielectric thinner reduces the voltage capability but increases the capacitance.
Commercial parts use thin plastic dielectric and better techniques- a comparable part would cost a couple dollars and be 18mm x 12mm x 15mm. They would also be a better part electrically because they would connect to the edges of the foil so the parasitic inductance would be less. |
H: Why SD card is less durable than internal storage in smart phones?
For instance, Raspberry PI managed to destroy SD card in few weeks. (It seems to be a common problem.) However, internal storage in a smartphone works well for several years (5-years-old Nexus One is still working well). Is the internal storage made by different technology?
AI: Is the internal storage made by different technology?
No, it is often just embedded MMC - which is technically equal to a SD card, just in a BGA package for soldering onto a PCB.
Note that there are very bad quality SD cards on the market, which do not tolerate much writing. I managed to break two el cheapo noname cards in weeks, without writing that much data with my microcontroller.
Using SWAP on SD will break even good cards with wear leveling rather quickly. Flash memory allows only a limited amount of write cycles, and swapping can cause a lot of writes. |
H: Can a photodiode distinguish between daylight and white/blue LED?
I am working with a photodiode that is supposed to detect very tiny amount of LED light(the light will be programmed by an attiny 85). Using different kind of lenses I succeeded amplifying the light amount that will fall on the photodiode. Making use of op amps I could bring the photo detector to trigger an action (start a servo motor) as the small light amount was falling on it.
R1: 10M; Opamp: LM358; photodiode: VTB8440BH; Energy consumption should be as minimal as possible.
Now I have the problem as this experiment only works in dark environment. Since the photodiode has become very sensible with the op amp even small amount of daylight is detected by the photodiode.
The photodiode I make use of is VTB8440BH (Datasheet Photodiode http://www.farnell.com/datasheets/57158.pdf.)
As per datasheet its sensitivity peaks at 500nm. Since the light source is a white/blue LED ( arrnd. 450nm) I have selected this photodiode.
However now I learned that even the wavelength of daylight settles btw 350 and 700 nm. Hence I experience the problem as mentioned above that the photodiode cannot differ between both the lights.
I am aware to avoid this issue I should/might use an Infrared Light source. I have also learned that I might use a filter to avoid daylight however in my case I doubt (not sure though) that only daylight can be disselected filtering the led light.
However I want to do it with an LED. Is there a possibility to avoid daylight and detect white/blue led???
I have already considered interesting discussions however I could not extract the required information for me to address my issue.
how to make a system respond to IR laser?
Poor man's IR obstacle sensor make sense(improve) from signal under daylight
AI: The peak spectral response of your photodiode is actually about 580 nm. So get rid of the blue/white LED, and go with a yellow-green ultra-high-brightness LED. Then get a narrowband filter at about the wavelength of your LED. Thorlabs, for instance, has a good selection for not too much money http://www.edmundoptics.com/optics/optical-filters/bandpass-filters/visible-bandpass-interference-filters/3429/. Don't worry too much about perfect matching of your filter and LED, LEDs usually have a pretty wide (10's of nm) spectrum. The use of a narrow-band filter will be critical in getting rid of unwanted sunlight.
Once you've done that, get a better op amp. If you're trying for cheap, even something like a TL081 will be better than an LM358. You'll have to use a split supply, something like +/- 12 or +/- 15 volts. Get over it. You need a split supply anyways in order to bias your photodiode. If you really don't like providing a higher supply voltage, and LF356 will work fine at +/- 5 volts. Also be aware that you probably should put a small capacitor across your feedback resistor for stability.
This may or may not fix your problem - it will help, but it may not be enough. There are two ways to work around this. The first is to get a second photodiode, and use a different filter on the input, with (let's say) a 100 nm difference in filter wavelength. Just as an example, let's say you use a 580 nm and a 680 nm filter. Both will receive about the same amount of power from sunlight, but only the 580 will get LED power. So you would detect a return only if a) the 580 signal level is high enough, and b) the 680 signal is distinctly lower, like less than 1/3 of the 580 signal.
If this doesn't work, you would need to modulate your LED, and look for the right frequency in the 580 return. The simplest (and least effective) approach is simply to put a bandpass filter on the 580 signal, so only the LED variation gets through. For tougher cases, you need a synchronous demodulator, which sounds scary but can be as simple as an op amp and a FET. See http://www.analog.com/media/en/technical-documentation/technical-articles/Use-Synchronous-Detection-to-Make-Precision-Low-Level-Measurements-MS-2698.pdf, figure 4. This is also called a lock-in amplifier. If you're willing to learn how to use one, you can do amazing things pulling a signal out of noise and background. |
H: Designing an analog circuit that Fourier Transforms or Laplace Transforms an input signal
This is currently my pet project but I am a bit stuck on some problems.
First I'll go over my idea for the Fourier Transform:
The Fourier Transform is defined as
\$F(\omega)=\int^{\infty}_{-\infty}d\omega\ e^{i\omega x}f(x)\$
As it is difficult to make a complex exponential signal, I decided to replace the complex exponential via Euler's equation:
\$ e^{i\omega x}=\cos(\omega x)+i\sin(\omega x)\$
The design goes as follows:
I will have two voltage sources (each being a sine and cosine signal respectively) and a third voltage source as the signal I want to transform. I split the third signal in two, and I take the log of each of the four signals but putting them into a log amplifier. From there I add one of the split signals to the sine signal, and the other to a cosine signal. From there I send the two remaining signals into a exponentiation circuit and add the two (thus multiplying the complex exponential and the signal of interest. Then I send it into yet another op amp to integrate it, thus completing my Fourier Transform Circuit.
Well not quite. There are two issues with this (hopefully my above explanation makes sense). The first is that, although I have a cosine and a sine to replace my complex exponential function, I still have to deal with the fact that my sine function should be multiplied by \$i\$ in order for it to be accurate.
The second issue is that, even if I do figure out the first, I am only transforming my input signal under one frequency value. How would I do it for a spectrum of frequencies? In other words, is there a circuit that allows me to continuously change the frequency of a signal?
Now I will go over my Laplace Transform idea:
This is similar to the Fourier Transform, only you integrate half of the real line and you integrate your signal with respect to an exponential decaying function.
\$F(s)=\int^{\infty}_{0}e^{-st}f(t)dt\$
This is all good as I can just have a charged RC circuit and multiply the signal of interest and the RC circuit signal via the same method described above (through logarithmic addition and exponentiation via op amps).
My only problem with this however, is that again, I am only transforming under one S value (under one \$\frac{1}{RC}\$ value). Is there a way to continuously change the capacitance or resistance values that is not mechanical? I am afraid that sticking a potentiometer and changing it mechanically would be unreliable and unreasonable.
Or maybe I am going about this completely the wrong way? What do you guys think?
Note that I am doing this because I know digital solutions exist such as the FFT via an arduino board or something. I would like to do this using analog circuits.
AI: I think you are going about it the wrong way. Think about what a Fourier transform does: It takes a time-domain signal and converts it to a frequency-domain signal. So what you want to end up with is a set of frequencies with individual amplitudes. Phase can be done also, but it's more tricky and rarely needed in my experience so I'll skip it for now.
Okay, so we want to take an analog signal on one wire and measure its amplitude in each of X frequency bands. Now it's easy. Just distribute the signal to X bandpass filters and measure the amplitude coming out of each. Like this:
simulate this circuit – Schematic created using CircuitLab
There's even a full-documented project for this here: https://sound-au.com/project136.htm |
H: What are these things called in a bode plot
Here is a low pass filter bode plot:
In the bode plot theory, what is K called? What is ω0 called? What do these two represent for a low pass filter? Does K not represent an amplification or attenuation of the main signal regardless of the low pass filter?
A peculiar thing is that the gain which is a magnitude is being divided by K and the frequency axis is being divided by ω0. Why is?
Why does it specifically start from 0.1 on the frequency axis?
AI: K is the gain, and w0 is the cutoff or corner frequency.
For many purposes, frequency is normalized to the cutoff, which is then at (unitless) 1.0. Many filter design equations work the same way. The axis stating at 0.1 is simply because you can't show zero on a log scale. If anything interesting were going on down there, they would have went down to 0.01 or lower |
H: PCB Integrated Chip Question
Hi I am building a PCB using eagle and its the first time I am using an IC. Two questions arose.
Do I need to connect the IC chip's ground, because eagle did not do it?
Do I need to make sure all of the ground orphans are connected?
Thank you guys in advanced!
AI: Basically what this means is that the combination of the isolate and width settings on your polygon are resulting in the plane not being allowed to extend to the pins.
I can only presume that you have hidden the 'unrouted' layer, or hidden airwires for that net, hence the pins aren't showing up as connected. If you type the command ratsnest gnd (where gnd is the name of the net that your ground plane is part of), this should restore visibility of the airwires.
What I usually do in this scenario (in fact I do it anyway even if the plane could have reached) is run wires out from the pin towards where the plane is - they don't have to actually go anywhere else, just a line straight out from the pin. This means that they will always become connected and you never run into the issue.
As a side note, just as a bit of friendly advice, I would always try to make sure your wires come out from the pins of the chip in the same direction as the pin - for that chip it would be either vertically or horizontally (0 or 90 degrees). While in part this is to make the design look neater, it also means the wires don't get closer than necessary to the adjacent pins. |
H: Can I tell if the HC-06 bluetooth is connected?
I seem to see that the HC-06 device behaves like a serial device with TX/RX. I also understand that this needs to be "connected" to a blue tooth master to send/receive data. Is there a way that I can tell from the HC-06 end whether or not it has a connection to its partner?
I plan to drive the HC-06 through an Arduino.
AI: There are two ways, due to the limited HC-06 AT command set and lack of hardware support (This varies by revision or carrier board, your milage may vary). I got my limited information from http://mcuoneclipse.com/2013/06/19/using-the-hc-06-bluetooth-module/
The first is by connecting to the high end of the led on the carrier board (or to pin 24). If it is blinking/switching on and off, it is not paired. If it is a steady high/solid light, you are paired to the pc.
The second is to send an AT command. For example, if you send AT when not paired, you will get back OK. If you send AT while paired, you will not get a response. You can use this to know what is happening. |
H: Can you implement WLAN on a ZigBee chip?
I've spent my afternoon browsing around the web looking for a microcontroller that has integrated WLAN (802.11), but I haven't managed to find any on the market. There are lots of cheap microcontrollers on the market that work in the 2.4 GHz band and usually they support the ZigBee protocol (802.15).
Since these chips work on the same frequency and some of them use the same modulation that is employed by WLAN, I'm not sure if it's possible or not to implement WLAN using these chips. I know ZigBee is a totally different protocol, but does this mean that they actually don't support any other protocol, or does it mean that it isn't impossible but I'd have to sort of "reinvent the wheel" and build my own networking stack from scratch?
AI: No, you can't use a Zigbee specific processor in a 802.11 WLAN. They're not reprogrammable.
You might want to take a look at the ESP8266, which is a (slow) Wifi module that seems to be reprogrammable.
Adafruit Link to a Module https://www.adafruit.com/products/2282
Instructables Link to a How-To http://www.instructables.com/id/Getting-Started-with-the-ESP8266-ESP-12/ |
H: Where exactly does the ground line go in an AC-DC power supply?
I'm working in the United States. I'm looking into working with mains power, and I cannot for the life of me figure out where the ground line connects. For example, a simple power regulator from mains power:
Assuming that I'm using the standard mains, there are three pins. Two are "hot", and one is "ground". I understand that the two "hot" pins carry the AC and the ground pin is used to divert current in the case of a short circuit (I think?).
I've heard people say that "ground" should be attached to the case.
Where do I solder the ground line, with a metal and a non-metal case?
AI: Two are "hot", and one is "ground".
This is incorrect. One is "hot". One is "neutral", and the third is safety ground.
My question is: if I'm building the circuit shown, where do I solder the ground line?
If the case is metallic, you should bond the ground wire to the case. This prevents the case becoming energized and electrocuting your users. (Because if the hot wire comes loose and contacts the case it will throw a breaker)
If your case is plastic and is "double-insulated" then no ground wire connection is required.
Since the ground wire is usually only connected to the case, it isn't normally shown in schematics for the circuits inside the case. |
H: Powering a Raspberry Pi using 15A supply
I'm trying to power a Raspberry Pi off a 5V, 15A power supply. Measured with a multimeter, the voltage is actually a little more than 5 - ~5.25V. I've never powered a Pi with anything more than 2A, so will this be a problem long term?
AI: No, your supply will only supply the current your load (raspberry pi) actually requires. The Amperage rating is the maximum current your supply can supply. |
H: Old-School RJ11-Based Phone
On an old-school RJ11-based telephone system, which of these statements is accurate:
1) Each wire contains a waveform constructed from the sounds detected by one party's handset
OR
2) One wire is the signal and the other is a ground wire
?
I say #1, but this homeless man I'm arguing with says #2.
AI: The more correct answer is #1.
Vastly simplified explanation follows:
At the Central Office (CO), there is a transformer with a split winding. Sort of like a winding with a center-tap, except that the two wires that would be connected together to become the center-tap are, in fact, isolated from each other.
One of those middle connections goes to ground, the other goes to -48 Vdc. The outside connections of the winding go to the customer premises via twisted-pair wire. Because the DC supply is fed to the mid-point of the transformer windings, there is nominal -48 Vdc between the conductors on the wire pair.
The telephone at the customer premises uses a carbon microphone (or modern equivalent) which changes resistance as speech sound waves hit the diaphram. This modulates the current in the line. Another circuit picks up audio between the conductors to feed the earphone in the telephone handset.
Note that I am leaving out many details (off-hook detection, the hybrid network at the telephone that reduces the amount of talk audio in the earphone, many other details.
The bottom line is that the telephone line looks like a balanced audio circuit with a DC voltage offset superimposed upon it. Thus: audio is present on BOTH wires in the pair as a differential signal. |
H: Wiring +5V to Micro USB
I'm wiring 5V from a power supply directly to a micro USB cable. I'm only using the +5V and GND connectors, and leaving Data+ and Data-. While I only plan to use the cable for power, do I need to do anything with that D+ and D- cables, or can I leave them disconnected from both ends?
UPDATE I should clarify that the USB cable is connected to a Raspberry Pi, not a basic circuit.
AI: You can leave them open.
Think about it this way - if nothing is plugged into the USB port they are essentially not connected to anything anyway. |
H: RF Energy Harvesting
Why can energy invested in RF radiation not be harvested fully? What are the main factors that affect this? Is there any significant research nowadays that fully describes this process? I stand on the conclusion: "Energy moves from one form to another.", but in this case why can it not be harvested in that quantity to use it for powering low-power devices or store it in significant quantities in some batteries for later use? Why is it not profitable nowadays and why is it not used today like energy from water, wind and other energy sources?
AI: Consider an antenna that converts all the electrical energy from a power oscillator to an electromagnetic radio transmission. Let's say 1 watt is fed to the antenna and 1 watt is the emitted radio wave power.
That power is flung out in most directions; just like a lightbulb emits light power in (virtually) all directions. The lightbulb isn't just a similar example it is exactly the same example - the light emitted is an electromagnetic wave.
Now imagine you are 1 metre from that lightbulb with a 100% efficient solar panel. Then imagine that you build several solar panels that exactly and totally shroud the lightbulb. You wire the solar panels in series and see how much power you can extract. Well, for this thought experiment, you can actually extract 100% of that power.
Then you stand 10m away and do the same. Obviously you need plenty more solar panels but, assuming the light emitted is totally hitting the panels and there is no leakage of light beyond those panels, you will receive 100% power.
So it can be done, but at great expense and inconvenience. But not too much of a problem with a pencil sharp laser beam and a 100% efficient solar panel. If you can focus the light sufficiently you can collect ALL the energy, Remember this is just a thought exercise and solar panels and lamps/lasers are far from 100% efficient.
Going back to a transmitted radio wave, you could build a parabolic dish and transmit at a sufficiently high frequency to be able to focus most of the power onto a receive antenna (another dish). This is done across the country by military and telecom people to get line-of-sight data and voice comms that are "largely" private in that it's hard to "steal" a listen to what is being transmitted unless you are up-close to the antennas and picking up a small side-lobe of energy.
For the rest of all the transmitters broadcasting, they are generally dipoles and spread their energy emitted in all directions in at least one plane. This allows music stations to be picked-up quite easily and that, of course, is the aim.
Can you easily harvest that energy? Not very well because the power is largely flying off into space and only a fraction is received by "listeners".
Each listener's antenna is effectively a net (i.e. it has a real "area" despite its long thin shape) that captures power sent from that transmitter and the amount it captures is femto watts usually. Normally, an RF receiver (at the risk of being too general) can work with about 10 micro volts received from the antenna and, averaging across a broad sample of antenna types, this voltage will have a source impedance of about 50 ohms.
The power liberated is therefore 5 uV squared / 50 = 5 femto watts.
Obviously the closer you are to the transmitter the greater the power that can be liberated but, if all you are interested in is getting usable power then use wires.
If you did the math on the sum total of energy that can be harvested at any one point on the earth you wouldn't find many places where more than a couple of milli watts can be gleaned.
Solar power and RF energy harvesting are basically both forms of the same thing - electromagnetic wave harvesting.
Even when we stand by router? I read that some routers gives up to
80mW
Routers typically use quarter wave antennas and to collect energy you could also use a quarter wave antenna. The realistic distance you can get up-close is about lambda (1 wavelength) before you start causing strange loading effects on the antenna. This is a distance of about 0.1 metres so, using the Friis transmission equation converted to dB: -
Loss (dB) = 32.45 + 20\$log_{10}\$(f) + 20\$log_{10}\$(d)
Where f is in MHz and d is in kilometres. This equation tells you how many dB of power loss you can expect at a given distance with a given carrier frequency.
For 2.45 GHz and 0.1 metres (0.0001 km) the loss is 32.45 + 67.6 - 80 = 20 dB.
But the tx and rx antennas have about 4dB gain between them (because they are semi-directional) and so the loss is only about 16 dB.
80 mW in becomes (theoretically) 12.7 mW out. |
H: charging battery directly from a source, what could go wrong?
I have a 100A lead acid deep cycle battery and also have a car's 12V 100A charger (alternator with AVR)
At 1500RPM the alternator will produce nearly 100A.. and the battery is directly connected to the battery, will the 100A be pushed into the battery? Or will the battery act as a load and take only what it needs? And how can I calculate the battery's resistance? I don't have the datasheet nor know the brand (unbranded).
I have been searching on the internet and they all just talk about the relation of the batteries resistance to its capacity.. nothing about how to measure it nor about the charging capabilities...
(Can I get a reference on how to measure it please?)
So, is it safe to connect it directly? (The built-in AVR cuts of when fully charged) or do I need a limiter in between?
AI: Okay, lots of stuff to talk about.
The thing about battery charging is that the battery has its own voltage, so resistance is only half of the story. If the charger is at 12 volts, and the battery is at 11.6, then the .4 volts difference is all that is pushing the current into the battery. This small voltage divided by whatever resistance it finds in the cables and battery determines that current. You might see a 100 amp peak, say when starting an actual car. That causes a rather large voltage transient.
And then, that isn't exactly right either. The voltages that you see while charging will be really very close to each other, and what's actually happening is you are replacing electrons in the battery chemistry to make its reaction go backwards. Its just a lot easier to model this mathematically as an ideal voltage source behind some internal resistance.
But the resistance is a real thing. Professional tools actually place a small value of AC current through the cell and take an AC voltage reading across the cell. This and Ohm's law gets you the value of the internal resistance for the pack or cell, wherever you can get terminals to check it. But, generally, this won't matter to you.
Hooking it all up together will work, with the caveat that diode Vladimir mentions needs to be in the line so the battery doesn't discharge through it. It may be built into the alternator already, maybe not. Do check that. What will happen is that when the battery voltage and the alternator voltage are the same, with no other loads connected, no current will flow. |
H: What for is L1 coil?
I can't understand why L1 has four windings? And how we get -12 V if there are two diodes connected towards each other. How will current of -12 V flow?
And do thos fours windings work as transformer?
AI: Yes the four windings are coupled inductors or in other words a transformer. I think it's a construction to generate the -12 V supply from either of the 3 other supplies, +3.3, +5 and +12V. Since the filtering caps are on the right of the 4 inductors, the ripple current will go through 3 of the 4 inductors. This will generate a voltage on the 4th inductor for the -12 V.
The diode on the right looks to me like a safety precaution to prevent the current flowing the wrong way.
The diode on the left had me puzzled a bit as it appears to block the current flow needed for the -12 V. But I think I have an explanation, I think this diode allows the inductor to build op current one way but blocks the other way. What happens when it does that ? Now think of when you control the coil of an electro-mechanical relay with a transistor, you need a flyback diode to protect the transistor because if there is no flyback diode the voltage will increase (coil with build-up magnetic flux but the current cannot flow). I think this voltage buildup is used here to generate the voltage for the -12 V.
Note that on almost all PC/ATX power supplies like these, the -12 V and -5 V cannot deliver much current. Usually 100 mA or so. |
H: What does the arrow on VCC in a BJT bias circuit mean?
At the top, the VCC has arrows on it. What does that mean?
I thought it would be like in other circuits as empty holes that you could attach, but I'm not sure here.
AI: The arrows have no special pointing significance. The conventional symbols used on schematics include the use of the arrow as a symbol for a power supply connection.
If you look around you will notice that there are a variety of different symbols used for power supply connections on schematics. There are also various ways that the associated voltage rail are labeled. Here is a sample of some of the common types. Note that in my example there is no particular correspondence between the label type and the symbol used. This is by no means an exhaustive list either and you can find other usages as well. |
H: Energy in transients vs. steady state
In something like a regular household, how much energy consumed is transient power vs steady state and what kind of frequency distribution does it have, roughly?
I imagine the vast bulk of the energy being in the lower frequencies but have been unable to find any information backing that up.
Aside from curiosity, the reason I ask is I am currently working on an Amp hour monitoring project for off-grid systems using coulomb counting (measuring voltage drop across a current shunt) and filtering that with a low pass filter before ADC, just wondering if this would cause an inaccuracy worth worrying about.
Thanks.
AI: Transients, by definition, are very short period. And (in the context of the vague scenario you describe) they're the effect of either infrequent load switching, or highly periodic 'switch-mode' noise that may result from use of a DC-to-AC inverter, for example, or an actual load drawing non-DC or non-sinusoidal current. The former can probably be ignored without a second thought, due to the comparative rarity of them.
As for highly periodic 'switching noise', well, "it depends" on the specifics of the equipment (inverter?) & load in use. If it were me, I'd want to see at least a voltage waveform, & ideally a current waveform, with the system under various loads, to "see if you have a problem" that needs to be accounted for in your measurements, or not. But my gut feeling is that the energy in any such 'noise' is probably going to at least 2, probably more like 3- orders of magnitude less (one hundredth or one thousandth) energy than the actual steady-state (DC or sinusoidal) load - if that guess is actually the case, then you can make a call as to whether that matters to your desired measurement accuracy. In a "regular household", I'd expect not :) |
H: 4-20mA to 0-3V3 Converter
Looking for a simple design to convert from 4-20mA signals to 0-3V3, I'm thinkin about configuration shown at picture attached.
And I would like to discuss its suitability.
It is based on:
- A follower configuration for a Rail-to-Rail OpAmp, powered at 3V3.
- A 165Ohm resistor to get, 3V3 at 20mA, and 0V66 at 4mA.
What do you think about?
It is any improvement I can do?
Or it would be better to work with another more precise configuration?
It is thought for a low power applications (<5V), but it would like to know if it could work with 4-20mA transmitters powered at 24V too.
AI: It will work. You might want to use a somewhat lower value of resistor so you can detect overrange on the 4-20mA. The offset zero allows you to detect underrange (this is useful for sensor break detection and such like). Of course you lose a bit of resolution on the ADC- 20% on the bottom. You could also use a stage with some gain rather than a voltage follower which would allow an even lower resistor (say 49.9 ohms) to be used and would allow a better performance op-amp to be used (relaxing the requirements to input common mode range includes ground and R-R on the output only).
Take care as to the layout- use Kelvin connection to the sense resistor, especially if you want to have a high accuracy (< 0.1%) circuit and are using a lower value resistor.
The compliance of the transmitter will determine the minimum supply voltage, and your 3.3V subtracts from that, so a lower input voltage is desirable, however too low and you lose accuracy. If several devices are connected in series on the loop then 12v or even 24V may not be enough (the transmitter may require 10V, an indicator another 10V and your circuit 3.3V is getting close even at 24V).
Note that a short across the transmitter will damage the input resistor most likely and probably blow the *** out of the op-amp and likely other stuff too. This can be protected against, at some cost in input voltage and parts. If you put a series resistor on the op-amp inputs it may limit the damage to just the input resistor. |
H: Sizing Photovolatic cells based on solar load
I'm designing a Photovolatic system to power up a certain electrical load (around 1000 Watts). I've just finished my solar calculations determining the optimum tilt angle and the optimum surface azimuth angle for optimum solar energy input over the year.
I picked a MITSUBISHI PV module with the following specifications:
Maximum power rating: 225 Wp
Maximum power voltage: 31.2 volt
Module efficiency: 15%
Aperture efficiency: 16.7%
Dimensions: 1625 x 1019 x 46 mm
Cell type: Monocrystalline
I come from a mechanical engineering background, I need help in the next design stages.
Do I use average yearly solar irradiance or maximum irradiance over the year to size the PV system?
Do I design the system based on module efficiency or maximum power rating?
AI: 1.Do I use average yearly solar irradiance or maximum irradiance over the year to size the PV system?
First you need to determine your load. You say it's a 1 kW. Is it intended to run 24/7? 1 hour per day? You need to determine the kWh/day requirement. Once you've done that, you can look at the PV performance. Be aware that, if the PV modules are fixed, the greatest daily total power you will get from them is roughly the equivalent of 4-5 hours at peak performance. You then need to calculate how many of these cloudless days, or their equivalent, your site will experience. So, for instance, if you can only expect half the days to be clear, you'll need twice as much PV as you think. You also need to determine that longest stretch of cloudy weather you can expect. All of this will determine how much storage (batteries, probably) you will need. And you must assume that battery charge is not 100% efficient, nor is your output inverter, and compensate for that. And finally, you need to take into account that not all batteries can be fully discharged without reducing their lifetime. Standard lead-acids which are discharged to 50% of capacity will only do so a couple of hundred times before they die. You can get deep-discharge or marine batteries which will do better, but they cost more and have less peak current capacity for a given size. At any rate, you should assume you need twice the battery capacity you think you do.
2.Do I design the system based on module efficiency or maximum power rating?
As far as this makes sense based on the answer to question 1, the answer is power rating. |
H: Proton current? and its potential effects in cars and circuitry
Is this statement true:
"Within the (lead-acid) battery, the electric current is primarily due to proton (hydrogen ion) current which is in the same direction as the electric current."
What are the implications of this statement?
Does proton current exist at all in the rest of the car circuitry, outside of the battery?
And what effects does it have, if any, on the wiring, components, fuses, connectors, circuitry, etc. in cars?
References:
How the Current Flows in a Car?
answer mentioning different flow types: https://electronics.stackexchange.com/a/95049/66759
AI: Mobile charge carriers (the flow of which we generally view are electricity) are only electrons. There are 'holes' but those are just abstractions of electrons. As far as battery chemistry goes, it's referring to ion's, which are atoms that have more or less electrons than normal, which makes them non-neutral, and so a flow of ions can cause a voltage and thus current. The statement is referring to proton flow, again this is just an ion in this case (I'm not a fan of the term 'proton current'), but the ion is not flowing through the wires, it is only flowing within the battery chemistry. Current is the flow of electrons, and electrons will not flow without a voltage. A voltage is a potential difference between two areas. So, if all positively charged ions (as they lack an electron) move to the positive side of the battery, and all negatively charged ions (as they have an extra electron) move to negative side of the battery, you get a difference where the one side is more negatively charged than the other, and thus you have a voltage. Connect a wire between the two and you have a current.
As far as anyone is concerned, outside of battery chemistry, all electricity is due to electrons. Though, really, even internally in a battery it's still due to electrons if you think about. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.