text
stringlengths 83
79.5k
|
---|
H: Analog video surveillance camera motion detection feature
For example Samsung SCB-2000PH Specification PDF has motion detection feature. For what purpose it is in analog camera? That camera does not have any output pins/connectors, that can trigger some output signal when motion is detected. And if I am correct, than coaxial cable can only transmit video signal (not any kind of motion signals). And in analog video surveillance system all motions is detected by video recording software/hardware. So, why analog video surveillance camera has motion detection feature and what i can do with that feature ?
AI: You should try reading the manual - the answer is right there in black and white:
This product has a feature that allows you to observe
movement of objects in 8 different areas on the screen,
and the words 'MOTION DETECTED' appear on the
screen when movement is detected. |
H: MSP430 RAM protection
I'm looking at the user guide for the MSP430x5xx family. It says there in section 9.1 that:
The RCCTL0 register is protected with a key. Only if the correct key is
written during a word write, the RCCTL0 register content can be modified.
Byte write accesses or write accesses with a wrong key are ignored.
And in section 9.3.1 that:
Field RCKEY: RAM controller key. Always read as 69h. Must be written as
5Ah, otherwise the RAMCTL write is ignored.
Can anyone explain to me what a strange protection if the password (code) 5Ah is known? For what purpose it was made?
Why RCKEY always read as 69h (not 5Ah)?
AI: Can anyone explain to me what a strange protection if the password(code) 5Ah is known?
It protects you from random modification by runaway code, e.g. on stack overflow.
Why RCKEY always read as 69h(not 5Ah)?
So you cannot simply read->write it - part of the protection mentioned above.
Microcontroller code often contains code that read-modify-writes a memory location to set or clear some bit. With the values 69h and 5Ah it is highly unlikely that such code path triggers a sucessful write in a runaway case. |
H: Supercapacitors vs. High Voltage Capacitors with Inductive loads used in CoilGuns or Solenoids
I'm looking for some insight on whether an 1000 Farads at 2.7v or 5.5v would be more effective than say 10,000uF at 400v-450v when creating a strong magnetic coil. The intent is something similar to what I find when examining Coil Gun experiments. Some of the equations I have referenced are :
The amount of potential energy stored in a capacitor depends on the voltage:
PE = ½ C V^2
Where C is capacitance in farads, and V is voltage
And
v = V * sqrt(C/m) / 10
Where v is velocity in m/s, V is voltage, C is capacitance in farads, and m is mass in kilograms
I feel like the Cost/Benefit seems like having loads of amps at low voltage would be better than lots of amps at high voltage merely because supercaps pack soo many more Farads. I am given pause because of the v^2 in the energy equation, and the sqrt in the velocity equation.
Additional Information to Consider: Materials cost as of 5/oct/14-
Small Aluminum electrolytic capacitors 450V 1000UF - $1.50 each
SAMWHA super capacitor 2.7V 500F - $5.67 each
Large Electrolytic capacitor 2200uf 450v - $13.20 each
This Last example is what I see in most coilgun examples use and may be more available than the quick search I did for my initial search.
Please also consider the loss of capacitance when run in series vs addition of capacitance when in parallel. As well as the use of the capacitors in other types of experiments if the end result is very similar to each other.
Your thoughts and insights would be appreciated.
AI: If we consider only ideal components, then the only number you need to care about is maximum stored energy per unit cost. As you already found, the energy stored in a capacitor is given by
$$ 1/2 \cdot C V^2 $$
The SAMWHA supercapacitor can thus store a maximum of:
$$ 1/2 \cdot 500 \cdot 2.7^2 = 1823 \:\mathrm J $$
The large electrolytic can store up to:
$$ 1/2 \cdot 0.0022 \cdot 450^2 = 222.75 \:\mathrm J $$
In this perspective, only the energy storage matters. That can come from high capacitance or high maximum voltage. It doesn't matter which, because you can shift the balance between current and voltage by changing the design of your coil. A coil with a large number of turns will develop a strong magnetic field without much current. However, it will have a large inductance and will require a high voltage to develop that current quickly. A coil with fewer turns will require more current to develop the same magnetic field, but the inductance will be lower so less voltage is required to get the voltage to rise rapidly.
If you were purchasing ideal capacitors, and you could fabricate an ideal coil, then this would be all you needed to make your decision. However, the real world is not so simple.
Real capacitors have non-ideal effects. It's common to model a capacitor as a network of other components, like this:
simulate this circuit – Schematic created using CircuitLab
Leakage determines how quickly the capacitor self-discharges. Ideally, this value is infinitely high. It is probably not much of an issue in your application, since you are not storing a charge for a long time.
ESL is the equivalent series inductance. Ideally this value is 0. This inductance places an upper bound on how quickly the current through the capacitor can change. You will want to make sure that the combined ESL of all your capacitors is at least an order of magnitude lower than the inductance of your coil, otherwise you will not get current, and thus the magnetic field, to rise quickly.
ESR is the equivalent series resistance. Ideally this value is 0. Here is the real problem for your application. You will be, at peak, drawing a very high current through your capacitors. This current must also flow through the ESR, and it is subject to all the physical laws of resistance. That includes dropping voltage, according to Ohm's law:
$$ E = IR $$
And converting electrical energy to heat, according to Joule heating:
$$ P = I^2 R $$
Any voltage dropped across ESR is voltage not available to drive your coil. If current is high enough relative to the ESR, then the voltage your coil sees will be essentially nothing. What you have is essentially this:
simulate this circuit
For the current to increase, voltage across R1 must increase. Since the voltage across R1 plus the voltage across L1 must equal the capacitor's voltage, as the current increases, the voltage across L1 must decrease. That's bad for you, because it means you can ramp up the current in L1 less rapidly.
Furthermore, the heating caused by losses in the capacitor can damage the capacitor. That's also bad for you.
The capacitor datasheets will elaborate on these details. However, based on general characteristics of supercapacitors and electrolytics, I can tell you that the electrolytics will have a much lower ESR on average. Supercapacitors are intended for lower current applications, sitting somewhere between a battery and a capacitor. They will typically be damaged by high current, or at least their ESR will be so high they will not perform well in your application.
There are also particular electrolytic capacitors designed to have an especially low ESR. These are called simply "low ESR" capacitors. They are also more expensive, but you might look into them. They typically find application as ripple filters in power supplies, where a higher ESR in the constant charge-discharging cycle they do would be a problem for efficiency, performance, or reliability. |
H: Opamp comparator output interfacing with digital circuit
I want to use Op amp as a comparator to shape the 50Hz sine wave to square wave, then route it to the PLL reference signal input, the PLL chip is 74HC4046. And i use AC coupled method. Because the supply of the Op amp is +/-15V, but the output signal amplitude need to be within +/-5V range. I have two solution to convert it:
Use diode to clamp the output to +/-0.7V or so.
Use transistor as below:
I want to know which one is better. Such as rising/falling time, delay, etc. I want the frequency is as stable as more.
AI: According to the datasheet, VIH, Voltage-input-high, varies with VCC, and it's 1.5 volts when the chip is powered with 2 volts. This means your first strategy won't work.
If you have a rail-to-rail op amp, you might be able to power it between +Vcc and ground, depending on how close to ground the output of your particluar op amp can go. Check VIL on the data sheet for your PLL to figure this out, as well as your op amp data sheet
I also suggest that you arrange for some hysteresis on the input, to guarantee nice clean transitions. You should consider a comparator instead of an op-amp. |
H: How to drain power with pins for led matrix on atmega32 instead of using a led driver
I want to make a led driver without the tlc594 series.
I use the atmega32 of which I can use 1 PWM pin.
The PWM pin will be connected to the base of the transistors.
With the PWM pulse I can dim the leds.
My question is how to configure the pins so that:
1) Pin is high, led wont burn.
2) Pin is low, led will burn.
I added a simplified scheme, of the led driver with a led matrix, so you can understand my situation.
Thx for the help.
AI: My question is how to configure the pins so that: 1) Pin is high, led wont burn. 2) Pin is low, led will burn.
If you configure a pin as output, setting it to low will sink current and setting it to low will source current. As long as the Vcc supplying your LEDs is the same as the controller Vcc, you circuit should work as expected.
The atmega32 can safely sink/source about 20mA per IO. However, there are limitations regarding the total maximum per port and for all ports combined. It depends on the package type. For PDIP its about 100mA max per port and 200mA max total. Take a look at the "DC characteristics" section in the data sheet.
So using 4 LEDs as illustrated should work fine (assuming about 20mA per LED). |
H: Toggle transistors with an shiftregister to light up an LED
First of all I'm quit new to electrical engineering. I had it 3 years in class but I didn't do well.
So here is what I plan. I got some shift-registers (74HC595) Which I'll set with an arduino mega 2560. With this I'd like to light up an LED. First I thought I could do it without any other circuit by just adding the right resistor to the 5V lane of the register.
simulate this circuit – Schematic created using CircuitLab
But I noticed that the register can handle up to 700mW so it wouldn't be possible and I think that the idea overall is bad. So I decided to add transistors to the circuit.(2N3904)
simulate this circuit
So my question is, if I need a resistor in front of the Base of the transistor? If so what value or let me know how to calculate it so I can answer it myself for the secont transistor. (see second question down here)
And I got one more question to it. I'd also like to disable LED's by disabling the mass with an transistor. Can I just do it as shown above?
(To mention this here. I'll use it to light up 75LEDs (25RGB) in 5 Layers. By disabling the mass of a layer I can set one layer of leds at once. This will be mulitplexed to handle each led)
Update: So in total it should be something like this to handle more then one LED:
simulate this circuit
Since i got kathod LEDs it should need to be like this:
Calculation should be simmelar right?
AI: Assuming your RGB LEDs are common anode, you will need 5 PNP transistors for level control and 75 NPN transistors for LED control.
For PNP it has to handle maximum 75 LEDs and for NPN it has to handle maximum 5 LEDs.
For PNP I recommend using Darlington transistors.
To saturate PNP, \$V_B<V_E\$ and \$V_B<V_C\$. And to saturate NPN, \$V_B>V_E\$ and \$V_B>V_C\$.
simulate this circuit – Schematic created using CircuitLab
In saturation region, transistor amplifies base current, so there is no need to pass high current to base-emitter. Thus, you can use base resistor. In fact, you should, because of current limit of shift register and transistor.
For minimum base resistor value:
$$R_{R2}=\frac{V_{CC}-V_{Q1_{be}}}{(V_{CC}-V_{Q1_{ce}}-V_{D1}-V_{Q2_{ce}})/R_{R1}/h_{fe}*2*75}$$
$$R_{R3}=\frac{V_{CC}-V_{Q2_{be}}}{(V_{CC}-V_{Q1_{ce}}-V_{D1}-V_{Q2_{ce}})/R_{R1}/h_{fe}*2*5}$$
Refer to transistor's datasheet for \$V_{be}\$(Base−Emitter Saturation Voltage), \$V_{ce}\$(Collector−Emitter Saturation Voltage), \$h_{fe}\$(DC Current Gain).
(There may be voltage drop in shift register, but it's not significant, so I omitted it from calculation.)
To be safe, use minimum \$h_{fe}\$ and maximum \$V_{be}~and~V_{ce}\$.
Also, there is high-power shift register. You might want to consider it. |
H: Short-circuit xPyS LiFePO4 batteries
I have a LiFePO4 battery connected in 2P4S configuration. What happen if one of the batteries is short-circuited? The other batteries will also be short circuits, or this will be result in the venting of one battery?
update:
Thank you for the answer, but the batteries are connected in this way:
What happen to the other cells conneceted in series (BAT6, BAT7, BAT8) if we have an internal short circuit of the BAT5 ?
AI: EDIT1: New answer to modified question (original see below)
First of all I need to tell you that this set-up is very risky. Very very very risky. This way of connecting the batteries means there's a much higher risk of damage over multiple charge/discharge cycles.
To your specific problem, if one battery in one chain becomes short circuited, the other three are "requested" to charge up to a 4cell voltage by whatever charges them, seriously over stressing them.
Put simply, if any battery becomes shorted in use, you can bet on it the other ones in the same chain are completely wasted as well, not to mention the severely increased risk of one cell blowing up or becoming shorted in the first place.
This is why battery packs are always built as in my original answer below by the factories that make them. Now, before you go and re-build a pack like that, let me warn you to always balance the cells to each other before you put them parallel, with a set up like this:
simulate this circuit – Schematic created using CircuitLab
Because cells are never exactly charged the same, ever, so you let them charge each other through a resistor, making sure no idiotic current flow. How long you leave them like this before connecting them depends on whether they have been fully charged with the same charger. If they have, 10 to 15 minutes should be more than enough. If they have not, leave them for at least an hour, but probably just half a day or more. You can reduce the resistor to increase the current and reduce the time, but be sure the resistor can handle the power, usually 10 Ohm is safe enough with a 1/4W resistor, lower values you may have to go to 1/2W, 1W or even 3W. If you want to make sure they stay alive as long as possible, don't go over 1/3 their capacity for the current through the resistor.
Also, if you want to prevent all damage as good as possible, look into balance-chargers and how they work, as they try to keep all cells in your pack healthy during the charging, severely reducing the risks of damage over time.
ORIGINAL ANSWER:
If your setup is like this:
simulate this circuit
And one battery, say BAT6, becomes a short circuit you will get:
simulate this circuit
So BAT5 is then shorted between it's + and - terminals. Often when one cell of a parallel set-up goes bad the other one is very damaged as well, because the unbalance that causes premature cell-death affects both the cells, just the slightly weaker one will go first. BUT even if that wasn't the case, shorting BAT5 will cause it to get severely damaged soon enough.
So they only thing you should do to fix this is remove both BAT6 and BAT5 and create a lower voltage pack like this:
simulate this circuit
Or get a pack with half the capacity and two cells left over, like this:
simulate this circuit |
H: Solder mask for 0.5mm pitch TQFP
I'm using Atmel SAM chips and the data sheets don't have any mention of solder mask clearance for their TQFP packages. What would be a nominal pad/solder mask opening/cream size for a 0.5mm pitch package?
AI: You should ask your board house what they need to account for registration errors. My board house needs 0.003" on each side of the pad. As for the paste layer, it depends on the pasting process. If it's the classic stencil and squeegee process, you need to be mindful of the thickness of the stencil. I recently did a 0.5mm TQFP, and with 95% coverage and a 0.005" stencil, did just fine. Having leads for excess solder to climb helps a great deal. I'm not aware of any hard, fast rules here. |
H: Why is the chassis used as ground in automotive electrical circuits
Automotive electronics generally use the metal chassis as the negative ground connector for the DC circuits. Obviously this saves something on wiring. Is there an electrical reason for this approach?
(I am not asking why negative instead of positive, but why metal frame instead of wire.)
AI: There's not an electrical reason, but instead a weight reason. By using the existing metal structure as a ground, it effectively reduces the number of wires by around half, and therefore saving a great deal of weight. (For example, otherwise each tail light would have to have two wires instead of one.)
Remember too, that some electrical loads in an automobile use a lot of current. A starter motor, for example, very commonly uses 0 AWG wire which weighs about 0.5 kg/m.
Interestingly, although not your question, the choice of negative versus positive is entirely arbitrary. In fact, back in the 1960s, Volkswagen used a 6V "positive ground" system for the Beetle up to around 1967 when they finally changed to the 12V negative ground system that is standard today. |
H: PIC16F628A Blinking LED
I was setting up a PIC16F628A for a simple Hello World program (blinking LED) and somewhere in the process, I have failed. The LED stays lit at the specified pin and does not "blink". I am using the Internal Oscillator (which resonates at 4 MHz). This is my code (Using the XC8 Compiler):
#include <xc.h>
__CONFIG(FOSC_INTOSCIO & WDTE_OFF & PWRTE_OFF & MCLRE_OFF & BOREN_ON & LVP_ON & CPD_OFF & CP_OFF);
#define _XTAL_FREQ 4000000
int main() {
TRISB0 = 0;
while(0) {
RB0 = 1;
__delay_ms(1000);
RB0 = 0;
__delay_ms(1000);
}
return (0);
}
And my schematic:
I have read that this might be a MCLR problem but I have configured the fuses to set MCLR as an input pin as shown in the code.
AI: You have a couple of issues with your code and circuit.
A while loop with a false condition will never loop. Do you mean to put "while(0)" or is that a typo? Either way, that loop is never looping. Change the 0 to a 1.
The PIC16F628A has a PGM pin that it uses in LVP (Low Voltage Programming) mode. It shares the same pin as RB4. The PGM pin must be tied to ground under normal operation and pulled high during programming (your programmer should pull it high during a programming sequence). If the PGM pin is left floating, the chip will randomly reset for no explicable reason. Or just not run at all.
Microcontroller based systems are typically single-purpose hardware. There is no operating system, so the code you program into the MCU has no higher-level entity to return to. For that reason, the main() function should be void and there should be no return statement at the end. Defining main() to return an int will probably not break anything, but it's considered poor coding practice. |
H: Multiple out signals with single clock
Here is the deal..
I need to transmit data to 8 identical components.
Each component has a clock and an input signal.
MCU only sends data. Components only receive data.
All 8 components are the same and receive the same 366 bit stream format (only with different values)
All components use the same clock.
Data should be transmitted at 25Mhz, Clock should also run at 25Mhz.
This is a job for an FPGA but I'm trying to get away with doing it on a 120Mhz MCU.
What would be the best way to approach this task? I cant send the data in serial (sending the data to each component at once) and I couldn't find an MCU with 8 SPI units.
All help would be appreciated.
AI: Well, if your chip has an external memory interface that you aren't using then you might be able to do something a little bit naughty, presuming the external memory interface can be configured properly. The idea is simple: connect all of the MOSI pins on the chips in parallel to the data bus pins with one MOSI pin per data pin, and conect all of the clock pins to the data bus clock, possibly with a buffer. Then all you need to do is configure the external memory interface to run with the correct baud rate, and write the data to the memory mapped region with the DMA engine. Naturally you will need to reformat the data so that bit 0 of each word corresponds to the first peripheral, bit 1 corresponds to the second one, and so on. |
H: Super fast magnetic field by an electromagnet?
Was wondering about the possibility of creating a magnetic field in milliseconds or less? I know it's possible based on certain labs achieving 60-100 Tesla and more. But what about creating a 2 - 5 Tesla magnetic field in milliseconds? How much power will be required? How will the electromagnet be designed?
Typically what cooling is required? This is more of a "pulse-like" electromagnet that could be used multiple times without being damaged, like a magnetizer. Where the fields are creating somewhat instantly. What properties will this electromagnet have?
AI: The magnetic field depends directly on the amount of current through the coil. To overcome the reactance (due to inductance) of the coil, use a high voltage. Follow that with a current regulator set to the value that gives you the 2-5T field. The higher the voltage used, the faster the current will rise to the desired value. |
H: Writing flash on ATmega328
I have struggled to understand this code but I can't understand the little endian for loop. Why is it necessary? And how could I read the page back? One byte at a time as an array? Is it even possible? Code from here
#include <inttypes.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
void boot_program_page(uint32_t page, uint8_t *buf) {
uint16_t i;
uint8_t sreg;
// Disable interrupts.
sreg = SREG;
cli();
eeprom_busy_wait();
boot_page_erase(page);
boot_spm_busy_wait(); // Wait until the memory is erased.
for (i = 0; i < SPM_PAGESIZE; i += 2) {
// Set up little-endian word.
uint16_t w = *buf++;
w += (*buf++) << 8;
boot_page_fill (page + i, w);
}
boot_page_write(page); // Store buffer in flash page.
boot_spm_busy_wait(); // Wait until the memory is written.
// Reenable RWW-section again. We need this if we want to jump back
// to the application after bootloading.
boot_rww_enable();
// Re-enable interrupts (if they were ever enabled).
SREG = sreg;
}
AI: I searched the datasheet, there is nothing about endian-ness. The issue might just be how you write to the flash memory. It seems to write to flash memory the 'words' are two bytes long, but the address itself is per byte. The original programmer was obviously a good kid, and read this part of the AVR-libc reference:
"Note
The address is a byte address. The data is a word. The AVR writes data to the buffer a word at a time, but addresses the buffer per byte! So, increment your address by 2 between calls, and send 2 data bytes in a word format! The LSB of the data is written to the lower address; the MSB of the data is written to the higher address."
source
The first half (byte) of 'w' is the byte pointed at by the dereferenced pointer 'buf' which is then incremented by 1 (by the ++). The second half of the word 'w' is done by this line " w += (*buf++) << 8" and what this does is adds the upper half (which is the contents of the address pointed to by 'buf' at the next byte) by shifting the byte left 8 bits. This puts it in the upper half, as I said.
You now have 'w' which contains two bytes of data, as a 'word' ready to be written with boot_page_fill function, a function from the AVR-Libc library.
If you ever do not understand the inputs to functions you should always try to look up the reference and see the comments that I found and showed above. |
H: MSP430 Timer A interrupt flags are wacko
Trying to setup a timer on my MSP430F5529 that should interrupt after approx. 2 seconds.
My initial setup looks like this:
TA1CTL = (TASSEL_SMCLK | ID_DIV8 | MC_UP |TACLR | TAIE | TAIFG);
TA1EX0 = (TAIDEX_DIV4);
TA1CCR0 = 0xFFFF;
TA1CCTL1 = (CM_NONE | CCIS_A | CAP_0 | CCIE_1 | OUT_1 | COV_0 | CCIFG_0);
As far as I know, this should setup Timer A to interrupt approx. every 2 seconds.
SMCLK frequency = 1 MHz
TA1CTL is divided by 8 with ID_DIV8, and again by 4 with TAIDEX_DIV4 so in total is divided by 32. This means TA1R gets a tick every 32us. It counts until it reaches TA1CCR0, which is at 65,536. 65,536 * 32us = 2.09715 seconds.
The interrupt is successful, however it incorrectly sets several flags.
It sets CCIFG in TA1CCTL0, TA1CCTL1, and TA1CCTL2. Not just TA1CCTL1, as I expected.
Another question I have is this: Why am I forced to use TA1CCR0 to specify what value gets counted to, when I am using TA1CCTL1? I tried specifying a value in TA1CCR1 initially, but the counter never incremented. This makes no sense at all to me.
So if anyone out there is pretty familiar with the MSP430 and could help, it'd be greatly appreciated.
AI: CCR0 holds the maximum value that the timer counts up to. When the timer reaches this value it resets to zero. Only CCR0 does this. CCR1 and CCR2 can trigger an interrupt when they match the current count, but the timer will keep on going past them. Since CCR0 sets the timer period, it is the obvious choice for generating the periodic interrupt (you could use CCR1 or CCR2, but then you would just have more registers to set up, and they might have other uses).
If CCR1 and CCR2 are set to less than CCR0 then the timer will match them before reaching its maximum count, so when the CCR0 interrupt occurs you will see that the CCR1 and CCR2 interrupt flags have already been set. You can enable just the CCR0 interrupt and ignore the other flags - they won't cause any harm.
TA1CCTL1 contains various bits that are used to configure CCR1. This has no relation to TA1CCR0 - you must still set it to the maximum count you require. If TA1CCR0 is left at zero then the timer won't count! |
H: Microcontroller PWM to bipolar push-pull amplifier issues. (level shifting)
I'm trying to design a circuit that allows a micro controller (arduino) to control a voltage to a load. The load voltage needs to be bipolar in nature (+- 3 to 5 V) for use in controlling a TEC.
My current design idea is to take the output of the micro controller as PWM and lowpass filter it to obtain a voltage between 0 and 3.3 V. From there, I plan to level shift it to +- 3 V via input to a BJT as shown below:
simulate this circuit – Schematic created using CircuitLab
When this portion of the circuit is tested alone, it appears to deliver the correct characteristics (50% PWM duty cycle gives 0 V, the average of many switches between + and - 3 V, varying the duty cycle increases/decreases this voltage up to the supply rail voltages in a proportional manner).
From there, the input is fed into a simple push-pull amplifier topology feeding off the same bipolar supply as the level shifter, to drive the load (load current in the region of 1 Ampere desired).
simulate this circuit
When the level shifter and low pass filter is connected to the push-pull amplifier, it becomes loaded and does not give the desired proportional voltage control I am after. I've tried moving the lowpass section to before and after the level shifting transistor, but in that configuration I have difficulty driving enough current through the base of the transistor to get it to switch (current amplifier needed?).
How would I best go about resolving these issues with the given (rough) topology? I've considered using an op-amp as a buffer for the low-pass stage, but I've only access to 741s which won't do for the +- 3 V power supply (Maybe I could increase the supply voltage - the driven load is a TEC device).
Is it possible to buffer the lowpass section output with a transistor simply? Or do I move the lowpass section to before Q1 and somehow build a current amplifier?
Any input or suggestions on overcoming this problem would be much appreciated, thank you.
I have access to only a single bipolar bench power supply and BJTs (no FETs, unfortunately) (along with some LM741 op-amps, and a selection of resistors, capacitors and inductors, but nothing fancy or integrated (might be able to squeeze some 7400 series logic AND gates for doing cheap level shifting if required).
Please note, the component values used in these schematics are for rough description only.
I've implemented Spehro's buffer suggestion, and it appears to be working as desired. Can anyone make any suggestions as to how I could further improve this circuit? (Q1 current seems a little high, ~100 mA, but only 75 Ohm on the collector seems to bias the RC lowpass output to around 0 V at 50% PWM duty)
The circuit is drawn up in LTSpice for simulation here.
Below is the circuit drawn up in CircuitLab, if that's easier to see.
simulate this circuit
Update: I've added some biasing resistors to the emitter-follower section and tweaked stuff a bit in LTSpice in order to get the system as linear as possible from the PWM input to output. I'm not quite sure if what I'm doing is correct, but it seems to be better than what I've been doing before.
LTSpice circuit linked before has been updated to match if that's easier to simulate.
simulate this circuit
AI: You can try buffering the output of the filter with a pair of darlington emitter-followers, which will replace the four diodes with four transistors.
simulate this circuit – Schematic created using CircuitLab
You can try buffering the output of the filter with a pair of darlington emitter-followers, which will replace the four diodes with four transistors.
Check that the no-load bias current in the output transistors is not too high.
It might be easier to use an op-amp though, if you can get some that are suitable. |
H: How does this SR latch work?
At first, I have to say, I'm not in Electrical Engineering, I'm studying for Computer Fundamental, and this question popped up, after a while considering, I decided to post it here.
I found some "quite similar" topics when posting this, but can't understand at all. Maybe because the OP and the answer providers are talking things like electrical engineers!
I can understand basic logic gates and basic flip-flop
This is the question:
The figure shows an RS flip-flop using two NOR gates. Which of the following is the correct truth table for the flip-flop? Here, “unchanged” shown in the table means the outputs maintain a previous state, and “unstable” means the outputs are in an unstable state.
This is the truth table I found on the internet, which indicates a is the right answer:
What I don't get here, is why Q = 0 and Q = 1 when S=0, R=1 and S=1, R=0 respectively, according to NOR gate truth table Q should be 0 and 0?
And how can we determine that Q will be "no change" or "unstable"? I believe there is a clear explanation for people like me can understand it, not only engineers!
AI: Reset pin going high causes the output to go to zero.
Set pin going high causes the output to go to one.
This is the function of an SR(Set-Reset)-Flip Flop, which acts as a single bit "memory". They latch their outputs due to the interconnected gates, as you see in the first diagram.
Nothing happens to the output when the inputs are not changed. Bad/strange things happen when both inputs are changed at the same time to a LOW state. Circuits designed with these can have strange effects if careful measures are not taken to avoid race conditions or clock(if clocked SR flip flops)/gate delays causing the simultaneous inputs of 0 into S and R.
The truth table of the NOR gate is important because it shows how the two parts of the SR Flip Flop interact - the NOR gate's outputs are fed into each other's inputs, which gives you the latching effect of the output.
You can put both S and R inputs HIGH at the same time if you wanted, but it does not form for to the digital theory of "Q and NOT Q" outputs, so it's not normally acceptable and is called "illegal" in the truth tables.
Bad things happen with both inputs are set low, if both inputs were previously high, because of the gate delays of the NOR gates.This can cause oscillations of the output due to the feedback in the circuit.
You can read more about these race conditions from here and here |
H: Sync filter in a lock-in amplifier
I've got two questions:
What does a sync filter in a lock-in amplifier?
What are pros and cons of using it?
AI: I think you should take a good look at a thorough description of a lock-in amplifier.
Here is one
Short summary: A lock in amplifier synchronizes its own output to the phase of the input signal. It requires a reference signal at the frequency you want to amplify. The output level of the amplifier is derived from the output of the phase detector - at phaselock, this output is a DC signal proportional to the amplitude of the input signal. There is an AC signal at twice the reference frequency (2F) riding on the DC which must be filtered out else it will cause harmonics in the output.
This is easy at relatively high frequencies. At very low frequencies, the filters become very long - long delays and large time constants.
This is where the synchronous filter comes in. The synchronous filter is a method of removing the 2F signal without using long filters. It has the advantage of providing better (faster) response to changes in the input.
Advantage is already mentioned. Disadvantage is that a synchronous filter can't remove other noise from the DC signal - it only takes out multiples of the reference frequency. If there is a lot of other noise at frequencies near the reference signal, then you will need a normal filter on the DC signal to get rid of the junk.
Use synchronous filter for low frequency signals
Use a regular filter for higher frequencies or when there is a lot of noise near the frequency of interest. |
H: Charge condition of lead acid battery
I need to monitor the charge condition of an 8V lead acid battery.
For monitoring purposes, I used a Beagle Bone Black (BBB) running Linux. It is also supplied via this battery. The battery also supplies three DC motors (switching on and off) and a camera.
Now if the charge falls below a certain percentage, the BBB should report this via SSH and shutdown.
Now my problem is:
How can I determine the state of charge? Is it sufficient to measure voltage every ~50ms and report "Low power" when the voltage is below a certain value for 1s, or do I have to use a fuel gauge IC like this one? If so, which one is easy-to-use or has a tutorial or reference project I can stick to?
AI: For lead acid batteries, voltage is good enough for reporting state of charge. Especially if you don't need detailed time information and just want to report "low battery".
It's not exactly linear, but it's close enough: Battery discharge curves |
H: Difference between overload and short-circuit protection
What is the difference between overload and short-circuit protection for motors? I do not understand the need for SC protection when a motor has overload protection. Shouldn't the overload protection trip under SC conditions (and really fast due to the inverse time characteristics)?
AI: Overload and short-circuit protection protect against two different parameters being exceeded: heat (power integrated over a relatively short time) and current.
A high current can be a an almost instantaneous problem: a wire that can't shed its heat can get too hot and burn through, or set fire to surrounding materials. In a real short-circuit situation the voltage is ~ zero, so the power delivered by the supply is ~ zero.
Overload is a slightly longer-term situation, where the heat in the motor is the problem. A motor has much more heat capacity than a wire, so a peak is not an immediate problem, but over a slightly longer period the heat must still be limited. |
H: How to explicitly connect hidden pins in eagle?
I am working on a project where I used a shift register 74HC595N which has hidden GND and VCC pins in Eagle. So I used the invoke property as shown in the pics, and connected the VCC and GND to the +5V and GND of the Arduino board. This connects the two hidden pins of the shift register directly to the Arduino. but in the PCB design phase, both pins are connected to random pins. Is there a way I can connect them explicitly from the schematic?
AI: I added the same object in eagle now too and it works fine here.
Maybe the 'random' pins are also connected ground for example. If the shift register is closer to a component that is also connected to ground you will see a yellow line (from the unrouted layer) to that component.
To check if this is the case you can use the show function on the board layout screen. (you can use this function by typing show in the text bar) Then click on the yellow unrouted line. everything that is sharing the same net name (GND in our example, will light up. You can now easily check if the arduino ground pins are lighting up. Also the name of the net is showed in the bottom left corner of the screen once you used the show function. |
H: Why solenoid valve when a liquid pump can be electronically controlled?
In some quick research online, I'm often seeing configurations where a liquid pump is used in tandem with a solenoid valve on the same liquid path.
So, let's say I have a very simple scenario: a standard pump transporting liquid from one container to another container (at a higher position).
If I wish to electronically control the flow/no-flow of liquid, I can simply switch on & off the power supplied to the pump, perhaps using a relay.
So then, what does adding a solenoid valve to that system achieve -- isn't it redundant?
EDIT: Example of a drawing I saw (although I suppose the valve here is a manual one for easier access):
AI: If there were no valve in the line, then when the pump is off, liquid may siphon from the higher container to the lower container until the liquid level is equal in each container.
Some pumps might prevent this by offering no free path for liquid to flow and preventing their internal parts from turning backwards by friction. For example, a screw pump. However, a centrifugal pump is probably more common, and in these, there is nothing preventing the flow of liquid in either direction when the impeller is not turning. Even when the impeller is turning, liquid can flow backwards if the external pressure is enough to overcome the pressure difference generated by the pump.
A solenoid valve solves this problem, and unlike a pump, is designed to block the flow of liquid at some pressure.
A check valve is another solution. However, to open a check valve requires some mechanical work, reducing the efficiency of the pump. Even when open, a check valve introduces more fluid friction than a solenoid valve.
There is an electrical analogy to this dilemma: active rectification. This is when an active device like a MOSFET is used in place of a diode. Whereas a diode has a forward voltage of typically 0.65V, a properly selected MOSFET can have a forward voltage of some mV. This in turn reduces losses in the rectifier. The tradeoff is increased parts cost and complexity. |
H: How to measure current practically in a circuit
I have to measure this circuit, I have done the theoretical calculations using Kirchhoff's 2nd law, but I'm having troubles in measuring the current in each part of the circuit:
I have to measure current in I1, I2 and I3 practically, so where I need open the circuit to obtain the current closing the net using a multimeter?
simulate this circuit – Schematic created using CircuitLab
AI: You don't need to open up the circuit at all, if you know you can trust the resistors.
If you measure the voltage across R3 you get a reading proportional to the current by I3 = V3 / R3. Or, put simply, with R3 being 1kOhm, you get 1V for each 1mA through R3.
If you measure across R2 you get a voltage proportional to the current I2, by: I2 = V2 / R2. Or, again simply, with R2 being 2kOhm, you get 2V for each 1mA through R2.
If you measure across R1 you get the current through R1. Verify that the current Through R1 is the current through V1, which is also the current coming out of V1, which is in fact I1. |
H: Strategies for powering an ATtiny micro controller and 40W peltier from mains
I'm trying to power an ATtiny1634 at 5VDC and a 50W peltier element at 12VDC. The microcontroller will, amongst other things, turn on the peltier via a 5VDC non-latching relay. I want to use an embedded SMPS that will convert mains power to DC suitable for powering the aforementioned two devices. Also, I would prefer all components except the peltier to be PCB mounted as the components need to fit within a tight space.
What different approaches are there to powering these devices?
In terms of simplicity I'm leaning towards a simple 5VDC 1W SMPS to power the micro controller and a 12VDC 40W SMPS for the peltier. The problem I have with this approach is that it becomes prohibitively expensive to put together. For PCB mounted power supplies in the 40W range, manufacturers like Tracopower charge ~USD 95, add in the 5VDC SMPS and that's over USD 100 just to power the devices.
Would using the 40W SMPS to power both sub-circuits be a viable option? If so, how?
It is still expensive to spend the USD 95 for the 40W SMSPS but it is an option if push comes to shove.
AI: Would using the 40W SMPS to power both sub-circuits be a viable option? If so, how?
Yes, that sounds likely. Your microcontroller circuit is likely to draw very little current. Unless energy efficiency is paramount, this means you can use a cheap linear regulator like a 7805 to get 5V from a 12V supply.
The biggest draw on the 5V circuit is likely the relay coil. To solve that problem, I'd suggest not using a 5V relay. Instead, use a 12V relay, and drive it via a transistor, like this:
simulate this circuit – Schematic created using CircuitLab
This way, the current necessary to run the relay coil is drawn from the efficient 12V supply, and your 7805 won't get hot. |
H: 8V AC signal into 3.3V digital input pin
I'm a noob and I'm doing this to learn, basically.
I have a typical old-style door bell with a transformer that outputs 8V AC, the wire the goes through the push button on the door and finally hits a solenoid-based ding-dong thingy.
I'd like to tap into this circuit and extract a signal that I can safely feed into one of the digital 3.3V input pins of my very delicate Raspberry PI.
I have a few diodes, capacitors, resistors, a couple of transistors and a lot to learn.
AI: You can use one of your pretty transistors and a couple of the diodes, resistors and capacitors in several ways, here's one:
simulate this circuit – Schematic created using CircuitLab
NOTE ABOUT VALUES: I just estimated the value of capacitor C1. If the RasPi sees a 50Hz or 60Hz (depending on your location) on/off when you keep the button pushed, it's too small. I guesstimate it to run empty in about 200ms, but since the diode doesn't full rectification if I'm off by too much... If it is too large the signal will stay on much longer than the button press, up to you if you mind about that.
For this design it is very very important to always only use AC power supplies that are unrelated to your Raspberry Pi. If the Raspberry Pi is powered from the same AC power source through a rectifier and capacitor, don't connect BELL Wire 2, or this will cause serious problems!
The Diode sends the current only into the capacitor. The capacitor gets charged when BELL Wire 1 is higher than BELL Wire 2, when BELL Wire 2 is higher than BELL Wire 1 the Diode blocks any current that wants to escape out of the capacitor.
The capacitor's "sort of DC" now feeds the resistor's base through R1, allowing it to turn on. This then pulls the RasPi input pin down to its GND, away from the 3.3V Power that it was fed through R2.
Once the BELL transformer's power disappears the capacitor will empty itself into the transistor and after a very short time (much less than a second) the transistor will have depleted it so much it will switch off again, letting the RasPi pin go back high through R2.
So you do need to remember about this: The signal you see at the Raspberry Pi will be inverted: When the bell goes the Input Pin will be tied to GND (0) and when the button is not pushed it will go to 3.3V (1). |
H: How can I make a decent ground plane in Eagle?
I've made a couple of simple PCBs as a hobbyist, and for the first time now I want to add a ground plane pour but I'm having some issues.
As I have currently understood I need to:
Create a polygon along the outline of my board with the polygon tool
Rename it to GND
Set a clearance
Turn on thermals for easier soldering
Click on ratsnest after manual/auto routing
The problem is that I'm getting empty spaces after doing an auto-route test and clicking ratsnest and the inner ground planes don't seem to be connected to the outer ones
Image:
What am I doing wrong?
AI: For a simple two-sided board, start by creating a ground polygon on the whole bottom layer. The trick then is to get Eagle to route most of the connections on the top layer. To do this, make the cost of routing within a polygon high and the via cost low. Actually you want to start with parameters more likely to find a solution, then tighten up the requirements over multiple optimization passes.
Before auto-routing, route the critical traces manually, and connect any grounds you can right at the pad to the ground layer. That will cause it not to waste routing space connecting the grounds.
Of course this all has to start with good layout that tries to put connected things near each other and oriented to have as few crossovers as possible.
After the auto-routing, you have to do some manual cleanup. The measure of a ground plane is how small the maximum dimension is of any island. Lots of small islands are better than a few big ones. This means you want the ground plane to flow around every via if possible. Unfortunately Eagle tends to clump vias, even with the hugging parameter set to 0. You can't set it negative, I tried. This means you have to see what the auto-router did and move things around a little to try to break up clumps of vias.
It's mostly about using the auto-router properly and realizing it's a tool, not a substitute for your own brain. If you are expecting fire and forget, you aren't going to get good boards.
Anyway, here is a auto-router control file from one of my 2 layer boards with the bottom layer a ground plane:
[Default]
RoutingGrid = 4mil
; Trace Parameters:
tpViaShape = Round
; Preferred Directions:
PrefDir.1 = *
PrefDir.2 = 0
PrefDir.3 = 0
PrefDir.4 = 0
PrefDir.5 = 0
PrefDir.6 = 0
PrefDir.7 = 0
PrefDir.8 = 0
PrefDir.9 = 0
PrefDir.10 = 0
PrefDir.11 = 0
PrefDir.12 = 0
PrefDir.13 = 0
PrefDir.14 = 0
PrefDir.15 = 0
PrefDir.16 = *
Active = 1
; Cost Factors:
cfVia = 50
cfNonPref = 5
cfChangeDir = 2
cfOrthStep = 2
cfDiagStep = 3
cfExtdStep = 0
cfBonusStep = 1
cfMalusStep = 1
cfPadImpact = 4
cfSmdImpact = 4
cfBusImpact = 0
cfHugging = 3
cfAvoid = 4
cfPolygon = 10
cfBase.1 = 0
cfBase.2 = 1
cfBase.3 = 1
cfBase.4 = 1
cfBase.5 = 1
cfBase.6 = 1
cfBase.7 = 1
cfBase.8 = 1
cfBase.9 = 1
cfBase.10 = 1
cfBase.11 = 1
cfBase.12 = 1
cfBase.13 = 1
cfBase.14 = 1
cfBase.15 = 1
cfBase.16 = 5
; Maximum Number of...:
mnVias = 20
mnSegments = 9999
mnExtdSteps = 9999
mnRipupLevel = 50
mnRipupSteps = 300
mnRipupTotal = 500
[Follow-me]
@Route
Active = 1
cfVia = 8
cfBase.16 = 0
mnRipupLevel = 10
mnRipupSteps = 100
mnRipupTotal = 100
[Busses]
@Route
Active = 1
cfVia = 10
cfChangeDir = 5
cfBusImpact = 4
cfPolygon = 25
cfBase.16 = 10
mnVias = 0
mnRipupLevel = 10
mnRipupSteps = 100
mnRipupTotal = 100
[Route]
@Default
Active = 1
[Optimize1]
@Route
Active = 1
cfVia = 99
cfNonPref = 4
cfChangeDir = 4
cfExtdStep = 1
cfHugging = 1
cfPolygon = 30
cfBase.16 = 10
mnExtdSteps = 20
mnRipupLevel = 0
mnRipupSteps = 100
mnRipupTotal = 100
[Optimize2]
@Optimize1
Active = 1
cfNonPref = 3
cfChangeDir = 3
cfBonusStep = 2
cfMalusStep = 2
cfPadImpact = 2
cfSmdImpact = 2
cfHugging = 0
cfPolygon = 40
mnExtdSteps = 15
[Optimize3]
@Optimize2
Active = 1
cfVia = 80
cfNonPref = 2
cfChangeDir = 2
cfPadImpact = 0
cfSmdImpact = 0
cfPolygon = 50
mnExtdSteps = 10
[Optimize4]
@Optimize3
Active = 1
cfVia = 60
cfNonPref = 1
cfPolygon = 60
cfBase.16 = 12
[Optimize5]
@Optimize4
Active = 1
cfVia = 40
cfNonPref = 0
cfPolygon = 70
cfBase.16 = 14
mnExtdSteps = 5
[Optimize6]
@Optimize5
Active = 1
cfVia = 20
cfBase.16 = 16
[Optimize7]
@Optimize6
Active = 1
cfBase.16 = 18
[Optimize8]
@Optimize7
Active = 1
cfBase.16 = 20 |
H: Inductor calculation for DC to DC converter
How can I calculate the value and characteristics of inductor in a DC to DC converter?
AI: A really great walk-through on DC-DC converter (Buck topology specifically) design calculations can be found at this Microchip Technology's web seminar slideshow. The seminar covers these important topics:
Calculate the required inductor
Calculate the output capacitor requirements
Select the input capacitor
Select the diode
Choose the MOSFET
Calculate the converter Efficiency
You need to know things like the input voltage, intended output voltage, acceptable input and output ripple voltage for your system/converter IC, and current requirements, as well as the switching frequency of your DC-DC converter IC. |
H: Adding more LEDs to a current regulating circuit
I am modifying a current regulating circuit that was designed to power three LED lights (see figure below). The circuit is designed to maintain current through the LEDs at 1A. The LEDs should be off when no PWM signals are input (the PWM signals are sent by an Arduino Mega). In the diagram, SJ1 SJ2 and SJ3 are regular BJTs and BJ1 is a power BJT.
I now want to power six LEDs instead of three. Is it as simple as adding three more LEDs in series with the original three? Or do I need to modify components of the circuit?
AI: Let's see if we can put all six LEDs in series first. The resistors BR1 and BR2 are in parallel, so their parallel resistance is 0.75Ω. At 1A of current, that's a voltage drop across the resistors of 0.75V. Above that, we'll assume BJ1 is in saturation. The datasheet you linked to doesn't give us the Vce(sat) at 1A, so we'll use the 5A number of 1V.
So 0.75V from the resistors and 1V from BJ1 means there's only 10.25V left for the LEDs. Dividing that by six gives you about 1.7V per LED. If the LEDs have a forward voltage drop of less than 1.7V at 1A, then you're good to go. But I doubt you'll be that lucky.
Inevitably, you'll probably need to put the other three LEDs in parallel with the first three. There's a couple of ways to do that. Here's one way that doesn't add too much more complexity to what you already have.
simulate this circuit – Schematic created using CircuitLab
This circuit effectively increases the total current through BJ1 to 2A. Each string of three LEDs will get 1A. From the datasheet, it looks like BJ1 can handle the current, so no need to change the transistor. I did have to change the resistance of SR3 to bias BJ1 to get 2A. The datasheet only gives a DC gain of 40 at 0.5A and 15 at 5A, so I picked 25. YMMV.
You might be tempted to just put the two strings of LEDs in parallel and be done with it, but unfortunately LEDs have a little "gotcha" when put in parallel. As LEDs heat up their forward voltage drop, Vf, decreases. When the Vf decreases, more current will flow through the LED making it hotter and further reduces its Vf. If the two strings of parallel LEDs were perfectly matched (as a simulator would probably do) this woudn't be a problem. But in the real world, the LEDs on one side will lose a tiny bit more Vf than the other side as the current starts to flow due to manufacturing variability. A tiny bit more current will start to flow through that string, which will heat those LEDs up even more, further reducing their Vf. All the while, the other string is being robbed of current. The end result is that one string of LEDs will be significantly brighter than the other. It might also cause the LEDs to fail if they can't handle more than 1A.
The solution is to put a small resistor in series with each string. Regular resistors have a positive temperature coefficient, so as they heat up, their resistance rises a little bit. That counteracts the effect of the Vf drop in the LEDs and works to balance the current through the two strings of LEDs. You'll see in the circuit above, I added R1 and R2 to serve that purpose.
Other than that, the reason for adding BR3 and BR4 should be obvious. With twice as much current, you want half the resistance so that the voltage drop across those resistors stays the same and SJ3 is properly biased to act as the current limiter.
Keep in mind those resistors are taking a lot of current. R1 and R2 are dissipating 1W each and BR1-4 are dissipating 0.375W each. Even SR3 may be dissipating nearly a Watt. Common 0.25W resistors will burn up in this circuit. You'll need to source resistors that can handle the heat, or put more resistors in parallel to get the same resistance. |
H: Identifying a part from game console controller
I need help identifying the following part. It came out of an old console game controller. It's labeled "SUP A9 103J". Googling it did not help. It's got ten pins and it was soldered into a space labeled "x9". I think it's some sort of crystal, but I'm not sure.
AI: That is very likely a resistor network/array.
And is used where you have a lot of parallel signals you need pulled up or down or even individual resistors.
This picture is snipped from the Bournes catalogue.
and comes in many internal resistor styles |
H: The right way to read a circuit
I can easily understand these simple circuits:
or
but I can't wrap my head around this:
Not (A AND B) is all I get, but there is still a logical sum at the end (OR) and I have no idea where to put it
but for this, I can understand:
Not (A AND B)
AI: I find it helpful to work right to left. The last gate is an OR gate. Forget about what the actual inputs are for the moment. They're just two inputs. Let's call them X and Y.
simulate this circuit – Schematic created using CircuitLab
Now let's look at the X input. You already appear to understand that it is (A AND B), so let's substitute that in for X:
simulate this circuit
Obviously, input Y is nothing more than (NOT B), so substitute that in for Y:
simulate this circuit
And that's it. |
H: Circuits in audio amplifiers to protect speakers
I hear that there are at least two kinds of circuits in modern audio amplifiers solely for the purpose of protecting the speakers against excessive loads on powering on and off.
Particular function of these circuits is delaying the connecting of speakers so long that there is reasonable probability of the amplifier to have become stabilised on powering on; and disconnecting the speakers prior to powering the amp off.
The effect is that neither on powering on or on powering the amp off the speakers produce a loud pop or boom, as the simpler older amps used to do.
My question is how exactly are these circuits called and what is their typical setup.
Background: I have two Behringer EPQ304's, and one of them always pops on powering off, and my googling produced little insight so far. English is my second language, so perhaps I've missed the proper names. But I'm interested in the design as well.
AI: These circuits are often called "soft-start" or "pop-suppression" or "speaker-protection". There are probably other names but I don't think there's a standard.
A popular protection circuit uses relays to connect the amplifier output to the speaker connector. There are several ways to control the relay:
Keep the relay disconnected for x seconds after power-on, giving the amplifier time to settle, then close the relay to connect the speaker. This alone would eliminate your pop at power-on. You can also disconnect the speaker when the power is turned off (but before the amplifier power supply drops too low to work) to eliminate a thump at turn-off.
A more sophisticated relay-based protection circuit would low-pass filter the output signal to look for any DC component and disconnect the speaker if it detects it. DC can burn out any non-AC-coupled speaker (like a woofer), and audio amps don't need to go below ~20Hz, so any DC component would indicate a fault condition and the relay would open to disconnect/protect the speaker. Typically DC faults are caused by failed transistors or the collapse of one of the supply rails. Depending on the design, this could be used WITH the above delayed-solution or instead of it (since the thump during power-on is usually a low-frequency transient that the DC detector could catch).
Many amplifier designs also monitor the temperature of the output transistors and disconnect the speakers if they go above the max temp the design allows.
A lot of audiophiles believe relays color the sound, and the resistance of relay contacts can degrade over time, so some amp designers add solid-state circuits that remove the biasing from the output transistors to effectively disconnect the amp, and provide a soft-start function during power-on. This might not provide quite as robust protection as a relay, but it's a good solution.
If your goal is to fix the amp with the turn-off thump, there are two options:
Add a relay and a circuit that detects when the power supply starts to fall that disconnects the speaker.
Since one of your amps doesn't have the problem, try to find out what's different between the amps. If you can find and post a schematic I could tell you what to probe for - we might be able to troubleshoot it with just a voltmeter... It's possible that the noisy amp has a protection circuit that's not working correctly, but it's also possible that the quiet amp just happens to be more "balanced" during power-down (the supplies come down more symmetrically or in a way that turns off the correct output transistor earlier)... |
H: Creating an adjustable output regulator, in LTspice
Firstly, I'm having some trouble with simulating a variable resistor in LTspice.. I am wondering if this can be done?
Also, does anyone have any advice on how to theoretically analyse this circuit? I mean, the data sheet gives a formula for Vo but I think it's a little vague, any pointers in the right direction to derive this would be great as well.
AI: The output voltage of a 7805 is 5V relative to pin 2 - if pin 2 is raised a volt above ground then the output voltage is 6 volts relative to ground. Because there will always be a small (and fairly constant) current flowing to ground from pin 2 (usually about 4mA =\$I_Q\$), the offset voltage on pin 2 can be 1V (if R is 250 ohms) or if you wish to do it more accurately you can use two resistors, R1 and R2 forming a potential divider from the output to ground. This uses the more complex formula in your question and \$I_Q\$ is as stated above i.e. about 4mA. \$V_{XX}\$ is the output voltage if pin 2 were grounded i.e. 5V for a 7805.
However, your circuit uses an op-amp to raise pin 2 so whatever voltage is at the output of the op-amp adds to the 5V on the output just as if you inserted one resistor in the common line. |
H: Short circuit protection for high current wearable: fuse, polyswitch, TBU, circuit breaker, something else?
I am thinking about design elements for a rather high current, battery powered, wearable application. Maximum current of 40A at 5V, but typically around a third to a half of that.
Power would come from RC car battery packs through a DC-DC converter. The packs typically do not have built-in over current protection, so I would need to provide my own.
I want the over-current protection for two reasons:
Personal safety. If you try and draw more than the rated current out of a lithium chemistry battery strapped to your back, you're gonna have a bad time.
Circuit protection. It's a wearable application and things move, grind against each other and short out. I don't want to kill the battery itself or the rest of my circuit when that happens.
From my investigations so far, it seems a glass fuse or polyswitch won't trip quickly enough, a TBU tops out at hold currents of under 2A, and most circuit breakers are built for AC house wiring.
What kind of device should I be looking for?
AI: EDIT1: See below for some more info about your implementation and a current trip to put inside or tightly fixed to the battery pack to prevent fires or explosions. Only just now saw you provided links.
200W of LED... you are going to be brighter than the pyres. Anyway, be careful and enjoy.
(oh, and, often made mistake: Make sure there's a bit of highly flexible wire connected to each component in a jacket, normal single-core test wire will snap off. Headphone wire may be obtainable, I love the stuff)
What you should do is protect the batteries with a Cell management board or chip. Many higher-end battery packs aimed at a specific car/plane/helicopter actually do already have them inside, because it's quite important always and everywhere.
Cheap eBay/Alibaba packs won't have them, often even if it is said they do.
Then, add any type of hard-switching protection at 1.5 times the limit of the protection unit.
What such a system does is measure:
The current coming in when charging
The current going out when discharging
The cell voltage of each battery
And sometimes, or maybe even often, they also balance the cells at the end of charging.
You can make your own electronic current trip with a mosfet, a low value resistor and a rail-to-rail op-amp. Or a dual op-amp if the calculations have to be a bit easier. Just make sure you use a balance charger if you want to be able to use it as often as possible. Unfortunately I have to run now, else I might have added the full schematic as a bonus.
EDIT1, Content: First some babble about batteries and DC-DC converters (skip ahead to the next heading if it bores you, but it may prove valuable).
To put some things into perspective, you have to realise that the battery pack is only 4.8Ah, and often, if not always, that energy content is measured at a relatively low discharge current, maybe in this case about 2.4A. If you draw ten times as much, the usable capacity will drop noticeably.
But, let's be optimistic and say you will get a draw of 20A and maintain a 4.5Ah usable capacity. This will mean that that will only last 4.5Ah / 20A = 0.225hours = 13.5minutes. I can't say if you'll be happy with that, but I just wanted to make sure you had seen the numbers. And remember, that 4.5Ah will probably be quite optimistic.
About the DC-DC converter, I was utterly unable to get actual graphical or failing that, tabular, data about the input to output range requirements or specifications, so I will assume the stated "minimum efficiency", although I have no information whether that's with 0.2V between input and output, or minimum 2V, in the latter case, the converter may perform worse once the battery starts running out.
So, from the curve of an average lithium polymer battery I am going to very coarsely generalise to a 7.1V average voltage over battery life, to make the calculations easier. For info: A cell goes from 2.5V to 4.25V over it's charge cycle and backwards over discharge, the exact curves and densities depend on total current again, so this quickly becomes a complex set of differentials, and since it's only a "for your info", I'm going to be generalising it to "let's say 7.1V on average at constant current".
Considering everything, if the DC-DC does 20A out at 5V, that's an output power of 100W. That 100W, at the lowest specified efficiency is 82% of the input power. So the input power has to be: 100W * (100/82) = 122W. Be aware, this means 22W sticks inside the converter = hawtness! Keep it on the outside of the outfit and reasonably ventilated. 122W means: 122W/7.1V = 17.2A. With 4.5Ah (lightly derated, as above), that's 4.5Ah/17.2A = 0.262 hours = 15.72 minutes = 15 minutes and 43.2 seconds.
As a note: You can improve the efficiency at several points by getting a 3S cell of 11.1V, to give the battery pack a lower current draw and the DC-DC converter more room to operate efficiently. (Or a different DC/DC with a 22.2V pack, that'll really take the weight off the current draw in the pack, but presumably, those aren't as affordable if you're not buying 200 at a time).
Now, some Current Trippy Calculations! Yay!
Now, if you want to be safe, you take a 25A trip current per battery pack. This may already warm them up, even if they can take 140A, so prepare to solve some light discomfort. In fact, if you do it properly, you anticipate the worst: Failure of the protection and explosion and wear the batteries on the outside with two or three layers of sturdy jeans cloth between you and them, possibly a thin layer of softer cloth between two layers to spread the pressure. Just a precaution, can't hurt, right?
I will walk through the calculations after the circuit diagram, using 25A. If you want 40A or higher, at your own risk, you can substitute that current for 25A and walk through the calculations and searches to find your new components. (Or if ever you need a 4A trip on a battery that's possible with the same instructions too).
simulate this circuit – Schematic created using CircuitLab
Now, as if this isn't long-winded enough, there's more!
OP-AMPS:
First: Finding the right op-amp. That's a bit of a tough one, because either the supplier doesn't include an interesting parameter, like a cost indication (forcing you to go back and forth between a supplier site), or no broad searching, forcing you to dive into small sub-cathergories. I slightly arbitrarily chose Texas Instruments. With the "Click the biggest number until you get to search by parameters" strategy. As I said, these people need to learn a little about searching still.
So I came out here: TI OpAmp pre-configured Parametric
I put in:
Total supply voltage min <= 4.5V (very low battery)
Total supply voltage max >= 10V (peak charging surges, allow a few volts above battery Vmax
GBW(MHz) >= 0.152 (Gain BandWidth is, to simplify quite a bit, the point where the amp stops amplifying, 152kHz still allows well below 1ms reaction, 1ms should be okay, so we don't need many-MHz GBW.
Iq(perChannel) <= 0.45mA (This is the supply current per Amp. 1/10000th of the battery capacity is likely going to be well below the battery's self-discharge, so this maximum value should be okay.
Vos <= 3mV (This is quite conservative/restrictive, but it gives plenty results. The lower this is the better, but 3mV already is decent enough. Vos is, to again oversimplify, the voltage below which the Amp may not "notice" the input voltage difference. I chose a 125mV trip target, so 3mV would be 2-ish%. See the resistor choice for more info.)
I then sorted it by unit cost (lowest first) and scrolled down until I found a dual channel rail-to-rail model. Rail to rail means the outputs and/or the inputs can go all the way to the supply voltage. Normal Op-Amps do not always allow you to go all the way to either supply voltage with reliable output response. Rail to rail saves a lot on testing, trying and reading, at only $1 maximum extra cost. I say: Worth it for this application! Especially since you want to push as strongly onto the mosfet's gate as you can (more about this further on).
So I came to TLC2262 with 1mV offset, low input bias current, decent gain bandwith, etc. And the datasheet (check this, always!) says clearly that the "common mode input voltage" includes the negative rail. That means the opAmp will allow us to measure the very very low voltages across the resistor.
RESISTOR R1:
Next is the measurement resistor, R1. I chose to go for a 125mV upper trip voltage. The lower you go, the less power you waste. But, if you go too low, you'll be getting insane resistor values. I think, possibly, 5mOhm is already very low for a DIY design, but there's likely some to be had with reliable connections. What you will need is a resistor with some way of connecting the current path to two main pins, and connect your measurement at two points exactly where the resistor starts. Because the wires of the resistor will quickly distort your measurement. Imagine a power resistor like this:
simulate this circuit
If you measure at the ends of the wires, you measure over 9mOhm, where you expect 5mOhm, that's nearly double! So, you connect the opAmp as close to the actual resistor as you can, with as little as current carrying wire between it.
Now, we chose 5mOhm. At 25A peak current, we can calculate the resistor's power dissipation, by: P = I^2 * R = 25A * 25A * 0.005Ohm = 3.125W. The schematic shows 5W for certainty.
I'll assume in the next calculations that you can get reliable connections. If not, you could test with a high current lab supply (10A for example) and a decent multimeter to see what the voltage per 25A would be (2.5 times what you measure at 10A).
So, with R = 0.005 Ohm (5mOhm), we can calculate the voltage drop as follows: V = I * R = 25A * 0.005Ohm = 0.125V = 125mV. We'll call this V(r1) later.
DIODE
Then we need to look at D1. If we estimate the voltage across D1 to be about 0.5V, we can calculate the current through it using our estimated average battery voltage of 7.1V and resistor R4, of 120kOhm.: V(r4) = Vbat - Vdiode = 7.1 - 0.5 = 6.6V. Idiode = I(r4) = 6.6V / 120kOhm = 55uA. (is nice and low). Now to properly finish the calculations, we need to look at the 1N4148 datasheet. The 1N4148 from Vishay is cheap, easy to get and very good for this purpose, so we look at: 1N4148
On page 2, in Figure 2, we can see what the forward voltage is (Vdiode) for a forward current. Unfortunately the graph goes only to 100uA, but since the diode responds nice and smooth in the lower region, approaching a certain asymptote at 0.00001uA, we can extrapolate about Vf(diode) = 0.45V at 55uA. Seems we were off by about 50mV. We can keep itterating, but the resistor is quite large and so is the voltage across it, so on balance, we'll be "close enough" for a 24A to 27A trip window, so to speak. In figure 1 we can see that the Vf(diode) decreases with higher temperature, so if the batteries get warm, the current monitor will shut off sooner, sounds like a good feature.
OP-AMP Function and math
Now, Op-Amp OA1-B (2nd part of the TLC dual Op-Amp) is used as a comperator. There's no feedback from the output to the inputs. This means that if the negative (-) input gets above the positive (+) input the Amp will swing its output low. When + is higher the Amp will swing high. So if the voltage coming from OA1-A is marginally higher (connected to the - input) than the diode voltage of 0.45V (connected to the + input) the Op-Amp will turn off the MOSFET.
For now, ignore R8, R9, LED1 and Q1, at the moment, they have no sufficiently significant effect at all.
Here comes some OpAmp magic math for OA1-A. An OpAmp, in its simplest definition (which we can be reasonably allowed to assume in this specific case of OA1-A), tries to get its negative (-) input to get the same voltage as its positive (+) input, by adjusting the output.
So, if the current trip gets activated, the resistor voltage, V(r1) is 125mV as we calculated before using the resistor value and trip current. Assuming this point, the OpAmp + input will be 125mV higher than the battery's negative terminal. Now the OpAmp tries to get V- to the same voltage. Assuming it will achieve this, the voltage across R2 is also 125mV. Now, an OpAmp cannot put any significant current out of or into its inputs, so the current has to come from the output of the OpAmp through the feedback resistor, R3. So the current through R2 and R3 are (roughly) the same.
R2 and R3 (As a continuation of OP-Amp Math)
Current through R2 and R3:
I(r3) = I(r2) = V(r2) / R2 = V(r1) / R2 = 125mV / 7.5kOhm = 16.7uA. (V(r2) can be substituted by V(r1) because of the Op-Amp's desire to get its - and + input to the same voltage).
Now we want the output to become the same as the diode voltage at the exact trip point, so that a tiny bit over will turn off the MOSFET. So, the voltage across R3 has to be:
V(r3) = Vf(diode) - V(r2) = Vf(diode) - V(r1) = 0.45V - 0.125V = 0.325V (again the substitution because of the Op-Amp's feedback behaviour).
Which gives: R3 = V(r3) / I(r3) = 0.325V / 16.7uA = 19.5kOhm.
So the relation between R3 and R2 is R3/R2 = 2.6
so in the above schematic we can substitute the given values by any standard/findable values that are a factor 2.6 apart, because that will keep the same balance. But try to keep the R2 between 1kOhm and 10kOhm, so that you stay within the area of low-leakage, but reasonable signal (10uA to 150uA). 1.5kOhm and 3.9kOhm would be an option, or 2.0kOhm and 5.2kOhm, or, possibly, 10kOhm and 26kOhm.
WHY R5?
The 220Ohm R5 is just a precaution. It avoids the OpAmp quickly trying to source a large current into the gate, protecting both which ever OpAmp you use and the MOSFET.
The MOSFET
The MOSFET: This is again a bit tricky. It comes from years of developing experience to choose a high-power MOSFET. 10 to 15 Years ago, I might have said "Take a look at Bipolar Transistors, because they might probably be better suited", but these days, for steady high-current conduction: MOSFET!
Now, what you want primarily: Low on resistance (R(ds)-on) at your operating conditions. The higher the on resistance the more power you will be throwing away in the MOSFET. Throwing away power = not favourable. So, if you can get 0 in your budget, get 0. Of course, getting 0 is not possible, and in your budget the constriction may well push you up to 3mOhm R(ds)On at optimum, or 10mOhm to 20mOhm R(ds)On with a maximum obtainable gate voltage of about 7V. The higher the gate voltage (up to a limit: every datasheet will tell you at which gate voltage it will break "V(gs) Max") the better. So with a 3S battery in stead of a 2S battery you will get better MOSFET conduction as well.
Next, you want to make sure it can actually conduct the currents you want to put through it and that you have a package you feel comfortable with cooling if necessary. At this point I chose International Rectifier, because I have never bought an IR MOSFET and got sad once I started using it. To my feelings they really deliver on the specifications and graphs they supply, so that's a good quality when you're looking to put high currents through something.
So I went here: International Rectifier "StrongIRFET" table
Now, IR has different series, and another series may well give you more affordable options than I am doing, but I will leave some research (at this point I am 3 hours in) to you as well :-). I liked my chances with the name "StrongIRFET" and the results did not disappoint.
So, I sorted by R(ds)On, because you need to choose something and in this case that's as good as any.
Then, I scrolled down to find a nice package, with 20 years of fiddlin' experience my eyes filter package names almost instantly on "This is SMD", "This is Through Hole" and "This is Nonsense" (and many sub categories). But to make a small, crude, guide, if it says "TO2**?", where *'s are numbers and ? is either not present or a letter, it's very likely to be a through-hole package with a nice screw hole for mounting it to a piece of metal, to get rid of heat. These, for people starting out with MOSFETS, are probably your best choice. Click one of those, check the datasheet, check the mouser price, check to see if you have achieved a balance of happiness between $$$ and HAWT-HAWT-HAWT. How? Easy!...-ish.
The example MOSFET: IRFP7430. In the datasheet (<-- click), on page 2 it says something quite awesome. Second table (for 25degrees C), third line, R(ds)On is 1.2mOhm with Id = 50A and Vgs = 6V. That sounds attainable! But, in electronics design you are forced into a life of pessimism, so we look on for graphs. Graphs are our friends.
On page 4 compare Fig 3 and Fig 4. If it's hotter, it conducts off the flipping charts! Well, there's some stuff going on there, which I won't go into, but basically, if we use the graph for 25degree C, it's likely okay.
So. We assume our lowest battery voltage is 5V, so V(gs) will be near the 4.8V mark. In effect, pessimism again driving us to use the 4.8V curve (One up from the bottom one). Fig 3 then shows us that at 20A, in the worst case scenario, we will be "dropping" 0.25V. That's a lot! But remember, in this case the battery is already pretty much empty, so it won't be long anyway.
Calculating the power lost: P = I * V = 20A * 0.25V = 5W. So you will need a heatsink or other piece of metal to get rid of some of the heat.
Now, during "average operation", with 7.1V the V(gs) will probably reach near 6.8V. Since 6.0V and 7.0V aren't that far apart in the graph we'll estimate about halfway between them. Problem. The current versus voltage is out of our range of our upper-limit of 25A.
But, we can make an estimation, that with the logarithmic scale of both axis and a slightly sub-linear behaviour at 25A the voltage drop will be about 55mV. I do this using a ruler and a tiny bit of human-brain-interpolation (artists call this imagination, but I think that sounds wishy-washy). So in its average trip-current operating area it will be dissipating: P = V * I = 0.055V * 25A = 1.38W. That's better than the tiny eensy weensy resistor we chose. Awesome!
So, now to the mouser (just an indication): IRFP7430PBF
Ugh! $6.86? May be acceptable, but still, NEXT! (by the way, you can do the mouser first if you have a tight budget, saves a lot of graphs, but for a decent example I chose to do it the wrong way around).
Next MOSFET: irfp7537
Looks nice and beefy. We learnt from our mistake, mouser first.
Mouser: IRFP7537PBF
Hm, $3.22. Much better.
Now the graphs, clicky the link above for the datasheet (after "Next MOSFET"). Comparing Fig 1 of this one with Fig 1 of the previous one, it's already clear why this one is half the cost. It's double the resistance! But still, a few quick calculations using the previously displayed methods:
Ultra low battery, V(gs) = 4.8V, estimated halfway between 4.5V and 5.0V line, worst case at 20A: V(ds) = 0.25V. Hay! Same! So these MOSFETs do have some commonalities. So again, add metal.
Average battery: V(gs) = 6.8V, graph somewhere between 6.0V and 7.0V. This time the edge is at 30A with 0.1V, so 25A is probably around 0.08V in stead of 0.055V. So with this one the trip-current average dissipation is: P = 0.08V * 25A = 2W. Still less than the resistor!
So, in effect you can also choose the second one, because the DC/DC converter, the wires, the battery's internal resistor and the measurement resistor all put together still waste much more energy then your MOSFET.
R6, R7, R8, R9, Q1, SW1
Now there's just one problem to fix: Once the current is tripped, the MOSFET turns off, this is good. But, then there's no current any more. So the Op-Amp OA1-A goes to "no over current measured" mode again. This would mean that the Op-Amp OA1-B then turns on the MOSFET again. But very quickly. In the span of fractions of a millisecond. So it would start oscillating and effectively limiting the current continuously, but increasing the heat in the MOSFET rapidly.
To solve this, Q1 and some resistors are thrown in as "memory". If the Op-Amp OA1-B goes low, to turn off the MOSFET, the transistor Q1 turns on. Q1 then sources current into the Op-Amp OA1-B's negative and the LED through R9. R8 makes sure that the Op-Amp OA1-A isn't bothered by this (since OA1-A wants its output to be 0V).
This situation means the Op-Amp OA1-B keeps seeing a much higher voltage at it's - input than the + input, keeping the output low, and the MOSFET off. Also, the LED lights up to notify you: "I have triggered an over-current!". (Use a low-current or high-brightness LED though, as I chose to keep the current small).
Now if you press SW1, you will hard-wire the Q1's base to the battery +, thus turning the transistor off, and resetting the schematic to its normal state. Unless the over-current is still there, in which case pressing the switch will cause the oscillation described earlier. So it's a good idea to not keep the button pressed for very long, just in case.
NOTE1: It is possible for the system to fluke into Q1 being on at first connect of the battery, a quick push of the button should fix that.
NOTE2: You can also charge the battery through the MOSFET in ideal circumstances, but to avoid causing weird behaviour in the Op-Amps, it's best to charge the battery directly, without this switching-schematic in between.
NO SUMMARY ...... I'M TIRED NOW! IT's 6:10AM Again.
I was planning on summarising all the formulas, but since I'm over 5 hours into this post now, I think I'll leave that to the reader. |
H: Which NTP server should I use for my product to update time?
I am developing a GPRS enabled embedded device.To synchronize time with the network I have to use NTP protocol.
The nature of the product is such that I have to Hardcode the NTP server address inside the firmware and I cannot change it in future by any means. The estimated quantity of the devices to be sold is in thousand and location is India.
After googling about NTP servers I am not able to figure out which server should I use.
The given link mentions about some incidents caused due to wrong NTP client configurations.
NTP Server misuse and abuse
I don't want fall into such trouble please help me choosing correct NTP server Address.
AI: I'd contact ntp.org. They have a pool of public NTP servers with DNS anycast for geographic proximity and are generally able to give good suggestions.
You might be asked to use a subdomain (e.g. Debian uses "debian.pool.ntp.org") so if a malfunction in your devices causes a traffic storm this can be reflected without affecting the rest of the pool. |
H: Can I swap any two lithium cells on an MP3 player / camera, etc?
Lithium batteries commonly have +/- and temp monitor connections. I'm pretty sure I can swap a 290 mAh MP3 battery with a 1400 mAh battery, it will charge very slowly.
Can I swap the temp sensor around on the two? Are they standard resistances / voltages? Can I measure if I can swap them around?
The 290mAh player battery reads +3.8V, sensor 3.5V
The 1400mAh battery reads +4.00V, sensor 3.95V
For now I am just wiring them both in parallel, not wiring the 1400 mAh battery sensor, I doubt it will overheat at 0.1C
It's for a Sansa Clip and a Canon battery.
AI: as pjc50 says in the comments, the temperature sensor inputs for the batteries are very commonly a 10K NTC thermal resistor. At room temperature, it should be approximately 10K ohms if you can multi-meter it. You can trick charging circuits by placing a 10K resistor to ground on the pin, if you have a battery which does not have a temperature input.
Obviously this is "less safe" than if you had a temperature sense input on the batteries, but if you are charging at a nice low current and it's a proper charging IC with the correct voltage and current charging modes, and safety timers built in etc it will be fine. |
H: What causes inaccuracy over time on a DMM?
Here is a piece of information from a datasheet of a DMM. The accuracy rates seemed interesting for me. I wonder what causes difference in the accuracy, especially the changes after 24 hrs? Is it only shunt related, or another components related issue?
Second question, what kind of equipment do you need to calibrate such DMMs for the best accuracy?
AI: The DC volts reading on a DMM is typically dependent on two things- the DC voltage reference and resistor ratios (for most ranges). Both of those drift with time.
AC volts is similar. Current is dependent on absolute resistor values as well as the reference and (probably) resistor ratios. All those drift with time. Ohms is mostly dependent on the absolute value of a reference resistor. Again, it drifts with time.
Wherever I mentioned time, also include humidity, mechanical stress, air pressure etc.
The actual physical reasons for the change with time might be impurities in the device, migration of metal or something else entirely. There seems to be a natural law that real things have a 'noise' (power spectral density of noise to be specific) that has a 1/f characteristic, which is typically what we call drift with time. This has been observed in many natural phenomena. You'll see this characteristic in op-noise too.
How do you calibrate a DMM? Keithley, Fluke and others will be happy to sell you a calibrator which will provide outputs you can use to calibrate your DMM. Of course the calibrator drifts with time too, but less than most DMMs because it's frighteningly expensive and uses very good parts and good techniques to reduce drift. Still, there will be a calibration period that you should have it calibrated by a lab. Their references they use to calibrate the calibrator also need to be calibrated, and they should be traceable to some internationally recognized standards lab such as NIST. If this is done properly you can trace the calibration of your $100 meter back to the standards lab (doesn't mean it will be accurate or reliable, but it should ensure that 1,000 DMMs are not calibrated with a 1.999V reference that is off by 5%. |
H: Gain vs. Directivity and effect of animal body to Antennas
My design works in a foresty area inside a collar of an elephant. These areas have at least -110dBm GSM strength (accurate ref. map linked) but, usually higher as I live in a small country where GSM coverage is easily provided.
Following is an excerpt from the datasheet of my GSM receiver
I am currently using a GSM antenna to receive GSM signals in harsh environment. But it may not be appropriate or the best suited. I'm wondering if I would have better reception if I chose an antenna with lower gain in my design.
Question 1: Does the gain of an antenna always increase with the decrease in directivity?
Question 2 : What type of GSM antenna is recommended for an application that can run in such low GSM coverage areas? What are the factors I should keep in mind to optimise this design to have higher possibility of connectivity?
Question 3 : What sort of an effect would the animals giant body have in the reception of GSM signals? If yes, what are the remedies I can do to reduce the impact of the same.
AI: Question 1: Does the gain of an antenna always increase with the
decrease in directivity?
Real antenna gain is nearly always referred to the theoretical isotropic antenna. The isotropic antenna emits power in all directions equally therefore it projects power onto the surface of a sphere where the antenna is at the centre of the sphere.
At distance r (radius of sphere), the power from an isotropic antenna is passing thru a spherical area of \$4 \pi r^2\$ square metres.
Normal antennas (such as dipoles) do not transmit this power in all directions therefore they are said to have a gain in certain directions compared to the isotropic antenna and, indeed there is more power per sq metre at a comparable distance, but this is beginning to become "directional". Therefore the higher the directionality of an antenna, the more power it concentrates in one direction (reciprocal for receiving antennas too) and the higher the gain.
Question 2 : What type of GSM antenna is recommended for an
application that can run in such low GSM coverage areas?
What is the likely incident power received and what is the minimum power needed by the receiver. A good figure for required power by the receiver is based on the signal data rate: -
Received power is -154dBm + 10\$log_{10}\$(data rate) - from this you can calculate the headroom, add maybe 20 dB for fade margin (could be lower if you accept a longer delay and you are moving).
Question 3 : What sort of an effect would the animals giant body have
in the reception of GSM signals? If yes, what are the remedies I can
do to reduce the impact of the same.
I have no idea. |
H: Design a 3-to-8 Decoder Using Only Three 2-to-4 Decoders
Using only three 2-to-4 decoders with enable and no other additional gates, implement a 3-to-8 decoder with enable. The inputs of the resulting 3-to-8 decoder should be labeled X[2..0] for the code input and E for the enable input. the outputs should be labeled Y[7..0].
Here's my current solution. My question is, is there a better/cleaner way to do this?
AI: There is no problem with your circuit. although I would suggest that you set pull-down resistors on the outputs. that's because the decoders usually set their outputs to high-impedance (high-Z) when they're not enabled. so the output may remain the same on the output node (because of node capacitance) and the wrong value may be read by the device that is reading the current output. making all the outputs pulled-down to GND will eliminate this problem and it will work correctly. Look at the picture below...
You can use a resistor array which is a nine pin element that has 8 resistor inside with a common pin that will be connected to ground! Easy! ;-)
simulate this circuit – Schematic created using CircuitLab |
H: Step up transformer for low frequency AC with DC offset
What is the best way to step-up a low frequency voltage with a DC offset?
I have the following signal coming from a function generator:
\begin{equation}
V_f(t)=8 Sin(2\pi f t+\phi) + 4
\end{equation}
Where:
$$(5 \leq f \leq 100) Hz$$
The desired output is:
\begin{equation}
V_f(t)=80 Sin(2\pi f t+\phi) + 40
\end{equation}
AI: The EE definition for a transformer is: -
"A transformer couples two or more AC signals through a magnetic
field. Often used as galvanic isolation and to transform one AC
voltage to another".
This means it won't step up the DC content of your signal. You'll need an amplifier and a power supply.
The desired output is: Vf(t)=80Sin(2πft+ϕ)+40
The peak-to peak output is 160 volts then add another 40 volts on top of that to accommodate the DC offset. It's going to be a specialist bit of design and nothing really easily found off-the-shelf. |
H: Relationship of antenna size to gain and directivity
This question is derived from certain answers I received for a previous question I posted.
Case : Let's say I have two GSM antennas of the exact same shape, design and material. The only difference is that one is 10 times larger in size than the other.
Question : What sort of impact would this have in the second antenna's directivity & gain?
AI: The shape very much affects how the size will play.
For the simple case of a dipole antenna, the best performance (in terms of power transfer) will be obtained with half the wavelength of the signal to be transmitted or received. You also get local minima in the impedance for values of \$k \lambda + \frac{\lambda}{2}\$, and increasing lambda will mean more directionality on the main lobe(s) but also more side lobes. Shortly put, it can be worse and typically \$\frac{\lambda}{2}\$ is the best.
If you have a more directional antenna like the yagi, the size will be primarily influenced by the main folded dipole , and the reflectors and directors will be sized accordingly. But a larger antenna may mean more directors (usually the reflector is one) and therefore, again, more directivity.
For other antennas like the parabolic reflector, size can improve gain/directionality but the benefits will get progressively lower. |
H: What is this power supply connector and why was it likely chosen over a 12V DC?
This is from a 3.5" hard drive enclosure that I am tempted to throw away since I don't have a plug. What likely influenced the design choice to use this sort of plug? The hard drive itself likely takes 12V DC as that is what a computer has.
AI: 3.5" computer drives, like hard drives or CD/DVD drives, all require +12V AND +5V to operate. In both IDE/PATA and SATA flavors. It's part of the standard. Since computers are expected to have both available through its power supply, disk manufacturers won't bother adding switching supplies to their boards.
As to why the enclosure manufacturer used that dual 12V/5V connector is for the same reason, to supply the needed voltages to the drive inside. Even if you bought the case with drive, the manufacturer might switch disk brands due to manufacturing or supply reasons, and they need to make sure that it works with whatever supply they already chose. It is also cheaper to go with an off the warehouse low amperage dual supply, then designing/sourcing a DC/DC step down regulator and needing a higher amperage 12V supply. Plus, size/space constraints. As well as heat constraints (passive cooling cases especially) And replacing an external supply is cheaper for warranty then having to replace internals etc etc. A variety of reasons. |
H: Catch both sides of a clock change PIC interrupt
I am trying to build an IR remote receiver using a PIC16F628A. To do that, I need to catch both the falling and rising edge of the external interrupt pin. From the datasheet it appears you can only receive an interrupt on one or the other edges. How would you recommend going about this problem?
AI: If you want to interrupt on both edges, then you can use an interrupt on change pin. If you can't wire to one of those, I'd switch the edge of the INT interrupt early in the interrupt routine. |
H: Passive Filter Negative Insertion Loss
Can someone please explain to me how a passive filter could possibly have a negative insertion loss? In the attached picture, this can be seen in the C or D curves where the insertion loss dips below 0 dB. I understand the filter is resonant at this frequency, but I don't understand how resonance could lead to a negative insertion loss on a passive circuit. This seems to conflict with the fact that passive circuits can't generate power.
AI: Passive circuits cannot produce a power gain but they can produce a voltage gain. A resonant circuit can produce a voltage gain equal to its Q. If the impedance levels are considered, there is no power gain. |
H: MATLAB - FFT aliases occur sooner than expected
I'm using Matlab to analyze the frequency spectrum of a sample wav file. In the frequency plot, I'm seeing aliases occur however they appear sooner than I would expect.
Here is the frequency plot:
Just using some quick calculations, the middle point of reflection seems to be centered around 3200 Hz. This would imply to me that the sampling rate of this wav file must have been around 6400 Hz, however when I load the wav file into audacity, I am told that the sample rate was 11,025 Hz.
I am inclined to believe that this is correct and that the sample rate is 11kHz because when I check the properties of the .wav file, it tells me the bit-rate is 176k, which would correlate to 16-bit samples at a rate of 11k.
So what could explain this? Is it likely that the meta-information in the .wav file is incorrect? Or could there be another explanation?
AI: If you do a FFT in MATLAB, you get one complex valued output (bin) for every input sample. If you then take the magnitude of this complex vector, assuming your original input was real valued, you will see that half the magnitudes will be mirrored. However, the number of bins has nothing to do with the sample rate of the original waveform, only the number of samples in the input. Note that this is simply a function of how the DFT is defined. It looks like your original waveform was about 6400 samples, so that is probably what you are seeing in the first graph (the 6400 frequency bins due to computing a 6400 sample FFT).
If you want to view the FFT in units of frequency (and not bin #) you need to rescale the horizontal axis by the sampling frequency. That is, the frequency of bin n is: \$f_n=\frac{nf_s}{L}\$ where \$f_s\$ is the sampling frequency and \$L\$ is the length of the waveform. |
H: Variable output PSU switch configuration
So I am designing a switchable voltage 9V/18V power supply and was wondering, what's the best way to switch between outputs, that's the current schematic I came up with:
Original image size
So my question is, will this work and is this the best way or is there a better one?
AI: You should switch the outputs of the regulators. That way you bypass the problem relieved by AaronD and you don't take the risk to have the regulators doing weird things the first ms when they are powered since they are always powered (but I'm not 100% sure about that last part, maybe the regulators are stable even when they have just been powered, but prevention is better than cure...).
You can also switch both input and ouput (using two bridge rectifiers to avoid the transformer tap switching), you've already planned a DPDT relay. You don't get startup instabilities immunity but you get rid of the problem of backpowering the ouputs of the regulators and you don't power the unused regulator. |
H: Complex numbers manipulation
I have a complex number s of the form s=[1/sqrt(NN\$_{t})] e^{j\phi_{k}}\$ S\$_{o}\$ is another complex number. It is given that |s-s\$ _{o}\$|<= \$\epsilon\$ where 0< \$\epsilon\$< 2
It is stated in the literature that this constrain can be written as
$$ \phi_{k}=\arg s \in\left[\gamma , \gamma + \delta \right] $$
where \$ \gamma \$ and \$ \delta \$ are given by \$ \gamma \$ =arg S\$ _{o} \$ - arccos(1- \$\epsilon ^2/2)\$
and \$\delta \$ =2arccos(1- \$ \epsilon^2/2)\$
Can anyone explain how is that possible?
AI: This is only possible if \$|s|=|s_0|=1\$. Squaring the original inequality gives
$$|s-s_0|^2=|s|^2+|s_0|^2-2\cos(\Delta\phi)\tag{1}\le\epsilon^2$$
where \$\Delta\phi=\arg\{s\}-\arg\{s_0\}\$ is the phase difference between \$s\$ and \$s_0\$. If \$|s|=|s_0|=1\$ is satisfied we get from (1)
$$2(1-\cos(\Delta\phi))\le\epsilon^2$$
or, equivalently,
$$\cos(\Delta\phi)\ge1-\frac{\epsilon^2}{2}\tag{2}$$
From this inequality it follows that
$$|\Delta\phi|\le\arccos\left(1-\epsilon^2/2\right)$$
which is equivalent to the condition in your question. |
H: Mixed analog-digital power supply
I'd like to build a project where I'm essentially controlling analog signal generation in the audio range from a microcontroller. In other words, an analog synth with digital control. I'm at the stage where I've prototyped and tested most of the core circuits on a protoboard, using simply two batteries (+ some caps) for a -9V/+9V split power supply. Now that I'm about to move to layout a PCB, and adding the microcontroller, I'd like to also have a more robust PSU. The requirements are:
+12V, -12V outputs for the analog side (I can basically live anything between 9 to 15 volts, bipolar, actually)
+3.3V for the microcontroller
output current a few hundred mAs. I don't know the exact power requirements yet, but since I'm basically just doing signal processing, I don't expect there will be very much power needed.
Input from a DC wall wart. Wall wart because I'm not a professional, so I don't want to deal with mains voltage, DC simply because they're easier to find than AC wall warts
low noise in the audio range
I'm currently thinking of using something along the lines such as http://www.linear.com/product/LT3471, http://www.ti.com/product/tl497a or similar (suggestions are welcome), more or less just following the datasheet schematics to get the various voltages. I'm asking for general comments, is this a viable route to go, and some specific things:
will the switched-mode supplies produce problems with noise? Should I use a linear regulator after the inverters to reduce that noise, or will filter caps be enough?
the LT3471 would be nice since it has two outputs, but as I'm going to build this with a soldering iron, I suppose the leadless package would produce problems/be impossible to solder? Is there a similar part in an easier package? (I do have experience soldering SMD, and will need to do that anyway for the uC I've chosen to use, so SMD is okay)
what else should I know?
Is there an easier way that I'm just missing completely? :) I know about virtual grounds, but as far as I understand, splitting a +24V supply would also not be without its problems, when there's a reasonably complicated circuit to connect behind it. Also, 24V wall warts aren't necessarily easy to find, I'd probably need to cannibalize some laptop supply, etc.
AI: Consider a pre-assembled multiple output DC-DC converter module. I'm guessing you'd be looking for one that outputs +/-15V from 9-18V in? You can probably even find one that has a third output with 3.3V. They're usually not overly cheap, but they do simplify the design process, they at least make claims to meet a particular noise spec, and you can choose one that you're able to hand solder easily - either through-hole or leaded SMT. They're readily available from the big vendors (Digikey claim over 200,000 DC-DC converter modules on their books).
For example, the LT3467 for the +/-15V part, and an LTC1174-3.3 for 3.3V can be used (or LTC1164HV-3.3 for a little bit more flexibility in input voltage), according to the schematics suggested in their datasheets. |
H: How does "bidirectional" transmission on gigabit Ethernet work?
I was reading about the various twisted pair protocols, being distracted by the marvels of Wikipedia when I went to look up the way to wire a connector.
And I'm wondering how it can transmit in both directions at the same time over the same conductor? I assume I read that correctly, since if they take turns it would not be called full duplex.
And why is that better than using two (different) pairs in each direction?
AI: The method is called echo cancellation, and it requires a bit of signal processing. Basically, the idea is since you know what you're sending out, then you can separate the signal you just sent from what is coming in from the far end of the link. The way the circuitry is set up, the transmit and receive signals are superimposed on top of each other, more or less adding together.
Simple example to give you an idea of how this works: if the transmitter sends
+1, +1, -1, +1
and the local receiver gets
+2, 0, -2, +2
then you can work out that the signal from the other end must have been
+1, -1, -1, +1
That's more or less the gist of how it works, but it's significantly more complicated due to delays and reflections. The technique is called 'echo cancellation' because sending just a lone +1 down the line will not result in receiving a lone +1, rather you will get several delayed copies at various amplitudes. For example, if you send
+1, 0, 0, 0, 0, 0
you might get back
0, +0.8, 0, +0.2, -0.1, +0.1
due to discontinuities along the line. The received signal then becomes the 'convolution' of the transmitted signal with this pattern. For example, if you send
+1, +1, -1, +1, 0, 0, 0, 0
then you will get something like
0, +0.8, +0.8, -0.6, +0.9, -0.2, +0.4, -0.2, +0.1
The transceivers send training sequences to figure out what the echo looks like (e.g. send a lone +1 while the other end is sending 0 and measure what you get at the receiver). This information is used to reconstruct what the receiver would expect to see from the transmitted data echoing back. This reconstruction is subtracted from the received data, leaving behind the signal from the other end of the link.
This method cannot tolerate as much loss or noise as using separate signalling pairs for each direction, however it means that you can re-use the old 100 Mbit cabling that you already have routed to every room in your building.
Incidentally, 10 Mbit and 100 Mbit signalling is horribly inefficient: both use a single receive pair and a single transmit pair, even though the cable has four pairs. When gigabit ethernet was developed, the designers wanted to keep compatibility with 10 and 100 Mbit ethernet as much as possible. Since there was no way they were going to get 10x the bandwidth out of one single pair, the solution was to improve the single pair bandwidth by 2.5x and then use all four pairs. They now have 10G ethernet over a slightly improved version of the same cabling (mainly it requires a lot of shielding), but it is currently very uncommon (most 10G ethernet uses completely different cabling that has one pair in each direction running at 10G). I seriously doubt we will see anything faster than 10G ethernet over RJ-45 cabling. |
H: Minimal Hall effect sensor circuit to keep something off after certain RPM achieved
I have a somewhat limited understanding of electronics and circuits. I'm trying to build a circuit that will keep a transistor in an off state after a given threshold of RPM is achieved using a A3144E Hall effect sensor.
For example, anything let's say that is below 500 RPM, I would like the transistor to be in an on state, and anything above 500 RPM, the transistor should be in an off state.
How could this be achieved using minimal and common parts without the use of a microcontroller, etc.?
AI: You can do this with an LM2917 (or 2907) and a few support components. Have a look at page 9 of the PDF. The transistor state is inverted from your requirements, but that's easy to fix with another transistor.
simulate this circuit – Schematic created using CircuitLab
Without actually building and testing it myself, and given that it's 20 years since the only time I've used an LM2917, I'm not going to promise you that this circuit will work - but based on the datasheet it should. It should cover from about 220rpm to 900rpm; changing the upper and lower revs is just a matter of changing the resistors.
The rpm is set by C1 and (R1+R2). R2 is adjustable, allowing you to set a resistance of between 33K and 133K.
The relationship between frequency, resistance and capacitance is: F = 1 / 2RC
F is rpm / 60, so:
rpm / 60 = 1 / 2RC
rpm = 30 / RC
Using a 1uF capacitor (as I did in the schematic):
rpm = 30,000,000 / R
So for a 33K resistor, rpm = 909 and for a 133K resistor, rpm = 226. Smaller resistor values give higher rpm's.
The normal behaviour is that the (internal) transistor switches on when the frequency is above the set point. Q2 (and R5) flip that behaviour - Q2 switches off when the frequency is above the setpoint. |
H: 64bit vs 32bit processor execution equivalence
I'm not sure if I am in the good site but here's my question :
I was questionning myself, what would be comparable(execution speed) between a 32bit and 64bit processor. Like what would be the clockrate of a 32bit processor to be as the same speed as a 64bit processor.
Ps : English is not my first language.
Wood
AI: Assuming that you're talking about the x86 and x64 instruction sets, there's not a whole lot of difference as the x64 set is backwards compatible with x86, meaning that a 32-bit operating system will easily run on 64-bit hardware. However, being designed around 32 bits, it will only be able to access 2^32 bytes = 4GB of RAM, even though there might be more installed. In that comparison, the clock rates are almost identical because of the compatibility.
In pretty much every other case, and even the one above to some extent, you simply can't compare clock rates because the instruction sets are so different. One may have a super-duper instruction that takes one clock cycle to do a specific task that occurs often in the job that it was designed for, while another may require many instructions to do the same thing. For that specific job, the first one will perform better with less clock than the second will with more.
This is especially true in embedded software. Unlike PC's, which have pretty much all standardized now on the x86 or x64 instruction set, every manufacturer of embedded devices has their own incompatible instruction set, which makes it difficult to measure relative performance levels that are less than an order of magnitude or so.
Of course, all of this assumes that the instruction rate is the limiting factor. In most embedded designs, it is, if anything. In PC's though, the issue is usually memory. The CPU spends most of its time waiting for the relatively slow RAM or hard drive to get around to returning the data that it needs. This is why you want a big cache, lots of RAM, and a fast connection in between. |
H: Logic circuit with not gate-stability
simulate this circuit – Schematic created using CircuitLab
Why is the first circuit unstable and the second one stable?
AI: It is easy to go through these circuits. Lets say that on the left side of the first inverter is a logic value of 1. This value is inverted and is 0 at the left side of the second inverter. This will become a value of 1 on the left side of the 3rd inverter. After the 3rd inverter the value is 0. this value is also on the left side of the first inverter. Where it was 1 in the beginning it is now 0. So that circuit toggles the input all the time making it unstable.
At the circuit on the right:
left say we have a logic value of 1 again on the left side of the first inverter. this value will be inverted to a value of 0. Then the 0 will be inverted again which will make a 1 on the left side of the first inverter. We started with a logic value of 1 and we end with a logic value of 1. That makes this circuit stable. |
H: Series and parallel transformers?
I have two different transformers. The output of the first one is 15 volts and 1500 mA. The output of the second one is 5 volts and 500 mA.
If I connected them in series (to get 20 volts) what will happen to the current?
If I connected them in parallel (to get 2000 mA) What will happen to the voltage?
Is there any danger in the previous connections?
AI: 1) If you connect them in series, properly, you'll get 20 volts out but the current out of the pair must be externally limited to 500 mA.
2) If you connect them in parallel, the transformer with the 500 mA secondary will be destroyed first.
3) See 2). |
H: What battery to choose with motors?
I am trying to figure out how many batteries I will need, in order to power my 4-wheeled robot (based on an Arduino). I understand that it is not practical to power the Arduino and the wheels with only one 7.4 V LiPO battery. So I know that the Arduino power source is going to have to be different than the motor power source.
The specs for the motor are:
Stall Current: 3.6A
Free Current: 0.15A
All motor specifications are at 7.2 volts. Actual motor specifications are within 20% of the values above.
I need to have all four motors run for at least one hour. So the question is: Can all four motors be safely powered by one 7.4V LiPO battery, or am I going to have to have one battery for two motors?
The batteries that I have are 2200mAh, 1C continuous discharge.
AI: The answer to this questions is quite complex, but let's try to simplify it by making some assumptions and generalisations.
First assumption: You want it to work a minimum of 1 hour continuously without ever stopping. Second assumption: A movement lasts on average 30 seconds. Third Assumption: All motors will start cold at once. Fourth assumption: The weight of the robot is such that the motors take 3 seconds (10% of the move time) to go from stall current to running current. Fifth assumption: Under the weight of the robot the motors will on average use about 1/3 of their stall current. Sixth assumption: The motors will go from stall to run current linearly.
Now, some of these assumptions will be more true than others, for example the last one, is quite ridiculous to a mechatronic engineer, but I feel this is not the time to start with differential and integral calculus, so we're making a triangle. It's easier and "close enough", especially since all those other assumptions are shots in the dark without some test data. So be aware, that the final estimation is going to be off and that you should do some tests with the finished robot to see by how much.
Now, we have an average movement to calculate the energy profile of, 30seconds, of which the last 27seconds are continuous movement with fixed current (the 3second start up is different). For those first three seconds a "triangle" is added to the flat curve of the other 27 seconds, which has its peak at time t = 0s, with 3.6A and its base at the level current of 1.2A (1/3 of the stall current as assumed). So its height is 2.4A and it's width is 3 seconds. This is a bit weird way to give measurements, but it'll work out, I promise.
So, the "area of energy" in the motor curve for each motor is Area(triangle) + Area(linear). The area of the triangle is 0.5*base*height = 0.5 * 2.4A * 3s = 3.6As. The area of the rest (which also sits under the triangle, sketch it on paper if you need to verify) is height * width = 1.2A * 30s = 36As. The total area is: 39.6As. The time span (width) in total is 30 seconds, so to get the average instantaneous current consumption you just divide again: I(avg) = 39.6As / 30s = 1.32A.
Now, there's four motors, continuously running at the average current over the span of an hour, as we assumed up front. If you already know that it will only be running the motors about 75% of the time, you can start with a battery capacity of 75% of the answer. And so on with any other, but they will have to be able to handle a continuous current higher than their capacity (C). For example, is the battery is only 50% the capacity, the continuous current will be 2C for that battery. This is why I just made the assumption of continuous running, because you will need that capacity with a 1C capable battery anyway.
So, we get a continuous current of: 4 * 1.32A = 5.28A. Now because the battery pack can be charged up to 8.4V initially and the motor ratings are at 7.4V, we should include a safety margin of at least 25%: Average current: 1.25 * 5.28A = 6.6A.
And as such a minimum capacity of 6.6Ah. Or, three 2200mAh cells in parallel.
But! Make sure the batteries are also rated for a peak current of four motors stalling during at least the 3 seconds of run in, or you will need extra cells in parallel! So the peak current of 3 cells parallel has to be at least: 3.6A * 4 = 14.4A. Or per cell: 14.4A/3 = 4.8A, which is 4.8 / 2.2 = approximately 2.2C.
Now, if you put them parallel, please make sure you first balance them together with resistors for a while, like so:
simulate this circuit – Schematic created using CircuitLab
In this drawing I am assuming you have ready-made packs that you don't want to take apart, but that do have a balancing wire. If there's no balancing wire: Take them apart and rebuild them! (Be careful not to damage cells! That will cause serious problems with potential bodily harm.) It's the only safe way! So you can use the above drawing with the balance wires. Then, when you've let that balance the cells through the resistors for several hours, connect the packs in parallel through the balancing wires, to get a pack like this:
simulate this circuit
If you have separate cells, or you have taken apart the battery packs to get separate cells, balance them in separate groups, so only the lower three together and only the upper three together. Like this:
simulate this circuit
Then solder them together without the resistors per group of parallel batteries, put them in series, add a balancing wire to the middle point of the finished pack.
Now, here's a very important thing to do: Make sure you have a way to balance-charge the finished pack! If you don't the lifetime of your batteries will be halved or worse! So after you have built the new pack, use a balance charger to fully charge both the cell stages before you start using it, or one of the two stages may get damaged very soon.
EDIT1: Another very important thing I forgot to mention just now, which I thought of when commenting above, is that you NEED to protect the batteries in your robot.
The batteries cannot handle the stall current of your motors, maybe the motors will get too hot as well, so when there's a stall current for more than 3 to 5 seconds, the robot might be stuck and you need to shut off power to the motors!
You can do this with your Arduino and a current sensing resistor, or you can put an independent limiting switch inside your battery pack. If you like reading and doing the exercise, this answer I gave last night could give you some inspiration (blatant advertising of 6 hours of work! ;-) ). Scroll down to Edit1 there.
With an extra two transistors you can replace the reset button by an I/O from the Arduino. But if you involve the Arduino, a current sensor and a bit of programming is much easier. |
H: Effect of non-inverting op amp on the AC and DC components of the input
I was wondering what the effect of an op amp like the one in the image below is for an input signal such as \$0.5\sin(2000\pi t) + 0.5\$ V? Are the DC and AC components amplified with the same gain? And also, what would be the phase relationship between the input and the output?
AI: As long as the AC signal frequency is within the op amp's bandwidth the AC and DC gains are the same for the circuit you have drawn. The gain is
$$\frac{v_{O}}{v_{I}} = 1 + \frac{R_f}{R_i}$$
If your op amp datasheet specifies its gain-bandwidth product you can easily calculate the bandwidth if you know the closed loop gain you need.
I've drawn your circuit in Circuit Lab with your input signal \$v_{I}(t) = 0.5\sin(2000\pi t)+0.5\text{V}\$, and I'm using \$R_{i} = 1\text{k}\Omega\$ and \$R_{f} = 100\text{k}\Omega\$ for a gain of \$101\$:
simulate this circuit – Schematic created using CircuitLab
If you run CircuitLab's DC solver you will see that \$v_{O} \approx 50.5\text{V}\$. Unless you happen to be using supply voltages greater than \$50\text{V}\$ the op amp will not actually be able to force \$v_{O}\$ that high and it will saturate.
If you need a high gain like \$101\$ as I've simulated and you are not be able to get rid of an undesirable DC offset like \$0.5\text{V}\$, you will need to add AC coupling. For most op amp circuits you can simply add a capacitor in series with your input to block the input's DC offset (you just need to determine the appropriate capacitance for the frequencies of interest). However, for this circuit that would be a bad idea since the op amp's non-inverting input bias current (which is very low but non-zero) would have nowhere to flow except into the AC coupling capacitor. To avoid this you also need to add a resistor from the non-inverting input to ground. Think of this as a simple \$RC\$ high pass filter. The AC coupled non-inverting amplifier looks like this:
simulate this circuit
If you run Circuit Lab's DC solver on the AC coupled circuit you will see that \$v_{O} \approx 0\text{V}\$.
You can run a frequency domain simulation in Circuit Lab for the Bode plot of the AC coupled circuit. You can see that the gain is very low at DC and low frequencies, is \$101\$ in the midband (including your input frequency of \$1\text{kHz}\$), and then decreases at \$-20\text{dB/decade}\$ at high frequencies. I don't know what frequencies are important to you so you might need to choose different capacitor and resistor values for the \$RC\$ filter. |
H: Electrical measurements of Chicago substation from where can I get it?
I am doing a project on electrical load prediction using machine learning. Machine learning involves creating models based on past data. For creating these models where can I get data regarding electrical measurements of Wider Chicago substation?
If you provide any links it will be very helpful.
AI: http://archive.ics.uci.edu/ml/
This is an archive for machine learning datasets..There is not the one which you want but there are datasets of some other Power Substations one in India. |
H: Component selections for the ETA3406 DC/DC converter
I was browsing Seeed Studio's Open Parts Library and found the ETA3406, which is a 1.5 MHz 1.2 A Step-Down Converter.
It's pretty cheap, and looks very useful for something I want to build, but the datasheet only shows it using a 2.2 µH inductor, which curiously is not in the Open Parts Library.
The datasheet also doesn't provide any guidance when it comes to selecting the inductor, all it says is:
If much smaller values are used, inductor current rises, and a larger
output capacitance may be required to suppress output ripple.
Larger values than LIDEAL can be used to obtain higher output current, but typically with larger inductor size.
I assume LIDEAL is that 2.2 µH value, but it's not very clear. Anyone have any tips on how to make the selection, given the scarcity of data?
AI: If you zoom the datasheet, you can see that the diagrams actually recommends the use of a 2.2uH inductor!
Although, it seems that Open Parts Library doesn't have these inductos either (but you can buy them cheap from Digikey, Mouser or any other distributor). To select one of them, is very important to take note on the maximum current the inductor can manage (as these ICs can have up to 1-2A as inductor current), so be careful!
This value is tipycal for step-down converters (I have used some of TI and other manufacturers and it's a standard value for a wide range of applications). I strongly believe you can use the datasheets of those parts to search for tips on value selection. |
H: Simultaneous Buck-Boost or Flyback Regulator - Help Selecting Chip
I have been trying to find a switching DC power supply that outputs a constant voltage of 12VDC, given a variable input between 4V and 25V. It's to my understanding I'd need a buck-boost converter, but many of the buck-boost converters I find on Digikey seem to show only a single application circuit for buck, and one for boost for the same chip (ie: no circuit that can do both simultaneously).
I am currently using the LM2577, and interestingly enough, it can accept a 12.5V input from a wall wart, as well as a 9V battery, and still has a constant 12V output. I don't know if for this type of chip though, if it makes sense for the input voltage to be greater than the output voltage, because it is a boost/flyback regulator.
So the first part of my question is: can someone recommend a good simple through-hole DC-DC converter that can take an input on the range [4V, 25V] DC and output a constant 12V DC output?
Second, I'm a bit confused on the terminology on Digikey, and Google has only gotten me so far. Could someone point my in the direction of a description of the various topologies? I get what a buck, boost, and buck-boost chip is, but the multiple combinations of boost/buck/forward-converter/flyback/inverting is somewhat daunting. Does flyback imply it is a buck-boost, even if the title is "Step down (buck), flyback", etc? Some such examples are:
Step down (buck)
Step down, flyback
Step down (buck), step up (boost), flyback
Step down (buck), step up (boost), flyback, inverting
Step up (boost), Cuk, Sepic
Switched capacitor (charge pump), flyback
AI: A traditional buck-boost converter (and the Cuk converter) invert the input polarity, so you can get -12V for your 4-25V input voltage range. What's confusing is that there are also buck-boost converters that usually use a 4 switch topology to either buck or boost depending on Vin, and do not invert the polarity. (As does a SEPIC converter.)
A flyback can also use the transformer turns ratio to give outputs above and below the input voltage.
A charge pump's operation depends on the configuration of the switches and the capacitors and the control scheme.
You don't say how much current you need, but something like this part from LTC could work http://cds.linear.com/docs/en/datasheet/31151fa.pdf |
H: Child-Safe setup for ESD protection environment on desk
I need to setup an anti-static workbench in my spare office, and kids sometimes get into it ever since they learned how to pick the locks.
My intended approach is to:
Lay out an ESD mat on the desk.
Punch a whole through the mat, and connect an ESD common point ground to the mat through the whole with a snap-cap.
Connect my ESD wrist strap by removing the alligator clip and connecting the wrist strap to the common point ground.
Connect the banana jack of the common point ground to the GND pin on the NEMA-5-15 wall outlet or equivalent on the power bar on my desk, ie:
I have one problem with this setup, assuming it is correct: I have a small, flat nema-jack connected to the GND of the wall outlet with an exposed banana plug sticking out of the wall. I'm worried that one of the kids could pull the banana plug out of the GND plug, and plug the banana jack into the hot or neutral blade slots of the wall outlet.
Is there a safer way to go about this? Are there maybe 3-prong plugs that have two plastic blades for the neutral and hot, and a fixed metal plug for the GND so there's no way someone can electrocute themselves by playing with the connector to the mat?
AI: This is what you're looking for.
Anti-static grounding plug
Assuming the same thing is available in your local plug style, and your house grounds are correctly wired. |
H: Mic Amp Mixer and Audio Distribution, Won't Work! Help! (Update 2) (Solved!)
I'm new to this forum and I really don't know much about Audio Amplifier Circuits. Hope you can help me.
Here it goes:
So basically what I'm trying to do is a circuit that mix 3 channels, amplifies them and then distribute them into 3 channels.
The problem is that when I test the circuit in real life I can only hear sound when I blow in my mic, anything like shouting singing or talking won't do any sound.
As I don't know much about audio circuits, I would love some help to solve this problem.
I'm currently testing with this:
Headphone
Driver: 40mm
Frequency response: 20Hz-20KHz
Impedance: 32 Ohms
Sensitivity: 90dB SPL/mW
Microphone
Pickup pattern: Cardioid (Unidirectional)
Type: Pressure Gradient Electret Condenser
Frequency response: 50-20KHz
Sensitivity: -40dBV/Pa re: 0dB = 1 Pa, 1KHz
Test conditions: 3.0V, 2.2K Ohm
But I want to be able to use any headphone or any microphone.
So my questions are:
Is the circuit OK? Do I have to change something?
What may be the reasons for only hearing when I blow on the mic?
Any suggestions?
How i solve those problems
The circuit is OK, i had to change the value of all the POTs from 50k to 5k, also all the polarized CAPs to non-polarized and reduce them from 47uF to 1uF all but the ones from the input, i change those for 10nF.
If you need any other info just tell me to add it.
Update:
Now, In Proteus I'm losing the signal after the 5k POT. Whats happening?
A Signal is after the POT, while B is Before the POT.
Solved: the problem was Proteus it was bugged.
Update 2
Well now the circuit looks like this with most of the problems solved.
It works but now i have another problem, there is some background noise.
More Questions:
I'm testing the circuit in a Protoboard, moving it to a PCB changes anything?
Is there something i should add or change to reduce this background noise?
PS: when the mic is not connected or muted the background noise stops.
Solved
Had to take away resistor 24 from the 2nd update circuit.
AI: First thing I notices is the time constant with your input capacitance and 1Mohm resistor - it's 47 seconds or equivalent to a high pass 3dB frequency of 0.0034 Hz.
This might take ages for your inputs to settle - make the input capacitor 47nF is my recommendation - this puts the high pass frequency at about 3.4Hz. Even a 10nF wouldn't be unreasonable (high pass of 16 Hz).
Your op-amp is a TL084 so I'm less worried about input current leakages causing offset voltage problems AND I'm happier with non-polarized caps at the inputs because if it is an electret mic and has a bias voltage on it, the electrolytic (have to be polarized correctly) input caps will become reverse biased and this may indeed be a possible reason why you see a problem.
Regarding your 50k pots, these will potentially give higher noise than say 5kpots and with 5k pots you can reduce R5, R10, R15 and R16 to something like 10ks also reducing noise. Noise is proportional to the square root of resistance so always best to go lower a bit if you can.
C7 and C12 are also problematic in the the signal they see may become reverse polarized. The time constants you are using around these circuits are very large given that those caps are 47uF - go for 1uF and non-polarized. U2 just appears to be a gain of ten stage so lose the centre biasing - 0V is centre and that is just fine assuming your Vcc and Vdd are largely equal and opposite.
You are using TL084 output amplifiers but this is really daft because you have an output pot that will likely introduce an impedance of about 25k (mid point). Just use pots and get rid of the extra 3 op-amps that feed the individual outputs. C9, C10 and C11 are not needed either or if you feel happier with them use non-polarized 1uF caps. |
H: Where can I find common circuitry implementations of different computer system components?
Mostly out of interest, I'm trying to understand common circuit-level implementations of computer components. I understand that implementations may differ widely, but I'd like to see examples. It would be great to see a lot of this stuff in one place, if such a website (or book) exists. Here's a list of the kind of components I'm trying to understand:
RAM
Flash memory
Data + Address buses
HDD's
NVRAM
ALUs
Any processors, relatively simplistic ICs
etc...
Here's a good example of the kind of thing I'm talking about:
http://www.righto.com/2014/10/how-z80s-registers-are-implemented-down.html
About 2/3's into the article, a circuit diagram is given that shows the register implementation.
It would be cool to see some of everything, to the point where one could have enough knowledge and resources to conceptually build (almost) an entire computer in their mind out of fundamental circuit components.
Does anyone know of such a resource?
AI: Have you tried the home built CPUs webring of sites? This one covers a lot of what you are looking for:
http://cpuville.com/ |
H: What's a probable VA rating for this?
I bought a variac at a garage sale a few months ago and I've played with it since then with a 40W incandescent desk light. Now I want to use it for the incandescent house lights in a small theater. About 1000W total at 120V.
I don't have any official specs. Any guesses on maximum power capability?
Edit:
AI: That looks a lot like a variac I have:
Which is rated at 22A/3.1KVA.
The outlet box on your variac looks like it's an aftermarket add-on. If you're lucky, the info plate will still be under it.
Otherwise, the diameter of the round housing is ~7.875". If yours is the same, I'd assume it'll be fine with a 1 KW load.
-- |
H: Adding hysteresis to MOSFET used as a switch
I have a low-voltage detection circuit which I use to trigger one of two LEDs (green, and red) that is powered off of a +9 V battery cell. As the battery discharges, its output voltage decreases, until when it finally hits the 6.9 V level. When the battery provides an output voltage greater than 6.9 V, the green LED is turned on, and currently flows from the source to the drain of the PMOS, Q4. If the voltage falls below 6.9 V, the green LED is turned off, the red LED is turned on, and the output of Q4 is turned off.
However, as another commenter mentioned in a separate question on part of this circuit, I should implement hysteresis in some form or another so that I don't have the circuit alternating between the two LEDs at the cutoff point due to the average load of the circuit changing when in the "green" mode of operation. What is the most straightforward way to approach this?
Do I have a comparator feeding into the gate of the PMOS? Since my voltage rail is expected to change, I can't really use a voltage divider across Vcc and Gnd for reference. My intent is to have the circuit stay in the "red" region (i.e. cutting off Q4) if it enters that region, with some noise tolerance for when the circuit is first turned on.
I simulated the circuit by Asmyldof below using a 100R resistor for the load, and a pair of AC power supplies with a shared 6V offset, and 0.5 V amplitude each (60 Hz and 120 Hz frequency sinusoids), and the simulation below it. This appears to just offset the output signal with respect to the input supply power. Is this actually hysteresis, or is my simulation just terrible?
Modified Circuit
Circuit Simulation - Light Blue:Power Rail, Orange:Output/Load Voltage
AI: Drawing only the PMOST bit of your schematic:
EDIT2: I completely forgot to add the 10k pull-up resistor. It's added now, R4. Sorry.
simulate this circuit – Schematic created using CircuitLab
Basically when the mosfet is turned on the R3 in my schematic puts a companion current into the transistor and the zener diode will have to conduct a little less current to shut off the transistor, reducing the shut-off voltage a tiny bit. When the MOST shuts off the support disappears and the circuit will have a much better chance to stay stable. Now, beware that R2 and R1 have to be able to pull the base of Q1 (in my schematic) below the 0.6V threshold, so R3 should not be too small and R1 and R2 not be too big. If it doesn't turn off at all I mis-estimated the transistor and you may have to increase R3, although I think it's close enough.
EDIT1: In response to your simulation: As I stated, I could be off with the transistor. What you see is the voltage drop across the diode, so maybe the system just doesn't shut off, or much too late.
Try simulating with a larger range of voltages to see what happens, then see if a larger R3 helps lifting the shut-off voltage. Other than that you can tweak the zener, though that will also tweak the LED trigger. Do keep in mind simulations aren't holy. I could model the whole transistor and do a full range calculation of the currents and cut-offs but that's something I haven't done in a very long time, so I'll probably only have time to really sit down for it in quite a few more days.
It's also possible a lower frequency may show different results, but that's quite unlikely, since from the perspective of discrete transistors and mosfets 120Hz is already pretty much DC.
EDIT3: When I wanted to do a calculation I looked at the schematic and saw I forgot the pull-up resistor in my schematic, R4. It's an absolute oversight on my part, but these things do happen. Now that it's added, I have run my own circuit lab simulation with the following schematic:
simulate this circuit
With these results:
You can see it switches off at about 5.5V, and back on at about 6.3V: Hysteresis! As said, you may have to change the zener a little, if the 9V battery is rechargeable, it may be pushing it a little, although that's still 0.92V per cell, so they should survive it well enough.
As you increase or decrease the R3, let's say between 90k and 330k the hysteresis window will change, with 90k being a quite large window and 330k being a tiny window. |
H: Decoders and Logic Gates
I have two questions. First, I've been staring at this problem for over an hour and I'm stumped. To be clear, I'm not looking for the answer, just some hints to get going would be helpful:
1) Using only three 2-to-4 decoders with enable and no other additional gates, implement a
3-to-8 decoder with enable. The inputs of the resulting 3-to-8 decoder should be labeled
as X2 X1 X0 for the code input and E for the enable input. The outputs should be labeled
Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0.
I definitely know how to use a 2-to-4 decoder, and how to use a 3-to-8 decoder, but how to create a 3-to-8 decoder using only three 2-to-4 decoders is stumping me. I don't know where to begin making the connections.
Second, I have this circuit:
My next question has to do with a specific gate from this circuit:
I have never seen this gate and don't know exactly what to do with it. Professor didn't go over it in class. what is it?
AI: A hint for the 1st part: You need 8 outputs, this requires two 2-to-4 decoders. What do you do with the 3rd 2-to-4 decoder?
Re the 2nd part of your question: "what is this gate?"
It's a tri-state buffer. It's "tri-state" because the output can be one of three states: 0, 1 or Z. I'll explain Z shortly.
The "side" input is the Enable. If Enable is asserted (high or 1) then the output follows the main (data) input. If Enable is not asserted (low or 0) then the output ignores the data input and becomes 'Z', or high impedance.
An output that is at 0 or 1 is actively driving the circuit. It is effectively tied to power or ground through a switch. If you were to attach two such outputs together and one was at 0 and the other at 1, then you would be joining power to ground - a short circuit. This is... bad.
An output that is at Z doesn't do anything at all. This is useful because you can tie any number of outputs that are at Z together and they won't misbehave. Even better, you can select any one of the outputs and make it 1 or 0 and that one output will take control, overriding all of the Z's.
This is the basis of how computer buses work - lots of possible drivers, but only one of them enabled (driving 1 or 0) at any one time. |
H: OP amp voltage comparator for an FET
I have a project requiring a switch (I supply 4.8V, the switch stays off. I supply 5V, it turns on.) After some testing and asking several questions, I realized that the MOSFET I was using would not cut it. In EE.SE chat, I was informed that a comparator could solve my problems. Doing some research, I found a schematic for an OP Amp Comparator. Changing it a bit, I got this:
Assuming this works, how would I choose an OP amp to work here? Looking on Digikey and several other online electronics stores showed me that I know next to nothing about OP amp specifications.
Generally, I want it to be fast (Using the FET for high-speed switching), and can handle 5V plus a margin (call it 6-7V?) What should I look for on a spec sheet that represents those things? Also, since there were about 10 different option tables, what would be a good, nothing fancy, set of specs to work from?
AI: First, you should use a comparator if you want to do comparisons.
Choose one with a switching time substantially less than what you want the overall switching time of the circuit to be (with 1 ms spec, you should be able to choose almost any of them).
Second, choose one that can drive enough output current to pull the FET gate full swing quickly enough. On chat, you mentioned the DMG9M65CT, whose datasheet gives a gate capacitance of 2.3 nF. To switch this by 5 V in 1 ms requires about 10 uA of current. Again, you should have no problems finding a comparator that can do this. (Your problem would be harder if you wanted to switch in less than a microsecond, for example).
Third, choose whichever comparator has the lowest price, is available for immediate delivery, has the package you want, comes from a vendor you trust, etc.
Final note, remember that many comparators have open drain outputs. That means they can only pull their output low. You'll need to have a pull-up resistor to pull the output high when it should be high. Choose the highest-value pull-up resistor that gives an adequately fast switching time for the low-high transitions. With a 15 V positive supply available, this could be as high as 50 kohms, but if your available supply is not very much above 5 V, you might need a much lower value. |
H: Why does this circuit oscillate and produce sound?
I've connected an 8-ohm speaker in series with coil. When I apply 5 volts / 500 mA to the combination (coil and speaker), I heard a very high frequency sound (something like whistling).
The coil is not air-cored (I think the core is made of ferrite or iron) and it has about 50 turns.
I would like to know why this circuit oscillates or produce this sound?
AI: Modern cell phone chargers operate a very high frequency- well above audible even for small dogs.
However, what I suspect is happening is that your inductor is perhaps 1mH and your adapter is perhaps capable of 600mA before overcurrent protection kicks in.
So, when you connect a fixed voltage to an inductor in series with a resistor, the current increases with time constant L/R towards Vin/R = 0.65A (allowing a bit of resistance for the inductor- and the DCR of the speaker won't be exactly 8 ohms).
This time constant (based on my guess as to the inductance) is of the order of 125usec, so if the overcurrent protection kicks out then restarts, the frequency of restarting should be in the several kHz range.
You don't hear the sound when the speaker is connected directly across the power supply because the restart frequency is above the audible range.
To confirm this, look at the voltage and current waveforms with an oscilloscope. |
H: Transformer calculations and physics
I have an electrical engineering academic background, but since graduation, I have worked exclusively in software and my EE skills are admittedly getting very rusty. Something I never fully understood was circuit analysis with transformers.
I understand, at the simplest level and with an ideal transformer, that the V/I ratio changes such that V1/V2 = I2/I1 and power of the primary should equal power of the secondary.
What I don't understand is that this can happen without violating Ohm's Law.
For example, what happens in this case:
I have a transformer that has 10 A running through the primary with 200 V across it. On the secondary, I connect a 10kOhm load.
If the secondary has double the windings of the primary, then I should have 400V and 5 A on the secondary.. but how is this possible considering I have a 10kOhm load on the secondary? It seems as though I should be able to calculate the load from my Vs and Is, despite the fact that I could attach any arbitrary load there.
How is this accounted for by equation (6) on Wikipedia (http://en.wikipedia.org/wiki/Transformer)
The second part of this question: What is a reasonable circuit model of a "real" transformer, and would circuit analysis (solving for currents and voltages) using the model answer the question I have above (about violating Ohm's Law)?
I do see a circuit model on the Wikipedia article, but it doesn't appear to answer my question at all. The secondary is just an open circuit with a calculated potential across its terminals and the transformer itself.
AI: If you have an ideal transformer with 200V/10A on the primary, the load on the secondary cannot be only the 10K. You don't get to pick all the variables independently.
In this case, 2000W is going into the primary, so for an ideal transformer, 2000W should be coming out. The load on the secondary must be 80 ohms.
If you force 10A into the primary of an ideal transformer with a 10K load, the primary and secondary voltages will rise until the secondary current is 5A, which means the primary voltage will be 25kV (and the 10K resistor will dissipate 250kW).
If you apply 200V on the primary and the load on the secondary is 10K, the primary current will only be 80mA and the secondary current 40mA.
A real transformer will not behave quite this way. It will saturate if the input voltage is too high or the frequency too low (typically not much more than the normal operating limit of high voltage/low frequency). Saturation is bad- it results in a large current that is turned into heat- so smoke and acrid fumes often follow. There is a magnetizing current, even with no load. There is leakage inductance which behaves like series inductance. There are copper losses which behave like series resistors (but copper so they increase with temperature). There are core losses, which behave a bit like (parallel) resistors. And there is the nonlinear effect of saturation, and the effect of core remenance which can be very pronounced on toroidal power transformers (an occasional high current surge on power-on which depends on the core state when it was last turned off).
Maybe (or not) it would help to remember that for an ideal transformer, the impedance presented at the secondary is reflected at the primary, divided by the square of the turns ratio.
In other words, for your example (and, I emphasize, an ideal transformer), the 10K resistor on the secondary behaves just like a 2.5K resistor across the primary terminals.
Similarly a 10uF capacitor on the secondary would appear as a 40uF capacitor on the primary (since the capacitor impedance is \$Zc = \frac{1}{j\omega C}\$). |
H: Using GPIO mode in SIM908
I'm working on a SIM908 module using GPIO mode (my rx pin contact is lost when soldering).
I have interfaced it with a PIC16F73 and while using GPIO mode I'm not getting any response. I have included an LCD to print the response. Is there any AT command or pins I should enable on SIM908 to activate GPIO mode or is it because there should be a delay between writing and reading on the ports?
I have included the code:
char x[20], y[20];
TRISB = 0x00;
PORTB = 'A';
PORTB = 'T';
PORTB = '\r';
TRISB = 0xff;
x[0] = PORTB;
LCD_Print_String(2,1,x[0]);
if (x[0] == 'O')
{
LCD_Print_String(1,1,"done");
}
else if(x[0] == 'E')
{
LCD_Print_String(1,1,"error");
}
while(1);
sim908 datasheet:http://www.synes.co.th/nicupload/20111109110456.pdf
AI: Reading through the datasheet I can't see any mention of being able to use the GPIO for sending AT commands and data. I suspect where you've read about using the GPIO for communications they're referring to say attaching a switch which could be viewed as communicating the switch's state to the module. Apart from that there are a number of holes in just trying to connect six GPIO lines and attempting to send ASCII data:
From your example the character "A" in ASCII has a decimal value of 65 or 1000001 in binary. That is 7 bits long so you'll be dropping part of the character, the same will apply for any ASCII value of 64 or higher which includes all uppercase and lowercase letters.
Parallel data transfer schemes typically need additional lines apart from just data lines. For example you might have something like R/W to indicate if data is being read or written, RDY to make sure the device is ready for a transfer and ACK to indicate the data has been transferred.
There is mention that the SPI and I2C interfaces can be used for AT commands and communications but only if you have custom firmware. That sounds like something you would have to pay for them to develop rather than something available off the shelf.
I think with the broken RXD line you might be out of luck unless you're able to repair it. You might have some luck with a scalpel to carefully scrape off some of the solder mask and soldering on a piece of wire wrap wire or perhaps a single strand of wire from some multi-strand wire, assuming there is some amount of track left before it gets to the RF shield. |
H: Low-power dual-rail ADC
I am building a battery monitoring device and planning on measuring voltage drop across a current shunt, amplifying, and reading into an external (12-bit) ADC chip to get a value of the resolution I desire.
The problem I am requesting help with is finding a low-power ADC that accepts +- voltage for the signal or some kind of workaround of that without losing too much resolution.
I am using a +- 5V linear regulator for power supply and a 0.1m ohm precision shunt, planning to accurately measure +- 200A (charging and discharging) but cannot find an ADC chip that suits my needs.
The TC7109 has dual rail supply and can take both positive and negative voltages into ADC but has quite high power usage (>1W).
Something like the the MCP3201 would be ideal (especially because I am already using planning to use SPI for SD card operations) but its input range doesn't extend into the negative.
Is there a way that I could use a cheaper, more convenient chip like the MCP3201 to measure positive and negative voltages without sacrificing precious resolution?
Below is a (very simple) circuit schematic of the proposed circuit before ADC:
AI: An instrumentation amplifier would be able to offset the differential signal measured across the shunt. An AD8221 could run from smaller supplies (+/-2.5 volts) so this saves power immediately and its current consumption is about 1mA.
Your input signal is going to be in the tens of millivolts so no problem with the AD8221's limited common mode input range (on a split supply) and the AD8221 output swing is to within 1.2 volts of either supply rail so, from a +/-5 volt rail you can get an output that is +/-3.8 volts but you need an "offset" to bias it to a standard ADC input range of (say) 0V to 2.5 volts.
The reference pin on the AD8221 can be fed from a 1.25 volt reference to centre the offset from the AD8221 at 1.25 volts and make it suitable for a whole load of low power single supply ADCs. The ADC input would need to be protected from the AD8221 producing a negative voltage in case the signal from the shunt was bigger than expected but this is acheived by a simple series resistor.
Typically the AD7988-5 (a 16 bit ADC that I've used recently) consumes less than 1mW at a sample speed of around 100kSps so this would fit the bill but TI have very similar offerings as do LT. It has a maximum input current of over 100mA so a simple series resistor of about 1kohm is not going cause a problem BUT check the data sheets. |
H: SPI reading from slave
I have small question about how bytes move around during SPI reading.
I have a flash memory chip and microcontroller.
Suppose I want to know jedec data from the chip(although it can be any data, this is just example), I found how to do it and it works fine, but I don't get the part when we assign jedec parameters to variables.
From the C code below I can see the possible logic like this:
we send "retrieve jedec" command to chip, then for some reason we start to send zeros to assign values to variables, probably it reads the value by sending dummy-bytes. Question is - isn't it supposed to overwrite bytes we are reading?
I mean - you shift something to the register you want to read therefore you get the value back by replacing it with what you have sent.
Maybe I express my question blurry, ask more info if you are confused, but to sum up everything I have two questions:
1. Why we are sending zeros during value assignments like *b1 = SPI_MasterTransmit(0);
2. If we do it to shift the value from slave device to master - why don't we erase the value from the slave by doing this?
void get_jedec_id(uint8_t *b1, uint8_t *b2, uint8_t *b3) {
PORTB |= 1<<PINB2; // turn high ss pin(/cs)
PORTB &= ~1<<PINB2; // turn low ss pin(/cs)
SPI_MasterTransmit(0x9F); // transmit get_jedec command of this chip
*b1 = SPI_MasterTransmit(0); // manufacturer id
*b2 = SPI_MasterTransmit(0); // memory type
*b3 = SPI_MasterTransmit(0); // capacity
PORTB |= 1<<PINB2;
not_busy();
}
SPI_MasterTransmit code:
unsigned char SPI_MasterTransmit(uint8_t outData)
{
// Transmission start
SPDR = outData;
// Waiting for transmission to end
while(!(SPSR & (1<<SPIF))) ;
return SPDR; // return received byte
}
AI: SPI is a full-duplex protocol. In order to receive data, you have to send data at the same time, even though the Flash chip might do nothing with the data that you send.
So, for example, you want to read the JEDEC ID. You lower the /CS signal and send the "read JEDEC ID" command. That command instructs the Flash chip to "send your JEDEC ID and do nothing with any other data that you receive". You keep sending data (which is all zeroes and will be ignored anyway), and as you do so it sends you back its JEDEC ID - you get back one byte of JEDEC ID for each zero byte that you send. When you raise /CS at the end of the transaction, that resets the Flash chip's controller. |
H: Switch Vcc to Ground with a control bit
I have a device that is 1 ohm and it consumes 3Amp. I want to run my device in both ways and I have only one voltage supply. I want to switch ground to Vcc and vice versa with a control bit from mcu. I considered cmos invertes, but I am not sure if the resistance of cmos inverter gate is high or not. Because voltage supply can supply limited current. And is it possible to use only 1 control bit to handle this situation, or 2 control bits are needed?
AI: In general, CMOS inverters won't be able to source 3A. As Wouter van Oeijen stated, an H-Bridge is what you want. The princicple of operation is shown below. As shown, S_B1 and S_B2 are closed, causing a current flow from right to left. When you instead close the A-Switches, the current is reversed. When you want no current at all, open all switches. In reallity, the switches will of course be transistors requiring a decent driver stage.
simulate this circuit – Schematic created using CircuitLab
A problem with these bridges is, that you must not close i.e. A1 and B1 at the same time. Therefore a certain delay has to added when reversing the current.
What exactly is your load, are you sure that you can assume an ohmic load? Or is it a motor? |
H: Best microcontroller for industrial applications
I have an industrial project requirement to build a device having this functionality:
Store Data
Send Data to Web Server
Device to be placed under scorching sun
Sensors - around 5
A Graphical Dashboard
RFID authentication
Buzzer
And maybe a couple more. I am totally getting confused which microcontroller to use:
MSP430
ATMEL
PIC
ARM (Cortex)
etc
Or others but I am not sure - I presume that there are other families also for my aid which I don't know. So which microcontroller should I use based upon performance, storage, durability, speed, architecture and robustness?
AI: Which micro-controller should I use based upon
performance, storage, durability, speed , architecture and robustness?
To that list add
availability,
second sourcing,
cost,
remaining lifetime before obsoleted,
support,
cost of entry to development (hardware, compilers,
familiarity with language or hardware,
and any other factors that are of more than trivial relevance to you.
Then decide relative importance of various parameters to you and give each a value from say 1 to 10.
Choose candidate processors that appear to be able to do the job.
For volume production only, you COULD subset at this stage based on costing within the range you can justify for volume purchasing.
Score each candidate roughly according to how they seem to match your criteria.
Order in list of declining score.
Decide if there is any obvious good reason not to discard the bottom half of the list.
Discard bottom half :-).
Look at top few candidates.
If one has a stand out score relative to all challengers, more carefully score the top say 3 again.
If there is still a standout, decide to probably use it, and ask sales rep for each why you should use theirs :-).
If no standout, choose one that you feel happiest with for reasons that seem good to you and use it.
If that is a one off or few off application, and maybe even if a many off,
then if this "Internet of things" device will do what you want, consider using it.
Spark Core - Open source software, open source hardware, open source 'cloud' presence, ARM based, Arduino compatible, WiFi on board.
A person conversant with the genal areas involved can have one of these doing useful things via the internet in (well) under an hour.
Features: https://www.spark.io/features
AND it looks good ...
PS: I have no involvement with Spark Core. I have one sitting on my desk as I type - as yet unused. Any day now. |
H: Transformer current peaks
So I am designing a power supply, got everything calculated, and decided to simulate it for a second to see if the smoothing caps keep the voltage above the regulator limit at max current draw. What I noticed, that the current through the transformer peaks to nearly 2.5 amps when the cap is charging in the transformer.
Will it destroy my 300mA transformer?
AI: Well done!. You have identified a real world effect that many people are unaware of and that can cause significant problems. As well as the undesirable effect of the current spikes on capacitor ripple current (causing reduced lifetime) and possible transformer heating, the sudden current peaks cause RFI (Radio Frequency Interference) from the diodes. Power supplies with too low a primary DC resistance can be RF noise sources! Who would have thought ? :-).
The solution is easy but counterintuitive.
You need "spreading resistance" to increase the capacitor charging resistance. This adversely affects supply "regulation", as Vout drops with increasing load due to the resistor, but a compromise resistor value greatly improves results without too much effect on the regulation. If you are supplying an electronic regulator with this circuit then the drop caused by the resistor can be designed to have no effect at all on Vout, as it simply reduces regulator "headroom" slightly.
Add a small series resistor in the bridge to capacitor lead.
When the bridge voltage rises above Vcap, the higher the current would have been, the greater the drop in the resistor which raises the apparent value of the capacitor voltage temporarily.
Assuming you have about 15VDC peak and want 12 VDC out you have 2V or 3 V headroom. If Ipeak_usual is 300 mA then to drop say 0.5V in the resistor at 300 mA it would have a value of R=V/I = 0.5V/0.3A = 1.66 Ohms. Say 2 Ohms for convenience.
Clearly the prior 2.5A peak is now impossible.
At 2.5A the 2 Ohm resistor would drop V=IR = 2.5 x 2 = 5V and once the capacitor is at working voltage, there is not 5V of "headroom" to drive it.
By changing the R value and looking at the resultant current waveform you can choose a value which is large enough to "spread the conduction angle of the diodes, and small enough to limit the voltage drop as load current increases.
Long long ago undergraduates were given this problem to solve with capacitor value and desired peak diode current as parameters. Without 'modern aids' it was a nasty iterative problem and a good introduction to the real world. Ask me how I know :-). |
H: Why is my instrumentation amplifier's output voltage completely wrong?
I'm trying to amplify the voltage of my load cell (Wheatstone bridge I believe), but my calculated values are not the same as my experimental values.
The load cell outputs a differential voltage of 0.1mV - 5mV (measured with a voltmeter), and I want to boost it to 0V - 5V (initially, then from 0.3V - 3.3V).
The OP Amps I'm using are MCP6273 "170 μA, 2 MHz Rail-to-Rail Op Amp".
Problems:
First stage is amplifying the voltage - I put a 2.5KG mass on the load cell, and it output a voltage of 2.5mV differential voltage as expected. However, when I measured the differential voltage between the outputs of the first stage op-amp's (all resistors removed, unity gain) I get a differential voltage of 7.8mV. Why?
Output of second stage is complete wrong. R1 and Rgain are 1Kohm each. R2 is 470 ohm, R3 is 100k ohm. This should give me a gain of 638 (i.e. 63.8mv - 3.19V at the output). However, even with no load (i.e. 0mV) the output is 3.3V. At 2.5KG (i.e. 2.5mV) it hits the 5V rail.
I have checked the connections multiple times
I have tried simply buffering the input (i.e without R1/Rgain/R1)
All the op amps are identical
What am I doing wrong?
AI: The offset voltage of each of the op-amps you're using can be as much as +/-3mV at room temperature. So, the difference between two outputs could be as much as 6mV different from the inputs with unity gain. You're seeing 5.4mV which is large, but within specifications and therefore plausible.
Since you don't have much gain in the first stage (only 3) you also have to consider the offset voltage in the second stage. In any case, 638 times your measured differential input offset voltage of 5.4mV + 2.5mV signal is almost 5V.
You can either use better op-amps (such as autozero or 'zero drift' types) or null out the offset voltage by some means (trimpot or reduce the gain and do it digitally). You should also consider the drift of the op-amps you're using which is not guaranteed, but is fairly reasonable typically (+/-1.7uV/K). |
H: Is it possible to step-up the output of a laptop USB port to 12 watts?
I've got a USB device that requires 12 watts to charge.
My laptop appears to output less that that.
My question is: Is it possible to step-up the output of a laptop USB port to 12 watts?
AI: No. This is basic physics. There is no free lunch (or energy).
If the laptop only puts out 500 mA at 5 V, for example, then you get 2.5 W. You could convert this to a different combination of voltage and current, but the result can't on average exceed the 2.5 W you put in (It is possible to get higher power out for short durations, but that's clearly not what you are asking about. The average out still can't exceed the average in.). Since no conversion will be 100% efficient, you will actually get a little less power out, with the remainder getting dissipated as heat in the converter.
For example, let's say you can make a switching power supply that is 90% efficient. That means with 2.5 W in, you get 2.25 W out at some other voltage and current combination. The remaining 250 mW will heat the switching power supply. You could get, for example, 10 V at 225 mA, 24 V at 94 mA, 2 V at 1.13 A, etc. |
H: MOSFET current mirror: Saturation mode?
I have some trouble understanding why M1 is in saturation/active mode.
According to Wikipedia a MOSFET is in saturation mode if \$V_{GS} > V_{th}\$ and \$V_{DS} \ge (V_{GS} – V_{th})\$.
However as drain and gate are tied together \$\implies V_{DG} = 0 \implies V_{DS} = V_{GS}\$. Therefore \$V_{DS} \ge (V_{GS} – V_{th})\$ can't be true (\$V_{th} > 0\$)? What am I missing?
AI: If \$V_{GS}=V_{DS}\$, and \$V_T>0\$, you can change the saturation requirements of \$V_{DS}\ge V_{GS}-V_T\$ to \$V_{DS}\ge V_{DS}-V_T\$. Subtracting \$V_{DS}\$ from both sides gives you \$0\ge-V_T\$, which can also be written as \$V_T\ge0\$. This is why this configuration is always in saturation as long as you meet the other saturation criteria of \$V_{GS}>V_T\$. |
H: How does the drain current flow in a MOSFET when the channel is pinched off?
Here is what I have understood. Please correct me if I'm wrong.
The depth of induced channel depends on the voltage V. Since the voltage across the gate and the path along the channel decreases from Vgs at the source to drain end to drain end, the channel is not uniform an is tapered. If the applied voltage Vds is increased to some value which causes the voltage between gate and drain end to be lesser than the threshold voltage, the channel is said to be pinched off.
If the channel is pinched off, how does the drain current flow? It's given in the book that the MOSFET enters saturation region and will have a constant value of drain current. But I don't understand how does the current flow when the channel no longer exists at the drain end.
AI: The current can still flow through the "substrate" even though the channel is pinched. The reason why it saturates is that there will be a region of higher resistance of size proportional to the Drain-Source voltage, and therefore the resistance of this region will be proportional to the same voltage.
But as current is voltage/resistance, the dependence will cancel out and you'll get "constant" current.
From Wiki (emphasis mine):
Even though the conductive channel formed by gate-to-source voltage no longer connects source to drain during saturation mode, carriers are not blocked from flowing. Considering again an n-channel enhancement-mode device, a depletion region exists in the p-type body, surrounding the conductive channel and drain and source regions. The electrons which comprise the channel are free to move out of the channel through the depletion region if attracted to the drain by drain-to-source voltage. The depletion region is free of carriers and has a resistance similar to silicon. Any increase of the drain-to-source voltage will increase the distance from drain to the pinch-off point, increasing the resistance of the depletion region in proportion to the drain-to-source voltage applied. This proportional change causes the drain-to-source current to remain relatively fixed, independent of changes to the drain-to-source voltage, quite unlike its ohmic behavior in the linear mode of operation. Thus, in saturation mode, the FET behaves as a constant-current source rather than as a resistor, and can effectively be used as a voltage amplifier. In this case, the gate-to-source voltage determines the level of constant current through the channel.
Also, from the MOSFET operation description, under saturation:
Since the drain voltage is higher than the source voltage, the electrons spread out, and conduction is not through a narrow channel but through a broader, two- or three-dimensional current distribution extending away from the interface and deeper in the substrate. The onset of this region is also known as pinch-off to indicate the lack of channel region near the drain. Although the channel does not extend the full length of the device, the electric field between the drain and the channel is very high, and conduction continues. |
H: How do I find the voltage range for an unknown DC motor?
I have a small unmarked motor with a burned out speed controller board. I'm able to figure out that the motor is a DC motor because it has two wires coming out of it and there's a rectifier on the speed controller.
I want to find out what is the maximum voltage range for the motor, but it is proving difficult. The board appears to have a triac and perhaps a diac or some diode. There's no transformer so I guess it's probably operating at full 120V. There's also a bunch of resistors and capacitors which is probably uses for PWM.
I chucked the motor on my drill press and spun the shaft at 570RPM or 59.69 radians/sec and got 16V output. The motor resistance is 39 ohms (was reading 50 before).
Is there a chart or formula for the voltage vs speed and or voltage vs torque for a DC motor?
FYI, the motor diameter is about 2 inches wide and the height of the motor is about 4 inches. The motor has a plastic worm gear attached to it and was used as a neck massager. My guess is that it needs to operate at high torque.
Here's a photo of the motor and a snap shot of the circuit:
AI: It's mostly about how much power the motor can safely dissipate without getting too hot. A secondary issue is you don't want the motor to over-spin, but usually it's pretty obvious when it gets that far.
Your measurements give us some idea, but it would be additionally helpful to know the physical size of this motor. That allows for the first pass guess as to how many Watts it can dissipate.
At 570 RPM (9.5 Hz) you got 16 V out. Most motors can do at least 3600 RPM (60 Hz), so let's see how that works out. At that speed, the back EMF would be 101 V according to your measurements. If you think it might be intended to run from rectified 120 V AC, then let's see what 170 V does, since that's what you'd get if there is a capacitor after the rectifier. 170 V - 101 V = 69 V left over to drive the motor at 3600 RPM. That would deliver 95 W to the motor, which is a lot unless it's at least maybe 6 inches across.
Let's look at it another way. For the back EMF to be 170 V would require 6000 RPM (100 Hz). That would be the absolute maximum speed. Is that plausible? That's not out of line for a DC motor, not knowing anything else about it. Of course it wouldn't actually ever get that fast because there would be no EMF left to actually drive it, and no torque left to drive anything else.
At 5000 RPM, you'd have 140 V back EMF with 30 V left over to drive the motor at 170 V in, which would take 18 W. That could be quite plausible if the motor is at least fist-sized. |
H: What to do with transistors I had desoldered from TV
I am a beginner in electronic design and want to learn about transistors.
I have an old TV and I decided to de-solder the following transistors.
Can you tell me what I can use them for, are they all the same, and if anyone has some literature where I can start, and some schematics if possible?
Here are the part numbers for the transistors I have de-soldered.
AI: The 2N3904 and 2N3906 are very common NPN and PNP transistors, and can be used in many circuits that calls for small-signal (as opposed to power) transistors. Both can drive 200 mA.
There are hundreds (or more) sites with circuits using these transistors. Google "2N3904 circuits" or "2N3906 circuits". Some are for amplifiers, some are for timers (blinking LED's), and some are for making various kinds of sounds -- sirens, musical notes, etc.
Here are a couple to get you started; the first is a Class A amplifier using a 2N3904 in a common emitter configuration:
and the second is a Class B amplifier using both the 2N3904 and 2N3906 in what's called a complementary configuration:
The values do not have to be exact; in partof the fun is changing them and seeing what effect that has. You can learn about how the initial values are determined by reading about "biasing" in articles like this.
You may also run into circuits using the 2N2222, which is like a 2N3904 but can switch three times as much power. So if you find a circuit using a 2N2222, as along as it doesn't need to handle more than 200 mA, you should be able to get by with a 2N3904 instead.
You can get the datasheets for any of these by Googling the part number along with the word datasheet, several ones will show up. You can also try looking them up in a distributor's webpage like Digi-Key. |
H: Comparator input interfacing
I need to digitize a weak (-10 dBm) 1-20 MHz signal with a comparator. The output of the preceding stage is 50 ohm.
The comparator I'm using is the LT1715. It's input trip point is ± 5 mV and the bias current is -2.5 µA (-6µA max). Is it correct that the bias current is the current the source needs to provide in order to reliably toggle the comparator?
In a 50 ohm system, I understand, the RMS voltage of a -10 dBm signal is 70 mV. That would be enough for toggling the comparator.
If I now simply connected the signal trace to the comparator input, I assume it would be reflected and the voltage would double. The reflection however would end up in the preceding amplifier and increase the noise.
For an ideal comparator with infinite input impedance, I'd simply terminate the signal with a 50 ohm resistor right at the comparator input.
But that would kill the signal for the real comparator.
How should I go about minimizing reflection (and ideally improving efficiency)?
AI: 70mV is well above the comparator's trip and offset voltages, so there is no need for any termination tricks. With 50Ω termination a bias current of 6uA would only change the input voltage by 0.3mV.
As well as avoiding reflections, using a 50Ω input termination also helps to reduce feedback and noise from elsewhere in the circuit. |
H: Is a 75 KHz 12V peak signal suitable for LM324N?
The LM324n has a gain-bandwidth product of 1 MHz, so I guess it works from 0 Hz to 1 MHz, is what I understand true?
Its slew rate is 0.5V/us which means that it can generate a 500 kHz output signal, is that true too?
If the above are both true, why when I apply a 75 kHz 12V peak signal to Vin+ with +12V DC supplies and Vin- is connected to Vout so it should work as a buffer, is the output signal destroyed?
AI: There are a couple of problems with what you are trying to do:
The slew rate is not sufficient to pass a 75kHz 12Vp signal. The max rate of change of your input signal is the max of the derivative of 12*sin(wt) or max(12*w*cos(wt)), which is 12*w or 5.6V/us. Look at Fig 11 in the datasheet.
The max output signal swing is (typically) the supply rail minus 1.5V, so a buffer with +/-12V supplies will not be able to reproduce a 12Vp sinewave. |
H: Unexplained behavior pic port b on change interrupt
I am trying to configure the port b interrupt on change interrupts to work with a program I am writing with MC XC8 demo version. I am using a PIC16F628A I am using this code to initialize the pic for interrupt reading. However it seems when I start up my program an interrupt is called. I don't understand why this is happening as the datasheet says interrupts will only be generated for pins set as an input and I have set all of port B to be output. Could someone please explain this strange behavior
int main()
{
TRISA2 = 0;
TRISA3 = 0;
PORTB = 0;
TRISB = 0;
CMCON = 0x07;
initialise();
writeCommand(0b00001111);
writeCommand(0b00000110);
writeString("Hello World ", 11);
GIE = 1;
RBIE = 1;
PEIE = 0;
while(1);
}
void interrupt interruptRoutine()
{
if(RBIF)
{
writeString("Interrupt", 9);
RBIF = 0;
}
}
AI: I'm guessing that the interruptRoutine gets called between RBIE = 1; and PEIE = 0;. That's a brief opportunity between instructions for an already-pending interrupt to fire. (note that the interrupt latency could make it appear that it happened an instruction or two later than it actually did) So you might want to rearrange your interrupt configuration instructions to close that gap.
Now the question is, "Why do you get the interrupt at all, given that they're all outputs and the datasheet says that it won't generate one?" I suspect that the interrupt was actually generated while they were still inputs, because that's the default direction and it's really hard to change immediately on power-up. So you already have an interrupt pending, just waiting to be enabled.
When I configure interrupts, I always make sure to clear the flags just before I enable them. That keeps any garbage interrupts from occurring. |
H: Creating a home made ultrasound transducer
I don't know how ultrasound transducers (transmitters) are made, is it possible to create a home made ultrasound transmitter with a custom specific range 1MHz or more? If it is not, would a 3D printer make it possible (to print parts)?
I don't understand why they cost so much and are very hard to get, from my understanding it is just a piezoelectric crystal.
There is a previous question: Building an Ultrasound Generator but nobody answered, they only posted websites to purchase not make.
AI: Ultrasonic transducers in that frequency range are not easy to construct since the resonant element (which usually is fabricated from piezoceramic material) must be very thin and very uniform in thickness and must have conducting electrodes (usually silver or nickel) deposited on two surfaces. At present, 3D printers are not capable of manufacturing such devices as they cannot handle ceramic materials and their accuracy is not good enough at the thicknesses required. However, you can buy reasonably priced transducers by searching online for 1 MHz transducers (e.g. http://www.steminc.com/PZT/en/mist-generation-transducer-16-mhz). |
H: Compromise needed combining virtual grounds
This is a long story for which I hope my proposed solution to a problem I've created will be a stable one. But op amps can surprise you, so let me explain. The circuit is large and complex, so I'd like to avoid posting it in favor of discussing the key issue I'm focusing on.
I have a circuit that uses several low voltage rail-rail op amps for some audio processing, and it is powered by an isolated single ended 9VDC supply, and further reduced to 5VDC with a standard 7805 regulator. Now I'm in that habit of always using a spare op amp in a unity gain buffer config to develop a virtual ground, using a pair of matched resistors and a bypass cap on the + input. I'll usually put a cap on the output too. And in cases like this where the supply is isolated, I will also connect that virtual ground to the ground pins of all input or output jacks to and from the device. This means no ac coupling caps are really needed on the signal input or output pins, though I'll usually add some small resistance on all I/O points to help protect the op amps. Anyway, I've been doing this for years and have had good results with acceptably low noise. And since the circuit already has an on-board 5VDC regulator, I added an "AUX 5VDC output" on a "pin" jack, so that it could power a companion "future" device.
Well it wasn't long before I decided I did need such a companion device in a separate box. Kind of an add-on "adapter" product. And I would like to use that "AUX 5VDC output" on device #1 to power my companion device. This second device also uses the same low voltage OP amps as #device 1. So the second device will also need a virtual 1/2V ground too. If the audio signal from the second device is always connected to the first device with a standard audio cable, then I already have a virtual ground coming in through the ground wire of that audio cable, and I won't even need a second "spare OP amp" V-ground in device #2. Maybe just an extra capacitor. But, I also want the second device to be able to work independently, with NO audio cable connection to the first device at all. And for that to work, device #2 must have its own independent virtual ground. I guess I could just use voltage divider and a capacitor, but I'd rather do it with a spare op-amp, as I did in device #1.
But can you see the problem I've created for myself? If device #2 has its own 1/2V virtual ground, and its running off the same supply as device #1, there is going to be a conflict if these two devices are connected together with an audio cable! Unless the two virtual grounds are absolutely identical 2.500000000... VDC, then there will be unwanted current flowing between the two virtual grounds. At the very least, I'd expect that to add noise. At worst, it could cause some strange instability.
So one solution I'm considering is to use a circuit like this one, for the virtual ground in device #2...
This circuit is nearly identical to the virtual ground circuit I'm using in device #1, but this time I've added a resistor to the op-amp. That resistor might only be about 50 ohms. Now if the two virtual grounds meet, and there is a small fractional DC difference between the two I'm hoping it will quietly be dissipated through that 50 ohm resistor. The virtual ground from device #1 will actually "prevail" as the dominant V-ground in that case. Then if device #1 is disconnected from the audio chain, device #2 can be used independently, because it will still have something very close (within 50 ohms) of true virtual ground.
Now this all seems to work well on the bench, but does anyone see any potential "gotchas" here? Its hard to really know for sure. Both devices will have to have their audio I/O connected to a wide variety of equipment used by musicians (effects pedals, PA console mixers, etc), so its impossible test every case. If you do see some gotchas and have some remedies, please consider that device #1 is already committed to what turned out to be an expensive prototype 4-layer PC layout, and prototypes have already been constructed. It would therefore be best is any remedies could be confined to device #2, as its just in the breadboard SCAD stage. :-)
Thanks for any thoughts.
AI: What if you use your second (or indeed first, or indeed any of all the other devices) with a device made by someone thinking the same as you with a shared supply in some larger encompassing device? Call the person and ask if the one ground is the same as the other ground? i.e. Is signal ground the same level as power ground?
I can tell you, in "cheap" designs many do it the same way as you, but often use the full power input to divide. So you are going to compete. Violently, if their reference is 12V/2.
If you want to make a good design that's universally compatible, you make sure that the external grounds are all actually the same hardwired level. So if you output a +5V and a 0V only, that 0V should be the same as the 0V on all the audio plugs. That's a good design.
So in this set-up, what would have been better is to output your original 5VDC as a +/- 2.5VDC balanced around your 'weak' virtual ground in a three pin plug. Then suddenly you have a balanced power supply to your second box and you could even devise a system where if the middle pin is not lifted to half VCC, then you make it yourself if needed. Or for separate use make a second DC plug with a switch built in that activates the divider and disconnects the 5VDC lines (for safety).
The high-end or 'common rail' design thing if you have a DC input jack, is to use a voltage inverter to obtain your negative rail, +9VDC --> -8VDC ; +9VDC --> +5VDC ; -8VDC --> -5VDC (or 2.5V for each, but then, use 5VDC in, for efficiency). Or even better a fully isolated balanced DC. Unfortunately nobody else who makes $10 gadgets does this, so you can't even assume it.
Want to use a divided VCC as a virtual ground with an external DC adapter and stay safe and compatible to "shared power situations"? One of two options:
You'll have to decouple and route the hard external ground through input and output or just force your own ground on the output again. It's not awesome, but it's what it is.
Add the DCDC isolation on the DC input I discussed before. If your consumption is as low as 1W DC/DC with +5V and 0V out or +3.3V, 0V and -3.3V out is about $5. Using the balanced with two low-drop 2.5V regulators, one negative one positive, will even get you much better thermal stability on the ground and its relation to your supplies. Plus, it sources and sinks the maximum available current with no problems or aberrations. In fact, doing that same trick with your original DC input would have been possible by first dividing the 9V to virtual ground and then dropping the original power lines to +2.5V and -2.5V.
If you go down the rabbit hole of "Oh, I'll just assume it's only a 0.1V difference", in six months you'll be kicking yourself, because you have a 9VDC system with a 4.5V virtual ground, etc. |
H: Using bench power supply to drive ex-cordless driller
Ok, so I perhaps naively thought I was the first person to ever think of this - go figure.
Anyhow I managed to get my hands on a couple of cordless drillers which have an expired battery and thought that if I added a power jack (socket) to one of the drillers I could buy a cheap external "wall wart" power supply to drive it. It turns out that it is not that easy to find such a power supply but I have recently bought a bench power supply which can deliver up to 30V and 5Amps so I thought I could use that given that the driller runs on 18V and draws between 1 Amp and 3.4Amps in operation (the latter when I held the chuck to simulate resistance (and torque current)).
The snag is that some guy at the local electronics shop told me that if I use the bench power supply I would almost certainly damage it (specifically he said that switched mode supplies should NOT be used to drive a driller and that I should use an old style "brick" transformer).
I have in fact already operated a similar driller using the bench supply (to test motors for my robot) but this was only for a few seconds at a time. There wasn't any evident harm to either motor or supply.
But was he right? I obviously would not like to think I had saved a few Euros only to have to throw away my new bench power supply.
AI: Don't know what the guy at the local electronics shop was smoking, but it's very common to drive dc motors with a switch-mode power supply. That's effectively what the variable speed trigger in the drill itself is doing already and it's what millions of radio-controlled modelers do with their motors every day. But even so, the output from you bench supply will be reasonably well filtered and smoothed, so its much the same DC as what you would get from the battery originally fitted to the drills. So by all means crank up you bench supply to 18v, set the current limit up to something sensible and go for it! |
H: Voltages with an earth ground
In this diagram, from what I understand the voltage between the positive terminal and the first earth ground is \$ 0V \$ and the voltage between the negative terminal and the earth ground is \$ 0V \$. So why then would you do this earth grounding? In what situation would the current flow between the earth grounds?
AI: The idea is that the power supply has a very high voltage output. So this diagram says "if you are afraid stupid people will come near, use a dirty trick":
You can connect the negative terminal of the supply to the mains earth ground or to the earth ground in another way and rely on it to be low in impedance in its route to the load. Then at the load side also connect the negative terminal to earth ground.
Now the current "can" flow from the power supply's positive terminal, into the load's positive terminal, through the load, into the power earth at the load's side, then from power earth back into the power supply.
Assuming we live in a world where everything always works in real life as it does on paper. This practise is largely abandoned for several very good reasons, the simplest of which is the universal rule: "You cannot rely on what you did not install yourself". Another major, but simple one is: People, that can be grounded through some point of touch, may invalidly assume they can touch the wire, because they are only touching one. The famous "one hand in the pocket" rule will not be enough any more to save people from nasty shocks, so in stead of preventing them, you are inviting them.
In my opinion a much better way of avoiding electric shock is to install the system with two good and insulated wires, as is mandatory in many parts of the world, and just not invite stupid people who like chewing on unknown wires near those wires. |
H: Why conceptually we connect circuits to earth but in reality that doesn't really work?
This question is best seen with an image:
Above we can see two equivalent representations of a circuit, on the left side we have a voltage source closed-loop connected to a Resistance (R), and on the right side the open-loop equivalent connected to earth. From this point we would say that both circuits should behave equally.
However when we try to translate the conceptual representation to real life, we find that the current doesn't flow in the second circuit, this is obviously because the floor is usually made of a non-conductive material, but then why do we make such a conceptual representation? On the other hand I've seen in constructions and other big electrical devices that the usually wire the machine to the floor, how come the floor will conduct in such case?
I was taught in school that 'earth' represents an infinite warehouse of charge, so we can give and extract as much charge as we need from it, then why in my example circuit I can't extract the charge?
AI: It does work that way. The problem is that you are comparing an ideal concept of Earth (e.g. one uniform level of potential energy) with a realistic concept of a floor... and that doesn't work.
The problem is that the floor is highly resistive. The ground is too if you don't bury a large enough conductor deep enough (e.g. deep enough to access the underground water table).
I've revised your drawing as follows:
simulate this circuit – Schematic created using CircuitLab
In the top figure, you can see a more accurate approximation of your floor terminated circuit.
In the lower figure, you can see a practical approach to "earth grounding". This is how your machine is connected. The return path is shorted to the Earth, but not through the Earth. This connection ensures that the reference potential of your circuit is largely the same as the surrounding environment.
AC powered machines are usually connected this way as a safety measure. It ensures that if a power line inside the machine becomes disconnected and touches the metal chassis in error -- and you then touch the outside of the machine -- the path of least resistance will be through the ground wire to the Earth, and not through your body to the Earth. |
H: How can I solder this circuit board without breaking it?
I bought a current sensor (link). I would like to connect it to my project, and I was planning to do so by just soldering on copper wires.
There is a resistor on each side, with blobs of tin on each side to keep it in place. These blobs reach out to the place where cables are supposed to be soldered on.
I haven't tried yet, but I imagine, that if I try to solder on the wires this, the tin blob will melt enough that the position and connection of the resistor will change. Thus the resistance will change and the current sensor is no longer useful.
How should I go about this?
In general I wonder about the construction of this board. If the blob on one example reaches just a tenth of a milimeter further towards the other side of the "resistor bridge", then the resistance will be lower.
On the picture from the website (shown below) the blob is smaller, and it would be easier to solder witout changing the connection to the resistors. However it does not look like the resistance is the same from board to board, with this type of "human" soldering. It looks very imprecise.
AI: I don't really see you'll have a problem, for the resistor to move the solder on both ends would have to be molten. For that to happen a lot of heat would have to conduct through the resistor and at that stage it'd be getting it so hot that damaging the PCB and/or resistor would be likely.
I'd just start by soldering one side as per usual and then give it a minute or two until it's cooled entirely before starting on the other side. |
H: Strange problem with JY-MCU (HC-06) Bluetooth module
Short explanation: data sent over the bluetooth serial does not arrive correctly to the Arduino.
Yesterday I connected a JY-MCU bluetooth module to my Arduino UNO R3 to test it. I connected the TXD and RXD pins to Arduino pins 10 and 11 respectively and used SoftSerial to communicate. I first tried some AT commands that I found online. After AT returned OK, I ran the code found here and got this output:
Starting config
OK
OKlinvorV1.6
OK57600
Done!
So the name and pin changed failed, but I (supposedly) changed the baud rate successfully. However, any further attempt to run any AT command failed (no output), even when I set the new baud rate (57600) in the soft modem. I then tried to pair it with my PC and used the following code to test:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11);
void setup() {
Serial.begin(9600);
mySerial.begin(57600);
delay(1000);
}
void waitForResponse() {
if (mySerial.available()) {
while (mySerial.available()) {
int a = mySerial.read();
Serial.println(a);
}
Serial.write("\n");
}
}
void loop() {
waitForResponse();
delay(2000);
}
In short, I wait for the module to receive something and then print the value of every byte. What's strange is that the data I send (using cutecom on the PC) is simply not correct - for example, sending the letter A (either lowercase or uppercase) outputs the number 161. However, sending two letters A outputs the numbers 161 and 176 despite the fact they are the same letter. I have very little experience with serial communication, but this looks like the baud rate is not correct. However, if this is the case, I don't know how to change the baud rate back to 9600 since I can no longer send AT commands to the module.
Any help on how to get the module to work properly or at least an explanation on what is happening here is more than appreciated.
AI: The baud rate 57600 is a pretty marginal on an AVR (the microcontroller used) at 16 MHz, normally OK with only a bit over 2% error but some modules can be picky. The site WormFood's AVR Baud Rate Calculator shows some good tables on error percentages for various clock / baud rate combinations.
Also I just noticed Majenko's comment and he's quite right the software serial you're using will be worse at that speed so for a start try it using a hardware UART.
That Arduino runs at 5 V logic levels so if you're not using a voltage divider to drop the transmit line to 3.3 V that might be worth try first. I've read a few mixed things about whether the HC modules are 5 V tolerant on the serial lines or not and it certainly won't do any harm trying it first to see if it resolves it.
But if neither of those steps work I'd recommend getting a USB to TTL serial converter, it seems for that module you should look for one with a 3.3 V logic level like this one for Sparkfun. They are also useful for a host of other things so are generally useful to have at your disposal. |
H: Electric shock with isolated material in the circuit
I never understand why electric shock happens if I'm connecting to ground by isolated material.
Let's consider an example with monophase 220V electrical system electrical shock while I'm wearing rubber shoes and touching a stripped wire.
With this circuit an electrical shock happens: electrical system- stripped cable - hand/body - rubber shoes - ground- electrical system- ...
However if I swap the order touching the wire with a shoe in my hand there will be no current through this circuit: electrical system- stripped cable - rubber shoes - hand/body - ground- electrical system- ...
The same considering the ceramic tile on the floor. This isolate me if I put it between the wire and my hand, but not if it is between my foot and the ground.
AI: It boils down to current distribution, but let's start from the beginning.
In both cases you form a circuit with several elements in series. Some of them have excellent conductivity, like copper wires. You are of meager conductivity, but your shoes and ceramic tiles have even worse conductivity, they are dielectrics. As the dielectrics have contact to or are in between conducting elements in a geometric relationship they form capacitors. This circuit consisting of capacitors and resistors permit AC current to flow. Aside from some other effects the current should be the same order of magnitude in both configurations.
What's the difference now between both cases? When touching the copper wire you form a conductive connection with a very small area for the carriers to pass. As two conductors connect, there can't be a strong electric field either. Due to the small area the current density maximises and you can sense it. n.b.: you can't sense it at your feet, can you?
The other case differs as you touch a dielectric. This dielectric differs from the surrounding air but not very much to change the electric field dramatically. Hence the electric field vectors connect to your skin perpendicular and with merely unchanged field strength. At your skin the electrical surface charge influenced by the field causes a current, but this time distributed over the surface of your hand. You can't sense it. |
H: When setting pin as input it getts pulled high, why?
I've hooked up a push button to GP1 and a LED to GP2 on my PIC12F683 and this is my code:
unsigned char i = 0;
void main() {
TRISIO = 0b00000010;
CMCON0 = 0x07;
ANSEL = 0b00000000;
while(1){
i = GPIO.B1;
if(i == 0){ GPIO.B2 = 0; }
if(i == 1){ GPIO.B2 = 1; }
}
}
But when I plug in the power my LED is turned on, even when I remove the switch from the breadboard.
I'm using MikroC. When I set GP1 to output the LED was turned off.
What is the problem likely to be?
My config:
Scematics:
AI: Disable the internal pull-up resistor of your input pin. In AVR it's usually done by configuring the pin as input and setting it to 0. (I don't know much about the PIC but it's done this way in Atmel's AVR).
also if your push-button is connected to VCC, you should put a pull-down resistor on the input pin, so when the switch is off, the input will be connected to GND and the value will be zore.
if you are confused by the thing's i've said, just put a 1Kohm resistor from your input pin to ground. It should solve your problem! (it just gonna use more power, but it's not much!) :-)
also here is a good refference on pin configurations for PIC (with lot's of pictures!):
http://www.mikroe.com/chapters/view/4/chapter-3-i-o-ports/ |
H: Power Mosfet design issue
My schematic
The components
BSN20 is a N-channel enhancement mode field-effect transistor (datasheet)
IRF7416 is a HEXFET power MOSFET (datasheet)
This is a part of a project in which the line into R2 comes from the PWM of an ATtiny88 (datasheet).
The R2 is set as an output from the ATtiny88, at first the heater line was High all the time when R2 was toggled (PWM).
When attempting to debug the hardware I found that if I placed flux or isopropyl alcohol across the line to R2 (from the ATtiny88) to ground, the heater line would toggle as expected (it took longer than it sounds to come to this conclusion).
In further research I found this webpage which indicated I may need a resistor to help pull down the gate pin of BSN20. At the time I only had a diode so I placed it with the "flat" side to the gate and the "triangle" side to ground and it made it work.
Questions
My three questions are:
In an ideal circuit should my design work?
In a real circuit was my mistake that I needed a Mega Ohm plus resistor between the gate and ground to make sure the gate went to ground?
Is the diode working as a hack, such that it provides a few Mega Ohm resistance with the way I placed it in my circuit?
In the long run I'd like to turn my DIY prototype into a produced circuit board. I have a computer science background not EE and would like to know what's going on and where I made my mistakes so that I can produce a valid design.
One more question
With more time to debug, i found one more variable. the voltage on the ground line in relation to the LDO regulator and at the leg of the source pin of BSN20 is reading 7.3mV. The voltage at several points across the ground trace showed different values. So one finial question. This seems to be either bad board design and/or more-likely a flux and other dirt under some of the chips acting like resistors pulling up the ground line. So...
Why is the diode is working for me?
Mohm resistance
when the MCU sets the pin to ground its pulling the local ground line down to match the MCU in other words causing ~0 volts between the gate and the source.
AI: 1) Yes.
2) No. Your mistake was in not realizing that the PWM output from the MCU couldn't get close enough to ground to turn Q1 OFF all the way, and therefore turn Q2 OFF all the way.
3). Yes, and you shouldn't use a diode, you should use a resistor and it should be something way less than a megohm in order to keep Q1's output transitions crispy. Depending on the MCU's supply voltage, 10k to 100k might be OK. |
H: Do I need OS for ARM Cortex-M0(3)?
I'm a developer of control devices for switch mode power supplies which need to generate a PWM signal(s) with a frequencies about 100 kHz, measure analog signals, communicate vie USART, make relatively simple calculations and so on. It is also important to start up fast and react very fast on some events like external interrupts (often within a fraction of microsecond).
Now I'm using Atmel Studio with GNU C compiler.
I'd like to go from 8 bit AVRs to ARMs. The main reasons are (hopefully): faster, more flexible, more powerful calculations, better community support.
I'd really want a short learning curve and fast development cycle.
I decided to use ARM Cortex-M0 and M3 processors.
Will I be able to use operation system on ARM?
The reasons why I think it could be useful in my case - faster learning curve and development time. But I have some doubts that I will be able to run application within several milliseconds after supply voltage will be applied and that I will be able to interact with ARM peripherals (like timers).
So do I need an OS in my case?
AI: A general purpose operating system, such as Linux, is a different thing from a real-time operating system (RTOS), such as FreeRTOS and ARM's own RTX. You can search for more info about the differences.
From the description of your application I would say that you certainly don't need, and probably don't want, a general purpose operating system. An RTOS could be used but it is probably not necessary.
I believe the ARM Cortex M0 and M3 microcontrollers do not have a Memory Management Unit (MMU) so that will make it difficult to even run a general purpose operating system on them. An RTOS does not require an MMU.
If you are already familiar with AVR programming but you're not familiar with RTOS programming then using an RTOS on your new ARM project is probably going to increase your learning curve rather than decrease it.
An RTOS does not require a lot of time to boot up like a general purpose operating system. An RTOS application can be up and running within milliseconds.
An RTOS should not get in your way of accessing the microcontroller peripherals such as timers. |
H: Usage of WS2821
I got a buck load of WS2821a, and I was wondering, can I use it for something else than driving LEDs?
TechSpec: http://www.world-semi.com/uploads/soft/140305/1-140305102109.pdf
Can it be used for:
0-10v
Triggering solenoids
And how?
AI: By Using Transistors. Or Mosfets. The led Driving pins are basically Open Drain, so a pull up resistor and a transistor, with a low base voltage as to meet the WS2821's regulating Voltage Limit (20~40mA at ~1V, more than that can cause heat issues), would work. I've seen the same thing done on TI LED drivers. Inverted logic of course. |
H: Logic gates. BCD Multiplication. Karnaugh maps (I think)
I have to draw minimum combination of logic gates that multiply any BCD number with a 7. Output is also in BCD. It probably has something to do with Karnaugh maps, that's how we do this sort of problems in class. I don't even know how to start.
AI: Truth Table for BCD number which has to multiply by 7 and output too in BCD can be given as below
K-Map can be given as |
H: Can I use this relay for DC
http://www.dx.com/fr/p/ssr-25da-25a-solid-state-relay-white-134494#.VDmPWPl_uap
It says AC output but how can this transform DC to AC ? Shouldn't this act like a switch ? If my circuit is DC and I close the switch it will transform to AC or will it stay DC ?
AI: According to one review on DX:
by Docteh on 11/26/2012 Involvement:Expert (understands the inner workings) - Ownership:1 week to 1 month
Pros:
Works perfectly. There is a red LED on the DC side of the Solid State Relay. This one also comes with a plastic cover. The cover has holes that allow a screwdriver to go in and be used without the cover.
Cons:
Appears to use more power on the DC side than a similar more pricier SSR like the Crydom ones. Another downside is that AC SSRs such as this only turn off at the zero crossing point, which means you have to use this with AC voltage on the output side.
Most likely (as no datasheet or part list to confirm), it uses a Triac or similar for the actual load control switching, which means that no current can be flowing for it to turn off. On AC, this is simple as the AC signal crosses the Zero point between Positive and Negative. On DC, the DC signal needs to be off for that to happen. It's a catch 22.
So no, you need a DC switching SSR. This one will not work well for you. |
H: What material is comonly used as insulator in laminations?
I am trying to build a brushless motor for quadcopter use, with a semi-CNC lathe and a CNC mill.
I know I can buy a stator core on gobrushless or maybe other place, but I want to know if I am able to build the stator core also.
There is a place near where I can buy electrical steel (silicon steel). I was thinking to use the mill to make several "stars" (shape of the stator core), and then somehow glue them together.
Then I want to know actually two things:
- What can I use to glue the laminations toghether?
- What material can I use to insulate each of the laminations from one another?
I am also shamefully ignorant in this field, so I don't know if this question is nonsense. Please if it is, explain why.
AI: Assuming a stator's core construction is the same as a transformer's construction, this site has some good information, including these little snippets:
These steel transformer laminations vary in thickness’s from between 0.25mm to 0.5mm and as steel is a conductor, the laminations are electrically insulated from each other by a very thin coating of insulating varnish or by the use of an oxide layer on the surface.
...
The laminations used in a transformer construction are very thin strips of insulated metal joined together to produce a solid but laminated core as we saw above. These laminations are insulated from each other by a coat of varnish or paper to increase the effective resistivity of the core thereby increasing the overall resistance to limit the flow of the eddy currents.
Varnish would work for both insulating and bonding to a certain extent, but better would be waxed paper, then mechanically clamp it all together, and encapsulate the whole thing in epoxy or varnish afterwards. |
H: Why is my guitar amplifier acting like a radio when I touch the volume knob?
I just bought an acoustic/electric mandolin (Ibanez M511SE-DVS) that I decided to test out with the only guitar amp that I have (a Baja BG-10). It works fine, but I noticed that when I have my finger on the volume knob, I receive (what is most likely) an FM signal to a local radio station.
Given that I don't have a background in electrical engineering, in layman's terms what are the reasons that a guitar amplifier would pick up a radio signal and feed it back through the output (speaker)? This behavior only happens when I touch the volume button.
AI: The capacitance from the volume control knob through the pot is large enough to allow RF to couple through - from your body, when you touch the knob - to the volume control circuitry, where it gets rectified/detected (turned into an audio signal) and sent through the rest of the amp to the loudspeaker. |
H: Voltage Dividers in a pull-up resistor circuit (why does the pin go to low)
I understand that when the button is in its open state the voltage on the input pin should be fairly close to \$ V_{cc} \$ provided \$ R_1 << R_2 \$ as \$ V_{in} = V_{cc} \frac{R_2}{R_1 + R_2}\$. But, I do not understand why the voltage on the input pin changes to low (close to 0) when the button is closed.
AI: When you press the button, you connect the input pin, and the bottom end of R1, to ground.
Current will flow through R1, and through the button to ground. |
H: What happens when the voltage drop does not equal voltage rise in a closed series circuit?
New to electronics. Can't get my head around so many basic things but the application of KVL is bugging me the most.
I want to know what happens when Kirchoff's voltage law is broken. If for example, I have a 6V battery and a 4V load in a closed circuit. What happens here? The 4V load will consume or result in a 4V voltage drop. There will be a 2V "spare" unused voltage remaining before the current hits the negative terminal of the battery. In this instance, KVL's law is broken (well, I know it can't be).
I think the right way would be to put a resistor with a 2V voltage drop before the current hits the 4V load? That way KVL is not broken.
Which brings me to my next point: how do I know how much voltage drop a certain resistor will cause? If I used a 10 ohm resistor as a load on a 30V power supply, it will draw 3 amp current. Would this resistor cause a 30V voltage drop? If so, would that mean if I put two 10 ohm resistors on the same circuit (instead of one), each resistor will cause a 15V voltage drop?
AI: To me, Kirchoff's Laws are scientific wording of what should be common-sense observations of electric circuits. Unfortunately, common sense isn't as common as we might like.
KVL says that the total of the voltage drops in a circuit must equal the supplied voltage. If that was not true, we would have some voltage across a wire which would result in approximately infinite current in that wire - but KCL insists that the current is the same at all points in a simple series circuit, so we can't have a huge current at one point in the circuit.
If you connect a device that normally requires 4 volts across a 6 volt battery, sufficient current will flow to make the resulting circuit comply with KVL. The voltage across the "4 volt device" will rise, and the output voltage of the battery will fall (due to a voltage drop across the internal resistance of the battery) such that the voltage across the battery and the device are equal. This may result in the destruction of the 4 volt device, if it cannot withstand the extra voltage and current.
Regarding your second point: the voltage drop across a resistor will depend on its resistance, and on the current passing through it, in accordance with Ohm's Law.
For your example of a 10 Ohm resistor across a 30 volt supply, the current through the resistor will be 3 amps, and the voltage across the resistor will be 30 volts. If you add a second 10 Ohm resistor in series, the load on the power supply is now 20 Ohms, so, by Ohm's Law, the current through the resistors will be 1.5 amps, and there will be 15 volts dropped across each resistor, for a total voltage drop of 30 volts.
If you put the two 10 Ohm resistors in parallel across the 30 volt supply, each resistor will now see 30 volts, and will each pass 3 Amps, so the supply will have to supply 6 Amps. |
H: What is the minimum voltage for general loads and peltier units
I am confused with "power ratings" on devices and electrical components.
First, what is the power rating on a home appliance or a electrical component saying when it is 12V? Is it saying "we would prefer a 12V power source"? OR "we need at least a 12V power source?" or "we can't take more than 12V power source"? Or does the answer depend on the device/component? (ie some are minimum, some are recommended, some are required)
Home appliance says it is 12V. But we plug it into a wall power point which is 230V power source (in New Zealand). How are these two compatible?
AI: The voltage (not power) rating on an appliance or electronic device is the voltage that the device is designed to operate on. If you have a 12 volt car radio, and connect it to a 6 volt battery, the radio is very unlikely to operate, but will not be damaged. If instead you connect it to a 24 volt battery, the radio will very likely be destroyed because it is not designed to handle that voltage.
If you connect a device rated for 12 volts to your 230 volt mains, you will likely get smoke, flames, much excitement, and a destroyed device.
Many electronic devices these days are rated for 12 volts or other low voltage, but come with a power supply that can plug into 230 volt mains, and reduce the voltage to the required voltage. Many such power supplies are built into the mains plug (we often call them "wall warts"), so to many people, they may just appear to be a mains plug. If you look at the lable on one of these "wall warts", you should see input and output voltages listed. |
H: Minimum voltage input for thermoelectric unit
Context: I am trying to make a drink cooler with a thermoelectric unit (peltier unit). I want to supply the minimum amount of energy as possible to the peltier unit. Now on my peltier unit, it says "15V" (and 68W). I am not sure whether it is recommended, minimum or maximum.
I would have probably just tried to find a batter that can provide 15V but there were two discoveries that I made which suggest I could possibly get away with providing less voltage power supply.
I read somewhere that peltier units in general can handle between 3 and 15 volts.
I bought a drink cooler using a peltier unit and it is charged by a USB (5V).
Questions:
Are peltier units capable of taking varying amounts of voltage without hindering its quality or damage it?
If so, how would I go about finding what it needs as a minimum voltage input?
Does all my above questions not matter because if I lower my voltage, the peltier will draw more current to meet the power rating (68W)?
Does the power rating of 68W mean, "I need that power as a minimum all the time!"
AI: Without a datasheet, I'd assume that 15 volts is the maximum voltage that should be used, and that, at that voltage, the device will draw 68 watts. If you supply a lower voltage, the Peltier device willl draw less current and less than 68 watts. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.