text
stringlengths 83
79.5k
|
|---|
H: ESD capacitor simulation for human body model
I have designed an ESD suppression circuit with the help of ESD capacitor using LTspice. In the circuit, 15kV input pulse is given to ESD human body model and the resistor, capacitor used near the source are as per the standards.Capacitor C2 value is calculated as per the theory. Now my question is,
1. i have used a switch before C1. Is this switch needed?
2. Output at C2 is same as C1. C2 does not influence the circuit.
What should i do to get the correct output?
Plz refer the image for details.
Thanks in advance.
AI: Have you read this article from Texas Instruments ?
To test your ESD protection properly you need to create the correct pulse. This can be done using a circuit like this:
ESD generator models according to HBM (left) and IEC 61000-4-2 (right)
As you can see the idea behind the Human Body ESD model is that a capacitor is charged to a certain voltage and that charged capacitor is then discharged (through a defined series resistor) through the device under test.
The discharge of the capacitor causes a current to flow and a voltage to develop across your DUT. You need to check if that current and voltage do not exceed the limits of what your DUT (the protection inside it) can handle. At least, that's how I simulate my ESD protections!
Your circuit will only briefly charge the capacitors, it does not simulate the high voltage discharge at all.
|
H: Understanding of class-AB currents
I am trying to understand a simple class-AB output stage. The bias voltage for the transistors is made by using two diodes. The following picture show the circuits. The currents drawn are how, i believe, the currents will flow.
I want to understand the currents, to be able to find a value for the resistor, R.
Especially i am thinking of the following:
Is the transistor Q2 solely driven by the input? I think this as there is no other path for the base current.
Will the current through R be used for driving the transistor Q1 and the diodes?
Then, if this is the case, how can a reasonable value for the resistor R be found?
I know that the lowest possible voltage across R is 5.5 V, and i know that I_C for Q1 is at most 260 mA. Given this i believe that the minimum current for driving the transistor is:
$$R = \frac{5.5}{(\frac{0,260}{\beta})}$$
This i enough current for driving the transistor, but how is it possible to determine the needed current through the diodes? I suspect that it is a quite low current. Will the easiest way to just undersize the resistor, and forget about the diodes?
AI: Is the transistor Q2 solely driven by the input? I think this as there is no other path for the base current.
You are only thinking about the DC (biasing currents) and yes, then the currents could (I am not saying that they always do) flow like you have drawn.
However the DC biasing is only one aspect of how this circuit works. The signals are small variations of this DC biasing current. So let's say that 10 mA is flowing out at Vi, if the signal causes that current to vary between 9 mA and 11 mA then on average there is still flowing 10 mA out of Vi. But the signal current is +/- 1 mA !!!
The current through R is your choice. What happens if you increase the DC current through R, what happens if you lower it? Think about the collector currents of the transistors as well.
Class AB means that for large signals part of the output stage will have no current (Ic = 0 A), what does that mean in relation to having a large or a small DC biasing current flowing through the transistors?
|
H: Simple Op-Amp setup for current sense has a strange working range
I am using a LM358D dual amplifier at the moment and my goal is to measure over-current on 2 motors. Before I'll be doing that, I made a test setup to test the equations and check the output signal of the op-amp. The gain is set to 100 with standard resistors.
simulate this circuit – Schematic created using CircuitLab
As you can see (don't mind the op-amp name, forgot to change), a voltage drop between the current sense resistor (something that I will implement later) is 0.02V (20mV). The op-amp amplifies it by 100 in an ideal situation so that I can read it with a STM32.
However, when I make this in reality, the Vout is around 0,7v and won't change until I decrease the 4.98 all the way down till 4.1v. When it reaches that point, the Vout changes dramatically when I decrease it slightly and reaches its max output of 3.9v (It's 3.9v because I connected the flexible source to v- and the VCC of the component) when the signal coming in the V- of the op-amp is 4v or lower.
My question is Why doesn't it amplify the difference between 5v(v+) and 4.98v (v-) but only starts the amplification at 5v(v+) and 4.10v(v-)?
I have checked the equations with an online calculator and used the circuitlab simulator and it should normally work. What am I doing wrong?
My ideal setup would be:
simulate this circuit
UPDATE 01/09/2018
I have increased the Vcc voltage for the op amp and thanks to you guys it displays now a somewhat normal behavior. However, I encountered another problem which is actually simple, but I can't seem to grasp it. To know how much current the load takes we use the Ohm's law. So I = U/R. Measuring the voltage drop while stopping the motor with my hand while supplying the motor with 7V, will have a drop of around 35mV(0,035V). When I use the equation, I= U/R = 0,035/1 = 0,035A. However, I don't think this is actually correct, since the motor is quite hard to hold with a hand. I have also a display in my self-built power supply and when I "load" the motor the current increases to around 2,2A. This might be the current that the resistor uses it up. Does it mean that I have to know the current first before I calculate it?
So, Volt per ampère = 0,035V/2,2A = 0,0159V = 15,9mV per ampère? I've looked it up and most doesn't fully explain it, just the principe of ohm's law.
simulate this circuit
AI: The op-amp is powered from 5 volts and the signal to be measured is 20 mV raised to a common mode voltage of 4.99 volts. The LM358 has an input common mode range of 0 volts to Vcc - 1.5 volts hence, you are asking too much from this device. If you raised the power supply (just for the op-amp) to greater than 6.5 volts it will work.
The problem more specifically is that the voltage on the +Vin pin is 99% of 5 volts or 4.95 volts. If you lowered the gain by increasing the input resistors to make the voltage on +Vin less than 3.5 volts then it would start to work.
If you powered the op-amp from 24 volts and your signal is top-side referenced to 24 volts then you could lower the gain such that +Vin was no more than 22.5 volts. This would make the input resistors 680 ohm and you'd have a front-end gain of 14.7 but you could apply a secondary stage to give you the overall gain that you need.
|
H: Trigger input with varying input voltages
Currently I am trying to build a circuit, with the goal of triggering a pin of an ESP8266 from varying input voltages (in the range of 5 to max 15 volts it should get triggered). Also the input should be seperated from the ESP.
What I was thinking to do was:
Use an optocoupler for the input voltage (currently thinking about the pc817)
Calculate the resistor so that min voltage and max voltage would work (current range of the pc817 is 20mA - 50mA, and Voltage Range is 1.2 (standard) to 1.4):
15V: (15V - 1,2V) / 0,05A = 276 ohm (already calculated for absolute max current)
5V: (5V-1,2V) / 0,02A = 190 ohm
So which resistor should I use to allow 5-15V in this optocoupler? Or is there any better circuit option/better optocoupler that allows something like this to be achieved?
AI: That looks dodgy. You haven't linked to a datasheet but the fact that you mention 1.2 to 1.4 V looks like you are referring to the \$ V_f \$ of the opto-coupler LED. If you vary the input voltage by a factor of three your opto-coupler LED current will vary by close to the same amount.
Your ESP trigger will depend on the output of the opto-isolator and the pull-up resistor. You want this to switch very cleanly so you should be switching the LED on hard rather than just on the edge of working at 5 V.
You could consider a constant current driver for the opto-LED.
Figure 1. This switched constant-current driver provides a constant-current to the LED over a range of supply voltages and independent of the LED’s forward voltage. Source: Simple constant-current driver.
In your case you can connect IN and Vbb together. L1 represents the LED in the opto-coupler. For 10 mA R2 should be about \$ R = \frac {V}{I} = \frac {0.6}{0.01} = 60 \ \Omega \$. Pick the nearest standard value. See my linked article for more.
|
H: What PCB Plating do I need to use Exposed Copper Pads with Pogo Pins?
I am designing a PCB that will have some Mill-Max pogo pins make direct contact with exposed copper pads on the PCB. This will have many connects and disconnects, think hundreds to thousands.
I know that it needs to be at least gold coated in order for this to be resistant to corrosion, but does that mean ENIG plating is enough? Or do I need selective hard gold plating?
AI: I have been putting solder on my pogo-pin pads. I apply the solder by hand on my prototype boards and have openings in the paste mask for those boards that have solder-paste applied with a stencil.
I find that the solder bumps have been far more reliable than bare pads for repeated use.
For those situations where the pogo-pin pads are used only occasionally, I find that whatever plating the board house uses is reliable. For me, this is both HASL and ENIG.
But: the pads will not stand up to repeated use. The cure is simple - just add a tiny bit of solder to each pad. A rounded bump is all that you need.
|
H: PA92 OPAMP phase compensation
I'm having trouble to understand the phase compensation on the PA92 opamp. First I'll explain quickly the circuit I'm building.
1. The circuit
I'm using a 200V battery and would like to create a virtual Gnd for my circuit. The PA92 OPAMP is the ideal component for that, because it can operate on high-voltage supplies (up to 500V). Below you can see the circuit I've built:
simulate this circuit – Schematic created using CircuitLab
R1 and R2 create a reference voltage aimed to be 0V. Capacitors C1 and C2 provide some stability for the reference.
D1 and D2 are 3V6 zener diodes that keep the inputs close to each other. A differential input voltage of more than 20V can damage the OPAMP.
You can find the datasheet of the OPAMP here: https://www.apexanalog.com/resources/products/pa92u.pdf
2. Phase compensation feature
This OPAMP has a "phase compensation" feature. You have to connect pin 4 to pin 5 through an RC circuit. The choice of the resistor and capacitor values define the phase compensation of the OPAMP. The datasheet explains briefly:
The PA92 is externally compensated and performance can be tailored to the application. Use the graphs of small
signal response and power response as a guide. The compensation capacitor CC must be rated at 500V working
voltage. An NPO capacitor is recommended. The compensation network CCRC must be mounted closely to the amplifier
pins 4 and 5 to avoid spurious oscillation.
These are the "small signal response" and "power response" graphs:
The datasheet also provides this table:
3. The problem explained
I have to admit that I don't fully grasp what this phase compensation actually does. To make the component behave as a general everyday OPAMP, I thought I had to choose the last line from the table (10pF, 0Ω). I couldn't be more mistaken. The output oscillates at about 60V peak-to-peak, as you can see on my oscilloscope screenshot:
> YELLOW: V+ input
> BLUE: V- input
> PURPLE: Vout
> Horizontal: 400ns per division, 10 divisions in total
> Vertical: 10V per division, 8 divisions in total
Note: For this test, I used two batteries in series of 100V each, so I have a real Gnd right in the middle. These oscilloscope screenshots are measurements respective to that real Gnd.
I then changed the CC and RC values to 100pF and 100Ω respectively. This corresponds to the second line in the table. I now get this output:
> YELLOW: V+ input
> BLUE: V- input
> PURPLE: Vout
> Horizontal: 1us per division, 10 divisions in total
> Vertical: 1V per division, 8 divisions in total
There is still an oscillation, but it's only 5.5V peak-to-peak (note the different scale!).
Finally, I would like to do a test with CC and RC equal to 150pF and 100Ω. I'll order 150pF capacitors for that. Hopefully, there will be no more oscillation.
4. My questions
I have basically two questions. A theoretical one, and a practical one:
What does this "phase compensation" feature on the PA92 actually do?
What is this "Gain" from the small table in the datasheet? Open-loop or closed loop? At what frequency?
What practical advice can you give to get rid of these oscillations? I'm really puzzled, I'd never expect this on such a simple voltage follower...
5. Notes
The circuit I've drawn above is really all I've put on the board. For now, the only load is the 100kΩ resistor.
@laptop2d says that the "phase compensation" feature "allows the OPAMP to respond faster at high frequencies". In short, can I look at this feature as a way to tune the "rise time" and "fall time" of Vout? So I could tune it from like 5V/µs to 50V/µs?
AI: What does this "phase compensation" feature on the PA92 actually do?
In short, it allows the op amp to respond faster at high frequencies, in other words, high gain at higher frequencies. Since your application operates mainly at DC, I would set the compensation 150pf, because you don't need the extra gain\bandwidth at high frequencies.
What practical advice can you give to get rid of these oscillations?
I'm really puzzled, I'd never expect this on such a simple voltage
follower...
This isn't a simple voltage follower because you have 20k in the feedback loop and the diodes. The diodes add a small amount of capacitance, there may also be small amounts of inductance from wiring the circuit up. The feedback loop has a resonance point from one of these things, and it's at 375kHz.
Since I'm too lazy to simulate this, the 20k resistors are not necessary, because the opamp inputs are high impedance, and the only other connection is the 150k resistors, which will give you a worst case shunting current of 1mA through the diodes if the 20k resistors aren't there.
If that doesn't work then try changing the op amp from a voltage follower to an inverting op amp configuration and across the feedback resistor, add a capacitor to limit the bandwidth (thus changing it to a low pass filter) to lower than 300kHz.
EDIT (from @K.Mulier)
Eventually I got it working with RC = 100Ω and CC = 147pF. For the other PA92 OPAMPs (which are used in more complex circuitry), I needed to solder RC = 100Ω and CC = 447pF to the compensation pins. For more details, see the other post.
|
H: How is the extinction angle for a half wave rectifier with RL load calculated?
I have a couple of notes about the half wave rectifiers with the RL load, but I dont quite undestand how is obtained the extinction angle \$\beta\$ ?
simulate this circuit – Schematic created using CircuitLab
Questions
\$I_{ODC}\$,\$V_{ORMS}\$
Resolution
First it is calculated the impedance
$$Z=\sqrt{R^2+L\omega^2}$$
$$Z=\sqrt{9^2+((18mH)(60)(2\pi)^2}=11.268\Omega$$
then the angle \$\phi\$
$$\phi=\frac{L\omega}{R}$$
$$\phi=tan^{-1}\frac{18mH*2\pi*60}{9}=36.99$$
Then it is calculated \$V_{ODC}\$
$$V_{ODC}=\frac{V_m}{2\pi}(1-cos\beta)=\frac{\sqrt{2}*180}{2\pi}(1-cos215)=52.11V$$
$$I_{ODC}=\frac{52.11}{9}=5.79A$$
for
$$V_{ORMS}=\frac{V_m}{2}\sqrt{(\frac{1}{\pi}(\beta-\frac{1}{2}sin2\beta))}$$
$$V_{ORMS}=\frac{\sqrt{2}*180}{2}\sqrt{(\frac{1}{\pi}(3.75-\frac{1}{2}sin2*215))}=91.997V$$
Discussion
While this seems to be an appropriate use of the definitions of DC and RMS values based on the definition using integrals and taking the idea that this is valid under a sine signal, the main issue is how is calculated the \$beta\$ angle since I see the value of 215 degrees but how was calculated?, I understand that the \$phi\$ angle its the difference of phase between the voltage and the current because of the induction effect, so I'm guessing this is added to \$pi\$ but this would yield 216.99 degrees not 215.
I calculate the \$\beta\$ from
$$\frac{V_m}{Z}\sin(\beta-\phi)+\sin(\phi)e^{\beta/\omega\tau}=0$$
using the circuit values
\$\omega\tau=2\pi*60*\frac{18mH}{9}=.753\$ in rads and the actual value from \$phi\$ in rads=0.645 so making the substitution on the equation before, it would be
$$\frac{\sqrt{2}*180}{11.268}\sin(\beta-.645)+\sin(.645)e^{\beta/.753}=0$$
Solving for \$beta=0.642\$ rads or 36.78 degrees, then this added to \$pi\$ would be 216.78 not 215. But why or how its justified I don't know.
I cant attend the lectures because of the job so I don't have more info and the people that I contacted does not know, even didn't notice this. It seems that the \$phi\$ value is used instead of \$\beta\$ and in this case are almost the same, but I have tried to solve problems like this and the values have a greater difference of 30 or 40 degrees, so I cant assume that the \$phi\$ values are used as an approximate to avoid solving the last equation, that I understand does not have a closed form solution.
AI: For the uncontrolled single-phase rectifier with RL load: In order to find the \$\beta\$, the extinction angle, the following equation must be solved:
$$sin(\beta-\phi)+ sin(\phi)e^{^-\frac{\beta}{\omega\tau}} = 0$$
where \$tan\phi = \frac{\omega L}{R}\$, Also, can be written as:
$$sin(\beta-\phi)+ sin(\phi)e^{^-\frac{\beta}{tan\phi}} = 0$$
The equation is transcedental and can be solved only by numeric methods.
Using the values you supplied: \$ \phi \approx 37\$ degrees. Solving equation numerically: \$\beta \approx 217\$.
Alternatively, \$\beta(\phi)\$ can be determined by using pre-built plots, like the one shown below (in accordance with the calculation above):
The approximation you mentioned (also in another post similar to this, which you deleted) does not seem always to work . Note, for \$0 \leq \phi\leq 40\$ degrees the curve seems a straight line, being enough to do \$\beta=\phi+180\$ degrees. But, using the plot, for \$\phi=70\$ degrees, \$\beta=260\$. Your approximation lead to \$\beta=250\$, something different.
|
H: Same serial command, different serial replies
I have a device (a traffic counter) that communicate with my computer throught Serial Port.
To extract data from this device, I use a specific software. I'm also using a Serial Port Monitor to check what is written on the serial port and what is the serial answer.
So for example if in the software provided with the counter I click on "get power consumption information" my serial monitor capture the following result:
[30/08/2018 18:29:28] Written data (COM4)
3f ?
[30/08/2018 18:29:28] Read data (COM4)
3f 20 33 63 20 28 30 38 3a 33 35 20 30 39 2d 30 ? 3c (08:35 09-0
37 2d 32 30 31 38 20 29 20 2b 28 4d 3d 35 2e 36 7-2018 ) +(M=5.6
38 56 2c 20 52 3d 35 2e 33 37 56 29 0d 0a 35 62 8V, R=5.37V)..5b
...
Then if I send by myself the same Serial command (so ? or 3f in hexadecimal), I obtain the exact same result. Great.
Now I try to extract the stored data. So I click on "extract the stored data" and my serial monitor capture the following result:
[30/08/2018 18:42:46] Written data (COM4)
72 30 35 64 r05d
[30/08/2018 18:42:46] Read data (COM4)
64 20 02 f4 01 b8 5f aa 81 00 ca 39 2b 4b b8 28 d .ô.¸_ª.Ê9+K¸(
dc 98 77 2c 59 ad 19 f6 5b 34 9c c7 31 5e 1f 1e ܘw,Y.ö[4œÇ1^..
68 5f c8 8e 7b 32 4f ed 10 60 51 d2 a1 5b 33 62 h_ÈŽ{2Oí.`QÒ¡[3b
...
But this time if I send by myself the same Serial command, the result is totally different !
[30/08/2018 18:41:01] Written data (COM4)
72 30 35 64 r05d
[30/08/2018 18:41:01] Read data (COM4)
72 20 30 35 r 05
Why the same serial command give me two differents answers ?
If I can get the same answer it will be easy to recreate the file created by the software... but I need the same answer.
AI: A serial interface, even a standard one like RS232, enforces nothing about the application protocol (available commands and their syntax) of a device. Which can have all kinds of special cases and commands that change settings or the way other commands work, limited only by the creativity and/or masochism of the engineer that designed it. This is why the same command can give you different results. Sometimes commands need other commands or conditions to provide results you are looking for.
As a metaphor, on a command prompt on your PC, typing ls will give you a different result if you issue a cd command to change directory in between. This is an illustration of how a command can have a side effect on the output of other commands.
In this particular case, there is something either the application or device is doing that provides valid data in one case but not the other. Or something you are missing in the capture, or even something you physically do to the device (e.g. power cycle, or button press) that you did not account for.
That being, this is simply the "joy" of reverse engineering, figuring out all the little details and side effects. It is impossible for anyone to give you any more information without either providing more information on the device, but even then all we can do is guess unless you can find command documentation or a protocol specification for this device. Sometimes this is provided in a datasheet or manual even if proprietary software is available as well, so it is worth checking.
|
H: Using a voltage divider with buried zener voltage reference
My plan in the below circuit was to use a voltage divider from a Max6225 2.5Vref, to get 2V and 1V from it in order to use the full 16bit bipolar scale of the ADS1115s, but I'm getting strange resistance readings from a DMM across the resistors - can I use a voltage divider with the Vref like this?
EDIT: Apologies for the drawing - not sure how to do the buried zener vref part, so I've marked the connections instead OK.
EDIT 2: Please ignore the test resistor in the bottom picture - this was just to test if the same thing happened however I connected a resistance from Vref out back to ground, rather than a short or something on the board
AI: IMO trying to tweak dividers and multiple op-amp buffers is a bit passé.
Since you already have a MAX5541 16 bit DAC on your board, which I assume is using your MAX6225 as its reference, you could simply generate the 2V and 1V references from that and store it in a Maxim DS4303.
The DS4303 will provide a 12bit resolution of your reference voltage, but you can tweak the expected output if you have an accurate enough 4-6 digit multimeter.
|
H: Identifying FR-4 and G-10
I am evaluating a couple products -- lighting ballasts -- and noticed one of them seems to use G-10 as the PCB laminate. I assume that the beige, solder-mask-free top layer is the clue.
Top:
Bottom:
Given that FR-4 is Flame Retardant, whereas G-10 is not, I prefer to stay away from the latter laminate. But I cannot say for sure if the second board uses FR-4 or not.
Top:
Bottom:
It appears that the second board has more of the FR-4 look to it (that pale green), but that could just be a top-layer solder mask.
Am I on the right track here? Is it even possible to tell the difference between G-10 and FR-4 like this?
AI: The top one looks like a cheap paper-based phenolic board eg. CEM-1/CEM-3. The outline and holes appear to be punched, which is very common for low end consumer products and power supplies. It punches fairly nicely under the right conditions, is cheaper and wears the tools less than epoxy-glass laminates.
Eg. Nan Ya Plastics CEM-1-97
The bottom one looks more like epoxy-glass such as FR4.
You can test for UL94V0 with a Bunsen burner following the procedure. Basically it's not supposed to keep burning (much) after the flame is removed.
|
H: Why use RMS instead of the average voltage of half the cycle for power
In a AC sine wave, the RMS voltage value is \$\frac{V_{p}}{\sqrt{2}}\$ where \$V_{p}\$ is the peak voltage whereas the average voltage value over half the cycle is \$V_{p}\cdot \frac{2}{\pi}\$
If we take the average of the entire sine wave the result would yield 0, since both half's of the sine wave cancel each other out. In order to fix this issue we've come up with the RMS value.
What I don't get is why bother using RMS, can't we just use the average voltage from half the cycle to compute the power.
Use \$P = \frac{V_{avg}^{2}}{R}\$ instead of \$P = \frac{V_{RMS}^{2}}{R}\$
I've heard that the RMS voltage value is the same as the DC voltage for calculating power. But why RMS? And not the average voltage value for half the cycle.
Any help is grately appreciated.
AI: They're not the same, in general. For a sinusoidal waveform, the difference is about 11%. The square root of the average of the square of a function is not the same as the average of a function.
The average over a half cycle is 2Vp/pi = 0.6366 Vp
The RMS is Vp/sqrt(2) = 0.707107 Vp
The ratio is 1.11.
The ratio will be different for different waveforms, but in general the RMS will always be higher. RMS gives you the power transfer into a resistive load, average does not (except for the degenerate case of DC).
In some cases you may actually want the average (but not for power into a resistive load).
Cheap multimeters often just measure the average of the rectified waveform and read 11.1% high, assuming a sinusoidal waveform.
|
H: Can I touch voltage?
After watched this man this man, I have some questions.
He touched 170 VDC, what is max DC voltage can I touch when I dry? And wet?
What is max AC voltage can I touch when I dry? And wet?
Is using 'diode bridge' convert dangerous 50 VAC voltage to safe DC voltage?
120 VAC @ 60 Hz vs 120 VAC @ 100 MHz, high or low frequency make voltage dangerous?
Is '50 V PWM 60 Hz' dangerous like AC or safe like DC?
Can I touch charged capacitor (only one leg)?
AI: AC and DC are both dangerous.
Its more common to be hurt by AC because DC generally does not go beyond 15V in domestic devices while AC can have values around 120V or 240V.
We are less tolerant to AC as you can see here
The main reason seems to be related with the capacitive effect of the skin.
|
H: Exactly what type of resistor is being referred to in this diagram?
I'm trying to control an RGB LED strip using a NodeMCU. I have been following the guide linked here. However, the diagram included in the diagram is rather unclear, especially for someone like myself who is new to electronics. This is the diagram:
All I can make out from the picture is "500 Ω". However, when googling for the resistor, I am unable to find exactly what I need. For example, on this AliExpress listing, I am unable to find any mention of "Ohms" and just get given an option of multiple "...R". "...K" "...M".
I would really appreciate it if someone could point me in the right direction as I am new to electronics and have found myself stumped by this relatively basic issue.
Thank you in advance for any help.
P.S. I am aware that the method used to step down the 12v to 5v shown in the diagram can be problematic and I am instead going to use a 12v - 5v car charger.
AI: A 500 Ω resistor might be listed as 500 R. However, 500 Ω is not a common value - 510 would be much more common, and would be appropriate for that application.
|
H: When are fiducials needed?
On a single-layer board with no through-hole and no machine placed components, is there any need for fiducials (for example to route the board outline)? Board house has asked for permission to add fiducials to gerbers. Of course I will say yes, but I am surprised. I definitely don't need the fiducials for assembly. But the vendor seems to be saying that the fiducials will assist in cutting the board outline.
AI: According to this application note from norcott, three global fiducials are used to determine the correct orientation of the board (or panel).
Relevant quote:
It is important that only three fiducials are used. This ensures that
if a panel is accidently inserted into the placement equipment rotated
through 180°, the equipment can detect it and halt assembly.
And for a single board without a panel, those fiducials are placed on the board, and will show up in the end:
(images taken from the application note)
There is no specific mention of routing the board outline in that document, but I can imagine that they use this also in the routing machine to make sure that the board has the right orientation.
|
H: Does non-matching impedance of amplifier and speaker distort the sound?
I'm about to buy a pair of headphones and an audio interface with built in amplifier. The specs say that the amp's impedance is "<30 Ohms".
The headphone I'd like to buy is a Beyerdynamic DT 990, which has versions of different impedance.
I'm only qualified in electronics enough to know that the higher the headphone impedance, the more "amplification" (for a lack of a better word) required to achieve the same power.
However, I'm concerned that the impedance being significantly different introduces distortion to the sound. I'm not talking about saturation necessarily, but maybe a slight change in transfer characteristics, which is obviously not something I want to deal with.
Any insight on this topic is highly appreciated.
AI: You can simply forget about impedance matching for home Audio.
Impedance matching is needed only where the wavelength of the signal comes close to the length of the cable transporting that signal. Electrical signals travel with almost the speed of light through cables, for the highest audio frequency (giving the shortest wavelength) the wavelength is about 15 km. I'm guessing that your cables aren't that long.
Impedance matching is needed to prevent signals reflecting and distorting them. This is usually only relevant for high frequency signals, not audio (exception: analog telephone lines).
In my opinion the "impedance matching" for audio amplifiers is really better understood as: "Can this amplifier drive this speaker?"
Example: some amplifiers are only suitable for 4 and 8 ohm speakers. Using it with 2 ohm speakers (or two 4 ohm speakers in parallel) can give issues.
For headphones this is almost never an issue unless the impedance of the headphone is very low (less than 10 ohms) or very high (600 ohms). And even then, if there is a "mismatch" the maximum volume might be reduced.
Usually home audio amplifiers drive the headphone output from the speaker output via series resistors to give a bit of protection against overloading the headphones as they need a lot less power than the speakers. Because of this almost any headphone can be driver from a home audio amplifier.
Mobile devices running on batteries cannot deliver so much power and voltage so overloading is less of an issue. Since the output voltage on these devices is limited I recommend using low impedance headphones, 30 or 50 ohms would be a good choice.
In either case, you do not have to worry about impedance matching, it is really a non-issue for headphones.
Sidenote:
For speakers the output impedance of the amplifier is relevant. The usual recommendation is that the amplifier needs a low output impedance. The lower the better as that will give it better "control" over the speaker. This is not impedance matching, it is actually a "best mismatch" situation as amplifier output impedance ( < 0.1 ohms) and speaker impedance (> 4 ohms) are not the same.
|
H: Why does this DC motor have such a wide range of power?
This DC motor has a power range of 9.0W-300W, while its voltage range is from 6 to 20 volts. Does this mean that its internal resistance is somehow dependent on the load? Or does the user determine the actual power with using a resistor in the circuit?
Performance Table
MODEL ---- VOLTAGE ---- -- NO LOAD --- ---- AT MAXIMUM EFFICIENCY ----- ----- STALL ------
OPERATING NOMINAL SPEED CURRENT SPEED CURRENT TORQUE OUTPUT TORQUE CURRENT
RZ-735VA RANGE V r/min A r/min A mN·m g·cm W mN·m g·cm A
9517 6 - 20 18 20400 2.8 17990 20.9 149 1523 281 1265 12895 156
AI: Yes, of course the effective resistance of the motor depends on the load. This is true of all motors.
When a motor is lightly loaded, it generates a high level of back EMF, which opposes the flow of current. You can think of this as a high effective resistance, although the actual resistance of the coils doesn't change. What is actually changing is the net voltage (= source voltage - back EMF) across that resistance.
When a motor is heavily loaded, the back EMF is reduced, allowing more current to flow. This decreases the effective resistance by increasing the net voltage across the internal resistance of the motor.1
The wide range of power ratings for this motor indicate that it is both efficient (low power consumption at low loads) and robust (can handle the current associated with high loads).
The methods for controlling a motor depend on how you're using it. If you're primarily interested in controlling its speed, you regulate the voltage, allowing the current to vary (within limits) with the load. If you're primarily interested in controlling its torque, you regulate the current, and the voltage varies with load. A resistor is NOT a particularly useful way to accomplish either of these.
1With AC (e.g., induction) motors, the situation is a bit more complicated. The magnitude of the back EMF doesn't change as much as its phase relationship to the source voltage. This still has the effect of increasing the net internal voltage.
|
H: Negative Voltage Generator for Low Voltage ( +1V ) Input
I am working on an analog circuit. I can only use a +1V power supply. My design requires a negative rail, so that my level shifter will work.
Attempts:
I have already seen Build Your Own Negative Voltage Generator
and I cannot use this because a diode would eat up 0.7 V. A Schottky would still eat up ~0.1 to 0.3V.
I need some way to get a near perfect way of converting input +1V to a ( -0.9 to -1 V ) output.
AI: Most analog circuits work better on a bit higher voltage than 1V. If you use a single cell charge pump or inductor step-up to, say, 2.7 or 3.3V then you can use an inverting charge pump to get -2.7 or -3.3V. Of course the current draw will be multiplied by the voltage ratio plus losses.
Eg. LTC1502-3.3 + LM2776.
|
H: Why does a Solenoid driven with intermittent duty cylce produce higher force than with continuous drive?
I'm selecting some solenoids with my MechE and I noticed something that I didn't have an intuitive explanation for.
We were looking at this solenoid and noticed that at the bottom the forces available were higher when used with intermittent pulsing instead of continuous pulsing. We haven't been able to explain to ourselves why this is the case. Any guidance?
AI: You are missing the fact that the bottom lines are for the two different types.
Figure 1. The yellows are related. The blues are related. [Colouring mine.]
The problem with solenoids is thermal management. The intermittent units have resistances of one quarter that of their continuous counterparts and a power consumption (and dissipation requirement) of four times that of the continuous.
The intermittent solenoid therefore can give a little over three times the force of the continuous units but only for 5 s at a time. 25% duty cycle implies that you'll need to wait 15 s after a 5 s on time before retriggering.
|
H: Solvng transistor circuit
The transistor circuit in shown in the schematic I have included:
simulate this circuit – Schematic created using CircuitLab
I have tried solving it like this:
First I calculated the potential at node A by applying voltage divider law:
V(A)=(680/680+4.7)*20. The answer is 19.86V.
Now, applying KVL in input loop:
19.86=Ib*R2+0.7V. And this gives the value of Ib to be 0.028mA.
But my text book has the value of Ib=15.45 microA. Why am I getting this much difference in the base current?(Which ultimately causes lots of difference in collector current if gain is high). This is how the textbook has solved it:
I dont know where I am getting it wrong. Would be of great help if someone corrected me. Thanks in advance...
AI: 19.86=Ib*R2+0.7V. And this gives the value of Ib to be 0.028mA. But my text book has the value of Ib=15.45 microA.
If only it was a simple potential divider.
Why am I getting this much difference in the base current?
Because, as you start drawing base current the collector current rises and drags down point A to a lower value. It's not just a simple potential divider in that respect.
You could iteratively solve this by recalculating the collector voltage to use in the "next step" - clearly it would be lower than 19.86 V and this would lead to a lower base current and that in turn would lead to a lower collector current.
Iterate a few cycles and see what you get. I might suggest you use a spreadsheet.
|
H: Can I get away with that poorly designed board?
I am designing a board but space is not a luxury that I have at the moment, can I get away with that design or I must use a SMD resonator?
AI: You could "Get away" with a design like this. A good clock design keeps the traces as short as possible, and the capacitors and traces symmetrical to keep the parasitics equal. A copper pour can also be a good idea on the top layer around the components to increase capacitance to ground, and shunt high frequency signals to ground.
The biggest problem with crystals is radiated emissions, and depending on the country your in this could be a problem. It's best to use good clock design practices to avoid problems.
One thing you might be able to do is mount the crystal on the other side of the board to decrease spacing.
|
H: Simple phasor problem with AC
Simple problem that I can't solve.
On this AC circuit, find the current read by ammeter \$ A_3 \$ (the one in series with the resistor) given that \$A_1\$ reads 4A and \$A_2\$ reads 3A, assuming every current is read by its RMS value.
There are no given values for resistor and capacitor, but the textbook answer gives that \$A_1\$ reads 2.65A Here's what I've tried :
Since we're in AC, I figured voltage lags in the capacitor, so current must lead by 90 degrees. I tried using Kirchhoff's law with phasors in mind to find \$I_3 = I_1 - I_2\$ which would give \$4e^{j0} - 3e^{j\frac\pi2} = 4 - 3j\$.
However, the magnitude of this phasor is \$5\$, which is greater than the magnitude of \$I_1\$, which is impossible, since there are no current source in branch 2.
What am I missing? Thank you
AI: You are correct that the resistor current and capacitor current are out of phase by 90 degrees, but in your solution you assumed that the total current and the capacitor current are out of phase by 90 degrees.
The current through \$A_1\$ is the total current and the current through \$A_2\$ is 90 degrees out of phase with the resistor current. If you draw the phase diagram \$A_1\$ is the hypotenuse. Can you use geometry and take it from there?
|
H: Can't seem to make IDC connectors work
I feel a bit silly here. I managed to build a complex multi-board block of digital logic, but I can't figure out how to plug in a wire...
My plan was to buy a simple set of standard square-pin connectors, solder those to my PCB, and then connect to it with some ribbon cable. Well, I mean, I need 4 wires, so actual ribbon is maybe excessive. I thought I could just poke 4 separate wires on there.
Anyway, I purchased some 4-pin headers, and some 4-pin IDC plugs. Reading Wikipedia, I was under the impression that "IDC" means you just mash the wires in there and the blades are supposed to cut through the insulation, but... well, I can't get it to work at all.
I tried just smooshing the wire in there, but it easily falls out again. I tried pressing it down with the end of a screwdriver, but it still comes out, and the insulation is clearly still perfectly intact. Heck, I even tried stripping the ends of the wire and soldering it in there, but that didn't work either.
Am I supposed to use some kind of special tool to insert the wires or something?? How is this stuff meant to work?
The actual item in question is
https://uk.farnell.com/amp-te-connectivity/3-640440-4/housing-22awg-4way/dp/1098455
It plugs into the header just fine, but I can't figure out how to put wires into it. Supposedly it works with "AWG 22" wire, and the datasheet for my wire says it's "AWG 23", which I believe is meant to be thinner, so...
AI: Yes, for this particular type of connector you need a special tool, like a screwdriver blade with two cuts. Something like this one:
Here is a home-made punch tool, using a flat-blade screwdriver and Dremel with thin diamond cut wheel:
|
H: Choosing a motor to lift window blinds
I'm looking to raise my blinds every morning
using an rpi/Arduino and a motor. The blinds are lifted by a cord that loops near the bottom. I've checked that the cord requires about 20N force to pull down, and the gear turning the cord loop at bottom will have a diameter of 6 cm.
Which motor should I buy?
Min torque needed ~ 20*3 = 60 Ncm.
Min speed ~ 20 rpm
AI: You can choose any miniature DC gear motor with a suitable torque with a down limit stop switch and DPDT relay to reverse with another up limit stop switch. (mechanical or opto). The coil can be a latching or non-latching type relay with snubber reverse diodes across coil and contacts to driving voltage.
Alternatively you can ramp the voltage slowly to limit start acceleration current from 8x down to 1x then detect some current rise sensed to stop immediately and latch off logic that drives a dual FET bridge that acts as a DPDT switch. This protects the cable from excess force in the up direction but not the down direction where a limit switch is still needed unless you detect a very slight rise in current at the end of travel due to lack of gravity pull.
|
H: Getting Rid of Annoying Buzzing Sound from Multimeter
my multimeter has been bugging me with this buzzing sound that turns on and off while I'm using it. I think it has something to do with its autoranging feature, but I couldn't find the manual for this one and have a mind to get rid of the buzzing if it won't stop.
The model is a Craftsman 19736. I opened it up and discovered the culprit: a spinning thing with a blue and red wire going to it in the back case. Do you know what it's for and if it's OK to remove?
AI: Page 21 of the user manual states:
WRONG CONNECTION INDICATION
The [buzzer] icon will appear in the upper right corner of the display
and the buzzer will sound whenever the positive test lead is
inserted into the 20A or uA/mA input jack and a non-current
function is selected. If this occurs, turn the meter off and reinsert the test lead into the proper input jack for the function selected.
You can disconnect it or just avoid having the leads in the wrong socket.
|
H: Blue wire in logisim
I created this circuit and at first all the wires were green but when I copied it out of the main folder into another one, the wires turned blue. I've tried messing around with it and looking up what the problem is but I cannot find a solution. The exact same circuit was working before and I don't understand why the wires are blue which are coming directly from the pins, they should definitely be green.
AI: Blue is the default colour of a wire in Logisim. It is blue because the simulation is not currently running, or there is no connection to a component's output on the wire, so no value is known for the wire.
They were originally green because you had a simulation running; during simulation they turn bright green to signify a logical 1 condition or dark green to signify a logical 0.
See this description of colour coding of wires in Logisim.
|
H: How do I identify a what kind of power connector for AC mains is on a product?
I see an AC mains input but I have no idea what kind of cable it goes to, how do I find the cable type so I can design around that? (Or conversely I have a cable and I don't know what type it is)
AI: Look for IEC320 reference tables, the connector should match one of the international standards. Once you identify the connector you can search for it. If not, it is a custom cable and the manufacturer will need to be contacted.
The first edition of IEC 320 (later renumbered IEC 60320) was
published in 1970.
Source: Wikipedia
This is what a table looks like
Source: https://www.stayonline.com/reference-iec320.aspx
Edit:
Another good resource https://www.plugsocketmuseum.nl/ApplConn_overview.html
|
H: Why is it bad to have an inductive load (context: dc-dc converter)?
In the book I'm studying from Power Electronics - Mohan he says:
(...) has two drawbacks (1): In practice the load would be indictuve.
Even with a resistive load, there would always be certain associated
stray inductance (...)
This is in reference to a basic buck converter where for the sake of simplicty he explained the operation using a very basic circuit:
Then, he said what I just quoted. He said that an inductive load is a drawback. Not only here, but in previous chapters they speak contemptuously about inductive circuits in general. So, my question: why is it so bad to have an inductive circuit or an inductive load in general (they can't be bad always, can they?)?
AI: It's actually an issue with reactive loads in general, although inductive loads are the type most commonly seen in industrial applications (lightly-loaded motors, etc.)
With a resistive load, the current always has the same polarity as the voltage, and this assumption vastly simplifies the design of power circuits in general.
With a reactive load, the inductance or capacitance sometimes returns energy to the source, which means that the current can have the opposite polarity from the voltage at times during the AC cycle. This is much more difficult to handle in a power circuit.
Sometimes it's well worth the extra effort — for example, in an electric vehicle, the same power circuit can handle driving the motor from the battery as well as the regenerative braking.
|
H: Logic Level Converter (3.3v <-> 5.0v) returning HIGH for Low Volt. & High Volt. sides when nothing is plugged in. [Raspberry Pi]
The Goal
I have a Raspberry Pi that I'd like to control my treadmill with. The Pi's GPIO ports output 3.3v and the treadmill's motor control board only takes 5v signals. Because of that, I bought a bi-directional logic level converter.
The Problem
You can imagine how bad it would be if I hooked up my Pi to the treadmill, and off-the-bat, the treadmill is receiving a solid 5v to the speed wire. I want to avoid that.
I've hooked up the LV to 3.3v and HV to 5v and attached grounds on both sides of the logic level converter. Now, right off the bat, touching my multimeter to Ground + LV1 shows 3.3v. Worse, touching HV1 shows 5v (meaning the nightmare scenario would have happened if this was plugged in.)
I recorded a video of me touching different parts of the converter and saying the results.
Things I've gathered this far.
If the Raspberry Pi's GPIO is not explicitly programmed to output a HIGH or LOW signal, it becomes like an "antenna". I've learned luckily that setting a pin explicitly to LOW and plugging it into LV1 will output 0v on HV1. The problem is that the Pi takes time to boot and launch my program, so I fear if a restart were to occur, the treadmill would receive full 5v to speed for 30 seconds while it booted.
Extra details
For this project, I have four wires I'm connecting from my Pi to the Treadmill: Incline Up, Incline Down (both take a solid 5v signal to activate), Speed (PWM 5v signal), and a tachometer(?) wire (diagram said it could be used to track footsteps.) Of these 4 wires, 3 of them are outputs and 1 of them are inputs.
Any advice is appreciated, thank you for reading this far!
AI: Add a pulldown resistor (a 1k or so resistor to ground) to each input of the level shifter that you need to protect from erroneous activation. As a result, when the Pi is not driving the line, it defaults to logic low, and the level shifter outputs will only be high when the Pi is actively driving the corresponding inputs high. When high, about 3.3mA will be drawn from GPIO pins to overcome the pulldown, which is within recommended limits.
Note: The level shifter includes its own pullups (which cause the output to default to high), with value 10k. When the signal is low, both pullups on each channel need to be overcome (the LV pullup directly, and the HV pullup because the FET will conduct).
Your pulldown resistor should have a value that is small enough to be able to overcome these pullups.
|
H: 48VAC analog waveform
I want to make a circuit to drive out a 48VAC 10mA 60Hz sine wave signal.
I was thinking that I could generate a waveform with a microcontroller to feed it to an opamp then to a audio transformer
Would this work?
I wanted it to he handheld, so I was thinking about sourcing the circuit with a battery. Haven't thought to much about the size.
AI: You're asking a broad question, so here are some broad comments in response.
You have a load of approximately 4800 Ω and you want to drive about 480 mW into it. Sounds reasonable.
You can easily get low-cost prebuilt modules to do both functions: DDS modules will synthesize your sine wave, and audio amplifier modules can provide the needed power level.
The only detail is that audio power amplifier modules are generally designed for low output impedances (in the range of 4 to 16 Ω or so). An easy way do deal with this mismatch is to use a transformer.
A small power transformer with a 24:1 voltage ratio will provide approximately the 600:1 (\$\frac{4800 \Omega}{8 \Omega}\$) impedance ratio you need. For example, if you can find one with a 120V primary and a 5V secondary, you'd be all set — just hook it up in reverse. A commonly-available 6.3V transformer would probably be close enough; just turn the gain on the amplifier up a bit.
An audio transformer with the required impedance ratio would also work, but would probably be less efficient at 60 Hz.
|
H: How do AC adapters achieve low current?
The image above shows how a typical AC to DC adapter works, high voltage (230V) at low current is fed into the primary coil and then gets stepped down to a lower voltage with higher current, afterwards it gets rectified to DC and finally a capacitor turns this DC to pure DC.
The power from the primary coil has to be the same as the power at the secondary coil (assuming no power loss). Let's for instance use an example, a phone charger, most phone chargers normally output 5V@1A DC which means 5W. Since the voltage from the wall is 230V this means that for there to be 5W there has to be 5W/230V = 0.0217A which means that the resistance at the primary coil is 230V/0.0217A = 10599\$\Omega\$
This is the part that I don't get, how can an inductor (coil), something with almost no resistance, have so much resistance. At first I thought that they would put a resistor before the coil but then I figured out that all the power would be used up by the resistor and wasted as heat instead of reaching the coil.
So what is really going on? Do they make these coils with materials that have really high resistance or am I missing something? Probably the latter is true.
Any help is appreciated.
AI: The following approach may also help a little
The ohmic resistance of an ideal coil is 0 ohm in DC, but in AC the coil resistance is called inductive reactance and its amplitude can be calculate by the following formula:
\$X_L=2 \pi f L\$
Where:
\$X_L\$ is the Inductive Reactance of the coil (in your case the primary of the transformer) in Ohms
\$\pi\$ =3.14
f= frequency of the AC signal (probably 50 Hz in you case)
L=inductance of the coil measured in Henries
An inductor or coil is a device that, when subjected to an increasing electrical current flow, generates a back voltage that opposes this current. Inductance quantifies how much energy an inductor can store
Please note that heat losses in a non ideal transformer are made by the wire resistance and by parasitic currents the transformer core and not by XL.
|
H: Connecting a polyfuse (PTC / resettable fuse) without soldering
I want to connect up a polyfuse to protect a potentially flammable USB cable and a Raspberry Pi Zero in the circuit below. However it seems that most Polyfuses are supposed to be soldered and I'd much rather avoid doing that.
Is there any way to hook up a Polyfuse without soldering it, specifically with regard to the circuit above.
AI: You can use a barrier terminal block and a leaded polyfuse.
Just put the polyfuse leads under the screws on one side and the wires on the other side. Shrink wrap or sleeving on the leads wouldn't hurt, and they should be trimmed so they are not excessively long.
Here is a different type of terminal block that works the same and some components are shown.
|
H: Can a short circuit in the output of a transformer be dangerous?
Assume that I have a 220 to 12 volts transformer with a nominal output current of 3 A (marked "12 V 3 A"). Now what does happen if I connect the two output wires to each other or to a load with very low impedance? Does the current exceed 3 A by a large margin? I don't think so. But is the secondary coil designed to withstand such currents? If the temperature gets too high, the insulation of the coil wires would be damaged, which is obviously dangerous.
AI: If you short the output of a good/efficient transformer, the secondary current will be very high, and the transformer will likely overheat and be damaged.
However, there are intentionally lossy ("impedance protected") transformers that will limit the load current to a safe value to prevent damage to the transformer in case of short circuits or overloads (often used to power doorbells and similar applications).
|
H: What will happen when taps at secondary side of auto-transformer are connected together (short-circuited)?
In case of Auto-transformer, there is only one winding, having three lead wires (1 for primary/input, 1 for secondary/output, and 1 common between both). At the secondary side (the output side), there are taps (sort of voltage dividers).
I have a auto-transformer with input at 220 V, and i have taps at the secondary side at 200 V and 240 V (only mentioning my required taps, there are many).
My question is, what will happen if the taps at the secondary get short-circuited (200 V tap and 240 V tap gets short)?
What will be the effect of this incidence on primary voltage and secondary voltage?
Will transformer be okay? it won't get damage or something??
AI: If you put a short circuit across a portion of the winding of an autotransformer, that portion of the winding will pass excessive current, and may be damaged - just as if you had shorted turns in either winding of a normal transformer.
|
H: What to use to crimp a resistor onto 18awg wire
I want to crimp a resistor like the one below onto 18awg wire without soldering...
I've seen that bootlace ferrules like the photo below can possibly be used to do this but if I buy 22-24awg sized bootlace ferrules then the 18awg wire won't fit. And if I buy 18awg sized bootlace ferrules I'm concerned it won't properly crimp the resistor in place.
What is the best solution to achieve a connection between the resistor and 18awg wire without soldering them together?
AI: A ferrule is NOT a reliable or permanent crimp device for your application. The metal walls are far too thin.
Try it: crimp two resistors in a ferrule. Bend them at right-angles to each other and try to spin them inside the ferrule. You will find that they spin quite freely.
What DOES work reliably is the barrel from a standard non-insulated crimp terminal. Find a crimp terminal that both wire fit inside and cut the terminal portion away from the barrel. Put both wires inside the barrel and crimp with a proper crimp tool.
This makes a permanent, gas-tight connection that will last for decades.
FWIW - my preferred crimp style for non-insulated barrels of this type is known as a "W" crimp - so-called because of the "W" shape left in the barrel after crimping. The AMP Certi-Lok tool with the "W" crimp die-set is one popular choice.
Almost as good is the T&B "StaKon" crimp tool that electricians use - the small crimp nest works well for barrels up to 16 AWG, the large crimp nest works up to 10 AWG.
Finally, if you don't have any non-insulated crimp terminals handy, just remove the plastic insulation from insulated terminals. The barrel is pretty much exactly the same as the non-insulated terminal.
|
H: Non excited synchronous motor
I was looking for a synchronous motor for my rotary spark gap. On this page I found what I need. http://www.tb3.com/tesla/sparkgaps/1800srsg/1800srsg.html
But the motor model is not 100% same on the web page the motor is a (SHINANO TOKKI X7807-202V) and I have (SHINANO TOKKI X7807-015V) the guy is explaining how to determine if a motor is synchronous or not, with a fluorescent light and white plastic tube on the motor shaft (please visit the website so you understand what I mean) I don't have a fluorescent light lying around, so I can't determine if my motor is synchronous.
May question.
Is there other methods for determining if a motor is running synchronous.
AI: You could make yourself a simple strobe with a couple of LED that would work like a flouro tube.
simulate this circuit – Schematic created using CircuitLab
R2 would need to be a 2W resistor, R1 a 1/4W
Di1 is a 7-9 volts DIAC BSOD-T112 from Digikey
D1 and D2 could be any LED with a VF @ 20mA of around 2.2-2.6V. You probably can't use White LEDs.
The conduction angle for the LEDs should be about 45-50deg.
At 50Hz you get 100Hz strobes and at 60Hz you get 120Hz strobes.
|
H: What limits the number of buses, devices and functions on a PCI bus?
I am learning the PCI/PCIe bus. I learned that:
A PCI hierarchy can support at most 256 buses.
A PCI bus can support at most 32 devices.
A PCI device can have at most 8 functions.
I checked the Configuration Header Type 0.
There's a Device ID field which spans 2 bytes. 2^16 is much greater than 256.
So where do the 256, 32 and 8 restrictions come from?
AI: I found an answer:
In addition to the normal memory-mapped and I/O port spaces, each
device function on the bus has a configuration space, which is 256
bytes long, addressable by knowing the eight-bit PCI bus, five-bit
device, and three-bit function numbers for the device (commonly
referred to as the BDF or B/D/F, as abbreviated from
bus/device/function). This allows up to 256 buses, each with up to
32 devices, each supporting eight functions.
|
H: Can two normal batteries be connected by series and parallel, at fraction of second apart, so as to charge and discharge at the same time?
Two ordinary wet cell batteries can either be connected by series or by parallel.
What happens if I have a contraption that enables these connections to alternate between series and parallel cycles in such a way that, in one cycle (first cycle) it connects these two batteries in series. In the next cycle (second cycle) it connects these two batteries in parallel connection.
The contraption moves fast (30 - 100 times per second) between series connection and parallel connection so that it becomes almost series/parallel "at the same time".
Can these two batteries in the first cycle (series) be arranged to discharge the battery and in the second cycle (parallel) be arranged to charge these two batteries?
If so, can we have the possibility of a battery system that can charge and discharge "at the same time"?
AI: There are components available to switch batteries between series and parallel.
However, there are no problems for which that is the best solution.
Matching voltages by dynamic series/parallel connection is far better done with a buck or boost SMPS converter. The effect of charging/discharging 'at the same time' is better done by powering the load directly, and making up the balance of the power flow to or from the battery, using voltage conversion as required.
|
H: How to fix a PCB inside this enclosure?
This is a related question to How to fix this in an enclosure without glueing.
However, for a protoboard/PCB, how could I attach it to the enclosure? The bottom of the enclosure has holes for attaching, but it doesn't have screw thread. How should these holes be used and how can I attach a PCB?
Glueing is not what I want, in case I want to add/change components on the protoboard later.
AI: The small standoffs molded into the bottom of that plastic box can be used with the proper sized metal machine screws. The screws will cut their own thread in the soft plastic. There are several things to consider:
Make sure to select the proper diameter machine screw.
Make sure to select a machine screw that is not too long. If too long it can bottom out in the hole and strip (see next item) or even make the plastic in the other side have a bump out.
Use care to not over torque the machine screws. It is relatively easy to strip out the holes.
When re-mounting an item and re-using a mounting hole that was previously threaded use care to try to get the screw thread to reengage the existing threads instead of trying to form new ones.
|
H: MCU with single external clock pin
I am selecting an MCU (EFM8BB10F2G-A-QFN20 Datasheet here) for one of my projects and I found a strange thing. This MCU has only pin for external clock source:
Till now, I have never encountered this case. In every other MCU I have used, there were two pins for connecting an external crystal. How can I use a crystal in this case?
AI: You can't (directly). The datasheet clearly states on the first page:
Clock Sources:
• Internal 24.5 MHz oscillator with ±2% accuracy
• Internal 80 kHz low-frequency oscillator
• External CMOS clock option
What you can use is a crystal oscillator (ie. crystal + active circuitry in the same component).
|
H: Does a soldering iron tip consist of multiple parts?
I recently purchased a new soldering iron and read here that it is good practise to tin the tip before actually using it. As I turned on the iron and applied solder to the tip, I noticed the very top of the tip accepts solder perfectly fine, but the lower parts have solder just run off.
When the iron cooled back down, I noticed the top of the tip looked nice and shiny, whereas the lower parts of the tip have blackened. I am unable to remove the blackened color with a damp sponge.
The separation between the top of the tip and the blackened part is a distinct straight line, so I assume it is made of a different material or coating.
I am therefore wondering whether what I observe with this new tip is normal? I'd like to maintain this tip as well as possible, so am wondering whether it is good practise to store the tip like this (top part tinned, lower part blackened)? Or do I need to maintain it in a different way? I have read through the questions on tip maintenance but could not find anything similar to what I've observed here.
The soldering iron works perfectly fine, I am just worried about the blackening of the base of the tip.
The soldering iron is a TS100 and the tip is a B2. (https://www.amazon.de/gp/product/B072LR7DV6/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1)
AI: The delineated part that accepts solder is the part you use. The rest is just there to transfer heat to the working tip. It is good that it does not accept solder, because that avoids having stray blobs of stale solder hanging off the tip that aren't what you are actually trying to work with and might make a mess.
The un-tinned part will get dark and ugly looking with use. This is normal and harmless. I wouldn't expect to see necessarily that dark a color on a new tip, but it doesn't look unreasonable and your attempts to tin it might have contributed (burnt flux?).
|
H: TP4056 & resistor at VCC
Could someone please explain me what is the 0.4Ω resistor at the Vcc pin (yellow color)? Why it is surrounded by a dashed rectangle? Should I add such kind of resistor when I design my circuit?
AI: If you leave out the resistor and charge a battery with 1A (maximum current that the TP4056 can do) then the TP4056 will have to dissipate: 5.0 V - 4.0 V = 1.0 V * 1 A = 1 Watt (I'm assuming about 50% battery charge so 4.0 V). That's a lot for such a small SOP package and the TP4056 will get quite hot.
If it gets too hot it will lower the current but then your battery will charge slower.
This is where the 0.4 ohm resistor comes in, it will drop 1 A * 0.4 ohms = 0.4 V. That means the TP4056 will now only need to drop 0.6 V. At 1 A that means 0.4 W is dissipated by the resistor and " only" 0.6 W needs to be dissipated by the TP4056. This might be just low enough for it not to become too hot.
So if you are going to charge your battery with about 0.5 A to 1 A, then I would add the resistor.
If you're going to charge your battery with less than 0.5 A you can probably safely leave out the resistor.
Oh the dashed rectangle: it means that this resistor will get slightly hot and to cool it it is advised to keep other components out of the way and using somewhat larger copper areas on the PCB connecting to the resistor is advised as that helps to keep it cool.
|
H: IN/OUT pin of the crystal circuits
Got few questions about the input/output pins of a crystal circuit.
As shown above, it's a common clock circuits.
My question is:
1. If we want to measure the waveform of the clock, which pin should we probe and why?
2. In the internal circuits inside the IC, which signal (IN or OUT) is used for the clock source of the internal circuits and why?
Thanks!
AI: You should measure the waveform from the OSC_OUT pin as that point is driven by the amplifier. Then adding some extra loading on that pin (the loading of the probe you will use to measure the voltage) is not an issue.
If you measure at OSC_IN you could be unlucky and disturb the circuit so much that it stops oscillating !
The internal circuit should and will do the same as you should so use OSC_OUT. That pin will not be used directly though there will always be additional buffer circuits present to feed the signal to all other circuits.
|
H: switch 3 references voltage for my servo position
I have some positioning servo driver and servo with pot feedback.
Now I try to build circuit to switch between 3 positions. For testing I just use 3 way switch and 3 pots as voltage reference, but in my destination project my switch will by 10 meters away from servo and driver so current circuit may be noisy. So can I build this without passing ref. voltage thru switch? Or using buttons?
AI: Your servo remains in an undefined state if all three switches are open-circuit. A simpler arrangement using two switches leaves the servo at its mid-position in a fairly low-noise condition, because both remote switches are open-circuit.
R1 defines the default state, while R2 pulls up toward +5V, and R3 pulls down toward ground. The switch chip and variable resistors can lie close to the servo, while the logic control signals can be remote. Be aware that the switch chip requires a logic supply and ground connection (not shown).
simulate this circuit – Schematic created using CircuitLab
If you really need the servo in an undefined state, a quad-switch like 74HC4066 can be used (one-of-four unused). As before, control signals can be remote, while analog servo voltages can be more closely associated with the servo:
simulate this circuit
|
H: Voltage of Different Voltage Sources in Parallel with Diodes
I am working on a project in which I will have two different power sources, which I will have to dynamically switch between to supply power to devices. These two power sources will likely be similar in voltage, but may vary slightly.
I figured that the best way to approach this would be by putting the voltage sources in parallel, but if there is a difference in voltage, current will flow between the sources, which is not what I want. I then had the idea to place a diode in series with each source before they are connected, to ensure current does not flow between them (Both sources are DC). I don't see why this wouldn't work, but what would the voltage be of the sources in parallel?
AI: The higher voltage of the two sources minus the diode voltage drop.
|
H: Two-port model of a BJT
In electronic books, the small signal model of a BJT is given as:
I've just studied two-port networks theory and, as an application, another book I'm reading shows this picture:
1st question: why do we have a voltage-controlled voltage generator on the left (which is absent in the first image)?
2nd question: why do we have a current-controlled current generator on the right? I've been always told that the BJT is a "transconductance amplifier" (= collector current is controlled by the base-emitter voltage, not by the base current, as shown indeed in the first image)
Thanks
AI: There are many models for transistors. We usually try to make them as simple as we can.
The first illustration uses rin and \$g_m\$ as the principal parameters. As these are dependant on bias point, this model is most useful for AC amplifiers with a relatively fixed bias point.
The second model includes all four hybrid parameters. These are useful over a wide range of current. The \$h_{re}\$ term is rarely big enough to be a problem, I've never needed to include it for practical amplifiers, only when answering homework questions. You would use this model when designing low frequency amplifiers, and biassing transistor amplifiers.
Or for RF and microwave amplifiers, abandoning the component model based approach completely and using S-Parameters works best. Again these are bias dependent.
Note that in all cases, the transistor does what the transistor does. All that changes is which of its features we choose to model, and which we choose to ignore. All models are wrong, but some models are useful.
|
H: Using MOSFET to turn on/off auxillary electronic circuit
I have custom-build e-bike which is basically a motor, battery, controller and an LCD screen with 3 buttons. When I push ignition button, the LCD sets voltage on one of it's signal wires (blue) to 51 - 67.2V (BAT+, depending on battery capacity) which is then wired to the controller.
I would like to sense voltage on this ignition wire and switch on/off an external dc-dc converter (8-72V to 5V5A) in order to charge my phone while riding a bike. One downside is that I can't pull too much current on this signal wire - dc converter need to be wired directly to the battery by mosfet or something else.
After 3 minutes of idle, LCD automaticly turns e-bike off (0V on ignition wire) which is okay, i want to charge my phone only while riding.
I need a solution that uses no power when switched off in order to not drain the battery.
I'm thinking of using a MOSFET as a switch where this ignition wire would be connected to the gate of MOSFET. As far as I understand I need a MOSFET with Vgs of at least 67.2V? Could anyone point me at a right mosfet? Wiring schematic and any tips on this would be great too. Thanks!
PS. Added schematic of my wiring
AI: Use a relay, like this one.
It can handle 72V.
|
H: Including one module in another module with variable
I need to implement this code to synthesize and do so that xor21 and and21 will work separately.
module top(
input a, b, x,
output c
);
always @(a or b or x)
begin
if(x)
xor21 x1 (.a(a), .b(b), .c(c));
else
and21 a1 (.a(a), .b(b), .c(c));
end
endmodule
However, I get the following error:
ERROR:HDLCompiler:1575 Instantiation is not allowed in sequential area
except checker instantiation
How do I go about designing this?
AI: You need to go back to basics.
Verilog is a hardware description language, not a programming language. Your code is describing hardware.
Let's see what your code is trying to infer:
module top(
input a, b, x,
output c
);
Ok, we have a module. That's all fine. Now what does it do?
always @(a or b or x)
begin
if(x)
xor21 x1 (.a(a), .b(b), .c(c));
else
and21 a1 (.a(a), .b(b), .c(c));
end
That code says "Whenever a, b, or x changes: If x is high, instantiate a new piece of hardware called xor21, otherwise instantiate a different piece of hardware called and21".
Hmm, that means that if the value of x changes, bits of your hardware suddenly disappear, and other bits of hardware appear from nowhere. This cannot happen. The whole design needs to be known when the design is synthesized.
In otherwords, you cannot instantiate a module in a procedural block.
Instead, you need to think about what you hardware you need. You decide, well I need an and21 module, and an xor21 module. So lets instantiate one of each:
module top(
input a, b, x,
output c
);
wire xor21_output;
wire and21_output;
xor21 x1 (.a(a), .b(b), .c(xor21_output));
and21 x1 (.a(a), .b(b), .c(and21_output));
Cool. Now we have a our module, and it contains our two submodules. Now we need to work out the behaviour of the output c.
Well, if x is high, we want the output from xor21, and if x is low, we need the output from and21. So that means we need a multiplexer. Well, we can either do this in continuous assignment using the ternary operator (?), or we can use an always block. Let's look at both. First the ternary:
assign c = x ? xor21_output : and21_output;
Then the always block (see note):
always @ (x) begin
if (x) begin
c = xor21_output;
end else begin
c = and21_output;
end
end
And voila. We now have a module with the required behaviour, in which the required hardware is known when the design is synthesised.
(note) - if you are assigning a value in an procedural block (such as always or initial), the target must be a storage type, such as reg. You cannot assign a wire type in a procedural block. So we would have to change the module definition to output reg c.
|
H: 1 Byte Register broken into 2 Nibble outputs not working VHDL/ModelSim
I have made a 1 byte instruction register in VHDL. Instead of having a 1 byte output, I have created an upper nibble output and a lower nibble output. The lower nibble output is special because it uses a tri state buffer. It has this because it connects to the main bus. The upper nibble does not as it feeds directly to the control circuit and does not need high impedence. For some reason, I can't get the lower nibble to output anything. The upper nibble seems to work fine.
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL; --This is required when doing additions to STD_LOGIC_VECTORs
ENTITY INST_REG_SAP_1 IS
--LiN is the load signal. It is active low
--Clk is the clock for the register
--Din is the register input bus
--EiN is the enable signal for the low nibble.
--HighNibble is the high nibble output
--LowNibble is the low nibble output
PORT(
LiN, Clk, EiN: IN STD_LOGIC;
Din: IN STD_LOGIC_VECTOR(7 DOWNTO 0);
HighNibble: OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
LowNibble: OUT STD_LOGIC_VECTOR(3 DOWNTO 0));
END INST_REG_SAP_1;
ARCHITECTURE Behavioral OF INST_REG_SAP_1 IS
BEGIN
PROCESS(LiN, Clk, EiN)
VARIABLE tempLowNibble: unsigned(3 DOWNTO 0);
BEGIN
IF(rising_edge(Clk)) THEN
IF(LiN='0') THEN
HighNibble<=Din(7 DOWNTO 4);
tempLowNibble:=unsigned(Din(3 DOWNTO 0));
END IF;
END IF;
IF(EiN='1') THEN
LowNibble<=(OTHERS=>'Z');
ELSIF(EiN='0') THEN
LowNibble<=Std_logic_vector(tempLowNibble);
END IF;
END PROCESS;
END Behavioral;
Here is the testbench
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity TB_INST_REG_SAP_1 is
end TB_INST_REG_SAP_1;
architecture test of TB_INST_REG_SAP_1 is
--create time constant
constant CLOCK_PERIOD: time:=2 us;
--create signals for every port
signal Clk: std_logic;
signal LiN: std_logic;
signal EiN: std_logic;
signal Din: std_logic_vector(7 DOWNTO 0);
signal HighNibble: std_logic_vector(7 DOWNTO 4);
signal LowNibble: std_logic_vector(3 DOWNTO 0);
begin
dut: entity work.INST_REG_SAP_1
port map(Clk=>Clk,
LiN=>LiN,
EiN=>EiN,
Din=>Din,
HighNibble=>HighNibble);
--simulate the clock
ClkSimulation: process
BEGIN
FOR count IN 1 TO 32 LOOP
Clk<= '0';
wait for CLOCK_PERIOD/2;
Clk<='1';
wait for CLOCK_PERIOD/2;
END LOOP;
END PROCESS ClkSimulation;
--simulate the load (LiN)
loadSimulation: process
BEGIN
LiN<='1';
wait for 4 us;
LiN<='0';
wait for 4 us;
LiN<='1';
wait for 4 us;
LiN<='0';
wait;
END PROCESS loadSimulation;
--simulate the Low Nibble Enable (EiN)
enableSimulation: process
BEGIN
EiN<='0';
wait for 20 us;
EiN<='1';
wait;
END PROCESS enableSimulation;
--simulate the Din
DinSimulation: process
variable temp: unsigned(7 DOWNTO 0);
BEGIN
Din<="10000000";
temp:="10000000";
wait for 4 us;
FOR count IN 1 TO 8 LOOP
temp:=temp+1;
Din<=Std_logic_vector(temp);
wait for 4 us;
END LOOP;
wait;
END PROCESS DinSimulation;
end architecture test;
Here is the output. Notice no output from the lower nibble.
AI: In your simulation, you forgot to map LowNibble.
This:
port map(Clk=>Clk,
LiN=>LiN,
EiN=>EiN,
Din=>Din,
HighNibble=>HighNibble);
should be
port map(Clk=>Clk,
LiN=>LiN,
EiN=>EiN,
Din=>Din,
HighNibble=>HighNibble,
LowNibble=>LowNibble);
|
H: Do I need a heatsink for a MOSFET
I'm currently working on a project where I need to be able to switch 7m of 9W/m LED strip (connected from both sides) using an Arduino with PWM. So the power of the led strip is about 63W at 12V. I have a plenty of IRF540N mosfets lying around but I need to calculate if I need a heatsink, or not. The intended circuit looks like this:
Note that I don't want the high current to flow on the tiny PCB traces, that's the purpose of the screw terminal.
I know that a logic level MOSFET would be better, but if I understand the datasheet correctly, IRF540N should be able to switch even much higher currents with 5V at the gate than I need. Or would using e.g. IRL540N make any difference?
Do I need a heatsink? If so, how to choose one properly? Is there anything else I should be worried of considering my circuit?
Thanks in advance!
AI: The IRF540 can have a gate threshold voltage of up to 4V according to the datasheet, so it would probably not be able to supply enough current for the LEDs to run close to 12V.
Actually, taking a closer look at the datasheet for the IRF540, figure 3, it seems that it would be more than adequate of driving a 5A load at 5V gate drive. I would try this if i were you. The heatsink is still necessary though!
The IRL540 on the other hand is more suitable as it is a logic level MOSFET. According to the datasheet, the RDS(on) is around 77mΩ.
63W at 12V equals 5.25A, lets just say 5A as there will be a small voltage drop across the MOSFET, and that will lower the current in the LEDs.
The dissipated power in the MOSFET will then be:
\$ P_{dissipated} =RDS_{on} *I^2\ = 77mΩ * 5^2 = \textbf{1.9W}\$
According to the datasheet, the junction to ambient thermal resistance is 62 °C/W
This means the MOSFETs temperature will increase with
\$1.9W * 62 °C/W = \textbf{117°C} \$ from ambient temperature.
Assuming 25°C degrees ambient, that will result in 142°C. That is still in spec assuming ideal condition.. But you know, the world is not ideal..
EDIT: I forgot to take into account that the on-resistance has an significant increase with temperature, so you should definitely put a heatsink on it!
|
H: TL431 Constant Sinking current
A user already asked a question about it at TL431 Constant current source. My SPECIFIC question is about the figure 29. Sure it is not a complete circuit, so I completed it, in order to understand it, with two resistors, R3 and R4, as place holder for possible "useful circuit".
And sure, AM1 shows that the current through it is roughly constant (I am using TINA(TM) de Texas Instruments). Also note that AM2 isn't:
So, the net effect can be accomplished without using the transistor, with a single diode, as shown here:
And yes, not shown, but AM1 will still be constant.
In fact, if we use nothing, and no connection between R3 and R4, AM1 is constant, as it should.
So my question: what is the use of that transistor since it does not help in sinking a constant current between R3 and R4 (which was, I thought, was the purpose of the building block) and since a single diode can do the job ( maybe at a higher expense of energy though ) ?
Note that I varied R3 and R4 with 3 steps each, producing 9 cases, but similar results occur if I use a larger number of steps.
AI: The regulator adjusts its cathode voltage to maintain a constant voltage at the reference input. It's like a reference voltage plus an op-amp with a transistor.
The external transistor will control current depending on the base voltage. So by controlling voltage at the emitter (where the REF input is connected), the collector current (which is about 99.5% of the emitter current) is effectively controlled to within a fraction of 1%, provided you don't run out of compliance voltage. The collector current will be approximately Vref/R2, or about 2.495V/R2
There are slight errors because the transistor gain is not infinite and the REF input draws a couple microamperes, but it's a pretty good current sink. The collector can't quite get to Vref, so the minimum collector voltage is about 2.6V, meaning the voltage across a load to +5 can't be more than about 2.4V/I.
Note that the collector current is what is controlled to be constant. The circuit block is a constant current sink. If you measure the collector current and open up R4 then the collector current should not change (unless you exceed the permissible range of voltages at the collector).
In this case, the current is 2.495V/220\$\Omega\$ = 11.34mA. The maximum load resistance (collector to +5) is about 2.4V/11.34mA = 211\$\Omega\$. When you exceed that resistance you no longer have a constant current sink. So your circuit with 1K is not a useful working example.
The emitter current as a consequence is also constant but that's pretty useless as it changes with R2 so it's more of a set voltage across a resistor.
Here is a quick LTspice simulation with a 100 ohm resistor as a load:
Ic(Q1): 0.0113147 device_current
Reduce the 100 ohm resistor (R3) to 0 ohms and we have:
Ic(Q1): 0.0113152 device_current
So it's a pretty good current sink. Output resistance (ideally it would be infinite) is about 2M\$\Omega\$.
Similarly, if I increase the supply voltage to 10V with R3 constant at 100 ohms, I get:
Ic(Q1): 0.0113529
So about +0.06% per volt line regulation. That could be improved by increasing R2. With R2 = 1K the line regulation is improved to +0.01%/volt and load regulation is slightly better too.
|
H: How to make shift register logisim
How would I make a 4-bit shift register with D flip flops so that only 1 LED is active at once. So for example if a button was pushed the first LED would light up and the other 3 would be off. If the button was pushed again the second led would light up and the other 3 would be off etc. I want to be able to do this with 4 LEDs.
This is what I've tried but I can't seem to be able to get it to work. Any help is appreciated as I've just started to learn.
AI: Something like this should work.
simulate this circuit – Schematic created using CircuitLab
Note: the LED part and resistor values were just the defaults when dropped onto the schematic. They would likely need adjustment in a real circuit.
Or here it is in Falstad, so you can see the simulation.
|
H: Electrical circuit with capacitors and transistor
I don't know how this circuit works. So I would like someone to explain me. I know that the qustion is too general, but I am new in electricity and I don't know someone who can answer me how this works.
The result is that when The circuit is connected to 9V battery one of the diodes start lighting and after some time (for example 5 seconds) the other diode start lighting while the light of the first diode start to decrease (start to dim) and a after second for example it stops lighting. So only the second diode now lighting and after for example 5 second it starts dimming and the first diode start lighting and after one second the second diod stop lighting at all an so on and so on.
I do the following measurements when D2 lights. C2 start to discharge when D2 start to ligthing.I measure that VCE (voltage drop between C and E) is positive. I measure that VDE is the sum of 9V + current voltage of C2.
So let assume that D2 starts lighting. I have the following questions:
The capacitor is charged at 6.8 Volts, but why?
Why when the D2 starts lighting the D1 dim for one for one second. Where the current goes through that lights the diode?
Why the voltage drop of R2 is the sum of 9V + voltage of C2. And when we have voltage drop through it this means that some current pass through it, but what is its path (maybe through C2?)
Why D2 stops lighting when the voltage drop across C2 is 0V. Why it don't stops when it is 0.7 for example?
Thanks in advance for your attention!
AI: This is called an astable multivibrator. It's a beautifully simple circuit that is very challenging to explain! If you're new to electricity then don't get too discouraged - this is tricky for even experienced people to understand. There are many explanations on the web. This one is pretty good.
I highly recommend simulating the circuit, and attempting to answer all your questions by probing the circuit in simulation. If you don't already have a simulation tool, try CircuitLab (which happens to be the built-in circuit tool on this site) or LTSpice. They're both relatively easy to get started and will easily handle this sort of circuit.
Now to your questions:
Consider D1 on, D2 off. T1 is on so its collector is at ground allowing C1 to charge via R3. Once it gets to about 0.6V, T2 switches on clamping the voltage on that side of the capacitor. T1 switches off at the same time so now C1 is charging in the opposite direction via D1. The 9V source, minus the two diode drops in D1 and T2, means the voltage across C1 tends towards about 7V. Before it gets there the circuit switches again, giving you about 6.8V on the cap.
Through C1, as per answer above.
When T1 is off, there is a path from 9V through R2, C2 and T2, until C2 charges. There is very little drop across T2, so during that period V(R2) + V(C2) = 9V.
D2's turn off is caused by C1 - when C2 charges enough to turn on T1, C1 is suddenly pulled to ground which pulls the gate of T2 low, turning off D2.
|
H: What is the main difference between AC and DC generator basic working principles?
I cannot understand the main difference on AC- DC generator basic working principles.
Lets consider how a loop wire works with a magnetic flux inside a DC generator briefly. Whenever the sides of the loop wire cut the magnetic flux line there will be current occurs on those sides.
Initial position at 0 degree, no current because no flux lines are cut by the sides.
After it rotates clockwise 90 degree the side AB comes in front of S pole and side CD comes in front of N pole. At this position, current flows from A to B on AB side and current flows from C to D on CD side.
Another 90 degree clockwise, no current on each side
The final rotation at 270 degree clockwise. Here, the CD side is in front of S pole and current flows from D to C on this side. The AB side is in front of N pole and current flows from B to A on this side.
What confuses me is that AC generator also works in this way in nutshell. What might be the difference between both of them? Talking about an AC thing there should be some sort of an "Alternating" mechanism which I can observe on the direction of the current whenever the loop wire sides come in front of different magnet poles but again a DC generator also works in this way. I hope this question makes sense.
AI: Your illustrations show an AC alternator, rather than a DC generator.
An alternator may use simple contact rings (or slip rings), though if a permanent magnet spins inside a stationary stator, as on some bicycle alternators, no slip rings are needed.
Originally, DC generators used mechanical commutators to reverse the polarity as each pole piece passed another, changing the alternating current into "pulsating" DC. Commutators wear out more quickly than slip rings, both because of arcing on the breaking of contact and because the contact surface cannot be made completely smooth. For that reason, more reliable alternators are more commonly used to provide DC output now that solid-state rectification is efficient and inexpensive (though copper-oxide and selenium rectifiers have been used for ~100 years).
|
H: How can I enable a LDO using the I2C SCL signal
Can I enable/disable an LDO (more specifically NCV8163AMX280TBG) by using the I2C SCL signal?
This would allow me to turn ON the regulator once a master starts the I2C protocol and turn it off once the master stops communicating via I2C.
If possible, what extra components do I need (caps & diodes probably)?
Any help is appreciated.
PS: The I2C configuration is 1 master to N slaves.
PPS: the regulator turns on at 1.2V and the circuit will be powered from 3.3V
Details:
This will be an array of small sensors and actuators built around STM8L001. There will be one STM8L001 for each sensor and actuator. There is a contraint on cost and the number of wires. Currently I have 2 wires for power + 2 wires for communication.
When the master wakes up it needs a way to wake up the slaves as well.
I currently see the below options to enable this behaviour:
1 extra wire to drive the ENABLE pin on the LDO from the master (master wakes up, starts i2c, enables the GPIO that starts all the LDOs on the slaves)
using MOSFETs to power up/down the entire power rail
using the SCL signal to signal the ENABLE pin on the LDO
The sexiest option is the last one as it is the cheapest.
The below schematic is for the slave. As you can see it is a minimal design using STM8L001 with the ENABLE pin directly on the power rail.
AI: Reusing the SCL for this purpose would enable me to have this behaviour for the lowest cost & complexity.
What?! You need to add some time delay circuit to each slave. Are you saying it would be cheaper and simpler than adding one MOSFET on power rail?
Also, keep in mind that most chips specify maximum I/O voltage relative to VCC. Your I2C pull-ups will feed it to unpowered slaves, pushing them over maximum specified rating. What often happens in this case is that protection diodes pass this voltage to power rails waking up the chip. But since the current is usually insufficient the MCU enters this semi-powered state which sometimes ends up damaging the chip.
The option with one additional wire to EN pins of all LDOs is good solution. The option with one MOSFET to switch power to all slaves is even better solution.
Now, here are couple real solutions.
STM8L001 has low power "halt" mode from which it can wake up on interrupts, including I2C interrupts. Furthermore, the I2C module can perform address match and only wake up when this particular slave is addressed. So, you don't have to wake up all of them, only the one you want to communicate with. You don't need any additional components, any additional lines, and the power savings would be probably higher, despite not shutting down the LDOs.
Having LDO on each slave is awful overkill. At the distances I2C works power loss in the wires is negligible. So, get rid of all those LDOs. Connect 3.3V power rail with MOSFET. Put I2C pull-ups after MOSFET! When you need to communicate always switch power ON first. Then insert a delay to allow slaves to wake up and configure their I2C. Only then configure and activate master I2C. So, with the cost of 1 MOSFET you can save money on all LDOs, make sure no power is wasted and safeguard I/O pins from high voltage in powered down state.
Finally, you can combine the two solutions above for even more savings. Get rid of LDOs and only power up the slaves when you want to communicate. Make each slave configure I2C address and go to sleep immediately after power-up. Then use I2C interrupt to wake one slave at a time. This way there will be zero power consumption between communications and minimal consumption during communication, since only one slave will be awake at a time.
P.S. In the end, @SamGibson was absolutely right to comment about XY problem. For some reason you focused on "sexiest option", ignoring much cheaper and more efficient ones.
|
H: when dividing two integer result truncated to 0
when i divide two integer and if the result is below like 0.987, then it become zero
uint8_t time = 11;
volatile uint8_t val[2] = {11,12};
return (uint8_t) (time* (val[0] / val[1])) // 11 * (11/12)
from above code the return value is 0, (i.e 11/12 = 0.916 ,but becomes zero),
any other way to make return value to 11, that is 11/12 to 1 not 0 ?
AI: In the line
return (uint8_t) (time* (val[0] / val[1])) // 11 * (11/12)
the integer expression (val[0]/val[1]), which is computed first due to the parentheses, returns zero, and anything multiplied by zero is also zero.
If you changed that line slightly to read
return (uint8_t) ((time* val[0]) / val[1]) // (11*11)/12)
you would get the answer 10, which is very close to the true value of 121/12.
The normal rules for integer division in C is to truncate, to round down towards -ve infinity. If you want to stick with integer division, then you can make rounding happen if you code it explicitly, by adding half your denominator to your numerator before division.
If you have the code space and execution time, you could use floats, for getting numbers that you recognise without having to be concerned with calculation order and truncation.
A halfway house is to use fixed point integer arithmetic, if you have the RAM space for longer variables. Work in a large base like 1000 (for convenient display of fractions) or 65536 (for convenient slicing of numbers into integer and fractional parts), and use unit16 or uint32s.
|
H: Simulating a variable mutual inductance model
Can we simulate a time varying mutual inductance in Matlab Simulink (or any other simulation tool).
Matlab Simulink has a variable inductor, but I could not find not mutual inductor.
AI: (or any other simulation tool)
In LTspice you have the behavioural inductor. The expression is a function of x, Flux=f(x), where x has a special significance denoting the derivative of the current through the inductor. See more about it in the manual. Don't forget that the expression needs integrating beforehand. For example, say you need the inductance to vary as \$-2x^3+3x^2+1\$. After integration you get \$-\frac{x^4}{2}+x^3+x\$, and that's what you need to use. Also don't forget that, in LTspice, ** is used to mean exponentiation, instead of ^:
The test setup has a current source with a unit current ramp, which translates into the voltage across the inductor being the actual inductance -- V(n001) in the picture (the only node, actually). You should take care that, due to the derivative, sharp discontinuities may appear (see the sharp rise at time t=0), it's up to you to handle those, LTspice will gladly calculate anything you throw at it.
|
H: How to pick a voltage comparator switch for a low power circuit
I am finishing up an embedded project for my vehicle and the last step is to make it automatically power off with the car. The way I detect whether the vehicle is on or not is via a battery pin, which maps the car’s battery voltage as a value between 0-3.3 volts, multiplied by 7.2 to give the real voltage. To preserve power, I need to sleep the microcontroller until a signal is written to the wake up pin. So, I need to write gpio high (3.3v) to the pin when the battery is below 13 volts (around 1.8v on the battery pin), and gpio low when it isn’t. Theoretically the high/low can be flipped but that’s not important.
I have done a fair amount of research and have gotten swamped with solutions. At first I thought I could get away with just a transistor but apparently the right way is through a voltage comparator built from op-amps... but that almost seems overkill? I would prefer to input the minimum voltage into the comparator and for it to be low power. I am also not quite adapt a parsing their spec sheets so I’m really at a loss as to pick the exact part I need. I would really appreciate some guidance :)
AI: A comparator is indeed a great solution for this, given that is pretty much a comparator's only job. The transistor solution will be much more difficult to tune and make stable. By the time you've added enough to the transistor circuit to get it to behave well, you'll have effectively designed a comparator.
To keep things really simple, consider a 5-pin, push-pull output, comparator IC like the LMC7211. Your requirements will be met by a huge range of comparators, so I'll just use the LMC7211 to explain.
Simply connect your scaled battery voltage to the inverting - input pin, your threshold voltage to the non-inverting + input pin, and your 3.3V supply to the supply pins. Finally, because the battery voltage changes very slowly and will likely increase at the moment you turn off the car, you'll probably want to add some hysteresis. Hysteresis means the turn on threshold is different from the turn off threshold so the circuit doesn't bounce repeatedly between on and off. To do so, just add a large value resistor from the output pin to the non-inverting input pin. The output pin will then give you the signal you require.
Something like this:
simulate this circuit – Schematic created using CircuitLab
With the resistor values I've used in the schematic, the output goes to 3.3V when the input falls below 1.76V and the output goes to 0V when the input rises above 1.94V. Adjust to suit your preferences.
|
H: Building a series RLC circuit using a given resonant frequency and bandwidth value
Assuming that we have to build a simple series RLC circuit in such a way that the its resonant frequency must be 200 krad/s and its bandwidth as 20 krad/s, we have these components:
Resistor: 1000 Ohms
Inductor: 2.5 mH
Capacitor: 2.5 nF
We can add or remove any components as we wish. Now, I have done the calculations using the resonant frequency formula (1/sqrt(L*C)) and the resonant frequency is twice the original value (400 krad/s). Is it possible to add more inductor/capacitor or other components to modify (decrease) the resonant frequency of the circuit? Or is it impossible? Any clarification is helpful.
AI: A mistake in my answer is assuming an RLC bandpass filter where L and C are in parallel. The question title refers to a series RLC circuit. However, the principles are exactly the same; R, L and C can be manipulated to give the correct level of Q and the product of L and C must be correct for the right resonant frequency. That latter formula remains the same for parallel and series circuits. However, Q is calculated as the inverse of the Q implied in my answer below. Hopefully this extract from the wiki page on Q factor will explain the differences: -
Using this on-line tool and plugging in the values to this circuit: -
I get the following response: -
Is it possible to add more inductor/capacitor or other components to
modify (decrease) the resonant frequency of the circuit? Or is it
impossible? Any clarification is helpful.
Clearly the resonant frequency is twice what you require and this can be changed to 31.83 kHz by increasing the capacitance from 2.5 nF to 10 nF. You could also have increased the inductance by 4 times but that would take you in the wrong direction for the next step.
The next step is getting the required bandwidth. Notice in the picture above there is a calculated value for Q and this value is "1.000". Well, for a centre-frequency to bandwidth ratio of 10:1 you need a Q of 10.
This means you have two options; you can either increase the series resistance (because Q is proportional to resistance) and get this: -
Or you can mess around with the values of L and C to manipulate the Q to the right value for R = 1000 ohms whilst maintaining the right LC product i.e. increase C by an amount whilst decreasing L by the same amount: -
|
H: Regarding headphones
i have a headphone. it it having problem while listining to music. it is having wheel like structure to increase music. the wheel like structure is having problems. when i press it little or roll it slightly then sound is good but it again stops. Please help me.
I m sorry that the question is off topic. I m not an eletrical engineer. i m a child of 16 who want to repair my headphone. i have got my answer by-Bimpelrekkie and see how i used cello tape insted of sodering-
AI: The wheel is connected to the very small potentiometer which basically controls how much of the power delivered from your player reaches the headphones.
The problem is that the potentiometers like these tend to degrade.
The solution would be to try disassemble the casing of the wheel and clean the internals with rubbing alcohol or something similar.
If it does not work another way is to remove the potentiometer and solder leads to bypass the regulation. Then you have no regulation, but the volume would be always at maximum.
|
H: Voltage follower problem
I've modeled the above circuit, but the breadboard version does not work.
(There are no unexpected oscillations - I'm just looking at DC levels.)
I'm trying to shift a 0.4V - 2.0V DC signal to 0V - 10V DC signal.
There is ref. 0.4V at pin 5 (+) of U6, the voltage follower, and 0.4V as you would expect on 6 (-) and 7 (output).
If I breadboard this circuit, U6 output (pin 7) does not give the expected voltage; it's about 0.6V, so the output on pin 1 is not 10V as expected. If the main input on R1 is 1V instead of 2V, the circuit works as expected. Can anyone offer an explanation?
Before you ask - I've breadboarded it twice!
I always thought that a voltage follower was simple!!
Current taken by circuit is >1mA.
Thanks.
AI: You're running into a practical limitation of the LM2904 opamp, and a possible error in its datasheet, e.g., this one from TI.
You are attempting what is known as "rail-to-rail" operation — your input voltages and/or output voltages are close to one or both supply voltages. The input common-mode range of the LM2904 includes ground, so you're OK there.
However, on the output side, there's a problem. The datasheet says that VOL is 5 mV typical and 20 mV maximum, which would suggest that you're OK there, too. However, the "equivalent circuit" shown in the datasheet shows that the output stage is BJTs wired as emitter followers, which would not be able to pull anywhere near to that close to the supply rails. I would expect to see a VOL of at least 0.6 - 0.7 V, which is exactly what you're seeing.
You need to either select a different opamp that has true rail-to-rail outputs, or give your LM2904 a negative supply that's at least 0.6 V below your ground reference. One simple way to achieve the latter is to use a diode or two in series with the negative side of your power supply.
Followup: You also asked about the LM324, which has the same output structure, so it has the same problem. At first, I didn't understand why the datasheets are saying that the output range includes 0V.
But then I realized that both families of opamps have a 50 µA current sink connected between the output pin and the negative supply, which means that they can drive to the negative rail as long as the load current is less than this value. Note Figure 9 in the LM2904 datasheet, and Figure 11 in the LM324 datasheet.
You're trying to put more than twice that amount of current into U6. Try changing the resistances around U5 to 3× their current values (or more).
|
H: Frequently interrupting the CC charging stage of a Lithium-Polymer battery
Because of design constraints I need to charge a 2S Li-Po battery over its balance connectors using a single-cell charger IC (e.g LTC4002). In order to allow the user to interrupt the charging process before the battery is fully charged, it makes sense to charge both cells alternately so that they are not significantly unbalanced after the interruption. The switching would not be triggered more often than every few minutes.
How harmful is such behaviour for the particular battery technology? Would you suggest some other charging process under my constraints?
Thanks for your help!
AI: The battery doesn't care if it's charged in intervals, even if you were to switch at a frequency >1Hz. The switching circuitry might be more difficult to implement than just using a 2S charging IC in the first place, however.
|
H: Impedence Matching of Antenna and Coaxial Cable
There is a scenario based question which is confusing for me
Antenna had four rods each 15cm arranged as a plus sign. its brass shielding was cut and it had two 75 ohm coaxial cables in it. one 10 cm long was connected to rod A and C whereas other was 17.5cm long connected to rod B and D. On measurement you found good impedance match between antenna and cable. both the cable got combined at the other end into one input connector
Find Center Frequency
Predict polarization
Plot radiation pattern.
Can you tell me how impedance matching works, do length matters and how can we know if antenna with given length is having a good match with coaxial cable with given length
AI: Since this is homework, here are some hints:
The dimensions of the antenna elements determine its intended operating frequency.
Mismatched cable lengths create a phase shift in the signal. The phase angle is a function of the cable length and the operating frequency.
Crossed dipoles fed with different signal phases is one way to produce circular polarization.
|
H: Why not all the diodes are in "on state" in the given picture?
Given:"all the diodes are ideal",in figure (e), only D3 is on and rest of the two diodes are given off in the solution. Similarly for (f) only D1 is on. I don't understand the logic behind this. Please help in understanding this thing.
Update: Showing my work for (f)
Assuming only D3(diode with 3V) is present and is in "on" condition.I end up getting same situation if I begin with D1 or D2, which gives all diodes are off.
AI: One way to arrive at the solution is to think of each diode individually. What would the voltage be at the output if only one diode is present? Assuming 0.5V drop for a diode, in (e) it woudld be 2.5V with only D3, 1.5V with only D2, 0.5V with only D1. (Assuming the diodes are numbed from the top to bottom). Can you see how to determine these voltages?
Now, in each situation, add the other diodes, one by one, and see whether it would influence the situation.
Starting with only D3, if we add D2, it would be blocking, because its left side has a lower voltage than its right side. Same for D1. Hence this situation (2.5 at the output) is consistent.
Starting with only D2, if we add D3 nothing happens. But if we add D1 we have a problem: its left side is 3V, right side 1.5V. That is not consistent with normal diode behaviour (should be 0.5V drop, but we have 1.5V in this situation). Hence this assumption (1.5V at the output) is invalid.
Same reasoning rules out the 0.5V at the output situation.
So we have only one consitent solution: 2.5V at the output, D3 conduction, D1 & D2 blocking.
You can use the same line of reasoning for (f).
|
H: Should analogue multivibrator and comparator pullup circuit have separate supplies?
I have managed to produce a design within the falstad circuit simulator for an analogue "LED chaser" using an analogue multivibrator and 3 comparators inspecting the voltage of one side of the multivibrator.
Once I had completed it I decided to link all the circuitry to one supply (the pullups for the comparators were originally fed by a separate 5v supply) thinking this would alter the output waveform; it didn't (to my knowledge).
If I were to make this circuit in real life would there be any disadvantage to using a single supply? Please excuse this if it is a fundamental/beginner sort of question I am not academically trained in electronics
The circuit link is here (cannot produce schematic from simulator)
AI: Usually you power everything in a circuit from the same supply voltage, unless you really need different voltages for different parts of the circuit. Since your circuit only needs 5 volts, you can of course power everything from a single 5V supply.
Think of it like a power bar: You can plug in as many devices as you want (as long as you don't overload it, of course).
Your circuit needs so little power that overloading your power supply is not a concern.
|
H: mips single-cycle branch verilog
I'm fairly new to Verilog, hardware design and computer architecture. Nevertheless, I've had a go at designing a simplified MIPS processor. It seems to mostly work fine but whenever I simulate it, it hangs on a BEQ instruction.
I'm trying to get it to run the following program (R1 is preloaded with 32'd10 and R4 is preloaded with 32'd1):
0 ADD R0 R1 R5; // R1 = 10
4 ADD R0 R1 R5; // R5 = 10 (redundant)
8 ADD R5 R6 R6; // R6 = R5 + R6
C SUB R5 R4 R5; // R5 = R5 - 1
10 SLT R4 R5 R7; // R4 < R5
14 BEQ R7 R4 -3; // Loop back to 8 if R5 > 1
Here is the GTKWave output:
As I understand it, the low 16 bits of the instruction should go to sign_extend, where it is concatenated with 16 copies of the sign bit. This then goes to shift_left2, where the address is multiplied by 4. This is added to the previous address + 4.
The two operands sent to the ALU are equal so the z0 signal is asserted. The Branch signal is asserted by the control module, based on bits [31:26] of the instruction. Branch and zero are ANDed in branch_and, causing branchnd to be asserted. This is fed into a mux to select the branch address instead of the incremented previous address and fed back in to the program counter, assigned to next_address on the next clock cycle, and fed into the instruction memory to fetch the next address.
It looks like all of this happens in my simulation. The branched address can be seen on addin at 12 seconds in the above picture, so it appears to function correctly up to that point. I can't understand why it hangs though. Surely this should just be fed into the program counter, assigned to next_address on the next posedge of the clock, and used to fetch the instruction. If I change the program so that the branch isn't taken, then it continues to execute until it runs out of instructions, so it does seem to be related to taking the branch.
I've tried changing sensitivity lists, adding/removing the clock from modules and just about anything else I can think of. Maybe I am missing something obvious. I'd greatly appreciate it if anyone could help. I'm new here so if this isn't the correct way to go about asking a question or if there is anything I can do to make this question easier to answer, please let me know.
Thanks
module MIPS_tb();
wire [4:0] rs1, rt1, rd1, writereg1;
wire [31:0] ins, register0, register1, register4, register5, register6, register7, addin, aluout, nextadd,
op1, op2, rfoutput2, dmreaddata, se_address, wdata, braddr, shaddr, incPCaddr;
wire reg_write, branch, branchnd, z0, regds, memtoreg, memwrite, alusrc;
reg clock;
reg reset;
MIPS mips1(clock, reset, rs1, rt1, rd1, writereg1, reg_write, ins,
register1, register4, register5, register6, register7, branch, branchnd, z0, addin, aluout, nextadd,
op1, op2, rfoutput2, dmreaddata, se_address, wdata, braddr, shaddr, incPCaddr, regds, memtoreg, memwrite, alusrc);
initial
begin
$dumpfile("MIPS_MIPS_tb.vcd");
$dumpvars(0, clock, reset, rs1, rt1, rd1, writereg1, reg_write, ins,
register1, register4, register5, register6, register7, branch, branchnd, z0, addin, aluout, nextadd,
op1, op2, rfoutput2, dmreaddata, se_address, wdata, braddr, shaddr, incPCaddr, regds, memtoreg, memwrite, alusrc);
reset = 1'b1;
clock = 1'b0;
#1
reset = 1'b0;
repeat(250)
#1
clock = !clock;
#1
$finish;
end
endmodule
MIPS
module MIPS(clock, reset, rs1, rt1, rd1, writereg1, reg_write, ins,
register1, register4, register5, register6, register7, branch, branchnd, z0, addin, aluout, nextadd,
op1, op2, rfoutput2, dmreaddata, se_address, wdata, braddr, shaddr, incPCaddr, regds, memtoreg, memwrite, alusrc);
input clock, reset;
output [4:0] rs1, rt1, rd1, writereg1;
output [31:0] ins, addin, aluout;
output reg_write;
output [31:0] register1, register4, register5, register6, register7, nextadd, op1, op2,
rfoutput2, dmreaddata, se_address, wdata, braddr, shaddr, incPCaddr;
output branch, branchnd, z0, regds, memtoreg, memwrite, alusrc;
wire [31:0] instruction, next_address, address_in, operand1, operand2, reg_file_output2,
ALU_result, data_mem_read_data, sign_extended_address, write_data,
branch_address, shifted_address, incremented_PC_address;
wire RegDst, Branch, MemtoReg, MemWrite, ALUSrc, RegWrite, zero, BEQ;
wire [1:0] ALUOp;
wire [4:0] rs, rt, rd, write_register;
wire [5:0] funct;
wire [15:0] addressop;
wire [3:0] ALU_control_vector;
assign rs1 = rs;
assign rt1 = rt;
assign rd1 = rd;
assign writereg1 = write_register;
assign reg_write = RegWrite;
assign ins = instruction;
assign z0 = zero;
assign branch = Branch;
assign branchnd = BEQ;
assign addin = address_in;
assign aluout = ALU_result;
assign nextadd = next_address;
assign op1 = operand1;
assign op2 = operand2;
assign rfoutput2 = reg_file_output2;
assign dmreaddata = data_mem_read_data;
assign se_address = sign_extended_address;
assign wdata = write_data;
assign braddr = branch_address;
assign shaddr = shifted_address;
assign incPCaddr = incremented_PC_address;
assign regds = RegDst;
assign memtoreg = MemtoReg;
assign memwrite = MemWrite;
assign alusrc = ALUSrc;
program_counter pc1(next_address, address_in, clock, reset);
register_file rf1(operand1, reg_file_output2, rs, rt, write_register, write_data, RegWrite,
register1, register4, register5, register6, register7);
ALU alu1(ALU_result, zero, operand1, operand2, ALU_control_vector);
ALU_control aluctrl1(ALU_control_vector, ALUOp, funct);
data_memory dm1(data_mem_read_data, reg_file_output2, ALU_result, MemWrite);
sign_extend se1(sign_extended_address, addressop);
instruction_memory im1(instruction, next_address);
control ctrl1(RegDst, Branch, MemtoReg, ALUOp, MemWrite, ALUSrc, RegWrite, instruction,
rs, rt, rd, funct, addressop);
branch_adder ba1(branch_address, shifted_address, incremented_PC_address);
PC_increment pci(incremented_PC_address, next_address);
branch_and brand(BEQ, Branch, zero);
shift_left2 shl2(shifted_address, sign_extended_address);
mux_2to1 branch_mux(address_in, BEQ, incremented_PC_address, branch_address);
mux_2to1_5bit write_reg_mux(write_register, RegDst, rt, rd);
mux_2to1 write_data_mux(write_data, MemtoReg, ALU_result, data_mem_read_data);
mux_2to1 ALU_source_mux(operand2, ALUSrc, reg_file_output2, sign_extended_address);
endmodule
Control Unit
module control(RegDst, Branch, MemtoReg, ALUOp, MemWrite, ALUSrc, RegWrite, instruction,
rs, rt, rd, funct, addressop);
output RegDst, Branch, MemtoReg, MemWrite, ALUSrc, RegWrite;
output [4:0] rs, rt, rd;
output [5:0] funct;
output [15:0] addressop;
output [1:0] ALUOp;
input [31:0] instruction;
wire [5:0] Op = instruction[31:26];
assign rs = instruction[25:21];
assign rt = instruction[20:16];
assign rd = instruction[15:11];
assign funct = instruction[5:0];
assign addressop = instruction[15:0];
reg [7:0] Control;
assign RegDst = Control[7];
assign RegWrite = Control[6];
assign ALUSrc = Control[5];
assign MemWrite = Control[4];
assign MemtoReg = Control[3];
assign Branch = Control[2];
assign ALUOp = Control[1:0];
initial
Control = 7'd0;
always @(*)
casex(Op)
32'd0 : Control = 8'b11000010; // R-TYPE
32'd35 : Control = 8'b01101000; // LW
32'd43 : Control = 8'bx011x000; // SW
32'd4 : Control = 8'bx000x101; // BEQ
default : Control = 8'b00000000; // NOP
endcase
endmodule
Instruction Memory
module instruction_memory(instruction, address);
output reg [31:0] instruction;
input [31:0] address;
reg [31:0] prog [40:0];
initial
begin
prog[0] <= 32'b000000_00000_00001_00101_00000000000;
prog[4] <= 32'b000000_00000_00001_00101_00000000000;
prog[8] <= 32'b000000_00000_00000_00110_00000000000;
prog[12] <= 32'b000000_00101_00110_00110_00000000000;
prog[16] <= 32'b000000_00101_00100_00101_00000000010;
prog[20] <= 32'b000000_00100_00101_00111_00000001010;
prog[24] <= 32'b000100_00111_00100_11111_11111111100;
prog[28] <= 32'b000000_00101_00100_00101_00000000010;
prog[32] <= 32'b000000_00101_00100_00111_00000001010;
prog[36] <= 32'b000000_00100_00110_00110_00000000000;
prog[40] <= 32'b000000_00100_00110_00110_00000000000;
end
always @(address)
instruction = prog[address];
endmodule
Sign Extend
module sign_extend(sign_extended_address, instruction_addr);
output reg [31:0] sign_extended_address;
input [15:0] instruction_addr;
always @(*)
begin
sign_extended_address[15:0] = instruction_addr;
if(instruction_addr[15]==1'b1)
sign_extended_address[31:16] = 16'b1111_1111_1111_1111;
else
sign_extended_address[31:16] = 16'b0000_0000_0000_0000;
end
endmodule
ALU Control Unit
module ALU_control(ALU_control_vector, ALUOp, funct);
output reg [3:0] ALU_control_vector;
input [1:0] ALUOp;
input [5:0] funct;
initial
ALU_control_vector = 4'b0000;
always @(*)
begin
case(ALUOp[1])
1'b0 : case(ALUOp[0])
1'b0 : ALU_control_vector = 4'b0010; // ADD for LW, SW
1'b1 : ALU_control_vector = 4'b0110; // SUB for BEQ
endcase
1'b1 : case(funct[3:0])
4'b0000 : ALU_control_vector = 4'b0010; // ADD
4'b0100 : ALU_control_vector = 4'b0000; // AND
4'b0101 : ALU_control_vector = 4'b0001; // OR
4'b0010 : ALU_control_vector = 4'b0110; // SUB
4'b1010 : ALU_control_vector = 4'b0111; // SLT
default : ALU_control_vector = 4'b0010; // ADD (doesn't matter)
endcase
endcase
end
endmodule
ALU
module ALU(ALU_result, zero, operand1, operand2, ALU_control_vector);
output reg [31:0] ALU_result;
output reg zero;
input [31:0] operand1, operand2;
input [3:0] ALU_control_vector;
initial
begin
ALU_result = 32'd0;
zero = 0;
end
always @(*)
begin
case(ALU_control_vector)
4'b0000 : ALU_result = operand1 & operand2;
4'b0001 : ALU_result = operand1 | operand2;
4'b0010 : ALU_result = operand1 + operand2;
4'b0110 : ALU_result = operand1 - operand2;
4'b0111 : ALU_result = (operand1 < operand2) ? 32'd1 : 32'd0;
endcase
if (ALU_result == 0)
zero = 1'b1;
else
zero = 1'b0;
end
endmodule
Register File
module register_file(operand1, reg_file_output2, rs, rt, write_register, write_data, RegWrite,
register1, register4, register5, register6, register7);
output reg [31:0] operand1, reg_file_output2;
output [31:0] register0, register1, register4, register5, register6, register7;
input [31:0] write_data;
input [4:0] rs, rt, write_register;
input RegWrite;
reg [31:0] registers [31:1]; // Register 0 reserved for "0"
assign register1 = registers[1];
assign register4 = registers[4];
assign register5 = registers[5];
assign register6 = registers[6];
assign register7 = registers[7];
initial
begin
registers[1] = 10;
registers[4] = 1;
registers[5] = 0;
registers[6] = 0;
registers[7] = 0;
operand1 = 0;
reg_file_output2 = 0;
end
always @(*)
begin
operand1 = (rs == 0) ? 32'd0 : registers[rs];
reg_file_output2 = (rt == 0) ? 32'd0 : registers[rt];
if(RegWrite)
registers[write_register] = write_data;
end
endmodule
Program Counter
module program_counter(next_address, address, clock, reset);
output [31:0] next_address;
input [31:0] address;
input clock, reset;
reg [31:0] pc_next;
assign next_address = pc_next;
always @(posedge clock, posedge reset)
begin
if(reset)
pc_next = 32'd0;
else
pc_next = address;
end
endmodule
Branch Adder
module branch_adder(branch_address, shifted_addr_instruction, incremented_PC_addr);
output [31:0] branch_address;
input [31:0] shifted_addr_instruction, incremented_PC_addr;
assign branch_address = shifted_addr_instruction + incremented_PC_addr;
endmodule
Mux 1
module mux_2to1(out, select, a, b);
output reg [31:0] out;
input select;
input [31:0] a, b;
initial
out = 0;
always @(*)
begin
if(select)
out = b;
else
out = a;
end
endmodule
Mux 2
module mux_2to1_5bit(out, select, a, b);
output reg [4:0] out;
input select;
input [4:0] a, b;
initial
out = 0;
always @(*)
begin
if(select)
out = b;
else
out = a;
end
endmodule
PC Incrementer
module PC_increment(incremented_PC_address, current_address);
output [31:0] incremented_PC_address;
input [31:0] current_address;
assign incremented_PC_address = current_address + 4;
endmodule
Branch/Zero AND
module branch_and(BEQ, branch, zero);
output BEQ;
input branch, zero;
and(BEQ, branch, zero);
endmodule
Left Shift Address
module shift_left2(shifted_address, sign_extended_address);
output [31:0] shifted_address;
input [31:0] sign_extended_address;
assign shifted_address = sign_extended_address << 2;
endmodule
Data Memory
module data_memory(data_mem_read_data, data_mem_write_data, ALU_result, MemWrite);
output reg [31:0] data_mem_read_data;
input [31:0] ALU_result, data_mem_write_data;
input MemWrite;
wire MemRead = ~MemWrite;
reg [31:0] data_registers [255:0];
initial
data_mem_read_data = 0;
always @(ALU_result, data_mem_write_data)
begin
if(MemWrite)
data_registers[ALU_result] = data_mem_write_data;
if(MemRead)
data_mem_read_data = data_registers[ALU_result];
end
endmodule
AI: In any sequential always block, you must use non blocking assignment (the less than/equal sign, <=). If it's not the cause of this problem, it will cause one layer for sure.
|
H: why MOSFET Driver
Why do we youse MOSFET Driver when we use MOSFET as a switch in a high side configuration and we do not use it in low side configuration?
Can we drive a MOSFET ON/OFF with the OUTPUT of UC3842?
AI: Firstly the UC3842. It has a push-pull BJT driver and is quite suitable for driving the high capacitance load of an N channel MOSFET's gate-source region: -
And here's an example circuit: -
Picture source. If you read the UC3842 data sheet you'll see that it is good for driving a couple of hundred mA so for small to moderately sized MOSFET's (generalism alert) it's a decent choice.
Why do we youse MOSFET Driver when we use MOSFET as a switch in a high
side configuration
In a high side application, the preferred method is to use an N channel MOSFET and specialist bootstrapped driver. The more natural choice would be a P channel MOSFET but these are usually deemed more inefficient at fast and hard switching.
To drive an N channel MOSFET, the gate must be driven higher than the source and, if you want to form a low ohmic on state between drain and source you need to drive the gate about 10 to 15 volts above both drain and source. Given that the maximum voltage seen will be at the drain this creates a problem and therefore specialist drivers are preferred because they incorporate a bootstrapping circuit to deliver higher-than-drain voltages to the gate. Here is an example: -
The high-side N channel MOSFET steals a bit of energy from the output switching waveform by using a capacitive voltage doubling circuit that feeds the boost pin.
This is also know as bootstrapping and isn't of course needed when driving the low-side MOSFET however, the LTC4444 device above can also drive a low side MOSFET and the advantage here is that it incorporates "adaptive shoot-through protection" that inserts a small dead-time between one MOSFET turning off and the other one turning on. This prevents both devices being partially on simultaneously and dramatically restricts the phenomenom of current shoot-through.
In the application note, they have treated a flyback power supply, so
the MOSFET is in the low side configuration, but I want to use this IC
for buck converter power supply where a MOSFET switch is in the High
side configuration
You are out of luck in that case - the output of the UC3842 is only suitable for directly driving a low-side MOSFET or BJT but, if you are prepared to do a few experiments you could drive an NPN BJT that can interface with a top-side P channel MOSFET but then there are better chips around than this solution.
|
H: TRIAC won't turn on/turn off
I'm trying to make simple lamp switching circuit to work, but it just doesn't want to work as intended - question is, why?
I'm using MOC3021 random phase optotriac with BT136/600E sensitive gate triac in such configuration:
simulate this circuit – Schematic created using CircuitLab
First thing - voltage V3 does nothing to this circuit - doesn't matter whether it's high nor low nor variable (zero-cross depending) - hot side never reatcs to it.
Second thing - depending on R3 (I've read somewhere that it's necessary if triac is sensitive) - if I plug this resistor, triac is always on, but if resistor isn't there - triac is always off. And it never reacts to optotriac U2.
Last thing - and very weird one - in configuration without R3 resistor, if I try to measure voltage on triac's gate, bulb sometimes flashes for half a second or so and the voltage drops from 230V to 30V and goes up again - same happens when I'm plugging/unplugging mains plug - looks like there's some connectivity problem, but there's none, checked it.
I haven't used a snubber for now, because lamp is resistive load so it shouldn't make any difference.. right?
And yes, I've checked the triac and optotriac, they seem to be good, even exchanged both with new ones - still the same.
What can be wrong with this circuit?
Regards
AI: Usually the problem is that you have swapped MT1 and MT2 on the triac.
... depending on R3 (I've read somewhere that it's necessary if triac is sensitive) - if I plug this resistor, triac is always on, but if resistor isn't there - triac is always off.
simulate this circuit – Schematic created using CircuitLab
Figure 1. (a) What you intended. (b) What you've done.
The gate needs to be connected to MT2 to turn the triac on. Your R3 test confirms that this is the error. Your opto-triac is connecting the gate to MT1 and so it does nothing.
|
H: Not enough pins, looking for a "demultiplexer" that keeps state
I want to control a simple display with a microcontroller. The display has 8 input pins, the microcontroller only 6.
Is there an IC that I can interpose that
lets me set the state of each of its output pins and keeps it that way
requires the least amount of input pins necessary
Something with a serial bus maybe?
I know that typically display controllers are used, but are there general purpose devices?
AI: What you are looking for is a GPIO "expander" chip. There are many available, typically using I2C or SPI to connect to the microcontroller. The Microchip MCP23017(I2C)/MCP23S17(SPI) is just one example that I have used in the past. There are many others to choose from.
|
H: Not getting expected voltage at LED
I recently picked up and arduino nano kit and messed around with all the simple projects. I dont have much EE experience besides those so I have a question that might be pretty basic.
I am trying to make a simple travel lantern with a rechargeable Li-ion battery pack. It is working, but the voltage at the LED is below what I calculated it should be and thus the LED is dimmer than expected.
I'm using a 18650 3.7v Li-ion battery for power that is connected to a TP4056 charge/protect board. The TP4056 output is connected to a MT3608 step-up boost converter to boost the 3.7v up to 7v which powers the Nano through pin 30. I know that is not an efficient way to power it but I will be changing that in the future.
I want to use PWM to control the brightness using a rotary encoder and the push button to turn it on/off. The LED was salvaged from a flashlight I had around and after some research it looks like it is a cree xp-c which lists a forward voltage of 3.6v @ 350mA. To reduce the 5v max output of the arduino pins I made a voltage divider with R1 being a 100 ohm resistor and R2 being 330 ohms. This should cause the output between the resistors to be ~3.8v, but since the arduino puts out a bit less than 5v I expected ~3.6v output.
The issue is that I am getting 2.6v to the LED instead of the 3.6v it should be. I measured 4.5v from pin D6 to GND but only 2.6v after the divider. What could cause the voltage to be 1v lower than expected?
Here is the code I have on the nano:
int tempPin = 0;
volatile boolean TurnDetected; // need volatile for Interrupts
volatile boolean rotationdirection; // CW or CCW rotation
volatile boolean isOn;
volatile boolean buttonPress;
const int PinCLK=2; // White
const int PinDT=4; // Orange
const int PinSW=3; // Brown
const int PinLED=5;
int counter = 100;
// Interrupt routine runs if CLK goes from HIGH to LOW
void isr () {
delay(4); // delay for Debouncing
if (digitalRead(PinCLK))
rotationdirection= digitalRead(PinDT);
else
rotationdirection= !digitalRead(PinDT);
TurnDetected = true;
}
void isr1 () {
delay(4); // delay for Debouncing
if(!digitalRead(PinSW)){
isOn = !isOn;
}
buttonPress = true;
}
void setup() {
isOn=false;
Serial.begin(9600);
pinMode(PinCLK,INPUT);
pinMode(PinDT,INPUT);
pinMode(PinSW,INPUT);
pinMode(PinLED,OUTPUT);
digitalWrite(PinSW, HIGH); // Pull-Up resistor for switch
attachInterrupt (0,isr,FALLING);
attachInterrupt (digitalPinToInterrupt(PinSW),isr1,FALLING);
}
void loop() {
if(buttonPress){
if(isOn){
int val = map(counter, 0, 100, 0, 255);
analogWrite(PinLED, val);
} else {
digitalWrite(PinLED, LOW);
}
buttonPress=false;
}
if (TurnDetected) {
if (rotationdirection) {
counter+=2;
}
else {
counter-=2;
}
if(counter > 100){
counter=100;
}else if (counter < 30){
counter = 30;
}
int val = map(counter, 0, 100, 0, 255);
analogWrite(PinLED, val);
TurnDetected = false; // do NOT repeat IF loop until new rotation
detected
Serial.println(counter);
}
}
AI: Arduino outputs are typically limited to 20mA with a voltage drop of 0.3 to 0.8V depending on the microcontroller used.
For 350mA leds, you need at minimum a mosfet or transistor, and preferably a constant current driver.
Resistor voltage dividers will be very very poor in this type of situation. You'd be better off using just a single resistor.
|
H: Conflict of polarity?
With the following circuit, would the R2 resistor not change or affect the polarity in some negative way (no pun intended)?
In the image below I added the red box as well as the red text in an effort to try and understand what is happening when the R2 resistor attaches to the +4V lead.
Can someone please explain what it is doing assuming that everything on the circuit is correct? Note: The positive lead is switched power, so it might be on or off at any given time.
Reference webpage:Power Control System for RPi Car PC
AI: R2 constitutes the lower half of a voltage divider used to reduce out-of-range voltages to potentials sample-able within the range of an MCU input rating.
Voltage dividers do not change polarity relative to their fixed ground. This circuit accepts a positive input, and yields a reduced positive output.
However vehicle electrical systems are notoriously nasty, and it is a legitimate question if this design overall is sufficiently robust for such usage.
|
H: Dealing with coupling of PWM noise into Hall-Sensors as spikes in BLDC driver circuit
I have designed the first revision of a BLDC driver board (based on STM32 and DRV8323 chips). Right out of the bath (after writing the firmware of course) I noticed that the coupling of PWM into the hall signals is very terrible!
The motors that I have designed this circuit for are rated at ~20Watts. Their hall sensor only works at 5V or higher. I use the XOR mode of the STM32 timer to capture and generate commutation event...the STM32 is 3.3V...but I assume it can tolerate 5V input but I do not know what is the hysteresis for detecting a low or high signal when the GPIO pins are configured in XOR mode:
At below 100% PWM, I get a lot of noise. The yellow trace is one of the hall sensors (the blue is commutation event). I only have 2 probes so I could not capture all 3 sensors and the commutation event (pulling an gpio high and low before and after updating timer output). As you can see, the noise over the hall sensor is quite bad:
I blame 2 things:
1.The layout: As I did not have prior experience, and because there are 2 motor connectors, I routed the hall sensors very close to the phase signals (greens are phases and yellow are halls).
2. Motor Cable:
The motor cables are just 8 wires next to eachother (no twisting) for almost 50cm...so even if I did the best layout in the PCB the cable itself would cause the coupling issue.
I have tested the driver with 100% PWM (meaning no switching) and everything looks much better (the noise is very small and limited to when the half bridges switch at hall sensor update). So I really need to take care of this noise. I know that I can mitigate this effect in the software (e.g. by inserting timeout and other filtering methods...) but nothing can beat having a nice clean signal anyways.
So to make it short here is my questions:
1) What can I improve in the layout? separation of hall sensors and phase signals into different connectors?**
2) I will tear apart the motor cable and separate halls from phases and make them twisted pair...before I commit this, do you think it makes sense?
3) Should/Can I use a level-shifter and perhaps a Schmidt trigger to remove the noise and convert 5V to 3.3V before feeding it into the STM32 controller? If so, what chips do you suggest?
UPDATE:
Here is the RC filter for hall sensors, placed near MCU input.
AI: Here is basically what I have (I also have a ferrite bead in series right at the connector, but that is for EMI, not part of the low-pass filter):
simulate this circuit – Schematic created using CircuitLab
Here is what I would suggest for you, since you also want to reduce the voltage from 5V to 3.3V. The RC time constant (ignoring the 1k) is the product of R2 and R3 in parallel and 56pF. R2 and R3 in parallel is 10k, so, it is pretty close to the same time constant as my circuit. You can experiment with different values of capacitor to change the time constant, but I suspect you will see a large benefit from this. The rise time is around 500 or 600 ns, which should be OK.
simulate this circuit
Put the cap close to the processor. Resistor can be close, also, but that is less critical than making sure the capacitor GND connection is close to processor GND connection.
|
H: Does the phone transmit waves?
In a cellular connection, How much is power density (in W/m2 or mW/cm2) of the RF energy from the phone to the tower? If not possible in above units then can I know in dbm ? My phone has:
Head SAR: 0.75 W/kg at 10g tissue
Body SAR : unknown
Connection : LTE
Is it true that the power emitted increases when we get low reception?
AI: Yes the phone also transmits back to the tower.
In GSM the phone transmitter maximum power is 33 dBm. In LTE the phone transmitter maximum power is 23 dBm. The transmitter power is smaller, when the phone is closer to the base station, as it smaller amount of power is sufficient for reliable communication.
EDIT:
Below is a simplification, but I believe it matches your current knowledge on the subject.
Imagine you had an isotropical antenna (which actually is physically impossible, but bear with me). An isotropical antenna transmits the RF energy spherically. Assume you are transmitting 1 W of power. The 1 W power now divides evenly to the surface area of the sphere. However, the surface are of the sphere depends on the distance.
Assume we are 10 meters from the transmitting isotropical antenna. The surface area of the sphere will be:
\begin{equation}
\ A = 4*pi*r^2 = 1257m^2,
\end{equation}
The transmitted power is divided evenly to the sphere area. Thus, the power density is
\begin{equation}
\ Power density = 1 W / 1257 m^2 = 795 uW/m^2,
\end{equation}
If we are a hundred meters away, the area of the sphere is 125714 m^2. So the power density is
\begin{equation}
\ Power density = 1 W / 125714 m^2 = 7.95 uW/m^2,
\end{equation}
So you see, the further you are from the transmitting antenna, the smaller the power density (or field strength).
EDIT 2:
Yes, LTE (and GSM) transmits with a greater power when the connection gets worse.
|
H: Create Circuit Simulation
I wonder if someone can help me. How will one go about to create a simple circuit simulator? Similar to Multisim, just a lot simpler!
Basically, I only need resistors, capacitors, inductors and voltage sources.
Is there a tutorial I can follow, to create this using C# and Visual Studio?
AI: I wrote the simulation engine that powers CircuitLab from scratch: from the sparse matrix library up through component models and simulation modes. My co-founder wrote the front-end. It ended up being an unbelievably huge programming project, but one I'm quite proud of. If you're up for the challenge, writing a circuit simulator may be one of the most rewarding programming projects you'll ever tackle.
At a high level, you just need to:
Turn a network of components into a system of equations (non-linear differential equations).
Numerically solve the system of equations (using sparse matrix techniques).
I don't know of an online tutorial, but I've tried to document a lot of this as I write the "Ultimate Electronics" textbook, especially in Chapter 2. There are also a number of 1990s-era books on the topic of circuit simulation, though I don't have them handy at the moment.
My suggestion would be to start from only voltage sources and resistors, and continue building from there. Good luck.
|
H: Can a rocket igniter rated for 12v and 3 amps be powered with a 4v battery at 9 amps?
I have a rocket motor igniter that says it requires a 12 volt battery at 3 amps. Since power is I x V, and power is really what heats up the wire that starts the igniter, is it possible that I could use a lower voltage battery, but use a much larger current to compensate, and have the same power?
AI: Using Ohm's law you can modify the power formula.
$$ P = V I = (IR)I = I^2R \tag 1$$
$$ P = V I = V \frac {V}{R} = \frac {V^2}{R} \tag 2 $$
Since your R is constant then dropping the voltage will reduce the power.
I have a rocket motor igniter that says it requires a 12 volt battery at 3 amps.
We can calculate the igniter resistance as \$ R = \frac{V}{I} = \frac {12}{3} = 4 \ \Omega \$. From (1) above we see that \$ P = \frac {V^2}{R} = \frac {12^2}{4} = 36 \ \text W \$.
At 4 V the power dissipated would be \$ P = \frac {V^2}{R} = \frac {4^2}{4} = 4 \ \text W \$. Note the 'square' relationship: dividing the voltage by 3 divides the power by 9.
|
H: Speaker input connector
I want to buy connectors which are generally at the input of speakers or amps. I have attached a picture below.
What are these plugs called? I cannot find these on Digikey.
Thank you for your help?
AI: Try this link:
http://www.electricalcableconnectors.com/sale-7620516-terminal-connector-spring-speaker-binding-post-jack-female-for-audio-video.html They certainly look the same. Otherwise, they may be the very old style - probably not manufactured anymore.
|
H: Converting DC to AC power supply
I have a simple wiring question.
I want to convert a LED light that uses 2 AA batteries, to AC power supply. I have 3 of these lights. I'm assuming each light uses 3V for a total of 9V. I have a 9V AC to DC 2A power adapter.
How should I wire this? Would such a connection work? I'm splitting 9V into 6 cells in series, which should supply 1.5V to each battery cell. Thinking of doing this and just soldering wires to each battery connector head.
Am I on the right track?
Edit: Added photo of the light. Looks like a simple circuit.
Power adapter specs:
AI: Am I on the right track?
No.
Your drawing shows that you are applying 9 V to each battery point.
If you look at your battery holders you will see that at one end the terminals are connected. This connection would short out your red and blue wires giving you 0 V everywhere and overheating your power supply.
simulate this circuit – Schematic created using CircuitLab
Figure 1. Correct wiring. This is a series connection of three 3 V devices to a 9 V supply. Note that the 'loop' is built in to your battery packs already.
If the three units are identical and will draw the same current then you can wire as shown in Figure 1.
Now that you've posted a photo it's clear that your devices are 11 x white LEDs in parallel driven by a 3 V batter pack. There is a problem here. Unlike bulbs, LEDs are very sensitive to voltage. A small change in voltage can cause a large change in current - maybe enough to destroy them. The AA cells have some internal resistance and this causes the voltage at the battery terminals to decrease as current drawn increases. The effect is to give you a crude current limiting circuit built into the batteries.
You can use the circuit I've drawn if
The power supply voltage is no greater than 9 V - maybe 9.5 V.
The letters all have the same number of LEDs. If they don't then letters with more LEDs will draw more current and the ones with less LEDs will have to share that current between fewer LEDs.
simulate this circuit
Figure 2. Note that each letter lamp has multiple LEDs in parallel. This arrangement, while not ideal, at least has the same number of LEDs (and current paths) in each letter lamp.
simulate this circuit
Figure 3. With half the LEDs removed from the middle letter lamp the remaining half have to carry twice the current. They might not like this.
I have an article on Parallel LEDs which may be instructive.
|
H: Bridge rectifier filter capacitor remove
My question is very simple. What components should be removed from the following circuit diagram for this circuit to work only on DC voltage? I'm sure that the bridge rectifier should be removed further than that I do not know.
AI: You can remove everything connected to pin 16, VCC, which is where your DC power will go.
Although, depending on your DC source, you may need a filter capacitor. So, leaving C12 would be a good bet.
If you want to keep the LED power indicator, do so, but you may need to adjust the resistor (R5) value depending on your DC voltage.
From the datasheet it looks your DC supply voltage should be between 3 and 15 V.
And, of course, you might want to keep the power switch.
Basically, placing your DC supply at pin 1 of the switch, would probably work fine (after verifying that the LED resistor is suitable).
|
H: Is it good practice to run large amounts of current through a MOSFET?
I have been looking for a good way to control the flow of a lot of current in my project. This may at some points be 40-50 amperes at 12-15 V. While relays are a good choice, they are mechanical and therefore take time to activate and wear out over time.
I have seen MOSFETs (like this IRL7833) that are advertised to be able to handle such demanding tasks. However, considering the size of the FET, it makes me uncomfortable to be putting that much power through it. Is this a valid concern?
AI: Why can a thick copper wire handle a large current?
Because it has a low resistance. As long as you keep the resistance low (switch the MOSFET fully on, for example use Vgs = 10 V as in the datasheet of the IRL7833) then the MOSFET will not dissipate much power.
Dissipated power \$P\$ is: \$P = I^2 * R\$ so if R is kept low enough the MOSFET can handle this.
However, there are some caveats:
Let's look at the datasheet of the IRL7833.
That 150 A is at a case temperature of 25 degrees C. This means you will probably need a good heatsink. Any heat that is dissipated should be able to "escape" as the Rds,on of the NMOS will increase with increasing temperature. Which will increase power dissipation... See where that is going? It is called thermal runaway.
Those very high currents are often pulsed currents, not continuous currents.
Page 12, point 4: Package limitation current is 75 A
So in practice with one IRL7833 you're limited to 75 A, if you can keep the MOSFET cool enough.
You want to operate at 40 - 50 A, that's less than that 75 A. The further away you stay from the MOSFET's limits the better. So you might consider using an even more powerful MOSFET or use two (or more) in parallel.
You're also not putting that much power through the MOSFET, and the MOSFET is not handling 50 A * 15 V = 750 watt.
When off the MOSFET will either handle 15 V at almost no current (just leakage), due to the low current that will not be enough power to heat up the MOSFET.
When on the MOSFET will handle 50 A, but it will have less resistance than 4 mohm (when it is cool) so that means 10 watt. That's OK, but you have to keep the MOSFET cool.
Pay special attention to figure 8 of the datasheet, "Maximum Safe Operating Area" you must stay within that area or risk damaging the MOSFET.
Conclusion: so can you? Yes, you can, but you have to do some "homework" to determine if you are going to be within the safe limits. Just assuming that a MOSFET can handle a certain current because it is advertised as such is a recipe for disaster. You have to understand what goes on and what you're doing.
For example: since 50 A through 4 mohms already gives 10 W power dissipation, what does this mean for all the connections and traces on a PCB? They must have a very low resistance!
|
H: How to make a circuit for DMX splitter notification LEDs?
I am trying to make a DMX splitter. Everything works now, but it would be somewhat useful to have notification LEDs, like in the example below.
For the input I could use one LED, which I either connect to the RS485 + or -. Which one does not matter, because if a DMX cable is connected the LED lights up.
However, for the outputs it does not matter if a DMX connector is attached, the LED always is on (because there is signal on the input going to the output).
How could I make a red/green or single color LED that would light up when an output connector is inserted to a DMX device?
(btw, for the input I used a transistor, to prevent a significant voltage drop from the real signal going to the LED).
I'm not asking to recreate it exactly, I just want to have a LED that lights/blinks when a signal is sent to a DMX output.
Update
I created a new question (Prototyping a DMX splitter, the schematics I copied here for completeness:
Circuit where the above is based upon (for the sake of this question there is no functional difference)
Credits to J. Mack.
AI: If you want to detect physical insertion of connector, then you need a XLR5 socket with mechanical switch. But, maybe, better approach would be to detect a terminating resistor between A and B data lines being present.
The presence of terminator can be seen as a current flowing in/out line drivers in the splitter, so small shunt resistor or whatever else suitable method to measure current will do.
|
H: Dynamo - Reversing the rotation of the shaft
I'm having a debate with a friend. He claims that if you change the rotation of the shaft of a dynamo the output DC current changes direction. I, however, claim otherwise. The way I see it is that a dynamo rotates a coil inside a magnetic field, this produces an AC sine wave which then gets rectified to DC by the commutator. If you rotate the coil in the other direction it still produces AC and then gets rectified to DC in the same direction as if the shaft were rotating in the original way, right?
So who is correct? If it's my friend then why does the DC current change direction?
Any help is greatly appreciated.
AI: Sorry, your friend is correct.
A permanent magnet dynamo is the same as a permanent magnet motor. If the motor polarity is reversed the motor spins in reverse. Similarly the EMF generated by the dynamo will reverse with rotation reversal.
Figure 1. A really simple motor/dynamo. Source S-Cool.
The brushes aren't providing rectification of the supply - they're rectifying the windings. Notice that current can flow either direction but that the coil's orientation doesn't matter as the brushes correct it.
|
H: -Ve feedback comparator and its threshold values?
I was trying to analyse and understand the following circuit.
My intention was to calculate the hysteresis of the comparator.
Circuit working: For both compartor input, there will be voltage inputs ranging from 40 mV to 250 mV. This will vary as per the connected circuits and will trigger the output of the comparator either as HIGH or LOW.
I have worked on comparators with one input pin as fixed-reference voltage and other pin as the varying-input voltage.
Comparator Part Number: TS332 comparator from ST.
For me this seems bit new and I was not able to understand the working of the comparator completely.
Basically I am looking for a guide to calculate the upper and lower threshold and finally the hysteresis.
Could someone help me with this.
AI: In this circuit the transistor acts as a switch which shorts R4 or it doesn't.
The approach to finding the levels at which the output switches is to distinguish the two cases:
1) when the transistor is off
2) when the transistor is on
When the transistor is on (case 2) the right side of R3 is connected to ground so you can ignore R4 and R5.
After simplifying the circuit it is simply a matter of finding the situation where the + and - inputs of the comparator have the same input voltage.
Sidenote:
The way the output of the comparator, R6 and the NPN transistor isn't what it should be. If the comparator had an "open collector" or "open drain" output (only pulling the output low) then this circuit would be OK. But the TS332 has a rail-to-rail output. That makes R6 unneeded. Also when the output is high will try to pull the base of the NPN to the supply. This will fail as the TS322's output cannot deliver that much current. There should really be a base resistor in series with the base of the NPN. You can just use R6 so move it so that it's in series with the base of the NPN.
|
H: Capacitor actual value with DC bias
I did find this answer which explained why the capacitor is affected by the DC bias, however, my question is more on the application.
Let's say I have a capacitor for which I have the DC bias characteristic (Cap Charge [%] in function of DC Bias [VDC]) such as follow:
Now, let's say I set the capacitor voltage to a certain value, i.e. 5V and I try to maintain it through a feedback loop. What is the DC Bias induce? Is it 5V? What is VDC?
It may sounds like a stupid question, but I kinda struggle with the notations...
AI: What is a DC bias
DC bias is a measurement of the average voltage on a wire on which can "ride" a signal, should this wire transmit data, and noise.
Its unit is DC Volts, or VDC. You can remember it because it is the direct voltage on the conductor.
Variation of stored charge as a function of DC bias
Onto the phenomenon you describe in your question : as the signal varies, the capacitance "seen" by it will vary, introducing nonlinearities. But, the DC bias being most of the time large compared to the signal (or noise) voltage, they will be small.
Thus, you can use the DC bias as an effective voltage with which to consider the effective capacitance of your component, if and only if the voltage across the capacitor does not vary too much.
For example, if a \$5\$ to \$-5\$ volts audio signal had a \$7\$ volts DC bias and one end of the capacitor was grounded, the overall voltage would range from \$2\$ volts to \$12\$, which is a huge variation. You should not rely on a time constant or a precise capacitance then. If it was a \$\pm 200 \text{ mV}\$ signal on the other hand, you most likely could.
|
H: Are there any reason why i shoudln't run an atmega328p at 16mhz on 4.2v?
I am wondering what problems might occur if i reduced the voltage from the usual 5v down to 4.2v.
AI: The "P" in ATmega328P stays for "picoPower", which was Atmel's name for devices working down to 1.8V and possessing multiple power-saving features.
You can safely run the chip at maximum 20MHz down to 4.5V. Below that the maximum frequency starts dropping, approximately linearly down to 4MHz at 1.8V
There should not be a problem running at 16MHz at 4.2V. In fact, simple calculation suggests you can safely run up to 18.3MHz at this voltage.
See "28.3 Speed Grades" in the datasheet
|
H: Hovercraft not moving at all
I'm a beginner in electronics. I tried making a hovercraft that looks like this:
The bottom looks like this:
And the battery used is this:
I have used a 9v motor, a 9v battery and a dual blade propeller. For now, I just temporarily connect the wires to the motor to see how it works. As soon as I connect the wires, the motor turns on and the propeller spins with a high speed. However, the entire craft just vibrates(not vigorously) and stays in its place. Sometimes, it displaces very slightly due to the vibration. Moreover, the speed of the motor decreases after a minute or so. Note that I'm not placing the battery on the hovercraft. I hold it while it is connected and try to move along with it when it moves. But the movement is too feeble.
1) Is the battery not good enough?
2) Is the skirt not well shaped?
3) Is the motor to heavy?
4) Is the air intake not properly designed?
What am I doing wrong here?
AI: I have several ideas about your design:
1) The battery is indeed not good enough. Those 9V batteries are not made to supply 'relatively large' currents, like your motor will ask. So you need a better battery.
2) The skirt needs to be shaped differently indeed. The idea is that the air is 'held' underneath the hovercraft. The paper sheet would act like a barrier, that 'prevents' the air from escaping the bottom. So the skirt needs to be around the edges of the hovercraft, not covering like you did.
3) I don't know if your motor will be strong enough to lift the entire thing, including the (heavier) battery. But because the rest is pretty light, you can try. If you redesign the skirt, it might work.
4) There is no air intake at all. There must be a way to suck air in from the top. The 'circle' you used should be mostly open to allow air in.
Good luck!
|
H: DMX receiver 40V signal
I am creating a DMX receiver circuit. The dmx that is received from a controller (USB DMX dongle) is converted via a transceiver (SN75176BP) to a signal which can be understood by an ATMEGA328P.
I now have the problem that it is not recognized. When I measure on my circuit at RX I get the signal that can be seen in the image. I think it is not working due to the fact that a 40+ Volts signal is supplied which can not be read by the ATMEGA328P.
Can someone explain to me why the signal can be 40+ Volts and how I can solve this in a good way so that my micronctroller can properly read this signal.
AI: The answer is clear now, it was indeed the probe settings. My probe has 2 settings. 1X and 10X. it was on 10X but somehow it is reading as 1X. Thanks @MartinF
|
H: Charge capacitor with static electricity
Can i charge a capacitor fully with only static electricity?
I already took a look at: Electrostatically charging a capacitor and How to charge a capacitor with static electricity? but i'm not sure this answers my question fully.
Can you explain to me if it is possible to charge a capacitor from for example a wimshurst machine? What needs to be taken care when the capacity of the cap changes (i.e. if one time i have 100nF and a different one has 1000uF)? Im trying to charge a homemade foil capacitor and before building a bigger one I would like to know if doing this is feasible and what specifications i should aim for. By that approach I want to avoid building a voltage multiplier or other high voltage supplies.
AI: Sure. In your wimshurst machine example, you're already charging up two capacitors that are built into the machine, they're the jars on the right and left.
If you want to charge up another capacitor, you could connect it between the rod that's going into the jar and the outer bit of metal (though you'd probably need a capacitor for each jar), or charge it by putting it between the balls. However, you need to make sure the capacitor is rated to the voltage you're charging it to (on the order of 10kV), which is not common. Since you're making it yourself, you will need to use a thickish dielectric and be prepared for it to arc over. You also need to be prepared for it to take a long time to charge. According to wikipedia, a leyden jar has about 1nf of capacitance, so if you add say a 10nF capacitor to each jar, the sparks will occur about 10x less often.
|
H: Did I ruin my multimeter with a current measurement?
I am trying to do a current measurement.
Probably I accidentally put it it parallel instead of in series.
What I tried before/after that (cannot remember exactly putting it parallel but might have happened likely) :
Used both connection with 10A and normal output on the multimeter.
Use all settings for current (200 mA, 20 mA, 2 mA, 200 uA)
I put it in series with a LED. When using the normal output the LED is off (open circuit), when using the 10A output the LED is on (closed circuit).
I get always 0.000 A (even when the LED is on and put it in series).
Did I ruin my multimeter?
The ohmmeter and voltmeter still works.
Below a picture of my multimeter (found on internet, exactly similar):
AI: The current measurement circuit in a multimeter needs to be low impedance. That means it is possible to expose it to overcurrent. Actually it's quite easy: All you need to do is to put it on a voltage source with a little bit of oomph, with nothing to limit the current.
A very easy mistake to do, as you no doubt know by now.
Because of this, any multimeter worth its salt has a fuse on the current measurement circuit(s).
Since the volt- and ohm meter circuits are separate high impedance circuits, they don't need to be fused, and will likely still work, even if you blow the current fuse(s).
This means that you can pull the fuse(s) out and measure them with the ohm meter on the same multimeter. A good fuse should have very low resistance, a blown fuse should have infinite.
When replacing the fuse(s), get good quality ones. They should be filled with sand, so that they don't explode if you accidentally short (e.g. try to measure the current across) the mains or other high energy sources.
Here is a text from Fluke explaining why using quality fuses is important.
|
H: Confused with figuring out this piezoelectric sensor
I have this impulse-hammer with this specific model data-sheet.
It has output through BNC and if I hook it up to a scope or a daq board, I see nothing but some 50Hz noise when the hammer is hit. There is no direct output.
But when I use this hammer with this amplifier I get proper readings.(I don't know it is the proper type of amplifier for this hammer but it worked)
After I read this document I'm further confused.
Does this hammer have any built in amplifier in it?(Is it charge type or voltage type?) The data sheet says 100mV/LBF but I get no signal without amplifier.
What type of force sensor is it?
AI: A dedicated analog amplifier gives also the power supply. Probably is kind of DC voltage applied to BNC connector, like suppy for old style antenna amplifiers. The signal then, has to have a capacitor to isolate the DC, so you get only AC measurements. These are my tougts , only.
IN the datasheet you will find a power supply of 6mA for dedicated amplifier, and the sensor accepts 8-40mA power supply, don't know how.
|
H: Motor driver chips only work one time?
I have the following chip (DRV8833)
Technical documentation
The inputs work the following way
And i have connected it the following way (I think)
simulate this circuit – Schematic created using CircuitLab
It worked the first time i turn everything on and toggled the GPIO pins, but the second time i started everything up nothing works and the same thing has happend to me with a DRV8838.
So i must be doing something totally wrong to render the chips unusable but what?
I have checked all connections with a multimeter by putting a cable in the breadboard and testing the connection between it and the each pin on the chip (moving the cable for each pin).
I have also tried to connect the motors to the power source and they work.
AI: Figure 1. The datasheet shows the current sense resistors.
Figure 2. Since the resistors are in the path to ground omitting them isn't an option.
Figure 3. A close-up of the missing resistors.
Section 8.3.3 explains the operation of the circuit mathematically.
The PWM chopping current is set by a comparator which compares the voltage across a current sense resistor
connected to the xISEN pins with a reference voltage. The reference voltage is fixed at 200 mV.
The chopping current is calculated in Equation 1.
$$ I_{CHOP} = \frac {200 \ \text {mV}}{R_{SENSE}} $$
Example: If a 1 Ω sense resistor is used, the chopping current will be 200 mV/1 Ω = 200 mA.
Now recalculate if you omit the resistors. RSENSE becomes infinity so ICHOP becomes zero.
Use the formula to calculate an appropriate resistor value.
|
H: Logisim ROM Output not matching address input
I'm getting this really weird problem when trying to use the built in ROM chip in Logisim. First off, even though I specified a 16-bit data bit width, the ROM only stores 4 bits per address (isn't this supposed to be 16 per address?).
When I specify an address (input), instead of displaying the output 4 bits, it seems to display some bits in some places and not in others. It's a little hard to describe because each time I switch the address I get a weird output that I don't expect and I can't figure out what methodology the ROM is following for displaying output. Here is one situation in the picture below where the input address is 15, and the output is a 0001000100010001. The address 15 currently stores 1111, and I have no idea where the zeros come from and why the 1's are spaced out like that. I must be misunderstanding something about this. If there are only 4 bits per 15 bit address, how does this work?
AI: The values stored in the ROM are being displayed in hexadecimal, not binary. Each hexadecimal digit is equivalent to four bits, and the hexadecimal digits 0 and 1 are equivalent to binary 0000 and 0001.
|
H: Change laptop 5.5mm barrel connector
I'm looking to replace the female 5.5mm barrel jack connector on my
laptop with a female USB C connector. The replacement USB C port need
only provide power and nothing further. I'm not sure how to go about
this. I've never modified anything electronic before, soldering is new
to me.
The model of the laptop is a
Lenovo X230t
My hope is that the scope of the project is just:
Open up laptop.
Remove old jack.
Solder on USB C jack.
Get USB-C AC adaptor with matching DC output for laptop.
What I want from y'all are:
An understanding of the difficulty of doing this: the time and money
costs of this project. Time covers any time spent doing the actual
task and learning skills that I'd need to learn to do it competently.
Is the project more complicated than the steps listed above? If so,
how?
Some suggested contributions to satisfy these goals are:
Pointing out difficulties that I will face outside of the above
listed hopeful project scope. For instance, saying that I'd have to
modify something on my motherboard, or I'd have to add something else
after the USB C female port so that power from the port can go to the
motherboard. This will help me ask further questions about both the
time and money costs of dealing with these problems.
Giving a solution to one of the pointed out difficulties and giving
some estimate of the time/money costs involved in carrying out the
solution.
Helping me understand the skills required to carry out this plan (I
assume soldering is one). If the project would involve more detailed
knowledge than "connect this wire to that other wire", then I'm out of
my depth, and I wouldn't know what to do or where to look to gain
those competencies.
Giving a the broad strokes of a plan to work this project, from
start to finish. That's
The steps of the plan, stated in general terms ("solder this",
"buy that", "attach blah blah thing"). I ask only for broad
strokes because detailed plans are time consuming to create, and
it would be easier to prepare some of these details in conjunction
with me, so you can get an idea of the sort of things I can
do/learn quickly.
A list of the materials involved and where to obtain them (as
best as you can). If you can't provide a location, please try to
provide an approximate price and/or the sort of retailer that may
sell the item (like "hobby shop" or "old pc parts store" or
something).
This is a somewhat similar question:
Replacing a 5V female barrel connector on USB hub with female USB micro
PS: Another possibility might be some sort of adaptor from USB C male
to 5.5mm barrel male that would provide the correct amount of power.
This is okay, but not desired. I have to replace the barrel jack
itself on my laptop anyway. The plug of my AC adaptors doesn't hold
well in them. But if this method is significantly easier than
replacing the connector altogether... then I'll probably do that.
Edit: My original intent was to get/construct a magnetic connector for an older laptop. To that end, I've found the following sources, which make these connectors for a barrel-jack-style plug:
https://www.instructables.com/id/MagSafe-for-the-Rest-of-Us-A-DIY-Magnetic-Power-A/
https://www.instructables.com/id/ThinkSafe:-A-Magnetic-Power-Connector-for-Thinkpad/
https://www.instructables.com/id/Magnetic-Laptop-power-connector/
I was surprised to find these, given that magnetic connectors for power cables are supposed to have a very broad patent on them.
AI: My hope is that the scope of the project is just:
There are several problematic points in your "scope of the project". Let's go point-by-point:
(1) Open up laptop.
Okay, no problem here.
(2) Remove old jack.
Okay, doable as well, with certain care and right tools like hot air pen (since the connector might have through-hole legs across a thick ~12-layer PCB.
(3) Solder on USB C jack.
Here the problems start. Type-C footprint is very tight, and there is 2500% probability that you can't fit the old footprint. You will need to use some interposer mini-board, and glue it somehow into the old place. Mechanical properties of this rework will be highly questionable, and the new Type-C connector will likely fall off after 10-15 insertions. But this is still doable. However it won't be functional unless you add proper pull-downs and other sophisticated electronics to it, see below.
(4) Get USB-C AC adaptor with matching DC output for laptop.
Now this is a real problem. Your laptop has likely something as 19-20-V input for normal operation. If you plan to get a "USB-C AC-DC adapter", this is not going to happen, even it would list "matching DC output" as one of its output options. The reason is that any Type-C adapter-charger must have a Power Delivery negotiation protocol in place, to move form the default-safe initial +5V level to higher power profiles. More, initially a Type-C charger-adapter won't output ANY VOLTAGE at all until the Type-C cable will see 5.1k pull-down on CC lines (which you should have after attaching your new Type-C connector).
The second hurdle will be PD, Power Delivery. Unless you get a set of special ICs, hook them up to CC line and program them for desired PD profile (19-20 V 3 A or something), a normal Type-C adapter won't give you the desired power.
One thing you can do is to get the fixed-voltage (your old) AC-DC adapter (19 V 3 A) and replace the native barrel plug with Type-C plug. However, in this case you are seriously risking to fry many other Type-C gadgets if somebody accidentally will plug your modified self-made Type-C charger into them, at least Type-C smartphones will be 98% fried, since they wouldn't have the tolerance to 20-V profile.
ONE MORE: The ThinkPad X230T laptop has three-pin connector,
The third (center) pin is used for power identification of the adapter. I am not sure which method is used, but you will need to emulate proper conditions (analog level or serial protocol) before your laptop will resort to full functionality.
I feel somehow that at this point you will abandon this project, so the IC sourcing and pricing won't be needed.
|
H: Why does this dimmer switch have reduced wattage capability for LED / CFL bulbs?
The Lutron "Maestro C•L" dimmer has different wattage ratings depending on the type(s) of bulbs being controlled. Its an electronic dimmer.
Specifically, when 100% incandescent or halogen it can handle 600 W, but when 100% LED or CFL only 150 W, with a gradual variation between these extremes for mixed bulb types.
Info from the specification sheet:
(The wattage capability also varies based on the # of "sides removed" though I can't see in the docs what that means.)
Source: http://www.lutron.com/TechnicalDocumentLibrary/369613a.pdf
What is the reason for the degraded wattage capability when running LED bulbs?
And is this variation in wattage capability typical of this sort of dimmer?
AI: Since dimmable LEDs don’t use active PFC for cost reasons, the peak/average current is much higher, called the crest factor, so conduction losses demand this de-rating of power limits in a Triac dimmer.
The last page gives examples of multiple dimmers on the side and why that causes further derating by how far “removed” from the load to line a configuration is possible. “Removed” here means shifted away from power input by cascaded dimmers.
|
H: ac voltage added to dc base line
I began to read up on transistors, which led me to this post on electronics stackexchange.
At the end of the original post, the question asks "the voltage at the base would be a sine wave with the DC bias as the baseline, correct?"
I understand the V2 with the two resistors in series is a voltage divider.
I am struggling to see how at the node connected to the base, the voltage is going to be simply the sum of V1 and V2, resulting in the AC signal superimposed on the DC signal from V2.
I think I can best express my confusion in the form of the second image below.
The voltage between the capacitor and GND is ground no matter the input oscillating voltage before the capacitor.
Then why should the first case be the sum of the AC from source 1 and DC from source 2 ?
-----p.s.------
Also, I remember playing with small batteries as a child. When I put hooked up those batteries of the same voltage in parallel, the voltage output was the same as having a single battery, which I believe is kind of like the first case. (So why should it be the sum of the two voltage sources in the case of the first image?)
AI: In the first circuit, if properly chosen, C1 will charge to the average voltage difference between the base and V1. If V1 is average zero, it will charge to 0.5V. The time constant will be 50 ohms * C.
The Thevenin equivalent of the resistors and 1V source is a 0.5VDC source with 50 ohms in series. If the impedance of C1 at the frequency of V1 is much lower than the 50 ohms, then most of the voltage appears at the base.
We know Xc = 1/(2*pifC) so C >> 1/(2*pi*1kHz*50) = 3uF. So suppose C is 30uF, then the time constant to charge will be 1.5msec and after 10msec or so it will be almost fully charged.
Here's a simulation with the AC voltage at 100mV peak and C1 = 30uF (and ignoring the base impedance):
When the voltage sources are first applied, the capacitor is assumed charged to zero volts, and it takes some time to charge to close to the final voltage.
|
H: ARM Cortex cores with peripherals, basic requirements
I've been reading a lot of stuff about using ARM tool chain to build applications for different microcontrollers including ARM cores. Right now, I've been using the fairly easy route with Atmel Studio 7 for xmega devices.
I understand that header files are provided by Atmel Studio 7 for their devices (in my case, the ATSAME70Q21.h or the XMEGA64A3U.h for past projects) which points to all the peripherals available in the microcontroller.
My question is, what is the bare minimum header files required if I have a ARM cortex based microcontroller with it's peripherals? Can I build directly with CMSIS? But as CMSIS seems to be only an API for standard ARM core processors, what happens with the peripherals (like UART, I2C,etc..), do I even need a header file definition for a particular device? If I build over CMSIS, does it mean I could easily port my project from say an Atmel ATSAM to an STM32?
I see these blocks but I don't quite understand how they piece together:
The ARM tool chain for compliling
Vendor specific header files for peripheral definitions.
CMSIS core
CMSIS implementations? Where are they?
And let's say a CMSIS implentation doesn't exist, how much am I screwed? Can I write this myself based on the datasheet, or is it just a waste of time?
Quite a lot of questions in this post. That show how much I am confused. I like using Atmel Studio, but I prefer when I can do projets from the bare metal and understand how the piece fit together instead of relying on magic code that could vanish in a future version of the IDE.
AI: This is a nice question. I was also confused when I first started working with ARM-based microcontrollers. You can certainly write code directly using the reference documentation. I do, and in my case, I find it simpler than trying to use the libraries.
On the ARM Web site you will find:
The ARM Cortex-M7 technical reference: https://developer.arm.com/docs/ddi0489/latest/preface
The ARMv7-M architecture reference:
https://developer.arm.com/products/architecture/cpu-architecture/m-profile/docs
There is considerable overlap between the above documents, I find myself using the architecture reference manual.
These documents are clearly written, and you will find reference information about the key components that are common to all Cortex-M7 implementations and ARMv7-M implementations (the Cortex-M4 and Cortex-M7 are both ARMv7-M implementations). I used the documents to write the part of my firmware that deals with the ARM processor, interrupts, memory protection, and caches.
You asked about the compiler toolchain. ARM posts current releases of the GNU toolchain for ARM at: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
I use the Atom text editor, and configured it to compile using the GNU ARM toolchain. That works very well.
For your specific microcontroller - in this case the Microchip SAM E70 series - the Microchip datasheet describes all the peripherals and registers. You can program directly to that.
In the case of ST Microelectronics STM32 processors, the ST Microelectronics datasheet describes only the component itself. A separate technical reference manual describes the programming details of the peripherals and their associated registers.
When I started, I referred to the CMSIS and vendor library source code when working out the sequence to bring up the microcontroller. Since then, I have not bothered. The reference manuals are sufficient.
You certainly can share source code for the ARM processor between any Cortex-M7 implementation. The Cortex-M7 and Cortex-M4 are close enough that a single set of source code works for both. So, with a little care, your code for the ARM processor itself will work on any Cortex-M4 and Cortex-M7 processor.
The code for the ARM processor core is likely to be a very small part of your software. Most of your microcontroller-specific code will deal with the peripherals.
The Microchip and ST Microelectronics peripheral implementations are not necessarily similar. I glanced at the Microchip SAM E70 USART peripheral description, since recently I have been implementing USART code for the ST Microelectronics STM32L4/4+. The peripherals are very different, I can't imagine that there would be any significant code sharing between firmware for the Microchip SAM E70 and the ST Microelectronics USARTs.
To me, the most confusing code was that which dealt with startup. A reasonable startup sequence is something like:
The first steps deal with the ARM processor core, use the ARM manuals for reference:
Initialize processor (enable floating point instructions, disable and clear caches - the processor reset does not clear the caches, this must be done in firmware).
Enable processor components (caches, MPU, NVIC, etc.)
The following steps deal with C/C++ runtime and with memory layout:
Initialize C/C++ runtime system (static variable initialization, etc.)
Initialize any memory allocation
From this point, standard C/C++ code will run.
The following steps with with the microcontroller peripherals, use the microcontroller reference documentation:
Initialize microcontroller clocks (component-specific). Until this point, the processor has been running on whatever clock is used at reset.
Enable the ARM processor SysTick clock. This clock is part of the ARM architecture (see the ARM manual), but is clocked by the microcontroller clock, so it runs at the correct rate only after the microcontroller clocks have been initialized.
Enable microcontroller peripheral clocks for the peripherals you want to access.
Now you can access each of the peripherals of interest.
As a detail, the microcontroller may offer a clock output (ST Microelectronics STM32 processors call this 'RCC MCO'). For debugging, I find it useful to enable this specific pin during clock initialization (which on some microcontrollers requires enabling the associated GPIO peripheral clock), because then I can use an oscilloscope to monitor the clock being used. I can see each clock come up at the correct frequency. After the clocks are running properly, everything else is easy.
|
H: MOSFET vs. relay power efficiency
Newbie question here. I am putting together a remote switching box for power circuits aboard a yacht. The design is for a central Raspberry pi to send orders to a few boxes, each controlling a number of circuits distributed through the vessel. Each box will contain an Arduino communicating with the RPi using XBee.
Each circuit will have a typical draw of a couple A with a max of 15 A. Typical switching frequency will be very low with some circuits staying almost always on and others almost always off.
My question is for the actual switching, should I choose relays or MOSFETs? My question is specifically around power conservation which is a primary concern on a sailing vessel. Given the high heat output of the MOSFET, am I correct in assuming these are wasteful components? More so than a relay?
AI: Your choice depends on a lot of things:
Are you switching AC or DC?
What is your switching voltage? (5/3.3V from a microcontroller? 12V from a battery? You mentioned and Arduino/RPi/Xbee but what exactly is doing the controlling, and is there any other power sources available?)
Switching speed
Thickness of your wire (how much power have you already lost from just copper losses?)
Efficiency is much of a muchness, and while relays might "seem" more efficient because they are a galvanic contact, that is definitely not the case. Just now with a quick google I found a relay with 0.1Ω of resistance rated for 15A (here). This gives a power loss of:
\$ P = I^2 \times R = 15^2 \times 0.1 = 22.5W \$
On the contrary, I also just now found a MOSFET with an on resistance of 0.005Ω (here). This gives a power loss of:
\$ P = I^2 \times R = 15^2 \times 0.005 = 1.125W \$
Yes - you can choose a higher-rated relay and that will have a lower contact resistance, and probably you will find one even more efficienct than the MOSFET. But that will cost more. Is cost a concern? The list of factors goes on.
Just goes to show you can't assume anything. If you give more details of your project I can help further and edit my answer, but for now it's very open-ended and frankly, depends on a lot of factors you haven't mentioned.
|
H: Voltage drop on diode
(0.5V ---- 100R resistor --- diode --- gnd)
How do you figure out voltage drop on this diode? (Lets assume forward voltage of this diode is 0.7V)
AI: To answer your question, what is the diode voltage drop with Vin=0.5V with 100Ω in series?
My answer
430mV with 70mV drop on the resistor from 700uA for an ideality factor of 1.
You cannot figure it out without some assumptions on the Ideality Factor or knowing the current in the diode.
more
In addition to other fine answers, looking at common Silicon diodes with Ideality Factors other than 1. (@analogsystemsrf previously illustrated if Ideality Factor=1, then the diode voltage rises 58mV/decade in current @ 25'C.
The important thing to remember is that it is continuously logarithmic over at about 4+ decades of current. For simple applications, this log. characteristic may be limited by noise at the lower limit and linear behavior from internal resistance, Ri at the rated current, although not often stated in datasheets.
From the datasheet curves, the log Vf/If slope and Ri may be computed near rated DC current.
After repetition, you remember for future use he values for 2 common diodes;
1N4448 rated for 0.1 Adc @ 1.0V ... Vf/If= 113 mV/ decade (If), Ri= 600 mΩ
1N4005 rated for 1.0 Adc @ 1.0V ... Vf/If= 140 mV/ decade (If), Ri = 66 mΩ
Notice that the current rating and Ri product are similar. This is not coincidence. (meaning high the current rating , lower the Ri internal resistance.
The higher current diode here also has a higher Vf/If slope.
Now if you put a sawtooth current source into a diode to plot voltage by using a large series resistor and voltage, you get this.
So in short, we use 0.7V for diode drop for convenience.
But it is hardly a hard switch, but still very effective.
|
H: Confusion with signal/source being low or high impedance
Regarding the following excerpt:
High impedance source gives you more volts and less current
Low impedance source gives you lower voltage but more current
What is meant by low impedance source and high impedance source here?
By "impedance" is it meant the output impedance? If so how is that relates to the source utilizing more power? How to comprehend this by circuit model? I came to this confusion after reading about piezoelectric amplifying techniques.
AI: I don't agree with those statements by themselvas they intend to be generically true but they're not. If a sentence was added like:
Given two sources providing the same amount of output power,
one having a low output impedance and the other having a high output impedance
Then:
High impedance source gives you more volts and less current
Low impedance source gives you lower voltage but more current
Here's an example of both:
simulate this circuit – Schematic created using CircuitLab
Here the load and source impedance are the same, that's because I want to extract the maximum amount of power from the source. Both sources will deliver 2 Watts each.
Note how the power in my load resistor is 1 Watt in both cases. In the high(er) impedance case, the voltage is 10x higher but the current is 10x lower.
|
H: STM32 Anti-tamper pin deactivation
I am working on a project that uses the STM32 Cortex M3 LQFP48.
There is a pin for Anti-tamper (PC13).
I am not concerned with anti-tamper security as this is just a home project.
How can I deactivate this feature on my chip?
AI: This is covered in the description of the backup control register BKP_CR:
As you can see, if the TPE bit is not set the TAMPER pin is free to be used as general purpose IO. Only setting that bit will change the function of the pin to the tamper detection.
And the reset value of the register is 0x0, so the default value is to start as standard IO and not as tamper pin.
So under normal circumstances, you don't have to do anything special to make use of that pin.
|
H: What is the purpose of the Load transistor in a TTL Logic NOT gate?
My professor presented the NOT gate in the Transistor-Transistor logic as the following:
Where V is always 5Volts. The two symbols are MOSFETs N-type transistors. The first transistor (which is always conducting) is called the Load transistor, and the second is the one who really does the logic operations. (By first I mean the top one, and second the bottom one).
What I'm unable to understand is why does this Load transistor exists. Can't we just plug the Drain of the other transistor directly in V? Why do we have to add a transistor between them?
Thanks in advance.
AI: Compare these two circuits:
simulate this circuit – Schematic created using CircuitLab
In which one(s) do you think the meters VM1 and VM2 can be made to show a voltage other than V = 0 Volt ?
In circuit A the NMOS1 can conduct some current so that the voltage at "out" can increase. Then VM1 can show a voltage larger than 0 Volts.
I think that in circuit B there is no chance at all of the meter VM2 showing anything but V = 0 Volt. Do you agree?
Update
OP suggested this as a "fix"for circuit B to make it work again
simulate this circuit
Look carefully at the circuit, note how Drain-Source of NMOS3 and VM2 are in parallel with the battery. The battery is ideal, it outputs Vbat, no matter what. Can NMOS3 then still influence the voltage across VM2?
Also note how "out" is now directly connected to the battery, so what can we then say about the voltage at "out"?
|
H: is a voltage regulator required for atmega328p when powering from boost converter at a set voltage?
I know that linear voltage regulators are more accurate at holding the required voltage but the boost converter i am using seems to keep a pretty steady one. the voltage will of course be within the chips requirements.
what would be the main drawbacks of not using one?
AI: is a voltage regulator required for atmega328p when powering from boost converter at a set voltage?
No it is not.
The ATMega is "just" some logic circuits in a chip.
So is the CPU in your PC and in your smartphone. Both of these are powered directly from switched regulators (usually buck converters but that doesn't matter that much) and they work fine!
As long as you keep the supply voltage of the ATMega chip within the specified limits (see the manufacturer's datasheet, from my memory it is 1.8 V to 5.5 V) then it will work as long as there is not too much variation (ripple) on the supply.
To keep the ripple in check, any boost, buck and linear regulator has at least one decoupling capacitor across its output. The ATMega chip also needs it's own decoupling capacitor. It is good practice to place at least one near each supply pin.
The accuracy of the supply voltage is not that relevant. The logic will work just as well at 3.456 V as it will on 3.3000 or 5.0000 Volts.
The only exception can be if you use the build-in ADC of the ATMega. This ADC can use the supply voltage as its reference voltage. If the supply is not accurate then the ADC's output data will not be accurate either.
There is a build-in more accurate reference for the ADC that can improve this.
You can also use an external reference voltage if you like.
Also if you would use the PWM output function, filter the PWM signal and want it to be accurate then also it will be as (in)accurate as the supply voltage.
But in general, if you need this then you would know and take precautions.
Oh and there is no reason to assume that switched regulator (boost or buck) are in any way less accurate than linear regulators. It depends on the model (chip, circuit) you're using and if you calibrate it or not (measure the voltage with a known accurate meter and then adjust to the right voltage). Both linear and switched can be as bad or good as the other.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.