text
stringlengths 83
79.5k
|
---|
H: wall warts: constant specified current though universal input voltage?
How come the input drawing current be constant (1.5A) even though it shows that the adapter is universal input (100-240V)? I mean that the power supply voltage varies in different locations still how come the current be same.
AI: The input current is not constant. The 1.5 A figure refers to the worst case, meaning the value that is guaranteed not to be exceeded under all combinations of valid conditions.
In this case, the combination of conditions is probably with 100 V in and 4.62 A out, although that is not explicitly stated, so you shouldn't rely on that. |
H: What is a RTOS, is it embedded or do I need to install? (MSP430)
First of all, I have the basic knowledge in low-level programming of microprocessors but I don't have the in-depth details which I need. I have never worked with RTOS before in my previous class. Now my thesis advisor wants me to test if a RTOS is really real-time he probably already knows the answer.
I tried to research about RTOS and OS but I couldn't find a direct answer for my particular question.
I wonder, do I need to install the RTOS to the MSP430 before I write codes - or is it embedded. If it's not installed already, can I install it through UART and USB-emulator?
Why do I need RTOS?
Thanks in advance.
AI: You are probably using Code Composer Studio or some other IDE. You will include the RTOS library (eg. TI-RTOS) with your code and it will be compiled and flashed** into the MCU memory. See, for example, this document.
(it's a bit buzzword-rich, but describes the functionality) This is a pre-emptive multitasking RTOS.
TI-RTOS is a scalable, one-stop embedded tools ecosystem for TI devices. It
scales from a real-time multitasking kernel (SYS/BIOS) to a complete RTOS
solution including additional middleware components and device drivers. By
providing essential system software components that are pre-tested and preintegrated,
TI-RTOS enables you to focus on creating your application.
TI-RTOS is not installed automatically as part of the Code Composer Studio v6.x
installation. You can install TI-RTOS from the CCS App Center (choose View >
CCS App Center in CCS). Choose the version of TI-RTOS for your device family.
If you use devices in multiple families, you can install multiple TI-RTOS versions
** Or whatever the verb is for programming their ferroelectric memory variants.. FRAM'd ? |
H: Why does putting resistors between Vcc/SDA & Vcc/SCL in I2C result in a square wave?
I'm trying to understand why placing resistors between Vcc and the data/clock lines helps my waveform be square, when I'm communicating between Arduino and an EEPROM chip. If resistors are not placed in the circuit, the waves look like shark fins. The circuit still functions, but they're definitely odd-looking waves.
For background, this question arose after wiring up an Arduino to a Microchip 24LC256 (EEPROM) using I2C. Upon inspecting the signals with my oscilloscope (trying to debug something unrelated) I noticed the waves looked, well, horrible. They looked like shark fins to me (is there a more accepted EE phrase for this?). I checked several times to make sure my probe scopes were tuned/compensated correctly, and verified I didn't get such behavior on other circuits. This is what the wiring looked like:
In a chance conversation I told an EE about this -- and they said this isn't uncommon for I2C. He recommended putting a 10k Ohm resistor between Vcc to SCL, and trying a lower resistor between Vcc and SDA. Additionally he recommended reducing the I2C speed to the lowest setting (31KHz for Uno). Sure enough if I put a 10k resistor between Vcc/SCL and a 4.7k resistor between Vcc/SDA -- they look nice and square. I also lowered the speed from normal down to 31KHz but that made a much smaller (if any) impact.
Unfortunately I never got a chance to ask why! I'm a noob to electronics but I'm very curious why a resistor placed like this causes them to be better looking square waves? This photo below is after using resistors, but before picking the 'optimal' resistor values for the best looking square waves. I think it looks much better.
I looked for explanations on Stack Exchange but to no avail. These seemed (potentially) similar to my issue:
Problem with I2C EEPROM communication (his waves look similar to what mine looked like, but the answer didn't address my question)
I2C interfacing between two chips (this one also seemed fairly promising but didn't dig into the "why")
Strange I2C signals emitted from FPGA (this seemed related to something else... though similar in that her waves look "ugly")
Thanks for the help!
AI: I2C is a bus that uses open drain outputs. An open drain is like a switch connected between the output and ground. It will not work without pullup resistors because there is nothing to make it go high.
If the pullup resistors are too high in value it won't work (or won't work reliably) because the resistor won't charge the capacitance of the inputs, the output, the wire and maybe a scope probe fast enough. If they are too low then the output won't be strong enough to pull it down.
You notice that on your scope measurement the outputs go low very quickly but are sluggish to rise to logic level 1.
If the code on your Arduino is using the internal pullup resistors on the ATMega to bit-bang an I2C interface then they are probably too high in value (tens of K ohms, and not well-specified) to work reliably, so they need to be paralleled with external resistors.
Personally, I would have written the code to not use the internal pullups (by default) to avoid the situation of the bus "almost" not working, and force the user to use the resistors or deliberately choose to use the internal ones. It's possible they're acceptable if the chips are very close together, low speed (100K) is used and no scope probes (especially in x1) are attached.
I've seen a very similar situation occur where 47K resistor networks were accidentally installed rather than 4.7K. |
H: "mapping voltage" on an analog potentiometer using a voltage divider
I'm working on a simple project to learn electrical circuits. I built a little sound box that will play tones when you press buttons.
The battery provides 3volts and the "power boost" is a buck converter that increases the voltage to the 9v needed to power the speaker.
I wanted to include a potentiometer to adjust the volume so I used one I had on hand. The problem was that most of the range of the potentiometer provided so little voltage that no sound came out of the speaker and then right as you get towards the end the volume shoots up.
I read a bit online and it seemed like using an analog potentiometer would resolve the issue since the resistance changed exponentially instead of linearly.
I swapped out the potentiometers, but it seems like I'm running into the same problem: most of the range of the potentiometer's resistance the voltage is so low that no sound comes out of the speaker.
I was talking with a friend and mentioned the issue and he suggested using a voltage divider to map the desired voltage range along the potentiometer. This sounds sensible, but I have no idea how it should be implemented.
Does using a voltage divider to map the voltage range to the speaker make sense? If so, how would I do it? I've been searching around for things like "potentiometer with a voltage divider" and "mapping voltage on a potentiometer" and have found plenty of results, but not for the task I'm trying to accomplish.
Any suggestions? Helpful links?
AI: It appears that you are using the potentiometer incorrectly for two reasons:
You are using it as a variable resistor instead of a potentiometer.
You have it on the speaker line. You should have it before the amplifier.
simulate this circuit – Schematic created using CircuitLab
Figure 1. (a) Rheostat. (b) Potentiometer. (c) Volume control.
Your diagram doesn't show the resistance value of the potentiometer or the speaker but let's say they are 1k and 8 Ω. 1k is a huge resistance to put in front of an 8 Ω speaker and only a small fraction of the power will get to the speaker. It's only when you decrease it to < 100 Ω that you can probably hear any change.
For a volume control we use a potentiometer. Note in Figure 1b that this has the bottom terminal connected to circuit ground. That means that as we slide the wiper up from the bottom the output voltage will vary from 0% to 100% of whatever is coming in on the IN terminal. (The output will actually be somewhat less if you have a load connected to the wiper. It will be very much less if you tried to connect your 8 Ω speaker to the wiper.)
What you need to do is get a proper amplifier circuit and hook it up as shown in (c). This way the volume control only has to deal with low powered signals and the amplifier boosts these to drive the speaker directly. That's how all amplification systems do it.
You need to draw proper schematics (component symbols, part numbers, designations - R1, R2, etc.) to help you and others understand your circuit. There are many online free tools and there is a CircuitLab button on the editor toolbar on this site (that I used for Figure 1). Have fun. |
H: Switching RS-485 bus
As shown in the graph, I'm trying to use mcu-controlled switches to turn a segment of rs-485 bus on or off (so that only one segment is on at a time). I was considering analog switches but I'm not confident how to take care of the negative voltage.
My question is:
Is an analog switch the best choice in this situation?(cost is an important consideration)
If so, what kind of analog switches should I use to switch the negative voltage line? or is there a better general method to do it? (a few specific recommendations would be even better!)
Thanks!
AI: Let's get some things straight first, to avoid miscommunication.
1) There is no "negative voltage line" in RS-485 specification. All the negative voltages in various guides and documentations refer to differential output of the line driver. The lines themselves (usually named A, B or Y, Z) swing between ground and positive voltage (standard +5V, but low-voltage RS-485 becoming more common).
Having said that, the wide CM range of RS-485 technically makes it possible for both lines to swing even with negative levels, e.g. -2..-4V. It is your responsibility to provide your nodes with common ground to avoid situations like this.
2) The maximum number of nodes usually limited by bus capacitance, however in case of RS-485 it is limited by combined impedance of receivers long before line capacitance takes its toll. Usually quoted maximum number is 30, which means your 120-nodes row might have to be split into 4 segments. I am assuming these are your "columns". However you can find transceivers with high input resistance that allow much higher number of nodes on the bus. The LTC2872 for example has 125k resistance, for up to 256 nodes. MAX487 that you've mentioned only allows 128 nodes. Note, that this covers 120-nodes row quite nicely, so you don't actually need "columns".
3) Dealing with this many nodes involves both hardware and software. Since RS-485 is electrical interface specification it says nothing about protocol. Therefore, if you resolve the impedance issue in hardware the software task will be simplified to providing correct addressing mechanism. Alternatively your software can treat part of the node address as MUX control and select correct node cluster before beginning actual communication. In both cases, you do not need those extra MCUs connected to switches.
4) Regardless of what you use to disconnect bus segments, simple termination will most likely be not enough. Biasing resistors should be used to ensure correct idle state of the disconnected bus segment.
5) On the network that big managing half-duplex communication can be quite challenging. Most solutions will likely reduce bus through-output. I would suggest using full-duplex wiring even if you don't need actual full-duplex communication. Uni-directional lines are much easier to multiplex and/or amplify.
Keeping all the above in mind, the actual solution can be as simple as adding a MUX for Enable signal connected to an array of RS-485 transceivers, one transceiver per bus segment. The Tx pins all connected together, the Rx pins need OR logic (either wired or gate). Also you might be able to find transceivers with 3-stated RX outputs or use MUX to connect one Rx at a time.
There are plenty of the suitable chips on the market, like LTC2872, LTC1335 etc. If you choose to split the lines for full-duplex, you can use quad MAX3030E transmitters. For the bus selector you can use any 1-channel MUX, like CD74HC4067, ADG731 etc.
So, the proposed configuration is 10 sub-nets of 120 MAX487/MAX489 nodes, plus 10 additional transceivers connected to master with two CD74HC4067 MUX chips on enable and Rx pins. No additional MCUs necessary.
If you are looking for ready-made solution, there are some RS-485 repeaters available, but they are quite expensive and you need at least 10 of them. IBS485, 8TMUX, PRO-2200. The only benefit of using these is that your software can focus on protocol only (see #3 above).
UPDATE
There is an option to actually use the wiring exactly as in your schematics, but without expensive ready-made repeaters. You can replace all those "switch + MCU" pairs in the drawing with 20 LTC2872 chips configured for half-duplex mode (compatible with your MAX487 chips) and connected with Y1-Z1 to main bus, Y2-Z2 to row segment. Then you cross-wire DY1-RA2, DY2-RA1 and you pretty much have low-cost repeaters. Here how it is done with two transceivers, but you only need one dual transceiver. And if you have used full-duplex wiring then you wouldn't even need that switching circuit in the middle.
So, all your nodes will be on the same bus. The rest is just a matter of a protocol, which in your case (single master) does not even have to worry about collisions. |
H: What is the difference between a 0 Ohm Resistor and a piece of wire?
As I was browsing through parts listings for a 3D printer project, I stumbled upon a resistor listed as "0 Ohm". Fittingly, it had a single band in the center: a black band. Because of \$U_t=R_tI_t\$, this piece immediately felt rather silly to me, as it wouldn't change the outcome of a series after Kirchhoff (\$R_t=\sum R_i\$) and would be a short in a parallel design: \$U_t=U_1 \& R_1=0\Omega \rightarrow I_1=\infty\$
What difference does this nill resistor have to just a piece of wire put in its place? Is there a special application where such a piece is used or is it just some kind of novelty?
AI: Zero-ohm resistors have several benefits over a simple bit of cable:
They can be used as a wire link and can be inserted automatically by PCB assembly robots. They come on a reel so no additional setup is required.
They can be used where a resistor may be or was used in certain design variations.
They can be used as test points.
They are often seen on single-sided PCBs to provide a jumper across some tracks to avoid impossible or very long alternate routes.
Wikipedia's Zero-ohm link has an interesting addition:
The resistance is only approximately zero; only a maximum (typically 10–50 mΩ) is specified.[2] A percentage tolerance would not make sense, as it would be specified as a percentage of the ideal value of zero ohms (which would always be zero), so it is not specified. |
H: wifi baseband access
I've got an unusual use case (optical communications) that would benefit from access to the wifi baseband signal before it is upconverted/modulated at 2.5Ghz. However most modern wifi chips combine baseband encoding and transmission encoding/transceiver functions on a single chip. Are there chips, or chipsets, that split these functions and would allow for custom final encoding - in my case OOK laser diode modulation at << GHz frequencies?
AI: Your request makes no sense - WiFi baseband is OFDM, and can't be converted to OOK.
None of the things that WiFi does to synchronize would even work with OOK.
It seems to me that you just want the bits going into the modulator. If that's the case: you don't need any hardware - that is exactly what your operating system sends to your WiFi card, and you need just a tap device (Linux networking terminology) to give you access to raw L2 packets.
Based on these, write software that controls youe light source. Later, port that to become a proper network card device driver. |
H: Powering 66 LEDs
I am trying to figure out some electrical values for a circuit I am designing. I am wiring 66 RGB CA LEDs in parallel. Each color channel takes 20mA (2.2v for Red and 3.2v for Green and Blue). How do I figure out the total ammout of current I'll need to drive each channel?
LED Datasheet
AI: If you run all colours at the maximum rated current of 20 mA, that will be 60 mA per RGB LED. for 66 RGB LEDs, you will need 3.96 amp.
If you run at a lower current, for less brightness, or know that all three colours won't be on at the same time, you will require less current. |
H: Does the Epson RX8900 real time clock count the year "00" as a leap year?
The datasheets ambiguously say...
A leap year is set whenever the year value is a multiple of four (such as 04, 08, 12, 88, 92, or 96).
Is zero a multiple of four? This is more of a philosophical question than a specification. The shown series starts at 4 and ends with 96, strongly hinting that the good folks at Seiko do not think that zero is a multiple of four.
Turns out to be a critical fact if you are trying to measure timespans - if you pick wrong then any date after Mar 1, 00 may be off by a day!
AI: Despite the misleading series in the datasheet, the RX8900 does consider the year "00" to be a leap year.
I tested this empirically by setting the date to Feb 28th, 00 and letting it roll to see what the next day was...
I also checked Feb 28th, 01 as a control...
If you are looking at this question, then this code might be of use to you...
// This table of days per month came from the RX8900 datasheet page 9
static uint8_t daysInMonth( uint8_t m , uint8_t y) {
switch ( m ) {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12: // Interestingly, we will never hit 12. See why?
return 31 ;
case 4:
case 6:
case 9:
case 11:
return 30 ;
case 2:
if ( y % 4 == 0 ) { // "A leap year is set whenever the year value is a multiple of four (such as 04, 08, 12, 88, 92, or 96)."
// Empirical testing also shows that 00 is a leap year to the RX8900
// https://electronics.stackexchange.com/questions/385952/does-the-epson-rx8900-real-time-clock-count-the-year-00-as-a-leap-year
return 29 ; // "February in leap year 01, 02, 03 ... 28, 29, 01
} else {
return 28; // February in normal year 01, 02, 03 ... 28, 01, 02
}
}
__builtin_unreachable();
}
static const uint32_t rx8900_days_per_century = ( 100UL * 365 ) + 25; // 25 leap years in every RX8900 century
// Convert the y/m/d values from the RX8900 to a count of the number of days since 00/1/1
// rx8900_date_to_days( 0 , 1, 1 ) = 0
// rx8900_date_to_days( 0 , 1, 31) = 30
// rx8900_date_to_days( 0 , 2, 1 ) = 31
// rx8900_date_to_days( 1 , 1, 1 ) = 366 (00 is a leap year!)
static uint32_t rx8900_date_to_days( uint8_t c , uint8_t y , uint8_t m, uint8_t d ) {
uint32_t dayCount=0;
// Count days in centuries past
dayCount += rx8900_days_per_century * c;
// Count days in years past this century
for( uint8_t y_scan = 0; y_scan < y ; y_scan++ ) {
if ( y_scan % 4 == 0 ) {
// leap year every 4 years on RX8900
dayCount += 366UL; // 366 days per year past in leap years
} else {
dayCount += 365UL; // 365 days per year past in normal years
}
}
// Now accumulate the days in months past so far this year
for( uint8_t m_scan = 1; m_scan < m ; m_scan++ ) { // Don't count current month
dayCount += daysInMonth( m_scan , y ); // Year is needed to count leap day in feb in leap years.
}
// Now include the passed days so far this month
dayCount += (uint32_t) d-1; // 1st day of a month is 1, so if it is the 1st of the month then no days has elapsed this month yet.
return dayCount;
} |
H: How to design a high impedance buffer circuit?
How can I design a buffer circuit that takes an input of +/- 10V and scales it down to a 0V to 5V.
The idea is to design a circuit that is microcontroller compatible (can be read by an analog-in pin by a typical 5V microcontroller) with input signals from Eurorack modular synthesizers outputting +/- 10V.
simulate this circuit – Schematic created using CircuitLab
I think I need a high impedance input but don't know what kind of transistors to use or what configuration to use them in.
AI: Something like this will probably work for you:
For R1 = 49.900K the ideal value of R2 would be 20.43904K and R3 would be 89.331K approximately.
The 4.096V source could be a 0.1% tolerance series reference that can sink or source current such as ADR3440. You can play with the resistor values to make them from standard values for R2/R3 as you like so long as the ratio of R1:R2:R3 is kept the same and the values are not too high or too low.
There should be a bypass capacitor on the op-amp supply and input or output protection may be required in a real circuit.
The op-amp has to be a rail-to-rail input and output type for +5V only supply.
simulate this circuit – Schematic created using CircuitLab
Note that if you leave the input open you will get an output voltage of 3.333V. |
H: Question regarding slew-rate
I have a question regarding SR effect.
Let's say that we have some simple amplifier with op-amp with the following parameters:
\$G=+10 \ V/V, \ f_c=1MHz, \ SR =1V/\mu s, \ V_{supply}=\pm 15V\$
The source signal is a square wave:
\$V_{in}=5V, \ \overline{V_{in}}=0V, \ f=10kHz\$
And I want to ask about checking if SR effect will occur - it is easy to notice that the output voltage will be limited by \$|V_{outMAX}|\approx 13.5V\$.
So should I check if
(1) \$2\pi\cdot\frac{f_c}{G}\cdot V_{outMAX}> SR\$
or
(2) \$2\pi\cdot\frac{f_c}{G}\cdot V_{out}> SR\$
where \$V_{out}=V_{in}\cdot G\$
All I ask for is a one word answer. Thanks in advance.
Edit: I assume that amplifier will produce something like this (red color) and this is what I am asking about
AI: There are two things at play here:
1) Opamp bandwidth
2) Opamp slew rate
Let's say your opamp has the following transfer function (a low pass filter):
$$ H(s)=\dfrac{10}{\frac{s}{\omega_c}+1}$$
So, at dc the gain is 10 and the cutoff frequency is \$\omega_c\$.
The response of the circuit to a unit step input (just considering one half of the square wave) is:
$$ v_o=10(1-e^{-\omega_ct})$$
This is just a signal that will increase exponentially at the beginning before reaching steady state.
Let's check if the output is going to be BW-limited or SR-limited.
$$\dfrac{dv_o}{dt}= 10\omega_ce^{-\omega_ct}$$
The slope is the highest near zero, so the initial slope is:
$$\dfrac{dv_o}{dt}\bigg|_{t=0}= 10\omega_c$$
It needs to happen that \$10\omega_c\leq SR\$ so that the output is not SR-limited.
In this case, for your 1MHz cutoff, \$10(2\pi f_c)\approx63V/\mu s\$. So your output will definitely SR-limited and this is just for a unit step input (your square wave has amplitude of 5V). In fact (theoretically) the output will not be SR-limited for values of the input of about 15mV or less. But you'd still have the BW limitation, which will keep the maximum slope at:
$$\dfrac{dv_o}{dt}\bigg|_{max}=10V_{in}\omega_c \text{ for sufficiently small }V_{in}$$
And when \$V_{in}\$ is big enough so that the previous equation is greater than the SR spec—then the limitation will be the SR. For practical purposes, you'd still be SR-limited because many opamps have offset voltages in the range of the minimum input voltage found in this problem (unless you use a precision opamp) but this is homework... |
H: What is the best approach when writing functions for embedded software in order to get better performance?
I have seen some of the libraries for microcontrollers and and their functions do one thing at a time. For example, something like this:
void setCLK()
{
// Code to set the clock
}
void setConfig()
{
// Code to set the config
}
void setSomethingElse()
{
// 1 line code to write something to a register.
}
Then come other functions on top of it that uses this 1 line code containing a function to serve other purposes. For example:
void initModule()
{
setCLK();
setConfig();
setSomethingElse();
}
I am not sure, but I believe this way it would be creating more call to jumps and creating overhead of stacking the return addresses every time time a function is called or exited. And that would make the program work slow, right?
I have searched and everywhere they say that the thumb rule of programming is that a function should perform only one task.
So if I write directly an InitModule function module that sets the clock, adds some desired configuration and does something else without calling functions. Is it a bad approach when writing embedded software?
EDIT 2:
It seems like lot of people have understood this question as if I am trying to optimize a program. No, I have no intention to do. I am letting the compiler do it, because it is going to be always (I hope not though!) better than me.
All the blames on me for choosing an example that represents some initialization code. The question has no intention of regarding function calls made for the initialization purpose. My question is Does breaking a certain task into small functions of multi-line (so in-line is out of question) running inside a infinite loop has any advantage over writing long function without any nested function?
Please consider readability defined in the answer of @Jonk.
AI: Arguably, in your example the performance would not matter, as the code is only run once at startup.
A rule of thumb I use: Write your code as readable as possible and only start optimizing if you notice that your compiler isn't properly doing its magic.
The cost of a function call in an ISR might be the same as that of a function call during startup in terms of storage and timing. However, the timing requirements during that ISR might be a lot more critical.
Furthermore, as already noticed by others, the cost( and meaning of the 'cost') of a function call differs by platform, compiler, compiler optimization setting, and the requirements of the application. There will be a huge difference between an 8051 and a cortex-m7, and a pacemaker and a light switch. |
H: Design an SMPS to provide 5V – Transformer
I'm trying to design an integrated IoT device that will replace standard light switches. Currently I'm using a Switching Power Supply from eBay: HLK-PM01, just to have an working prototype. Now I spend over a week searching for example schematics, IC and others to create my own small switching psu, but really I'm quite unsure how to begin with.
I need to provide around 300 mA 5V from 240V AC in my whole circuit. I've got an ATmega168PA, nRF24L01+ and other less important components, like status diodes and one analog sensor to power. I'm building the psu on my own to have the possibility to arrange those components on the PCB a bit more and to gain more knowledge about those modules.
Found out that an IC from the TNY263-268 family, from Power Integrations should fit my needs, but now my problem is:
What type (something like EF12.6 or EE13..?) and from where could I purchase a complete transformer that will fit into my circuit?
Often most examples mention discrete component values, but those transformers aren't really described.
Maybe I'm horrible wrong with all this, but I'm open to all suggestions and advices I can possible get.
AI: Maybe I'm horrible wrong with all this, but I'm open to all
suggestions and advices I can possible get.
I would look no further than Premier Magnetics - they support a large number of Power Integrations designs such as this universal one that uses the TNY-255: -
This page will take you to various options for off-line SMPS designs and if you click on UL-CSA Recognized - TinySwitch Transformers it will deliver the TNY options. |
H: SY8113 based Buck Converter Voltage Regulator design
I am working on an Electronics design which incorporates DC-DC buck converter voltage regulators. This is the first time I've been working with buck converters, so I have no experience and only limited knowledge on their operation. I've already found a design using the SY8113 for the same purpose as what I'm designing (power for a RPi CM3), but when I use the formulas in the Datasheet, the Inductor value I get does not match the "reference" design I've used.
To explain a little bit further; The RPi CM3 pulls a max load of 250mA on the 3.3V (and 1.8V) supplies, which in turn are supplied by the SY8113 circuits. These supplies also power some peripherals, but the total current should not go beyond 500mA. However, using the Inductor value from the reference design (2.2uH), it seems the power supply circuit is designed for a 3A power draw.
So my first question is: What is the consequence of designing such a power supply circuit for 3A, and then only pulling 250 - 500 mA from it?
Secondly, if I calculate the Inductor value from the datasheet formula, I get a minimum inductor value of 11.22 uH (so 15 uH should be a usable value). However, finding a 15 uH inductor with a DCR below 50 mOhm (which is recommended in the datasheet) seems quite hard. So what is the consequence of picking a 15 uH inductor with a DCR of 98-115 mOhm for instance?
I would simply like to know if I should use the 2.2 uH inductor from the reference design, or if I should use the value I get from the datasheet formula. Also, I would like to know about any problems which could occurr from choosing an inductor with a slightly higer DCR than recommended.
Datasheet:
https://datasheet.lcsc.com/szlcsc/Silergy-Corp-SY8113BADC_C78989.pdf
Reference design:
AI: What is the consequence of designing such a power supply circuit for
3A, and then only pulling 250 - 500 mA from it?
The data sheet says: -
3A output current capability
This means it is capable of delivering 3 amps. If your load is 250 mA then there is no problem. There is also a typical circuit on the front page that shows efficiency vs load current: -
As you can see, the load current range if from 10 mA to 3 amp.
In addition the regulator is a synchronous type and this means that it will handle a large range of load currents without excessive ripple voltage on the output i.e. it won't go into burst mode unexpectedly.
Secondly, if I calculate the Inductor value from the datasheet
formula, I get a minimum inductor value of 11.22 uH
You don't need to - stick with the 2.2 uH design and you'll be OK. |
H: Large current draw at each cycle
I am designing a power circuit based off an older circuit for a similar machine, and have had a few issues in LTSpice simulator, where massive currents are drawn for the capacitors charging.
The image above shows the capacitors spike at the frequency of the AC input, quickly charging, but drawing a huge amount of current per cycle.
The instantaneous current draw (approx 120Hz) is 18A, and I am wondering whether this value is harmful to the operation of the circuit (currently under a 3.15A fuse), as the normal DC load is under the fuse normally.
Circuit voltage vs total current draw
Circuit outline (Simplified)
(I've got ways to manage inrush current, but not the constant spikes)
AI: This is perfectly normal and is something of a downside of the capacitor input power supply, but they all do it.
Generally (unless you model the parasitics correctly) spice models of this sort of thing are a bit worse then the charging pulses are in reality, because real transformers have leakage inductance and resistance and real grids have both inductance and resistance.
The old school solution is a choke input supply, but it adds quite a lot of weight and needs a minimum current load to avoid the voltage shooting up, this was popular in the vacuum tube era where lots of volts at low current was the usual case. The modern way if a PFC circuit, but it adds a lot of complexity.
How much ripple can you tolerate? Reducing the size of the cap increases ripple, but raises the conduction angle, so less cap is better in that respect.
What almost everyone does is just to massively over size the diodes and size the transformer for the actual VA requirement (which will be quite a lot bigger then the average power), and carefully consider the cap ripple current. |
H: Pull-up resistor circuit clarification
I'm new to electronics and I'm trying to understand pull-up resistors properly. I have a problem with the following schematic:
I've redrawn the schematic into my following schematic for better understanding:
In the redrawn schematic, R1 represents pull-up resistor.
If we connect the circuits using the button, according to explanations I've read, the current should flow not to the MCU, but to straightly to the ground, because on that branch there is lesser resistance.
Based on conservation of charge, the current that goes in the branches, must come out of the branches, so I = I1 + I2. From that we can deduce I = U (1 / R2 + 1 / R3). However, branch leading straightly to the ground has (imo) approximately 0 ohms resistance, because there is no resistor, so I goes to infinity = short-circuit.
How is possible there is no short-circuit?
Is my redrawn schematic identical to the original one?
Also based on my knowledge of physics, even if we press the button and connect the circuit, there should be identical voltage on both branches in this parallel circuit. How is it possible that we can read 0 on the pin? Do we actually measure current instead of the voltage?
AI: The circuit modeled by you, shows R2 in series with R1. Closing the switch, will bypass R2, with a total current of \$ I = \frac{U}{R_1} \$. When the switch is open, current will flow equally on both resistors, which is \$ I = \frac{U}{R_1 + R_2} \$. So your formula is wrong.
But, also the schematic redraw is somehow wrong, since the input of the MCU has a resistance in the order of mega-ohms, and is better modeled as a capacitor or to simplify, as open-circuit. So the MCU can be excluded from the current loop and is only important to understand the voltage at its input.
When the switch is open: there is virtually no current, since the MCU input is just an open circuit, therefore the drop on R1 is null since there is no current, and on the MCU input you will see \$ V_{mcuin} = U - R_1 \cdot I = U\$.
Because \$I = 0\$ since there is no current loop closed.
When the switch is open: the current is the one flowing in \$R_1\$ and is \$ I = \frac {U}{R_1} \$, while the MCU will see 0V since it is now attached to the same negative node of your voltage generator U. |
H: How to achieve positional servo control with an Atmega328P?
I am trying to drive my SG90 servo using the timers on the Atmega329P using phase correct PWM. I have set up my motor well enough that it rotates, but I cannot get it to stop - the servo motor just continues rotating.
Here's my current code:
servo.c
#define F_CPU 16000000L
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "servocontrol.h"
#define TOP 500 // 1000*(64/16000000)
void servo_delay() {
_delay_ms(1500);
}
void setup_servos() {
DDRD = (1 << DDD5) | (1 << DDD6);
TCCR0A |= (1 << COM0A1) | (1 << COM0A0) | (1 << WGM00) | (1 << COM0B1);
TCCR0B |= (1 << CS00) | (1 << CS01);
OCR0A = 0x00;
}
void move_servos() {
for (int i = 100; i < TOP; i++) {
OCR0A = i;
servo_delay();
if (OCR0A == 300) {
PORTD &= ~ (1 << PD5);
}
}
}
servocontrol.h
#ifndef SERVOCONTROL_H
#define SERVOCONTROL_H
void servo_delay();
void setup_servos();
void move_servos();
#endif
main.c
#define F_CPU 16000000L
#include <avr/io.h>
#include "servocontrol.h"
int main() {
setup_servos();
move_servos();
}
I'm trying to use timer0 in phase correct non-inverting mode, but I exprecienced the same problem when I used timer1.
How do I get the servo to stop at the location I want? I feel like there is a part of the PWM process that I am currently missing, but I cannot seem to figure it out. I will greatly appreciate any help.
AI: At 16 Mhz and with 1/64 clock source you have 250 kHz TC frequency. You set TOP to FF (WGM00), so your PWM period is 2 ms. Normal hobby servos need period about 20 ms (50 Hz).
You can try 1/1024 clock for 32 ms period (at TOP = FF). Then OCR0A between 8 and 16 will give you 1 to 2 ms pulse width, for 8 positions of servo resolution.
You can use Fast PWM mode for 16 ms period. Then OCR0A between 16 and 32 will give you same 1 to 2 ms pulse width, for 16 positions of servo resolution.
Or you can use Timer1 with OCR1A as TOP for precise period control and OCR1B as duty cycle with much better resolution. |
H: Transfering configuration to IEDs using IEC 61850
Sorry if this is a dumb question, but since I don't have much experience with IEC 61850 compliant devices, I am having trouble creating the "big picture" of how the whole system is being configured in practice.
Specifically, I don't understand how the devices which transmit data GOOSE or SV (without mentioning MMS in their datasheets) use the Substation Configuration Language (SCL) in practice, i.e. I cannot seem to find the exact part which mandates how the configuration is transferred to actual devices.
Can somebody clarify which part of the standard describes this? Are these files transmitted over FTP, or over custom vendor (proprietary) protocols, or does MMS provide a way to transmit SCL files in a standardized manner?
AI: The standardised configuration process is defined in part IEC 61850-6 (along with the SCL itself). In summary:
Each device should have an IED Capability Description (ICD) file, possibly generated by the IED online, or provided by the vendor.
A software tool should be used to manage and combine multiple ICD files into the full SCD file, and set up things like GOOSE and SV communications between IEDs.
Each IED should be configured with the full SCD file. It is possible to transfer files using MMS, but I think it is vendor-specific how the IED is configured from the SCD file. |
H: Open-source layout routing tool
I am looking for an open-source circuit layout routing tool (with scripting option) for custom layout design. For example: I design a NAND schematic and convert it into layout and place components (NMOS and PMOS) by myself and then auto-route it.
If found Qrouter from OCD but it requires standard cells for routing. I don't want to use standard cells I just want to place individual components and then auto-route the design. I have checked KiCAD and gEDA but they are used for PCB designing and I couldn't find to control or program then with scripting.
Could anyone recommend some other options for me? Can't I use VLSI routing tools without standard cells ?.
Thanks
AI: No, you can't (with standard tools) do autorouting of transistor-level designs without standard cells. There are many issues that must be addressed when creating VLSI designs that are beyond the abilities of automated routers. The standard cell library is hand-crafted in such a way that these issues are invisible to the autorouter. For example, an efficient VLSI design must carefully plan the location and width of the power lines so that the P-well and N-well contacts (taps) can be made without blocking the routing of polysilicon gates. Unlike PCB design, the minimum pitch of every routing layer may be different and the sheet resistance of some layers may be much higher than others. |
H: Why is this the maximum dynamic range in a spectrum analyzer?
In Keysight's popular AN 150 there is a plot of noise and harmonics amplitudes versus the level of the input signal at the mixer (page 57).
It's stated there that the maximum n-th dynamic range is given at the intersection of the noise and n-th harmonic lines (i.e. when both noise and the n-th harmonic are of the same amplitude).
I'm having a hard time understanding why this is so. As I see it, one can change then level of the mixer's input to perform some kind of trade-off between SNR and harmonic distortion. So what criteria is followed to state that when both effects are equally relevant the dynamic range is maximum?
AI: Signal to noise ratio gets worse as signal level falls.
Signal to distortion ratio get worse as signal level rises.
Dynamic range is the ratio of the signal level to any unwanted signal, noise or distortion.
Therefore there is a signal level where these two unwanted signals are equal. At either side of that level, one or the other unwanted signal gets worse and dominates. At that level, dynamic range is best.
Note that the noise level depends on the resolution bandwidth, whereas the distortion level doesn't. The optimum dynamic range level therefore changes with bandwidth. |
H: Use transitor as a switch to ground audio input
I have got a probably very dumb question. I was not able to find an answer on the other topics because they always described the use of transistor as a switch for other applications.
I have a circuit with audio signal passing through and going to a speaker. I would like this signal to be grounded unless a 5V TTL signal is on. In this case this will have to go to the speaker. Can I do it with a transistor?
All the example that I found are about something (like a LED) already connected to a a voltage and then with the transistor either grounding its cathode or not and I do not know whether this would work in the other direction (what I would like to do).
Can I use a transitor to ground/mute the audio signal when TTL signal is zero?
AI: If what you want is the ability to switch between audio and silence, you can use an analog mux to switch between your audio input and ground, instead of the amplifier output. As an example, you would ground S1, S2, and A1, hook up your low power audio source to A0, connect A to your amplifier, and use S0 as your switch input.
If you want stereo, you'll need to use a chip that has two analog multiplexers, and repeat for each line. |
H: op amp current source oscillating
I know this topic has been discussed a lot, but there seems to be varying opinions about the solutions..
The problem is we are trying to make a current source with an op-amp driving a FET as the load. Our goal is to have a fairly high bandwidth for the regulating loop(couple of 100kHz?), but the output of the op-amp is oscillating.
Using a ADA4807 and a ST P36nE06 mosfet.
The values for the series(R2) and parallel(R3) resistors were chosen from the op-amps datasheet about driving capacitive load.
There is a 100nF bypass cap very close to the supply pins, and a 2uF cap also.
We have tried a few things which includes:
Upping the series resistor to 50ohm or 100ohm. Did not fix it.
Adding 1nF cap from output to -vin of the op-amp, together with a 10k or 100k resistor (miller integrator). Did not help.
Changing the 10mOhm resistor to 100mOhm. Did not help either.
The prototype is done on verroboard. I don't know if that could be an issue?
I would think this op-amp would be able to drive any capacitive load, but it doesn't seem to work for us. What are we doing wrong?
AI: The op-amp's capacitive load drive stated in the data sheet is 15pF giving rise to an overshoot of 30%. Yes, you can improve this by using a series resistor to drive the capacitor (The MOSFET is about 2 nF) but you are still driving capacitance within the closed loop feedback network and that makes adding a resistor pointless - you just shift the phase further and make it oscillate at a lower frequency.
In a closed loop situation like this you have to look at the op-amp's open-loop gain and recognize that it is never ideal and might have a phase margin that is quite poor at high frequencies. A poor phase margin means that negative feedback is close to becoming positive feedback and an extra bit of RC filtering (due to the gate-source capacitance) can easily tip the balance from stability to oscillation.
You need to put a capacitor from op-amp output to the inverting input and put a resistor (try 1 kohm) from that input (pin 4) to the feedback point on the current sense resistor. You may be lucky and get the bandwidth you want but there is no guarantee. |
H: Does this appliance break UK safety laws?
Good evening.
I recently purchased this active suction SMD pick-up tool from AliExpress:
When it arrived, it seemed to work fine. However, when I opened it up (to investigate the feasibility of adding a switch), I was less than impressed with the build quality and safety of the unit. (I was also staggered at the amount of empty space inside, but that's beside the point.)
The inside looked like this:
Closer examination showed obvious green corrosion on the ends of the wires; poor soldering; and damage due to a lack of strain relief:
I also noted that the capacitor was rated for 100V, which is far less than the operating voltage of the unit. Tests determined that the AC voltage drop across the capacitor was far less, however this probably did not take peak voltage into account.
At the very least, I would need to fix the solder joints and heatshrink the exposed contacts for safety. Either that, or demand a refund from the seller - and if I'm going to complain, I need to know what exactly I'm complaining about. I need to know if this device can legally be sold.
Therefore, my questions are:
Does this device break any specific UK laws or regulations, that I could complain to the seller about?
Do I need to replace the capacitor with a higher voltage one? If so, what voltage? I'm running on a standard ~240V supply, but I gather capacitive droppers should ideally be rated higher than that.
Presumably I need to add a fuse of some sort? (Again, does the lack of a fuse violate UK law?)
AI: Superficially that looks like a 'standard' triac dimmer circuit, and the capacitor isn't going to see more than a few 10's of V at worst.
The live wiring, although exposed inside the case, is not exposed outside the case - so isn't any more unsafe than it would be if the circuit was built on a PCB.
The oxide on the grey-insulated wire is probably from an aggressive flux in the solder. Not ideal, not particularly dangerous.
The quality of soldering looks something like I did when I was 10 years old, but I guess you get what you pay for ... |
H: using sine or square wave to obtain conductivity of solution?
I see for designing a conductivity meter, Some Designer use square waves, as excitation to obtain conductivity and some others use sine waves for this work in their design, which wave do this job better for me?
AI: I am in the process of designing an EC (Electrical conductivity) meter that works with the Raspberry PI and I am using square waves. It is much easier to generate a square wave than a sine wave. In my case, the RPi actually controls the timing of the square waves.
Typically, an an op amp is used to drive an AC signal to the EC probe. In this case, the edge rate is limited by slew rate of the op amp. Unless you are using a VERY fast op amp, you will not need to worry about issues from fast-edged square waves.
Simple EC meter designs rectify and low pass the AC signal output of the EC probe and measure the resulting voltage, but this is not extremely accurate. A better way is to use an A/D converter to measure the actual voltage output from the EC probe.
The design which I am currently debugging samples the EC sensor output after the rising edge of the square wave. It averages the actual voltage with a sample-and-hold stage driving an RC low pass filter to accurately measure the voltage with a low frequency A/D converter.
I have found that the main issue with accurately measuring the conductivity is that for high conductivity solutions, the ions in solution migrate very quickly, so you need to measure the effective solution resistance very close to the edge the square wave. |
H: Gyrator Derivation
I am trying to understand the input impedance calculation of this Gyrator circuit from Wikipedia.
The input impedance Zin is given as:
I am having trouble deriving this. My first reaction was to say Zin = Vin/Iin and setup a system of 4 equations to solve this. The math is not giving me an elegant answer like in the Wikipedia article. I am ending up with a far more complicated solution. Am I missing some easier approach to see the solution? It seems like the solution in the article the author right away sees that the Zin of the top branch is Rl + jwRlRC and the Zin of the bottom branch is (R+ 1/jwC). I don't see how he/she gets that tho.
AI: The way I approach this is to initially assume that the combined impedance of C and R is very high. Then I calculate the output voltage of the op-amp: -
$$V_{IN}\cdot\dfrac{sCR}{1+sCR}$$
Then I calculate the voltage across \$R_L\$: -
$$V_{IN}\cdot (1 - \dfrac{sCR}{1+sCR})$$
$$=\dfrac{V_{IN}}{1+sCR}$$
And, because: -
$$I_{IN} = \dfrac{V_{IN}}{R_L+sCRR_L}$$
$$Z_{IN}=\dfrac{V_{IN}}{I_{IN}}=R_L +sCRR_L$$
In other words an inductance of \$CRR_L\$ in series with resistance \$R_L\$. |
H: How to set PWM frequency with high granuality
I want to create a PWM at 100kHz that can have 1000 steps. e.g. when I set CCR1 to 0%, the PWM is off an when I set CCR1 to 499 it should be 50% and obviously at CCR1 = 999, it should be full duty cycle of 100%.
The CPU_CLK is 80MHz...but I can not achieve this. here is my code so far:
htim1.Instance = TIM1;
htim1.Init.Prescaler = 0;
htim1.Init.CounterMode = TIM_COUNTERMODE_CENTERALIGNED2;
htim1.Init.Period = 1000-1;
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
htim1.Init.RepetitionCounter = 0;
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE;
This gives me a PWM with frequency of 40kHz....far below 100kHz...the Prescalare is already at minimum ...is this impossible to achive?
The chip is STM32L476.
AI: The short answer is, it's not trivial with a clock of 80 MHz unless you pull off some dithering techniques (see below).
$$\mathcal{f_{clk}}=PWM_{frequqncy}\times2^{steps} $$
In your case, steps required is 10 bits...therefore you need at least a main clock of 100MHz.
The document I linked in my comment, shows some complex ways to achieve this with lower clock rates by dithering and combining more timers(it is quite complex). Here is the document by STM itself.
Obviously, Another solution would be using another MCU from the same family with higher clock speeds if your application/budget allows it. |
H: How does tuning in a spectrum analyzer actually work?
I have a pretty basic doubt about how tuning works in spectrum analyzers. I'm reading about the topic from Keysight's AN 150.
The problem arises in this paragraph in page 11:
We need to pick an LO frequency and an
IF that will create an analyzer with the
desired tuning range. Let’s assume that
we want a tuning range from 0 to 3.6
GHz. We then need to choose the IF. Let’s
try a 1-GHz IF. Because this frequency
is within our desired tuning range, we
could have an input signal at 1 GHz.
The output of a mixer also includes the
original input signals, so an input signal
at 1 GHz would give us a constant output
from the mixer at the IF. The 1-GHz signal
would thus pass through the system and
give us a constant amplitude response
on the display regardless of the tuning
of the LO.
The sentence in bold is what confuses me. As far as I know, the product of two sinusoids of different frequencies returns two sinusoids at the difference and the sum of the original frequencies. So how is it possible that the original input and LO frequencies are present after the mixing?
AI: A RF mixer doesn't actually multiply two signals, at least not directly. Instead, the signals are first added and then passed through a nonlinear circuit, which ideally has a quadratic relationship between input and output.
We can therefore represent the mixer by a function:
And putting the sum of two signals into that function gives us:
This clearly contains the original input signals. Only the product of the two input signals is desired, the rest has to be filtered out.
Most mixers produce even more frequencies than those because they're not purely quadratic but also have summands with an even higher exponent. Third-order is especially nasty to filter out.
A typical mixer uses a diode as its nonlinear element, which has (roughly) the following function, ignoring some constant factors:
Computing its taylor series, we get:
This clearly has b != 0, so we get some of the original input signal at the mixer's output if we don't filter it out. |
H: S - parameters or scattering matrix
i have written in dsp.stackexchange.com, but guzs have written me this question would be better off on this site.
I have questions according to how to measure s- parameter.
I have a two-port network:
Normalized incident voltage
Now I would like to derive from measurements by setting the value of the incident signal \$a_2=0\$, which:
\$S_{11}= b_1/a_1\$ with \$a_2=0\$.
How to set \$a_2=0\$?
How I have understood I need a wave which go in other direction compare with \$a_2=0\$. Can I reach this condition if I connect resistor with 50 Om
AI: If you connect an ideal matched load to port 2, that will set \$a_2\$ to zero.
However, it's not always possible, or convenient, to get a load that's sufficiently accurate for your purposes. It depends what accuracy you want to work to, and what frequency you're using.
At very high frequencies, GHz, we often use a 'sliding load', which is an approximately matched load, that can be slid along a precision air-spaced coax, to change its electrical length (reflection angle) without changing the absolute reflection. The measurement software finds the centre of the circle that results as the load angle is changed, and this point becomes the effective reflection from a load ideally matched to the air-line.
Another method uses shorted or open sections of coax of different length. With these it's a case of generate enough equations for the unknowns, and solve them simultaneously. Again, the impedance of the coax becomes the effective load impedance with this method.
If you have a load that's not matched, but accurately known, it's still possible to put its value into the equations, and get a good measurement of the S parameters, when used in conjunction with at least two other reflection standards. |
H: Fitting USB Data in Cat5 Cable with External Power
I have a camera system at home with a DVR, which connects to a VGA monitor and mouse with which you can read and edit its settings (the cameras can be accessed over the Internet). I've been trying to move the monitor out of the closet it was in before (that's where the DVR is) to a more convenient spot, on a desk in my room. As it turns out there is a Cat5 cable that leads to the closet from my room, and I was able to splice together a VGA cable to both ends of the Cat5 wire, which allows me to see the video feed from the DVR. The VGA setup I have uses 6 of the 8 wires in the Cat5 cable, leaving 2 behind. I wanted to also connect a USB mouse to the DVR from my room using the Cat5 cable, however you'd normally need 4 wires in Cat5 cable in order to do that. Despite this, I tried to run the USB mouse's Data+ and Data- through the Cat5 cable's remaining pair of wires, and I connected the VCC and Ground wires to a power supply. The mouse was powered (ie it lit up) but it did not appear to be controlling the DVR from my room despite the data cables being connected. Is there any way to run only the USB data through Cat5 and not VCC and Ground? This would allow me to run VGA video and USB through the same Cat5 cable, which I am hoping to do.
Here's the current setup, where the mouse is powered but not "connected:"
To <----VCC------+ (loose)
DVR's <----GND------+ (loose)
USB <----------+ To DVR's VGA out
in <--------+ | D- ^ ^ ^ ^ ^ ^
| +--------+ | | | | | |
+--------+ | | | | | | |
External USB Power Supply D+ | | | | | | | |
(an iPhone wall USB | | | | | | | |
charger adapter) (cable goes through walls)
^ ^ | | | | | | | |
VCC | | GND | | | | | | | |
| | +------+ | | | | | | |
| | D+ | +------+ | | | | | |
| | | | D- | | | | | |
| +----------+ | | V V V V V V
+------------+ | | | All VGA video,
| | | | to monitor
V V V V
To Mouse
AI: Your circuit is missing a common GND between the mouse and the DVR. This alone prevents USB from working correctly.
There is another issue: The CAT.5 cable is not suitable for USB - wrong impedance. It is also highly likely too long.
But there might be a simple solution: Try one of those wireless mice. |
H: how do electrical arcs occur?
I was under the impression that arcs form due to high voltage, that the breakdown of air was typically 3 million volts per meter. However, arc furnaces typically use low voltages, around 30 to 40 volts, and high amperages, usually a couple hundred amps. Do arcs form from high amperages too, or do they form from high power or what?
AI: What you want is Paschen's Law
Paschen's law is an equation that gives the breakdown voltage, that
is, the voltage necessary to start a discharge or electric arc,
between two electrodes in a gas as a function of pressure and gap
length.[2][3] It is named after Friedrich Paschen who discovered it
empirically in 1889.[4]
Paschen studied the breakdown voltage of various gases between
parallel metal plates as the gas pressure and gap distance were
varied:
With a constant gap length, the voltage necessary to arc across the
gap decreased as the pressure was reduced and then increased
gradually, exceeding its original value. With a constant pressure, the
voltage needed to cause an arc reduced as the gap size was reduced but
only to a point. As the gap was reduced further, the voltage required
to cause an arc began to rise and again exceeded its original value.
For a given gas, the voltage is a function only of the product of the
pressure and gap length.[2][3] The curve he found of voltage versus
the pressure-gap length product (right) is called Paschen's curve. He
found an equation that fit these curves, which is now called Paschen's
law.[3]
Basically, once air ionizes is becomes quite a good conductor. Passing a high current through it keeps it ionized. |
H: Battery labeling
I hope EE.SE is correct, otherwise, please point me to the right SE
According to IEC 61960 chapter 5 cells must be labeled like:
A1A2A3N2/N3/N4
e.g.
ICR19/66
Yet, this information is hardly found on any cell in the market. Every big company only provides 18650 with some additional information.
Why is that so?
What are the legal impacts of this missing label in case of a hazard?
AI: The IEC standard may say something about labeling, but the part you're missing is that there is not necessarily anything that forces companies to follow the IEC standard.
Companies don't follow standards like this unless they have to. "Have to" comes from two places, government regulations and market requirements. If the government doesn't require it, and the customers don't care, then there is no reason for companies to go thru the expense of being certified to a particular standard.
For example, large retailers here in the US often won't carry electrical products that aren't certified to certain safety standards (shock hazard, fire, etc). As a result, companies that want to sell their gizmos into that market effectively have to get them certified to those standards.
On the other hand, if nobody cares or forces you to do it, there is little point in going thru the hassle and expense of certification.
Some standards are also silly or over-bearing, and end up being ignored. There is no point jumping onto a standard until it is widely accepted. Only time can tell that. |
H: What is the name of this kind of connector where you stick a whole board in to connect?
An example of the connector type I'm looking for a name for can be found on this board:
It's the big box. You stick a board in to it with strips of exposed copper to connect. It also seems similar to how video game carts and USB work.
I'm looking to get my own version of this connector to interface with some old logic packages that I found.
These boards just have pretty common logic packages on them and they look like one plugs the whole board into something. I would like to design my own board to do this, but I think I need a part like the one on the adafruit board.
AI: They can be called edge connectors or card slot connectors, just to name two. |
H: Hard and Soft Chopping
I am controlling my BLDC (Brushless DC motor) controller with PWM technique by changing the duty cycle to reduce the power(current) in phase winding.
what is hard and soft chopping in PWM based controller(BLDC controller). Soft chopping is good PWM control technique compare to the hard one. But what is the concept of the both chopping and how to apply in the controller.
AI: There are dual N type bridges which use the low side PWM to create the boost voltage for the high side driver gate. This reverses sides with direction.
Acceleration ramp on PWM control, limits current and thus controls torque.
Soft chopping reduces slew rate dI/dt and thus reduces EMI noise at the expense of driver VI*f power dissipation often reduced by passive CM and DM LLC filters . (common and differential mode dual winding with RF caps to CM gnd and differential)
Examine the timing diagrams in published designs to see how. |
H: How to calculate secondary RMS current of each winding in multiplre output flyback converter?
As I am designing multiple output flyback converter and I have confusion in selection of wire gauge of the secondary winding. There are 4 secondary windings and one bias winding. Mode of operation is CCM.
V_out1 48 V
I_out1 1.5 A
V_out2 48 V
I_out2 0.15A
V_out3 25 V
I_out3 0.7 A
V_out4 25 V
I_out4 0.3 A
V_bias 16 V
I_bias 0.05 A
280 V dc input voltage. D_max=0.47, Lprimary=3.1mH, Fsw=65KHz
AI: Wire gauge is determined by the required output current. Estimate the wire length from the core size and number of turns, the calculate the resistance. Remember that the resistance of copper is a function of temperature, so you can use the wire resistance at your expected transformer temperature. The wire resistance is in series with your output, and you can perform the R*I^2 calculation to determine the power you will be generating which will be both a transformer loss and a heat source for your design. Remember that you will be supplying pulsed current, so your voltage drop will be greatest immediately after switching off the primary, and the voltage must be high enough immediately after switching.
You will have to do some math. When your power supply is fully loaded, what is the duty cycle? It depends on whether you are in discontinuous mode or continuous mode and the duty cycle, but the peak current on the output winding will be much higher than the average current. It should be relatively easy to draw a theoretical waveform, and then calculate the result of adding the expected winding resistance. |
H: How do you know that an oscilloscope is displaying the actual waveform?
As oscilloscopes get faster and faster, when designing a new scope how do you know that what it's displaying is the same as the actual waveform? For the fastest scopes, you don't have something faster that you can use to verify that the measurement is correct.
For testing a new scope design, is there perhaps some reference circuit that produces a waveform with known characteristics so that you can tweak the probe/amplifier/digitizer until you measure what you "know" the reference circuit is producing?
Do you perhaps measure single frequency sine waves and then assume a certain rise time waveform can be measured based on the bandwidth across which the scope can accurately measure the sine waves? What about intermodulation distortion?
AI: For the fastest scopes, you don't have something faster that you can use to verify that the measurement is correct.
This is not true. We may not have time-domain that can display faster signals, or direct digital synthesis methods capable of generating signals at these frequencies, but we have been able to generate signals in the hundreds of gigahertz for decades.
The LeCroy 100 GHz scope is, to my knowledge, still the only one with .1 THz bandwidth (though I've heard that might change in the next few years). I believe it was first demonstrated in 2014, and then released somewhere in 2015, but don't quote me on that. In any case, that bandwidth of real-time time-domain analysis has only become available within the last decade.
But a quick google will show you people talking about sub-millimeter wavelength systems and physics (generally sub-millimeter is used to refer to signals with frequencies above 300 GHz) since the early 1900s. So, for over a century people have been working with these signals.
Through using physical concepts to generate them, such as cavity resonators etc. we can generate signals that are very high frequency. Using non-linear devices, we can make mixers that operate at 1 THz now. So if we can generate this signal, and know it is a very pure sine we can input this into our new scope and start from there.
When working at these frequencies, we very often don't work with the time-domain (so what an oscilloscope displays) but with the frequency domain (what a spectrum analyzer/network analyzer displays). In fact, I have been working with systems operating significantly above 100 GHz for a few years, but I have not used a scope with a bandwidth over 50 MHz in the last decade.
The front-ends of those scopes tend to operate in a more frequency-domain way than a time domain way - they use mixers and power dividers to cut the input signal into a number of bands (in the case of the LeCroy, I believe it is 3 bands), and then mix each of these down to DC. Then we digitize all of those, and use very complex and smart DSP to stitch them all together. Using careful characterization of the system, we can allow the analog front-end to misbehave to some extent, as we can compensate for it in the DSP (provided it misbehaves in a very predictable and repeatable way). |
H: Can a 555 output be made to pull to ground?
I have design in Multisim with a 555 timer that I want to pull to ground when the signal changes. It's a missing pulse detector for resetting an mcu.
Is there anyway I can achieve this with say a transistor or mosfet?
I need it to pull to ground so i can reset a MCU.
AI: You can use CMOS version of IC 555 (LM555,.. for example). It will swing down to ground and up to VCC.
Or you can do this :
simulate this circuit – Schematic created using CircuitLab
Vcc depends on your MCU voltage and M1,M2 should be logic-level MOSFETs. |
H: How to prevent polling using RS485
I was advised to use RS485 since I have about 7 devices needing to talk to each other (and cannot get CAN to work).
Although I want to start simple (two devices where one sends and other receives), later there might be multiple senders. One of the can be seen as Master, but others also should be able to initiate messages. So I need some kind of polling protocol.
The problem is, in RS-485 every time a device sends a message, all devices will 'hear' it and have to process it (although it's mostly checking one byte to know it's not meant for them).
But if I would get like 100,000 messages per second (worst case), this still cost a lot of processing time. And the master device (who initiates most) needs to do quite some non communication related processing.
How can I reduce the polling? I was thinking of decoupling the master device directly from RS-485 by adding some kind of communication device that passes RS-485 back/forth the master (e.g. via SPI). However, this seems a strange solution (converting back/forth all messages via SPI, also latency will be affected).
Or using some dedicated line (like one of the RS485-A/B lines) that devices can set HIGH to announce they have data. But I'm not sure if I should treat this equally as a RS-485 signal (so essentially having 1.5 RS-485 signals).
AI: How can I reduce the polling?
Considering the advantages of CAN bus i.e. the peer-to-peer protocol and, considering how it works - devices with a lower address naturally override devices with higher addresses, I can see a way something like this might work on RS485 but with limited devices.
It is assumed that all 7 devices can recognize the end of a previous valid message. When this happens, each device counts a period of time proportional with its address (1 to 7 time-slots) but dutifully checks to see if the bus has become active by a device with a lower count. If that happens then that device gives up and waits until the message ends and tries again.
If the device in question reaches "its count" and the bus has not become active then it takes control.
This protocol is only really useful when the number of devices is low because hundreds of devices would waste a lot of time BUT, 7 devices will likely be quicker than sending a typical address byte.
To complete the cycle, if there are no devices wishing to communicate, one device (probably the last one) must issue a short message that resyncs the cycle back to the beginning again.
You have to decide on the length of the time slot carefully - it cannot be so short that a distant device thinks it can take bus control but in fact it just hasn't seen another device take bus control but CAN has the same problem potentially. |
H: S-Parameters math confusion
S11 for marker 1 says -47.661 dB
Two Questions
1st ..... What is | S11 | ^ 2
2nd
Is this accurate ?
g = 20 log_10(-47.661) dB
AI: 1st ..... What is | S11 | ^ 2
\$\left|S_{11}\right|^2\$ is a power ratio. -47 dB means a power ratio of roughly 2/100,000 or 0.00002 (because -50 dB would be 1/100,000 and +3 dB is about 2x)
You could also get this result by simply changing your network analyzer to display a linear scale.
Is this accurate? g = 20 log_10(-47.661) dB
Since you haven't defined \$g\$, it's not possible to answer this.
But it would be very unusual to take the log of a decibel value.
You get decibels by taking the log of a power ratio. Taking the log again doesn't generally give a meaningful result.
If you want to convert a decibel value \$X\$ back to a power ratio, you'd use
$$\frac{P_2}{P_1} = 10^{X/10}.$$
If you want to convert a decibel value \$X\$ back to a voltage ratio (assuming equal reference impedances for both signals), you'd use
$$\frac{V_2}{V_1} = 10^{X/20}.$$ |
H: Matrix board without solder pads
I am sure there is an obvious answer to this question, so I apologise in advance.
I ordered some matrix board, but what arrived has no solder pads. Every matrix board I have used has the solder pads, and so I am not sure what to do. The board has the holes, just no pads... Is this board for a different purpose?, or is there a way to solder circuit components to this board?
AI: You got bare perf board without pads, by the sound of it.
Yes, you can use that to make prototypes, just solder thin insulated or bare wires (think wire-wrap wire or something like AWG30 solder-through magnet wire) to the pins of the devices.
It's even possible to use it for SMT devices if you glue them down with legs in the air dead-bug style. |
H: Field Oriented Control Feed Forward Term
I implemented a Field Oriented Control (FOC) controller for a synchronous motor, which works already pretty good. Now the I-part of the PI controllers is necessary to achieve a good reference tracking, but slows down the dynamics drastically. I heard that a feed-forward term and prefiltering can be used to get rid of this problems, but I actually don't know how this could be achieved. The motor will mostly be driven at very slow speeds, but also here, a huge current seems to be difficult to track.
I heard that the plant of the BLDC motor for each phase can be simplified as follows:
$$\frac{1}{Ls + R}$$
Such that the output current is related to the Space Vector Modulation (SVM) voltages, but I don't see how to go from here.
How can prefiltering and feed-forward control be used to achieve better performance in Field Oriented Control (FOC)?
Edit: What I find is mostly the feed-forward part to compensate for the speed of the system, but this is not necessary in my application, since it is used for position control or slow speed only.
Is there a way to take feedforward terms into account to achieve better current control? Maybe I'm just bad at tuning my PI-controllers for current control, but it seems that the current is very sensitive to the P-part and so to get best current tracking mostly the I-part is used. So I'm interessted in how to achieve better and faster control of I_q and I_d.
AI: Consider an R-L load, the transconductance transfer function is as you wrote:
\$ \frac{I_{out}}{V_{in}}= \frac{1}{Ls + R} = \frac{ \frac{1}{R}}{\frac{L}{R}}s +1 \equiv \frac{K_{dc}}{\tau s + 1}\$
This can be viewed as your plant model P(s) and you can then create a controller C(s) to control the current in this RL load
\$ \frac{Y(s)}{X(s)} = \frac{G(s)}{1 + G(s)H(s)} = \frac{C(s)P(s)}{1 + C(s)P(s)H(s)}\$
Your controller could be a PI controller to minimise any errors in your load and equally control the bandwidth of the overall response. A voltage is applied to the load to realise the needed current.
At DC the voltage needed is that to overcome the resistive component, at AC it is the voltage needed to overcome the resistive and reactive component and the controllers response aims to control this.
The plants terminal voltage is thus: \$ i(t)R + j\omega Li(t) \$
But what about synchronous machines? (wound rotor, BLAC, BLDC? ). Current is needed to produce torque to either accelerate an inertia or oppose some load. With increase velocity the backEMF increases. This is a disturbance into the current loop. The terminal voltage is now:
\$ i(t)R + j\omega_e Li(t) + K_e \omega_m\$
So the current controller now needs to demand more voltage for the same torque. Under a constant speed situation there is no problem and is obvious you need more terminal voltage while running at a given speed to overcome the backEMF. But what about under dynamic responses? bandwidth testing? higher loop disturbance rejection? The current loop's is no longer outputting a response needed to produce torque but to mitigate a disturbance and this decreases the currentloops response.
This disturbance however is well understood and thus can be mitigated via a feedforward term to "inject" a voltage demand that would be known to be needed to overcome the backEMF at the present velocity, this leave the current loop to respond purely to the torque demand, be it due to load changes or demand changes
You have already included a diagram at to where the feed-forward term would be injected (I usually do not inject on the d-term unless I am employing some form of field weakening) and hopefully I have provided at least an initial insight as to how you may benefit from it when you have outer control loops and system dynamic's to control. |
H: NPN transistor as variable resistor for cc LED operation
I want to build a simple circuit, to control a chain of LEDs via an external PWM signal but limit their current. Unfortunatly I'm not aware of all the effects that the transistor would introduce to this circuit. If someone could point out any simple enhancements to compensate for effects I haven't taken in account for I would be very gratful.
There is a current I1 flowing trough the LEDs and the collector, which I want to be constant. V2 is a uC GPIO output pin with an Von of 3.3V (which I assume is close to constant) and Voff of 0V. The current from V2, to which I refer as I2, will be split into I3 (transistor Base) and I4 (R2). I therefor know, Vsense = Rsense * (I1+I2).
Now there is Vbe, which I don't know if I should assume it as constant. First it is dependant of Ice, second it may vary between production lots, I don't know, how signifficant this effect is.
Two resistors also seem too simple, but if it works.. Or should I better put in a diode instead of R2 and adjust Usense + Ube = Vdiode.
My goal is to get a few improvments or related circuits that get around issues like frequency dependency, change of parameters over temperature, production lot related variance etc.
Please, for the sake of simplicity, assume all the parts in this schematic a capable of handling the resulting theremal dissapation.
simulate this circuit – Schematic created using CircuitLab
AI: You show a voltage rail of \$24\:\text{V}\$. This may be a matter of convenience for you, but isn't required by your load. Or it may be that your load requires most of it. You don't show the load current. So it's not really possible to proceed very far with a design. One is instead, it might seem, faced with writing a book on the topic.
I do see a comment you made saying that there is a "chain of LEDs." So I'll assume for the moment that most of the \$24\:\text{V}\$ will appear across that chain, leaving the BJT with a small remainder to deal with.
Something like this would be preferable to your circuit (which I don't want to discuss.)
simulate this circuit – Schematic created using CircuitLab
I show some rough formula guesses on the above schematic but the formulas are here: \$R_1=\beta_2\cdot\frac{3.3\:\text{V}-2\:\cdot\: 700\:\text{mV}}{\eta\cdot I_\text{LOAD}}\$ and \$R_2=\frac{700\:\text{mV}}{I_\text{LOAD}}\$. The value of \$\beta_2\$ should be conservative for an active-mode BJT (perhaps 100.) The value of \$\eta\$ is a "fudge factor" I just created. Here, it should be at least 2 and perhaps as large as 4. I'd probably use 3, myself. (It should never be used, smaller than 1.)
You can find a longish discussion of such a circuit here: CC using BJTs. The discussion there is much more detailed and also includes a BJT+MOSFET version of the above circuit, as well. It's probably worth reading through.
Be aware of your dissipation in \$Q_2\$. Small signal versions of BJTs are usually found in TO-92 or SOT-23 and have a very limited ability to dissipate. Larger TO-220 packages can handle more and you can add heat sinks to them, too. It is even possible to extend the above circuit to share the load current between several BJTs.
(It may be a good idea to keep \$Q_2\$ thermally isolated from \$Q_1\$, since \$Q_1\$ is measuring the current going to the LEDs.) |
H: How can I power a device that requires 5-7V and 2.5-6 mA with what I have?
I have voltage pins on one device that outputs 6.23V DC and 70 mA DC. What type of circuit do I have to build that can power up another device that requires 5-7V DC and 2.5-6 mA DC using my 6.23 V source?
EDIT
The source outputs about 60-80 mA current, not 0.1 mA
AI: If your first device (the "supply") can only provide 0.1mA then you will need an external supply.
5V@6mA = 30mW
[email protected] = 0.623mW
30mW > 0.623mW
Energy is conserved.
Edit: You have added that the power source is intended to operate a cooling fan. In that case, it seems much more likely to be 100mA (0.1A) than 0.1mA. There is still potentially an issue with the ground and also the possibility it may be PWM'd or something like that (since the voltage is non-standard for a fan).
An external 5V supply really seems to me like the safest way to go unless you really need to avoid that. |
H: What information does one need to size inrush current limiting resistors?
I am trying to find a replacement for resistor Vishay CP00021R000JE14, a 1 Ω, 2 W ceramic wirewound (R_MED in the diagram). On startup, this resistor limits the current dumping into 200 µF of capacitance.
The instantaneous power is far beyond the 2 W part rating, but because this is not sustained, the part isn't destroyed.
The datasheets for many of these parts give things like "short time overload" power limitations, but say nothing of instantaneous power or current maximum values.
That said, what information do I yet need to assess whether another resistor is suitable for this purpose?
AI: I suppose to really calculate that you would need:
ambient/body temperature at t0
"disfunction" temperature of the core conductor
temperature/resistance coefficient of the core material
thermal conductivity of the body
thermal capacitance of the body
Of those given I think ther thermal conductivity from the core to the body and inside the body are the most significant. You know e.g. 2W*2,5*5s = 25Ws of power is fine, but that doesn't mean 1s @25W would be fine. You would need to make own measures to get the values that are relevant for your application:
Put the resistor in an oven, measure it's resistance over a few points to determine its temperature/resistance coefficient.
Then power the resistor with a fixed current for a fixed time and immediatly measure the resistance. Double the power, keep the time, measure the resistance and you can calculate the thermal conductivity. The Operating Temp range will give you a hint on how much you can stress the conductor. Add to it the temperature relative to ambient you measured at the resistor core after 2W*2,5*5s and you have the approx max core temperature.
Now you can run some calculations to ensure that your type of load doesn't bring the core to a higher temperature than the manufacturers maximum rated load.
I'm not taking thermal body conductivity or capacity in account, as I assume the time is significantly short. |
H: Why do I see 0v on electret microphones?
I've got a few electret microphones and I tried to make this circuit:
It didn't amplify my sound, it continuously buzzed. Without mic it did same thing. So I probed mic and I saw 0.000v. Also 0mA (shorted).
I tested 5 microphones sitting next to each other, they all had same results. There was a neodymium magnet about 3-4cm next to them. Are they broken? Or is there something else wrong?
AI: Electret microphones have an internal amplifier that requires a bias voltage at a few mA (or less) current; they have a moderately high impedance. Carbon button microphones are much lower impedance. Note that though a carbon mic is nonpolarized, i.e. it doesn't matter which way it's connected, electrets may require connection of a specific line to positive. Some electrets have a three-wire connection, one for ground, one for V+ and a third for output.
The schematic below should work with most two-terminal electret mics to drive a standard mic input on a PA, but you'd need high-impedance headphones or anther stage of amplification to drive a speaker.
from http://www.diyaudio.com/forums/instruments-and-amps/188392-buffer-preamp-circuit-electret-mic.html, modified |
H: How do I make a circuit for a push switch that in order to turn on you need to press it 2 times?
Is there any way to make a switch circuit that turn a led on by pressig it two times thank you...
AI: The logic same but with improved simulation and faster switch debounce time.
Only glitch is it may need power up reset.
1 second per division. |
H: Eleminating radiation from chargers
When I move my EMF radiation meter near a charger it shows me that there is radiation from the charger, and even the device itself radiates when the charger is connected to it.
The chargers emit radiation even if the device is not connected to them.
I understood that the radiation is caused because of the way the modern chargers are working. They are working in a way that they switch on and off very quickly. It is done by a DC/DC converter.
It results in a very high frequency noise (radiation) that travels on the charger's wires and even on the connected device.
But I noticed that when I connect the ground of the output of the power supply to the ground of the wall socket, there is no radiation!
So I have some questions:
Why it eliminates the radiation?
Is it safe to do that? (I know that the two sides of a transformer need to be isolated from each other, but it is just in principal).
Will it damage the device, the charger or the socket?
If it's ok, why the chargers are not designed in the way they will not radiate? (The chargers have only 2 connectors to the wall socket so why they don't have the third connector to the socket's ground?)
Thank you!
AI: The coupling capacitance in the isolation transformer causes common mode noise voltage from the primary side switcher not the low voltage side. So this Common Mode DC pair extends the CM noise to the laptop. Some have a torridal ferrite to absorb some of the CM signal but when the laptop is floating there is not much attenuation unless RF caps were used to the primary earth ground. This current is limited by the Earth ground leakage test limits often 250uA or 500uA depending on country. So the winding coupling capacitance often radiates with line frequency modulated 50kHz or whatever switching rate. Then external unbalanced mic’s often induce some of this E field into the high CM input impedance and causes nonlinear conversion to differential mode noise.
Earthing gnd shunts and attenuates the CM high impedance Signal to low levels.
That is simply an impedance divider.
This also works with any VGA video cable as this cable has earth ground from the 3 pin power plug.
The only risk is a ground fault to the grid could energize the metal edges of the laptop case momentarily or an open ground elsewhere but to a machine with high ground current may pass to a user touching a good ground.
A better solution would be to have a perfectly balanced high inductive CM choke with RF caps to earth ground to both shunt voltage but at lower CM noise current levels But this adds great expense it seems so it is not done for the few that might benefit from it. |
H: Output impedance of CNY70 circuit
I have a CNY70 sensor connected this way:
I read the output (the CNY1 port) with a PIC18F2550's ADC and in the datasheet, it tells me
The maximum recommended impedance for analog sources is 2.5 kΩ.
I want to know my circuit's output impedance because using common sense I can assume it's 10kΩ (because of R2). It actually works and also using an Arduino but I don't know if the ADC is being damaged or something.
AI: If the Vcc at the right side of R2 is in the allowed ADC input voltage range, there's no damage expected. The 2,5kOhm limit is for accuracy. the ADC takes a little input current and that can cause errorneous ADC result when compared to unloaded voltage. You said "it works" and I believe it - obviously you can take into the account somehow the possible conversion error or the exact value isn't interesting, you measure only if the voltage is over or under a certain treshold.
ADD due the comments:
It's difficult to decide how much more ADC input catches random noise due the bigger source impedance. Only careful tests can reveal how much there's random variation at the LSB end of the result.
See the datasheet. FIGURE 21-3: ANALOG INPUT MODEL makes possible to calculate the error limits due the leakage current (quite small) and you can decide how long it takes to charge the sample&hold capacitor to the needed accuracy.
There's suggested adding a capacitor. It reduces the noise but filters also the signal. Simulate it's effect. |
H: Why do some IDC connectors have gaps?
At my work we use IDC headers and cable terminators a fair bit, and we've noticed that most headers have a gap on the sides (see image below). It looks like a clip would grab the gap nicely, but have never seen any cable terminators with any such thing. My question is why might the gap be there?
AI: They're for retainer clips, but almost no one ever uses them these days. If additional retention is required then special headers with clips on the side are used instead.
page 5 |
H: How to make an Arc welder out of 3500v bug zapper transformer?
I got a transformer from old bug zapper it has 3500v output , can I use it to make an Arc welder by removing the secondary windings and put 10 gauge wire windings instead.
I saw some videos on youtube to make it using microwave transformer, can I use the same concept?
Thanks in advance.
AI: You mentioned replacing the secondary with 10-gauge wire - I'm guessing that you have some understanding of the thicker wire's greater current-carrying capacity, which you would need for an arc welder.
The problem here is that the magnetic core - the steel laminations - also have a maximum magnetic flux carrying capacity, just like the wire has a maximum current-carrying capacity. The bug-zapper manufacturer would have used the lowest-cost (smallest) laminated core that met the power needs of the zapper - which are MUCH less than what you'll need for an arc welder. You would find that the secondary current would max out at a too-low value.
One caution - if you do get hold of a microwave transformer, DO NOT power it up on the bench top. Microwave transformers are one of the few devices that supply both high voltage and relatively high current - and are pretty much guaranteed to kill you if you get across the HV side. Not sure about bug zappers, but I'd be very cautious with that as well. |
H: Inserting an unused voltage source in LTspice messes up transient results
This took me three days to figure out. Consider this simple circuit in LTspice:
Looks pretty innocent. The output is a 1V sine wave, as expected. Going to View->FFT, setting number of data points to 5000, Start Time 50u, End Time 100us. No filtering. This is the output:
An output like this does not quite make sense for a sine wave output and/or a weakly nonlinear system in which the harmonic should fall gently.
Now delete V6 and re-run. Voila, the spectrum makes more sense.
LTspice does not allow for "commenting out" certain blocks and does not even remember the parameters. So if I switch between sin and pulse input, I always have to recreate and memorize the entire parameter set. Hence it makes sense to place all the sources on the schematic and just connect the one with which I am working right now.
I have the suspicion that it has to do with the discrete-time timesteps which are enfored by merely placing a pulse source.
My question is:
What did I do wrong?
How can this be avoided? In other words, how can I trust the output of a transient analysis?
Unfortunately LTspice seems so spartan: Are there any options to enfore a fixed sample step? Any options to resample the transient output such that it is suitable for a DFT?
AI: There is nothing wrong with what you did, but it can be improved. As per the comments and @HKOB's answer, the extra source has a 1ps rise/fall times, compared to its duty cycle of 0.5us. While the PULSE sources are internally fixed valued per timestep -- that is, throughout the simulation, at any time, LTspice knows what values are at what times -- the solver still needs to reduce its timestep in order to accomodate the very sharp rise/fall times. This is, in this case, mostly due to the very smooth nature of the signals (sine input, sine output). This, together with your imposed timestep of 10ns for a period of 1us, makes LTspice generate additional noise, despite .opt plotwinsize=0, but also notice that the values of the induced noise are very small, comparable to the ones for the missing source.
BTW, you can add a 0 to the beginning of the pulse, followed by a comment: 0;pulse ..., this will make the source be zero valued. Or, you can prepare it to be ready for a .step like this: pulse {-a*0.8} {a*0.8} 0 {1p*a} {1p*a} {0.5u*a} {1u*a}, where a can be .step param a list 1 0, for example. Here's the result with these settings:
Notice that the noise (until 100MHz) is actually less than the harmonics due to relatively large timestep, which means it's safe to ignore them, or improve the simulation: simply make the timestep 1ns (1000x less than the period), and re-run.
You can go lower, but for the amount of time you're simulating it will get very slow for little added benefit, which means you can reduce the total simulation time to 8-10 periods or similar (unless you really mean to capture the very low frequencies, too) and the result will be faster and with the same relevance.
Unfortunately (and, at least to my knowledge), there is no SPICE simulator that has a true fixed timestep and that is due to the nature of the solver. What timestep you impose only has the effect of restricting the solver to the maximum of those timesteps, but it will go lower if it needs to. |
H: Help in the closing of a logic circuit
I'm currently studying logic circuits for my exams and came across a question "7. An electrical circuit is set up with four switches. A lamp will light only if the following happens:
Switches A and B are both on.
Either Switch C or Switch D is on, but not both.
Draw a logic circuit to represent this. I made a AND gate for A and B, made an XOR gate for C and D but don't know how to close the circuit into one output as I now have two outputs. I hope you guys understand my situation and help with it, Thank you. If this is the wrong site please lead me to the correct site, please.
AI: This is an English language problem. You've been given a specification in natural language, and are struggling to turn it into explicit logic.
Switches A and B are both on.
You've used an AND gate for this, correct, that clause is (a AND b), let's call this partial result e.
Either Switch C or Switch D is on, but not both.
You've used an XOR gate for this, correct, that clause is (c XOR d), let's call this partial result f.
So far, you've reduced the whole expression to ...
A lamp will light only if the following happens: e ? f
Now, does 'only if' mean it lights if e AND f, or does it mean e OR f?
This is why engineers get themselves into trouble, accepting a job with a specification written in English, and then realising they don't actually know what it's asking until they come to implement it. 'Only if' sounds a bit logiccy doesn't it.
'Only if' is not used in logic. There is a term 'if and only if', usually expressed as IFF. However, IFF is a biconditional, it's designed to express a truth about a system, rather than as a formula for getting a result from inputs. For instance 'I have a brother IFF my sibling is male'. (Something) IFF (conditional).
As you're trying to make a logic formula work, it clearly doesn't mean IFF, but IF. So we have ...
(A lamp will light) IF (e ? f).
The IF still hasn't clarified whether that ? should be AND or OR, or even something else. English is not precise enough. It could mean either of those.
Let's put the 'only' back in again, to see if it helps to qualify whether it's AND or OR.
A lamp will light ONLY if BOTH the following happens: e ? f
A lamp will light ONLY if EITHER the following happens: e ? f
As a native English speaker, the first one sounds reasonable, if unusual, but the second one sounds really odd. If English wasn't my first language, then I may not come to that conclusion.
This may be a question designed to test whether you can spot ambiguities like this, and say that the question is underdetermined.
However, if I was taking an examination, and believed that there 'was only one correct answer', then I'd plump for AND, that's my best reading of the English.
If I was implementing a product from a customer's specification, I would go back to them and ask them if that's what they really meant. |
H: In a Wilson mirror, does Q3 need to have the same beta to cancel the base current error?
I'm learning about Wilson mirrors in the Art of Electronics Third Edition (pg. 102). It shows the following circuit:
simulate this circuit – Schematic created using CircuitLab
It then explains the circuit. As part of the explanation it says this:
Transistor \$Q_3\$, by the way, does not have to be matched to \$Q_1\$ and \$Q_2\$; but if it has the same beta, then you get an exact cancellation of the (small) base current error that afflicts the simple mirror of Figure 2.55 (or the beta-enhanced mirror in Chapter 2x).
Exercise 2.17. Show that this statement is true.
Figure 2.55 is just a Widlar mirror as so:
simulate this circuit
The book doesn't explain what the "(small) base current error" is but I assume it's referring to the fact that in the Widlar mirror, \$I_P = I_{load} + I_{B_{Q1}} + I_{B_{Q2}}\$ instead of \$I_P = I_{load}\$. So I set out to solve Exercise 2.17 with that assumption.
From an analytical perspective, it makes sense to me that if \$Q_3\$'s base current is equal to \$Q_1\$'s base current, \$Q_3\$ will balance out the equation. \$I_P + I_{B_{Q1}} = I_{load} + I_{B_{Q2}}\$ (and because both base currents are equal, \$I_P = I_{load}\$). However, when I start to solve this mathematically involving \$\beta\$, it seems to me that \$\beta\$ needs to be different, not stay the same.
Here is my logic:
\$ I_{B_{Q1}} = I_{B_{Q2}}, I_{C_{Q1}} = I_{C_{Q2}}, I_{E_{Q1}} = I_{E_{Q2}} \$
\$ I_{B_{Q3}} = I_{B_{Q1}} \$
Use \$ I_B = I_E - I_C \$ to give \$ I_{E_{Q3}} - I_{C_{Q3}} = I_{B_{Q1}}\$
Use \$ I_{E_{Q3}} = I_{E_{Q1}} + I_{B_{Q1}} \$ to give \$ I_{E_{Q1}} + I_{B_{Q1}} - I_{C_{Q3}} = I_{B_{Q1}} \$
Rearrange to give \$ I_{C_{Q3}} = I_{E_{Q1}} \$
(Lines 2 & 5 appear to be correct according to my simulations)
Use \$ I_C = I_E - I_B \$ and 2. and 5. to give \$ I_{C_{Q1}} = I_{C_{Q3}} - I_{B_{Q3}} \$
Use \$ I_C = \beta I_B \$ to give \$ \beta_1 I_{B_{Q1}} = \beta_3 I_{B_{Q3}} - I_{B_{Q3}} \$
Substitute \$ I_{B_{Q1}} \$ with \$ I_{B_{Q3}} \$ to give \$ \beta_1 I_{B_{Q3}} = \beta_3 I_{B_{Q3}} - I_{B_{Q3}} \$
Divide by \$ I_{B_{Q3}} \$ to give \$ \beta_1 = \beta_3 - 1 \$
Now we can see if the two \$ \beta \$ values were equal, the equation would not work. I've been bashing my head on this for hours. Where did I go wrong?
AI: I'm not sure how accurate you want to go, but there are a few things in this circuit that I believe will not make the current in both branches equal.
While \$V_{BE1} = V_{BE2}\$ means that \$I_{B1} = I_{B2}\$, in general \$V_{CE1} \neq V_{CE2}\$. This will generate a small difference in \$I_C\$ due to the Early effect.
Ignoring that difference, we can still find
$$I_p = I_{C1} + I_{B3} = \beta_1I_{B1} + I_{B3} \\
I_L = I_{C3} = \beta_3I_{B3}$$
We can also find an error in your 4th point, the KCL needs to be:
$$\begin{align}
I_{E3} &= I_{C2} + I_{B1} + I_{B2} \\
&\Downarrow \\
I_{C3} + I_{B3} &= I_{C2} + 2I_{B1,2} \\
&\Downarrow \\
I_{B3} &= \frac{\beta_2 + 2}{\beta_3 + 1}I_{B1,2}
\end{align}$$
This means that point 2 and 3 are incorrect as well.
So finally
$$I_p = \left(\beta_1 + \frac{\beta_2 + 2}{\beta_3 + 1}\right)I_{B1,2} \\
I_L = \beta_3\frac{\beta_2 + 2}{\beta_3 + 1}I_{B1,2}$$
These two current are equal only if
$$\beta_1(\beta_3+1) + (\beta_2 + 2) = \beta_3(\beta_2 + 2)$$
Assuming \$\beta_{1,2} = \beta_1 = \beta_2\$ we can solve that
$$\beta_3 = \beta_{1,2} + 1$$
which turns out to be the same equation anyway. Now you can continue by observing that \$\beta \gg 1\$, such that \$\beta_3 \approx \beta_{1,2}\$. |
H: SPI fundamental question
I am a little confused regarding the order of bytes that are transferred through SPI to a slave device.
The next time diagram depicts the sequence of bytes to be sent when we want to write data to a a flash memory chip
After I send the command byte (first 8 byte to the slave device (Flash Memory) I must send the address bytes and then the data I want to write.
So my question is this: Which byte do I send first, after the command byte? The High Byte or the Low byte of the address? Although it doesn't make sense to me why the High Byte should be sent first it is obvious in the diagram that the High Byte must be sent first and then the Low Byte. So, I wanted to ask in case I am thinking it the wrong way.
Thank you for your time
AI: Even if a clear specification doesn't make sense to you, you should adhere it.
If it doesn't work the way it is specified, you can start to question it.
Byte order is often different between the microcontroller and external peripherals, so be prepared to face this in the future at other points as well.
And this is nothing inherent to SPI, it's the protocol defined by the manufacturer of the chip. SPI will not determine the byte order. |
H: How is this piezoelectric effect converted to voltage?
The data-sheet of this accelerometer says:
This piezoelectric accelerometer may be treated as a charge source.
Its sensitivity is expressed in terms of charge per unit acceleration
(pC/ms–2, pC/g).
Is it possible to convert this pC/g to V/g? How is it converted to voltage so that it is amplified?
AI: The typical way this is done is by measuring the flow of charge (current) from the device into an inverting amplifier circuit: -
Analog Devices app note CN0350 is where this circuit came from and here is a brief extract from that page: -
Piezoelectric elements are commonly used for the measurement of
acceleration and vibration. Here, the piezoelectric crystal is used in
conjunction with a seismic mass m. If the mass is subjected to an
acceleration a, then there is a resulting inertial force F = m × a
acting on the seismic mass and the piezoelectric crystal. This results
in the crystal acquiring a charge q = d × F, where d (measured in
coulombs/newton, C/N) is the crystal charge sensitivity to force.
The resulting steady-state charge sensitivity Sa of piezoelectric
accelerometer is Sa = Δq/Δa (measured in C × s2/m).
Note that acceleration can be converted to g using the relationship 1
g = 9.81 m/s2. |
H: Would I need a zero-crossing SSR for a reflow oven controller?
I'd like to follow this guide to create a reflow oven controller: https://apollo.open-resource.org/mission:resources:picoreflow
But I am confused on the zero-crossing SSR.
Does it need to be zero-crossing to control the heating element?
I already have a very old SSR for which there isn't even a data sheet, so I am unable to tell whether it has zero-crossing.
AI: The oven itself won't care where in the power cycle the heater is switched on and off. The time constant of the heater should be many times the period of a power line cycle, so timing details at the level of power line cycles don't matter.
However, the rest of the world might care. Switching at the zero crossings reduces the voltage and current transients. That in turn reduces conducted and emitted interference.
If I were doing this, I'd try to switch at the zero crossings. If this is a commercial product, you may need to switch at the zero crossings to pass EMI (electromagnetic interference) requirements. |
H: ADC input range vs sensor output range
I am currently working on a project, where I need to calculate the current in a circuit. The setup is as follows:
Allegro ACS758 Hall effect current sensor (ACS758LCB-050B-PFF-T), primary sampled current -50 to 50 A, sensitivity 40 mV/A
Analog Devices LTC1968 true RMS-to-DC convertor
Analog Devices LTC2420 20-bit ADC convertor
The current sensor outputs 0V for -50A, 1/2Vcc for 0A and Vcc for +50A. The measured current is the phase current of a BLDC motor and that is why a RMS-to-DC convertor was used before outputing the data to the ADC.
I now need to calculate the current value from the ADC output and I am unsure whether I am doing it correctly. So if you could please review my thinking and tell me if I am right or not, I will be very grateful.
The output of the current sensor is 0 - 5V, the output of the RMS-to-DC convertor is also 0 - 5V. But the datasheet of the ADC states:
I am using Vref = 5 V, so in my case the input voltage range is limited to -0.3V to 5.3V, thus the range is 5.6V and the calculation for voltage per point (vpp) is:
$$vpp = \frac{5.6}{2^{20}-1}$$
Taking it the other way around, I have calculated points per volt (ppv) as:
$$ppv = \frac{2^{20}-1}{5.6}$$
Therefore -0.3V would be then represented by 0 points and 5.3 V would be represented by ppv*5.3 = 992401.34 points. Assuming linearity over the whole range, I could now calculate all the points in between and the current from that.
Am I correct?
Thank you for your time.
EDIT:
old schematic:
EDIT2 (new schematic)
If I understood everything correctly, then this should now be a working example. The Hall sensor will output 0.5 - 4.5V, I will run this through a circuit, that would limit this to 1.5 - 3.5 V and this would be the input to IN1 of the RMS convertor. IN2 would be at a potential of 2.5V and thus the condition of max. peak input swing of the RMS convertor is satisfied. But I am not sure of the output of the LTC1968. Is it possible to do as I did in this schematic? Connecting the output return pin to a voltage of 1.5V, so that the output pin will output a voltage of 0.5V with respect to ground (-1V with respect to the return pin) for -50A through the circuit and 2.5V for +50A through the circuit. And a 2.5V reference voltage for the ADC. I hope I understood it right now. Thanks.
AI: Firstly the workings of the current sensor; -50 amps corresponds with a voltage output level from the ACS758LCB-050B of 0.5 volts, 0 amps is 2.5 volts and +50 amps is 4.5 volts. This ties in with the 40 mV/A sensitivity stated. It's output cannot fall to 0 volts nor rise to 5 volts.
Next the RMS to DC converter. This picture from the data sheet shows how it interfaces to signals: -
Text below slightly edited to fix error
The supply would be 5 volts and 0 volts and half the supply voltage (2.5 volts) is applied to the IN2 input. This makes it relatively easy to interface with the ACS758LCB-050B because it naturally produces a quiescent DC level of 2.5 volts. But you have to limit the input voltage range to a peak voltage of 1 volt: -
VIMAX Maximum Peak Input Swing (Accuracy = 1%) 1 volt minimum
So you need to reduce the output swing of 0.5 volts to 4.5 volts from the ACS758LCB-050B to 1.5 volts to 3.5 volts for the LTC1968.
the output of the RMS-to-DC convertor is also 0 - 5V.
No it isn't: -
VOMAX Maximum Differential Output Swing 1 volt guaranteed
That swing can be manipulated to higher or lower absolute levels by the RTN pin but the swing is +1 volts. So, for best accuracy with your ADC choose a voltage reference that gives close to full scale with an output swing from the LTC1968 of +1 volt. |
H: Setting Over voltage and Under voltage limits for LTC4364
I am trying to set under voltage, over voltage and over voltage clamping limits in a circuit for Overvoltage Output Regulator with Reverse Current Protection using LTC4364 device. The LTC4364 uses an external resistor voltage divider to set the over, under voltage and overvoltage clamping(FB pin) limit set points.
In the datasheet they have some example circuits with OV, UV and Overvoltage clamping limits with Resistor voltage divider but i am not able to understand how they calculated resistor values for certain OV and UV limits.
with Vin=12V and to set UV to 6V they have used 383K(R1) and 100K(R2) as well
to set OV to 60V they have used 475K(R1) and 10K(R2). I am not able to get these values with basic voltage divider fromula.
My question is I want to set UV to 18v and OV to 32 V and overvoltage clamping to 35V at FB pin with Vin as 24V.Can anyone help me how to calculate resistors values for desired set limits.
The LTC4364 data sheet is here LTC4364
AI: The UV and OV inputs trigger at about 1.25 volts (read the data sheet) so, using R1, R2 and R3 values from your top digram, you get a potential divider ratio at the UV input of: -
(90.9 + 10)/(90.9 + 10 + 383) = 0.2085
So if the input voltage is 6 volts you get 1.25 volts at UV.
Note that your top diagram has "6 V" written beside the UV pin. It doesn't mean that 6 volts appears at that pin, it means that when Vin is 6 volts or below the UV lockout circuit triggers. |
H: How to open up serial terminal for my USB device converter (or, how to enable VCP in linux)?
I am using a new Cyclone V SoC board by Enclustra (Mercury+ SA2) mounted on their PE-1 BaseBoard.
To connect to the board serially on Windows platform, I have to connect the board which is detected as USB Serial Device Converter in the Device Manager. And, next, from the properties, I need to enable VCP. By doing this, now the attached board shows up as a COM port, which enables me to access it using a serial terminal such as putty. This works correctly.
I'm trying to do the same on my Linux system running Ubuntu 16.04. The device is detected as ttyUSB0. I have already tried the screen statement. The moserial GUI. Doesn't Work. How should I proceed from here? Below is a screenshot:
Thanks :)
AI: please check the permissions of the /dev node
$ls -la /dev/ttyUSB0
There is a high chance it shall resemble
crw-rw----. 1 root dialout 188, 0 Jul 18 13:27 /dev/ttyUSB0
A character device with RW permissions for ROOT and RW permissions for dialout group.
If this is the case check the group membership of the user attempting to access
$ groups
if the user is not part of the dialout group, add them
$ sudo usermod -a -G dialout $username
The user then needs to logout and log back into reload the group permissions |
H: What command is sent from AVRDUDE to an AVR programmer for programming ATmega8
I have implemented an IoT ATMEL AVR Programmer based on protocol stk500, and I successfully connect with it wirelessly and program any ATMEL AVR Programmer through Arduino IDE, My Question is: I need for example the set of commands that are sent from AVRDUDE to my programmer that programs ATMEL AVR ATmega8.
I'm trying to send command from an Android device to program that microcontroller wirelessly.
Thanks,,,,
AI: Documentation on avrdude internal specifics is lacking. Your best bet may be porting the source code (link). However, I would not attempt to port it to Android, it would be quite a lot of work. Instead, cross-compile it to the microcontroller on the programmer (if it's running some Linux OS this should be easy enough), and send from Android only the command-line options.
How to make avrdude recognize the device it is on as the actual programmer itself may be difficult, though achievable with some file piping or symbolic linking. If needs must, you could consider using a secondary micro just to run avrdude. |
H: Inductor for MOSFET protection
Help me understand the role and effect of an inductor used in the following electrical circuit.
The circuit in question is a power supply circuit for around 50 servers in a data center. The circuit uses a MOSFET transistor for commuting the power provided to the servers. In order to protect the transistor, the apparatus must be able to evaluate the connected charge in case it might be a short-circuit or too high of a capacity, as this will destroy the transistor.
For this purpose, an inductor is connected in series with the circuit, but I fail to understand how this addition fulfills the intended role.
AI: If a MOSFET drives a voltage into a short circuit or a circuit with an impedance that is too low it will exceed its ratings and become damaged. If a small value inductor is placed in series with the MOSFET, it will not cause a rapid short circuit but a ramping-up of current. This is due to the formula for an inductor: -
$$V = L\dfrac{di}{dt}$$
That ramp-up of current is proportional to voltage AND, if that current ramp is monitored (via a small series resistor), it can be quickly ascertained that either the incoming supply voltage or the load are beyond acceptable limits before the current reaches a damaging level to the MOSFET. |
H: N-mosfet detects the proximity of my hand. Can it be useful?
When the gate of an N-channel MOSFET is not connected, it allows current to pass from drain to source, and the amount of current depends on the distance between my hand (or a piece of metal touching my hand) and the MOSFET (or a wire connected to the gate). Are there any designs that take advantage of this?
AI: Yes. If you google "floating gate sensor" you will see there are many many applications for this effect.
Wikipedia article.
From sensing radiation, to measuring fatigue in steel plates, there are lots of ways to use this effect. EPROM, EEPROM, and flash all use this effect as well. |
H: what is the name of this yellow component in the motherboard?
I am not an electrician and I have no idea what is the name of this part on the image.
It makes a strange high frequency noise and I suspect thet the fault of this item causes my tv not to turn on. It has the following text written on its side:
MSC TY-T0129 122103
The tv is logik l22fed12. Is this component tv specific or can I buy a similar one? The main question is the name of the component but I would be happy if you could tell me whether I have any chance to make my tv up and running by replacing it or not.
AI: It's probablly a transformer providing the voltage conversion and isolation needed by the power supply.
Unfortunately transformers tend to be among the less standardised parts, so finding a drop-in replacement may be difficult.
I suspect it's not actually the problem though, transformers and inductors in switch mode power supplies normally make some noise and in a broken power supply can make a hell of a lot of noise even though some other component is at fault. |
H: Arduino logic level mosfet
I am currently trying to switch on a nichrome wire for about 5s using an Arduino and an external power source. It will be a single use only activation, I have decided to use an N-Channel mosfet for the job since space is limited.
The power source is a Li-ion battery and therefore I need to limit the power going to the nichrome wire to avoid burning it out. Based off some calculations I will need just about 100ma at nominal battery voltage to reach my desired temperature.
Since my arduino will only deliver 3.3v I need to use a logic level mosfet such as the FDN361BN which has a VGS of 1 V to 3 V. I have attached a draft schematic to illustrate my intentions, however how can I limit the amperage?
Can I just lower the voltage of the gate using a voltage divider in such a way that I only allows a certain amount of current based on the datasheets graphs?
Also what is the purpose of the 10k resistor, is it to assure that the mosfet won't get switched on accidentally?
AI: I will need just about 100ma at nominal battery voltage to reach my
desired temperature.
I'd consider using a low voltaget op-amp and a darlington transistor like this: -
With 1 volt in, the op-amp's negative feedback ensures that 1 volt appears across the 10 ohm sense resistor and this largely ensures that 100 mA flows through the nichrome wire in the collector.
You need to choose an op-amp that can work down to 2.8 volts without spitting and moaning and the Darlington is preferable over the MOSFET because of instabilities due to gate capacitance. |
H: Fixing an LED night light circuit
I bought an LED night light that's powered by three AAA batteries. At first it was super bright (too bright!) but then faded and finally went dead after just a week. It seemed to me that it didn't have an adequate current limiting resistor so I opened it up. It's simply 8 LEDs in series with a resistor, 3 AAA batteries and a switch.
The resistor is strange since it appears to be red-red-gold-gold banding and I don't know what to make of gold in the third position.
My question is, do you think it was the resistor that caused it to burn out so fast, and if so, what would be an appropriate replacement?
AI: Each White 5mm LED is rated about 65mW at 3.1V@20mA with an ESR of approx 15 Ohms intersecting with 2.8V.
Thus 8 parallel LEDs have an ESR of 15/8~=2 ohms. The fixed part appears have gold indicating a decimal point between Red-Red or 2.2 Ohms .
Thus current at 4.5V to 2.9V to a load defined as 2.8V +(15/8+2.2)If=Vbat
Thus If =( Vbat-2.8V ) / 4 Ohms
For Vbat =4.5 , If= 53mA / LED. !!
For Vbat =4.0 , If = 38mA / LED !
For Vbat = 3.5, If = 22mA / LED ok.
For Vbat = 3.1, If = 2.8 mA/ LED dim.
So power consumption for average at 4V is 1.2 Watts and 3 cell’s with est 3* 1.8Wh @ 0.5A might give 4 hours really too bright then a few days dim to dead.
Conclusion :
bad match of battery to load. Increasing R to two 2.2 R’s to share heat or 4.4 reduces power drain, reduces efficiency but reduces the initial current giving slightly more time. Maybe 2 weeks vs 1.
Chalk it up to a poor design. |
H: Simulating all transient solutions for RLC series circuits
I am reading this page that contains the transient solutions for RLC series circuits: over-damped, critically damped and under-dumped.
This site presents these graphics for the 3 cases:
Then I have decided to create a simulation using multisim, at https://www.multisim.com/content/LzLcDKNVvCzQeRUc6B9GTU/rlc/open/
My simulations are far from giving me these curves.
If I understood the theory correctly, these are my values:
Over damped = R^2 > 4L/C... I choose R = 10Ω, C = 1C, L = 2.25H
critically dumped = R^2 = 4L/C... I choose R = 3Ω, C = 1C, L = 2.25H
under damped = R^2 < 4L/C... I choose R = 1, C = 1C, L = 2.25H
These are the curves I get:
OVER
UNDER
CRITICALLY
My curves are completely off.
Solid curves are voltage across capacitor. Dashed curve = current. V1 is a pulse, 10 VDC amplitude, 1ms.
What am I missing?
AI: As far as I can tell your simulations match what I get from this online tool. I only did the under-damped case and the tool only provides Vout across the capacitor but it looks very similar to your graph: -
Looking at the transient voltage peak I get an overshoot of 1.329 after about 5 seconds and this pretty much ties with your graph except yours peaks at 13.3 volts due to the transient step being 10 volts.
What am I missing?
I don't know - they look good to me. |
H: Do you need a Pull down resistor when the line has an LED connected?
basically, since the LED is a diode that is tied to GND via a Resitor, does that mean it can double as Pull-down resitor for that line?
simulate this circuit – Schematic created using CircuitLab
AI: Generally a LED will not suffice, because when the voltage drops down to the forward voltage of the LED, the LED mostly stops conducting, therefore the voltage will not drop much further (or at least very slowly). Depending on your application this might not be sufficient. |
H: RF Attenuator Failure
I am attenuating an audio frequency (50 KHz) signal that is pulsed at 666 W for 300us with a period of 300ms. I estimated the power dissipated averaged over a period to be approximately:
\$\frac{300 \times 10^{-6}}{350 \times 10^{-3}}\times 666 = 0.5709 \approx 600\text{mW}\$
In the past, I have had no issue with going smaller than the peak power I expect to see on the power rating for the resistor as long as the average over the (reasonably small) period was less than power rating for the resistor. The resistors warms up, but they are ok long term.
Now I am working with some mini circuits attenuators (VAT-XX) that are rated for 1W with various attenuations (1dB - 20dB). Running this signal through these attenuators results in "POP POP POP" and some dead attenuators. Before the failure, measuring the DC resistance gave some reasonable value around \$300\Omega\$ for the chain of attenuators. The DC resistance is now in the 10s of mega-ohms. The failure happened about 5 or 6 periods after I turned on the source and the attenuators did not heat up. The popping continued after the first pop and has a period that audibly matches the signal period.
I am skeptical that the failure is due to exceeding the power rating and I think that it is possible that the attenuators were damaged by the voltage during the pulses, which is ~850V peak-to-peak (perhaps the coax dialectric was broken down).
I would appreciate any helpful suggestions on why the attenuators failed.
AI: You have exceeded the pulse power handling of the attenuators.
Some resistors, like bulk water, or wirewound, dissipate the heat in a very large volume of material, so can have very high pulse power ratings.
Some, like thin film, have a very small volume of resistive material deposited on a more-or-less thermal conductor. Unfortunately, the thin film requires heat to be conducted away fast enough to keep its temperature reasonable.
The difference between 666W and 600mW may be key to your problem. I often exceed average power, but by a factor of a few, or maybe 10. More than a ratio of 10, you really need to look into the pulse energy rating of your resistors. You are trying for a factor of 1000!
Now some attenuators, and I know this from when I blew them up as a junior engineer, have a profile that concentrates the heat in just one tiny part of the film, and they drop like flies with the merest pulse overload.
You need to multiply 666W with 300uS, and find an attenuator rated for that number of Joules, as well as the average power. |
H: What does it mean to have dual input range?
Hi guys I am looking for a wide range input voltages DC-DC Converter as my inputs would vary from 12,24,36,42Vdc. I found this, the Murata NCS12 series which have an input ranges of 9-36V and 18-75V. Now what does that mean? Could it be I can input from 9-75V? Because it only has 1 pin for the input voltage.
Also what does the 10% load efficiency mean? Because I might need only 300mA but a peak of 1A for my application.
I might use the NCS12S1205C.
So would this be great for my application of inputs 12,24,36,42V 300mA peak 1A ?
AI: […] the Murata NCS12 series [has] input ranges of 9-36V and 18-75V. Now what does that mean?
Remember that this is describing a series of parts, which includes many different parts with different characteristics.
The parts with a nominal 12V input (order codes NCS12x12xxx) have an input range of 9-36V.
The parts with a nominal 48V input (order codes NCS12x48xxx) have an input range of 18-75V.
There is no single part that can accept voltages from both ranges.
Also what does the 10% load efficiency mean?
I think you're confused. There is no such value in the datasheet.
The datasheet gives a range of efficiencies (e.g, 78-83.5% for the NCS12S1203C), and gives specific details on input currents under 10% and 100% load at specific input voltages, but there is no "10% load efficiency" specified. It's possible to calculate an efficiency at 10% load from the current values in the second table, though.
So would this be great for my application of inputs 12,24,36,42V 300mA peak 1A ?
No. There is no part in this series which supports that range of input voltages. |
H: Is there a way to store matrices in an FPGA?
I just finished a Coursera course on hardware design (nand2tetris) and I want to take the next step and implement the design in an FPGA. Being fairly new to the hardware aspect of computing in general, I needed to clear a few questions regarding memory. In particular, I want to implement a memory design that is organized into square arrays of 16 bit wide registers. The data would be accessed by specifying an array and then either a row or column (with the goal of expediting matrix multiplication). However, I am unsure if such a design will fit into an FPGA (I believe I can afford at most a Cyclone V or something equivalent). Since GPUs can be implemented on FPGAs, there must be a more efficient way of doing this that does not require using the D flip flops in each logic element to store a bit from an individual register. If there is not, how do people handle arrays of data in parallel on FPGAs?
Any information would be really helpful and since this is all a purely pedagogical exercise, pointers to learning materials on the subject are appreciated.
AI: Your 'most limited resource' is likely going to be the number of multipliers on the FPGA.
Your matrix multiplication logic will then consists of a stream of numbers read from a source, fed into a bundle of multipliers and the result stored again.
Two-dimensional access is easiest implemented using register albeit it also uses a lot of logic to select the outputs. I have implemented a two-dimensional memory using standard (one dimensional) memory chips but that was patented. I think you will just need to spend some cycle 'rotating' the matrix. Or be clever how you write the result. You might even consider storing each matrix twice.
I am more concerned about precision.
I have no idea what your numbers are, but I do recollect colleges at Delft University about the problems with maintaining precision when repeatedly using floating point numbers. In your case it will be worse because the multiplier in an FPGA has only a limited number of integer bits. Unless you want to implement massive parallel floating point multiplication. |
H: Guitar signal with opamp boost
Hi just having some issues understanding what's happening with my opamp circuit.
Vin is a Sine wave at 1kHz and VG is 4.5V.
From what I understand this circuit should boost the signal I provide it with my guitar. Simulated the circuit on LTSpice which provided the expected output at Out. But when I built the circuit, and supplied it with an input signal from my guitar and output into a guitar amp, it was significantly more quiet than what the guitar would sound going straight into the amp. What would be the reason for the signal being so quiet and what would I further need to read up on to understand what is going on with the opamp circuit.
EDIT: For the built circuit I used an NJM4560D opamp.
AI: Guitar pickups have a high output impedance. The should be connected to a load with a high input impedance - typically 100 kΩ to 1 MΩ. Your pre-amplifier has a 1 kΩ input impedance so there is a large voltage drop across the internal coil impedance.
Try increasing R1 and R2 by a factor of 100 and see what happens. Let us know. |
H: About PIC programming
Hi friends iam new to PIC programming , I'm coding my pic in mikroC pro , please help me out.. iam attaching my file with this!the code i want is message from transceiver should receiver and check whether the message is ON or OFF then pic should function on my output accordingly!
AI: The compiler doesn't know what the variables TRISABITS etc are, which means you didn't tell the compiler about them. This is usually done by including the appropriate file given by Microchip. For example, in my header files I have:
#include <p18f47j13.h> // For a PIC18F47J13
It might be easier to use MPLAB X from Microchip and use their project wizard to start your project. MPLAB X will make sure that the mentioned include file is there. |
H: Press and hold the reset button to reset AVR!
I connected a tactile switch to the AVR reset button according to the circuit below. every time I press the button the AVR resets itself but my question is: Is there a way to make this button acts after let's say 3 seconds? I mean press the button and hold it for 3 seconds and then the AVR resets itself. (some kind of resistor-capacitor circuitry)
AI: The circuit here will activate the AVR reset about 3 seconds after the switch is pressed. The AVR will stay in reset as long as the held pressed over the 3 seconds and will then come out of reset about 0.75 seconds after the switch is released.
(Edit: Replaced schematic with one showing LM393 comparator).
In this schematic the V1 voltage source is there to provide a voltage controlled action of the S1 switch. Obviously in your case the S1 is simply a switch that you press with your finger.
The 3 second delay can be tweaked to get it as close to 3 seconds as you want by adjusting the R4 value.
The comparator shown for U1 is a device with a push-pull output so it would not need the R2 pullup resistor. If you choose some other 5V compatible comparator it may have an open drain output so would require the R2 resistor. |
H: ESD protection on analog signals
I have a board which has its microcontroller pins directly breaking out to a breakout header.
I am fairly certain the board won't be in ESD safe environment when being tested.
I decided to get fairly standard ESD diodes and placed it across all Digital pins. They have capacitance in the pF's so shouldn't cause any distortion there.
My question is if it is okay to place ESD diodes on analog inputs to the micro. Is there any way i reduce acuracy of these inputs?
I have been told in the past to avoid using ESD diodes on very high speed signals (in my case it was MIPI-DSI), as the very low capacitance can become significant. I am just wondering if there are other cases (analog inputs being one) where this concern should be taken?
Thanks!
AI: First I'd like to stress that all microcontroller chips already have on-chip ESD protection, without that they would become almost impossible to handle.
But it is indeed a good idea to add extra protection to pins which can be touched from the outside and/or interface with other boards etc.
You can just treat the Analog pins the same way as the Digital pins and add the same protection. Under normal operation the extra ESD devices will not conduct and therefore cannot harm the signal. You will not reduce accuracy at all. Again let me point out that the pins will already have ESD protection inside the chip. Typically that is a circuit like this:
The 2 diodes on the left are additional external diodes, not how they are in parallel with 2 of the on-chip diodes.
Only for very high frequency signals either analog or digital (like MIPI) ESD protection can influence the operation. But very often cables and PCB traces add more capacitance that the small ESD protection devices. |
H: Canceling ambient sound
I've just moved into a new flat and I noticed that there is a lot of car noise coming through windows. I know, I could just close the windows, but that's a less interesting approach to a problem. So last night, while trying to fall asleep, I started to wonder: Is there a device that could isolate me from noise coming from the outside?
I'm thinking of something that could listen to the sound coming in, invert it and then output the inverted sound through a speaker array, so they both cancel each other out.
Is there something like this on the market, or is it even possible?
AI: It is called "Active Noise Control" (ANC) and apparently is not that uncommon. It is much harder to do in 3-D, but even that has been done to reduce noise in aircraft cabins and automobiles.
If your noise source is localized (i.e. window) then ANC will be more efficient and might be even simple enough for DIY project.
Commercial solutions also available, but I suspect quite costly.
As a side note, while it was interesting reading and I don't regret spending time on this, you really should have done it yourself before asking question. It only took me 5 minutes to find the links above. |
H: What is this silver component?
Anyone know what this silver component is? Tried to google it, but no luck.
Thanks
AI: That component is a surface mounted polyfuse. A resettable fuse that trips at elevated temperature and resets as it cools down.
These components are made in many package styles in addition to the one you show.
Picture Source: Littelfuse.com. |
H: Voltage Dividers for a beginner (with respect to soil moisture sensors)
I've just started with electronics and want to make an analogue soil moisture sensor (with Arduino).
When I looked online for an explanation of the working, every site said that it works as a voltage divider.
These are my questions:
What exactly is a voltage divider? How does it work (for a beginner) ?
The tutorial said that a wire has to be connected from the Vcc to an analogue pin on the Arduino for the readings.
But how can a wire from the Vcc send analogue signals about the soil's resistance? Doesn't it just supply power?
The tutorial mentioned a capacitor between the Ground and the signal wire for filtering noise.
What is this noise? How can the capacitor filter it? Why does it need to be filtered?
I've attached an image of a part of the tutorial for reference.
Thanks a lot and apologies for my silly questions (couldn't find a satisfying explanation elsewhere) .
AI: The voltage division is between the 57K resistor and the soil resistance (which is not shown and can be modeled as a resistor to ground - the actual dirt ground which must be connected to circuit ground). The output voltage will be Vcc * Rx/(57K + Rx). The DC resistance the analog input sees can be as high as 57K, which is above the recommended level for the Atmel/Microchip MCU used in the Arduino by more than 5:1.
Noise comes from the environment primarily in this case since there are radio transmitters and mains electric fields present. In another context, that noise might be your signal. Noise applies to unwanted signals of any kind. Capacitors present a low impedance to AC signals and can help reduce that noise to a negligible value, but present a high impedance to low frequencies so the voltage at the divider output (and Arduino input) will approach the ideal value albeit relatively slowly (within a second or so it will be stable).
The electrolyis mentioned in your snippet is the electrochemical corrosion of the electrodes due to the potential present. Eliminating the DC voltage (for example, by flipping polarity or using an AC signal to measure) will minimize the problem. |
H: What does NP and NO means in datasheets?
I will be using a DC-DC Converter from Cincon: EC4BW11
I do not understand what NP and NO means on the pinouts. I am assuming that the input voltage will be connected on pins 1 and 2 (+Input, -Input) and the output voltage on pins 3 and 5 (+Output, -Output) since this is and ISOLATED DC-DC Converter which would mean they don't have a common ground?
Would the pin 4 (Common/NP) mean that this is the common for dual output, am I right?
AI: It appears that this isn't a dual function pin...it's either common (and although it's not stated, it seems clear it's the common (ground) for dual output devices) or it's not there. NP stands for No Pin...there's no "NO" abbreviation, it's just saying in the comment that NP stands for NO PIN. |
H: Does wireless charging degrade battery life?
Does a design using wireless charging such as QI effect the longevity/health of lithium-ion batteries such as those found in modern consumer electronics devices?
What special considerations must be taken when incorporating wireless charging into a device to keep the batteries at optimal health?
AI: The presence or not of (QI) wireless charging by itself bears no relation to how long the battery will last.
The presence of wireless charging does allow you to often charge the battery (for a short time). That then could allow you to keep the battery level between 30% and 70 % for example and that does prolong battery life as less time is spend below 30% and above 70% is most stressful for a battery.
So if you never use Wireless charging or just charge in the same way as you would when charging using a cable, then wireless charging should not affect battery life. |
H: Decreasing and reading output of a sensor (0 - 10 V) using a voltage divider - Output impedance
I have a pressure sensor giving an output between 0 - 10 V.
I want to read and save the value using an arduino, so I am using a voltage divider (https://learn.sparkfun.com/tutorials/voltage-dividers) to scale it down to 0 - 5 V. Since I want to halve the voltage, I am using the same resistance twice.
I have noticed that the voltage changes according to the value of the chosen resistance pair. I assume this is due to the output impedance of the sensor.
On the sensor there is a label reading "OUT 0...10 V RL>10K". I assume this is the impedance of the output.
Does this mean that one should use a pair of at least 10K Ohm resistance for the voltage divider?
Info on the sensor = https://www.hubacontrol.com/fileadmin/user_upload/domain1/Produkte/Product_catalogue.pdf - Page 109 (Sensor type 692)
AI: Looking at the datasheet, it does look like it needs a load resistance of more than 10kOhm.
The total load resistance of your potential divider will depend on two things: the value of your resistors, and the input resistance of whatever you're connecting to the divider output.
Since you're connecting the divider output directly to the arduino ADC, and the ADC input resistance is very high, the only thing you really have to worry about is the resistor value.
The total resistance of your divider will therefore just be R1+R2, so you need to make sure that this adds up to >10kOhm. I would make the total resistance >20kOhm just in case. |
H: EAGLE schematic - capacitors and resistors all incorrectly connect to each other in BOARD
I'm relatively new to EAGLE and after watching tutorials I am trying to design a small board with (eventually) 16 low pass filters.
This is the schematic view, I am trying to make a low pass filter - ground, through capacitor, into the resistor. When I turn this into board view, it looks like the next picture which I believe is incorrect.
This is what the Board view looks like which seems wrong to me as all the capacitors are connected, as are all the resistors. But not to each other.
Any thoughts on what I am doing wrong?
AI: If you do wire both terminals of the capacitors together, they will be shorted out.
Notice how the green line connects both ends of the capacitors?
If I were you, I would delete all of the signals in your schematic, rotate the caps vertically, placed above the ground terminals. Then place the resistors vertically above the capacitors.
Join them together with the wire tool making sure to end your wire on the pins themselves - don't draw a wire under the capacitor, the connection point is at the ends of the pins.
You can also draw one resistor/capacitor/GND, connect it up, and then group and copy/paste rather than drawing each one individually.
Also make sure to name your nets using the name tool on a wire. That way if you find any net called N$# you know you have a section of schematic where you haven't specifically named a wire. It also means you can more easily tell what each airwire is in the layout by checking its name. |
H: Why do electrons move as if on conveyor belt in a circuit?
For example sometimes people will ask whether it matters what side of a component you place a resistor on. Surprisingly, it doesn't matter because electrons behave as if they're all connected together on a conveyor belt -- if they encounter resistance in one spot they slow down everywhere else. It's not as though it's very fast on one side and then slower on the other.
Why is this the case? How do the electrons "know" to slow down even well before they actually encounter a resistor that may be on the other side of a component?
AI: How do the electrons "know" to slow down even well before they actually encounter a resistor that may be on the other side of a component?
They actually don't. Know, that is.
There are tree parts of this answer. First, they might never encounter a resistor on the other side of a component. Considering that speed of electron in a copper is somewhere in micron/s range chances are your particular electron will never even reach that resistor before you turn your circuit off.
Second, what you describing as "conveyor belt" is actually a flow of energy, not the movement of electrons. And energy transfer is happening close to the speed of light, which is fast but not instantaneous. Consequently, any changes or disruptions in a circuit do not happen immediately, it just looks like that because of high speed of wave propagation.
And finally, if you put one and two together, the resistor placed in a circuit does not "slow down electrons on a conveyor". What it does is make energy transfer harder, so the total energy flow in the circuit is reduced.
The analogy with water in pipes while being useful is technically incorrect, because the speed of water flow depends on pipe diameter according to Bernoulli's principle. Furthermore, the amount of electrons in a conductor is enormous. If you really want to compare electricity to water you should use at least a river.
Now, the river does not have to flow fast to pass wast amounts of energy. Imagine the force of water pushing down on water wheel lowered into the river. The bigger the wheel, the more power is generated. With big enough wheel even slow river can produce huge force.
So, what happens if you somehow manage to block a river upstream? The speed of flow will be pretty much the same, but the level would drop, and so would the pressure on our hypothetical huge water wheel. That is how resistor in a circuit works. Also important to note, that there will be some delay between blocking upstream and reducing the power downstream, just like it happens with electricity, only on different time scale. |
H: Problem FIFO in the implementation (VHDL)
I was working in that for the past five days and I don't know what happened. I must implement a FIFO to send some information, I attach the FIFO that I use. As you can see in the code, this FIFO using three process update data, pointer process and send or receive data. The idea is send the information with a frequency a little lower than the clock of the FPGA, that's why the process uses the sensibility of wr_en and rd_en (the enable signals) to make two of the process. First of all I simulated all the different signals that the FIFO needs to send or receive the information and the simulation works fine without problem, all the signals that I expected were there (also I attach the FIFO testbench).
The problem is when I tried to write in the FIFO, if I made that with switches, there is no problem, the FIFO works fine. However, when I tried to send the information with another FPGA with a more higher frequency, the FIFO recognize some false data and for this reason the FIFO is full even when the wr_en signal was high just one (but with a lower frequency of the main FPGA). I searched a lot in the simulation and in the code and I don’t see a problem, I don’t know why the FIFO doesn’t work as I expect.
Any advice of what could happened I really appreciate. Thank you
Code FIFO in VHDL
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
------------------------------------------------------
----------------------------------------------------------------------------
entity fifo is
Generic(
ADDR_W : integer := 7; -- address width in bits
DATA_W : integer := 24; -- data width in bits
BUFF_L : integer := 80; -- buffer length must be less than address space as in BUFF_L <or= 2^(ADDR_W)
ALMST_F : integer := 3; -- fifo flag for almost full regs away from empty fifo
ALMST_E : integer := 3 -- fifo regs away from empty fifo
);
Port (
clk : in std_logic;
n_reset : in std_logic;
rd_en : in std_logic; -- read enable
wr_en : in std_logic; -- write enable
data_in : in std_logic_vector(DATA_W- 1 downto 0);
data_out : out std_logic_vector(DATA_W- 1 downto 0);
data_count : out std_logic_vector(ADDR_W downto 0);
inputValid : out std_logic;
full : out std_logic;
rd_ptr_out : out std_logic_vector(ADDR_W-1 downto 0); -- current pointers
wr_ptr_out : out std_logic_vector(ADDR_W-1 downto 0); -- current pointers
err : out std_logic
);
end fifo;
----------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
architecture arch of fifo is
type reg_file_type is array (0 to ((2**ADDR_W) - 1)) of std_logic_vector(DATA_W - 1 downto 0);
-----------memory, pointers, and flip flops---------
signal mem_array : reg_file_type ;
signal rd_ptr, wr_ptr : std_logic_vector(ADDR_W-1 downto 0); -- current pointers
signal rd_ptr_nxt : std_logic_vector(ADDR_W-1 downto 0); -- next pointer
signal wr_ptr_nxt : std_logic_vector(ADDR_W-1 downto 0); -- next pointer
signal full_ff, empty_ff : std_logic; -- full and empty flag flip flops
signal full_ff_nxt : std_logic; -- full and empty flag flip flops for next state
signal empty_ff_nxt : std_logic;
signal q_reg, q_next : std_logic_vector(ADDR_W downto 0); -- data counter
signal q_add, q_sub : std_logic;
signal wr_en_prev,rd_en_prev : std_logic;
---------------------------------------------------
begin
---------- Process to update read, write, full, and empty on clock edges
reg_update :
process(clk)
begin
if falling_edge(clk) then
if (n_reset = '0') then
rd_ptr <= (others => '0');
wr_ptr <= (others => '0');
full_ff <= '0';
empty_ff <= '1';
q_reg <= (others => '0');
else
rd_ptr <= rd_ptr_nxt;
wr_ptr <= wr_ptr_nxt;
full_ff <= full_ff_nxt;
empty_ff <= empty_ff_nxt;
q_reg <= q_next;
wr_en_prev <= wr_en;
rd_en_prev <= rd_en;
end if; -- end of n_reset if
end if; -- end of falling_edge(clk) if
end process;
----------- Process to control read and write pointers and empty/full flip flops
Ptr_Cont_Original :
process(wr_en, rd_en, q_reg)
begin
wr_ptr_nxt <= wr_ptr; -- no change to pointers
rd_ptr_nxt <= rd_ptr;
full_ff_nxt <= full_ff;
empty_ff_nxt <= empty_ff;
q_add <= '0';
q_sub <= '0';
---------- check if fifo is full during a write attempt, after a write increment counter
----------------------------------------------------
if((wr_en /= wr_en_prev) or (rd_en /= rd_en_prev)) then
if(wr_en = '1' and rd_en = '0') then
if(full_ff = '0') then
q_add <= '1';
if(conv_integer(wr_ptr) < BUFF_L-1 ) then
wr_ptr_nxt <= wr_ptr + '1';
empty_ff_nxt <= '0';
else
wr_ptr_nxt <= (others => '0');
empty_ff_nxt <= '0';
end if;
-- check if fifo is full
if (conv_integer(wr_ptr + '1') = conv_integer(rd_ptr) or (conv_integer(wr_ptr) = (BUFF_L-1) and conv_integer(rd_ptr) = 0)) then
full_ff_nxt <= '1';
end if ;
end if;
end if;
---------- check to see if fifo is empty during a read attempt, after a read decrement counter
---------------------------------------------------------------
if(wr_en = '0' and rd_en = '1') then
if(empty_ff = '0') then
if(conv_integer(q_reg) > 0) then
q_sub <= '1';
else
q_sub <= '0';
end if;
if(conv_integer(rd_ptr) < BUFF_L-1 ) then
rd_ptr_nxt <= rd_ptr + '1';
full_ff_nxt <= '0';
else
rd_ptr_nxt <= (others => '0');
full_ff_nxt <= '0';
end if;
-- check if fifo is empty
if (conv_integer(rd_ptr + '1') = conv_integer(wr_ptr) or (conv_integer(rd_ptr) = (BUFF_L-1) and conv_integer(wr_ptr) = 0 )) then
empty_ff_nxt <= '1';
end if ;
end if;
end if;
-----------------------------------------------------------------
if(wr_en = '1' and rd_en = '1') then
if(conv_integer(wr_ptr) < BUFF_L-1 ) then
wr_ptr_nxt <= wr_ptr + '1';
else
wr_ptr_nxt <= (others => '0');
end if;
if(conv_integer(rd_ptr) < BUFF_L-1 ) then
rd_ptr_nxt <= rd_ptr + '1';
else
rd_ptr_nxt <= (others => '0');
end if;
end if;
end if;
end process;
-------- Process to control memory array writing and reading
mem_cont :
process(wr_en,rd_en,n_reset)
begin
if( n_reset = '0') then
mem_array <= (others => (others => '0')); -- reset memory array
data_out <= (others => '0'); -- reset data out
err <= '0';
else
-- if write enable and not full then latch in data and increment wright pointer
if( wr_en = '1') and (full_ff = '0') then
mem_array (conv_integer(wr_ptr)) <= data_in ;
err <= '0';
elsif(wr_en = '1') and (full_ff = '1') then -- check if full and trying to write
err <= '1';
end if ;
-- if read enable and fifo not empty then latch data out and increment read pointer
if( rd_en = '1') and (empty_ff = '0') then
data_out <= mem_array(conv_integer(rd_ptr));
err <= '0';
elsif(rd_en = '1') and (empty_ff = '1') then -- check if empty and trying to read
err <= '1';
end if ;
end if; -- end of n_reset if
end process;
------ counter to keep track of almost full and almost empty
q_next <= q_reg + 1 when q_add = '1' else
q_reg - 1 when q_sub = '1' else
q_reg;
-------- connect ff to output ports
full <= full_ff;
inputValid <= not empty_ff;
data_count <= q_reg;
wr_ptr_out <= wr_ptr;
rd_ptr_out <= rd_ptr;
end arch;
---------------------------------------------------------------------------------------
Testbench
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY fifo_tb IS
END fifo_tb;
ARCHITECTURE behavior OF fifo_tb IS
COMPONENT fifo
Generic(
ADDR_W : integer := 4; -- address width in bits
DATA_W : integer := 24; -- data width in bits
BUFF_L : integer := 16; -- buffer length must be less than address space as in BUFF_L <= 2^(ADDR_W)
ALMST_F : integer := 3; -- fifo regs away from full fifo
ALMST_E : integer := 3 -- fifo regs away from empty fifo
);
Port (
clk : in std_logic;
n_reset : in std_logic;
rd_en : in std_logic; -- read enable
wr_en : in std_logic; -- write enable
data_in : in std_logic_vector(DATA_W- 1 downto 0);
data_out : out std_logic_vector(DATA_W- 1 downto 0);
data_count : out std_logic_vector(ADDR_W downto 0);
inputValid : out std_logic;
full : out std_logic;
err : out std_logic
);
END COMPONENT;
SIGNAL clk : std_logic;
SIGNAL n_reset : std_logic;
SIGNAL rd_en : std_logic;
SIGNAL wr_en : std_logic;
SIGNAL data_in : std_logic_vector(23 downto 0);
SIGNAL data_out : std_logic_vector(23 downto 0);
SIGNAL data_count : std_logic_vector(4 downto 0);
SIGNAL inputValid : std_logic;
SIGNAL err : std_logic;
SIGNAL full : std_logic;
constant PERIOD : time := 20 ns;
BEGIN
-- Please check and add your generic clause manually
uut: fifo PORT MAP(
clk => clk,
n_reset => n_reset,
rd_en => rd_en,
wr_en => wr_en,
data_in => data_in,
data_out => data_out,
data_count => data_count,
inputValid => inputValid,
err => err,
full => full
);
-- PROCESS TO CONTROL THE CLOCK
clock : PROCESS
BEGIN
clk <= '1';
WAIT FOR PERIOD/2;
clk <= '0';
WAIT FOR PERIOD/2;
END PROCESS;
-- *** Test Bench - User Defined Section ***
tb : PROCESS
BEGIN
n_reset <= '0';
rd_en <= '0';
WAIT FOR 40 NS;
n_reset <= '1';
wr_en <= '0';
WAIT FOR 20 NS;
wr_en <= '1';
data_in <= std_logic_vector(to_unsigned(10,24));
wait for 10*PERIOD;
wr_en <= '0';
wait for PERiOD;
wr_en <='1';
data_in <= std_logic_vector(to_unsigned(5,24));
WAIT FOR 40 NS;
n_reset <= '1';
wr_en <= '0';
WAIT FOR 20 NS;
-- write to fifo
for test_vec in 0 to 17 loop
WAIT FOR 20 NS;
wr_en <= '1';
data_in <= std_logic_vector(to_unsigned(test_vec,24));
WAIT FOR 20 NS;
wr_en <= '0';
end loop;
wait for 10 ns;
WAIT FOR 10 NS;
rd_en <= '1';
WAIT FOR 10 NS;
rd_en <= '0';
wait for 3*PERIOD;
-- read from fifo
for test_vec in 0 to 8 loop
WAIT FOR 10 NS;
rd_en <= '1';
WAIT FOR 10 NS;
rd_en <= '0';
end loop;
-- write to fifo
for test_vec in 0 to 15 loop
WAIT FOR 10 NS;
wr_en <= '1';
data_in <= std_logic_vector(to_unsigned(test_vec,24));
WAIT FOR 10 NS;
wr_en <= '0';
end loop;
-- read from fifo
for test_vec in 0 to 11 loop
WAIT FOR 10 NS;
rd_en <= '1';
WAIT FOR 10 NS;
rd_en <= '0';
end loop;
WAIT FOR 80 NS;
-- read and write to fifo
for test_vec in 0 to 11 loop
WAIT FOR 10 NS;
wr_en <= '1';
rd_en <= '1';
data_in <= std_logic_vector(to_unsigned(test_vec,24));
WAIT FOR 10 NS;
wr_en <= '0';
rd_en <= '0';
end loop;
-- read from fifo
for test_vec in 0 to 7 loop
WAIT FOR 10 NS;
rd_en <= '1';
WAIT FOR 10 NS;
rd_en <= '0';
end loop;
-- write to fifo
for test_vec in 0 to 13 loop
WAIT FOR 10 NS;
wr_en <= '1';
data_in <= std_logic_vector(to_unsigned(test_vec,24));
WAIT FOR 10 NS;
wr_en <= '0';
end loop;
wait; -- will wait forever
END PROCESS;
-- *** End Test Bench - User Defined Section ***
END;
AI: when I tried to send the information with another FPGA with a more higher frequency..
As per your own statement, your external signals are unrelated to your FPGA clock. You are thus trying to process asynchronous signals with in a synchronous design without taking any precautions. That will not work.
In your test-bench everything is 'perfectly' defined, as is the nature of pure theoretical signals. Your signals (wr_en, rd_en and all 24 data lines) change exactly after 20ns and exactly in-sync with the clock. Real life is, unfortunately, not so perfect.
The problem I have is in giving you a solution as it take some experience to solve this issue.
I would normally advise you to use an asynchronous FIFO, that is a FIFO which you write using one clock, and read using a different clock. But this here is a FIFO. Which means I would have to teach you how to design an asynchronous FIFO and that goes beyond the scope of Stack-exchange.
Start with looking up subjects like:
Synchronization.
Clock domain crossing.
Or look for an example of an asynchronous FIFO on the WWW.
A second way is to use a high FPGA sample frequency and have a source with a 'ready' signal when the input is valid. But then you still need to learn about synchronization and clock domain crossing logic to correctly handle the 'ready' signal.
Theoretical a solution is to make the source generate data using the same clock as your FPGA, (Note: the same clock, not the same clock frequency). But for most data streams that is not possible and you still need to be wary of clock skew. |
H: Why exactly a RLC Circuit powered by DC oscillates?
First sorry if the question is stupid... I am learning.
I am trying to visualize here, without equations, what happens to a RLC circuit that makes it oscillate.
Consider a RLC circuit, a switch and a 12V battery. Both L and C are initially discharged.
OK, I see that the role of the resistor is to damp the oscillations, so, lets consider R=0 and L and C are ideal.
At t=0 I close the switch.
The current starts flowing thru the resistor and reaches the inductor.
At this time, the inductor is an open circuit and the capacitor is a short circuit.
Current tries to reach the capacitor but the inductor is preventing it.
Magnetic field is building in the inductor. Current is increasing and its Voltage is dropping.
Current finally reaches the capacitor. It starts charging. Its voltage starts to rise. Capacitor is building electric field.
So at this point magnetic field is rising on the inductor and electric field is rising on the capacitor.
I understand that oscillations happen because energy is being transferred from the capacitor to the inductor and vice-versa. But if both the magnetic field and electric field are rising, how can this oscillation happen.
I was expecting to see one rising and one falling and vice versa, but both are rising when the circuit starts.
If all my explanations are wrong, please forget them and explain what is really happening in terms of current, voltages and fields to make the whole thing oscillate.
Thanks.
AI: lets consider R=0 and L and C are ideal.
Just think about a big flywheel driven through an elastic rope by a motor. The capacitor is the flywheel and the elastic rope is the inductor. The equivalent of DC being applied to your LC series circuit is the motor running at constant speed. The torque of the motor is current.
At first, the flywheel barely moves even though the elastic rope has been turned by the motor several times but, after a short while, you see the flywheel starting to rotate but, its rotation speed is much slower than the motor. As time goes by the rope gains more turns and transmits a bigger torque to the flywheel until hey presto. The flywheel is rotating at exactly the same speed as the motor.
But there is still stored energy in the elastic rope and this continues to exert more torque on the flywheel. Now the flywheel is rotating faster than the driving motor and also the elastic rope is starting to lose some of its turns.
After a while longer the elastic rope has run out of energy - no more turns and the flywheel is rotating at exactly twice the speed of the motor. The elastic rope now starts getting wound backwards - the flywheel is rotating faster than the motor and this starts winding turns in the opposite way. This creates a counter-torque that also starts to decellerate the flywheel and once again, there comes a situation where both motor speed and flywheel speed are identical but the energy in the elastic rope is slowing the flywheel down until after a while longer it can be seen to stop it completely. At this point the elastic rope has fully got rid of its energy/turns and the flywheel has no energy due to it being momentarily stationary.
Then, because the motor is still spinning, the process begins again. |
H: Measured amperage differs greatly from my math
I've got the following circuit:
simulate this circuit – Schematic created using CircuitLab
It works. The LED glows nice and bright.
However my math doesn't match the readings I'm getting from my digital multimeter. Using Ohm's Law, I take the voltage rating of the batteries and desired amperage of the LED to figure out how much resistance I need.
This is my math:
V = I*R = 4.8V (4x AA 1.2V/2400mA in series)
I = V/R = 0.02A (1x 3mm Green LED 3.0-3.2V/20mA)
R = V/I = 240Ω (1x 220Ω & 1x 20Ω in series)
These are my multimeter readings:
Voltage across the batteries: 5.17V
Voltage across the LED: 2.93V
Voltage across the resistors: 2.24V
Resistance across the resistors: 238Ω
Amperage on the circuit: 9.56mA
Now obviously I am getting more volts from the batteries than I anticipated but even adjusting for that I still don't get ~9.5mA of current in my math.
Adjusted math:
V = I*R = 5.2V
I = V/R = 0.022A
R = V/I = 238Ω
What am I missing?
AI: The resistance is calculated from the voltage across the resistors, which is the battery voltage minus the LED voltage (your schematic shows the LED backwards, but obviously that's not what you've built).
Using your original numbers (4.8V-3.1V)/0.02A = 85\$\Omega\$
Using your measured battery voltage: (5.17-3.1)/0.02 = 103
So try 100\$\Omega\$. |
H: What is the definition of characteristic impedance of a lattice network?
We were being taught about Lattice networks in class, today, and our professor mentioned that the characteristic impedance of a symmetrical lattice network like
is given by:
$$Z_0=\sqrt{Z_aZ_b}$$
I'm not sure what characteristic impedance means in this context. I searched around the net a bit and found that the term is generally used in the context of transmission lines. However, I'm not sure how it applies to a lattice network or perhaps more generally to a two-port network.
Basically, my question is: What is the definition of characteristic impedance of a lattice network (or a two-port network)?
AI: I'm not sure what characteristic impedance means in this context.
If you "placed" an impedance on the output (on the right of the network) and looked at the impedance into the network (from the left) then the input impedance (looking in from the left) will equal the "placed" impedance when that placed impedance equals the characteristic impedance of the network.
You could go through the math and calculate the input impedance when an unknown impedance is placed on the output then equate the input impedance to that unknown impedance and it would turn out to be \$Z_0\$.
The impact of this is that you can cascade an infinite number of sections and the input impedance would remain constant. |
H: Who said, "all sensors are temperature sensors, but some are better than others"?
One of my favorite electrical quotes goes something like "all sensors are temperature sensors, but some are better than others". Unfortunately, I don't remember where I read this. What is the origin of the quote?
AI: Whoever said it probably did so in person, and the odds that any of us met the true first person are low. This is the sort of engineering observation that could have been invented by several different people back in 1940, for all we know.
Elecia White's 2011 Making Embedded Systems quotes this anonymously, so the latest possibility is 2010. Her PowerPoint also has:
All sensors are temperature sensors, some measure other things as well.
An alternative, suggesting some divergence:
It has been said that all sensors are temperature sensors first.
This follows the broader observation that no real-world physical relationship or behavior is truly, fully linear across the range of all possibility. For electronic sensors, temperature is big, but humidity, pressure and acceleration pop up surprisingly often. You could say that the best sensor for one phenomenon is just exceptionally bad at sensing all the others - because anything that interacts with it does something. |
H: Power management problem on Samsung SI9000?
I have a Samsung SI9000 model SPH-D710 Sprint version. The issue I am having is the phone seems to not be charging the battery. Currently the battery is fully discharged and when plugged in and charging the phone charging icon on the screen appears and disappears quickly and then the phone shuts off.
I checked the voltage at the USB port and I see 5V. I also check the voltage at the battery pin connection and I see 2.8V. I'm not sure if that is the correct voltage to be seen at the pin connection that's why I am asking this question.
Also, the battery I am using is a Anker 3.7V 1800mAH battery. I do not have another battery to rule out if its a faulty battery.
AI: Frequent problem with charging a phone over u-USB connector is contamination by lint, which leads to excessive plug forcing, which might bend data pins in the tiny flimsy connector. Once the data are pins are broken, the phone loses ability to identify chargers and doesn't charge itself anymore. The level of 2.8 V no load is definitely too low for a Li-Po 3.7-V battery.
You might need to find a replacement sub-assembly board that holds the USB connector. Or get a stand-alone charger and keep charging your battery separately. |
H: ceramic capacitance value
I am trying to figure out how to read the nominal value of this capacitor. When I use a meter it reads 3.4nF. I have several caps that have the format of .00X where X is an integer. Not sure how that decimal point works in there.
AI: Common capacitances range from 1nF to whole farads for supercapacitors. The standard notation for larger values is like for resistors, but with nanofarads instead of ohms as the base unit.
(all digits before the last) * 10 ^ (last digit) nF
Here, that format would produce a 30 indicating 3*10^0 nF. Instead, they used "fraction of a microfarad" decimal notation:
.003uF = 3nF
It's no more compact, but at least you can tell that it represents a component value, and the format allows higher precision without resorting to negative exponents. Considering the tolerance, it's in agreement with your reading. |
H: Toggle two LED status lights with two transistors
I have an input that is either floating, or grounded.
The switch is fixed, it's either open or closed. Ie, I can't replace with a double throw.
Here is the schematic / sim.
If the switch is closed, I want the lower LED to come on. If the switch is open, I want the upper LED to come on.
I feel like i'm pretty close, but that diode in there just feels wrong, and when the switch is closed you can see the upper LED stays on dimly.
Here is my second attempt.
This one has a pull up resistor for the NPN and it has a pull up resistor for the switch. But the upper LED still is slightly dimly lit.
How do I fix that?
AI: What are these "transistors" of which you speak?
simulate this circuit – Schematic created using CircuitLab
You need to adjust the resistor values to get the currents you want, and to balance the brightness of the leds, as different leds/colours have different brightnesses. (hint: you can use "simulate this circuit")
Both can be used with a single bicolor LED if you want. D4 should be a higher voltage color than D3. V(D4+D3) >> V(D3), so when SW2 closes the current goes though D3.
Note that the forward voltage of the different colors is important in these arrangements.
These arrangements work better on higher voltages, as the currents will naturally be be closer for the two leds.
Oh, alright here's a transistor one. It's a better choice at low voltages, it can give nearly equal currents on 3.3V.
R6 sets the LED current. If you use R4 and R5, then the voltage across D6 is <1V, and the D6 off current is very small.
The lower Von RED led is paired with the transistor so the voltage of both paths is more equal.
simulate this circuit
As long as Q1 has reasonable gain, neither resistor is really needed, as the off current of D6 is only 100-200uA. The more D6.Von (green) is > D7.Von (red), the less the off current will be. This arrangement works if D6=blue, D7=red, but you need R4,5 if D& blue, D6 red.
simulate this circuit
So if your switch has to have one end connected to the battery, you just move R6, and flip it all over if you want (-ve) switch.
simulate this circuit
Adding a relay...
simulate this circuit |
H: can I replace a 2n2222 transistor with a tip31c
I have a TIP31c transistor, I need a 2N2222 for an Arduino project to drive small dc motors with PWM, I found both transistors are NPN, but I don't want to hurt my Arduino, is the swap possible?
AI: It should work if you get the pinning correct. The TIP31C is generally going to be lower current gain than the 2N2222 so it will require a higher base current for a given load.
If your small motor load is a low current device truly compatible with the ratings of the 2N2222 then I see no reason that would keep you from trying the TIP31C. |
H: Shift register Tri-State and ULN2803A
I was planning to use the SN74HC595 shift register in association with the ULN2803A and MIC2981 to switch on and off some loads based on the data of the shift register.
What happens if I disable the output of the shift register (using the OE line) and lines Qa to Qh go into high impedance state ?
Would the ULN or MIC chips read the high impedance input as randomly high/low, ie, switching on and off the loads randomly ?
---------- Qa Qh ----------
| | -------- | | -------- Load A
| Shift | -------- | ULN2803A | -------- Load B
| Register | -------- | or | --------
| | -------- | MIC2981 | --------
| | -------- | | -------- ...
| | -------- | | --------
| | -------- | | -------- Load H
---------- ----------
|OE
AI: ULN2803 will read low input, see the equivalent circuit from the datasheet:
The resistors will pull the inputs down as you see.
MIC2981 will also read low since there is no current to drive the input transistor base. Cautions must be taken because here there is no pull down resistor and the input is noise sensitive. |
H: How to read maximum input
This is Carlo Gavazzi Power Analyzer, the sticker says
Input 3x380(660)V
Does it means that the maximum input voltage per line must be 380V or 660V?
AI: The "range code" of your product is "AV5", it means that your product can handle from 380V to 660V on its 3 inputs (-> tri-phase). The "D" letter also means that you must supply this power analyzer with 230VAC.
UPDATE : When I say :
from 380V to 660V
I mean 380V to 660V AC Three-phased.
Source :
Datasheet |
H: Node with two different voltages at the same time - Two branches (voltage source+resistor) in parallel - LTspice
I simulated the following circuit:
Why is Vu=7.5 V? I expect there to be an error because Vu=5=10 at the same time.
The current in the two branches is the same, thus (R1=R2):
$$Vu=R_1 i+V_1$$
$$Vu=R_1 i+V_2$$
$$V_1=5=V_2=10$$
Thank you in advance.
AI: Your equations are incorrect. If you define the current in one way, then that current needs to be negative for the other side.
$$\begin{align}
V_u &= R\cdot i + V_1 \\
V_u &= -R\cdot i + V_2 \\
\end{align}$$
$$\begin{align}
R\cdot i &= V_u - V_1 \\
R\cdot i &= V_2 - V_u
\end{align}$$
You find that
$$V_u = \frac{V_1 + V_2}{2}$$ |
H: Why is a microcontroller pin connected to ground via capacitors?
I am analyzing a circuit which uses an microcontroller to measure analog signals in digital form. I don't understand the function of one connection in the circuit.
See the figure. Here Vref of the MCU is connected to ground via two parallel capacitors. This microcontroller is chinese-made so its datasheet is available, but not very detailed.
The datasheet shows that Vref is internally connected to VDD/VCC which is 3.3 V, though I am not sure, because I think it should be zero, because it compares an input analog signal to detect its +ve and -ve cycle.
According to the datasheet Vref is an external voltage input pin.
The capacitors in question are in the red rectangle.
I need to know these facts:
What would be the function of the capacitors if Vref is internally at VDD/VCC?
What would be the function of the capacitors if Vref is an input pin and it is grounded via these capacitors?
AI: Vref usually means the reference voltage output of the built-in ADC (or DAC, or analog comparator). A reference voltage circuit is basically a very low current voltage regulator (a poor power supply, but very stable).
Components like ADCs are "using" voltage from this regulator (drawing current). Capacitance on the output of regulators helps to improve stability and reduce noise.
You can think of those capacitors like regular decoupling capacitors on the output of an LDO. |
H: Use 0.5W speaker with PAM8302A cause speaker goes hot
I'm using PAM8302a (datasheet) and an 8ohm, 0.5w speaker. It seems the amplifier is too powerful for the speaker because the speaker's back turns hot after several seconds. PAM8302a uses 5V and the speaker is directly connected to VO_P & VO_N pins. How can I keep the maximum output with good quality and don't burn the speaker?
1uf __________
----||----|100 ohm|---| | /|
| PAM8302a |--- | | 0.5 W
1uf | |----| | 8 ohm
----||----|100 ohm|---| | \|
__________
AI: The PAM8302A is designed to be able to deliver 2.5 watts into a 4 ohm speaker from a 5 volt supply. A speaker impedance of 8 ohms means potentially it will deliver more than 1.25 watts but your speaker is only rated at 0.5 watts.
You are over-powering your speaker. |
H: Can I use an L7805CV with an AC input?
I am trying to switch a small water pump (for a pet fountain) according to the output of a PIR sensor. A couple of years ago I setup a circuit on a breadboard and tested it with the pump - it worked! Unfortunately, I don't have schematics or photos of the circuit anymore.
The circuit is powered by the power adaptor of the water pump (12VAC output). Using the L7805CV it should regulate to 5VDC (for the PIR sensor). The PIR sensor activates a transistor which uses the same 5VDC to activate a relay. The relay should then switch the original 12VAC.
I am a bit confused why that worked back then. I tried a similar setup now and the L7805CV gets hot, but there is no power output.
Can I source the L7805CV with AC power? (without using a diode bridge)
If not, is it correct that I could use a diode bridge to convert the 12VAC to 12VDC and use that as an input for the L7805CV?
Update:
After reading your comments/answers, it came back to me that in the working circuit I had been using a 9V battery as an input for the L7805. Sorry
My current (wrong!) circuit is attached:
AI: No buddy , you can not connect 12VAC directly to 7805 as it is not meant to be operated with ac voltage ,
better use bridge rectifier and capacitor afterwards to smoothen the DC output and then feed it to the 7805 to get +5VDC.
12VAC * 1.414 = ~17VDC
With this 17VDC input and 5VDC output - if your current drawn is high , definitely your 7805 will get hot so you may need a small heatsink to dissipate the heat and keep the junction temp. of 7805 less than absolute maximum .
hope this helped ! |
H: Struggling to understand wire gauge and strands
I have been trying to understand wire gauge for a project, but there are so many different strand types and sizes it's alittle overwhelming. The wire needs to be 30 AWG and stranded, is it common for 30 AWG to have 7 strands or can it have more like 26?
AI: The stranding is more-or-less arbitrary, determined by the sizes of individual conductor that the manufacturer can make and how they are combined. The differences are (almost) entirely physical, electrically there is very little difference between a wire with many strands (all touching each other) and one with a single core.
Mechanical characteristics include:
flexibility
lifetime when bent
break strength
corrosion resistance (as mentioned by @Henry Crun)
The first two generally increase with the number of strands (but the insulation also can have a large effect).
Diameter variations with stranding will affect the electrical characteristics (eg. inductance, capacitance) only slightly, and rounding from the nominal gauges of strands leads to some slight difference in nominal resistivity though the target is the same resistance per unit length (because the total cross sectional area of the conductors should be the same regardless of stranding).
Eg. an AWG30 wire has a nominal cross-sectional area of 0.0509mm^2. If there are more than one strand then they should add up to that area.
For example, here is an excerpt from the standard stranding chart of a specialty wire manufacturer:
They offer as many as 40 strands of AWG46 wire (as standard). The nominal OD increases for coarse stranding in particular, but in this case only by about 20% for the coarsest stranding.
This particular maker can make single core wire as fine as AWG 56 so you might imagine that (for enough money, and it would be a large amount) they could make an AWG 30 conductor with ~420 strands of AWG 56 wire.
Note that this only covers the conductor. The insulation system is another subject entirely and pretty much independent of the conductor. |
H: Can capacitors in speakers (Yamaha) be replaced by slightly different ones?
Now, I know that people used replacement capacitors which has a Capacity of 22nF, 250V ac and 630V dc +/-5%
The Capacitor was labeled C515 on the board it is soldered on.
I was wondering how flexible those values are. Does it have to be 22nF and those exact voltages? People have been using overspeced ones but I'm kinda scared it will destroy even more.
I mean, best-case would be that some of you know the exact capacitor, but why not use one that is a bit different, if it works just as well?
How different can it be? I feel like the capacity has to be the same, but the voltage can be higher. Is there a limit to that though, where there is too little flow?
AI: You can use any 22nF caps as long as they are made for 250VAC and 630VDC. You will never get the exact component, the important part is to match the specs of the original one. |
H: Use battery supply as backup
I'm designing a circuit that has a built-in single-cell LiPo battery with its charger for a GSM circuit. The board feeds from a 12V power supply and uses the battery as a backup, and when the power supply goes out, the battery must power the load, and when the supply goes back battery should begin charging, and the load should be fed from the power supply. I used two Schottky diodes to select between the two. But I'm not sure what happens when the battery is being charged and powering the board at the same time. Another problem is that both regulator circuits supply 5 volts, but how can I make it use the step-down regulator (power supply) when both regulators are working? My load uses 5V and 1~2A, and the maximum dropout should not get over 600 millivolts.
simulate this circuit – Schematic created using CircuitLab
AI: If you set or design the step-down regulator to 5.6 V but the step-up converter (after the battery) slightly lower, for example to 5.3 V then as long as the 12 V power is "up" the step-down regulator will always "win" (be used, supply the current) as it delivers a slightly higher voltage.
When the 12 V power is off, then the step-down regulator cannot supply a voltage so the step-down regulator will will be used.
I recommend adding a battery protection circuit between the battery and the rest of the circuit so that when the 12 V power is off for a long time, the step-up converter cannot fully deplete the battery. It should stop at about Vbat = 3.0 V to prevent over discharging of the battery which damages the battery.
A battery protection circuit will simply disconnect the battery when Vbat gets too low (and too high as well if the charger circuit breaks).
But allow me to suggest an alternative solution: many power banks come with an input and an output socket and allow for supplying 5 V and charging the battery at the same time. Then you would have a complete finished, working solution. If the powerbank needs 5 V in put then you only need a step-down regulator module. |
H: How can the armature current of a DC shunt motor be zero at no-load?
I have seen the mathematical explanation of this explained using back EMF, where the back EMF would equal the input voltage and hence the armature current would be zero. But I'm unable to understand that if the armature current is zero at no-load for the motor then how can the motor shaft rotate with the maximum speed at this state ? (As there is no current flowing through the armature windings it shouldn't be able to rotate?)
AI: In 'imaginary world' the motor is armature is rotating freely without bearing friction or windage, so once it get up to speed (which takes forever, but it gets very close very quickly) it continues to rotate at exactly the RPM to counter the applied voltage. Since there is zero current, zero torque is produced (but none is needed to keep the rotor spinning).
If you subsequently reduce the voltage, the current flows in the opposite direction compared to starting up, and the rotor RPM drops. If you increase the voltage the motor RPM increases to balance the applied voltage with back EMF, as before.
In reality, the no-load current is not zero, but it's a lot less than the current at full load and much, much less than the current with rotor locked. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.