text stringlengths 83 79.5k |
|---|
H: Coil inductance measurement
I want to obtain the inductance value from a coil. To do so i'm using a basic RL circuit as follows. The function generator has a 50 Ω internal resistance and the coil resistance is 87 Ω. The coil has a small sticker with it's value (6,24 mH) supposedly provided by the manufacturer. I would like to prove it experimentally to be sure that it's correct.
simulate this circuit – Schematic created using CircuitLab
As we know the voltage that goes through the coil tends to 0 following this expression: \$V_{L}(t)\$=V·\$e^{-t/τ}\$, where $$τ=\frac{L_{1}}{R}$$
What I was doing with the oscilloscope was taking the difference of time between the signal rising start and the moment where the exponential is the 36.79% of the initial value. Then considering this number τ and knowing R value I calculated L1 (L1=R·τ). The result is not the expected and I firmly believe that this method is not correct at all.
What I tried next was similar, taking two points but this time the first one is a little bit after the maximum voltage and the second the 36.79% of the first one. Now with the time and voltage difference between the two instants and the expression seen before I calculated $$L_{1}=\frac{-(t_{2}-t_{1})·R}{ln(\frac{V_{L}(t_{2}-t_{1})}{V})}$$
Again the result is not correct.
I would like to know what i'm doing wrong.
Anyway if you know a different and simple way to measure the inductance experimentally i'm open to sugestions.
Thanks!
AI: simulate this circuit – Schematic created using CircuitLab
Figure 1. (a) Interpretation of original post. (b) Improved measurement technique?
I can't quite figure out how you are taking your measurement but I suspect it is as shown in (a). This has the disadvantage that you are measuring the voltage drop across the internal resistance.
(b) shows an alternative approach: measure the current through the inductor. By using your 1k as a current shunt you should see the voltage across R4 follow an exponential rise curve. When the driving voltage goes positive you should measure the the rise time to 1- 36.79% = 63.21% of the final voltage. |
H: LDO Output Capacitor Selection and ESR Consideration
For a simple application of a voltage regulator with 5V in and 3.3V out, I am looking at these three regulators.
1)AP2127K-3.3TRG1
2)MIC5504-3.3YM5-TR
3)TLV73333PDBVR
They all have different output capacitor requirements.
Regulator #1 (AP2127K-3.3TRG1) Says the following in the datasheet:
"Compatible with Low ESR Ceramic Capacitor: 1μF for CIN and COUT"
And also has this graph of stability range for an output cap of 4.7uF
To me, "Low ESR Ceramic Capacitors" means ceramic capacitors with much lower ESR than 100mOhms. What frequency is this part referring too for it's ESR ratings?
Regulator number 2 (MIC5504-3.3YM5-TR) says this in the datasheet.
"The regulator requires an output capacitor of 1uF or greater to maintain stability. The design is optimized for use with low-ESR ceramic chip capacitors. High ESR capacitors are not recommended because they may cause high-frequency oscillation."
"Stable with 1uF ceramic output capacitors"
I did not see any exact ESR ranges specified. What does this mean? "Low ESR". Regulator number 1 seems to think it's above 100mOhms.
Regulator number 3 (TLV73333PDBVR) says this in the datasheet.
"The TLV733 series is designed with a modern
capacitor-free architecture to ensure stability without
an input or output capacitor."
This means the regulator control loop is stable with 0 ESR caps and I can put any ceramic cap I want on there.
"However,
the TLV733 series is also stable with ceramic output
capacitors if an output capacitor is necessary."
Since these are all the same PCB package, I would like to provide alternate part numbers for the one I choose, but the output cap has to work with all of them.
Questions:
1) What frequencies are the datasheets referring to when they rate the ESR value? Regulator 1 and 2 seem to have different opinions. AVX Corp datasheet lists all tantalum caps ESR at 100kHz. Is this the industry standard frequency for LDO ESR ratings too?
2) I have read app notes that say not to use 0.1uF bypass caps on the output because you can end up with the pole and zero cancelling each other out and the regulator could end up unstable. But most schematics I see have one. Is this because the designer calculates what the zero and pole is or is this normally done in error?
3) Since Regulator #2 says not to use high ESR caps, does that mean regulator #1 and #2 can't use the same output cap? Since #1 would require a minimum ESR greater than the maximum ESR of #2? Even though #2 doesn't specify ESR range.
AI: What frequency is this part referring too for it's ESR ratings?
and
1) What frequencies are the datasheets referring to when they rate the
ESR value? Regulator 1 and 2 seem to have different opinions. AVX Corp
datasheet lists all tantalum caps ESR at 100kHz. Is this the industry
standard frequency for LDO ESR ratings too?
The problem with 'low ESR' is its a nebulous marketing term, if your really interested in finding what the ESR is for the capacitor, the frequency and impedance for the capacitor must be known. Usually that means actually digging through the capacitors datasheet or requesting manufacturer impedance information (by request I mead looking for the information on their website)
Usually they mean 10kHz to 100kHz but this can vary from LDO to LDO there is no industry standard. Its from the voltage control loop and it varies from design to design.
So from a design perspective this means digging through the datasheet and finding the ripple and the ESR of the capacitor that they used and ensuring that the ESR is lower than that value. So I would find the lowest ESR capacitor that is available on the market and throw that in your design. How do you do that? compare some capacitors and find the one that has the best impedance curve or a lower impedance curve than the capacitors recommended.
From ESR stability and the LDO regulator
A capacitor ESR graph looks like the one below, at some manufacturers you can compare these values. or find them in datasheets to get a feel for ESR.
2) I have read app notes that say not to use 0.1uF bypass caps on the
output because you can end up with the pole and zero cancelling each
other out and the regulator could end up unstable. But most schematics
I see have one. Is this because the designer calculates what the zero
and pole is or is this normally done in error?
Remember that instability is only a problem if you have transient loads and at the frequency range of interest. Instead of worrying so much about ESR, you should be worried about ripple and under what conditions this can happen. If you do have transient loads (especially transient from 1kHz to 1Mhz see above plot) and you are concerned about the ripple then you do need to worry about the ESR. If ripple isn't a concern then don't worry about it.
The manufacture is trying to guarantee their ripple specs, they don't want engineers telling them that their products are defective because there is too much ripple at higher frequencies.
If you really want to know where the pole comes from:
The pole is at higher frequencies (as shown in the plot above, which
applies to most regulators but not all). Stated another way, the
system must have sufficient phase margin, i.e., the amount of phase
shift remaining until 360° degree when the gain is at 0 dB. Since each
pole contributes 90° of phase shift and 20dB/decade (or –1) rolloff
in gain, a three-pole, high gain system requires compensation in order
to be stable. A regulator is nconditionally stable (i.e., has
sufficient phase margin) if the open loop gain curve rolls off at
20dB/decade (i.e., like a single polesystem) before crosses 0 dB. The
most common method of compensation is to insert a zero inthe system to
cancel the phase shift and rolloff of one of the poles. Since an LDO
already requires an output capacitor for normal operation, using the
output capacitor’s ESR is typically the simplest and least expensive
method for generating this zero.
Also From ESR stability and the LDO regulator
3) Since Regulator #2 says not to use high ESR caps, does that mean
regulator #1 and #2 can't use the same output cap? Since #1 would
require a minimum ESR greater than the maximum ESR of #2? Even though
2 doesn't specify ESR range.
It might, if they have different types of control loops then you might have a problem specifying the same capacitor. Make life simpler for yourself, sample some LDO's throw them on the board in question (with the same capacitor) and measure the ripple under operation. Use a capacitor with a reasonably low ESR |
H: Calculating the average power dissipated in an AC circuit
This is the question from a very important assignment I am working on: "A load is being driven by an AC source. At a particular time, the voltage across the load is 120cos(wt+50) and the current through the load is 20sin(wt-10). Calculate the average power in Watts dissipated by the load."
My working:
I first convert the current into cosine to give 20cos(wt-100)
Then I use the formula \$\ P=|Vrms||Irms|cos(\theta v -\theta i)\$
which gives me -1039.2 W
I assumed that the question asked for real power since it is the power dissipated in the resistor and thats the only equation the literature gave.
An online calculator gave me a complex number with the real part twice the value that I found. Is this correct? Negative power in a resistor? Where did I go wrong?
AI: An online calculator gave me a complex number with the real part twice the value that I found.
Be careful with online calculators and the inputs they expect. Many AC formulas expect RMS values.
Assuming the voltage and current given in your problem are not RMS, you've done it right.
$$
P_{avg} = \frac{1}{\sqrt{2}} V_o \cdot \frac{1}{\sqrt{2}} I_o \cos{150}
\\
P_{avg} = \frac{120 \cdot 20}{2} * \hspace{2pt} \text{-}.866 \\
P_{avg} = - 1039.2 \hspace{2pt} \text{W}
$$ |
H: What integrated circuit has the capability to control the connection between two I/O pins for signal transmission
I am working on an educational project to play around with computer networking and communication.
I won't be using any official networking protocols and I'm fine with that.
I would like to build a sort of network switch which has the capability to route different nodes to one another.
I'd like to find a single chip solution that has 100's of I/O pins, and has the ability to connect any of these I/O pins to any other using some sort of protocol.
So, if I wanted node 4 to talk to node 20, and node 4 uses pins 20-25, and node 20 uses pins 100-105, pins 20-25 would get connected to 100-105.
At present, it would be possible to use an Atmel microcontroller with 100's of I/O's and turn on and off a pair of transistors for each data line to allow the communication to occur.
However, I would rather save myself the hassle of a thousand transistors and would rather drop hundreds on a single chip solution for the task.
So, have any of you seen the chip I'm describing? If so, what sort of chips should I be looking for, and should I pay special attention to features relevant to the signal transmission aspect of the circuit (parasitic capacitance, inductance, etc.)?
EDIT:
Although crosspoint switches would be nice, I can't find a lot of them with the hundreds of channels I'm looking for. An FPGA would be a nice solution, but I don't know if these devices would allow me to do the routing I wish to do.
AI: Formally this is called a "crossbar switch", which is an actual category of parts you can buy.
The most applicable general-purpose parts to improvise one from would be CPLDs and FPGAs, though you'd be seriously underusing the capability of the latter.
An MCU is generally NOT a good choice for this task except in low speed circumstances, as MCU I/Os could only be universally bridged by the involvement of software, which introduces latency, sample rate limitations, and likely sampling jitter. The exception might be certain MCU's that have a degree of almost FPGA-like arbitrary I/O pin mapping, though that is generally to put any functional block on any pin - any ability to directly map one I/O pin to another would be a sort of side effect. |
H: STM32F4 without ST Link module
I ordered an STM32F4xx board to use it in an embedded systems class a couple months ago. It has arrived yesterday and I figured out it does not have the ST Link module included.
How can I program it? I understand I can get an STLink module, but i would like to know if there is another way.
AI: While you can use the serial or (on the `407 USB or several other interfaces) bootloader, realistically, you should get a cheap SWD adapter.
You can even use a Discovery board for any SMT32 variant for this purpose, if you remove the jumpers that connect the stlink to the on-board target.
While the bootloader gets you only code loading, the SWD interface (with any of ST's Windows software, or on Linux/Mac either of Texane's open source tool, or OpenOCD) gets you code loading and the ability to have a breakpoint debugger. |
H: How does conversion to electricity work?
I'm having a bit of a hard time understanding how electricity is created in the practical sense. For example, when heat is explained , you have the scientific definition of what heat is , and then you have real world practical examples , (like rubbing your hands together , etc).
When it comes to electricity though , when I ask how it is made , I am always told basically 'this uses a generator which creates a conversion' , but how does that work? How is physical work converted into electricity? If I were to start off in nature and had to try to create it on my own , how would I do that?
To me it sounds like you take two magnets and get them to rub together fast enough to create the 'friction' which is electricity
AI: To answer this question, first we must define the word "electricity." Unfortunately, there is no single definition upon which experts all agree. Therefore, asking about "electricity" can only give confusing and obscure answers. (See the tldr; down below.)
But why?
First, the physics definition: "electricity" is the large quantity of mobile electrons of the copper atoms inside the wires. Quantities of electricity are to be measured in coulombs. The word "electricity" means electric charge. Whenever this type of "electricity' moves along, its flow is called "electric current," and is measured in coulombs/sec or Amperes. This is the NIST definition, part of the SI physics-units and the metric system.
But most low-level textbooks disagree totally with the above.
Instead, they insist that "electricity" is a form of energy. They say "electricity" is the joules, not the coulombs. In that case, a flow of electricity is measured in watts, not amperes. In that case, electricity is photons (since the energy in electric circuits is the EM waves; the propagating energy stored in the e-fields and b-fields surrounding circuits.) This kind of "electricity" is much like a low-frequency radio-wave, it moves at the speed of light, and is found in the space surrounding the wires or power lines. It never travels inside wires, instead it travels in the plastic insulation. When this energy flows along, the flow-rate is expressed in joules/sec.
And then, a different group of textbooks insists that "electricity" is the motion of the electrons in the wire. In other words, electricity the amperes. In that case an electric current is not a flow of electricity. Instead, the flowing motion itself is the electricity! Electricity is not like a stuff, instead it's a rate. When electrons stop moving, the amperes go to zero, and the "electricity" vanishes. Yet the electrons are still sitting right there in the wires. But this kind of "electricity" isn't made of electrons or charge, this electricity is the flow-rate, it's the charge-motion. If we move some electrons then electricity appears, stop them and the electricity winks out. (So, electricity is not like air, instead it's more like wind. It's like currents inside a water tank, but it's not like water.)
But under the SI/NIST definition, "electricity" certainly is like air and not like wind. The textbooks are ignoring physics standard definitions of words.
What then does the word "electricity" actually mean?
If we ignore the low-level textbooks, and instead follow the centuries-old scientific definition, then we're forced to say that all wires are full of electricity all the time, because metals are partly made of electricity. Atoms contain equal quantities of positive electricity and negative electricity. In an AC system this electricity moves back and forth, and it never travels from dynamos to distant users. Nobody ever "generates" this type of electricity, instead it only travels in complete circles with no beginning or end. The wires supply it, and a dynamo or battery is an electricity-pump.
And in a simple flashlight, the same amount of electricity is always there ...but when we turn on the switch, the electricity starts moving slowly in a circle, like a flywheel, or like a rotating drive-belt. Closing the switch has enabled the battery's pumping action, and has created a current, but it didn't create any electricity.
Don't like that picture?
Well, then ask yourself this: is electricity something like wind, or instead, is it something like the air? Or, is electricity made of energy, like sound-waves traveling through the air? Three different things, three choices.
We can't look to books for an answer, because their authors figure that, since it's invisible, it all must be one single thing! One author says it's like wind (electricity is the flow,) another says it's like air (electricity is the stuff that does the flowing,) while another says it's the energy (it's wave-motion that propagates almost instantly from place to place.) Taken together, they're essentially saying that nitrogen is sound, and that air molecules are made out of wind. Or something. Amperes equal watts equal coulombs? Which one measures the "quantity of electricity?" It's just a messy swamp of ignorance.
My own recommendation: strike out the word "electricity," and never mention it again.
Then if you want to use the scientific definition, just say "charge" or "coulombs."
TLDR; Your question then becomes: "How are coulombs created in the practical sense?" Answer: they aren't, since the coulombs are supplied by the substance of the wires. During an electric current, it's the electron-sea of the metals which flows along. (Or, in salt water and in human bodies, it's the dissolved sodium and chloride ions which flow during an electric current.) The mobile coulombs are always there inside any conductor. A dynamo or generator or battery is just a charge-pump, and doesn't create the stuff being pumped.
It works like this: thrust a magnet into a copper ring, and the ring of electrons (the copper's sea-of-charge) will turn in a circle. The motion is current, measured in amps. Cut the ring and insert a resistor. When you move the magnet, the resistor gets hot, because the moving charge is basically "rubbing upon" the interior of the resistor, creating a sort of electrodynamic-frictional heating effect. And, we can heat up any metal by holding the metal still, then moving the metal's electrons. (They move best when forced into a circular flow, like water moving inside an aquarium.)
Or, maybe your question really was this: "How can an electric generator convert physical work into some joules of low-frequency electromagnetic field-energy?" Hook your AC dynamo to a large antenna. Crank the shaft, and the joules of 60Hz energy will exit the dynamo, propagate along both wires, and then fly off into space. (Or, perhaps you prefer to swap out the antenna with a resistive load, such as an incandescent bulb or a heating element?)
:)
See, it's not that hard to understand "electricity." But first you have to confront the fact that ...no such stuff exists. Once you get over that hump, the main barriers are gone, and everything starts falling into place.
One final note: take two bar-magnets and a wide copper loop. (Your loop can be miles across.) Squeeze the loop so it forms a long 'racetrack' shape, with two parallel wires in the middle. Move one magnet past one end of the loop, while holding the other magnet near the far end. The other magnet will jerk! The magnets are somehow coupled together. Wiggling one will wiggle the other. One magnet is the generator, the other magnet is the motor. Make your wire loop 20KM long. Still works! That's the basis of the power grid.
The energy is transferred between the magnets via EM waves guided by the wire loop: when you wiggle one magnet, it produces a charge-flow inside the wire, but also produces a charge-imbalance in the two halves of the loop (the two parallel wires.) An EM wave then flies along the two wires, a wave of e-field and b-field (created by the voltage across the wires and the currents inside them.) When the wave crashes into the far end, its energy is absorbed by the magnet, and the magnet jerks. Physical work was transferred almost instantly from the first magnet to the second, as if they were connected by a moving drive-belt hidden inside the wire loop. A drive-belt does exist. It's the movable electron-sea of the metal wires. A magnet can pump it and make it flow. But when it flows, it can produce forces which move another magnet. (If the copper-electrons are like a fluid, then the magnets are like weird canoe-paddles which can pump the copper's fluid into motion.) |
H: Difference between multi layer chip inductor and high frequency chip inductor
What is the difference between a multi-layer chip inductor and a high-frequency chip inductor?
And also what is the difference between rated current and saturation current if an inductor?
AI: Rated Current is the maximum continuous current that the inductor can withstand. Generally the limiting factor for this parameter is the temperature rise of the inductor.
Saturation Current is the current value in which inductor core saturation occurs. This happens because there is a limit to the level of magnetic flux a magnetic core such as ferrite can take. When saturation occurs
the relative permeability falls and in turn this causes the level of inductance falls. The saturation current is generally taken to be the current at which the level of inductance falls by a specified amount - usually by 10%-20%.
There is no specific difference between the two inductors You mentioned. In fact it is possible to combine two and have high frequency multi-layer chip inductor.
As the name says High Frequency inductors are inductors that are made to work at high frequencies. The manufacturer is usually trying to obtain a good benefactor by reducing capacitance and parasitic resistance.
Multilayer means that the inductor is constructed as a stackup of multiple layers of conductive trace separated by ferrite material. The other popular type of chip inductor construction is wire chip inductor.
Multilayer chip inductor:
Wire chip inductor: |
H: Choosing the value of an audio pot
I salvaged a motorized pot from a stereo receiver which I want to use between a CD player and a power amplifier (both devices sit on the same shelf at my workplace). Currently, the line out jacks feed a volume pot through 30+ feet of (cheap) cable, and then another 30+ foot run back to the amp. Nobody at work thinks there is anything wrong with the sound (except for the ground hum), but I was nonetheless able to convince my boss to let me "have at" the sound system.
I like the motorized pot idea because the audio cables will be very short, and noisy environments shouldn't be a problem when driving the motor remotely over long cables (plus multiple control points are possible).
My question concerns the pot's value which is 50k, versus what the vast majority of the audio circuits I've found use, which is 10k. In How do I determine if I can safely substitute potentiometers?, general guidelines are given and I seem to meet them all. All except for: try to stay within a factor of 2 (or 1/2) from the ideal. But this doesn't satisfy; I'm after a more definite answer for my specific application. Then, in What potentiometer should I choose?, I was dismayed to read, "As a rule of thumb, for audio, pots generally range from a resistance of about 10K to around 1 megohm." (I thought we were talking 10k to 50k?)
Since I've found 10k to be the "consensus" value, and 50k to be the "exception" value, it seems reasonable (to me) to make this post. So I ask, "What's the deal with the 10k and the 50k audio pots?" I guess my question comes down to one of degree: how much difference will this make, and in what circumstances? Sound quality is my top priority. If there is a trade-off, I don't want to give up more than 2% to 5%.
AI: simulate this circuit – Schematic created using CircuitLab
Figure 1. A potentiometer between a pre-amp and a power amplifier.
A lower pot resistance will load the output of the previous stage. When DC blocking capacitors are used the combination of the capacitor and pot (C1 - R1) forms a high-pass filter. In most cases the higher the pot resistance the better as the cutoff frequency will fall. (Cut off frequency = \$ \frac {1}{2 \pi \cdot R C} \$.
On the input to the next stage a lower source resistance is better as it will better drive the next high-pass filter formed by the input DC blocking capacitor and input impedance. Note also that R2 in parallel with R1 loads the audio taper somewhat so as R1 increases I would expect the taper to be somewhat skewed. This would only be significant if trying to make a linear fade-in or fade-out while doing DJ at your workplace.
In the end the designer makes a trade-off and 10k is a reasonable value.
I would be surprised if you can hear any difference other than, perhaps, a slight bass roll-off. |
H: Can I apply a 24v DC current to an analog voltmeter graduated between 8 and 16v for a few seconds?
I have an analog voltmeter that is used to monitor 12V batteries, with a needle going between 8V and 16V)
In a specific situation, I have a series/parallel switch which turns two of my batteries into a 24V battery, and I want to make sure that this complicated switch is indeed working (notably, it won't set if there's not enough current in the batteries, which happened to me once in the past).
In other words, I don't care whether I have 24V or 26V there, I just want to make sure that I have, say more than 15V.
I can think of many ways to achieve this, but since I already have a voltmeter with all the cabling in place, it would make sense to use this if at all possible. Of course this would just be very intermittent.
Will the needle go through the roof, or would my voltmeter die a painful death ?
Unfortunately, I can't easily access the rating information of the voltmeter.
AI: Will the needle go through the roof, or would my voltmeter die a painful death ?
It sounds like you have an analogue meter of the moving coil type. You could damage the mechanism by hitting it hard against the end-stop.
One solution is to halve the sensitivity of the meter and double the readings or replace the scale.
simulate this circuit – Schematic created using CircuitLab
Figure 1. The addition of a "multiplier" resistor, R1, allows the range of the meter to be extended.
Measure the resistance of the voltmeter using a multimeter.
Add a series resistance of the same value.
Double the readings.
Addition of SW1 allows you to make a correct reading once you are happy that the voltage is below half full-scale.
This method uses the voltmeter itself as the bottom half of the voltage divider and avoids the parallel resistance problem presented if an external voltage divider is used.
Note that most analog multimeters were 20 kΩ/V so I'd expect yours to work out at about 16 x 20k = 320 kΩ if a standard meter movement is used.
simulate this circuit
Figure 2. A Zener-limited voltage follower limits the maximum voltage applied to the meter movement.
If you can tolerate the 0.5 V drop that Q1 causes then the circuit of Figure 2 might suffice.
Figure 3. The results of a DC sweep from 0 to 26 V.
How it works
Q1 is configured as a voltage follower. The emitter voltage will be about 0.5 V lower than the base voltage.
When the voltage exceeds 16 V the 15 V Zener and LED will start to turn on. This will clamp the base voltage at about 16.5 V and the meter voltage will max out at 16 V. Meanwhile the LED indicates "overvoltage" getting brighter as the voltage increases.
It may be possible to adjust the meter coil via the front-panel adjustment screw, if fitted, to recalibrate the meter and remove the 0.5 V drop. |
H: Do I need ground for RS-485 if it is galvanically isolated?
I am designing an RS-485 communication.
The communication interface is isolated. So, only the noninverting and inverting line will be connected outside to the cable.
I know that I have to include the signal ground for the RS-485 interface to be perfect. However, I am short on the number of terminals I can use.
Will it be OK if the interface is isolated and the noninverting and inverting line is pulled up and down with 47k Ohm resistor?
Will 47K Ohm pull-down resistor some how work level the ground level of the system to same level of the network even if the signal ground is not connected?
AI: Yes it will work. Perhaps 47 kΩ is little too high (it's a very big resistance). It depends on how many nodes you will connect. 47 kΩ is OK for each node, but then you can put additional lower resistance at the both ends.
simulate this circuit – Schematic created using CircuitLab
The Vcc and GND are floating power rails of each independent power source, the shield of the cable is connected to the earth. GNDs of nodes are not connected together as well the Vcc. |
H: power voltage and performance of bulb
What i am seeing in is that when the supply is 220V for the bulb (rated 220V,5W), it glows orange. But once reached 440V supply, the bulb glows bright white. And exceeded, the bulb fuses. I expected bright white at 220V since it was rated 5W(which i guess is the maximum power) at 220V. Was I wrong? And what causes the bulb to fuse out?
AI: 5W mains powered bulbs aren't generally intended as serious illumination, they are more likely to be used as indicator lamps, so failure means you can't tell that some circuit is powered, which could put you in a dangerous situation.
Also, high voltage low power implies very thin wire which makes the bulb very fragile and impacts its lifetime.
Put these factors together - both factors suggest the bulb should be highly under-rated, for decent lifetime but low illumination efficiency and low colour temperature.
I'm not surprised it significantly exceeded its rated voltage, but I'm a little surprised you got to twice its nominal rating before it failed instantly. |
H: Relay to switch 24v dc (low current) with 240v ac mains?
I have a 240v AC main (switched) and wish to control a 24v DC logic with it.
Background: I bought a cheap WiFi enabled (Broadlink chip) thermostat to control my central heating. It's a surprisingly decent unit. However, up on receiving it I realised the output is switched mains, whereas the logic board on the boiler (Ferroli) is 24v DC.
What is the easiest/cheapest way to achieve this?
Thanks
[Note- I realise this is the converse of the typical switching scenario wants and clearly the "cleanest" solution would be return the controller and get a more appropriate one!]
AI: What you want is a relay. There are many available with coils rated for 240 VAC. Now you only have to pick one that can switch 24 VDC at whatever your maximum current is. Fortunately for you, most relays with 240 VAC coils will be able to switch 24 VDC at a few 100 mA easily, but always check the datasheet carefully. |
H: How to determine the max current my USB Charger can safely supply
I have bought a 5 Volts 2 Amps USB Wall Charger off of Aliexpress for about $1.70. Let's call it cheap charger. It looks a lot like this one (stock image):
I want to use this USB charger as a power supply for my project. Said project includes 30x WS2812 (incl. 5050 LED) and an ESP8266. This setup will draw something like 1,3 A of current at 5 Volts when the LEDs are on full brightness.
When charging a phone, the charger will heat up slightly. But powering the mentioned components will heat it up even further (from how hot it feels). This leads me to not trust the rating anymore (the 5V 2A is written on the back of it). This is reinforced when using another 5V 2A USB Charger, that came with a tablet. Let's call this one regular charger. This one only slightly heats up.
Question: Is there a way for me to determine what current my charger can safely supply?
Please keep in mind, that I don't have extensive tooling. I only have a digital multimeter and another (bigger) power supply. The USB connector cable that I also bought there ($0.16) doesn't have wires for D+/D-. So measuring the resistance is more or less impractical.
To differentiate against other questions:
Best way to test a USB wall charger for output current talks about negotiations between devices. I do get at least the 1 A of current but want to know if my supply can provide that steadily.
The answer to Properly testing a USB power supply says "[some USB chargers from eBay/Aliexpress] tend to outright lie about their specifications." Which I believe is true for my charger. Do I really have to replace it?
After the suggestion by @Jogitech I tested the cheap charger and it maxed out at around 1.5 A. The multimeter shows a voltage of around 4,1 V at this point. The LEDs started flickering so I stopped there.
I also tested the regular charger, that came with a tablet (this one is also rated 5V 2A). Using this one, I was able to draw the full 2 A of current while the multimeter still showed 5 V.
Conclusion: Like @user2497 said in the comments, I will be looking for a new power supply, that can actually power the circuit without the constant fear of breaking.
AI: Its hard to say what current a cheap power supply from aliexpress can supply safely. But if the rating says 2A and you only need 1A it should be fine. From your description i assume that the device is not getting too hot to touch for a longer time, which adds to the assumption that 1A load current should be fine. If you want to try a somewhat experiemental approach you can stress the device with say 1.8A (Keep an eye on the output voltage aswell) and monitor its case temperature over a longer duration (until thermal equilibrium is reached). If you are still below or equal 70°C (@20°C ambient temperature) you are totally fine (only valid if the case is non metallic). Have a look at IEC 60950 if you want more detailed Information about how hot the surface of electronic equipment housing is allowed to get. |
H: Controlling led using arduino
I want to control 25 red led (not rgb) using arduino uno. Basically i want to make a led chaser. Can anyone help me regarding this project?
AI: I strongly recommend you to read about serial data and shift registers.You can use a few pins on any micro controller to handle large I/O operations using a shift register.If you're using only 25 LEDs,the digital read function would be sufficient,but if you try to scale the project,it may be too slow,so you can also read about hacking the ardunio to read the digital pins in a much faster way. |
H: N- and P-channel MOSFETs in series
I'm currently trying to build a soldering station. Everybody on the internet uses AC-voltage for that, but I haven't really found the reason for that. So I thought "Well, let's build one and see if it works with DC as well".
At first I wanted to switch the heater element with a single MOSFET, but unfortunately the thermoelement shares a common ground with the heater element. That's why I thought about this design, which is quite similar to an H-bridge. As far as I understand it should do a good job of isolating the SS_GND- and SS_Heater-Pins when I turn Q1 and Q2 off, right?
I'm not too experienced with this type of electronics, so I thought it's better if I ask someone else first.
Thanks for your help!
AI: If you want Q2 to be conducting when IC_P1 is high, you need to wire the output of OK1 to pull Q2's gate to ground, not high as you have it now. N-channel MOSFETs turn on when VGS is positive; P-channel MOSFETs turn on when VGS is negative.
Otherwise, your schematic looks fine. But as others have already pointed out, the fact that the two elements share ground should not be an issue in the first place. You could eliminate Q1 altogether. |
H: What kind of gate(s) can I use for this logic?
I'm trying to combine two digital inputs to get the following output. What kind of gate(s) can I use to get this? I know that no standard logic gate would work. 'X' means doesn't matter.
IN-1 IN-2 OUT
0 0 0
0 1 1
1 X 0
AI: For a circuit like this with only two inputs, it would make this a little easier to analyze if you expand the X:
IN-1 IN-2 OUT
0 0 0
0 1 1
1 0 0
1 1 0
Since there is only one term resulting in a "1", you can write a Boolean expression describing solely that line. In this case, this means (!IN-1) AND IN-2. You can construct a circuit to compute this using an AND gate, with an inverter on the IN-1 input. |
H: Relay sending too many signals.
I have a 555 timer clk output going to the coil of a relay. 5volts going throw the contact. The 5volts is then going to the clock bit of a CD4026 then to a 7 segment display, Seems the relay is chattering as the numbers skip (1,5,9,14,15,18) ect.. , how can i fix this.
i know its something with relay, cause if i put clk stright to CD4026 it counts perfect.
simulate this circuit – Schematic created using CircuitLab
AI: You are experiencing several problems:
No pull-down on the CLK IN input.
Relay contact bounce.
No snubber diode on the relay coil.
CMOS logic has a very high input impedance and acts like a capacitor of small value. If your relay contact closes the input charges up to 5 V and stays there when the contact opens again. What happens next depends on leakage currents at the pin and whether the pin is in an electrically noisy environment. The pin may stay HIGH or may discharge to LOW or may flicker between the two.
D1 protects the 555 and power supply against voltage spikes when the relay is switched off.
simulate this circuit – Schematic created using CircuitLab
Figure 1. The modified circuit.
You need to add a pull-down resistor (because your relay is pulling up) and a capacitor to debounce. R1 and C1 in Figure 1 provide that function. Exact values are not important for your application. |
H: how does RS flip flop works?
I am confused by this question for a long time. Let's say the initial states are R=1,S=0,Q=1,Q'=0, and both NOR gates are ideal (no propagation delay). Then both gates should change their states simultaneously, and we get R=1,S=0,Q=0,Q'=0.
But as the figure below shows, it contains two steps change, firstly R=1,Q'=0 and we get Q=0. Then S=0,Q=0 and we get Q'=1. This is the result in all contexts. I don't understand why it is two steps change.
Thanks
AI: finally I figured it out.
For me, it is quite a tricky question. Previously I assume both R and S are changed/applied simultaneously, i.e, there is no previous states, and Q=1,Q'=0, then I apply R=1,S=0. In this case, if there is no propagation delay, both NOR gates respondence simultaneously. Thus I will get Q=0 and Q'=0. That is an invalid state.
But actually there should be initial states, and R,S should not change simultaneously, also logic gates should have propagation delay. If one signal (R or S) changes at a time, the gate connected to this signal changes first (let's say R changes, thus Q' get new states after the propagation delay t2 of the bottom gate), in the meanwhile, Q and R keep fixed. After Q' get its new value, the top gate (R and Q') get involved, and Q gets new state after the propagation delay (t1) of the top gate. Employ this idea we would be able to get all the conclusion as shown in textbooks.
Actually, as long as t1 not equal to t2, even R,S change simultaneously, the device should still work well (i.e no invalid or metastable states.) |
H: Converting a 4 to 20 mA signal to 0 to 5V
I am trying to convert a 4 to 20 mA signal to 0 to 5V.
Till now I just used a 250 Ohm resistor to convert my signal to 1V to 5V.
Now I am trying to increase the resolution by adding a OpAmp.
When applying a constant voltage it will function but adding my sensor fails.
The first picture fails, whereas the last picture works. Is someone able to tell what I am doing wrong?
Thanks in advance!
EDIT: Final Circuit
AI: R4 and R5 are another load in parallel with your R6 in the top diagram, reducing the total load on the 4-20 signal to 118 ohms. That is a problem.
Before you play with subtracting 1V from the overall output, buffer your 4-20mA signal through an op-amp to get the 1-5V signal, then you can perform additional operations on that.
One thing, be aware that the floor value (whatever voltage you get at 4mA) is often used to determine if the loop is broken or the transmitter has failed. By normalizing things, your floor value will go negative in that case, which could be a problem downstream. |
H: How to find Vce SAT in NPN transistor datasheet
I am trying to find out the VCE value when the collector current is 150 mA (Controlled by the load). the base current is 4 mA. What is the VCESAT value when the base current is 4 mA?
part: BC817-40
Datasheet
AI: If you look at the Figures 10, 11 and 12 you can see a set of graphs for Vce vs collector current at various base currents. Choosing the 4.8mA base current curve as being closest to what you want, you can read the Vce value at around 150mV - 200mV for all three of the transistors at 150mA of current. This is quite typical for a BJT device in saturation.
Note that in practice there is quite a lot of variability in this value between parts/batches and it will change a bit with temperature (as you can see in the other figures 7, 8 and 9). |
H: Is there a pushbutton that does what a latching relay can do?
Is there a small (around 1 cubic inch) pushbutton that does the same function as an NVR (No Voltage Release) switch or a latching relay?
Functions needed:
-Must press button when circuit loses electricity to prevent automatic starting
-Preferably a normally-open momentary
AI: Yes, they appear to exist for the obvious applications (smallish woodworking machinery etc.). Here is a datasheet. |
H: Driving an LED with a low amplitude square wave as an input of MOSFET switch
I am trying to drive an LED with a square wave.
I've made a circuit like below:
The problem is, an equiment can generates a square wave with a limited amplitude up to 1.7 V.
After some experiments, I realized that the LED D1 becomes bright enought if the amplitude of V1 is higher than 2.5 V.
I guess this is because a drain current I_D isn't large enough according to the transfer characteristics of M1, STD12NF06L-1.
simulate this circuit – Schematic created using CircuitLab
I think D1 can be brighter if BJT is used even though the amplitude of V1 is not high enough:
simulate this circuit
The circuit right above is a circuit I imagined by some googling. (I have little knowledge about circuits)
By making a such circuit, a square wave V1 can only act as a trigger signal, and the LED D1 can receive enough current by the BJT.
In short, I want to provide a sufficient current to D1 no matter how the amplitude of V1 is large or small.
Is what I think ---using BJT to provide a constant current--- correct?
If the first is right, which BJT Q1 and resistor R3 can be used?
If the first is wrong, can it be solved by using voltage amplifier near V1?
PS: My final goal is to drive the LED with frequnecy up to 2-4 MHz. Are parts and circuit I am using too slow to achieve such a goal?
AI: Observe the datasheet of your MOSFET, figure 5 "Transfer characteristics" at page 5. Your transistor only starts conducting significant current when Vgs (the gate to source voltage) reaches 2 volts. This is called the treshold voltage. As the amplitude of your signal is quite low, Vgs never reaches a voltage high enough and your MOSFET fails to conduct enough current for the LED to turn on properly.
In order to fully turn on the led, your circuit only needs a small modification: you need to add a DC bias to the gate of the MOSFET. This can be accomplished with a dc blocking capacitor and a voltage divider:
simulate this circuit – Schematic created using CircuitLab
The 47kΩ and 33kΩ resistors form a voltage divider, maintaining the gate of the MOSFET at an average voltage of 5V * 33kΩ / (47kΩ + 33kΩ) = 2,06V relative to the source. Your signal is AC coupled to the gate, causing Vgs to go above and below the threshold voltage and thus switch the state of the LED.
If you need to connect a lower impedance load to the MOSFET (that draws a current higher than a couple hundred milliamperes when on), you need to add a proper gate driver between your signal and the gate of the tansistor. |
H: Send alert tone to pc from microcontroller via serial communication
I am learning microcontroller for couple of weeks. Yesterday, I have learned how to establish serial communication between PC and microcontroller. I can send texts to pc's hyperterminal from mcu and send text from pc to mcu.
Now, one question arises in my mind. It is how can I send control words to pc from mcu, say send an alert tone to pc from mcu? Is it possible?
Thanks. BTW, I am using PIC microcontroller.
AI: This sounds a bit like a X-Y problem to me.
If you just want to produce a sound whenever your MCU detects some condition, I strongly suggest some sort of buzzer (magnetic or piezo). That's simple, reliable, energy-efficient and cheap. Using a computer just for this task is a huge overkill !
However, I suppose you ask the question this way because you want later on to trigger something more involved that needs your computer. The generic way to solve this problem is to write on the computer some always-on program (a "daemon") that talks to your mcu through serial port (or USB or whatever) and does whatever is necessary, whenever necessary : (python example)
import serial
ser = serial.Serial()
while (True) :
if Serial.read()=='a' :
# do something
You could also probably start a standard shell (bash, zsh or whatever is available for your OS) talking through serial port. You need to setup the serial port before that (stty comes to my mind) ; but then you don't need to write / maintain anything on the PC by yourself and you just write commands from your mcu on the serial TX. |
H: pmos transistor acting as pull down device
I have a simple question related to the pmos transistors. Why can't it be used to fully pull down a high voltage signal? Can somebody please help me to understand the electrical characteristics behind that. Is it possible to relate the voltage level to which a pmos can pull down a signal to the characteristics of the pmos device(e.g. Vth)?
Thank you very much for your help,
Helene
AI: A PMOS can be used as a pull-down device, but it isn't because of its poor performance. In books like Rabaey Digital Integrated Circuits they refer to this phenomena as the PMOS passing a strong 1 but a weak 0.
The reason behind this is the regions of operation during pull-up and pull-down.
To synthesize:
Pull-up The PMOS is mostly in linear region
Pull-down The PMOS is always in saturation region
Let's start from case 1, when the PMOS is used as a pull-up device.
In that case:
simulate this circuit – Schematic created using CircuitLab
Initially the Out node is low and In is at Vdd. When In is lowered to gnd, the PMOS starts to charge the load capacitor CL.
At this initial moment, the source S is to Vdd, the gate G is to gnd, and the drain D is to gnd as well (the capacitor is initially discharged).
With these voltages, the PMOS is in saturation region. It stays there until Out goes above In by exactly Vt, where Vt is the threshold voltage. Since In is to gnd, hence 0, the PMOS goes from saturation to linear region when Out = Vt. From now on, the PMOS behaves like a resistor, and keeps charging the capacitor till Out = Vdd. Please note that throughout the whole time, the source to gate voltage of the PMOS, Vsg, is constant and equal to Vdd.
For case 2, when the PMOS is used as a pull-down device, we have:
simulate this circuit
Here the load capacitor CL is initially fully charged with a voltage of Vdd, and the input In is at Vdd. When In goes low, the PMOS start to discharge the capacitor. In this case though, as initial condition we have S to Vdd, G to gnd, and D to gnd. Since the drain and the gate are at the same voltage, namely 0, the PMOS is always in saturation region. As you know, the current of a MOS in saturation region depends solely on the gate to source voltage, in the case of a PMOS the Vsg.
The problem here is that the source pin is the output node (Vsg = Out), which is dropping from Vdd to 0. When Out reaches Vt the PMOS does not conduct anymore, since when Vsg = Vt the device goes in cutoff region.
For this reason, the PMOS can't pull down the output node all the way to gnd, but only to Vt, hence the term weak 0.
In reality, the PMOS conducts a little bit when Vsg < Vt, so it eventually pulls down the output node to gnd, it just takes a long long time to do it.
A perhaps easier way of seeing this is through the IV curve of a MOS, as shown in the picture available on wikipedia:
When the PMOS is used as a pull-up device, you're moving along one of the blue lines, from right to left. The Vsg = Vdd decides which one of these lines to use, while the varying output voltage varies the Vsd. As you can see, if you stay on a single blue line there is a continuous path to 0. No matter how little Vsd is, the PMOS is still conducting current.
When the PMOS is used as a pull-down device, you're moving across the blue lines, from top to bottom. The output voltage is the Vsg, so you go from one line to the other, while Vsd is constant. As you can see, there isn't a path to zero here, because for Vsg < Vt there is no blue line: the PMOS is in cutoff.
Everything I just said can be applied, with duality, to a NMOS. A NMOS is an excellent pull-down device but a poor pull-up device. |
H: What does "desying" mean in polarimetric radar studies?
Do you see these two papers? paper1and paper2
It seems that desying has a special professional meaning in polarimetric radar studies.
I'm reading this paper and somewhere it says:
We present in this paper an improvement to a decomposition scheme using an idea of desying first conceived by Huynen.
I don't want to go through all the details and understand what desying means exactly. I don't read those two papers suggested in the beginning of this question. I just want to have an idea about desying so I decided to ask it from people who are mastered in radar studies.
AI: Since no one else has answered, I'll go ahead and make an answer out of my comments.
Downvotes and corrections welcome. :)
Psi (Ψ) is used in some of the formulas for polarimetric radar as the symobol for an angle that represents the orientation between the target and the radar beam. The 9 parameters that Huynen defines must be derived without Ψ, since they are meant to be used regardless of the orientation. Removing the factor Ψ from the measured data is called desying.
Since Ψ is central to much of what goes on, I would suggest you read at least the relevant parts of the papers you linked to, or perhaps better yet find a copy of Huynen's book Phenomenological Theory of Radar targets in which he defines the term "desying."
The term "desying" makes more sense if you think of it as "deΨing" or "dePsiing."
My understanding of this comes from page 76 of Target Scattering Decomposition in Terms of Roll-Invariant Target Parameters by Ridha Touzi. |
H: Is there a convention for lines separating areas in circuit diagrams?
I often see boxes of various styles to separate areas and increase clarity in circuit diagrams. I'm wondering if there is a line style convention in circuit diagrams for illustrating:
A set of parts located in a particular part of the board? (Such as a high-voltage area)
An optional sub-circuit that may (or may not) be installed.
such as short dash, long dash, long-short dash etc....
If there is none, I guess I should just choose something clear and stick to it consistently. In engineering/ technical drawings they are quite exact about this kind of thing, but I haven't come across anything in electronics.
AI: NEMA has some guidelines for electrical schematics:
There are other options besides dashed lines- especially in the modern era. We can use colors, filled boxes of various shapes and colors with various types of borders etc. Absent a relevant set of standards, I think it's best to just make it obvious and simple, not too ugly, and annotate it as Ignacio comments.
Try to to make it difficult to confuse with the boxes that are used in hierarchical schematics or with component symbols that may show internal circuitry. |
H: Why mosfet is preffered over voltage divider for voltage level shifting
Before writing this question I read several similar threads, but didn't found the answer I am looking for. When we need a voltage level shifter the first thing that come to the mind is a voltage divider. But in certain cases in the industry, a MOSFET inverter is freferred when it comes to digital voltages involving input to a FPGA or Microcontroller.
For example, if I have 5V output from a device to represent Logical 1 where the PMODs of FPGA can read a maximum 3.3V for logical 1, I need a level shifter for sure. Whenver I tried to use a voltage divider circuit as in B of the below image, I was recomended to use A in the image. Even though A ouputs inverted logics and needs manupulation in the software to invert values read, it is always preferred. I never got an answer for that but it could be related to pull up resistor behaviour of the LVCMOS.
So my question is why A is preferred over B when it comes to digital inputs to FPGA and Microcontrollers?
AI: What justinrjy says, plus circuit A draws no current when Vin is low / Vout is high. In many cases (example : UART, i2c...), that's most of the time: significant savings for battery-operated circuits.
You can of course use circuit B with high resistor values, so that the permanent current draw is negligible; but then load impedance and electronic noise does proportionnal damage and switching speed is reduced for capacitive loads (as mosfets are). |
H: Trying to Fix my remote for my house Fan, is this component a fuse?
Decided I would try and fix the remote for this 3 speed fan I have a home since it is summer now. Here's the circuitry I'm dealing with here:
So here our are some notes:
There was some battery leakage when I opened it up, but I cleaned the battery contacts. Would this be harmful to say the ceramic resonator or capacitors?
I replaced the IR bulb with no luck (in the right orientation)
All contacts look good, nothing looks like it burned up
My next move was to replace what I think is a fuse below that NPN transitor. Can anyone confirm that little red thing is indeed a fuse? If so, I have a bunch of these standard green ones lying around that I could put in.
EDIT:: Here's the bottom:
AI: The "little red thing" is a diode. Without physical evidence of damage, it's probably fine. |
H: Are ten 2W speakers as loud as two 10W speakers?
If all things are the same (e.g. total magnet weight, manufacturer, cone material) and I have two 10W speakers as compared to ten 2W speakers would the decibel level be the same?
AI: The key parameter that needs to be the same is the efficiency of the speakers, in terms of electrical power in to acoustic power out. The other things you list (magnet weight, cone material, etc.) are only indirect indicators of efficiency, and there are many other parameters that would apply as well. |
H: Determine the currents in the following circuit
Here I have such a problem. I'm asked to determine the values of currents in this circuit(the circuit is in permanent sinusoidal regim). The double-sided arrow in the image represents the magnetic coupling:
Where: E = 140 V, L1 = 4mH, L2 = 20mH,
R1 = 1 Ohm, L3 = 6 mH, C2 = \$ 500 * 10^{-6} F\$
,\$Z_s = 1 - 2j\$, \$ w = 1000 \frac{rad}{s} \$.
\$ 1mH = 1 * 10^{-3} H \$
C1,C2, C3 = capacitors
\$R_k \$ = resistors
\$L_k \$ = inductors
E = voltage source
The problem is I do not know how to deal with impedance \$ Z_s\$ while composing the system using Theorem Joubert and Kirchhoff in complex.
I hope I was understandable. Thank you in advance.
AI: If you want the equation from what the English-speaking world calls Kirchoff's Voltage Law (KVL), for the right-side mesh of your circuit, it's
$$-V_{C3} + V_{R2} + V_{C2} + V_{Zn} + V_{L3} = 0$$
You will now have to guess (or work out) what direction convention I chose for each element, since you didn't include any polarity markers in your schematic.
Then you will have to substitute in the characteristic behavior of each element for the voltage variables, to get an equation that just depends on the mesh currents.
From there (and the similar equation for the left side mesh) you will be able to solve for the currents. |
H: ws2801Can I send data in any direction
I have bought a series of LED's. I'm working to make a bunch of modular floor panels and I need to be sure that if I flipped the wires around it's not going to screw up the LEDs on me. I'm basically asking can i do this and expect it light up?
AI: No, you cannot.
EDIT: From here the explanation changes
The WS28** chips delay the signal you give them by the amount of bits they need to control the LEDs to allow you to chain them and then clock in data in a huge stream and rely on them all taking the right amount of data from the stream and all being predictable (to within certain limits, many of those chips in the series have some "undocumented features" when it comes to timing).
This means that the device output is an on-board generated HARD logic output and the input is an on-board terminated input. It would be much like connecting a chain of logic gates like this:
simulate this circuit – Schematic created using CircuitLab
END of EDIT (Thanks to Ignacio for pointing out my inattention to the picture evidence provided)
What you can do?
Drink a cup of coffee or tea and pay attention for a couple of hours while hooking them up, testing it at a very safely limited current power supply (if possible after each addition to find mistakes immediately) and then depend on the fact that once hooked up you are never going to have to think about it any more anyway. |
H: How to determine current limiting resistor values for push pull amplifier driven by op amp?
I'm looking to increase the output current drive of a high voltage op amp using a push pull amplifier. The OPA454 datasheet includes an application circuit to do exactly this, and includes some current limiting resistors:
As noted, \$R_3 = 20\Omega\$ provides current limiting and allows the op amp to drive the output when \$|V_O| < 0.7\$V (i.e. both transistors are off). I understand that \$R_3\$ provides current limiting by stealing the op amp's output current from the transistor that is on. But how do I choose the value of \$R_3\$ to set the current limit to a particular value \$I_{\text{MAX}}\$ (e.g. \$2.5\$A)? \$I_{\text{MAX}}\$ doesn't have to be too exact, it just needs to be in the desired range (e.g. \$\pm 250\$mA).
Also, how do I choose the values of the emitter degeneration resistors \$R_4\$ and \$R_5\$? I know they are used to prevent thermal runaway by reducing \$V_{BE}\$ (and thus \$I_C\$), but I think they will also affect \$I_{\text{MAX}}\$ because they will affect the voltage across \$R_3\$.
The purpose of this circuit is to generate an adjustable output voltage from about \$0\$V to \$+100\$V with \$I_{\text{MAX}} \approx 2.5\$A. I've got dual but unbalanced supplies (not the \$\pm 50\$V shown) to support the output voltage range. Based on the suggested transistors in the above application circuit, I will probably use the MJ15003/MJ15004. Frequency response is not a huge concern since the output has milliseconds to transition.
I would guess that the relevant specs for determining the resistor values are the op amp max output current and transistor \$h_{\text{FE}}\$ (the former affects the maximum \$I_B\$, which is multiplied by \$h_{\text{FE}}\$ to set the maximum \$I_C\$), but is there anything else I need to take into account?
Alternatively, is there a better way to limit the output current for this push-pull amplifier?
AI: The current from an OPA454 is just about limited to a little over 100 mA and on a good day you might get 150 mA so, R3 is chosen to prevent the OPA454 from producing this current i.e. the BJTs take over at a certain point and produce the bulk of the output current.
For instance, at 100mA drive through R3 (20 ohms) the Vbe across one of the transistors is aiming be 2V. Clearly it can't so this means the transistors are doing their job of relieving the op-amp of having to perform too hard.
Basically, if R3 is 20 ohms and the transistors start to turn-on at (say) 1V, the peak current taken from the OPA454 is 50mA and well within the spec of the device. Remember the OPA454 cannot produce watts of power - you can't expect it to deliver 50V from a 100V rail driving 100mA - it will burn long before then.
EDITED BELOW
Here is a typical push-pull output stage that uses two more BJTs for inhibiting the drive current supplied by the output transistors: -
Taken from AllAboutCircuits useful site on push-pull amplifiers. Because the original circuit uses both bases connected together, to make this work requires maybe a 10 ohm resistor inserted in each base - basically replacing each diode in the above diagram. The pull-up and pull-down resistors are not needed.
If an emitter resistor is 0.5 ohms, at round about 2A current there will be enough voltage across it to turn on the extra transistor and this diverts base drive away from the main transistor.
Here's what it looks like in a simpler form (a clsss A single BJT driver): -
Taken from the Analog Devices Wiki website. You might also have seen this method used in controlling the current thru an LED: - |
H: Achieving (near) exact voltage divider ratio
Often, I'll have a need to create a voltage divider that has a specific resistance ratio, to obtain whatever voltage I need on the output. For example, for a specific project I'm working on (creating a reference voltage for a buck regulator), I need a resistance ratio (R1 / R2) of (nearly) exactly .375. This is an easy example, as a 3k and an 8k would work just fine for this - but often there isn't an obvious common-valued resistor combination to create whatever ratio you need. Since resistors are only made in discrete values, I'm curious of the best way to go about choosing what feels like a near-arbitrary selection of resistors. I'm thinking about cases when you want maybe <2% error (for voltage references for example), so just picking 2 close resistors probably wouldn't be super easy.
AI: Resistor series values are designed such that you can select for ratios with an accuracy on par with the tolerance. For example, the E96 series (https://en.wikipedia.org/wiki/Preferred_number) is used for 1% resistors. Pick two values from the table and calculate the divider ratio. If you switch one of them out for an adjacent value in the table, the difference in the ratio will be less than 1%. This works for any resistor series. If you need to do better than that, you can use a trimmer, expensive laser-trimmed resistor arrays, or possibly some form of calibration to compensate for an offset divider value. If you really need high precision, don't forget about the temperature coefficients. |
H: PCB Holes Too Small to Fit Component
Based on the VSK-S25 datasheet which states the holes to have a diameter of 1.5 mm,
I used the following values in EAGLE
When the PCB is made, it turns out that the pins of VSK-S25 are too large for the pads. Should we have used 0.059 inches for Drill rather than Diameter?
AI: Drill is the size of the clearance hole, diameter is the outer diameter of the copper pad. The difference between these numbers determines the width of the annular ring (donut). |
H: Common drain amplifier vs op amp for unity gain (voltage Follower)
What is the difference between using a nFET vs. an op amp as a unity gain amplifier, i.e. voltage follower?
Application: Provide constant voltage with a variable load, see example below:
Min Current 0.1 mA, Max Current 600 mA
AI: You can do what you want with an NFET or an opamp.
If you use an NFET there will always be a voltage difference between Vin and Vout, this is caused by the Vgs of the NFET. This Vgs is also somewhat dependant on the load current.
So if for example Vin = 4 V, your Vout could be 2 V if you draw 600 mA. For very low Vin (below 2 V) it can be that you will get 0 V at Vout.
Using an opamp will give more accurate results, however 600 mA is too much for most opamps. There are opamps that can deliver such a current but I am unsure if they can do so with a 5 V supply.
You could also combine an opamp and a NFET, something like discussed here
But again the 5V supply might be limiting, for 600 mA.
Also note that you will need some cooling (a small heatsing) for the NFET or the power opamp in case you will be drawing the 600 mA.
As suggested above, it will be a good excersize to use a simulator (LTspice or QUCS)
and try this out for yourself at 0 cost (OK just some time). |
H: MGL inductor for impedance matching
Has anyone ever used TDK MLG inductor for impedance matching?
It is very small, how am I gonna connect it to my circuit?
http://product.tdk.com/en/catalog/datasheets/inductor_commercial_high-frequency_mlg1005s_en.pdf
AI: It's an 0402 get some tweezers, man up and solder it down. Grab a magnifying glass or a microscope if you have trouble seeing it. Just dab some solder on one pad, heat it up, slide it in with the tweezers and solder the other side :) |
H: Need help modifying a motion detector circuit
I'm working with my son on a 4-H project, and we have great ambitions, but very limited knowledge.
We're looking to use a motion detector to switch off the current to electromagnets that will hold the doggie door closed.
We found a Motion Triggered Room Light Kit at Jameco, and it looks like it would do the trick for us except that it's designed to turn power on when motion is detected - we need it to cut the power to the magnets so the door will swing.
The other thing we'd like to be able to do is modify it to use 2 motion detectors instead of one - one on each side of the door so it unlocks no matter which way the dog is coming through.
We'd also like to eliminate the light sensor portion, as we want it to work day and night. It looks like replacing the CDS photo resistor with a regular resister of the appropriate resistance (it looks like 100KΩ should do the trick, but I'm not 100% sure). We can simply leave the light sensor inside the box so it always thinks it's night if need be.
Here is the schematic provided with the kit:
Sorry it's not particularly good quality, I simply pulled the image from the PDF of the instructions I downloaded from Jameco
We can do the soldering and follow the very detailed instructions in the kit, but neither of us have enough electronics knowledge to be able to modify the circuit to do what we need.
AI: This modification consists of two parts: an easy part and a slightly harder part :) You'll need a:
74HC32 OR gate IC in a DIP package
Another PIR sensor, identical to that in the kit
A scrap of perfboard/veroboard/...
More of the phone wire called for by the kit
And a 200kΩ, 1/4W resistor (Radded in the schematic below)
The first step is to enable the circuit to work with an ORed set of PIR sensors, while disabling the light sensor function. For this, you'll need parts listed above.
Make up two PIR sensors according to the kit instructions, but do not include the CdS photoresistor or R1, and do not connect them to the kit. You can then make up the OR gate perfboard according to the following schematic, with R1 being the 10kΩ resistor the kit has you install in the sensor enclosure:
simulate this circuit – Schematic created using CircuitLab
Once this is made up, the +5V, OPTO, MOTION, and GND leads from the perfboard can be wired to the mainboard in place of the original sensor, while the two modified sensors can be connected to +5V1/MOTION1/GND1 and +5V2/MOTION2/GND2 respectively. This hardwires the system in "dark" mode, and means that either or both motion sensors active will activate the relay.
Now, to the easy part of the modification, and that's changing it to turn OFF the device it's controlling when it's triggered. That's simply a matter of taking the wire from the relay to the HOT side of the output and wiring it to the normally closed contact of the relay (the currently-unused pin on the 2-pin end of the relay) instead of the normally open contact of the relay (the center pin on the 3 pin end of the relay). |
H: How does this slow turn-on regulator work?
I understand R1 & R2 are for feedback which the regulator uses to set output voltage. What is the purpose of the 50k ohm resistor, BJT, and the lower 10uF cap? Does the capacitor & resistor make some time constant the affects the feedback voltage?
If I may ask a semi-related question about the diode... I presume it's some sort of protection diode but what is it actually protecting?
AI: The reference voltage is programmed to a constant current source by
resistor R1, and this current flows through R2 to ground to set the
output voltage
\$I_{adj}\$ gradually falls down as the PNP turns off(in OP Figure) after charging the capacitor. The regulator initially observes that \$V_{out}\$ is actually higher (as \$I_{adj}\$ is higher) as per the equation above and hence will try to reduce the \$V_{out}\$. This in turn creates the slow turn on function as \$V_{out}\$ slowly rises as \$I_{adj}\$ gradually falls to minimum. |
H: Why thermal printer is called as 'thermal'
I always wonder when I see "thermal printer" written in printer's datasheet. Why its called as 'thermal". What is the difference between Graphic and thermal printer?
Thank you.
AI: Thermal printers have tiny heating elements in the print head. They require a specially-coated paper that will turn black when heated (then fade over time). I think most thermal printers can print graphics as well as text. Most printers in cash registers and credit card terminals seem to be thermal.
A graphic printer can print graphics as well as text. It may use any printing technology - inkjet, laser, thermal, or whatever... |
H: JFET Audio switch, does not work in simulation?
This is a circuit I've found online and apparently it is taken from the very rare audio book by National semi. The circuit is used to switch a signal on and off at a transition time that the user sets using the RC input. The problem is that I can't seem to get this to work in simulation. Any ideas what I might be missing out of?
AI: The circuit you posted can work. These are the results of a hastily conceived LTSpice simulation with some guesswork values for the components:
Therefore there could be something wrong in the simulation parameters or the choice of the values of the components.
As I said in a comment, you should post additional information for us to be able to troubleshoot the problem.
Note: this circuit works (i.e. switch opens) under the assumption that the control signal's amplitude is much higher than the amplitude of the controlled signal, here 10V and 100mV respectively. Well, actually the assumption is that the maximum positive value of \$V_{ctrl}\$ must be greater than the maximum positive \$V_{sig}\$ value + \$V_{GS(off)}\$ of the JFET, but since in practice \$V_{GS(off)}\$ is not very predictable it's better to err on the safe side.
This is the easiest mistake I guess you could have done (insufficient amplitude of control signal), but this is wild guessing in absence of more data from you. |
H: Connecting cables when end point rotates 360
I need to be able to rotate raspi camera 360' by motor and up/down by servo. The problem is that when I rotate it 360', all camera cables will tangle up. What is the method to make it right? I need camera, servo and lighting cables to go through that motor.
AI: You have two possibilities:
A slip ring (or multiples for each cable). Advantages are that you can easily run mostly the same signals signals as over your cables. Disadvantage is that it has contact wear and isn't suited for high rotation speeds due to that.
Example:
Rotary transformers (again one for each cable) like in VCR heads. You can only use AC signals here, it is more complicated to build, but you can do it in higher speeds.
Example: |
H: Why does this transformer draw so much current?
I've been working on a DC power supply to provide about 10 mA at 200 V. The simplest way (not dealing with a switching power supply) seemed to be using a transformer to step 120Vac up a little bit to get peaks near the target voltage, then rectify and filter.
I've wound a custom transformer with a 18:19 ratio to do the step-up which behaves reasonably in simulation, but draws much more current than I expect when actually constructed:
simulate this circuit – Schematic created using CircuitLab
R2 is an NTC with \$R_{25\mathrm{C}}\$ of 50 Ohms to limit inrush current, and there's a fuse inline (not pictured). When connected the circuit draws upwards of 10A, but it takes a moment to warm up (quite literally; the NTC gets warm as you'd expect) before blowing the protection fuse, to the point where a 4A fuse took more than a second to blow (so current doesn't seem to be dropping after the first few AC cycles).
Since this is a custom transformer I don't have any solid numbers on its characteristics, so it's possible inrush current is much higher than the simulations say. Additionally, I may have underestimated the NTC so it warms up long before the transformer reaches saturation. (The third option being that I'm completely wrong and this is a bad idea.)
How can I limit the primary current to something in the the 1-2A range that I expect from simulation, or is there a smarter way to build this power supply?
AI: When connected the circuit draws upwards of 10A
I'm not surprised. Consider the transformer primary as an inductor and forget about the secondary or any loading. The primary is still an inductor and you have to get the primary inductance high enough so that the current taken (with no secondary winding/load) is reasonably small.
Primary inductance (in fact it's called magnetization inductance) is proportional to turns squared so doubling the turns makes the inductance 4 times greater and, would reduce the intake of current by 4.
Eighteen turns is never going to be enough. A typical ferrite core (for example) might have an A\$_L\$ value of 10 micro henries per squared turn and this means 18 turns is going to be about 3 milli henries. At 60 Hz this has an impedance of just over an ohm and without a fuse you'd have a fire.
Usually AC transformers have round about 1000 turns on the primary and this of course means a primary inductance of 10 henries and a very much reduced magnetization current. Try looking at this site for some information on transformers.
Also note that transformers do not pass DC because the primary inductance becomes a short i.e. the lower the operating frequency you use the more turns you need to avoid excessive primary (only) current.
If you are still intent on rolling your own, here's the math: -
Also take a look at this medium power transformer: -
Note the number of primary turns. A quick estimation I did tells me there are about 12 layers of about 90 turns each. That's 1080 turns! |
H: Strategy for a learning lawnmower robot, and choices of motors
I am pondering on building a practical learning lawnmower robot (could be Arduino based) and I am wondering if this will work.
The robot will be both autonomous and RC (radio controlled). Given some specific lawn, the robot will first learn the path it will have to take via RC. So initially the user has to use RC to control the bot to mow the lawn completely. Necessary data will be recorded by the bot, to be used in later autonomous sessions.
To keep things simple, the RC controller will have only a 2 buttons: rotate (0 radius) and go (forward). The path will then be made up of straight segments (i.e. in a zig-zag manner).
So basically, when learning the path, the bot will record the angle (by mean of an onboard IMU) and length of every straight segment taken. In an autonomous session, the bot will first be placed at the START point, and will just re-play whatever has been recorded. It will ensure recorded angles are maintained, and segment lengths are covered precisely.
I understand that using this strategy, if there are new obstructive objects that emerge on the lawn (lamps, sprinklers...) , re-learning will be required. But I guess that this is still much better than the bot having to improvise everytime it mows the lawn (very likely the same lawn). The advantage of this approach is that it will be much cheaper than fully-autonomous approaches, and might even be more efficient.
My questions:
Do you think this strategy will work, or there are deal-breakers I haven't thought of? What else do I need to consider for this to work?
What kind of motors (stepper, servo, DC with encorder) will be most suitable for this application?
If you can even recommend a specific motor model, that would be great.
I am obliged to any thoughts that you could share.
Cheers,
Dave
AI: I don't think it will work in that simple form. There will be variations of the turns and distances despite your best efforts at recording them. Even on a flat, smooth surface you will have problems with repeating a particular course perfectly. Add in bumps, dips, and varying rolling resistance and I really doubt your robot could follow an arbitrary course perfectly every time.
I would suggest trying it out with a simple robot first.
There are many simple (and cheap) wheeled robots available. Just program one to follow a set course (forward so far, turn right so many degrees, forward so far, turn ,etc.,) then run it several times to see how consistently it can repeat it and how far off course it can get. If it does tolerably well on a smooth floor, start adding bumps or other small variations and see what happens.
What you are proposing is based on dead reckoning, and depends on very precise control of distance and turning angles. Any variations will compound with time and distance traveled, until at some point you are completely lost.
If you equip your robot with a navigation system, and record the commands as waypoints, then you might get some where. It knows where it belongs and where it is allowed to mow, and does its best to stay there and follow the given track.
You would, however, have to have some kind of way for the robot to know where it is. A GPS receiver is a start, but it isn't precise enough. Maybe differential GPS, with a separate receiver as a reference and bluetooth/wifi to connect with your robot.
Inertial tracking might help. Costs are going up, however.
A smartphone would have all of the bits needed for tracking and navigating and would be cheap but is has %$&$% all in the way of outputs - you might misuse the earphone or use bluetooth for the phone to send commands to the hardware - and just as little for inputs - again, bluetooth is a possiblity but its bandwidth isn't unlimited.
Building your own controller means interfacing with all the needed sensors and navigation tools, and so might be more expensive.
All in all, you've picked yourself a fun project with lots to learn.
Motor control, battery management, programming, control systems, feed back loops, systems integration, safety considerations, navigation and lions and tigers and bears, oh my! |
H: Controller built-in vs external DAC
I am using STM33F in my application, it has 12 Bit DAC.
For one of the audio codec module in same application, stereo DAC with inbuilt amp needs to be implemented (IC TLV320DAC3100). Above codec will store voice in digital format and will play audio and has built-in DAC.
So, can we use host controller in-built DAC instead CODEC DAC? Is there any pros/cons/constraints while using in-built controller DAC?
Thank you.
AI: Well, if by voice you actually mean human speech or singing, it appears you don't need fast sampling rate to satisfy Nyquist (which means that built-in DAC is way to go), another strong suit of built-in DAC is fact that you don't have to implement any serial communication with external IC, you could just use your MCU instruction set to control your DAC. The downside for built in circuit is fact that it's only 12 bit wide which means that you won't be able to achieve even audio cd standard (16-bit,44100Hz).
My advice would be to test it - code your way around built-in 12-bit DAC, listen to how it sounds. Then try using 16 or 24 bit external DAC and see if difference between both results is significant enough to go with external DAC |
H: Can this ATMega328-PU ATMEL microchip be used instead of MCP3008
I wanted to follow this tutorial as a first project.
I've got all the parts I need, but I could not purchase the chip that was linked in the article.
So I found another chip that sound similar (To a complete beginner) .
My question is, will I be able to use the chip I brought, in place of the one suggested in the article or am I trying something thats impossible?
AI: Yes you can, but your tutorial breaks down because you are not following it.
The ATMEGA is actually a microcontroller. It requires more attention to setup the hardware as well it requires programming. If you are a complete bigger and want to follow the tutorial, then this might not be the approach you want to take. That's not to say you can't do it, it's just slightly more complicated to get working.
The MCP3008 is an external 10bit ADC. It is not as complicated to get working than a microcontroller.
If you can find a 10bit external ADC, you should be able to follow your tutorial pretty well. |
H: Basic power: drive 12v LED from 5v Raspberry Pi output — no 12v supply available
There are a lot of questions on here and elsewhere about this.
The consensus seems to be to use a transistor to switch a power supply — implying that I have a 12v supply available.
Only 5V is available, either coming out of the GPIO pins or directly from the power supply (USB battery in this case).
This is a single LED: seems like it should be possible to directly wire it to the GPIO pins with a component in the middle that raises voltage. (GPIO pins can "safely" provide 16 mA)
It appears that I need a stepup/boost converter, but nobody seems to be discussing that. Am I thinking about this correctly?
AI: In general, you need a boost converter on the 5V supply input, to 12V. You can typically see 85% efficiency. You still want to use the transistor on the RPI output, since it is 3.3v and low current.
Any typical step up or boost converter will work, considering you keep in mind the minimum regulating load.
Alternatively you can find a boost converter with a 3.3v enable pin, and control it directly from the rpi.
Edit The button that OP linked to can be disassembled by design, to replace parts. An easier solution is to replace the led resistor with one suitable for 5V operation. I'd still advise a transistor setup. If you feel lucky punk, well do you?, then a resistor suitable for a red led at 3.3V 16 mA or less would work directly, with minimal brightness change, but a ten cent transistor to protect the RPI pin is recommended. |
H: Is it proper to use an internal layer as a heat bed if I want to warm my multilayer PCB?
I need to design a circuit to warm my PCB. There are many ways to build up such circuit. But I learned from a post "Warming PCB in a low temperature environment" that maybe I can use traces as heater.
My first idea is to use one of the internal layer as a heat bed and place copper traces there. I have searched the Internet for a while but I can not find any application note or any discussion on this topic.
So my question is: is it good or proper to use the internal layer as a heat bed? If not, any disadvantage?
(I am not familiar with the fabrication process of PCB boards. So I am not so sure whether could I place traces in the internal layer)
AI: I think you could do this. Suggest serpentine tracks that don't form a coil so that the magnetic field won't be especially strong. You can shield electrostatically with a ground plane, but the magnetic field will go right through everything, so if you have sensitive circuits you might need to filter the PWM to something more like DC (not really a big deal, just some inductors and capacitors).
The copper thickness and resistivity and etching of fine traces are not that well controlled, but +/-20% is not a big deal on a heater (and you might be able to get that repeatably).
Personally, I'd use a cheap SMT thermistor for the sensor assuming you only want to control at one temperature. Just stick it in and it will work. There will be excitement enough getting the heater to work well.
Here is an example of a pattern used in a commercial film heater:
Yours would have to jog around through-holes, but if you splurged on blind vias that could be minimized. |
H: How to measure resistance
I have a project to build heating element using silver ink.
My specification is the heating element must be in range 2 to 2.6ohm
I will design the circuit for the heating element, but have a problem
how to theoretically measure the resistance of the circuit(before send to print house).
Based on reference on this website
http://circuitcalculator.com/wordpress/2006/06/14/conductive-ink-traces/
the resistance can be measure as below
Resistance = Sheet_Resistivity*(Length/Width)*(Ref_Thickness/Thickness)
In my case,
Sheet Resistivity = 10miliohms/square,
Ref_Thickness = 1mil(0.025mm)
Thickness = 1mil(0.025mm)
1) Based on the quotation, if I have 50mm x 50mm & another one is 10mm x 10mm
silver ink with same thickness, the ohm will be the same which is 10miliohms.
Is it logic?
2) Another question is, how to measure the resistance if I design a complicated
circuit as per attached image? In the image, 1box considered as 1mm x 1mm
Point "A" and point "B" will be connected to battery(+ve & -ve).
Blue color indicate the silver ink
Your advice and explanation will be very helpfull. Thank you.
AI: As well as Ignacio's answer on the straight bits, you can consult "Handbook of Electronic Package Design, By Michael Pecht" which has formulas used for correcting for the corner geometry when you use a serpentine (meander) pattern. |
H: Understanding a current sensor circuit
I'm struggling to see how the output of this circuit is $$V_{0} = {I_{s} R_{s} R_{L}/{5k}} $$
My work thus far:
I understand the voltage into the base of the BJT is $$I_{s}R_{s}$$
I understand the voltage into the collector is Vin
Now what I am struggling to see is where the 5k term and the R_l term come from.
I see that the IsRs is the voltage across the the two leads of the opamp, this detects the current. Where the 5k and how Rl interacts I don't understand.
My guess would be the 5k is a result of voltage division.
Can someone guide me to understanding this circuit?
AI: The 5k term comes from the internal resistor on the positive input to the opamp, through which current to the BJT's collector flows.
The voltage into the base of the BJT is, in fact, not IsRs because of the negative feedback via the BJT. The opamp increases the voltage to the BJT's base until the collector draws enough current from the positive input via the 5k resistor to make the two inputs equal. Since the current into the collector is equal to the current out of the emitter (plus the base's negligible contribution), the same current will flow out of the OUT pin. Rl converts that current to a voltage. |
H: 12V signal convert to 5V without interfere
I have Wiegand 26bit bus.
DATA0 - GND = ~12.5V when idle
DATA1 - GND = ~12.5V when idle
I need some sort of scheme or something to convert 12V signal to 5V without interfere.
I have few thoughts:
Optocoupler. Will the R1 and LED interfere a lot?
MOSFET. What would be the scheme?
MAX232 chip. a bit difficult at the moment to test
Please suggest something for this case.
UPDATE
The scheme of EM Fields does work. But i have one more problem.
There are 2 RFID readers connected in parallel. One is newer version than the other. They are configured to give Wiegand 26bit output.
1 parity bit + 8 bit site code + 16 bit card number + 1 parity bit = 26 bit
When i tried to read i received this
Card number is 140,2193
binary 1 10001100 0000100010010001 1, but i noticed that the older one gives extra 0(marked with red dots) after 1. That means DATA0 line is triggered to low after every 1. Security system reads card correct. What could cause the line go low?
AI: Use a couple of voltage comparators as shown below and select them for the speed you need.
R1 and R2 are used in conjunction with R5 and R6 to generate the hysteresis which will insure clean transitions at the comparator outputs, R3 and R4 are used to generate a 6 volt reference (the input switching point) for U1A and U1B, and R7 and R8 are pullups to 5V for the open collector outputs of the comparators. |
H: What is the small barrel type connector called?
I just ordered a barrel connector but it's bigger then the one i need, What is the small barrel type connector called. My original one has a yellow ring around it, Is that an indicator of what type it is?
AI: What is the small barrel type connector called.
It's called a barrel connector with a different diameter.
Typically I see these connectors specified in 0.1 mm increments.
My original one has a yellow ring around it, Is that an indicator of what type it is?
Within one particular vendor's product line, it may be. But you might find a compatible connector from another vendor with a different color. |
H: Open collector microcontroller output
I am building the following circuit, in order to control the P channel MOSFET as a high side switch for my load.
The input of this circuit will be from a microcontroller (maybe an STM32F103), and I was planning to use the output pin, in open collector mode.
Will this work? Please note that I am pulling up the pin at 12V.
I know that in other circumstances it would work, but in a microcontroller, will the output handle the 12V? When in open collector, are the ESD diodes disconnected?
And if it works, how do you handle the initialization of the pin, (after reset, before configured as an open collector pin).
AI: No, the ESD network is not disconnected. There are a very few micros that may have one pin or so that can be pulled up to a higher voltage than supply voltage (eg. RA4 on PIC16F7X, which can be pulled up to 12V absolute maximum), but generally you cannot do this without causing the ESD network to conduct (which you should avoid doing for several reasons, for here it will suffice to note that it won't work for you). Some newer micros may have special ESD networks to allow 5V inputs which allow the output to be pulled up to +5 even with a lower voltage supply, but I don't think an operating voltage of 12V is a reasonable expectation.
Just drive a small MOSFET or a BJT+base resistor with the GPIO push-pull and use that as your 'open drain'. You may even be able to find a dual n-channel/p-channel MOSFET that suits your purposes and keep the parts count identical (though I like the idea of a series resistor to the GPIO if possible, just because it could save the micro in case something shorts the 12V to the GPIO). |
H: How could I make a water-resistant touch/tap sensor (similar to push button) for all-weather outdoor use?
I am building an Arduino-based device to be used outdoors (on a bicycle), and it is expected to work in all weather conditions. The device will have some buttons to turn lights on and off, honk the horn, etc.
Since regular push-buttons would not be water-resistant, I thought about creating some sort of "touch sensing push button" with bare wire ends (either one or two wires), or exposed metal plates. I have already read about single-node capsense, but I don't know if it would work.
Also, I wonder if piezo crystals found in small buzzers could be hacked to work as touch or tap sensors in this same application, thus enabling the use by people using gloves.
AI: Membrane switches are probably your best bet. You might be able to salvage them from an existing keyboard - such as the ones on microwave ovens or other kitchen appliances.
Piezo crystals generate analog voltages - more voltage if hit harder. I suspect that interfacing might be a little more complicated than contact switches.
Both are momentary switches (i.e. they make contact during a small period of time). In case of the membrane switch during the activation. Piezo switches only generate a voltage which pressed and released. So you will need some electronics to 'remember' the position (i.e. ON/OFF).
If you feel up to it, small controllers (such as the famous Arduino) can do this easily.
Some suggestions for DIY buttons:
Membrane buttons are not difficult to make. I'm not sure if they still exist, but there were some toys that 'clicked' mechanically when squeezed. It's the same principle. It's just difficult to find the suitable materials. You need a conductor which is sufficiently 'springy', without 'memory'.
You could make capacitive sensors too. Make a disk - say about 2cm diameter on a PC board, pile a non-conductor - thin mylar or polyester - with a hole about 2.5cm, and then another layer of polyester with a (thin) copper disk. If you connect the disk to a square wave (software!) then you can detect the voltage on the PC board disk - it'll change amplitude if pressed. The larger the disk, the more sensitive. |
H: Altium Designer - 45 degree rotation
I am using Altium designer 15.
How can you rotate a component by 45 degree in PCB mode?
Regards,
MathieuL
AI: I know that there are a few ways of doing it, but this is the way I use (because I can't remember the other way and it wasn't important enough for me to find out).
Go to your preferences
PCB editor
Under the "Other" section, change rotation step to 45deg. |
H: CircuitLab voltage source question
I was having a problem with one of my circuits in CircuitLab, and traced it down to my sources always enabled, even if I switch them off by connecting to an open switch. This seems to be so simple, but I can't figure out it.
Here is a simplified circuit showing the behavior. I have a 5 V voltage source V1 on the left, disconnected from ground because switch SW1 is open. I have a second 5 V voltage source V2 on the right, connected to ground because switch SW2 is closed.
When doing a DC simulation, I would expect node "off" to be 0 V, and node "on" to be 5 V. But they are both 5 V as shown in the simulation window. Why?
AI: The system you have drawn actually has an in-determinant answer for what \$V_{off}\$ is with respect to ground because it is galvanically isolated from ground.
Having a perfect open circuit in the system is problematic in how many circuit simulators are implemented, so the way this is often handled is to use a very high (but finite) resistance to model open circuits. With this very high but finite resistance, the solution becomes \$V_{off} = 5V\$.
To test if CircuitLab does use a finite high resistance, I built a "voltage divider" circuit with an open switch and a very large resistance. The DC simulator tells me the output voltage is 333.33mV, which means that \$R_{open} = 5\cdot10^{14} \Omega\$
simulate this circuit – Schematic created using CircuitLab |
H: Dropping 24V to 12V simply and efficiently
I have a 24V solar system, and I want to get only 12V from the DC output.
Currently I am taking a wire from only 1 battery, but this causes unbalance in the batteries and I have to check it a lot and switch the wires to balance, also the wire is a bit long and I get a drop and when it is near or below 12V my devices stop functioning.
I thought if I can get the 24V down to 12V at the end of the wire I'd be sure to get constant voltage for the devices, and would not have to worry about the balance of the batteries and it woyld be safe since the charge controller has a deep discharge safety.
The problem is I can't use resistors or transistors (voltage regulator) due to excess heat and a transformer is not an option (nor DC to DC converters - can't get any here,) I am looking for nearly 5A of current.
So I am kind of stuck here.
How can I do this?
--EDIT--
Would making a stairs of voltage regulators be ok to use? (24V-19V-15V-12V) or would it be better if I put multiple 12V regulators from 24V?
Efficiency isn't a problem, but I don't have large heat sinks. Or is there a way to drop enough voltage so I can feed it to the 12V voltage regulator? Using a resistor will limit the current and I want to avoid that.
AI: If you need a high-power load resistor, you can get a long length of wire (enamel/transformer wire is best) and put it in a bucket of water. You now have an incredibly high-power resistor. If you want to drop 12V at 5A (probably less due to regulator overhead) then you want a 2.4 Ohm length of wire. Do you have a multimeter?
If you put this load resistor in series with a 12V regulator, the regulator will keep its output at 12V, but its input voltage will drop as the current increases, so the power dissipated in the regulator will be significantly reduced when at high loads (will be dissipated in the bucket instead).
Best of luck! |
H: Why is ground voltage non-zero, and why does it increase when I plug in an LED?
Here is the circuit (Arduino Due, 1kΩ resistor, LED):
Note how I bring the ground from the Arduino board to the breadboard, and also connect the ADC pin to the gnd rail on the breadboard.
Here is the code:
void setup() {
Serial.begin(9600);
#define ADC_FREQ_MAX 250000
Serial.println(ADC_FREQ_MAX);
}
void loop() {
analogReadResolution(12);
Serial.print(analogRead(0));
Serial.print('\n');
}
Here is what I do:
600cs: I unplug the LED.
4000cs: I plug in the LED.
6500cs: I unplug
the LED.
7750cs: I plug in the LED.
Here is the result:
I plug this same setup into an Uno, and I get no issue:
Why is ground voltage non-zero, and why does it increase when I plug in an LED? What issue with the Due could cause this?
AI: In Breadboards with lengthy cables a 50 mV offset is acceptable and is not an issue. If it is affecting measurements, then you should consider shortening the cables and possibly use thicker cables. a 0.5 ohm resistance cable with 5mA current will give 2.5 mV drop. If there are other currents through the ground cable, assume Entire board current, then the drop will go up. For ex. 100 mA current now will cause a drop of 50 mV. |
H: What's the purpose of having two of the same value caps in parallel?
Why does this 5V circuit use two of the EXACT same value capacitors?
It's not needing a larger capacitance issue considering 100nF is relatively small.
Here is the full schematic: Arduino Leonardo
AI: Because they're decoupling caps for two different ICs or supply paths. On the schematic they're side-by-side, but on the actual board they're over by the ICs they're decoupling. |
H: ANT-MMCX and Microstripe line and UHF RFID module circuit designing
Below, you see the only schematic of a 6 pages-datasheet of an UHF RFID module (working frequency = 840...930 MHz):
There are three questions:
What is that ANT-MMCX? I search it in Google and I found two components named ANT-GPS-MMCX and ANT-GSMQB-MMCX-ND. Which one is appropriate for this module?
The antenna is connected to the module with a 50Ω microstripe line. The question is "What is this microstripe line?". I must design and build it myself or there are created ones in the stores? What happens if I connect the antenna to the module with a simple wire?
Will the above circuit works properly if I use a 5V mobile phone charger as the power supply (let assume it can provide the require current) and connect RXD and TXD to my computer's serial port and also put all the circuit on a simple bread board? or there are a lot of points in high frequency communication circuits that I must consider and apply to the board design that are not shown in the image? (If so, let me know the most important ones).
AI: ANT-MMCX means Antenna MMCX connector. It depends on your antenna, but basically its just a matched connector.
A Microstrip line is a transmission lines structure which is easy to build on a pcb. It consists of a trace over a reference plane with a set width and distance to produce 50 ohm impedance.
You can find plenty of calculators online to calculate the width and distance from the reference plane for you. If you connect the antenna with a simple wire you can expect an impedance mismatch and very bad performance to the point of being impossible to receive the signals. You cannot build this on a breadboard, you need a proper pcb.
I would suggest you buy a complete module, this way you could probably use it on a breadboard.
EDIT:
From looking at this datasheet it seems like this module is meant to be soldered on a pcb, how did you plan to use it on a breadboard ? you might be able to solder some sort of a 50ohm coax directly to the module and connect it to an antenna. |
H: Are these two OP-AMP circuits behaving different?
I am looking for DC biasing circuit for a bipolar square wave with frequency < 10 MHz.
I'd like to make a square wave with high 1.5-1.7 V and low (-1.5)-(-1.7) V into a square wave with high ~ 5 V and low ~ 0 V, such that midpoint is 2.5 V
And I've found two examples.
The First one is like:
And the second one is like:
As I have little knowledge about circuit, I am wondering if they are behaving same or not.
A signal in the first circuit is fed into (+), but in the second circuit, it is fed into (-). I think both circuit will output inverted waveform respect to each other. Is it right, or do I have a wrong understanding of circuits?
AI: Yes they are behaving differently.
The first one is not inverting. The second one is inverting.
To be more accurate the output signal in the second one should look like this (phase inverted; also the amplitude may be changed, depending on R1 || R2 and R4):
For most audio purposes or many other cases it doesn't matter if phase is inverted along the signal path or not.
And of course the first circuit includes a (quite) low pass filter consisting of R? (100kOhm) and C? (100nF) at the output.
The second circuit doesn't. That's a big difference. |
H: Inbuilt flash memory size not enough
I am using TM4C1230C3PMI controller from Texas instrument in one of my project. It has 32KB of internal flash, which is not sufficient for my application. Higher flash sized micro-controller are available in the market which can be used but I want to go with this micro-controller only. As per my knowledge external EEPROM can be used to increase the total flash size (Program memory).
Is my thinking is correct?
If not please suggest how can I increase the total flash memory size of the controller?
AI: You cannot extend the program memory (flash). TI produces the same chip with double the flash and RAM, but nothing else changed: TM4C1230D5PMI.
If you cannot use a chip with larger flash, you will have to reduce your code size:
Disable debugging, such as the expensive printf function. A printf that supports floating point output will typically set you back around 5KB-10KB.
Make sure you compile with optimization enabled - typically the compiler flag is -Os.
Modern compilers can do link time optimization (LTO). With gcc, you get this with -flto. You have to pass -flto to both compilation and link stages, for all files. This typically reduces the produced code size by 30%-50%. |
H: Which of the following motors best suit as a wind generator?
I'm watching some brushless outrunners with low kv as a generator for a simple wind turbine that I'm going to build soon. It might not be a scale or fully useful turbine, because I want to build it for testing and prototype purposes for now; I will test it with a fan(s) probably, however I want it to be as useful as possible.
I have found the motors that are linked below:
1) Turnigy CA80-80 Brushless Outrunner
2) Turnigy Aerodrive SK3 - 6374
3) Turnigy RotoMax50
4) Turnigy RotoMax80
5) Turnigy RotoMax100
6) Turnigy RotoMax150
As you see there are lots of details rather than just kv and I`m not such educated to understand these all. Could you clarify:
(a) which of these is the best as a wind generator? why?
(b) which of these is the best for price? why?
(c) and do you recommend something else than of these?
If you ask me how much output I need, I don't know, I would be additionally thankful if you could clarify how much these things can produce, what is the optimal load, and other information you think is useful.
AI: Quoting from Hugh Piggott
Blade power = 0.15 x Diameter^2 x windspeed^3
= 0.15 x (2.4 metres)^2 x (10 metres/second)^3
= 0.15 x 6 x 1000 = 900 watts approx.
(2.4m diameter rotor at 10 metres/sec or 22 mph)
Plugging in your numbers :
(1) 0.7m diameter
= 0.15 x (0.7 metres)^2 x (10 metres/second)^3
= 0.15 x 0.5 x 1000 = 75 watts approx.
(2) m diameter
= 0.15 x (1 metres)^2 x (10 metres/second)^3
= 0.15 x 1 x 1000 = 150 watts approx.
This is the power available from the wind. If you work the same out for 11mph (5m/s) you should find 1/8 of the power is available, or just shy of 10 and 20W. You haven't told us what your local wind speed profile is, so you'll have to revisit this calculation yourself.
Now before we can work out how to extract some of that power, we need to know how fast the blades spin.
Rpm = windspeed x tsr x 60/circumference
=3 x 7 x 60 /(2.4 x 3.14)= 167 rpm
Assuming you follow his recommendation of a tip speed ratio of 7, and you aren't interested in speeds below 5 m/s (11mph) where there's less than 10W available:
(1) 0.7m diameter
= 5 * 7 * 60/(0.7*Pi)
= 954 rpm
(2) 1m diameter
= 5 * 7 * 60/(1.0*Pi)
= 668 rpm
and these speeds potentially double at 11m/s.
Now we can look at one of your motors: the CA-80-80, first on your list
This has Kv=160rpm/V and a motor resistance of 0.011 ohms.
Kv=160 means that, driven directly, it should generate 954/160 = 6V (AC) from the 0.7m rotor.
As Kv is defined in terms of the driving DC voltage, this may turn out to be the peak AC voltage generated, rather than the RMS voltage. Which you get isn't clear from the motor specs. If so, you'll get just shy of 5V after the rectifier, but if that 6V is the RMS voltage, the AC peak is 8.3V and you'll see about 7V after rectification.
From the 1m rotor you'll get 668/160 = 4.1V (AC) at 5m/s (same considerations apply).
Now 10W at 6V means you can extract 1.66A, by setting the load resistance to 3.6 ohms. Taking more current than that will simply stall the blades. Alternatively, 20W at 4V means you can extract 5A with an 0.8 ohm load.
You'll lose some power in the motor's own resistance : at 5A, you'll lose I^2*R = 25*0.011 = 0.275W (out of 20W : negligible).
For interest, let's see how the 1m rotor performs at 10m/s : speed will be 1336rpm, voltage 8.35V. Power available is 150W, so current = P/V = 18A. So to extract full power you need to tune the load resistance to 8.35/18 = 0.46 ohms and you'll lose 3.5W in the motor resistance.
Tuning the load resistance to best extract the power available is outside the scope of this answer : it would usually be done by a switching converter such as an intelligent battery controller, like the "MPPT" chargers in solar power systems. But to demonstrate power generation you can simply switch power resistors in and out of circuit and measure voltage and current.
Clearly this motor will work, quite efficiently, at extracting the power available from any reasonable windspeed with the rotor sizes you suggest. Equally clearly, at £99.53 it's an outrageously expensive way of generating 10-150W. As a motor it's rated easily in excess of 30V and 100A so this is barely 5% of its rating.
But now you can repeat this exercise with the key parameters for the other motors and see if another fits your definition of "best" or best value.
(One point about "alternators" from Hugh Piggot's writings : he reminds us that because they aren't permanent magnet based, they require power to generate the magnetic field. About 40W in the case of car alternators, which makes them less attractive for smaller wind turbine applications) |
H: A theoretical question on probe resistances for a voltage measuring device
As seen in the figure above, a current regulator is providing a constant current looping through the series resistor Rshunt. Input impedance of data acquisition device is 10 GigaOhm. Can we say that almost no current passes through the probe resistance Rcable(since input impedance is huge) and therefore there is no voltage drop across the probe cables? How can I relate this resistance to input impedance of DAQ device and can I just neglect the probe resistance?
Can I quantify the error caused by Rcable here in relation with DAQ inout impedance?
AI: An equivalent circuit could be this one
Can we say that almost no current passes through the probe resistance
Rcable(since input impedance is huge) and therefore there is no
voltage drop across the probe cables?
Absolutely yes
How can I relate this resistance to input impedance of DAQ device and
can I just neglect the probe resistance?
In your drawing, simply replace the DAC amplifier with resistor of 10 GOhms. Since the resistance of the series of R_cable and 10 GOhms is much bigger than R_shunt you can say that the error introduced by R_cable and the DAQ is very small.
Can I quantify the error caused by Rcable here in relation with DAQ inpout impedance?
Solve the circuit: the current in the R_DAQ branch is
I_DAQ = I * (R_SHUNT) / (R_CABLE + R_DAQ + R_SHUNT)
Thus the voltage read by the DAQ is
V_DAQ = I_DAQ * R_DAQ = I * [(R_SHUNT) / (R_CABLE + R_DAQ + R_SHUNT)] * R_DAQ
which can be rewritten as
V_DAQ = I * (R_SHUNT) / [ 1 + (R_CABLE + R_SHUNT) / R_DAQ]
Ideally you would expect to read V_DAQ = I * R_SHUNT but actually you get I * (R_SHUNT) / [ 1 + (R_CABLE + R_SHUNT) / R_DAQ].
The relative error then is given by
(R_CABLE + R_SHUNT) / R_DAQ.
As long as R_DAQ is much greater than R_CABLE + R_SHUNT you can safely say that the DAQ does not affect the shunt. |
H: Why does the amplitude of a filtered signal decrease when higher order FIR filter is used?
I am having a signal of frequency range 0-2 Hz. I want to remove baseline wandering (very low frequency drift) for which I found the cut off frequency — 0.0245 Hz — and a FIR filter of order 91. The output signal has no baseline but the amplitude of the output signal is reduced.
Is this common? If yes, what could be the reason?
AI: Yes, what you observed sounds plausible. Your misconception is probably due to thinking of the filters you used as having a sudden transition. This is one reason I don't like the term cut off frequency. Instead, use rolloff frequency, which presents a better mental image.
Keep in mind that a single pole filter, whether high pass or low pass, has a gain of-3 dB at the rolloff frequecy. For some applications you can approximate such filters as being flat at 0 dB on the pass side of the rolloff frequency, then dropping from there by 6 dB/octave on the stop side. This approximation works well enough in most cases a octave or two past the rolloff frequency on either side, but is not valid near the rolloff frequency. This is one reason such simple filters are usually placed a octave or two past the desired pass band.
For example, you could place a couple poles of a simple high pass filter at 10 mHz, and you wouldn't get much attenuation by the time you get to your desired 25 mHz cutoff frequency. Of course the drawback is that some content below 25 mHz will be passed. To know what is acceptable, you have to have a spec for how flat the pass band needs to be, or at least the maximum attenuation you can tolerate at 25 mHz. You also need to specify how much minimum attenuation you need at some lower frequency. No, you don't get to say pass everything above 25 mHz and nothing below, since that's physically unrealizable.
For the sharpest possible transition between pass band and stop band, use a sync filter. Fortunately your frequencies are low, so something with a lot of points, like 1024, is quite feasible to do in real time on even a small and cheap DSP. Since your highest frequency of interest is 2 Hz, you have to sample at 4 Hz minimum. However, I'd sample significantly faster than that and apply low pass filtering digitally, which can then be dessimated to a bit above 4 Hz. This puts less constraint on your external hardware anti-aliasing filter.
For example, let's say you put two poles of simple R-C low pass filtering in front of the A/D. You don't want it eating into 2 Hz signals much, so you move the two poles out to 10 Hz. The combined filter will drop 12 dB/octave or 40 dB/decade. You can easily sample at 200 Hz, low pass filter, and decimate, and use a tiny fraction of the cycles of the DSP. Let's say you decimate to 10 Hz sample rate (1:20), so the Nyquist frequency of this sample stream is 5 Hz. Looking thru all the above, you can see that input frequencies that can cause aliasing should have been well stomped on.
Now you have a 10 Hz sample stream you want to apply a sync filter to. Let's say 1024 points, so you have to perform the multiply-accumulates at 10 kHz. Yawn. There is plenty of headroom to make the filter wider, probably limited more by RAM than cycles at this slow sample rate. In any case, even a 1024 point filter can probably be placed only 1/2 octave below the minimum pass frequency. Your desired signal above 25 mHz will be pretty much untouched, and below 12 mHz pretty much attenuated to the noise floor. Of course you'll have to figure out the details since you haven't specified important parameters like what your noise floor is, minimum acceptable attenuate in the pass band, acceptable transistion frequency range, and minimum required attenuation below that. |
H: From bitwise instructions to c code intuitively
I need to be able to recognize what an assembly code is doing. I can picture the basic instructions in C code in my head. But bitwise instructions such as and 10000001 and xor 11111111 in the middle of the code aren't so straightforward to comprehend.
Can someone explain how I should be intuitively translating bitwise operations to c code?
Thank you
AI: Ignacio is spot-on in his comment, and I'll add that the hardware functionality is actually closer to the assembly code so it would be better to learn assembly directly rather than attempting to translate.
The particular examples you presented have direct C equivalents, but there are many assembly operations which do not (despite C's low-level emphasis), so you will quickly get into trouble if you approach it that way. For example, rotating the bits in a byte with or without a carry bit could be clumsy. I know this for a fact because I have translated tight microcontroller assembly code that I have written into C for simulation (eg. Fractional math calculations).
Compare to learning a different natural human language- you may have to embrace some different paradigms to become moderately fluent. In English we go forward into future which seems to makes sense until you realize there are other languages in which you go backwards- you can see what's behind but not what is to come.
You'll want to study the instruction set, of course, with emphasis on adressing modes as well as the functions, but also the programming model- registers and so on. There is much more variation from processor to processor than there is between flavors of 'C'. |
H: What type of zener diode is this?
What type of zener diode is this? The thin band is blue.
AI: Other than the package looks like LL34, it's impossible to tell from the picture. The wide yellow band is almost certainly marking the cathode end. The line in the middle is not a marking band, but a artifact of construction.
You can try measuring the voltage across these diodes in normal operation. Keep in mind that for a Zener diode in Zener mode, the cathode is positive. If these are used as voltage references, that may work. If they are for clamping or other intermittent purpose, you may get lucky looking at the waveform over time. Otherwise, remove the didoes from the board and see what voltage they develop with about 1 mA reverse current. |
H: Where can I find an ic at home relevant to my project?
I am fairly new to electronics but I have a decent understanding of how basic components work. I want to start building my own audio equipment as fun projects and for actual use in my home studio (going for very unique sounds).
Unfortunately, I do not have access to a credit card and there are practically no decent electronics shops in my country that can provide the variety of parts that I require. I am also university student so I am broke :D. This means I have to salvage old equipment and reuse various components.
Right now I am trying to build an audio amplifier to power four 8 ohm speakers (2 tweets and 2 subs). Where is the most likely place that I can find an ic for my amp at home (aside from other amplifiers)?
Side note: I have one very old car amp, but the components that "looked" like ics don't yield many results on google, and I am really not sure if I can just supplant say an lm3886 chip for any random chip that I found lying around. The component's model is la3607. Also, could someone please tell me if there is a definite way to determine that a particular component IS an ic and what purposes it can be used for without google?
AI: I like to use Octopart to search for ICs and their datasheets.
To build an audio amplifier, you do not need to use any ICs. You could start by building a simple BJT amplifier. It should not be too difficult to find bipolar transistors in random (old) electronics. Focus on the 3-legged parts. Look for 8-legged ICs - they may turn out to be op amps. While you have the electronics in front of you, take a picture of the board (both sides), for later reference. Try to follow the traces and understand how (part of) the circuit works. It is a fun thing to do, you learn a lot, and it helps you identify parts. |
H: What does a race condition mean?
I'm a new electrical engineer so bear with me. I hear some of the other engineers I work with talk about a race condition that exists in one of our circuits.
What does that mean?
AI: It means, very simply that two things at the same time "race" for the result.
An example is a circuit with a Reset and a Set pin, if you trigger the reset, the output becomes 0. If you trigger set, the output becomes 1. If you first trigger set and then reset very, very quickly after it, reset will be seen, so the output is 0.
But, if they are both triggered at the exact same time, what happens?
If the circuit designer paid attention, there should be an answer, if that's important to the function. If there is no certain answer to that question, the circuit has a race condition, where the signal from the set and the reset "race" each other to see which one wins to determine the output.
The path with the least delay will usually win, but then you could see the race condition as the exact trigger in which the most delayed path is triggered exactly that much before the quicker one.
Many circuits, including logic building blocks inside ICs, have certain race conditions, but usually they are such that when you use the circuit the way it is intended, that you will not notice. So often when engineers say "race condition" out loud a couple of times they actually mean that it is also one that could happen in normal use, which would be a problem, because in a race condition normal operation cannot be predicted.
In software the term is also used, but often to indicate timing problems, or lock-ups. It is a similar principle, though. Often when you have two processes in a computer running independently, but using the same memory you protect that memory from being written by one, while the other is using it. If you don't they call that a possible race condition: One process could be reading a value that is just in the process of being updated, or both could be writing to it at the same time and then you don't know what will happen. |
H: What is wrong with my guitar amp?
I found this 1W guitar amp design on the Internet:
http://www.diale.org/punch.html
And I am trying to build it on the protoboard. I could not find the IC TDA7052, instead I've got the a TDA7052B. According to the datasheet, the difference is that it has one extra pin for volume control (pin 4), which I connected to an 1M potentiometer, like this (and I am hoping that wire below is ground):
I am using a 12V DC input.
Now, I can't see the difference of what I have built and the schematics, but clearly there is something wrong. The speaker output on open circuit is about 12V when volume potentiometer is at maximum, with no input. First that I believe that the mean DC voltage should be around 0, otherwise it will have a constant current drain. Second that, according to my calculations, to have a 1W power output at the 8 Ohm speaker, the peak tension must be at most 4 / sqrt(2) = 2.83 V. At the measured 12V, the power would be much greater. Indeed, if I turn it on, the IC will quickly get too hot. If place 270 Ohm resistance between the speaker outputs, it will get too hot, instead.
Here it is:
For someone with more experience in analog electronics, it should be obvious what is wrong. Can you please help me?
AI: You have a number of problems that I can see.
First, your grounds. You must learn that solderless breadboards, while convenient, are very bad for audio work. Using as short a jumper as possible (like, about 1/2 inch) connect pins 3 and 6. Then use a somewhat longer jumper to connect pin 6 to ground. Better yet, use 2 in parallel. Also, tie your buffer grounds to pin 3, not to the ground strip on your breadboard.
Next, decoupling. Connect your 0.1 and 220 \$ \mu {F} \$ capacitors directly from pin 1 to pin 6. Do not use these long wires, especially for the 0.1 \$ \mu {F} \$.
Third, your input AC coupling, C1. Do not use an electrolytic for this. Get a non-polarized 1 \$ \mu {F} \$.
Fourth. With no signal in, measure between pins 2 and 3. It should be zero. If not, figure out why your input buffer is messed up.
Fifth. Be aware that this is not a single-ended amplifier. That is, it does not have one side of the speaker grounded while the other varies. BOTH outputs will change with signal changes. In general, with zero input and a 12 volt supply, both outputs should be at 6 volts.
Sixth. Your voltage calculation is only partly correct. It calculates the RMS voltage to produce 1 watt RMS into 8 ohms. However, the actual swing must be multiplied by 1.414 to find the peak voltage, since for a sine wave of amplitude A, the RMS is \$ \frac{A}{\sqrt{2}} \$.
Finally, be aware that, since you are running 8 ohms/12 volts, your chip will run hot. |
H: Design PCB with copper polygon (Altium)
I'm sort of new to Altium, so any kind of detailed help would be very welcome... I need to create a PCB in altium that has copper all around with small plastic channels surrounding the tracks. Is it possible to create such thing (as described in the picture)? Do I have to create some sort of polygon around it?
AI: Yes, you use a polygon copper pour (put the polygon on a copper layer) and connect the pour to the desired net if you want to use it for connectivity (it's generally bad form to leave copper floating without a good reason).
Copper pours can be a bit inconvenient to work with while you are manually routing a board so you can 'shelve' the polygons while you are working on other things. Today's computers are not fast enough to repour in real time, so you need to repour the polygon whenever changes are made that affect the polygon (such as moving a via).
As David said, your image looks like a milled PCB that would likely have been created by post-processing the Gerber output files to create tool paths. |
H: Is there a technical reason not to use RCA jacks for speaker connections?
I'm designing a home-made amplifier and am trying to choose connection options for the speaker outputs; is there any reason that RCA plugs are inappropriate, assuming I control the full system, including making the correct cables? Can they cause interference of some sort? They would be more compact than banana sockets or terminal connectors, but seem rare - is this purely convention or is there a motivating technical factor?
AI: It avoids accidentally connecting a speaker output (100W at 8Ω => 28V) to a line input (which may not be 28V tolerant). |
H: FT232RL TX/RX Direction
I want to basically embed an FTDI cable in my board to avoid confusion with the RX/TX pins, wrong cable, etc.
I really want to make sure I choose the direction correctly though. I have UART_TXO OUT of the micro and UART_RXI INTO the micro. How should these be connected to the FT232R? I'm having trouble really nailing down the direction of each pin. Currently, I have:
Also the FT232R requires no programming, correct?
AI: In general, the RX pin of one device should be connected to the TX pin of the other, and vice versa. The R in RX stands for receive, and the T in TX stands for transmit.
Also, to the best of my understanding, the FTDI serial chips do not need to be programmed, plug and play so to speak. |
H: What do I need to create a USB interface between a PC and a board?
I am making a custom camera that will be interfaced through the USB port to the computer. Currently, the board contains all necessary circuitry to drive the image sensor. It outputs a parallel stream of pixel data and a sample pixel clock. The data is sampled with a NI DAQ board that is in the computer.
I would like to add/create a USB interface to my board, so I do not need to use the NI DAQ.
What options are there to create this interface? What do I have to consider? How complex would it be to write a driver for my board so a computer can recognize it? Any recommended articles to get a general insight on how to approach this problem?
AI: Sounds like you may need a lot of bandwidth over the USB interface. One need is to get a chip with a USB PHY and bring that up. Another possibility is to use an FPGA and an external USB PHY chip. This will be more work, but it could give you better performance. Another option is to use a USB FIFO chip which is easier to interface with, and couple that to an FPGA or CPLD.
Edit: If you need on the order of 1 Gbps of bandwidth, I think you have two main options: https://github.com/mossmann/daisho (uses TUSB1310A USB 3.0 PHY) or something similar to run USB 3 directly from the FPGA, or connect via PCI express or a wide parallel bus to a relatively powerful controller that supports USB 3. |
H: What's that two-bracket or pair of slopes like schematic symbol next to a data line?
I found this symbol in some datasheet. But I have no idea what is it? Can anyone tell me?
The symbol is mirrored and points towards a data signal line
It looks like an icon for a clock signal or a rising and falling slope or like two closing brackets
AI: TX_LED_N and TX_LED_P nets' naming convention says they are differential. It might be a instruction to the layout designer to route the lines strictly length matched tracks on PCB. It might also depend on the tool, the tool might automatically support pairing of differential signals and indicate the same via the symbol posted in OP. Below image from below link in comment. |
H: Can someone verify my EL wire oscillator?
I'm pretty new to electronics, but my latest project is a circuit with two "frames" of animation that I make out of EL wire, and I want to build a circuit to switch between them every 2-3 seconds or so.
To do this, I'm wiring an astable multivibrator to 2 triacs which each connect to EL wire strands 1 and 2. My goal is that when the respective square wave goes high, the base of the triac will go high and allow the inverter's AC voltage to pass through to the EL wire.
Can anyone verify that what I'm doing is reasonable? And any tips as I pick out components?
Thanks much!
AI: This is fairly close to your concept. D1, D2 and the ground symbol are only there to allow it to simulate (don't put them in the real circuit). SW1 is also there for simulation (to make the oscillator start) but it could be your SPST control switch- closed power triac 1 only is 'on' and open is for oscillation. I've shown a 6V supply to keep the reverse Vbe on the transistors acceptable.
simulate this circuit – Schematic created using CircuitLab
This circuit (with 470 ohm resistors) puts about 10mA through the triac gates, so you need to pick triacs that will reliably trigger with 10mA in quadrants II and III (IV is the hard one, and we're not using it).
C1 and C2 can be aluminum electrolytic capacitors rated at 25V or higher.
The main problem with your circuit is insufficient gate current for the triacs, also the time constant is too short for the times you said you wanted, and the 40K resistors are a little high for the required base current. |
H: Measuring current drops voltage?
We have some pcb in which contains an MCU ,and some WiFi module .
Usually at start, the board takes 70-100mA with 3v3 .
It gets its current from the UNO board connected to a mac.
It works great like that .(if you wonder how the UNO can get this current,me too)
Problem starts when we try to measure current. If we take the fluke device, and put it in serial to the voltage of the pcb to measure current, what happens is that the MCU starts to get resets, and the WiFi module voltage is drops .nothing is works than.
We have tried to change the current scale on the Amper-Meter , from 20m to 20A.
Nothing helped.
*if we measure current of other stuff that consumes lest current, it DOES measure and show the right current.
The problem occurs only with the pcb that contains a WiFi module that takes 70-100mA.
connections are:
3v3 from arduino - > Ampermeter plus->Ampermeter minus->board 3v3 .
AI: This is the "burden voltage" of an ammeter - when a 'shunt resistor' is used to measure the voltage drop due to current flow, then the voltage seen by the circuit being powered is lower. Multimeters, because of their wide sensing range, tend to have relatively high shunt resistors, which causes the circuit being powered to see significantly less voltage, and so some things don't work right.
I'd recommend putting a very low value resistor in series with the 3.3V rail that's powering the wifi module (say, 100mohm), and then measure the voltage across that resistor & do the Ohm's Law calculation to work out the current. |
H: Low Pass filtering in Delta Sigma modulation
I was reading about delta sigma modulators. I read that to make the data more accurate it performs digital low pass filtering on the quantized data. So like, if we have a one bit quantizer which is pushing data out at some rate, let's assume that its a DC signal,and we take average after every four samples we increase its accuracy to 2 bits. Similarly, if we take the average every 16 samples we increase it to 4 bits.
For a single bit quantizer, it makes sense since adding 4 one bit values would result in 4 different results which could be expressed in 2 bits. Firstly, is this reasoning correct?
But suppose instead, I have a 2 bit quantizer, and I average every 4 samples, what should be the resolution of the resulting output data?
Here is the link from which I was reading:
http://ewh.ieee.org/r5/denver/sscs/References/2002_07_Analog_AN-283.pdf
AI: If you averaged 4 samples from a standard ADC connected to a source that has band-limited (but spectrally flat) white noise then you would increase the resolution by 1 bit. This is the standard approach.
But, you are talking about a sigma delta ADC and the returns are much better than one-bit per four samples because this type of ADC produces quantization noise that is much greater at higher frequencies thus, averaging is much more effective.
(source: eet.com) |
H: Arduino Uno reading analog 24v DC signal
Disclaimer: Please be gentle - I'm a newbie with electronics.
Overview
I have a proprietary 24v DC analog sensor signal that I'm trying to interface with using a Arduino based microcontroller. The sensor is has only two connections which is used both for power and signalling.
Approach
I've searched various posts and sites regarding conversion of the 0-24v analog signal to the range 0-5v the ADC on the Arduino Uno (actually Freetronics Eleven with ATmega328P) can interpret.
From what I've pieced together:
The ADC is a 10bit for 0-5v so I have roughly 4.88mV per step (total of 1023 steps). The resolution is good enough for my needs.
I can use a simple voltage divider circuit to "scale down" to 0 - 5v range.
I should choose my resistor values not only to achieve the desired divided voltage, but also to suit the impedance of the ADC. I'm still lost with the whole impedance thing so I'm still unsure about whether to use R1 and R2 sized as say 4.7Kohm and 1.2Kohm or larger by an order of magnitude or two.
Voltage buffer / op-amp: I seen references to including this as part of the circuit, but again my ignorance only makes me dangerous at this point. I'm not certain why this is useful or what it achieves, but I think it seems to help address the mismatch of impedance from the 24v signal and that of the ADC? But I could be wrong.
One particular question that I have is about the fact that the ADC and the 24v sensor signal that I'm trying to interface is that they have different power sources, and apparently this is an issue because they don't share the same GND. Out of my depth, so some insight would be useful. The Arduino is running at 5v DC.
I realise SE prefers Q&A type of posts, but to me the above is context that fits together for the larger circuit - at least that's what I think.
I would really appreciate it if those with more understanding and knowledge could offer their insights and assert my thoughts above and even elaborate on it to further my understanding and clear up some of my misunderstandings.
Many thanks!
AI: It seems like your first task is going to be determining what sort of signalling is being used, so what you need to start with is a "poor man's oscilloscope" in the form of a microcontroller with ADC. You're going to want to use it to measure both the voltage across the sensor wires and the current through them; if the wires are used for both power and communication, it's likely that the way it communicates is by increasing and decreasing the amount of current it consumes, in which case your most useful information will come by measuring the current waveform.
As you observed, the Arduino can measure voltages between 0 and 5 volts on its analog ports. In order to measure a wider range, up to 24 volts, we need a voltage divider, like this:
simulate this circuit – Schematic created using CircuitLab
The basic operation of a resistor divider is simple. Ignore 'Radc' for a moment, and assume 'IN' is connected to a voltage source. Current will flow from IN, through Ra and Rb, to ground; the amount of that current depends on the voltage at IN. We can calculate this with i = Vin / (Ra + Rb). The voltage where Ra and Rb meet will depend on the current flowing and the value of Rb - it's Vdiv = i * Rb.
Knowing this, we can construct a divider for any ratio we want simply by determining the relative values of Ra and Rb. But what about the absolute values? In principle we can pick any magnitude we want, but in practice there are several important considerations:
It's likely that 'In' isn't a true voltage source, capable of supplying unlimited current, but instead has its own internal resistance, which we call the output impedance. If we draw enough power from it, it will cause the input to sag, producing inaccurate results and potentially affecting the rest of the circuit.
Dissipating a lot of current through our divider by using small resistors also wastes a lot of power, and produces a lot of unwanted heat.
It's likely that our measuring device isn't perfect either. Our equations above assume that the ADC doesn't put any load on the resistor divider, but that's not correct. Different types of input will load what they're measuring to different extents; this is where Radc comes in: it's a representation of the load that the ADC puts on the circuit, not a physical, discrete component. In the case of an Arduino, we can assume it's in the range of 10 kiloohms to 100 kiloohms, depending on things such as the sampling rate.
Point 1 above means that we want to make our resistor divider's impedance - the sum of both resistor values - much higher than the output impedance of the circuit we're measuring, so we don't affect our measurements. Point 3 above means that we want to make the resistance our ADC sees - Ra, in this case - much smaller than its own input impedance, so the ADC's impedance doesn't affect the measurements. If possible, then, we want to select a value in between - a resistance for Ra+Rb that's more than, say, 100 times the input circuit's output impedance, and a resistance for Ra that's less than, say, 1/100th the ADC's input impedance.
But what if those two requirements are in conflict? That's where an opamp comes in.
An ideal opamp (operational amplifier) has infinite input impedance - it doesn't disturb the signal it's measuring at all - and zero output impedance - its output is a perfect voltage source. Real life opamps differ from this ideal to a greater or lesser extent, but for our purposes it's close enough to true.
We can exploit these properties to make our measurement circuit better by putting the opamp between the resistor divider and the ADC input, like so:
simulate this circuit
Now, our resistor divider 'sees' a very high output impedance from the Opamp's input, and our ADC 'sees' a very low input impedance from the Opamp's output - the best of both worlds!
Choosing an opamp
But what opamp do we need? Well, we have a few requirements:
We want to be able to power it from our Arduino's 5v supply
It should be in an easy to solder package
Input and output should go all the way from ground to the supply voltage - this is called 'rail to rail IO'
It should be readily available and affordable
It should be capable of handling signals up to the maximum speed of our ADC - about 10-20KHz.
Its input impedance should be quite high
A quick search on digi-key reveals the MCP6241, which supports input voltages as low as 0.3 volts below the negative rail and as high as 0.3 volts above the positive rail (5v), and output voltages within 35 millivolts of the negative and positive rails, which is easily good enough for our purposes. This opamp's power pins can be connected directly to GND and VCC on the Arduino, with the remainder wired up as shown in the diagram above.
What about the resistor divider? Well, the MCP6241's datasheet says its input impedance is 1013 ohms - an absurd 100 teraohms, or one hundred million megaohms. This is high even for an opamp, and means we can use a resistor divider just about as large as you'd like - or so you'd think.
One final wrinkle in choosing our resistor divider value is that we don't live in an ideal world when it comes to constructing our circuit, either. PCBs aren't perfect insulators, and neither are breadboards; surface contamination will affect the resistance too, and if you touch your circuit, you can guarantee the resistance through your skin is a whole lot lower than a teraohm. All of this means that we should pick a resistor divider value that's much lower than the theoretical maximum - a good rule of thumb is something in the range of 100 kiloohms to 1 megaohm.
We want to divide our input so that 24 volts in is roughly 5 volts out, which means we need a ratio of 5/24=~20%. Suppose we set Rb at 100 kiloohms; that means that Ra should be 4 times bigger, or about 400 kiloohms. 402 kiloohms is a readily available value, which gives us a final division ratio of 100/(100+402) = 19.9%, meaning 24 volts in will measure as 4.78 volts out.
Measuring current
All of the above is aimed at letting you easily measure a 24 volt signal on your microcontroller without disturbing the input much. If you want to measure a current instead, your life is much simpler: determine the likely range of currents you want to measure, and pick a resistor that will create a small but measurable voltage drop at those levels. With your 24 volt system, anything up to 1 volt may be acceptable. Then, place that resistor between ground and your sensor's negative wire, and measure the voltage across it directly with your ADC, or via the opamp without the resistor divider if you wish. |
H: MOSFET choice for 12v LED Strip and 3.3v Logic
I'm currently planning a project on a low-cost WiFi-enabled RGB LED
controller and could use some help in looking over my parts list and
general concept.
What I'm wanting to do is a build a relatively low-cost, WiFi-enabled
RGB LED (strip) controller. In the end it should be controlled via an
Android App which is already being developed in my free time.
For the WiFi module I want to use the infamous ESP8266 board, namely an
ESP-07.
We are talking about normal, RGB, LED Strips (5050 SMD in my case) - nothing fancy.
The plan is to flash it with nodemcu firmware (can't provide a link, but googling "nodemcu" will show what it is about, but it doesn't really matter for the sake of the question),
write a simple TCP server implementation which allows to manipulate 3
GPIO pins' duty cycle over the network. I have no problems related to
the software or the programming of either the MCU, the App or anything
else. What I'm unsure about are the electronics involved here. I've come
to understand that I want to use transistors or MOSFETs to drive the LED
Strips 12v using the 3.3v logic of the ESP8266. From what I know, I
should choose a FET that can be switched fast (requirement for PWM) and
has a maximum gate threshold voltage below 3.3 Volts.
Based on these requirements and the availability at my supplier I've
chosen the IRFZ44N
and I want
to wire it directly to the three GPIO outputs of the Microcontroller.
Is
there any reason for this being a bad idea? Should I maybe add a diode?
I don't think so since LEDs are resistive load and not inductive (so
there shouldn't be voltage spikes or any of the likes, but I'm a layman
when it comes to electronics, far more involved in programming..)
Please tell me if there are any pitfalls to this plan and thank you for
taking the time to read through my plan.
AI: The FET you link to is not suitable for your application. Taking a look at the "typical characteristics" table, we see this:
Vgs(th) is listed as between 2 and 4 volts - already it could be higher than our supply voltage, but not especially the "conditions" column on the right: the specification is given with only 250 microamps of current. Your LEDs, presumably, will draw a lot more than that.
To figure out if the FET is suitable, you need to know how much current you plan to draw, then look for the graph plotting "typical output characteristics":
Look for a line corresponding to the gate voltage you plan to use - in this case, there isn't one low enough - and look for where the curve flattens out. If that's at a current level greater than the amount of current you need to supply, you're good. Alternately, look at the "typical transfer characteristics":
This plots maximum current as a function of gate voltage, so you can trace a line from your MCU's gate voltage - 3.3 volts - to determine what the maximum current level at that gate voltage will be. Again, in this case, the plot doesn't actually go low enough to evaluate that on this particular FET.
Keep looking - there are FETs that meet your requirements - and remember that everything depends on how much current you plan to conduct. |
H: Inerfacing switch & led with any controller
I am trying to interface switch and led. I want to write a program in which if I press and release the switch led should glow and if I again press the switch led should turn off. I am not able to write logic for it as I am newbie to embedded system. Can anyone just help me writing the logic for it.?
Thanks.
This is my code of turning on and off led using switch
CODE
int main(void)
{
DDRC |= (1<<PC0); //Makes first pin of PORTC as Output
DDRD &= ~(1<<PD0);//Makes firs pin of PORTD as Input
while(1) //infinite loop
{
if(PIND & (1<<PD0) == 1) //If switch is pressed
{
PORTC |= (1<<PC0); //Turns ON LED
_delay_ms(3000); //3 second delay
PORTC &= ~(1<<PC0); //Turns OFF LED
}
}
}
AI: I am not a programmer but after reading your question on solution came in to my mind which I am going to explain below.
For the below logic your LED and Switch both should be controlled with a controller's different I/O pin. First controller should sense the switch pressed logic and based on the switch logic controller has to first sense the LED I/O Pin Logic for previous condition of LOW or HIGH Logic. If LED Pin logic is HIGH make it LOW and vice versa. Note LED's pin I/O has to be reversed only after the switch is pressed.
Below logic can be followed
Switched pressed (Y/N)
{
If Y
{
changed the logic of LED port pin // If HIGH, change it to LOW if LOW, change it to HIGH
else N
{ Do nothing}
}
} |
H: Two rf 433 transmiter and one receiver connection won't work?
This is my problem. I want to transmit from two transmitters and capture data with a single receiver. I bought two pairs of rf433 and was able to transmit data between each of these rx-tx pairs correctly with ardunio.
But sending from two tx and receiving by one rx was unable to accomplish. Then I tried to find out the reason and here is what I found. These rx and tx modules wont work vice versa. See this diagram:
Since they both transmit 433Mz this also should work fine. If they work in vice versa only, I am able to transmit from two tx.
But I am unable to find out the reason behind this. I would be very thankful if anyone can help with this problem.
Thanks in advance.
AI: The transmitters don't transmit at exactly the same frequency - there may be tens of kHz difference - the receiver however is matched to the transmitter and, from what I know and have read about these particular devices, there is a manual adjuster on the receiver to bring it into near-perfect alignment with the transmitter it is paired with.
Notice the screw terminal on the receiver - this is, I believe, an adjuster that can align the receiver's operating frequency with the transmitter. Basically this means that two randomly chosen transmitters are unlikely to be at the same frequency and, as a result, one setting of the screw on the receiver will not suit both transmitters.
They are $5 a pair so you get what you pay for. |
H: VHDL "casting" a constant into a signal?
Is there a way to cast a constant value into a signal in order to send it into a function's parameter ?
Let's say I have this function:
Function mylogic(signal a, b, c : std_logic) return std_logic is
Begin
return ((not a) and (not b) and c);
End Function;
And I would like to call it this way:
... mylogic('0',a(3),a(4))...
I cannot send '0' as a parameter because the function expects a signal, is there any way to have it work without declaring another signal to hold the value '0' ?
AI: Just make the formal parameters constants (i.e. delete the word signal in the function declaration).
You're not driving them within the function anyway. (If you are, it isn't a function)
Then, when you call the function, the current value of each signal is passed as a constant to the function.
This won't work if your function uses the signal's attributes (such as 'event or 'stable, but 'length etc which aren't specific to signals would be OK). If you DO need signal-specific attributes you'll need to add a signal anyway. |
H: Does the altera ROM megafunction have a startup delay?
I'm trying to make a very simple single cycle CPU in VHDL. My machine code is stored in a ROM that was made by the Altera MegaWizard. The first word that is stored in this ROM is 0x1111. After writing a testbench for the CPU, I found that there is an initial delay of 1 cycle when reading from this ROM. Is this normal and is there a way to fix this? Would this delay even matter in my CPU?
AI: Depending on how you configured the MegaWizard settings, this is expected. If the ROM is contained in a block RAM, there is always at least 1 cycle read latency. Basically you assert the address at t=0, then on the next clock cycle (t=1) the address is loaded into the address registers in the BRAM. The data then appears at the data output of the memory ready to be clocked in at t=2.
If you use an MLAB then the address inputs can be specified to not be registered which means the data is ready to be clocked in at t=1 - but this can reduce the FMAX of the system - because you have removed the clock cycle of pipelining.
The latency may or may not be an issue depending on how you design your CPU. As it is a fixed latency - it will always be 1 cycle - then you can account for this in your CPU design by adding pipelining to the instruction and data fetching - e.g. fetch the next instruction while processing the current one. |
H: Charging circuit for automatically 'switching' between 1A and 2.4A?
Does anyone know of a charging circuit that could automatically switch between 1A and 2.4A depending on what the device accepts? Suppose the power source is 3.6V which till be stepped up. For instance, older phones would take 1A but the iPhone 6 takes 2.4A. I heard that there's a chip for this.
Thanks
AI: iPhones and most other cell phones are charged off of a 5v USB cable connected to the phone, which also provides wired access to the phone to transfer data to ad from a PC. Internally, the charging is controlled by a "battery management" chip like the bq24014. This is certainly not the same chip as used in the iPhone; it just happens to be one I've used when designing a cellphone type device. This particular chip is only good for 1A below.
The battery management chip provides several functions. First of all, it controls the charging through various stages -- first a constant current, then saturation phase with constant voltage until the charging current falls to a minimum level, and then turns the charging off. During all of this, it monitors the battery temperature using an optional third lead coming from the battery.
With the bq24014, the maximum charging current is set using a resistor connect to the ISET pin. Other battery management chips may use other schemes but the end result is the same. Using a MOSFET and another resistor, it is possible to have more than one charging current possible,
Batteries are typically charged at 1C -- the mA capacity of the battery for one hour; but may be charged as low as .1C or as high as 2C or 3C (fast charge).
So as you can see, the charging current is totally controlled by the chip inside the device itself, and not by the power source (though of course the charging current can't be higher than what can be provided by the power source). So if you step up the 3.6v from the 18650 using a boost regulator, and the charging current inside the phone is set at 2.4A, you're going to draw approximately 3.6A from the 18650:
$$2.4A \times \frac{(\frac{5v}{3.7v})}{0.9} = 3.6A$$
where 0.9 is the assumed efficiency of the boost regulator.
3.6A is just within the limits of the 2600 mAh 18650 battery, and well within the limits of a 3200 mAh battery, assuming a maximum discharge rate of 1.5C (yielding 3.9A and 4.8A respectively). Note as the voltage of the 18650 drops, the current draw will rise. When the voltage of the smaller battery has dropped below 3.45v, the current will be near its maximum discharge level of 3.9A. Not too good a margin. But with the larger battery, this won't happen until the voltage drops below 2.8v. Therefore: you need to use a 3200 mAh 18650 battery. |
H: What do these symbols in ac connectors stand for?
I'm trying to use a relay to control my house lights with a electronic circuit. I'm familiar with 5V DC circuits, but I've never played with AC before. My relay has three connections, which I assume are ground and the two wires that will be connected when the thing is on.
However, I can't find any datasheet or information about it, my only clue are these symbols:
Using pure logic I would guess that the "bottom" (in the picture) and the middle one are the connectors, and that the other ("top" one) is the ground. So when it is on the relay connects bottom to middle, and when it is off, connects the top to middle. Is that it?
And one more thing: my house is not grounded (yeah...). So is it safe to not connect anything in the ground terminal (leave it unplugged), or for this specific case I'll have to use some quirk to make it work?
AI: By convention, relay contacts are shown in the de-energized state.
The middle is the common. Top is normally open (connected to common when energized). Bottom is normally closed (connected to common when de-energized).
Verify with a multimeter.
The blue relay is a Sanyou type, very common and somewhat nasty pinout.
Not enough information (nor desire) to speculate on residential wiring codes and permissible connections in Brazil. |
H: What to choose hFE or beta from the plot of transistor's datasheet
Suppose I have this BC635 transistor, if I look at hFE then I'd say that the lowest value is 25 from that table in the Electrical Characteristics category, but if I look at the Figure 3. Base-Emitter Saturation Voltage from where I get the beta characteristic, on the right side of the plot beta is 10.
Now I only learned about the beta characteristic in school, not about hFE, but I read online that they are the same thing, although this is not true judging from the datasheet I linked.
The question is:
What should I use in my calculations for the base current if I want to use a transistor as a simple DC switch, beta from the plot or hFE?
What's more troubling is that some datasheets do not have those plots, what should I do there?
AI: If you are using the transistor as a saturated switch then you decide what Ic/Ib should be.
The saturated characteristics of the transistor are guaranteed at Ic/Ib = 10. Most often you'll use a bit less drive, maybe Ic/Ib = 20 unless you are very close to the limits of the transistor.
hFE is gain in an unsaturated condition (as an amplifier) with a relatively huge Vce (2V in this case). It is a poorly controlled parameter and varies a lot from part-to-part and with temperature.
You can say that you should have forced \$\beta\$ << hFE (specified at a high Vce) if you want consistent results.
Plots are only an indication of typical behavior, you need to look at the guaranteed limits for design. The plots may help you interpret the guaranteed results at intermediate operating conditions.
So, suppose you want to switch 100mA. hFE (Vce = 2V) is typically around 100, and does not tail off much as you go higher to 200mA (Figure 2) so we can be fairly sure it doesn't do anything weird, but the 100 is only typical. We can see that hFE is guaranteed to be 40 at room temperature and 150mA, so it should be at least 40 at room temperature and 100mA. It might drop 30% at low temperature, so we're left with a guarantee of 28 at low temperature and for a low gain unit. I think I would use Ic/Ib = 10 in this case, not 20.
Now that does not mean that you can't pull a random BC635 transistor off the shelf and use Ic/Ib = 50 and have it work most of the time, but that is not proper design. Don't be that guy. |
H: Why is the impedance in the parallel resonant circuit maximum at resonance?
Why is the impedance in the parallel resonant circuit maximum at the resonant frequency?
For example if we have two resistors in parallel the equivalent resistance is less than the values of the resistors in the circuit. Isn't this similar to the LC parallel circuit?
AI: All paralleled components produce an impedance that is "product" divided by "sum" and, at resonance, the "sum" part becomes zero because X\$_L\$ = -X\$_C\$. This means infinite impedance because "something" divided by "zero" produces infinity.
The impedances are opposite but equal in magnitude at resonance and, because they share the same voltage, the currents will be equal in magnitude but of opposite sign. The inductive current lags the voltage by 90 degrees and the capacitive current leads the voltage by 90 degrees hence, the net current is zero in the steady-state situation. |
H: How to choose transistor for switching bigger MOSFET
Leading on from my last question:
MOSFET choice for 12v LED Strip and 3.3v Logic
I have decided to use the IRFZ44N (despite it not being ideal for the job) for being economical the cheapest option and now need a second transistor that allows me to switch the MOSFET. The idea is the following:
Since the project already has a 12v lane in place for the RGB LED strips, I want to use another transistor in front of the MOSFET to raise the gate voltage to 12v allowing the IRFZ44N to be used for my project.
I know that I'm looking for a small transistor (nothing beefy) since all it will do is switch a MOSFET gate at 12v which is not current-intensive as far as I understand it. I want it to be fast-switching so that it does not interfere with PWM. Looking through a local supplier I found that I could get a BS170 for 10 cents. I wonder if this is a suitable transistor for switching a IRFZ44N at 12v Collector Voltage. The full plan repeated once again:
wire the BS170 to the microcontroller (3.3v on Gate), PSU (12v on Collector) and the IRFZ44N (BS170 Emitter to IRFZ44N Gate)
wire the IRFZ44N (12v on Collector, LED Strip to Emitter)
are any other components needed for this? Is the transistor a good fit? It seems to me that mostly any transistor would work as long as it is definitely conductive at 3.3v and can handle 12 Volts.
What I'm really unsure about is the amperage - how do I calculate how much current switching a MOSFET will draw? The BS170 cannot handle > 0.1A according to the datasheet (section 'transfer characteristics' for the Fairchild BS170.
Thank you for reading this - probably all too simple - question.
AI: A single transistor will not provide an interface with your FET AND do it without inversion. You can do the job with two transistors, though.
simulate this circuit – Schematic created using CircuitLab
This will provide a decent drive for your FET with about a 1 usec added to on-time. That is, if you put in a 10 usec pulse, the FET will be on for about 11 usec.
Also note that R5 needs to be a 1-watt resistor.
EDIT -
It turns out I was using the wrong FET model, and my value for gate capacitance was too low. For a "real" IRFZ44, the added pulse width is about 3 usec, not 1. The problem is that, when you go to turn off the FET, The charge stored in the gate can only discharge through R5, and the time constant is in the 3 usec range. You can, of course, decrease R5, but then the power it dissipates when the load is driven on goes up. You can get a 2 usec delay rather than 3 by decreasing R5 to 100 ohms, but then you need a 2-watt resistor. If you need very narrow PWM cycles (low effective motor current) you're probably better off with a more sophisticated driver. I personally tend to go with the Maxim MAX4426/4427 (less than $4 each, with 2 channels per IC), but that's just habit. |
H: Can I Reverse/upside-down mount SMD LED
I've seen reverse-mount LEDs which are meant to have the light shine through a hole in the PCB, instead of straight off. Is it possible to just add a drill hole for normal LEDs and just place them upside down before soldering?
Is it possible the lense/substrate will melt if reflowed on a hotplate? If it matters any, I've got 0805 components.
AI: Depending on the package, this can be done.
For my work, we evaluated several types of LEDs, and being mountable "through-PCB" was mandatory.
The right LED shown in the picture can be mounted normal and through-PCB, the second is exclusively for through-PCB, and the LED in the middle is a standard and very common 0603 package, not foreseen for through-PCB mounting.
It turned out the type in the middle had the best electrical/optical characteristics, and its small size was a benefit for us, too.
The package is a piece of ceramics with metal contacts of almost the same size on top and bottom side. As there are re-reeling companies out there which will turn the LEDs in the reels upside-down, it was possible to machine-place it like any other component:
Just note that size and tolerance of that transparent resin is not that accurate, so add some extra tolerance for the hole.
About possible temperature issues: During soldering, probably the entire tiny 0603 package will heat up to the solder temperature, so the resin and the LED chip should resist solder temperatures for a short time. Due to the size, I doubt that the resin will cool down faster when mounted normally. But I would recommend to solder at the lowest possible temperature and as short as possible. Also, have a look at soldering recommendations in the data sheet.
In general, no guarantee can be given, but it worked for us quite well. |
H: AtTiny84 with USB
I am having some problems with the ATTiny84 and USB. I am creating an "arduino clone" but I want a simple (and especially compact on the board) way to implement a USB serial interface. This will only be used for a slightly modified version of firmata.
I am having problems with the signal lines on the USB connection (which apparently have to be 3v3?). I have already created a schematic. (see picture) and I wanted to see if this is correct. The USB part is in a rectangle. I haven't really found any good documentation on this. The documentation I have found looks like the following:
This seems incorrect to me if the USB data lines require 3v3. or is this correct and can I hook it up this way to the attiny84 as well?
PS. I am an absolute electronics n00b so dont pick too hard on my mistakes...
AI: The two diodes in the lower circuit drop 2 × 0.7V = 1.4V Given the USB bus delivers 5V, the power supply rail of the ATtiny will be at 5V - 1.4V = 3.6V. This effectively limits the controller outputs to 3.6V.
USB data lines are spec'd at 2V8 ~ 3V6 (HIGH). The USB power rail is spec'd up to 4V75 ~ 5V25. Which means that the above is just marginally OK at best and in practice the USB power supply voltage is just below 5V. Also I didn't account for the diode voltage that may be just slightly lower than the intended 0V7. Although it is marginally OK, in practice it works just fine. I have a similar circuit on my bench and has been working for ages.
The diodes on my bench USB keyboard drop 0.7094V and 0.7155V, but I didn't do any effort to reduce current or whatever. Your mileage may vary.
The problem with the top circuit is that the resistors will load the data lines. And depending on the power supply voltage and the signal level on the data lines it may just work, but personally I'm not too sure about it. I have no experience with that architecture, in contrast to the other one. |
H: Coffee machine wiring diagram
First of all I am a beginner in electronics / electricity. I am currently trying to connect a coffee machine to a Raspberry Pi powered relay.
No problem with that, but as I am going to put apart and rewire a coffee machine, pretty dangerous heating device after all, I wanted to fully understand its wiring diagram beforehand.
That's where I'm stuck. This is the diagram I drew of it.
I could understand that the three pin device in the middle is a rocker switch. The thing I don't get is the use of the third pin in such a device. What if there were only two pins int the switch, and the wires connected to the upper right one were just fixed together ?
Thanks in advance!
AI: As said in the comments, it's most likely a circuit like this:
simulate this circuit – Schematic created using CircuitLab
Due to this design, the light will be on, whether the thermostat is on or of (if it exists in the circuit)
So yes, shorting the right terminals would give a nice short circuit.
I've also seen switches with four terminals. Two for a pure switch, and two for a pure light. |
H: Strategy for powering surveillance cameras
I would like to install 16 surveillance cameras
All the cameras are connected to a DVR, 25 meters away (at most)
All cameras are powered by 5V-DC, around 3W-6WS for each camera.
I have two strategies for the powering the cameras.
Use standard 220V-AC already spread around and have a small AC-DC converter for each camera.
Install a Main AC-DC (around 150W) near the DVR and connect all the camera with 12AWG wires.
There are many pros and cons for each strategy. I would like to get your opinion on the subject. Feel free to assume that 16 small power ACDC costs like one high power ACDC.
AI: The closest table of conductor resistances I have to hand is for 50Hz AC resistances of metric wire. For the purpose of this exercise, assume that the DC resistance is approximately the same as the AC resistance at 50Hz.
Suppose each camera requires 6 watts at 5 volts. This is 1.2 amperes.
The a.c. resistance of 2.5mm² conductor (common household mains wiring size) is 9.01 Ω/km at 75° C.
You need 50 metres of it (25 metres each way), so the circuit resistance is 9.01 Ω/km × 0.050 km = 0.45 Ω.
By Ohm's Law, 1.2 amps × 0.45 Ω = 0.54 V of voltage drop.
Typically, a voltage supply is expected to be within 10% of the nominal voltage. In this case, 10% of 5V is 0.50V, so the voltage drop of 0.54 V is probably too much.
If you go up to 4mm² conductor, with 5.61 Ω/km resistance, the voltage drop is only 0.33 V which is probably tolerable.
Personally, I would be inclined to run 4mm² conductors at 5 VDC. Low voltage is less of an electrocution risk, and you can install it yourself. You should (must?) mitigate the risk of fire (from faulted circuit) by installing a 4 amp fuse on each circuit.
Running 240 VAC to each camera means that you would need an electrician to do the work, you need to buy 16 individual power supplies, and those power supplies will be in very inconvenient places when you need to replace them. |
H: How do I design a 2A or more power supply for my consumer USB devices?
I understand that many of my consumer devices charged by USB ports can charge at higher rates than 0.5A. However, in testing, I've found they don't consume more than this.
Test Setup
I have a power supply that outputs between 0 and 30 volts, and 0 to 20 amps.
I set the voltage to 5 volts, then connected up a female USB to the wires correctly.
When I plug in a Samsung Galaxy S4 Mini, it pulls around 0.44 amps. It is the same with a Samsung Galaxy Tab Pro.
However, when I connect an iPad Air with an official lightning cable, it only pulls around 0.11 amps.
Also, I tried connecting a ZGPAX S28 smartwatch and it was still about 0.44-0.45 amps.
The power supply is more than capable of outputting the maximum 2.1 amps, so why doesn't it to at least the tablets?
What do I need to do in my test setup to convince the devices to consume their maximum charging current?
AI: The reason why your Apple/Samsung devices do not draw more current is simple.
It is because there is additional data communication going on between the Apple/Samsung device and their dedicated power supplies. This makes both devices recognise eachother and agree on a higher current to be used. The charger sets certain voltages on the USB data lines and this is recognised by the phone or tablet.
Your 20 Amps supply does not supply these voltages on the date lines so it does not "talk" to your Apple/Samsung device therefore these assume it is a normal "dumb" charger and do not draw more current than what is allowed by USB standard which usually is only 100 or 500 mA
To charge an apple device put thoses voltages on the data lines:
desired current :
2,000mA D- : 2.0V D+ : 2.75V
Also, depending on how full the battery is the charge current is also limited. It will only be maximum when the battery is 30 - 70 % charged (these numbers are just my guess). Charging with a high current is bad for the battery when it is very low or almost full.
Sources:
Adafruit : The mysteries of Apple device charging
Voltaic : Choosing USB Pin Voltages |
H: Power dissipation
In electronics, we always calculate power dissipation of components and devices all the time. I understand why we do this (heat issues and power supply), but there is something I never really quite understood.
What normalizes this power we always calculate? By this I mean:
Is it like the "percentage" of the power used by a device "per watt" from the source?
Power used per second the device/component is operational?
If the device is battery-powered , percentage of the total energy of the battery it will drain?
AI: Fraction of overall power used by a part of the device can be relevant. For example, this can tell you whether it's worth the complexity of turning off a particular subsystem when not in use.
Power per second makes no sense. Power is energy per second.
For battery powered devices, you want to calculate how long the battery will last, or conversely, what battery you need to last a certain time. |
H: Moving two elements from series to parallel
I got a small pizza oven with two elements (top and bottom), they are rated 115V 600W and they are connected in series, as we have 230V in Europe.
Everything works fine, but I would like to control those two elements independently (so I will need to connect them in parallel), unfortunately that is not going to work with 230V, what is the best solution, in your opinion, to connect them in parallel and still have them operate within their rated conditions?
AI: You can't just connect them in parallel.
If you're fluent with this stuff, you can drive each one directly from 230 V, but with PWM so that the average power doesn't exceed 600 W. There are various ways to do this, including triacs, but there are issues beyond what we can reasonably get into here. You have to consider what happens when the system screws up and applies the full 230 V. In that case the power dissipation will be 4 times intended, or 2.4 kW, for a short while. That will damage the element quickly, and possibly other things around it.
Another option is to use a transformer to make 115 V, then drive each element independently from that. That will work fine with less chance of catastrophic failure, but will require a big, klunky, and expensive 50 Hz power transformer. |
H: What is the simplest way to play a sound or wav file?
I'm pretty new/noob with electronics. I'm trying to reproduce a sound (I'm using Proteus as simulator) in a circuit.
I wasted hours of looking for but I can only found solutions with Arduino or synthetic sounds, I need to reproduce a "wav" sound or any other format, recorded previously.
Which is the simplest method/example to make this?
Thanks in advance
AI: Arduino will probably be the simplest option as I suspect there will be tons of various libraries and shields to do just that (3sec on google gave me the MP3 player shield from Sparkfun).
If you want to learn a bit in the process, and you don't mind that sounds will require pre-processing to be loaded onto the system, you could: read a WAV file into an array using any software of your choice, load that array into an EEPROM chip big enough for it, and use a counter to iterate through the content to play the song. Each tick of the counter you'll get a value, that needs to be sent to a digital to analog converter before feeding a small speaker (or a preamp). I did just that on an FPGA a few months back, using Matlab's wavread() function to get the EEPROM memory content.
Somewhere in the middle, you've got the MP3 decoder chips, for example from VLSI. The MP3 Arduino shield is based on that, and its schematic is available as usual on Sparkfun's website in case you want to adapt it for your own purposes. |
H: How to use a MUX DEMUX to communicate two circuits?
I'm trying to reduce two circuits with 14 connections to only 3. I was googling for hours and I read a lot about multiplexor and demultiplexor. But as is my first investigation in electronics (I'm a really noob) I can't found a solution to this.
My near aproximation to resolve this problem is the following one (is a concept/analogy, not the real circuit).
Any help or comment will be preciated as any answer!
Thanks in advance
AI: As long as you allow ground as an uncounted line, you can do it a bit more simply than Asmyldof suggests. Not only that, you can do it for as many channels as you like.
simulate this circuit – Schematic created using CircuitLab
The counters are synchronous reset, and the carry is active when the counter is at max carry. The polarities of the carry and reset must be the same. 74HC163 is a type IC, except that the carry and reset are of opposite polarities, so an inverter must be used.
There are only 3 signals required: clock, reset and data.
The counter size can be more or less indefinitely extended. |
H: How to switch between two analog outputs with a digital output?
I have a circuit with a 74ls93 counter and I want to use one of its outputs to switch between two analog output, i.e., when the output of the counter is HIGH, the output of the circuit must be V1 and when is LOW the output must be V2. V1 and V2 are fixed selected voltages between 0 and 5 V. The output of the circuit (V1 or V2) will be one of the inputs of a microcontroller.
What is the easiest and cheapest way to do this?. I think i need something like an analog multiplexer, but i'm not sure.
AI: Simplest and probably cheapest solution is to use 1/3 of a 74HCT4053, or use a 74HC4053 with a 4.7K pullup resistor on the 74LS output. Connect VEE to GND for this application.
A0 to V2
A1 to V1
AN is the output
S0 is the control input
/E should be grounded (to enable)
Unused inputs S1, S2 should be tied to GND or Vcc, the others can be left floating. |
H: Connecting BeagleBone Black to an Arduino
I am a software guy (everyone immediately downvotes...) trying do the following:
(1) On a BeagleBone Black ("BBB") I am driving a GPIO pin high in software.
(2) Then I am sending PCM (audio) out another pin as I2S serial.
I want to measure the time between (1) and (2). Of course I could use an oscilloscope, but I want to do the measurement 1000 times and take an average. So I plan to use an Arduino as a timer (I've already written and tested the software using push-buttons as inputs). My question: how do I connect the BBB to the Arduino?
I realize I must connect the GPIO pin of the BBB to an input pin on the Arduino.
And the I2S serial pin of the BBB to another input pin on the Arduino.
Is that it? Do I connect the GND of the BBB to the GND of the Arduino as well? And do I need to worry about the 3.3v output from the BBB (both pins) to the inputs on a 5v Arduino?
AI: Arduino expects a minimum of 0.6 * 5 V = 3 V at ts input to detect it as logic high. There is no harm in trying once by connecting directly from BBB to Arduino. Connect both the grounds.
If the voltage dips below 3.1 V for some reason, you can go for 3 V to 5 V voltage translator.
It should work without translator. |
H: Finding 2nd Vds value in a NMOS circuit
I think for the first part of this problem I solved for Ra = 13kohm and Rb = 7kohm, but I'm not able to understand or see how to get the voltage at the point V1. Any idea on how to go about finding V1?
AI: Both transistors conduct a current $$I_D=3.6mA$$.
Assume both of them operate in saturation (constant-current operation); use the relevant equation to find the overdrive voltage.
Then use $$V_{OV}=V_{GS}-V_{t}$$ to find the source voltage of transistor 2. The rest is easy. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.