text
stringlengths 83
79.5k
|
---|
H: Component to detect the state of an external LED
I need to detect the state of an LED in a machine that I cannot connect to in any electrical way. So I would like to measure the light emitted from this LED.
The conditions:
The ambient lighting is low to very low (both the machine containing the LED and the sensing device are inside a box with few and small holes)
The sensing component can be very close and well aimed at the LED (distance between 0 and max 5mm)
The LED is orange (if that is relevant?)
Input will be processed by a PLC
My question is: what component meets the following criteria the most?
Criteria in order of priority (from high to low): reliable detection, simple wiring (few components, easy to wire to let's say an arduino), easy programming the microcontroller, and low price.
I am looking into these alternatives (but maybe there are more?).
LDR (light dependant resistor)
Phototransistor / photodiode
LED as a light sensor (in the same colour as the emitting LED)
Which component meets the criteria the best?
AI: Probably a phototransistor. It would be best if you could shield it from outside light and attach it closely to the target.
One thing to consider is if the LED is actually illuminated continuously or merely appears to be illuminated continuously. The phototransistor will likely be fast enough to pick up multiplexing that would not be obvious visually. If so then you'd need some kind of filter.
The general approach would be to use a phototransistor plus a resistor (maybe a parallel cap) and a comparator such as an LM393 with a reference formed by another couple resistors.
Using an LED as a photodiode (or a real photodiode) is possible, but the output current is very low compared to a phototransistor and it would thus be more sensitive to electrical noise and might require a bit more complex circuit (such as a transimpedance amplifier).
|
H: Why does stepper motor not turn properly at different frequencies?
I have an 8 wire stepper motor and an unipolar motor driver. I wired the motor as unipolar connection. On motor 3.15V and 4.2A is written.
My connection is above. When I connect V to 24V 14A source to V, at 1 ms step, the motor (has 200 steps) rotates at 3 Hz, but I expect 5 Hz. When I set step to 10ms or 100ms, the motor rotates very absurdly, like rotating 20' to left and waits then rotating right to 40' and lots of unexpected rotations.
When I connect V to 5V, it rotates at 1 ms step (5Hz expected) at 2Hz but vibrates too much. When I set 10 ms (0.5 Hz rotation is expected), the motor rotates at 0.45Hz; and vibration is very low. At 100ms step it works as expected.
My conclusions are
High voltage is necessary for fast switching
High voltage does not work at lower frequencies (long step sizes like 10ms or 100ms).
Low voltage does not work at high frequencies (short step sizes like 1ms)
Low voltage works pretty well at low frequencies.
My questions are
Is my wiring schematic correct for unipolar scheme?
Why did high voltage experiment not work for low frequencies?
Why did low voltage experiment not work for high frequencies?
Which voltage should I give to V at the schematic to rotate the motor at both high and low frequencies?
AI: "On motor 3.15V and 4.2A is written."
This means that each coil has a resistance of 3.15 / 4.2 , or about 0.75 ohms.
You do not describe your driver in detail. Is it a constant-current type? If so, what current have you set it to? Note that I doubt that it is a constant-current unit. If not, what is the maximum current each phase can handle?
I suspect that, at 24 volts you are wildly overdriving your motor (the power supply current limited and you got 7 amps through each energized coil), and I'm a little surprised it still works. Plus, I'm also surprised that your driver has not been damaged.
Given what you did to it at 24 volts, and since at low speeds it seems to work properly, I'd suggest that one or more phases have been damaged, and/or one or more driver channels has been damaged. The low speed performance is caused by the damaged phase(s) working "more or less" while at higher speeds more or less is not good enough.
|
H: Using a Counter to Determine next MSB position in polynomial division
I am working on implementing a polynomial divider the operation is as follows:
Check MSB of Numerator:
if 1 XOR with Denom then shift Denom right
if 0 Num is the same and Denom also shift right
When doing the following shift for the Denom the new MSB of the numerator to compare with is the old MSB-1
Therefore I have implemented a Down counter that starts with M downto 0
at each step the new MSB is the value read from the counter
on VHDL Implementation I got an error on the following
if(numerator(ctr_reg)='1')
the obtained error is:
type identifier with "ctr_reg" does not agree with its usage as "natural type"
How can I solve this? should be done with a variable inside my process?
And what is the hardware translation of a variable used in such case
Thank you
Included Libraries
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
use work.classic_multiplier_parameters.all;
Error From updated statement:
if(numerator(to_integer(unsigned(ctr_reg)))='1') then
AI: I assume that ctr_reg is of type (un)signed because it's a counter.
VHDL expect normal indices to be of type integer (natural, positive are subtypes of integer). See the definition for std_logic_vector:
type STD_LOGIC_VECTOR is array (NATURAL range <>) of STD_LOGIC;
So you must convert your counter from (un)signed to integer:
if (numerator(to_integer(ctr_reg)) = '1') then
If ctr_reg is of type std_logic_vector (slv), then you must also convert slv to unsigned:
if (numerator(to_integer(unsigned(ctr_reg))) = '1') then
If this construct is to long, write a function (let's say to_index(..)) which hides these conversions :)
if (numerator(to_index(ctr_reg)) = '1') then
A definition for to_index(..) can be found here.
Edit 1:
List of commonly used packages in VHDL:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL; -- common std_logic(_vector) operations
use IEEE.NUMERIC_STD.ALL; -- defines signed and unsigned and their operations
|
H: How to detect several agents within a radius, what is the best and easiest way to do it?
I have a room with 30 objects which may or not be present, and I want to be able to detect which objects are in the room.
My first idea was to attach a RFID tag to each one of these objects and have a sensor detecting them, but then I have frequency collision problems and since the room is quite large, I also cannot activate tags which are further away. Or I may be missing something...
I would also want to have objects not carrying an active radio transmitter, i.e., no batteries wandering around, just RFID tags or resonant metal pieces.
I could use cameras but image processing would require an Arduino on steroids.
This is for a hobby project since I need an excuse to use my Arduino again :P
How would you solve such challenge?
AI: This: -
I would also want to have objects not carrying an active radio
transmitter, i.e., no batteries wandering around, just RFID tags or
resonant metal pieces.
And this: -
The room may have several entry points, or it could even be an outside
environment. Imagine I want to know how many people are in my terrain
which has around 100m of radius.
Are technically incompatible requirements. I suggest you lower your expectations but I hope someone basically proves me wrong.
|
H: VHDL - Flip Flop inferring on a signal
I have to design a circuit to count up to a number and return to zero. It must have a carry signal (which I named a_o in my circuit) as flag to show that the maximum number of the counter has been reached.
The circuit is working fine, but it is inferring a Flip-Flop in the a_o signal that I don't want to be there. I have checked all reasons why an unexpected flip-flop can appear but I still can't solve the problem.
Many thanks in advance
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
entity ej11 is
generic (N : positive := 4;
M : positive := 10);
port (
e_i : in std_logic;
nmr_i : in std_logic;
clk_i : in std_logic;
a_o : out std_logic;
q_o : out std_logic_vector (N-1 downto 0));
end entity ej11;
architecture Comportamiento of ej11 is
signal aux : unsigned (N-1 downto 0);
signal acarreo : std_logic;
begin
Cuenta:
process (clk_i, nmr_i)
begin
if nmr_i='0' then
aux <= (others => '0');
acarreo <= '0';
elsif rising_edge (clk_i) then
if e_i = '1' then
if aux < M-1 then
aux <= aux + 1;
else
aux <= (others => '0');
end if;
if aux = M-2 then
acarreo <= '1';
else
acarreo <= '0';
end if;
end if;
end if;
end process Cuenta;
q_o <= std_logic_vector (aux);
a_o <= acarreo;
end architecture Comportamiento;
AI: Remove the carry from the process (it's declaration is also unneeded unless accarreo is read in another process or concurrent statement ):
architecture Comportamiento of ej11 is
signal aux : unsigned (N-1 downto 0);
-- signal acarreo : std_logic;
begin
Cuenta:
process (clk_i, nmr_i)
begin
if nmr_i='0' then
aux <= (others => '0');
-- acarreo <= '0';
elsif rising_edge (clk_i) then
if e_i = '1' then
if aux < M-1 then
aux <= aux + 1;
else
aux <= (others => '0');
end if;
-- if aux = M-2 then
-- acarreo <= '1';
-- else
-- acarreo <= '0';
-- end if;
end if;
end if;
end process Cuenta;
q_o <= std_logic_vector (aux);
-- a_o <= acarreo;
end architecture Comportamiento;
Either add a concurrent assignment or a new process with an assignment to a_o (conditional concurrent assignment shown):
a_o <= '1' when aux = M-2 else
'0';
Including the assignment to accareo inside the if statement is inferring sequential logic inferred the flip flop.
A process would look something like:
Acarreo:
process (aux)
begin
if aux = M-2 then
a_o <= '1';
else
a_o <= '0';
end if;
end process Acarreo;
|
H: Why doesn't the RMS current and voltage give me average power?
Apologies for the multiple bridge rectifier questions.
I have a 230V/9V 10VA transformer, and I want to know how much DC current I can draw from this circuit. From this I assume that the \$I_{rms\_max} = 1.1A \$.
I ran the simulation for various values of C1 and R1, and this seems to give the greatest possible DC current (I think).
Because this was going to be fed to a boost converter, I allowed 2V ripple.
The following values were obtained from LTspice:
\$V1_{rms} = 9V\$
\$I_{V1(rms)} = 0.96A\$ <- Less than 1.1A
\$V_{out(rms)} = 10.15V\$
\$I_{R1(rms)} = 0.40A\$
This gives me:
$$
\eta = \frac{P_{out}}{P_{in}} = \frac{10.15*0.4}{9*0.96} = 47\%
$$
However, this is the power graph:
The average values of the graphs give me 4.9W and 4.13W, which gives me an efficiency of 84%.
Which value is correct?
AI: Averaging the instantaneous power is the correct approach here.
The product of the rms voltage and current gives the apparent power. The average power is, in general, less than the apparent power due to a less than unity power factor.
See this related question for a detailed answer on the power factor calculation.
|
H: Is it worth reusing old components
I find myself constantly trying to recycle old components in my new projects. Yesterday, I needed a demultiplexer so I just took it out from some old phone board...
Demultiplexers cost basically nothing and the one I took out is quite old. So my question is this:
Does it make sense to reuse old components the way I did or is it better to use new ones?
AI: I guess the answer is maybe.
Yes, if...
you're in the process of fixing something and the hard-to-get spare part is readily available on a junk board in the corner of your lab. Hard to get can even be a standard 10k resistor, if it's Sunday afternoon and you don't want to order parts online or wait for the next electronics shop to open. Sometimes, I even re-use old parts when hacking something at my company and don't want to wait two days for ordered parts before putting the design in production.
you're trying to learn from an existing design and rebuild a sub-circuit found on a larger board. Besides solid knowledge about the required theory, existing designs are your best teacher.
you're after exotic components (high voltage from CRT monitors, vintage parts from old equipment, cool-looking stuff like nixie tubes or a magic eye from an old radio)
No, if...
you're building a large new project and the components we're talking about are standard, cheap diodes, resistors, ...
you're going to sell your circuit and must know where your components come from. Who tells you that a part on a junk board has never been subjected to stresses beyond those listed in the data sheet's absolute maximum ratings, causing permanent damage or deviations from the values you must count on?
|
H: Diode detector strange discharging
I am building a diode detector circuit in order to detect ASK signal with 125 KHz carrier frequency and 8 KHz data rate. However, I realized I would say a strange behaviour and discharging of capacitor.
The setup is following:
Function generator set to sine wave 3 Vp-p and f=125 KHz.
Function generator is connected to anode (1N4001. From kathode goes C=1nF to ground as well as 330k ohm resistor. This value is for sure not correct but it was an experiment. Here is schematic:
The generator has 50 ohm input impedance.
So, here is the waveform:
As you can see, capacitor is charging, but then suddenly discharges really fast until certain DC level at capacitor is reached. I would at least expect that charging stops as soon as capacitor is charged to the voltage that can't any more provide forward voltage for diode. In that moment it should start to discharge via resistor which should be pretty much slower than shown.
So, my question is why this happens and is there any feature of the diode that comes into game near the point of shutting off?
So, you were all right guys. I changed to 1n4148 and now it works fine, although I cant realize how can this voltage drop.
AI: Actually your scope plot is as expected for the components you used.
Between peaks, the capacitor discharges thru the resistor slightly. When the peak appears, the diode is forward biased and the capacitor voltage rides the input voltage minus the diode drop. All is fine up to here.
At the input peak, the capcitor is charged to its maximum value, and the input then goes down to be less than the capacitor voltage plus the diode drop. However, the 1N4001 diode you are using is meant for power line rectification applications, and has a long reverse recovery time. This means the diode continues to stay "on" for a while after it is reverse biased. This is why you can see the capacitor voltage follow the downslope of the input signal after the peak. Eventually the diode turns off, and the capacitor voltage stays reasonably constant due to the R-C time constant being much larger than the time between input waveform peaks.
To fix this, replace the diode with one intended for fast small signal applications, like the 1N4148. When you do this, take another scope shot and add it to your question. This could be a great learning opportunity for others about diode reverse recovery time.
|
H: Two different MCU , different output but none was right?
I write this simple code to check my new burner :
#include<avr/io.h>
void main(void)
{
DDRC = 0xFF; //high pins
PORTC=0x00;
while(1)
{
PORTC=0xFF;
}
}
I use Extreme burner software to burn . My burner seems to work fine. It burn the code (said by the burner software ) but output is not as I expected.
I burn two ATmega32 .
For first one , PC2 , PC3, PC4 give high output (around 4.3 volt) and rest is low (around 1.7 volt) .
For second one , PC0 , PC1 , PC7 pin high output and rest is low.
I can't understand why ???
anyone can explain and give me a solution ??
Thanks
AI: ATmega32 fuse bits are enabled JTAG interface on PC2...PC5 by default.
If you want to use PC2...PC5 in your project, you should disable JTAG by unprogrammed JTAGEN fuse bit.
|
H: How does the controller know when to jump to the ISR?
I am talking about things at the core level.
As far as I understand, the controller core just executes instructions which are fetched from the memory (Fetch - Decode - Execute). When an Interrupt arrives, how does the core/ALU decide to jump to the ISR?
Because we, or the compiler, don't add any instruction to poll the interrupt status - then how does it know that an interrupt needs to be served?
AI: What you are missing is that the core does do more than just execute opcodes that are fetched from memory. It has specific logic in it to implement interrupts.
When the interrupt detection hardware asserts the signal that says it's time to take a interrupt, usually a special instruction is jammed into the core that was never fetched from memory. In most cases this is a CALL instruction to the interrupt vector address. This uses the existing instruction execution mechanism to save the current PC onto the call stack, and change it to the interrupt vector address. It also deals with discarding pre-fetched instructions and the like.
The special interrupt-taking logic also has to disable interrupts in such a way so that the same interrupt condition doesn't cause another call to the interrupt vector address next cycle. Different processors have different ways of handling this. The simplest is to just gloablly disable interrupts, requiring the software to re-enable them at the end of the interrupt service routine. Other processors have a interrupt priority level. This level is bumped so that only interrupt conditions of higher priority can cause a new interrupt. The interrupt priority is then something that is automatically saved along with the CALL return address, and restored when the code returns from the interrupt.
|
H: Replace crystal earpiece in bat detector circuit
I've been following the instructions on http://pw1.netcom.com/~t-rex/BatDetector.html which includes the following schematic for a Frequency Division Bat Detector circuit:
The instructions clearly state (http://home.earthlink.net/~bat-detector/SBD2Parts.html note #5) that a crystal earpiece should be used. However these are increasingly hard to come by.
Is it possible to use a non-crystal earphone with this circuit? Or is there any recommended modification to the circuit to enable it to drive a pair of earphones?
AI: The crystal earpiece has such high impedence that it presents virtually no load to the CD4024. Normal earphones have impedence in the 16 to 32 ohm range, which would (at 9V) cause the CD4024 to provide far more current than it's capable of, potentially damaging or killing it.
You need an amplifier with high input impedence which is capable of driving headphones. The LM386 you're using already in your circuit would work. The datasheet gives an application circuit for an amplifier connected to a speaker. You've already got the 10k volume selector.
|
H: How do I determine the current load at which my buck regulator will operate in DCM?
I am using an TI TPS56121 buck converter and I have designed it to supply 4.6V at 5A. However, my load current can vary from 500mA up to 5A (the load normally runs at about 3.6A). How do I determine the current load value at which my design will no longer operate in CCM, but will begin operating in DCM (which is something that I do not want to happen)?
AI: It's a Synchronous Buck so it will always operate in CCM.
DCM occurs when the inductor current cannot go negative, effectively clipping the bottom of the inductor current waveform. The presence of a low-side FET (Synchronous topology) prevents this from happening by allowing negative inductor currents.
The problem with DCM is that by changing the inductor waveform it also changes the dynamic characteristics of the power stage, changing from a double pole (in CCM) to a dominant pole in (DCM), so you have to take care of compensation in a dual-mode. But you don't have this issue here with this device.
|
H: What is the purpose of the thick blue line in this schematic?
On this schematic for a Z80 computer, there appears to be a thick blue wire connecting some components together. What is it? Googling yields no results: here is the schematic
AI: Yes, they are buses. The address, and the data bus.
They are basically a way of drawing lots of nets without having to draw each individual one. The label by the nets that connect to it define what connections are inside the bus.
|
H: Reverse bias I-V characteristics of mosfet
What is the equation for a N-channel MOSFET's current value (\$I_{DS}\$) given a negative drain-to-source voltage \$V_{DS}\$?
I can find plenty of forward biased I-V curves for the N-MOSFET, but I haven't found any reverse biased ones.
AI: Basic threshold model--
It is in the triode region for Vgs > Vth, regardless of the direction (and |Vds| low).
There is also a body diode in parallel so if -Vds is more than than a few hundred mV that must be taken into account as the diode will conduct.
If you want more accurate subthreshold modeling, someone has probably done it, but this suffices for many or most applications where the transistor is reverse biased.
|
H: How do I get the index of these word addresses?
We are given 32 bit memory address references.
For example:
180, 43,2.
We are asked to find the index "given a direct-mapped cache with two-word blocks and a total size of 8 blocks". Mind you have I have the answers. I am looking to HOW to get those answers.
The index for 180, 43 and 2 are 2, 5 and 1. For other questions, I used the address mod the number of blocks. But modding those three numbers by 8 or 16 is not working.
AI: Based on the known numeric answers, it is presumed that you are asking for the block index in the cache memory that corresponds to each given main memory address. Since there are only 8 blocks in the cache, the values can only go from 0 to 7. Furthermore, each cache block holds 2 words (so each even memory address and its next odd memory address map to the same block).
int(180/2) mod 8 = 2
int( 43/2) mod 8 = 5
int( 2/2) mod 8 = 1
The "mod 8" is because the indexes repeat every 8 ( x mod 8 is always from 0 to 7). The "/2" is because each block can hold 2 addresses. The "int" basically truncates the division, and we don't mind where exactly in the block the address value resides (1st or 2nd word).
Since some readers may be interested in what direct memory cache is, I found this instructional video.
|
H: How to Monitoring the lines between an Atmega8 and a LCD using Atmega32
I have a device that it use an Atmega8 to send some data to a 2*8 character LCD. the LCD has 8 pins and the pins are as below from left to right:
DB7 | DB6 | DB5 | DB4 | En(Clock) | RS | VDD | VFF
I think it is a HD44780 with DB0...3 , Contrast and WR connected to GND.
By the way, I want to monitor the lines between this LCD and Atmega8 using an Atmega32. I mean I want to achieve the data that transferring between them and send it to my computer's COM port and ....
I checked the datasheet of HDD44789 (A 2*16 LCD) and I found this :
Although this has 8 bit for data and mine has 4 bit, but I think both have a single procedure to print data on the LCD.
Now I want to know, how I can read the data on the lines using an Atmega32. for example can I connect En to Interrupt-0 pin and in falling edge read DB4....7? Does it work?
And another question, when we send data to LCD in 4bit-packs, we send high nibble first or we send low nibble?
AI: Can I connect En to Interrupt-0 pin and in falling edge read DB4....7?
Essentially, yes. You also want to read the RS pin to see if the data is for control or text.
And another question, when we send data to LCD in 4bit-packs, we send high nibble first or we send low nibble?
Higher nibble first.
|
H: Ozone and electronic equipment
Hopefully this is the right community to ask this question. Does anyone know whether there is a significant chance that ozone at approximately 15 ppm will damage consumer electronics, speakers, keyboards, and lab equipment, such as a Tektronix scope, for example?
I'm very sensitive to smells (actually diagnosed with hyperosmia, if anyone wants to know) and there is a slight but unpleasant odor that builds up in the apartment when I keep the windows closed for about 10 hours or so. I moved here recently, and except for this and a couple of other minor problems, I really like it. It's cold and rainy outside, so I can't keep the windows open, as I do in the summer.
I decided to blast the place with ozone, which helped for a few days, but now the odor is coming back. The first time I did this I waited until the rain stopped and hauled all of the electronics to the balcony just in case, and left the place, of course. But I'm not going to drag all of this stuff back and forth again, so I wonder how dangerous is this really?
According to a quick guesstimate based on the ozone generator specs ad the volume of air in the apartment, and assuming ozone half-life of about 30 minutes, the concentration should stabilize at about 15 ppm. Would repeated exposure (let's say a couple of hours once a week) pose a significant risk for electronics?
AI: 15 ppm? Holy Cow! It might not damage electronics, but it will surely damage you. See http://www.ozoneservices.com/articles/007.htm 12 ppm kills guinea pigs in 3 hours. .05 ppm is the upper limit for FDA-approved medical devices, and 0.1 ppm it the health and safety limit.
That said, I'd expect only a long-term degradation in electronics gear. I'd expect bleaching of exposed surfaces, among other things, but only over a span of months.
ETA - Spehro has brought up the problem of ozone attacking rubber, and Brian has extended the concern to speakers. This is a valid concern. Ozone cracking is well-known, and there exist antiozonating agents (and no, I'm not making the word up) which get added to the rubber before it's vulcanized. I'm assuming that any rubber found a piece of electronics equipment would be so protected just on general principles. Well, we all know what happens when you assume, so I may be wrong. See http://en.wikipedia.org/wiki/Ozone_cracking for a discussion of the problem.
|
H: How do I interpret this thermal curve graph for my heatsink?
Datasheet of heatsink.
The heatsink says it's thermal resistance is 24K/W.
Let's say my device dissipates 5 Watts. Assume a perfect conduction from the case to the heatsink, and junction to case is 0K/W.
If I use the specified value, the heatsink should rise 120K above ambient. However, from the graph it says it will be about 96K above ambient (unsure which curve is correct).
Further, how do I interpret the effect of forced air cooling according to the graph?
AI: The specified value of 24K/W assumes that the performance is linear. That chart is obviously anything but linear.
Forced air changes this "base" 24K/W to the amount given on the chart. So if there was a flow of 400fpm the thermal resistance would drop to about 6.3K/W.
|
H: Connectors that protect wires from breaking when it is resonating alot
I am building a robot vehicle, that is resonating alot when it is in rough areas. Cause of this the wires in the robot will resonate a bit too. When this happens every now and then a 'vein' (tiny copper wire in the wire) of the wire will break off. After a certain time the wire will break off from the connector.
Are there connectors that will prevent this? Or is there another solution to prevent this? I am currently using normal screw terminal blocks from TE connectivity. The connector should be able to handle atleast 5A.
AI: You should stop everything flapping about. In high vibration environments (aerospace, etc), you'd find everything tied or laced in some way to stop it shaking. You might even find that the lacing has then had epoxy or some other sticky goop put on it to stiffen it further.
Making everything stiffer will also raise the resonant frequency of the whole system, which may be helpful too.
Here's a picture of the ultimate in robot vehicles for hostile environments (Curiosity) - note the lacing on the cables...
|
H: Shift Register Vs Multiplexer
I am not sure about an implementation. I've a multiplexer 8 input, 1 output and 3 select signal. One of these selects signal sequentialy acquires all value of a bit vector. Now I can choose 2 way.
The first way is to use another multiplexer where the input is the bit vector and the select signal is a counter log2 of the input.
The second way is to use a shift register and take the LSB bit of the vector.
What is the best solution in terms of area in a FPGA
AI: Here are some thoughts on hardware coasts:
8 bit shift register on virtex-5, spartan-6
A slices contains 4 LUTs and 4 registers. You'll need 2 slices to store 8 bits.
8 bit shift register on virtex-6, 7-series
A slice contains 4 LUTS and 8 registers. You can store the complete byte in one slice.
3 bit counter
Small counters are implemented using LUTs and registers. This counter fits into one slice
8to1 multiplexer
A 6-input LUT architecture can map 4to1 muxes into one LUT. A 8to1 mux requires two 4to1 muxes and one 2to1 mux (mux-tree). Xilinx FPGA slice cells contain additional F7MUX and F8MUX primitives which can be used to build wider muxes. In case of 8 bits: 2 LUTs and one F7MUX. All in all: A half of a slice.
Note 1:
If you are using a shift-register, you also need to know when to stop shifting, if it's not a pipeline.
|
H: How does a cable tone-and-probe kit work?
A useful tool for someone installing electrical cabling of any sort can be a Tone and Probe Tool: it allows one to find individual leads among a possibly hundreds in a cable trunk, without having to either strip or connect the remote end.
With the tone generator part connected to the start of the wire(-s), the probe tool typically generates an audible tone once its tip is in close proximity of the correct wire.
Can someone explain how these work in theory, perhaps with a high-level sketch of the basic circuits of such a tool?
AI: The tone generator injects a signal onto the cable to be traced. Typically it's a Square wave (with high harmonic content), or a warbling tone.
Here's an example:
The probe tool is usually called an Inductive Amplifier, but in reality it works by capacitive coupling from the tone injected onto the wire.
There's a very informative Google group discussion on this, where the probe is described as:
The original 'banana' probe is simply a LM386 driving a mini 1" (25 mm)
to 1.3" (30 mm) speaker. The input has an MPF102 JFET as a source
follower, with a 4.7k source load resistor and a 10 meg from gate to
ground (& collector to +9V). A 47 pf cap in parallel with the 10 M to
rolloff highs, and a 1 Meg in series between the gate and probe tip.
The source load resistor is coupled to the input of 386 thru a .1 uF
ceramic cap. A push button momentary contact switch and 9V battery
complete the circuit.
This site describes one guys attempt at building one.
|
H: How to attach an electronic enclosure to glass?
I'm developing a very small PCB that I'll put inside a small case that will be attached to glass, let's say for example in a car. Once you attach this to the glass, it should stay there for a long period, but should also have the ability to be detached and attached again without too much effort.
At first I considered using a sucker also known as a suction cup but this is maybe a too bulky solution, and I need something more discreet. Also the distance between the glass and the case should be minimal, and using the suction cup this distance is considerable. So do you know something that could do the job for this application?
AI: In Italy we have a transponder-based payment system called Telepass, which sticks to the windshield using Velcro. One side attachs to the glass with tape, and the other is attached to the device.
It is pretty tough, and usually lasts for years.
It seems it uses Dual Lock by 3M.
|
H: Can different sources with same voltage output can drive different amount of current through the circuit
I started experimenting with electronic devices. While I was doing that I connected a DC motor to output of arduino which provides 5V. It could not provide enough amount of current. But when I connected the same motor to my phones battery which provides 3.8V output it provided a lot more current. So I was confused wasn't the current from arduino should be more as it has more voltage?
AI: You didn't specify the voltage and current requirements of your motor so some guessing is required to provide an answer. Typically, small hobbyist type DC motors will draw at least 100 ma at 5 volts. The Arduino output port cannot provide that much current. If you measure the port voltage with the motor connected it will be much less than 5 volts and not enough to turn the motor. The battery, on the other hand, can provide sufficient current to power the motor without dropping much voltage. Basically you need to match a power source to a load in both voltage and current. Because a source is rated to provide a given voltage, it will only do so if its rated current is not exceeded. You exceeded the current rating of the Arduino port.
|
H: Role of Inductor in power supply section..?
I'm interfacing a TFT display with MCU which requires 450mA current & 3.3V.
In power supply section I have used regulator ICs to get 5V & by using two diodes I'm getting 3.3V. For filtering in power supply I have used inductor.
but the display requires a 450 mA current which is not provided. & my display was getting reset because of not enough supply current. It led me to remove inductor & shorting it. now section is working & display is stable. But it will led to noise in power.
One remedy to this scenario I heard ( NOTE - I don't know exactly about it & I'm not sure Whether i'm saying it right. If it's wrong then please correct it)
- we can use winding around an Inductor & then we can use it to provide enough current supply to display.
If any alternate solution is available with this please let me know.
NOTE - I'm not asking about how to regulate supply to 5V or 3.3V. I'm talking about the inductor which is used in filtering of power supply. How it is related to current if it is.
AI: First of all the 2 diodes will not reduce the voltage from 5 to 3.3. Additionally you make the output voltage more noisy as the amount of voltage dropped depends on the current drawn.
Use LM1117-3.3 regulator instead.
|
H: How would I properly develop a current rating for this system...?
I have a system that I have recently developed for in house (manufacturing) equipment testing. Transformers rated for 80VA (264V, .303A) are used in series and rectified using a full-wave diode bridge. The signal is leveled out by capacitors to produce a DC bus voltage. A fuse is placed in series with the windings of the transformers and rated for .315mA.
Should the system be rated for .303 mA (the rating of the transformers), .315 mA (the rating of the fuse) or higher (more current possibly pulled from the bus caps)?
here is a schematic of the system:
Voltage ratings were easy to figure out. I turned on the system and turned the input variac as high as it would go.
AI: Make sure your fuse is rated to break 1.05kVAC. I would suggest fusing the primary as well, since the transformers could fail, in fact it's more important than fusing the secondary.
According to the Hammond Design Guide for Rectifier Use, the maximum DC current output for your configuration is about 0.62 of the AC rating, or about 188mA in your case. This is because the RMS current in the transformer winding (and thus the heating) will be higher than the DC current output.
If you're talking about current available at the terminals as shown, you have to subtract the current through the 400K bleeder resistor, which is about 3.8mA, leaving you with ~184mA.
|
H: Verilog: Check, if a signal is 100 ticks active?
I have one input and one output. And I want to turn the output to 1, if the input was 100 ticks active (100 cycles).
module check_100(
input wire clock,
input wire reset,
input wire in_a,
output reg out_a);
reg[10:0] counter;
always @(posedge clock) begin
counter <= counter + 1;
if(in_a && (counter == 100)) begin
out_a <= 1;
end
end
But it doesn't seem to work properly.
Is this a good way to check, whether a signal is 100 ticks/cycles active or not?
Thank you! :)
AI: 1) You need to increment your counter whenever the input is high (which you do)
2) You need to reset your counter whenever the input is low (which you don't)
3) You need to stop counting after counted to 100 (in case you want the output remain high). It will actually remain high in your case, but only because you are not doing the (2).
|
H: Send integer values through serial communication in PIC to PIC?
I need to pass integer values from one PIC to another through serial port
for char I can use the following code
char data1='a';
TXREG=data1;
while(PIR1.TXIF==0);
but when I try to pass int type variable it returns an ASCII equivalent..
Is there anyway to receive the data as integer instead of char type?
AI: You already are sending integer values over the UART with the code you show. Your problem is apparently sending integers that are more than 8 bits wide.
The UART inherently only sends 8 bit bytes (in the most common configuration) at a time. If you want to send a wider integer, you have to send more than one byte to represent that integer. For example, you might decide that all multi-byte integers are to be sent in least to most significant byte order. If you have a 16 bit integer to send, then you send the low 8 bits first, then the high 8 bits. The receiving PIC does the reverse. It receives the low 8 bits first, then the high 8 bits, and writes those consecutively in memory so that the rest of the system can access the value as a 16 bit integer.
24 bit integers, for example, are sent the same way except that 3 bytes are needed instead of 2. 32 bit integers require sending 4 bytes.
Note that none of this has anything to do with sending numeric values to show up on a terminal emulator. Terminals display characters. Each possible character has a pre-determined binary code. You send the byte containing the code for a character, and that character shows up on the terminal. For example, the code for the letter "A" is 65. If you send the byte 65, then a terminal will show "A". Likewise, sending 48 causes the terminal to show "0". Look up something called ASCII code. That will tell you what the byte values are for each of the characters the terminal can show.
Here is a example to illustrate all of the above. Suppose you wanted to send the 16 bit integer value 9525. Let's convert that to HEX so we can see the individual bytes easily: 2535h. You have previously decided to send multi-byte values in low to high byte order. The two bytes you will send are therefore 35h and 25h in that order. These have the decimal values 53 and 37. You send these bytes, and the other PIC receives 53 and 37. Note that (37 * 256) + 53 = 9525, which is the value you are transmitting.
If these bytes were to be intercepted by a terminal, then you'd get whatever characters map to 53 and 37, which happen to be "5" and "%". So the terminal will display "5%" when you send 9525. If you wanted the terminal to display "9525" you'd have to send the byte values for the characters "9", "5", "2", and "5". Those happen to be 57, 53, 50, and 53. That is a lot more complicated since the PIC has to figure out the decimal digits of the binary integer it has, convert them to the character codes for those digits, then send those.
Generally it's a lot easier to do any kind of user interface conversion on the PC and let the PIC send and receive native binary. Converting the binary integer 9525 to the characters "9525" is trivial for the PC, but can require substantial code space and cycles on a small PIC.
|
H: Do we know what a radio wave looks like?
In precalculus class, we are learning about sin/cos/tan/cot/sec/csc and their amplitude, periods and phases shifts. I've studied electronics on and off for about a year. I would like to know if we actually know what waves look like. Do they actually look like the sine and cosines like in mathematics textbooks, or are those wave functions just representations of something we can't see be can only analyze their effects and therefore something we don't know what they look like.
AI: Forget the quantum stuff for a moment. If you want to learn about quantum electrodynamics, read QED by Richard Feynman. (You should read it anyway; it may be the only really good pop physics book.)
Classically, an electromagnetic field is a force field that acts on electric charge. It doesn't "look like" something any more than a mechanical push or pull does. One of the things that the EM forces can act on is molecules. They can change the shape of the molecules, or (at high frequencies) even break chemical bonds. That's how you see -- light stimulates a chemical reaction in the cells of your retina, which kicks off a chain of chemical reactions that culminate in brain activity.
When we say that a radio wave can be described as a sine wave, we're talking about how the amplitude of the wave (i.e. the strength of the force) varies over space and time. Sine waves tend to pop up a lot for the reasons Dave mentioned -- they're simple solutions to second-order differential equations, and you can use Fourier analysis to describe other signals in terms of sinusoids. Sine waves are also used to talk about sound, for the same reason.
Most radio waves will not be pure sinusoids, but many are based on sinusoids. For example, the amplitudes of AM radio waves are sinusoids whose amplitude varies slowly. The amplitudes of FM radio waves are sinusoids whose frequencies vary slowly. Here's an illustration, courtesy of Berserkerus on Wikimedia Commons:
Notice that the example signal in this image is also a sine wave. That's not an accident. Sine waves work well as simple test signals. The radiation from power lines would also be pretty close to a pure sine wave.
If you want to visualize a radio wave, imagine being underwater near a beach. The currents aren't visible, but you can still feel moving waves of water as they push you back and forth. That's what radio waves do to the electrons in an antenna.
|
H: Wireless Home Automation 2.4GHz versus 433MHz
Project specifications
- This is an **Arduino** project
- This is supposed to be internationally applicable
I am working on a home automation project which might go into smaller production. The project is wireless and the connections would be managed as followed:
You would have multiple slave nodes, and one master node in the house.
All of these nodes would be transmitting and receiving data. E.G.
Receive: command to switch relay, turn on the AC etc.
Transmit: optocoupler data to see if a light is on, temperature etc.
Bands
I have 2 band options:
2.4 GHz band
433 MHz band
2.4 GHz
Pros:
Big data transfer rate(not really that important)
Cheap transceivers with antennas available here
Cons:
Small range, solved by making each node a repeater. It bounces the signal if it isn't its, but writes down the packet id so if another node bounces the packet the node wouldn't get stuck in an endless loop)
A lot of interference
Questions:
Do any government regulations limit duty cycles for this band?
Would it be that badly affected with other wireless networks?
Would the other signals make the signal hard to read(I have never worked with this band before)?
Would the repeater idea work?
433 MHz
Pros:
Big range
Good wall penetration
Little interference
Cons:
Really freaking expensive transceivers
If I would use no transceivers, but 1 receiver and 1 transmitter(cheaper), I would need 2 antennae, and it would cost me about the same as the 2.4 GHz transceiver w/ antenna
Questions:
Would the 1 receiver + 1 transmitter interfere badly with each other?
Is this band crowded?
Do any government regulations limit duty cycles for this band?
Suggestions
Feel free to give me any suggestions!
AI: Putting this in an answer just because it's easier to type here. I did a similar automation project at home like you describe, so I'll share how I felt when the project was finished. I did custom boards with a TI MSP430 @ 900Mhz, just point to point with a MSP430 with ethernet as the access point. I wish I had picked 433Mhz, I expect it's range would have been better for me.
I picked 900Mhz, like you I was looking for something that was not in 2.4Ghz which I figured would be crowded with wifi and cordless phones. I wanted a small antenna though so I chose 900 over 433. Using my little TI SA there were other 900Mhz sources in my neighborhood but it wasn't crowded.
There are definitely power restrictions, and transmission time restrictions in all those bands. TI has a nice app note about regulatory compliance in these ISM bands. Most interesting to note is that if you do frequency hopping you'll be allowed to use more power than if you just pick a channel and stick with it. That's a little more work, and for me it had battery life implications. My nodes sleep and poll to look for commands from my phone. If I used hopping they'd have to wake up and find the AP's frequency first which burns more power.
I think if you look at some of the micro controller solutions you can find pretty cheap 433Mhz transceivers. That was another reason for 900.
Ah for your other questions about interference it depends, certainly it would be easier to design a system where you always had access to your channel and no one else interfered. Knowing you have to deal with interference will cause you to handle things like re-transmissions, acknowledgments that messages have been sent, maybe error checking like CRC, and collision hold off.
Really it's not a bad thing, you will end up making a more robust product. You don't want to send your switch a signal to turn on and have it never get there. Better to expect interference and make your system robust enough to try again.
Repeaters can definitely work, people use them all the time. To me a repeater infers that it will be on all the time so not good for a battery powered EP, but there are other mesh networking strategies that could work too. I'd start with just point to point first to get yourself going, but you can always dive right in.
Just my 2 cents, good luck with the project.
|
H: How to resolve this Syntax error
Am trying to code a top level module that would connect different modules to make an up/down counter that would display a hexadecimal character on a 7 segment LED on posedges; but every time I try to run the following top level module I get an error that says
'Line 25: Syntax error near "<=".'
There is no one else to ask this and am following the same outline of the example in my reference book. What am I doing wrong?
module Main_Module(a, b, c, d, e, f, g, U, R, P, Clk);
input U, R, P, Clk;
output a, b, c, d, e, f, g;
reg [3:0] Data;
wire In3 <= Data[3], In2 <= Data[2], In1 <= Data[1], In0 <= Data[0]; //This is Line 25
Counter Counter_1(Clk_1Hz, R, P, U, Data);
Segment_Display Segment_Display_1(a, b, c, d, e, f, g, In3, In2, In1, In0);
ClkDiv1Hz ClkDiv1Hz_1(Clk, R, Clk_1Hz);
endmodule
Thank you Eugene Sh.and Greg for your time!
AI: Wires need blocking assignments (=), not non-blocking (<=). You can define it this way:
wire In3 = Data[3], In2 = Data[2], In1 = Data[1], In0 = Data[0];
Example here
More commonly you will see the declaration and assignments as separate statements. The two are functionally equivalent
wire In3, In2, In1, In0;
assign {In3, In2, In1, In0} = Data;
|
H: Switching frequency of a solid state relay?
I bought a SainSmart 4 channel solid state relay recently. I am planning to use an Arduino to control some Christmas lights I've put up around my home. My question is: How fast can you switch SSR's on and off? For example, what if I want to have a string of lights flash, what would be an appropriate flash rate so the relay won't get damaged?
This is the relay module I am using: http://www.sainsmart.com/sainsmart-4-channel-5v-solid-state-relay-module-board-omron-ssr-avr-dsp-arduino.html
On specs it says: OUTPUT EACH CHANNEL: Load voltage range: 75 to 264VAC (50/60Hz)
But the 50/60Hz isn't stating the max switching frequency, is it?
Thanks for any help.
AI: According to the datasheet, the G3MB-202P is a discontinued zero-crossing switched AC SSR.
So, when it is commanded to turn on, it will delay by up to 1/2 of an AC cycle until the next zero crossing. So, at 50/60Hz it can delay by as much as 10msec or 8.33msec
When it is commanded to turn off, it cannot turn off until the current crosses zero. This can be as much as 10msec or 8.33 msec again, but not necessarily in phase with the voltage.
For a resistive load you if you commanded it on for a bit more than 10msec it would be guaranteed to turn on, and commanded it off for a bit more than 10msec it would be guaranteed to turn off. Using say 10.5 msec for each, that's 21msec or about 47Hz. In reality you would get beating between commands and response frequencies with wildly varying amounts of power, so perhaps 1/10 of that frequency or about 5 or 6Hz is more reasonable as a maximum, but even that is a bit high.
If you want to get 'even' and fairly-beat free power (for example for a PWM heater control), normally 0.5Hz is about right (gives you 200 half cycles per period at least).
Nothing you can do by commanding the relay will damage it with a simple load like lights, but you may get undesirable (or perhaps interesting) variations in light if you cycle it too fast. Some will probably appear as smooth pulsations in brightness, which might be quite okay. The life of the lights might be shortened a bit if they're incandescent, but they're only Christmas lights.
|
H: How differential pairs should be called out on fabrication print?
I have a design that the diff-pairs (100 Ohm impedance) and single-ended (50 Ohm impedance) are routed on the same layer. To specifying the impedance, on the “Lamination Stack-up”, I am going to add the information like this;
INT1 (TW=0.006” Z0=50 ohm / Z0=100 ohm DIFF-PAIR). Is this OK?
In this case, the fabrication vendor will determine dielectric thickness based on the TW, trace spacing, and material on their own to achieve required impedance. Right?
In other case, if the trace width of the diff-pairs are different to the trace width single-ended, can I apply this way to call out?
AI: You can do that, or you can call the diff pairs out as width and spacing. Really however you communicate well with your shop is fine. Even better if you call them at the start of your design to work on the stackup with them. Nobody knows their process like they do. It could be easier/cheaper for you to make a minor change that you wouldn't know about otherwise.
Also I'd say you should be specing your dielectric thicknesses and your over all board thickness. The shop will likely slightly adjust your widths based on what they know about their etching and lamination process.
That's another part of the Stackup that is nice to work with your shop on ahead of time.
|
H: Using distribution transformers vs direct connection to primary switch gear
I am trying to learn more about transformers and low voltage electrical distribution.
Say you have a medium sized industrial building with a primary switchboard feeding several load centers elsewhere in the building feeding localized loads.
Is it more efficient* to use one voltage through out the system, i.e. the power feed into the building would be 120/208v 3phase which would be distributed through out the building, or distribute a larger voltage and hence smaller current through the building to the load centers and then transform the voltage to the desired voltage at that point.
*note: more efficient can either mean electrically, as in am i wasting more power by using more transformers vs larger cabling, or monetarily, as in is the smaller copper distribution wire going to outweigh the price of the transformers.
thanks in advance.
AI: The decision between HV and LV distribution is usually driven by capital cost and safety considerations, with energy efficiency being a lesser objective.
The choice depends on:
the size of the building
the size of the loads
the expense of electrical equipment with appropriate continuous current rating and fault current rating, including:
transformers
cables
copper busbars
circuit breakers.
If your "medium sized industrial building" contains a number of arc furnaces, each of which requires thousands of amps, you are likely better off having high voltage distribution.
The high fault currents involved in a low-voltage solution are difficult to deal with - while it is possible to build one big transformer feeding an 8,000 amp switchboard, it is expensive to build an 8,000 amp switchboard to safely withstand a 100 kA fault level.
It is cheaper and safer to have two transformers feeding 2 × 4,000 amp switchboards rated for 50 kA fault level, or four transformers feeding 4 × 2,000 amp switchboards rated for 25 kA fault level.
If your "medium sized industrial building" contains things like lathes, welding sets, mills, and so on, which are comparatively light loads, you are likely to be better off with a low-voltage distribution system.
It is an electrical engineer's job to make this judgement on a case-by-case basis, to deliver a safe, lowest-cost, fit for purpose design.
This might include doing enough engineering design on both options to evaluate their relative safety and cost.
|
H: using AD620 with load cell
I am currently using an AD620 to amplify the signal coming from my load cell. I am supplying it with single supply of 5V and 0V. Below is my preliminary circuit.
I am feeding half the supply to the reference pin so i am getting an output of 2.5V to 3.7V. I also tried feeding the reference pin of 1.5V and I am getting an output of 1.5V to 3.7V as expected from the information provided from the datasheet. What can i do to have a 0 to 5V rail-to-rail swing? Do i have to feed this output to a rail-to-rail op amp like an AD822?
************************************UPDATE*****************************************
I have modified it by using an AD822 "rail-to-rail" op amp to subtract a voltage so I could scale down my output from the AD620. is there something wrong with this? Because I am having some inaccuracies regarding my AD822 output.
AI: Yes. What you need is a difference amplifier with gain. You can do this in a single stage, but I think you're better off doing it in two stages. First, create a voltage of 1.5 volts, and subtract that from your AD620 output. You can do that with a simple difference amplifier: one op amp and 4 equal resistors. You will now have a useable voltage swing of 0 to 2.2 volts. Then you make a non-inverting amplifier with a gain of a little more than 2, and boost your 0 to 2.2 to a 0 to 5 volt signal.
|
H: Linear Power Supply Advice
I am new here to StackExchange and new to electronics in general. As my second electronics project (the first being a blinker circuit for a bandolier of LEDs) I am building a regulated linear power supply.
The specifications for my power supply are mostly dictated by the components I have available and are within my budget and skill level. Ideally I would like a variable dual output with the ability to supply negative voltage for use with opamps and audio amplification, which is where I am in need of assistance.
So the transformer I'm using is rated for 12VAC at 2A. It is not a center tap transformer.
So, my question :
What would be the easiest way to get a negative rail? I've seen people connecting two positive outputs together in series in a common ground configuration to obtain negative voltage, so would this work given my schematic?
I also have another transformer that can supply 12VAC at 500mA, would it be worthwhile use that alongside the other transformer to provide a negative rail? Would I need a negative voltage regulator for it? I'm under the assumption that having dual half wave rectifiers isn't generally feasible for non center tapped transformer.
Below is my draft schematic (untested) for the supply I would like to build given that I can just hook up the two outputs in series and get a negative rail. I'm just unsure if the setup I have is adequate for it.
I have no idea if the dual output setup I have here will work, I don't see why it wouldn't though. I have no idea what I am doing really so I am probably wrong.
Any general advice would be great as well, thank you.
AI: No, this won't work to give you +/- supplies, because of the common negative rail.
You can, however, use the transformer you have to give you +/- adjustable supplies by using two half-wave rectifiers (2 diodes), double up on the capacitor values to keep the ripple at ~2Vp-p, and an LM317 for the positive and an LM337 for the negative supplies. With suitable (large) heat sinks capable of dissipating about 10W each it should be good for about +/-0.6A. You could also use 10,000uF caps (say 25V rated) to get a bit more voltage range at high current.
simulate this circuit – Schematic created using CircuitLab
|
H: PIC32 Configure PPS for SPI CLK
Well I'm struggling hard with this, been at it for 2 hours so far. I should have stuck to my TI parts :)
Anyway I have a board and I'm trying configure the PPS to bring the SPI peripheral out to the pins. Actually I'll use it in I2S mode.
So the part is a PIC32MX210F016B and the SCK pin is this: SCK2_PRB15 Physically connected to pin26. I can see that in the datasheet this is the SCK2 pin.
I've been trying to follow these plib examples I've found like so:
PPSOutput(3, RPB15, REFCLKO);
But it's not working. I understand that there are different peripheral groups, but I don't get how to find the group number from the datasheet. I have been reading it tonight and reading table 11-2 about port settings. I'm still not clear.
I'm also reading the PPS.h header file to try to understand the settings but I can't find anything about SCK in there. I did finally figure out by looking at the macro expansion what the PPSOutput function is trying to do, but I just don't know how to figure out the parameters for my part.
Anyone have any ideas?
AI: If you look at page 21 of the datasheet, you will see that the row of pins for SCK2 does not have PPS listed for its pin assignments like the other pins do; rather it is connected to either pin 23, 26, 29 or 15 depending on the package. Therefore it is not reassignable.
The SDI2, SDO2, and \$\mathsf{\small \overline{\text{SS2}}}\$ pins are reassignable through the PPS mechanism.
|
H: Multiple DTMF circuit interfaced to one microcontroller, will it work?
I already tested this circuit with only one modification, I changed the R2 to 300kOhms which worked in my case.
I interfaced this circuit to a microcontroller where they shared a common ground. I successfully read the telephone number of the caller as shown in this figure. Apparently, I received the code number (10 2) and the 7 digit phone number. The frame was encapsulated with byte 0 and byte 15.
Now, I wanted to create a circuit that contains 3 channels for 3 different phone lines which are then to be interfaced into one microcontroller..
If I'm going to share a common ground for them all (3 DTMF circuits and microcontroller circuit), will it work?
On the sidenote, based on the datasheet, the circuit is in single-ended configuration.
EDIT: I added the entire circuit shown below.
AI: Yes, you certainly can have three of your DTMF decoder circuits connected to your microcontroller.
However, even though the three telephone lines nominally share the same ground (somewhere), you should really treat them as "floating" with regard to your decoders, and use a transformer to couple the audio from each line to the corresponding decoder.
|
H: Adding two signals and finding the RMS and Peak to peak value of the output signal
I would like to start by saying I have been solving exercise related to Op amps and how to find RMS values and Peak to peak values. But I got stuck on this exercise.
Basically, two signals has to be added.
U1= 4v
U2= 2vsin(2*Pi*f*t)
and after those signals are added using op amps the result should be
Uout=2(U1+U2)
Before I have solved question where both U1 and U2 had some certain value without sine part, and I was able to solve it. But when sine is introduced on one of the signal generator it just got confusing.
My first question is how can two signals be added if one of them has sine part in it and the other not.(May be I am missing some basics, Sorry on my part then.)
Now Second question is how to find the RMS value and peak to peak value of Uout.
What I did for finding the RMS value was
Uout=8v+4vsin(2*Pi*f*t)
than just using RMS formula.
(UoutRMS)²= 1/T * Integration from 0 to T * Uout(t)².dt
Is this correct what I am doing, Need help my finals are coming?
AI: For U1 the peak voltage is 4V and so is the RMS as it is DC
For U2 the peak value is 2V and the RMS is \$\dfrac{2}{\sqrt{2}}\$ as its a sine wave.
A useful formula to know when adding two signals which do not share any frequencies in common is:
$$\text{RMS} = \sqrt{U1_{\text{RMS}}^2+U1_{\text{RMS}}^2} $$
Which in this case \$ RMS = \sqrt{4^2+\left( \dfrac{2}{\sqrt{2}}\right)^2} = \sqrt{18}\approx\ 4.243\$
The positive peak is just 4 + 2 = 6 V
The the minimum value is 4 - 2 = 2 V
So the peak to peak is 6 - 2 = 4 V as you would expect since adding a DC offset wont change the peak to peak.
Alternatively you can do this from first principles
$$RMS = \sqrt{\dfrac{1}{T} \cdot \int_0^T \left(U1(t)+U2(t)\right)^2dt}$$
|
H: Schottky Diode disadvantage as compared to usual diode
Schottky diode have a low forward voltage drop (typically \$0.15-0.45V\$) and very fast switching action, as compared to traditional diode, which typically have a \$0.7V\$ voltage drop (Silicon diodes). What is then the advantage of traditional diode as compared to Schottky diodes?
AI: Full semiconductor junction diodes have much lower reverse leakage. Take a look at a Schottky diode datasheet, and note the reverse leakage, particularly at maximum working temperature.
Semiconductor junction diodes are also available at much higher reverse voltages.
|
H: Low Pass Filter With Hall Effect and ADC Help
Background:
I am using the Allegro ACS758KCB-150U hall effect based current sensor, here is the datasheet, I am using it to measure current drawn by 24V motors, between about 20A - 130A. The reason I need to measure the current is to get a general trend of how hard the motors are working to accomplish there jobs, by measuring their current draw. I am using this ADC, but I would not be opposed to getting a different ADC or using a different type of sensor to measure the current. I would like to measure 10+ times a second.
My question:
On the datasheet for the current sensor on page 1 there is a diagram labeled Typical Application, it shows a low pass filter between VIOUT and GND. There is a resistor Rf which is later defined as greater than 4.7kohm, and a capacitor Cf that is not defined. How do I assign values to Rf and Cf to work for my application? If I need a different ADC what should I look for when selecting one?
Here is what I know in relation to my question:
I know the formula to find the cutoff frequency for a low pass filter, I haven't taken any college physics courses as I am only in high school, but I have taken calculus.
Thank you for any help,
Joel
AI: The browser doesn't like that link to the datasheet, so I couldn't read it. Provide the link to just the PDF file, not a page with all kinds of fluff around it.
In any case, the reason for the low pass filter is that the motor current can have short term spikes and other noise, but what you care about is more of a recent "average", or more precisely, you care only about the low frequencies of the current signal. Since you only want readings at 10 Hz (a reasonable rate for looking at motor current), you should filter out frequencies above 5 Hz at least.
A simple way to accomplish this is with a R-C low pass filter:
The rolloff frequency of such a filter is
F = 1 / 2πRC
When R is in Ohms and C in Farads, then F is in Hz. In this example, the rolloff frequency is 4.4 Hz. That's the frequency at which it roughly starts to attenuate, with the attenuation being 3 dB at that point. Much below that frequency, the amplitude is unchanged. Much above that frequency and the amplitude falls off 6 dB per octave above the rolloff frequency, which is also the ratio of the rolloff frequency to the frequency being passed. For example, 100 Hz is 23 times the rolloff frequency, so this filter will attenuate a 100 Hz signal by 23 in voltage. If you stick in a 100 Hz at 10 V, you will get out a 100 Hz at 440 mV.
You also have to consider loading of the current sensor output and what maximum impedance the A/D input requires. The above is fine if the current sensor can drive a 1.2 kΩ load, and if the A/D is OK with its signal having 1.2 kΩ impedance. You can adjust this by changing the resistor but keeping the R*C product the same. For example, R1 = 12 kΩ and C1 = 3 µF would give you the same frequency response, load the current sensor output less, but also present a higher impedance signal to the A/D.
|
H: Class B power amplifier
In this circuit from (Grey,Meyer Analysis and Design of Analog Integrated circuits fifth edition) It is stated that : "In the quiescent
condition,\$ V_o = 0\$ and \$V_1 = 0\$ ."
What forces V1 and Vo to be equal 0 when \$V_i =0\$ ?Aren't there other sources (\$V_{cc}, -V_{cc}\$) which may cause \$V1\$ to be >0 ?
edit :It is actually mentioned that this is a simplified schematic of the output stage of the 709 op amp
AI: Brian is right. This is not a complete circuit. Do not bother attempting to analyze the quiescent conditions of this circuit.
For the record, as drawn, if \$V_i\$ is greater than 0.6V above \$-V_{CC}\$, then the collector of \$Q_3\$ will be near ground and \$Q_2\$ will pull the output voltage down toward \$-V_{CC}\$. Grey and Meyer are well-respected, but maybe write for an advanced audience. I am sure that when presented in full context, everything makes sense.
|
H: How to connect 2 3v3 lines in parallel from different dc/dc converters?
Is there any way, to connect 2 different (but same output voltage) dc/dc converters? One of them works on 5 to 40 Volts, and one on 3 to 5.
AI: If your application can tolerate a small resistance in the power circuit then Voltage Regulators with same output voltage can be paralleled easily.
Consider the circuit below where V1 and V2 are nominally 1V but in reality may be a little different. Then with zero load (I1=0): \$I_{R1}-I_{R2}=2(V_1-V_2)/(R_1+R_2)\$ so you can get reasonable matching of currents for resistors in the m\$\Omega\$ range. So if your max voltage difference was likely to be 10mV (say) then 10m\$\Omega\$ resistors would give you a matching of 1A.
Also, the current matching due to mismatched interconnect resistance at load is \$I_{R1}/I_{R2}=R_2/R_1\$ so adding 10m\$\Omega\$ to the interconnect in this way should drown out the influence of standard interconnect resistance.
simulate this circuit – Schematic created using CircuitLab
|
H: Limiting current draw on a camera battery charger
I have a camera battery charger which is driven from a 12V (measured 12.2) switched mode wall wart rated at 1A. All three items (charger circuit, wall wart and battery) are stock, but all three heat up pretty quickly, which got me worried. The items work - the battery gets charged - but all items, especially the wall wart, are very hot in the end. I measured the current through the wall wart cable to be 1.5A. Now how should I go about limiting it?
I thought about adding a 4 ohm resistor in series with the wall wart supply, as I calculated would be adequate. I also thought about adding a few diodes in series to drop the voltage, but I was worried, it might interfere with the internal circuitry of charger (there's a couple of ICs and inductors and what not in there, too complicated for a beginner like me to reverse engineer).
Or would I need an active current limiting circuit?
AI: Many chargers use a fancy charging method called pulsed or burp charging:
(from http://www.mpoweruk.com/chargers.htm)
A high current is used to charge for a certain pulse length, and after, the battery receives a short discharge pulse. Effectively, this increases the charge speed, however, this method depends on certain calculations for the optimal voltage and current to charge with.
If you change the input current and voltage of the charger, you can't expect this to work properly anymore, which may harm the battery and/or increase the charge time.
Therefore, it would be the best not to use these devices together, but to get a power supply rated for 1.5A.
However, if you bought these items together, there's (almost) nothing to worry about. Many devices get hot during normal use (especially wall warts). And if it booms, you have your warranty.
|
H: Soldering my own CUL sender/receiver
I have been thinking of starting a new home project: I want to automatize some stuff at my home, starting with the heating. To do this I looked at the FHEM project. All looks pretty good and interesting, but I realized quite early that I needed a small device to send and receive radio signals to all the devices of the house that I want to install.
The website suggested to get this one, but looking at the price it looked quite exagerated (plus the website does not look very reliable). Looking around on the internet I saw this other item. I am not very skilled when it comes to electrical things, but I could swear it is the exact same thing (Am I wrong??). the only difference I notice is that it does not have the USB jack solderer in. Fortunately I know someone that knows how to solder this kind of stuff. He agreed to help me with the project, but he told me he would need the schematics to figure out how to weld it.
Could someone please help me find those schematics, since I have no idea where to look for them?
AI: Those modules are similar in that they are both RF transceivers, but the second one (the CC1101 module) doesn't have the necessary capabilities built in to be able to 'talk USB' which the first one has.
Its not just a 'missing USB connector' and would need a bit more added on to be able to plug into a PC.
And just for future reference - welding vs soldering: http://www.explainthatstuff.com/weldingsoldering.html
;)
|
H: PIC32 How do I find group number for peripheral
From my last question I made a mistake on thinking SCK was under PPS control. I see that now but I still don't understand how to figure out group number for a function with PPS by reading the datasheet.
Let's say I want to bring out MOSI, or I think that's SDO2 in PIC land. On my board it's connected to Pin 22, SDO2_RPB11. And I'm still using a PIC32MX210F016B.
Using their macro: PPSOutput(2, RPA1, SDO1);
I have to specify a group as the first input, then pin, then function. For some reason I'm not seeing where the datasheet specifies what group to use.
I'm guessing by reading the pps.h header that it's something like this:
PPSOutput(2, RPB11, SDO2);
I'm not sure though that does compile.
AI: In my opinion that 'Group Number' parameter is pretty poorly documented.
How I've figured it out is to look at the PPS Pin Selection table for either inputs or outputs (tables 11-1 & 11-2 in your datasheet).
Then, for inputs find the input function or for outputs find the pin you're interested in from the left-most column and then look over to the right-most column of the table.
You'll see they're 'grouped' - so for example:
- INT4, T2CK, IC4, SS1, REFCLKI are all in Group 1
- INT3, T3CK, IC3, U1CTS, U2RX, SDI1 are in Group 2
- etc ...
|
H: PIC Microstick vs Pickit
I am starting new in using PIC MCUs and am slightly confused by these two available options.
Pickit is a programmer/debugger, that's what they say. Now, there is this something called Microstick which is a ready-made development board with an inbuilt programmer/debugger. Microstick seems to me to be like an Arduino for PICs. Furthermore, Microstick is almost half the price of Pickit.
Now, the question is that why would one buy Pickit if Microstick can already do what Pickit can? I mean Pickit is just a programmer while Microstick seems to me to be not only a programmer but also a quick-start development board.
Am I missing something here?
AI: There are, at the moment, 4 different flavors of Microstick boards:
Microstick for 3V PIC24F K-series. Supported parts: PIC24F16KL402, PIC24F16KA102, PIC24F08KL302, PIC24F08KL402, PIC24F08KA102, PIC24F16KA302, PIC24F32KA302
Microstick for 5V PIC24F K-Series. Supported parts: PIC24FV16KM202, PIC24FV08KM202, PIC24FV16KM102, PIC24FV08KM102, PIC24FV32KA302, PIC24FV16KA302
Microstick for dsPIC33F and PIC24H Development Board. Supported parts: dsPIC33FJ64MC802, dsPIC33FJ128MC802, PIC24HJ64GP502, PIC24HJ128GP502
Microstick II. Supported parts: all 3.3V PIC24FJ, PIC24E, PIC24H, dsPIC33, and PIC32 28-pin SPDIP packaged devices
The Microstick boards are development boards which also have an integrated programmer/debugger that only works with the microcontrollers that they support. If you go this way, I suggest you buy the Microstick II dev board (@ $35) as it supports the most microcontrollers. And no, the Microstick boards have nothing in common with the Arduino boards.
The PICkit 3 programmer/debugger supports all the available Microchip microcontrollers to date. And it's under $50. A great investment if you're planning on working with different families of PIC microcontrollers. Note also that the Microstick boards don't support any of the 8-bit PICs.
|
H: Can I use this power supply?
This may (and probably will) sound very silly, but I rather ask first than destroy my childhood memories - I found my old sega mega drive at my parents home, but it had no psu. I knew I had some psu's laying around at home so I found one that supplies 5V2A, but the console requires 10V1A.
I guess I should get an universal psu somewhere, but maybe, by some chance, the one I got at home won't burn my console and will actually work?
Thanks.
AI: As Bitsmack says, you need a power supply that can produce the same voltage and at least as much current. The most reliable way to get one is to buy an old Sega AC adapter off of eBay. Sega Retro has a page listing the adapters that work with various Sega consoles.
|
H: Circuit for a coarse and fine setting potentiometer?
I've tried to find a circuit for a coarse and fine adjustment (two potentiometers) voltage divider, but I don't understand it and/or they don't have a linear response.
Problem: I want to have an adjustable voltage from 0 - 5V using two potentiometers, one for coarse adjustment and the other for fine (10mV if possible) adjustment.
From the datasheets I've looked at (e.g. this) they don't seem to specify the resolution of increments possible of the pot.
Here are three circuits I currently have:
The third circuit's fine adjustment decreases as the coarse adjustment is set higher, so I don't think this is a good idea (unless a logarithm pot is used... no idea how those work yet).
Since the first and second are very similar, I'll consider the first one.
I assumed a 5 degree resolution out of 300 degrees, since I could not find any information regarding this.
This gives me:
0.83kOhm / adjustment with the 50K pot, and a 166mV resolution
0.167kOhm / adjustment with the 10K pot
The equation I obtain is:
$$
V_{out} = \frac{R_{course} + R_{fine}}{50 + R_{fine}} V_{in}
$$
Plotting this in matlab for 0V course adjustment, I get the following curve:
At the lower end of the pot, there is a resolution of 33mV and at the higher end of the pot there is a resolution of 24.7mV.
For my application, this is adequate. However I'm unsure if there is a better (and linear) approach to a fine and course adjustment.
AI: This is better..
simulate this circuit – Schematic created using CircuitLab
Advantages are:
Low sensitivity to pot tolerance and tempco (you can use precision
resistors for R2/R3)
Quite linear and almost constant fine adjustment range in mV
Quite constant (+/-0.5%) and predictable output impedance (minimum 9.09K maximum 9.195)
Low sensitivity to CRV (contact resistance variation) of pots (1% CRV in R1 results in 0.05% variation).
This circuit draws 20mA or so from the 5V rail. If that's an issue you can increase R4 10:1, increase both R4 and R1 by another 10:1 at the expense of a bit of performance or scale all the value at the expense of output impedance.
Your circuit #1 has an output impedance of 0 ohms to 27.5K, depending on the pot settings.
Fine and coarse only takes you so far, you could also consider a switched voltage divider for the "coarse" adjustment. Expecting the "coarse" adjust to stay stable within 0.2% may be too much to ask unless it's a very nice potentiometer.
Note that your conductive plastic pot does not specify a temperature coefficient at all- that's because conductive plastic pots are generally horrible- maybe +/-1000ppm/°C typically, so using them as a rheostat rather than a voltage divider is not such a great idea. You've got that reduced by 5:1 by the ratios of the pots, but it's still pretty bad. The circuit I presented would typically be about 5x better with decent resistors for R2/R3 because the pots are used purely as voltage dividers.
Edit: as a good approximation for R4 << R3 and R1 << R2 (you can do the exact math in Matlab taking the pot resistances into account if you like), the output voltage is:
\$ V_{OUT} = 5.0 (\frac {\alpha \cdot 9.09K}{10K} + \frac {\beta \cdot 9.09K}{100K}) \$
Where 0\$\le \alpha\le 1\$ is the position of R1
and 0\$\le \beta \le 1\$ is the position of R4
So the range of R1 is 4.545V and the range of R4 is 0.4545V. If you center both pots you get 2.500V. If you can set R4 to 1% of full scale (reasonable), that's 4.5mV resolution.
|
H: SPI Clock Frequency changes when level shifted
I'm using Adafruit's TXB0108 bi-directional 8 channel level shifter with my Arduino Uno. The SPI clock from Pin 13 is level-shifted through the first channel of the level shifter. Measured with my multimeter, the frequency of Pin 13 is 3.439Mhz. However the measurement of the output of the level shifter is 245 (+/- 10) Khz. And I have no idea why! I checked the datasheet of the level shifter, and I think it should be good to 10 Mhz.
Running the following code the following:
#include <SPI.h>
void setup()
{
pinMode(13, OUTPUT);
digitalWrite(13, HIGH);
SPI.begin();
SPI.setClockDivider(SPI_CLOCK_DIV2);
}
void loop()
{
byte pot = B0;
SPI.transfer(pot); // Do SPI transfer of variable pot
}
AI: Make the frequency measurement on a scope. It is probable that the waveform coming out of the level shifter is being misinterpreted by the meter. It is possible that this is just due to the different voltage, but it could also be distorted or rounded off. And a saelae logic analyzer may not provide enough information if the signal is distorted in some way, you will likely need an actual DSO with a decent analog bandwidth (bandwidth of 1/2 clock frequency is the absolute minimum required to get the state (1 vs 0) but not the shape, bandwidth of 10x clock frequency will give you a very good idea about the shape).
|
H: Serial Servo Control using PIC
I am trying to make a serial servo controller using pic18f4550 microcontroller.
following if the complete code that i've tried..
please note that i'm currently sending 8bit hex to control only one servo.
i'm sending this data from one pic to another..
#define FREQ 20000000
#define baud 9600
#define spbrg_value (((FREQ/64)/baud)-1)
unsigned char rx_data(void);
void tx_data(unsigned char);
void main()
{
int i;
double state;
int ip1=0;
SPBRG=spbrg_value; // Fill the SPBRG register to set the Baud Rate
RCSTA.SPEN=1; // To activate Serial port (TX and RX pins)
TXSTA.TXEN=1; // To enable transmission
RCSTA.CREN=1; // To enable continuous reception
TRISB.RB0=0;
while(1)
{
ip1=rx_data(); // Receive data from PC
//this part doesn't gets executed!!
state=max((ip1/4)+1,12);
LATB.LATB0=1;
for (i=0;i<state;i++)
delay_us(10);
LATB.LATB0=0;
for (i=0;i<200-state;i++)
delay_us(1);
}
}
void tx_data(unsigned char data1)
{
TXREG=data1; // Store data in Transmit register
while(PIR1.TXIF==0); // Wait until TXIF gets low
}
unsigned char rx_data(void)
{
while(PIR1.RCIF==0); // Wait until RCIF gets low
return RCREG; // Retrieve data from reception register
}
i've made sure that proper data is being sent by the master pic by hooking up to the PC's serial port and observe output..
as stated in code the part after ip1=rx_data(); doesn't gets executed.
i've also confirmed by commenting out the ip1=rx_data(); part and then replacing ip1 variable with an int value... then the servo moves to the proper position according to the value instead of ip1(which ranges from 0 to 255).
any help?
UPDATE:
with the suggestions given in the answers i've cross checked the following.
1.Both PICs running on 20mhz so frequency is correct.
2.serial data format is correct. i am receiving the proper data to the PC.
3.Wiring checked.
4.decoupling( plz explain how to do proper decoupling).
5.power supply. ( both running of a 5v 1 amp wall chargers).
so the most probable problem (other than the software) may be the improper decoupling. can anyone explain this to me?
AI: Firstly, Your code is blocking. That's not the way to wait for serial data. You will have to monitor the RX interrupt flag from the main loop and if set do the ip1=rx_data(); to get the data. In your case, if your wiring of the UART pins are wrong or there is no data from the master MCU, the line while(PIR1.RCIF==0); is an infinite loop. That explains why the rest of your code doesn't work.
Second thing I noticed is that you are giving the servo only one pulse per control signal. Most hobby RC servo motors expect at least 3 such pulses to reliably position the horn.
|
H: Is interfacing the 5V TTL UART with 3.3V microcontroller via voltage divider possible?
I need to connect my MSP430 microcontroller (3.3V) to interact with a 5V TTL UART camera (http://www.cn-lcf.net/sdp/561974/4/pd-2909996/7575433-2127043/LCF-23M_OV528_Protocol_RS232_Camera_Module.html).
In order to do that I came up with the idea of dropping the camera's TX port from 5V to 3.3V level by a voltage divider.
The MCU TX to camera RX does not need a voltage divider and since it's a TTL camera the 3.3V from the MCU shall be enough to drive the camera's input high (https://dlnmh9ip6v2uc.cloudfront.net/assets/6/d/7/7/4/515385fdce395f0905000000.png).
Will that work?
AI: This is quite commonly done but keep resistances low so that there is little chance the rise times and fall times of the data signal are not unduly lengthened. As PeterJ says in his comment, something around 1k will be OK.
There are devices that you can buy that do this (8 bit wide and bi-directional) but if you only have one signal to modify then resistors are the best choice.
|
H: Using 25 IR LEDs with Raspberry Pi and Transistor
Using a Raspberry Pi and 5V I want to use 25 IR LEDs (5mm LED, 940nm wavelength, 20 degree beam width, 100 mA continuous, 1000 mA pulse, Approx 1.6V forward voltage; http://www.exp-tech.de/super-bright-5mm-ir-led-25-pack) in parallel using 8 pairs of 3 LEDs each pair with a 2 ohm resistor and one single LED with a 36 ohm resistor.
This tutorial is my basis:
https://www.sparkfun.com/news/1396
You can see that in this tutorial a npn transistor is used with a resistor R6 of 330 ohm.
I've ordered this PN2222 transistor (http://www.exp-tech.de/npn-bipolar-transistors-pn2222-10-pack).
My question is, once I have all LEDs and their resistors (2 and 36 ohm) in place, how would I need to install the transistor(s) and how would I calculate the R6 resistor for my example?
Update 1:
Here is the LED datahseet: http://www.adafruit.com/datasheets/IR333_A_datasheet.pdf
They are just turning on/off all at once.
For my project I would need to get enough IR light in order to brighten up a whole room of 15 and up to 35 square meters, if less LEDs will produce enough IR light, I'm happy with it.
For video recording a Raspberry Pi NoIR Camera will be used.
The system will be time-controlled, the LEDs are supposed to run probably 4-5 hours for each time-frame.
@KyranF: You're right that I was not aware fo this as this is acutally my first project including more than one LED.
Here is a first try to visualize the solution.
Does this setup with the mentioned LEDs and a MOSFET sense?
Do you think 14 LEDs of this kind would be enough in order to brighten up a whole room?
Update 2:
This is my current set-up, which seems to be wrong as well.
I'm not getting the IR LEDs to lighten up.
Important hint: I'm using 33 ohm resistors for the LEDs as the LEDs I've finally bought are using 50mA instead of 100mA as the ones listed before. Here is the new Datasheet
My Python code looks like this:
import RPi.GPIO as GPIO ## Import GPIO library
import time ## Import 'time' library. Allows us to use 'sleep'
GPIO.setmode(GPIO.BOARD) ## Use board pin numbering
GPIO.setup(7, GPIO.OUT) ## Setup GPIO 4 Pin 7 to OUT
GPIO.output(7,True) ## Turn on GPIO 4 pin 7
time.sleep(5)## Wait
GPIO.output(7,False)## Switch off pin 7
The wiring looks like this:
Here is an overview of the GPIO setup:
AI: I suggest you get a better current rated transistor, or even a good old MOSFET (much better, you don't have enough voltage headroom to use the transistor properly anyway.. who knows how the sparkfun guy got stuff to work at all). For what you want to do, get a 2-3A rated MOSFET, or at the very least a 1.5A+ rated NPN transistor.
It is not a good idea to operate 3 LEDs at 1.6-1.8V on 5V, and expect a 2Ohm resistor to regulate current properly. The variation in forward voltage is too much, and having such a small resistance (also with poor tolerance) you will not get very good results.
I suggest you use 2 LEDs in series on each chain, and use a larger resistor. To get 100mA out of 1.4V spare (3.6V out of 5V is taken up by 2 LED in series) you need about 14 Ohms, which is surely better than 2 in terms of leeway for tolerance. The other thing is, both 2 and 14 ohms are unusual/non standard values, you might need to find a nearest standard value. Also remember your LEDs should only be on for the picture, for a short period of time, so it's not actually that bad if your LEDs run slightly over-current.
The LEDs used by the Sparkfun tutorial are 1.6-1.8V x 10mA, meaning they are only really 18mW each, and there are 13 LEDs. That is 13 x 18mW = 234mW total of IR light. You are trying to do 25 LEDs at 1.6-1.8V x 100mA, meaning your IR light output will be a ridiculous 4.5 Watts. Do you really want x20 more IR light than the tutorial guy had? I don't think you really thought about any of this..
The basics for calculating R6 in your case is if you do end up using a NPN transistor, the base current into the transistor is determines how much current flows through it. Your LEDs do the current limiting, so there is no real reason to even use a transistor (which effectively act as current-amplifying switches). The correct component for this digital on/off functionality is an N Channel MOSFET. Both should have a base/gate resistor though, but the MOSFET one is almost not needed, rather it's recommended. It can be something simple like 100 Ohms.
The base resistor for a transistor allows you to control current through the collector-emitter using the DC current gain/beta factor of the transistor, usually shown on the datasheet. If you have a gain of 100, it means 1ma into the base will allow 100mA through the emitter-collector. Problem is, as the base current approaches saturation, the current gain drops dramatically until it is quite low, like 10 or so. This is different for each transistor however. If you put 40mA into the base, it will probably saturate, causing the transistor to act more like a switch with minimal forward voltage drop, which is what you would want to happen in this LED driving application.
UPDATE: based on the feedback from OP, I have provided the below diagram to show the correct way to hook up the IR LEDs, with a low-side NFET power switch. Note the FET should have a "logic level" gate drive voltage, around 2V threshold should be good for 3.3V control. The FET should also be rated for 3+ Amps. I believe it was worked out to be about 800-900mA continuous, for 4-5 hours in this user-case scenario.
simulate this circuit – Schematic created using CircuitLab
|
H: Improving RF sensitivity
I'm trying to improve the range on my 433 MHz radios that are using the CC430F5137.
Based on 25.3.3 in http://www.ti.com/lit/ug/slau259e/slau259e.pdf, it seems like decreasing the RX filter BW can improve radio sensitivity. I looked over TI's DN005, DN015 but I didn't see an explanation why this was the case. Common sense tells me that if you're listening over a larger spectrum, the radio has less time to distinguish between signal and noise. But that's not a satisfactory scientific answer, is it?
Based on (3) in http://www.ti.com/lit/ug/slau259e/slau259e.pdf, decreasing the baud rate helps radio sensitivity as well. Again, this makes sense since there is more time for each 0 and 1 to transmit over the air. Is there any scientific explanation for this as well?
I guess the other question is if the baud rate is related to the RX filter BW. Or are they completely orthogonal concepts?
AI: Common sense tells me that if you're listening over a larger spectrum,
the radio has less time to distinguish between signal and noise. But
that's not a satisfactory scientific answer, is it?
Your common sense is flawless. A generally accepted formula for receive sensitivity is: -
Sensitivity = -154dBm + 10\$log_{10}\$(data rate)
So, at 1Mbps the receiver's best sensitivity is -94dBm. For 1kbps this becomes -124dBm.
There are several factors that go into this including temperature of receiver but at or around ambient this formula is pretty useful. Temperature produces noise and background thermal noise is ultimately what you are fighting against (plus interference from other transmissions).
If you want more theory, then the essentials of radio wave propagation is the best source I've come across. See page 14.
To make use of the higher sensitivity, a receiver's bandwidth has to shrink to suit the smaller bandwidth of a lower baud rate transmission.
|
H: What are the differences between mini, sub-mini, and ultra-mini switches
Apologies if this isn't the appropriate SE for this question. If not, any pointers to a more appropriate place would be appreciated.
I'm looking to swap out some toggle switches on a R/C controller. I'd like to be able to shop online for the new switches and look at a variety of styles, but I'm confused about the keywords I should use when specifying the size. The switches are the thru-hole panel mount type with with bushing and nut to fasten them.
When looking online some sources don't specify the bushing size, they just specify "miniature", "sub-miniature" or "ultra-miniature" toggle switches. I haven't been able to easily figure out how these classes of switches differ.
I measured a roughly 1/4" hole in my controller, and I've seen a miniature switch say it has a 1/4" bushing, but then a sub-mini switch spec showed a .240" bushing. This seems like such a small difference I'm not sure if that's actually the difference between "mini" and "sub-mini".
So, what do these terms indicate?
AI: Names like "mini" and "sub-mini" are marketing terms with no engineering definition. They go all the way back to the days of valves (vacuum tubes), when anything smaller than the "typical" size was called "miniature". Then people wanted smaller still, hence "sub-miniature", and so on. The terms seem to have lost their meaning over the years, especially now that we have surface-mount parts.
|
H: How to read a push-pull output
I recently came across a sensor that had a "push-pull" output. I can't find anywhere how to read such an output:
Is it some particular kind of analog output?
I would want to read it with the MSP430G2553 (using energia or code composer).
AI: Just connect it - and only it - to the MSP device pin.
A "push pull" output is one that can't be shared with other outputs (to save I/O pins) and doesn't need a pull-up or pull-down resistor. Which makes it the easiest sort to use.
An "open collector" (or "open drain") output can only pull the voltage down to 0V, but not up to +V. This means it can be connected to other outputs of the same type without damage, but needs a "pull up" resistor to signal '1' when it is turned off. (The MSP430 has these pullups built in, there is a special register to turn them on or off)
|
H: DC/DC converter/eFuse maximum output capacitance
I have some doubts about the design of this DC/DC converter circuit/PCB circuit:
On the left side there is a 400V to 12V DC/DC converter (Vicorpower DC/DC Mini, 300W). The maximum output capacitance of the converter is calculated with 833.3µF. (Datasheet: "The capacitance value is not the absolute maximum value, but the value for which general application of the converter can be deemed appropriate. Testing will be required to ensure that the module is stable if this value is exceeded. Approximately 10X the value calculated will cause the converter to go into current limit at turn-on.")
On the 12V output side of the converter there are several PCBs. Each of them has some DC/DC converters and some capacitors at different voltage levels. Also, each PCB has an eFuse of the type TI TPS2592AL (programmable SoftStart control). The DC/DC converters on the right hand PCBs are of the type TI TPS6213X (buck converter, programmable Soft Start).
Now I have two questions about this case:
The Vicorpower DC/DC converter has a maximum output capacitance of 833.3µF. Does this only mean I have to add the capacitor values on the 12 V line in front of the eFuse? Or do I also have to add the capacitor values on the 5V/3.3V line of the PCBs for the total output capacitance?
For the circuit calculation of the eFuses I have to figure out the "Load capacitance" of the eFuses. Similar question: Do the capacitors behind all DC/DC converters count? Or just on the 12V line?
Thanks!
AI: Add the recommended ~830uF capacitance as close as you can, on the output of the Vicor power module. Make sure the ESR and ripple current ratings etc are all correct. Make sure the type of capacitor (Electrolytic, Cermaic, Tantalum etc.) chosen is correct and has the correct ratings and ESR as mentioned before.
Add smallish 47 or 100uF capacitors on the inputs of each of these separate PCB which are the 12->5V Buck converters. The datasheet for the converters will say what they want as input capacitance, otherwise as I said go for some kind of local supply. This will prevent current-lag related voltage sag/ripple when the 5V output goes under load, yet the 12V input has no power supply decoupling available.
The load capacitance will be the capacitors you put after the efuses, because remember a discharged cap acts almost like a short circuit during power-up stage, so that will greatly affect the way the efuse works for "soft start" operations.
Therefore if you put a 100uF cap after the efuse, just before the 12->5V DC/DC converter, then use 100uF as the load capacitance for the efuse calcs.
|
H: How to switch between two input lines based on a digital pulse
How can I switch between two inputs based on a digital signal. I would like to have the Input 1 connected to the Output for the duration of the pulse and Input 2 connected to Output when the signal goes low.
AI: You can do this with 2 ICs and no MCU. I'm assuming you have 3.3 volts available for power, but 3 volts will work. You can use a 74HC4538 monostable multivibrator to detect your 1 MHz, and a 74HC157 to select your data. See http://www.nxp.com/documents/data_sheet/74HC_HCT4538.pdf for the 74HC4538. A schematic looks like
simulate this circuit – Schematic created using CircuitLab
Please note that each IC has a bunch of unused inputs which you will need to tie to ground.
It works like this: every rising edge at the 1B input will cause 1Q to go high and stay there for 40 usec (0.7 x R x C = 0.7 x 56 x 1000 x 1 x 1000 psec). Since U1 is a retriggerable monostable, each succeeding edge will start the 40 usec period again without causing a glitch in the output. 40 usec after the last edge of the input, Q will return low. The high on the select line of U2 will cause signal B to be connected to the output during the burst. When SEL is low, signal A will be selected. Note that, unlike a 4066, the connection is not bidirectional. The selected input drives the output and not the other way, as with an analog gate. The turn-on delay from the first edge will be about 150 nsec for 3.3 volt operation.
Using a 5 volt supply will be a problem, since the input levels will be too low, but you can get away with using a 74HCT4538 and 74HCT157 in that case, although then the 157 outputs will try to drive to +5 as well.
If it's not obvious, you can select up to 4 pairs of signals with one 74HC157, although there is only a single select line for the entire chip.
ETA - when I did the schematic and above explanation I completely forgot that you had specified an analog gate. Doh!. Well, the 4538 part will still work just fine, and the output will drive a 4066. However, you should also be aware that a CD4066 http://www.ti.com/lit/ds/symlink/cd4066b.pdf is only characterized for operation at 5, 10 and 15 volts. It will operate at 3.3, but see Fig 5, which suggests that the on-resistance at 3 volt operation will be somewhere in the vicinity of 1k (or more, maybe - it's just not specified.)
|
H: Is it possible to connect more than one device on the same SPI?
Is it possible for someone to connect multiple sensors to the same microcontroller's SPI or I2C port?
If it's possible, how would someone alternate between devices?
AI: SPI:
The master can work with slaves in two modes: with independent slaves or cooperative slaves.
With independent slaves I just need to select them with the uC's I/O
pins.
With cooperative slaves I need to "daisy-chain" them (I
won't be using this).
I2C:
It has a 2 line bus (clock and data) and I just need to connect them to Vdd and the master and slave devices.
|
H: Do MOSFETs have voltage drop across source and drain when turned on?
Like diode and BJT having around 0.6V drop, is there any voltage drop across the MOSFET drain and source when the MOSFET is turned on? In the datasheet, they mention diode forward voltage drop, but I assume that it for the body diode only.
AI: The MOSFET behaves like a resistor when switched ON (i.e. when Vgs is large enough; check the data sheet). Look in the data sheet for the value of this resistor. It's called Rds(on). It may be a very small resistance, much less than an Ohm. Once you know the resistance, you can calculate the voltage drop, based on the current flowing.
|
H: is CFM additive?
I currently have a heatsink with 1 (loudish) 1000-1500 CFM fan.
If I was to put 2 quieter 500-750 CFM fans on either side of the heat sink, would they effectively push the same amount of air? It is a vertical heatsink.
current flow is -->||
was thinking dual flow to be --->||<---
AI: When a fan moves air from one side to the other, this will reduce the pressure on the upstream side and increase the pressure on the downstream side. How much the pressure is affected will depend upon whether the fan is operating in totally free air, or has to move air through ducts, around obstacles, etc. A fan which can move 100cfm with a certain pressure differential across it will generally be able to move more air when the pressure differential is smaller, and less air when the pressure differential is larger, though this effect will be much more significant with some fans than with others.
If one places two fans on either side of a heat sink such that one fan pushes air into the heat sink and the other draws air out, both fans will move the same amount of air, and that amount of air will equal the amount of air moving through the heat sink. The upstream fan will increase the pressure of the air feeding into the downstream fan (thus reducing the pressure differential across it); the downstream fan will reduce the pressure of the air on the downstream side of the upstream fan (thus reducing the pressure differential across it). The fact that each fan will have a lower pressure differential across it than would be the case in the absence of the other will enable the fans to move more air together than they would individually, though how much more would depend upon the design of the fans and the ducting or obstacles between them.
If one places two fans so that both try to draw air out of a heat sink, creating a partial vacuum, and lets air flow in naturally to fill that vacuum, the amount of air that flows will be such that the total air flow through the two fans equals the total air flowing into the heat sink from outside. Drawing a deeper vacuum will cause air to flow in faster, but will also increase the pressure differential seen by the fans. Having two fans would draw a deeper vacuum than having one, but each fan would move less air than it would if operating individually.
Most likely, having two fans would increase the total volume of airflow significantly, but would not double it. On the other hand, without knowing the exact conditions under which fans are rated it may be hard to judge whether two smaller fans will move more or less air than a single larger fan (whose CFM rating may have been measured differently).
|
H: What is the name of a component that combines a switch with a variable resistor?
I had some lights with a rotating switch that would turn them on/off, and then continuing to turn the switch would make them brighter. What sort of switch is this called? (it had a physical "click" to it between switching on and off).
AI: It's just a variable resistor with a switch. It doesn't have a specific name to distinguish it from variable resistors without a switch.
|
H: Using PIC32 Flash for storage
Continuing along on my PIC32 adventure, and using my PIC32MX210F016B. I have some configuration data for another IC that I have to program over SPI. I want to store that confurgation data, about 2K in the PIC flash. I'm not to clear how to do that though. I was trying to find some documentation or example about it.
In TI land for an MSP430 I remember I had to specify the flash page I was going to use in the memory map and then CC studio kept erasing it every time I reloaded code.
I feel like since this is static maybe I can declare it in my code, I just don't want it to end up trying to take up 2k of ram.
Any advice or references on the best way to accomplish this?
AI: You can declare your data in your code using the 'const' storage class to tell the compiler to place the variable in flash instead of RAM.
So something like:
const char array_of_stuff[2048] = {0, 1, 2, 3, 4, 5, ... , 2047};
or even
const struct {
int thing0,
thing1;
char smaller_thing,
lots_of_little_things[512];
etc ...
} interesting_stuff = {
123,
456,
'p',
{'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', .... },
etc ...
};
or, if your data is stored in something like an external .csv file
const char my_data[2048] = {
#include "my_data.csv"
};
Leaving out the 'const' keyword might at first seem to produce the same effect, but in fact what you'll have is a big area of initialised RAM which the compiler will arrange to have populated with all of your stuff at startup instead of locating your variable(s) in flash 'directly'.
|
H: Charging li-ion batteries with protection circuit
If i'm using a protection circuit like this one:
http://www.batteryspace.com/pcbfor148vli-ionbatterypack5alimitwithfuelguagesocket.aspx
and 4, 3.7v li-ion batteries.
Can I use a simple 16.8v dc wall wart to charge them?
or do I still need a special li-ion battery charger, and if so what is the purpose of the circuit?
AI: That board doesn't provide any recharge facilities, so yes you should still use a proper Li-Ion charger with it.
The purpose of that board is to protect the batteries in case of "error".
It will:
Shut off the batteries when their voltage gets too low.
Shut off the batteries if the current draw exceeds 4-6A (short circuit).
Provide an estimation of the charge left in the batteries ("fuel gauge")
Prevent "over-charging" of the batteries (too high a voltage placed across them)
Two of those (over voltage / short circuit) could cause the batteries to explode, the under-voltage can cause the batteries to become useless and unable to be charged.
|
H: How can the value of a resistor be measured if it goes straight to ground?
I'm looking to integrate a LiPo charging circuit into my PCB, and found the MCP7831 IC. It's got a PROG pin, that allows you to change the behavior of the IC by use specific resistor values between that pin and ground.
But I'm wondering how it knows the value of the resistor?
I would think to know the value of the resistor your + voltage is applied to one side, and the other goes to an input pin of an IC that measures the lowered voltage. But if it connects straight to ground, how does the value get measured?
AI: Have a look at the datasheet - it's shown explicitly:
In normal (not precondition) charging, a constant voltage of 1.00 volt is maintained on the PROG pin by closed loop control through the op-amps (the 1.22 V reference is divided down). The resistor connected from the PROG pin to Vss causes a current to flow of 1.00V/R. In the example, a current of 0.5mA will flow through the 2K resistor (Ohm's law).
That current is reflected in the current mirror with a 1000:1 ratio, so 500mA will flow through the battery. There's a few details beyond this, but I think this covers the question.
|
H: PIC MCUs C language Compilers and IDE for PIC16F and PIC18F
I want to write some program in C language for a PIC16F and a PIC18F. I searched in the internet and I got confused with the name of them! I want a free version and I know that my C program is less than 2 KB. Does MPLAB lonely enough? Or I need to install C16? C18? Which one I must install? Can I install both in a single computer?
I found four kind of MPLAB C18 Compiler here.I don't know which one should I use and what is the difference?
Is there any other free software that is better for a beginner? and also be good for biggish project?
And finally what is the difference between MPLAB IDE and MPLAB X IDE and these different CXs (C18 C24 ...)?
Finally please give me a full view about the advantages and disadvantages of different PIC compilers.
And give me a good tutorial source about installation steps and the steps to build a simple flashing LED with PICs for step one to getting started with this kind of MCUs.
Note that I am familiar with AVRs and I worked with them about 1 year.
AI: I've personally found in my limited experience of PIC programming, that the Microchip MPLABX IDE and the XC compilers had all the functionality that I needed. As far as I am aware, the only pitfalls I found were that the free version doesn't allow high compiler optimization of your code, but I didn't find it impacted negatively on what I was doing.
I haven't tried any "free" PIC alternatives, but knowing the amount of pain I went through trying to set up a GCC for GNU compiler in Eclipse, I can say that MPLAB X is an absolute breeze to pick up for beginners.
NOTE: Microchip don't make it obvious, but the C18 compiler you linked is actually an older generation. The XC suite being the new one.
For you, I would recommend getting the MPLAB X IDE and then installing the MPLAB XC8 compiler, which supports PIC12, 16 and 18. (Check under the Downloads button)
I have only the XC16 compiler installed currently, but when I run MPLAB X IDE and click New Project and select a PIC18 as the device, it asks me for a toolchain to work with like so (I'm given a choice between C18 and the XC8 all-in-one, though some PIC16's are only supported by XC8):
Once you have installed the XC8 and the X IDE, in it, you can just click File > New Project, and then under Samples you will find a C template and example "blinky" code for all the targets.
You will also need a picKit for programming or debugging your code on your target.
Don't hesitate to comment if I haven't explained something properly :)
|
H: MHz oscillator probe impedance?
I find something weird going on in my 100MHz oscillator probe.
I always thought the probe has a resistance of 1M ohm, but apparently at 13MHz, when I put a 2.2k ohm resistor in series with the probe, the reading is severely reduced. Does this mean that the oscillator probe is actually something around 50 ohm or so? But that would be impossible because 50ohm connected to the circuit would alter it's operating point too much.
AI: The capacitance of the probe, combined with your 2.2k resistor, create a low pass filter. Can you please report what is the probe capacitance? It may be marked on the probe. If the capacitance is 20pF, for example, then the cutoff frequency would be around 3.6 MHz. This means that a 13 MHz signal will be attenuated quite a bit.
If you want to test the probe resistance, you should measure the amplitude of a DC source, then put a 1M resistor in series and measure again. If the probe resistance is 1M, then the amplitude will be half with the 1 MHz resistor in series.
Noted that your oscilloscope is labeled as 13 pF. Brian Drummond added this in the comment section, and I am including it in the answer:
That 13pf may be the scope itself ... add 30pf or so for the probe and its cable. So the probe loads (attenuates) the signal even more than that. Plus, if you're probing a tuned circuit, the effect will be even greater because you're detuning it... For 13MHz you NEED a 10x probe. The 10:1 attenuator is right at the pin, and keeps the loading capacitance down to maybe 3-4 pf (see probe spec).
|
H: Is current with a frequency less than 1 Hz still considered DC?
We had a big argument last night with vague conclusions. Is the current with a frequency less than 1 Hz considered DC?
It would still resemble a wave...
AI: AC and DC are relative terms. If you're looking at a 10kHz waveform for 100ns, you will think it is DC. It works the other way around too: if you forget about what's providing you with "DC", who knows if this waveform is not going to change in the next seconds, minutes, days, years? Think the voltage of a capacitor for example during slow discharge. If you monitor the voltage on an oscilloscope, you'll see a flatline. DC you say? Wait longer, and the flatline will decrease in voltage towards zero, which means there is some AC in there as well.
Besides, no signal is actually pure DC, you always have AC components as well due to noise and all sorts of causes. It is only "DC-enough" or "AC-enough" for the application you're intending to use it with/for.
Fourier transforms are a good way to picture what DC and AC components are in a waveform. The transform is constant for periodic signals and depends on time for any non-periodic signals like the capacitor example. For the square wave: (source: wikipedia)
|
H: How to prevent MPLABX and XC16 from polluting my assembly program on 16-bit PIC24?
I recently started programming PIC microcontrollers after AVR and I wrote a small, do-nothing program just to see what the assembler produces in the HEX file:
;File: main.s
.include "p24FJ64GA202.inc"
.global __reset
.global __INT1Interrupt
.text
__reset:
nop
goto infinite
__INT1Interrupt:
nop
retfie
infinite:
nop
nop
nop
bra infinite
.end
After building and disassembling, I found that the assembler puts these unnecessary blocks in my code, that I did not write:
and
How can I prevent this from happening?
AI: Those routines form part of the crt0, the system initialization routines. They are standard routines. Briefly they:
Erase the empty memory to a default of 0 throughout
Copy the pre-defined data from Flash into RAM
Without those routines the basic C system won't function. They are required for any program written in C.
I know your program isn't written in C, but the whole environment is C. You're using a C compiler, for instance.
Because of that you get the C routines.
You can try adding the linker option -nostartfiles to prevent the inclusion of the crt0. You can also use -nostdlib and -nodefaultlibs to prevent inclusion of standard library functions.
Note that this will completely break compilation of any C files.
Alternatively, you can keep the start files in there and instead of executing your program starting at the reset vector, define a "main" function in assembly which the crt0 will call for you after the system initialization has taken place.
By the way - XC16 is based on GCC 4.5.1.
|
H: find RPM from Pulse of motor
I have an electronic gearbox motor with the following details:
25GA-370-12V -330RPM
I want to find a PID control for this motor in Matlab. I take data from this motor by Arduino Due driver and an Arduino program.
The duration of printing of test is 0.003 sec (per 0.003 sec how many pulse show) and any 800=(2*400) pulse is one round in motor.
So I have some data about time and how many pulses at that time. The motor has both CW and CCW rotation. My problem is how can I find the RPM from the pulse?
I don't know how to change pulse with witch formula.
For example: at the time of 1347544 after start I have 122 pulses but I can't find the way to change it to RPM at this period
i can put my Arduino code for you to know what i say
AI: Regardless of what that "1347544" is about, if the motor shaft rotates 360 degrees per 800 pulses and you've accumulated 122 pulses during the 3 millisecond sampling interval, then the shaft will have rotated 54.9 degrees during that 3 milliseconds, which is 18,300 degrees (50.83 revolutions) per second. Then, since there are 60 seconds in 1 minute, the shaft will have been rotating at 3050 RPM during the 3 millisecond pulse acquisition window.
|
H: Estimate current through inductor in DC circuit with PWM control
I am designing a circuit to control an electromagnet (coil with iron core) through a N-channel MOSFET driven by a PWM signal.
I can't figure out how to derive the relationship between the PWM duty cycle and the current I will get in the coil, and I need to know this as the magnetic field generated is a function of i.
These are the system specs:
DC voltage source: 7.5V
Coil L = 15 mH
Thanks for the help!
Update
Thanks for the feedback so far: of course the resistance is missing, I forgot about that!
At this point, I have the coil with L = 15mH and R = 2.4 Ohm. And no, it's not coursework, just a personal project.
So, the current in the circuit should be i = V/R (1 - e^(-Rt/L)). The steady-state value is therefore i = V/R.
With this in mind, I thought of adjusting this to PWM as follows:
V = Vcc * %pwm (%pwm: duty cycle), therefore I finally have a relationship that links the duty cycle to the current through the coil.
This, however, turns out to be off compared to experimental data I just took: for example, for duty cycle of 20%, I would expect V = 1.5 V and i = 0.625 A.
In reality, however, I measure a voltage around 1.1 V.
What is this due to? I thought it might be linked to the PWM frequency, but it's 3.9kHz, which sounds like more than enough!
Finally, I also made a model in Simulink to try and understand the issue, and these are the plots I'm getting:
Funny thing is, I am getting average current and voltage values much higher than they should be! Besides, why does the voltage plot vary as a "sawtooth" rather than the square PWM signal?
Thanks again!
Update 2
Right, so I think I managed to get my model right now, thank you again for the help everybody!
At this point, I think I have a fairly good model of the relationship between PWM duty cycle and current through coil.
This is my updated Simulink output for a 50% duty cycle:
Thank you again
simulate this circuit – Schematic created using CircuitLab
AI: Ideally, a high-enough-frequency PWM circuit with a perfect switch and catch diode will give you \$ \alpha \$ times the current you'd get with 100% duty cycle (where 0\$ \le \alpha \le 1 \$ is the duty cycle ) . In this case, you've drawn the circuit as having an inductor without resistance, so the current would increase without limit.. So you need to include the DC resistance of the coil in your analysis.
Edit: Something is obviously screwed up with your model. Below is a simulation of startup from zero inductor current with good models of all the parts as you've shown, and 4kHz frequency and 50% duty cycle.
The average current is about 1.428A. The ideal prediction was 50% of 7.5V/2.4 ohms or 1.56A, however there is some loss in the MOSFET and the diode.
Your "experimental" data does not sound too far off, as I said there are losses in the diode and MOSFET (mostly the diode in this case). If you want a more ideal result you could replace the Schottky diode with another MOSFET (drive the coil with a half-bridge).
If the Schottky Vf is 330mV at 0.5A and the MOSFET has 100mV across it when on, then with 20% duty cycle the voltage the R+L will see is +7.4V when on and -0.33V when off, for an average of 0.2 * 7.4 + 0.8 * -0.33 = 1.216V, so the average current will be 0.506A, which is very close to what the simulation shows.
|
H: What is the proper way to preserve solder iron tips?
My question is should you turn off a solder iron to preserve tip when not in use. I am currently working on a project which requires sometimes a lot of soldering and sometimes occasional soldering to reroute wires or just tin wires to use as jumper cables. I work 8 to 12 hours a day and most of the time I am programming but sometimes I need to change things on hardware when I solder. So when I am programming should I turn off the soldering station or should I just leave it on or should I minimize the tempreture to preserve the solder tip?
AI: While the tip is hot, it is oxidizing faster. You should turn it off when not in use, but before it cools, apply some solder to the tip so it forms a cover around it when it cools. That prevents oxidation of the tip while it is cooling down and also when it is off.
|
H: Arduino detects voltage on ground
I've been having a hard time finding a solution to this problem.
I recently ordered a 5 Volt 2Amp AC to DC switching power supply from adafruit.cc
When I connect my Arduino's analog sensor to the ground of my switch mode power supply my Arduino detects that it's oscillating.
I thought the voltage on the ground pin would always be 0 and not oscillate. The power supply on the Arduino does this properly. Why am I having this issue with the switching power supply and is there any way to to make the circuit have a consistent ground?
EDIT: Links to info
http://arduino.cc/en/Tutorial/AnalogInput
https://www.adafruit.com/products/276
I don't know how useful that analog input info will be I'm more of a programmer.
AI: Yes, @SHG is right, and you confirmed my suspicions.
The analog input measures the voltage difference between the arduino ground and some point above arduino ground.
You can only measure relative to the Arduino's ground, not measure some other point in another circuit.
You have to connect the ground of the Arduino to the ground of the remote circuit in order to get any form of meaningful signal. In your case you would basically be measuring the Arduino ground since they would both be connected together.
|
H: Bell Detector with Arduino
I am trying to upgrade our existing bell with my arduino to detect whether the bell is used and to mute the bell.
The circuit for the bell runs with 9V AC. In order to minimize the wiring I want to serially connect something to the bell such that it is possible with my arduino to turn the bell on and off and I can detect whether the bell was used.
I tried to use two relays: one as a switch which can be used by the arduino and one as a switch which will be closed when the bell is used. They were parallel connected. But since I am a beginner nothing worked as intended :)
Is it possible to do this with two relays? Or is there a better way to make it work?
EDIT
Thanks for the answer. The bell isn't earthed. I tried this:
What is wrong with it? :)
AI: Here's your detection circuit:
simulate this circuit – Schematic created using CircuitLab
The output will pulse 4.7V at the same frequency as the source when the bell is being triggered, which is appropriate for a 5V Arduino. Use a different zener diode if your Arduino is running at a different voltage. Note that R1 should be a 1/2W device or higher since 200+mW of power will be dissipated through it.
EDIT:
simulate this circuit
This new schematic connects to an input with the internal pull-up enabled. It will pulse low at half the frequency of the source.
|
H: Interfacing a USB webcam to an Arduino board
I'm trying to connect a USB webcam to an Arduino board (Intel Galileo), the Galileo is powered by a 400 Mhz processor, has 512 Mb of RAM and 8 Gb of external storage (SD Card). I'm a computer science major and electronics is not really my field, what I understood to this point is that if this was a serial connection I would've used the first and second (0 and 1) pins to make the connection (Rx and Tx). Now I understand there is a difference between USB and serial, but USB is somehow serial? Anyhow I've attached both a picture of the camera cable and of the board and would appreciate the most simplified way to make the connection.
Thanks!
AI: Plug the camera into the USB host port.
The Intel Galileo documentation says it has a USB host port, which is labelled 'USB HOST' on the PCB. Plugging a keyboard or mouse into this port (using a standard USB cable) will allow it to be used with the USBHost library, so doing so with a camera should also make the correct electrical connections.
You will then have to use linux and OpenCV to support your camera as in this thread, or search for "intel galileo usb camera" online for other examples.
|
H: LCD Display connection
How to connect this http://docdroid.net/ngqg LCD Display to microcontroller? It is ILI9341 based.
Is it possible to connect only SPI/LED pins and leave every other input pin floating or I need to connect every pin(HSYNC, VSYNC etc.) and control them myself.
Thank you!
AI: That display requires you to send each frame as a frame in its entirety. You need to send the full pixel data for each and every pixel with all the right timing. Kind of like driving a VGA monitor.
While it is possible to do it with a generic microcontroller, that microcontroller must:
Have enough RAM to store the entire frame buffer
Be fast enough to generate the clocks and data streams while still leaving you enough processing time to do what you want to do.
There are specialized microcontrollers that have extra hardware in them to specifically drive this kind of display. The one I have used in the past is the PIC24FJ256DA210.
|
H: Micro audio preamp with low consumption [SOLVED]
The audio output for all of my devices/computers is too small to push my speakers to the maximum.
I want to build a very small audio preamplifier to hook between the computer and speaker to boost the signal a bit. The output should be about 0.5V
Can you suggest some basic schematics that has very low power consumption so I won't have to open the box every week to replace the battery? It is probable that the circuit will be often left (forgot) running over night.
Single power supply (so no 741 ICs)
Small battery (maybe a 12V cylinder)
Low power consumption
AI: For a simple pre-amp you don't need anything as meaty as 12V. You only need as high a voltage (plus a little headroom) as you want to output.
A simple single-stage inverting op-amp circuit with, say, 2x gain, is probably easiest:
simulate this circuit – Schematic created using CircuitLab
U1 is any (ideally Rail-To-Rail) single-supply capable op-amp. There's millions of different ones around, costing just a few pence each.
The gain is set by the ratio of R2 to R1, so 2:1 in this case.
R3 and R4 form a voltage divider to provide a "false ground" to the op-amp. This offsets the whole signal by half \$V_{CC}\$ so it can swing both positive and negative without needing a negative voltage. It basically imposes a DC offset on the signal.
C1 and C2 decouple the DC component of the signal from the rest of the audio chain.
C3 and C4 are just normal power supply decoupling capacitors.
The power supply should be at least the maximum output peak-to-peak voltage. 5V is a good value to use (it allows the output to go +/-2V [or more with R-to-R]) and you could easily take that supply from a USB port.
Two of those circuits (one for left, and one for right) would double the volume of your audio signal ready for inputting into your power amplifier or powered speakers. For compactness you can get a dual op-amp in one single 8 pin package.
|
H: mechanical relay output voltage doesn't change
As a followup to my previous question, where a 2222 npn transistor wasn't beefy enough to handle the load I was putting on it to activate a solenoid valve, I decided to try a mechanical relay board kit instead (which I realize is overkill for what I need, but it wasn't too expensive, and I figure I can reuse it eventually).
Like my previous question, I'm driving the logic with an arduino. I see the LED on the relay toggle, and I can hear the relay click when it's turned on or off. However, the output voltage (NO to COM on the 'relay 2' outputs) doesn't change when I test it with a multimeter. The voltage between any pair of output pins stays zero (NC to COM as well, all the outputs on relay 1 as well).
Is it likely that I make a mistake when I soldered the board kit together? I could try to re-do the soldering, but visually it looks OK to me (although I'm new to this), and things are functioning enough that I can hear the relay click when it's toggled.
Could I have fried both of the relays? It's a 'Omron Relay G2RL-14-DC12, SPDT, 12A, 12VDC'. Is there a way I can diagnose what's wrong with the board? I've prodded various through-hole pins on the underside of the board, and I can see a voltage across the LED's pins, but not the output pins. Is there something else I should test? Since I can hear them click, I assumed they're working, but maybe something else on the board is busted.
The output voltage should be the same as the input voltage, right? The multimeter says the voltage across the input pins is 11.7 when the relay is on (open), 11.9 when the relay is off (closed), 12.01 when the arduino is off too (why would it be different? I thought it was an isolated circuit).
Thanks for fielding my newb question :)
AI: The relay contacts are not connected to the board 12 volt power supply - they are just isolated switch contacts.
If you measure the resistance between the COM (common) and NC (normally closed) terminals, you should see near zero ohms when the relay is released, and an open circuit (inifinite resistance) when the relay is operated.
Measuringing resisttance between COM and NO will give the opposite result - near zero ohms when the relay is operated.
|
H: Using a transformer with 400 volt rated primary side with a 120 volt line
Is it possible to use a transformer rated for 360 to 400 volts on its primary side on a 120 volt line? Will it still perform adequately? And I would assume the turns ratios still apply?
This is the transformer in question: WE-LLCR Resonant Converter.
Also, I understand that the saturation current is that which the inductance drops off; however, this datasheet says the I-sat is 4 amperes, but it's rated for 8 amperes output current. Why is this so?
I will be using this in an SMPS at 100 kHz.
AI: If you look at the datasheet, it says Resonant Converter. The only resonant converters that I have worked on were to get high voltage outputs without feedback. I think there may not be any difference in the transformer construction and you can use it for the much more common PWM scheme SMPS.
The 4A saturation current spec is for the primary.
The transformer can function for 400V or below. One of the key spec here is the primary inductance -- 400uH, it determines the current rise for a given on time. Back of the envelope calculations: at 120VDC input, 0.5us on time (50% of the period of 100KHz), discontinuous current mode (flyback topology), the transformer can transfer no more than 45W. At 320VDC input, 320W. And these are assuming 100% efficiency.
SMPS can be fun, but be careful when dealing with 120V or greater. In the common flyback topology, the flyback voltage would add on top of that.
|
H: Where is a good place to start learning about electrical engineering for AVR stuff?
Can someone point me to a really good tutorial on electrical engineering, mainly avr stuff.
I have looked at alot and none in my opinion really give a complete idiot like my self a good place to start.
AI: Electrical engineering is a very broad field. What parts you need to study depends on what sort of projects you want to do. Here are some areas that may be relevant to microcontroller projects:
Basic circuit theory (voltage and current, power, resistance, Ohm's Law, Kirchhoff's Laws)
Digital logic (boolean algebra, logic gates)
Computer architecture (IO pins, registers, addressing, memory-mapped peripherals, interrupts)
Embedded software (toolchains, C, assembly, memory management, what a linker actually does)
Common microcontroller peripherals (timers, PWM, SPI, ADC, etc.)
Basic electronics (diodes and op amps)
Basic power conversion (linear regulators)
Intermediate electronics (transistors)
As you can see, there's quite a lot, so it helps to narrow it down. Without knowing much about your background, it's hard to suggest a good course of study. (For instance, if you already know C, that will make life much easier.) The main question is whether you're more interested in analog or digital projects. Microcontrollers are used for control and communication. So what are you controlling, and what are you talking to?
Probably the most important thing to start with is your toolchain. You can use an IDE (Atmel Studio), and there's lot of example code available from Atmel and from other people online. Going through the compile/link/load/run process a few times will be very helpful.
You'll need to be able to program in C. If you don't know it, The C Programming Language by Kernighan and Ritchie is an excellent book. Pay special attention to pointers. If you want a book with a general overview of embedded programming, try Making Embedded Systems by Elicia White.
Start with IO pins. Using example code, figure out how to make pins either inputs or outputs, how to control the state of an output, and how to read the state of an input. Make some LEDs blink and some buttons turn them on and off. A little knowledge about voltage, current, and resistance helps on the hardware end.
From there, it's up to you. For analog projects, you'll need to know circuit theory and electronics. For digital projects, you'll need to learn about logic and communication protocols. To move beyond a development board and/or a bench-top power supply, you'll need to learn about power conversion.
What resources are best for learning about these depends on your learning style. Do you prefer a more serious, disciplined approach using textbooks? Would you rather read shorter articles on the internet? Or do you just want to put together things that other people have designed?
If you want textbooks, you might start with Hayt and Kemmerly for circuit theory. The Art of Electronics by Horowitz and Hill is a good choice for analog electronics and some basic digital stuff. Basic digital logic is too easy to really need a book.
A really great online resource is the Falstad circuit simulator Java applet. It'll help you to develop an intuitive understanding of what's going on in a circuit. There are lots of built-in demo circuits, too!
I can probably suggest more resources if you clarify your goals, so please do so if you can.
|
H: Design up counter in VHDL using generate statement
I need to design an 8 bit up counter in VHDL using T flip flop and generate statement. I know how the counter works, but I am not able to design it in VHDL.
The main problem is "using generate statement" . As I can see, in an up counter (ripple or synchronous ; either is OK ; I decided to use ripple ) , the previous output is fed as a clock. So I can map Q(i -1) for clock in the i'th generated flip flop. But what about the first flip flop ? It has a clock explicitly applied.
So if I use generate statement, I cannot simply map the clock to previous output ; the first flip flop will always create problem. Another thought which came was to initialise first counter explicitly and then use generate statement for remaining 7 flip flops. But here as well, I think, the first (or rather, second) flip flop using generate statement will pose a similar problem ( ie mapping clock).
Am I incorrect or missing something important here ?
Here is the code ( planned code, not actual code) :
component tff is
Port ( t : IN BIT ;
clk : IN BIT ;
q : OUT BIT );
end component
--Other irrelevant stuff
For i IN 0 TO 7 GENERATE
tffx : tff PORT MAP ( tIn , q(i-1) , q(i) ) ;
end GENERATE ;
--More irrelevant stuff
Thank you.
AI: Here is a simple generate statement, which generates 8 TFFs and connects the clock input of the tff to the q output from previous FF. Because you are using indices calculations (i+1 or i-1), you need to wider range for the tff_clocks range or you must shorten the generate loop.
I'm using a loop from 0 to 7 so I extended tff_clocks by 1. Index 0 is connected to the original system clock.
architecture ....
signal tff_clocks : std_logic_vector(8 downto 0);
begin
tff_clocks(0) <= clk; -- first tff is clock with main clock
genTFF : for i in 0 to 7 generate
tff_inst : tff
port map (
clk => tff_clocks(i),
t => '1',
q => tff_clocks(i + 1)
);
end generate;
async_counter_result <= tff_clocks(8 downto 1);
end;
|
H: Deciphering datasheet descriptions: "normalized series 54/74 load"
I was reading something when I came across a project using the SN74180 parity checker IC. I begin looking at the datasheet when I came across this description:
The SN54180/SN74180 are fully compatible with other TTL or DTL circuits. Input buffers are provided so that each data input represents only one normalized series 54/74 load. A full fan-out to 10 normalized series 54/74 loads is available from each of the outputs at a low logic level. A fan-out to 20 normalized loads is provided at a high logic level to facilitate the connection of unused inputs to used inputs. Typical power dissipation is 170 mW.
What is meant by a "normalized series load" and why would you need an input buffer?
It seems like this description is alluding to the fact that this device supports up to 10 fan-out loads for each output at logic LOW, and 20 at logic HIGH.
How can this number be different for each type of logic level?
It would seem that the fact that it can support 20 fan-out at logic HIGH would be moot since the 10 fan-out at LOW would be a bottle-neck anyway. Surely I am misunderstanding this characteristic.
What is meant by ".. facilitate the connection of unused inputs to used inputs"?
AI: What is meant by a "normalized series load"
A digital input requires a certain amount of current in order to pull the input stage high or low enough to have a voltage within the logic thresholds. This amount of current is designated "1 normalized series load", and it varies per family.
and why would you need an input buffer?
Certain logic devices, e.g. muxes, have complex structures that consist of more than 1 load. The input buffer hides these extra loads.
How can this number be different for each type of logic level?
Both TTL inputs and TTL push-pull outputs are asymmetrical, but not balanced to each other. This results in a discrepancy in the load handling.
What is meant by ".. facilitate the connection of unused inputs to used inputs"?
This one I'm not sure about. Floating TTL inputs are seen as high regardless, so I'm not sure how this would come into play.
|
H: How Does Connecting a Battery in Series Affect Current Flow
Background:
I am creating a circuit to run electronics and motors. The some of the electronics are 5V some are 12V and the motors are 24V. I have a small universal 12V battery for the electronics I run it through a 5V regulator for the 5V electronics. In addition I have a huge Optima Yellow Top 12V battery. I want to create a 24V circuit for the motors by connecting the small 12V battery to the large optima 12V battery in series.
My Question:
How would current flow through this circuit? In other words, do the motor take an equal amount of current from each battery? Would the current in the wire from the positive terminal of the smaller battery to the negative terminal of the Optima battery be the same as from the optima positive terminal to the smaller battery negative terminal (the motors will be between the optima positive and the smaller battery negative). Will the optima battery be able to supply the majority of the current? If I hooked another 12V battery in parallel with each of the 12V batteries, how would current be drawn from that battery?
Thanks for any help,
Joel
AI: In the simple series connection, the current will be limited to the current from the battery with the lowest current rating. Note: that may not be the smallest of the batteries, either in physical size or in total energy storage. Just for example, Nickel-Cadmium batteries generally have very low internal impedance, so even a fairly small NiCd battery usually has quite high current capability (but will discharge very quickly at maximum current capability).
When batteries are connected in parallel, you add together the current capabilities of the batteries.
For your series/parallel connection, you'd want to connect at least enough of the smaller batteries in parallel in match the current of the larger battery (or at least to match the current requirements of your circuit). If you connect more in parallel than that, you'll get the same total current flowing, but less through each individual battery, so they'll discharge more slowly. That'll give longer battery life unless current draw is so low that the batteries are already limited by their shelf life (which is unlikely where they're powering motors and such).
In most cases, however, you want to ensure that any batteries you connect in series are as close to identical as possible--regardless of overall current capability, if some of the batteries discharge at different rates from others, things can get fairly ugly.
|
H: Changing voltage multiple times
I am trying to power an atmega328p, and the esp8266 for one of my projects.
I am trying to drive a relay to switch lights on and off. The problem is that the relay runs on 12v, the atmega runs on 5v and the esp8266 runs on 3.3. I was thinking of using a board mount power supply to use 120v ac, to get 12v for the relay, then use a 7805 regulator to get 5v for the atmega, and finally use a LM3940IT to get 3.3v for the esp8266. I do know that the esp8266 can not be run off of the atmega's 3.3v pin :(
What I am wondering is am I totally off on what I am hoping to do. Is there a better way? I have found a couple articles about switch power but, not as much as I would like.
I am also concerned about the amount of amperage needed for everything. I will use a Darlington transistor to drive the relay from the atmega, I am not sure how much power that will consume.
Here is the board PSU
http://www.mouser.com/ProductDetail/RECOM/RAC04-12DC-230/?qs=F5OEftmZcCAbIVZkvUf1yw%3d%3d
I would really appreciate any help.
Thank you very much.
AI: What you're doing is certainly feasible, as long as you're willing to handle the waste power. The one change I'd suggest is replacing the PSU with a RAC04-12SC. You don't need the -12 that your specified PSU provides, and going to a single 12 volt output will giver you 333 mA, which may be enough. Note that, if the PSU is going full out, it will provide 4 watts, and the 7805 will have to dissipate 2.8 watts minus the power in the relay coil. This is certainly possible, but you must use a good heat sink, with proper care for thermal connection.
|
H: Simple switching between clocks using oscillator disable pins
I am working on a circuit where I need to use different clock sources. I am using two HCMOS oscillators. Both oscillators have an disable pin. When disabled, the clock output buffer is placed in tri-state.
Can I safely connect both lock outputs with each other and use the disable pins so that only one oscillator is enabled at a time? The following image shows what I mean.
NOTE: Glitch-free switching between clock signals in not required.
AI: Your circuit concept will work just fine as long as you only enable one oscillator at a time. After all there are reasons that oscillators like these are equipped with an output enable/disable pin. Your application is one of the reasons.
Some food for though. To ensure that both oscillators are never enabled at the same time you need to properly comprehend how the two enable signals are generated. If the two signals come from a microcontroller (which I suspect is the case) you can easily control the enables via the software to ensure that at least one of the enables is low at any given time. However when the MCU is in reset or before the software is active you have to make sure that the default (reset) state of the enable circuitry abides by the only one active at a time rule. A good way to handle this can be to design so that both enables are low in the disabled state through power up and until the MCU software is active and able to select one or the other enable. An effective way to deal with this is to use MCU pins that default at powerup and out of reset as inputs to the MCU. You can then put suitable pulldowns on each of the enable lines to hold the lines low until software eventually comes along and configures the two pins as outputs and drives one high.
The job to ensure proper operation gets slightly more complicated if these oscillators are actually supplying the clocking signal to the MCU itself. (I suspect that this is not the case for your application since you said that glitchless switching was not required. It the MCU was fed from the clocking selector on the fly then you would need a glitchless design. You would also need to design the circuitry so that one enable was active and the other was disabled in the default (reset) state.
|
H: How to build an FM transmitter and how does it work?
I have become interested in radio transmission and would like to know how to build an FM radio transmitter. When I search for information I either get a block diagram or a video of someone putting it together with no explanation. I have basic electronics knowledge but I don't understand whats going on, for example, here:
How am I supposed to learn this stuff? Can someone give an explanation or a link to where I can learn?
Thanks
AI: How am I supposed to learn this stuff?
There are no short cuts and I would learn the following (but there's no guarantee I haven't missed anything from the list because I learnt this stuff decades ago and I don't have perfect memory): -
Learn ohms law
Learn capacitors and inductors
Learn tuned circuits
Learn BJTs then how they are configured such as common emitter, common base, and common collector
Understand small signal AC analysis and DC analysis of these circuits.
Learn about active filters using BJTs (learning for op-amps will also be useful)
Learn a little bit about power supplies
Learn about modulation techniques such as AM and FM
When you are reasonably confident with the above you should be able to see that the FM transmitter in your question is a common base configuration at the carrier frequency and for the modulation signal it is a common emitter amplifier. Along the way to learning about BJTs you will have learnt about miller capacitance and if you did your learning correctly you'd have known that a signal on the base of a common emitter amplifier can "modulate" the miller capacitance.
Put all this together and you have your answer - the miller capacitance is modulated by the modulating signal on the base. This in turn modulates the resonant frequency of the tuned circuit in the collector and, feedback from collector to emitter creates an oscillator whose centre frequency is wobbled by the base signal.
Now don't expect anything more from me - go and do some learning and maybe a couple of months of intensive slog will get a keen beginner about 50% there.
Bear in mind that I have no idea what your starting point is so don't gripe at me if you already know about some of the stuff I've mentioned.
|
H: Diode voltage rate of change and junction capacitance
I was looking through some schottky diodes and saw in their datasheets, that they have characteristic called voltage change of rate [dv/dt]. Most of those I saw have it exactlly 10000. Now, in datasheets, they also specify their junction capacitances, which differ from diode to diode.
My questions are:
What is voltage change of rate, what does it mean? And how come, they have it exactlly the same?
Why is junction capacitance in graphs usually a function of reverse voltage and not forward current or something?
EDIT:
I am actually asking for a way to compare these diodes, to figure out which is faster and which would fit my needs.
AI: The maximum rating on dv/dt is just that- do not exceed it if you want your design to be reliable. Older diodes were good for as little as 2kV/us but most are now okay with 10kV/us. Of course the actual ability to withstand dv/dt may be higher but that is all you are guaranteed, so stay within it.
The capacitance of all diodes varies with the voltage across it- minimum at the rated reverse voltage and higher with positive bias (though it is in parallel with the conduction of the diode). Diodes characterized for this are called varactor or varicap diodes, but all diodes have this characteristic.
Beware if this is important to you and the number is specified at a much higher voltage than where you are using it.
Schottky diodes do not directly have reverse recovery time as do conventional diodes (though the protective structures can have some similar effect), so the capacitance may be your main speed consideration. Here is the 1N5819 capacitance curve from the datasheet:
|
H: Serial connection via 3.5 mm Jack
lately I have been experimenting with the Intel Galileo, the thing is that I can't get the serial connection to work so I can do the "Linux magic". Today I bought this cable and tried to establish a UART connection but this error pops out. Any clews?
AI: That cable does not provide a UART connection. Instead it connects the USB port directly to the TRRS plug. This is not what you want. Buy or make a real USB-to-UART bridge cable instead.
|
H: How to test and rate a home-built low dropout regulator?
I built a low dropout regulator following experiences building a discrete linear regulator. The circuit is simple like this:
simulate this circuit – Schematic created using CircuitLab
I would like to know how to test the maximum voltage inout and output, current carrying and heat dissipation ratings of this circuit with parts as specified in circuit, as well as its minimum voltage dropout.
By supplying a regulated 5.5V into this circuit I can get the maximum of 5.4V at the output under 30mA load. Does this spell a minimum 0.1V dropout at 30mA?
I also got a minimum of 2.5V voltage output without load. How to modify this regulator so that it can shut the load down by turning the pot one way all to the end?
Also is the op-amp getting power from the unregulated input a problem?
--- EDIT ---
Since this circuit is not protected, how to add overcurrent protectection? I am considering using LM358 instead of LM741 as the op-amp chip, and how to construct the current sensing and overcurrent protection circuit using the extra op-amp from LM358, a shunt resistor and a few more MOSFETs? (I have 2N7000, BS250, IRF4905 and IRF540 spare parts lying around in bulk)
--- EDIT 2 ---
Rounding up suggestions, does this seem like a better circuit?
simulate this circuit
The reference is modified per @SpehroPefhany's suggestion to use a TL431 powered through a 680Ω resistor. The old 741 is swapped out with OPA2134 dual rail-to-rail op-amp (expensive!) per @andyaka's suggestion. Some frequency compensation is attempted using capacitor C3 at the gate of pass transistor M1.
My intention of the overcurrent protection is like this:
The second op amp in the OPA2134 package is wired into a differential amplifier, monitoring the voltage difference between current shunt resistor R4. When the current approaches 4A the voltage drop across R4 increases to the point that the voltage output of the differential amplifier OA1b approaches the threshold voltage of 2N7000 and start to push it on, pulling the voltage at the inverting input of error amplifier OA1a lower, pushing the gate voltage of M1 higher and start to shut M1 down.
--- EDIT 3 ---
Rounding up suggestions again, would this be better?
simulate this circuit
The op amp is no longer driving the pass MOSFET directly, and current shunt voltage is directly matched against the threshold voltage of a MOSFET PNP BJT. This should be able to eliminate the need for a RRIO op amp. I am still using a relatively modern LM358 but is 741 suitable here now?
AI: I suggest you do not use a 3.3V zener diode as a reference- you'll get horrible line regulation (and ripple rejection), especially with a resistor as the current source, as well as bad temperature stability.
At least use a TL431 (almost as cheap as a zener in volume) which (if you give it >1mA) will maintain a very steady voltage (nominally 2.495V) and has quite reasonable temperature stability. Your 1uF in parallel should result in unconditional stability.
An LM358 should work okay with a sufficiently low pullup resistor to allow the output to get close to the positive rail so the MOSFET can turn off. The LM358 is good for 32V, your MOSFET gate is probably not rated for 32V so that limits your maximum input unless you improve your circuit.
You've not made any attempt to deal with (frequency) compensation. At some point (probably very soon) you will find out why LDOs have problems in this area when it turns into an oscillator. You may not easily see the oscillation at the output because of the huge capacitor, so look at the op-amp output to see if the circuit is stable.
Anyway: How to test
Line and load regulation test for the rated input range with different loads (minimum to maximum and a few inbetween). Measure the output voltage for each.
Temperature stability- repeat tests at different temperatures from minimum to maximum.
Stability- change the load from maximum to minimum with different input voltages and observe the output behavior-looking for droop or overshoot when the load is increased or decreased suddenly.
Ripple rejection- apply some ripple on the input at the desired frequency and observe how much gets through to the output.
Drop-out- observe the output behavior as the input is increased from zero to a voltage a few volts above the output, with various loads.
You can measure quiescent current Iq as well, if you like. If you pullup resistor is very low (like 1K) you may see a significant increase in current as the op-amp rails for a high set output voltage and input slightly too low to regulate.
|
H: Pinout of the IRL7833 N-channel MOSFET?
I downloaded the datasheet for this MOSFET, but can't find where it labels the pinout anywhere. Has anyone used these before? I got them for cheap from Amazon, and I'm hoping to control some DC lights with them from an Arduino.
Here's the datasheet: IRL7833
From what I know, these are actually quite old, dating back to the mid 1990's. But I'm thinking that they should work fine. One thing that also confuses me is the max. gate threshold voltage, which is 2.3V. I'm a newbie to electronics, but is that saying the maximum voltage I can output to the gate is 2.3V?
AI: International Rectifier datasheets are never obvious with their pin labels. They hide them in the engineering drawings of the packages.
For instance, the TO-220 package, on page 9 of the datasheet, has this drawing:
The pins are numbered 1-3 and the tab numbered 4. To the right of that drawing is a little table:
LEAD ASSIGNMENTS
GATE
DRAIN
SOURCE
DRAIN
The other packages are even less clear with the table being in tiny text hidden somewhere in the drawing.
The "max" threshold isn't the upper limit for the gate voltage - it's the upper limit of the threshold voltage - the voltage above which you should be to turn it on. The threshold itself could be anywhere between MIN and MAX. As long as you are above MAX then you are good.
|
H: What is considered low or high frequency?
I've been reading some guides and papers on data acquisition and often times on the subject of measuring frequency they will simply say
For low-frequency signals, it is sufficient to use one counter, or
timebase. The rising edge of the input signal triggers the number of
timebase ticks to be counted
They fail to define what constitutes a high frequency, what is the threshold? My online research often takes me into the realm of radio frequency and Rf at which point I wonder if the same applies to electronics in general.
So if I'm looking to measure the frequency of a 4,100Hz signal - is that considered LOW or HIGH frequency?
AI: It depends on the application. In this case, it's relative to the frequency of the time base.
As the period of the measured signal is not necessarily a multiple of that of the time base, the ticks counted are only an approximation for the frequency and there will be some error in your measurement. However, the more ticks fit into one period of the measured signal (the higher the frequency difference is between the two signals), the smaller the error.
Knowing the period of your internal time base and the desired precision, you can decide whether the signal is low or high frequency for your measurement.
For example, 4100 Hz seems like low using a 10 MHz time base (2439 or 2440 ticks per period, depends on the starting phase difference). The error can be calculated: as the measuring device can only count integer ticks, exactly 2439 ticks would mean a frequency of 4100.04100... Hz, while exactly 2440 ticks would account for 4098.3607 Hz. In the first case, you have an error of 0.041 Hz (0.001%), in the second case, the error is 1.6393 Hz (0.04%).
|
H: Microcontroller-based SMPS designing
Is it feasible to construct a variable voltage SMPS using one of each of the following:
ATtiny84 microcontroller
IRF4905 power PMOS
2N7000 signal NMOS
4.7mF cap
220uF cap
AD5280BRUZ100 100kOhm digital potentiometer
680mH inductor
1N5819 Schottky diode
AMS1117-3.3 LDO regulator
An external host device should be available to talk with this SMPS and adjust its output voltage between 0 and 12V.
--- EDIT ---
The design I have in mind:
simulate this circuit – Schematic created using CircuitLab
The pot on the right is part of AD5280BRUZ100 chip. The ATtiny84 is programmed to take commands from the I2C interface and use PWM to control the amount of energy each packet contains.
Input is 30V from an mains isolation/step down transformer and a bridge rectifier.
AI: Most of the AVR Tiny & Mega devices that are specifically designed for SMPS have "Fast PWM". This implies a counter that is clocked from a signal that is a multiplied version of the MCU clock. This feature gives a faster PWM signal, thus allowing smaller components. The Tiny84 does not appear to be one of those.
On the other hand, there is absolutely no reason why you could not built a SMPS from that device. Whether or not you can do it with exactly that parts list is anybody's guess. If you have such a specific list, you must have a design in mind and it would really help if you gave responders more information. You have also NOT said what your input voltage is. If the input is NOT greater than 12V, you will have problems because most SMPS only do boost or only do buck, but not both.
Personally, I would have the MCU manage the PWM AND drive the digital pot. And, I would have serial (RS232, USB, etc) from the outside world set the pot that sets the feedback that sets the voltage. All that said, you MAY have some challenges with conflict between the serial input, the digital pot control, and the link between feedback input and the PWM.
|
H: Why the need for multiple I²C ports?
The I²C protocol allows, in theory and with 7-bit addressing, up to 127 devices to be connected to the master. This is a large number, so why would any low-cost microcontroller (e.g. this PIC24), have more than one I²C port? Why is it needed?
AI: Sensor hub arrangement
In this scenario, there are two I²C buses. Let's call them local bus and main bus. The purpose of the local bus is to connect a bunch of sensors to a microcontroller (μC). The purpose of the μC is to poll the sensors, aggregate information from them, and detect certain events. A μC in such role is called sensor hub. The sensor hub is not responsible for higher order functions; there is a powerful main processor for that. The main bus connects the sensor hub to the main processor. So, the sensor hub μC is a master on the local I²C bus and a slave on the I²C main bus.
SPI and I²C
The PIC linked in the original post doesn't share the pins between SPI and I²C. However, there are other PICs that use the same pins for hardware SPI and I²C, because both are implemented with the same MSSP peripheral. If a PIC has two separate MSSP peripherals, then one can be used for hardware SPI, while the other one is used for hardware I²C.
|
H: Parallel transformer outputs
If I fed in ~140 volts at 100kHz to This transformer what is the most power I could get out of it? The data sheet rates it at 36 volts DC 3 amps on one of its three outputs but I am confused by this.
First, the saturation current is rated at 7.4 amps so why is the output current significantly less, especially when the voltage is being stepped down by a 4:1 ratio and the output DC resistance is so low.
Second, if I wire the three identical outputs in parallel will I achieve 36 volts with 9 amps or am I mistaken in how parallel transformer outputs work?
Third, If I wired these outputs in series would I then get 36*3 = 108 volts at 1 amps output?
Lastly, these winding ratios are given with the input voltage across pins 2 and 4 on the primary side, I should be able to put 120 volts across just pins 3 and 4 to get a 72 volt, 1.5 amp output, correct?
Thank you for your time, when working with dangerous line voltage I want to make sure I have everything correct. I ask these questions because while I would think they would carry over from what I see on 60hz transformers, I haven't been able to find a good resource on these switching transformers.
AI: Flyback topology is one of the common schemes for SMPS of less than a few hundred watts because of the simplicity. These equations give the first order calculation of some parameters you ask for:
$$ I_{peak} = \frac{V_{in} t_{on}}{L} $$
Energy stored by the transformer per period: $$ E_{L} = \frac{1}{2}LI_{peak}^{2}$$
Power transferred: $$ P = \frac{E_{L}}{t_{period}} $$
t_period would 10us for 100KHz. t_on is the switch on time, assuming 50% duty as a starting point, it would be 5us.
The peak current must be less than the saturation current while accounting for input voltage variation and tolerances plus safety margin. The peak current does not translate directly to output current through the turn ratio.
When wired in parallel, the output windings should be capable of giving 9A.
When wired in series, the output windings should be capable of 3 times the voltage @ 3A.
For SMPS and flyback SMPS in particular, the turn ratio does not translate to actual input voltage vs output voltage.
I don't know how to say much more within a page or two. Possible resources would be some manufacturers' sites such as TI's. There are usually loads of application information. Pick SMPS ICs that seem to meet your requirements and some of them would have online calculators of recommended circuit arrangements.
|
H: Capacitive touch directly above LEDs
I'm trying to make a design where the user can run his/her finger directly over a series of 10 LEDs (covered with 1 mm glass), and the LEDs should glow on/off based on the finger's position.
I wish to use capacitive touch (like on a phone, where the touchscreen is directly above the LCD) to accomplish sensing of the user's finger.
I am familiar with making copper pads on a standard PCB to make a capacitive touch sensor, but if this opaque PCB goes on top of the LEDs, then their light would be obscured.
Is there some alternative strategy I can try in order to let the LED light come through and still allow capacitive touch sensing of the user's finger directly above the LEDs?
EDIT: Perhaps below design should work? (incorporating reverse-mount LED suggestion of user @Some Hardware Guy)
Green = PCB; Brown = Copper pads (for capacitive-sense), and Yellow = Reverse-mounted LEDs
AI: What about a reverse mount led meant to mount on the bottom of the board and to come through a hole in your PCB, and hopefully be flush with the top of the board (you could adjust your thickness to make if flush or just under. Then do your capsense traces on the top layer.
|
H: Arduino PC LED strip controller
I have an LED strip being controlled by an Arduino and powered by a molex connector within my PC. I'd like to have my Arduino connected to my computer via USB 24/7, however when I do this, the molex grounds itself through the USB connection when I toggle the switch to the off position, so the LED strip does not turn off when I want it to. Also, I don't feel comfortable grounding molex through USB. Is there any way around this? I have a reasonable background with electronics, but I'm just not sure what to do in this case, and I couldn't find anything on the internet. Thanks.
simulate this circuit – Schematic created using CircuitLab
AI: I can see why you'd wand this since it'd be really nice to be able to reprogram the arduino at every time although having separate grounds while still connected to the same PC is going to get a little hairy.
The USB and the Molex connector share a ground internal to the computer so if you wanted to separate that, you'd have to modify the USB board to use a different ground. This gets into heavy PC modding and can get pretty hairy quickly.
|
H: Eagle: What is the significance of the tCream layer having this "hashed" pattern?
I am trying to modify a part because in the original libary, some of the pads were of differing sizes. I would like to make all pads to be of the same size. In the following image, there are three pads. The first and third pads are in the original form.
In the middle pad, you can see that I lengthened one of the shorter pads with the polygon tool, but the polygon I get is solid.
By process of elimination (removing layers from view in the Layer Settings menu) I have found out that the these pads are in the tCream layer.
What is the meaning for the diagonal "hash" lines? Why does my polygon not have those lines, even though I'm drawing on the same layer?
AI: There is no significance; if you double-click the layer button or use the "display" command you can change the colour and display fill style for each of the layers. It's only for being able to visually differentiate the layers on your screen; they all print the same.
|
H: MPU-9150 (IMU) - what happens at fullscale range boundaries?
We're debating the use of the MPU-9150 IMU in an application. This IMU has a user settable full scale range for the accelerometer (e.g. 2g, 4g, etc) and gyroscope (200dps, 400dps, etc).
Suppose I set the values at 2g and 200dps - what happens at the boundaries of these ranges? Are the values ceiling/floored (i.e. an acceleration of 3g-4g results in 2g sent to back from the sensor), or do the values roll over?
AI: The MPU 6050 pegs at either end of the range (you can see the red series flat lining):
I assume the 9050 does the same, though haven't tested it. We use the 6050 in production.
|
H: "Ultimate" Surge Protector with Solar Cells
I've had an idea that I was wondering if it would be possible.
I came up with this idea when thinking about local computer backups. Companies such as IoSafe make hard drives which are water & fireproof, however I'd be willing to bet that a good electrical surge would take one out.
Would it be possible to isolate a hard drive (or SSD), electricially, simply using solar cells for power and fiber optic for communications?
You'd have a light source which would power up the solar cells, which would power the HDD/SSD. You'd have a fiber optic connection for data.
In theory it would be very isolated from outside elements.
Does such a device exist? Is there a reason why not?
AI: While I'm certain there are less drastic ways to provide surge protection, I'll focus on the solar issue - solar power is very inefficient. The best of panels struggle for 20% efficiency. Light generation is inefficient also - even LEDs have a theoretical maximum of 40% or so. That means that to use your SSD that needs 2W of power, you'll need to dump in ~26W into the light source. Given that power consumption is a major issue for data centers, this would be a non-starter.
|
H: Using a Arduino Pro Mini to power more than 2 servos
I don't know very much about Arduino, but from some basic research I have read that the Arduino Pro Mini can only support two servo motors.
I am trying to create a set of reaction wheels using hard drives, brushless motor controllers and an Arduino Pro Mini. (I can get a different model of Arduino, but that's what I had lying around.)
Since a set of reaction wheels requires a minimum of three hard drives to work, I need to find a way to be able to control another servo using my Mini.
Is it possible to control more than two servos (with precision) when using an Arduino Pro Mini?
If so, how?
If not, should I look into a different model of Arduino? Since I value small size, will an Arduino Micro work?
AI: That's not correct. There was a limit in early versions of the Servo library, but that's been removed. The Pro Mini uses the same ATMega 328p chip as a full-size arduino, so the only limitation is the number of PWM pins that are broken out. There are 6 on a Pro Mini, and the library supports up to 12 on a non-mega.
Also - note that the arduino micro is based on the ATmega32u4 chip, which means it'll behave like a Leonardo, not a standard Uno. It has 7 PWM pins.
|
H: How is the current limited in this common drain circuit?
I'm trying to create a dummy load circuit, but it was limiting itself around 1.7 A, so I built this circuit. V1 is 0 - 5 V via a potentiometer, and V2 is a 5 V / 3 A power supply.
simulate this circuit – Schematic created using CircuitLab
When I increase the voltage Vgs, even up to 5 V, the current through the power supply (measured with a multimeter) limits itself to around 1.7 A. If I remove the 1 Ohm resistor, the current is not limited at all, and keeps rising.
I have looked at these two diagrams on the datasheet of the MOSFET, but can't seem to figure out why the current limits itself due to the resistor:
I wanted a 3A current through the power supply / MOSFET / resistor, so I looked at figure 3. For a 3 A current, Vgs needs to be ~3.4 V. At 3 A, there will be a 3 V drop across R1, so Vds will be 2 V. Then I looked at Fig 1, and at Vds = 2 V, it should be able to have an Id of 3 A, given that Vgs = 3.4 V.
So why can't I get 3 A out of this circuit?
AI: What you observe is very well described by calculating the voltage drops across the various components and then looking up the results on the data sheet graphs that you have provided.
The three key factors are
What is the FET Rdson value at the operating point that you observe, what is the consequent Vds drop and what affect does this have.
What is the drop across R1 at the observed current, what is the resultant Vs and what affect does this have?.
Do the data sheet "typical" parameters match what you expect to see in the steady state in your application?
Clue: Guess.
You are a victim of a number of things which add to aifd Murphy.
The FET has a nastily high Rdson - exact value uncertain but if 1 Ohm as it may be then you have extra resistance combatting current flow.
As W5Vo said - the results are 'typical' - and they then add weasel word fine print to the graphs to define typical.
See the orange boxes.
The "weasel words" 20 uS pulse width is to allow the die to heat minimally and cool again between pulses. Rdson can be double in some cases with some FETs at full steady state temperature. In your case fig 4 shows Rdson with die temperature.
You showed fig 1 which is at 25 C.
Now look at fig 2 which is at 150 C.
At about 2V Vds (higher Rdson due to hotter die) and 3.3V Vgs the operating point lies above the available plots. You can only get back onto the graph with higher Vgs or lower Vds (so lower current). That's at 150 C. Your reality lies between the two curves and depends mainly on your Rdson which depends on the effective thermal Rja which depends on your heat sink.
Note the Vds in Fig3. **50 Volts ** !!!!!!!!!!!!!!!!!!!!
Fig 1 is at 25C - if ambient is 25C and you have 1.7A at 1 Ohm = 1.7 Watts the die temperature will be highly dependant on heat sink.
Infinite sink - Tjc = 2.5C/W - rise about 4 degrees C. Cool!
Open air no sink Tja = 62 C/W - rise about 100 C+ - and Rdson will rise so dissipation will rise so ... . Touch not the FET bot a glove!
At 1.7A Ids, V_R1 = 1.7A.
V1 = 5V so Vgs = 3.3V.
Recalc, rinse, repeat.
Asymptote is liable to be about what you see.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.