text
stringlengths 83
79.5k
|
---|
H: Wien Bridge Oscillator using OpAmp(LM386) works in simulation, but doesn't work in Breadboard?
This is a simulation of the circuit in multisim. It is a Wien bridge oscillator circuit, tuned at 1844Hz. I am mostly interested in generating sound of that frequency. It seems to work here in simulation but when I connect a speaker to the output, I dont get anything. Connected a LED as well, im getting nothing.
I am not sure where the problem is. Is the supply voltage of +/- 6V a reason? I am using a 12V power supply, split in half through virtual ground technique.
Any idea on where the problem might be? How can I fix it to make some 1844hz sound with a speaker?
AI: The LM386 is not an op-amp, it is a speaker amplifier chip. So it does not work in a circuit that is built around an op-amp. |
H: Connect the oscilloscope to equipment with a common neutral and ground
I watched a video. At 3 minutes, the situation is shown when neutral and ground are joining. Why can this be dangerous? If we are talking about an oscilloscope, the crocodile must already be connected to the earth and nothing threatens me. The way I understand the connection, I showed in the picture. Is it possible to get "tickled" with such a picture?
AI: Say that you incorrectly clamp the GND of the probe in the T1 of your "DUT", if your oscilloscope is floating, then all its grounded metals and shielding become a direct contact to the live wire. And you can get "tickled", as you said yourself.
In the picture you drew the GND probe was disconnected from the GND/Neutral conductor, but the measuring probe is still connected to the live wire. In that case, your oscilloscope will be referenced to the live voltage (if you measure the voltage with a multimeter from ground (earth) to any point on the oscilloscope circuit it will be "about the same" as the live wire).
I think your confusion (at least looking at that ball with L G N) stems from you thinking the GND of the oscilloscope is connected to the GND of the house wiring, which in that video is not the case (the oscilloscope is floating, no connection to the power outlet ground pin). |
H: Powering my 5 volt project with AA batteries
I am thinking about using 1 AA Battery with these battery holders and this boost converter to power my 5 Volt arduino project, My project will pull about 100mA. Is there any problem with doing this? I don't see any issue with using these together to power my project, but I wanted to get other's opinions that before I buy these products. Thanks for the help!
AI: What's your run-time requirement? With 100 mA @ 5 V that's 0.5 W. Assuming an efficiency of maybe 80%, that means the input current from your 1.5 cell (say at 1.3V average voltage) will be 416mA, rising to 625mA at 1V cell voltage.
Your boost converter operates down to 1V, so looking at the discharge curves for a typical AA alkaline battery gives a run time of maybe 3.5 hours or so. |
H: Antenna Array - Hundreds of elements forming thousands of beams - How?
How would an antenna array of 100 elements be able to form 5000+ simultaneous beams?
Or do I have it wrong, there would only be a maximum 100 beams from the 100 elements at any one time and those 5000 potential beams are realized by hopping the 100 elements over the area so each of the potential 5000 beam gets a fraction of time from 1 element?
AI: If you control an array of 100 antennas and are able to control the phase (and ideally, amplitude) of the signal of each of them, you can produce beams in arbitrary directions. That really means that you can point in any direction.
Looking at this as receive beamformer. Let \$w_{\phi,i}, \, i = 1, \ldots 100\in\mathbb C\$ be the individual antenna weight to point the beam in direction \$\phi\$. \$x_i(t)\$ is the antenna $i$ receive signal. Then, the beamformed receive signal \$y_\phi(t)\$ is
$$y_\phi(t) = \sum\limits_{i=1}^{100} w_{\phi,i}\cdot x_i(t) = \mathbf w_\phi^T \mathbf x(t)\text, $$
if written as elegant vector product.
Now, obviously, you can do that for other angles, such as for angle \$\psi\$,
$$y_\psi(t) = \sum\limits_{i=1}^{100} w_{\psi,i}\cdot x_i(t) = \mathbf w_\psi^T \mathbf x(t)\text. $$
Putting these beamformed receive signals in a receive signal vector instantly yields the elegance of the beamforming matrix \$\mathbf W\$:
$$\begin{pmatrix}y_\phi(t) \\ y_\psi(t) \end{pmatrix} =
\begin{pmatrix}\mathbf w_\phi^T\mathbf x(t) \\ \mathbf w_\psi^T\mathbf x(t)\end{pmatrix}
= \begin{pmatrix}\mathbf w_\phi^T \\ \mathbf w_\psi^T \end{pmatrix} \mathbf x(t)= \mathbf W \mathbf x(t)$$
There's no restriction on the number of rows in \$\mathbf W\$, so you can have arbitrarily many received beams as you want.
In transmit beamforming, the same applies. The only constraint there is that the sum of all the beamformed signal vectors needs to still be small enough to allow your transmitter to transmit them. |
H: 10V voltage with raspberry and arduino
is there a simple way to connect the 5V pins of the Arduino and the raspberry pi in series to get 10V ?
Thanks
AI: No. The pins are already all connected in parallel, you can't change that. |
H: Strange measurements for Vrms in LTspice
For my experimental methods class (basically an intro to electronics) in university we had to simulate a circuit, which was nothing out of the ordinary, it just produces different sine waves of 2 volts peak to peak. However, what was interesting to me was the fact that, when reading the measurements that the software produced for the Vrms, it seemed to depend on the frequency, contrary to the theory.
Of course, I expected the measurement to be different to the theory, given that simulating it with a computer probably introduced limitations. What I didn't expect was for it to behave so weirdly, having these peaks where it would rapidly decrease and increase again, and ultimately converging to around 702.42 mV, which doesn't make any intuitive sense to me.
I thought that the measured voltage would just stray arbitrarily far from the ideal one, but was surprised when that wasn't the case.
So, why does this happen? It might be a stupid question but when I saw this I got curious and couldn't come up with an explanation by myself (I'm not too far into my studies, so that might be a reason).
Thanks in advance!
AI: Not a stupid question in any respect, as you learned, Vrms should be frequency independent. And it is, your simulation is just reporting wrong values. There is a comment that says it's not a lot of variation, but I disagree. There should be no variation, much less 0.7% error for an experiment like this. You should be questioning this kind of thing. This pattern looks strange if you don't know what's happening.
Knowing the limitations of your tools and how to remedy them is important. Your LTspice program tries to do things quickly. It doesn't want to simulate 10 million points. It wants to do the least work to do the job. As a result, sometimes you will lose some precision.
As an example, lets say LTspice generates 1k datapoints total for your 100Hz wave. Over your simulation time of 50ms, you have 5 total cycles (periods) of that wave. Each full cycle gets 200 points.
Now, lets bump up the frequency to 1000Hz. Let's also say you still only generate 1k datapoints. At 1000Hz, you fit 50 total cycles in your simulation time, resulting in only 20 points per cycle. This loss in resolution makes the waveform more 'jagged', and might result in invalid measurements.
Notice in the figure below the red waveform (especially the peaks) look more pointy than the blue waveform. That's because there are less data points per period for the red waveform, so there is some interpolation going on.
LTspice is a bit more complicated than just simulating a flat 1k datapoints. It has some special sauce in it that if it sees a lot of change it will dynamically change the timestep and start to simulate points closer together. If nothing's happening it may start simulating points further away. This is to save computational power while providing decent accuracy. But sometimes you need to sacrifice some of that speed to get good results.
Now how do you fix this? One, you can force LTspice to have a minimum time step. This will give you control over the minimum distance between datapoints.
You can also change your simulation time so you only see a few periods of the waves.
Below I have a figure of my RMS measurements of a 1kHz wave. Both ways get you 0.707 Vrms. My max % error is 0.01%, 70 times less than the original.
If your lab instructor planned this, they are pretty good. They are showing you that simulations have idiosyncrasies that you need to be wary of. I will be stealing this for when I teach, give your instructor my regards. |
H: HX711 chip not working
I'm working on an electronic weight scale using MSP430 and I need your help:
I've written the code using Energia and I've used the HX711 module for testing and everything works just fine. The final project requires everything being on a single PCB, which means I had to give up using the HX711 module (I have to only use the HX711 integrated circuit.) I've remade the schematic that was on the module (see the attachment below.)
I've done some measurements on the circuit and here's what I've discovered:
The Vsup and Dvdd pin are set to 3.3 V as expected.
Base has 2.6 V.
AVDD, VFB and AGND are all equal around 0.7 V.
Also the VBG is 1.8 V.
The schematic is identical to the one attached, but because AVDD and AGND are equal, the voltage that arrives at the load cell is equal to AVDD - AGND which is zero, so I think this might be the issue; I just need a second opinion from you guys (and ways that I can raise that differential voltage.)
AI: I think in your schematic that you haven't tied AGND into proper GND: -
The above is a sample circuit I found on google that clearly shows that AGND connects to a GND symbol and your circuit doesn't appear to. There may be other errors too but this is the most obvious.
Red box and red AGND are my additions to make it clearer to you.
Here's another schematic that confirms this error is quite common: -
Notice the AGND label on the node that goes to the pin named AGND - nodes that are labelled need to be connected.
Picture taken from this forum that also have folk getting confused about the same issue - node names imply connectivity and, it seems, a few folk have just copied the circuit without looking at the data sheet.
And, if you look at the Sunrom schematic directly above where you picture came from you can see all the 0 volt connections inside red boxes (my addition): - |
H: How to control RMS output of an DC-AC inverter?
Is it possible to design an inverter, with 270V DC input and RMS output of 115V. I don’t want to use a chopper or a transformer. Is it possible to meet this requirement by using PWM only? Or chopper/trafo is a must for this case?
I am using SPWM and I have already applied a modulation factor of 0.5, still not getting 115Vrms
Edit: My inverter is working. But the RMS value at the output is higher than my desired value. How do I reduce the voltage RMS value of the inverter?
AI: Yes it should be possible.
A 115Vac waveform has a peak voltage of 162.6V. If you assume an ideal inverter (no volt drop due to conduction or deadtime on the inverter..), the peak output voltage that can be generated is 270V ~ 190Vrms single phase waveform.
I mention single phase because this is key. A 3phase, 115V phase voltage rectified would produce ~270V and thus if you wanted to re-invert back to 115Vac you are now entering into the world of ideal cases.
Lets proceed with a DC-link of 270V and a need to generate single phase 115Vac. This requires a modulation depth of 60% ( \$ \frac{\hat{V_{o,pk}}}{Vdc} = \frac{115\cdot \sqrt{2}}{270} )\$
Consider an inverter as such:
This produces an output like:
Which meets your stated needs. There is plenty of margin in your modulation to overcome real-world drops: output semiconductors, deadtime, output filter.
It is stated that you are achieving higher than 115V output. The simple option is to reduce the modulation depth but it is worth investigating why it is higher. It is possibly due to light loading, higher DClink voltage than you expect or measurement error.
This is purely open-loop an will only generate a sinus PWM pattern. The actual output will be dependant on the DClink voltage: if there is a significant AC component then this will appear on the output waveform
A 20Vpk disturbance at 1/2 the output freq:
To resolve this you would need a closed-loop controller either around the DCLink or the output AC to provide additional corrective factor onto the PWM pattern. |
H: Determine transfer function from circuit with different currents
Just started on the topic Circuit Analysis, and am supposed to find the transfer function of the following circuit:
So I know I am supposed to use KVL to solve this problem.
I can first transform the circuit to:
From the circuit, I can see that because u*Vc is in parallel with the output:
$$V_o(s) = uV_c(s)$$
$$V_c(s)= \frac{V_o(s)}{u}$$
Using KVL,
$$V_i(s) = (I_1*R)+(I_3*R)+V_c(s)$$
where: $$V_c(s) = \frac{V_o(s)}{u}$$
Now the problem is, how do I exactly get I1 and I2 from the circuit?
New to this, thanks :)
EDIT: I crafted another KVL equation, as well as being able to determine I3.
$$V_i(s) = (I_1*R)+(I_2*1/sc)+V_0(s)$$
$$I_3(s) = \frac {V_c(s)}{1/sc}$$
AI: First thing I did was redraw the circuit. I added a node 'Vx' to help me solve.
(1)
$$I_1 = I_2 + I_3$$
(2)
$$I_1 = \frac{V_i - V_x}{R}$$
(3)
$$I_2 = (V_x - V_o) * sC$$
(4)
$$I_3 = \frac{V_x - V_o/u}{R}$$
Plugging equations 2,3,4 into 1 gives:
(5)
$$\frac{V_i - V_x}{R} = (V_x - V_o) sC +\frac{V_x - V_o/u}{R}$$
(6)
$$V_i = V_x (sCR + 2) - V_o(sCR + 1/u)$$
________
Now let's get Vx in terms of Vo. I do this using I_3
$$I_{3 (R)} = I_{3 (C)}$$
$$\frac{V_x - V_o/u}{R} = (V_o/u) * sC$$
$$V_x = V_o * \frac{sCR}{u} + \frac{V_o}{u}$$
$$V_x = V_o * \frac{sCR+1}{u}$$
______
Now, I have the rest done, but believe that you are capable of taking it from here. I think your roadblock was using Vx, which helped me get I1, I2, and I3.
Check your work by setting 'u' equal to 3, you should see some major magnitude peaking. For picture below I used R = 10kΩ, C = 1uF, u = 3. |
H: How to do serial communication between 3.3V and 5V devices using THT components?
I know that there are many questions dealing with logic level conversion/shifting between 3.3V and 5V devices, but my goal is to do do this with standard breadboard parts, so either discrete parts or DIP/DIL packaged ICs.
The serial communication shall take place between an ESP8266 and a device that outputs/receives 5V TTL, and the desired speed is 38400bps, so I'm not sure if a simple voltage divider will be up for this speed, the same goes for using 4N25 optocouplers.
I know there are ready-made solutions like this here from Adafruit available, I would prefer to use generic parts that are available long-term.
I have used a MAX3232CPE for a similar project converting 3.3V to RS232 levels in both directions, does something like this exist for 3.3V to 5V as well (and in DIP/DIL packaging)?
AI: The classic FET level shifter should do
simulate this circuit – Schematic created using CircuitLab |
H: Is this input-output relation correct? Schmitt trigger
OK, operational amplifier will want to keep node A at GND level. It will try to set its output so that the condition (inverting input potential = non-inverting input potential) is satisfied all the time.
So, why isn't a 5V of input mapping to -10 V which will hold node A at 0 V, but rather it is shown that +5V of input will result in +/- 12 V of output?
AI: OK, operational amplifier will want to keep node A at GND level. It
will try to set its output so that this(inverting input potential =
non-inverting input potential) happens all the time.
It's not negative feedback - it's positive feedback. That's how a schmitt trigger works.
So, why isn't a 5V of input mapping to -10 V which will hold node A at
0 V
It's not negative feedback. It's a non-inverting comparator with hysteresis. |
H: Deriving Wheatstone bridge equation
I have the following circuit:
Here I have obtained the equation of Ud = U * ((deltaR / R)/(4+2(deltaR/R))). But I'm stuck on the part on how to derive that formula.
Any help or guidance is appreciated. (mainly since my book don't have the answer to this question that is within it)
AI: Image taken from original question: -
$$V1 = \dfrac{U}{2} \space\space\space\text{and}\space\space\space V2 = U\cdot\dfrac{R+\Delta R}{R+R+\Delta R}$$
$$\text{therefore}\space\space V2-V1 = U\cdot\left(\dfrac{R+\Delta R}{2R +\Delta R} - \dfrac{1}{2}\right)\space\space = U_d$$
Keep on drilling down the formula to get: -
$$U_d = U\cdot\left(\dfrac{\Delta R}{4R + 2\Delta R}\right)$$ |
H: How to interface with an H-bridge IC (L298N) using a single PWM pin
I would like to know if it's advisable to control an H-bridge IC (L298N) using a single PWM pin?
Let me explain: By driving ENB pin High and by feeding complementary PWM (achieved by using a simple NPN transistor inverter circuit to invert PWM signal from Arduino) to IN1 and IN2, the dc motor connected to OUT1 and OUT2 is working (circuit schematic shown below).
In this setup, I am only using a single PWM: a duty cycle of 0% is maximum speed in one direction, a duty cycle of 100% is maximum speed in the other direction and a duty cycle of 50% stops the motor.
Apart from having a reduced resolution, everything seems to work. However all the tutorials online advise to use 3 pins to control L298N, with the PWM pin connected to ENB (for example this Tutorial). Why is this so? Is it not advisable to do what I did, using a single PWM pin?
AI: In this setup, I am only using a single PWM: a duty cycle of 0% is maximum speed in one direction, a duty cycle of 100% is maximum speed in the other direction and a duty cycle of 50% stops the motor.
That is not really what this is doing, no.
Is it advisable to control an H-bridge IC (L298N) using a single PWM pin?
By driving ENB pin High and by feeding complementary PWM
Generally, yes, if your H-Bridge has built in circuitry that eliminates the time during which both transistors of one side of the H-Bridge are on, then you can do that.
The L298N doesn't, so there's a short amount of time where the inverter hasn't inverted yet, but the uninverted path has already been toggled, where that happens. And that shoot-through can damage you H-Bridge, lead to catastrophic flyback spikes on the power supply line etc.
So, you need a better H-Bridge controller.
Getting an H-Bridge controller that isn't the L298N (and thus, from the 1970s) also allows you to omit the inverter, and go fully digital.
So, good approach, bad component. For example, TI has a pretty large portfolio of motor drivers. Some you can just instruct to do what you want, and don't have to do any PWM yourself. |
H: Resolving an issue with syntax in SystemVerilog
I am trying to build a 4:1 multiplexer using 2:1 multiplexers that I've built. I am getting a few errors whenever I try typing the command:
vsim mux4_test
Array connection type 'reg$[1:0]' is incompatible with 'wire[1:0]' for port (sel): can't mix packed and unpacked types.
** Error (suppressible): (vsim-3053) mux2.sv(19): Illegal output or inout port connection for port 'Z'.
# Time: 0 ns Iteration: 0 Instance: /mux4_test/m4a/mux2a/g6 File: NOT.sv
# ** Warning: (vsim-3015) mux2.sv(19): [PCDPC] - Port size (1) does not match connection size (32) for port 'Z'. The port definition is at: NOT.sv(3).
# Time: 0 ns Iteration: 0 Instance: /mux4_test/m4a/mux2a/g6 File: NOT.sv
# ** Error (suppressible): (vsim-3053) mux2.sv(19): Illegal output or inout port connection for port 'Z'.
# Time: 0 ns Iteration: 0 Instance: /mux4_test/m4a/mux2b/g6 File: NOT.sv
# ** Warning: (vsim-3015) mux2.sv(19): [PCDPC] - Port size (1) does not match connection size (32) for port 'Z'. The port definition is at: NOT.sv(3).
# Time: 0 ns Iteration: 0 Instance: /mux4_test/m4a/mux2b/g6 File: NOT.sv
# ** Error (suppressible): (vsim-3053) mux2.sv(19): Illegal output or inout port connection for port 'Z'.
# Time: 0 ns Iteration: 0 Instance: /mux4_test/m4a/mux2c/g6 File: NOT.sv
# ** Warning: (vsim-3015) mux2.sv(19): [PCDPC] - Port size (1) does not match connection size (32) for port 'Z'. The port definition is at: NOT.sv(3).
# Time: 0 ns Iteration: 0 Instance: /mux4_test/m4a/mux2c/g6 File: NOT.sv
And here's my attempt in doing it:
For 2:1 mux:
module mux2 (
input logic d0, // Data input 0
input logic d1, // Data input 1
input logic sel, // Select input
output logic z // Output
);
logic w1,w2,w3,w4,w5,w6,w7,w8;
NOT # (.Tpdlh(10), .Tpdhl(8)) g1(.Z(w1) , .A(d0));
OR2 # (.Tpdlh(2), .Tpdhl(6)) g4(.Z(w5), .A(w1), .B(w4));
NOT # (.Tpdlh(10), .Tpdhl(8)) g2(.Z(w2) , .A(d1));
OR2 # (.Tpdlh(2), .Tpdhl(6)) g5(.Z(w6), .A(w2), .B(w3));
NOT # (.Tpdlh(10), .Tpdhl(8)) g3(.Z(w3) , .A(w4));
NOT # (.Tpdlh(10), .Tpdhl(8)) g6(.Z(w7) , .A(w5));
NOT # (.Tpdlh(10), .Tpdhl(8)) g7(.Z(w8) , .A(w6));
OR2 # (.Tpdlh(2), .Tpdhl(6)) g8(.Z(z) , .A(w7), .B(w8));
endmodule
for 4:1 mux:
module mux4 (
input logic d0, // Data input 0
input logic d1, // Data input 1
input logic d2, // Data input 2
input logic d3, // Data input 3
input logic [1:0] sel, // Select input
output logic z // Output
);
logic w1,w2;
mux2 mux2a(
.d0(d0),
.d1(d1),
.sel(sel[0]),
.z(w1)
);
mux2 mux2b(
.d2(d0),
.d3(d1),
.sel(sel[0]),
.z(w2)
);
mux2 mux2c(
.d0(w1),
.d1(w2),
.sel(sel[1]),
.z(z)
);
endmodule
Testbench
module mux4_test;
logic d0,d1,d2,d3,sel[1:0], z;
mux4 m4a(
.d0(d0),
.d1(d1),
.d2(d2),
.d3(d3),
.sel(sel),
.z(z)
);
initial begin
d0=1'b0;
d1=1'b0;
d2=1'b0;
d3=1'b0;
sel[0]=1'b0;
sel[1]=1'b0;
#20
d0=1'b1;
d1=1'b0;
d2=1'b0;
d3=1'b0;
sel[0]=1'b0;
sel[1]=1'b0;
end
endmodule
NOT:
module NOT (
input logic A,
output logic Z
);
parameter Tpdlh = 1;
parameter Tpdhl = 1;
not #(Tpdlh, Tpdhl) not1 (Z, A);
endmodule
OR:
module OR2 (
input logic A,
input logic B,
output logic Z
);
parameter Tpdlh = 1;
parameter Tpdhl = 1;
or #(Tpdlh, Tpdhl) or1 (Z, A, B);
endmodule
AI: The 1st compile error I get is related to the sel port.
In module mux4_test, change:
logic d0,d1,d2,d3,sel[1:0], z;
to:
logic d0,d1,d2,d3, z;
logic [1:0] sel;
sel[1:0] (unpacked) is not the same as [1:0] sel (packed).
The 2nd compile error I get is related to the mux2b instance. Change:
mux2 mux2b(
.d2(d0),
.d3(d1),
.sel(sel[0]),
.z(w2)
);
to:
mux2 mux2b(
.d0(d2),
.d1(d3),
.sel(sel[0]),
.z(w2)
);
mux2 does not have d2 and d3 ports.
Your code compiles cleanly for me. I do not see errors related to the Z port; here is the code on edaplayground
We concluded that the Z error was a bug in the user's simulator. The OP updated to the latest version of ModelSim, and now all errors are gone. |
H: How the thyristor in a sawtooth generator reach its holding current?
In a sawtooth generator(circuit below) , the capacitor charges then when the thyristor turns on due to the bias voltage of R2 and R3, capacitor discharges to the thyristor like a short. Then after discharging the capacitor, the thyristor turns off and the capacitor charges again. This will form a sawtooth generator.
Question : "The thyristor turns off after discharging the capacitor", why would the thyristor reach its "holding current" and turn off when there is still a constant current coming from R1?
This current from R1 is approximately 100V/1kohm=100mA. Even if capacitor is fully discharged, this 100mA is enough to prevent the thyristor from turning off.
Since the thyristor act like a short(with small forward voltage), I thought current from R1 will short through thyristor thus the thyristor will never reach its holding current and will forever be on regardless how small the charge from the capacitor is.
AI: Here's my circuit: -
If I choose a generic SCR and set the hold current to be 110 mA (i.e. 10 mA above what V1 and R3 can deliver) I get this: -
Looking good!
If I set the hold current to be 70 mA, I get this: -
I think there is a great deal of justification in saying that the circuit in Albert Malvino's book: "Electronic Principles" (as portrayed in your question) is faulty. Of course I don't have that book so I can't tell you if there is some small print somewhere that says the holding current has to be above 100 mA for this circuit to work. |
H: Make 9v ups for router with TP4056 and MT3608
I am building 9v UPS for my wifi router using TP4056 lithium-ion charging module and MT3608 stepup converter. If USB power is available I want MT3608 to get power from USB (TP4056 Vin Pin) otherwise from battery (TP4056 Vout Pin). I don't have mosfet, So I am using diode Like this
IF USB power is avaliable does MT3608 pull current from higher voltage source (eg: from USB 5v rather then 4.2v from battery). Does this circuit will work?
Any suggestions?
AI: Does this circuit will work?
9v*0.5A = 4.5W. Boost converters work on power (with losses), so if 4.5W are going to the router, then at least 4.5W (lets say 5W) must come from the source. 5v/5W = 1A. So 1A must be available from 5V to get 0.5A at 9v.
USB-C might be able to do this, but to get that much power from a USB-C port, it would have to be negotiated using a special chip. Standard USB ports can only deliver 0.1A.
IF USB power is avaliable does MT3608 pull current from higher voltage source (eg: from USB 5v rather then 4.2v from battery)
The boost converter would totally be powered from whichever source was higher (after the voltage drop of the diodes.)
If attempted using a standard USB port, first it will try to run from USB, as that is higher than battery voltage. Exceeding 0.1A will cause the port to shut off, then the battery would power it. So it likely could be charged from the USB port, or operated when unplugged, but not operated while being charged. |
H: Proteus thermal exposed copper (opening) for the pcb layout
I am using Proteus 8.7 and I am so confused about how to make a power plane (copper pour) exposed .
I mean I want that area free from green mask so that It can make its use as thermal dissipation area. Which layer should I use to make this opening ? The layers I can use for the top side is "top paste" and "top resist" for this purpose . But I don't know which one would help me to achieve what I want .
AI: The paste (more properly solder paste) layer defines where solder paste is to be printed on the board during assembly. It's used to make the solder paste stencil.
The resist (more properly solder resist) layer is what you want. "Solder resist" is synonymous with "solder mask". I'm not familiar with Proteus, but usually solder resist layer is negative, meaning that if there's something drawn on that layer, then that's where solder mask will be missing in the completed design. |
H: Resettable fuse nominal
I've found a part which looks like this:
I found out that this is a fuse, but i can't find any information about nominal. I suppose that marking show allowed current, but what about multiplier?
AI: It's simply the same thing upside-down, as you can see in this datasheet (similar datasheet linked in @Marcus Müller's comment). |
H: How to find a compatible upgrade for a phone camera
I have a set of Android video glasses which are based on the PRIXTON C18 phone. I'd like to upgrade the camera to a better one - specifically one that supports changing the shutter speed as the current one does not.
I've tried a couple of different cameras from Ebay that look similar to the socket (right shape/number of pins) however they have all been too big or small to click in. Here's what the socket and old camera look like:
Socket on the android device
Camera
My specific questions are:
Is the socket type shown above a standard socket and if so what do I need to search for to find cameras which will be compatible?
If the socket type is standard, is it a plug-and-play type thing - i.e. will all camera devices that fit the socket likely just work?
AI: Is the socket type shown above a standard socket and if so what do I need to search for to find cameras which will be compatible?
No, at least not as far as I'm aware of.
If the socket type is standard, is it a plug-and-play type thing - i.e. will all camera devices that fit the socket likely just work?
even if it was, no, that's not how it works: you'd need to know the specific properties of each camera module. This isn't the cozy world of UVC USB webcams that "just work" because there's only a handful of profiles, and the camera reports its resolution and modes it supports itself.
Instead, this is probably a CSI2 camera, where you have variable number of lanes, bit rates, pixel formats, line reading orders, timings...
So, you need to modify your smartphone operating system to drive the new instead of the old camera (if your smartphone SoC can do that at all, even if the pinout is the same).
In short: no, you can't just upgrade a camera from a highly customized device like a smartphone without nearly design-level insights. I'm sure people have done it, but it's not within what I'd expect you'd be able to do without dedicated expensive measurement equipment, and an in-depth knowledge of how to modify your smart phone operating system image. |
H: 3.5mm jack signal splitter
I need a solution for listening to music from 2 headphones/earphones on a single mobile phone. Using a speaker could be an option buy my girlfriend wants it this way. Anyway, while looking for a solution, the only thing I could really find is DIY videos of people making a cable like this 3.5mm jack signal splitter. I'm worried this could affect maximum volume, or damage the earphones, maybe even my phone's audio output, as it would put two inputs in parallel, thus making the current larger. For this reason I've been looking for some low-power circuit that i could power with a smaller battery pack, probably with an amplifier with two outputs or something. I've been unable to find any that suit this criteria. I did find this circuit which seems like it could be what I need, but I'm not sure about how portable it is, considering it would probably need a separate power supply or something, since it works at 20-35V.
I would like to know are those 3.5mm signal splitters reliable and safe for both phone and headphones, and if not, I would appreciate if someone could point me to the right direction regarding picking a custom circuit and assembling it. I would very much appreciate if you were to provide me with a suitable circuit diagram.
I have relatively limited knowledge of electronics, one that's mostly theoretical so I would warmly welcome any corrections you make regarding stuff that I said in the question. Same goes for my English, since it's not my primary language.
AI: Depending on how much money and how portable the system can be, the splitter can be a very good solution.
The splitter only parallels the headphones, there is nothing fancy happening inside of it. This can have at least two effects:
lower the maximum volume
damage the phone
The maximum volume will be lowered because the amplifier inside the phone needs to drive 2x headphones, so they will need to share the power. Whether this is acceptable or not depends entirely on the amplifier in the phone, and on the "efficiency" of your headphones, i.e. the dB per watt they can output.
Damaging the phone is a very remote and unlikely scenario. The amplifier inside is designed to drive a certain load, and you are demanding more. This can potentially overheat the chip, drain the battery faster, or even damage the chip. Again, this possiblity is extremely remote: the chip is most probably protected from short circuits, so it is impossible to damage it.
One alternative you can explore is to use bluetooth headphones. Some phones allow for multiple headphones to be connected at the same time.
Another option would be to use an active splitter; I don't even know if such a thing exists, but it would require an additional battery/power source.
Since you say that your electronics knowledge is limited, I strongly advise against assembling your own circuit. There is no way you can do better than a mass produced, engineered product.
All in all, your best bet is the splitter. |
H: How is capacity calculated when adding a battery in parallel with a faded or damaged one?
I was intrigued by the answer and comments on this question about connecting a second battery in parallel to increase capacity. The original battery has obviously lost capacity and is nearing its end of life. The OP wanted to add a second in parallel to increase capacity, which might make sense if 1) the UPS was compatible with doing so, and 2) the original battery was not faded/damaged.
Marcus indicated in the answer that adding a second battery in parallel would add "but 25% more capacity than just the new one."
I'm unsure how that figure was arrived at. If two identical batteries in parallel are twice the capacity of one alone, how does one calculate that capacity when the batteries differ in capacity or age? It seems to me that a deficient cell would obviously contribute less than 100%, but could also parasitically drag down the newer battery if they attempt to equalize. (That's my assumption.)
Is the 25% figure given based on a rule of thumb, a best-estimate based on the limited information in the original question, or something else?
AI: I think the point of the original answer was that the two batteries are not identical. They had the same specifications when new, but the OP said that one of the batteries was dying and had lost most of its capacity. So Andy was trying to say that there was little point in using both batteries; just use the new battery and recycle the dying one. |
H: Why frequency of a DC signal is chosen as zero? If the period can be anything, isn't it same for frequency?
This is a page from Oppenheim.
We can assume a DC signal as a repetition of 10 strips per 10 seconds/10 strips per 5 seconds. Like that, if we choose different periods, we get different frequencies also. Then why is frequency chosen particularly to be zero?
AI: If you want to treat this signal as a periodic one, then you can take its Fourier series.
Unlike most other periodic signals, you have free choice of what frequency to consider as its fundamental frequency --- you can calculate the series for any fundamental frequency
But regardless of which fundamental frequency you choose, you'll find that all the terms in the series except for the 0-frequency one have zero magnitude. |
H: Control two different DPDT circuits with one DPDT switch
I have a HDMI switch (pictured below) and a USB 2.0 Switch both have dual inputs and a single output, with no external power input. Both from what I can see are switched via DPDT switch. What I want to achieve is have them both controlled by a single DPDT switch instead of their own switches, as I plan to put them together in a 3D printed case to make a crude KVM switch.
I’m not sure if I can just wire them up to the same switch or if I need anything additional to isolate the two circuits as I guess they will run on different voltages etc?
Any help is appreciated.
AI: You can use a 4PDT switch, replacing the 2 DPDT switches. Or you can make your 3d case press both switches at the same time (a bar or fitting over two dpdt switches, like a large cap).
Or you can figure out the IC on the board to see if the switch is just toggling the ICs enable pin. You shouldn't need to isolate them, if you share the ground between the two. If you do need isolation then you can use optocouplers. This requires some electronic knowledge but start with pulling datasheets. |
H: Stop USB-C plug from holding/clipping
Apologies if this isn't the right StackExchange site to go to, seemed like the best option.
I 3D printed a phone cradle for myself that was built for use with right-angle USB connectors. My phone has a USB-C port and the cradle does its job, but with a minor annoyance: I have to hold the cradle down in order to remove my phone from it because the USB-C plug clips into place (as it normally should!).
But for the cables I'm using for my cradle(s), I'd like to stop them from clipping on so I can just slide my phone out of the cradle without needing both hands to do so. Is this possible?
While writing this question, I did find this question and answer with a diagram that shows the retention springs, and while I appreciate knowing where they are now, I can't easily envision a way to restrain, break, or remove the springs to accomplish what I want to do.
AI: That's the way the USB-C connector is designed, and frankly, that's a good thing: there's actually quite a bit of current passing through pretty small contacts when charging a modern phone, so you really want to ensure contact is reliable.
So, your intent to remove the clipping is in opposition to using the connector as charging connector.
So, the much more boring mechanical solution is: Gluing, screwing, or otherwise affixing your cradle to something heavy enough for you to pull out your phone with one hand. |
H: Use two 250V series cap in APFC instead of single 400V
I have a EVGA 500W PSU with an APFC which is causing spike noises, presumably from the APFC or main switching as they both run in sync controlled by the CM68000TX combo apfc switching PWM chip
Noise (about 700mV every 16uS) comes in when APFC turns on, even on the 5VSb line. (5VSb line is smooth until PSU turns APFC and everything else on, noise on all 12v, 5, 3.3 lines etc.)
Also when I load the PSU with e.g. a 10Ohm resistor on the 5V line, the Power Good output goes low for about 270mS. Voltage levels averages are kept somewhat ok, but I believe the PG is rebooting the PC "randomly"
Now I have measured the original 400V 270uF and is giving me less than 240uF so I have in hand two 250V 470uF caps, can I connect these in series for testing purposes?
I'm a bit concerned if it being 200 extra uF would cause any issue, or may be something else I don't know.
AI: If 2 x 470uF capacitors are connected in series, the result is a 235uF capacitor, but only if both are identical the maximal voltage of each one will be exactly 50%. If the capacitance is not exactly the same, the voltage will be unbalanced and could exceed 250V for one of them.
Furthermore, for SMPS, the filter capacitors need to be suited for the high current peaks and resulting dissipated heat from the series equivalent resistor. Often parallel capacitors are used in those devices, but never series capacitors.
In other words: those 2 capacitors as substitute most likely would not be an improvement.
But to get the right capacitor, the next recycling yard may have some old TVs, PCs, monitors or other devices with SMPS, where some 400V capacitors could be salvaged for free. Caveat: A few years back, those capacitors were prone for failing, testing before use is essential. |
H: What are common ways that modern processors handle data hazards with asynchronous registers
I'm trying to design a processor in VHDL. While the base instruction set is done, I'm having trouble building on top of it.
Specifically, I'm implementing control and status registers (CSRs), which allows the system to be controlled to a greater degree.
These CSRs do not need an instruction to be altered, they can change based on the state of the machine. This comes with a set of data hazards that I have been trying to solve. There are not many existing resources that offer solutions to these hazards.
Rules:
All instructions which associate with these registers are atomic instructions which are meant to swap the CSR value with a general purpose value.
Hazard 1: RAW
The register is read from, and the CSR are read from on one clock cycle of the pipeline. On the next clock cycle, the values are written. During this time, the CSR may have changed.
Hazard 2: interrupt WAW
Something in the processor triggers an interrupt, And changes a whole bunch of registers at once. In the pipeline, however, there is an instruction which writes to a CSR which has been modified. This corrupts the register.
What are some common ways to remedy these hazards?
AI: In general any asynchronous inputs to the system (such as from peripherals) would be synchronized with a dual rank register to make it synchronous to the processor clock before it is used by any processor state machine.
From: Synchronization in digital logic cercuits |
H: Understanding this startup circuit
In the circuit below, how is Q1 turned on? When there's voltage in the bias winding, it turns Q2 On and subsequently turns Q1 off. Also, does the end of R4+R7 keep floating when Q1 is off? It should go to ground. I'd appreciate any help to better understand the startup circuit in the yellow square.
EDIT: Idea with an Enhancement MOSFET
EDIT: Another approach with Enhancement MOSFET
AI: Q1 is a depletion mode device, therefore it is ON with zero Vgs. When Vin is applied, Q2 is off, Vgs of Q1 is held to zero by R12, and Zener D6 clamps the voltage to the controller to ~33V.
The controller starts switching, causing the bias winding to deliver energy to the Vdd input of the controller through D4, and to the gate of Q2 through D6.
Q2 pulls the gate of Q1 below the source, turning Q1 off, and therefore eliminating the power dissipation in the startup circuit.
The 200K voltage divider on the gate of Q1 prevents damage from exceeding the +/-20V max Vgs rating of the device. |
H: What is meant by the MOSFET is pinched-off?
What is meant by the MOSFET is pinched-off? It is same as in the JFET case where the depletion region becomes too large until the electron cannot flow through the transistor?
AI: When a positive gate-source voltage in NMOS is applied, As voltage increases once the voltage reaches the threshold voltage, the channel will be created and the device is ready to conduct electron or holes (in case of PMOS) through the channel between drain and source.
So by applying drain-source voltage it maximizes at the drain end and minimum at the source end. As Drain-source voltage is increased, it attracts the electrons from source end to drain end and current flows from Drain to Source, in this case, we're in the triode region.
As the Vds increases, we reach a point where Vds=Vgs-Vth that is pinch-off, at which the current becomes saturated and almost constant current flows.
As Vds increases, the channel becomes smaller till it's OFF, but in a real case, the channel is not completely pinched-off, in fact, it is more like pressing a pipe end with your fingers. There is a uniform electric field at the pinched end hence instead of stopping the current there is a constant saturated current.
reference: https://www.quora.com/What-is-pinch-off-effect-of-MOSFET |
H: Clarifications about GY-521 Module (Accelerometer and Gyroscope) for Arduino
I have some doubts about how to analyze data acquired through a gyroscope and accelerometer (GY 521, datasheet).
Precisely, let's consider this acquisition I have done when the module was still:
My questions are:
1) While I was reading the datasheet, I was not able to find any information about the reference (xyz) system. How are x, y, z axis physically oriented compared to the module?
2) Which is the meaning of negative values, if the reference axis are not specified? Does it mean maybe the verse of motion?
3) Is it correct that there are so high variations between two consecutive measures (in which the module is still)?
AI: I don't know this specific part, but you don't need to know how the axis are physically oriented, because your device will never be mounted with 100% accuracy in ideal conditions. This is gonna be some evil little QFN fine-pitch MEMS, so the SMD process alone will give quite some inaccuracy in position, not to mention the inaccuracy that comes with how the final PCB is mounted.
So you'll need some means to calibrate the accelerometer when it is sitting still at 1G. A serial bus command, a button, a jumper etc. The (x,y,z) offset you get then, is the 1G vector pointing towards the centre of the earth. All your calculations from there on must be based on this offset.
As for why you have different values from time to time, there could be many explanations. This part apparently uses internal ADC to read the data, for example the datasheet mentions 16 bit ADCs. That's quite some resolution - with 3.3V supply, one ADC unit would be 3.3/(2^16) = 50.35uV. Fluctuations in ref voltage will mean ADC noice. And then ADC are by their nature giving unstable output. So I suspect this is the natural state of things - a moving average filter in software can usually handle it.
Though you should investigate how the part's supply and ref voltages look. Any noise from switch regulators or line etc will affect the part. PCB layout and decoupling caps will of course matter too. And yet another culprit could be rounding math or floating point inaccuracy in software. |
H: Can you create a circularly polarized signal with dipoles that are perpendicular but not crossed?
All of the circularly polarized phased arrays that I can find use elements that are themselves circularly polarized, that is, two perpendicular dipoles that are crossed at their midpoints (the picture on the left). Would something like the pattern on the right work, where the antennas are still perpendicular but offset? If so, would the horizontal and vertical elements still be fed 90 degrees out of phase, or would it get more complicated? I can imagine that this would make them easier to pack, but it's very possible that I've missed something obvious.
Thank you so much!
AI: In theory you could, as in the far field both of these antennas will produce waves that seem to originate from approximately the same point. So from an observer in the far field, that is looking perpendicular to the surface of the antennas, these can product circular polarization.
However, I think it will actually be harder to make, since in the case of crossed dipole, you gain from the fact that the fields of one antenna are zero along the symmetry axis.
Here is an image to illustrate (simplified but should get the concept across). Vertical antenna has an illustration of it's fields shown.
The nature of the crossed dipoles means that the differential mode (which is the mode dipoles work on) of both antennas is naturally isolated from the other. When you put them next to each other, this is not the case. |
H: DALI Lighting (IEC62386-209) and Command-In-Between
Good Afternoon,
I'm having some trouble understanding IEC62386-209 section 12.7.3, which involves sending an "ENABLE DEVICE TYPE 8" command to DALI Control Gear prior to sending an extended (DT8) command.
The paragraph in question for the associated test sequence:
12.7.3.1 Test sequence 'ENABLE DEVICE TYPE: Application extended commands' An application extended command shall be executed only if
preceded by command 272 'ENABLE DEVICE TYPE 8'. If there is a command
in-between command 272 and the application extended command the
application extended command has to be ignored unless the command
in-between is addressed to another control gear. The test sequence is
shown in Figure 85.
My issue is in understanding what happens when an in-between command is sent on the bus, directly after ENABLE DEVICE TYPE 8 (such that it's essentially interrupted)
From what I gather, and according to the paragraph above, the extended command has to be ignored, unless the in-between command is addressed to a different device.
In that case, what happens if the in-between command is not sent to another device, but a device group which the device is or isn't part of?
AI: If the command in-between the ENABLE DEVICE TYPE 8 and the application extended command addresses this device, that aborts the application extended command sequence hence the test shows that QUERY COLOUR TYPE FEATURES should not be responded to for addresses Broadcast, Short Address 1 or Group Address 1 because the device under test has these addresses in the example test case.
For the cases where the command in-between does not address this device, that command is discarded so the application extended command sequence operates as if there were no command in-between. In the example test case, this means there is a response to the QUERY COLOUR TYPE FEATURES when the command in-between is addressed to Short Address 2 or Group 2 because the device under test does not have these addresses. |
H: Why can't I short circuit a virtual ground with ground in OP Amps?
Consider this circuit for instance.
simulate this circuit – Schematic created using CircuitLab
If I calculate the closed loop gain of this circuit using Kirchhoff's law it turns out to be
$${V_o\over V_i} = {-R_2 \over R_1}\left( \frac{R_4}{R_3} + \frac{R_4}{R_2} + 1 \right)$$
Since one end of \$R_3\$ is at 0 potential and \$V_1\$ is also at zero potential, \$R_2\$ and \$R_3\$ can be considered to be connected in parallel connection, which is then in series with \$R_4\$. This way the closed loop gain turns out to be
$${V_o\over V_i} = {-1 \over R_1}\left( \frac{R_2 R_3}{R_2 + R_3} + R_4 \right)$$
This value isn't equal to the above calculated value, hence there must be something wrong with this method. The only mistake I can think is short circuiting \$R_3\$'s one terminal with \$V_1\$ junction. But why can't I do that?
AI: You can't do that because even though V1 sits at the same potential as ground, it is a different node in the circuit and as such has an isolated current path. Sharing the same potential is not a sufficient condition to consider components to be in parallel; they must share the same nodes. If you connect anything else to that point (such as R3) you disrupt the operation of the circuit by allowing current to flow through a new path.
In this circuit, the current into the op amp input pins is zero, so the currents through R1 and R2 must be identical. However, if you connect R3 in parallel with R2, then the current through R1 will be split between R2 and R3 instead of flowing exclusively through R2. As a result, the circuit will behave differently. |
H: 1117 Regulator outputting 4.2v
I have an esp-12 soldered on this breadboard adapter. I mounted a 1117 3.3V (not adjustable ones) regulator to the board and removed the 0 Ohm jumper resistor as instructed by the manufacturer.
Using a regulated 5V power supply, I powered it up but I noticed it is getting hot. I measured the voltage on esp-12 power pins and it reads about 4.2V. I changed the regulator multiple times but the result was the same.
Any Ideas why this is happening?
AI: because the footprint is not pin compatible with LM1117.
the pin order for the regulator on the PCB from left to right is : GND-IN-OUT. |
H: Chebyshev filter - theoretical vs simulation gain
Question is about the gain peak (or maybe more suitable would be growth) ocurring in higher frequencies (>20kHz) in Chebyshev filter 4-th order in simulation (simulated using Bode Analyzer in NI Multisim) - what's the reason for this? Theory shows that gain is going still down even up to -150dB, however simulation shows minimum at about -120dB. Is that because of some capacitance effects ocurring in op-amps or something else? I found similar problem to mine, but the grounding there and op-amp was quite different (Unexpected behavior of the Sallen-Key second order filter).
Below theoretical gain based on formula:
$$
A(f)_{dB}=20\log{\left\lvert\frac{k_0}{(1 + a_1(\frac{j(2\pi f)}{\omega_g}) + b_1(\frac{j(2\pi f)}{\omega_g})^2)(1 + a_2(\frac{j(2\pi f)}{\omega_g}) + b_2(\frac{j(2\pi f)}{\omega_g})^2)}\right\rvert}
$$
and chart for this:
The result of the simulation is shown below.
In higher frequencies like 1MHz gain continues to go up. The circuit was constructed based on the Sallen-Key scheme - schematics of the cicuit below.
AI: Is that because of some capacitance effects ocurring in op-amps or
something else?
Your sim uses the cranky old 741 op-amp and that device fails to become effective even as a unity gain amplifier around 1 MHz. You have about 20 dB pass band gain and so you are asking each 741 to roughly provide a gain of 3 and now the effective point where the 741 gives up the ghost is going to be around 300 kHz.
But, because your circuit is trying to produce a fairly high Q using the feedback capacitors C2 and C4, the new point in the spectrum where the 741 falls over is going to be about ten times lower in frequency i.e. circa 30 kHz.
Just ballpark numbers but you can prove this to yourself by using an op-amp with a gain-bandwidth product of 10 MHz or above. |
H: Audio amplifier design problem
I am trying to design an audio amplifier circuit using BJT
These are the requirements of the circuit
Input signal: 50-100 mV (It's the output of my iphone's mic)
2W-4ohm speaker
There is no requirement for DC voltage source. I can choose so as to feed enough for my circuit.
Here's my approach
I choose to use 12V DC source and design my circuit into two blocks. The first block is an EC amplifier stage which is to amplify my voltage according to the requirement. The second block is for power amplifier, in which I choose emitter-follower as driver stages before a push-pull circuit. I want to use class A stages in that position for impedance matching and to increase the total gain of the power amplifier
But the problem is my power amplifier stage doesn't seem to work and the output of the first stage is just 2V peak (It is expected to be 4V peak)
Is my design reasonable? If yes, what's wrong with it?
AI: I'm not ruling out other things but, the lack of an output capacitor is a pretty significant omission: - |
H: How to fully discharge supercapacitor?
My biggest problem is when I discharge a supercapacitor, let's say 100F 2.7V, I use a boost converter, but all boost converters have a minimum input voltage of about 0.9V. But the capacitor still has a lot of energy, about 40%.
It is frustrating because I'm not able to use this energy so my real useful capacity of capacitor is only 60%.
Does anyone have some idea how to fully discharge a supercapacitor?
AI: The energy stored in a capacitor is given by :
$$E= \frac{CV^2}{2}$$
Fill in the numbers for both 2.7 V and 900mV:
$$E_{\text{full}} = \frac{100 \text{F} \cdot 2.7 \text{V}^2}{2}\approx365 \text{J}$$
$$E_{\text{end}} = \frac{100 \text{F} \cdot 0.9 \text{V}^2}{2}\approx41 \text{J}$$
In other words, we have \$41/365\approx 11\% \$ of the full capacity left when your converter dies.
Making DC/DC converters that can extract (part of) that 11% capacity left in the capacitor, without losing it all to lower overall efficiency, is an active and challenging topic within research. |
H: Holding torques of a 7W stepper and a 48W stepper
Does anyone know why a 2.5V 2.8A (=7W) stepper has a holding torque of 1Nm whilst a 24V 4A (=48W) stepper has a holding torque of only 2.7Nm:
Stepper 1:
Stepper 2:
The latter draws 7x the power, but gives just 2x the holding torque. The inductances are roughly the same. The first is 2.8mH and the latter is 2.4mH. What might cause a 48W stepper to draw so much more power but give so little more?
AI: Pictures from here.
In short, the longer the stack-length the more torque can be produced per amp. So, if the basic model can take more current, it can generate more torque AND if its stack length is longer it can produce even more torque.
It's got nothing to do with the electrical power fed to the stepper motor when stalled - all that power is just wasted. After all, a bench vice doesn't consume power when gripping a motor armature to a standstill and, all the power fed to the stepper motor is turned to heat in a rotor lock situation.
Current and length are the primary factors for torque. |
H: Is this a capacitor in series with the power source?
I'm a complete newcomer here. I was looking at this small circuit and it looks like there is a capacitor connected in series with the power source. Is it possible that this is the case, or do capacitors always have to be connected in parallel with the power source?
AI: I believe it is a polyfuse/resettable fuse. It would make sense to be in series as it would break the circuit if it draws too much current. Polyfuses are often that yellow colour, but I'm unable to read the text on it. |
H: What is this spongy material?
Hi, while I am tring to repair electronic circuit. I'm encountering this sponge. I wonder what is this sponge? and can I find out what it is used for. I often see this in sensitive circuits like in laptop board and near to cooling parts. Adheres on cooler materials
AI: It is some kind of soft-open-cell foam, wrapped in conductive tape, to ensure a good grounding and shielding contact between pieces. The foam may or may not have large amounts of carbon particles in it to make the foam itself conductive. |
H: What is this called, PCB bevelled fingers?
I found this non-plated fingers PCB connector, with blackish color, in a Logitech MK240 wireless keyboard. This fingers connect between the PCB and plastic sheets wiring (for the keys).
It is a bit beveled, or I'd say furrowed (black has more bevel than grey in the pic), as to enable the center of an individual finger to give more pressure to the sheets I thought.
What are these fingers specifically called, especially when requesting fabrication? Are these fingers replaceable with usual PCB traces beveled with solder?
AI: Usually this falls under a 'gold finger' process step. You would communicate to your manufacturer that you need beveled gold fingers, and sometimes you can even specify the exact amount in a mechanical layer or additional mechanical drawing file.
This is not to be confused with V-grooves, which are a separate process, and a way of singulating individual PCBs from a panel.
In this specific case, they seemed to have gone for carbon instead of gold. My guess would be that since this process already had a carbon layer added for rubber-dome keys (as this is a keyboard), and thus they used that for cost. The reason they use gold in other cases is to avoid contact issues due to oxidation. The same can be achieved with carbon contacts.
I don't think there is any specific process name for this. |
H: Different connections on positive and negative pins in PCB design
I've seen some designs they have connected pins of power components differently.
For example in a buck capacitor at the output of a DC to DC power supply I've seen the positive pin on direct connection and the negative pin on thermal relief connection or with just one via to the ground.
In the picture below you can see a solid state SMD capacitor (both pins have the same size) is directly connected to the positive pin having a much lower impedance but the negative pin is connected to ground with just one via and a thin trace. The pads have the same size.
I'd like to know if there's any good reason behind that or if the engineer did not understand how the current flows.
Isn't that a mistake? Shouldn't both pins have the same impedance path to the power rails?
AI: I'd like to know if there's any good reason behind that
The part is a 470 uF 25 volt electrolytic capacitor like this: -
So, it will have a fairly high ESR (effective series resistance) that will dwarf the resistance of the via to ground and the short copper track. In effect the way that it is mounted will have little effect on its performance.
If it were a non-electrolytic device used in high frequency circuits where the capacitor were expected to deliver anything other than bulk capacitance then how it is mounted with respect to the power rails could be very important.
Shouldn't both pins have the same impedance path to the power rails?
Ideally yes, but in practice for a bulk electrolytic capacitor, you could put it in series with 0.5 ohms and it would, more than likely in 99% of applications, work perfectly as required by the circuit. |
H: How to code in assembly language for floating point exponentiation?
I have problem calculating raise a to the power of b (a^b) where b is a floating point number.
In my case, b=-1.45. So the expression is a^(-1.45).
I'm using PIC18F4520 microcontroller and I don't know how to implement it in assembly language or its routine as well.
AI: Note that just because b isn't an integer, it doesn't mean that it is necessarily floating-point. For example, it could be expressed as the integer ratio \$-1.45 = \frac{-29}{20}\$.
You need to specify what the type and range of a is, and what kind of accuracy you require in your application. You also haven't specified what you want the output to look like. As @jonathanjo pointed out, all answers except for a=1 are fractions less than 0.5. Also, since exponentiation is a nonlinear operation, it's important to understand what real-world values the integer values of 'a' represent.
For what it's worth, arbitrary exponentiation is usually implemented as a 3-step process: log, multiply, exponentiate:
$$a^b \equiv \exp(b \cdot \log(a))$$
You can use any convenient base for the log() and exp() operations, as long as they're the same. 2, \$e\$ and 10 are popular choices.
CORDIC is one way to implement log() and exp() on small systems. See also cordic.
But depending on your requirements, piecewise linear or polynomial approximation of the overall function might be more appropriate. These just require a few multiplies and adds. It's also possible that \$\frac{1}{polynomial}\$ or \$\frac{1}{\sqrt{polynomial}}\$ would be a good fit for your function. These operations are similarly easy to add to the mix using Newton-Raphson. |
H: What about MCP23S17 GPIO pins output ports being also used to be read by input pins?
We are connecting Raspberry Pi3B with some MCP23S17 expanders:
MCP23S17.
I have read that they could emulate an open-drain outputs, playing with high Z state of the pin when configured as input. What kind of input and output those GPIOs are?
What about when it is a normal output by default? are they push-pull? I have seen that they normally are push pull output.
I would like to use that for continuity detection between two pins that could be or not in contact. So I would like to know what kind of things I must to do or connect there, when I will do some of these things:
1.- Could I connect an output pin to another input, write the output pin and read the input pin value?
2.- Does I need a special "connection-configuration" for achieving this function propperly?
According what I have been seen, it seems to be "open-drain" the best option, due push pull option it's said that it can't be connected with other IC pins. I'm not sure about this information.
So if anyone could clarify me these questions will be helpful.
AI: They are not different than many MCU GPIO pins. Unfortunately the datasheet has no block diagram at all to explain this.
The pins have direction control register to set the pin direction between input and output. Basically it just controls if the output buffer is enabled or disabled.
When output buffer is enabled, the pin is a push-pull output which drives the pin state high or low according to the output data register. When the output buffer is disabled, it is in high-z state, so it can act as an input pin, so another device can drive the pin.
The current state of the pin can always be read from the input register, whether it is an input or output.
There is also a pull-up enable register, which can enable an internal pull-up for a pin, to set it's state high if nothing else is connected. This removes the need for external pull-up resistors.
And finally, as the pin is completely under user control, it can be set to be either low output or high-z state, to emulate an open-drain IO pin.
1) Yes, you can connect one pin to another, and write the output pin and read input pin to see if they are connected together or not.
2) No, nothing special is needed. Just one input and one output is enough.
Open-drain can be used too, but you don't have to. |
H: Preventing Interference when using RF transmitters and receivers
I want to use a "listen-before-talk" approach to transmit data from sensors connected to a transmitter and receiver pair to a MCU connected to a transmitter and receiver, which means that the sensor will only transmit data once it has been asked to do so by the MCU, but the problem I'm having is that my receivers will have no way of knowing if the information it's receiving is from one of my transmitters or from some other 433 transmitter in the area.The receiver I want to use has a product description here which seems to suggest there may be a method of pairing up my transmitters and receivers but how? If I transmit transmitter ID information e.g if the transmitter is transmitting 4 bits, I make the first two bits always "11" so the receiver knows that the information is from one of the transmitters it should listen to would I then be able to filter data I don't want on the AVR?
AI: Those types of transmitters and receivers only work on a single channel. The receivers usually employ a form of active gain control (AGC), so will increase the gain until something (usually noise) is received. The gain is reduced to an appropriate level when a transmission starts.
Generally best practice is to:
Agree on a bit rate between the two systems (e.g. 4800bps). Generally
receiver/transmitter pairs will give you some guidance on these.
Transmit a preamble of 10101010 (generally somewhere between 8 and 40 bits) before starting the main transmission. This has two purposes - it allows the AGC to settle at
a good point, and can be detected by the microcontroller so it is
aware that a transmission is starting.
Transmit a sync word e.g. 0xD5F7, and only listen to packets which have the correct sync word. The length of the sync word varies.
Use the rest of the data packet to detail the address, direction, and
data.
I have found that the VirtualWire library for the Arduino is actually a nice, clear example of how to go about this. Maybe take a look, even if you are working with another microcontroller family.
One further thing worth considering is the encoding of bits. You can just send a 1 as a 1 and a 0 as a 0. There are more complex schemes though. Manchester encoding ensures that each bit of data transmitted has at least one signal transition. This has two significant effects:
Regardless of the data sent, there will be an equal number of highs and lows sent. This means the AGC can work properly and there is no DC bias to the signal.
As there is a transition for each bit, it is easy to recover the clock from the signal even if it is not known. This really means you transmitters no longer have a need to use an external crystal - the internal oscillator is accurate enough. |
H: Continuous light: do LEDs flicker like fluorescent lights?
Continuous light - do LEDs flicker like fluorescent lights?
Under fluorescent light there is a flicker.
As I understand LEDs work only with DC current, thus they have a AC to DC transformer circuit pumping electricity into them. That would mean that they emit continuous light.
AI: LEDs will emit steady light if given steady current. The question then becomes what kind of current waveform LEDs are driven with in a light assembly.
The exact answer depends on the circuit in the light. LEDs run on just a few volts. The much high line voltage has to be converted to the lower LED voltage somehow. Most likely, this will include the cheapest, dumbest, and most stripped down switching power supply possible.
I see other answers mention a transformer, but I think that is quite unlikely. There is no need for isolation in a sealed unit with no external connections other than the power line. Even if there is a transformer, it's not going to be fed directly from the line frequency. The extra savings in cost and size of a transformer that works at 10s to 100s of kHz far outweighs the cost of the components to produce that frequency.
Most likely, there is a full wave bridge to rectify the AC line voltage directly. That will then be chopped thru a inductor to drive the LEDs. Depending on how cheap the lamp is, it might chop at a fixed duty cycle, which would make the LED brightness vary with power voltage. Even a little current feedback would keep the LED current reasonably constant over most of the line cycle, perhaps dipping only briefly at the power line zero crossings. A small cap would reduce that, but caps cost money and take space, so may not be included.
LED lamps are made in large volumes, so serious manufacturers probably develop custom ICs just for this purpose. In such a case I'd expect at least some attempt at regulation, so the LED brightness will be largely constant, perhaps with short dips at the power line zero crossings.
However, all this is speculation. Why not just look? Put the lamp at the end of a extension cord and swing it around in a otherwise darkened room. Whether it flickers or not will be immediately obvious. |
H: Transmission line reflection. I would like a non-mathematical explanation
I am a licensed radio amateur, and find bewildering the many different explanations, which range from folksy urban myth to Maxwell-Heaviside Equations, of what happens at the termination of a transmission line or feeder. I realise that they all come to the same thing in the end (or should do, pun perfect), but none of them give me a gut feeling for what is going on.
I like diagrams, so an answer in terms of (graphical) phasors for the currents and voltages at the load would suit me best. How, for instance, does a step pulse down the line cause twice the voltage at an open circuit termination? Similarly for current at a short circuit. And how is the reflected step generated by the inductance and capacitance of the line?
Can anyone help, without getting all mathematical, and not telling any "lies to children"?
AI: OK, for what it's worth, here's how I visualize it.
As you say, a transmission line has both distributed capacitance and distributed inductance, which combine to form its characteristic impedance Z0. Let's assume we have a step voltage source whose output impedance ZS matches Z0. Prior to t=0, all voltages and currents are zero.
At the moment the step occurs, the voltage from the source divides itself equally across ZS and Z0, so the voltage at that end of the line is VS/2. The first thing that needs to happen is that the first bit of capacitance needs to be charged to that value, which requires a current to flow through the first bit of inductance. But that immediately causes the next bit of capacitance to be charged through the next bit of inductance, and so on. A voltage wave propogates down the line, with current flowing behind it, but not ahead of it.
If the far end of the line is terminated with a load of the same value as Z0, when the voltage wave gets there, the load immediately starts drawing a current that exactly matches the current that's already flowing in the line. There's no reason for anything to change, so there's no reflection in the line.
However, suppose the far end of the line is open. When the voltage wave gets there, there's no place for the current that's flowing just behind it to go, so the charge "piles up" in the last bit of capacitance until the voltage gets to the point where it can halt the current in the last bit of inductance. The voltage required to do this happens to be exactly twice the arriving voltage, which creates an inverse voltage across the last bit of inductance that matches the voltage that started the current in it in the first place. However, we now have VS at that end of the line, while most of the line is only charged to VS/2. This causes a voltage wave that propogates in the reverse direction, and as it propogates, the current that's still flowing ahead of the wave is reduced to zero behind the wave, leaving the line behind it charged to VS. (Another way of thinking about this is that the reflection creates a reverse current that exactly cancels the original forward current.) When this reflected voltage wave reaches the source, the voltage across ZS suddenly drops to zero, and therefore the current drops to zero, too. Again, everything is now in a stable state.
Now, if the far end of the line is shorted (instead of open) when the incident wave gets there, we have a different constraint: The voltage can't actually rise, and the current just flows into the short. But now we have another unstable situation: That end of the line is at 0V, but the rest of the line is still charged to Vs/2. Therefore, additional current flows into the short, and this current is equal to VS/2 divided by Z0 (which happens to be equal to the original current flowing into the line). A voltage wave (stepping from VS/2 down to 0V) propogates in the reverse direction, and the current behind this wave is double the original current ahead of it. (Again, you can think of this as a negative voltage wave that cancels the original positive wave.) When this wave reaches the source, the source terminal is driven to 0V, the full source voltage is dropped across ZS and the current through ZS equals the current now flowing in the line. All is stable again.
Does any of this help? One advantage of visualizing this in terms of the actual electronics (as opposed to analogies involving ropes, weights or hydraulics, etc., etc.), is that it allows you to more easily reason about other situations, such as lumped capacitances, inductances or mismatched resistive loads attached to the transmission line. |
H: Very accurate time measurement
I'm going to measure very short times as accurately as possible. The device will get first one pulse and within 150 microseconds six more, each on their own wires. The time between first signal and each of the six other signals must be measured as accurately as possible. The accuracy should be at least 100 nanoseconds but more is better.
Which microcontroller would be best for this? I've found this. They seem to have a timer with period of 4 nanoseconds. It would be accurate enough for me.
Would some other microcontroller be better to do this? Can this be done with AVR?
AI: The speed of the microcontroller is not always the limiting factor. The MSP430 can be an appropriate solution, not because of the fact it only runs up to 25MHz, but because several MSP430 devices have the Timer D peripheral which enables up to 4ns time period (256MHz). This is faster than almost all microcontrollers out there. Even the STM32 in its latest versions (F4) can only do 180MHz.
Timer D is available on MSP430F51x1 and MSP43051x2 devices such as the MSP430F5131.
However, that only solves being able to capture the time. The big question is what do you do with it because the processing itself will be slower. You could sample the time between two pulses, but you won't be able to do any processing between them, if that's what you mean. |
H: Overclocking an AVR microcontroller by using an external oscillator with higher frequency than uC supports
What would happen if I would connect an external oscillator that has a higher frequency than the microcontroller (AVR) supports? Will it blow up, constantly reset, or what?
AI: This is generally called "overclocking" and it will not usually cause your micro to "blow up". It is possible to damage your chip however by running it above its rated frequency. The AVR may boot depending on how much you overclock it. I have run ATMega8 micros overclocked and they have been fine. The voltage and frequency ratings given in the data sheets are "safe" ratings and often you can run the chips higher. This is not guaranteed though, and different chips will have different maximums. You can also increase the operating voltage of the chip to improve stability when running at higher clock rates. Remember that increased voltages/frequency will cause increased heat and may damage your chip. Running a micro above rated frequency/voltage may cause errors while running, or cause other numbers in the data sheets to go out of spec. |
H: Voice playback IC
I was looking for cost effective voice playback IC and came up to ISD 1700 series. Another brief datasheet is here. I don't believe with the same footprint and only for 3-4 bucks I can get up to 16 min voice playback(if I am wrong correct me). However I wasn't able to find how to program the chip through digital channel.
If anyone has experience with this ICs - can I program the voice through SPI interface by storing voice samples directly into flash memory rather than recording from mic?
AI: The ISD chips I've worked with, and the 1700 looks like it's no exception, store audio in analog format. I think they write data by starting with every memory cell erased, and then program hit memory cell corresponding to each audio sample until its voltage matches that of the sampled audio input. The SPI bus serves to control which parts of the analog memory will be read and written, but does not have any means of reading or writing its content. If you want to program the devices, you'll have to design or buy a test fixture to feed in analog data. |
H: CMOS Inverter Voltage Transfer Function
So let's say I have a perfectly symmetrical Voltage transfer function curve for my CMOS inverter. The curve looks like this:
The question is, how would this curve change if the size of the NMOS transistor was reduced.
My answer: The curve would still be symmetric but would start shifting right.
But I just know that from my textbook, I don't understand WHY the curve would shift right.
So why exactly will it maintain symmetry and shift right?
AI: The voltage shifts because additional over drive voltage is required to generate additional \$ I_{ds} \$ to match the \$ I_{ds} \$ of the PMOS. This arises because of the reduction of W reduces the \$g_m\$ of the NMOS transistor.
The curve will have it's roughly sigmoid shape, which is dictated by how the transistors transition from triode to full active, but they will not be perfectly symmetrical. \$V_{th} \$ , \$g_m\$ are very unlikely to be perfectly matched. |
H: 12VDC power supply question
I have a 12VDC 500mA power supply and I want to power two (2) separate items, by using a "Y" adaptor. The first item is supposed to use this exact power supply, but the second item tells me to use a 12VDC 250mA power supply. They are both a couple different projects with LEDs. I do not want to use two (2) separate power supplies. What kind of problems can I expect, especially from the second item?
AI: The power supply is simply not powerful enough.
If you have two devices, of the same voltage rating (12V), you add the currents together to find out how much current your PSU needs to supply:
Device 1: 12V, 500mA
Device 2: 12V, 250mA
Total current needed: 750 mA
Total current your supply can handle: 500 mA
Since your supply is not designed to supply 750 mA, it would be foolish to try to use it to power both devices at the same time. The power supply is simply not powerful enough.
The results will vary from not supplying 12V anymore, to overheating and in the very worst case let off smoke and catch fire.
You might be able to use it to supply one when the other is off, but this depends on how much standby current each uses.
Powering device 1 while device 2 is off might still be too much current.
Powering device 2 while device 1 is off could possibly be OK. |
H: Spark Transmitter with flyback driver and good arcs
I recently built a Fly-back Driver with a fly-back transformer and a primary voltage input of 12 volts and the arcs are about an inch long ( i don't know the exact output voltage because I don't have the ability to measure it ). I have heard that in the 1900's they used arcs to transmit Morse. I want to replicate this. I am wondering how I would hook up the antennas to the arc and hooking up the ground and how the arc relates to all of this. I know that there might be some legal issues to this, but I live in the mountains far from many people, maybe a few FM radio users but I just want to test this for a second and I will not be continuously running this, in other words don't restrict me to information because of legal issues because I know the warnings. So how should I connect the arc up to ground and the antenna and is there any other components I need for this?
AI: Wikipedi's pictorial 1000 words from here opines:
And a very large number of references are here some even relevant. |
H: Format Approach to NODAL ANALYSIS
SITUATION:
Nodal Analysis is nothing more than applying KCL and is very powerful. I'm working on developing a more clearer perspective of two approaches in Nodal Analysis "GENERAL & FORMAT". Mesh Analysis is also quite powerful but my questions below are pertaining to Nodal Analysis.
The "General Approach" seems to be more extensive when it comes to factoring and simplifying equations into a form to later solve using simultaneous calculation. After studying the "Format Approach" I started to see a more clearer picture of what my equations were actually representing after the factoring and simplification steps. It was showing that the voltage at the node I was applying KCL too, was simply being multiplied by the sum of the conductance attached to that node.
QUESTION #1:
Among the many methods used in solving for unknown currents and unknown voltages would I be theoretically correct in saying that the "Format Approach" is effective in most cases? If not could you explain?
EXAMPLE #1:
I'm including an example here from my textbook to show the "Format Approach".
QUESTION #2:
How do I write the equation, "in the same format as the first example", that is used to solve the circuit below? Since the circuit below has 2 components that are shared, "12V Source & 10 ohm Resistor", I just can't figure out how to write the equation using the same approach as above.
AI: You can solve this circuit by more or less the same method you've given in the question; however you need to plug in one more equation (\$V_1=V_2+12\$) into the system and introduce an unknown current variable. So I'm not sure if we can call it a 'pure' nodal analysis.
This is what you've got to do:
Write KCL on the left node (\$I_s\$ is the current through the voltage source): $$6A=\frac { { V }_{ 1 }-{ V }_{ 2 } }{ { R }_{ 3 } } +\frac { { V }_{ 1 } }{ { R }_{ 3 } } +{ I }_{ s }$$
Do it again on the node on the right side:
$$4A={ I }_{ s }-\frac { { V }_{ 2 } }{ { R }_{ 2 } } +\frac { { V }_{ 1 }-{ V }_{ 2 } }{ { R }_{ 3 } } $$
So far, we're in line with the method described in the question. As a last step, write down this one:
$$V_1=V_2+12$$
Now we're left with 3 equations in three unknowns, which you can easily solve to get \$V_1, V_2\$ and \$I_s\$ |
H: What is typical power consumption of FPGA devices
I am new to this site and had one question. I know typical CPUs have power consumption (TDP) in range of 100-200W, for example Intel Core2. I wanted to know what is typical power consumption of FPGAs. I saw this paper, where it says power consumption of Xilinx xc5vlx330 is 30W, but it gives no reference. I wanted some authoritative reference of any FPGA board (preferably high-performance FPGA) and any company. I searched online where they provide datasheets, but they do not clearly tell the power value, but only direct to power estimation tool.
AI: The reason they direct you to a power estimation tool is because the power consumed depends very heavily on how hard the device is working.
Intel know that their processors will be clocked at the max rated frequency (at least some of the time) and that all the processing units will be used (at least some of the time).
Xilinx have no idea what their customers will do. It may be that the design is slightly too big for a small device, so needs the larger device, hence only (for example) 60% of it is used and the other 40% lies idle, not consuming dynamic power. Most time customers cannot clock the entire device at anything close to the theoretical fmax, so that reduces dyanamic power also.
If you were to calculate a theoretical max power dissipation, it wouldn't help much as you'd then end up overspecifying your power and cooling subsystems by a factor of (guessing) 2x to 4x! |
H: PCB footprint of Xilinx Kintex 7 FPGA
I am laying out a board with a Xilinx Kintex 7 FPGA (serial number XC7K70TFBG676). The first step is to create a footprint of the FPGA for my layout tool, the Cadence Allegro PCB Editor.
Does Xilinx provide Allegro footprints of their FPGAs for easy import?
AI: It is not even necessary for you to ask xilinx, since someone else has done so already. A quick google search ("xilinx kintex footprint") gives me this as the third result, where a Xilinx employee states that the
Kintex-7 FF676 is the same as every other Jedec 1.0mm 27x27 device, so the PCB decal footprint is the same.
Which indicates that the footprint of that specific kintex is standard. The only difference between the FFG and the FBG is the thermal characteristic and the height of the package, so the statement above should apply to the FBG also.
Since the part is standard, some tools have a part creation feature where it is possible to specify the package type and pitch and other dimensions and the tool will create the part for you. |
H: Am I following the procedure to set the sensitivity in Try Mode for the A1362 Hall-Effect sensor correctly?
I am following Figure 5 pg. 18 of this data sheet: Vp(HIGH), Vp(MID), Vp(HIGH), followed by 0-255 Vp(MID) pulses that increase the sensitivity each time Vp(MID) is applied.
However, when I bring the north and south poles of a strong fridge magnet close to the hall effect sensor I always get approximately 4.5668 volts for North and 0.3012 volts for South, no matter how many Vp(MID) pulses I send to VOUT pin.
The circuit I am using is here:
https://www.circuitlab.com/circuit/x22u47/hall-effect-sensitivity-offset-programming2/
You may get a little confused about the 27V (Vp(HIGH)), 15V (Vp(MID)), and 3V (Vp(LOW)). Basically I have a single 30 Volts power supply that I am dialing up and down to get the high,mid, low voltage pulses needed to program the sensor.
For example, I set the power supply to 27 volts and connect it to hall-effect's VOUT pin. Then I unplug the jumper wire connecting to VOUT, dial down to 15 Volts, and plug the jumper wire back in. Unplug jumper wire, dial back up to 27 volts, plugin jumper wire into VOUT pin again. The voltmeter attached to VOUT pin gives me correct voltage readings when I plug the jumper wire into VOUT.
But this still does not explain why my north and south pole readings do not change significantly even though I have sent up to 30 Vp(MID) pulses after the initial Vp(HIGH)-Vp(MID)-Vp(HIGH) pulses.
I would greatly appreciate it if someone could point me in the right direction.
If you look at Figure 5 on pg. 18, you will see they send out a Vp(HIGH), then it drops down to Vp(LOW). Then it goes up to Vp(MID), then back down to Vp(LOW).
The way I am doing it, instead of dropping down to Vp(LOW), the voltmeter reads 2.0V when the jumper wire is unplugged, which is the "Pre-Programming Quiescent Voltage Output" as shown on pg.4 of the data sheet under "Pre-Programming Target".
So I don't specifically send out a Vp(LOW) pulse, but 2.0 volts is technically less than the 5.5 volts required for Vp(LOW) as shown on pg. 15 of the data sheet.
So I am quite confused about why the hall-effect sensor's sensitivity is not changing despite following Figure 5 exactly as shown.
AI: You're probably suffering from bounce. If you were to connect an oscilloscope to the Vout pin (I suggest you try this) you might well see something like this:
When you plug or unplug the jumper, it will be almost impossible to do this without causing several unintended pulses. I recommend not trying to program it by using jumper wires.
By far the best way to do it is to use a microcontroller and some transistors. However, if you really want to do it by hand, using this circuit might help:
Here, you can press S1 to pulse Vout to 27v, and S2 to pulse it to 3v. C1 will help to remove any switch bounce. I don't guarantee that this will work though. |
H: What does "P. C. MOUNTING" stand for?
In this datasheet, last page, what does "P. C. MOUNTING" mean in the diagrams?
AI: Printed Circuit mounting. This part of the drawing shows the recommended pad size, hole size and spacing on the PCB. Copy this when you create a "footprint" for the switch in your PCB layout system, and the switch should fit the PCB perfectly. |
H: BJT Pre-Regulator
I have a circuit that has an input of 35V peak and I would like to drop the voltage down to 5V 200mA. I was recommend to use a pre-regulator in the following configuration:
The good thing is that it works. My question is what is this BJT/preregulator doing? How does it work?
AI: The base voltage is set by the CR4, the emitter will be below that by 0.7V. In your case around (14.-0.7) = 13.3 V. The remaining voltage gets scrubs off across the \$ V_{ce} \$ of Q1 as heat. \$ (35 - 13.3)*0.2 = 4.34 W \$ |
H: Set Kd too high
In a control system, why when I set Kd (differentiate) too high then it has a buzzling sound? Is it because of the system is moving up and down very fast?
AI: Some sort of vibration is common when the D term gain is too high. This is because it amplifies whatever noise is on the error signal. If the system can't respond as fast as the noise, then you could get a buzzing sound from the motor. |
H: Is an ADC always necessary between 8051 and zero crossing detector?
I am making a SCR(Thyristor) trigger by using 8051 microcontroller.
I have a here is a zero cross detecting (ZCD) circuit which detects the zero points and this is conveyed to the 8051 which will do further action.
The ZCD circuit is made up of BJT transistor(s) and gives a pulse of 5 V . So is it necessary to add an ADC in between the ZCD and 8051?
PS:I am trying to first simulate in multisim, and its not working (I have directly connected the output of ZCD to pin p1.0 of 8051).
edit(updated problem):sorry for not clarifying the problem.I mistakenly used led word for probe thinking both are same. You can see one round thing connected to pin P2.0(bottom right). It is the probe. What I was trying to do is to detect the pulse from ZCD and convey it to 8051. 8051 will take the input and turn on the probe, and then again go for checking it.
SCR(with optocoupler) will come in place of probe, but thats second part. I am just trying to make the first part work correctly.The probe blinks at first -90 to 0 while it should only blink when the pulse is given to p1.0 port.
$MOD51 ; This includes 8051 definitions for the Metalink assembler
ORG 0000H;
loop:MOV P2,#00H;//make probe off
SETB P1.0;//make the p1.0 as input port
AGAIN:JNB P1.0,AGAIN;//loop here until p1.0 is high
MOV P2,#0FFH;//turn on the probe
sjmp loop;//go for checking the pulse again-infinite loop
END;
AI: No you don't need an ADC in between the ZCD and the 8051.
You must have your simulation setup incorrectly, as it should work as shown. the only think I can think of is that SPICE does not like floating parts of the circuit, so the voltage source on the other side of the transformer may need a high resistance connection to the secondary, in order to keep SPICE happy. This is at least the case for LTSpice, I don't know about Multisim.
Anyway, here is the circuit simulated in LTSpice, it seems to work fine. Note the high value resistance between primary and secondary (R1)
Simulation
EDIT
It seems as though you have not given us all the detail - you mention an LED not lighting up though (unless I'm missing something) there is no LED shown on the schematic. Also, though I am no 8051 assembly expert, if the code you have posted is the entire firmware, then I'm not sure how you expect it to do anything useful. There is no SETB or MOV instruction which could be used to set an output pin. |
H: What's the use of a decoupling capacitor near a reservoir capacitor?
I've seen some circuits where a decoupling capacitor is used as well as a reservoir capacitor, like this (C4 and C5):
I've read about decoupling capacitors and for me it looks as if they are meant to remove small fluctuations in the supply voltage. Then I thought - wasn't that the purpose of a reservoir capacitor as well? Why wouldn't the reservoir capacitor be able to filter out the small fluctuations, if it is able to filter out the large fluctuations?
So I feel like I have a basic misunderstanding here. What is the purpose of a decoupling capacitor next to a reservoir capacitor, when we assume we place both equally near to the power consuming part? Or is the only advantage of the decoupling capacitor that it is smaller and can therefore be easily placed more near to the power consuming part?
AI: The most likely reason why that is done is because, in real life, capacitors do not have infinite bandwidth. Generally, the higher the capacitance of the capacitor, the less it will be able to react to high frequencies, while small-valued capacitors react better to higher frequencies, as seen in the graph below. Using two different-valued capacitors together is just done to improve the response of the filtering. |
H: What is a one-bit ADC good for?
I have recently heard of the concept of a one-bit ADC, and have seen it implemented in the context of a sort of digital-to-analog converter (oddly enough), and I'm wondering, what is the point? Why not simply use a higher-resolution ADC, if higher resolution is desired?
AI: To give a basic example of how a 1-bit ADC can be used to obtain useful information from a waveform, take a look at this circuit. It uses a triangle wave to turn the information into a pulse width modulated output. This is a similar but simplified version of how other 1-bit ADC techniques work, by using a (usually fedback) reference signal to compare the input to.
Circuit
Simulation
Magnified Timescale View:
We can see from the top input waveform, the triangle wave is used to compare the waveform at different points through it's period. As long as the triangle wave is of a considerably higher frequency than the input (the higher the frequency the more accurate), this causes the comparator to output an average of high/low depending on the voltage level of the waveform.
To see how we can reproduce the original waveform from the PWM data, the comparator output is fed into a low pass filter, and out pops the sine wave again.
For further reading:
Delta-Sigma Converters
Successive Approximation ADC
Single Bit ADCs
Ramp Compare ADC (Counter ADC) |
H: Multiplexing an 8x8 Matrix - Why Transistors?
I'm trying to understand how to properly multiplex an 8x8 matrix (or any large amount of LEDs)
http://arduino.cc/en/Tutorial/RowColumnScanning
However, I'm getting a bit confused, since I've found others like this: http://garagelab.com/profiles/blogs/arduino-scrolling-text-marquee-to-give-a-happy-christmas
That one says to use transistors for the current switching, but the first link doesn't even use any resistors (which I find suspect), nevermind transistors.
I don't really see why the transistors are needed, can anyone explain why?
Thoughts?
AI: The transistors are needed if the current required to drive the LEDs is higher than the microcontroller can handle. This means either a single pin current rating, or the maximum rating for all the pins together (will be given in the datasheet)
Most typical 5mm and 3mm LEDS have a maximum current rating of around 20mA and can be driven directly from a microcontroller pin (10mA is fine for most applications)
However, if your microcontrollers maximum rated current is 200mA and you want to drive 20 LEDs at 15mA, then even though the individual pins can supply the current you are out of spec for the maximum current rating.
The LEDs should always have a current limiting component (e.g. resistor) in place when driven from a voltage source, so you are right to suspect the first link. It appears that it is simply relying on the pins drive not being high enough to cause damage to the micro or the LED, which is definitely not a good idea.
Here are the the Absolute Maximum Ratings for the ATmega328. Notice there is a per pin current rating and also a maximum total Vcc current rating:
Also see notes 3 and 4 on pg.314:
Also, you can get high power LEDs with current ratings of >500mA, so a transistor is obviously the only option in this case. |
H: Options for getting 3.3v @ 220mA from small batteries
I have a system running at 3.3v requiring 70mA at most times and 220mA at peaks (roughly 20% of the time). I'd like to find a way to power this from coin cell batteries or other small portable source. Battery life needs to be about 1h but size should be as small as possible (which is why something like AA's won't work)
I see a couple ways of doing this:
Put several 4 button cell alkalines in series and use an LDO voltage regulator to get the voltage down to 3.3v
Use ~3 alkaline button cells in parallel and boost the voltage using TPS61200 (datasheet: http://www.ti.com/lit/ds/slvs577c/slvs577c.pdf). Schematic similar to this: http://www.sparkfun.com/datasheets/Prototyping/LiPower-v11.pdf
Same as the previous one but with the batteries in series. The TPS61200 will regulate down to 3.3v when the batteries are full and boost to 3.3v in the end
Same as above but with a single cell LiPo battery. I'd like to stick to easy to find batteries though. Rechargeability is not important.
Use 3 AAA batteries in series with a voltage regulator (size is a bit of a concern..)
In terms of efficiency does it matter if i put 3 alkaline batteries in series or parallel (TPS61200 can work down to 0.3v with a 0.6v startup voltage)?
So far i tried using a CR2032 lithium battery with NCP1450A (http://www.onsemi.com/pub_link/Collateral/NCP1450-D.PDF) to boost it to 3.3v but the output voltage stays around 1.4v. It may be that something else is wrong in my circuit but from what i understand the battery can't provide enough current anyway (4mA continuous, 15mA peaks) so there's no point continuing that path?
AI: Coin cells will not work well with your needs. While it varies by brand and size, most coin cells have low capacity, and an internal resistance that limits current output. A CR2032 has a nominal 250ma capacity (and that varies based on current load btw), and an internal resistance (Equivalent Series Resistance or ESR) of 18 to 30ohms, again based on current load). Depending on the speed of the current draw, you are going to get voltage drops, and quickly drain the coin cell. If you can get that much current out of it at a given time. 70mA is pushing it even for high quality CR2032, and 220mA is improbable, frankly, impossible. That is why your CR2032 boosted to 3.3v isn't working. The current draw of the regulator is causing the cell's voltage to drop.
That is, without having multiple in parallel (or using high capacity caps). That's the second part you asked. Batteries in series are a sum of the voltages, with the same amount of current. Batteries in parallel are a sum of the current capacities, with the same voltage.
As for your options, one or two AAA batteries with a boost converter would suit you better. It gives you relatively high capacity while still keeping space to a minimal. The TPS61200 you mention would work, if you can deal with a tiny (3x3mm leadless package. The TPS6107x family would do the same, same minimal components, in a sot6 package. You only need 1 battery for either of these. An AA gives 2400mAh nominal, an AAA gives 1200mAh nominal. |
H: What is the purpose of R2 in this discrete voltage regulator circuit?
I understand the general working of the circuit - R1 biases Q1, Q2 acts as an error amplifier closing Q1 just enough to get 1.4V at it's base. What is the puropse of R2?
simulate this circuit – Schematic created using CircuitLab
AI: R2 simply makes sure that there's a certain amount of current flowing through Q1 even if no external load is attached to the circuit. This is called a "minimum load".
It also makes sure that a certain amount of current is flowing through D1, which makes its forward voltage drop have a more stable value, improving the regulation of the circuit overall.
Note that as long as R1 = R2, the current through D1 is independent of the actual value of Vout; it only depends on Vin and the resistor value. The current flowing through R1 is (Vin Vout Vbe) / R1. The current flowing through R2 is (Vout Vf) / R2. If you add these together, the Vout terms cancel, leaving (Vin Vbe Vf) / R1.
The only current through these two resistors that doesn't flow through the diode is the base current of Q1, which means that the diode current slightly depends on the amount of current being drawn by the load, depending on the actual gain (current transfer ratio) of Q1. For high loads, this would be a good place for a Darlington. |
H: Where to find buttons eagle cad
Does any one know where to find buttons in EAGLE that look something like the one in this schematic?
I'm making a schematic and all I can find are complex looking buttons. If those are not available, then can someone help me find a normal switch, like this:
I can't seem to find this in the EAGLE libraries, either.
AI: The best answer is to make your own, it's easy. Someone else's library parts aren't going to adhere to your conventions for the silkscreen, hole sizes, BOM handling, etc, etc. I never even look in the Eagle libraries as they are basically useless.
In your case, you haven't even said what kind of button, only shown the schematic symbol. There are many many many different "buttons" from various manufacturers. Most of these will require a different footprint. You have to specify a particular part before you can even tell if someone else's Eagle button is applicable to your case.
In the off chance you can live with my conventions, download my Eagle Tools release from http://www.embedinc.com/pic/dload.htm and look around in the "Switch" library. There are some buttons in there, but again, there is no way to know what you actually want. |
H: Information about time-to-digital converters (TDCs)
I'm going to measure short times (max 150 microseconds). To do this I will use time-to-digital converters (TDCs). They don't seem to be very common and it's hard to find information about them on internet. I wonder if someone here can answer my questions.
Which companies make these things? So far I've only found Acam. Is there more manufacturers?
They are connected with SPI. Can I connect six of them to a single MCU? The problem is that all six can sometimes send the measurement at the same time. What happens then?
Is there an alternative which would do the same? A resolution needed is 50 nanoseconds.
AI: This is the first I have heard of your "time to digital converter" thingies. That is probably because I've never tried to look for a stand-alone part like this before, which is because just about all microcontrollers have this capability built in.
Many many micros have the capability to capture the value of a free-running timer on a edge of a digital input. That seems to be what you want. You need 50 ns resolution, so the timer needs to increment at 20 MHz rate at minimum. There are plenty of micros that can do that. Some of the dsPIC, for example, can run at 40 MHz instruction rate, which is also the rate the timer can be incremented at. That would give you twice the resolution you need.
It is unclear if you want to measure the width of a pulse or the time between two separate events. It also matters what the minimum possible time between the start and end capture is. Depending on the answer, you can do this with a single capture module or you may need two for each pulse. If the minimum time is long enough, then the firmware can grab the capture value from the first event and reconfigure the capture hardware for the second event. If the time is too short, you need separate capture hardware for each edge, perferably running from the same timer.
Take a look at the "Input Capture" module of dsPICs. One or two of these should do what you want. You may not be able to handle all 6 signals in a single micro, but micros are cheap, so use one for each signal if you have to. That also makes communicating the result back to some central location easier since you can implement any protocol you want.
For more specific recommendations we need to know what the minimum time between the edges are, how/if the 6 signals need to be synchronized, do they have a commmon start time, etc? |
H: Random-delay gen
Some years ago I tried to design a circuit where (among other things) a LED flashes after a kinda random delay. As it didn't work, (and after raging and destroying everything that could help me solve the problem) I am wondering if there was a fundamental mistake or I was just too sloppy.
Today, I finally found a print of the circuit (the digital version is lost anyway) so that I, at least, can ask for help.
Picture of the circuit:
(Hope you're not confused by the european symbols...)
By unplugging the counter IC (7474), everything is working as it should (just with constant delay): by pressing the first button, the belonging LED lights up till the LED "D4" flashes.
Therefore, just the upper half of the circuit is interesting for me. Without the counter IC the delay is generated by the capacitor "C1". My intention was that, by grounding the other 2 capacitors (C2 and C3), the capacity (and the delay time) is tripled.
As the counter IC is supplied with nearly the same voltage as the capacitors, the 2 capacitors (C2 and C3) should only influence the circuit while the counter IC doesn't output TRUE
The outputs of the counter IC should be random, as the counters are set by oscillators (made with IC2)
AI: As the counter IC is supplied with nearly the same voltage as the
capacitors, the 2 capacitors (C2 and C3) should only influence the
circuit while the counter IC doesn't output TRUE
This is your false assumption. C2 and C3 have the same capacitance, and the same effect on the timer circuit, regardless of whether their negative ends are held at 0V or 5V.
Note that when they are at 5V, you are reverse-biasing the capacitors, which can potentially damage them (but probably not too badly at 5V). |
H: VHDL: Architecture naming and interpretation
Note: I am using Xilinx's ISE and have an FPGA board to work with (with switches and lights and so on), and I've hacked together some simple projects so far. At the same time I'm reading several tutorials to build a foundation for what I'm doing.
I've seen various entities and their architectures mentioned in the reference materials I've been going through, but the naming is often confusing. Often instead of "architecture rtl of.." or "architecture structural of..." I'll see "architecture foo of..." or even "architecture arch of..."
I realize (belatedly) that the architecture name is just as arbitrary as the entity naming, though there are style guides that suggest more consistent naming conventions can be used to avoid this issue. This leads me to a few questions:
Looking at an entity, how can one determine the actual architectural
model being used without hints from the architecture name? RTL,
behavioral, structural... they appear to be quite similar to my
learner's eye (assuming the examples I've seen were actually named
correctly). A simple but obvious example would be helpful here (or a
pointer to one).
If specifying multiple architectures for a single entity (which I
understand is possible) do you simply give the architectures
different names in the same file or...?
Are the architecture names confined to a given entity (that is, is
there any problem with "namespaces" by using the same architecture
name over multiple entities)?
Edit: and one more:
It seems there is a distinction between RTL and behavioral, but as mentioned above I'm not really seeing it in the examples I've seen (often I only see one architecture being defined). Is one architecture more common than the others?
What I've been looking for is a comprehensive yet simple multi-component project (little components), written using best practices (proper naming, not all crammed into one file, etc.) but I've yet to find one. I find properly crafted sample projects very useful for illuminating basic principles and best practices. If you know of such an example project I'd be grateful for a pointer to that as well. (If nothing else, perhaps once I figure this out I can share one of my own...)
AI: Looking at an entity, how can one determine the actual architectural
model being used without hints from the architecture name?
You can't - when it is instantiated or configured the architecture can be specified (if there is more than one to choose from) or a default will be chosen for you.
If specifying multiple architectures for a single entity (which I
understand is possible) do you simply give the architectures different
names in the same file or...?
You give them different names. It doesn't have to be within the same file (in fact VHDL cares a lot less than you might think about what's in what file)
Are the architecture names confined to a given entity (that is, is
there any problem with "namespaces" by using the same architecture
name over multiple entities)?
They are "attached" to an entity, so can be reused.
I often use a1 as my architecture for everything synthesisable as
rtl implies lower level (to many readers) than I write at.
behavioural often implies non-synthesisable (to some readers)
synth is used by the synthesiser for it's model (otherwise I'd have used that)
a1 has been non-conflicted so far and doesn't cause confusion ;)
If I actually have more than one architecture, I tend to name them verbosely (for example hard_multipliers and lut_multipliers for a filter which instantiates - or not - MUL18 blocks).
Very often you only have one architecture, so it doesn't matter. Good entity names are much more important.
It seems there is a distinction between RTL and behavioral, but as
mentioned above I'm not really seeing it in the examples I've seen
(often I only see one architecture being defined). Is one architecture
more common than the others?
It's historical - you didn't used to be able to synthesise "behavioural" code (which at one point included things like adding!) - so you created an RTL version which instantiated adders and the like. (That's as I understand it - I've been writing behavioural (and yet still synthesisable) code since I started VHDLing in about 1999!) |
H: i2c on different logic level devices
I'm having a problem making LPC2148 work with SRF10 sensor. LPC is 3.3v device with 5v compatible i2c (at least user docu claims that). On the other side there is SRF10 device which is 5v.
I have tried with both levels as pull-up lvl connected with 4.7k resistor (i have 3 devices on same line so i used higher value resistor).
Strange thing is that it sometimes read the value correctly but it fails to read values from 2 registers... Basically, it doesnt work.
Now, what is strange on this picture, is that logic lvl on SDA is 0 by default and it should be 1. That means that pull-up is not doing the job well ? Could that be related to logic lvl differences between uc and slave ?
EDIT:01.03
Here is my implementation of state 0x50, a_chn is i2c0 or i2c1
void slaveDataReceived (uint8_t a_chn)
{
uint8_t k;
volatile unsigned char *i2cConClear;
volatile unsigned char *i2cConSet;
volatile unsigned char *i2cData;
if (a_chn == 1) {
i2cData = (volatile unsigned char *)(0xE005C008);
i2cConClear = (volatile unsigned char *)(0xE005C018);
i2cConSet = (volatile unsigned char *)(0xE005C000);
}
else {
i2cData = (volatile unsigned char *)(0xE001C008);
i2cConClear = (volatile unsigned char *)(0xE001C018);
i2cConSet = (volatile unsigned char *)(0xE001C000);
}
k = *i2cData;
appendToDataBuffer (a_chn, k);
if (i2cDataRcv[a_chn] == i2cDataHead[a_chn]){
I2CMasterState[a_chn] = I2C_IDLE;
*i2cConSet = I2CON_SET_STO;
*i2cConClear = I2CON_CLR_AAC;
}
else {
*i2cConSet = I2CON_SET_AA;
}
*i2cConClear = I2CON_CLR_SIC;
}
AI: I see valid start and restart conditions in your waveform, so I don't think SDA is the 'wrong polarity'. The valid start condition is there before writing 0xC0 (indicated by the first green dot in the capture) and the valid restart is the second green dot (before 0xC1). The fact that SDA stays low after the master ACKs the slave shouldn't be an issue as long as the master releases it before the next rising edge of SCL.
One issue could be the size of the pull-ups. If you're trying to operate faster than 100kHz, you may need stiffer pull-ups to ensure the edges are sharp.
Another issue is that the master should NACK the last expected read byte, even if it is valid data, since many slaves expect a NACK before they will allow a valid stop condition to come through. For your single-byte reads, the master should NACK the data byte. For the 16-bit registers, it should ACK the first byte and NACK the second one. I've seen quite a few slave devices hang the bus or malfunction if the last read isn't 'terminated' by a NACK. |
H: How can I detect a pulse from a device with the AC'97 component of a Xilinx Atlys board?
I have a digital device which transmits rapid pulses over a 3.5mm audio cable, indicating that some event has occurred. I want to connect that device to my 3.5mm line in jack on my Atlys board and determine how many of those pulses have come across. I have read some other people's questions regarding transmission, but have yet to find community sourced information on reception with the audio jacks.
The maximum pulse frequency from the device is a little under 6kHz, so I figure the Atlys board will have no problem.
I was hoping I could just monitor some "data ready" type of signal. But with the two different clocks (L15, L13) and the complexities of AC'97, for a beginner it's quite confusing.
Does anyone have any thoughts or suggestions on how I might accomplish detecting these pulses?
AI: Without more information all we can do is guess. You don't come right out and say whether this source of "rapid pulses" is AC'97 so my answer is going to assume it's just some arbitrary pulse train you want to look at and process. If it's AC'97 then you probably don't want to connect it to a (presumably) analog audio input.
Guess 1
The 3.5mm jack on the Atlys board has some minor signal conditioning and can be connected directly to an input pin of the FPGA. You can run that signal through a synchronizer and Bob's your uncle. Your detection time will have a resolution of the FPGA clock signal used to synchronize the incoming signal, and will have delayed by however many flip flops are in your synchronizer.
Guess 2
The 3.5mm jack on the Atlys board is treated as an analog signal (makes sense, as 3.5mm jacks are typically used for audio), conditioned as such and fed to the input of an ADC. In this case you've got to drive the ADC with the FPGA and look at the output of the ADC to determine when a pulse came in. The signal's bandwidth is only 6kHz so this really shouldn't be an issue, and you can filter the ADC data more if need be. The output of all of this should be a digital pulse train.
Guess 3
Similar to Guess 2, but maybe you're lucky and you have the analog signal from the 3.5mm jack feeding a comparator. The output of the comparator goes to the FPGA, and now you've got a digital signal that must be synchronized and used just like Guess 1.
Once you have this digital pulse train in the FPGA you probably want to count pulses over some period of time. If it's an AC'97 stream there are plenty of resources on decoding AC'97, but let's ignore the content of the data stream for the moment.
If you're just counting pulses something like this might work:
if pulse_bit changes
if pulse_bit = '1'
++pulse_count
end if
reset_pulse_timeout
end if
if pulse_timeout expires
copy pulse count to toplevel
reset_pulse_timeout
end if
If you're actually looking to extract some kind of intelligence from the pulse train (i.e. it's not just a pulsing line but more like a serial line and you're looking to get data from this) then you want to look at various async or sync serial ports (UART, TDM or USART) to look for the start of a transmission, grab bits and look for a stop bit. At that point you now have a data word you can look at specific bits within for what you want. |
H: Mathematical approch to measuring current, voltage and resistance of mixed series and parallel
If there is a circuit like the one below, where all resistors are 1k ohm, how does one determine the currents? The voltage sources are all 10 volts.
The problem I am having is that I do not know if the top voltage source takes the zero resistance path in the middle or if the bottom one does.
NOTE: This is not a homework question.
AI: There is one important low-impedance node in the whole circuit. That's the frame and the cross in the middle. Let's call that 0v. The top voltage source is connected to the middle via that 1k resistor, that means the lower voltage source has priority.
The current flowing in:
the bottom resistor must therefore be 10v/1k = 10mA.
the right resistor must be 0mA, because it has the same voltage on both sides.
the two resistors in the top half form a potential divider between 0v and 0v, so you might think of the top voltage source as sitting at about 0v too. However, since it's generating a voltage, then the top side will be at 5v, and the bottom side at -5v. |
H: What is with the popularity of the 8051 Core?
I keep seeing the old 8051 architecture around a lot. But I can't see why people would want to use this old architecture in their products when there seem better alternatives around, such as ARM cores, and if you're not designing your own MSP430s, AVRs, PICs offer a good feature set and are low cost. So why are they still so popular?
AI: From Wikipedia:
Designers use 8051 silicon IP cores, because of the smaller size, and lower power, compared to 32 bit processors like ARM M series, MIPS and BA22. Modern 8051 cores are faster than earlier packaged versions. Design improvements have increased 8051 performance while retaining compatibility with the original MCS 51 instruction set. [ ... ] Enhanced 8051 silicon IP cores now run at one clock cycle per machine cycle, and have clock frequencies of up to 450 MHz. That means an 8051-compatible processor can now execute 450 million instructions per second.
Some engineers may have learned about the 8051 in school, and so they reach for the familiar part in their designs. (This is like the question: why are new schematics still drawn with the 741 op-amp?)
Also, this is a very helpful, entertaining read which touches on the subject of why isn't something more complex and powerful always chosen in favor of the simple: http://www.danielsen.com/jokes/objecttoaster.txt |
H: Eco-roof flow meter with "counter channel" output - what is that?
Some background:
I'm working on an eco-roof flow monitoring project and we want to hook up a Unidata 6506G tipping bucket flow gauge (our effluent flow is in a strange low range range where we needed a large tipping bucket) to a Steven's data logger.
Data Sheets:
Flow Meter
Data Logger
Real Question:
What's with the output from this flow meter? It just says "a series of digital pulses." What is a counter channel, what is a pulse channel, and how do they differ from analog? Do you think it will be necessary (or possible) to have, say, a microcontroller translating the data from the flow meter to something the data logger can handle?
Apologies for broad question, I am an environmental engineering student. Anything to get me on the right track would be awesome. Thanks!
AI: Your flowmeter is a tipping bucket - it dumps when a fixed volume, N, has accumulated. When it dumps, it momentarily closes a reed switch. Thus every time the switch closes, you've amassed an additional N of total flow. By taking the first derivative of the output - dividing by time - you can compute the flow rate.
These reed switch closures with each dump can be made into electrical pulses if the switch is made to complete and break a circuit. If you count the pulses over eternity, you can compute the flow over eternity. If you count the pulses per unit time, you can compute the flow per unit time.
To interface with your datalogger, you'll want to use the "pulse" input. A pulse input is basically an input to a digital counter inside the datalogger. Every time your bucket dumps, the switch closes and the datalogger will register a count event, incrementing the internal counter by one. The datalogger hardware and software will determine exactly how counts are managed, whether they are simply counted or differentiated to give a rate. You'll need to look into the configuration docs for your specific model to adapt it to your specific needs.
What you have is similar to a digital output - the switch is either open or closed. The total flow is a function of events over time. An analog output would supply a continuously variable signal (voltage, current, or frequency, typically) that would resolve to engineering units in your datalogger. For example, a pressure transducer might provide an analog voltage output ranging from 0-5V as the pressure ranged from 0-500 PSI. Your datalogger would read the voltage directly and convert it into a digital number, which would then be scaled back in to the 0-500 PSI engineering units by your datalogger software.
The good news is that this is all pretty safe stuff (i.e. hard to damage either the equipment or yourself). Try connecting the flowmeter to your datalogger on your desk. Simulate water flow by tipping the bucket and verify that it shows up the way you expect in the datalogger software. |
H: How to force Keil to compile with software float for STM32?
When I am trying to create a float variable in Keil to program STM32 it just crashes.
I had a look online and as far as I read it tries to use hardware floating point unit (which is not enabled and I don't want to use it).
If I want to use software based floatin point then I have to specify that in my compiler.
How do I do that?
AI: In the Keil Compiler Options (ALT+F7 - Target tab) you can select Floating Point Hardware - Not used. That should solve the problem. |
H: Question about the Inrush Current in LDO
I have a doubt with inrush current limiting for an LDO. To understand that, I referred old literature of capacitors and others. I have some conflicting arguments which I need to clear out:
This is from Wikipedia:
The current into a capacitor is known to be
: the peak inrush current will depend upon the capacitance C and the
rate of change of the voltage (dV/dT). The inrush current will
increase as the capacitance value increases, and the inrush current
will increase as the voltage of the power source increases. This
second parameter is of primary concern in high voltage power
distribution systems. By their nature, high voltage power sources
will deliver high voltage into the distribution system. Capacitive
loads will then be subject to high inrush currents upon power-up.
The stress to the components must be understood and minimized.
This passage says that inrush current depends upon capacitance
value, voltage to applied to it.
From my basic understanding: for sudden changes the capacitor is a short and the capacitor will not allow any changes in voltage suddenly. So, when we turn ON power at that instant C will be short having 0 voltage across it. So the max current will depends on the ESR of cap and any series path resistance. It doesn't depends on the capacitance value.
This passage says: Inrush current depends on ESR of the cap and not on value of capacitor, which contradicts the previous passage.
From all these how can we calculate how much transient will there be?
One more confusion: most of the regulators specify controlled slew rate of the output to mitigate this inrush current limiting problems. But the slew rate limiting will work for capacitors connected on the output side. But there will be capacitors that will be connected on input side of the regulator. Will those have large currents?
AI: You are assuming the capacitor will be a true short, which it won't be, the voltage will never rise infinitely fast - remember there is inductance and resistance in real life to limit things. If we look at the formula for current through a capacitor:
\$ I = C \cdot \dfrac{dV}{dt}\$
We can see that I depends on the cap value and how fast the voltage source rises. The formula does not include the ESR though, so we have to allow for this separately.
This means that both the cap value/rise time and/or the ESR can limit the peak current - roughly meaning if the rise time is fast enough, the peak current will be limited by the ESR. If the result of the formula above is much lower than V/ESR though, then it will be limited by the capacitance value, or voltage rise time.
You can see both effects at once - initially at turn on with a fast rise time, there will be voltage divider effect between the wiring resistance and the ESR, then the capacitor charges as it would normally.
If we look at a couple of examples, using the same risetime of 1ns to 1V, but different ESR/Cap Value/Wiring Resistance.
With a 100uF Capacitor, 1mΩ ESR, 1mΩ Rwiring:
With no ESR, we would expect I = 100uF * (1V/1ns) = 100kA. However, the resistance of the wiring and ESR of the capacitor divide to limit things to 500A initially, then the capacitor charges to 1V.
Now if we reduce the capacitor value to 10pF, but keep everything else the same, the current is limited by the capacitance value: I = 10pF * (1V/1ns) = 10mA:
The ESR has no effect here.
Now if we simulate a more realistic situation with the 100uF capacitor, wiring inductance of 100nH and increased resistance of 10mΩ wiring resistance and 50mΩ ESR we get something like this, where everything works together to limit peak current:
These are very simplistic simulations, you could go on and add the capacitors ESL, leakage current, wiring parasitic capacitance, etc.
About the capacitors on the input side of the regulator, without limiting they will be subject to large currents at power up regardless of the slew rate limiting on the output side. |
H: Raspberry Pi and Touch / Pressure Sensor
I have to create simple device for a promotion campaign. I should react when someone seats on the chair, so I need advice on choosing the right sensor. Should it be pressure sensor and what kind is better for Raspberry Pi?
AI: If you just need to detect someone sitting on a chair, you just need to connect a pressure-switch or mat to one of the GPIO pins & read the status. There is plenty of info on this on the RaspberryPi forums.
A robustly-sprung push-button switch on one of the legs could also do. |
H: Microcontrollers with Floating Point Hardware
I know this is a "contemporary" question, but I think it's a useful one to aggregate some knowledge. What are some currently available microcontrollers that sport a hardware floating point unit (i.e. that aren't going to cost me a huge RAM footprint to do floating point math emulation)?
AI: The Cortex-M4 devices include a FPU. Some of them are:
ST Micro: STM32F3 and STM32F4
TI: Stellaris LM4F
NXP: LPC4300
Freescale: Kinetis K
[Edit]
Just because they include an FPU doesn't mean the support all floating point instructions. Make sure to check the microcontroller's information to see what might be missing. |
H: How to avoid/reduce heat for three 1W LED's?
I'm asking on behalf of a colleague who wanted to make solar powered lighting for poor people.
Electricity generated by solar cells are stored in a car-battery sized 12V battery, and that current is passed to three 1W LED's which operate at 3.3V. She's tried connecting it in series and parallel, but she says the circuit heats up and the LED's don't work for a while, but when it cools down, the LED's glow again.
She wanted to know:
1. How to prevent the heat formation, so that the LED's would glow continuously?
2. How to efficiently convert 12V to the three 3.3V of the LED's (series/parallel)
Using thermal paste was far too expensive (they're making it for poor people).
AI: Only two ways to reduce heat in LED applications. The first is undercurrent. Reduce the current they use by choosing bigger resistors or adjusting your current controlled source. This of course leads to less light output. Alternatively you can use PWM to simulate the brightness but still cutting out some on cycles.
The other method is cooling. Large Heatsinks are the primary passive method. Or you can throw on a fan as well. There is always Peltiers but cost is a concern with those.
You do not want the leds in parallel. You will need to bring down the 12v to 3.3v on each, and then have three times the current. Very inefficient. Keep it in series, you would only need a single current regulator and only one times the current. |
H: What's the equivalent zener voltage of two parallel zeners?
Assume we have two zeners connected in parallel, one with a zener voltage of x volts, and one with a zener voltage of y volts. What will be the equivalent zener voltage of the circuit?
AI: The one that has the smaller voltage. It will hog the current until it's voltage compliance brings the voltage into the range of the higher zener, which then will start to flow some current. But even if the higher zener is flowing some current the majority will still flow through the smaller voltage unit.
Heating of the diodes also plays a role, especially if the voltage shifts with increased temperature. While the term Zener is generically applied to these diodes, the Zener breakdown (negative temperature coeff.) and avalanche break down (positive temperature coeff.) are two distinct mechanisms. |
H: Suitable components for logic control
Having never worked with electrical components, ignorance of the most elementary sort is holding me back. I'm looking for suitable components for logic control of DIY home automation equipment. I've looked extensively online and have no idea. What websites, books, etc. can I use to figure out what kind of hardware I need?
Some examples of the work the logic controller will need to perform:
Read signal voltage from 6 to 12 sensors (mostly < 5V. At least a few < +/- 0.05V) and communicate that data to software
Operate outdoors down to -10'F and up to 120'F
Run OS/software based on a common programming/scripting language
Turn on and off relays that control 12VDC, 48VDC, 55VDC, 110VDC, and 220VDC circuits
Crude Real-Time Clock (1 second precision is fine)
Use a common physical connect for access to the UI (RS-232, ITU-8P8C, etc)
Execute really simple programs
I'm not even sure what all information you need to help me. If you ask for clarifications I'll edit my question pro-actively. Please edit tags as appropriate. I'm quite lost, but very motivated to learn.
AI: From what I gather from the comments, you don't want to use a ready built and/or hobby type platform.
You are right, an R-Pi is way overkill for switching a few relays and reading some sensors, and for all it's processing power is not as useful as many small microcontrollers would be with e.g. ADC and other low level peripherals.
So I would advise:
If you have never worked with electronic components, don't assume the missing knowledge you need is "elementary" - if you want to avoid using a ready built platform, there are many things that can complicate even the simplest of electronics firmware/hardware tasks. So be prepared to spend some serious time reading and soldering.
Grab a small microcontroller like a PIC or AVR, a breadboard, some basic components (see e.g. Adafruit or Sparkfun for starter component kits) and start there (for a proper selection see Mouser, Farnell, Digikey, etc).
There is lots of info out there to get you started, just head over to Microchip or Atmel and take a look at the starter kits (an example is the 8-bit based PICkit3 starter kit, or a more powerful 32-bit option is the PIC32 starter kit). There are plenty of App notes and tutorials on the sites mentioned above.
You will almost certainly have to learn some C, it is the main language for small to medium microcontrollers. There are more exotic options like graphic driven firmware design using flowcharts and such, or C++ for more powerful micros like the ARM Cortex, so if you really want to avoid C have a look around for alternatives, but it is likely to make things more difficult for you.
Grab a basic electronics book - Practical Electronics For Inventors is a great introduction to all the components and basic theory. It does not really cover the firmware side of things though, for that have a look through options on Amazon, Programming 32-bit Microcontrollers in C is a good one if you go for the PIC32 starter kit.
Lastly, jump right in and come back here when you get stuck. It's easier for us to help you with specific problems as they turn up, right now you just need to get going with something (anything) and find your feet as you go along. |
H: EMVA standard 1288 SNR formula (equation 11)
I'm trying to understand equation 11 for Signal-to-Noise Ratio in EMVA standard 1288 Release Candidate 3.1:
http://www.emva.org/cms/upload/Standards/Stadard_1288/EMVA1288-3.1rc.pdf page 7.
Using equations 6 and 8 I arrive at something similar to eq 11. However for me there is no
Instead I get
I have to say it makes more sense to me to find another noise term below instead of number of electrons.
Can anyone explain this?
AI: They have just substituted the statistics for shot noise back into the equation.
\$ \sigma_e^2 = \mu_e \$ and \$ \mu_e= \eta\mu_p \$ i.e. # of electrons = QE * # photons and shot noise follows \$ \sqrt N \$ statistics.
Other than the different nomenclature (other than what I am used to that is) it is a good document and I recommend you conform to it's standards. |
H: Wall supply transition to a 2nd wall supply
A device has various supply rails, but they are all derived from one 9V wall supply via switcher and linears. What kind of issues can occur if the device is unplugged from one wall supply and then plugged in another, within seconds?
Are the grounds of the two equivalent or can weird reverse biasing happen momentarily; especially if the ground or power terminal of the 2nd supply doesn't connect simultaneously?
Is there some terminology that I am missing that could help in searches?
AI: There should be no issues with reversals. The circuit may stop to function because there may not be sufficient hold time on teh charge storage on board. or some of the rails may droop whilst others are held. This may be more problematic in certain cases with parts of the circuit having gone through a reset whilst other parts are in an old state. without knowing what the circuit is and it' very hard to tell. "Hold time", "brown out sensitivity", "rail sag", "Rail droop" or "power droop" to name a few searches. |
H: Connection of EZ430-RF2500 development tool with PIC18f877
I want to conect the ez430-rf2500 development tool with PIC16f877 throught uart, do I have to use a max232 chip in order to be able to communicate between those two MCUs or it can be done without it.
AI: You can connect the PIC's UART to the MSP430's UART directly, if the power supply voltages are the same. So, it is possible get away without an RS-232 driver such as MAX232. Of course, you would need to connect the grounds together.
As a side note, MAX232 generates the true RS-232 voltage levels. These are higher than the voltage levels, which the UART outputs. The benefit of higher voltage levels is that the true RS-232 is more immune to interference.
What if the power supply voltages aren't the same?
PIC16F877 can use supply voltages between +2V and +5.5V. MSP430F2274 on the ez430 can use supply voltages between +1.8V to +3.6V. Suppose that the MSP430 runs off +3.3v, and the PIC runs off +5V. MSP430F2274 doesn't have inputs that are 5V-tolerant.
The supply voltage ranges overlap. May be, lowering the supply of the PIC16F877 to +3.3V is an option. You may need to lower the oscillator frequency. Check that other components, which share the power supply rail with the PIC can operate off +3.3V.
If your design doesn't allow you to lower the PIC's supply voltage from +5V to +3.3V, there are level shifters (or level translator) ICs. See this post for details. |
H: PackageReference in Altium Designer
In Altium Designer standard libraries, parameters PackageReference and PackageDescription are same as Footprint Name and Footprint Description.
I'm also going to have those fields in my new components, I wonder if the above is plain copy or those fields are referencing to each other? Feels redundant to manually copy that two pieces of information.
Can I just create footprint, name it, set description and then somehow reference that information in PackageReference and PackageDescription parameters?
AI: Use a database
Best practice is to manage all of this information outside Altium using its database integration sub-system.
You can link symbols and footprints via a table rather than trying to manage this information inside of a symbol (which is the wrong layer of abstraction) or in a library of symbols (grouping becomes arbitrary and difficult to manage as the library size grows).
Doing it this way means that you never have to mess with internal attributes and double-entry of data.
My approach
I use CircuitHub for library management. It's free and it's trying to be a Wikipedia of parts.
It plugs into Altium (and other tools) and provides linked symbols and footprints via a local database that is sync'd from the web (so you can use it offline).
You can add/edit/manage parts on the website and it automatically (via Dropbox) syncs those changes to your computer where you can use them in Altium (or any other supported tool).
Here is how you setup CircuitHub to work in Altium.
Here are the basics of component management in CircuitHub.
Disclaimer
I helped create CircuitHub, because I got tired of dealing with these kinds of problems in library management. |
H: Arduino GPS Camera
I am working on a project through my school. We are going to be shooting cameras on spikes into the ground beside grid roads for tornado tracking. The spikes will be equipped with two cameras. My job is to design a system to track the spikes. I need to get GPS location and send it to a computer in the truck. I was thinking of using an Arduino. I need to send the GPS info (and possibly temp./air pressure) to the truck. I need as much range as possible as one of the spikes might be thrown by wind. We are hoping to keep the cost under $250 per spike.
AI: I recently bought two XBee-PRO 900HP's ($40 each) and I think they'll do nicely for your purpose. Great range (although I haven't tested anywhere close to the range you need). The spec claims up to 28 outdoor line-of-sight miles. Setting them up was really easy. These are new modules so you might have trouble finding decent tutorials on the "API mode" but you can probably get away with the default serial mode. These can be powered directly from the Arduino's 3.3V pinout. I can't stress enough how easy I was able to go from zero to sixty with 'em. The DigiMesh technology may be incredibly useful given you'll have an array of these spread out geographically. Since you'll be transmitting binary data (the images) I guess you'll have to base64 them. In API mode (aka not basic serial) I'm fairly certain you could transmit the raw binary data without any conversions other than having to split it across multiple packets. You'll have to fiddle with the baud rate based on your range, how much data your transmitting, and how fast you're doing it.
Another option, and I'm not sure how expensive this would be, is to give them all cellular data connections. You'd just have to setup a web server somewhere with a simple API. This would probably end up being easier to get working assuming you're in an area that has decent cell coverage and you know how to setup a web server (or know someone who does that's willing to work with you).
I think an Arduino Uno (or similar) would be enough but that would depend on the size of your imagery. You'd most likely have to have another chip buffer the image and then pass it through to your own buffer on the Arduino. An Arduino Pro would also work but would take considerably more effort to get up and running. It also doesn't have a 3.3V regulator built in. The new Arduino Due might be worth a look too.
In the same project (and device, for that matter) that I'm using the XBees, I'm using a GPS. Specifically the Fastrax UP501. Most of the GPS modules that I looked at are 3.3V so this is another reason to use an Arduino that has an onboard 3.3V regulator. Sparkfun has an epic GPS buying guide I'd highly recommend you take a look at. A 1Hz update speed should be more than enough unless you're trying to track these things as they fly through the air. Feel free to take a look at how I implemented GPS (using the TinyGPS library) in the CaptainShip module.
Sparkfun has a good selection of weather sensors but you may have a place already in mind that has more accurate and precise instruments.
As far as durability goes that'll be up to the design of the spike itself.
EDIT: A few other things for you to consider in a project like this. Granted, I've never done something quite like this myself, but this is how I'd probably end up going about it.
What's the power source? Solar? Battery?
How long can I make this power source last? The XBee and GPS that I mentioned both have low power modes.
How can I monitor the power source? Alert the server/coordinator of the issue.
With a properly configured XBee you can remotely upload sketches to your Arduino array without the need for direct access. This could save you a hell of a lot of time, or may not be important at all.
How many IO pins do I need? This will play a huge role in determining what Arduino you'd choose.
RAM is something incredibly limited on these devices too. As I hinted above, I doubt you'll be able to fit the entire image into the Arduino's memory. You'll need not only a way of interfacing with a camera from the Arduino but a way to store the image elsewhere.
Sparkfun has a few CMOS cameras to choose from but the documentation is severely lacking. |
H: Can this circuit be a Schmitt trigger?
I'm just learning about Schmitt triggers with op amps. I have the circuit below, and I tried to go through the calculations to find the high and low thresholds. What I'm understanding from my calculations is that the high voltage threshold and low voltage threshold are the same (-5V). Is this correct, or did I make a mistake?
AI: Short:
Yes, it's a Schmitt trigger.
Yes, you have made a mistake.
Output low / high happens at Vin =~ -10V*
Output high / low happens at Vin =~ -15V*.
*I have slightly adjusted Vout range to make sums easier. Result is essentially the same. As shown the zener is being used in an unapproved manner.
Longer: Loosely a Schmit trigger can be considered to be a comparator with hysteresis or positive feedback such that the switching decision point alters when the circuit ir triggered to provide a "deadband". On that basis this IS a Schmitt trigger circuit.
Using a zener to clamp Vout as shown is a VERY bad idea.
The opamp is using all its output to try to drive the zener high. This is a non-approved way to do what is desired BUT OK for working through the example
Without using your notes.
Vout swings from about -0.8V to about 4.3V. For practical purposes we can work with 0V and 5V and get an OK answer to the main question.
Vref on the inverting input (OA-)is -5V. This does not change.
Vout is low = 0V when the non inverting input OA+ is below -5V and high = +5V when the non inverting input is above -5V.
When Vout = 0V then the trigger condition occurs when Vin = -10V, so OA+ = -5V.
When OA+ rises above -10V Vout rises to +5V.
So immediately OA+ rises to -2.5V (half way between Vin at -10V and Vout at +5V.
So the opamp is now ell away from the switching point.
To switch back OA+ needs to fall to -5V and to achieve this Vin will need to fall to -15V (as OA- is now +5 - (5 - - 15V) = 5 - 10 = -5V.)
SO the switching boundaries are
-10V rising = output low to high and
-15V falling = output = high to low. |
H: Seven segment display becomes dimmer as more segments are lit
I've got a common cathode, two digit seven segment display (LDD-N512RI-RA) hooked up to the GPIO pins of a microcontroller (Coldfire MCF52233 DEMO). The problem is that the brightness of the display varies with the number of segments lit. As more segments are activated, the display becomes dimmer. From what I've read, this happens if you try to use a single resistor for the common cathode instead of using one for each anode. However, I am using one for each anode.
I have very little experience with electronics and know very little about electricity, unfortunately. So until I learn more (which I want to do), I can only guess what the problem might be. In the meantime, can anyone suggest what is going wrong here?
More information: The GPIO pins provide 3.3V. The forward voltage/current of the segments is 2.2V/10mA. I'm using 100 Ohm 1/2W resistors for each of the segments. I've got the common cathodes hooked up to GPIO pins as well, and I set the pins to the cathodes to low to activate the displays (I'm not sure if that is the correct way to go about it.). I am alternating between displaying the left/right digit using a high frequency timer interrupt, which I realize may not be the best way to do it. I am already using the timer interrupt, though, so I hoped that I could tack on some simple digit alternating logic without a problem. The board is powered via a USB line to my computer. I'm happy to provide any other relevant information, just let me know exactly what is relevant.
AI: My first assumption from the symptom is that you have a single cathode resistor, which would explain everything. However, you say this is not the case and that you have individual 100 Ω resistors on each anode line.
The answer then must be that whatever is driving the cathode can't handle the combined current. Apparently you are driving the cathode with just a microcontroller output, which has insufficient current sink capability. Do the math. You want 10 mA thru each of 7 segments. That means whatever is holding the cathodes low has to be able to handle 70 mA. A microcontroller pin is very very unlikely to do that. See the datasheet.
The solution is to add a transistor that can sink the current from each of the cathode connections:
70 mA is easy for any discrete transistor you will be able to get. Let's say the transistor has a minimum guaranteed gain of 50. That means the base current needs to be 70mA / 50 = 1.4 mA. Figure the B-E junction drops 700 mV. With 3.3 V drive from the micro, that leaves 3.3 V - 700 mV = 2.6 V accross the base resistor. 2.6 V / 1.4 mA = 1.9 kΩ, which is the absolute maximum allowed base resistor. Given that, I'd use 1 kΩ between the digital output and the base.
Note that this will invert the common cathode logic from what you had. The microcontroller output now has to go high to enable a digit. |
H: How many functions can I put into an arduino uno?
Is it realistic to put the following: GPS module, GSM module, SD card slot and about 4 analog sensors into Arduino uno? (have not yet goten an Arduino in my hands).
AI: How many functions? That depends on a few factors. First, will I have enough pins? The GPS module will probably take up two PWM pins (Rx and Tx) but I recommend you hook the Rx and Tx of the GPS directly into the hardware serial Rx and Tx of the Uno. The senors will probably use a single analog pin each. The Arduino Uno has six. I'm not sure how many pins the GSM module will take up but you have at least 3 PWM pins left to fool around with. The SD card, from my understanding, can be hooked up directly to the Uno using SPI and the ICSP pins. I'm not certain of this, so it's probably worth doing some more research on. The SD card will require at least 2 PWM pins if you're not able to use ICSP.
Second, will I have enough RAM and flash memory? As soon as you start doing lots of stuff on the Uno you realize that 2KB of RAM and 31.5KB of flash memory isn't a lot. The Arduino IDE will tell you if your sketch is too big to fit on the Uno when you compile it, so draw up a quick sketch that has all the library/function calls you need and go from there.
Third, will I have enough serials? I've only been able to get two serial connections working on the Uno (but I've been told you can get three working with some hassling). That is the hardware serial (accessed by the Serial object) and a SoftwareSerial object. The GPS will definitely utilize one of these and I bet your GSM module will use the other. Don't forget about debugging! Since you won't be able to have all three of these hooked up to your Uno I recommended debugging with the GSM module. Get this working and then move all your debugging code from Serial to your GSM connection. That way instead of using the Serial output on your computer you'll have to read from wherever your GSM module is sending data to. |
H: GPIO input connected to garage door button
I know there are other GPIO / Garage door related questions, but this is not a duplicate- I need to read the status of the garage door button, not a garage door sensor.
I would like to connect the garage door's button to a GPIO input on my Pi. I want to be able to trigger actions when someone pushes the button. I am able to read the status of a basic switch using this circuit I found. My concern is that when I connect a volt meter across the garage door button I see over 16 volts (presumably to drive the LED in the button?). I am concerned that if I connect my switch reading GPIO input circuit to the button, that 16 volts could fry my Pi. How can I read whether the button is open or closed, but protect my Pi from the voltage on the line?
I do also have a garage door magnetic switch sensor that I can read fine with my GPIO circuit, but my requirements include knowing when the button is pushed- not just whether the door is open or closed.
AI: Is it possible that you are looking for an optocoupler? |
H: Schematic symbol confusion
I'm looking at building an audio amplifier using the following the TDA7385 amplifier IC.
Here is the data sheet: http://www.mouser.com/ds/2/389/CD00002618-109852.pdf
I am confused by the application circuit which is documented in the above datasheet, specifically where it does not mention any voltage lines (apart from the pin labels) like most other data sheets I have seen for similar chips. The below graphic should help describe my query.
Am I correct in assuming that the voltage line is not labelled directly and that the black lines are "chassis ground" ?
AI: The flat black lines are the various circuit grounds, and the voltage pins are labelled at the IC symbol, so you are correct in your assumption that this is the positive supply rail also.
The datasheet is pretty unclear - there is no pinout table, but there is a diagram of the IC pins with labels, so you can number them starting from pin 1 at the left, then match these up with the numbers on the example circuit.
We can see from the above pin 6 is Vcc 1 (positive rail 1) and pin 20 is Vcc 2 (positive rail 2) Also pins 2,8,18 and 24 are power ground pins. Pin 13 is S-GND, and Pin 16 is AC-GND. The application notes in the datasheet describe the use of all these pins. Here is a snippet mentioning the use of AC-GND:
As shown by Figure 14, all the TDA7385’s main sections, such as
Inputs, Outputs AND ACGND (pin 16) are internally biased at half
supply voltage level (Vs/2), which is derived from the Supply Voltage
Rejection (SVR) block. In this way no current flows through the
internal feedback network. The AC-GND is common to all the 4
amplifiers and represents the connection point of all the inverting
inputs. Both individual inputs and AC-GND are connected to Vs/2 (SVR)
by means of 100 kO resistors. To ensure proper operation and high
supply voltage rejection, it is of fundamental importance to provide
a good impedance matching between Inputs and AC-GROUND terminations.
This implies that C1 , C2 , C3 , C4 , C5 capacitors have to carry the
same nominal value and their tolerance should never exceed ± 10 %.
I assume that S-GND is signal ground, and the datasheet covers this and the output stage power pins:
To simplify pc-board layout designs, each amplifier stage has its own
power ground externally accessible (pins 2,8,18,24) and one supply
voltage pin for each couple of them. Even more important, this makes
it possible to achieve the highest possible degree of separation
among the channels, with remarkable benefits in terms of cross-talk
and distortion features. About the layout grounding, it is
particularly important to connect the AC-GND capacitor (C5 ) to the
signal GND, as close as possible to the audio inputs ground: this will
guarantee high rejection of any common mode spurious signals. The SVR
capacitor (C6 ) has also to be connected to the signal GND. Supply
filtering elements (C7 , C8 ) have naturally to be connected to the
power-ground and located as close as possible to the Vs pins.
Looking at the example layout, we can see how the separate inputs with signal ground, and out power pins are used to keep each channel isolated on the board, and connecting to the supply separately to from a star grounding network. |
H: Do you recognise this signal?
The story for this signal is the following. I've bought an NAD C 356BEE amplifier with an integrated MDC DAC module. It has optical and USB input. The optical is OK, but if I connect the DAC to my PC with USB, then it makes clicking/popping noise at specified times. The click frequency is somehow related to the signal sample rate. For example at 96 kHz it pops in every 2.5 seconds, but at 48 kHz it pops at 30 seconds.
I've played a sine wave, and I've recorded the noise and zoomed in to the waveform. It's a very short signal, about 0.008 seconds. Do you have any idea what it could be?
The amplitude of the noise signal is much higher than the test signal. The length of the noise signal is random (but very short, you hear just a click), but the waveform is always the same for the same test signal.
Different test frequencies cause different error signals. It seems like the error signal is some transformation of the original.
AI: That looks like a sine wave with the y-axis wrapped around. Here's my attempt at recreating it:
This is a plot of the function \$1.25 \cdot \sin(t) - \operatorname{round}(1.25 \cdot \sin(t))\$, where \$\operatorname{round}(x)\$ rounds \$x\$ to the nearest integer.
Perhaps the highest bit of your signal is getting cut off? That would seem likely to produce such a waveform. |
H: Is a low load resistor a big problem in low pass filter and amplifier circuit
I am going to use AVR's PWM output signal to pass through a low pass filter (maybe plus an amplifier). I found the speaker has a quite low resistance (8 ohms). I tried to simulate my schematic on Orcad, obtaining very a low voltage signal on speaker in (mV). I think that is the problem of this load resistance (I simply put the load resistance across output terminals). But I am not sure how to deal with that. Hope someone can help. Thanks in advance. The same problem occurs when I tried using single simple pole low pass filter. Looking forward to hear your suggestions.
AI: Your speaker rated at 1W will require an amplifier circuit to be placed between the DAC / filter circuit and the speaker. There are numerous solutions to provide for this amplifier function including discrete circuits, IC circuits and single chip amplifier modules. You could build up a circuit using a chip amplifier such as an LM386 or you could check online sources to get a low cost ready-made circuit module. Sellers on eBay are making an assortment of modules available such as this example: |
H: How can I tell the size of a barrel power connector?
Spring cleaning, and I'm trying to get power supplies for all my devices with missing power supplies. They're all the typical barrel power connector, and I'm having a dickens of a time trying to figure out the pin/hole diameter.
I ordered the power supplies I needed based on outside diameter (e.g., 5.5mm in my example below) and was surprised to discover that while the jack fit, the center pin did NOT. How do I prevent this from happening in the future? Do they even make calipers that can get into the hole to measure the pin diameter?
Radio Shack has their little keyring behind the counter with every known tip size, but all they can get from that is which stock number fits on their universal wall wart. Personally, I think that these types of "universal" kits are the worst thing to happen to electronics in, like, FOREVER. Too many parts to misplace and the tip-to-cable connector is almost always proprietary.
If I try to pump them for information about what the outer and inner diameters are, they want to know if I'm happy with my current cellular provider. As you may surmise, I'm not a big fan of trusting my local Radio Shack for electronics guidance.
So...that leaves me with a bunch of power supplies that don't fit their devices, and me a little peeved that I have to deal with RMAs, return shipping, etc., especially when I really don't have a clue how to figure out what to order. That also begs the question about how to ensure that I buy the right jack when designing something that NEEDS wall wart power.
Where do I even start? Anyone have any ideas on how to finding the correct barrel & pin diameters when I don't have specs on the jack? Is it really trial and error? or is there some measurement device that's available to help?
AI: Those are barrel power connectors.
Looking at Digikey, it looks like common inner diameters with a 5.5mm outer diameter are 2mm, 2.1mm, and 2.5mm, but that doesn't mean that your target application doesn't have a custom size which doesn't match any of these.
The one I usually use for my projects is 2.1mm*5.5mm if I can, but as far as I know this is by no means a rule of thumb.
Knowing what the jack is being used for may help in identifying a correct size. |
H: What easily acquirable material changes its resistance when heated?
I'm trying to build a Resistance Thermometer that varies current/voltage output when heated. It has to be DYI, I don't want to buy anything done, only something like a light bulb, and this has to be easily changed, as the ideal temperature range I want to provide to it is 0-100 oC. I understand all resistors change their resistance with temperature, but I'm looking for something that changes it a lot more than the regular hardware store resistor.
AI: You are looking for the temperature coefficient of resistivity.
Iron is pretty high, I just looked up 0.0147 at 500C.
Copper, in my table, is 0.0042
I use iron wire for a high current load resistor, and it is annoying how sensitive it is to heating.
Here is a link explaining it all. |
H: Eagle 6 : Problem Importing Custom Parts
Recently started working on a new PCB board for a dev kit. I ran in an issue where I had made a custom part for the M50-3501042 2x10 male header with 0.05'' (1.27mm) pitch.
Note also that this is a through-hole component.
The issue I had was that I set the diameter of each of the pins in the custom package to 0.04'', however, when I imported the part into my PCB design, the pins on the board had increased in diameter and were overlapping with other pins giving DRC errors.
I updated the library and all the parts in Eagle, however, this did not fix my issue.
I have no idea on how to fix this issue. Any ideas?
EDIT: Okay so I tried the solution posted in the comment, however it did not work for me. Only the via holes on the board changed and not the pins on the custom part. I tried messing with some other DRC settings but haven't been able to come out with a solution yet.
AI: After looking through help files and forums, I finally came out with the solution to my problem (with the help of many online contributors of course). The solution, as expected, has to do with the rest ring that eagle sets.
Initially the rest ring was set at a min value of 10 mil for my DRC file. I lowered the value of that to 6 mil to avoid overlap on the header.
NOTE ON THIS: BE CAREFUL WHEN SETTING MIN HERE BECAUSE EAGLE SETS THE MIN FOR THE WHOLE BOARD, SO OTHER COMPONENTS WILL ALSO BE AFFECTED. FOR MY CASE, EVERYTHING CHECKED OUT GOOD, BUT TAKE CARE IF YOU USE THIS SOLUTION.
I think it would be more convenient if you could individually set the rest ring size for specific components since you have components of different sizes on the board, however, I don't know if eagle has such capability. Please correct me if I am wrong.
Anyways, hope this helps someone else out there. I spent quite a bit of time trying to find a better solution than just modifying the rest ring size for the board, however, I wasn't able to find anything else.
Also, for those who didn't read the comments on this question, here is another resource for anyone who has stumbled here with a problem with Via diameters: VIA DIAMETER PROBLEM
To add to the solutions. I re-posted this question one element14 community forums for Eagle. Here is the response I got. |
H: Piezoelectric Sensor and the ADC
I would like to hook up a piezoelectric sensor to my ATmega8 microcontroller via its ADC.
The reason being is that I would like to use the sensor as a force sensor. I noticed that the harder I press it, the higher a voltage it delivers (but for a very short time). This is expected behavior, of course.
What I am wondering is how I would connect it to the ADC. I mean, when I press it really hard, the piezo registers upward of 10 V. When I press it softly, it usually gives me around 1.3 V.
As I understand it, the micrcontroller cannot take anything more than 5V, or else I run the risk of damaging it. Is this correct? I mean, I am guessing the current coming out from the piezo is extremely small, though I don't know if that changes the situation.
Essentially, I would like to know if it is possible to hook up this piezoelectric sensor to my AVR microcontroller to take analog readings.
AI: A quick experiment with a piezoelectric bender shows the following voltages:
No pressure: 0.12 Volts (probably drift / noise / breeze)
Mild pressure: 1.72 Volts
Firm pressure: 4.21 Volts
Fingernail tap: 6.29 Volts (spike)
Knock on table: 11.74 Volts (spike)
Assuming the area of interest spans the first 4 levels of signal, and any reading higher than 10 Volts can be generalized to an arbitrary "Out-of-Range" reading, the following implementation should serve for the purposes of question:
simulate this circuit – Schematic created using CircuitLab
The diode D1 shunts the negative portion of the signal that the peizo bender will generate on knocks or release of pressure. To be extra-cautious, this can be substituted by a Schottky diode to cope with very fast spikes, or for tighter clipping to ground rail (~ 0.3 Volts instead of ~0.7 Volts), a germanium diode.
The Zener diode is intentionally selected as 4.7 Volts, in order to ensure that the output voltage does not overshoot 5 Volts under any circumstances.
The op-amp buffer ensures that the voltage divider is not significantly loaded by the ADC pin, hence the voltage divider resistance computation is simplified.
This circuit will output half the positive voltage generated by the piezoelectric pressure sensor until the voltage reaches approximately 4.7 Volts, then clamp at that voltage for any higher pressures applied. Any negative voltage generated due to knocks or sensor bounce-back, will be shunted across the diode D1, protecting the op-amp (or the ADC if directly connected) from negative voltages. |
H: Negative and positive voltage from a single 12 V battery
I am trying to power my CPU with a single 12 V battery.
For 12 V, 5 V, and 3.3 V I have decided to use a buck converter using a 555, but I can't find any solution to get -5 V and -12 V out of that same battery.
I have tried using a 7905 for -5 V, but it's heating a lot (maybe because it's connected wrong; GND is connected to +ve and Vin is connected to -ve).
AI: a battery v volts, means by convention that the positive pin is at +v volts and the negative pin is at 0 volts.
Lets say I need -12 volts, that would mean I need a battery of 24 volts (in the number space there are 24 numbers from -12 to +12. also 12 - (-12) = 24)
The voltage regulator would give you +5 volts and ground (i.e 5-0 = 5).
See if this helps.
You could also see http://www.geofex.com/circuits/+9_to_-9.htm (charge pumps)
I have never done anything like this. Could you please tell me why you are needing a -5v. Is it needed for RS232?
Tell me how it goes.
I don't know if I have correctly in understood your question..
Please reply... |
H: Portable 5V power supply
I am usually in need of powering my microcontroller projects with 5V. Typically this is not a problem, as I use any power supply (converted PC power supply, wall adapter, USB, etc.).
However, when I need my projects to be portable and lightweight, I am not quite sure what the cheapest/easiest way to accomplish this would be. The additional requirement is that I would like to use 3.7V LiPo batteries. This is simply because they are much smaller than any other solution, and can pack a lot of power. Also because I have many lying around.
If I was using something higher than 5V, then I would just use the L7805 to drop it down, or some other solution. So how would I step up the voltage from a 3.7V battery to 5V in the cheapest and smallest way possible? Is there a widely used IC which accomplishes this task?
AI: Two options for you:
One is to use a boost converter for ~3.7V to 5V (i.e. if the supply range is always below the required rail voltage) There are hundreds out there to choose from, you can get e.g. very simple fixed 5V boost regulators which only require a few external components (see TI, LT, ON Semi, Analog Devices, Microchip, Maxim, etc - they all make switching regulators).
Or if your supply is above and below 5V over the battery discharge curve, then as Madmanguruman suggests, use a buck-boost/SEPIC/Cuk converter. Make sure the input range of the IC fits with your battery voltage range. There are plenty of questions on here that discuss the use of switching regulators in this type of situation, so I won't cover that again here.
The other is to use a microcontroller and surrounding ICs that run from +3.3V - then a simple LDO can be used, which at this drop (say for a Li-Ion from ~4.2V down to 3.5V or so to +3.3V - you can get LDOs with less than 100mV dropout voltage nowadays) will be efficient and simple. Nowadays +3.3V is very common, and many microcontrollers with a "nominal" 5V can run fine from 3.3V - a random example is the PIC16F1828 which boasts a 1.8V - 5.5V operation range. So check to see whether this might be an otpion with the chips you are using, or whether swapping a couple would be easy enough. |
H: Could a lamp plugged into an outlet be dimmed using a variable resistor?
If you had a variable resistor connected between a lamp and the wall, could it be dimmed with a variable resistor?
Would it be practical, i.e. would it waste much energy? And would it affect both current and voltage or only one?
AI: Yes; this was how it was done before triac dimmers became available. Usually known as a "rheostat".
The sum of energy dissipated in lamp + dissipated in resistor is then constant, so you need a 60W resistor.
Both voltage and current would be affected together; the lightbulb is an ohmic resistor. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.