text stringlengths 83 79.5k |
|---|
H: Possible causes for AAA battery to explode
Today, the AAA battery in my remote control exploded. The "pop" sound is pretty loud. I've been using this remote control for years, and I'm more inclined to believe that it is the battery issue rather than the circuit issue, because if it was the circuit problem, the problem could have occurred a few years back.
From my understanding, the common reasons for an electrolyte capacitor to explode is due to high voltage over the voltage rating or connection in wrong polarity. However, I'm not sure about the reason for an AAA battery to explode. So the question is like what is stated in the title, what are the possible reasons for an AAA battery to explode?
Edit1:
@Russell, the battery connection is shown below, this should be a series connection right?
Besides, the remote control is still functional with new batteries. I took a deep breath while trying this again, the explosion isn't big, but the sound is still a little scary...
Some additional information:
What sort of battery - Alkaline, NiMH, other?
It's Alkaline - not rechargeable
How many AA batteries in remote?
Two
IR remote presumably?
There's an LED, and I have to point it to the air conditioner to use the remote, I think it's IR remote.
Brand of battery?
Energizer
Age of battery (time in use)?
It's not newly installed, my guess is a few months of usage before the explosion.
Was it recharged?
No, it isn't recharged.
AI: From the information provided it sounds either like a faulty battery or a very high current drain from the equipment - or both.
Update 1 : Having seen the most impressive photo, my prior assessment stands. This would be extremely unusual. A large amount of energy seems to have been involved. If there were 3 or more batteries in series (were there?) and one was reversed this may happen as the current would be driven through it backwards.
This strongly suggests a bad battery - possibly a counterfeit one.
Update 2:
We now know there are two batteries.
This is less than the 3 minimum needed to drive current backwards through one battery so the back discharge mode seems unlikely.
it is still possible with one well charged battery and one fully discharged.
The good battery can effectively reverse polarity charge the dead battery.
Unlikely but possible in this case.
A counterfeit battery still sounds possible.
Prior material:
IR remote controls pulse IR LEDs with short pulses of very high current - possibly an amp or more. Most batteries should either provide this or just gracefully fail to do so. A very poor quality battery or a faulty one MAY be affected by such a load.
If the IR control stayed on for some reason then a continued high current may occur. If this happens the IR LED would probably die. If your control still works with a nw battery then this is probably NOT what happened.
It is EXTREMELY unusual for an AAA cell to "explode" in use. You need to say if it was an alkaline, or NimH or ??? type cell.
Some appliances allow charging of the battery inside the equipment. If a non rechargeable battery is charged it MAY explode. This would be rare and it is unlikely your remote allowed charging.
Aspects worth considering in situations like this:
These are suggestions only - necessarily an incomplete list.
What sort of battery - Alkaline, NimH, other?
Ability to deliver high current may increase chances of "energetic" reaction.
How many AA batteries in remote?
Three batteries are required in series for reversal of one battery to cause significant reverse current flow when all batteries are in good condition. (ie one "forward" battery opposes the reversed battery and the remaining 'forward' battery supplies forward current.
IR remote presumably?
IR remotes often pulse the LEDs at very high peak current levels - far higher than in most handheld devices.
Brand of battery?
Age of battery (time in use)
Was it recharged
Was a non-rechargable battery charged? Can 'cause problems'. |
H: Can I use a potentiometer to reduce sound level in a speaker?
I want to reduce the level of sound in a speaker (i think 6Ω 30w rms). I wonder if it is that simple to put a potentiometer in one of the cables.
If this can do the trick, how do I calculate the resistance needed?
AI: That's a way, but it's better suited for eadphones, as the resistance will consume a power comparable to the speaker, so you need a fairly high power resistor.
The alternative is to use a power transistor, and then you would need only a circuit to bias it, and that can be generated also with a voltage divider, with the potentiometer.
The problem is, as Russel said, that the loudness is logarithmic with the power delivered, so you would need an exponential output from the transistor. I think that for achieving that you can use a MOSFET, that gives you an exponential transconductance (that is, for a linear increase of the input voltage, the current scales exponentially) but that's theory. |
H: Blind/buried vs. through hole vias?
I'm trying to learn PCB design and, from what I've read and seen, there appear to be three different types of vias:
Through hole - goes all the way through the board
Blind - goes from the top or bottom layer to some layer in between the top and bottom, but not all the way through
Buried - is between the top and bottom layers
It seems like most semi-complex boards I've had the opportunity to look at are 4-layer boards, and that usually one layer is dedicated to GND, another to VCC, and then the other two have traces. My question is what kind of via is most appropriate when trying to connect a pad or trace from one layer to the GND or VCC layers? I ask because I would have thought that a blind or buried via should be used, but it seems like most boards I've looked at use through hole vias and that there's just a stop around the via on the layers it's not supposed to be connected to. Is there a reason to use that method instead of using a blind or buried via?
AI: Blind and buried vias add a lot to the cost of a multi-layer board, and are only used on high-density, high-performance systems. The increase in cost is because the layers have to be drilled separately, assembled, and then the holes are plated. Blind vias are sometimes back-drilled (the unwanted plating is removed with a slightly larger drill from the back) which reduces the cost, as the layers are stacked before drilling. |
H: Is this 7805-based design correct?
I found this design on internet:
It is said to be a regulated power supply with variable DC output 5-15 V, 400 mA. My first question: Is this design around 7805 correct? I am asking because it doesn't correspond to the the 7805 datasheet:
What I miss there is R1. I expect there actually is some resistor inside 7805, so R1 is not required to let it work. But we don't know its value so we are unable to say what will be the exact output voltage when using the design on the first image. Am I right?
Then I am confused about voltages. The transformer's output on the above picture is 12V, then 2 diodes take 0.7V each, then 7805 takes another 2V. So we've got only 8.6V left for the output. My second question goes here: How can this give 15 Volt output? (15V 400mA is said to be maximum output of this design by the author.) Is it normally legal and working, does it mean that we can have any output voltage from any legal input voltage using these IC regulators?
And my third question: Isn't LM317 generally more suitable for adjustable voltage supplies of this kind than 7805? The 7805 seems to me like a LM317 with those R1 and R2 added inside. Also, LM317 has got a lower dropout voltage than 7805 and can give a higher current.
Update:
I found the following information in National Semiconductor's LM340/LM78XX datasheet:
RAISING THE OUTPUT VOLTAGE ABOVE THE INPUT VOLTAGE
Since the output of the device does not sink current, forcing
the output high can cause damage to internal low current
paths in a manner similar to that just described in the “Shorting
the Regulator Input” section.
AI: The circuit is wrong.
A 7805 can be used in an adjustable mode as per the diagram you provided - using R1 and R2, BUT it is not a good regulator to use this way as it draws substantial and variable current via its adj (ground usually) pin which leads to poor regulation. Using an LM317 in this manner is much better - it is designed to be used like this.
The DC voltage will be ~= the peak voltage = 1.414 x VRMS_AC.
(1.414 = sqrt(2))
So 12 VAC x 1.414 =~ 17V
17 - 2*x 0.7 = 15.3 volts.
The 7805 or LM317 can have 2+ volts internal drop leaving about 12.5 to 13 volts possible at the output.
Use an LM317 if possible - datasheet here.
Fig 5 in the datasheet is the same effectively as above but the reference voltage is 1.25V.
To protect against the back polarity problem that you mentioned, connect a diode from output to input (usually non conducting). If Vo > Vin then the diode will conduct and protect the regulator. |
H: Need help identifying a capacitor
I have a ceramic disc capacitor that got cooked in a power surge due to a faulty generator. The capacitor was between the fuse and transformer of a circuit board for a pellet stove.
It is RED with and though damaged, I can make out two lines of text
50L10
0933
I believe the first line its a 250volt with 10% tolerance.
But not sure how to read the 0933 because everything I found on the web talks about 2 and 3 digit codes.
Any help would be appreciated.
AI: I added your image.
Appears to be a MOV (Metal Oxide Varistor), whose job is to absorb voltage spikes and surges, which it appears to have done heroically.
You can find a whole family of similar devices here - you can choose parameters from the tables to limit the range of types of device, voltages, energy etc.
You'll find that these look suspiciously similar. From $US0.28 in ones for here.
These are examples only. Many more.
Voltage rating wanted depends on whether your system is 110 VAC or 230 VAC or other.
Typical specification table below. You care mainly about continuous AC voltage rating and peak current and/or energy handling. Peak current ratings and Joule energy handling should be as large as you want to afford. |
H: Calculating maximum wattage
If we get 220V from outlet, would it be possible to tell the maximum power (wattage)?
Since,
Power = Voltage (V) x Current (I)
Also, Is it possible to get the maximum amount from current (I) from 220V? Assuming any type of standard wire with resistance used?
AI: Assuming the wiring is up to standards then you can multiply the voltage (220V) with the current written on the circuit breaker. You will get the apparent power, measured in VA. How much real power you get depends on the device (load) you are trying to connect - a purely resistive load (like a heater or an incandescent light bulb (not entirely resistive, but close enough) then the real power will be equal to the apparent power. Otherwise you have to multiply the apparent power with the power factor.
Real power = apparent power * PF
The power factor may be written on the device or it may not. PC power supplies without PFC (Power Factor Correction) have power factor around 0.6, power supplies with PFC have power factor around 0.99. Purely resistive load has power factor of 1, purely reactive (ideal inductor or capacitor) load has power factor of 0. |
H: How do I produce a linearly chirp signal in spice?
I want to produce a chirp signal to test my PLL and found out the lock range.
There is the PWL and pwlFile as Spice commands, but I can't understand how can I produce a linear chirp like this :
This is a Matlab function I have to build such a signal and a binary chirp as well:
fmin = 0.1;
fmax = 1e7 * fmin;
numOfSamples = 5000;
f = linspace(fmin,fmax,numOfSamples);
t = 1 : numOfSamples;
w = 2 * pi * f;
x = sin(w .* t);
plot(x)
binaryChirp = floor(1 + x);
figure,plot(binaryChirp)
AI: To produce such a signal one way would be to use an arbitrary voltage source:
Syntax: Bnnn n001 n002 V = [expression]
This is a source with a function you define.
Here is an example of sweeping from 1 to 20Hz in LTSpice:
And the simulation:
I have used the time variable (defined in LTSpice as current sim time) to change the frequency (the (19 * time) part ) to keep things simple, but you can obviously use some other variable to change things (e.g. V or I of another circuit element)
Here is the netlist in case you want to cut/paste:
R1 N001 0 1k
B1 N001 0 V=sin(2 * pi * time * (1 + (19 * time)))
.tran 0 1000m 0
.backanno
.end |
H: Oscilloscope/Function Generator with GnuRadio (using very cheap hardware)
I was just getting started with RF signal processing, and I was very interested in being able to make an oscilloscope and function generator work in real time with Python. Essentially, I would like some means of:
*Creating arbitrary waveforms defined by a numpy array (or sending out individual pulses in real time)
*Reading arbitrary waveforms into a numpy array (or receiving instantaneous voltage readings in real time)
I am quite new to this field, and I want to make sure I understand exactly what gnu radio is capable of and how I might go about setting this up.
It seems that gnu-radio is meant to interface with USRP--which is definitely out of my price range at the moment. I want to have a much better idea of what I am doing before I spend more than $20 on this.
I know $20 is not a lot, but I know that I can build an oscilloscope from a $2 USB audio driver, and I can use Mathematica (which I already have) to play arbitrary waveforms through the audio jack in my computer. Radio Shack has all the electronics I need to work with that signal. I am not looking for good sampling rates or anything fancy--yet. I just want a better grasp of the field.
So is gnu radio the best way to go about making a simple oscilloscope + function generator setup?
If so, what is the cheapest hardware I would need to get something that will send/receive arbitrary waveforms?
Added - RM
NumPy:
NumPy is the fundamental package needed for scientific computing with Python. It contains among other things:
a powerful N-dimensional array object
sophisticated (broadcasting) functions
tools for integrating C/C++ and Fortran code
useful linear algebra, Fourier transform, and random number capabilities.
Besides its obvious scientific uses, NumPy can also be used as an efficient multi-dimensional container of generic data.
Arbitrary data-types can be defined.
This allows NumPy to seamlessly and speedily integrate with a wide variety of databases.
NumPy array:
GNU Radio
AI: No. GNU Radio is not the best way to go about making a simple oscilloscope + function generator setup BUT it may suit what you are trying to do, which is actually something slightly different.
If you are specifically aiming at producing real-time real-world arbitrary waveform generation and basic oscilloscope functionality where speed is not critical and you have a PC available, then there are numerous free or low cost software solutions available that directly target these capabilities, either separately or in combination. Gargoyle and friends will tell you about many of these by using search strings such as
arbitary waveforms soundcard
The above produced either directly or via linked links (examples only) the references listed at the end of this post under "OSCILLOSCOPES & FUNCTION GENERATORS:"
BUT
GNU Radio is targeted more towards RF solutions than towards what you appear to be wanting to do. It essentially attaches processing software to an ADC/DAC front end of your choice with a minimum of intervening hardware an with a software radio as the mos likely target - BUT not the only one.
As it is RF focused in original mindset the most supported hardware look suspiciously like multi MHz RF front ends and costs accordingly, BUT it does have sound card drivers and also has emulation capability allowing complete software playing with no hardware at all.
So, yes, it will do what you want.
It is Python based. Whether it uses NumPy arrays or other means of data presentation is entirely your choice.
GNU Radio oscilloscope module usrp_oscope.py
Usefully, GNU Radio has an oscilloscope module available - usrp_oscope.py - here - 350 lines of Python code.
Oscilloscope module
Basic Q & A here
User discussion here and here
An excellent introduction to what GNU Radio does (and doesn't) do is here
[http://www.gnu.org/software/gnuradio/doc/exploring-gnuradio.html]
A good overview of hardware supported here
[http://gnuradio.org/redmine/projects/gnuradio/wiki/Hardware] with mention of soundcard interfaces.
They note:
Most computers nowadays are shipped with a built-in sound interface or sound card. 16 Bit resolution at 44.1 kHz (kSPS) and two channels is a long available level that you can expect. Virtually every operating system supports this hardware out of the box, and it's sufficient for a lot of DIY and hobby applications. You can expect stereo (2 channels) input and output.
If the quality of a built in sound interfaces are not very expensively built and introduce noise or show bad frequency characteristics or degraded resolution, that is dynamic range. Fortunately, high quality sound interfaces are offered, like professional digital recording equipment, with more than a dozen channels, up to 24bit resolution and 192kHz sampling rate. These interfaces can be connected internally via PCI bus or externally via USB.
GNU Radio's own Wiki - excellent get you ging page here
"Exploring GNU Radio" by Eric Blossom - the 'father' of the GNU Radio concept here
Python writing tutorials for GNU Radio here . They say:
Welcome, GNU Radio beginners. If you are reading this tutorial, you probably already have some very basic knowledge about how GNU Radio works, what it is and what it can do - and now you want to enter this exciting world of Open Source digital signal processing (DSP) yourself.
This is a tutorial on how to write applications for GNU Radio in Python. It is no introduction to programming, software radio or signal processing, nor does it cover how to extend GNU Radio by creating new blocks or adding code to the source tree. If you have some background in the mentioned topics and are starting to work with GNU Radio, this probably is the correct tutorial for you. If you don't know what a Software Radio is or what a FIR filter does, you should probably go a few steps back and get a more solid background on signal processing theory. But don't let this discourage you - the best way to learn something is by trying it out.
Although this tutorial is designed to make your introduction to GNU Radio as easy as possible, it is not a definitive guide. In fact, I might sometimes simply not tell the real truth to make explanations easier. I might even contradict myself in later chapters. Usage of brain power is still necessary to develop GNU Radio applications.
Wikipedia / GNU Radio here
"OSCILLOSCOPES & FUNCTION GENERATORS:"
Free "Soundarb" soundcard based function generator. here
1
- SoundArb is a free program from David Sherman Engineering Co. that allows you to control a PC sound card like you would a conventional function generator. You can select standard waveforms, load arbitrary waveforms from a text wave table file, control the frequency and amplitude of the waveform, and select from a versatile set of triggering modes. With a stereo sound card, one channel can be used as a "sync" output.
Free software download here
XOSCOPE - GNU Sourceforge Oscilloscope here
xoscope is a digital oscilloscope using input from a sound card orEsounD and/or a ProbeScope/osziFOX and will soon support Bitscopehardware. Includes 8 signal displays, variable time scale, math,memory, measurements, and file save/load.
Opencircuits.com/Oscilloscope - vast range of oscilloscopes including open source hardwrae, sound card based, more. Superb. Here
Free miniscope pc oscilloscpe front end here
This offering via EDN may be free Program turns PC sound card into a function generator with softwarehere
Wikipedia provides this introduction which in turn links to
Virtins Sound Card Signal Generator 3.2. Typical lowish but note free commercial offering. Free trial . $20 ish ull version here . Many siilar availabnle. Many free.
Basic tutorial
This handbook for a commercial product but with some good related material here
DIY Verilog FPGA implementation
Instructable AWG using an AVR microcontroller. Not quite what you want but shown minimalist hardware that can be used with no PC here |
H: 12V relay circuit, converted to 5V relay, under uC control
Few questions about a little Home-Automation project I am trying.
Below is the schematic which I found in an article, slightly modified to suit the parts I have in hand --
Original had,
Q1 = BC548
Relay = 12V coil voltage
Mine has,
Q1 = BC547B
Relay = 5v coil voltage
Q1) Is that an acceptable conversion ?
Note: The BC547B has Vcbo:50V, Vceo:45V, Vebo:6V, where-as the BC548 in original circuit has Vcbo:30V, Vceo:30V, Vebo:5V, rest of the parameters being pretty same as per datasheet (hFE:220-450).
The relay is the SPDT PCB-mount kind (rated for 10A @230VAC), also called "sugar cube".
Q2) The load I am trying to drive is resistive (60W 220VAC incandescent lamp). What changes might I need if I would like to drive loads like --
Fluorescent lamp
Fan (220VAC, 60W)
1HP Water pump (220VAC, 800W) -- One thought is to use higher current rated (e.g. 30A) relay. But, I think I need to worry about EM feedback which might cause arcing and destroy the EM relay.
Q3) Right now I am making this on a veroboard (el-cheapo phenolic kinds). While I understand that this may be sufficient for the lamp/fan control, I am wondering if I need something better for higher loads, s.a. the Water-pump control ? What is the minimum gauge wire to be used for this purpose ? What kind of connectors (terminal blocks) could be used ?
AI: DO NOT USE MAINS AC ON STRIP BOARD / VEROBOARD
that your days may be long on the face of the land.
This is in fact doable with reasonable safety with proper care.
BUT learning what "proper" means in this context is something best arrived at by some years of general experience. Destruction of equipment and / or life is easily achieved by applying AC mains to stuff and to people and it should not be dealt with lightly, ever.
Wire the mains wiring to the relay contacts directly using appropriate connectors or hard soldering as appropriate.l If the relay is mounted on the veroboard, leave largish full holes in the veroboard around the contacts ad ALWAYS provide means of preventing user or other contact with live mains.
Note that I said above IF the relay is mounted on the veroboard,...".
I do not and did not recommend it.
That was just for people who like to ignore good advice and to live dangerously. Better not to do it till you have lived longer and prospered somewhat. As you know, wax on wings tends to melt when flying too close to sunwards and mains shocks can be as lethal.
If you MUST do this
(1) use high temperature wings when flying close to sun - TEFLON may help.
(2) 8mm / 0.33 inch gaps all round MINIMUM between contact and anything else on board.
A GAP is a hole with air in it !!!!
Veroboard and similar = Phenolic board = PAPER plus a resin.
Relying on paper board to not track, carbonise, absorb moisture or make deals with Murphy
is placing your life at risk.
Or somebody else's.
Leaving an AIR gap is the equivalent to an 8mm creepage distance which is what most regulatory authorities prescribe in similar cases
Leaving 8mm of Veroboard as an AC mains barrier is like tossing a coin 10 times and calling heads. You will probably get at least one head and would be surprised when you didn't.
The difference is, with a coin you have a silly look on your face when you fail, whereas with AC mains you may end up with a silly look on your dead face.
(Q1) Your driver is good EXCEPT
The base drive resistor is far too low. ee below.
they have used a very non standard and confusing symbol for the output contacts. I assume this is a SPDT = sngle pole double throw (= single changeover ) contact with isolation between output circuit and 5V.
The transistor may or may not be OK depending on coil current - see below.
You do not specify the coil current, but say it is 200 mA.
Icollector = Icoil = 200 mA
Ibase >> to > Icollector/Beta = 200 mA / 200 = 1 mA
I base = (Vdrive - Vbe) / Rbase or
Rbase = (Vdrive - Vbe ) / Ibase.
For Vdrive = 5V,
Rbase = (5-0.7) / 0.001 = 4300 ohms.
A resistor that gives substantially more than 1 mA is desirable 9allows beta to be low etc). So R1 = 1k = 1000 ohms would be fine.
Even with say 3V drive.
Ib = (Vdrive - Vbe)/R1 = (3-0.7)/1000 = 2.3 mA.
With a Beta of 200 Icmax = beta x Ib = 200 x 2.3 = 460 mA.
If relay current < 200 mA then 1K is stioll good.
If relay current is higher the value of R1 MAY need adjusting - probably not.
(Q2) Your basic circuit is good for load power at any sensible level, subject to suitable coil drive power AND possibly some sort of snubbing of the contacts.
The relay or contactor has to have contacts rated for the load carried - which will be in the relevant datasheet.
A "snubber" is a circuit designed to absorb transient AC energy which may othewise cause contact arcing when the contacts open. It usually consists of a series C and R such that the C limits the current to a low value in the R under normal conditions but when high voltage and/or high frequency transients occur the R current and dissipation increase and absorb the transient energy.
There have been various other stack exchange questions re snubbers eg
here & here & here & here
and there is lots of on-web resources eg
Wikipedia
Good intro
Good. Slightly more complex
Good - with online calculator
Non dissipative version (from above link)
and manufacturer of relays etc will often specify what is needed for their product with a given load.
[Q3} Wire size. Terminal block size.
Too general for easy answer.
Many wire tables are available re current/gauge.
"As thick as you can sensibly handle with no great effort" is usually enough.
Occasionally you need thick enough to be hard or annoying, but that is usually at low voltage, not at mains voltages.
Transistor selection:
The BC547b is rated at only 100 mA Ic. Datasheet here
This may be OK BUT a much better transistor is available which is often as cheap and sometimes cheaper.
This is the BC337 (NPN). BC327 (PNP). Also availabl in SOT23 SMD as BC817/BC807. I use these as my standard "jellybean" transistors. They will meet almost any need that you'd sensibly use them for, and in most cases a better transistor is not available without paying a lot more.
These are available in several beta ranges. I always buy the highest beta bin range = BC337-40 which has beta in the range 250 - 600 with mean of 400.
BC337-40 etc 800 mA*, 50V.
(* rated current varies with supplier 600 - 800 mA typical). 800 mA in datasheet cited).
Digikey has them at $US0.14 / 100 here
Keep watch a you will sometimes ee them for far less - maybe under 5 cents in 100's.
BC337 datasheet
Creepage / Mains clearance
Phenolic PCB has its specialist uses but really really should be avoided for most purposes. The savings in cost are not vast compared to eg FR4 fibreglass. Phenolics main advantages are cost (minor gain) and "punchability". It is amenable to having holes or slots etc cut by punching tather than drilling or routing. In general use it is a nasty PCB material. It break and shatters. It risks breakdown. It is not fire or moisture proof. Caveat emptor!
Excellent creepage & clearance page here
Excellent TI power supply safety design paper here - Image from this shown below.
Excellent creepage & celarance page here.
Note they say:
When designing a switch-mode power supply for use in information technology (IT) equipment, a typical rule of thumb is to allow an 8-mm creepage distance between primary and secondary circuits, and a 4-mm distance between primary and ground. If these dimensions are allowed for during the design stage, there is a high probability (95%) that no failure will occur with respect to creepage or clearance when the final product is submitted for test.
All the above are liable to lead you to conclude that my advice was too conservative and that you can use lower limits with Vero board. It wasn't. You can't with any safety. |
H: How to transmit high current (2.6A) with low voltage (1.2V) for a long distance?
I want to supply a DSP with 1.2V. This DSP needs 2.6 Amps of current at full load. The minimum supply based on the electrical specs of this DSP is 1.16V, which means that the maximum voltage drop caused by power planes, traces and connectors should not exceed 40 mV.
In my case, I found it very hard to achieve this since the distance between power source and DSP is about 8000 Mil (~ 20 cm) and this supply passes by two connectors which add 100 mOhms, so the drop is 260 mV (100m x 2.6A) without counting in planes impedance. I drew a simple schematic for my case shown in the next image:
My questions are:
Is the total distance only 20 cm? or should I add the return so that the actual distance is 40 cm ? ( Much worse :( )
How can I solve this issue? knowing that the distance between source and DSP can't be less than 20 cm. Should I add another regulator beside the DSP? or is it better to generate a slightly larger voltage to compensate this drop? (there is other components the need 1.2V supply and are at different distances from the DSP).
How can I calculate the plane impedance, shown in the above image as R(Plane)?
# Edit 1:
Regarding point 1, ok, the total distance now is unfortunately 40 cm.
I thought of a solution to reduce the connectors resistance, which are the main factor of high resistance. According to connectors data sheet, the resistance of the pin is 25 mOhms, I have extra free pins, so I'll use 8 Pins to transmit the 1.2V so that the is now divided by 8, but the question now is, I don't know if this resistance is for the pin only or is it the total after mating? and after mating should they be treated as series or parallel resistors?
AI: In general, trying to push final regulated power any distance is not a good idea. In your case it clearly won't work. Yes, the return path adds to the total resistance since it is in series with the load. It is strange that you have connectors in the positive supply but not in the ground. If this is a fixed installation, then why not solder wires from one end to the other?
A better way to deal with the need for distributed regulated power, especially at low voltage and high currents as you have, is to distribute a higher roughly regulated voltage and make the final tightly regulated voltage locally. This does two useful things:
The drop in distributing the higher voltage won't matter since is will be regulated anyway to the final voltage. You do have to make sure the voltage at the other is at least the minimum required for that regulator to work correctly, but that headroom is usually easy to build in.
In the case of local regulators being switchers, the higher voltage will have less current, which means it will also have less voltage drop accross the distance, with less power wasted and heat that must be dealt with.
So where does your 1.2V supply come from? You probably have some higher voltage with a buck converter somewhere. Send that higher voltage over the distance and put a buck regulator right at the DSP. Note that this relaxes the requirements on the 1.2V supply on the main board. Two smaller buck regulators will still be more expensive than one larger one, but allowing both to be smaller will help somewhat. It also distributes the heat from any losses, which usually makes that easier to deal with.
Added in response to your comment:
If you really really can't put a local regulator by the load, then the next best thing is to have a sense line coming back. This line reports that actual voltage at the far end back to the regulator on the main board. This voltage is used as feedback so that the voltage at the far end is what is regulated. The voltage at the regulator then will automatically be higher as needed to overcome the voltage drop on the way to the load. The sense line doesn't experience these voltage drops since it has very little current flowing thru it. It is just a voltage feedback signal.
If the ground connection also can have significant voltage drop, then it gets more tricky. Sometimes you use two sense lines and treat them differentially at the power supply. Sometimes you assume the forward and backward voltage drops will be about equal and add a little bit of gain in the sense circuit. Sometimes you just set the output of the supply a little higher to compensate for the nominal total voltage drop and not try to actively regulate around it at all. |
H: How does electrical devices consume power?
I'm curious to know how does an electrical device can consume any amount of power it is required? Suppose the voltage here is 220V. How can you get any amount of electrical power say. 1000 watts out of it? Please tell me what I'm misunderstanding.
AI: The power line may be supplying a fixed voltage, like 220V, but how much current the device draws is up to the device. Power is voltage times current, so you can see how the device determines the power by determining the current.
For exmaple, in order to take 1 kW from a 220V line, a device would have to draw 1kW / 220V = 4.5A. If this were purely a resistor, it would be 220V / 4.5A = 48Ω. A 24 Ω resistor would take twice that power (2 kW), and a 96 Ω resistor half that (500 W). All these can be connected at the same time to the same 220 V line and each will still take the power calculated above.
At some upper limit, the 220 V line can't supply more current. At that point something has to give, like the voltage sag. In houses, a fuse will blow or a breaker pop before there is any significant sag. |
H: RC Circuit with Multiple Capacitors
I have been working on this problem and it is driving me absolutely crazy. The questions is asking for Vo for time greater than or equal to 0. I have successfully redrawn the circuit (shown below) to represent steady state or t = (0-). This gives me an initial value at Vo of 12 volts. However, I cannot come up with a set of equations after the switch is open.
I feel like Nodal Analysis should work in this situation but I keep ending up with 2 equations and 4 unknowns. For example:
1: (Vo - Vx)/20k + C1(dVo/dt) = 0
2: (Vx - Vo)/20k - C1(dVo/dt) + Vx/40k + C2(dVx/dt) = 0
No matter how I approach the problem I end up with a differential from the other capacitor! I have no clue how to approach this problem. In addition to the madness I am not sure if my C1 is correct in equation 2.
Can someone please help me or give me some direction on how to solve the natural response of the circuit below (The third image)? Thanks for reading.
AI: It seems like you're making a simple thing complicated. You are right about the steady state and therefore the t=0 condition. For that you ignore the capactitors and you have a simple resistor divider.
Note that after t=0 you have two capacitors discharging accross resistors. Each does so independently with its own resistor. From basic R-C circuits you know that each will be a exponential decay assymptotically approaching 0 with a time constant of R*C. You simply have two of these added together. The two R-C circuits don't interact since there is no current flowing between them, only within them. So you're answer is just the sum of two exponential decays. Yes, it really is that simple. |
H: Why does a cold solder joint appear grainy or dull?
A good solder connection is shiny, and we're taught that dull solder indicates a cold solder joint. Why is this?
AI: Sometimes you can see a difference in the appearance of the metal of a bad solder joint. I think this is due to something having gone wrong as the solder was solidifying, like one part of the joint was moved with respsect to another.
It seems to me though that the majority of bad solder joints don't look different on the surface of the solder. If there is a visual clue, it's usually that the solder didn't wick into the joint properly. It will look a little beaded up instead of having formed a nice miniscus with the edges having flowed along the metal of the joint.
Another point is that good solder joints don't actually look nice and shiny. The solder will look shiny when molten, but develops a slightly dull finish upon cooling.
All in all, I think what you are referring to is more superstition than fact. |
H: Silicon Controlled Switches: applications&suppliers
I came across this description of what are called "silicon controlled switches." I always look to balance n/p-channel electronics for stability, and using these silicon controlled switches seemed like the perfect way to do so. However suppliers seem few and far between, and the few products I could find were >=$50 a piece!
I could find very little information on these devices online, so I am wondering what technological niche they fill, and if anyone sells them at a reasonable price--i.e. on the order of the price of the components an equivalent circuit made out of regular transistors. If not, why are they so expensive?
I am beginning to suspect that they are more commonly known/sold under a different name.
AI: An SCS is a specialist device that is now seldom available. The equivalent circuit is shown in the page that Feynman referenced. It's main claim to fame is that it is a TRIAC like device that can be driven off in the middle of a conduction cycle using gate drive alone, unlike a TRIAC.
A TRIAC or SCR can be driven off mid conduction by interposing an inductive reverse conduction inducing current spike, but that is unusual* and cheating, as conduction is stopped by stopping conduction.
A number of high power camera flashes use this method to terminate flash cycles.
You can buy an SCS here for $US17.50/25. Given that it is a 1400 Volt x 112 Amp device the price is "not bad". Datasheet here.
An SCS (Silicon Controlled Switch) is a device whose time has largely passed. It lingers on in very high voltage high current niche applications but would almost certainly not be used for new work.
An equivalent functionality can be provided by using 2 x MOSFETS (2 x P or 2 x N channel) connected in series with sources connected and gates connected (!!!).
You thus get a module where the current path is
---[DS]-[SD]--
Driving the 2 connected gates +ve relative to the two connected sources (for an N channel pair) turns the pair on and connecting the two connected gates to the two connected sources turns the pair off. this then is a true bilateral (bidirectional, 4 quadrant) swith - about the most flexible switching device available. Even better than an SCS if you can but an SCS :-).
To equal the above SCS you could use two of something like the IXYS MOSFET (same brand as the SCS) IXTY06N120P 1200V 90A MOSFET priced at $2.79/25 at Digikey but not in stock. It's a TO252 package which is capable but which may get "somewhat stretched" [tm] at those power levels.
In most cases a more normal topology MOSFET or TRIAC solution will do whatever job you have well enough.
There is little that you cannot do with an H-Bridge :-).
http://search.digikey.com/us/en/products/IXTY06N120P/IXTY06N120P-ND/2117410 |
H: Write back buffer in lpc
I was reading the Lpc2148 Manual and in the Static Ram section I came across
Write back buffer
The SRAM controller incorporates a write-back buffer in order to prevent CPU stalls
during back-to-back writes. The write-back buffer always holds the last data sent by
software to the SRAM. This data is only written to the SRAM when another write is
requested by software.(the data is only written to the SRAM when software does another
write). If a chip reset occurs, actual SRAM contents will not reflect the most recent write
request (i.e. after a "warm" chip reset, the SRAM does not reflect the last write operation).
Any software that checks SRAM contents after reset must take this into account. Two
identical writes to a location guarantee that the data will be present after a Reset.
What does it mean. and what did he mean by CPU stalls and back to back writes
AI: The write-back mechanism is a method usually used to guarantee the consistency of the data in memories in a multi-agent system (multi-core systems but also with DMAC - controller of hard disks - for instance). In this case is meant to avoid writing data in the RAM in case it's required in short time from the CPU.
It means that the data is not immediately written to the memory, but held in a register until anyone requests it. It's the alternative to the write-through policy, in which every time a write-to-RAM instruction is called for data, it's written directly to the RAM.
It prevents CPU stalls (that are clock cycles in which the CPU is waiting) because the result of the instruction is saved in the register for future access, and it's written to the memory only if needed (another "write" instruction requesting the buffer, that has to be emptied); so you don't need to save into (and load from) RAM a value that is requested in the next instruction.
In this way the content of the RAM is not always up-to-date, so it shows a trick to guarantee that a certain data is written before a reset. |
H: Why does fuse blow up sometimes?
Sometimes once in a year, either one of main fuses or a fuse in room blow up due to something. What is the cause of this? Why do we even use fuses? Is it because the voltage doesn't stay at 220V all the time?
AI: IMPORTANT:
It is far far better that a fuse sometimes blows when there was no need for it to, than for it to sometimes fail to blow when a fault condition exists.
Blowing a fuse. The term "blow" will be used here for the fusing of a fuse - the act of melting the fuse wire and breaking the electrical circuit. Terms such as "it blew a fuse" and "why did the fuse blow?" are common here. The term "blow" in this context may be less common in some countries. Using "fuse" which is correct, as in "the fuse fused", is liable to be too confusing :-).
Why do they blow?
Should they?
The purpose of a fuse is to protect equipment and wiring against the damaging effects of electrical faults which cause excess currents, and to disable equipment which is faulty. The fuse "blows" when the current carried exceeds the rated value for an excessive time. The higher the overload the shorter the period before the fuse blows. So, equipment which is meant to "draw" 10 amps but which has a short from phase to ground, so it draws, say, 100 amps, will blow its fuse in milliseconds. But, a piece of equipment which draws say double the fuse's rated value, may take many seconds to melt the fusewire and to blow the fuse. The ratio between trip times(time to blow) and "overload to rated current ratio" vary with fuse design and can to some extent be controlled by the manufacturer. This is a complete subject in its own right, but assume that a fuse will blow "after a while" at 2 x + overload and will blow almost immediately with say 10 x + overload.
A piece of wire can only be so smart ...
Because a somewhat complex task is being carried out by a deceptively simple piece of equipment (ie a piece of wire) and because the fuse is not always optimally dimensioned for the equipment used, the fuse sometimes "blows" when there is no significant or long term fault condition present.
To blow or not to blow ? - that is the question.
Dimensioning & surges.
Assume that a fuse will blow "after a while" at 2 x its rated value then we can expect it to run indefinitely at its rated value.
If we have a household circuit rate at 20 amps and a number of outlets rated at say 10A then it is possible to connect more load that the rated fuse value. If we connect say a 10A fan heater, a 5 amp one bar radiator (maybe in the next room), a 400 Watt plasma TV (about 2A), and some plug in mood lighting at say 1 A or less then all SHOULD be well. 10+5+2+1 = 18A. If somebody then turns on an electric jug rated at say 8A current rises to 26A. More than the 20A nominal value but less than the 2 x 20A = 40A we have said it will blow at. But if the plasma TV is off and is turned on suddenly the power supply input filters amy present a nearly pure capacitive load to the mains. The mains will be at random phase at TV turnon and usually a current spike will cause no problems. But on some random lucky (or unlucky) day the mains may be at the very peak of the mains cycle at turn on. The capacitor may have stored charge of opposite polarity from last turnoff leading to an even greater current spike. Add a possibly high mains voltage (as happens) and some heavy switching spikes from a nearby factory, or even domestic equipment (treadmill, welder, drill, sander, router, planer ...) Then load + capacitor spike + high mains + switching transient may lead to a very high short term load. And the fuse may decide enough is enough and melt. Or may not.
*Unlikely?*Is all the above likely to happen at once?
No. But as reported, the nuisance blowing happens only a few times a year. Ij the order of what is expected.
We could make the fuse rating higher (more amps)!
Yes. That is one solution. But the ability to react to moderate overloads is lost. Along with lack of protection may go loss of insurance, if the insurance loss assessors find a still intact 2 x 20A wire fuse in the smouldering ruins of your workshop. |
H: Why do rechargeable batteries have no short-curcuit protection?
Whenever I read a user manual to a device that runs off a rechargeable battery - like a cell phone or a power driver - the manual will always say I should store and handle the battery in such way that its terminals are not shorted by any objects like a paper clip or a screwdriver or any other stuff I might have in my pocket or bag. The warning further says shorting may lead to a battery exploding.
Why won't batteries have circuitry that addresses shorting and makes it less dangerous?
AI: There are two main types of rechargeable batteries - Lithium Ion and its children (such as LiPo) and the rest.
LiIon cells MUST ALWAYS have protection electronics and the vast majority do have. If abused or, sometimes, just because it wants to, a LiIon cell will reduce both itself and the equipment it is in to a flaming heap.
LiIon "Vent with flame" ... - spontaneous "uncaused" laptop self dismantlement because (even) Sony could not get it right.
The no-name brand can't always either ;-) ...
All other types can cause serious damage when shorted but are not usually prone to explosive self dismantlement. Short-circuiting may cause dangerously high thermal energy dissipation and may damage the cells permanently, but will generally not cause a run-away reaction.
LiIon (Lithium Ion) is a "slow release bomb" waiting to happen. A LiIon battery may be able to be persuaded to "vent with flame" (Gargoyle knows) by charging too fast, charging to excessive voltage, heavy discharge, spike penetration or heavy knock, charging at normal rate when voltage is low, charging at all when voltage is very low.
Protection devices for LiIon calls are the norm. These usually mount INSIDE the battery casing so their presence is not obvious. LiIon cells should ALWAYS use such devices. Most manufacturers will not sell LiIon cells without internal protection devices. Some will.
LiIon cells under fault conditions undergo heavy self discharge at a point which produces Hydrogen gas and first molten and then gaseous lithium metal. Temperatures rapidly rise to the ignition point "and away it goes". Once started the reaction usually runs to completion. Water is welcomed as an additional reactant by the Lithium metal.
Lithium ion safety
Lead Acid, NimH. NiCd, NiFe, LiFePO4 ...
can all do significant thermal damage and will probably damage the cells if you short them and leave them shorted. BUT they usually do not explode and are not usually known to self incinerate.
I have never seen any of these batteries fitted with internal protection.
Note that LiFePO4 = Lithium Ferro phosphate, is in that list. A LiFePO4 cell is about as safe as they come. You can drive a silver spike through its heart, if you must. It will not thank you, but also will not self dismantle. Very briefly, the reason is that the Li metal is held in a spinel structure in the cell proper and does not migrate physically when the going gets exciting.
A lead acid "car battery" will melt about anything metallic that you place across its terminals. This would include eg large crescent wrenches. If you got badly hurt by bits of molten wrench you should not be surprised. The battery would probably never be the same again, but will probably not melt down. You CAN literally explode a lead acid battery by igniting hydrogen generated during charging, but that is a separate issue.
Add say 6 x AA Nimh 2000+ mAh cells, various coins and some keys to a trouser pocket and go about your business. On occasion you will get a short via coins and keys and misc cells so hot that skin burns could result and fire would not be a surprise. If you manage to do this you are an idiot! I've done it two or three times :-). Not again, I think!!!
NiCd about as for Nimh. More robust against shorts probably.
A fully charged 2000+ mAh AA Nimh will provide 10+ amps into a hard short. |
H: Driving LEDs with 74HC540 or 74HC541?
I have some LEDs (not the high power type) being driven by a 74HC541, one LED per output, with no other load. I've noticed a tendency for people to use the 74HC540 instead (inverting buffer). I've gone through the datasheets and both ICs can sink or source 25mA per output pin (which is fine).
There are obviously four permutations here: inverting/non-inverting, with LEDs connected to Vcc or Ground. It looks to me like these permutations are pairwise equivalent.
Other than for logic reasons, why would you choose an inverting buffer over a non-inverting one, or vice versa?
AI: If you intend to run the LED from the same supply as the logic gate, and that gate can source and sink symmetrically, then it doesn't matter. Even though a logic gate may be rated for the same source and sink current, it is still possible that the low side driver has a little lower resistance. The total Vdd and Vss currents the device is rated for may also not be symmetric, even if individual pins are.
In general, it is more likely that low side drivers have a little less resistance and that the total Vss current rating is a little higher. Also, using the low side driver works with open drain outputs. This is why people are used to wiring LEDs between the output and Vdd. This means you want a inversion in there for a logic high to cause the LED to light. Of course if this is all coming from a microcontroller, which it almost always is these days, then digital signal polarity is irrelevant since it can be handled in the firmware either way.
As long as you are not violating any spec in the datasheet, go ahead and wire up the LED whatever way is most convenient for you. You could let the final board routing decide. |
H: Are there any Analog FPGAs?
As I understand it FPGAs are flexible "digital" circuits, that let you design and build and rebuild a digital circuit.
It might sound naive or silly but I was wondering if there are FPGAs or other "flexible" technologies that also make analog components available to the designer, like amplifiers, or A/D or D/A or transceivers or even more simple components?
AI: I've used a product line called the Electronically Programmable Analog Circuit (EPAC), probably more than ten years ago by now, which claimed to be the analog equivalent of an FPGA, and Cypress has for years produced a line called the PSoC (Programmable System On Chip) which incorporates a switchable arrays of both analog and digital circuitry. Note that in both cases the devices have a moderately small number of functional blocks (3 to 24 or so in the case of the PSoC) with somewhat limited routing options, rather than providing hundreds or thousands of blocks with enough interconnects to allow essentially arbitrary routing.
One reason that analog FPGA's don't offer anywhere near the design flexibility of digital devices is that even if one passes a digital signal through dozens or hundreds of levels of routing and logic circuitry, each of which has a 10dB signal-to-noise ratio (SNR), meaning there's 1/3 as much noise as signal, the resulting signal can be clean. By contrast, getting a clean signal from an analog device requires that every stage the signal goes through must be clean. The more complex the routing, the more difficult it is to avoid picking up stray signals.
In applications that aren't too demanding, having a small amount of analog circuitry combined into a chip can be useful. For example, I've designed a music box which uses a PSoC to drive a piezo speaker directly; the PSoC includes a DAC, a fourth-order low-pass filter, and output amplifier. It wouldn't have been hard to use a separate chip to do the filtering and amplification, but using the PSoC avoided the need for an extra chip. |
H: Why can this 7-segment LED show 2 colors?
I have a 3-digit, 7-segment+decimal display I bought from an ebay store. I believe it is a hi-eff red one, and the seller provided this link to the data sheet. A search found this data sheet which is more complete and seems to describe the part better, though bottom line - I don't know exactly which part I have. The part has "C403E (1) T0831 RoHS" printed on one edge.
I checked each segment as I wired them on a breadboard, and when I inadvertently powered one without its resistor, surprise! It glowed green - not overly bright, and didn't burn out. I repeated this with, and without its resistor; with a resistor it's red, without one, it's green.
Anyone know why / how this could happen? Every bi-color, common cathode part I've been able to find has two anodes per segment. This one has only one.
AI: Many red and orange leds looks green when powered beyond their current limit, and some of them lasts for minutes. But every one of them finally change from a LED to a SED (where the S stands for SMOKE :-) ) |
H: Which relay switches can be activated by the parallel port?
I'm planning on controlling some external circuits using the parallel port by switching on relays that can switch on the external circuits.
Am I right in thinking the pins have a voltage of 3-5V when high and a maximum current of 50mA? The most sensitive relays I can find require 5V and 1A (eg, http://www.maplin.co.uk/dpdt-1a-miniature-relay-37494)
AI: No, that's the maximum current. The coil resistance is 180 Ohms at 5 V -> 28 mA.
Edit: And if you want to switch at 3 V, find a different relay. This one isn't specified at other than 5 and 12 V. |
H: Are I/O pin internal resistances equal to the Thevenin resistance?
I'm trying to find the Thevenin resistance of an I/O pin for the ATmega644. I see on the datasheet that there is a 20-50 kohm range of internal pull-up resistance. So with that, I can create a circuit modeled thus (ignore all values):
The voltage source is from the GND and I/O pin and the resistor in the diagram is the pull-up resistor. I only care about this pin when it is HIGH so I am assuming that the Veq=Vcc. Thus Req is the pullup resistance when high.
Am I missing something here? I'm looking for the output Thevenin resistance.
AI: The information you gave specifies the Thevenin equivalent when the pin is configured as an input. Veq will be the same as Vcc and Req will be the pull-up resistance from the datasheet. The input capacitance might also be important, depending how you use the input.
When you configure the pin as an output, the equivalent circuit will change. Req will be much lower. Veq will depend on whether the output value is high or low (and Req probably depends also).
When calculating the Thevenin equivalent circuit, its good to remember that Veq is the open-circuit output voltage; and Req is given by Veq/Iss, where Iss is the short-circuit output current.
Edit
Microcontroller data sheets don't always give you everything you need to know to answer your question. Here's the closest thing to relevant lines from your datasheet (p. 316):
This says that with a 5 V supply, if the load is 20 mA or less (the negative sign indicates current going out of the pin) the high level voltage will be at least 4.2 V. You can guess that the open-circuit output voltage will be very close to 5 V (or you can measure it on a demo board to be sure). That implies the Req is no higher than (5.0 - 4.2) / 0.020 = 40 Ohms.
In any case, these estimates are all very rough. They all depend on the assumption that the output driver has linear characteristics. In reality, the behavior is likely to have substantial nonlinearities, so its better to design using the specs that are guaranteed in the datasheet, rather than make guesses about Thevenin equivalent circuits.
For example, if you design your LED load to draw less than 20 mA, you know that you'll get at least 4.2 V out of the output pin. That should be enough to choose your LED current limiting resistor, or tell you that you need an external transistor buffer to drive your LED.
Also, be sure to check Note 3 after the quoted table in the datasheet where it gives some limits for total I/O current in case you are driving multiple LEDs from different pins. |
H: NE555 load resistor?
I'm using 555 timer in astable mode. I've used Multisim to generate it ant this is what I've got:
I'm little confised by the 100 ohms Rl resistor. Do I need it there ? If I do, why ? I've tried with and without it, and it works for me both ways ... I'm using the 555 to drive another CMOS IC input.
Thanks
AI: The 100 ohm is A load - an example - what load you really use is up to you.
If you are driving a CMOS IC you do not need anything else connected to the OUT pin.
The 555 has a "push pull" or bipolar output stage. This means that it drives "actively" both high and low, so you get an output voltage whether there is a load connected or not.
The 555 load is generally connected to the OUT pin when you want a square wave output. There are other places you can connect to if you are doing less usual things.
LM555 / NE555 / xx555 datasheet - Fairchild
LM555 / NE555 / xx555 datasheet - NatSemi
Active low and high drive can be seen here:
More normal block diagram view. Here you cannot tell that the output pin is actively driven high and low. |
H: DC supply for control circuit of a DC-DC converter?
I have a switch mode DC-DC converter assignment which is supposed to convert 36-72V input DC voltage to 9V DC voltage. The circuit I'm working on contains a control circuit (implemented with a custom and multipurpose microcontroller) which requires 5V DC supply (and drains 55mA current from it) to run.
I feel myself in a paradox; a DC-DC converter is needed to run a DC-DC converter. How do I simply obtain a 5V supply for the control circuit? How do other practical and commercial circuits do this?
Since the input voltage can be up to 72V, I can't use a 7805 directly. Is there any way of using it by making a puzzle-like connection out of it, or cascading two 7805 in a smart way? Also, I can't convert the 9V DC at the output to 5V, because in my design, without the control circuit creating PWM signal, the output voltage will be 0V.
I'm working on a scientific assignment in which I can only use the most simplistic semiconductor devices, like (BJTs, MOSFETs, 78xx, etc). So, please don't offer me using a high level IC for this purpose.
AI: A common approach is to make a low power supply which will start the microcontroller and which is then either
disabled when the main circuit starts. Or,
the low power circuit may be low enough power to be left running.
The arrangement below shows how this can be done using a very minor modification to @Pentium100 's circuit. The load in his circuit is R2. I've left R2 in place but it now serves as a very light nominal load when no power is being drawn by the microcontroller.
If you supply the microcontroller via a diode from the emitter of Q, then, if you subsequently supply the load from a slightly higher voltage, the low power circuit will supply no power as the diode will be reversed bias.
eg Say you microcontroller will operate with 3V < Vdd < 5V.
If you arrange for the emitter of Q to be at 4V then the output end of the diode will be a diode voltage drop below Q1 emitter.
A diode drop is typically about 0.6V so the microcontroller will see about 4V-0.6V = about 3.4V. So the microcontroller has Vdd =~3.4V Vdd to start up with.
BUT if you then feed 5V to Vdd the diode will be reverse biased and supply no power.
The only power then drawn by the low power circuit is the power fed to DZ1 by R1. This could be say 0.1 mA for a power dissipation of V x I = 72 V x 0.0001A = 7 mW. Even at 1 mA its only 72 mW.
Super rough also borrowed diagram ...
Upper uode is part of the buck regulator feed - may or may not actually use a diode in the location shown but this gives the general idea.
The above diagram is modified from one found here. An interesting and useful page but only somewhat related to this topic. |
H: Xbee Shield - Turning jumper settings into ON/OFF (XBEE/USB) manual switch
I have the following Xbee Shield where I need to constantly switch jumpers in order to allow Xbee communication and/or USB communication.
The following is set for Xbee communication:
"Xbee Communication"
The following is set for USB communication:
"USB Communication"
The following is without jumpers (which also acts as USB communication as well):
"Without (also USB)"
As my Arduino and Xbee Shield are going to sit inside an enclosure with screws and my USB port being quickly available to plug a USB cord into I'd like to attach an ON/OFF switch that acts as XBEE/USB rather than have to unscrew it and manually shift the jumpers into the correct places. I'm not quire sure how to wire up a switch to do this.
Looking from a birds eye view. If the pins are as follows:
(1) (2) (3)
(4) (5) (6)
Considering that without any jumpers attached, it acts as USB communication. Am I then safe to assume that hooking up a switch like the following is going to be easy?
Any help is greatly appreciated.
AI: Of course it's possible!
You just need a 3-pin switch that maps exactly the pins of the jumpers, and that commutes from the right to the left pin.
These are some examples...
Then, to connect it I would suggest to use a connector, so you can always come back to the jumpers way, but this way you usually can't disable both...there are also 3-positions switches that allow also to leave the contacts open.
UPDATE: I don't understand well the part with numbers; you need to keep the 2 jumpers separate, so you can use 2 switches and try to mechanically switch them simultaneously, or maybe you can find a switch that can simultaneously command 2 channels... |
H: Sequential Circuits
I'm learning about sequential circuits, and it's driving me crazy. How can you use an output as input, what was it's value at time 0? It can't go on forever...
AI: Generally, its input at time 0 is arbitrary unless a reset circuit of some kind forces it. You either have to have such a reset circuit, or your design has to work regardless of the input at time 0. |
H: Need help with board / components recommendation
I'm trying to make a self-contained graphic playing system, and would like to have components or full PCBs suggestions. What I need is:
Output to a small color LCD. Like 3 inches, 65K color, 640x480 for example. No touch screen. Can be smaller if that helps, but at least 2 inches and enough resolution for decent pictures.
2D video frame buffer able to handle at least 30fps
Programmable via a graphics library if possible (i.e. SDL)
Very low power: able to stay powered by a cellphone battery for at least 10 hours (including the LCD!). The battery will be charged by a small solar panel during the day.
Enough memory for a few images + code to move them around.
As cheap as possible of course! :) Planning to buy in batches of 50 or so.
Desirable but not completely needed:
Webcam input and being able to do simple tracking with openFrameworks or similar
Video playing capabilities
Auto power on when it has enough current.
I need to know if making such a system at home with available off-the-shelf components is possible, and if so, suggestions about which chip(s) / fully assembled PCB would do the task, as well as which screen should I get.
This won't be a handheld / portable system so space is not an issue, but low power is.
AI: Yes. It's doable.
You do need to say what you'd like it to cost (acceptable/target/dream)..
But by far the best way of doing it is to either remove or disable power consuming features from a smartphone or one of the many low cost Asian "pocket PCs" that have screen size from about 3" to 8".
Or, one of the many entry level Linux capable single board systems ("Gooseberry Pie" style (yes I know).)
Output to a small color LCD. Like 3 inches, 65K color, 640x480 for example. No touch screen. Can be smaller if that helps, but at least 2 inches and enough resolution for decent pictures.
Buy module. Connect drive. Done
2D video frame buffer able to handle at least 30fps
Programmable via a graphics library if possible (i.e. SDL)
Smartphone, ... . Yes.
Very low power: able to stay powered by a cellphone battery for at least 10 hours (including the LCD!). The battery will be charged by a small solar panel during the day.
Deep-ends on what you want to run. If you ant video live all day long you will need to look very carefully at power budget.
Take iPhone 3 as "cellphone battery". About 1300 mAh. 10 hours = 130 mA at 3.6V nominal ~= 470 mW. Say 400 to 500 mW. Backlight is out (50-100 mW per LED) except for short periods if essential.
Best way to see what can be done is to look at the state of the art consumer products. Most modern DSLRs have an LCD on the back of about the size and capability of what you describe.
Sony are amongst the market leaders. As of August 2011 here is their latest offering.
Sony White Magic 3" VGA LCD display
claimed to reduce power consumption by about 50% over previous devices. VGA RGBW, 3",
225 mW low power mode 470 cd/m^2 with 125 mW backlight
400 mW outdoor mode 1000 Cd/m^2 with 300 mW backlight.
SO Sony say 225 mW is indoor mode at 50% previous suggesting 400 mW+ previously.
That's with backlight - if you can get it backlight free it's easier.
Note in the above specs the display proper draws 100 mW.
Enough memory for a few images + code to move them around.
Webcam input and being able to do simple tracking with openFrameworks or similar
Video playing capabilities
Auto power on when it has enough current.
Just do it.
Arduino plus various "shields".
Smartphone with stuff hacked off.
Asian mini tablet with not much hacked off.
Gooseberry Pi plus what people will immediately add to it when it arrives.
Buy modules and combine at much higher cost.
An obvious way to ease the spec is to accept the need for a higher capacity battery.
10 hours at 0.5W requires 2.5W PV panel in winter or 1 - 1.5 W in summer deep-ending where you are. More takes more.
Buying PV panels in 50 quantity you can get them at say 2W for $10 each. (ie $2.50 each ex factory in 1000s.) That's not a major component in your pricing.
Much more could be said, but that should give a good guide. |
H: TLC5940 and ADXL335 circuit 'glitches' on perfboard. Need decoupling caps?
I created a circuit containing one TLC5940 and one ADXL335 breakout board. The ADXL board comes configured with 0.1 uF capacitors to set the bandwidth of each axis to 50Hz.
It is wired to an Arduino Mega 2560 like this. The ground is shared between both the TLC and the ADXL. 5V and 3.3V are hooked up to the Arduino.
On a breadboard, there is no problem. With the exact same circuit a perfboard, the ADXL values seem to fluctuate when the TLC is updated. Also, when fiddling with the 3.3V wire to the ADXL (connecting/disconnecting), LEDs are turning on and off randomly.
I checked my soldering, and while not the best there is (it's my first perfboard) there aren't any shorts/mistakes as far as I can see.
Could it be because the power sources are 'dipping' when updating the LED's? If so, do I need decoupling capacitors to smoothen it out?
AI: Decoupling capacitors are absolutely essentialTM in any real world circuit.
You want a say 100 uF on the 5V supply to ground ON the perf board plus a 0.01 uF to 1 uF ceramic from 5V to ground at each IC as near to the supply pins as practical.
You also need to be ABSOLUTELY CERTAIN that all pins on all devices that should be connected to a defined level are connected. I'm not going to pore over avery pin description BUT YOU SHOULD.
5940 datasheet
ADXL335 datasheet
it's good to have a circuit diagram of what you are doing BUT what you have presented us with is very sloppy. eg the ADXL IC shows on its data sheet VERY CLEARLY that it needs a supply decoupling cap AND ALSO must have caps on its output lines WHICH CONTROL ITS BANDWIDTH. Either the caps are on your board but not on your diagram (very naughty) or not on your board (even naughtier). So, please to fix either board and/or diagram and report back. You may have decided to use no x y z caps and get max bandwidth - is that what you are now seeing as errors?
Coming back and asking more questions without fixing the board and or diagram and telling us what the reality is would be both pointless and rude - Olin will tell you this very loudly soon if I don't tell you now ;-).
BUT Olin will also vote to close your question and will influence others to do so too. I won't. I don't need to because others will do so quick enough if you don't fix these discrepancies. So, I suggest rapid action and we will all get a good result :-). |
H: Where can I get a small cheap linear actuator?
First, I should clarify: I am not looking for much power or much precision. I am looking for the cheapest thing I can plug into an arduino. I am just looking for stuff I can use for prototyping/proof-of-concepts.
I was taking apart an old CD drive when I noticed there was a linear actuator being used for controlling the head. It seemed perfect for my purposes. When I came across this article I realized that this thing was actually quite precise.
This raised a lot of questions, but the most important one to me is:
Do I have to buy a CD player every time I need a linear actuator?
Where do I get those particular linear actuators found inside a CD player? I assume they are cheaper than the CD player itself.
AI: I don't know what is in your CD player, but it sounds like you are asking in general how to create linear mechanical motion that is electrically controlled.
The most obvious answer is a solenoid. Look around and you will see many different types. These are basically a magnetic plunger moved by the magnetism of a coil.
There are also devices known as voice coils, which are the same concept as a solenoid except that the coil is intended to move. They are called voice coils because this is the mechanism used to make loud speaker cones move.
There are also such things as linear motors. These are like rotary motors with the magnetic poles sortof unwrapped in a line.
Of course rotary motion, such as produced by a electric motor, can be turned into linear motion mechanically. A rack and pinion arrangement is one way. There can also be lever-arm driven mechanisms, which are in turn driven by geared down motors.
Getting accuracy is a separate issue. A basic solenoid is generally intended to be on or off. Voice coils can position quite accurately as a function of current when working against a known mechanical spring force. If a stepper motor is used, then the rotary motion is known open loop, and this can be turned into known linear movement. Otherwise, you will need some kind of mechanical position sensing and closed loop feedback to control the actuator. There are again many types of that, but that's getting too far afield of your question.
Added:
Whoever downvoted this answer, please explain what you think is wrong. Phantom downvotes don't benefit anyone since nobody knows what you object to. It also doesn't give anyone a chance to decide whether you might be wrong. |
H: What is the easiest way for me to measure the amount of "juice" that's left in an alkaline battery?
This question applies equally to both non-rechargeable batteries and rechargeable batteries.
I want to know if I managed to fully recharge my rechargeable batteries (mine are primitive), and how much battery life is remaining in my non-rechargeable ones.
AI: If we talk about small AA, AAA and coin batteries (both 1.5V and lithium 3V), then the simplest estimation can be made using a voltmeter. The voltage goes down (declines) over time and usage.
Note that each particular device needs a different minimum voltage to operate normally, so for example a battery from one device which seems dead can be put somewhere else and operate normally (at least for a little while). For example my digital weigh is quite demanding - it ceases operation already when the voltage drops to 2.88 V, and those lithium batteries are still well usable in bicycle computer or somewhere else.
Update: Note that alkaline batteries have got some kind of self-healing effect. When they are not used for a while, their voltage goes a bit higher. This can mislead your voltage measurements. So you should put them back to some load for a few seconds and then you can see their real health. Also note that totally dead batteries don't need this; they show voltage near to zero even without any load. |
H: Extending a pulse from a DTMF Decoder
I have built a DTMF decoder which offers relay closures corresponding to the digits received. Everything works great, except the equipment I am interfacing to is slow.
The office telephone system gives a pulse of tone whenever a digit on the telephone is held down. From what I've read, the pulse lasts 300ms. The equipment my DTMF decoder is interfacing to cannot detect a pulse that quick.
I am working on getting the tone pulses extended to 1s, but need a plan B. Can anyone think of a way to take a 300ms pulse and extend it to 1s?
I've tried using a 74LS123 (retriggerable multivibrator) but I dont think the IC is designed to go that long.
I've thought of using a JK Flip Flop to latch in the signal that eventually closes the relay contacts, but haven't worked it out yet. I have a limit on the amount of real estate I can use.
I'm looking at some kind of RC charge/discharge circuit to hold the relays on. But I cant figure out a way to have the capacitor charge in 300ms and discharge over 750ms - 1second.
Any input would be appreciated.
Very simplified schematic attached.
AI: Do you want the relay to latch on or just stay energized for the length of the tone?
If (a) then just use any of different latches: could use a toggle F/F if you want it to toggle on and off with tones, or capture the rising edge from the decoder and use it to clock an LS74 flip flop.
For (b) you didn't say what problem you ran into the the LS123. I find it hard to believe that it won't configure as a 1-second one-shot, but if that's really the case, you can make very long one-shots using an NE555.
Also, do you really need two levels of isolation from the phone line? You have both an optocoupler and a relay in your circuit. Better yet, back off and take a 30,000 foot view: what exactly are you trying to build? |
H: A cheap experiment to demonstrate the relationship between resistivity and heat output
I'm trying to design a cheap experiment that will demonstrate relationship between resistivity and temperature change under current. Optimally I would
Find some relatively resistive substance
Run some current through it.
See how much it heated up
Any suggestions from either the practical angle (choice of material, range of current) or the math (temp change <>watts) would be a big big help
Thanks much in advance
Joe
AI: Nichrome.
Strap a piece of this stuff across the leads of a 6-volt lantern battery and you can melt thread, fishing line, Styrofoam, etc. It gets really hot - sometimes visibly red hot, depending on the battery. Check this out: http://www.amazon.com/Nickel-Chromium-Resistance-Bright-Diameter/dp/B000FMUF4E/ref=pd_sbs_indust_1
You might also be able to find it at your local hardware store.
Or, for an even cheaper (though much less awesome) experiment, use a thermistor: http://en.wikipedia.org/wiki/Thermistor. I've gotten them on Mouser for a few dollars each (of course, I don't buy in bulk).
They are very cheap, and the temperature rise is easy to calculate (calculations might fall under the category of "self-heating" in datasheets, and on Wikipedia). |
H: Bias headphone audio signal for use with digital potentiometer?
I am attempting to control speaker volume via a digital potentiometer, the problem being that audio signal goes both above and below 0V, for regular potentiometers this is no problem but for digital they cannot handle a signal below ground.
How can I shift the signal up to always be above 0V? I believe this is called biasing, so instead of -2V to 2V it'll be 0V to 4V. I have seen example circuits for this. So for me the more important question is do I have to shift it back down for the speakers to "understand" the signal again?
AI: You can shift it like this if you don't have the center voltage already available:
simulate this circuit – Schematic created using CircuitLab
Or like this if you do:
simulate this circuit
You may recognize it as a highpass filter, which it is. In signal processing, DC (constant offset) is 0Hz, and is considered a frequency just like any other. Set the cutoff frequency well below the lowest point of interest.
As for the speakers, yes, you should offset it back, using the speakers' ground as the center point. You should probably add a buffer amp between the pot and the output, which you can take advantage of as an active highpass filter. This circuit takes that idea one step further by coaxing a linear pot into a somewhat decent log response, which is a little bit better suited for the way we naturally measure volume:
simulate this circuit
It may not be immediately obvious, but I used one of each variation. The input one is almost obvious - I'm using the digipot itself as R2 - and the other can be seen by realizing that the (-) input of the opamp is actively held at the speaker ground, which is the desired center point. Also, by loading the pot with R3 to ground, I can convert a linear response into a semi-log one.
The classic inverting opamp then takes the voltage that appears between C2 and R3 and puts it on the output with a gain of (-R4/R3). This means that you can make R4 variable in order to match the digipot's volume range with the speakers' volume range, which is generally a good idea in my opinion. Once set, it should never be moved again unless you change your setup, so it doesn't need to be anything fancy.
Two things to note:
The opamp needs a wide enough power supply to cover the entire +/- voltage range that the speaker can handle, or that you care to give it. It can't go outside of its own supply.
Power on/off transients typically go straight through this kind of filter because they're relatively high in frequency content. At this point in time, the cap is charged incorrectly for the required offset and so you might need some kind of over/undervoltage protection between C1 and the digipot and between C2 and the opamp. You can use a pair of zener diodes in reverse series from the signal to the center point if you have it and it's "stiff" enough compared to the supply rails, or you can use a shottkey diode from the signal to each supply rail of the device that it's about to go into. |
H: What's the point of Karnaugh maps?
You can't use them for more than 5 variables efficiently and no "real life" circuit has only 5 variables (except for the simplest of them). So what's the point of them? They seem pretty useless for actually engineering work.
AI: In today's world with many decent choices of hardware design suites with HDLs (Hardware Description Languages) and Digital Circuit Optimization and Minimization there is no real need for small topology logic design as offered by Karnaugh maps. On the other hand there are two pretty useful areas where they come into play.
A) One area is in the training and education field. Karnaugh maps are an excellent visual tool to help students learn about the ideas of logic minimization and essential prime implicants.
B) Another area where I've found them useful is in embedded programming. Once in a while when programming an algorithm or a software state machine a quick Karnaugh map can be used to simplify the conditional expression used in the code. Four, five or even six variables is often just the right fit for a programming logical expression. |
H: Do I use a 5V 2A or 3A DC adapter to power my 2m (6.5ft) WS2801 LED strip?
(Please excuse me if my English is bad)
I recently purchased a 5m LED strip, but I only need to power approximately 2m (6.5ft) of the 5050 RGB LED WS2801 strip, but I'm afraid that a DC power adapter with 2A may not provide enough current, or a 3A or more may damage the LEDs, what do you think I should go for?
Here's a few specs about the 5m LED strip:
Input voltage: DC5V
Current: 3.2A
LED Qty: 32 per meter
Power(W/M):7.68W/M
AI: Current ability of supply should be equal or greater than current required.
A supply able to supply more than required will do no harm.
As I = V/R , current is provided "on demand". The supply supplies what is needed, not more.
For reasons explained below, a 3A supply is just about right for your 2m strip.
A 2A supply is underrated and a >3A supply will do no harm.
In the calculations below I have used the figures to the number of places specified and not rounded the results in calculations. In practice the values in the specification sheet will be approximate and will vary between samples. A variation of +/- 5% in currents would be good, +/- 10% not surprising and > 10% not unknown.
Such variations will usually not matter. Occasionally they will.
It pays tp provide somewhat more power supply capacity than required as the voltage may "sag" somewhat when loaded to the limit. Some supplies will get excessively hot when at or slightly above their specified ratings BUT these are liable to also have other problems - such as being death traps occasionally. A good 3A supply from a competent manufacturer will usually give you 10% + above the rated value without demur.
Your specifications are inconsistent
Current = Power/Volts. or I = P/V
If the strip was 7.68 W/m as claimed then at 1m the current would be
I = P/V = 7.68/5 = 1.556A and 5m = 7.78A
Suspect values:
If I = 3.2A (another of your specs) then with 32 LED/s each LED would draw 3.2A/32 = 100 mA. This is conceivable with all 3 LEDs operating - some suppliers say 60 mA = 20 mA per LED colour and 100 mA = 33 mA per LED colour. It is usual but not certain to rate LEDs of this size at 20 mA / LED colour - but it is possible to be higher.
At 3.2A/metre 1m will take 5V x 3.2A = 16W
and 5m will take 5 x 16W = 80W
which seems 'rather high' [tm].
Probable correct values:
If we instead use the quoted 7.68W/m
I/m = P/V = 7.68/5 = 1.536A
As there are 32 LEDS/m this means
each LED takes 1.5436/32 = 48 mA/LED
or 16 mA per LED segment.
This sounds closer to likely reality (but may not be).
Assume the 3.2A figures is correct. Then:
V = 5V
I per m = 1.536A
I per 5m = 7.68A <- explains the 7.68 figure in the data.
P per m = 7.68W
P per 5m = 38.4 W
2m requires 2 x 1.536 = 3.072A
ie a 3A supply is about right.
M for metre should be m as Mr Metre did not exist. |
H: What bluetooth chip / type should be used for a remote control car?
I am building a small remote control car to be controlled by bluetooth (iOS and Android). I am having a custom circuit board built, and I want to know what bluetooth chip I should get. I would like the range of the car to be at least 20-30 feet.
AI: I suggest you look at the Bluegiga BLE113 module. Uses very little power. Module includes antenna. Good for 100m. You don't need to have a separate microcontroller, your application can run on the BLE113 itself (has a user-programmable 8051); however you can also control it via traditional AT commands via a UART connected to a microcontroller. Even comes with source code for an iPhone application. |
H: Platinum RTD temperature sensor choices between 1000ohm and 100ohm
I heard the Platinum RTD temperature sensor are very accurate and I want to use it for my temperature measurement project (-40 degree to 80 degree range). I don't want to use other type sensors.
Platinum RTD sensor have 2 categories: 1000 ohm and 100 ohm.
Which one should I use?
What are the differences? Is it because 1000ohm will give you higher voltage than 100ohm so you can easily do ADC (0-5V, 10 bit, Arduino)?
AI: Scatter gunning a few thoughts: -
Given that PTDs can be used in very fast thermally changing applications, using a PTD with a 1000 ohm resistance over a long (ish) length of cable may lead to the cable capacitance ruining the high frequency thermal perturbations that would have been seen more accurately with a lower resistance PTD.
Lower resistance PTDs exhibit lower thermal noise too.
On the other hand, for a given voltage change (for a given temperature change), a smaller excitation current is required for higher resistance PTDs. This can lead to less-self-heating and higher accuracy.
Higher resistance PTDs are less prone to errors due to cable resistance changing with temperature. |
H: Compensating input impedance
I'm trying to measure the reverse leakage current of some diodes with the method proposed HERE - the diode is connected in reverse bias to 5V through 1 megaohm and voltage is measured across the resistor, the current is calculated from the voltage. However I need to do this as accurately as I can, and as I understand the input impedance of the measurement device will distort my results greatly because it is close to the resistor's value. Instead of a voltmeter I'm using an oscilloscope (1M input impedance, 10x attenuation probe). My questions:
How would one compensate the change in measured voltage due to the voltmeter input impedance?
Is there any difference to doing this while using an oscilloscope?
If I'm doing something wrong here it would be nice to know as well. Any input is greatly appreciated!
EDIT: As I suspected, the way to go here is to consider the voltmeter/oscilloscope to be a resistor in parallel of the load to be measured - as Andy suggested. You should also check EM Fields' answer for measuring methods. HERE'S a well written paper about the effect of measurement device input impedance on your circuit.
AI: If the input impedance of the measurement device is (say) 10 Mohms then you can assume that this 10 Mohms is in parallel with the 1 Mohm circuit resistance. This effectively lowers the 1 Mohm to 0.9090909 Mohms.
Try researching resistors in parallel. |
H: 3.5mm headphone jack frequency range
I want to receive audio data from a device and handle it through the mobile’s headphone jack, but my data has a low frequency of about 1Hz. I’ve found that it’s too low for this port.
I’ve searched about the 3.5mm headphone jack frequency range but couldn’t find anything!
What is your suggestion? USB port can be an alternative solution?
AI: Your question is very nearly incoherent. You do not say (clearly) whether you want to put data into the cell phone and analyse it there, or whether you are going to send data out of the cell phone to be analysed by an external system.
Regardless, certain parts of your question can be answered.
The audio range of the earphone of a cell phone can't be counted on to go below 100Hz - some phones will go lower, some will not even get down to 100Hz.
The audio range of the microphone of a cell phone can't be counted on to go below 100Hz - some phones will go lower, some will not even get down to 100Hz.
The phone itself will not convert from some nebulous, undefined "data" to audio or from audio back to data - your software will have to do that.
To work around the limitations of the cellphone audio, you would be better advised to modulate the data on to an audio frequency that the phone can handle - in the middle of the speech band is probably best, so 1200Hz to 1800Hz. You can find plenty of data on the internet about frequency shift keying (FSK) or phase shift keying (PSK) for transmitting data across audio systems.
If none of that made sense, then you have a long way to go before you begin working on your data transmission. Read up on things. Define your data format and data rate. See what you can come up with for ways to achieve your goal. If you get stuck, come back and write a better question - and consider telling us what you are trying to do, as someone here may have done it already and can point you at a better way. |
H: What are the tradeoffs between control vs software algorithms (in charge pump PLL)?
I have a grid signal (45-65 Hz) that I've sampled with an ADC and put it through an IIR LPF so that noise does not effect the zero crossing detection.
All I want is the frequency of the signal. Now what are the advantages/disadvantages of using a software implemented charge-pump PLL vs just averaging the time between the last few zero crossings?
I know much better PLLs can be used to find the frequency, but given I only have the zero crossings what method will offer the best result.
AI: I would like to calculate f as often as possible accurate to 0.5Hz
accuracy and my zero crossing is accurate to within 100us.
If you were measuring a 65Hz waveform over 1 cycle and you had a zero cross error of 100us the total period measured would be: -
\$\dfrac{1}{65} + 100E-6\$ = 0.015484615 seconds or, a frequency of 64.58 Hz.
This seems accurate enough given your requirements. You should also consider how many pulses you would count over that period and I'd aim for counting 10us pulses or better. This is one-tenth of the error incurred by the zero cross detector and filter.
I don't think you need to go to the complexity of any PLL for this. |
H: Connection problem with RS485 system on PC with RS232 port
I am developing a system in which I have to integrate hardware. I am from computer background, so I don't have much knowledge about hardware systems.
The issue is I have to integrate with London based taximeter with MR400S model. This taximeter gives output according to RS485 system. My application is on PC and I want to receive signal from this taximeter. My PC can read data from RS232 cable. I have RS232 cable so I have connected the RX and TX of taximeter to TX and Rx of cable. But my PC is not detecting this hardware, so can anyone help me solve this issue?
AI: This taximeter gives output according to RS485 system. My application
is on PC and I want to receive signal from this taximeter. My PC can
read data from RS232 cable. I have RS232 cable so I have connected the
RX and TX of taximeter to TX and Rx of cable.
RS485 is not compatible with RS232 hardware wise at all. RS485 uses a balanced, differential 2-wire or 4-wire transmission/reception circuit. RS232 uses single ended transmit and receive wires (and ground) and has no facility to accept 485 without a 485 converter. |
H: How to ON/OFF two fans with 3-state rocker switch?
I have a 3-state switch, It has 3 pins. It can have 3 state as you can see in the picture below. when it's off (i.e on O) the middle pin is not connected to anything! When it's on I, the middle pin is connected to I and when it's on II the middle pin is connected to II. Easy, Right?!
Now, I have two 5 volt DC fans and a 5 volt battery. I wanted to build a connection between these four elements that when the switch is on O, both fans are off. When it's on I, one fan is on and when it's on II, both fans will be on. I wanted to avoid using any other logical elements like gates or diodes, etc...
simulate this circuit – Schematic created using CircuitLab
All I want to have is just one switch, two DC fans and one DC battery. I couldn't figure it out how to do it, so I'm asking here! :)
If there is no way of doing it, is there a way to build it with minimum extra required elements?
AI: To do what you want, you will need at least one diode in the circuit, between poles I and II, At the expense of having a voltage drop in one of the fans.
When in position I, the diode will not let any current pass trough it, so only Fan I will spin. When the switch is in position II, Fan II will get power, and the diode will let current trough it (with some voltage drop) and fan I will also get power. Because of the voltage drop, Fan I will spin slight slowly than if it were directly connected to the power supply.
For small currents, any ordinary diode will do the job, like 1n4148 or the 1n400X series. Take a look at the datasheets of these models (and the fans, if available) to see the current specs. |
H: Relation between C-rate and power of a battery
I'm a non-engineer, but I need to understand the function of a battery. I hope you can help me!
For example, I have two bulk storages.
5MW (power) 5 MWh (capacity)
5MW/10 MWh
So the definition of the c-rate is: A C-rate is a measure of the rate at which a battery is discharged relative to its maximum capacity. A 1C rate means that the discharge current will discharge the entire battery in 1 hour.
So for the second storage, a 1C shouldn't be possible? Because it is not possible to discharge the whole capacity in one hour because of the power? I'm a little bit confused.
AI: You're right (provided that the 5 MW spec is the upper limit of the power).
In the first case you have an exactly 1C-rated storage, whereas in the second case it's 0.5C. Note that putting two 1C-rated storages in parallel will still provide 1C maximum discharge rate. |
H: How does part of a microprocessor (Apple secure enclave) use a microkernel (L4)?
Please excuse my ignorance. I'm an 'old-fashioned' guy who thinks that there is just 'software' and 'hardware' - and these are two separate things. Along this line of thinking an OS is part of the software, and a microkernel is part of the OS. (I'm aware of the debate about Microkernels - and how Linux didn't really end up using one).
I'm also aware you can do fairly amazing things with FPGAs - but perhaps I assumed this was limited to microcode and DSP.
So when I hear the quote:
Apple is using the L4 kernel ... It's the microkernel in the Secure Enclave
I'm fascinated.
I'm aware that L4 is the microkernel that has been 'proven correct' against its specification. But to me - that is part of the OS. (ie loaded from disk into memory and then instructions are transferred down to the CPU over the Bus.)
My question is: How does part of a microprocessor (Apple secure enclave) use a microkernel (L4)?
(Is this a kind of FPGA? Do they feed it into the part that lays out the transistors and 'embed' the software in silicon?)
AI: Majenko's answer is correct but not entirely complete. The whole thing rests on ARM's "TrustZone".
This is a stronger version of the normal concept of "ring 0" security found in operating systems, or a "hypervisor". It's a top level operating system that boots from the incorruptible ROM, configures the MMU, and then boots the "user" (phone) operating system. The special thing about the ARM version is extra MMU protection, so that the phone operating system cannot access all the hardware or memory.
Edit: see http://www.google.com/patents/US8775757
It seems to be both a distinct processor within the SoC and the "trust zone" MMU protection. Both processors have access to main memory, including a "mailbox" for communication between the two, but some memory is protected against access by anything other than the "secure enclave" processor.
The first non-patent citation of that document is "ARM Security Technology Building a Secure System using TrustZone® Technology, Copyright © 2005-2009 ARM Limited. All rights reserved, PRD29-GENC-009492C". |
H: Headphone has no sound if fully inserted in jack
When I connect my headphone to headphone jack in my laptop, I don't hear any sound. Unless I do not fully plug it in and instead just plug it in around 50%.
Sometimes I hear sound but it is all garbled.
This headphone used to work fine before and now it is giving me this problem for some time.
If I connect another headphone then it works fine so I don't think headphone jack is the problem.
Does anybody know why this is happening and how to fix it?
EDIT
Found a similar question. When I said that sometimes I head sound but it is all garbled then this is what I was talking about as discussed in this question.
Why do speakers sound different when they're not fully plugged in?
AI: Probably one of the wires coming out of the plug has broken. Cut off the plug along with a few inches of cable (to get past the point where a wire is broken), then solder on a new plug. |
H: "Chip Select Bar" - proper jargon or a place to have some beers at?
Today, I came across a data sheet for an ADC (cf. p. 2) including a pin list with the "barred" (i.e. overlined) letters CS, indicating negative logic for the Chip Select pin, followed by the name that had the word "Bar" spelled out.:
\$\overline{CS}\$ = Chip Select Bar
This seems strange to me. To this day, I have always called this pin "Chip Select" - and in writing, I might use "Chip Select (negative logic)" or something similar, and the only time I would probably spell out the word "Bar" would be when talking to the person who typesets the data sheet. Outside the context of typesetting, this rather sounds like a funny name for a bar where you can meet EEs after work. But - I'm not a native speaker.
Surprisingly for me, searching for the term "Chip Select Bar" produces tons of results, the first one being an application note by a reputable company where you can not oly read the words "Chip Select Bar", you even find a pin labeled "CSB" where I would have expected "!CS" in case the typesetting software wouldn't allow \$\overline{CS}\$. It's the very first time I see the letter B as a symbol for negative logic, and this surprises me even more than the spelled-out word "Bar". And in the application note, they are talking about an active low signal, aren't they: "CHIP SELECT BAR (CSB) - CSB is an active low control ..." (cf. p. 3).
Now... is it possible that spelling out the bar in the symbol for negative logic has really become a synonym for negative logic and even replaces "‾" or "!" as a symbol when a pin name is abbreviated, as in CSB? It appears that this habit might cause more confusion than it helps, doesn't it? Is the word "bar" really a commonly used synonym for "active low"?
Loosely citing The Doors: "♫ Well, show me the way. ♫ To the Chip Select Bar. ♫ Oh, don't ask why. ♫ Oh, don't ask why..."
P.S. Please excuse the title and my idea that I might get some beers at the Chip Select Bar; I actually intend to ask a serious question about proper jargon.
AI: The notation with the bar, \$\overline{a},\$ is not from an engineering context originally.
It is a notation used in the context of logic as a mathematical field of research.
In that context, the line above a symbol to indicate negation is indeed pronounced "bar".
For the pronounciation of various notations of negation, see the table in the section "Notation" of Wikipedia: Negation.
It does make sense to use this notation of negation here, actually because it is pronounced "bar": Most other notations are pronounced by a prefix "not".
In the contexts "CS bar" is used, "not CS" in it's place would often be ambiguous:
"Hey, wait, not not x, not y!"
versus
"Hey, wait, not x bar, y bar!"
Regarding spelling it out, I think it's really the backup option in case you can not write the \$\overline{a}\$ for typesetting (or keyboard) reasons.
Note that you can not just leave it out when speaking:
Saying
Connect this to chip select because...
is clearly understandable,
but
Connect these to x and y because...
when you have pins \$\overline{x}\$ and \$y\$ is less clear. Should I put a inverter gate in between for x?
And it's not clear at all when you have pins \$x\$ and \$\overline{x}\$.
That \$\overline{CS}\$ spoken as "chip select" works well depends a lot on context information. And in part, it's simply because you do not care whether it's inverted or not in many situations. |
H: UART without using the same clock
I am using the C027 development board for prototyping an application and I was wondering it it was possible to use the Tx and Rx pins of the GSM module (available on the pinout of the board as P0_15 and P0_16) to communicate with another microcontroller on another board (like the MSP430 Launchpad).
I think that it is not possible as both ends have to share the same clock in order to be synchronized but I therefore do not understand why they put these pins on the pinout.
Is it possible in my situation to communicate by UART without having the same physical clock connected to the two components ?
AI: Communicating through UART does not require your systems to have synchronized clocks.
As Majenko pointed out, the A in USART is Asynchronous.
So long as you have the correct BAUD rate, and have your data bits, parity and stop bits setup to match both systems, you will be able to communicate. |
H: Rogowski Coil High Frequency Limit
I'd like to do some experiments involving high frequency (1.296GHz to be exact) that involve an 50ohm inductor that has minimal RF losses. The obvious candidate is to drive a Rogowski coil (driven as though an air-core current transformer without a secondary running through the centerline) since it generates no external fields -- only a dynamic B-field within the minor radius of the torus.
The problem is when I look at the application of Rogowski coils to current sensing, the frequency limits seem to be a factor of 10 lower than my target.
What limits the frequency of a Rogowski coil to below the GHz range?
AI: What limits the frequency of a Rogowski coil to below the GHz range?
Mainly the fact that it is by definition a multi-turn inductor, and the self-resonant frequency is going to be a few hundred MHz at best.
An inductor that has an impedance of 50Ω at 1.296 GHz has an inductance of 6.14 nH. That's a really tiny value, and it's really difficult to make a low-loss discrete inductor with that value. Another issue is that the skin depth for copper at that frequency is only about 2 microns. That's why most work at microwave frequencies is done with silver-plated tuned cavities and striplines.
What is it that you're really trying to accomplish? If you can be more specific, we can come up with more appropriate approaches for you to try. |
H: Efficient use of space in FPGA
Background and clarifications:
I've never developed/written a single piece of hardware before, but I'm currently using Verilog to develop a huge project for a FPGA as my final graduation project.
I've got some questions on how to write verilog code efficiently. (Assume that, when I say "efficient", I mean "the way that uses less area and pins of the board").
Within the problems I'll suggest possible solutions, but, if none of them is right, feel free to negate them and add your correct solution.
In a certain way, problem 1 is the same as problem 3, so feel free to answer only one of them. I've written both to provide another example of the problem, just in case one feels more comfortable in answering one than the other.
In case you don't know how to answer problem 2, don't worry, as it's not the main problem here.
Thank you for your help.
Problems:
1 - Let's assume we have a module X that controls if modules A, B, ... N are logically on/off, that is, it sends signals to them to signal if they should be enabled or disabled. I see two ways of doing this:
Option 1: Send, to each destination module, a pair of enable/disable wires, wasting space with wires. i.e.:
module X(o_enable1, o_enable2, o_disable1, o_disable2);
assign i_enable1 = o_enable1;
assign i_disable1 = o_disable1;
module A(i_enable1, i_disable1);
assign i_enable2 = o_enable2;
assign i_disable2 = o_disable2;
module B(i_enable2, i_disable2);
Option 2: Create a bus, and each destination module would be responsible to mask it and verify if the enable/disable signal was sent to it, saving wire space, but creating a demux for every module. i.e.:
// o_enableDisable -> 0 = `ENABLE, 1 = `DISABLE
module X(o_enableDisable, o_enableDisable_bus);
assign i_enDis1 = o_enableDisable;
assign i_enDis_bus1 = o_enableDisable;
module A(i_enDis1, i_enDis_bus1);
assign i_enDis2 = o_enableDisable2;
assign i_enDis_bus2 = o_enableDisable2;
module B(i_enDis2, i_enDis_bus2);
// ... Inside A
if ((if i_enDis1 == `ENABLE)&&(i_enDis_bus1 == ENABLE_FOO1)) // Do something
if ((if i_enDis1 == `DISABLE)&&(i_enDis_bus1 == DISABLE_FOO1)) // Do something
2 - In the previous problem, we assumed that we were going to enable/disable modules logically. In case we wanted to turn them on/off physically to save power, is there a way to do that, or do we just have an if statement inside the module? i.e:
if (enabled) begin
// Contents of module while on
end else begin
// Contents of module while off
end
3 - Let's assume we have a decoder module X that sends commands to modules A, B, ..., N. I see 3 ways to do this:
Option 1: Commands as single wires, loosing pins, but saving the space of a demux. i.e.:
module X(o_com1, ..., o_com_m, ..., o_com_n);
assign i_com1 = o_com1;
// ...
assign i_com_m = o_com_m;
module A(i_com1, ... , i_com_m);
module B(i_com_m_plus_1, ..., i_com_n);
Option 2: Logarithmic input to be decoded inside destination module, wasting space with a demux. (Note that X decodes an instruction, decides which module it should send a command to and then sends a command to it)
module X(o_command_A, o_command_B, ...);
assign i_command_A = o_command_A;
module A(i_command_A);
assign i_command_B = o_command_B;
module B(i_command_B);
// Inside A
case (i_command_A)
`COMMAND_1: begin /* ... */ end
// ...
`COMMAND_n: begin /* ... */end
endcase
Option 3: A mix of both.
AI: First, when designing FPGA's we mostly just think about "resources" rather than "space". Resources are things like routing resources, logic cells, RAM blocks, multiply-add blocks, etc. It looks like you're concerned about minimizing the use of routing resources, and willing to use more logic cells to do that.
Really, the best way to answer your questions (and first off, to find out if trading logic for routing is the right thing to do) is to synthesize your first-draft design and look at the resource usage. If routing resources are close to fully utilized, then start looking for ways to reduce them. If logic is close to fully utilized, then start looking for ways to make the opposite kind of optimization.
Let's assume we have a module X that controls if modules A, B, ... N are logically on/off, that is, it sends signals to them to signal if they should be enabled or disabled.
The typical way to do this in an FPGA is to just let all N modules run continuously. If only one out of the N are used at any given time, then you can often just use a mux to select which of the outputs gets used by downstream logic. If the combinations of modules being "disabled" is more complex, then you often just tell downstream logic to ignore those inputs, rather than disabling the module generating them.
You normally don't have separate wires for enable and disable like you proposed in your 1st option. Just one wire that is (for exampel) high when the module should be enabled and low when it should be disabled.
Although of course having separate enable and disable lines that only pulse intermittently is also possible if you have a good reason to do it. They would typically drive the SET and RESET inputs of a flip-flop to generate the actual enable signal.
In the previous problem, we assumed that we were going to enable/disable modules logically. In case we wanted to turn them on/off physically to save power, is there a way to do that, or do we just have an if statement inside the module?
FPGAs don't typically have provisions to selectively power down parts of the fabric.
It is possible to use enable pins to reduce power consumption (due to reduced switching), but if the amount of logic being disabled is not a very large fraction of your design, it's not likely to significantly improve your power budget.
Also, you need to show that at any given time at least some known fraction of the logic is disabled, since you'll have to design your power supplies and heat sinking to account for the worst-case operating conditions anyway.
Let's assume we have a decoder module X that sends commands to modules A, B, ..., N. I see 3 ways to do this:
Your option 1 (a seperate signal for each command) is a very common FPGA coding style. Similarly, one-hot encoding is typically recommended by synthesis tool vendors for encoding state machine states. |
H: How do I reset a capacitor once I have a signal rise?
Once the signal rises to a certain level, my capacitor starts getting charged.
Once the signal falls back down to that same level, my capacitor stops charging.
This way, I am using the voltage of my capacitor as an indication of how long the signal stays above that level. I call this time duration as "hump duration".
My problem is, I have a train of such pulses. That means, after the 1st hump comes the 2nd hump and so on. In order to also get the "hump duration" of my 2nd hump, I believe I will have to reset that capacitor.
So how can I reset my capacitor when my signal rises above a certain level (i.e., right before next hump comes)?
AI: What you are doing is called a "Time over Threshold" measurement that is very common in particle detection applications (for example in Nuclear Science).
The problem you are having is called "pileup" and, as you noted, a direct consequence of not resetting the capacitor. You need to do what is called "baseline restoration".
One common solution is to add a discharge path as clabacchio suggested. The stupid simple way to do that would be to put a resistor in parallel with the capacitor you are charging. Then, the capacitor would discharge based on the RC time constant of the value of the resistor and capacitor you are using.
Doing this makes a brutal tradeoff though, and may not work. Here's the tradeoff: on one hand you want a small RC time constant so you can have a faster train of pulses. A small RC means the capacitor will bleed its charge quickly and be ready for another pulse. On the other hand, you want a large RC time constant so the capacitor holds the peak long enough for you to record the measurement.
If the simple technique I described doesn't work, you can put a transistor switch across the capacitor. Once you've made the measurement, you pulse this transistor and do a hard reset, clearing the capacitor. This technique is a bit more complex (especially if you're not using a computer already to acquire the data) but can be effective. If you're not using a capacitor you need to have a comparator. One input will be the signal you're measuring and the other will be the threshold. The output of this comparator can then be connected to the switch. |
H: Make outputs single ended on CS4234
I am working with the CS4234 codec for a project
It has 4 ADCs and 5DACs. One thing that is confusing me is that the pins are labled AOUT1- and AOUT1+ in the similar fashion for all ADCs and DACs.
The device states it can do single ended, which I believe is what I need to achieve stereo sound. How can I change these various ADCs and DACs to Left and Right input/output channels?
Could I just use the positive for left and then the negative for right? Like are they already in this configuration or do I need to use an op-amp to convert the signals?
AI: The device states it can do single ended, which I believe is what I need to achieve stereo sound.
No. Single ended would just be using AOUT1+ and ignoring AOUT1-, or combining both + and - into a single signal with an op-amp. For stereo you would use AOUT1 and AOUT2 in either single-ended or differential mode.
Using an op-amp to make a differential output into single ended can be done like this:
simulate this circuit – Schematic created using CircuitLab |
H: Why does a Category 5 rated jack have different solder tail positions than a traditional jack?
I am attempting to specify a replacement part for a modular jack used in an original design (I basically need something that will stick out farther than the original). However, the part I would like to use specifies different solder tail positions than the original because it is designed for use with Cat 5.
The part is from TE and can be found here.
Here is the difference in the solder tail positions:
1. What is the reason for changing the positions of the solder tails for a category 5 jack?
AI: CAT5 cabling, for some reason, doesn't use a simple 1:1 relationship between connector pin numbers and the wire colours and pairs.
CAT5 cables have 4 pairs of wires: Orange/Orange+white, Green/Green+white, Blue/Blue+white and Brown/Brown+white. In CAT5 the colour pairs are assigned backwards (orange+white is 1, plain orange is 2), and the second pair (green) is split around the third pair (blue)*.
So from a CAT5 perspective the wires are numbered according to the second pinout, but from a connector perspective the pins are numbered as per the first pinout.
* Perhaps someone can clarify as to why this is - I have always wondered. |
H: Level vs edge triggering, usefulness of level triggering
Many processors / µCs / dev-platforms (BeagleBoard, Arduino,...) use interrupts.
These can be triggered by the detection of:
HIGH level
RISING edge
CHANGING level (either FALLING or RISING edge)
FALLING edge
LOW level
Now either of two things must be true:
FALLING and LOW (/ RISING and HIGH) are virtually the same
When a LOW (/HIGH) level is applied over a non-trivial time, the controller is stuck repeating the interrupt service routine over and over
Both of these don't make sense to me:
The first cannot be true, since it would be totally useless to make the difference in the first place then.
So if the second one is true: how could this be useful? What application is there that is not better off with a combination of RISING and FALLING instead of HIGH?
Research so far:
This question is just a stub, so it didn't help: https://electronics.stackexchange.com/questions/92833/what-is-the-difference-between-level-triggering-and-edge-triggering
This one is also not too useful as it is about when those interrupts are triggered, not the implications of the differences: What does edge triggered and level triggered mean?
This one mainly elaborates on the differences in detection of the different trigger events: Why edge triggering is preferred over level triggering?
AI: Level triggered (high or low) can allow the source to say "nevermind" or to keep the trigger active until the ISR gets around to it. Interrupt latency is not guaranteed on a single core with multiple triggers, though it's usually pretty fast. Generally, the signal for a level-triggered interrupt is itself edge-triggered and you have to clear it in the ISR or else you'll come right back into it again.
As Ignacio said, level triggered can also do something continuously while active, though you should write your software to not get stuck in an "interrupt loop". Not getting to your main code can be somewhat difficult to debug.
Edge triggered is good for things that happen once on some event. If the event happens again, then your response will happen again, so you'll need to be careful about repeated events like switch bounce. |
H: Displays, camera, speakers, microphones: why after more than 50 years of development do they still need calibration?
An old question running through my mind:
Displays, camera, speakers, microphones: why after more than 50 years of development do they still need calibration?
Whatever cheap or high-end material I come across in the reviews I read from time to time, none seams to be properly calibrated.
There is enough research and commercial competition over these transducer categories for a time long enough to make this intriguing...
AI: Calibration is expensive. Regarding consumer equipment, most users want less expensive product and do not mind small deviations. If you are willing to pay, you can get very precise stuff with decades of research in it. |
H: Can I replace capacitor with multiple lower value capacitors in filter?
Can I replace higher capacitance value MLC capacitor in Sallen-Key topology filter with 2-3 lower value capacitors in parallel (with total capacitance equal to replaced cap)? I tried it in TINA-TI and AC Transfer characteristics are identical. Are there any contraindications to this?
The filter is 0.6..6.4Hz band pass. I started designing it using application report with basic equations, then did a lot of changes to adjust transfer characteristics. Changes include using capacitors with values not available on market.
AI: Yes, as long as the parallel capacitances sum to the capacitance of the replaced capacitor there is no difference in the circuit. This is typically done in order to get a non-standard capacitance value out of standard capacitance values. For example, if you need \$8.6\mu\$F then you can put two standard \$4.3\mu\$F capacitors in parallel to get it since \$8.6\mu\$F is not a standard value. |
H: Divisible-by-2 Circuit Help!
I'm having a little trouble with my boolean algebra and I was hoping you all can help me out. I've been given the task of designing a circuit that takes in a binary 4 digit number (X3X2X1X0) and returns '1' if the number entered was even. I'm fairly certain that my truth table is correct, but if someone could look at my algebra for my 'Y' value, it would be greatly appreciated, as I am somewhat unfamiliar with boolean algebra. Thanks in advance!
AI: The answer is the inverse of X0
i.e. \$Y = \bar{X_0}\$
It's clearly this because if \$X_0\$ is 1 then the number is an odd number. Sometimes you've just got to look at the truth table without thinking much about boolean algebra. |
H: Numerical value in decimal of the 32-bit word stored at address 1000H
I'm a little confused how to tackle these three questions.
Assuming two's complement arithmetic and operand alignment, give the numerical value in decimal of the 32-bit word stored at address 1000H and of each 16-bit half-word stored at addresses 1000H and 1002H under (1) Little Endian and (2) Big Endia storing conventions.
1000H: 23H
1001H: F7H
1002H: 32H
1003H: AB
Questions:
For the first question, we have 23H at 1000H. Is this a hex word? What is the H for? 23 would be 35 in decimal
But two's complement would assume binary? 35 in binary would be 11011101. I also understand big vs little endian, but I'm missing something here.
AI: I'm going on the assumption that the "H" at the end of each number indicates hexadecimal representation. I'm going to use subscripts like \$23_{16}\$, \$35_{10}\$, and \$00100011_{2}\$ to represent hexadecimal, decimal, and binary, respectively.
In computer memory, data is addressed on byte (8-bit) boundaries. When a data type larger than 8-bits is stored in memory, it will span across as many 8-bit memory locations as necessary to accommodate its size.
The first part of the question asks what the decimal equivalent of the 32-bit integer that is stored at address \$1000_{16}\$. You can translate that to "What is the decimal equivalent of the 32-bit integer that begins at address \$1000_{16}\$?" Since it's 32-bit, you know it will span over the memory space of four bytes. Therefore, the contiguous memory representation of the 32-bit integer is \$23F732AB_{16}\$.
In Big Endian, we don't have to change the order of the bytes to represent the actual value. But since the numbers are stored as signed integers (two's complement), we do need to check the first bit to see if the number is negative. The MSB is \$23_{16}\$, which in binary is \${\color{red}0}0100011_{2}\$. The sign bit is low, so the value is positive and no two's complement conversion is necessary:
$$23F732AB_{16} = 603402923_{10}$$
The Little Endian representation of the integer is \$AB32F723_{16}\$. In this case, the MSB is \$AB_{16}\$, which is \${\color{red}1}0101011_{2}\$. The sign bit is set, so this is a negative number. To represent it in decimal, we must first "un-two's complement" it by subtracting one and flipping all of the bits. This results in a hexadecimal representation of \$54CD08DD_{16}\$. Translating to decimal and adding the negative sign gives you:
$$AB32F723_{16}=-1422723293_{10}$$
Remember that numerical values can be freely represented in whatever base you want. You can take the two's complement of a hexadecimal number just as you can a binary number. The reason you are probably a little confused about that is you were taught a method to perform a two's complement using only binary numbers. But that was just for convenience. It is simply easiest to perform a two's compliment operation on the binary representation of a number.
The 16-bit integers will work out in a similar way as the 32-bit. Each one will span two 8-bit memory locations, so you will have \$23F7_{16}\$ and \$32AB_{16}\$ as two separate 16-bit values. I will leave the rest of the work for you to work out on your own. |
H: Diode-connected transistor, small-signal, Norton, Thevenin
How do I calculate the equivalent Thevenin resistance of the small-signal model of a diode-connected transistor (base tied to collector)? Early-effect is neglected. The port of interest is between C and E.
In the figure, \$v_{\pi}\$ is the small-signal voltage between B and E.
I did the lower two circuits, so I'm not sure if the \$v_{\text{thev}}\$ and \$i_{\text{nor}}\$ are correct.
But if they are, then I get
$$Z_{\text{thev}} = \frac{v_{\text{thev}}}{i_{\text{nor}}} = -\frac{1}{g_m}$$
which isn't the same to the one I get when I apply a test voltage \$v_x\$ to the port, and set independent voltage source \$v_{\pi}\$ to zero. Then I just have a short circuit and can't calculate:
$$Z_{\text{thev}} = \frac{v_{x}}{i_{x}} $$
AI: Thevenin and Norton equivalents typically involve independent voltage and/or current source(s). But your only current source here is \$g_m v_{\pi}\$ and it is dependent on \$v_{\pi} = v_{be}\$ (which in this case equals \$v_{ce}\$ because of the diode connection).
To find the equivalent resistance apply a test voltage \$v_x = v_{ce}\$ across C and E, and find the current \$i_x\$ through it. The current is
$$i_x = \frac{v_x}{r_{\pi}} + g_m v_{x}$$
where the first term comes from the current through \$r_{\pi}\$ and the second from the current through the dependent source \$g_m v_{\pi}\$. Also note \$v_{\pi} = v_x\$ (again, the diode connection). Now just solve for \$v_{x}/i_{x}\$. |
H: What's the purpose of a ferrite bead inductor on this circuit?
I'm studying the analog voltage reference circuit described in the AVR450 Application Note - Battery Charger for SLA, NiCd, NiMH and Li-Ion Batteries, which schematic is below (copied from page 38).
On page 40, there's a schematic showing the MCU connections for the charger where the analog reference circuit is used (picture below). Marked in red there's a component (a BLM-21) whose symbol looks like an inductor, but I'm not sure what exactly it is.
I found online that it seems to be a ferrite bead inductor.
My questions are:
What is the purpose of that component in the aforementioned circuit? It looks to me that it may be part of a LC filter with C9. Is that it?
What happens if I omit it?
AI: Yes, it's basically part of a low pass L-C (or R-C for high frequencies) filter for the analog Vdd on the chip (with C9). Ferrite beads act like very low resistance (< 1 Ohm) for DC, inductors (several uH) for low RF frequencies and they act like resistors (hundreds of ohms to 1K or more) for frequencies in the 100MHz range.
Ferrite beads are normally specified in ohms in the resistive region (relatively high frequency- usually 100MHz) where they are very lossy, but they have an inductive region at lower frequencies. Note that care must be taken with this kind of circuit that noise inherent in the supply does not resonate at high Q with the ferrite and capacitor or the bead may actually result in more noise on the power rail. A good reference on beads can be found here. This sort of thing can cause all kinds of grief if the SMPS noise is (or has a harmonic) close to resonance and it changes with loading or input voltage or temperature to move in and out of resonance.
If you simply omit it the chip will not work properly since there will be no power supplied to Avcc. If you replace it with a short, the chip will operate normally, however you may see somewhat higher noise on ADC readings and possibly other subtle effects on analog performance.
R33 may have been a thought to allow for a ferrite bead in the analog ground (usually not a good idea) or it may be used as a net tie to enforce a single point connection between the analog ground nets and the ground. |
H: Why is there a 0R resistor linking GND and AGND in analog voltage reference circuit?
This is related to another question I've just posted (What's the purpose of a ferrite bead inductor on this circuit?), regarding the battery charger described in the AVR450 Application Note - Battery Charger for SLA, NiCd, NiMH and Li-Ion Batteries, which one day I hope to build.
On page 40, there's a schematic showing the MCU connections (picture below). Marked in red is a 0Ω resistor that is puzzling me. I suspect that it is just a wire jumper linking AGND and GND. But I don't understand why there's a jumper there.
My questions:
What does the jumper represent?
Why are AGND and GND separated like that?
AI: Digital circuits are noisy, but they can (mostly) handle their own noise without noticing. Analog circuits notice noise a lot; in fact, they have to pass noise just like a signal because they really can't tell the difference.
The best way to keep digital noise out of analog circuits is to keep them separate, both physically and electrically. But they have to be connected somehow in order to convert from one to the other, hence the jumper in exactly one spot, which is probably next to the converter on the physical board. |
H: Charger light circuit
I have a charger light. It gets charged by 220V AC supply. It can light 5 LEDs. I know that it needs to make the supply 220V AC to DC of lower voltage nearly 5V to 10V. Then it can charge the small battery. But I found no transformer in the circuit. There are simply some diodes resistors and capacitors.
I want to know how the circuit works. I want to know how the small battery can be charged with so high voltage?
AI: It uses the large capacitor to "drop" the AC voltage down to a low value that can be rectified and fed (possibly via a resistor for some current limiting) to the battery. It's circuit might be something like this: -
The circuit above is possibly more complex than yours because it provides a semi stable 6.2V dc output (see the zener). I think your circuit will be similar in that there is a capacitor (2.2uF or maybe a slightly different value) that feeds the bridge then, I suspect, the battery will be where the 1000uF is.
The capacitor's impedance at 50/60 Hz will be a few kohms and at the battery's charging current will "lose" most of the AC voltage across it leaving maybe something like 5Vp-p going into the bridge.
The 470kohm resistor may be omitted on your circuit - it's used to discharge the 2.2uF cap when removed from AC - it could give quite a substantial tingle if someone handled the plug and the cap was still charged to a few hundred volts. |
H: Writing down logic of a circuit
I have this circuit :
I'm trying to write down the logic of every output (W,X,Y,Z), to get a truth table out of it :
W = NOT (A OR B)
X = NOT A AND B
Y = A AND NOT B
Z = A AND B
But when compares to the source, my truth table is wrong, so I know that my logics are all wrong.
I always start from the right to left everytime I want to understand a logic circuit, for example, in this case, output W is the output of an AND gate between two NOT parameters W = NOT X AND NOT Y, but where do "X" and "Y" in this case come from, obviously not A and B? Look at the logic circuit, I felt like I was lost in a maze! Any suggestions, or hints to help me to understand this kind of logic circuits easier is greatly appreciated!
AI: If you trace through and label the inputs of each AND gate, it makes thing clearer:
W = (NOT B) AND (NOT A), same as NOT (B OR A) by De Morgan
X = (NOT B) AND A
Y = B AND (NOT A)
Z = B AND A |
H: Measuring the input impedance of an oscilloscope
I am measuring the voltage drop on a 1MΩ resistor with an oscilloscope, and as I understand to get accurate readings I should compensate the internal impedance of my measurement device for such a high value resistor.
It's a Tektronix TDS2024C oscilloscope, from the manual I know that it has a 1MΩ internal impedance and I'm using a 10x attenuation probe, which should have a 9MΩ resistance. According to everything I read that should add to a 10MΩ internal impedance, even though I'm not quite sure why and would like to know it a little more accurately.
So, two questions:
Are there any simple methods to measure the input impedance of an oscilloscope accurately instead of taking the word of the manufacturer?
How does the input impedance add to 10MΩ anyways, if the internal resistance isn't connected in series? Shouldn't it form a voltage divider for 0.91MΩ? Schematic below:
AI: Ignore the capacitors, cable etc. and just consider the resistors. From probe tip to ground you have 9MΩ in series with 1MΩ - that's 10MΩ! You can verify this by measuring the resistance between probe tip and ground with a multimeter (on 20MΩ scale).
Of course this only applies to DC. At higher frequencies the impedances of the capacitors and cable become significant. At 50MHz the reactance of a 10pF capacitor is about 300Ω. |
H: Why are these Fourier transform values not as expected?
We are being taught Fourier Transform in our EE course this semester and I have several questions about it. The answers do not need to be rigorous and mathematical, all I need is an intuitive 'feel' of the Fourier Transform. I may be completely wrong at certain points so feel free to point it out.
Is the FT of a continuous function \$ x(t) \$ approximately equal to the DFT of the discreet-time version of the same function?
In other words, if
\$ X(\omega) \$ if the FT of \$ x(t) \$
\$T\$ is an array containing closely spaced values of time (for example [-10:0.001:10])
\$y\$ is an array containing \$x(t)\$ \$ \forall\$ \$ t\in T\$
\$ Y \$ is an array containing the DFT of y
\$ Y'\$ contains values of \$ X(\omega) \$ for corresponding \$ \omega\$
Then is \$Y \approx Y'\$
Can someone please explain the result of the following code
t = [-10:0.001:10]
x = sin(t)
y = fft(x)
z = abs(real(y))
I expected z to be an array of real numbers containing a sharp peak as the FT of a function gives the spectrum of frequencies contained in the fourier series representation of the function. But it turned out that the maximum was 4.32 and the mean of all values of the array was 0.55, which does not seem to be what I expected.
Is there something wrong in the way I am interpreting the fourier transform? How do I need to proceed if I need to calculate the frequency spectrum of this function?
AI: Intuitively the DFT and FT are similar. As the other poster pointed out, the main difference is that sampling in the time domain is equivalent to repetition in the Frequency domain, so the DFT will have repeated spectra at multiples of the sample frequency.
Two problems here.
i) abs(real(y)) is incorrectly being used. You need the absolute value (or magnitude) of both the imaginary and real components ... abs(y).
ii) You're seeing the effect of spectral leakage because the DFT assumes a repetitive signal; i.e. the maths "assumes" the signal you applied is repeated infinitely. Your signal will have discontinuities in this case.
Try the following code:
t = [-10*pi:pi/10:9.9*pi]
x = sin(t)
y = fft(x)
z = abs(y)
You should see this: |
H: Using XR2206 function generator with split supply
I have an Exar XR2206 to generate triangle wave with single supply Vcc. This wave has peak value 12 volt and 0 volt.
How to make this IC operate in split-supply?
Hence I got triangle wave with peak value +6 Volt and -6 Volt.
AI: The XR2206 will operate just fine from split supplies. All you have to do is tie all ground pins to V-. See pages 10 and 11 of the datasheet. |
H: What size crimp connector for 2.54mm headers?
I have a few pin headers on my board which are the standard 2.54mm spaced pins (datasheet), and I'm trying to find the appropriate female crimp connector which will connect to it, exactly like the one below:
However, I'm having trouble determining the size of the crimp connector. The datasheet says that the male header is 1.1mm, so 17 AWG.
What is the size and shape (and hopefully if known, the name) of the crimp connector I need?
AI: I think you can use the below connector
http://uk.farnell.com/fci/65039-036lf/connector-receptacle-2-54mm-1way/dp/2112430
And for crimp
http://uk.farnell.com/fci/47745-001lf/crimp-socket-22-26awg/dp/1097977?MER=en-me-pd-r2-acce-con |
H: Powering a large DC motor from the mains
I scavenged a 220 volts DC motor from a large photocopy machine.
How can I best get a suitable 220 volts DC supply when our local main supply is 240 volts AC? Since the voltages are so close is there a cheap way to convert type of current on a one-to-one basis like this?
AI: How was it powered in the original copier?
Is it a permanent magnet motor, or does it have a field winding?
EDIT : the linked picture strongly suggests a PM DC motor NOT a Universal motor so the main part of this answer is wrong. Left for the moment but it should probably be deleted.
If the latter (most likely for an older large DC motor) it's actually a "Universal" motor and will work equally well off AC or DC. And a close inspection of the copier will probably reveal a connection directly to the AC supply.
Universal motors work on AC because, when the voltage to the rotor reverses polarity, so does the voltage supplied to the field coil, so the resulting "push" remains in the same direction.
Then a straight connection to 230V AC would be better (the right voltage!) than converting the incoming AC to DC, which, if you smoothed it with a reservoir capacitor, would give you somewhere over 320V DC.
On the other hand if it is a permanent magnet rotor, a bridge rectifier and no smoothing capacitor will generate "dirty DC" of the right RMS voltage. But be aware that the peak voltage is still too high, which could stress the insulation. |
H: Why is an op amp's bandwidth higher at lower gains?
If I build a resistor network where the op amp has a lower gain, it is able to maintain its gain for a larger bandwidth. Why?
AI: This is called constant gain-bandwidth product but it isn't true for every op amp. It is only true for voltage feedback op amps which use dominant pole compensation for stability. Such op amps can be approximated as a first order system since one pole dominates all others and the others can be ignored. (However, this is not true of current feedback op amps since current feedback op amps do not have a constant gain-bandwidth product.)
A first order system has a transfer function of the form
$$H(j\omega) = \frac{H_0}{j\omega\tau + 1} = \frac{H_0}{j\omega/\omega_c + 1}$$
where \$H_0\$ is the DC and passband gain, \$\tau\$ is the time constant of the dominant pole and \$\omega_c\$ is the cutoff frequency (bandwidth). The gain of this system is
$$|H(j\omega)| = \frac{H_0}{\sqrt{(\omega/\omega_c)^2+1}}$$
For \$\omega << \omega_c\$ the gain is approximately \$H_0\$ and the bandwidth does not come into play. If \$\omega >> \omega_c\$ the gain-bandwidth product can be approximated as
$$|H(j\omega)|\omega = \frac{H_0}{\sqrt{(\omega/\omega_c)^2+1}}\omega \approx \frac{H_0}{\sqrt{(\omega/\omega_c)^2}}\omega = H_0\omega_c$$
which is a constant. Since it is a constant, increasing the gain requires a decrease in the bandwidth while decreasing the gain allows an increase in the bandwidth. |
H: Does a capacitor discharge itself when the charging voltage becomes 0?
I am charging my capacitor with a binary pulse train (either 1V or 0V). I notice that when the voltage stays at 0V, the capacitor discharges itself.
As shown, the green curve signal is connected to one terminal of the capacitor, and the blue curve signal is the voltages across the capacitor.
Is this expected? Previously, I thought the voltage will rise when 1V but never fall when 0V. So I am expecting voltage across the capacitor to be a "staircase" waveform.
AI: Is this expected? Previously, I thought the voltage will rise when 1V
but never fall when 0V. So I am expecting voltage across the capacitor
to be a "staircase" waveform.
What you are looking to achieve is called an integrator. With an integrator, the output stays where it formerly reached before the input dropped to 0V thus, it kind of latches the amplitude - it has nothing to integrate anymore and the output stays constant until the input rises to some other no-zero value. |
H: ISA efficiency code compaction and memory traffic
I'm having issues understanding this problem and am new to ISA's. Here's a problem with 3 questions and my biggest question is, what is supposed to happen? Specifically, the HLL Code at the bottom.
Assume four ISAs
accumulator-based
stack-based
memory-to-memory (operands located in main memory)
register-based (pure load/store)
Instruction / data size
all data operands 4 bytes
all memory addresses are 16 bit
all opcodes 1 byte
memory address fields 2 bytes wide
register fields in load/store machine are 4 bits wide (16 32-bit registers)
Additionally, all memory addresses are 32-bits long and all instructions and data are fetched in one single memory access in the case of memory-memory architecture, no need to use additional memory location.
Compile code for four ISA's and determine the metrics: 1) code size 2) data memory traffic, including addresses, 3) instruction traffic, including addresses.
HLL code:
A = B + A
C = A - C + D
AI: As a hint to get you started, here are some possible instruction sequences for the first HLL statement:
Accumulator-based
load A
add B
store A
Stack-based
load A
load B
add
store A
Memory-to-memory (2-address)
add B, A
Register-based
load A, r1
load B, r2
add r2, r1
store r1, A
Your job is to figure out how big each instruction is, and also what the memory access patterns are for both instruction and data operations as each sequence executes. |
H: Info on transformers? Where to find?
I'm quite often taking things apart to salvage the parts and use them in my projects. Right now I'm taking apart an old PC-power supply for a switch-mode lab-supply project.
The power-supply in question is Delta Electronics DPS-460DB A. Below is a picture of the transformer that I've tried to find info about. Essentially what I'm asking is how in the world does one find basic information on transformers, just like other components? This is not the first time I've pulled my hair out after surfing the "deep-web"(not THE deep-web of course) for info about a transformer and scored absolutely zero. Are almost all transformers custom parts and therefore lack a basic, public, datasheet? What's going on here?
AI: You've got it right. Many (though by no means all) power supply magnetics are custom parts. Your best bet is to try to find the manufacturer of the transformer and see if they list the part on their website. You could also contact them and ask. But odds are a custom magnetics manufacturer won't hand out information about their customers' proprietary designs. This is especially true if the magnetics manufacturer is also the power supply manufacturer.
I'm afraid if you want to understand that transformer, you'll have to take it out and analyze it. |
H: How do you determine graded versus abrupt diode junction types?
The problem
When a diode is reverse biased with 8V, it has a junction capacitance of 15pF.
When the reverse biased is increased to 12V, the capacitance drops to 13.05pF.
Find whether it's abrupt or graded junction.
The solution
The capacitance of abrupt junction diode varies inversely with the square root of applied voltage. If it's abrupt type, then:
$$C_{12} = C_8\sqrt{\frac{8}{12}} = 15\sqrt{\frac{8}{12}} = 12.24 \; pF$$
The capacitance of graded junction diode varies inversely with the cube root of applied voltage.
If it's graded type then:
$$C_{12} = C_8\sqrt[3]{\frac{8}{12}} = 15 \sqrt[3]{\frac{8}{12}} = 13.10 \; pF $$
Therefore, the given diode is graded junction type.
Now for my puzzlement, I didn't understand what is the criterion from which they deduced that it's a graded type and not an abrupt type, can some please explain?
AI: The junction capacitance of a reverse biased diode is given by
$$C = \frac{C_0}{ (1 + V_R/ V_0) ^ m }$$
Where
\$C_0\$: Capacitance at No applied voltage
\$V_0\$: Junction or built in potential
\$V_R\$: Applied reverse bias
\$m\$: Grading coefficient = \$1/2\$ for abrupt and \$1/3\$ for step graded junction
The rest is all math. Simply divide the two equations, one for 15 pF and other for 13.05 pF, and take the logarithm. The result is 0.33. So it is graded. |
H: How to get USART and USB-Serial working on the STM32F4Discovery Board?
I'm programming a STM32F407VG chip on the STM32F4Discovery board using CooCox CoIDE. I've stitched together a program based on some examples and tutorials I found online to get USART1 through pins PB6 and PB7, and USB-serial through the microusb port. I can get both working independently, but when I put them together, the USART doesn't work properly and sometimes spews out garbage. It seems that initializing the system clock changed my USART baudrate of 9600, but I'm not sure how to fix it.
Here is my code:
#define HSE_VALUE ((uint32_t)8000000) /* STM32 discovery uses a 8Mhz external crystal */
#include <stdio.h>
#include "misc.h"
#include "stm32f4xx_usart.h"
#include "stm32f4xx_conf.h"
#include "stm32f4xx.h"
#include "stm32f4xx_gpio.h"
#include "stm32f4xx_rcc.h"
#include "stm32f4xx_exti.h"
#include "usbd_cdc_core.h"
#include "usbd_usr.h"
#include "usbd_desc.h"
#include "usbd_cdc_vcp.h"
#include "usb_dcd_int.h"
#define MAX_STRLEN 12 // max string length in characters
volatile char received_string[MAX_STRLEN+1];
volatile uint32_t ticker, downTicker;
/*
* The USB data must be 4 byte aligned if DMA is enabled. This macro handles
* the alignment, if necessary (it's actually magic, but don't tell anyone).
*/
__ALIGN_BEGIN USB_OTG_CORE_HANDLE USB_OTG_dev __ALIGN_END;
// This funcion initializes the USART1 peripheral
void init_USART1(uint32_t baudrate){
GPIO_InitTypeDef GPIO_InitStruct; // this is for the GPIO pins used as TX and RX
USART_InitTypeDef USART_InitStruct; // this is for the USART1 initilization
NVIC_InitTypeDef NVIC_InitStructure; // this is used to configure the NVIC (nested vector interrupt controller)
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE); // Peripheral clock for USART1 (APB2) --> other USART uses APB1
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE); // Peripheral clock for GPIOB (PB6 = TX, PB7 = RX)
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7; // Pins 6 (TX) and 7 (RX) are used
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF; // the pins are configured as alternate function so the USART peripheral has access to them
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz; // this defines the IO speed and has nothing to do with the baudrate!
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; // this defines the output type as push pull mode (as opposed to open drain)
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_UP; // this activates the pullup resistors on the IO pins
GPIO_Init(GPIOB, &GPIO_InitStruct); // now all the values are passed to the GPIO_Init() function which sets the GPIO registers
/* The RX and TX pins are now connected to their AF
* so that the USART1 can take over control of the
* pins
*/
GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_USART1);
GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_USART1);
/* Now the USART_InitStruct is used to define the
* properties of USART1
*/
USART_InitStruct.USART_BaudRate = baudrate; // the baudrate is set to the value we passed into this init function
USART_InitStruct.USART_WordLength = USART_WordLength_8b;// we want the data frame size to be 8 bits (standard)
USART_InitStruct.USART_StopBits = USART_StopBits_1; // we want 1 stop bit (standard)
USART_InitStruct.USART_Parity = USART_Parity_No; // we don't want a parity bit (standard)
USART_InitStruct.USART_HardwareFlowControl = USART_HardwareFlowControl_None; // we don't want flow control (standard)
USART_InitStruct.USART_Mode = USART_Mode_Tx | USART_Mode_Rx; // we want to enable the transmitter and the receiver
USART_Init(USART1, &USART_InitStruct); // again all the properties are passed to the USART_Init function which takes care of all the bit setting
USART_ITConfig(USART1, USART_IT_RXNE, ENABLE); // enable the USART1 receive interrupt
NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn; // we want to configure the USART1 interrupts
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;// this sets the priority group of the USART1 interrupts
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; // this sets the subpriority inside the group
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; // the USART1 interrupts are globally enabled
NVIC_Init(&NVIC_InitStructure); // the properties are passed to the NVIC_Init function which takes care of the low level stuff
USART_Cmd(USART1, ENABLE); // This enables the complete USART1 peripheral
}
/* This function is used to transmit a string of characters via
* the USART specified in USARTx.
*
* It takes two arguments: USARTx --> can be any of the USARTs e.g. USART1, USART2 etc.
* (volatile) char *s is the string you want to send
*
* Note: The string has to be passed to the function as a pointer because
* the compiler doesn't know the 'string' data type. In standard
* C a string is just an array of characters
*
* Note 2: At the moment it takes a volatile char because the received_string variable
* declared as volatile char --> otherwise the compiler will spit out warnings
* */
void USART_puts(USART_TypeDef* USARTx, volatile char *s){
while(*s){
// wait until data register is empty
while( !(USARTx->SR & 0x00000040) );
USART_SendData(USARTx, *s);
*s++;
}
}
/* Initialize USB, IO, SysTick, and all those other things you do in the morning */
void init()
{
/* Set up the system clocks */
SystemInit();
/* Setup SysTick or CROD! */
SysTick_Config(SystemCoreClock / 1000);
/* Setup USB */
USBD_Init(&USB_OTG_dev, USB_OTG_FS_CORE_ID, &USR_desc, &USBD_CDC_cb, &USR_cb);
/* Set up USART */
init_USART1(9600);
}
/* Main function */
int main(void)
{
init();
while (1)
{
uint8_t theByte;
if (VCP_get_char(&theByte))
{
VCP_put_char(theByte);
}
}
return 0;
}
// Interrupt Handlers
void SysTick_Handler(void)
{
ticker++;
if (downTicker > 0)
{
downTicker--;
}
}
void OTG_FS_IRQHandler(void)
{
USBD_OTG_ISR_Handler (&USB_OTG_dev);
}
void OTG_FS_WKUP_IRQHandler(void)
{
if(USB_OTG_dev.cfg.low_power)
{
*(uint32_t *)(0xE000ED10) &= 0xFFFFFFF9 ;
SystemInit();
USB_OTG_UngateClock(&USB_OTG_dev);
}
EXTI_ClearITPendingBit(EXTI_Line18);
}
// this is the interrupt request handler (IRQ) for ALL USART1 interrupts
void USART1_IRQHandler(void){
// check if the USART1 receive interrupt flag was set
if( USART_GetITStatus(USART1, USART_IT_RXNE) ){
static uint8_t cnt = 0; // this counter is used to determine the string length
char t = USART1->DR; // the character from the USART1 data register is saved in t
if( (t != '\n') && (cnt < MAX_STRLEN) ){
received_string[cnt] = t;
cnt++;
}
else{ // otherwise reset the character counter and print the received string
cnt = 0;
USART_puts(USART1, received_string);
//USART_puts(USART1, "\n");
//memset(received_string, 0, MAX_STRLEN+1);
}
}
}
Here is the USART example: http://eliaselectronics.com/stm32f4-tutorials/stm32f4-usart-tutorial/
and here is the USB example: https://github.com/xenovacivus/STM32DiscoveryVCP/blob/master/main.c
AI: Turns out the HSE value in the stm32f4xx.h file was set as 25000000 as default. I went in and editted the value to 8000000 and it works now.
So go into cmsis_boot > stm32f4xx.h > line 92:
Change from
#define HSE_VALUE ((uint32_t)25000000)
to
#define HSE_VALUE ((uint32_t)8000000) |
H: Difference between a magnetic field sensor and a hall effect sensor
I can't understand the difference between a magnetic field sensor and a hall effect sensor, to me are both the same.
I have a voltage detector pen that I can use when I troubleshoot my house I believe it detects the electric field (magnetic), but that's it.
If I wanted to make a circuit with a sensor that knows when any kind of metallic object is nearby, which kind of sensor would I have to use?
What kind of sensor do supermarkets use?
How can I increase the detection distance of such sensors?
How could I detect (for example) a car passing by the street with my sensor?
AI: 1) If i wanted to make a circuit with a sensor that knows when any
kind of metallic object is nearby, which kind of sensor would i have
to use ?
You need to use a metal detector to detect a metallic object i.e. an object that can pass current or modify a magnetic field it comes into vicinity of. A metal detector generates an alternating magnetic field which will induce eddy currents into a metallic object. These eddy currents remove energy from the magnetic field and this is detectable. Non conducting materials like ferrite are also detectable because of the permeability of the material modifies the applied magnetic field in a different way to induced eddy currents. Metal detectors.
2) What kind of sensor do supermarkets use?
If you are talking about shop products that have a tag read this. These generally use a 13.56MHz magnetic field and operate very similarly to a metal detector.
3) how can i increase the detection distance of such sensors?
This can be done on metal detectors by spacing the transmit and receive coils out further and piling more electrical energy into the transmit coil. On RFID tags it's harder because the tag (the portable part) has to modify the imposed magnetic field in order to make itself detectable and with a larger incident field and coils further apart it rapidly becomes a really difficult job just to double the distance. Mag field reduces as a cube law so doubling the distance means 8 times less incident field and 8 times less received signal coming back. Net effect is a reduction in received signal relative to the incident signal of 64 : 1 (simplified math alert!). That's a big deal!!
4) how could i detect (for example) a car passing by the street with
my sensor ?
Most car sensors are buried in the road and pretty much operate on the principles of metal detection. |
H: Why do microcontrollers have so little RAM?
Maybe this is more of a perceptional problem, but it seems like microcontrollers have advanced by leaps and bounds in the last 20 years, in almost all regards, higher clock speed, more peripherals, easier debugging, 32-bit cores, etc...
It is still common to see RAM in the 10's of KB (16/32 KB).
It doesn't seem like it could be an issue of cost or size directly. Is it an issue of complexity with the RAM controller above some threshold?
Or is it just that it isn't generally required?
Looking over a parts matrix at a popular Internet supplier, I see one Cortex M4 with 256 KB for less than US$8, and then for a few dollars more you can find a few more that are ROMless, but it seems pretty sparse...
I don't exactly have a need for a microcontroller with a MB of volatile storage, but it seems like somebody might...
AI: There are several reasons for this.
First of all, memory takes up a lot of silicon area. This means that increasing the amount of RAM directly increases the silicon area of the chip and hence the cost. Larger silicon area has a 'double whammy' effect on price: larger chips mean less chips per wafer, especially around the edge, and larger chips means each chip is more likely to get a defect.
Second is the issue of process. RAM arrays should be optimized in different ways than logic, and it is not possible to send different parts of the same chip through different processes - the whole chip must be manufactured with the same process. There are semiconductor foundaries that are more or less dedicated to producing DRAM. Not CPUs or other logic, just straight up DRAM. DRAM requires area-efficient capacitors and very low leakage transistors. Making the capacitors requires special processing. Making low leakage transistors results in slower transistors, which is a fine trade-off for DRAM readout electronics, but would not be so good for building high performance logic. Producing DRAM on a microcontroller die would mean you would need to trade off the process optimization somehow. Large RAM arrays are also more likely to develop faults simply due to their large area, decreasing yield and increasing costs. Testing large RAM arrays is also time consuming and so including large arrays will increase testing costs. Additionally, economies of scale drive down the cost of separate RAM chips more so than more specialized microcontrollers.
Power consumption is another reason. Many embedded applications are power constrained, and as a result many microcontrollers are built so that they can be put into a very low power sleep state. To enable very low power sleep, SRAM is used due to its ability to maintain its contents with extremely low power consumption. Battery backed SRAM can hold its state for years off of a single 3V button battery. DRAM, on the other hand, cannot hold its state for more than a fraction of a second. The capacitors are so small that the handful of electrons tunnel out and into the substrate, or leak through the cell transistors. To combat this, DRAM must be continuously read out and written back. As a result, DRAM consumes significantly more power than SRAM at idle.
On the flip side, SRAM bit cells are much larger than DRAM bit cells, so if a lot of memory is required, DRAM is generally a better option. This is why it's quite common to use a small amount of SRAM (kB to MB) as on-chip cache memory coupled with a larger amount of off-chip DRAM (MB to GB).
There have been some very cool design techniques used to increase the amount of RAM available in an embedded system for low cost. Some of these are multi chip packages which contain separate dies for the processor and RAM. Other solutions involve producing pads on the top of the CPU package so a RAM chip can be stacked on top. This solution is very clever as different RAM chips can be soldered on top of the CPU depending on the required amount of memory, with no additional board-level routing required (memory busses are very wide and take up a lot of board area). Note that these systems are usually not considered to be microcontrollers.
Many very small embedded systems do not require very much RAM anyway. If you need a lot of RAM, then you're probably going to want to use a higher-end processor that has external DRAM instead of onboard SRAM. |
H: What data format do audio cassettes use?
How do the sound pressure values correspond to the magnetic domains on the tape? Is the format analog or digital?
AI: It's analogue. A high-frequency 'bias' carrier has the incoming audio signal superimposed onto it, and the result is sent to the recording head, which is just an electromagnet.
The purpose of the bias is to drive the magnetic material around and around its hysteresis curve, so as to avoid the non-linear part of the curve close to the zero-crossing. |
H: Impedance mismatch
When I connect an oscilloscope to a function generator use both oscilloscope cable (one connect to the scope and one connect to the FG), I got 700mVpp when outputing a sine wave of 1Vpp and 10kHz.
But when I use the BNC cable connects to the FG, and the scope cable connect to the scope I got 2Vpp output with the same input.
What is the exact calculation behind this?
AI: If you're saying that the open-circuit output of the function generator is 1VPP and that when you connect it to the scope the scope reads 700mVPP, then if your scope's input impedance looks like 10 megohms paralleled by some few picofarads:
EDIT: 1 megohm paralleled by some few picofarads:
the generator impedance looks like 428k ohms, so clearly something's very wrong.
Do you have your scope's impedance set at 50 ohms, perhaps, and with half of 1VRMS coming from a 50 ohm function generator you're reading 0.7V peak from the scope? |
H: How to design a switch for my integrator?
I have an inverting integrator
that integrates the input signal (green) into the blue signal.
If I do nothing, the integrator output will go down and down and down... I don't want this. I want to reset my integrator back to ~9V when the second green pulse comes.
With some knowledge in digital circuit, I already produce the "switch signal" (green narrow pulses) as shown below.
Finally, I need to build a switch circuit that resets the integrator (basically C1) every time it sees the green narrow pulse. How could I build this switch circuit?
My Attempt
I tried using an npn BJT who is on when V_{BE}>0 and V_{BC}>0. However, this is not working, maybe because my green pulse is only 1V (from digital circuit) and the integrator output is as high as 9V. There is no way whereby V_{BE}>0 and V_{BC}>0. Also, I feel this way, the switch circuit is somewhat "disturbing" the integrator.
AI: Funny but it seems like a very similar question has been asked just recently, and a piece of a circuit I've used before may help you too. This would be my approach.
You would have to set the voltage divider resistors at the (+) input of the left OP amp so that the input pulse would cross the threshold. If you think the pulse will be less than perfect, you might also want to experiment with an high added resistance to offer some hysteresis. When the pulse goes high, the output of that first OP am will quickly switch low, and the output of the integrator will begin to rise slowly over time. When the pulse goes low, however, its output will quickly switch high, and the output of the second OP AMP will drop almost immediately, like a RESET. This is due to the much lower resistance (and hence shorter) integration timing for the RESET case. You can reverse the action to behave like your version by switching the twodiode resistors, putting the voltage divider on the (-) input of the first OP AMP, and feeding your input to its (+) input through an additional resistor. The important thing is that now you'll have a RESET after each pulse event. If you were sampling the output of the second OP AMP, and saving the highest result recorded every time the pulse went low, you will a have a good measure of the pulse duration. In addition, I'd argue that resetting AFTER the event is always better than resetting at the start of the event. The reason is that any reset is likely to take a short but still non-zero amount of time. So resetting AFTER the accumulation ensures that any reset time does NOT corrupt your pulse duration measurement. |
H: 5-stage pipelined implementation (RISC) of a microprocessor
I'm trying to solve two questions about a RISC 5-staged pipeline that is not exactly like MIPS found here (everything is included in this post).
Consider the non-pipelined implementation of a simple processor that executes only
ALU instructions in the figure. The simple microprocessor has to perform several tasks. First, it computes the address of the next instruction to fetch by incrementing the PIC. Second, it uses the PC to access the I-cache. Then the instruction is decoded. The instruction decoder itself is divided into smaller tasks. First, it has to decode the instruction type. Once the opcode is decoded, it has to decode what functional units are needed for executing the instruction. Concurrently, it also decodes what source registers or immediate operands are used by the instruction and which destination register is written to. Once the decode process is complete, the register file is accessed (the immediate data are accessed from the instruction itself) to get the source data. Then the appropriate ALU function is activated to compute the results, which are then written back to the destination register. Note that the delay of every block is shown in the figure. For instance, it takes 6 ns to access I-cache , 4 ns to access register file, etc.
a. Generate a 5-stage (IF, ID1, ID2, EX, WB) pipelined implementation of the processor that balances each pipeline stage, ignoring all data hazards. Each sub-block in the diagram is a primitive unit that cannot be further partitioned into smaller ones. The original functionality must be maintained in the pipelined implementation. In other words, there should be no difference to a programmer writing code whether this machine is pipelined or otherwise. Show the diagram of your pipelined implementation.
c. What are the machine cycle times (in nano seconds) of the non-pipelined and the pipelined implementations?
Attempt:
I'm thrown off by ID1 and ID2 as MIPS usually has Fetch, Decode, Execute, Encode, Memory.
But here's my try
a) diagram
F D1 D2 E WB
F D1 D2 E WB
F D1 D2 E WB
F D1 D2 E WB
F D1 D2 E WB
c) non-pipelined:
This would mean sequential progression, so 1) compute the address of next instruction to fetch by incrementing the PIC = 2+1 = 3 ns 2) PC to access I-cache = 6ns 3) instruction type decoder = 3.5ns 4) function decoder = 3ns 5) source, immediate, destination 2.5 + 3.5 + 4 = 10 ns 6) Register file = 4ns 6) ALU = 6ns 7) Register file = 4ns Total = 39.5 ns
pipelined:
very unsure
AI: Well, I'm really not sure.
This CPU description is incomplete, for example there is no branch nor data memory access.
For the non-pipelined version, there is only one visible clock, the program counter. It is possible to calculate the next PC address while doing the ALU operations, propagation time is 6+3.5+4+4+1+6=24.5 ns
All the decoders (source, operand...) are parallel, so only the longest delay is part of the timing "critical path". There is no clear indication of the delay needed for writing into the register file, maybe 4 ns more.
For the pipelined version :
F : I-cache : 6ns ( in parallel with the program counter update )
ID1 : Instruction decoder : 3.5ns
ID2 : Destination decoder : 4ns ( parallel with the other decoders, which are faster) + register file : 4ns
EX : ALU + MUX : 7ns
WB : register update : ??? ns
Max delay is around 8ns.
Alternatively, all decoding in ID1 (so 7.5ns) and register access in ID2 (4ns). Traditionally, the ALU is part of the EXECUTE stage.
Anyway, I think that this exercise is really poorly written. |
H: Stepper motor driver differences?
I have recently used a H bridge to control a small stepper motor obtained from a DVD drive and now want to look into controlling something larger, for example large Nema 23 steppers. From reading online I found that H bridges cannot be used for controlling such a motor and instead a "chopper circuit" is to be used such as the EasyDriver. This raises the first question:
Why can ordinary H bridge circuits not be used for larger steppers?
I kept reading about this to find an answer and then saw that many people are using drivers such as TB6600 instead of an EasyDriver. From what I can see, EasyDrivers cost around £1 whereas the TB6600 controllers are almost 10 times that! Why is there such a big difference, do they not just do the same thing? Why do so many people use these when there is such a large price difference?
AI: Plain H bridges can be used to control large steppers, provided that they have the current/thermal capacity. But it's not efficient to do so.
The problem with a stepper motor is that the windings have lots of reactive impedance, and a motor with fine steps, rotating at or above a moderate speed, will be trying to switch the current flowing through that inductance very quickly. Doing this requires a quite high voltage - eventually many times the voltage necessary to push rated current through a stationary coil which shows only resistive impedance.
The designer of a simple driver has a choice: they can size the voltage for the stationary case, and lose torque (and soon miss steps) as the step rate increases. Or they can size the voltage to overcome the inductance of the high speed case, and overdrive (and overheat) the motor when it is not turning.
An early solution was to use a very high voltage, and huge power resistors in series with the coils - in effect reducing the ratio between the total impedance in stationary and rotating cases. This was actually done on some early CNC conversions of full size bridgeport milling machines, but effectively means there's a resistive heater strapped to the back of the cabinet.
The modern, efficient solution is a chopping current drive. This is effectively an additional circuit which rapidly enables/disables an H bridge. When a step occurs, the winding is energized at a high voltage. A comparator then monitors the rise of current though the winding inductance over time (typically by sampling the voltage on a high power fractional-ohm sense resistor). When the current has risen to a set point level, the driver is disabled and the current falls. It's then re-enabled and the cycle repeats - as long as a given winding is commanded to be energized, it will be "chopped" on and off to achieve the specified current.
Ultimately a chopping drive is an H bridge - but one with an extra current regulator inserted between the step generator and the control signals to the FET's comprising the bridge.
NEMA23 is about at the dividing point for H bridge construction - anything much larger and you want an assembly of discrete power FET's, while for limited applications at that size and lower (desktop 3d printers, etc), you can probably use an integrated circuit bridge or complete driver circuit with chopper included. |
H: Is it possible to measure acceleration in sports activities with an accelerometer
I've been trying to make a simple prototype capable of measuring a punch or a shot put throw with an accelerometer, but suddenly stopped working, and "locked" into a value, has I was testing it.
When I was testing it, even tho I tried to make the code The most efficient possible to maximize the measurement frequency, sometimes I would get irregular values (low accuracy).
The way I tested my prototype was dropping it into a hard surface.
The components I used where:
Microcontroller (msp430g2553)
Display (QDSP 6064)
accelerometer (ADXL377):
- range: +/- 200g
- frequency response: 1000Hz
- absolute maximum g: 10000g
The code I used is the following (sorry, it's in portuguese):
#include <msp430.h>
#include <math.h>
#include <stdio.h>
#define CAT_1 BIT3
#define CAT_2 BIT4
#define CAT_3 BIT5
#define CAT_4 BIT6
#define SEG_A BIT0
#define SEG_B BIT1
#define SEG_C BIT2
#define SEG_D BIT3
#define SEG_E BIT4
#define SEG_F BIT5
#define SEG_G BIT6
#define SEG_DP BIT7
#define EIXO_X BIT0
#define EIXO_Y BIT1
#define EIXO_Z BIT2
#define BOTAO BIT7
unsigned int adc[3];
unsigned int eixo_x = 0;
unsigned int eixo_y = 0;
unsigned int eixo_z = 0;
unsigned int maior = 0;
unsigned int soma = 0;
float gx;
float gy;
float gz;
float gxy;
float gxyz;
int total;
char total_string[3];
int flag_display = 0;
const int zero_g = 512;
const float escala = 2.6165;
int i = 0; // tempo de atraso
void escolher_digito(int digito);
void escolher_numero(char numero);
void digito_um(void);
void digito_dois(void);
void digito_tres(void);
void digito_quatro(void);
void zero(void);
void um(void);
void dois(void);
void tres(void);
void quatro(void);
void cinco(void);
void seis(void);
void sete(void);
void oito(void);
void nove(void);
void vazio(void);
void atraso(void);
void main(void) {
WDTCTL = WDTPW | WDTHOLD;
P1REN |= BOTAO; // Ativa resistância interna para os modos "pull-up"/"pull-down"
P1IES |= BOTAO; // Selecionar botão de alto para baixo (modo "pull-up") (alto -> baixo, 1 -> 0)
P1IFG &= ~BOTAO; // Limpar a flag BOTAO antes de permitir interrupções
// Desta forma previne-se uma possível interrupção imediata
P1IE |= BOTAO; // Permitir interupções em BOTAO
_enable_interrupt(); // Permitir interrupções
P2SEL &= ~(SEG_G | SEG_DP); // Seleciona modo I/O para P1.6 e P1.7 (por defeito estão configurados para o cristal do relógio externo)
P1OUT |= CAT_1 | CAT_2 | CAT_3 | CAT_4;
P2OUT = 0;
P1DIR |= CAT_1 | CAT_2 | CAT_3 | CAT_4;
P2DIR |= SEG_A | SEG_B | SEG_C | SEG_D | SEG_E | SEG_F | SEG_G | SEG_DP;
BCSCTL1 = CALBC1_16MHZ;
DCOCTL = CALDCO_16MHZ;
ADC10CTL1 = INCH_2 + CONSEQ_1; // Canal máximo: A2, modo de conversão: sequência de canais
ADC10CTL0 = ADC10SHT_1 + MSC + ADC10ON; // Tempo de amostra: 8 x ADC10CLK ????????? alterar?
// Multiplas amostras e conversão (apenas válido para modo de sequência ou repetição)
// ADC10 ligado
ADC10DTC1 = 0x03; // Transferência de dados -> numero de transferências por bloco: 3
ADC10AE0 |= 0x07; // Ligar entradas analógicas A2, A1 e A0
for(;;) {
// Modo de observação (quando o display se encontra desligado) (ciclo infinito)
if(!flag_display) {
ADC10CTL0 &= ~ENC; // Desligar conversão
while (ADC10CTL1 & BUSY); // Esperar que ADC10 fique ativo
ADC10SA = (unsigned int)adc; // Copia dados em ADC10SA para o array adc
ADC10CTL0 |= ENC + ADC10SC; // Iniciar conversão de amostra
//__bis_SR_register(CPUOFF + GIE); // Modo de poupança de energia LPM0 (CPU e MCLK) desativados
// Permitir interrupções
soma = adc[2] + adc[1] + adc[0];
if(soma > maior) {
maior = soma;
eixo_x = adc[2];
eixo_y = adc[1];
eixo_z = adc[0];
}
}
// Modo de display (ciclo infinito)
if(flag_display) {
escolher_digito(2);
escolher_numero(total_string[2]);
atraso();
escolher_digito(3);
escolher_numero(total_string[1]);
atraso();
escolher_digito(4);
escolher_numero(total_string[0]);
atraso();
escolher_digito(1);
escolher_numero(' ');
atraso();
}
} // ciclo infinito
} // main
// Rotina de serviço de interrupção
#pragma vector = PORT1_VECTOR
__interrupt void P1_ISR(void) {
atraso();
switch(P1IFG & BOTAO) { // Se a flag de interrupção for ativada
// xxxx1xxx & 00001000 = 00001000
// xxxx1xxx & 00001000 = 00000000
case BOTAO:
P1IFG &= ~BOTAO; // Fazer reset à flag de interrupção
// Ciclo único
// Se o display não estiver ativo, fazer os cálculos para determinar a soma vetorial
if(!flag_display) {
// valor em Gs de cada eixo
gx = (eixo_x - zero_g) / escala;
gy = (eixo_y - zero_g) / escala;
gz = (eixo_z - zero_g) / escala;
// soma vetoral dos eixos
gxy = sqrt((gx*gx) + (gy*gy));
gxyz = sqrt((gxy*gxy) + (gz*gz));
total = gxyz - 1;
// Conversão de inteiro para string da soma vetorial
sprintf(total_string, "%d", total);
}
// Se o display estiver ativo, desligar display (ao calcar em BOTAO)
if(flag_display) {
// desligar display
//P1OUT |= CAT_1 | CAT_2 | CAT_3 | CAT_4;
P2OUT = 0;
}
// Ligar/desligar display
flag_display = !flag_display;
return;
default:
P1IFG = 0; // Caso ocorra outra interrupção em P1, limpar a flag
// Provavelmente desnecessário, mas uma boa prática
return;
} // switch
} // interrupção para P1
void escolher_digito(int digito) {
switch(digito) {
case 1: digito_um(); break;
case 2: digito_dois(); break;
case 3: digito_tres(); break;
case 4: digito_quatro(); break;
}
}
void escolher_numero(char numero) {
switch(numero) {
case '1': um(); break;
case '2': dois(); break;
case '3': tres(); break;
case '4': quatro(); break;
case '5': cinco(); break;
case '6': seis(); break;
case '7': sete(); break;
case '8': oito(); break;
case '9': nove(); break;
case '0': zero(); break;
case ' ': vazio(); break;
}
}
void digito_um(void) {
P1OUT |= CAT_1 | CAT_2 | CAT_3;
P1OUT &= ~CAT_4;
}
void digito_dois(void) {
P1OUT |= CAT_1 | CAT_2 | CAT_4;
P1OUT &= ~CAT_3;
}
void digito_tres(void) {
P1OUT |= CAT_1 | CAT_3 | CAT_4;
P1OUT &= ~CAT_2;
}
void digito_quatro(void) {
P1OUT |= CAT_2 | CAT_3 | CAT_4;
P1OUT &= ~CAT_1;
}
void zero(void) {
P2OUT &= ~(SEG_G | SEG_DP);
P2OUT |= SEG_A | SEG_B | SEG_C | SEG_D | SEG_E | SEG_F;
}
void um(void) {
P2OUT &= ~(SEG_A | SEG_D | SEG_E | SEG_F | SEG_G | SEG_DP);
P2OUT |= SEG_B | SEG_C;
}
void dois(void) {
P2OUT &= ~(SEG_C | SEG_F| SEG_DP);
P2OUT |= SEG_A | SEG_B | SEG_D | SEG_E | SEG_G;
}
void tres(void) {
P2OUT &= ~(SEG_E | SEG_F | SEG_DP);
P2OUT |= SEG_A | SEG_B | SEG_C | SEG_D | SEG_G;
}
void quatro(void) {
P2OUT &= ~(SEG_A | SEG_D | SEG_E | SEG_DP);
P2OUT |= SEG_B | SEG_C | SEG_F | SEG_G;
}
void cinco(void) {
P2OUT &= ~(SEG_B | SEG_E | SEG_DP);
P2OUT |= SEG_A | SEG_C | SEG_D | SEG_F | SEG_G;
}
void seis(void) {
P2OUT &= ~(SEG_B | SEG_DP);
P2OUT |= SEG_A | SEG_C | SEG_D | SEG_E | SEG_F | SEG_G;
}
void sete(void) {
P2OUT &= ~(SEG_D | SEG_E | SEG_F | SEG_G | SEG_DP);
P2OUT |= SEG_A | SEG_B | SEG_C;
}
void oito(void) {
P2OUT &= ~SEG_DP;
P2OUT |= SEG_A | SEG_B | SEG_C | SEG_D | SEG_E | SEG_F | SEG_G;
}
void nove(void) {
P2OUT &= ~(SEG_D | SEG_E | SEG_DP);
P2OUT |= SEG_A | SEG_B | SEG_C | SEG_F | SEG_G;
}
void vazio(void) {
P2OUT = 0;
}
void atraso(void) {
for(i = 0; i < 0xFFF; i++) {
}
} // atraso
The design is pretty straightforward, here's a foto:
I'm afraid I broke the acceleration sensor or the microcontroller, but it could also be because its physically impossible to measure this types of accelerations due to unwanted noise from vibration or even amateurish coding.
Is it even possible to measure these physical properties in, for example, a shot put throw?
AI: Dropping a rigid object onto a hard surface produces accelerations in the thousands to tens of thousands of Gs, and you probably exceeded the 10 kG shock rating of your sensor.
There are better ways to test and/or calibrate accelerometers. You can start by turning it to different orientations and making sure you can measure gravity in both directions on every axis. You can put it on a turntable and measure the radial acceleration at various rotational speeds. Or you can get time on a calibrated "shaker table". |
H: Difference in the datapath of Load Upper Immediate to Load Word in a 32 bit MIPS processor
For the MIPS insturction Load Word I have got the following Datapath:
How does the datapath for the Instruction Load Upper Immediate looks like?
AI: I had these pictures sitting around except for the red lines.
The two instructions differ in semantics:
$t is the destination register, $i is an immediate value.
LUI:
LW:
The images are all links to their full size versions.
In a real implementation the muxes to the ALU could likely produce 0 and 1 constants.
And along the bottom of those pipeline diagrams the $t should actually be t, the pointer to the target or destination register. |
H: Determining whether piecewise function y[n] = {x[n] if n even, -x[n] if n odd} is time invariant
$$
y[n] =
\begin{cases}
x[n], & \text{if }n\text{ is even} \\
-x[n], & \text{if }n\text{ is odd}
\end{cases}
$$
My usual way of solving time invariance problems is to do this:
$$y[n-m] = x[n-m]$$
but I have no idea how to deal with the function splitting off into 2 cases.
AI: Hint: You can re-write \$y[n]\$ as
$$y[n] = (-1)^{n}x[n]$$
which has only one case. \$(-1)^{n} = 1\$ if \$n\$ is even so \$y[n] = x[n]\$ if \$n\$ is even, and \$(-1)^{n} = -1\$ if \$n\$ is odd so \$y[n] = -x[n]\$ if \$n\$ is odd. Does that help? |
H: Industry standard ways of connecting boards / modules?
There are literally thousands of different types of connectors when I'm searching on a distributor such as element14, and I'm not sure what are the "standard" ways of connecting boards together.
Currently, when I need to connect two different boards together, I will use a 2.54mm spaced pin header, and some ribbon jumper wires. While this is fine for prototyping, I want a more standard solution to connecting modules together (such as USB, D-Sub, HDMI connectors, etc).
Digital Communications
The protocols I normally use a I2C and SPI, so Vcc, GND, and the bus wires (SDA, SCL, MOSI, etc). For these protocols, are there any standard physical connectors which I should use when I want to connect boards together? e.g. RJ45 or something? I've always associated RJ45 with telephone comms, so not sure if there are more appropriate standard connectors.
Analaogue Communications
For example, if I want to drive a motor or fan, what type of socket should I use on my board? On computer fans, hard drivers, toys, etc. I have seen them use Molex or some tiny white connector. Is this a standard way of connecting analogue input/outputs? AFAIK Molex is a brand of connectors, but nowadays is it just a name for the type/shape of connector?
Protocol-less digital communications
For example, push button switches, and LED lights, etc. How should I connect these between boards?
Finally, in my latest project I need to connect my around 20 different connections (these include both vcc/gnd lines, analogue inputs, switch inputs, as well as an I2C line, and some multiplexer line select lines,) between two boards. Should I have different connectors for each of these, or is there one standard connector I can use for all the pins?
The distance of communication I'm talking about is 1 - 2 meters at most, however any information regarding longer range communication is also appreciated.
AI: Back in the day when I was doing this type of thing, I used to use the D-style connectors a lot for standard digital logic signals. They were cheap, came with pigtails already, and were a lot more durable than standard headers.
That said, there's not really a standard way to do it, because a lot depends on the electrical, environmental and mechanical needs. High power or low power? Do you see connecting and disconnecting it a lot? Does it need to be mechanically strong or can it be fairly flimsy because there isn't a lot of vibration or movement in the chassis? How many signals need to cross? How high speed are the signals...will they need a ground plane through the middle of the connector, or match a specific impedance?
Examples off the top of my head:
The edge connectors that PCIE cards use (like a graphics card in your PC) are cheap, but aren't really made to connect and disconnect a ton of times, so probably not good to use in a lab environment. The molex connectors are usually used for power connections because they can carry a ton of current, so they would probably be good in other high-current situations like driving motors. Are you fairly space constrained? There are a bunch of teeny, tiny connectors that cost a bundle.
The best is when I was working for a defense contractor and we were getting a bunch of Hellfire missiles back from the first Gulf War in the 90's. A bunch of them came back because the connectors that were supposed to connect the missile to the helicopter were getting a ton of sand in them and failing to make contact. And how were they tested? The ground crew had to put each missile on the helicopter rail and slam it back HARD to see if that particular missile was going to lock into place and make contact through the connector or if it went into the crap pile to try to clean out later and try again.
Anyway...there are no real standards. Just figure out what works best for your needs. Good luck!! |
H: Size of passives for active filter
I am working with the CS42436 codec, and in their datasheet, they have recommended values for components to be used in an active filter that takes the differential outputs from the DACs and converts them to a single-ended channel.
I have no problem with the values and what components to use, although I am concerned about the power going through the resistors and such. Right now, I am using the recommended design using 0402 resistors and capacitors. Apart from the assembly, will this size be okay for an active filter or do I need bigger components that can handle higher power?
AI: 0402 resistors might be rated for either 1/10 W or 1/16 W. You'll have to check the specs of the parts you're actually using (or, if you're buying off EBay or something, just assume 1/16 W).
Then you'll have to calculate for each one in the circuit, how much power it is consuming. For an analog filter, you want to consider the maximum input amplitude case.
If the power consumed is less than 0.5 or 0.75 of the rating, you are probably okay with 0402. If you power consumed is more than that, use a bigger part. You might even want to limit the consumed power to less than 0.5 of the rating to avoid self-heating causing your filter characteristics to drift, depending how repeatable you need the filter's performance to be. |
H: An Explanation of CMOS Logic
While trying to understand CMOS Logic on Wikipedia for class, I came upon this paragraph which I can't quite wrap my head around on the duality of CMOS:
An important characteristic of a CMOS circuit is the duality that exists between its PMOS transistors and NMOS transistors. A CMOS circuit is created to allow a path always to exist from the output to either the power source or ground. To accomplish this, the set of all paths to the voltage source must be the complement of the set of all paths to ground. This can be easily accomplished by defining one in terms of the NOT of the other. Due to the De Morgan's laws based logic, the PMOS transistors in parallel have corresponding NMOS transistors in series while the PMOS transistors in series have corresponding NMOS transistors in parallel.
Specifically, what does it mean that "All paths to he voltage source must be the complement of those to the ground"?
And how is this accomplished by defining one in terms of the NOT of the other?
Any explanation would be greatly appreciated, and if you can provide a simple example of this even better.
AI: It's actually quite simple, and it's based on two requirements:
Every node in the signal path must be connected to either Vcc or GND, to be at logical level 1 or 0 respectively;
There should never exist a conductive path between Vcc and GND, else it will short the supply and start draining a lot of current and possibly burning some parts here and there.
Therefore you must make sure that if the pull-up network is conducting, the pull-down is not. Hence their logical function must be the opposite. |
H: Clarification about FCC exemption for subassemblies
please kindly help me understand the "subassembly" exemption of the Part 15 certification requirements regarding intentional radiators. I want to produce and sell a MCU board which includes wireless communication features built-in. Obviously this board must be incorporated with other circuitry in a final product/system by the purchaser, in order to make a working product, so my product is not a "final product".
Does this qualify as a "subassembly" and thus would be exempt from FCC certification requirements, or does the fact that it is an intentional radiator nullify the "subassembly" aspect?
Thank you.
AI: From my experience with this (several products, using various combinations of wireless devices), then if the wireless module you use (be it cellular, Bluetooth, BLE, Wi-Fi or ZigBee or ISM) includes an antenna, and the entire module (radio + antenna) has been tested per FCC requirements (and therefore has an FCC ID stamped on it), then you do not have to do any further testing.
Here is an exmple of the type of module I am referring to. Note the chip antenna on the upper left corner.
Note the one pictured above is pretty much blank. The real one I have on my workbench is covered with text and logos, including an FCC ID and CE mark.
As long as you have only one wireless device on your board, (and there are no other wireless devices on other boards) the person using it in their product should be able to use the FCC ID that is stamped on the module.
But, if you have a module that attaches to a separate antenna, and only the module was certified (or not), then you must test the combination together. Furthermore, if you have more than one radio in the final product, then they must be tested together, even if they have been certified separately.
This is my understanding. You should have it verified by someone else before proceeding. |
H: Assembler coding for ARM (Cortex-M0 and M3): is it possible/practical?
Unfortunately there are no questions on Stack regarding ARM and assembler at all.
My concern -- is time critical devices. Let's take for an example one of my AVR-based device (program compiled with GCC) which should do something up to INT0 interrupt. It working with 8 MHz internal oscillator (125 ns one machine cycle) but it took up to 5 microseconds to react for the interrupt. After the code investigation I came to the conclusion that in the beginning of interrupt service routine processor make a lot of work to save it's state which is almost uncontrollable for high level programming languages (such as C is). If I'd use assembler I could for example throw a pin change in the very beginning and keep the rest of necessary calculations after that. Or I could have much more control over the registers' use and therefore much less time to save those registers.
If I'd go to ARM (which I'm planing to do soon) I will have much faster processor core with much more registers and memory space which looks promising. But will I ever be able to have any control over such time critical processes to obtain for example reaction time within let's say hundred nanosecs'?
AI: It's very reasonable to program ARM in assembler. It's a straightforward RISC architecture with few surprises and plenty of registers. You can mix C and assembler provided you have a good understanding of the calling conventions.
There is a special low-latency ARM interrupt mode called FIQ, which swaps out some of the registers to a bank in hardware so they do not need to be saved in the ISR. 100ns latency to doing something useful is still going to be hard - at 100MHz that's 10 clock cycles, and FIQ takes up to 12 before it executes the first instruction. |
H: Do "blown" fluorescent lights still use electricity?
When a fluorescent light fixture goes out, it often flickers and then after a while stops shining altogether. When this happens and when it finally dies is the circuit broken and does it still use electricity?
I don't understand too much what exactly is spent or breaks in a fluorescent light bulb when it is at the end of its life and I would appreciate any explanation. Here's a video about what I'm talking about:
https://www.youtube.com/watch?v=NDnKEOeFJn0
AI: I'm going to go out on a limb and say this question is valuable from the point of view of electronic design, as it pertains to some fundamental understanding on how fluorescent lights work.
Fluorescent lights work by accelerating electrons from the cathode to the anode in an almost-vacuum environment. In this vacuum is mercury vapour, and when the electron hits a mercury atom, that Hg atom goes into an excited state and outputs one or more photons of UV light upon decay. These UV photons then hit the phosphor-based coating on the inside of the glass tube, which converts these UV photons to visible white light.
So, in order to function, it is vitally important for these lights to have a lot of 'free' electrons available to shoot at the mercury. One way to make electrons more mobile and likely to shoot off the cathode is to heat it up, and this is what a so-called 'starter' circuit does: it is essentially nothing more than a high voltage generator and a heating coil. The heating coil heats up the electrode to mobilize the electrons and the high voltage generator (usually just a resonant LC pump) creates enough voltage for the initial 'spark' to ignite the bulb. Once electrons start flowing and the lamp is 'on', the gas inside the lamp looks more like a plasma and is very conductive, so neither the high voltage nor the addition of heat is necessary to keep it working. Hence, it's just a starter, once the bulb is on, it is shut down.
Old-style starters would keep trying to fire the bulb even when the electrodes were entirely spent. This means that that heating coil would be running until its filament would burn out. In a lot of cases this would mean the bulb has a higher power consumption after it's died.
Modern electronic starters 'give up' after a few tries when they detect that the bulb won't start. After that they use up no or almost no energy until power is cycled to the starter. |
H: What does short to ground mean? How to do that?
I've just started a simple project using raspberrypi and a capacitive touch sensors breakout board. I had a few problems using I2C, but after some time of research I managed to get stuck on one only... On one of the forums I found an answer that solved the same issue for another user, so I'd like to try it out:
Turns out I forgot to short the ADD to GND to set address 0x5a.
The thing is, I don't really know what that means... Am I just supposed to solder ADD to GND? There's GND already on this board (apart form ADD). Do I just connect them both to GND? What does shorting to ground actually mean?
Thanks a lot for your help and sorry for the trouble :)
AI: Short to ground, just means to have a direct connection to Ground. A "short" is any direct connection between two nodes. In any circuit, technically, you have shorts everywhere, but the term "short to.." is generally used for ground or some power node.
So you have a direct connection between ADD and GND would be a short. |
H: Jump start car from lithium ion laptop battery
Building the actual circuits is beyond me at this point, but I'm wondering if it's technically possible to jump start a car from the power contained in a large lithium-ion laptop battery.
For example, I have this laptop battery with the following specs:
11.1V 8.4Ah 94Wh
And I see a car jump-starter product here with the following specs:
Battery Capacity: 12Ah
Gas powered vehicles - 4.0L and lower displacements
Jumpstart your car battery 20 times on a full charge
Would it be technically possible to MacGyver a connection that could jump start a small car (let's say 4-cylinder gasoline for the sake of example) from my laptop battery?
And if not, what is fundamentally different about the type of battery they use in the linked product that causes it to withstand the startup current?
AI: Yes, it can be done, with due care.
The laptop battery described could typically provide quite a few jump starts. Getting it to do so safely and effectively is "the trick". Read on ...
What is often not generally appreciated is that energy to turn the starter motor during a jump start does NOT come directly from jump-battery to starter but is first transferred from jump-battery to car-battery and then from car-battery to starter motor. (See note at end)
The starter motor draws hundreds of amps - probably 100-200 Amps in a very good situation and 400-600-800 Amps in various other cases. Even when the car-battery has been run flat by lights left on or whatever, it has the ability to accept energy from the external source and then to return it to the starter motor.
A 11.1 V LiIon battery probably has 3 cells in series.
11.1/3 = 3.7V/cell. Actual cell voltages will be about 4.2V fully charged and 3V dead dead, so the battery = 9V to 12.6V. It is OK to use down to about 9.3V. At 9V if it does actually charge you are in the area where it is doing damage to the battery to use it.
Issues are
If car battery is very flat its terminal voltage may be low enough that the laptop-battery provides more current than is wise. The laptop-battery can be damaged and lose cycle capacity and worst case can "vent with flame" - spectacular high energy melt down.
If the car battery is very high impedance due to eg major internal sulphation the voltage may be around 12V when open circuit. The laptop battery open circuit voltage may be lower than the car-battery voltage and no energy transfer may occur. This will probably not usually be what happens.
If the laptop battery was rather flat (around 9V) and the car battery had modest life in it (eg starter relay goes click-click-click but starter will not turn, headlights light dimly) then the car-battery voltage may be usefully greater than the laptop-battery voltage and the charging may occur in the opposite direction. Max safe charging voltage for your laptop battery is probably about 8.4A (A = Ah rate). A battery that may not start a car may happily deliver 10 x as much current as the laptop battery can safely handle.
"Vent with flames" / fireball / pyrotechnics may well eventuate. you'd be needing a new laptop battery. The car battery would not have noticed.
In many cases you may be able to 'just connect the batteries " +ve to +ve, -ve to -ve and get an acceptable result. But, as above, maybe not.
Adding a series diode of suitable current rating will protect against charging the laptop battery. You can still get excessive current the other way. And voltage available is reduced.
The laptop battery would be good for this purpose if properly used.
What is needed is some limit on safe maximum current, and a voltage for charging that is suited to the car battery in any state. You could make such but you can but them on ebay for less than you can make them for - or from China for perhaps slightly less again.
What you need is a power supply with Vin is at least 9V - 13V, Vout is say 13V-14V and current out is limited to say 5A. If the car battery loads down the supply then the current limit should work. such supplies probably cost in the $US5-10 range on ebay. You can pay more.
Note: You will find much discussion on whether jumpstart energy is first saved in the car battery. I'm wholly convinced that it is. I have started cars from battery packs joined with twisted connections and thin wire and connected to the battery by 3 feet + of "lamp cord.
Eureka! Very satisfying when it works. A starter motor would not even notice that such a battery was there.
If you have REALLY heavy jump start leads, big solid connecting clips and some luck then you may be able to jump start directly from the remote battery. I've seen it done once when all normal attempts failed. The AA was called and he had a monster battery and lead set. It only just worked and his leads nearly melted. It charged and ran OK after that and I have no idea why it behaved that way. ALL the jumps start packs sold have no chance of starting a car directly. |
H: MOSFET Cell Balancing Circuit
I'm designing a simple cell balancing for charging LiPoFe4 cells in series. In order to prevent overcharging, when on of the cells reach the maximum charing voltage, the microcontroller will enable the mosfet, to bypass the current to the next cell.
Consider the following circuit, where the 3.2V sources represent two cells, only with the top cell presenting the balancing circuit.
simulate this circuit – Schematic created using CircuitLab
For the mosfet I intend to use, the max threshold gate voltage is 2.5V. Assuming the worst case scenario, the botom cell being fully charger, I'll have a Vs of 3.2V. With the bypass enabled, I'll have Vg of 5V from the microcontroller. Thus, I won't achieve the Vgs = 2.5V, and the mosfet won't transit onto its 'on' state.
The question, what would be the best way of workaroud here, not changing the mosfet? I thought, maybe, add a greater voltage reference and control this one with the microcontroller,but I still think there's something simple I'm missing.
Thanks in advance!
AI: You could pull the gate up to the upper cell + terminal with the high value resistor and then pull it down to turn the MOSFET off, for example with a BJT or another MOSFET (open collector/open drain).
However, the "threshold" voltage is not what you want to look at-- you want a gate voltage that will guarantee a certain Rds(on) so as not to cook your transistor. The only iron-clad guarantee on that datasheet is for 4.5V Vgs, so I would suggest using a MOSFET with guaranteed performance (Rds(on)) with 3V or lower Vgs. Also you should take care that the voltage under fault conditions (for example with the battery removed) cannot come close to exceeding the Vgs maximum rating (usually 10-20V, but sometimes lower). The MOSFET gate oxide can be protected with back-to-back zeners (between gate and source), if necessary. |
H: Two conductors in a magnetic field, canceling each other's EMF?
If two conductors are in a changing magnetic field, oriented the same in the field, and they induced equal EMF's, can their wiring be oriented in a way that they can cancel each other's induced EMF?
So that that $$\epsilon_t= \epsilon_1 - \epsilon_2$$
Similar to twisted pair concept.
AI: Yes, this is one of the things coaxial cable and twisted pair cable try to do. Ideally, each conductor sees the same magnetic field and thereby has the same EMF generated end to end. This affects the common mode voltage, but not the differential mode voltage. Systems that use such cables are usually designed to use the differential voltage only, and allow for some common mode offset.
Twisted pair ethernet is a common example of this. The ends are transformer coupled, so only the differential mode voltage matters. The common mode voltage can be up to whatever the insulation of the cable and the transformers at each end can handle. If I remember right, the ethernet standard requires ends to be able to handle 100s or volts of common mode offset, or maybe 1000 volts. I don't remember the exact number, but it's enough to allow one device riding on a 240 V power line with the other device tied to ground. |
H: Prevent loss of Large Signal Voltage Gain at low Rload
Operational Amplifiers (opamps) have the tendency to drop their Large Signal Voltage Gain when the load is too low. This behaviour is usually described in the datasheet. Loads of 500 ohm and lower usually result in very low gain.
How can I prevent this loss of gain?
I've tried using another opamp as a unity buffer, but the top of the signal gets clipped. I've tried a transistor, but the signal got distorted. My target load is 50 ohm and the signal is a triangle in 50 - 10000 Hz range, 0 - 10 V. The opamps in use are LT1077.
EDIT: I'm aware of the trouble the LT1077 has at low loads. I'd hoped there would be a buffer solution like I tried with the transistor (as far as I know though, Class A are used when the load gets too heavy, not when too low).
When trying the transistor, the top of the signal got clipped. I made sure there was enough voltage available, so I'm not sure how that happened.
AI: You need an opamp with more output current. Search for power opamps. (LM675 and OPA544 are two I've used.) At 200mA you might get away with a TCA0372. Or use some audio driver chips if you don't care about DC.
Edit:(more thoughts, comments) Warning the LM675 has a minimum gain of 10. And all the power opamps I've looked at have some cross-over distortion. (Still looking for the perfect power opamp.) If your output is single sided, then you could use a transistor (Class A) with the transistor in the opamp feedback loop.. but that will waste a lot of power. Or make you own push-pull output stage. (again as part of the opamp feed back loop) |
H: Sniffing twisted pair without interupt
Is it possible, with an oscilloscope, scalpel and a lot of patient, to open up a network cable (twisted pair), and sniff the traffic? All without interrupting the network traffic.
So;
Use the scalpel to get inside the cables, one by one.
Use the oscilloscope to find out which cable does what.
Attach to the data cables and dump the packages.
Or will this disturb/beak the connection and make it unstable/impossible for the ends to talk to each others.
AI: This is possible in theory, but will be difficult in practise. One problem is that anything you attach to the cable will cause a impedance discontinuity, which can cause problems with the regular communication. Depending on the situation, it also allows the right kind of sniffer to figure out you're in there eavesdropping.
You want to put a relatively high resistance immediately connected to the cable. This resistance needs to be significantly higher than the impedance of the cable. For example, if you're breaking into normal ethernet, then the cable impedance is 50 Ω. You'd want to put at least 500 Ω resistors immediately on the lines so that your tap is contributing little in terms of impedance discontinuity.
However, the higher the frequency of the signals, the harder it will be to still make sense of the signals at the other end of the resistors. This is where you may have to carefully create a circuit, physically close to the resistors, to receive the signal. Once you interpret the signal into digital, you can then transport it by ordinary means to whatever you have decoding the data stream. |
H: Difference between TLC272CP and TLC272CDR
I was using an operational amplifier in my project from Texas Instruments. The series is TLC272. There are many different models. Could someone tell me the significance or the meaning of CP or CDR in different types of TLC272?
Can you please explain which one is better and how does it make a difference? And also what is a reel?
AI: They are different packages for the IC. Page 2 of the datasheet shows that CP is a plastic DIP package, and CDR is a small outline package. The R at the end means the ICs come in a reel; if there is no R then they come in tubes.
Performance may depend on the package -- you'll have to check the electrical characteristics in the datasheet to see what the differences are and if they matter to you (the package will be listed at the top of the electrical characteristics table). The package choice is mostly dependent on which you would prefer to use.
Reels are used for large quantities. If you only need a couple hundred (or less) units then you just need tubes. There is no difference in performance between tubes vs. reels -- it's just a difference in how the ICs are shipped.
This is what a reel of ICs looks like:
This is what a tube of ICs looks like: |
H: Using a bottle of water as a resistor
Today, while drinking some water from a \$500mL\$ bottle, I started reading the info about the water and found out that the conductivity (\$\sigma\$) at \$25°\$C is \$147.9\mu S/cm\$. So it came to my attention that maybe I could calculate the resistance of the water bottle, from top to bottom. After some measuring, I found out that the bottle can be approximated as a cylinder with \$18cm\$ height and \$3cm\$ base radius.
So we can do the following: \$R_{eq} = \frac{\rho L}{A}\$, where \$\rho = \frac{1}{\sigma}\$ is the resistivity, \$L\$ is the bottle's height and \$A\$ is the base area. By doing this, I got \$R_{eq} \simeq 4.3k\Omega\$.
Then, I bought a new full bottle, made a hole on it's bottom (of course avoiding leakages) and measured the resistance (with a digital multimeter) from this hole to the "mouth", at first making it so that only the tip of the probes touches water. The measured resistance was really high, ranging from \$180k\Omega\$ to even \$1M\Omega\$ depending on how deep in water I positioned the probes.
Why is the measured resistance so different from what I calculated? Am I missing something? Is it possible at all to use a bottle of water as a resistor?
Edit #1:
Jippie pointed out that I should use electrodes with the same shape as the bottle. I used some aluminum foil and it actually worked! Except this time I measured ~\$10k\Omega\$ and not the \$4.3k\Omega\$ I calculated. One thing I was able to notice while lighting a LED with water as a resistor was that the resistance was slowly growing over time. May this phenomenon be explained by the electrolysis that happens while DC current travels through water (the electrodes slowly get worse because of ion accumulation at their surfaces)?
This would not happen for AC current, right?
AI: The formula you use is valid for a certain area, but the size of your probes is nowhere near the area you used in your calculation. If you want a closer approximation, you'll have to use electrodes similar in size as the area you calculated the water column for, one flat on top, one flat at the bottom. |
H: Sending Signals over a Coaxial Cable
Recently I've been trying to understand how multiple signals can travel along a coax cable. Indeed, I have already read "How are multiple signals propagated in a coaxial cable?", but it doesn't seem to be exactly the same question, nor is it specific enough, so please don't mark this as a dupe.
So how exactly are multiple signals transmitted on different frequencies? For example, I'd like to send data between two devices using a 50-Ohm cable, and I have a 7MHz carrier and a 11MHz carrier. Do I simply couple the signals to the cable using 50-Ohm resistors? Or capacitors? Transformers? Or some kind of push-pull line driver?
In addition, what are the typical voltage levels for coax? I can only find maximum ratings. If I were to design a device
Finally, how are signals sent bidirectionally? I suppose I could implement an EIA RS-232 or RS-422 where I could simply send binary data as negative and positive signals. However, I'd imagine that it would only suffice for sending data in one direction. If the two devices is is trying to exchange data, and one device is trying to output +1V while the other device is trying to send -1V back, won't there be some sort of contention, so to speak? I could do an I2C and have the "master" device coordinate the whole thing to send signals both ways, but I really want to do it the right way and send RF signals.
Thanks for your help.
AI: Sending full duplex signals (biderectional) is not difficult but you have to have localized cancellation circuits at each end to remove the signal being locally transmitted leaving (mainly) the received signal. Telephones work in the same way - you can send and receive audio simultaneously and because of the cancellation circuits you can barely hear in your earpiece what you are transmitting thru the microphone. It's called a telephone hybrid: -
It doesn't need a transformer but one can be used to provide isolation and line impedance matching. Basically it's a wheatstone bridge where the line forms one limb and the driver (local transmission) is the "excitation". If the line impedance matches Zref, the receiver circuit gets 50% of the line signal coming down the line to it but, more importantly, it receives zero signal from the local transmission i.e. total cancellation of the locally transmitted signal.
When driving a 50 ohm coax with two signals at one end, each has to drive thru a 100 ohm resistor in order to maintain the impedance seen by the coax as 50 ohms. This prevents reflections and the normal problems associated with reflections.
Voltage levels are whatever you wish them to be. The higher the level the less possible chance of corruptions due to external influences but the bigger the possibility is that you might interfere with another system. Coax aint perfect and it can create EMI due to the data edges or carrier frequencies. |
H: Designing a stiff voltage source using an emitter follower
simulate this circuit – Schematic created using CircuitLab
I am new to electronics, and I am trying to do Exercise 2.2, page 67 of The Art of Electronics.
Use a follower with base driven from a voltage divider to provide a
stiff source of +5V from an available +15V supply. Load current (max)
= 25 mA. Chose your resistor values so that the output voltage doesn't drop more than 5% under full load.
According to my understanding, a BJT in emitter follower configuration has its emitter following the base, no matter what the emitter signal is fed to. Therefore, under normal operation the emitter follows the base (with a 0.6V difference because of forward voltage drop), and is not really influenced by what's connected to it.
We need to find resistor values so that even under maximum load current 25mA, the emitter voltage never drops below 5V - 0.05*5V = 4.75V.
If I set VE(minimum) = 4.75V, I(load,maximum) = 25mA, I can compute the corresponding minimum load resistance value but I believe this is useless and is meaningless.
If there is no load, I set VE = 5V. So VB = 5.6V. I would have used the voltage divider equation to find the ratio needed between R1 and R2, but I am not sure this is valid since there is a current going through the BJT collector.
I am kind of lost on what i need to do. It's the first design question I try, it seems like there are more unknowns than constraints and so we have to set some values, and I have no electrical intution/experience to know what to set to which value and why.
Thank you for your help.
AI: Here's an overview of the design process to get you started. I'll let you work out the exact calculations.
I would replace \$R_{\text{load}}\$ with an independent current source \$I_{\text{load}}\$ for your simulation (you can use your CircuitLab schematic for simulation once you add resistor values). Set \$I_{\text{load}} = 25\$mA since that is your worst case.
Pick a relatively large emitter resistor \$R_3\$. This simply provides a load to the transistor if the actual load isn't connected (e.g. \$I_{\text{load}} = 0\$). For example, use \$R_3 = 10\$k\$\Omega\$. If \$V_{\text{out}} = 5\$V then the current through \$R_3\$ is \$0.5\$mA and \$I_{E} \approx 25.5\$mA in the worst case (\$I_{\text{load}} = 25\$mA).
Next you need to determine the worst case (highest) \$I_B\$. Use the lowest \$\beta\$ in the transistor's datasheet (worst case) and then calculate
$$I_B = \frac{I_E}{\beta + 1}$$
Now in order to make the resistor voltage divider "stiff" you need to make sure that the unloaded bias current through the resistors (call it \$I_{\text{div}}\$) is at least 10 times the load current (in this case \$I_B\$ is the load for the voltage divider). Otherwise the load current draws too much current away from \$R_{2}\$, which causes the voltage at the output of the voltage divider decrease too much. This puts a constraint on the maximum value of \$R_1 + R_2\$ since
$$I_{\text{div}} = \frac{15}{R_1 + R_2} > 10I_B$$
This equation plus the voltage divider equation
$$\frac{R_2}{R_1+R_2}15 = 5.6$$
gives you two equations and two unknowns. |
H: Power an op amp when having only higher supplies
I have a +-24 V supply and I want to power an op amp. I initially tried an LM324 using a single +24V supply, but I then discovered that I want the op amp to be allowed to output negative voltages too (which the 324 can't). I could not find an op amp that can take e.g. max +-25 V so that I can connect it immediately to my supply. Would just a voltage divider do?
AI: A LM324 can handle up to 32 V supply, so ±15 V would work and give you most of the voltage swing a LM324 can have. A opamp takes relatively little current, so basic linear regulators will do. You've got plenty of headroom, so the 78xx series will be fine. You can use a 7815 to make +15 V from the +24 V supply, and a 7915 to make -15 V from the -24 V supply. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.