text
stringlengths 83
79.5k
|
---|
H: Positive Edge Triggered D-FF by switches
if Given that this circuit implements Positive Edge Triggered D-FF so What is the purpose of the switches S2 and S4? Hwo can i know what is the kind of S2 and what is the kind of S4 (P or N)?
AI: A flip flop is two opposite phase latches back to back.
A latch consists (in this case) of a back to back inverter.
To write into a latch you must overcome the feedback inverter (trying to write old value) with the input inverter which is driving the initial bitnode.
One solution to this problem is to cut off the feedback inverter whenever the latch is transparent.
This is the purpose of the switches S2/S4: they prevent the second inverter in each chain from writing back to the input, while the latches are open.
This prevents contention, speeds up the latch, and reduces power consumption. Very common in VLSI. It also removes the need to size the input inverter stronger than the feedback inverter.
Opposite phase is the key word which helps you decide on what type of switch to use.
For a positive edge flip flop, the second latch must OPEN when the clock goes high.
Consider the situations:
CLK high: master latch closed, slave latch opened => S1=off,S2=on,S3=on,S4=off
CLK low : master latch open, slave latch closed => S1=on,S2=off,S3=off,S4=on
From here it easy to see that:
S1 = PMOS
S2 = NMOS
S3 = NMOS
S4 = PMOS
Although typically the switches S1/S3 would be transmission gates. And S2/S4 would be tri-state inverters built into the feedback inverters of each latch.
EDIT
Added a picture. Green circle arrow shows feedback. Red means switch is off. Blue shows where the output data comes from.
So, when clock is low the data is stored in the master latch.
When clock goes high, the master latch is cut off from D. Simultaneously the data from the master latch passes through the slave latch. So, rising-edge FF.
|
H: Dielectric Mirrors?
What common electrical product(s) have dielectric mirrors integrated in their design? I once asked a question on the Physics.SE about alternatives for a Faraday's Cage in order to "shield" leakage of EM radiation, and a person on the site said dielectric mirrors. I researched and found out how they function, except I do not where to find their application in everyday electronic products.
AI: I don't know exactly what you want, in order to qualify as common, but an entire product area that buys from an area I work in uses them as an essential component in an electronic instrument that finds important use as part of electric system power transformers, like those found in substations. These are fiber-optic thermometers based on phosphor thermometry techniques. We use dichroic mirrors in each and every one of them, and these are essentially dielectric mirrors if I gather your meaning. The wavelengths involved are located within the visible and near visible (from about 400nm to 1100nm, but part of it uses only a very narrow portion of that area.) And there are lots of them used by the power industry, from China to the US. They are also widely used by certain manufacturers using commercial microwave systems for heating their products and where fiber optics doesn't interact with the generated microwaves in the chamber. (If we can get the price down sufficiently, then I think theses would find immediate use in home microwave units since you can easily just stick the tip of a fiber into some meat, for example, and set your desired temperature and let it run. But the cost per measurement point remains a little high for that, just yet. Perhaps, though, at least the fact that it might soon be a reality qualifies as a common product?)
|
H: opamp, ADC, level shift problem
I have an input signal with an amplitude of a few mV that I want to filter, amplify and then feed to an ADC ("Analog Signal").
The input signal (Coming though C1) is lifted at 2.5V and the range of the ADC is 0-1.25V. The ADC has a reference voltage pin of 1.25V (it's the LTC2470).
Until now I was using the Adjustable resistor R4 to center the output signal of the opamp by hand. But this solution is not elegant. I would like to remove R3, R4 and the +5V input and manage to center the output without external intervention.
How would you proceed to center the output signal of the opamp to about 1.25/2?
AI: Okay, so you want to use the 1.25V reference for the offset. This is basically the comment Scott Seidman made in schematic form:
simulate this circuit – Schematic created using CircuitLab
The input common mode voltage is fine- it sits at 625mV fixed which is well within the range. Maximum input voltage is about 9mV peak. The op-amp output can't swing quite down to the negative rail with the load of the ADC input so you would get slightly more range by biasing it up by a smidge, but probably not enough to be worth bothering with given the large Vos uncertainty of that particular op-amp.
|
H: What were gate length of early SSI circuits?
Just curious about early IC history. Wikipedia tells about IC nodes starting with 10 micron, but I'm curious what people produced before that, in 1960s.
AI: 1960s ICs generally did not have gates, as they were bipolar. NMOS, PMOS and CMOS came into their own in the 70s. So we have to talk about feature size. Early TTL (1960s) was around 12um. There's an interesting (and freely available) IEEE publication reviewing predictions. Here is a relevant chart:
So around 1960/62 we have about 25um and a few um in the early 1970s.
The feature size did not decrease as dramatically as the number of devices increased. More of the improvement was from increased chip size and better use of the available space, all of which together accounted for Moore's Law.
Keep in mind also that most of the applications in the 1960s were driven by military/aerospace programs and were not necessarily subject to the usual rules of economics (Moore's law refers to the most economical number of devices/chip).
|
H: Are these 12v power supplies worth using? Is additional circuitry needed to drop voltage to meet USB standards?
I have these two power bricks I want to convert one of them to power a Banana Pi and 3.5 HDD.
https://i.stack.imgur.com/KHQUA.jpg
I want to determine if either is safe and the needed circuit modifications to do so. This whole thing is a curiosity and not needed from a functional stand point, but I'd like to understand why they have been working for other electronics.
The first one has a molex IDE HDD connector, I will call "Fineness" (rated at 2A for each 12v and 5v from the label photo), seems the most questionable to me because of what I would call overvoltage. Right after I connect wall power to the brick, the 12v circuit reads 16.25v. I connected a 12v fan with a label stating it draws 0.41A. Initially that circuit reads 15.8v with the fan then the voltage increased slowly. A few minutes later the voltage stabilized at 16.4v with the fan connected. Right after I removed the fan, the 12v circuit read 17.5v. The 5v circuit stablizes at 7.2v after slowly climbing. I don't have the knowledge to know if this acceptable with the small amp draw of Banana PI and the hard drive. I've seen forum post photos showing the BPi using as little as 200 mah at 5v USB and then contrasting that with the supposed manufacturer USB power rating of 2A: http://www.bananapi.org/p/product.html. My guess is the voltage sag would be minimal and the incoming voltage would still be far too much for a HDD and above the max of 5.25v max for the USB standard. This power brick originally came as part of a USB to SATA/IDE kit. About a year or more back I successfully used this to power a 3.5 HDD.
My results from testing the molex connectors from the top down:
slot 1 is +12v
slot 2 actually empty, would be Gnd 1, but instead is a plastic stand-in to provide a firm fit???
slot 3 is Gnd 2
slot 4 is +5v
Circuits
slot 3 connected to slot 1 reads up to 17v
slot 4 connected to slot 3 reads up to 7.2v
Is it worth making changes or even necessary to lower the voltage on this Fineness' power brink before I can trust it will not break the Banana Pi and a 3.5 HDD?
So if the Fineness brick is not an option, I could work on this one instead:
Second power brick (see second photo on the imgur link above) has a barrel connector and is rated at 12v up to 6A. When I initially power it reads 16.5v and continues up to 17.75v over a few mintues. I had used this to power a cheap china made audio amplifier with no problem over several months of use and then stopped having a use for it several years back.
I have the same question for this brick about safe voltage. What is needed to create a voltage drop circuit to safely supply 5.25v - 5.0v to a USB plug on the Banana Pi and also 12v and 5v to the HDD?
To me it seems a problem for both of these power bricks to have voltages so far outside of the rated 12v and 5v ranges. There has to be room for a little voltage sag as a load is applied.
Is it actually important to stay within 5.25v for USB? If not, what is acceptable above 5.25v without being damaging?
Is it just by chance that these power bricks have not broken something in the past and they are just too low quality to spend time on correcting?
Do my voltage measurements with no load or a 12v fan not mean much without a more significant load such as 1A or 2A to see how the voltage sags/stabilizes?
Currently, I am using a USB charger for the BPi and the original power brick that came with the external HDD. I'm looking to learn and then apply that by laying out, testing, and then soldering the changes. I'd also like to power the 3.5 HDD without the enclosure's USB adapter which is presently obstructing connecting the HDD to the BPi through SATA directly.
Thanks for your help and consideration.
AI: I have an external HDD power supply that is almost identical to yours (it has the same model number, but a different brand name). One notable difference is that when unloaded my PSU puts out a more reasonable 5.13V and 12.6V.
This type of switch-mode supply rectifies the AC mains to produce DC, then chops it up into a high frequency square wave which is fed into a ferrite-cored transformer. For multiple output voltages the transformer can have several windings with different turns ratios.
Output voltage is regulated by varying the on/off ratio of the square wave, but this affects all outputs so putting more load on one output will cause the other output's voltage to rise. The PSU cannot regulate each output independently, so it may be designed to stabilize the voltage of only one output (usually +5V because this is more critical for digital logic), or take an average of both.
Switch-mode supplies often need a minimum load to get good regulation. Cheaper units may have no regulation at all, simply relying on the transformer ratio to set the output voltage at the rated current. Your PSU may have worked OK with a hard drive because it is matched to that load - or it might be faulty. Either way I would not use it with the Pi, which could be damaged by anything over 6V. However you could use it to power a suitably rated step-down voltage regulator (AKA DC-DC converter).
|
H: Why do I need to keep Led drive and photodiode ADC supplies and traces separate in a pulse oximeter design
I've seen a couple of application notes recommend keeping led drive supply and ADC supplies separate.
To me it seems that since the LED will illuminate the photodiode that ADC is reading anyway, keeping this two close would make sense. Including the reference voltage for current source and the reference voltage for ADC.
I'm referring to this datasheet. Page 78 "11.1 Layout Guidelines"
http://www.ti.com/lit/ds/symlink/afe4400.pdf
TXP, TXN are fast-switching lines and should be routed away from sensitive reference lines as well as from
the INP, INN inputs.
Is is possible that this are just general recommendations and the author did not consider this special case where LED illuminates the photodiode from the same circuit? Or is this to prevent oscillations.
AI: While you do have a point that it might make sense to compensate for variations in the LED brightness caused by power supply fluctuations, the hint is very important to adhere to. The LED is not just lighting all the time, but it is pulsed. The circuit very likely uses lock-in like techniques to filter the photodiode signal for the parts of it that are in response to the LED pulses. It is extremely important that the feedback from driving pulses to the LED to observing those pulses at the photodiode is purely optical, because otherwise the optical signal us obscured by the electric cross-talk. If you don't decouple the LED supply sufficiently from the detector supply, you will get electrical feedback as well because the supply voltage will surely drop a bit when you pulse the LED.
|
H: TM4C123, only one timer works at a time?
I am using TivaC TM4C123 MCU. I am trying to send data serially through one pin and a synchronized clock through another pin. Here is an illustration:
I used Timer0 module for the serial data and Timer1 for the clock. The frequency of the clock should be twice the data. Here is the important part of the code:
void DATA(long number, int iteration) //number: data to be send serially
{
long x=0; // iteration: number of bits to send
for(int y=0; y<iteration ; y++) {
while((TIMER0->RIS & 0x00000001) != 1){} //wait until Timer0 times out
x= number & (0x1<<y); //Get each bit individually
if(x==(0X1<<y)) //If bit is 1
GPIOF->DATA |= (1<<1); //Make PF1 High
else if(x==0X0) //If bit is 0
GPIOF->DATA &= 0XFD; //Make PF1 Low
TIMER0->ICR |= (1<<0); //Reset Timer0 flag
while((TIMER1->RIS & 0x00000001) != 1){} //wait until Timer1 times out
GPIOF->DATA ^= (1<<2); //Toggle clock
TIMER1->ICR |= (1<<0); //Reset Timer1 flag
}
}
int main()
{
GPIO_INIT(); // Initiate GPIO
TIMER_INIT(); // Initiate Timers with Timer0= 1/2 Timer1
while (1) {
DATA(0XAB01,16); // 0xAB01 16 bit data need to be send serially
}
}
There is a problem in this code, which is both of the data and the clock have the same frequency, which means that Timer0 or Timer1 are disabled.
To make my problem more clear and easy to understand. I wrote two simple codes with a graph for each of them. Here is the first code: I am using While loop
int main()
{
GPIO_INIT();
TIMER_INIT(); //Timer0= 1/2 Timer1
while (1) {
while((TIMER0->RIS & 0x00000001) != 1){} //Wait for TIMER0 to time out
GPIOF->DATA ^= (1<<1); //Toggle PF1
TIMER0->ICR |= (1<<0); //Reset TIMER0 flag
while((TIMER1->RIS & 0x00000001) != 1){} //Wait for TIMER1 to time out
GPIOF->DATA ^= (1<<2); // Toggle PF2
TIMER1->ICR |= (1<<0); //Reset TIMER1 flag
}
}
Here is the output I got:
Here is the 2nd code: I am using If condition
int main()
{
GPIO_INIT();
TIMER_INIT(); //Timer0= 1/2 Timer1
while (1) {
if((TIMER0->RIS & 0x00000001) == 1) { //If TIMER0 out timed out
GPIOF->DATA ^= (1<<1); //Toggle PF1
TIMER0->ICR |= (1<<0); //Reset TIMER0 flag
}
if((TIMER1->RIS & 0x00000001) == 1) { //If TIMER1 timed out
GPIOF->DATA ^= (1<<2); //Toggle PF2
TIMER1->ICR |= (1<<0); //Reset TIMER1 flag
}
}
}
Here is the output:
Conclusion: When I used the if condition the two timers are working normally, but when I used While loop only one timer is working and the other timer is just using the same counts of the other.
AI: Apperently your clock timer Timer0 is slower than data timer Timer1 so there nothing suprising in represented behaviour because your code skip every second event from Timer1 when you use while.
I think there enough one timer with max used frequency - is Timer1. More over there should be one timer because data and clock must be synchronous and this condition not guaranteed by code represented in your question.
int main()
{
char even = (char)0x1;
GPIO_INIT();
TIMER_INIT(); //Timer0= 1/2 Timer1
while (1) {
while((TIMER1->RIS & 0x00000001) != 1); //Wait for TIMER1 to time out
TIMER1->ICR |= (1<<0); //Reset TIMER1 flag
even ^= (char)0x1;
if (even) GPIOF->DATA ^= (1<<1); // Toggle PF1 [Clock]
GPIOF->DATA ^= (1<<2); // Toggle PF2 [Data]
}
}
So your function DATA(long number, int iteration) will be:
void DATA(long number, int iteration) //number: data to be send serially
{
long x=0; // iteration: number of bits to send
char even = (char)0x1;
for(int y=0; y<iteration;) {
while((TIMER1->RIS & 0x00000001) != 1){} //wait until Timer1 times out
TIMER1->ICR |= (1<<0); //Reset Timer1 flag
even ^= (char)0x1;
GPIOF->DATA ^= (1<<2); //Toggle clock
if (even) continue;
// data change every odd cycle
x= number & (0x1<<y); //Get each bit individually
if(x==(0X1<<y)) //If bit is 1
GPIOF->DATA |= (1<<1); //Make PF1 High
else if(x==0X0) //If bit is 0
GPIOF->DATA &= 0XFD; //Make PF1 Low
y++;
}
}
|
H: What's the difference between all of these video inputs?
Over the years and with the large variety of hardware I've dealt with I've used quite a few of different video inputs and outputs. While I usually have no issue just plugging cables into devices, I really started to wonder how video cables differed from each other.
Could anyone specify the difference between s-video, rgb, rca, component, composite, vga, hdmi, displayport, dvi, and any others I'm forgetting? Why do these cables keep evolving; what does an hdmi cable offer that an s-video cable does not, for example? What are the advantages of using one cable/input over another? Refresh rate? Input lag?
AI: Analogue
S-video, RGB, RCA, component, composite and VGA. You forgot SCART.
The big difference here is between those which run each colour on its own (pair of) cables (i.e. RBG component & VGA), versus those which squash them down to fewer signals.
S-video carries two signals, luminance and chrominance. Composite carries only one. The squashing process introduces noise and fuzziness to the signal, so these aren't suitable for any higher resolution than plain TV.
Another distinction is whether audio is carried. Two of the three RCA plugs are for audio. The other cable types don't carry audio.
SCART can carry either composite or component or both, along with audio.
Analog systems impose no lag beyond the speed of light, which is roughly one foot per nanosecond.
The key metrics for analogue systems are bandwidth and signal-noise ratio (SNR).
Digital
HDMI, DisplayPort, DVI. All somewhat interchangeable, or at least can be converted without "smart" adaptors. Very high noise immunity and easily capable of perfectly reproducing the input signal.
All can carry audio, although audio over DVI is a bit more complicated.
Digital systems tend to buffer frames and impose input lag of one or more frames.
Digital systems are required if you want clear HD video, especially "4k" (which may require particular version numbers of HDMI etc). Analog systems simply do not have the bandwidth. The best you can get is HD-over-component, which involves huge bulky cables of limited length.
The key metric for digital systems is bitrate, often inaccurately called "bandwidth".
Out-of-band control signals
The older analogue systems have no idea what's on the other end of the cable. VGA has a system for identifying monitors called DDC, so computers can pick a suitable resolution. SCART defines quite a sophisticated protocol for communications among TVs, VCRs, satellite units etc.
The three fully digital systems have control side-channels for the same purpose. In HDMI this is called CEC.
HDCP
HDMI signals can be encrypted as a copy-protection measure. A similar system is built into DisplayPort but not widely supported.
|
H: High side switch and Low side switch
I wonder what is the difference between high side switch and low side switch. Basically it work the same way (electrically speaking) but I don't know if one is better than the other. Is there any safety purpose? What is the best solution if there is big capacitor in the circuit? Capacitor C1 will discharge through the load in the low side switch mode whereas C2 discharge through the ground.
simulate this circuit – Schematic created using CircuitLab
AI: I wonder what is the difference between high side switch and low side
switch. Basically it work the same way (electrically speaking) but I
don't know if one is better than the other.
It depends on the circuit you are switching. Ignoring safety in vehicle reasons, you might choose to switch on the high side of a signal amplifier because the low side might be the signal 0 V reference (as well as power 0 V) and, routing both signal and power grounds through a common point i.e. the low side switching MOSFET can lead to serious noise and distortion effects on the final signal. If the MOSFET had true micro-ohm (or less) on-resistance then it's less of a problem but you won't find one this good for pennies or pounds.
So, if you can switch the low-side it's generally easier because a micro/controller will normally be logic level referenced to 0 V and it can easily drive an N channel MOSFET (or NPN) but beware of signal lines sharing this common switching device as outlined above.
What is the best solution if there is big capacitor in the circuit?
If you are referring to a big capacitor across the target load's power pins then there are no real implications other than to ensure your switching mechanism can handle the in-rush current.
|
H: Reading 2 Quadrature encoders using a single Arduino Due
I am working on an autonomous robot in my summer vacations. I am currently working on running the motors of my robot in a closed loop. In order to do so, I have to interface two Quadrature encoders of the motors with the Arduino Due that I have. My motor encoder have 3200 Edges per Revolution. I have read the Atmel SAM3x8E datasheet and have successfully tested one encoder. It appears that TIOA0 and TIOBO are used to read PHA and PHB of of one Encoder which correspond to Pin 2 and 13 of Arduino Due. I am not using Index pin (TIOB1).
It seems that I can only interface 1 quadrature .Is their any way I can use Quadrature decoder to read 2 encoders instead of one. As I have stated earlier I am not using the index pin. So, maybe there might be a way to decode to encoders using the three available pins as shown in the above diagram. I don't want to use Interrupts to do this job.
Here's is the link of SAM3x Manual:
http://www.atmel.com/Images/Atmel-11057-32-bit-Cortex-M3-Microcontroller-SAM3X-SAM3A_Datasheet.pdf
Link of Motor that i am using:
www.pololu.com/product/2824
AI: If the encoder frequency is not too high it's just a matter of keeping track of the count using an up-down counter and two general purpose input pins.
simulate this circuit – Schematic created using CircuitLab
Figure 1. 2-bit rotary encoder waveforms.
The program logic is very simple.
Track the current state of 'A'. If the state changes to 'high' then:
Look at input 'B'. If 'B' is low then count up. If 'B' is high then count down.
You'll probably need to debounce the inputs to prevent spurious triggering. You then need to write some code to detect the rising edge of the 'A' pulse.
|
H: How to write an efficient C code for a firmware
This question is about programming but as its about programming electronics so I thought of posting it here instead of stackoverflow . I have just started my electronics projects. I have designed two applications and have done their hardware and firmware part myself. Here in this question I want to know how to write an efficient C program and how to manage all the files in the project.
Lets say in an application, we have below parts:
GPIOs
Serial Communication
RTC (I2C Communication)
SD Card (SPI Communication)
The way I work is to create different files for every module. Like for Serial Communication:
//serial.c
//function to initialize serial communication
void serialInit()
{
}
//function to send data
void serialSend()
{
}
//function to receive data
void serialReceive()
{
}
So in serial.c I have made all the required functions for serial communication.
//serial.h
void serialInit();
void serialSend();
void serialReceive();
/*
* All the variable used in serialInit(), serialSend(), serialReceive().
* char rxData = 0;
* int i,j=0; ..etc
*/
and in serial.h I include all the variables used in serial.c. Same goes for every file like rtc.c rtc.h sdcard.c sdcard.h. I main.c I include all the header files:
//main.c
#include "serial.h"
#include "rtc.h"
#include "sdcard.h"
main.c contain all the logic and programming part. All the variable used inside main.c is defined in main.h. Now problem sometime occurs here. As main.h contains all the variables and if I need to include main.h in any other source file, it gives error: multiple definition. I have searched for this error and have found many solutions to it. I want to know the effective of handling this problem. What are some good practice for designing firmwares. Is the way I am writing is correct way or not. What are other methods for handling major embedded firmwares.?
AI: Overall your division of functionality across the different files looks good, but you shouldn't be defining variables in a .h file.
The .h file is more for sharing variable & functions with other modules.
So only variables which you want to share should be listed in your .h file and they should all be declared with 'extern' as the first word in the declaration.
Variables which are only used inside the corresponding .c file should not be declared in the .h file.
Function declarations don't need an extern.
So for your serial.h example, what you should have is something like:
//serial.h
void serialInit();
void serialSend();
void serialReceive();
/*
* variables which are exposed to other modules in your code
*/
extern char rxData = 0;
/* These variables are not exposed and only used inside serial.c
* They're only here as an example and should be deleted from this .h file entirely
* int i,j=0;
*/
Note that not declaring a variable in a .h file doesn't actually prevent another code module from accessing it if it 'knows' about it.
The way to prevent other modules from accessing 'private' variables is to declare them as 'static' in your .c file.
This makes the variable still 'global' inside that file, but inaccessible from outside.
When you declare functions in a .h file, you can declare them as you have done with no parameters specified - just using () - if your functions don't take any parameters.
I prefer to explicitly define the parameters each function is expecting, so for example:
void serialSend(void *buf, int len);
or
void serialSend(void);
if your function really doesn't take any parameters.
This lets the compiler check that when you call this function that you're passing the correct type & number of parameters.
Just using () means that you're allowed to call the function with as many parameters of whatever type you like - even though it doesn't actually take any.
|
H: Problem with connecting Nano v3 to Sharp Proximity Sensor
I am trying to connect a Sharp Analog IR Distance Sensor GP2Y0E02A to a nano v3. It accepts 2.7 - 3.3 v so I have it connected to 3.3 v from the arduino but I dont get serial output, just complete blank. When I change the code to something a little similar (see code under buggy code below) I get voltage values. So I think the problem might be with the code which I am using to convert voltage to cm below.
Buggy Code (voltage to cm)
/***************************************************************
Arduino GP2Y0E02B example code
Gets range from GP2Y0E02B and prints it to the serial monitor.
By James Henderson 2014
***************************************************************/
#include <Wire.h>
int distance = 0; // Stores the calculated distance
byte high, low = 0; // High and low byte of distance
int shift = 0; // Value in shift bit register
#define ADDRESS 0x80 >> 1 // Arduino uses 7 bit addressing so we shift address right one bit
#define DISTANCE_REG 0x5E
#define SHIFT 0x35
void setup()
{
// Start comms
Wire.begin();
Serial.begin(19200);
delay(50); // Delay so everything can power up
// Read the sift bit register from the module, used in calculating range
Wire.beginTransmission(ADDRESS);
Wire.write(SHIFT);
Wire.endTransmission();
Wire.requestFrom(ADDRESS, 1);
while(Wire.available() == 0);
shift = Wire.read();
}
void loop()
{
// Request and read the 2 address bytes from the GP2Y0E02B
Wire.beginTransmission(ADDRESS);
Wire.write(DISTANCE_REG);
Wire.endTransmission();
Wire.requestFrom(ADDRESS, 2);
while(Wire.available() < 2);
high = Wire.read();
low = Wire.read();
distance = (high * 16 + low)/16/(int)pow(2,shift); // Calculate the range in CM
Serial.print("Distance is ");
Serial.print(distance);
Serial.println("CM");
delay(50);
}
Simple Example (works by giving voltage)
int sensorpin = 5; // analog pin used to connect the sharp sensor
int val = 0; // variable to store the values from sensor(initially zero)
void setup()
{
Serial.begin(9600); // starts the serial monitor
}
void loop()
{
val = analogRead(sensorpin); // reads the value of the sharp sensor
Serial.println(val); // prints the value of the sensor to the serial monitor
delay(100); // wait for this much time before printing next value
}
Schematic
AI: The problem is you are using i2c (the protocal behind the wire libary) to communicate with an analoge device. The sensor you have chosen returns the distance to the controller as an analog voltage in the range -0.3 to +2.8V (see the datasheet linked from the store page). Therefore you cannot communicate with it via a digital protocal.
To Make this work wire it up like this:
simulate this circuit – Schematic created using CircuitLab
The code you need to control it should look something like this:
void setup()
{
// Start serial connecton back to PC
Serial.begin(19200);
}
void loop()
{
// Enable the sensor
digitalWrite(15, HIGH);
// Wait for it to turn on
delay(100);
// Read the analog value from the device
value = analogRead(0);
// power down the sensor
digitalWrite(15, LOW);
distance = /* do math here, see datasheet for typical values */; // Calculate the range in CM
Serial.print("Distance is ");
Serial.print(distance);
Serial.println("CM");
delay(50);
}
Also I would strongly recomend reading the datasheet of the device you have ordered carfully.
EDIT: I noticed that the code you are using is for the GP2Y0E02B not GP2Y0E02A. The GP2Y0E02B is digitally controlled over I2C, your GP2Y0E02A only outputs an analog value. Is it possible you ordered the wrong version of the sensor?
|
H: 3.3V Supply using lipo
I'm trying to design a supply circuit for a board that should deliver 3.3V using a LiPo battery, the battery should be that charged using a micro USB cable.
here is what I've done so far.
the LM3940 regulates the supply voltage to 3.3V and the MCP73831 is a battery charger. the Target voltage supplies the whole circuit.
after doing some research I figured out that need to take the load sharing in consideration, I found the following schematic for that :
My question is how big is the voltage on the MCU pin (my target voltage should be 3.3V)
the way I see it , if **Vin ** is equal to 5V the output voltage is also 5V ?
should I connect the the MCU pin to the voltage regulator ?
thanks for any hint !
UPDATE
made changes based on Andrew answer
AI: Your first circuit is a fine example of how to create a bad and potentially explosive circuit. If the battery is low it gets hit with 3.3V and as much current as the LDO can supply rather than being carefully charged.
When the battery isn't low the charger is powering the circuit rather than the voltage regulator. The charger has no idea how much power is actually going into the battery and the circuit is being powered by up to 4.2V rather than 3.3V.
In the second circuit when VIN is high Q1 is off effectively isolating the battery from the MCU pin allowing the battery charger to do it's job.
Power flows to the MCU pin via a diode, assuming 5V input with an LDO down to 3.3V the 0.2-0.3V drop in the diode shouldn't be an issue.
When VIN is off R2 causes Q1 to switch on and allows battery power to flow from the battery to the MCU pin.
Q1 needs to be sufficiently large to handle the current with appropriate voltage thresholds so that it is fully on and off under the normal operating conditions.
So yes, connect the MCU pin to the input of your regulator and you should get a clean regulated supply until your battery discharges to about 3.5V (assuming a 0.2V drop out LDO). Once your LDO drops out of regulation you should shut the system off since it's no longer reliable. You should definitely shut off before the battery gets below about 3.1V or you risk damage to the battery pack.
3.5V will normally be about 30% charge remaining but it is very temperature dependent. You could hit that voltage at 90% charged in low temperatures.
|
H: ATtiny power consumption with clock prescaler
I'm designing a battery-powered radio-linked sensor device which requires a long lifetime. Due to the project requirements I have very little onboard energy to work with; a single coin cell is the likely source and the lifetime requirement is at least a week.
My primary power savings will come from placing the device into a deep sleep mode and waking it with a timer every ten or so minutes to take a reading and transmit it. This means that for only 0.5% of the time is the device drawing any significant power; during the sleep state the consumption will be in the units of microamps at most.
The proposed process is as follows:
MCU is powered on.
The sensor is powered on by the MCU and a one-second grace time is given. The MCU is placed into a sleep state until the grace period elapses.
The MCU communicates with the device via I2C or SPI and gets a reading.
The sensor is powered off by the MCU.
The transmitter circuitry is powered on by the MCU.
The reading is transmitted.
The transmitter circuitry is powered off by the MCU.
The MCU triggers an external low-power (nA range) timer device which is configured to delay for approximately ten minutes.
The MCU puts itself in power-down mode to conserve power.
The external timer device triggers a pulse to a GPIO pin, which raises a waking interrupt in the MCU, returning us to step 1.
The ATtiny44A has multiple clock modes (section 6.2): an internal calibrated 8MHz clock, a low-precision internal 128kHz clock, and support for external clock sources and crystals. These can then be stepped down using the clock prescaler (see fig. 6-1 and section 6.3 for a description). I will be running the MCU at 3.3V.
As the processes performed by the MCU are not particularly time-critical, I'm trying to decide which of the following strategies are more optimal for low power consumption:
Use the internal calibrated 8MHz clock as-is with no prescaling, to minimise the time during which the MCU will be switched on. This has the benefit of speeding up the few calculations I'm doing on-chip and speeding up the IO with the sensor and transmitter devices. However, a potential downside is that other internal clocks are running at a higher frequency, and will remain running during the one-second grace period in step 2. My gut says that this is a poor choice since any power saved by quicker computation will be dwarfed by the one second of running the clock on idle.
Use the 128kHz low precision internal clock source. This increases computation and IO time, but may save power during the grace period.
Use the internal calibrated 8MHz clock with the prescaler set to 1/64, producing a 125kHz clock speed, emulating the low precision internal clock. I am unsure as to whether this is a useful option.
Use the internal calibrated 8MHz clock with the prescaler set to 1/256 (the maximum), producing a 31.25kHz clock speed. Again I'm unsure if this will save power.
Which of these, in the scenario described above, will result in the lowest power consumption?
AI: Chapter 21 of the ATtiny44 datasheet has a lot of information about consumption vs. frequency and supply voltage.
A casual look indicates that the lowest clock frequency will lead to the lowest total consumption.
Table 21-2 contains some information about how much additional consumption you add from the various modules depending on frequency, again indicating that lower speed will net you lower consumption.
Depending on how fast you need the computation to be done you might be able to get away with the 128kHz clock speed.
I haven't looked at the I2C and SPI modules in detail but it is possible that they will not operate correctly at such a low frequency so you might consider bumping up the speed before doing any comms using those peripherals.
|
H: what kind of OS is present inside 'mbed'?
mbed seems to be a good place to start a new project on ARM. And they are saying that there is an OS inside. Is that real time (RTOS) ? is that capable of multi tasking and inter-task communication ? is there any comparison with FreeRTOS ?
AI: From the release note for version 5.1.0:
mbed OS now incorporates an RTOS.
The RTOS core is based on the widely used open-source CMSIS-RTOS RTX,
providing an established kernel that can support threads and other
RTOS services on very tiny devices. The RTOS primitives are always
available, so that drivers and applications can rely on features such
as threads, semaphores and mutexes. The RTOS is initialised ahead of
entering the main() thread, enabling components to rely on RTOS
facilities even if the core application is single threaded.
The implementation is based on CMSIS-RTOS RTX 4.79.0, and we will be
tracking and contributing to the development of CMSIS-RTOS releases,
allowing us to pick up support for new versions and architectural
features such as TrustZone for Cortex-M.
The MINAR eventing-only scheduler is not included in this release. An
alpha version of a more flexible event scheduler library is available,
supporting the same design patterns within RTOS threads and
components. This library will be merged and managed as part of the
core OS codebase once it reaches release maturity.
|
H: Choosing the right FET to switch between two sources
The circuit below is based on the answer to this question, which i find to be suitable for my application.
3.3VDC is the main supply for the circuit, with 3.6V 1/2AA battery for backup, as defined by the product requirement. The load is basically three switches which should be powered by the main supply until there is an outage, in which case the battery takes over.
In seletcting the Diode, i picked the panasonic DB3X313N with a Vf of 0.55V, this will drope the 3.3V supply to 2.75V which will still work, as the logic input will detect a high.
For the FET, I choose Infineon-BSS84P-DS , with a Vgs(th) of 1-2V.
The load is basically three switches with 10k pull up resistors, so the currrent draw is minimal.
I would like to ask:
Will this circuit function as expected, i.e. to supply the load from the 3.3V source and only source from the 3.6V battery when the mains source is unavailable.
If so, then is my choice of diode and FET suitable for this circuit, expecially with the FET, as i've not worked with FETs before.
AI: The device you have chosen is not fully specified for \$R_{DS(on)}\$ below -4.5V
There is no guarantee that the device will turn on fully with 3.6V of bias, and even if it does then you can expect a relatively high value of \$R_{DS}\$ of the order of \$10 \Omega \ to \ 20 \Omega\$ which will give a voltage drop of 100mV to 200mV across the FET.
I would be more inclined to use a part that is fully specified for a lower \$V_{GS}\$ such as the DMG3415U or perhaps the Si2323CDS, both of which are fully characterised at 2.5V \$V_{GS}\$
Either of these parts is guaranteed to turn on at the 3.6V bias you have with low on resistance; many others exist and these are simply suggestions.
Basically, look for devices specified for \$R_{DS(ON)} \$ preferably with \$R_{DS}\ \le 100m\Omega\$ at \$ V_{GS} \le\$ 2.5V
|
H: Extra bare wire in USB cable
Whilst cutting up a USB cable for a project I noticed this extra bare wire within the insulation. Now I'm assuming the foil is shielding of some sort, but do I need to connect this bare wire to ground? Or should it be left disconnected?
AI: That is the drain wire that helps carry charge off of the foil jacket and carries more current than the foil can.
It is part of the shield/ground of the cable.
As far as how to terminate it, that depends on what function it serves in your system. There are several purposes for that shielding:
Reducing EMI emissions
Reducing EMI susceptibility
Defining cable impedance
Providing a discharge route for ESD
The shield ground should factor into your grounding strategy, especially keeping in mind that there will be large discharges coming down that shield wire in user-pluggable systems. (as opposed to fixed, industrial type installations)
|
H: How does current work in hubs?
Okay, I'm a total noob and don't know if I'm even wording this question correctly, but I'll try.
My understanding is that the power supply (an USB power supply in my case) determines the current. I have a 2.5A 5V supply, and a USB-to-DC cable that connects that power supply to an USB hub (5V as well). Now that hub would get a total input of 900mA from its data USB 3.0 connection to the PC + 2500 mA from the power supply. Does it just always get that current, regardless of whether it actually needs it? In other words, if I just have one little USB drive in the hub, will that USB drive get all the 3400 mA and burst into flames?
AI: The power supply works as a voltage source up to 2.5A current. You cannot combine the current of the externals supply and the PC's port - that would require expensive adaptive circuitry.
|
H: Reusing an 8 bit microprocessor? (86CH09NG)
I salvaged some parts from a microwave and I am wondering if it is possible/ feasible to reuse the 8 bit microprocessor on it? I am also not sure if I found the proper datasheet for it? (link to datasheet)
AI: ROM (MaskROM)
Nope.
Well, yes, but only for what it was already used for. Mask ROM means that the programming is directly part of the silicon and cannot be changed.
|
H: How much time needs a 1.5 kW solar panel to charge a car electric battery?
Tesla car battery has about 6000 li-ion batteries. Each rated 3.7 V and 3500 mAh.
I asume ten 1m2 solar panel, each gives 150 W at 12 V (this gives about 12.5 A). For this problem, I put them in parallel, so together they give 1500 W, 12 V and 125 A.
The li-ion batteries will be in 3s, so they will behave like 2000 batteries in parallel, each 3s group will have 12 V (aprox.), and 3500 mAh capacity.
The total capacity of the battery group is 2000 cells x 3500 mAh = 7 ∗ 10^6 mAh = 7000 Ah.
The time the solar array needs to charge the batteries is: 7000 Ah / 125 A= 56h of good sunlight.
In a sunny location, lets say that you have 8h of good sunlight per day, so 56h / 8h/day = 7 days to charge the battery.
Have I missed something important? This is not homework, just curiosity. I think the solar panels are not really used in parallel because taking 125 A from them seems like a bad idea (very hot and melts everything). What else?
AI: You're about right
I've checked your numbers and it looks like you have done the calculation correctly. 150W per square meter is pretty good, most panels will be a bit worse than that, even pointed at the noon sun. I expect an average of 150W for 8h a day is a bit optimistic too. Here in the UK the average is about 10% of the rated output, so it would take about 20 days, not 7. With sun tracking panels and a sunnier climate, you'd do better, but 7 days would be impressive.
You haven't considered efficiency losses either. Some energy will be lost in transmission from the panels to the car (either becasue of the huge current flowing, or in the converters mentioned below) and in charging the batteries. Probably only 10-15%, so not worth worrying about if you're just getting a general estimate.
You might also choose not to charge the batteries at 12V/125A. That would require some very thick, heavy cables - probably 8-10mm diameter copper. Instead it might be better to connect the solar panels to a converter and step up to 100-200V, ac or dc, and convert back at the car. Since the car has a built-in converter for 120Vac input, it would make sense to use that.
|
H: Using 16 x 4 Alphanumeric LCD with MikroC Pro for PIC compiler
I am trying to interface a 16x4 LCD to a PIC16F877 MCU. The project is just a digital clock showing date and time from a DS1307 RTC.
The display works correctly when I use a 16x2 LCD. But if I try to print the same thing, same code in the 16x4 LCD's 3rd and 4th row, the display prints it at 4rd column instead of 1. I have displayed the working and the not working screenshots below.
Maybe it is because of using 4-bit interface instead of 8. Or maybe some other issue. Can you please guide me:
I am using MikroC Pro for PIC compiler's library LCD display. It is a 4 bit interfacing library.
Schematic:
1st 2nd row:
3rd 4th row:
Code:
// LCD module connections
sbit LCD_RS at RB2_bit;
sbit LCD_EN at RB3_bit;
sbit LCD_D4 at RB4_bit;
sbit LCD_D5 at RB5_bit;
sbit LCD_D6 at RB6_bit;
sbit LCD_D7 at RB7_bit;
sbit LCD_RS_Direction at TRISB2_bit;
sbit LCD_EN_Direction at TRISB3_bit;
sbit LCD_D4_Direction at TRISB4_bit;
sbit LCD_D5_Direction at TRISB5_bit;
sbit LCD_D6_Direction at TRISB6_bit;
sbit LCD_D7_Direction at TRISB7_bit;
// End LCD module connections
unsigned short read_ds1307(unsigned short address)
{
unsigned short r_data;
I2C1_Start();
I2C1_Wr(0xD0); //address 0x68 followed by direction bit (0 for write, 1 for read) 0x68 followed by 0 --> 0xD0
I2C1_Wr(address);
I2C1_Repeated_Start();
I2C1_Wr(0xD1); //0x68 followed by 1 --> 0xD1
r_data=I2C1_Rd(0);
I2C1_Stop();
return(r_data);
}
void write_ds1307(unsigned short address,unsigned short w_data)
{
I2C1_Start(); // issue I2C start signal
//address 0x68 followed by direction bit (0 for write, 1 for read) 0x68 followed by 0 --> 0xD0
I2C1_Wr(0xD0); // send byte via I2C (device address + W)
I2C1_Wr(address); // send byte (address of DS1307 location)
I2C1_Wr(w_data); // send data (data to be written)
I2C1_Stop(); // issue I2C stop signal
}
unsigned char BCD2UpperCh(unsigned char bcd)
{
return ((bcd >> 4) + '0');
}
unsigned char BCD2LowerCh(unsigned char bcd)
{
return ((bcd & 0x0F) + '0');
}
int Binary2BCD(int a)
{
int t1, t2;
t1 = a%10;
t1 = t1 & 0x0F;
a = a/10;
t2 = a%10;
t2 = 0x0F & t2;
t2 = t2 << 4;
t2 = 0xF0 & t2;
t1 = t1 | t2;
return t1;
}
int BCD2Binary(int a)
{
int r,t;
t = a & 0x0F;
r = t;
a = 0xF0 & a;
t = a >> 4;
t = 0x0F & t;
r = t*10 + r;
return r;
}
int second;
int minute;
int hour;
int hr;
int day;
int dday;
int month;
int year;
int ap;
unsigned short set_count = 0;
short set;
char time[] = "00:00:00 PM";
char date[] = "00-00-00";
void main()
{
I2C1_Init(100000); //DS1307 I2C is running at 100KHz
CMCON = 0x07; // To turn off comparators
ADCON1 = 0x06; // To turn off analog to digital converters
TRISA = 0x07;
PORTA = 0x00;
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_out(3,1,"Time:");
Lcd_out(4,1,"Date:");
do
{
second = read_ds1307(0);
minute = read_ds1307(1);
hour = read_ds1307(2);
hr = hour & 0b00111111;
ap = hour & 0b00100000;
dday = read_ds1307(3);
day = read_ds1307(4);
month = read_ds1307(5);
year = read_ds1307(6);
time[0] = BCD2UpperCh(hr);
time[1] = BCD2LowerCh(hr);
time[3] = BCD2UpperCh(minute);
time[4] = BCD2LowerCh(minute);
time[6] = BCD2UpperCh(second);
time[7] = BCD2LowerCh(second);
date[0] = BCD2UpperCh(day);
date[1] = BCD2LowerCh(day);
date[3] = BCD2UpperCh(month);
date[4] = BCD2LowerCh(month);
date[6] = BCD2UpperCh(year);
date[7] = BCD2LowerCh(year);
if(ap)
{
time[9] = 'P';
time[10] = 'M';
}
else
{
time[9] = 'A';
time[10] = 'M';
}
Lcd_out(3, 6, time);
Lcd_out(4, 6, date);
Delay_ms(100);
}while(1);
}
AI: You need to set up the row and column information in your code and send it to the LCD. Generally two chips are used on the LCD board. Their instruction setup can be found on the web in pdf format. The commands set up the chip to inform it how to process the information you send. Rows are from 0 to 3, and you still have to tell it where to place your text.
|
H: "Reverse etch" PCB base(not the copper)
Is there a reliable way to etch a PCB(from working product) so as to be left with the surface without the substrate?
Sometimes an existing PCB product which wasn't designed with weight, size or flexibility in mind is to be reworked.
Looking for a good process to address that aspect of existing PCBs for ultralight weight application projects(air water etc)
Mechanical approaches have serious drawbacks as most PCBs are dual sided but perhaps I am wrong?
Once left with the thinest possible layer of all active components it will be replaced with flexible PCB type base .
Edit : Would 'Aqua regia dissolve the copper/tin as well as the epoxy holding the fibreglass? That is about the only way of doing away with substrate sandwiched in dual sided PCB design
AI: You really, really, want to assemble the circuit on a thinner (or flexible) PCB. If you have gerbers or similar for the PCB, just send them off to a PCB manufacturer and get some thin PCBs made.
If you already have (or are buying in) a small number of single-sided PCBs and need to reduce their weight then you could try grinding down the back. Use a metalographic polisher/grinder to remove the fibreglass - go slowly and use flood cooling. If you're careful, you might get down to 0.1mm or so. You'll also be grinding away most of the legs of any through-hole components so you'll need to check that they haven't come loose afterwards. That won't work on a double sided PCB, obviously.
Most PCBs are a mixture of epoxy resin and glass fibres. You could probably find a strong acid to dissolve the epoxy. The only thing which would dissolve the glass would be HF. Both of those will destroy most components, and getting even a few drops of HF on your hand will kill you.
I very much doubt you'll find a chemical agent which will remove the fibreglass and leave the copper and components undamaged. And even if you did, the end result would probably fall apart before you got it onto the new substrate.
|
H: Servo-amp vs Monolithic
In the realm of audio what are the differences between servo-amps and monolothic amps? Are there any performances criterion that might make one more favorable to another--gain, noise, ease of implementation, topology, THD, etc.
AI: what are the differences between servo-amps and monolothic amps?
An audio monolithic amplifier is one component containing all the silicon needed to make an amplifier: -
As you can see it has five pins (just like an op-amp). A monolithic amplifier is defined by its packaging and not its function.
A servo amplifier may be monolithic (like the one above) or it may be made from discreet components but, in essence it performs a function i.e. it is defined by function and not by packaging.
Providing the amplifier can equally handle DC as well as other audio frequencies it can be a servo amplifier but not all servo amps are either monolithic or capable of handling audio.
|
H: High current, low voltage switch
I have a serious hobby coilgun project powered by a 6S (25V) LiPo Battery. Currently i have the LiPo, capable of at least 600A burst current connected to a ~75mOhm circuit for some 300+A of peak current. I have built said system with a Mosfet switch (AUIRFB8409 ~1.4$ each from AliExpress). These have worked, but if the current stays on even a little longer (or maybe vene from just wear) they break. The first switch is exposed to some ~4-8 ms of current, which according to my calculations would only rise to the 300A at the 4ms mark or so (pure speculation).
My question: What are my best alternatives to switch the current?
As i see it:
Parallel 2-4 of those mosfets with strong thermal coupling. Cheapish, would probably work?
IGBT? The high voltage rating is wasted and would not work properly with my 25V? and they seem to either have same current handling as Mosfets or be super expensive and huge
Something else entirely?
Thank you for your time
AI: You can use something like IXTN600N04T2.
That is N-MOSFET built for 600A continuous drain.
UPDATE:
according to datasheet, there is 200A external lead current limit. So it seems this MOSFET is actually not capable of continuous 600A drain.
|
H: LED Cube - Drain Current Resistor for MOSFET Switch
I'm an electrical engineering student trying to build an 8x8x8 RGB LED cube as a summer project. Currently I'm designing the portion of the driver circuit that controls the anode layers of the cube. I have 8 individual MOSFET Transistors that I'm using as switches and I'm trying to select resistors. So far I've calculated that the transistor will need to be able to supply 3.84A to the LED (20mA per diode * 3 diodes per RGB LED * 64 LEDs per layer). I've selected a 60W power supply (5V, 12A) and am now trying to calculate the values needed for a drain resistor. If I follow the example in my textbook and the few I can find online I need to subtract the maximum voltage across the LED (3.4V for my LED's) from the supply voltage, and then divide this voltage by the maximum drain current ((5V - 3.4V) /3.84A = 0.417Ohm). Given the low value here can I ignore the need for a current limiting resistor on my drain pin? Or am I missing something a bit bigger? Any help is appreciated!
AI: You can't do it with 1 common resistor for a whole layer. You would very rarely have all LEDs illuminated in a single layer, so you would be overdriving the LEDs that were illuminated. You would need to put a resistor per LED on the cathode side.
|
H: Understanding when certain components need a lower voltage
When looking at electronic modules to buy (WiFi, sound etc) many descriptions say that the module cannot use a 5V input. But the 5V supply can be used if it's stepped down to 3.3V (or whatever is needed).
What I don't understand is that when I create a series circuit with a 9V battery and some LEDs that have a drop of 2V I don't need to step down the battery to 2V, the LEDs use only what voltage they need.
So why don't modules just take only the voltage they need? Why does the input need to be explicitly reduced?
AI: For diodes:
If you apply too high of a voltage to a diode, it will conduct lots of current and burn itself out very quickly. If you apply too low a voltage to a diode, it won't turn on. The solution is to apply exactly 2 volts to the diode. With one diode and a 9 volt battery, the simple solution is to put a resistor in series with the diode to burn off 7 volts of the energy so the diode only sees 2 volts. Note that this creates a DC current through the diode and resistor.
Remember, diodes have a constant voltage drop, not a constant current. The diode will pull whatever current is necessary to have only 2 volts drop across its PN junction. If a current limiting resistor isn't used, then the diode will be using the resistance of the copper as the current limiting resistor and will pull enough current to cause a 7 volt drop across the resistance in the copper. This is assuming ideal diodes that never burn out. A real diode would burn up quickly.
For integrated circuits (ICs):
The problem with "electronic modules" (or ICs) is that the amount of current needed varies with time. For example, a microcontroller has many, many diodes in it. Sometimes, parts of the IC (like the ADC) are turned off and those diodes are not conducting very much current. Later, that part of the chip might be turned on and now all the extra diodes (for the ADC) require additional current to function. What this means, is the current flowing into an IC is often AC current.
The problem is that AC current through a current limiting resistor creates AC voltage. If the AC voltage drops below the threshold voltage of the diodes, then the chip stops working because all the diodes are off. If the voltage rises too high, then the chip will conduct lots of current and burn itself out just like a diode without a current limiting resistor. What the IC needs is DC voltage that isn't too low or too high. The simple solution is to apply exactly 2 volts. The problem is you only have a 9 volt battery. There are a few solutions. Voltage regulators basically create AC resistance that compensates for the AC current to create a DC voltage output. So, it provides a current limiting resistor to burn off the extra 7 volts, but it changes it resistance to allow the correct current into the IC. Buck regulators step the voltage down by quickly connecting and disconnecting the power and using a capacitor to smooth the voltage to a near constant 2 volts. So the buck regulator would be connected approximately 2/9 of the time, and disconnected approximately 7/9 of the time.
I oversimplified some things, but that's the gist of it.
|
H: Which is better, single inverter or buffer + inverter?
I am trying to make a circuit that inverts a scaled (resistive divider) voltage using op-amps. I have come up with two ways to do it, but I'm not sure which one is better and why. I'm not particularly worried about saving cost or components, so which one of these designs is better? I'm most worried about signal integrity.
I plan on adding some filtering caps and potentially a clamp, but from the basic design standpoint, which looks better?
Single Inverter vs. Buffer + Inverter
AI: Quick answer - neither.
First, your 20k input resistor is too small. If you calculate power dissipation you'll find it dissipates about 1 1/4 watts. A 100k, 1/2 watt device would be much better.
Second, your inverting circuit does not need the 500 ohm input resistor, which is clearly a holdover from your non-inverting design.
Third, the inverting portion of your buffer/amp should use larger resistors. This is not an absolute objection, since most op amps will provide the 8 mA or so needed, but the circuit will work just as well with 10k resistors, and draw less power. It will also allow smaller capacitors to be used for filtering.
With that said, there is no clear winner. The single inverter is obviously more reliable, since it has fewer components, but this is not the only consideration. How is the input voltage applied, and what sort of noise environment are you working in? If the circuit may operate with power on but not physical attachment to the power supply, and a hot connection made, the buffer/inverter is better, since the A/D input is always going to be within the 0 to 3.9 volt range. With the input disconnected, the inverter will float around, responding to static charges and the phase of the moon. The buffer configuration will also respond more gracefully to the connection process.
Either configuration can be made resistant to EMI, as follows
simulate this circuit – Schematic created using CircuitLab
Look at the tradeoffs, though. The buffer capacitor needs to be large, since the frequency response is dominated by the small value of R2, but the voltage across it is only 4 volts. The inverter capacitor can be much smaller, since it is working with the large input resistors, but it also sees 80 volts, and so need to be a much higher voltage unit. Note that, for high frequency (like RF) inputs, the inverter cannot use a feedback capacitor to control noise, since any noise above the frequency response of the op amp will not be attenuated.
Finally, since you are interfacing to high voltage, you should consider the intrinsic protection provided by the buffer/amp. If something goes wrong you have two possible devices which might (if you're lucky) provide some protection for your A/D converter and the processor which it connects to, as opposed to one. This is hardly guaranteed, but it's worth considering. I speak as someone who, long ago, had a dial-up modem connection using an external modem. The phone line was hit by lightning, and the modem destroyed, but the PC survived. It's not clear that an integrated modem would have done as good a job.
So in general there is no obvious winner. It all depends on your priorities.
|
H: How to pick correct operational amplifier as unity gain buffer between TLC1543CN and LDR
This is a follow up question on: Interfacing TLC1543CN adc with 8051
I have a LDR in voltage divider circuit. The resulting varying voltage is outputted to adc. Which in turn passes the converted signal to 8051. Lastly the LDR measurement is shown on a 16x2 lcd module.
My problem is that according to the adcs datasheet: http://www.ti.com/lit/ds/symlink/tlc1543.pdf source voltage resistance can be max 10k Ohm. However my LDRs resistance varies between 5k Ohm and 0.5M Ohm. My understanding is that the voltage outputted by voltage divisor circuitry needs to be therefore passed through unity gain buffer before passing it to adc.
So we come to my question: What kind of op amp would be sufficient for my needs? Preferably something that I can cheaply order from eBay.
AI: Speed
An LDR is generally a slow device (many ms response time). 2Mhz bandwidth (=4Mhz sample frequency) is useless and unattainable. The ADC does not support it: its conversion time is 21us, which -if you could fully use it- impies a bandwidth of around 20kHz. But even that is extreme overkill for an LDR. Speedwise any opamp will do.
Supply voltage
When you have a positive power-supply only, you will have to choose a so called rail-to-rail opamp. Normal opamps often have trouble working on a single 5V supply.
Dynamic range
Using a unity gain buffer is fine, but you lose resolution because the ADC input range is not fully used...
Imagine a divider of the LDR and a 5k resistor to ground. In the dark case the output of the divider will be: Uin*5k/(500k+5k) = close to 0V (good). But when the LDR is lit, it's resistance will be 5k, and the divider-output is only half of the supply-voltage. So you use only half of the ADC-steps.
To alleviate that you could use more gain. You can use a non-inverting amplifier configuration with a gain of two instead. This will "scale up" the output to the full ADC range at the cost of two resistors. It doesn't influence the choice of opamp.
|
H: Will this AM radio receiver work?
What I'm essentially trying to do is to add an amplifier to a simple passive radio receiver:
simulate this circuit – Schematic created using CircuitLab
XFMR2 consists of two inductors 0.4 uH and 730 uH. C3 varies between 35 and 235 pF (or something like this). Numbers and the whole left part is taken from here.
The idea is to demodulate negative part of a signal via D1, R1, C5 and pass it to an inverting amplifier based on OA1.
If this circuit is going to work: I'm interested in receiving medium frequencies. It is said they're quite tough to receive in a city due to industrial and home EM noise, especially during days. Am I going to need something more sophisticated instead of this circuit? (not going into antenna discussion here)
Also, why germanium diode OA47? Can I replace it with a Schottky diode?
AI: It wont work .C4 stops the detector diode from working .Remove C4 by shorting it .R2 is way way to low and will load the tuned circuit meaning no selectivity.Use a high impedence buffer like say a MPF102 or an opamp to keep some selectivity.Your audio output stage looks iffy so recheck the biasing .The Ge diode is slightly better than the Schotty here.
|
H: Converting Proteus PCB to Altium PCB file
Hey all I am converting a Proteus PCB design into Altium and I am wondering what each file is since it asks me in Altium.
My Proteus files are:
And this is what Altium does when I do a PCB Design Check/Fix:
And so I say Yes and I am presented with this:
And this is where I am not sure what to put for each... Any help would be great!
AI: I suspect that those are Gerber photoplot files.
Looking at some of the types listed, I'd say cadacam-bottom-silkscreen.txt should be "Silk Bot", ...bottom_solder_resist.txt should be "Mask Bot". Others seem pretty obvious, although you may have a bit of a problem guessing at the valid type names.
The file names seem to me to be self-explanatory, if you have some idea of the photoplot files required to make a PC board.
|
H: Calculating power measurement error from V and I error margins
I am using a Yokogawa WT310 for measuring DC power. The manual (available here) says that both current and voltage have accuracy of +/-(0.1% of reading + 0.2% of range).
Assume this example setup:
Input current: 700mA
Current Range: 1A
Input voltage: 10v
Voltage Range: 15v
Based on that setup and the meter specifications, we can calculate the following:
P = V * I = 7w
Verror = +/-(0.001 * 10v + 0.002 * 15v) = +/- 0.04v
Ierror = +/-(0.001 * 0.7A + 0.002 * 1A) = +/- 0.0027A
My goal is to calculate the power measurement's error margin. Here's what I've done:
Perror = Verror * Ierror = 0.04v * 0.0027A = 0.000108w
Note that in this example, Perror is less than both Verror and Ierror.
Now imagine I'm using a less accurate meter and measuring much higher voltage and current ranges. Assume I get these results for error margins:
Verror = 1.17v
Ierror = 1.2A
Perror = Verror * Ierror = 1.17v * 1.2A = 1.404w
Now, Perror is greater than both Verror and Ierror.
This makes sense mathematically; that's just how multiplying numbers less than 1 and greater than 1 works. But it makes me feel like I'm missing something conceptually. Shouldn't Perror scale consistently relative to Verror and Ierror? Am I just calculating Perror incorrectly?
AI: Oh yes, you're definitely missing something. You can't focus on the errors without looking at the "non-errors". Let's use your second example, where you got a power error of 1.404 watts. What is the "non-error" component?
Just for grins, assume that the real voltage was 100 volts and the real current 20 amps. Then the real power was 2,000 W, but the inaccurate readings were 101.17 volts and 21.2 A, for an incorrect power calculation of 2144.8 watts, or a power error of 144.8 watts.
If you consider each measurement as a base plus an error, and the errors are normalized with respect to the base (such as you would do with percentage errors) then $$(1 + x)(1 + y) = 1 + x + y + xy$$ and the error term is the sum of the errors plus their product. For small errors the product term is negligible, and the error is simply the sum of the errors.
For non-normalized errors, as in your example, you need to compute $$P = (V + {\delta}v)(i+{\delta}i) = Vi + V{\delta}i + i{\delta}V +{\delta}V{\delta}i $$ and the power error E is simply $$E = V{\delta}i + i{\delta}V +{\delta}V{\delta}i $$
So, yes, your reservations were correct.
Figure 1. A graphical representation of the \$VI\$ term (green), \$V \delta i \$ term (red), \$ i \delta V \$, term (blue) and \$ \delta V \delta i \$ term (white). It can be seen that, in this case, the \$ \delta V \delta i \$ term contributes very little to the overall error and that about 80% of the error is due to the \$V \delta i \$ term.
|
H: How to configure a relay to operate as a transistor?
We have a FINDER 40.51.9.012.0000 relay, with this scheme:
I want it to operate as a transistor, in the sense that a signal can control the connection of two other lines (i.e., the collector connects to the emitter only when there is 12V on the base).
According to the relay pinout, the collector should be clearly the pin labelled 11, and the emitter to 14 (given 11 connects to 12 by default, i.e. base=0V). Now, where should the base connect? And the power supply? Actually, the collector is the power supply itself, is there any problem if the line connects two pins?
AI: You are looking for the standard function of a relay. People are complaining about the transistor analogy because your transistor is already configured to act as a relay :)
Here is an example of a standard connection. SW1 might be a switch, a button, coming from some other transistor, from a PLC, etc...
If you want to hook your 12V power supply up to the "collector", change the circuit so that it looks like this:
Usually this would be done because you want to switch more current than SW1 could handle.
By the way, when referring to relays the standard pin names are:
A1: One side of the coil
A2: The other side of the coil. Often connected to ground.
COM: The pin that you are calling the "collector"
NC: "Normally Closed" - The pin that is connected to COM when the relay coil is not energized
NO: "Normally Open" - The pin that is connected to COM when the relay coil is energized
Like this:
|
H: node analysis with current source
I have the following problem to solve. I wanna find the current through R1 so i did a node analysis on this circuit. This is what i got so far:
I2 = I1 + I3 (I2 being the current going through R2 etc)
I2 = (VB - 0)/R2 (VB being the node between r1 and r3)
I3 = ((VB - 0)/R3+R4)+I
I1 = (VB-E)/R1
i put all this together and get 28800 = 201VB + 1000*I. Now i dont know what to do with the I aka the current source. Do i convert it to voltage?
AI: But you first wrote I2 = I1 + I3 haven't you ??. All this means that you have assumed that I1 and I2 current flow into VB node.
I3 is flowing into VB node. And this current is equal to 0.1 A (current source current) because in series circuit we have the same current everywhere and this is why R3 and R4 do not have any influence over I3 current, only current source count here. I1 also flows into VB node and this means that the I1 current is flowing from positive side of the Voltage source through R1 into VB node.
And this is why we have I1 = (E - VB)/R1.
$$I2= I1 + I3$$
$$\frac{VB}{R2}= \frac{E- VB}{R1} + I $$
$$\frac{VB}{600\Omega}= \frac{48V- VB}{400\Omega} + 0.1A $$
Of course, you could write it this way also (all current flow out of the VB node, and that means that I assumed that VB node has the highest voltage/electric potential)
$$I1+I2+I3=0$$
$$\frac{VB - E}{R1}+\frac{VB}{R2}+(-I)=0$$
$$\frac{VB - 48V}{400\Omega}+\frac{VB}{600\Omega}-0.1A=0$$
and the solution is $$VB = 52.8V$$
|
H: Slotted Optical Switch (OPB992T51Z) anode and cathode connections?
I have an optek Photologic® Slotted Optical Switch. It is meant to turn off when the near infrared emissions (850 - 940nm) are blocked.
It has five wires as follows:
I am unsure about what to do with the anode and cathode, (most likely connect the anode to Vcc).
Firstly, I connected Vcc and GND but the signal voltage did not change when the LED was blocked.
Next I connected the anode to Vcc and the cathode to GND Aas shown below and retried.
Still nothing.
Am I missing something obvious?
AI: The LED should be powered via the Anode and Cathode pins, the same way any other LED is powered - with a series resistor to limit the LED current to a safe value.
|
H: AT-Commands: Send E-mail with attachment
I purchased a telit GSM Click (GL865) to use in my project. The architecture is composed of PIC based board with two MikroBUS connectors, I used one for the Telit GSM click, and the second one for the SD card.
I interfaced the Telit GSM Click correctly.
I interfaced the SD card correctly.
I can read and write files to the SD card from within the Pic.
I issue successfully the AT commands to Send SMS and to Send E-mails.
The goal: Send e-mail with attachment, via telit GSM CLIK GL865.
The problem: I can't send e-mail with attached file.
I tried to provide filename to the command, it works without Error, but the received e-mail does not contain the file sent by the Telit modem, in contrast, I get an empty file with the same filename.
Example:
AT#SMTPCL=\"[email protected]\",\"testEmail\",1,\"test.txt\",0
then I issue my text (email body)
then I issue the escape sequence ("+++")
Where: test.txt is a text file (containing some text) and stored in the SD card.
The command above works fine, I receive the e-mail (containing email body text) with an empty file "test.txt"
I think that the AT Command fails in finding the file, then it will send an empty file with the same filename.
I think that there is a way to import the file to be used by the Telit modem and the AT commands.
I read the official Telit documentation and searched in the Internet, but I did not find any solution.
I would like to seek your valuable support, and tell me please, how to get it to work, I will be very thankful.
AI: According to the manual, section 5.1.6.10.9. Send mail with attachment - #SMTPCL:
AT#SMTPCL=<da>,<subj>,<att>[,<filename>,<encod>]
This command permits to send an email with different types of attachments if
GPRS context has already been activated
(#SGACT or #GPRS).
After sending message body text (as with #EMAILD), the command switch to
online mode if attachment has to be sent.
While in online mode data received on the serial port are transmitted on the
SMTP socket as MIME attachment.
The escape sequence has to be sent to close the SMTP connection
In other words, YOU are responsible for sending the content of the attached file, after you send the body of the email message.
|
H: Tube amp: What do these resistors do?
This is a schematic for a very simple guitar pre-amp. I understand the basic amplifier architecture except for those two 33k resistors in the middle, combined with the 220nF capacitor. Any ideas as to what those are for?
AI: It's (capacitively coupled)negative feedback so the gain is controlled about 66K/1K = 66.
The feedback is applied to the cathode of V1a rather than the grid because it needs to be negative feedback.
|
H: Can I control a load of 12v DC with a solid state relay 24-380VAC?
I need to control a load of 12v DC and 30A, Can I control the load with an AC solid-state-relay 24-380v and 40A? If it isn't possible, what should I use?
Thanks.
AI: No you can't.
Figure 1. The SSR-40 DA.
I need to control a load of 12v DC and 30A ...
The device clearly shows that:
The output (pins 1 and 2) are AC. It can not switch DC.
The output will switch 24 V to 380 V AC. Even if it could handle DC your voltage is too low.
If it isn't possible, what should I use?
A relay or a DC SSR with voltage and current ratings to suit.
|
H: How to alternate 2 LED strings using 555 IC?
I have one sensor that goes on/off at times, I want to flash 2 LED strings (RED, GREEN) every 1 second using a 555 IC.
So when sensor ON
1st second GREEN-ON,RED-OFF
2nd second GREEN-OFF, RED-ON
the 555 IC can sink and source, do I use a P and N channel MOSFETs to drive the LEDS?
Is this schematic correct? have I connected the MOSFETS correctly and also I'm not sure about the 555 timing if it is 1 second ON 1 second OFF
Can anyone suggest different approach
Please help
AI: You can drive the strings like this (555 circuit shown for 50% duty cycle when used with CMOS 555) M1 needs to be a logic-level MOSFET. For 1Hz (0.5s on 0.5s off, R6*C1 needs to be about 0.71, so you could use 1uF and 710K with a CMOS 555.
simulate this circuit – Schematic created using CircuitLab
|
H: Arduino pmos ZVP2106A as switch
I've got some ZVP201A PMOS transistor and I want to use one as a switch to control a little 5V 110-150mA light bulb with an Arduino. Here is my schematic:
Is it correct? Is the ZVP201A the right transistor for my application? The 10k pull down resistor is really needed? How can I choose the right value for the Gate resistor?
AI: The circuit looks fine to me, but I'm not sure about your choice of mosfet.
The pull-down resistor is optional, but recommended. If the Arduino is unconnected, or the I/O pin is configured as an input, the mosfet gate would be floating. This could cause it to be neither fully on nor fully off, and dissipate so much power it could be damaged. The pull-down resistor protects you from this.
As for the gate resistor, it is to limit the inrush current when switching, which can be significant. The Atmega328P has an absolute maximum rating of 40mA per I/O pin, so you'd want at least 125Ω, but a bit of a margin is a good idea. 150Ω would give you 33mA max, so you'd be safe.
If you want to switch quickly (e.g., using PWM), you want the gate resistor to be as small as possible. If you're only switching occasionally, then anything under 10kΩ is probably fine.
Now for the choice of mosfet. If you look at the third and fourth graphs in the datasheet, you can see that at -5V gate voltage, the Drain-Source voltage at 250mA is over 2V! At your desired 100mA, it's probably less, let's say 2V exactly. That leaves only 3V for your light. And these are typical values, they could be better, but also worse.
Even if you managed to turn that mosfet fully on, its Rdson is 5Ω, so that's at least 0.5V drop at 100mA. This mosfet might not work well for your purposes. If you look for another one, try to find one where the graphs say it'll comfortably do at your gate voltage.
You might consider a jelly-bean bipolar transistor instead. At those currents, those tend to have a voltage drop of 0.7V, but you're guaranteed to properly switch such a transistor.
|
H: How does the Intel 8086/88 know when to assert the IO/M signal?
Consider an Intel 8088 processor with a standard, parallel RAM and ROM implementation that also supports address/data bus access to various external peripherals like analog-to-digital converters (ADCs), UARTs, and more.
I'm having trouble designing a chip-select decoding scheme that I'm confident will work. Although I could use logic gates across all 20 address lines, the resulting PCB has significantly more traces and ICs, along with a greater potential of my design being incorrect. I'd like to utilize the IO/M pin to make my design easier to design and debug.
The 8086/88 datasheet describes the basic function of the IO/M pin but doesn't explain the underlying mechanism behind it. I understand that a logic low on the pin indicates a memory access and a logic high indicates I/O access, but I don't understand where the processor comes up with this information. The memory map I'm trying to work with has 2kB of address space reserved to address peripherals. Both ADC's require 8 bytes each to address individual analog inputs, and the UART needs a 1-byte placeholder.
0x00000 - 0x7FFFF : SRAM Chip 0 (512kB)
0x80000 - 0xDFFFF : SRAM Chip 1 (384kB)
------------------------------
0xE0000 : ADC 0 (8 Bytes)
0xE0008 : ADC 1 (8 Bytes)
0xE0010 : UART 0 (1 Byte)
------------------------------
0xE0800 - 0xFFFFF : Flash ROM (126kB)
Since memory maps can be arbitrary, how does the processor magically know when it's trying to access memory vs. I/O devices? By extension, how does the Intel 8088 know what to do with it's IO/M pin if I could easily swap the ordering of the above address space?
AI: Thanks to my suspicions based on a past (and future?) life in Z80 ASM and a quick search for 8086 io, I found a handy synopsis of 8086 I/O at this page by Dr. Jim Plusquellic (hooray for free lecture notes!) - http://ece-research.unm.edu/jimp/310/slides/8086_IO1.html - which I'll now try to... synopsise even more handily.
As his page explains, the 8086 has two available modes of I/O:
memory-mapped
"isolated" a.k.a. standard
In the latter case, a special set of instructions must be used - IN, INS, OUT, and OUTS. These cause corresponding signals to be output on the M/IO (Memory or I/O) and R/W (Read/Write) pins. That page indicates the difference and how these can be wired up:
As the Prof. explains, using this mode avoids using up normal memory ranges for I/O, with the caveats that:
it increases circuit complexity: you must wire up the mentioned pins to disambiguate between the two possible meanings of an address and direct each to the right destination. In doing so, you conceptually create the 'virtual pins' IORC or IOWC (I/O Read/Write Control) shown in the diagram.
it limits the instructions you can use for I/O to the 4 mentioned, rather than letting you do all kinds of acrobatics with normal memory loads/stores/etc., as you could under memory-mapped I/O (assuming the target device will tolerate them!)
So, the reason the 8086 and friends know when to assert IO/M is... because you tell them when, by using one of their dedicated I/O instructions.
|
H: How to quickly distinguish DO-35 Switching diodes and Zener diodes
I do not have a magnifier glass handy. And many a times I saw Diode Numbers get wiped out after reusing the diodes. Is there an easy way to distinguish between DO-35 packaged Switching diodes like the very popular 1N4148 and 0.5Watt Zener diodes using multimeter?
Even a simple circuit would also work for me. It would be awesome to keep the circuit handy as a tester and use it everytime I need.
AI: How about two or three 9V batteries in series with a 10K resistor. Connect the diode in a series circuit both ways, and measure the voltage across the diode each way.
The diode and zener will both measure about 0.6V in the forward direction, and the diode will show the battery voltage when reversed, while the zener will show the zener voltage, if less than the battery voltage, otherwise it will look like the diode.
If the zener happens to be (say) a 200V zener you would need 200V to test it, which would be dangerous.
|
H: charge pump doubler
I am not fully sure as to how this circuit works. I know that during the positive half cycle D1 is on and C1 charges to V volts, and that during the negative half cycle D1 will become off and D2 conduct. So some charge flows from C1 to C2, keeping C2's voltage at some level until the next negative half cycle. But how will the voltage across C2 end up being at ~2V volts at the end?
simulate this circuit – Schematic created using CircuitLab
Edit: D1 is on when it's negative half cycle and off when positive. I knew this.
AI: During the negative half cycle D1 is on and charges C1 to the negative peak voltage minus the diode drop (with the more + voltage on the cathode of D1.)
Then during the positive cycle the charge from C1 transfers to C2. The voltage delta on C2 will depend on the relative size of the capacitors, but with no or light load the "buckets" of charge from C1 will eventually fill C2 to twice the input voltage minus diode drops and resistive losses.
[ If the voltage on C2 is less than 2X Vin then charge will flow from C1 to C2 since C2 is charged to the negative peak of the input sine wave each cycle. On the positive cycle C1 is "lifted" to ride on top of the positive half of the sine wave creating a current that charges C2. Once C2 reaches ~2X Vin, C1 can no longer transfer charge to the output, so the output stays at that level. ]
If the energy removed by the load is less than the energy transferred each cycle, the output will still eventually ramp up to close to 2X the input voltage.
|
H: How do I create the layout for this rotary encoder on a pcb?
I am very new to designing boards and I am trying to do a board layout that contains a MODEL EN11-HNM encoder but I am not sure how to handle the tabs that provide the mechanical strength while it is on the board.
I have laid out the three pins as it shows in the diagram titled "pcb layout" (in the linked datasheet) but there are also two, unlabeled squares in that diagram that appear to be where the tabs are.
My inclination is that there should be holes there, but the diagram doesn't suggest it (at least to me). Any help is much appreciated. Thanks!
AI: Yes, the squares are the holes for mounting tabs.
It's easier for PCB fabs to drill round plated holes than to make square ones. Often, PCB fabs charge extra for plated non-round holes. You can use round holes for mounting tabs. To be on a safe side, make the hole slightly larger than the diagonal (3.2mm) of the recommended square hole.
|
H: Using mosfets to switch between two thermistors
I've got an Atmel ATmega328P and I'm trying to run two thermistors into one analog pin (TEMP_M5), using a digital pin to select which thermistor is active (TEMP_SEL_M5). I thought the circuit below would let me do that, but I've breadboarded it and while the right-half of the circuit seems to work when TEMP_SEL_M5 is pulled to ground, whenever TEMP_SEL_M5 is pulled high, the voltage at TEMP_M5 is 0 V.
Description of the circuit:
The lower half is the bottom half of a voltage divider.
TEMP_M5 is an analog pin.
TEMP_SEL_M5 is the digital selector pin.
My theory was that pull-down R27 would pull Q3's gate low, so Q3 would enabling TH_M5 to form the upper part of the voltage divider, while also pulling Q4's gate low, keeping thermistor Q4 inactive.
Can anyone point me in the right direction please? Or might I have an error on my breadboard (or both!).
AI: As an alternative to @Chapacabras perfectly reasonable solution, if you don't have any PMOS devices, you can simply invert the topology of the circuit presented in that answer in order to still be able to use NMOS devices.
The following topology should work as it allows the source of the NMOS to be connected to ground in order to allow your control signal to create a high enough Vgs to turn them fully on:
simulate this circuit – Schematic created using CircuitLab
(p.s. Circuit lab doesn't appear to have thermistors, so it is the wrong symbol, I know)
You can connect the two inputs using the resistor-transistor inverter that you show in your schematic. If I get a chance later I'll add it in to the schematic.
The downside to this is it inverts the behaviour of the output - a higher voltage now represents the opposite temperature change from the original circuit.
|
H: What is this symbol that looks like a parallelogram?
it says "180ohm at 100MHz" next to it. So I'm guessing that it's a non-air-core inductor. It seems to fit this: What is this symbol on the schematic? - except that the symbol is slightly different than what's in that answer. Wanted to confirm.
this is part of Atmel at91sam3d (ARM SoC) schematic.
AI: It means a ferrite bead.
They are used for noise suppression and are specified usually in terms of impedance at a certain frequency - the higher the impedance, the more it will block those frequencies.
|
H: LM2596 buck converter overheats converting 36DC -> 5DC at 600mA
In my circuit I'm using an assembled LM2596 converter module (those which are like $2 on ebay). The input voltage is 26V AC (current 140mA), which is rectified (making it ~36 peak DC), and feeds the buck converter. The output is 5V DC, 600mA. All seem to be within reasonable ranges for the converter, but it overheats pretty fast to the point I can't touch it anymore. And if left overnight for testing, it burns out. Both the LM2596 chip and the 330 induction heat up; the inductor seems to be hotter.
So far I tried to drop the voltage at the converter by inserting the capacitor (up to 100mF, non-polarized) into the AC circuit for capacitive resistance. This drops the input voltage to ~9V but the capacitor itself overheats really fast. I also tried with different modules, and they all do the same.
My questions here:
Is it normal?
If yes, what could I do? Is it reasonable to chain the converters, like using the first buck to drop something like 36 -> 20, and then the next one to drop 20 -> 5? Any side effects, besides the cost of two converters? Or is it more effective to put them in parallel?
Edit: photo of the module. The dark chip says LM2596 -ADJ:
Conclusion: I have tried a bigger capacitor (2200uF), a different inductor, and a heatsink. Nothing worked, except stacking regulators.
AI: These converters are often advertised on eBay as working up to 40V and 3A with 92% efficiency. Don't believe it.
The 'LM2596' may be a fake. But even if it's a 'good' fake, what kind of performance can you expect? I simulated the LM2596 in TI's WEBENCH®. Here's the circuit...
And here's the simulation result...
Only 74% efficiency at 600mA! That equates to 1W of power loss, which could make a small board quite hot. However in the simulation the inductor only dissipated 0.16W, much less than the LM2596's 0.54W. Your inductor is getting hotter than the IC, which suggests it may have higher resistance and/or magnetic core loss than the simulated component.
The combination of low inductance, high voltage drop and low current results in high ripple. A circuit designed for low output current might achieve higher efficiency by using a larger inductance value, but then it would be worse at high current. I am guessing the original designers of this converter wanted to get the greatest current and voltage range they could out of it, so they used the minimum inductance value they could get away with. Then someone else copied the circuit, but substituted the inductor for a physically smaller part with higher resistance and lower saturation current. And if the LM2596 is a fake...
Is it reasonable to chain the converters, like using the first buck to
drop something like 36 -> 20, and then the next one to drop 20 -> 5?
Yes, this should help. Efficiency improves at lower voltage drop, so you could try cascading converters (eg. first from 36V down to 12V, then from 12V to 5V) so the voltage differential that each one has to handle is reduced. Total efficiency may be worse, but each individual converter is more efficient so they should run cooler.
|
H: Why does the opamp output voltage saturate?
simulate this circuit – Schematic created using CircuitLab
Vout = Vin (1 + R2/R1) According to this positive feedback topology - made an error here, it's Vout = Vin(-R2/R1) (edit)
Now I read in a tutorial - http://www.electronics-tutorials.ws/systems/feedback-systems.html , that
If the input voltage Vin is positive, the op-amp amplifies this positive signal and the output becomes more positive. Some of this output voltage is returned back to the input by the feedback network.
Thus the input voltage becomes more positive, causing an even larger output voltage and so on. Eventually the output becomes saturated at its positive supply rail.
How does this happen? Shouldn't Vout be constant at a particular value, because we aren't changing Vin or the resisitors right? Shouldn't the equation Vout= Vin ( 1 +r2/r1) always hold? Error Vout = Vin(-R2/R1) (edit)
So how is the Vout increasing iteratively?
AI: Vout= Vin (1 +r2/r1) is the equation for a non-inverting op-amp with negative feedback.
simulate this circuit – Schematic created using CircuitLab
Figure 1. Non-inverting amplifier configuration.
Your configuration is non-inverting but has positive feedback. This will give a Schmitt trigger effect.
Remember that the op-amp output will be \$ (V_+ - V_-)A \$ where A is the open loop gain and typically > 1M. If we apply V1 = 1 V as shown in your schematic when the output is zero then \$ V_+ \$ goes to 0.5 V. The output will then try to go to \$ (0.5 - 0)1M \$ \$ = 500,000~V \$! It will get as far as the positive supply rail and stop with \$ V_+ \$ half-way between 1 V and the supply voltage. This will hold the opamp in that condition indefinitely.
Schmitt trigger, ʃmɪt/, noun, ELECTRONICS:
a bistable circuit in which the output increases to a steady maximum when the input rises above a certain threshold, and decreases almost to zero when the input voltage falls below another threshold.
|
H: Microcontroller not working as expected or crashes after a few days
I am using Atmel AVR ATmega8 in my monitoring project, which measures three phase voltage and sends data through a uart. It works great in 1 or 2 days. But after that amount of time, it is not working as expected, and no response comes from the uart and heartbeat led, which indicates uc is alive or not. And sometimes heartbeat led blinks and no response comes from uart. But after a hardware reset, it works again, then crashes again until hardware reset. I implemented a watchdog in it, but it seems not working. I reset the watchdog counter in 8 bit timer interrupt routine. Should I reset it in my main code, not in an interrupt routine?
I assume it is getting out of SRAM. ATmage8 SRAM is 1 kb, and my static data is using 71,2% of it. And I am not using any heap allocation. My question is: Is it possible to stack and static data collide?
AI: Is it possible to stack and static data collide?
Yes, that is entirely possible. Atmega has no dedicated stack space, so if you use too much of it, you will overflow and crash your static data.
Try to reduce your memory consumption (use the smallest suitable data types for variables, reduce your array sizes etc.) Make sure you don't have any recursion or unusually long call trees under certain conditions.
If you can get your hands on better hardware, try running your program on a 2K version of the controller. If it runs without issues, you can confirm it's an insufficient memory problem without having any extra programming effort to do.
PS. As @Edesign says, servicing the watchdog from a timer interrupt is useless: doing so would protect against timer failures, not code failures. You should service the watchdog from your main loop, ideally from a sanity check function:
//main loop
while(1) {
uart_task();
sensor_task();
wdg_task();
}
void wdg_task(void) {
if(uart_ok() && sensor_ok()) do_wdg_reset();
}
Note that the watchdog is supposed to help with errors which cannot be accounted for programmatically, like power glitches. Using a watchdog to reset a buggy program instead of fixing the bug is not the way to go.
|
H: LM2576 output voltage error
In my earlier post, I was using LM317 for SIM900 but due to some voltage drop problem, I decided to go with LM2576. I am trying to step down the voltage from 12v to 4.5v using LM2576. I have studied the voltage calculation formula described on page 21. For the time being, I am just testing it on breadboard so have not connected the capacitors and diode at the output. Following is the schematic
According to the voltage calculation formula:
O/P Volts = Vref(1 + R2/R1)
O/P Volts = 1.23(1 + 4700/2000)
O/P Volts = 1.23(1 + 2.35)
O/P Volts = 4.12v
So the calculation shows output voltage of 4.12v but in practical it is showing 5.64v.
Is my calculation wrong or I am doing something wrong in the circuit. Please help.?
AI: I am just testing it on breadboard so have not connected the
capacitors and diode at the output.
That's just plain ignorance. All bets are off if you don't have the flyback diode because it IS an integral part of the energy reclamation into the output capacitor (also not fitted) from the inductor.
The diode also prevents (as a side issue) back emfs from the inductor harming the chip.
The other issue is that without the output capacitor the voltage across the potential divider will be a somewhat distorted square wave and not representative of anything when measured with a multimeter.
It's like trying to drive a car with the tyres removed.
|
H: Is the self-powered USB hub powering my devices?
I bought a cheap Hub for powering my 5 arduino(s). It has an AC wall power adapter. Can i determine if it actually powers my USB devices and what amount of current per USB port can deliver?
The USB hub has one LED, that lights when i power it with the AC adapter, and until now everything works ok.
In the control Panel, in the USB ports i can't find any useful information. I can see the Hub as port 4 hub 3, but says power required "unknown".
AI: The simplest way to know if your hub is providing power to the ports or not is to just plug something into it while it's not connected to the computer. If it gets power then the only place it can possibly be getting it from is the hub's power supply.
How much current it can deliver depends very much on how they have designed the hub. Many cheap hubs just have a direct connection between the power supply and the power pins of the ports. The only limit then is what the power supply can provide (less what the hub itself needs to operate).
Better ones include power control and over-current sensing, etc. In these cases, if they are to adhere to the USB 2.0 specs, then 500mA is the minimum current they should be able to provide whilst self-powered, or 100mA when bus powered. Any more than that and, at the hub's discretion, the power may be shut off.
Of course, the hub is free to provide considerably more current, in which case it can be classed as a CDP - Charging Downstream Port - which can be used to charge high capacity battery systems like mobile phones, etc, where they request (or expect) much higher currents than the USB 2.0 spec allows for a standard port.
So the only real way of knowing just what your hub can do is to pull it apart and see what kind of power circuitry is connected to the power pins on the ports, and look at the datasheets for any chips involved.
|
H: Fixed 5V regulator circuit LM1084
I am building a circuit using a fixed 5V LM1084.
All the circuit diagrams in the datasheet seem to be for the adjustable configurations. To used the 5V fixed should I connect Adj/GND pin directly to ground?
AI: Yes, you connect the ADJ/GND pin to Ground aka GND for the fixed-output versions.
Eg. Figure 12:
|
H: Condition for absolute stability
A necessary condition for absolute stability of a system is
Gain cross over frequency < Phase cross over frequency
Where Gain cross over frequency is the frequency at which Gain = 1 or 0 dB
Phase cross over frequency is the frequency is the frequency at which phase = -180 deg
Can anyone please tell me why?
AI: Any system (without negative feedback) will eventually roll-off the amplitude at the higher frequencies and, at some point, the gain will fall to unity and get smaller as frequency increases more. If the phase angle hasn't fallen to 180 degrees before the gain has become zero then, when applying non-phase-changing negative feedback, the system will not oscillate.
Lets call that frequency point F1.
If the gain (without negative feedback) is still greater than unity when the phase has degraded to 180 degrees, it is fairly certain that when applying non-phase-changing feedback, the system will oscillate.
Lets call this F2
Quite simply if F1 occurs then F2 cannot occur and the system with feedback is stable. Alternatively if F2 occurs it CANNOT be lower than F1.
|
H: serie parallel RLC circuit current
I got a problem with how to calculate the current going through R and L in this circuit.
I have calculated the following.
Xc= 79.6Ω at -90°
Xl = 251.3Ω at 90°
ZRL = 128.8Ω at 30.8° (R||L)
ZT = 111.48Ω at -7.03°
Vc = 10.8V at - 83°
Vr = 17.33V at 37.83°
Total current(IT): 0.135 A at 7.03°
everything above this point ive checked in my answer key and they seem to be correct. Now to where im not correct, the current IR and IL.
I use IR = ((XL/(R+XL) * IT) = 0.084A at 97.03°
IL = ((R/(XL+R) * IT) = 0.05A at 7.03°
Where am i going wrong? IL and IR are supposed to be IR = 0.115A and IL = 0.069A
AI: The current thru the inductor is simply the voltage across it divided by its inductive reactance at 1000 Hz. So:
I = 17.33 / 251.3 = 0.06896 amps
The current thru the resistor is analogous, the voltage across it divided by its simple resistance: So:
I = 17.33 / 150 = 0.1155 amps
In a circuit like this where you are dealing with pure inductances, pure capacitances and pure resistances you simply apply the "AC" version of Ohms Law:
V = I x Xc, or V= I x Xl, or voltage = current times reactance
|
H: two way switch for a bulb circuit
how to install a wiring where I can have two switches the two switches will turn on a bulb
I have to turn on the light if any of the switch is on and I have to turn off the light if any of the switch is turned off
can you suggest me a way to install such a mechanism thanks in advance
AI: I have to turn on the light if any of the switch is on and I have to turn off the light if any of the switch is turned off.
Your stated requirements are contradictory. If one switch is on and the other is off then, according to your requirement:
"Turn on the light if any of the switch is on." So the light is on.
"Turn off the light if any of the switch is turned off." So the light is off.
You need to make up your mind.
If you want a two-way lighting system then you use two changeover switches.
simulate this circuit – Schematic created using CircuitLab
Figure 1. Two-way lighting circuit using 2-way switches. (These are called 3-way switches in North America - probably because they have three wires. They only have two switch positions.)
The circuit of Figure 1 is probably what you want but not what you asked for.
|
H: Maintaining voltage at 5V, but voltage must be able to change
Okay so I'm a beginner at electronices not sure where to begin looking so I'm just going to ask, is there a way to maintain voltage at 5V but it must be able to change to below 5V.
Basically, I'm hooking up an output from a sensor and going to connect it to an Arduino for data logging. But the problem is the output from the sensor can go up to 7V or more(According to the a program that monitors the sensor, it doesn't do data logging), and i wish to avoid frying the Arduino board so is there a way to fix that?
Will a voltage regulator do it? All I know about voltage regulators is it maintains voltage at a certain point.
So to make it clearer, is there a way to prevent the output voltage of the sensor from shooting above 5V and also be able to change from 0V to 5V.
AI: There are 3 ways you could achieve restricting the voltage from going over 5 volts.
You could clamp it by using a zener diode at 5V along with a resistor to restrict too much current going through the Zener diode. See this.
You could use a resistor voltage divider to scale the output from the sensor to make the maximum voltage at 5 volts. But make sure you know the sensor's output voltage will not reach over than what you predicted. To prevent something like this from destroying your target device, add a zener voltage clamper at the output.
Use an operational amplifier
|
H: How to calculate telescopic antenna impedance?
I'm designing a 27 MHz transmitter for controling RC toy using TX-2B and RX-2B ICs. Thre is my output stage schematic (see attachment). Output impedance 50 Ohm. I know that antenna length on 27 Mhz should be l (wave length)/4 = 2,77 m (quarter wave antenna) and impedance of that antenna is approximately 36 Ohm. But its too long antenna. I want to use small chineese telescopic antenna (97 cm) . Antenna lenth can be reduced connecting serires inductor. According to this https://m0ukd.com/calculators/loaded-quarter-wave-antenna-inductance-calculator/ in my case loading inductance should be 5.12 uH. Now our antenna reactance is zero: $$Im(Z_{a})=0$$How about antenna resistance $$R = R_{Radiation} + R_{Loss}$$ How i can calculate it?
AI: Radiation resistance versus monopole height: -
(source: strobbe.eu)
Your monopole is about 0.088 of \$\lambda\$ so radiation resistance will be about 3 ohms. Here's the formula: -
Stuff taken from this website.
|
H: Do the statements "circuits/components will only draw the current they need", and "V = IR" contradict?
What I'd like to know is how we can resolve the two statements, "Circuits/linear components will only draw what they need", and "V = IR". They seem to contradict one another, in my view. With a given voltage and a given resistance, current will be set by these two properties in the circuit, regardless of "the current components need". If this could be at all explained mathematically as well, I also think that'd be better... these analogies seem limited after a certain depth...
AI: It is incorrect to say "components only draw what they need to from the circuit." That statement appears to relate to questions like: "I have a power supply that is rated 2 amps and I wast to connect it to a device that only needs 1 amp. Will the power supply give my device too much current?" The answer should be something like: "The power supply determines only the voltage supplied and the current available. The characteristics of the connected device determine how much current it will draw from the power supply." Often, the characteristics of the connected device are well described by ohms law. However there are many devices that have characteristics that are not well described by ohms law. Never-the-less, it is still the characteristics of the device that determine the current in most cases. If the supply has a major influence on the current drawn, there is likely a problem with the connected device or the power supply is the wrong voltage.
Of course, there is such a thing as a current-source power supply. In that case, the power supply delivers whatever voltage is required to force a set current through the load.
|
H: Measuring temperature using resistance termometer Pt100
Given:
voltage source \$U_0\$ = 1.2 V
\$R_i = 1000 \Omega\$
\$Pt_{100}\$ is described by \$\Delta\delta=T-T_0=0°C\$ with \$R_0 =100 \Omega\$ at \$0°C\$
\$R_1 = 500 \Omega, R_2 = 50 \Omega\$
Asked:
Calculate the \$I_{out}\$ at the amplifier for \$0°C\$ and \$100°C\$
\$R = {\rho L \over A} = 50 \Omega = R_{L1} = R_{L2} = R_{L3}\$
\$R_{0°C}=R_i+R_{L1}+R_{Pt0°C}+R_{L3}=1200\Omega\$
\$I_{0°C}={U_0\over R_{0°C}}=1mA\$
\$Uc_{0°C} = I_{0°C} (R_{Pt0°C}+R_{L3})= 0.15 A\$
\$I_{out} = {U_c\over R_{L2}}=3mA\$
Calculate the general transfer characteristic - thus, the \$I_{out}\$ of the amplifier as a function of temperature.
I've found the solution for 0°C, but I don't know how to calculate it at \$100°C\$ (because I don't know the \$R_0\$ at \$100°C\$).
Many thanks for your help.
AI: Pt100 resistance vs temperature is defined by various standards. Here's one.
Figure 1. Extract from Labfacility datasheet.
Figure 1 shows that at 100°C the resistance will be 138.51 Ω.
|
H: Why 7805 regulator gives output 6 volt?
I am using 7805 and 7815 for the voltage 5 V and 15 V respectively. I provide 24 V to 7815 it is giveinng me output voltage 18.5 V instead of 15 V. According to 18.5 V to input to 7805, its output is 6 V. It should have to provide 5 V output. similarly, the output of 7815 should be 15 V.
I don't know what is happening. Can you tell me what will be the error in the circuit?
I am using this schematic in hardware.
AI: You need a minimum load for them to regulate. Add a resistor to give 100 uA of load and the situation should improve.
|
H: Translating a 1.8 V FPGA pulse to 24 V pulse to power a solenoid
I am designing a board that will interface between a FPGA board and solenoid that powers a pneumatic system.
The signal coming from the FPGA is a LVCMOS 1.8 V signal. Current from the FPGA signal is approximately 10 mA. I desire the output of the designed board to be a 100 mA 24 volts to power the solenoid. My initial thoughts are using a BJT transistor to accomplish this task.
Doing some simple online searching I found this DIY project that is translating 3.3 V to a 5 V signal. I assume I can use this as my basis using BJT transistors, though my knowledge on electrical engineering is limited.
Is this the appropriate approach to take mimicking the DIY project, or is the voltage and current difference too large? If the simple design is okay, how do I go about selecting the correct resistor values and BJT transistors?
Any help is greatly appreciated! Thank you!
AI: Make your life easy.
Don't try to switch the 24Volts.
Switch the solenoid to ground.
Like this:
simulate this circuit – Schematic created using CircuitLab
The diode is NOT optional. The 1N4007 is a stand in. Which diode you really need depends on how much current the solenoid can kick back when you turn it off, and I don't know how much that might be.
Without the diode, the solenoid will build up a high voltage when you turn off the transistor. This voltage can easily be higher than the voltage rating of the transistor. That will kill the transistor in short order, so make sure to include the diode.
R1 can be made larger or smaller depending on how much current it takes to fully switch the transistor from 1.8V.
The type of transistor use use for Q1 depends on how much current the solenoid takes to operate. You must make sure that it is rated for enough current and for at least 24VDC from collector to emitter - more is better.
The 2N3904 is rated for 40V from collector to emitter, but only 200mA. You will probably need to check the current your solenoid draws. Depending on that, you will need to find a transistor with the proper ratings.
|
H: Why isn't the switches being bypassed in this triac/diac circuit?
Just when you think you understand circuits, there's always a curve ball to derail you and leave you scratching your head.
The diagram below is a Triac/Diac speed controller for a reciprocating saw. At the top of the diagram, you'll notice there is a black wire from the right brush of the motor, a yellow wire to a resistor switch and a white wire connected to neutral. They are pigtailed together.
Although the diagram appears to be correct and works, I am confused as to why it works. If electricity chooses the path of least resistance, shouldn't the current leaving the black wire go directly through the white wire and back to neutral? Shouldn't it bypass the speed and trigger switches?
What adds insult to injury is that current bypasses the resistor in the speed switch when it is closed. Why does it bypass in. this case and not the other?
AI: What you're missing is you have two circuits. Yes, the current flows from live, through the triac, through the motor, then down the white wire to neutral.
However, current also flows from live, through the capacitor (remember, it's AC we're dealing with here), through the resistors, the switch+resistor pair, and down the white wire to neutral. Some also heads off down to the triac to control it.
To make it more pictorial, you can split the circuit into two separate parts so it makes more sense:
First the main motor power circuit:
Then the triac control circuit:
Both (apart from the actual triac gate wire of course) are in parallel with each other using the same power supply.
|
H: Emitter follower regulator with sziklai pair, transistor heating up!
I have a wireless chip esp8266 that requires input voltage of 3.3V and can draw current up to 500mA.
Unfontunately at the moment I don't have any 3.3v regulator IC's or buck converters or any 3.3v voltage source, so as a temporary measure (until my ordered stuff arrive from China) I made the following design using voltage divider to limit output voltage and sziklai pair to boost the current output:
simulate this circuit – Schematic created using CircuitLab
Now I'm using a bunch of LED's in parallel with 100ohm resistors as the testing load, and by drawing only 40mA the PNP transistor started to heat up considerably and I'm worried it would blow up if i draw more than a 100, also I'm concerned that the increased temperature might change the output voltage considerably due to decrease VBE according to Ebers-Moll module.
The 2N3906 datasheet says that the max Ic current is -200mA, so why is it heating up at 40? and also I need more than the double of that to drive the wifi chip.
What can I do to fix these problems and make a stable voltage source with 0.5A output?
AI: You have a load where you want \$3.3V_{DC}\$ and a compliance current of up to \$500mA\$. The design is linear and sources its power from a \$12V_{DC}\$ supply. It's not clear to me (because I may have missed reading it, or for other reasons) if this is a lead acid battery operating in a car or a laboratory power supply on a bench. You have some questions about \$V_{BE}\$ as a function of temperature and its impact on the circuit you are considering. You have a all-too-hot PNP BJT. You have BJTs, no MOSFETs. You are currently using a resistor divider to set your output voltage.
Let me start by just thinking out loud about the design you already show. \$Q_2\$ will be sourcing most of the current. Luckily, it's not operating saturated, as \$V_{CE} > 1V\$. So you can expect \$\beta \ge 50\$ for the PNP and a reasonable base current. Unluckily, it's not operating saturated, with \$V_{CE} > 8V\$, so its dissipating like crazy -- likely at more than 4W. That's probably more than a TO220 package will well do into air. So that's a problem identified. Remember it for later. \$Q_1\$ is just providing base current to \$Q_2\$. That's likely to be \$I_{C_{Q1}} < 10mA\$. And luckily, \$Q_1\$ is also not operating saturated, so once again you can expect \$\beta \ge 80\$ for the NPN and a very reasonable base current that is probably \$I_{B_{Q_1}} \le 150\mu A\$. Not a bad load current drawn away from something setting the voltage (resistor divider.) But this does reflect on your resistor divider, if you intend on keeping it, in terms of stiffness and you need to carefully consider the implications. (You could also consider a zener here, of course. But I'll stick with your resistor divider.)
So let's pencil out a design and ignore heating problems for now. You'd do something like this:
simulate this circuit – Schematic created using CircuitLab
Well, there's a rough idea. You can see a lot of power in the PNP BJT.
Now, you don't actually have to burn off all that power in the PNP. You can distribute it somewhere else, if you want. It does have to be burned somewhere. But you can insert a resistor. It turns out that an easy place would be in the collector leg of the PNP (the \$V_{CE_{Q_1}}\$ stays the same then.) That PNP only needs about \$2V \le V_{CE} \le 4V\$ in order to keep both itself and the NPN out of saturation. And a TO220 package probably can dissipate 2W into air. So let's split the difference and figure \$V_{CE_{Q_2}} = 3V\$, so that \$Q_2\$ is burning only 1.5W or so, and shove the rest into some other resistor.
The new schematic looks like this:
simulate this circuit
\$R_3\$ will dissipate about \$3W\$, worst case. (The above circuit is really targeted for a maximum of \$485mA\$, but I figured you would be okay with that in order to get a standard resistor value there.) \$Q_2\$, as predicted, will be about \$1.5W\$.
If the current is, let's say, \$250mA\$, then what happens? Well, the PNP BJT will stretch out its collector and will have to drop another \$3V\$, for a total of about \$6V\$. But the current is now only \$250mA\$, too. So it will still dissipate about \$1.5W\$. The resistor will reduce its dissipation, though.
In either case, you can get away with a small signal NPN. You just need to get a TO220 packaged PNP and these are fairly cheap and easy to get.
Regulation isn't all that good, still. We did, after all, allow \$200mV\$ range for the divider in the calculations. You could go even stiffer for the resistor divider. But another approach would be to use a zener. (Of an appropriate value.)
Where did I get the 4.025V node value for the divider?? Well, the NPN BJT is a small signal device. Stuck in my head is that they have \$V_{BE} = 0.7V\$ when \$I_C = 4mA\$. So I figured \$3.3V + V_{BE} = 3.3V + 700mV + 60mV\cdot log10(\frac{10mA}{4mA}) = 4.025V\$ and that's where the number came from.
|
H: Most efficient circuit for 2048 Bit multiplication, and how to effectively render it
So this isn't for a hardware application, but I still think it will be extremely relevant to those that are chip designers/EE enthusiasts.
I'm attempting to do some analysis on multiplication viewed as a boolean function. For this I want to construct a boolean function of two vectors \$X,Y\$ each of length 2048. Of course a symbolic representation of this function corresponds to an actual circuit, so implicitly what I want to do is build the smallest possible circuit (meaning fewest number of gates followed by least depth) for multiplying two 2048 bit numbers and store the result in a text file (using And and NOT and Or)
Now with this comes a couple of parts:
Choice of algorithm: I'm thinking building the circuit implementing Karatsuba's algorithm would be a good idea (is 2048 bits large enough to warrant Toom-Cook?, I know its definitely too small for Strassen's Fourier Transform techniques).
Switching between algorithms, there should exist some value N, for which multiplication of N digit numbers is faster through traditional grade-school style multiplication, than running up my costs by implementing Karatsuba style multipliers at that level.
Once I have the algorithm built out what is the best way to render it symbolically in a text file? My gut is to hack this out with a long script, but perhaps you might know of some tools that let you abstractly generate circuits and write out the results which would be faster for me to convert to my desired forms than trying to reinvent the wheel in python.
AI: Firstly, it depends what the rest of your hardware is. Is it just the multiplier, or is there some other hardware, e.g. memory controllers etc., that is going to be needed anyway and you can utilize. Secondly, do you have a floor in performance? I can think of small multiplier implementations that will be quite slow?
Off the top of my head, there are 8051 implementations that are below 3000 gates. Remove pipelining, and all the unused instructions and hardware, and you can have an MCU that is a few hundred logic gates. Now, add some RAM and you have your very low gate multiplier.
I think the smallest implementation will involve a very minimal ALU with the following operations: add, shift, and XOR. This is all you need to implement the multiplication. You can use RAM to store your data. Add a few instructions and a basic control unit, and you have a rudimentary processor. You then off load all the complexity in the form of instructions.
Also, what do you count as a gate? Are you after minimum logic gate count, or minimum transistor count? What about flip-flops? Different answers to these questions can produce very different results.
|
H: bandwidth of digital control design in conventional dc-dc converter
I designed conventional single inductor two output dc-dc boost converter in psim. This means inductor energy is stored and thrown to 1 output at one cycle and charged and discharged to the 2nd output at next cycle. The two outputs are sensed by using voltage dividers and time multiplexed using analog mux at the speed of half of the switching freq to be processed in the digital control stage. My digital stage is very simple pid with z transfer func. After that pwm controls the switches on/off time.
The design works well.
vin 2V
vo1 4V
vo2 6V
fs =1M
L=4uH
c=50uF
etc...
so my question is in above scenario, does the bandwidth in the control should be greater than switching frequency or less than switching frequency?
thanks
AI: For a reasonable guarantee of stability your process/measurement/control bandwidth should be significantly greater than the bandwidth of the analogue LC filter that smoothes the output.
It's not a 100% guarantee but a reasonable guarantee of stability.
Reason: -
If you are switching at 1 MHz then your LC filter (yes you must have an output capacitor although not shown in your circuit) MUST be significantly more "sluggish" than the switching frequency to obtain adequately small ripple voltage on the output. This of course is easy to achieve with pretty small components so there's no excuse for bad selection.
Sampling/controlling at a higher speed can achieve not much else other than a slight improvement in accuracy due to the ability to numerically average the ripple voltage but, as I said earlier, it's sensible to make the natural ripple voltage low by use of an appropriately scaled LC filter.
From the L and C values you quote, the analogue cut-off frequency is about 11 kHz. If you are alternately switching at 500 kHz then the size of the ripple voltage will be determined by a 40 dB / decade roll-off: -
Resonance is about 11 kHz and, at 1 MHz, the attenuation of the switching waveform will be about 80 dB and, at 500 kHz will be about 78 dB or 8000:1. So, if Vin is 2V, the switching waveform will be 2V p-p and, with a bit of hand-waving the ripple will be about 8000 times lower i.e. sub milli-volts.
In other words you have chosen an L and a C combination that are more than adequate for this design. Your control loop could probably work at a speed of 100 kHz without much problem.
|
H: Is a Karnaugh map always a good way to simplify a Boolean expression?
I want to simply the following expression:
(NOT A AND NOT B AND NOT C) OR (NOT A AND B) OR (A AND B AND NOT C) OR (A AND C)
I created a truth table first, then a K map from the truth table. (See below.)
As far as I can tell, the simplest expression I can derive purely from the K-map is:
(A AND NOT C) OR B OR (A AND C)
But I can reduce this further with Boolean algebra to:
A OR B
Is it fair to say that a K-map will not always give the best possible solution?
AI: Karnaugh map are a very good way to simplify logic expressions. However, more than four variables can get a bit tedious for us humans to do.
Moreover, its very difficult to spot something called "Static Hazards" if you tread down the algebraic simplification path. Designs that are Static Hazard free are very important in digital design and Karnaugh maps can be used to avoid them.
Karnaugh maps will always get you the simplest expression as long as you form the largest group possible even if that means looping(including) ones you have already accounted for.
With regards to your observation, it is wrong. You cannot simplify this to A OR B, look at line one on your Truth Table.....
|
H: Why did my Gameboy shut off during takeoff?
When I was young I remember playing my Game Boy Advanced SP in the airport terminal. When we boarded we were asked to shut off all electronics. I was setting a high score in Pokémon Pinball: Ruby & Sapphire, so of course I left it on. During takeoff, it shut off. I checked the power switch, it was definitely still up. Later I switched it off and back on, and it worked just fine.
Why did my Gameboy shut off?
I was guessing it's an electrical reason, but if this isn't the correct StackExchange site to ask this question please let me know.
AI: I was setting a high score in Pokémon Pinball: Ruby & Sapphire, so of
course I left it on
Maybe your Game boy was susceptible to electromagnetic interference emanating from some of the aircraft's control systems. This is a typical sort of problem a microprocessor based design could suffer from.
Ironically, those pieces of equipment that can suffer from this sort of interference (we call it susceptibility) are almost certainly capable of "leaking" out EMI (electromagnetic Interference) that can, if we choose to believe all the warnings, interfere with an aircraft's control system.
This means you've probably admitted to one of the most serious crimes I've ever seen admitted-to on SE.EE. Your parents should take the rap of-course if you were too young. Interesting reading on Quora from a pilot.
Here's another quote specifically about game boys: -
I had fuel indications on the FMC going crazy on board the B737, that
returned to normal when all electronic stuff in the back was switched
off. I suspect a "Gameboy" electronic game device to have interfered,
but this is no more than a guess. No, I did not ask to switch the toy
back on again and investigate more in depth as I was responsible for
the safety of 140 passengers and this would have been extremely
irresponsible! This is not a situation in which to do such testing!
This [ever-present responsibility accounts for why] there is no
"proof" of the relationship.
Taken from here
|
H: blink a led 10ms every 1 second
I am currently looking at generating a signal to blink a led with a 10ms duration every 2 seconds. I was thinking to use a 555 timer to do so, but I don't see how to change the duty cycle to make that off time is different than on time.
I want to avoid the use of an MCU if possible to save energy.
AI: So this is also from \$2V\$ to \$3V\$. Is this another question related to your MSP430 question, earlier, called "connect a 5mm led to a gpio without transistor"? Is this just another way of addressing your earlier question? If so, you really are better off just getting a high efficiency low current LED and doing this in software. You'll get precision control of timing and it's cheap and easy. Plus, using the existing MSP430 for this (which has fabulous sleep modes and very very fast re-start from sleep capability) then the power consumption is really at a minimum, too. In fact, even if you had to add another MSP430 for ONLY this purpose, it would still be a very very low energy alternative. Those things sleep on sub-microamp draw with a timer running and can fire up to full speed in about a microsecond. I can't see why it wouldn't be a solution here.
Honestly, I don't know why you don't stay with that solution. But I'm going to assume this is for a different purpose than that one.
Before moving on, the MSP430G2210 is an 8-pin part that costs about $1 in ones. It includes an internal VLO that, in LPM3, draws about \$0.5\mu A\$ and can wake up and have the DCO running in about \$1\mu s\$. (You may not even need to bother with the DCO, but the VLO might be \$250\mu s\$ cycles and the DCO can be much much faster and get the few instructions needed done in much shorter time, so it might be worth it to start the DCO anyway.) So you turn on the LED, go to sleep, turn off the LED, go to sleep. Etc. Assuming you fire up to \$12MHz\$ in \$1\mu s\$ and run for another \$4\mu s\$ before going back to sleep (draw about \$3mA\$), that's \$5\mu s\$ every \$2 s\$ at \$3mA\$ and the rest at \$0.5\mu A\$. Add to that, let's say 10mA for the LED during the \$10ms\$ period. Average of \$100.5\mu A\$ draw total. That's basically just the LED itself (\$100\mu A\$ average) with the MSP430 not counting for anything. And that's better than an LM3909 will do. Speaking of which:
There is an IC called an LM3909 which, if you can get one, would probably solve the need. They run off of as little as about \$1.2V\$ and they work fine running on up to \$6V\$. So that covers your range of \$2V\$ to \$3V\$. They will use more than \$1 mA\$ to get the job done, though. You don't even say how many \$mA\$ you want to drive through the LED during that 10mS period, so I will take some freedom there, too. (The LM3909 delivers a high initial current that will probably be more than \$20mA\$ and then let's that drop down to about \$20mA\$ over a period of \$5mS\$, for one combination of values I tested. Which might be fine for you. But who knows? You didn't say what you can accept.)
If you are serious about a completely separate circuit for blinking the LED and truly don't want to use the LM3909 for other reasons, then here is a workable LM3909 in discrete form:
simulate this circuit – Schematic created using CircuitLab
Again, the current consumption of a dedicated MSP430 is less.
You could also consider this circuit:
simulate this circuit
It's also extremely low power. It will not work at \$2V\$, though. I think you may be able to operate down to somewhere around \$2.5V\$, perhaps? Definitely at \$3V\$. So it may not be a fit. It was something I was considering attaching to the phone line to monitor the activity, as it converts voltage to frequency pretty well and with different values for \$R_1\$ and \$C_1\$ wouldn't exceed the phone company's maximum on-hook impedance for a phone attachment.
But you really do need to specify a LOT more than you do when you write. In general, you aren't disclosing yourself very well nor discussing a range of acceptable behaviors or constraints.
|
H: Packaging polarity indication of a supercapacitor (polarity indicated by arrows)
I obtained some supercaps from an auction site.
As is often the case for low cost components from such sources, these do not have supplied data and such branding as there is does not appear traceable.
I would like to know if there is a standard for polarity for such devices and how likely it is that generic devices such as this one follow the "standard".
My samples have an arrow on the label which may indicate polarity, but this is uncertain.
To make my query specific, but also liable to be generally useful, here is a set of closely related questions:
What is the polarity of this supercapacitor (4F, 5.5V)?
How was the polarity determined in this case?
Is there a standard for polarity for such capacitors?
What does the arrow indicates?
Some details of specific product here
Including this diagram:
AI: Since the product you purchased has no background information, you can't be certain. However, the convention for these stacked-disk type capacitors is polarity mark points to negative lead. This is the same as is the convention with conventional electrolytic capacitors.
For example, the Eaton KR-5R5V474-R:
Has its datasheet show:
Similarly, for the Panasonic EEC-S0HD224H:
Has the same arrow convention considering the asymmetric leads with polarity indicated in its datasheet:
|
H: Using microcontroller's ADC to measure the voltage between LiPo cells
What I want to do is to measure the balancer output of a 3 cell LiPo, and if any cell drops lower than 3V I want to put my uC in the shutdown mode. Gonna be using STM32F401RET6.
First question is: is it actually a good idea to do it this way, or should i do it externally (not in uC), using a couple of op-amps.
And secondly, what kind of socket do I need to plug the balance connector to my pcb. Dualsky is my Li-Po manufacturer.
AI: Yes, that's a valid approach, certainly with just three cells. You have three voltages to measure. Obviously you'll need a voltage divider on at least two of them and you'll have to consider the current draw of the divider keeping in mind that the micro probably wants to see 10K or less looking out of the ADC inputs. It's also possible to use a higher resistance dividers (M\$\Omega\$) and buffer the outputs with some inexpensive CMOS-input op-amps, or to switch the divider when you want a measurement with a high-side MOSFET or BJT switch.
You'll have to watch the divider tolerances vs. the shut-down tolerance you're trying to achieve. If you use 1% tolerance resistors the error due to resistor tolerances alone could be much higher than 1% even though each measurement is only affected by ~1% by resistor tolerances (depending on the exact ratio- worst-case error of a voltage divider made from 1% resistors is between 1% for equal resistors to about 2% for very unequal resistors). Consider this example with 100K/200K nominal resistors.
VM2 is 2.970V -1.00% error
VM3 is 3.040V +1.33% error
Your calculation for the top cell would be V3 = VM3*3-VM2*2. In this case the error as a percentage of V3 is +6% even though all the resistors are within tolerance. You can always consider 0.1% resistors and it's unlikely (but possible) that the resistors would be so perversely off tolerance in the worst directions.
This rapidly becomes a losing approach as the number of cells increases though.
simulate this circuit – Schematic created using CircuitLab
|
H: What power in outlets forces electrons to flow back to anode in batteries?
title pretty much says it all...
I completely understand how battery works (because its simple right?).
But I´m little confused about recharging part... I understand that when you plug battery into the outlet you force electrons to flow back to anode.
But no matter how much I search and watch videos... Nobody describes more closely WHAT IS THIS POWER IN OUTLETS that forces those electrons to flow back?
What is this power that nobody describes? I assume it has to do something with AC/DC current in today outlets?
https://www.youtube.com/watch?v=3KX_KuS6FPI this is one of the examples of the videos where everything is explained briliantly but when it comes to recharging they describe it: POWER in an outlet forces electrons to force back...
But what is that POWER?
thank you so much for your answers and sorry for my noobie question (if it is)
but I really could find anything about this topic
AI: There is absolutely nothing magical about the power in an "outlet". There is simply more of it than there is in a battery.
As a simple illustration, take two rechargeable batteries - one flat and one fully charged. The flat one will have a much lower voltage than the fully charged one. Let's say they're 0.8v and 1.3v respectively.
Connect the batteries to each other in parallel: + to + and - to - (note: don't actually do this, you might overheat and blow up your batteries - just do it in your head).
Now one battery wants the voltage between + and - to be 1.3v but the other can only manage 0.8v. So the stronger battery wins and pulls the voltage up to where it wants it to be. In order to do that it has to "help" the other battery to get there, by giving it some of its charge.
After some time both batteries will find an equilibrium where they have the same amount of charge and both want the voltage to be the same. At that point everything stops. The flat battery has gained a fair chunk of charge, and the charged battery has lost an equivalent amount of charge.
Now the difference with an outlet is purely that there is a seemingly infinite amount of charge to "help" the flat battery reach the voltage that the charger wants it to be - the charger never goes flat - so the flat batter can be "helped" all the way to full charge - and beyond if the charger doesn't know when to stop.
Note to pedants: Yes, this is all completely wrong, but it paints a picture that helps the OP understand basic concepts.
|
H: How to Create a Simple Speaker Driver After LMC555 with Low Pass Filter
I created a very basic sound generator which ends in a LMC555 which plays a melody in the frequency range between 440Hz-880Hz. Now I struggle with the speaker driver. I would like to use very basic components like transistors and MOSFETs and no sophisticated IC.
The current circuit looks like this. I omitted the whole melody generating part. It uses MOSFETs to change the frequency of the LM555 as shown.
simulate this circuit – Schematic created using CircuitLab
The current solution is not ideal. But I struggle to bring the output signal from the LM555 into a signal which can be filtered using a simple RC low-pass filter so it can be used to be amplified using a transistor, or even be suitable to as input for an amplifier.
I looked through many examples, but they usually just connect the speaker directly to the LM555 without transforming the signal first. So the output will be still a very extreme square wave.
How could I implement a driver like this?
AI: simulate this circuit – Schematic created using CircuitLab
Figure 1. Green box: addition of a DC-blocking (decoupling) capacitor to the output to drive the speaker safely. Orange box: addition of line-level output to drive an audio amplifier.
First, lets fix the existing circuit. Loudspeakers don't like DC. It biases the operation to one side of the suspension's neutral point. They prefer AC. Addition of a decoupling capacitor will fix the DC part. You'll have to experiment with R5 but anything up to 20 Ω should work. That should get you a reasonable tone.
To connect to an amplifier add the components in the orange box. This will reduce the output voltage by a factor of about 10. Adjust the resistors if you want more. By adding capacitance in parallel with R7 you can attenuate high frequencies (which has the effect of rounding off the corners of the square-waves).
|
H: Why is Vbc absent from bjt equations?
In BJT biasing the voltages Vbe and Vce are always present in calculations.
Is the voltage Vbc absent from any equation because one of the collector, base and emitter is grounded or any other reason concerning the theory of semiconductors?
AI: You are incorrect in your titled assertion. But I can guess where it comes from.
Most people use the simplest concepts they need to get the job done. They are concerned about the forward voltage, \$V_{BE}\$, which is somewhat impacted by the collector current and very much impacted by temperature... so that's important... and \$V_{CE}\$ is immediately related to whether or not the BJT is saturated or not and this impacts very basic questions about available \$\beta\$, likely dissipation and temperature of operation, which are also pretty important. Besides, if you know \$V_{BE}\$ and \$V_{CE}\$ then you know \$V_{BC}\$. You might care about that, too. For example, the Early effect... But it's of secondary importance.
But you are wrong, anyway. The first model of the transistor to learn about is the Ebers-Moll model. It's level 1 model includes three distinct ways of looking at the BJT: transport, injection, and hybrid-pi. They are equivalent views, but they have different areas where they are easier to apply.
Let's look at the injection model first (addressing itself to diode currents):
\$I_F = I_{ES} \cdot \left[ e^{\frac{q\cdot V_{BE}}{k\cdot T}} - 1 \right] \$
\$I_R = I_{CS} \cdot \left[ e^{\frac{q\cdot V_{BC}}{k\cdot T}} - 1 \right] \$
\$ I_C = \alpha_F \cdot I_F - I_R \$
\$ I_B = \left( 1 - \alpha_F \right) \cdot I_F + \left( 1 - \alpha_R \right) \cdot I_R \$
\$ I_E = -I_F + \alpha_R \cdot I_R \$
Now, the transport version (addressing itself to collected currents):
\$I_{CC} = I_S \cdot \left[ e^{\frac{q\cdot V_{BE}}{k\cdot T}} - 1 \right] \$
\$I_{EC} = I_S \cdot \left[ e^{\frac{q\cdot V_{BC}}{k\cdot T}} - 1 \right] \$
\$ I_C = I_{CC} + \left[ -\frac{1}{\alpha_R} \right] \cdot I_{EC} \$
\$ I_B = \left[ \frac{1}{\alpha_F} - 1 \right] \cdot I_{CC} + \left[ \frac{1}{\alpha_R} - 1 \right] \cdot I_{EC} \$
\$ I_E = \left[ -\frac{1}{\alpha_F} \right] \cdot I_{CC} + I_{EC} \$
Finally, the non-linear hybrid-\$\pi\$ (nice, because linearizing it in the small-signal case leads directly to the well-known linear small-signal hybrid-\$\pi\$ model):
\$\frac{I_{CC}}{\beta_F} = \frac{I_S}{\beta_F} \cdot \left[ e^{\frac{q\cdot V_{BE}}{k\cdot T}} - 1 \right] \$
\$\frac{I_{EC}}{\beta_R} = \frac{I_S}{\beta_R} \cdot \left[ e^{\frac{q\cdot V_{BC}}{k\cdot T}} - 1 \right] \$
\$I_{CT} = I_{CC} - I_{EC}, \rm{(generator \,\, current)}\$
\$ I_C = \left( I_{CC} - I_{EC} \right) - \frac{I_{EC}}{\beta_R} \$
\$ I_B = \frac{I_{CC}}{\beta_F} + \frac{I_{EC}}{\beta_R} \$
\$ I_E = -\frac{I_{CC}}{\beta_F} - \left( I_{CC} - I_{EC} \right) \$
As you can easily see now, \$V_{BC}\$ figures quite prominently in the most basic and first level BJT modeling. And it doesn't stop there. It's present in EM1 (DC perspective), EM2 (more accurate DC with 3 new constant valued resistors in each lead, 1st order modeling of charge storage for freq. and time), EM3 (basewidth modulation - Early effect, variation of forward current gain with collector current, other DC and AC improvements, etc), Gummel-Poon (basewidth mod and \$\beta\$ vs I, AC and variations with ambient temps, etc), modified versions of those, and even into the latest models. You just haven't been exposed to even the first level of BJT modeling, yet. That's all. That's because for many (if not most) needs, you can simplify the basic BJT EM1 model still further and ignore quite a bit and still get by, okay.
Full disclosure: The three images shown above were taken directly from Ian Getreau's "Modeling The Bipolar Transistor," which was originally written circa 1974 by Ian, then an employee at Tektronix (which at the time had an "STS" [semiconductor test systems] division.) I received my first copy of the book in 1979, when I started as an employee at Tektronix. Ian has since secured the rights from Tektronix (in 2009) and has republished it through Lulu. So it's still available today. [I have never met Ian nor do I receive anything from him for sales of the book or for any other reason. But I did help him get it republished because the book is unique and needed to become available, again.] Half of his book is dedicated to various techniques one can use to extract, through experiment, various BJT parameter values for the models he documents (which include up through Gummel-Poon.) It holds a unique and special place in the literature.
|
H: Do simple LED strip dimmers consume power while turned off?
I am referring to this kind of LED strip dimmers:
I want to know if it consumes power while the LED strip is off, and if so, how much.
AI: Yes they will. It may be a few milliamps, or even less, in the microamp range, but they will as the microcontroller and passives are still powered even when the microcontroller is asleep or simply has it's PWM timers off. Since it is an RF accessible controller, it will need power for it's radio receiver interface.
The only way to get to 0 power is a physical switch. And the power supply would still be connected, so a physical switch on the power supply's AC side as well.
As to exactly how much power, get a multimeter and test it. It won't be much.
|
H: DC to AC conversion and filter wave shaping
My question refers to checking concepts.It's a scientific one,so I am not looking for a way to make a DC to AC power supply for a device because its charger broke or something similar.
The goal is to convert the output of an astable multivibrator into a sine wave that can drive a transformer in a decent way.
The way to do this:connect two low pass filters one to another.One will have a square wave at the input and convert it into a triangle wave.The other will receive it and convert into a sine wave.
simulate this circuit – Schematic created using CircuitLab
I know that for each filter to work as an integrator,the time period of the incoming wave has to be smaller or equal to the RC time constant of the filter.I will calculate these accordingly.This is not the issue.
The problem starts with the square wave.I'm not sure if it should go below 0 or if it's ok to let it vary between 0 and +5V for example.The same is available to the triangle wave.I'm not sure if it will produce the desired sine wave if it won't oscillate between a negative and a positive voltage.
The question is:What kind of square and triangle waves should be generated so that a circuit such as the one described by the schematic will work as explained?Will a square wave (from the multivibrator) input which oscillates between 0 and +V make it work or should it shift from -V to +V?
AI: The problem starts with the square wave.I'm not sure if it should go below 0 or if it's ok to let it vary between 0 and +5V for example.
Obviously, a DC offset in the input wave doesn't matter to the output – it won't pass through the transformer.
So you can use pretty much any periodic function. Since you said yours is a scientific question:
make yourself a plot of the spectrum of the periodic function you apply to the input (spectrum = Fourier transform!). You know that all periodic function have line spectra. The zero-mean square wave has lines in its spectrum spaced every 1/period – that's pretty handy, because that means that you can put your low pass somewhere betweeen 1/period and 2/period, which implies it can have pretty relaxed transition between pass- and stopband.
The triangle is just a square wave convoluted with itself. That's awesome – because convolution in time domain is multiplication in frequency domain, which means that the triangle wave's spectrum is just the squared spectrum of the square wave, so the same filter can be used. However, for practical reasons: It's a lot harder to produce a good triangle wave than a good square wave, and especially if you consider switching losses, fully switched semiconductors are usually much more efficient.
Also, from a practical point of view: your transformer already is an inductive device – and you might very well get away by adding a capacitor in series instead of having RC lowpasses on the input, which would give you a resonant circuit around the frequency you feed in, with (virtually) no power lost, solving the DC offset problems at the same time.
|
H: circuit analysis to find current and then voltage across resistors
This was one of my assignment questions, I am on it since last 3 hours but not able to solve it. Here the source voltage in the circuit shown in Fig. is 100 V.
I need to find reading in each meter. I don't know what I am doing wrong in applying KVL here. Please give your solution.
AI: This is actually (as you have noticed, with a face-palm) a trick question. It's designed to see how observant you are.
The circuit is laid out in such a way as to trick you into thinking it's more complex than it is. It isn't though - it can be better drawn out like this:
simulate this circuit – Schematic created using CircuitLab
You notice I have also turned the schematic upside down so + is at the top and - is at the bottom. You can now instantly see that the three resistors are just all in parallel with each other and therefore all in parallel with the 100V supply, making the voltage across each resistor 100V.
You have to remember that in a schematic all the nodes and "joins" that are linked together by a simple wire are effectively the same node. In the schematic above I have coloured a selection of wires in red. They are all the same wire - all the same node - and thus all at the same potential. It's only when you come to tracing the current flow through it that you start to split values between different branches.
So, \$V_{M1} = V_{M2} = V_{M3} = V_1\$ and \$I_{R1} = \frac{V_1}{R_1}, I_{R2} = \frac{V_1}{R_2}, I_{R3} = \frac{V_1}{R_3}\$
|
H: Rotary Encoder Schematic Symbol
I want to create a part in Eagle for Bourns PEC16 series rotary encoder. I can follow online tutorials, but I'm not sure what the standard rotary encoder symbol looks like. Is there a diagram or specification I can follow to make the part more useful?
AI: I am not aware of any standard for this, no. You see various permutations on:
A box with a circle in it and terminals coming out of the side
A circle with terminals, maybe with a rotational arrow in it
A box with multiple switches in it
A box with the words "Rotary Encoder" written in it
The list goes on. So just draw something that says what it is. A rotary encoder isn't really that pictorial a device, hence most things say what it is either within it or next to it.
|
H: Smooth and no-flickering dimmable light source
My goal is to record a video with a varying intensity light source.
No flickering at any frame rate (frame rate 30 60 120 240) while watching frame by frame, not human eye.
Smooth dim level
Any type of lamp is OK. (DC powered is preferred)
Dimming by voltage controlling from signal generator (sine shape about 10-60 Hz or higher)
Many requirements make me confuse how to choose the right things to the right job.
I tried dimmable halogen capsule with 12VDC. It worked well when I powered it using large DC power supply. Varying voltage changes light intensity as I need and cause no flickering. But when I use the signal generator to smoothly dim the light, it cannot afford that high current.
I will try LED with 0-10V dimmable driver. No need high power source. But the price is expensive for me. I want someone to make sure it will be the right way or not? I am worried about flickering at high frame rate.
Could you please recommend the type of light source, driver (if needed)? Or I have to go back to halogen lamp and find high power oscillator?
AI: unlike Majenko, I'd totally not say that incandescent is the only way to go:
Yes, many cheap LED dimmers will just PWM your LED; meaning it turns on and off faster than the eye can register – however, when catching that on a sensor/film, the shutter speed will make it very likely that you might see flickering, simply because frames might catch a varying amount of on/off.
So, true PWM directly applied to the LED is not an option – however, there's nothing wrong as using an LED as such. In fact, LEDs are very nice for applications like these – they can be brightness-adjusted without any risk of damage by varying the current flowing through them.
So, what you'd need is an adjustable constant current source – in the easiest case, that would just be an adjustable power supply in current mode, which internally is actually pretty much an amplifier (typically, class A), meaning that it also wastes quite some energy as heat – but that might not be your primary concern here.
Going one step further (and maybe saving you a lot of money on adjustable benchtop power supplies), there's a lot of ICs that actually are power supply controllers dedicated to dimming LEDs with adjustable current. They do control a MOSFET switch with a PWM, but they do it at a high rate, and use that PWM to drive an inductance, which, on time average, outputs a constant current. I've built such an adjustable LED supply with then ON Semi NCP3065, which enables me to drive a 39V max 200mA LED from a 12V battery. Ripple in current at relevant frequencies is very low – the switching frequency lies between 100 kHz and 250 kHz, so far above the shutter opening period that no camera sensor can catch the ripple, even if it was of significant height, which it isn't, because the PWM isn't directly changing the current flowing through the LED, but just the amount of energy stored in the inductivity.
Now, of course, my LED is a blindingly bright light source that is best comparable with a really, really bright flashlight; this might be far too small for studio usage. If you need to dim something like an LED flood light, inductivities might get larger than a single small <1€ IC can handle; then, you're suddenly the business of designing your own Switch mode power supply. Might not be the easiest choice.
|
H: A query regarding thermal voltage V = KT
I read that thermal voltage = KT ; K in ev/K and T in Kelvin.
By substituting we get V = 8.620 * 10^(-5) ev/K * 300K = 0.0259 ev
But where ever I read, thermal voltage is given as 26 mV but it has to be 26 milli electron volts, right?
Can you please clarify this?
AI: Yes. A volt is also a Joule per Coulomb. A fact I never forget for a moment. Think of it this way:
If you have two plates separated by some gap in a vacuum in outer space, and place 100 volts across them, and then imagine placing one Coulomb of charge at the negative plate, that Coulomb of charge will be accelerated towards the positive plate. Eventually, the charge will strike the positive plate and the impact energy will be just 100 Joules. (And so it must also be that their velocity at impact is the same, so that the kinetic equivalent \$\frac{1}{2} m v^2\$ works out, correctly.)
You can move the plates further apart and the acceleration will be less, but the distance will also be just enough further apart to allow that Coulomb of charge to have exactly the same impact energy. (Because it will have exactly the same velocity in the end and therefore the same kinetic energy.) It doesn't matter how far apart, or how close the plates are, the results are always the same: 100 Joules of kinetic (impact) energy converted from the prior 100 Joules of potential energy. The only difference is the time it takes for that conversion.
It's consistent. 1 volt will impart 1 Joule on 1 Coulomb in this situation.
Since you are into units and dimensional analysis (and I think that is a very good thing), you might also now look into magnetics and the concept of Webers (or Joule-seconds per Coulomb or Volt-seconds.) A Joule-second is a unit of angular momentum. Electrons have quantized 'spin,' and they also have orbitals around an atom and there is something there to consider about angular momentum.
In fact, electron spin and orbital motion (or, at least, under the assumptions of models for these) both contribute to magnetic dipole moment. In magnetic materials, these tiny moments do not add up to zero.
In all these situations, they have angular momentum and the magnetic dipole moment will be proportional to the angular momentum, by some proportionality factor.
So, supposing this relationship and using \$\mu\$ for the magnetic dipole moment and \$L\$ as the angular momentum, we have (using \$x\$ for now as the factor):
$$\mu = x\cdot L$$
For an electron in a circular orbit (Bohr's early idea for atoms) and using \$\vec{p}\$ as the momentum vector of the electron and \$\vec{r}\$ as the vector from the center of the atom:
$$\mid \vec{L}\mid\: =\: \mid \vec{r} \times \vec{p}\:\mid \: =$$
But as this is circular and using \$R\$ as the scalar for the orbital radius,
$$L = R\: p\:\operatorname{sin}\left(90^\circ\right) = R\: m_e\: v_e$$
For a current loop, and you can think of an electron in a circular orbit as being just such a current loop, we know that \$\mu=I\left(\pi R^2\right)\$. Also, the time it takes to make an orbit is \$T=\frac{2\pi R}{v_e}\$ and of course the electric charge of an electron is \$q_e\$, so \$I=\frac{q_e v_e}{2 \pi R}\$ (charge per unit time.)
Therefore the magnetic dipole moment of a single, circular orbiting electron is:
$$\mu=I\left(\pi R^2\right)=\frac{q_e v_e}{2 \pi R}\left(\pi R^2\right)=\frac{1}{2} q_e R v_e$$
(Assuming that \$v_e \ll c \$.) It now follows:
$$\mu = \frac{m_e}{m_e} \frac{1}{2} q_e R v_e= \frac{1}{2} \frac{q_e}{m_e} R \:m_e\: v_e= \frac{1}{2} \frac{q_e}{m_e} L$$
Clearly then, the missing factor must be \$x=\frac{1}{2} \frac{q_e}{m_e}\$!!
Angular momentum is quantized. (The revolution in physics from the early 1900's.) Therefore, \$L=N \hbar\$ (where \$\hbar=\frac{h}{2\pi}\$.) \$N\$ is any integer from 0, up. Assuming \$N=1\$, \$L=\hbar\$. So it follows that \$\mu=\frac{1}{2}\frac{q_e}{m_e}\hbar\$. For a single electron, this works out to \$\mu_e\approx 1\times 10^{-23}\:\textrm{A}\cdot\textrm{m}^2\$.
Suppose you have a bar magnet weighing \$69.5\:\textrm{g}\$ and that you go through a process of measuring its dipole magnetic moment using a compass and a yardstick and measuring the deflection relative to the local magnetic field of the Earth. You find that this is \$3.5\:\textrm{A}\cdot\textrm{m}^2\$.
Now suppose that you assume that almost all of the atoms in this magnet are iron atoms. The mass of one mole of iron is about \$56\:\textrm{g}\$. So the number of atoms here, using Avagadro's number, would be \$n=\frac{69.5\:\textrm{g}}{56\:\textrm{g}}\cdot 6.02\times 10^{23} \approx 7.5\times 10^{23}\$. So now you'd compute:
$$\mu = n\: \mu_{atom} = 7.5\times 10^{23}\cdot 1\times 10^{-23}\:\textrm{A}\cdot\textrm{m}^2 = 7.5\: \textrm{A}\cdot\textrm{m}^2$$
This is actually pretty close to the bar magnet measurement. The interesting thing here is that there are also some small contributions to the spin of an electron (ignored here) and also assumptions that all of the atoms contribute exactly one such electron moment. Also, we assumed circular orbits. Bohr's model was modified by Sommerfeld to first include elliptical orbits to explain certain hyperfine transitions and later modified to include motion in three dimensions by Sommerfeld, still later. And then it was again modified when Uhlenbeck and Gaudsmit added the concept of spin. (Pauli then came up with his exclusion principle based on all the quantum numbers by then.) But it turns out in practice that you can really do some remarkable predictions about such behavior using simplified model approximations.
Note that I had to introduce quantum theory and the simple Bohr atomic model to get here. It's things like this that helped force physicists into developing and accepting quantum theory.
I guess I just want to call your attention to how much can be done with dimensional analysis and thinking about the units in different ways (not the one obvious way, but by changing things out and combining units in different ways that you'd otherwise expect, using a LOT of imagination.) It takes you places you might not otherwise go and you might discover new ways of looking at the world around you!
Now look at the Ohm, which is a Joule-second per Coulomb^2. Where can your imagination go with that?
I recommend you read a book called Matter & Interactions, 3rd edition, if interested further.
Note: 1 Joule = \$6.24150913 \times 10^{18}\$ eV. You are using \$\frac{eV}{kelvin}\$ for your Boltzmann's constant rather than \$\frac{volt}{kelvin}\$. So the value of q, the charge on an electron, should be used consistently. If you use \$\frac{eV}{kelvin}\$ for the units of Boltzmann's constant, then you must q=1 for the unit of charge (eV is in very small units associated with the smallest unit of charge, 1 electron.) If you use \$\frac{volt}{kelvin}\$ for the units of Boltzmann's constant, then you must use q in units of Coulombs, instead. Just keep the dimensions in mind, is all.
|
H: Annotating a schematic in Altium
I'm trying to annotate a Schematic project in Altium, my aim is to get, for example, in the 1st sheet : C101. C102 R101 and so on , in the 2nd something like : C201 C202 L201.
I've been trying in vain to do that.So I've decide annotate each sheet alone(Not the whole project), but this turns out to be tricky. Here's what I get :
So as you can the proposed names are the same as the current ones !
any idea how to solve this ?
AI: No need for board level annotate here (you would need that with a multi channel design) and you're already on the right track.
Where you selected 100, assign start designators for all sheets: 100,200,300,400 ...; also check the checkbox next to it (as you did with the 100).
Not click on Reset Designators, which will remove already assigned Designators. Then click Update Changes List, and finally, Create the ECO list (which will then effectively assign them).
Done.
|
H: How to lock one (or more) layers in Eagle?
I am designing a PCB using Eagle software, and the PCB has a specific shape. The shape is little complex so that it includes a number of curves, and it is really impossible to move the shape segments (layer-dimension) one by one.
But 'block' command is also hard for me in this case, since it selects components and copper traces as well.
Is there any ULP or any way to completely lock other layers and move only one layer at a time. And i cant hide the other layers while moving, since other layers convey me the position to where i should move.
there is 'Lock' tool for components, but is there any lock tool for layers ?
AI: There is no way that I know of to "lock" a layer, but if a layer is hidden, it can't be selected.
Before you select what you want to select, enter the command display none <layernum> where <layernum> is the layer (or layers) you want to select (e.g. 21 is Dimension I think) - space separated if there are more than one.
Then you can select using the group tool what you want.
After selecting, you can enter the command display last to show all layers that were hidden by the first command.
As an alternative, if you are making complex shapes that are not to be electrically connected (e.g. stuff on the dimension layer or silk screen), I find it is much easier to create a library for it.
I have for example a generic library for logos which have been imported with the import-bmp and import-dxf ULPs. These end up being quite complex shapes that are a pain to select in the layout, but if they are in a library, you can just place the footprint directly in the layout editor (no need to add it to the schematic).
You can do the same for board outlines. Some cases, e.g. those from Hammond, give you a recommended PCB size with mount hole locations and notches in various places. I find it easier to draw this up in a library (I used the holes library, but you can make one of your own). This way moving it around in the layout is easy (just drag it around like any other part), and reuse in other designs is easy too. Plus it ensures you don't accidentally resize it.
The other advantage is that once they are a library part, you can actually lock the instance when placed in the layout. This prevents it from being selected and moved (handy for the board outline mentioned above).
|
H: Home-automation standard for custom devices
I'm willing to build my own home-automation system (at least partially). I haven't chosen the protocol yet.
My goal is to make home-automation devices that would be compatible with controllers/software and other devices on the market.
For example, I could create a device with an action named Action1 and I could trigger this action with a standard software.
This way I could buy some devices and build special ones for particular problems.
So is there a standard for house automation related to a particular protocol or not, where devices can be controlled by a compliant software and where devices can communicate their capabilities ?
For those who knows what I am looking for is something like GigE-Vision but for home-automation.
[Edit] As I understand there is no high level protocol widely adopted (i.e : to switch a lightbulb). OpenHab simplifies the dilemma on what will be used (z-wave, insteon, knx, ... because it allows to mix existing "standards".
What is left for me is to decide which technology is the most convenient to use depending on multiple factors like physical chips availability, difficulty to configure them, their price, need or possibility of external microcontroller, etc
Thank you for your valuable inputs.
AI: So is there a standard for house automation related to a particular protocol or not, where devices can be controlled by a compliant software and where devices can communicate their capabilities ?
No. There are many "standards".
The OpenHAB open-source project (as in open-habitat) has done a huge amount of work on this with protocols hacked for many commercially available systems. They have an OpenHAB application to run on Linux (Raspberry Pi is suitable platform) and Android (at least) app to control the system. Using their platform you can integrate devices from all the vendors they support.
|
H: When load increases in rotor of induction motor how does stator draws more current?
When load is increased in the rotor , why does the stator draws more current since the rotor is short circuited. How does mechanical load increases the electrical current flow....
AI: The current induced in the rotor creates a magnetic field. The force between that magnetic field and the magnetic field of the stator is transmitted as torque rotating the load. The load has a counteracting torque that resists the torque supplied by the motor. That resistance to the motor torque is seen electrically by the rotor as additional resistance in the rotor circuit in series with the actual very low resistance of the rotor bars. If there is no load torque, the load resistance is high and the rotor current is zero. With increased load, the load resistance is less and the current increases.
A More Detailed Explanation
In a three-phase induction motor, the rotating magnetic field of the stator passing through the rotor conductors induces a current in the rotor conductors. Lenz's law states that the current induced in a circuit due to a change or a motion in a magnetic field is so directed as to oppose the change in flux and to exert a mechanical force opposing the motion. As a result, the force between the stator and rotor magnetic fields causes the rotor to turn. If there is no force opposing the rotation, the speed of the rotor will increase until its speed matches the speed of the stator magnetic field (synchronous speed). At that point, the stator field passes through the rotor without moving through the rotor conductors and the rotor current and torque drop to zero.
If the motor is turning a load, the load torque opposes the motor torque and prevents the motor from reaching synchronous speed. The difference between the operating speed of the motor and synchronous speed is called the slip speed or slip. The amount of slip is proportional to the torque produced by the motor.
In order to explain and analyze the operation on an induction motor the following equivalent circuit was developed by Charles Proteus Steinmetz in about 1887. The circuit represents one phase of a three-phase motor
Diagram adapted from Malcom Barnes "Practical Variable Speed Drives and Power Electronics"
In this circuit, an ideal transformer is used to represent the mechanism of the induction of current in the rotor by the rotating magnetic field of the stator. A variable resistor, Rr(1-s)/s, represents the mechanical load and the influence of slip on the rotor current. The mechanical power developed in the rotor is represented by the power dissipated in the variable resistor. The other circuit components represent the electrical properties of the stator and rotor.
|
H: Calculate total impedance in circuit with series RL in parallel with C and R
Hi im trying to find the total impedance in this circuit but im having troubles figuring it out. I have calculated the individual impedance for each branch like following:
Xc = 46.8 ohm at -90 degrees
Xl = 46.8 ohm at 90 degrees
ZR = 1000 + j0
Zc = 0 - j46.8
ZRsL = 10 + j46.8 => (47.8 ∠ 77.93)
So now when i try to find the total impedance the first thing i tried was ZT = 1/((1/ZR)+(1/Zc)+(1/ZRsL)) which i get to be 23.1 ohm. Which is wrong. Any help would be appreciated.
EDIT: So i get how do do it from the comments below but i dont know what numbers to use. Like with (ZT=(Z1⋅Z2⋅Z3)/(Z1⋅Z2+Z1⋅Z3+Z2⋅Z3)) What do i actually put as Z1, Z2 etc. I cant take (10 + j46.8)( 0 - j46.8) can i? In my mind that is 56.8-46.8. I know it isnt but i cant figure out how to do it
AI: I think an earlier version of your question suggested that you may have an answer, just not a process for finding it. If so, you might have posted it up.
Ignoring the voltage source, except for the frequency, I get about the same figures you do for each branch:
\$1000 \Omega = 1000 \angle 0^{\circ}\$
\$10 \Omega + 14.9mH = 10 + j46.8097305 = 47.8659678 \angle 77.9411244^{\circ}\$
\$6.8\mu F = -j46.8102774 = 46.8102774 \angle -90^{\circ}\$
Putting those in parallel, leads to something like:
\$1000\Omega \vert\vert (10\Omega + 14.9mH ) \vert \vert 6.8\mu F = 180.943269 - j31.4410821\$
or,
\$183.654589 \angle -9.85741212^{\circ}\$
I'm just not sure how you got your figure. Do you know if I got my calculations right, though, according to what you were told? I'm reasonably confident about my figure here. But I make mistakes, too.
EDIT: I just used the same thing you referred to:
\$Z_T = \frac{1}{\frac{1}{Z_1} + \frac{1}{Z_2} + \frac{1}{Z_3}} = \frac{Z_1 \cdot Z_2 \cdot Z_3}{Z_1 \cdot Z_2 + Z_1 \cdot Z_3 + Z_2 \cdot Z_3}\$
I used the complex number notation, because it's easier for me. But the above is just the same as:
\$Z_T = \frac{1}{\frac{1}{1000} + \frac{1}{10 + j46.8097305} + \frac{1}{-j46.8102774}}\$
EDIT AGAIN: Note to @Joo223: If you want to test out either form of the equation I mentioned, then you MUST keep the fully cartesian equivalent. This means keeping your \$\sqrt{-1}\$ terms separated out. Remember, these are complex numbers and you are using a complex number system. Not the real number system. When you compute Z for something, you get a complex value. The imaginary part might be 0. The real part might be zero. But you still can't just go around thinking that an imaginary part is really just a real part. It's not. You will need a complex number calculator.
So look at these expressions:
\$\frac{1}{\frac{1}{1000}+\frac{1}{10 + 46.8097305 i}+\frac{1}{-46.8102774 i}}\$
or, equivalently,
\$\frac{1000 \cdot (10 + 46.8097305 i) \cdot (-46.8102774 i)}{1000 \cdot (10 + 46.8097305 i) + 1000 \cdot (-46.8102774 i) + (10 + 46.8097305 i) \cdot (-46.8102774 i)}\$
Please take careful note that I've not just ignorantly stuffed a real numbered value as an \$\Omega\$ value. I've had to keep track of both real and imaginary terms. You will need to use complex number calculations here.
Real numbers do not form a closed algebra over their operations. Complex numbers do close the algebra. But more importantly for electronics is the idea that multiplication by i rotates a plot by \$90^{\circ}\$. Or, you might look up Euler's: \$ e^{i \cdot \theta} = cos(\theta) + i\cdot sin(\theta)\$. Investigate the infinite series for e, sine, cosine, and the hyperbolic sine and cosine. It may help, too.
But the point is that you must keep things straight in your calculations. I have a complex number calculator that handles everything smoothly for me. So I use it. I can set up the \$\omega = 2\cdot\pi\cdot f\$, as well, and just slap that in along the way. In fact, my calculator allows me to simply type this into it: \$1000 \vert (10 + 14.9mH ) \vert 6.8\mu F\$ and to get the right answer without any further ado. It knows about H and it knows about F and it knows about SI. It knows that + means in series and that | means in parallel. So it's really easy for me to make sure I'm getting the right results. (I created that calculator software for exactly these reasons.)
|
H: Generating a sine wave from a square wave, for a large frequency range
I have a PWM output from a micro controller. I want to turn this into a sine wave.
The typical way to do this is a low pass filter. Unfortunately, I want to change the PWM frequency, and the corresponding sine wave frequency, over more than a couple decades (say, 10Hz to 100kHz). Are there any simple ways to do this?
AI: Depends on what hardware you have available and how deep into software you want to go.
If you have the processing power and GPIO pins available, you can get away with a very cheap and simple R-2R ladder as your DAC (ditch the PWM). You can then use a sinewave LUT in your MCU's memory + a software defined Low Pass Filter. You can store multiple LPFs in memory/change the characteristics of it on the fly to get your desired frequency response. The output of the LPF can then be fed right to the R-2R ladder to generate your sinewave. This approach is a tradeoff between software complexity/processor power and flexibility/external component size and cost.
If you only have a few frequencies you want or creating a perfect sine-wave is not that important you could toggle between a few different external LPFs.
|
H: How exactly does a point-contact razor blade diode work?
The original foxhole radio used a razor blade with an oxide layer and a makeshift cats whisker to form a diode. How exactly did this makeshift diode work? Is it actually a P/N junction, or does it work through some other principal?
AI: Buried in the Wikipedia Article on Crystal Radio is an asseration that a cat's whisker detector is a form of Schottky Barrier Diode formed by the junction between a metal and a metal oxide semiconductor. This would be in contrast to an "ordinary" diode formed by the junction between two semiconductors being relatively P-type vs N-type with respect to one another.
However, there was a lot of variation in materials used, and getting satisfactory results seemed to require a lot of manual adjustment to find a region with the right properties and suitable contact pressure, so it is at least worth considering if more than one phenomenon has been utilized - one might ask if there might also have been junctions between regions of different oxidation states, for example.
A contrasting explanation is that of a point contact diode, where the migration of metal from the contact wire into the semiconductor serves to locally dope a region to differing properties than the surrounding bulk - apparently this is done in manufacturing by passing a large current through it to cause migration, so it's an interesting question if anyone ever "primed" their cat's whisker setup with a few electrochemical battery cells. Jeri Ellsworth electro-forms such doped regions around a phosphor broze wire by discharging a capacitor through a resistor.
It so happens that if you want to make a crystal-radio like device today (or a diode power detector for measuring RF) a modern packaged Schottky Diode is a frequent choice, typically having a low forward voltage and often being more available and cheaper than a Germanium Diode.
|
H: Linear Circuit Analysis: Source Transformation of DC Network
The 1st (upper) picture is the given problem. The 2nd (lower) picture is my attemps to the solution.
I neglected the middle resistor in bridge circuit, resistor in parallel with voltage source, and resistor in series with current source. But now I'm stuck, any hint?
AI: I just noticed this. I'll just do some broad hand-sweeps quickly through the schematic you provided. Hopefully, I won't make any gross mistakes in the process. And hopefully, it may help a little.
Mentally, I'm treating your node A as ground. So I'm calling that
\$0V\$, arbitrarily.
This makes the resistor bridge in the lower left corner completely
irrelevant, so you can just ignore it entirely. You have a current
source driving current into it and that will set up a voltage across the bridge. But it is completely irrelevant
because your current source has infinite impedance and it completely
isolates the bridge circuit from the rest of the circuit. So I'm
mentally eliminating \$R_2\$, \$R_3\$, \$R_4\$, \$R_5\$, and
\$R_{20}\$ and just hooking the current source directly to node A
(ground.) That sweeps away a lot of unnecessary work. (Another way
of looking at this case is to realize that it doesn't matter at all
what the current source is sourcing into. It will source into it,
period. So if you just hooked that end of the current source to
ground, you'd still have the same situation for the rest of the
circuit. Same deal, any way you look at it. It's just a pointless
distraction.)
Of course, I'm mentally combining \$R_{19}\$ and \$R_{21}\$ into a
single resistor (\$R_a = 2R\$), \$R_{17}\$ and \$R_{18}\$ into another
resistor (\$R_b = 2R\$), and also notice that \$R_{15}\$ and \$R_{16}\$
are also wired in parallel, so I mentally also combine them into yet
another single resistor, which I'll call \$R_x = \frac{2}{3}R\$.
This last resistor, \$R_x\$, is interesting because it is in series
from node B back to the node that \$U_1\$ and \$I_1\$ also share. So
I'm going to think of this shared node as node C, for now.
Now that I've got this new node C, I can see that \$R_{10}\$,
\$R_b\$, \$R_6\$, \$R_{12}\$, and \$R_a\$ all form a nice bridge,
again, from node C to ground (node A.) The resistance of this bridge
can be lumped as \$\frac{4}{3} R\$.
Hmm. That just leaves that rats nest involving a couple of voltage
sources. There is no way any of the current needed by the current
source, \$I_1\$, can be coming by way of \$R_1\$ or \$R_7\$, because
their voltages are fixed firmly (or, in effect, bridged over by the
\$0\Omega\$ characteristics of \$U_1\$ and \$U_2\$.) The same is
true for \$R_{13}\$, \$R_{14}\$, and \$R_9\$. So all that can be
ignored. The voltage sources in effect bypass all those resistors.
So all of the current being driven by \$I_1\$ must be coming
entirely through either \$R_8\$ or else through the equivalent
resistance of the bridge already mentioned in (5) above.
The equivalent is now looking like this:
simulate this circuit – Schematic created using CircuitLab
Convert the voltage source (\$U_1 + U_2\$) and series resistor into a Norton equivalent, sum the currents, convert back to the Thevenin voltage equivalent if you want, and get something like this:
simulate this circuit
I'll let you mess around with the algebra on the voltage source.
EDIT: Well, after an hour waiting for you... Here it is: \$V_s = \frac{U_1+U_2}{2} -\frac{2}{3}I_1 R\$
NOTE @hello: Just look and see that the two voltage sources are effectively zero impedance. Shorts, so to speak, with a voltage characteristic that is more than \$0V\$. They completely bypass the resistors I mentioned in point #6. That's one way. Or, take the perspective of the of the current source. Where can it pull its current from? It can't pull anything extra through \$R_1\$ or \$R_7\$, because if it did, the voltage drop across those two would have to increase. But it can't increase. There are voltage sources across them. That makes pulling any of the current source current through them impossible. If you think about it closely, the nodes relating to \$R_{13}\$, \$R_{14}\$, and \$R_9\$ are also completely determined by those voltage sources (the shared node is determined by the other nodes and the other nodes are determined by the voltage sources, so once again the current source can't pull extra through there, either.) That does NOT mean that the current source can't be pulling through the two voltage sources, though. It can do that. So that just leaves that little \$R_8\$ (plus, of course, that other bridge equivalent I mentioned.)
|
H: When I need an RF sampler
I have a raspberry 3 which can transmit 150mW max. I would like to connect it to my oscilloscope. Is it necessary to use RF sampler?
AI: Unless you have an atypical oscilloscope or an RF transformer in there, the low voltage rails of the pi mean the amplitude of the pi's output is probably well within the range of what the scope can tolerate with appropriate settings, and if not a 10x or 100x probe should probably solve that.
That leaves the question of how best to load the pi "transmitter" - probably you want to load it with a non-inductive resistor of some sort, as the scope input itself will be too high in impedance.
Another option would be an RF attenuator - essentially a specialized voltage divider, which will itself help present something of a load (though not quite of the intended impedance, unless terminated in the designed impedance).
Finally there is the question of what you hope to see. Depending on the operating frequency and scope, the fundamental component might be within the scope's bandwidth, but time domain instruments such as scopes are incapable of telling you the important things about an RF signal, such as harmonic content, frequency, or noise to anywhere remotely close to the degree which matters. Modern digital scopes may have a frequency domain FFT mode, but their digitizer is typically only 8-bits - far from the dynamic range needed for useful RF measurements.
If the signal is not within the bandwidth of the scope you could build a diode power detector - basically a "crystal radio" used to measure the envelope of a directly connected source/transmitter. A scope's high impedance input is a good match for these, which would otherwise need a high-impedance voltmeter.
Past versions of the ARRL handbook used to include plans for a heterodyne down converter for looking at HF / low VHF signals with a low bandwidth oscilloscope. Today some people use DVB TV tuner dongles as crude widely tunable software defined receivers - these have some serious limitations in frequency and instantaneous dynamic range (8-bit ADC) and who knows what in terms of flatness over frequency, but can be useful when their limitations are kept in mind.
Various other types of RF measurements require sampler circuits for reasons beyond just amplitude and loading - for example, you might want a directional coupler to evaluate antenna/load match by looking at forward and reflected power individually.
Keep in mind that the pi's output is almost certainly not spectrally clean enough for on-air use, especially at 150 mW power levels.
|
H: Clock signal from Atmel ATMega chip
I am not sure this is the right place to ask this question, but did not see any communities dedicated to Atmel chips.
I used a scope to look at my atmega328 clock signal (pin 14) and got the following result.
I expected a square wave, not a notched sine wave, but I have no basis for that expectation. So, is this what the signal should look like, or do I have some problems with my clock setup (noise, wrong caps, etc). I am using a 16MHz crystal with 22pF caps to ground wired to XTAL1/2 (9 and 10). The clock frequency looks dead-on at 16MHz, 62.3ns which you can see on the scope. Supply voltage is coming from a 7805 (fed from a 12V wall wart) Does this indicate a noise problem (need additional capacitors perhaps) or maybe this is actually what the signal looks like?
Second question this made me think of, what generates the clock signal anyway? (If I need to ask that as a separate question I will).
EDIT:
The probe is a 10x probe, 100 MHz. It was not calibrated when I measured the above signal, so I calibrated it per Stratton's instruction. The probe is now compensated as can be seen here (820 microsec period = approx. 1.22kHz which is what it should be)
Now when I hook everything up, I get the following, it looks worse...
Could the notching be strictly from no bypass capacitor at the chip? I find that hard to believe, but I have never done this experiment, so I am out of my league!! I know every thing I have read and learned says to use them, it would just be amazing.
Also, I included a picture of the setup just for clarification. Maybe you can see something you don't like (besides my poor ability to build a test board!!)
AI: The first shot looks like ringing caused by stray inductance of the ground clip on the probe and/or compensation issues. 16MHz is getting in to the realm where stray L-C becomes an issue in measurement.
From your shot after you compensated the probe, it now starts to look like a bandwidth limited square wave. You can clearly see the first (16MHz) and third (48MHz) harmonics, however the fifth (80MHz) and higher are gone. Having said that, the third looks distorted (more like a second harmonic, which shouldn't be that strong)
This makes sense. Your scope bandwidth is too low to get anything higher than the third harmonic, so it will always look distorted in that way. As for the lack of the fifth harmonic, well you either have bandwidth limiting enabled on the scope, or the bandwidth of the probe is not high enough. Either way it is getting filtered out.
There will also be ringing still from the ground clip inductance which will cause some distortion and may explain the extra distortion beyond bandwidth limiting.
Ground clips cause ringing, it's inevitable. However, you can eliminate some of the issue by removing the ground clip all together and use the alternate ground on the probe.
Usually scope probes have a removable spring tip. Once that is removed, you have the tip of the probe (metal point) and a ring (ground). In order to reduce the ringing, you should connect the metal ground ring (usually an attachment is provided with the probe) to ground as close a possible to the chip ground, and then measure directly on pin 14 with the tip of the probe. This eliminates two wires (the ground and your signal wire) from the measurement path, thus reducing the inductance from the wires and improving measurement results.
The fifth harmonic is almost 50MHz, which is as I say getting quite high - 80MHz for the seventh harmonic is even higher. So careful measurement is required to get good and accurate readings.
As to where the clock signal is coming from, the clock out pin (P14) of the ATMega is a buffered version of the internal clock which comes from the crystal causing an inverter to oscillate at a given frequency.
|
H: Setting heat on electric stove
This may sound like a strange question, but its bothered me for a while:
I assume electric stoves (the ones with the coils that get red hot) work just by having a resistor that gets hot. If it's getting hot, then it must be using a lot of power so it would be pretty low resistance, but the heating element would still be higher resistance than the wires so the heating element is what gets hot. But to change the heat if the stove there must be a variable resistor, why does the variable resistor not get really hot when you lower the heat?
Am I really off about how all this works?
AI: The hob power is typically controlled using a thermo-mechanical duty-cycle controller.
Figure 1. Part of a hob power regulator.
There are three parts to the control.
A small heater element that turns on with the hob.
A switch contact containing a bi-metallic strip. This is designed to suddenly toggle over at a certain temperature to give a fast contact closure or opening to avoid sparking.
An adjustment mechanism driven by the knob. This modifies the temperature at which the switch will toggle.
Normal operation:
At switch-on the hob is cold and so is the bimetallic strip. The contact is closed. Power flows to the hob and to the heater.
After maybe 20 s or so the heater has warmed up the contact enough to toggle the switch. It opens, power is removed from the hob and the contact heater. They both cool down.
After another delay the bimetallic strip will toggle the contact closed again and cycle will repeat.
This type of control is on-off control with adjustable duty-cycle (the percentage of time the power is on). It works well for a cooker as the thermal mass of the hob, pots and pans is generally high enough that a 10 s blast of heat won't cause too rapid a fluctuation in temperature.
Note that this type of control has no idea of what's actually on the hob or even if the hob is connected! It does not control the pot temperature - only the power fed to the hob - and really it's only an adjustable duty-cycle timer. So, for a given setting a small pot will get much hotter than a wide frying pan that can radiate the heat. Power setting is determined by the cook using his/her experience.
But to change the heat if the stove there must be a variable resistor, why does the variable resistor not get really hot when you lower the heat?
You are right that a variable resistor would get very hot. At half-power it would be dissipating as much power as the hob itself. The on-off control is much more efficient and uses hardly any power.
Note that this pulse technique can be used at very high frequency to dim lights or speed control a motor. In such applications we refer to it as pulse-width modulation. The frequency of the pulses is chosen, for example, so that in the case of lighting there is no visible flicker or, in the case of a motor, that it doesn't cause vibration.
Figure 2. A PWM signal giving 80% power, 20%, 80% and zero power.
Bimetallic strip
Figure 3. A bimetallic strip consists of two dissimilar metals of different coefficient of expansion bonded together. As temperature rises the strip will turn convex on the side with the metal of higher expansion rate.
Oven thermostats
Figure 4. The oven thermostat has a fluid-filled remote bulb and capillary tube. Expansion of the fluid in the bulb drives fluid up to the thermostat where a bellows actuates the contact. Rotating the knob adjusts the distance of the contact from the actuator and thus the temperature at which it opens.
Simple stepped power settings
simulate this circuit – Schematic created using CircuitLab
Figure 5. By using elements with power ratios of approximately 1:2:4 a multi-pole switch can be used to create a binary pattern to generate seven power settings (and off).
|
H: How to connect same signal pads in Package Editor in Eagle?
I'm trying to make a circular pad for a project:
To try to make my life easier when changing inner and outer diameters I created a package which consists of 2 pads: one horizontal, which connects one "fin" to the next one, and a vertical one, which is the fin itself.
The "origin" distance is the radius of the pad.
My problem is, I don't want the "unrouted" yellow connection between the pads since they're already touching, and the Package editor doesn't have the route command.
Is there a way that does not involve using the "wire" command and trying to guess the pad center? (I'm not sure if even this would work).
p.s.: I know if I just ignore the request to route it, I'll probably be fine. But I'd like to know if there's a proper way of doing it.
AI: If you are using Version 6 or later, in the device editor, use the Append button.
In the connection screen, make your connections as normal. Then if you want more than one pad in the package to be connected to the same pin in the schematic, do the following steps.
Click on the connection to which you want to append a pin
Click on the pad to be appended
Click the append button
You should now see more than one pad name forming the connection. There is also a small symbol which looks like a trace connecting some pins (highlighted red). This indicates the type of appended connection.
If the blue line is present in the indicator, it says that they must be connected by a trace in the layout.
If you click on it, the blue line will go away. This now indicates that only one of the pins need be connected (you can connect more, but only one is needed).
In your case, you can use the latter option in a sort of "hacky" way. As you know that the pads are already electrically connected in the footprint, you can click the button to indicate that only one needs to be connected in the layout (as you know they are already connected anyway). This will remove the air wire that is annoying you.
|
H: PIC32MX ICSP wiring
I was looking to use a PIC32MX series microcontroller on a project. It is currently in the mail, but I thought I would try to understand the wiring for power and programming before it arrived. I had planned on using a PICKit 3 to program the device over the ICSP line, but I'm having some trouble understanding the wiring of the MCLR. Here are the designs I have come across:
simulate this circuit – Schematic created using CircuitLab
According to Figure 2-2 on page 46 of the reference manual for the device family the connection circuit should look something like the first circuit design. According to the Microchip wiki it should look like the second circuit. The third design comes from Figure 2-4 in the PICKit 3 User's Guide and the final design comes from Figure 1 in the Microchip ICSP Guide. The design I have seen most people using is the third one, but I am unsure if it would be better for some reason to use one of the others. Does anyone have a suggestion?
AI: I believe in the past I have used Option 1, although all of them will probably work ok.
The advantage of Option 1 is that it is the most protected from ESD and other transients on the programmer reset pin and the switch.
Option 4 is intended for the case where the programmer is providing a high \$V_{PP}\$ (possibly 13V) to the \$\overline{MCLR}\$ line.
Related: ICSP Circuit: Vpp (13V) and Vdd (5V) on Pic microcontroller MCLR pin
|
H: Why the constant of integration in pure inductive is zero, while deriving an expression for current?
I think it should not be zero but should depend on the physical quantities... Basically it should be circuit dependent
AI: It isn't necessarily zero.
Consider this circuit:
simulate this circuit – Schematic created using CircuitLab
and assume the switch is closed for a long period of time, and then opened at t=0.
Then the initial current through the inductor is 10 mA, and this is also the "constant of integration" when writing an integral equation for the behavior for t > 0.
This does depend on the design of the circuit, but most importantly it depends on the history of the state of the circuit (whether switches have been opened or closed, whether voltage and current sources have changed their values, etc) for all the time before the instant we arbitrarily choose to call "t = 0".
|
H: adapting 60 LED battery operated string-light to work with wall wart
I need to adapt one of these 60 LED string-lights to be powered through a wall plug. These are micro LEDs all wired in parallel; sadly, I couldn't find specs for this kind of LED. The string's power supply holds 6 AA batteries (3 parallel-wired-pairs in series) so I know it requires a 4.5V supply, but I have no idea about the current.
Also, I have a similar LED string light with 100 LEDs (this one powered with a AC/DC power adapter) that no longer works. The adapter outputs 4.5V / 1A. So I want to ask:
-What specs should I look for in the power supply/wall wart?
-Can I use the power adapter from the broken string to power this smaller one?
-Is it a good solution to just hook the LEDs up to a wall wart with the correct specs or does this circuit need more components to work and for the LEDs not to burn out?
Thank you!
AI: The way these strings work is multiple leds in parallel depending on a single series resistor and/or the the battery Equivalent Series Resistance. Some simpler strings also depend on the Forward Voltage of the LEDs being higher than the battery pack voltage. A 3.3V @ 20mA led will only pull 15 or so milliamps at 3V.
In this case, there is likely a resistor or diode between the battery pack and the led string. Since these have timers, there is probably a mosfet or transistor and an IC internal to the case.
Simplest case, a 4V power supply should be used. Otherwise a 4.5V should be fine. Open the case to confirm there is a resistor or something.
As for current, measure the led string with fresh batteries using a multimeter. This will confirm how much current is being pulled.
As for the broken plug in one, what exactly broke? The string? You can solder, crimp or twist it back together, by removing the clear coat insulation. If it's the power supply, then you can't re purpose it. Check with a multimeter.
|
H: Include board margin in PDF output
I'm designing a flex PCB to place on the back of a human hand and I need to print it out once in a while to compare the shape. In the output job file I have included the PCB printouts under Documentation but I can't seem to find any layer corresponding to the board margin.
AI: Turns out, Altium doesn't use a layer for board shape which is defined separately. But it's possible to copy the board outline to a mechanical (or any) layer using the command Create Primitives from Board Shape under Design->Board Shape while in the 2D layout mode. This is useful when generating gerbers as well.
|
H: Bi-directional energy meter
I have a question regarding reading import and export energy from an electricity meter, the system has a solar array fixed allowing power to be exported to the energy grid when there is excess power.
The link to the energy meter I am interested in (CL model), is below:
https://www.accuenergy.com/files/acuvim-l/Acuvim-L-Power-Meter-Brochure-1030E1210.pdf
On page 2 the real time energy functions are listed, this should all be available over MOD bus.
I believe all I need to read to obtain import power is Power P1,P2,P3,Psum?
I believe all I need to read to obtain export power is Reactive Power Q1,Q2,Q3,Qsum?
The functions Energy and Reactive Energy see more appropriate but share the same parameters.
Could someone please clarify if this is correct or provide what parameters are required to read and calculate the exported power?
AI: Having designed a number of energy meters over the years, I can say with authority that reactive energy (Q) is not the same as exported energy (PE), in fact it has basically nothing to do with it. What you need is an energy meter that has separate counters for imported real energy (P) and exported real energy (PE).
Reactive power is basically only relevant for industrial metering, but in case you're interested, an energy meter can additionally have up to four counters for reactive energy (Q), these being, in order of real world relevance, inductive (QIND) and capacitive (QCAP), exported inductive (QEIND) and exported capacitive (QECAP). When there are six registers in total, the sign of real power is used to select which registers are accumulated.
Most important, however, is that when money is involved (the meter is used for billing), the exact meter brand and model must be accepted by your power grid company. If money is involved, they may also come and seal the meter themselves with their own seal, although the practice varies from company to company in different countries.
When you're reading the registers, be sure to note the difference between instantaneous power (P) and accumulated energy (W). The register names for instantaneour powers might be something like P, PE, Q, QIND, QCAP and the energies might be something like W, WE, WQ, WQIND, WQCAP etc.
|
H: ESD Diode - GPIO Microcontroller
I need to protect my GPIO from Electrostatic discharge as my inputs are coming from outside.I am using LPC2132 Micro controller which uses +3.3V Supply.Bidirectional ESD diodes that I have seen so far has maximum clamping voltage 0f 7V. Since the micro controller does not withstand more than Vdd+0.3V,I am confused how to protect the micro controller.Is there any way to protect from Electrostatic discharge other than TVS diodes
Attached the screenshot
Added the circuit to protect the Output of Microcontroller
AI: Digital input pins will normally have something stated in the data sheet about the maximum current that can be fed into an input. Normally, the input current is nano amps but when an input voltage rises above the positive rail this current can sky-rocket. Ditto when an input falls below the negative rail.
The DS might say that the maximum current is 1 mA - this gives you something to work with because, an input pin can have a resistor placed in series with it. For example, if an input pin rose by 0.3 volts above the 3V3 rail then there is a danger of too much current however, if there was a 1 kohm resistor in series, you could raise that input voltage to 4.3 volts at the risk of only 1 mA flowing.
So, by adding a series resistor you are giving yourself an easier job of input protection. If 5 mA is allowed, a 1 kohm resistor will give you 5V extra protection beyond the 3V3 +0.3 volts you specify in the question.
Protection offered by a 7 V device is now clearly feasible.
|
H: USB power isolation
Here is the USB to Serial portion of Sparkfun's Stepoko board. Can anyone help me understand why the USB power is isolated from the +5V which is a separate onboard supply powered by an external supply? Nothing except the FT232 is powered by the USB. Hence would it be ok to just leave the F_SMALL fuse and D3 schottky diode unpopulated? Why do you explicitly need to isolate the two supplies?
AI: If Vcc is higher than +5v + the forward drop of the diode the board will be powered from USB. If +5v is higher than Vcc - the forward drop of the diode then the board will be powered by the on-board supply. By removing the diode and fuse you remove the ability to power the board by the USB port.
You must isolate the two power sources because a USB device is not allowed to drive power onto the USB power lines. Only a host or hub is allowed to do that. The diode prevents the board power from going out through the USB port.
|
H: Rs232 connection to gyro, uC and PC
I have a question regarding RS232 communication between a VectorNav VN-100 Gyro, Mbed LPC1968 uC and PC. I am using gyro to measure the number of rotation and processing it in the uC and displaying the number of rotation on a seven segment display. here is the top level diagram of the system (please ignore the power distribution, it uses a inbuilt battery)
All the electronics are inside a steel container, so what I want to do is to be able to reach gyro through the connector to send various commands. Since, gyro is already connected (tx, Rx) to uC how can I connect it to the connector? Here is the pin out of the gyro,
Pin 2 and 3 are connected to uC so can I use pin 8 and 9 with MAX232 in order to connect the gyro to the PC?
[Updated to include model numbers of Gyro and MCU]
AI: Pin 2 and 3 are connected to uC
According to the information you supplied, those pins are at RS-232 voltage levels. Therefore you must be using a MAX232 or similar to convert those to logic level (TTL or 3.3 V etc) for use by your MCU.
Doesn't it make more sense to use the signals on connector pins 8 & 9 to connect to the MCU instead, since those are already at 3.3 V levels?
can I use pin 8 and 9 with MAX232 in order to connect the gyro to the PC?
As I explain above, it seems to make more sense (based on the info you supplied) to use the RS-232 signals at pins 2 & 3 for any external RS-232 connection. That way you don't need to add a MAX232 or similar, for the connection to the PC serial port, since the signals would already be at RS-232 levels
Update: Now that you have supplied the Gyro model number, one limitation I noticed in the VectorNav VN-100 Gyro user manual is that a firmware update is only possible via UART #1 which I think is connected to external connector pins 2 & 3 (you need to double-check that). Therefore you need to consider how you would do a firmware update to the Gyro, if you still choose to have pins 2 & 3 connected to the internal MCU.
|
H: Counter in VHDL
Designing a counter mod60 in VHDL, I realized that something strange happens, but I can't explain why.
This image shows the moment of the transition from 59 to 00 (numbers converted to a 7SegDisp):
The code for it is:
ENTITY Contador IS --"Contador" means counter
PORT(
clk: IN BIT;
disp_uni, disp_dez: OUT BIT_VECTOR (6 DOWNTO 0)
);
END Contador;
--------------------
ARCHITECTURE Contador OF Contador IS
------
SIGNAL unidade: NATURAL RANGE 0 TO 10; --units
SIGNAL dezena: NATURAL RANGE 0 TO 6; --tens
COMPONENT ConvDisp IS
--display conversor's entity goes here
);
END COMPONENT;
-----
BEGIN
PROCESS (clk) BEGIN
IF (clk'EVENT AND clk='1') THEN
unidade <= unidade + 1;
IF (unidade = 9) THEN --Realize that the condition is 9 and not 10
unidade <= 0;
dezena <= dezena + 1;
IF (dezena = 5) THEN --Realize that the condition is 5 and not 6
dezena <= 0;
END IF;
END IF;
END IF;
END PROCESS;
conv1: ConvDisp PORT MAP (unidade, disp_uni);
conv2: ConvDisp PORT MAP (dezena, disp_dez);
END Contador;
That code works. My question is why, since the units are resetting when they arrive at 9, not 10, and tens are resetting when they arrive at 5, not 6.
AI: Postponed assignment semantics.
Change the units and tens to variables, which have immediate assignment semantics, and the circuit will do what you expect (instead of working).
Then change them back and learn why it works.
The reason for postponed assignment semantics is that signals, (unlike variables in both VHDL and other programming languages) are designed for inter-process communication, and thus issues of race conditions, glitches, non-determinism and even potential deadlocks are important.
Signal assignment semantics (postponed assignment) along with delta cycles, are an elegant solution to this problem, and one of the most fundamental concepts in VHDL.
Learn this thoroughly and VHDL will make much more sense and be easier to write.
Yet it doesn't seem to be very well taught.
Here's my take on it, which may help.
|
H: Can connecting of AC adaptor first into device, then into mains pose a risk of voltage spike?
Manuals of several various electronic devices I came across recommend connecting their AC adaptor first into the device, then into mains. I always thought the reverse order is safer because I thought that connecting into mains can send a voltage spike into already connected device. Are power supplies (adaptors of laptops or other electronics) designed in a way that there is no risk of harm to their device when connecting?
Are both connecting orders equally safe in these terms?
AI: Are both connecting orders equally safe in these terms?
Depending on the equipment, in some cases the answer is no, the connecting orders are not necessarily equally safe, and the order can definitely matter. There is a reason why you found that "Manuals of several various electronic devices I came across recommend connecting their AC adaptor first into the device, then into mains."
During my research some years ago, the main issue I found is the LC-induced voltage spike, generated by the combination of the inductance of a typical switch-mode PSU's output filter and the cable going to the power supply "brick" (L) and the low ESR of (especially) ceramic input capacitors in the equipment (C).
Linear Technology have AppNote 88 which explains this better than I could write in a few paragraphs - "Ceramic Input Capacitors Can Cause Overvoltage Transients".
In brief, the problem is that the already established voltage (e.g. 24 V in the Linear AppNote) is applied across an uncharged ceramic capacitor in the equipment (a simulated notebook PC power input circuit in the AppNote). In this situation, the capacitor has had no chance to (comparatively) slowly charge as the PSU voltage ramped-up, with the cable attached to the equipment, which would have happened in the "recommended" connection sequence. Instead it sees a step-change in input voltage when the PSU cable is attached. The result can be a voltage peak exceeding twice the input voltage. To quote from the AppNote:
"The input voltage transient problem is related to the powerup sequence. If the wall adapter is plugged into an AC outlet and powered up first, plugging the wall adapter output into a portable device can cause input voltage transients that could damage the DC/DC converters inside the device."
Another article with experiments which show the problem (although here they use a switch on a PCB at the end of a long cable to the PSU, rather than plugging-in a connector) is here by Pololu - "Understanding Destructive LC Voltage Spikes"
Summary - Unless there are any device-specific instructions to the contrary, it is less risky to connect the (unpowered) AC adapter first into the device, then into the mains, as you saw in those instruction manuals.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.