text
stringlengths 83
79.5k
|
---|
H: How do I wire Solid State Relays to a linear actuator
Sorry for the dumb question, but I only know enough to get myself in trouble.. I've searched through previous questions and haven't found an answer that dumbs it down enough for me.
I'm trying to activate a 12vDC 12amp linear actuator (https://www.progressiveautomations.com/linear-actuator-ip66#ig_lightbox2[gal]/0/) to travel in/out using 2 solid state relays. (https://www.automationdirect.com/adc/Shopping/Catalog/Relays_-z-_Timers/Solid_State_Relays/Panel_Mount_Relays,_Hockey_Puck_Style,10A_-75A(AD-SSR6_Series)/AD-SSR6M12-DC-200D)
Ultimately an Arduino will control the relays, but for now I'm manually activating them with a 9v transformer for testing purposes. Currently it works fine with 1 relay attached, but when I attach the 2nd it short circuits. I believe the issue is my ground connecting to both leads on the linear actuator, but I'm not certain on how to rewire. Do I need a relay for both positive and negative leads? (4 total)
Revised for changeover relay and diodes:
AI: With a simple switch type SSR you need to have a bipolar supply to use two of them.
simulate this circuit – Schematic created using CircuitLab
If you only have a single supply, you can use four of them in a full-bridge.
simulate this circuit
In both cases care must be taken not to turn on both sides at the same time.
Note: I also showed you how to add diodes to protect the SSRs from the switching spikes that may occur then the switches open. This may already be covered internally to the relays, but extra does not hurt.
You can also drive the actuator with a single, more traditional, mechanical change-over relay.
simulate this circuit |
H: DALI specification: help to understand the physical layer schematic
I am trying to understand an NXP circuit that has implemented the physical layer of the DALI specification. In particular, it is DALI master hardware. For the transmission (page 4), it says exactly:
For high signals of DALI1_TX, Optocoupler OK2 connects junction R2 and R3 to the DALI bus, which creates a drive current for the base of T1 that starts to conduct and short circuit the DALI bus via bridge B1.
But I understand just the opposite: when DALI1_TX is a high (3.3 V), the direct current through the optocoupler diode is zero and therefore, the optocoupler transistor is cut-off. Then, the base current of 'T1' is zero and the transistor is cut-off. What am I doing wrong?
The explanation for the reception (page 5) I do not understand correctly either. When the bus is idle, the 'OK2' optocoupler transistor is saturated and therefore, DALI1_RX is a low level. On the other hand, when there is a low level in the bus, the optocoupler transistor does not drive and DALI_RX is a high level. It is right?
Thanks.
AI: I think that the terminology is sort of messed up.
They refer to 1 bit as high signal.
They are not referring to the voltage on the wire.
The DALI1_TX and DALI1_RX are active low.
The signals are pulled low by an open collector output for a 1 bit and left floating for a 0 bit (pulled to 3.3V by the pullup resistor).
So the high signal is actually 0V on the wire. |
H: How to use this power supply?
I've needed to use a second power supply and been given this one by a friend, and I don't really understand how to use it fully. I also have a couple basic questions on use.
It has two screens, and I only understand the right half, which is the output current and voltage. Can anyone explain the left half?
Secondly, with the configuration i've connected it, measuring with a multimeter across + and Com shows 4.089V compared to + and - which shows 4.12V, why is this?
Thirdly when doing standard things like supplying a voltage to a circuit is it better do connect + to Com or -?
Thanks
AI: That looks like a dual supply.
The left side controls the negative voltage, the right the positive.
simulate this circuit – Schematic created using CircuitLab
When you measure from the + to the - you need to add the values shown in the two displays.
If you want to hook it up to something that needs a single supply, just use the right side and connect your thing to + and common.
BTW: With the Volts/Current button pushed in the meters will show the current being drawn by each supply instead of the voltage at the outputs.
Your difference between the displayed value and your multimeter value will be due to the calibration differences in each. In reality, neither is probably right.
Here is the PSU manual thanks to Ron Beyer. |
H: How to do with a capacitor that i can't buy
I would like to buy only 4 capacitors like this:
750pF
1600VDC
500VAC
5% tolerance
I only find it on mouser but MOQ is 2'000; almost same as me !
How I can deal with that? Should I try to find 2 capaciters totalizing 750pF and wire them in parallel ?
Thank you
AI: Try looking at parts with higher voltage ratings (when filling out the selection form select ranges)
a more durable capacitor should not adversely effect the operation of your circuit.
I found one on mousers site that was available in singles. |
H: How can I record video with single camera module of smartphones?
I want to record video apart from my smartphone(Let's say Samsung Galaxy S3) taking out it's camera module.I think it is possible because camera's microchip comes with itself.I mean I will connect camera to micro SD and I will give wanted DC current from battery and camera records and sends video to my micro SD card.If it is possible how can I do it?And how much voltage will be needed to record video continously?
AI: Your question shows no understanding of how the camera works, how SD works, the amount of processing that is required between the two or how electricity is used to do what you want. You need much study.
... and camera records and sends video to my micro SD card. If it is possible how can I do it?
To solve your problem you could connect the camera to the SD card using the circuits of a smartphone. i.e. Just use your phone. |
H: SR latch timing diagram or waveform with delay, help!
I'm having trouble solving these two problems (my solution and general solution showed):
What I did was follow the truth table and based on the combination on the graph draw the appropriate state with a delay of 10ns:
PLEASE HELP ME UNDERSTAND HOW TO DO IT AND WHERE I'VE GONE WRONG AS IM STRUGGLING TO DO THIS.
Thank you in advance.
AI: Note the path from Set to Q/ is only one gate delay, but from Set to Q is two gate delays. That is, when Set goes high, Q/ goes low one gate delay (10nS)later, which causes Q to go high one gate delay after that, for a total of 20nS.
Similarly, the path from Reset to Q is only one gate delay, but from Reset to Q/ is two gate delays.
You need to factor in those different delays into your timing diagram. |
H: Drive 6Vdc relay ( with coil resistance 68ohms ) with 20mA current source
I have a current source of 4-20mA and I need this to drive a 6Vdc relay.
I could not use passive Current to Voltage converter since the relay coil have resistance of 68 ohms and the voltage drops at output if the relay is connected.
Is there any compensating circuit for this issue?
AI: 20mA at 20V (a reasonable maximum assuming a typical 24V power supply) is 400mW. Your relay takes 530mW, so even with 100% efficiency it's dubious.
At 4mA it's not on the same planet.
If you really require a relay, consider using a telecom-style latching relay that can change position with a brief (tens of ms) pulse and then draws no coil current at all. |
H: Can GaN FETs be driven directly by logic level signals?
I've gotten interested in using GaN FETs for their combination of fast switching speed and very low on-state resistance. Most of the eval boards (for example by EPC) use GaN driver chips such as UCC27611 and LM5113 which regulate the gate voltage to 5V and clamp transients.
Now, looking at some of the smaller GaN FETs like EPC2037 which has 0.12nC gate charge or EPC2036 with 0.70nC, I'm wondering: is there any reason this cannot be driven directly from a 3.3V microcontroller pin?
If the microcontroller can source/sink 25mA, the switching time is in theory only 0.12nC/25 mA = 4.8ns, and that's without a driver (!!). The real switching time may not be quite as good of course, but it should still be super-fast compared to a non-GaN FET. I would like to tie the gate to a microcontroller pin without a gate resistor, if possible.
Now, I can see from the same datasheet that FET won't be fully on at 3.3V, but does this have any negative effect other than slightly higher heat dissipation? I'm okay with lower efficiency, just want to know if there are any pitfalls of the kind that could make the FET fail.
(My use scenario is switching 5V 1A at ~1MHz, I think 20-50ns switching times should be fine but faster is better. The microcontroller is STM32F103)
AI: Driving the gate to 3.3 V is within specification, so nothing bad should happen.
However, note that Rdson is only guaranteed for 5 V gate drive. The graph of Rdson as a function of gate voltage gives you some guidance what you will get at 3.3 V, but this is not a guarantee. It looks like you should expect around 600 mΩ. You can't base a volume design on "probably around".
Despite the marketing hype at the beginning of the datasheet about exceptionally low Rdson, the Rdson is actually quite high. The gate leakage current is also quite high.
It seems the unusual aspect of this FET is that it can switch 100 V with only 5 V gate drive. If you only need to switch 30 V, or can provide 10-12 V gate drive, there are much better FETs. This is definitely a specialty part. I haven't looked up the price, but I expect that says "specialty" too.
The package also pretty much requires hot air soldering for manual work, unlike a SOT-23 which can be soldered with a ordinary soldering iron. |
H: raspberry pi 3.3 to 5v level shift for led rgb strip
I'm working on my first electronics project. Basically I'm trying to control an rgb led strip from a raspberry pi's gpio pins. I'm trying to convert the raspberry pi's 3.3v up to the 5v required for the led strip. I bought these level converters https://www.amazon.com/gp/product/B0148BLZGE/ref=oh_aui_detailpage_o01_s01?ie=UTF8&psc=1. The docs for the level converters say both 3.3v and 5v need to be supplied at all times. Does this mean I need a seperate 3.3v power supply in addition to the led strips 5v power supply? This is assuming the GPIO pins should be sent through the channel pins on level converter and not through the 3.3v pin.
AI: That is a simple mosfet level translator. But there are two issues, see update:
It uses pull-ups to each voltage, to do the level translation from low side to high side, and back.
You need to connect the 5V power to the HV pin, the 3.3V power to the LV pin, and your GPIO to the appropriate pin.
The RPI has a 3.3V power rail you can use. It is fairly small in terms of current, but will work great for this purpose, as this circuit has a very low current need.
Update:
Based on the reviews on the amazon page, you either get a simpler board, with just mosfets and resistors, which work as I described above, or you get the pictured one, which includes a 3.3V regulator. In that case, all you need to connect is 5V, the Gnd, and the GPIO. |
H: Why use a "load switch" and not just one transistor as a switch
I am trying to understand the advantage of using a 'load switch" for switching applications.
The load switch (like the one below), has two transistors to do the job. Why can't I just use one transistor (bjt/fet) for doing the same thing?
AI: You could use a single FET, but there are several advantages to using a load switch IC.
Voltages higher than the micro voltage can be switched. (That can also be done by using 2 transistors. )
The load switch has inrush current limiting built in. This can be done with discrete components as well, but requires more engineering.
More often than not, load switches have monitoring, such as power good or overcurrent outputs, etc.
Tolerance analysis is easier when that entire circuit is on one die with guaranteed data on its performance.
As with all things engineering, trade-offs. |
H: iPhone not charging when plugged last
The power extension has two USB slots. I noticed that when a Xiaomi phone is plugged first, and then iPhone next, the iPhone doesn't charge. However, if it's done in reverse, iPhone first, Xiaomi second, the iPhone charges and so is the Xiaomi phone.
Why plugging in a particular sequence makes a difference whether the other phone will charge or not?
I also tried to swap the plugging of phone on the USB slots, same thing happens.
AI: I can offer the following explanation of your phenomenon. If you would search the EE site, you would find out that chargers do have various different "signatures", and phones might understand one signature but not other signature.
Since your iphone did take charge when plugged first, I would assume that your "power extension" ports have the Apple signature, likely in parallel. The Apple standard signature is 45k/75k voltage divider (or of this order of values) on D+ and D- lines; different combinations signify different charger capabilities. This is a high-impedance signature, so it could be easy to screw/skew it up with some other device plugged in. If this signature is compromised and exhibits wrong levels, iphone won't take charge.
Apparently your other Xiaomi phone distort this signature when plugged first (it might behave as a host and have 15 k pull-downs), so if the iphone is second, it gets confused. If you plug the iphone first, it recognizes the Apple signature, and charges. Apparently your other phone doesn't care about signatures. |
H: What does solder additive do?
I grew up as a boy doing soldering kits in the 80s. I wanted to do the same for my daughter so bought a soldering iron online.
It came with a box of orange resin with Chinese writing on it. I'd never seen something like this to do with soldering. Running it through Google translate comes with something like 'solder additive'.
When I google search online for 'solder additive' I get vague descriptions of better joints, or coping better with dusty joints. I don't understand how that would be solved by resin.
My question is: What does solder additive do?
EDIT: Thanks for all those that contributed to this question and the EE SE community. I asked my Dad what we had done for resin when I was growing up. He responded, "We used resin-core solder, that's why you never saw the resin."
AI: Resin may allow a dirty joint to work where otherwise it would not., but that is not its purpose. You should always clean the components you are soldering together prior to making the joint, they should be bright and shiny. Remove corrosion prior to soldering.
That said, the purpose of resin is to combine with and displace Oxygen. Without resin, air surrounds the components being soldered together. The heat from soldering accelerates the corrosion process where the solder forms bonds between the components being soldered, making for poor bonds between the solder and components. When you use resin, it burns thus depleting the Oxygen (by combining with the resin) and temporarily displacing more Oxygen from getting to the joint. |
H: DALI schematic: help to analize reception circuit and limited current supply
I am trying to understand how this schematic works. It is a physical layer implementation of the DALI specification. The schematic is in this document
(page 11). I have mainly two questions:
In reception mode: when the bus is idle (voltage level between 9.5 and 22.5 V, according to the specification) if the lower limit (9.5V)
is analyzed, the current through the optocoupler diode is: $$\frac{V_\text{bus (idle)}-V_\text{f (bridfe)}-V_\text{Z (D4)}-V_\text{f (U2)}}{R_6} = \frac{9.5-0.7- 5.1-1.25}{2.2\,\text K} = 1.1\text{ mA}$$
(approximately). With such current value, the U2 optocoupler transistor is not saturated and therefore, DALI_IN is not close to 0 V.
What am I analyzing erroneously? For \$V_\text{bus(idle)}=22.5\,\text V\$, the current is approximately 7 mA, so DALI_IN has a voltage close to 0 V
(the transistor is saturated).
Limited current source: The DALI specification limits the maximum current to 250 mA. In the schematic, the limited current source is
created with Q1, D3, R2 and R3 but I can not understand how it works. How are the maximum current value and the output voltage calculated?
AI: Let's start with the easy bit.
2. Limited current source:
The current limiter circuit is this one
simulate this circuit – Schematic created using CircuitLab
D2 stabilizes a constant voltage on the base of the transistor, so the voltage on the base is VB=VD1 then the voltage on the emitter is the voltage on the base minus the base-emitter diode-voltage (VBE) so VE=VB-VBE. Now VE is also the voltage across the resistor R1 so the current in the resistor must be IR1=(VD1-VBE)/R1. it is obvious ofcause from this equation that since VD1 AND VBE are both constant that the current in R1 (IR1) must be constant.
More coming up on the "1. ..reception mode" part thingie..
1. In reception mode:
..With such current value, the U2 optocoupler transistor is not saturated and therefore, DALI_IN is not close to 0 V.
Where do you get that idea?
If you look at the output side of U2 it is pulled up to 5v by a 10k resistor, if we calculate the current through the transistor in order to pull the output low we get that 5v/10k=0.5mA thats a very low current. Now we look at the datasheet of the TCLT1000 and we take a look at the graph of the collector-emitter saturation-voltage (y-axis) compared to the collector-current (x-axis). We see from this that if the current is below 1mA then the saturation voltage is below 0.2v what that means is that if the collector pulles 0.5 mA which is enough to pull the output completely low then the voltage across the output is going to be <0.2v so in other words it is going to be pulled to GND.
Now we can estimate how much current that takes throught the led because we can look at the graphs of the CTR (current-transfer-ratio) compared to forward current in the led and from this we see that if the forward current in the diode is 1.1mA then the CTR is aprox. 50%, what that means is that 1.1mA throught the led = 0.55mA through the transistor. In other words the output is pulled low both in the case of 9.5v and 22.5v, but below 9.5v/1.1mA I would expect the output of the opto-coupler to start going high. |
H: Efficiently limit current to LED without power loss
Let's assume I have 3 LEDs which have forward voltage of 3.3 V and current rating is 300 mA. All the LEDs are in series and I have a power supply of 12 V. when I series a resistor to limit current it draws much power.
Calculations:
Voltage through LEDs =\$3.3v*3=9.9 V\$
Voltage drop through resistor=\$12v-9.9v=2.1 V\$
Resistor value for \$300 mA =2.1v/0.3A=7\Omega\$
Power loss through resistor \$= 7*0.3=2.1 W\$
I need to reduce this power loss.
Is there any way with MOSFET or BJT transistors?
I read this http://www.instructables.com/id/Power-LED-s---simplest-light-with-constant-current/. But I don't understand how to calculate values. Here is the circuit diagram in above site.
I don't need exactly this. I need a proper way to do that.
AI: The circuit you have indicated does not lower the power loss. It merely replaces your fixed resistor with a current limiter that ensures you have closer to the 300mA or whatever you need, under a wide range of LED forward voltages and supply voltages.
As such the current limiter is really just a smart resistor and will still dissipate the same sort of heat a simple limiting resister would.
To be low power you need a circuit that uses some sort of switch mode regulation to generate the required current in the LEDs at a high efficiency conversion factor.
UPDATE
By the way your math is wrong.
You stated..
Power loss through resistor \$= 7*0.3=2.1W\$
That is incorrect, that is the formula for voltage drop across resistor = \$2.1V\$
Power loss through resistor \$= 2.1 * 0.3 =0.63W\$
You are already running at 82% efficiency.
With a switch mode current regulator you might be able to boost that up a few percentile, but it may not be worth it. It is still wise to use a current limiter rather than relying on a resistor though. |
H: Questions about SMPS Toroid winding
I'm making a simple SMPS to create multiple isolated outputs to audio effects circuits.
I need to make a toroid pulse transformer which has one primary and
at least 10 secondaries.
These secondaries will be used in pairs to make 5 positive and negative outputs.
I've never wound my own transformer before so I have some basic questions :
Can I wind each 'pair' together. That is physically push two wires through the core together for each turn? Then use those pairs to create my positive and negative outputs? Will that have any effect on noise or galvanic isolation etc?
Can I safely wind my secondaries with thinner wire? The intention is that the primary will pass 3 amps, and each secondary will only be expected to supply 100mA or so. Is it safe to do that?
Will the transformer still work if the iron powder compound is not exactly right. So in an ideal world I'd be using a T130-3 (switching at 100KHz) But what if it's a T130-6 etc? Will it work, but just much less efficiently?
what would happen if I wound secondaries, on top of other secondaries? Would that work? So if I ran out of space on the toroid, could I just wind more secondaries on top of other ones? I appreciate that there'd be some difference in output voltage, but would those coils still work?
Sort of related to question 1. Would my negative secondary coils need to be wound in the opposite direction? And also, should my secondaries be wound in the same direction as the primary?
PS :
T130 core size : OD-1.3" ID-0.7" height:0.25" (roughly)
Type 3 iron powder (grey clear) : Carbonyl HP Permiability 35 80Khz-500Khz
Type 6 iron powder (white clear) : Carbonyl SF Permiability 8.5 (10Mhz up)
AI: Yes - it's called bifilar winding.
Yes. Work out copper loss (I^2*R) for each winding, choose wire such that the loss on the primary is about the same as all the secondary losses added together (and as small as possible, i.e. use most of the space). Copper loss is simply the power loss due to current passing through the wire's resistance. Work out the length of wire, look up the resistance per metre of your chosen wire diameter in a table (online) and plug in your current. If losses don't match, choose more appropriate wire. Doesn't have to be precise - see the difference between adjacent wire sizes.
Probably not, but it depends on your definition of "work". You need to work out the flux density in the core, and compare it with where each iron saturates. Add datasheets for both cores to the question if you're in any doubt what to do. This is basic to transformer design, easy to get wronf if you don't understand.
It'll work, but the coupling between secondaries will be affected - e.g. noise on one sec may be coupled more strongly to another.
You can wind everything in the same direction - just pick the correct end of each winding when wiring it up. (Easiest done if you have an oscillator and a scope so you can monitor the phase of each winding). |
H: Frequency response of state variable filters
Could someone explain the difference between the following responses of a state variable filter? It looks as though the band pass response is approximately 3dB lower in the second image.
Assuming a state variable filter:
I have seen frequency responses like this:
and like this:
Are they both correct?
Can they be achieved from the same state variable filter?
AI: The bottom two graphs are correct, for what would be a Butterworth response (Q=0.707) You can set the Q equal to one (Q=1) and get no attenuation of the BP response at the center frequency. But then there will be a gain peak at the center frequency of both the LP and HP response. |
H: OrCAD PCB Designer Transistor Footprint
i want to change the position of the transistor pins (2N3904 & 2N3906, Q3,Q4,Q5 and Q7), on the first image is what i got so far (inside green oval area), the footprints are TO92.
i want to change the position of the transistor pins, something like its shown on the last image, so how i can do that ?
If i change the footprint i think i have to start over (design all the tracks, placing all components, etc, it takes again a lot of time and pacience) so if i can avoid that, that would be great.
i want to change all TO92 footprints to TO92VAR.
AI: Select the symbol, right click and show element. This will give you the footprint name. Find the symbol_name.dra file in your footprint libraries. You can either edit this one or make a copy. Open the footprint with allegro. Now you can edit it to your heart's content.
If you made a copy of the footprint you'll have to change the footprint name in your schematic and re-import the netlist. If you did not go Place->update symbols. Select package symbols and hit refresh. It should bring them in. |
H: Should a frequency-controlled motor use a circuit breaker with a B or C trip characteristic?
In our company, a discussion is raging on whether a motor with a frequency controller should be protected with an automatic circuit breaker with B or C characteristic.
The B-camp's argument is that, because of frequency controllers or soft-starters, the inrush current on a motor is much lower so a B trip characteristic should be sufficient. The C-camp believes that using B characteristic is just not allowed.
Are there any reasons to still use a C-characteristic circuit breaker?
AI: I assume that you are asking about the branch circuit breaker feeding the frequency controller or variable frequency drive (VFD). There should be no breaker between the VFD and motor. The VFD does not just reduce the inrush current, it actively controls the current and eliminates the inrush. You should check the specifications for the VFD, but VFDs generally limit the intermittent current to no more that 150% of rated motor current. The limit value is generally adjustable to some value below the rated motor current, probably 50% or so. With a VFD, a motor can provide 150% of rated torque for acceleration with the motor drawing current in proportion to torque, 150% current for 150% torque.
At low speed and high torque, the input current to the VFD can be considerably less then the motor current because the motor power factor is quite low and the reactive component of the current is supplied by the DC bus capacitor bank in the VFD. However there can be some high peaks in the input current due to harmonic distortion. The harmonic content is strongly influenced by the source impedance. Higher source impedance (lower short circuit capacity) reduces harmonic content. VFD suppliers often recommend and supply input line reactors to reduce harmonic content. Any add-on reactors must be selected with the knowledge of built-in reactance supplied by the manufacturer.
VFDs generally include provisions to limit power-up inrush current due to capacitor charging.
The first thing to do is check the VFD manufacturer recommendations regarding VFD input fusing and branch circuit breaker selection. I doubt that any will recommend a C characteristic breaker. |
H: Why is there a maximum time for length of write pulse to write on an EEPROM?
I am still just learning about electronics on my own, so please bear with me.
The EEPROMs that I have come across (for example this one where the t_wp max is 1000 ns.) all have a time limit for the write pulse (I think this is called the Write Pulse Width). I am just curious, but
1) What is the reason that EEPROMS have this upper limit?
2) Are there any parallel EEPORMs with no upper time limit?
Please note that I am not asking about the limit on the number of times one can write to an EEPROM.
AI: There are two reasons I can think of for having a limit to the write pulse length:
If the part uses dynamic latches to hold the address, those latches may only be able to hold their value for a certain length of time. Since the address is latched on the falling edge of /CE & /WE, but the write doesn't start until the rising edge, giving the chip a write command that's long relative to the time required to complete a write cycle could result in the dynamic latches forgetting the address before the write cycle is complete.
If the device rejects any write cycles that are excessively long, that may help guard against erroneous write operations in cases where a system operation gets disrupted (e.g. by loss of power). If that were the intended purpose, however, I would expect a specification that would indicate that write pulses within a certain range are guaranteed to be accepted, write pulses that are outside a larger range would be guaranteed to be ignored, and those between the two ranges might arbitrarily be accepted or ignored.
In either case, 1000ns seems like a curiously short maximum. The address needs to be held for an entire write cycle, so any dynamic latches would need to be able to deal with that. If the cycle limit is intended to guard against stray write events, engineering it to be usable with systems that run at slow clock speeds should have been trivial and would have improved usability. |
H: Transfer function of filter
I've got a trouble with this filter:
I tried calculating transfer function from four-pole matrix, but can't handle it :(
Any help much appreciated.
That shaggy drawed element near U1 source is coil. Sorry for my drawing.
What I've done so far (I think it is wrong):
AI: This is the problem with the classical analysis, you end up in algebraic paralysis and getting control back is difficult. The easiest and fastest way is to consider the FACTs. By considering the physical time constants of this two energy-storing elements (2nd-order circuit), I can derive the transfer function with minimum effort and get it factorized almost immediately. The denominator obeys \$D(s)=1+sb_1+s^2b_2\$. There is a gain \$H_0\$ for \$s=0\$ obtained when the capacitor is open-circuited and the inductor replaced by a short: \$H_0=1\$. Then, reduce the excitation to 0 V (replace the input source by a short circuit) and "look" at the resistance offered by the capacitor (while \$L_1\$ is short circuited) and the inductor (while \$C_2\$ is open circuited) connecting terminals. You have two time constants \$\tau_2=R_2C_2\$ and \$\tau_1=\frac{L_1}{R_1}\$ and you can form \$b_1=\tau_1+\tau_2\$. The second-order time constant is obtained by considering \$L_1\$ open circuited while "looking" into \$C_2\$'s terminals: \$\tau_{12}=C_2(R_1+R_2)\$ leading to \$b_2=\tau_1\tau_{12}\$. The below drawing illustrates how to conduct this analysis:
There is no zero in this network and the expression fitting the second-order polynomial is: \$H(s)=H_0\frac{1}{1+\frac{s}{Q\omega_0}+(\frac{s}{\omega_0})^2}\$. Now, if you compute the quality factor \$Q\$, it is very low and the whole network can be replaced by two cascaded poles: one dominates at low frequency (closer to the origin) while the second shapes the response at high frequency. This is called the low-\$Q\$ approximation. As such, the transfer function can be rewritten as \$H(s)=H_0\frac{1}{(1+\frac{s}{\omega_{p1}})(1+\frac{s}{\omega_{p2}})}\$ with \$\omega_{p1}=Q\omega_0\$ and \$\omega_{p2}=\frac{\omega_0}{Q}\$. The below Mathcad sheet shows you the whole process here and compares the factored expression with the raw, brute-force expression (upper right corner):
For the raw expression, I identified a Thévenin generator driving the left side of \$R_2\$ and affected by an output impedance made of \$L_1||R_1\$. You then apply an impedance divider expression and there you go. The problem with this method and yours is that you may make mistakes when unwinding the whole expression and trying to rearrange it in a friendly (read factored) format. By applying the FACTs, you see that you simply split the circuit in a succession of simple sketches for which time constants are determined by inspection, no algebra! Then, you assemble the pieces to form the denominator you want, already in a canonical form. Should you later spot a mistake, go back to the sketch, fix it and the rest remains untouched. I really encourage you to dig these FACTs and determine transfer functions in the fastest way ever! |
H: How can we provide a stable reference voltage to a voltage regulator if we don't have a stable source to begin with?
In voltage regulator circuits i always see a "reference voltage", that is supposed to be used to tune the regulator to the voltage we want to regulate the output to.
But since we don't have a regulated source to begin with, how can we provide that stable "reference voltage" ?
AI: The primary reference is something like a zener diode or a band-gap reference or maybe a floating gate MOSFET. The regulator is something like a power amplifier that provides an output that is proportional to that voltage. The gain of that amplifier determines how much the output voltage changes with load current changes (load regulation).
Although the reference can operate okay from unregulated input, there will be some change with input voltage (line regulation). To improve that regulation we can start up the reference in some way and run it mostly from a voltage or current related to the output voltage. This is called "bootstrapping".
Here is the block diagram of an MC78M05 showing the basic regulator and protection circuitry.
Here is how the schematic of an LM7805 breaks down:
The green part is the startup circuitry. The yellow is the bandgap reference. The rest is the error amplifier, feedback divider and protection circuitry. |
H: Why there is difference between image size and video resolution of a specific camera?
I was searching to buy a camera, but I saw in specs they wrote:
2MP(full hd) video recording
5MP image size
Why the vido size is 2MP but image size is 5MP? How they calculate these numbers?
If I had a camera that could shooting in 4K, how can I find it's photo's size in MegaPixel?
AI: The numbers given in pixels or megapixels tell us the number of pixels (or, sensors) that the hardware can process.
A photo frame is a matrix of data grabbed from sensors. A 5MP photo contains nearly 5 millions of pixels that are processed and saved by the hardware. As you know, it is done in a single shot and the duration of a single shot is a few milliseconds.
Since a video can be thought of as a series collection of photo frames, the hardware may not be fast as it was on processing photo frames. I mean, it may not be able to process those 5MP frames in 60 (or even 25) times per second (Yup, the frame rate). In other words, if a camera can record maximum 1920x1080 (i.e. 2MP) video at 60FPS, then the hardware is capable of processing 1920x1080x60=124.4 millions of pixels in only one second. So, that is the limit.
To your last question: I have no idea about if there is a direct relation between those two. But, as I explained above, the limitation comes from the hardware itself. |
H: FPGA Internal Timing constraint failing
I'm currently trying to implement an IP-Core on a Cyclone V 5CSEBA6U23I7 FPGA-HPS System using Altera Quartus II and TimeQuest Analyzer.
The Verilog code pasted below produces a timing problem, namely the assignment fifo_wdata_289[255:0] <= {fifo_out,fifo_wdata_289[255:16]};, which writes the output of one FIFO into another FIFO register array.
The FIFOs in use are asynchronous, but the signals used are on the same clock domain.
This is being placed on the chip with a clock skew of -2.255 ns, which is a little bit less than a whole period (288 MHz clock => 3.47 ns), and makes TimeQuest complain, that the constraints are being violated.
The recommendation of TimeQuest is to Reduce the levels of combinational logic for the path (Issue Long Combinational Path) with Extra levels of combinational logic = 1.
The 288 MHz clock is generated via PLL and I'm using Timeconstraint files (sdc) with commands derive_pll_clocks and derive_clock_uncertainty.
My question now is how to solve this problem, since I only have one layer of combinational logic (Demuxer and routing, as suggested by the assignment) and thus have no idea how to reduce that. Is there any other way I can make sure the timing requirement is met, or is there a better way to program this statemachine?
Thanks for your help.
case(stateProc)
2'b00:
begin
if(~fifo_empty&~fifo_full_289)
begin
fifo_wdata_289[255:0] <= {fifo_out,fifo_wdata_289[255:16]};
fifo_wdata_289[287:256] <= {2'b11,fifo_wdata_289[287:258]};
if(imgSize >= maxImgSize - 32'd2)//image done, transmit data and fire irq
begin
fifo_wdata_289[288] <= 1;
stateProc <= 2'b01;
imgSize <= 32'd0;
end
else if(fifo_wdata_289[258])//process transfer without irq //258 high means that 256 has been written in this cycle and 258 in the previous cycle
begin
fifo_wdata_289[288] <= 0;
stateProc <= 2'b01;
imgSize <= imgSize + 32'd2;
end
else//accumulate more data
begin
fifo_wdata_289[288] <= 0;
stateProc <= 2'b00;
imgSize <= imgSize + 32'd2;
end
end
else
begin
fifo_wdata_289 <= fifo_wdata_289;
imgSize <= imgSize;
stateProc <= 2'b00;
end
end
2'b01:
begin
fifo_wdata_289 <= fifo_wdata_289;
imgSize <= imgSize;
stateProc <= 2'b11;
end
2'b11:
begin
fifo_wdata_289 <= 0;
imgSize <= imgSize;
stateProc <= 2'b00;
end
endcase
EDIT:
The TimeQuest failing paths look mostly like this:
Slack:
-3.178
From Node:
soc_system:u0|CamConnector:camconnector_0|FIFO_289:FIFO_inst_289|dcfifo:dcfifo_component|dcfifo_6up1:auto_generated|wrptr_g[0]
To Node:
soc_system:u0|CamConnector:camconnector_0|fifo_wdata_289[267]
EDIT2:
I'm currently using MLAB cells as FIFO storage, which are rated for 290 MHz.
Both FIFOs are asynchronous and have a synchronizaton setting of 3.
Timing closure Recommandations of TimeQuest reports the following two issues:
Unbalanced Combinational Logic
Long Combinational Path
AI: since I only have one layer of combinational logic (Demuxer and routing, as suggested by the assignment)
No you don't have that. There is also the clearing in stateProc==2'b11. But I assume the Cyclone LUTs are big enough that it can encompass an extra AND gate at the same time.
But I suggest you also post the failing path as reported by the tool. Because something does not add up here. The path for the fifo_wdata_289[288] is more complex and you say that it does pass timing. I would not be surprised if the mux control signals: fifo_empty, fifo_full_289, stateProc etc. are also in the failing timing path together with the drive tree as you control a lot of FF's from one signal.
If not you can really only run at a lower speed. There is no use in fiddling with the clock as the circuit uses it's own signals (fifo_wdata_289[255:0] <= {fifo_out,fifo_wdata_289[255:16]};) Thus if you skew or invert the clock, fifo_wdata_289[255:16] will come out later and thus again fail timing. You may be lucky and the fifo_out is arriving late and causing the timing error but again look at the timing report of the failing path.
Anyway, skewing a clock is something which can be done in an ASIC but I would not try it an FPGA. I don't think you have the fine control to skew one clock
~300ps against another. But I have not us cyclones so maybe....
Update:
Just what I expected: The path start at the wrptr_g... I assume that is the write pointer which is probably compared to the read pointer which makes the fifo_full/empty flags which control the mux.
The best way to get rid of the timing issue is to make a registered version of the full/empty flags. That may mean you have to redesign some of the rest of the circuit.
If the FIFO is a synchronous one there is a trick to generate synchronous full/empty flags. You check if the level is ONE and on a read but not write you synchronous set the 'empty' flag. See here for some free example code of FIFO's which have that feature. Unfortunately that does not work with a-synchronous FIFOs. |
H: smart card clocking using NXP
In my current project, I'm trying to implement a smart card reader using LPC1788 which has a built-in smart card interface. Smart cards use the ISO7816-3 standard to communicate with the outside world. Smart cards need clocks which must be between 1MHz to 5MHz. This clock will be used to generate a baudrate with a fraction that is implemented in the card as default. ISO7816 states that if I connect a 3.58MHz signal to the card, the baudrate will be 9600.
On the other hand, the LPC1788 datasheet states that:
If the smart card to be communicated with requires (or may require) a clock, program one IOCON register for the UART SCLK function. The UART will use it as an output.
Then it states:
Enable the UART clock and set up UART clocking for an initial UART frequency of 3.58 MHz.
So I'm confused! If I set the baudrate to 9600 and program UART SCLK , will I get 3.58 MHz?
What does it mean by: "set up UART clocking for an initial UART frequency of 3.58 MHz"?
How can I do that?
AI: You have to apply a clock to the smart-card. The baudrate used for communication is clockrate/372. So for a clock of 3.58Mhz you'll end up with a baud-rate of 9632.6 That's close enough to be read by an ordinary UART.
If you configure the UART for smart-card IO then you have to program the clock pin for UART functionality. If you don't it's just a ordinary GPIO.
Once done it will start to output the clock signal as defined in the baudrate registers. The actual communication will run with the slower (divided by 372) frequency.
The chapter is a bit misleading because in the manual they use baud-rate for both the clock and the acutal transmission speed. |
H: Is a stage box with an iron grid safe using this way?
See also my previous question:
How should I bypass switches
Where I made a circuit directly by mains, and as proposal by very useful comments to use a separate 'control' circuit at 9 or 12V.
However, according to this video:
How to Build On-Stage Light Boxes for Your Band
the switch under the 'plateau' is directly connected to 220V.
However, in my case I want to make a very important change: I don't want to use plexi glass, but a metal grid (like this):
I assume it would not safe to make a switch directly under this iron grid that is connected to 220V? Or is it actually not really safe for the plexi glass solution as in the YouTube video neither?
(Btw, I think according to the related earlier question, I'm going for a transistor/relay/triac solution anyway).
And a side question: another band I seen, uses a foot switch instead of a switch under the grid. I'm almost sure that foot switch is connected directly to mains (meaning 220V goes through it). Now this is seen quite often with living room lamps etc... but I wonder if this is safe on a music stage (what if someone would drop beer over it, and the foot switch is not 100% 'closed' somehow) ?
AI: There absolutely is no issue in using a correctly rated momentary switch to turn on and off a lamp directly. After all, our houses are full of wall switches, foot switches, and even not so safe kinda sloppy switches from non controlled markets.
But there's a catch: there is no issue if you can ensure that the switch will operate in a proper environment at all times. If you can understand what a proper environment is, and enforce it, then go ahead with whatever design comes to your mind.
Using a low voltage switching circuit is certainly a hassle, because you need a transformer, a PCB, whatever: it's a mess.
But consider this: you can buy an off the shelf relay, connect the mains voltage to it, put everything in sealed box like what they use to make electrical connections in gardens, and just run around your low voltage control wires.
With low voltage control you can do a number of things that are more difficult and costly to do with the mains directly: you can add crappy foot switches everywhere, and enjoy the light going on and off when your drunken guitarist drops a pint on it while smiling to that girl that was "definitely looking at him". You can add alwasy on, always off switches at no cost. You can parallel foot switches so that you can turn the lights on and off from various points in the stage. You can add a microswitch to your drummer pedal and have cool, perfectly timed, blinking lights. You can even program an arduino or whatever to produce super cool effects in the future, if you want.
Be safe on stage, if you have to ask if it is safe assume it is not safe. |
H: What is the boxy plastic housing around spade connectors called?
This spade connector is used to connect to 12V SLA batteries, and I believe it's the F2 variant. However it has a nice plastic shroud around it which makes it easier to remove from the batteries and since it's fitted after the crimp it doesn't get damaged as some alternative shrouds do.
I am trying to find where to buy these covers (with or without the female spade connectors) however I'm having trouble because I don't know what they are called!
Does anyone know what retailers label these parts as?
AI: Most often they are called just
Hard plastic 6.3mm female blade terminal cover
and code for it RS63004X, where X is a colour code, e.g RS63004R for Red.
Check this link
Also, you can go through all range of terminal covers on RS website. |
H: Busted Capacitor
I have a motherboard with a capacitor busted. When I put the CMOS battery on it, it randomly reboots after a couple of minutes. The busted Capacitor has a rating of 6.3V 3300uf 150*c. But the problem is I have only a 16v capacitor woth the same capacitance but I know it will have ESR issues. But changing the busted capacitor with a capacitor with the same voltage rating but with higher capacitance will it work fine? Because I can't find the same rated capacitor on our local stores.
AI: The non-critical parameters for this application are voltage rating > 5V, ESR and value of Cap which allows at least 1 minute to change the battery.
Critical values are the leakage resistance or C time constant of the Cap for giving at least 1 minute minimum battery replacement time. But this is not your problem.
Neither the battery condition or the capacitor condition should trigger a PC reboot in a normal design, since the PC being powered up also powers the Real-time clock and CMOS volatile memory.
Impressions: No risk to trying a larger voltage rating cap.. No risk on ESR rating. But be alert for circuit contamination. If this MOBO is more than 10 yrs old, maybe it is time to recycle it? |
H: LPC1343 double pin functions
I was looking to create a LPC1343 development board, but I noticed something odd.
If you look at the pinout for this MCU you can see double functions for some pins. This is common, so you can program a pin to use for a particular function. But here is the weird thing. Pin 3 on the LPC1343 says: "RESET/PIO0_0". Now I'm confused. How can a reset pin also be a I/O pin? I can't find anything about it in the datasheet.
Any help would be appreciated. Thanks in advance.
AI: Looking in the user manual if actually found the pin function register. You can, just like the other pins, switch the function via this register. Which I still find odd, because you wouldn't be able te reset the MCU anymore using an external pin. But apparently they did design it this way. |
H: ADC Burst mode in LPC2119 not working
I have been trying to work with ADC using ARM 7 LPC 2119 in burst mode however this functionality is not working.
My code is as follows:
ADCR = 0X0121090F; // Start A/D Conversion
//Wait for the conversion to complete
while(!(ADDR & 0x80000000));
{....}
I am also scanning 4 channels from AIN0 to AIN3, however on debugging I see nothing:
As can be seen, the ADDR value does not change when there is an input to AIN0. What am I doing wrong here? Any help would be appreciated.
AI: On scanning through the datasheet Page 305, it is listed that START bits must be 0 when burst mode is on.
In your case I am seeing that the burst mode bit and the start bits are set to 1. This is wrong and will not work.
ADCR register must be configured as follows: ADCR = 0X0021090F; |
H: Current amplifier with Mosfet and Op-Amp: Output resistance
In the following circuit, why is \$R_o\$ given by:
\$R_o=(R_1//R_2)+r_{o2}+g_m .r_{o2}.(R_1//R_2)\$ ?
I dont understand the \$g_m .r_{o2}.(R_1//R_2)\$ parcel
AI: The output resistance is increased beyond the observed value of (ro2+R1||R2) because of the negative feedback effect.
It is known that negative feedback does increase input and output resistance for such a circuit with a factor of (1-loop gain).
For the circuit under discussion the loop gain LG=-(gmRE)=-gm(R1||R2).
Hence , we have (with RE=R1||R2)
r,out= RE+ro2(1+gmRE)=RE+ro2+ro2gmRE.
Feedback model for identificatioin of the loop gan:
This simple model results from (and fulfills) the BJT equations:
Ic=Vbe*gm ,
Ic~Ie ,
Vout=-gmRc/(1+gmRE) .
As can be seen: The loop gain is LG=-gmRe .
simulate this circuit – Schematic created using CircuitLab
This model is based on the known equations for a BJT.
It can be applied for the FET as well by replacing Vbe by Vgs. |
H: DC motor back emf and supply voltage
In this question the solution manual takes Eb as 250v and solve it to get the torque. How's that possible ? How can one takes the supply voltage as Eb? If there's something i don't or i didn't get please enlighten me.
The given solution :
Pd = Te*Wr
Eb=Z * P * Phi * N/(60 * 20)--- substituting values we get
N =543.47
Pd =Te*Wr = > 250 * 50 = Te * 2π * 543.47/60
Te=( 2π*N)/60 = 219.6Nm.
AI: Supply voltage = Eb + armature current x armature resistance. The solution apparently assumes that the armature resistance is negligible. In other words, the motor is assumed to have 100% efficiency. Note that torque delivered to the load is torque developed minus internal motor friction torque and aerodynamic drag torque acting on the rotor. Also no mention is made of any power required for the motor field, so the motor either has permanent magnets or the field power is also neglected. |
H: (how) can I use 250v fuse in a 9v circuit?
I bought a nice big assorted set of fuses ranging .1A to 20A. All of them have 250V on them.
The question is can I use them in circuits with 3, 6 9 or 12 V?
If yes, does lower voltage changes the rating amp of the fuse?
AI: The design of a fuse conductor material gives rise to the PTC characteristic which causes a thermal runaway effect above rated current so that resistance rises rapidly with temp until it melts the conductor. The thin shape ensures that when this occurs, it explodes the material with sufficient gap that at least 1 mm air gap exists so that ~1kV spikes can be blocked on a 250Vac line.
It has no effect on low voltage circuits other than being relatively high resistance when conducting.
You also might want to consider getting an assortment of polyfuses.
- Why?
- Fuses do not provide great protection for low voltage circuits, because of the thermal mass of the transistor junction is much smaller than the fuse link so the fuse is too slow to protect semiconductors. It is effective for some low voltage applications such LiPo battery protection.
Thus 100mA fuses of this type rated for 250Vac are relatively useless for low voltage due to the maximum voltage drop possible when operating below the specified fusing limit. |
H: Is it possible that the BJT will work in active mode even if emitter base junction is reverse baised?
I was going through voltage divider bias configuration of BJT and then i encountered two problems:-
The above two problems are nearly same except that the emitter terminal is grounded in case of (b) and baised in (a) .when i solved and found out the thevenin's voltage(between emitter and base terminals) then it was positive for (b) and negative for (a) .Negative value of the thevenin's voltage would suggest that the emitter base junction is reversed baised so The transistor must be operating in the cut-off region.
In some videos online i found that even when thevenin's voltage is negative the BJT was operating in the active region .Is this really possible ?If yes then how?
Edit:The calculation of Vth for (a) is given in this video.
Thank You for giving your time.
AI: In both cases, (a) and (b), your circuit is essentially the one on the left, below. The equivalent circuit, after the biasing pair is converted to its Thevenin equivalent is on the right, below:
simulate this circuit – Schematic created using CircuitLab
For the left side
Case (a): You have \$V_{CC}=+20\:\text{V}\$ and \$V_{EE}=-20\:\text{V}\$.
Case (b): You have \$V_{CC}=+20\:\text{V}\$ and \$V_{EE}=0\:\text{V}\$.
\$V_{EE}\$ is the only difference.
For the right side
Case (a): You have \$V_{TH}\approx -11.538\:\text{V}\$, \$V_{EE}=-20\:\text{V}\$, and \$R_{TH}\approx 1.735\:\text{k}\Omega\$.
Case (b): You have \$V_{TH}\approx 4.231\:\text{V}\$, \$V_{EE}=0\:\text{V}\$, and \$R_{TH}\approx 1.735\:\text{k}\Omega\$.
In both cases, an NPN transistor would have its base-emitter junction forward biased and not reverse-biased. You should be able to easily see this fact. Note that in both cases, \$V_{TH} \gt V_{EE}\$.
Also, looking at the right side schematic, you can trivially find that:
$$V_{TH}-I_B\cdot R_{TH}-V_{BE}-I_E\cdot R_E=V_{EE}$$
This can be solved for \$I_B\$, knowing that \$I_E=\left(\beta+1\right)\cdot I_B\$:
$$I_B=\frac{V_{TH}-V_{BE}-V_{EE}}{R_{TH}+\left(\beta+1\right)\cdot R_E}$$
You should be able to go from there to the rest of any analysis needed. (Assuming you can treat \$V_{BE}\$ as a constant. If not, things get more complex.) |
H: Best way to pair a DC-DC boost converter and a MOSFET to compensate for MOSFET voltage drop
I'm building a PWM fan controller, and would like to use a DC-DC Boost converter to compensate the voltage drop across the MOSFET.
What I would like to get an opinion on is if it's more efficient to boost the voltage before the MOSFET, or after.
I think it would be better to use the boost converter after the MOSFET since it will automatically adapt to any variation on the MOSFET output caused by operational temperature changes.
I'm not in any way an engineer, and don't have enough knowledge to make calculations, I'm still learning that part...
For prototyping, I'm using an IRF830, which will be replaced by logic level MOSFETs on my final product. The DC-DC boost converter is a MT3608 2A, but I'm planning to include something like it in the final project.
Thank you in advance for any inputs on this.
Edit: Insert a basic schematic.
simulate this circuit – Schematic created using CircuitLab
AI: Intuitively, I would put it after. (after all the voltage dropping components). If the voltage drop is variable, you will have a variable voltage output if you put it before. HTH. |
H: Why do push button telephones use dual-tone for signalling?
Here is a related information from wikipedia:
For touchtone service, the signal is a dual-tone multi-frequency
signaling tone consisting of two simultaneous pure tone sinusoidal
frequencies.
Above shows that if one pushes number 1 he sends the mix of 697Hz and 1209Hz to the telephone station/center through a wire.
My questions are:
What is the practical reason or advantage to mix two signals instead of a single pure tone?
Is there a reason to use such frequencies like 1209Hz which do not belong to any music tones(modern western twelve-tone equal temperament)?
AI: The two reasons are simple:
Eight frequencies are easier to discriminate with simple analog electronics - banks of bandpass filters or even vibrating reeds - than sixteen frequencies.
The equally tempered scale is too close to the natural scale, which has simple fractional relationships between the frequencies.
Consider that a phone line may be highly distorted : the second harmonic is one octave above the fundamental, and the third harmonic of a note is an octave plus a fifth. If you used more musical intervals between dialing tones, harmonic distortion could result in dialing the wrong number.
The frequencies were chosen (citation needed, no doubt - here for example ) to reduce or eliminate the possibility of harmonic or intermodulation distortion between tones being mis-detected as the wrong number.
The tone frequencies, as defined by the Precise Tone Plan, are selected such that harmonics and intermodulation products will not cause an unreliable signal. No frequency is a multiple of another, the difference between any two frequencies does not equal any of the frequencies, and the sum of any two frequencies does not equal any of the frequencies. The frequencies were initially designed with a ratio of 21/19, which is slightly less than a whole tone. The frequencies may not vary more than ±1.5% from their nominal frequency, or the switching center will ignore the signal. |
H: How to solder an SMD component with a "pad" on the bottom?
I am getting a PCB manufactured for a project that I am working on. One of the parts, the A4950 motor driver (datasheet), has a "pad" on the bottom, which is meant to be soldered to GND of the PCB for thermal dissipation. I am only ordering a small quantity of the PCBs, so it would not make sense for me to buy some sort of PCB assembly service. I am planning on soldering the components myself.
I was thinking about the soldering, and I am unsure how I would go about (using a soldering iron), soldering the pad on the bottom. Is this even possible to do by hand?
I was thinking maybe I could manually apply some soldering paste to the PCB, but I'm not sure whether that is an appropriate use of solder paste or not.
How can I prototype an IC with an exposed pad on the bottom?
AI: The absolute best way to do this is to preheat everything with a large high flow hot air source or oven. Apply paste first, if you have it, or a little bit of wire solder to the pad. Then pre-heat. The pre-heat temperature is around 125C or so.
Once everything is heat soaked at 125C, apply localized hot air directly to the part to be soldered and immediately around it. The temperature should be hot enough to melt the solder, but not overheat the part. A lot of cheap hot-air equipment has poor temperature setting and indication. So you may need to experiment. If the solder melts extremely fast, it is too hot. If it melts in about 10-45 seconds, that is probably good. If it takes a full minute, then it should probably be hotter. Often, you will notice the part kind of self-aligns itself and snaps into place when the solder is all melted. This is a good indication that it is hot enough.
Small parts will probably reflow much faster than large parts, and may not need as high a temperature either. Your first efforts may not work well. So keep track of the time, temperature and results. Once you find a winning recipe, stick to it.
If you don't have any way to pre-heat the whole board, then you can just do it the way Arsenal says. If you are repairing a board that went through a reflow oven, keep track of time and temperature when you remove the part. This will give you a good idea of time and temperature required to install the new one.
For large parts, I sometimes don't place them prior to heating. I hold the part with tweezers near the edge of the hot air stream. I use hot air on the pad until I can see that the solder is thoroughly melted, then I place the hot part on the molten solder pad with tweezers. Don't place a cold part on hot solder. The part has to be hot, too, otherwise you will get a cold solder joint. If you do it this way, you can stop heating almost immediately after you place the part. Oh, also, use flux. |
H: Cheap PWM Charge controller not charging the battery
I recently got myself a CMG-2430 PWM charge controller(pretty cheap I know) and a 12v deep cycle battery. The problem is that the charge controller doesn't charge the battery when I connect the solar panel. ....I know that is a cheap solar charge controller but I really what to ask you guys about opinion because I might just have missed something simple. Here are all the informations about the solar panel, charge controller and battery and after that I will give some more info about the problem.
Solar panel
Pmax: 20.0 W
Ipmax: 1.20 A
Vpmax: 16.9 V
Isc: 1.24 A
Voc: 21.5 V
Battery
Voltage: 12 V
Capacity: 20 Ah
Initial current: less than 5 A
Solar Charge Controller (CMG-2430)
Voltage: 12V/24V automatic
Current: 30
Now, when there is no sun (or the solar panel is disconnected) it show's the moon symbol and when I connect the solar panel it does change to the sun symbol but shows 0.00 A even in full sun, and when I check the current on the battery it does confirm that is not charging. Maybe you guys have an idea of what could possibly be wrong.
update:
I did find the problem....I finally opened the controller and guess what. ...it has a black spot and a burned moosfet near the solar input. ....thanks everyone anyway!
AI: When the Sun is shining.. you can measure the input current, with a Multimeter..
On the side off the Solarcell... If there is a current off example 1 Amp. ...
Then, the CMG-2430 PWM gets hot after a while.. if there is no current going to the Battery.. |
H: How to power STM32F103C8T6 in a 'real' project?
I'm sorry for this probably very generic question, but I cannot find a good answer.
I have several STM32(F103C8T6, a.k.a. Blue Pill), which I now power via a ST Link (giving 5V via USB).
The STM32 itself works on 3.3V.
However, I want to use later not USB power, since it should work 'standalone' with an adapter.
Of course it depends on the hardware attached to it, but let's say I don't need much extra (much less than 1A), I think the default way is to:
Get a 'generic' 220/240V AC -> 12 V DC adapter
Buy a female adapter plug and connect the adapter to it.
Connect the wires from the female adapter plug (12V) to a buck converter?
Connect the buck converter output to the STM
However, I was wonder:
Is it needed to use both an adapter and the converter? Or should I buy a dedicated 5V adapter (which are much less common I think)
In case I need a buck converter, I see many types.
The cheapest is e.g. this ... would this work? And in case not, what (kind/type) should I buy?
AI: I see several options:
Use a USB cable and a charger with a USB outlet and connect it to the USB port of your blue pill.
Cut a USB cable in half and solder the red and black wires to the 5V and GND connections of your blue pill, respectively. The blue pill has a voltage regulator to generate 3.3V. Then plug the USB cable into any charger with a USB outlet.
Buy a small power supply that outputs either 5V or 3.3V and connect it to the 5V or 3.3V connector and to the ground of your blue pill. Either solder the connection or - if you have a 3.3V supply - connect it to the 3.3V and GND pins of the ST Link connector.
Do the same as above with a power supply generating a higher voltage and additionally use a buck converter to generate 3.3V. |
H: eagle library--updated footprint wont show in board
I initially created a part in an eagle library, but now I need to change the package layout. I have already put the initial part in an eagle schematic, so removing/re-inserting it is not an option. So anyway, I opened the library editor up and edited the part's package layout, and saved the library. I then went back to my schematic, went to the library dropdown ----->Update library, and selected the library that I edited. I then created a board from the schematic(I didn't already have a board--I am not even done with the schematic. I just created the board to test if the library update worked.) Unfortunately, the package on the board remained the old one, not the edited version of the package layout. I then tried doing the same library dropdown ----->Update library while inside the board editor, but still no luck.
How do I update the part so that the board uses the new package library? Thanks.
AI: Eagle stores the symbol, footprint, and schematic information inside the project file itself. This means that once you insert a part, the part information is copied out of the library and placed in the .sch file. The link to the library is lost.
In order to update the part in the schematic/board, you need to right click on the part and select "Replace":
Then select the part again from the updated library. As long as the connections are the same, the new part will be replaced in the schematic/board with the updated part. If there are pin conflicts, it will notify you. |
H: Help identifying component on cisco switch SGD110D-08
first of all thanks for taking time helping me with this issue.
TL;DR; Identify the blew up component on the picture and win!
I've by mistake done a very short but effective connection in reverse polarity to my cisco switch. Apparently only one component blew up and I pretend to replace it and see if I can save the switch as it is brand new.
During the "explosion" of the component part of it's name got deleted but I'm pretty sure that someone with more experience (or maybe someone with the same switch and good will) can help me identify the component.
Here's the best picture I can take:
https://i.stack.imgur.com/7b52i.jpg
Here's the whole PCB for some context:
https://i.stack.imgur.com/WYGJp.jpg
The model is SG110D-08 it's a 8-port gigabit switch.
Thanks!
EDIT 1:
New photo cleaned up with some alcohol.
https://i.stack.imgur.com/o71S8.jpg
AI: Can't tell for sure, as the marking is burned off (but looks like AG_ maybe) - but the layout example in the TI TPS562200 datasheet looks damn near identical to what's on that pcb: http://www.ti.com/lit/ds/symlink/tps562200.pdf |
H: USB-C Power Delivery with a buck converter
Following on from my previous question: The project I'm designing requires a peak current of 5V @ 6A. The average current draw will be more like 2A.
The reason I'm looking into USB-C is that I want a connector that is low-profile, reversible and I wish to use the power delivery capabilities of USB-C (3A/20V). I won't be using USB-C at all for any data transfer, only power.
There are many chip solutions that I've seen, which I'm still combing through. My plan is to use one of these chips to negotiate with the PD source a supply of 3A/20V. (As an aside, this project is a one off, and will be "supplied" with an appropriate USB-C PD source). However, the project required 5V @ 6A, so I was going to use a buck converter. I haven't actually looked into what buck converter I can use to fulfil these requirements (any help on this would be appreciated), but I've seen some chips which seem capable of providing at least 5V/6A from a 20V supply.
My main issue is that to start the PD negotiation "Profile 1", which provides 5V @ 2A, will be used. Presumably I'll have problems supplying the buck converter with such a low voltage.
Does anyone have any experience of designing a similar circuit? Do I need something that will stop the VBUS of the USB connecting to the buck converter if the voltage is less than ~20V?
Update 1
Initially I've been looking at providing power to a USB-C control chip at the original 5V that VBUS will supply. There are a few on the market that offer what is known as "dead battery" or "no battery" support. However, these chips also provide all the multiplexing and other data services which I don't require, and are a bit out of the scope of the project.
One chip I've been looking at is the TUSB320 which will allow my USB-C port to act as a upstream facing port/sink. The plan is to use a LDO with an input voltage capable of at least between 5V and 20V in order to use VBUS power to power the TUSB320 chip. One possible contender is the UA78M33 which has a fixed output of 3.3V. This means that the chip can remain powered no matter what the VBUS voltage is.
As far as I can see (although further research is still required), once the higher voltage and current has been negotiated from the USB supply, the voltage will transition from 5V up to 20V with a maximum slew rate of 30mV/μs.
The LDO will also power the microcontroller, so that it and the TUSB320 can communicate over I2C. Once the higher voltage/current arragement has been negotiated, then the buck converter (next thing to look into) will be enabled (by the MCU) and power the 5V side of things.
Update 2
As Ali Chen correctly pointed out, the TUSB320 doesn't support the high power 3A/20V that I require. After some research I've found the FUSB302 from ON Semi. It's almost a direct replacement in terms of how it will run. My plan to use a LDO to supply the FUSB302 from VBUS still stands. Updated circuit diagram is:
I found a very useful link online from someone who converted an Easy Bake Oven to run off USB-C. Furthermore, he has written some libraries (modified from the Google Chrome EC library) that help use the FUSB302.
The next step in this project is choosing an appropriate buck converter. I'd also like to look at the efficiency (or potential inefficiency) of using a wide-range LDO that supports the maximum VBUS voltage (i.e. 20V) to continually run the MCU. Otherwise, the two viable options I see are:
Swapping over to the buck-converted 5V once the VBUS voltage is at 20V.
Finding a buck converter that supports input from 5V up-to 20V, but only enabling the high current drawing devices once the VBUS voltage is 20V and 3A current can be supplied.
AI: Yes, the standard way in PD negotiations (as in many other cases as QuickCharge, or even basic USB device functionality) is to start with low-power electronics and conduct power negotiations. And then turn on power function if negotiation gets successful. For example, USB must have most protocol capability when running out of 100 mA source. So this is not a problem, and this is a commonly suggested solution.
When doing PD negotiations, your high-power "function" (5V@6A) must be disabled, most (if not all) of buck controller ICs do have some "enable" pin. Your PD logic must keep the power function disabled until successful negotiation into high-power mode. More, the buck controller ICs should have so-called "undervoltage" protection, so the explicit "disable" might be unnecessary.
This means that you might need two microcontrollers to accomplish your high-power function, one for PD sequencing/control, and another one that needs 6A to run. |
H: How to null op-amp offset in current source?
I have a current source circuit with an op amp and pass transistor. The simplified schematic is this:
simulate this circuit – Schematic created using CircuitLab
I would like the output to be adjustable over a pretty wide dynamic range, let's say 4-6 decades (amperes to microamperes), and most importantly I'd like the output to be a true zero if the input is zero.
The problem is the offset voltage of the opamp which introduces an offset to the output current. The opamps with the right speed for what I'm looking for have offsets of 100-500uV. This is not much of a problem when the current is 1A (and the voltage across the sense resistor is 1V), but becomes a pretty big problem when the current is 1mA and the sense voltage is 1mV.
The other problem is saturation. If the offset happens to be positive, when the input is zero, the opamp would try to drive to a negative sense voltage and its output would hit the negative rail. When the input goes positive (eg at the beginning of a short current pulse) the op amp would take time to get out of saturation, and then to slew from the negative rail to a high enough positive voltage to turn the MOSFET on. This results in a delayed and slower rise time at the beginning of current pulses in some of the breadboard versions of this I have built.
I could try to null the opamp offset either using the null pins or slightly offsetting the input. I think drift over temperature and time would make it so this would need pretty frequent adjustments.
I could also add an extra switch on the high side to get a true zero, but that doesn't solve the dynamic range problem (at best I'd have 4 decades of dynamic range, and more likely only 3) and also the saturation problem.
Span errors or deviations from linearity don't matter as much, but zero shift errors are really bad for my use case.
Is there some way to avoid the offset issue in a circuit like this, and have a current source which is essentially exactly proportional over a very wide dynamic range? Is there some way to use a current feedback amplifier instead of voltage feedback?
(Example component choices: THS4541 opamp, BSS816 mosfet. R_load is not actually a resistor, it has a nonlinear I-V curve)
AI: To put it simply, you cannot have your cake and eat it too with this type of circuit. You need to separate the DC constant-current sink from the AC pulse generator.
1) I have built many circuits like you have but stayed with a DC stable op-amp like a TL072. The secret is to insert a 1 K ohm resistor in series with the mosfet gate. Insert a 10 K resistor in series with the feedback from R sense. Insert a 100 nF capacitor from the op-amp output to its (-) input.
2) Now you have a ultra-stable current sink. Use a potentiometer to adjust Vin, with Vin being sourced by a stable voltage ref or regulator. To span many decades of range use a rotary switch where R sense is and use 0.1% resistors if possible.
3) You can buy ultra-stable .025% resistors made by Caddock from Digi-key or Mouser but they get expensive. Use 1.00 ohm, 10.00 ohms, etc, on up to 1 K ohm. With this circuit the voltage at R sense will match Vin to within .1% or better. For protection insert a 15 volt zener across R sense so when the contacts are open the servo loop is not broken.
4) Now to inject an AC signal do it by using a 100 nF capacitor in series with a 10 ohm resistor and connect it to the mosfet gate. The resistor is to prevent parasitic oscillation of the mosfet. Use a pulse generator to inject signals less than +/- 15 volts p-p into the capacitor.
5) The op-amp will keep the constant current stable but slow wide pulses may cause a 50 uS correction time in the servo-loop.
6) Option 2 is to add an NPN such as a 2N2222 to the gate of the mosfet to strobe it off very fast (collector goes to the gate, emitter to ground, base to signal generator). Minimum of 100 KHZ or the op-amp will become unstable.
7) Personally I prefer the capacitor injection method as it keeps both the AC and DC servo-loop DC isolated and the ability to keep a constant current (when on) is much better. Remember it is best if the op-amp is a stable voltage feed-back type, then inject the pulses. Place a DVM in series with your load if possible to make sure your current is exact without any pulses.
8) Use an oscilloscope if possible to measure the drain pin of the mosfet. Look for signs of saturation by your pulse generator or instability from the current sink being over driven.
9) The following circuit will give you 3 decades of range if a 3 pole rotary switch is used. Amps, milliamps, and microamps, plus your modulation scheme.
simulate this circuit – Schematic created using CircuitLab |
H: Something strange with my multitester
I have a multi-tester. And its model name is J0411A. And it looks like thisYou might see that this multi-tester includes a resistor tester. When I set the tester to x1 of Ohm section and connect + to - directly, I get about 2.6 Ohm. When I set the tester to x10(other things are same), it points 1.8 which it means 18 Ohm. Why two numbers are different?
AI: Analog meters I've used had a "zero adjust" knob for setting the meter reading to zero when you short the leads. This adjustment has to be made each time you change the scale. |
H: Can I use an arduino as a LCD controller?
I saw this video where a person used a graphical LCD as a very rudimentary monitor for his computer using an Arduino... I was wondering whether it is possible to use an Arduino as a controller board for larger, proper LCDs (from laptops for example). If the Arduino doesn't have the processing capabilities, could you use, for example, an ESP32?
AI: It depends probably:
If the display memory should be sent completely by the Arduino during every 'refresh' rate, than no. The Arduino Uno has only 2 KB of memory and I doubt that is enough (depends on the resolution, e.g. 500 x 250 dots = 125,000 dots, assuming 1 bit per dot is 15 KB.
If you only have to send the 'changes' than the Arduino is capable of doing so. This means probably that the LCD should have its own LCD driver.
But even if you only need to send changes, than don't expect to be able to send fast videos. An Arduino has 16 MHz and depending on the video processing this might be too slow. |
H: Can the ARM processor be switched to unprivileged mode inside handler mode?
In the ARM documentation it is stated that:
The processor supports two operation modes, Thread mode and Handler
mode. Thread mode is entered on reset and normally on return from an
exception. When in Thread mode, code can be executed as either
Privileged or Unprivileged.
Handler mode will be entered as a result of an exception. Code in
Handler mode is always executed as Privileged, therefore the core will
automatically switch to Privileged mode when exceptions occur.
But it doesn't specify if I can just switch back to unprivileged mode inside an interrupt handler, or if the processor will just ignore that. I don't have an M3 handy with me to test at the moment so I am wondering if anyone knows the answer or is able to test?
Basically my scenario is I would like to be able to implement asynchronous "event handlers" from user code that are triggered by some hardware activity, but I want these to run in unprivileged mode, the obvious way to do this is to just have a loop like this in thread mode after setting up the kernel:
while (true) {
__WFI();
if (event_triggered) {
run_event_handler();
}
}
But the downside is that this code will be constantly running and doing the check whenever any interrupt happens, even if no event handler actually needs to run!
Whereas instead I could simply have a purely interrupt-driven design where whenever the kernel does something that (it knows) will trigger a user event, it can raise, say, a low-priority PendSV which then runs them as needed... but of course that would then run in a privileged context. So can I switch back to unprivileged here?
AI: So can I switch back to unprivileged here?
Yes. The simplest method would be to set up another stack for the unprivileged "thread".
Now you can simply switch stacks in the interrupt handler and use the standard "exception return" by moving a special value into the PC. |
H: Deriving expressions from transfer function of state variable filter?
I have been trying to design a state variable filter based on a block diagram provided. The transfer function which I have is of the form:
$$\frac{K_1K_2}{s^2 + K_1s + K_1K_2}$$
I need to obtain and derive expressions for the natural frequency and quality factor of the state variable filter in terms of \$K_1\$ and \$K_2\$. In order to do so I need to compare my T.F with a 2nd order normalized T.F for state variable filters. Below is the T.F I am comparing with from this website.
$$\frac{V_{\text{out}}}{V_{\text{in}}} = \frac{A_o\left(\frac{f}{f_o}\right)}{\left[1 + 2\zeta\frac{f}{f_o} + \left(\frac{f}{f_o}\right)^2\right]}$$
I am getting confused since the 2nd order normalized T.F does not have an \$s^2\$ term.
For the natural frequency I have got:
$$\omega_n\text{ or }\frac{f}{f_o} = \sqrt{K_1K_2}$$
and for the quality factor:
$$2\zeta\omega_n = K_1s$$
$$\zeta = \frac{K_1s}{2\sqrt{K_1K_2}}$$
My question is: Am I comparing to the right transfer function since it does not have s squared terms? If so have I proceeded correctly? If not, are there any tips on what I could do to derive the above expressions correctly?
AI: The transfer function of a second-order low pass filter is given by (reference):
$$H(s)=\frac{\omega_0^2}{s^2+2\zeta\omega_0 s+\omega_0^2}\tag{1}$$
where \$\omega_0\$ is the resonant frequency (in radians), and \$\zeta\$ is the damping ratio.
Comparing \$(1)\$ to your transfer function you get
$$\omega_0=\sqrt{K_1K_2}$$
and
$$\zeta=\frac12\sqrt{\frac{K_1}{K_2}}$$ |
H: How do I read these blasted five-band resistors?
I have 500 resistors designed like this:
That's brown, red, black, black, brown. Roughly equal spacing between all bands. 120 ohms, right? No. This is a 10k resistor: brown, black, black, red, brown.
Why would they label it this way? They could easily have labeled it brown, yellow, SPACE, brown and it would be obvious how to read it. Am I missing some technique?
AI: According to the standard there is supposed to be a larger gap between the tolerance band and the others.
Now, in your particular case, that difference is almost so subtle you can not see it. However if you look closely you can see that the tolerance band has a slight gap to the neck of the resistor comparted to the first digit.
As such, this resistor needs to be read from the right.
However, the tolerances involved in "painting" the lines is not that well controlled, especially for cheap resistors from over-seas. As such, sometimes you have no option but to verify the resistance with an ohm-meter. If the resistors are a mixed bag of singles, that can be quite the chore. If they are still on the tape, not so much. Measure one and write the value on the tape.
If they are 5% or 10% resistors it's easier since silver and gold are not used in the first digit location. |
H: Using a digital potentiometer in a voltage divider
I'm using an MCP3008 ADC and an MCP4131-103 (10k) digital potentiometer to try and create a sort of "adjustable voltage divider."
For the project, the resistance I'm measuring will vary, and I hoped to use the MCP4131 to adjust my reference resistor on the fly. Namely:
Vin
|
R1
|
|--Vout
R2
|
GND
I'm measuring and logging R1 (a material) over time, and it increases from maybe 500-20k Ohms over the duration of interest. If I use a fixed resistor for R2, I get poor resolution when the value is mismatched with the current value of R1. I hoped to have the digital pot adjust itself based on the running average so I also maintain my resolution.
I believe I have both the MCP3008 ADC and the MCP4131 working individually with my Raspberry Pi 3 using SPI, but they don't seem to work like I expect in a voltage divider setup.
Wiring up the MCP3008 like this Adafruit guide, I used a voltage divider with a 10k resistor as R2 and the following formula to find R1:
v_out = adc * 3.3/1024
R1 = R2*(3.3 - v_out)/v_out
| resistor used | calculated |
|---------------+-------------|
| 1000 | 1010 |
| 4700 | 4628 |
| 47000 | 46574 |
That confirmed that my ADC appears to be functioning well.
In addition, I cycled through settings for the MCP4131 and manually read the value between the high (3.3V) and wiper with an multimeter. In each case I'm sending a value of target resistance * 128/10000. I plotted the results and get:
That looked good enough for me to believe the pot is also connected and functioning correctly.
Now, when I try to setup a voltage divider like the above to test both the digital pot and the ADC together, I get wonky results. I've tried two configurations to troubleshoot, substituting the 4131 as either R1 or R2, with a fixed resistor as the other one used:
wiper pin of 4131 --|-- resistor -- GND
|
|
ADC
3.3V -- resistor --|-- wiper pin of 4131
|
|
ADC
Using a 10k resistor in the first configuration and setting the digital pot to 5k, I get a raw ADC reading of 403, or 1.3V. I'd have expected:
3.3V * (10000 / (10000+5000)) = 2.2V
This results in a calculation of:
10000*(3.3 - v_out)/v_out = 15384 # should be 5000
Swapping things around and using the second configuration, I get an ADC reading of 624 or 2.01V. I'd expect a value of:
3.3V * (5000 / (10000+5000)) = 1.1V
This results in a calculation of:
5000*(3.3 - v_out)/v_out = 3209 # should be 10000
I'm wondering if because the potentiometer is really a voltage divider in and of itself, it's not behaving like I expect. Should I be, for example, changing my ADC Aref or GND to one of the R_a or R_b pins on the potentiometer? Or perhaps the error is in my code and I need to account for two voltage dividers in a row?
I haven't found any examples of using a potentiometer as one of the resistors in a voltage divider. Unfortunately, a potentiometer is one, searching "using a potentiometer in a voltage divider" gets a ton of hits that simply explain what pots are.
Thanks for any guidance, and I'm happy to post whatever other information would be helpful.
AI: You need to configure your digital potentiometer as a rheostat. If you connect the wiper with one of the terminals A or B, you will get a variable resistor between the two terminals A and B.
According to the datasheet, the wiper is at B when the digital potentiometer is set to 0, and A at full scale. This means you can choose whether the resistor will be near 0\$\ \Omega\$ or 10 k\$ \Omega\$ when you set the min/max value in software depending if you connect A or B to the wiper. This may make your software routine more convenient. |
H: Calculate resistance for high amperage LEDs for control with Arduino
I'm trying to control my LED strip with my Arduino, so I decided to buy a FET. Now I want to learn why and what kind of resistance should be put between the gate and the Arduino.
I have a long (1560 cm) LED strip connected (in parallel). The strip consumes 1.2A per meter, so it needs 18.7A.
I bought a N-Channel Mosfet (IRF540N, which can handle up to 30A), but the problem is that I'm new on resistances.
I know the formula of Ohm's Law, but my problem is that I don't understand it well.
What resistance should I put?
AI: You must connect the negative side of the LED strip to the Drain (D), the ground (the negative side of the power supply) to the Source (S) (without any resistor)
and the Arduino output to the Gate (G). Apply at least 4V to the Gate but no more than 18V. So your 5V from Arduino is fine. On the gate you need two resistors: Between the Arduino output and the Gate, put a resistor of 140 Ohms (or between 100 and 1K if you don't have 140 Ohms exactly). Between the Gate and the ground, put a resistor between 200K and 800K (any value in between is ok). HTH. |
H: Dynamo connected to a motor question
Brief explanation: From the figure above, (B) is an electrical motor and (A) is a Dynamo, the red mark is a rotating rod connected to the dynamo. The dynamo is supplying power to the motor (B), hence the motor is getting more power which in turn makes the rod rotates faster.
Is the rod RPM going to keep increasing non stop or is it going to stop at a certain RPM and not increase any further?
AI: Let's say you can get 20 W out of your dynamo.
Its efficiency is < 100% (it always is). Let's say it's 80% so you will need to put in 25% more mechanical energy in than you hope to obtain in electrical energy. That means you will need 25 W of mechanical power from the motor.
You are now just wasting 20% of the motor output as heat in the dynamo. This is before we look at the extra heat generated in the motor.
You are inventing "free energy" or "perpetual motion". Since these violate the laws of thermodynamics they can't work. |
H: Air Purifier Circuit Mod Help
I have an air purifier I would like to modify the PCB to an always on state at high setting when plugged in. This would allow me to control the device with and Amazon Echo compatible smart plug.
Important switches on the board
SW2 - Power on the unit which is initially in an off state.
SW1 - Cycle through fan speeds which is initially in the "Auto" state. 4 presses gets you to High, the 5th press back to "Auto". "Auto" works based on a dust sensor.
SW1 and SW2 are labeled in the PCB screenshots below:
Thanks in advance for any tips or guidance for this project.
AI: It seems you want to defeat the auto control method and have some personal need to control it remotely and defeat all the uC functions for the sensor and switches. This implies a steady state operation and can be monitored on the connector CN1. If you measure the voltages on each pin for each level (after you locate the 0V reference pin on the PIC processor. )
Then you can toss the board and just use jumpers to make connections on CN1 to enable the fan at full speed and ionizer all the time.
But I am not sure of the value of doing this unless the noise of the fan keeps you awake at night. Then I would look at a better fan or a better quality air filter. |
H: Computer won't post / Beep unless Unplugged for a few hours
I'm experiencing this issue for almost a year now. It is slowly getting worse. My motherboard is Gigabyte GA-Z77X-D3H and my PSU is Corsair CX600. The source of the problem most likely has to do with either one of these two components. I have built this PC 6 years ago. Thus this problem started to appear after 5 years. Motherboard is compatible with LGA 1155 chipset only.
As i mentioned, the PC won't beep/boot properly unless unplugged for some time. This time can be 30min, 1 hour, or a few hours (last time -today- it needed 2 hours). I have to unplug all cables from the chassis to bound the causes of the problem. My case (Mid Tower) is a bit cluttered now with all the cables, but i have them all separated and making sure that no cross contacts, or shorts are occuring, so i'm probably ok there.
I have replaced the CMOS battery, the fault isn't there. RAM Sticks, GPU, Storage drives are all working properly. I have also recently installed a custom fan speed controller. Finally all caps on the mobo look fine.
Could someone suggest me some methods i could try to identify which one of the 2 components is failing, or whatever else may be wrong? Thanks in advance.
EDIT
I forgot to mention that once the computer is powered on properly then there's no problem at all. I can leave it on for days without an issue.
AI: I'd suggest that you need to disconnect all internal peripherals (disk, floppy, USB (except keyboard) and test POST functionality for your motherboard.
You can get modern POST cards that will help you (here is an example: https://www.amazon.com/Desktop-Notebook-Motherboard-Analyzer-Diagnostic/dp/B01HRFQ8YM/)
If you test POST with only your keyboard and display attached you should either get Boot messages on your display, or POST failures on your tester card.
As a quick test I'd ensure your +5 V standby is working correctly, I've seen this impact your ability to turn on a PC with no other side effects once started. |
H: Missing component on the Usb to RS485 converter
I have a Usb to RS485 converter that was dead on arrival. I opened it up to see if I could fix it to find out that it was missing a component on the top left corner. This is a very common converter. Can someone who has the same device tell me what the missing component is?
Thank you!
AI: Looks like it is missing a resistor with the marking 121 on it (120Ω)
There must be one at each end of the buss. So if this is just point to point, then it may be added externally to the screw terminals. (kudos to GK for the nudge)
I would use a logic probe, scope or DMM on the MAX chip pin 1,2,6,7 and check status. If RE is low then RO = voltage(Pin 7-pin 6) "1"=+ve, "0"=-ve |
H: What is the advantage of an advanced battery charger?
Since my old, dirt cheap battery charger broke down, I disassembled it and was surprised not to find any integrated circuit in it:
Obviously, I'm now looking for a replacement. Now, there are advanced battery chargers which advertise:
... provide longer lasting, better performing batteries ...
But I'd rather ask in this community: What are the specific advantages of the more expensive models? I guess they're limiting the charging current? But if they only inform me on fully charged batteries I'd rather stick to the cheap chargers.
I'm slightly unsure if this is the right place to ask such a question (it sounds like buying advice) -- let me know if not.
AI: I'm assuming you only want to charge NiMh and/or NiCd based cells because that's what your old charger supports. If it supported Lithium based cells it would need to have more complex electronics.
The more expensive chargers often use a higher charging current for faster charging but this means that this current has to be switched off or lowered when the cells are full.
Cheap chargers like your old charger take much longer (10 - 14 hours) to fully charge the cells. These chargers simply charge with a small current which is allows continous charging meaning, it does not need to be switched off.
When NiMh and NiCd cells are fully charged but you still charge them, they get warm. That's not a problem at a low current (as is the case with the simple chargers) but it is a problem (the cells will overheat) at a large current. So fast-chargers need electronics to detect that a cell is full and stop fast-charging it.
If you can wait for your cells to charge, by all means get a slow / cheap charger.
If you cannot wait, get a fast charger.
You could also consider buying more cells and alternate sets using the slow / cheap charger and for the same money as a fast charger.
For cell lifetime in my experience the slow charging does put less stress on the cells so that should make them last longer. |
H: Non blocking delay for state machines
What is the best way to implement a non blocking delay for a state machine for each state?
So far, the best I found is something like that:
static uint8_t state = STATE_ONE;
if (state == STATE_ONE)
{
static uint64_t time_value_ms = (uint64_t)0;
if (time_value_ms == (uint64_t)0)
{
time_value_ms = system_get_ms() + delay_ms;
}
else
{
if (system_get_ms() > time_value_ms)
{
time_value_ms = (uint64_t)0;
state = STATE_TWO;
}
}
}
else if (state == STATE_TWO)
{
static uint64_t time_value_ms = (uint64_t)0;
if (time_value_ms == (uint64_t)0)
{
time_value_ms = system_get_ms() + delay_ms;
}
else
{
if (system_get_ms() > time_value_ms)
{
time_value_ms = (uint64_t)0;
state = STATE_ONE;
}
}
}
.
.
.
else
{
return;
}
But the problem in the code above is that when the state changes, the time_value_ms variable has to be set at 0 in order to be available to count a delay again when the state return in the STATE_ONE afterwards.
Therefore when you need a non blocking delay in every state in a big state machine with too many states (10 states for example) the code becomes complex with very bad readability.
The delay is used as timeout timer for deadlock or an event timer.
AI: This can be solved by using function pointers.
void (*FP)(void*, uint64_t);//FP = Function Pointer
//The void means that whatever function FP will point
// to will always return nothing.
//The *FP means that FP is a pointer named FP.
//The void* means that whatever function FP will point
// to, its first argument will be yet another pointer of type void.
//The unsigned long means that whatever function FP will point
// to, its second argument will be an unsigned long variable.
uint64_t next_time_pulse=0;
//time variable that we compare system clock with
void state_0(void* FP(void*, uint64_t), uint64_t t){
//custom code that should always happen if state_0 is active
if(t<system_get_ms()){
//custom code that should happen when state_0 transitions to state_1
FP = &state_1;
t = system_get_ms()+delay;
}
return;
}
void state_1(void* FP(void*, uint64_t), uint64_t t){
//custom code that should always happen if state_1 is active
if(t<system_get_ms()){
//custom code that should happen when state_1 transitions to state_0
FP = &state_0;
t = system_get_ms()+delay;//this will update "next_time_pulse"
}
return;
}
void init(){//initiate your system, only called once
FP=&state_0;//Set FP to state 0
next_time_pulse = system_get_ms()+delay;
//when should the absolutely first clock happen?
}
void loop(){//your main loop of your system
//some code that won't be blocked.
FP(&FP,&next_time_pulse);//This will call either state_1 or state_2
//if you want to know which state FP is in
//then write whatever that knowledge would give you, in the functions
}
As you can see, I'm just using pointers, so if you need several finite state machines happening independently then you can just make more variables, and most likely just store them in an array.
If you need more states then you just add more functions.
Another way of solving it would be with just simple arrays, because that's the essence of the above solution.
uint64_t machine[2];
uint8_t next_state[2]={1,0};
//state 0's next state is 1
//state 1's next state is 0
//=> {1,0}
void init(){//initiate your system, only called once
state=0;
//Set state to 0
machine[0]=system_get_ms()+delay;
//when should the absolutely first clock happen?
}
void loop(){//your main loop of your system
//some code that won't be blocked.
if(machine[state]<system_get_ms()){
state=next_state[state];
machine[state]=system_get_ms()+delay;
}
}
This way it's more difficult to make custom things happen depending on a state (could be solved with a switch case... ), but your simple example is now simpler to understand code wise.
Though, with more information regarding how you are going to use your finite state machines, more elegant / optimized code could be made. |
H: How does this transformerless 5V power supply work?
I recently took apart a crock-pot cooker that stopped working correctly.
It had two boards:
One that dealt with the high-voltage for controlling output to the heating element
The other had a 4-bit microcontroller and a few buttons/LEDs.
I was surprised to see no transformer anywhere, and very few parts, considering there was a signal labeled +5V for powering the microcontroller.
I reverse-engineered the schematic:
simulate this circuit – Schematic created using CircuitLab
Is it me or is this a really crappy design?
I was very surprised to see that the DC GND was connected directly to the 120VAC L!
Is the 5V DC basically just a rectifier with a voltage divider?
AI: It's you.
The 1.5uF film capacitor acts as a reactive (lossless) dropping element. D21 shunts negative current away and D22 conducts positive current to the filter capacitor C23 and it is limited by the 5.1V Zener diode D23. The 1M bleeder resistor (across the 1.5uF) prevents a shock from touching the plug pins after it's pulled. R21 limits the peak current to about 7A if plugged in at an AC peak.
This kind of circuit requires all elements that could come in contact with a human to be isolated from the mains for safety, including any kind of display, switches etc. Any breach in that insulation (including you opening up) could lead to a potentially fatal shock.
As in the comments, your heater should go directly to the N side of the mains. There's probably an overtemperature fuse cutout in there somewhere too, maybe buried near the heater, and probably an overcurrent fuse somewhere. |
H: Altium Designer 16 - CurrentDate Special String Format
In previous projects, I used the CurrentDate special string, in the format YYYY-MM-DD (see the image below).
Opening the same project on a different installation of Altium, the format has been automatically changed to MM/DD/YYYY. Is there a way to change this format?
I'm unsure if I changed it in the past. If I did, I don't remember where this setting lives, and I can't seem to find it in the Altium documentation. Any help would be really appreciated.
AI: It most likely uses your Regional Setting from Windows. |
H: What converter to use?
I am going to build a stage box, and I need 5V for that (to add some logic, maybe even later an STM32).
I also need mains (220V) for a 12W RGBW LED PAR light.
At first I thought to put in the box a 'wall socket' with two 220V plugs, but since the 12W needs to be switched by a relay, only for 5V I need a solution.
My thoughts were:
Using a buck converter like this. However, I don't see any holes, so I don't know how to fix it inside an enclosed box.
Using an already enclosed converter like this. I also don't see holes here, but at least I can glue it on one side. This one is twice as expensive (but still cheap).
Using a switching power converter like this. This one has holes, but cost even more. And I don't need the power it can deliver.
Using an adapter (220V->5V).
I'm quite a novice, so these questions might be trivial but not for me:
About option 1: How can I 'fix' this part in an enclosure? With using glue? I don't think it will be safe for 220V, especially if I want more in the enclosed box (like the STM32 later).
About option 2 (but also 1/3): Can I safely put this in a 'closed' enclosure? I think I can since the power usage is quite minimal (200 mA, maybe even less). So actually option 2 is already an enclosure, but I want to put it in a bigger enclosure with all logic (STM32 possibly and the relay).
About option 3: I like the holes, but that's it. Feels awkward to buy this just because it is the only solution with holes to fix it.
About option 4: I feel more comfortable with an adapter, however, I really don't like the idea to put inside my stage box a wall outlet, just to put the adapter in. I though about cutting of the 'adapter' part, but still what I keep is essential option 2.
(Actually all questions come down to: how should I fix/consolidate them in an enclosure and will I get problems with heat?)
AI: Pins to another board (like a "perf board") with pads (or a PCB). Same as #2.
"Safe" is relative for those things. None of them bear any approval markings, so you have to assume that each could kill you or burn your house down. If you have no datasheet there's no way to tell how inefficient they are. They're probably just as (un)safe in a moderate size enclosure as a huge one.
That one looks a bit better designed (EMI filter, inrush NTC) but not everything that could kill you is visible.
That one might have non-fake approvals but as you say is not convenient.
If this is a real application, I strongly suggest you use something from a reputable manufacturer with (non-fake) approvals. It will cost more, but you'll be able to sleep at night. Try a small (eg. 10W) enclosed supply from Meanwell (from a reputable franchised distributor not ebay/Ali).
All your questions should be answered by the manufacturer's data sheets and supporting documents (application notes etc.). If they can't supply those documents, you should not buy the product, in general but particularly for a safety-critical component. |
H: Relationship between input voltage and output voltage for an active filter
I'd like to know if I understood correctly the relationship between input voltage and output voltage for an active filter.
I study in French, so please understand if my glossary doesn't accord with English ones.
Say, [Av] is the coefficient of amplification(10^(Gain/20)). [Vi] is the input voltage and [Vo] is the output voltage.Φ is the phase shift between [Vi] and [Vo].
So,
Vo = Av * Vi(ω*t+Φ)
Isn't it right?
AI: What you have is accurate for \$A_v\$ at a particular \$\omega\$. For example, take this graph:
This is the attenuation (attenuation = 1/gain) of a passive low pass filter. The gain is measured in decibels (dB), and, you are right, you convert from dB to Av with $$A_v = 10^{Gain/20} = 10^{-Attenuation/20}$$ So for low frequencies, the attenuation = 0, so \$A_v = 1\$. But, \$A_v\$, and \$\phi\$, change with frequency. For your equation to work, you need to turn \$V_i\$ into its frequency domain components, apply the equation to each component, and then integrate the components. So, for a square wave at 10 Hz, we know the wave will have decreasing harmonics at 30 Hz, 50 Hz, etc. To see what we would get out of the filter, we would apply the input harmonics, using the appropriate \$A_v\$ and \$\phi\$ for each frequency. So we would get:
$$ V_o=A_{v-10}*V_{i-10}*cos(10*t+\phi_{10}) + A_{v-30}*V_{i-30}cos(30*t+\phi_{30}) + ... $$
Where \$V_{i-10}\$ is the 10 Hz amplitude of the square wave, \$A_{v-10}, \phi_{10}\$ are the 10 Hz gain and phase shifts. If this were a more complicated signal, you would need to integrate it over all the frequencies.
Does that make sense? |
H: Boost converter is acting as a capacitor
I've just bought two Xl6009 Boost converters and both are showing the same problem. When I connect a power source to the input terminals and tried to measure their output it shows 1 on the left side of the multimeter (meaning infinite resistance ) then when I take out the power source then it immediately shows a reading of 14-20 volts and gradually falls to 0 volts just like a capacitor ...I've tried 3.7 lipo , LiCd and 5v adapter but same results. I have also adjusted the pot but no effect .
AI: There are several things wrong with this so-called question, the most obvious of which is that YOU DON'T EVEN ASK A QUESTION!
Second, when in voltage measurement mode a "1" on the multimeter does not mean "infinite resistance", it means "out of range", meaning the voltage you're trying to measure is too high for the range your meter is set to. Try setting to a higher voltage range.
Third, you don't provide a schematic of your setup. How are we supposed to diagnose a supposed "problem" if we don't even know the circuit you're using?
Boost converters require capacitance on the output in order to filter out the high-frequency switching noise and provide you with a clean DC voltage. As those capacitors discharge I expect the output voltage to decrease (following the remaining voltage across the capacitor terminals). What you describe makes perfect sense and I don't know why you think something is wrong. This is pretty standard behavior for any kind of switching converter. If you want the output to drop to 0V faster when you remove the power supply, decrease the output capacitance (if possible). Just remember that this will allow more high frequency noise to appear on the output, so it's a tradeoff between how fast the output drops to 0 volts and how much noise your application circuit can handle on the power supply. |
H: Never use Ni-MH batteries in a toy?
This is a simple battery powered toy basically just a DC motor.
Never use Ni-MH Batteries
Why would Tamiya 4WD JR prohibite rechargable Ni-MH batteries? As I understand it, the voltage is a bit lower, but beyond potentially lesser performance, I see no danger. Thoughts?
AI: This model has a low quality metal-brushed 'toy' motor which has very limited lifespan. It doesn't appear to have a current limiter or overload cutout, and is probably controlled by a simple on/off switch.
Alkaline cells have higher nominal voltage than NimH, but under heavy load a good NiMH will produce higher voltage for longer. In the graph below the performance of a Sanyo Eneloop (low self-disharge NiMH) and high capacity NiMH are compared to a typical Alkaline cell at 1A discharge. The alkaline can only manage about half an hour at an average voltage below 1.2V, whereas the high capacity NiMH gets over 2 hours mostly above 1.2V. The Eneloop is even more powerful, but has slightly shorter run time due to its smaller capacity.
The extended run time and higher voltage from NiMH would wear the motor out faster, and if stalled the battery could deliver enough current to burn out the motor and/or wiring. Apart from the potential fire risk, the result would be an unhappy customer who might blame the manufacturer for producing a poorly designed toy.
By specifying Alkaline only, Tamiya avoids having to improve the electronics to work with better batteries. At the time that this model was designed (1987) good quality motors and sophisticated electronic devices were relatively expensive, so that may have been a wise decision. |
H: Noise issues Atmega power line
I have designed a PCB that has a Atemga328 chip, connected to 6 logic level MosFETs via the PWM lines of the chip. The board is primarily designed to run long lines of led strips. Turning them on, fading etc.
The board has been thoroughly tested, and the only issue discovered is that when there is a big load (~4A per mosfet), the atmega chip becomes unresponsive. This is exacerbated when driven with PWM signals rather than leaving the load permanently on.
On inspection, there is a huge amount of noise on the power lines that correspond to the switching of the mosfets (I cannot produce screenshots at this point in time).
Upon doing research I have found a couple points of possible failure with my design.
The use of a 7805 regulator for atmega chip. Although I would like to keep this cheap do to wide availability.
The use of a common ground plane for the power and digital grounds.
My question, is will separating the digital and power ground planes would help with the noise? And what other steps can I take to reduce noise in the power lines?
board layout without planes
board layout with ground plane
board layout with 12V plane
Notes:
The board is designed to use a 12V rail for the MosFETs.
Two layer design.
AI: The decoupling capacitors for your Atmega should be directly across the supply pins and as close as possible to the pins. Try soldering a 100nF directly across pins 7 and 8 and also 20 and 22.
If you intend to relayout the PCB you need to think about getting the high current path off the groundplane and as short as possible. You have three sets of two outputs and three ground connects. Change the output ordering and group these as three sets of output-ground-output the ground is connected directly and only to the two transistors driving that output. You then add a single point connect from your groundplane to a point between the transistor sources to enable the gate drive. Use a separate logic ground connection. |
H: Cannot change to front copper layer in KiCAD
I am learning to design PCB using KiCAD. I followed a tutorial on youtube. I got stuck at changing the layer of the PCB. From the video, the layers can be interchange by pressing page up (front copper) or page down (back copper). My filled zone layer is b.cu and net is GND. The B.Cu layer is just fine but when i change to F.Cu layer, it is still the same as before.
I have inserted a picture showing my issue. As you can see the selected layer is F.Cu but it is showing the back side. What have I done wrong and how can I change to front layer?
AI: Personally, I do the copper pour after routing is done. But any way, you can untick B.Cu layer to hide the bottom layer. Also you can click on "Do not show filled areas in zone" on the left side toolbar(11th button from top), to hide the copper pour. Doing this is a must when routing on bottom layer, as you will not be able to see the tracks as lay them down and you will need to rebuild the copper pour every time after the wire is connected by pressing 'b'.
Another thing, in the tutorial, he is using openGL mode while routing, and from the screenshot its seems you are in default mode. To switch to openGL mode go to View>Switch to OpenGL or press 'F11' key. |
H: Writing SPI Flash on Mac
I am not entirely sure whether this question would be on-topic here, but I am stuck on this issue unable to find any relevant answers online in any other sites.
I am working on a pet project which includes using SPI NOR (I am going with 16MB Winbond W25Q128 SOIC-8 chip). This chip will be used for bootloader storage.
Now I got my hands on STM32 based programmer for SPI chips (SOP8-SOP16, see pics below). However this programmer seems to work only with software provided by whoever designed it, which is only available on Windows XP (attempting to run it on Win7 results in it working, but machine complains about libusb drivers that it installs). I do not have any Windows machines, I mostly use Mac since it was enough before (I also have a few headless Linux boxes at my disposal). But Mac (nor Linux) do not recognize this programmer.
So my question is what are inexpensive programmers that I could easily use for writing/dumping SPI memory on Mac or Linux? (I have read that dediprog ones work on Linux, but their price-tag is way out of my budget).
AI: It seems that somebody has already written some software in python to interface this exact dongle (labelled WTX100, apparently a relatively popular, cheap SPI programmer), without needing any part of the original, closed-source software:
https://github.com/mytbk/xtw100
So you need python with the pyusb library, and then you'll probably need to tweak this program to your needs, but it seems you have the possibility to use your dongle from non-Windows operating systems. |
H: Clip type for in-system programming (SOIC8 vs DIP8)
Updated:
What clip can I use to connect to this [specsheet] SPI flash chip in a DIP8 package?
note: this picture is of a motherboard that belongs to someone else, but mine has the same manufacturer, model-family, and Winbond 25Q64FVAIG. Only the third line (date code?) is different. The surrounding circuitry appears identical.
Original post:
I'm under the impression I can't use a SOIC8 clip to connect to a DIP8 package.
I'm seeing a large number of clips labelled both SOIC8 and DIP8 (1, 2) - one with a description saying "clip onto any 8 pin SOP, SOIC or DIP package."
What am I missing?
AI: You are correct, the pin pitch is different so you'd need a dedicated DIP clip or a dedicated SOIC clip. I think the description for that product may be misleading.
EDIT: The chip is socketed so you can carefully pry it up and program it outside of the circuit, like on a breadboard. This is probably what's best unless there's a dedicated header on the board for in-circuit programming. Taking it out of the circuit removes ambiguity as you can control what it's connected to. You won't need a test clip anymore either. |
H: Diode breakdown
I read in the book, "Microelectronic Circuits" that the breakdown of a pn junction is not a destructive phenomenon given that the breakdown current is limited to a safe value by an external circuit.
What does it imply by a safe value?
How it is ensured by an external circuit that the safe value is not crossed?
And what happens if the safe value is crossed?
Edit: I found out that the safe value is the value which ensures that power dissipated in the junction is allowable to a safe level. But I couldn't find answers to my remaining questions.
AI: PN-junction breakdown means that the diode's breakdown voltage is exceeded so that the diode is no longer in reverse mode (meaning, almost no current flows) and that a current does start to flow. How much current will flow is then only limited by all the series resistances of the diode and the voltage source supplying the reverse voltage.
If the sum of those series resistances is low enough, a large current can flow. Since the power dissipated in the diode will be P = I * V ,the reverse voltage times the current. That dissipated power heats up the diode, above a certain temperature, the diode will be damaged.
The current can be limited by increasing the series resistance, for example by simply adding a resistor in series. Another approach is using a current limited supply for the reverse voltage, such a supply will simply decrease the voltage so that a certain current value is never exceeded. |
H: What is the RS-485 line wire series resistance limitations?
Just tried to simulate the communication line with the series resistance in it:
As you can see even at 1 MBPS the signal at the "receiver" is fairly good. I'm pretty sure that this will be OK to receive the signal.
The reason I tried to think about the series resistance is an intention to put the resistors at the reseiver with a parallel TVS (or Zener) diodes to protect the receiver (I will need to have a long transmition line). After I put the zeners the falls and rises become much slower (I beleive that it was due to diodes parasitic capacitance):
I think it would be a bad idea to put TVS without a resistors.
15 pF capacity I took from some RS-485 transceivers datasheet. Actually I was able to find the receiver input capacitance only in the TI's AM26C31ID datasheet (it was 6 pF). Probably there are other devices with this parameter specified but many from MAXIM and Analog Devices was not :(
So it looks that the wire series resistance is not an issue for communication under real circumstances. Are there any other points I am not aware of?
UPDATE:
I made a simulation with lossy transmition line (LTRA) and came to the conclusion that the series resistance is not influence much to the signal (it is 1 MBps, at 200 meters, which is pretty long for this speed):
However this resistance CAN influence the signal in some cases:
if the termination resistor placed AFTER there resistance
if the series resistance become close to the input impedance of the receiver which leads to significant amplitude reduction.
AI: That is an oversimplified model. You should use a lossy transmission line with terminations to properly simulate the circuit.
In LTSPICE the model is LTRA. Expect it to take a rather long time to run.
The maximum recommended length is 4000 feet. Assuming AWG 24 wire, that's 200 ohms round-trip. Consider the extremes of common mode voltage and loading (32 unit loads).
Much more in the NS (now TI) application note [10 Ways to Bulletproof RS-485 Interfaces] (source of the above graph).
Probably if you are willing to relax the requirements from the standard, reduce data rate and use heavier gauge wire you can use longer wires. You would probably want to go to isolated drivers and/or receivers since it's difficult to guarantee the common-mode voltage over such distances. |
H: Using one pot to control simultaneously different parameters
First, please forgive my lack of knowledge, as i'm a beginner in the matter.
I'm looking for a way to control with one pot different parameters. In context, i'm trying to control a Filter Cutoff on two different channels. Later on i'll add options for more filter types, so a Dual-Gang Pot won't do me much good.
Also, i'm trying to do it as analog as possible. No MCUs in the mix.
I've been lurking everywhere to find such a method, and so far, aside from possibly a digital pot (which would require some digital circuitry, adding more components on a already tight space), i just can't find anything.
Could you possibly help me with this ?
Thanks
Now understanding it is virtually impossible, best choice for now is to use as many Double-Gang Pots as needed, in my case 6 of those. Thanks anyways for your help :)
AI: Short answer: To "simultaneously" control two parameters? No. To "sequentially" control two parameters? Probably, if you use a switch to select between the channels - as long as you can tolerate needing to "refresh" the settings on each channel every so often.
Long answer: Almost anything is possible with the right circuit, but it's impossible to affect two variables independently with only one input. You can use a switch or button as an additional input.
I'm assuming you have two outputs: filter cutoff on channel A, and filter cutoff on channel B. I'm further assuming that the filter cutoffs can be controlled by a single analog voltage. The first thing you need to do in the design process is envision exactly how a single pot would control both variables. The most obvious method is to use a switch to select which variable is being controlled, and remember the setting of the other variable when it is not being controlled.
For now, let's remove the "no microcontroller" restriction so that we can get access to digital memory, which can retain information perfectly. You could use a switch to select between the channels - when you switch from channel A to channel B, the current position of the pot is sampled, saved, and used to control the channel A cutoff. The pot is then available to control channel B.
Now, back to the purely analog solution. You need an analog memory cell - say, a capacitor followed by an op-amp voltage follower - for each channel. You have a switch that connects the potentiometer to one capacitor or the other. The cap charges to a specific voltage while it is connected to the potentiometer, then when the switch is moved, the capacitor holds that voltage. You will need to make sure your cap self-discharge leakage and op-amp input leakage currents are extremely low to prevent the voltage from changing noticeably over whatever timeframe you expect to go between adjustments to each channel. And you'll need to balance that against making sure the capacitance and pot resistance are small enough to avoid a noticeable delay when you turn the knob (buffering the pot with a 3rd voltage follower may help with that).
Getting your capacitor droop small enough is where things get interesting. If you assuming 10pA leakage current, 0.1uF capacitors, and 0.01V allowable droop, you would have to refresh the voltage on each channel every 100 seconds. You can probably get to usable time intervals if you can relax the allowable droop and/or increase the capacitance. |
H: Finding cable impedance, to determine RS485 line termination
We have some Belden 6341PC cable which will be used with some RS-485 communications equipment, which of I'm learning will need line terminators. I'm told the resistor values needed should match the characteristic impedance of the cable. The problem is I'm not seeing anything on the datasheet which explicitly mentions the impedance.
I also see that, according to the spec sheet, this cable is rated as being for 'Pro Audio and Intercom Systems', not RS-485 systems.
1) Based on the info on the spec sheet, is there a way to determine which resister termination value should be used?
2) Should I recommend another cable be used instead? The problem is the cable has already been pulled, so we're hoping it'll work without issues.
AI: Impedance on cables is defined by the ratio of distributed reactance of L/C as follows.
\$Z_o=\sqrt {\frac{L}{C}}\$ for L= 0.16 uH/ft for each line and C= 44 pF/ft, line to line thus;
\$Z_0= \sqrt{\frac{0.16uH}{44pF}}=60 Ω\$ for each line and thus differential Zo = 120 Ω |
H: how does SSD non-volatile storage work
Is it because of the charge present in floating gate that SSDs are able to store information without power? If so, how long would the charge remain in floating gate without electricity?
AI: Usually they use a battery and refresh the memory with a controller on technologies that have don't have a permanent lifetime. Or they design the memory technology for a longer lifetime.
Some Enterprise class SSD's will actually lose their information if not powered up after a few months. |
H: Power supplies in series, can you ground the middle leg?
Let's assume I have two 15V DC power supplies. These power supplies are allowed to be connected in series (per the user's manual).
I have a device that requires a signal from +15V to -15V (motor driver circuit).
Typically, I would put both my power supplies in series, I would then provide 15V (relative to ground) to the motor driver circuit to use as ground. So from potential earth perspective, the motor driver circuit has 0V as its -15V, 15V as its ground, and 30V as its 15V.
However, what would happen if I were to put both of my power supplies in series and then ground (potential earth) the middle leg from image below (i.e. ground negative terminal on power supply 1/positive terminal on power supply 2). Would I need to worry about power supply 2 shorting to potential earth?
I would guess that since each power supply can be used in series, that means the + and - terminals are isolated from ground. Thus, it would be possible to connect the middle leg to ground. This would require that power supply 2 be able to maintain a truly negative voltage relative to potential earth.
Am I correct in this assumption?
AI: As long as the outputs of both supplies are floating (not connected to Ground, or to each other in some other way), connecting the two supplies in series, and calling the mid-point "Ground" is perfectly normal. |
H: How to measure small, spiky amounts of current?
Let's assume I have a microcontroller with some amount of peripherals attached and would like to be able to make a reasonable estimate of battery life. Because I might have it sleep at times, and various peripherals would be in differing states, my current consumption might vary between uA (in sleep mode) and some 10s of mA (when awake).
Now, I could attach a battery and let it run down and measure the time, but this makes it both time consuming and hard (and possibly expensive) to compare different approaches, both in the firmware and hardware.
I could place a multimeter in series, but even if it has data logging, that is at some interval and I'd have to interpolate, and could entirely miss variations smaller than the interval. (Plus burden voltage and all that.)
If my device sleeps enough, the awake current becomes somewhat negligible, but that might require a 1000:1 ratio of sleep time to awake time, so that's not likely on all designs.
Is there some device that integrates current over time at very small amounts (e.g., not the Kill-a-watt outlet meter)? Basically I'm interested to know that "over the last hour, 20mAh were consumed". Bonus points if I can get precision current measurements at any given time, to compare awake and asleep current consumption.
AI: Well, there's certainly specific current-sensing ICs. In your case, I'd "simply" go with something like:
Use a small (e.g. 0.5 Ω) series resistor between battery and your electronics.
Amplify the voltage across that resistor with an instrumentation amplifier
Log that voltage, e.g. using an ADC
Problems:
low currents · low resistance = low voltage: Your measurement accuracy will be bad due to noise
since microcontrollers wake up very fast and go to sleep equally fast, your ADC sampling rate necessarily needs to be very high.
But as a principle, that works, and is certainly viable (although designing a stable, low-noise, high-amplification instrumentation amplifier might be nontrivial; but: there's existing instr.amp ICs that make that a lot easier).
Luckily, your problem is rather common. So: Many, including Texas Instruments, have a portfolio of current sensing amplifiers, some of which integrate both aforementioned shunt resistor AND a digital interface. See TI's product listing.
In fact, these ICs are capable of measuring current and supply voltage at the same time – and that's great to actually measure drawn power, a measure far more relevant to battery life than raw drawn current, if there's nonlinear elements (that is, for example, MCUs).
The INA233, for example, can be connected to an external shunt (let's say, 0.3 Ω) and has a resolution of 2.5 µV per ADC step. That means, a single ADC step is I = U/R = 2.5 µV / 0.3 Ω = 8.333 µA in current.
I think that device also has an automatic sampling & averaging mode, so that you can easily get good approximations even under rapidly changing load.
Also, as I just found out: the thing has an "alert" level, so that you can wake up your measurement system whenever the current rises above a configurable threshold. Nice! That way, you only need to sample occasionally. |
H: Detect open AC circuit and fire alarm
I’m a noob, would appreciate any help with the following:
THE PROBLEM
We live on a mountain in North Carolina. When the temperature drops well below freezing, the well head freezes resulting in loss of water and broken pipes. I installed pipe heater tape which worked well for several years, but the tape burnt out and well head froze again. Many $$$ to repair.
THE QUESTION
Build a circuit that will:
1. The easy part… turn heater on when thermocouple is closed, turn heater off when thermocouple is open.
2. The hard part… when heater is OFF, monitor the circuit so that if the heater is open, an alarm will sound.
The problem is that if the heater fails (burns out) at 3 am, you don’t know about it until too late. After 4 days of head scratching, I came up with the attached circuit using several relays. I’m not sure this will work, I think the heater will still run when K2 is fired, and the alarm will be on anytime the thermocouple is open.… All commercial products are designed to thermostatically control a heater.
Looking at some circuits on Stack, it seems the best approach is a small current across the heater when it is off, then sound alarm when open is detected??
Help appreciated in advance…
AI: A couple of ideas:
simulate this circuit – Schematic created using CircuitLab
Figure 1. Monitoring continuity of the tape wiring.
The tape I'm familiar with has copper conductors with a "poor" insulation between the wires. This circuit monitors continuity of the copper. RLY2 should energise anytime RLY1 is on. If RLY2 does not energise then sound the alarm.
Your original question, however, doesn't indicate what the nature of the burn-out was: failed conductors or loss of conductance between the wires.
simulate this circuit
Figure 2. Current monitoring.
This circuit uses a current monitoring relay. If RLY1 turns on but there isn't enough current to turn on RLY2 then the alarm sounds.
Notes:
Both circuits will give a brief alarm circuit closure while RLY1 is energised and RLY2 is responding.
The circuits can be combined to use current monitoring and continuity monitoring.
Figure 3. A simple current monitoring relay.
A quick image search showed up the relay above. It is rated for 1 A through the coil. Note the few thick coil windings clearly visible in the photo.
simulate this circuit
Figure 4. Low-voltage permanent power.
Since neither of the above really do what you asked for I offer Figure 4 as a low-voltage power monitoring solution. A transformer provides, say, 12 V supply to the heater when off. A ten times more sensitive current relay can monitor this current and alarm if the current falls below the threshold.
Points to note:
Relays exhibit hysteresis. Once the relay energises it will remain energised until the current falls perhaps to half. This may be too late for your application.
You can combine any variety of the above circuits.
It would be more normal to put the thermostats in the live rather than neutral side of the relay.
Thermocouples:
Theremocouples don't work as you have drawn them. You probably mean a thermostat as shown in my schematics. |
H: Understanding constant current circuit
I've been learning about different constant current circuit designs and just recently stumbled upon this one. All I know is that the highlighted resistor is the load resistor and when varied, like a potentiometer, the current running through the load resistor stays the same. Also, adjusting the other two resistors will change the current through the load.
I think this makes some sense, for creating a path of less resistance either through the diodes or transistor will cause more current to flow in that direction. Yet, I don't understand why the current through the load is unaffected by the loads resistance. Is it because the current above the transistor cannot sense the loads resistance below? Therefore, once passing through the transistor you will have the same amount of current due to the fact that the current only has one path to ground? Maybe that's total nonsense.
Lastly, not sure why the diodes either.
AI: Zach, this circuit is pretty easy to understand if you understand the BJT first. (You will understand diodes, if you understand the BJT, so that's a given.) Everyone struggles with these things at some point, so it's fine you don't apprehend this well right now. Take it one step at a time.
There is plenty of information on diodes here (and elsewhere.) You are awash in information about them. I won't try and replicate any of that. It's enough for this circuit that you accept two things about diodes:
A forward-biased diode has a fixed voltage across it. For regular silicon diodes, this value is \$700\:\text{mV}\$. (For LEDs, which are also diodes, it varies with the color and type and you have to look at the datasheet for that.)
Everything I just said in point #1 is actually wrong. But for these purposes, you don't need to worry about that fact.
Now to the BJT. It also has a diode from base to emitter. So the rules above apply. But we add the following about the BJT:
When the BJT's base-emitter diode is forward-biased, the collector current is the same as the emitter current.
What I just said in point #3 is also wrong. But #3 is close enough for these purposes to not matter.
So. Now we can describe the circuit.
The \$20\:\text{k}\$ resistor forward biases the two diodes by providing a path for the current to go to ground.
The total voltage across the two diodes is therefore \$1.4\:\text{V}\$, with the rest left over for the resistor. Therefore, the base voltage for the BJT is \$10\:\text{V}-1.4\:\text{V}=8.6\:\text{V}\$.
Therefore also the resistor current is \$\frac{10\:\text{V}-1.4\:\text{V}}{20\:\text{k}\Omega}\approx 430\:\mu\text{A}\$.
The BJT's emitter is forward biased and therefore the emitter will be \$700\:\text{mV}\$ above the base or \$8.6\:\text{V}+700\:\text{mV}\approx 9.3\:\text{V}\$.
So the voltage across the \$500\:\Omega\$ resistor is \$10\:\text{V}-9.3\:\text{V}=700\:\text{mV}\$ (one diode drop -- which if you look closely you should see why this will be the case in this circuit.) From this, we can compute that the current in that resistor is \$\frac{700\:\text{mV}}{500\:\Omega}\approx 1.4\:\text{mA}\$.
Since by rule #3 above, the emitter current and collector currents are the same, it follows that the collector current is also \$1.4\:\text{mA}\$.
The collector current is always the same as the emitter current (within a reasonable approximation.) So, it doesn't matter what resistor you place between the collector and ground.
Except,
The above conclusion isn't right if the collector current we just worked out causes a voltage drop across the collector resistor that exceeds the base voltage. So this means that the resistor cannot be larger than \$R=\frac{8.6\:\text{V}}{1.4\:\text{mA}}\approx 6100 \:\Omega\$. So it has limits. |
H: SDRAM structure for Cortex-M7
I'm looking into designing a custom board based on a Microchip / ATMEL SAM S70 or STM32F7 / STM32H7. The SAMS S70 appears to be the cheapest option and offers roughly the same as the ST competitors.
I'm now trying to figure out how much SDRAM I can attach to these MCUs.
The datasheet of the S70 does not specify what type of SDRAM (DDR2, DDR3) etc. it can handle. How do I know what memory chips are compatible?
Browsing through digitec, I noticed that almost all (?) 1G memory chips have 8 banks, which is more than the SAM S70 can handle (4 banks max). And all the chips that I found that offer 1G on 4 banks are DDR1 only. Is the amount of data per bank somehow limited?
Also I am unsure how much data the memory controller on the SAMS S70 can adress per bank (row / column adresses) and in total. If I read the datasheet correctly, the biggest address is 13 bits of row address, 11 bits of column address + 1 bit byte offset + 2 bit bank address, i.e. 27 address bits in total.. that would be 1/8 of 1G, i.e. 128M?
Where does Page size play into this?
I know that these are many questions but I am quite overwhelmed by the amount of memory configurations and the limited information in the datasheets doesn't help.
AI: The type of memory you need is SDRAM. It is not the same as DDR SDRAM. I don't think I've seen a Cortex-M device that supports DDR memory yet. You would typically go for Cortex-A family, if you need that kind of capability.
You can easily find SDRAM chips on digikey or any other distributor site.
At this point, the rest of you question is probably irrelevant, but let me give you some extra points.
Both of the chips support 256MB of RAM. If you look at the digikey link above, the largest amount in a single chip is 512 Mbits (64 MBytes). This is where the data bus width comes into play. You can see that 512Mb chips come in three configurations:
16M x 32bit
32M x 16bit
64M x 8bit
One way to increase the memory capacity would be to use two 512Mb devices in 32M x 16bit configuration, and wire them up as shown in this Atmel app note, for a total of 128MB of RAM: |
H: Electromagnet Wire/Voltage/Magnets?
I have some questions about my project. I want to make a big electromagnet, the size is about:
Outer Ring:
50-70cm Height
35cm Diameter
Inner Ring (The Movement):
32cm Diameter
Now:
is it OK to use 1mm copper wire?
How much voltage do I need for a nice movement?
Must the inner ring be a whole magnet, or is it OK to make many small magnets on the inner ring?
AI: is it okey to take a 1mm Copperwire?
Yes. A single layer 60cm long will have 545 turns and need 600m of wire.
How much Voltage do i need , for a nice movement?
13 Volts. The coil will draw ~1 Amp. The movement will be very nice (synonyms: enjoyable, pleasant, delightful, entertaining, amusing). You could use up to 65V (which should draw 5A) but the coil will get hotter and the movement could get quite ugly.
Must be the inner Ring be a whole magnet or is it ok , to make many small magnets on the inner ring?
It's OK to put many small magnets on the inner ring - if you can get them to stay there. The magnets should all be oriented in the same direction, eg. north pole up, south pole down.
Resources used for calculations:-
Solenoid calculator
AWG gauges and their current ratings |
H: How to drive optoisolator from Mains
Most of the circuits that I have seen, MOC3021 or similar opto-isolator is driven from Micro-controller. I want to do the opposite - Can I drive the opto-isolator from mains supply and use the other side as INPUT to Arduino.
AI: This circuit is fairly commonly used: -
Note the values of R1 and R2 - they limit current into the opto's LEDs to a few mA. This is important because you need to "drop" the mains voltage to around 0.7 volts for each LED (one deals with positive half cycles and the other deals with negative half cycles).
One resistor could be used (circa 200 kohm) but its voltage rating may be exceeded by the mains voltage so, a lot of folk choose two resistors with their combined voltage ratings exceeding the peak of the mains AC voltage.
The circuit above is called a zero crossing detector because as the mains waveform passes through zero, the transistor in the opto momoentarily switches open circuit.
An MOC3021 only has a single infra red diode in its emitter section therefore to use it you must put a reverse protection diode across it to prevent excessive reverse voltages damaging it. It only gives "half-wave detection too: -
You also need to consider that the resistor(s) dropping the AC voltage are, in effect power rated as if they were connected across the whole of the mains AC supply.
This link might help with a few extra ideas. |
H: 4-terminal shunt resistor
What is the importance of a 4-terminal shunt resistor? What is real purpose behind using two seperate terminal for the voltage measurement across the shunt resistor?
AI: Take a look at this. It shows two terminals as the main current flow (thick tracks) and uses 2 more terminals for measurement of the volt drop generated by that current: -
The "better" way is on the left because it takes measurement connections from a defined place and at no point on those measurement connections is there load current flowing.
The picture on the right shows the measurement connections at some small distance from the shunt resistor terminals and therefore there is a small volt drop that forms an error - in effect you can't rely on the stated value of the shunt resistor in order to convert the measured voltage to an assumed current flow. |
H: Internal resistance of a battery
I am trying to figure out where I went wrong on the following problem:
simulate this circuit – Schematic created using CircuitLab
The two batteries are identical, and each has an open-circuit voltage of 1.5V.
The lamp has a resistance of 5\$\Omega\$ when lit. With the switch closed, 2.5V
is measured across the lamp. What is the internal resistance of each battery?
(Problem 2.1 in Agarwal and Lang's, Foundations of Analog and Digital Electronic Circuits).
Note the answer printed in the back of the book: 0.5\$\Omega\$ .
Here's my solution:
Step 1
Use element law to find current, \$ {i}_{1} \$, through bulb.
$$
v=iR \rightarrow {i}_{1} = \frac{v}{{R}_{bulb}}=\frac{2.5V}{5\Omega}=\frac{1}{2}A.
$$
Step 2
Model the internal resistance of each battery as a resistor. State the equivalent resistance of the two resistors in series.
$$
{R}_{eq}={R}_{1}+{R}_{2}=2{R}_{n}
$$
Step 3
By Kirchoff's Voltage Law, the potential difference across the two batteries must be equal and opposite to the potential difference across the lamp. I combine the element law with the above expression in the following manner:
$$
v={i}_{2}{R}_{eq} \rightarrow {R}_{n}=\frac{1}{2}\frac{v}{{i}_{2}} (eqn. 1)
$$
Step 4
By Kirchoff's Current Law, the sum of currents at any node is zero.
$$
{i}_{1}-{i}_{2}=0 \rightarrow {i}_{2}={i}_{1} (eqn.2)
$$
Step 5
Combine eqns. 1 & 2 to find \${R}_{n}\$, the internal resistance of a single battery.
$$
{R}_{n}=\frac{1}{2}\frac{v}{{i}_{1}}=2.5\Omega
$$
Conclusion
After reflecting on the problem statement, especially the open-circuit voltage part, I know that I am committing some logical fallacy. However I just cannot see it on my own. Where did I go wrong? Should I not imagine that the internal resistance of the batteries can be modeled as a resistor? Would an energy / power approach be better suited to this problem?
AI: I think your misconception happens in step 3:
By Kirchoff's Voltage Law, the potential difference across the two batteries must be equal and opposite to the potential difference across the lamp. I combine the element law with the above expression in the following manner [...]
This is not true or at least not written precisely enough. Maybe you should draw the complete circuit to make it easier to understand:
simulate this circuit – Schematic created using CircuitLab
Now apply the voltage law:
$$V(BAT1) + (-I\times R1) + V(BAT2) + (-I\times R2) + (-I\times R(LAMP1)) = 0$$
$$2 V_{bat} - I\times 5\ \Omega = 2 I\times X$$
$$\frac{V_{bat}}{I} - \frac{1}{2}\times 5\ \Omega = X$$
$$\frac{1,5\ V}{0,5\ A} - \frac{1}{2}\times 5\ \Omega = X$$
$$X = 0.5\ \Omega$$
I omitted the current through the voltage meter (assumed to be ideal), so no need to apply current law as only one known current is flowing in the loop. |
H: Difference between 0-18V and -9V - +9V
What is the principle of the difference between a supply which provides 0-18V and +9V and -9V?
If I am using a circuit which takes a +/-9V power supply, and instead start powering it with 2 9v batteries, is there a fundamental difference in the supply, or is it just a verbal one?
AI: In this case BAT1 has at the plus side 18 V, and at the BAT2 minus side 0 V, because GND is connected there.
simulate this circuit – Schematic created using CircuitLab
Below, the GND is in between the batteries, so on either side the difference is 9V, resulting in +9V at the + side of BAT1 and -9V at the - side of BAT2.
simulate this circuit |
H: Vce saturation voltage confusion
I finally finished my first transistor circuit and looks as follows:
For the LED to light up properly, I assumed a forward current of 70mA and a voltage drop of 1.3V. The datasheet of the PN2222A states that at 70mA collector current, the saturation voltage \$V_{CE}\$ will be about 0.06V. So
$$
R2 = \frac{5V - 1.3V - 0.06V}{0.07A} = 52\Omega
$$
Lowest value of \$\beta\$ equals 10, resulting in a total minimum current gain of
$$
\beta_{Total} = \beta^2 + 2\beta = 120
$$
\$I_{B}\$ is therefore
$$
I_{B} = \frac{I_{C}}{\beta} = 583\mu A
$$
So
$$
R1 = \frac{3.3V - 1.62V}{583\mu A} = 2882\Omega
$$
When I plugged in both voltage sources, the LED only glimmed lightly. I measured \$I_{C} = 42.4mA\$ which is definitely too low. For troubleshooting purposes I checked every voltage drop and one was far away from its theoretical value: \$V_{CE} = 0.7V\$.
Why is the real saturation voltage way higher than stated in the datasheet?
AI: Why is the real saturation voltage way higher than stated in the
datasheet?
Because you have configured your transistors as a darlington pair and no matter how hard Q4 is turned on it can only realistically shorts Q3's collector to Q3's base and, given that you need 0.7 volts on Q3's base to turn on Q3, you are left with Q3's collector at about 0.7 volts.
If Q4's collector were connected to 5 volts via an appropriate resistor (about 390 ohm) it would work closer to how you expect it to because you can source >10 mA from the 5 volt supply into Q3's base. |
H: VHDL: Demultiplexing a signal to one of many outputs while driving unused outputs to '0'
I'm attempting to create synthesisable VHDL that will demultiplex a one-bit continuous signal stream to one of many outputs. The outputs that aren't being sent this stream should be set to '0'. See image below for an idea of what I'm trying to achieve.
The code I've written to create this functionality is:
send_s <= (line_select_s => prbs_i(0), others => '0');
where 'prbs_i(0)' is the signal stream.
Unfortunately this is unsynthesisable in Vivado, giving the error:
[Synth 8-211] could not evaluate expression: aggregate choice expression
Is there a proper way to do this? The VHDL simulates fine but will not synthesise.
AI: The problem with your code is that an assignment of the form:
a <= (3 => '0', others => '1');
must use constants for the offsets being assigned (in this case, 3).
If you need the offset being set to vary, you have to split it into two assignments. Note that this will only work inside a process; with a pair of concurrent assignments, you would encounter a multiple driver problem.
process (line_select_s, prbs_i)
begin
send_s <= (others => '0');
send_s(line_select_s) <= prbs_i(0);
end process;
This works because although we start by assigning '0' to the whole vector, the last assignment to a particular signal in a process will take priority.
An alternative is to use a loop:
process (line_select_s, prbs_i)
begin
send_s <= (others => '0');
for i in send_s'range loop
if (i = line_select_s) then
send_s(i) <= prbs_i(0);
end if;
end loop;
end process;
This has the advantage that if your select signal can represent an offset larger than the width of your target vector, no error will be produced in simulation. An example scenario would be a 3-bit select signal, but a target vector with only 5 elements; the first method would produce an error if the select signal represented 6, 7, or 8, but the second would not.
As a side note, you may want to make a process like this synchronous if you want to get the best performance (in terms of maximum operating frequency) out of your design. |
H: PIC16F1936 Multiple ADC channel readings
I am programming a PIC16F1934 and using it's two ADC channels namely AN0 and AN1.
I take the maximum out of a bunch of few readings for the AN0 reading and then just one sample for AN1.
Here is my code:
ADCON0 = 0b00000001; // Source: AN0, Enable ADC
for (uint8_t i = 0; i < 46; i++) {
ADCON0bits.GO_nDONE = 1; // start conversion
while (!ADCON0bits.GO_nDONE); // wait for result
rawADCResult = *((uint16_t*) & ADRESL);
ADCResult = ((uint32_t) rawADCResult * 500ul) >> 10; // Scale it to 100x volts
if (maxADCResult < ADCResult) // Check if value has changed
maxADCResult = ADCResult; // and update last value
__delay_us(50);
}
ADCON0 = 0b00000100; // Source: AN1, Disable ADC
__delay_ms(500);
ADCON0 = 0b00000101; // Enable ADC
__delay_ms(500);
ADCON0bits.GO_nDONE = 1; // start conversion
while (!ADCON0bits.GO_nDONE); // wait for result
rawADCResult = *((uint16_t*) & ADRESL);
ADCPORTA1 = ((uint32_t) rawADCResult * 500ul) >> 10; // Scale it to 100x volts
The maxADCResult from channel AN0 is fine. But the value of ADCPORTA1 is always matching the value of channel AN1.
I am printing these values on the LCD and have made sure that I am not copying the same variable twice:
lcdSetCursor(1, 1);
sprintf(msg, "AN0: %d ", ADCResult);
lcdWriteString(msg);
lcdSetCursor(2, 1);
sprintf(msg, "AN1: %d ", ADCPORTA1);
lcdWriteString(msg);
One more thing, if I change the order of the channel reading (AN1 first, then AN0). The situation is reversed. Now the result of AN1 gets copied over to AN0.
I tried these things, but it's no use:
Disabling enabling the ADC in b/w each channel change.
Introducing huge delays to allow the MUX to change the channel or the ADC to power up.
Writing whole registers in each command to make sure all bits are according to need.
Completely changing the names the variables used with AN0 and AN1.
Can someone help me with an insight to this issue?
AI: You have the sense wrong in your adc code: "while (!ADCON0bits.GO_nDONE);"
should be "while (ADCON0bits.GO_nDONE);". You want to be stuck in the while loop while ADCON0bits.GO_nDONE is "1". When it is "0" the ADC has completed the measurement and you can then get out of the while loop and read the result. Otherwise, you read the ADC register immediately after starting the conversion. The result is then from the previous conversion. |
H: What other units can influence the way a wire glows than watt?
I have a vape device with a mod that lets me configure the power I want to operate it with and also as an additional setting that is called vape strength which can be set to soft/medium/hard.
When operating it on soft it generates just medium amount of light vape. On hard it tastes most of the time burnt.
So my question is, what electrical unit can influence this options, given that the power is set fix?
AI: It could be monitoring temperature by the PTC resistance of the heater and altering the duration of power or total energy. I have seen expensive Vapes with many digital parameters on an LCD and this is how I imagine they have control over these variables.
opinion
I think soft and hard referring to slew rate power in first second makes most sense to me which affects volume of smoke but not final temp.
How that ramp up is controlled may be non-linear in terms of power , temperature and taste so finding the right thermal profile is key to the recipe by trial and error and shared experiences. |
H: Power factor basics
I am confused about how the power factor is defined for an unbalanced 3-phase load?
Wouldn't it make much more sense to ask for a particular phase of the unbalanced 3-phase load?
AI: What would make the most sense would be to determine the power factor for each phase of an unbalanced 3-phase load. You could define the power factor as the average power divided by the average volt-amperes, but I don't know what you would use the information for. When an unbalanced load is found you might be concerned about how to get it balanced. Another concern would be to make sure the highest phase current is within capacity limits. |
H: Why Duracell Security MN21 12 V 23A Alkaline Battery cannot provide 12v to Computer Fan 12 V 0.16A
Fan spinning only at 5V (~600 RPM). Why this happened? The fan should spin at full speed.
AI: Duracell MN21 battery : (datasheet available here) : "typical impedance : 22 ohms".
Voltage lost in battery at fan's rated current (0.16A) : 22 * 0.16 = 3.52V.
Voltage available to fan : 8.48V assuming fan actually takes 0.16A.
It's worse than this because the fan will take a higher current (its stall current) while starting, therefore dropping a higher voltage across the battery's internal resistance. If it takes 0.3A, there will be only about 5V left across the fan, which is about what you're seeing.
That battery is designed for things like remote key locks, not for enough power to move air around. You need a more serious battery. |
H: LED bar graph driver with 12 pins?
I wanted to use a 12 LED bar graph with a LED bar graph driver but the the driver I know (LM3914) supports only 10 LEDs. Is there a similar driver IC with more out pins?
The purpose is to use the bar graph as a battery voltmeter. DIP package preferred.
AI: I wasn't able to find a 12+ driver with a quick google search, but a fairly easy(although larger) implementation would be to just use two LM3914's.
There's an example in this spark fun tutorial
Just hook up LEDs 1-10 to the first one, then feed the RLO output to the RHE of the next driver and connect the last 2 LEDs to it.
Edit: Information added as per my comment above.
Since you're already using a microcontroller, just drive the LEDs with that. Rather than using a larger mcu, if you can still get 3 spare pins on the ATtiny13A, then you can use a 12 bit shift register such as the TLC6C5912-Q1 and all 12 LEDs with finer controller over when/what is displayed.
Here's a schematic because I have entirely too little to do at work right now. Based upon This instructable although they use the ATtiny85. I'm not sure what external circuitry you're using to measure/load the battery, as after a little googling, the ATtiny13a doesn't have an internal reference.
simulate this circuit – Schematic created using CircuitLab |
H: Designing dimmer circuit for main
I saw a dimmer on instructables and try to create circuit and pcb for it. However the it looks nice and probably will work but I'm not confident the reliability on long run.
So my question would be if this design violates some safety rules or not.
Yes I know the resistors don't have value yet but I still analyzing the datasheets of the optocouplers and the triac I have. (Probably will result more question(s))
AI: There is creepage protection for 2.5kV impulse from IEC-664 cat II which requires an air slot gap in case of dust accumulation shown by routed grey zones.
The resistors must be rated for this as well and may need 4 parts for this.
Triacs use REFDES Q1 not D1 and trace width must support any surge current of expected loads.
It is bad practice to have Screen printing between high voltage exposed pads. |
H: Low voltage controlled open drain circuit
I have a power regulator with an output enable that can be used to shut the regulator off without actually unhooking it. I am trying to figure out how to control that using a GPIO port of a Jetson TX2 (1.8V logic).
The manufacturer of the regulator says that I will not be able to connect the output enable wire directly to a 1.8V GPIO pin because the output enable is internally pulled up to the regulator Vin (24V). They said to drive it properly I will need an open-drain circuit, which will allow your GPIO to switch the output enable pin between float and ground.
Using https://www.microcontrollertips.com/what-is-an-open-drain/ as a source I looked on Digikey to find an N-channel MOSFET that would work and I think one of these:
https://www.digikey.com/product-detail/en/toshiba-semiconductor-and-storage/SSM3K329RLF/SSM3K329RLFCT-ND/3522426
https://www.digikey.com/product-detail/en/nexperia-usa-inc/PMV40UN2R/1727-1900-1-ND/5056345
would. Is creating the open drain circuit a matter of connecting the output enable wire of the regulator to the mosfet drain, the Jetson GPIO to the gate and the mosfet source to ground like this? Or do I need a current limiting resistor between the GPIO and the gate?
simulate this circuit – Schematic created using CircuitLab
Thanks for your help.
AI: Either the MOSFET or the BJT will work.
You might find the transistor (leaded type) easier to work with and it has a bit more margin on the voltage (45V vs. 30V on a 24V circuit).
Personally I would add a resistor with the MOSFET gate (something like 10K) to make it a little less likely to damage that $500 computer board. It will slightly slow it down (microseconds). It's not necessary for the MOSFET. It is necessary for the BC547 BJT. |
H: Transfer function of an amplifier
Can someone please help me find the transfer function of this circuit.
$$
\frac{V_0(s)}{V_i(s)}= \dots
$$
simulate this circuit – Schematic created using CircuitLab
This is what I have done so far.
$$
I_{R1}+I_{R3}=I_{R2}+I_{C1}
$$
$$
I_{R2}+I_{C2}=0
$$
$$
I_{R3}=I_{C2}
$$
By substituting currents I reach the following formula.
$$
\frac{V_i-V_1}{R_1}+2 \cdot S \cdot V_0 \cdot C_2 = S \cdot V_1 \cdot C_1
$$
AI: There are many options to determine the transfer function of such a filter. One of them is to use the fast analytical circuit techniques or FACTs. By doing so, you will determine the time constants associated with each of the energy-storing elements of your filter. Because there are two capacitors with independent state variables, this is a second-order system whose denominator obeys the following expression: \$D(s)=1+b_1s+b_2s^2\$. What is cool with the FACTs is that you will independently determine \$b_1\$ and \$b_2\$ through individual sketches leading to a canonical form without much efforts. We can start the analysis for the \$s=0\$: open the capacitors and solve the transfer function \$H_0\$. By inspection, you have \$H_0=-\frac{R_3}{R_1}\$. The equivalent sketch is
Then, you reduce \$V_{in}\$ to 0 V and you determine the resistance by "looking" into \$C_1\$'s terminals while \$C_2\$ is in its dc state (open-circuited). The sketch is below:
If you do the simple maths ok around this circuit, as confirmed by the below simulation, the resistance is 0 and the time constant \$\tau_1\$ is equal to 0.
For the second time constant, we now "look" at the resistance offered between \$C_2\$'s terminals as illustrated below (\$C_1\$ is set in its dc state):
If you do the maths ok and consider a perfect op amp, the second time constant \$\tau_2\$ is equal to \$\tau_2=C_2(R_2+R_3+\frac{R_2R_3}{R_1})\$. According to the definition, \$b_1=\tau_1+\tau_2=C_2(R_2+R_3+\frac{R_2R_3}{R_1})\$.
To obtain \$b_2\$, we will now determine the time constant involving \$C_1\$ while \$C_2\$ is a short circuit:
Doing the maths (look at the virtual ground at the (-) pin) leads to \$\tau_{21}=C_1(R_1||R_2||R_3)\$ and this is it, we have \$b_2=\tau_2\tau_{21}=C_2(R_2+R_3+\frac{R_2R_3}{R_1})C_1(R_1||R_2||R_3)\$. The complete transfer function is thus:
\$H(s)=-\frac{R_3}{R_1}\frac{1}{1+sC_2(R_2+R_3+\frac{R_2R_3}{R_1})+s^2C_2(R_2+R_3+\frac{R_2R_3}{R_1})C_1(R_1||R_2||R_3)}=H_0\frac{1}{1+\frac{s}{Q\omega_0}+(\frac{s}{\omega_0})^2}\$
The FACTs let you determine the transfer function through a succession of simple sketches that you can individually solve and check with a simple simulator. Should you make a mistake, identify the guilty sketch and correct it: no need to restart from scratch as with classical analysis. Also, as you can see, the result is already factored without the need to inject further energy into the factoring of an arm-long expression mixing all the terms (brute-force analysis). This filter is part of the many solved problems described here. |
H: Using MCP73213 for charging two Lithium ion batteries connected in series
My device has some loads which use 5V. I can't use a single Li-ion Battery as it'll give only 3.7V. So I've decided to connect the batteries in series to get 7.4V power supply. Since my wall adapter gives 12V output, I'm planning to use MCP73213 to charge the batteries. The batteries I've bought are actually cell phone batteries.
Now I've the following questions:
Is it a good idea to use this cellphone batteries in series? Is there any possibility that this series connection will affect the battery life?
Is MCP73213 a good choice, as it doesn't have any balance charging mechanism?
AI: It depends on your application. If the batteries are charged slowly (<0.5C or so), discharged slowly (<0.5C or so) and operated at normal temperatures, balance is usually not a huge issue.
That said, it might be easier to just use a single cell battery and a switching boost converter to generate the 5V rail. |
H: Help me understand voltage X
I am trying to understand an explanation written here: http://people.ucalgary.ca/~aknigh/vsd/ssim/vsi/co.html
As far as I understand:
voltage V(A) is line 1 voltage
voltage V(B) is line 2 voltage
... but what/where is voltage V(X) ... or V(X) at time t? I would like to understand the equation "Once phase B voltage is high enough for its diode to conduct:".
AI: Va and Vb refer to the input voltages from any two phases when used in the example showing two phases.
Vx is the voltage at the common point (Cathodes) of the two diodes.
He does not define this (and he should) but you can deduce this from the first pair of equations
ie Vx = Vinput - voltage drop in inductor due to AC current - diode voltage drop.
This corresponds to starting at Vline and transiting an inductance and a diode. The point in his example that matches this is the DC "bus' where the diode cathodes join. |
H: Using a 120W inverter with a 180W brick
For some testing at my company, we attach the product to a small plane and collect data with a laptop. The product itself is run off a small motorcycle battery and, last time we flew, our laptop battery died. I checked out the specs on the power supply and it was listed as 180W.
Our pilot happens to have a 120W (with the correct output voltage) inverter for a 12V DC plug in the cockpit. If we were to use that and plug the laptop into it, would that just be 2/3 of the current draw and the charging would be slower? If, for whatever reason, my laptop is using the full power normally supplied, draining at 1/3 the normal speed would be awesome if it tripled my battery life.
I found inverters with 200+W ratings online, but they suggest only hooking up directly to a battery because plugs often have fuses at 15A or less. Since the only one up there is the motorcycle battery, it would have to be that. However, I'm hesitant to use that battery because it's rated at 12 Ah, which 12/15 = 40 minutes to drain just powering the laptop.
AI: There are a lot of interesting things in here, so I'll try my best to hit them all.
1) Just because the laptop power supply is rated at 180W doesn't mean the laptop will draw 180W. If the laptop starts off fully charged, its actual power draw should be quite a bit less (after all, you can use the laptop and charge it simultaneously, right?) So you should measure how much power the laptop ACTUALLY draws. You can also adjust settings on the laptop to minimize power draw (laptops have power save modes, but you'll need to specifically turn them on since the laptop thinks it's plugged in and thus doesn't care about power usage)
2) If you do try to draw a full 180W from an inverter rated to 120W, you're not going to get 120W. As mentioned in the comments, you will either blow a fuse or brown out the circuit. That's why you need to know the true power draw of the laptop. As long as the laptop never draws more than 120W, you should be able to plug in using the inverter just fine.
3) Getting a higher-rated inverter isn't likely to help you because the pilot has probably already sized the 120W inverter based on the capacity of his 12V plug. But, doesn't hurt to ask.
4) I'm not going to go into much detail on the motorcycle battery since I think in your case the right answer is to run off the 120W aircraft power. But if you do go the battery route, I strongly recommend measuring its lifetime at the actual power draw of your product + laptop. As SamGibson pointed out (see comments), listed battery capacities are generally overly optimistic in realistic operating conditions. I'm assuming flight time is expensive, so it's worth the time on the ground to figure out exactly how much operating time you'll have. The battery datasheet should give you lifetime vs discharge current, but that will change depending on how old the battery is and other factors - the best bet is to measure it yourself. |
H: How to determine voltage across LEDs in a circuit?
I simulated a basic circuit in Orcad but I don't know how it found voltages(6.08 V and 3.04 V) on the nodes? How do I calculate those voltages mathematically? I am attaching three image files of schematics and values.
NOTE: Current value in circuit is 23.92mA according to OrCAD calculations.
This is schematic diagram with values
These are LED values
These is the voltage across both LEDs
Please help me to understand this.
AI: The simplest equation model of an LED is of the following form:
$$V_D=V_{FWD}+R_{ON}\cdot I_D$$
Where \$V_{FWD}\$ and \$R_{ON}\$ are what is called "model parameters" that define the specific behavior of a specific diode. You need to provide those in order to get quantitative answers.
The above model is based upon the following idea. Suppose you take three measurements with the LED, getting both the voltage across the LED as well as the current through the LED, and place them onto a chart:
If you then use a ruler and draw a line through the points, you may find that it intersects the y-axis at some value. In the above case, it intersects right at \$V_{FWD}=2.96\:\text{V}\$. This is the meaning of \$V_{FWD}\$ in the above model. It's a projected value based upon an extrapolation from a few actual points made elsewhere on the chart. Similarly, the slope of the line, in this case with \$R_{ON}=2\:\Omega\$, provides the other model parameter. (You can compute these from a collection of raw data points by using a "least squares fitting" algorithm for lines, if needed.)
A circuit with a power supply of \$V=30\:\text{V}\$, a resistor of \$R=1\:\text{k}\Omega\$, and two added LEDs (all of these in series), yields the following result (the \$2\$ comes from the fact that there are two LEDs in series):
$$30\:\text{V} - I_D\cdot R - 2\cdot \left(V_{FWD}+R_{ON}\cdot I_D\right) = 0\:\text{V}$$
That equation is easily solved for \$I_D\$:
$$I_D=\frac{30\:\text{V} - 2\cdot V_{FWD}}{R+2\cdot R_{ON}}$$
(You should be able to solve and find the above equation.)
Using your table of LED information, I may get either of these two models and their predictions:
\$V_{FWD}=2.96\:\textrm{V}\$ and \$R_{ON}=2\:\Omega\$, \$\therefore I_D=\frac{30\:\text{V} - 2\cdot 2.96\:\textrm{V}}{1\:\text{k}\Omega+2\cdot 2\:\Omega}\approx 23.98\:\text{mA}\$
\$V_{FWD}=3.00\:\textrm{V}\$ and \$R_{ON}=2\:\Omega\$, \$\therefore I_D=\frac{30\:\text{V} - 2\cdot 3.00\:\textrm{V}}{1\:\text{k}\Omega+2\cdot 2\:\Omega}\approx 23.90\:\text{mA}\$
Neither of those are an exact match with the value you provided. But they are very close. The fact that they are not exact suggests that either I didn't interpret the table you provided correctly, or else a different type of LED model was applied in simulation.
The problem with the above model is that it assumes that the LED behaves linearly, but LEDs don't actually behave that way. And the above model works over only a very small range of actual currents nearby the "standard value." If you stray very far, then the entire model breaks down and the LED no longer matches the expectations.
An improved model of the LED looks like this:
$$V_D=n\cdot V_T\cdot\operatorname{ln}\left(\frac{I_D}{I_{SAT}}+1\right)$$
This is one of the two equivalent ways of writing the widely known Shockley equation, which provides a much better model of the LED over a much wider range of diode currents. (It still fails to take into account things like lead frame, wire bond, and wire resistances. Adding them is easy, though it complicates the solution a little.)
Here, \$V_T\$ is the thermal temperature and is computed as \$V_T=\frac{k\cdot T}{q}\$, where \$k\$ is the Boltzmann constant, \$q\$ is the charge of an electron, and \$T\$ is the absolute temperature. At room temperatures, \$V_T\approx 26\:\text{mV}\$. This is a physics parameter and isn't strictly speaking a model parameter.
\$I_{SAT}\$ is the saturation current. This is an extrapolated value for the LED (again) where an estimate is made about an axis intercept (as it cannot be directly measured.) This is an LED model parameter.
\$n\$ is the emission coefficient and is greater than or equal to 1. With LEDs, it will often by closer to 5 or 8 or even more. This is also an LED model parameter.
With this new model, the new equation to solve is:
$$V_{CC} - I_D\cdot R - 2\cdot \left[n\cdot V_T\cdot\operatorname{ln}\left(\frac{I_D}{I_{SAT}}+1\right)\right] = 0\:\text{V}$$
The solution for finding the LED current is:
$$I_D = \frac{2\cdot n\cdot V_T}{R}\cdot\operatorname{LambertW}\left[\frac{I_S\cdot R}{2\cdot n\cdot V_T}\cdot e^{\cfrac{V_{CC}+I_{SAT}\cdot R}{2\cdot n\cdot V_T}}\right]-I_{SAT}$$
(I have provided a methodology towards solving these kinds of equations. Please feel free to examine similar [not the same, though] steps that can be applied to reach the above solution on your own. See: Differential and Multistage Amplifiers(BJT).)
Suppose (and this is just pure supposition since we don't have actual model parameters) that the model parameters are \$I_{SAT}=6\:\text{fA}\$ and \$n=4\$. Then at room temperatures we'd find:
$$I_D\approx 23.96\:\text{mA}$$
This isn't necessarily supposed to be close to the values your simulator gave. However, I picked out model parameter values that were designed to get somewhere in the vicinity. That said, remember that Spice uses numerical methods, not closed mathematical solutions. And also remember that I simply don't have any good idea about what model parameter values I should have used.
But it at least provides an idea about the mathematical process involved.
Spice sets up a matrix and uses some internal knowledge about diode models to help it "linearize" the Shockley diode equation around the "current operating point" of the diode. So while Spice does use the Shockley equation, its approach is quite different from the mathematical solution using it that I just gave. Instead, Spice uses a series of tiny time steps together with linear solution methods and incremental adjustments to the linearized models to successively reach an answer. |
H: tri-rail power supply from cheap buck converters
I'm looking to build a 3 rail regulated supply (+5v, +-12v) and I've got a bunch of cheap but functional buck converts from aliexpress. I'm wondering if I can run these off a single AC-DC converter (wall wart, etc) and get a common-ground 3 rail supply from this?
I'm thinking something like:
simulate this circuit – Schematic created using CircuitLab
Will that work? Or do I need to introduce a multi-tap transformer or similar solution? The buck converters are these.
AI: The circuit will not work unless either
the -12V converter is an isolated DC-DC converter, or
it is intended to produce negative voltages and actually has a positive GND contrary to your labeling.
Cheap converter modules that don't specify otherwise are likely to be non-isolated. This means that the input negative/GND and the output negative/GND are internally connected, so your circuit will short out the -12V converter. |
H: Are there any special internal Ethernet connectors other than RJ45?
I am working on the board that suppose to have 1 GbE port (10/100/1000BASE-T). Looking at connectors all I seem to find is standard RJ45 connector.
However in my design the board itself is not directly exposed to the outside, there is a backplane which will include some other ports as well.
Now, I could put the standard RJ45 on the board and and 2 of them on backplane and connect board to backplane with standard CAT5 cable. However the RJ45 connector is rather bulky comparing to everything else on board.
So my question is -- are there any alternatives to this approach, how do commercial products that do not expose main board ports directly work around that?
PS: I've seen this question which recommends micro USB 2.0 port as chip alternative, but that means only 4 wires per port (so 2 ports per board for single RJ45?) I foresee some impedance matching issues right there.
AI: You need to use a different ethernet standard than 802.3ab, that doesn't need RJ45 jacks. Like IEEE 802.3ap “Backplane Ethernet”, which supports gigabit speeds over a backplane type of connection. This standard was designed for your application in mind.
Also see On-Board connection of ethernet transceivers for 10/100 speed connections on the same board. The Micrel now Microchip app note AN-120 http://ww1.microchip.com/downloads/en/AppNotes/Capacitive%20Coupling%20Ethernet%20Transceivers%20without%20Using%20Transformers.pdf describes how non-transformer (and connector) ethernet connections are designed on board. |
H: Measure picofarad capacitances accurately
I need to measure or sense capacitance from 0 pF to 5pF, with an accuracy of 0.1pF or better. I know capacitance to digital convert chips claim to do that, but is there a simpler/easier way to breadboard a circuit to measure these ultra-low capacitances?
I have a small concentric cylinder where the outer cylinder is physically fixed (and tied to some potential) but the inner one is moving in and out. It's this movement I need to track. The change in overlapping area between the two cylinders produces a change in capacitance. In that way, I keep track of its position at all times by monitoring the change in capacitance.
AI: It's quite straightforward to detect a change of capacitance of 0.1pF, as a ratio. The simplest is perhaps to build a relaxation oscillator and measure the frequency and change of frequency digitally, as the test capacitor is connected.
It's very difficult to know exactly how much effective capacitance there is in the rest of the circuit, and any connection jigs, strays, terminals, leads that the ratio is measured with respect to.
The advantage of a relaxation oscillator is that one capacitor terminal is grounded, so the strays are relatively stable. The disadvantage is the strays can be large, quite easily large compared to 5pF.
The alternative is a 3 terminal guarded measurement, which is immune to stray capacitance on either terminal of the capacitor, and only susceptible to strays across it. The third terminal is ground. The method is as follows.
1) Apply a sinusoidal voltage with respect to ground to one terminal of the test capacitor from a known voltage. The strays from this terminal to ground are driven to exactly the same voltage, we are not interested in how much current is required to charge them, the voltage measurement is sufficient.
2) Hold the second terminal at ground, and measure the current required to do that. The most common way to do that is to use a virtual ground op-amp. The strays from the second terminal to ground are held at 0v, so no current flows into them, so the current measurement is accurate.
3) We now know the current through the capacitor for a given voltage across it. Compute the capacitance from impedance and frequency. A capacitive feedback rather than resistive on the virtual ground op-amp allows you to eliminate the frequency from the equation.
Even though the guarded measurement removes the effect of the strays to ground, any strays across the capacitor that are enhanced by your test jig, perhaps a plastic pressure pad that holds an SMD component down onto a footprint, will change the measurement compared to what it would be in circuit without that pad. |
H: Discharge of capacitor bellow 0.5V
I have a conundrum that I am trying to solve and am afraid I am stuck. Could anyone share some insight please?
My circuit is displayed on image above. 5V (5Vsw) and 3.3V (3V3sw) are used as supply voltages. When Vkill is triggered, entire circuit switches off. However, depending on start of new power cycle, time delay brought on by 555, varies on case to case basis.
This is seen in plot from circuit.
Vkill is business end of sub-circuit, which turns off entire circuit and Vprob is voltage that is giving me headache. Ven is control voltage given by other part of circuit (not shown here) and Vbatt is power for entire circuit.
My first attempt was to add a bleed transistor that drains some (if not all) of the excess energy, but this is still not enough, because of diode drop on mosfet conduction. Time variation is dampened but not eliminated.
Can anyone give me an example on how to dump ALL energy from capacitor bank (C5,C6,C7) as soon as Vkill is triggered?
Suggestions to changing timer circuit to solve the issue and far fetched ideas are also welcome.
Thanks for all useful suggestions.
AI: I think you need to familiarize yourself with the internals of a 555: -
So when you say: -
Vkill is business end of sub-circuit, which turns off entire circuit
How do you rationalize this when clearly (in the picture above) the discharge pin is an output and you are trying to drive it with Vkill?
The Discharge pin is used to discharge capacitors. The internal NPN transistor will discharge them down to a few milli volts in a fairly short time but ignoring the strange idea of trying to drive the discharge pin, if you want to discharge those capacitors from an external circuit then use an N channel MOSFET with source to ground and hit the gate with a positive voltage to discharge those capacitors.
Trying to discharge capacitors with a P channel source follower will leave several hundred mV across them. |
H: Is there a threshold voltage below which batteries are definetly dead and has to be recycled?
I have a particular case, where I purchased a brand new LiIon battery for an iPhone SE that showed 3.82 V in the beginning. I connected the battery to the circuit and after an hour or so, it showed 2.7 V. Then I disconnected the battery from the circuit, and kept it aside. Now after few days, the battery shows 0V. Does it mean the battery is faulty or it just needs to be recharged?
On a similiar note, does the NiMh and Alakline battery also have threshold voltages, below which they arent usable anymore and needs to be recycled?
AI: It's more than likely that the protection circuity has shut off all access to the battery due to it being over-discharged.
Li Ion is an inherently dangerous battery chemistry and lots of precautions are made to try and make it safe, one of these is effectively a fuse in the protection circuity that when over-discharge of the battery occurs effectively bricks the battery - without diverting the protection board at least (tip: don't do this).
The problem is that in an overly discharged Li Ion, tiny needle-like crystals begin to form in the liquid electrolyte. These crystals can eventually bridge the anode & cathode causing an internal short in the battery, usually leading to fire and/or an explosion. Here's a video demonstrating what happens to a shorted lithium ion battery.
Even though the battery is showing 0v there probably is still some charge left in the battery, but it has dropped below a voltage at which the battery can now be considered "unsafe" and the protection circuitry has broken the connection between the battery terminals and the terminals exposed for connections (probably where you are testing). In other words, the terminals you are using to test the voltage of the battery are probably not the terminals of the actual battery itself, there is probably a tripped fuse somewhere between the actual terminal and the point at which you are testing.
For reference, according to The Journal of Chemical Thermodynamics (referenced on this Wikipedia page)
Lithium-ion cells are susceptible to damage outside the allowed
voltage range that is typically within (2.5 to 3.65) V for most LFP
cells. Exceeding this voltage range, even by small voltages
(millivolts) results in premature aging of the cells and, furthermore,
results in safety risks due to the reactive components in the cells.
As @BruceAbbott pointed out in the comments the quote above specifically talks about Lithium Iron Phosphate (LiFePO4)batteries that have a slightly different safe range than standard Lithium Ion. For LiIon the range is typically 2.7-4.2V.
NiMh and alkaline batteries do not suffer from the crystal growth issue, as far as I am aware. |
H: optimize peltier element cooling
I am currently playing around with this Thermoelectric Peltier Cooler Setup:
I have read that it's possible to cool these elements down to more than -20°.
However, I got the elements for cooling an aluminum pipe, so I glued both onto the pipe to cool it down.
Its already cooling them down, but clearly not that much as I expected (Just around 0°).
My question is: how can I get more cooling\heating performance from the peliters?
AI: A few comments and observations: -
A single TEC1-12706 peltier thermoelectric cooler can only cool effectively when the thing that it is attached to (the aluminium pipe) isn't conducting ambient heat from the surrounding environment back to the cooler at too high a level.
For instance the TEC1-12706 is rated about 50 watts and let us assume that all this power is converted to the cooling process. Let's say the aluminium pipe has a thermal resistance of 1 degC per watt i.e. if 1 watt of heat power were pushed into the pipe it would rise in temperature by 1 degC.
Or, put it another way, if 50 watts of heat power were extracted from the pipe it would cool by 50 degC. This would cool the pipe down to -25 degC in an ambient of +25 degC.
However, if the pipe has fluid flowing through it at ambient temperature then it won't cool down to -25 degC or even close because that fluid is imparting heat to the pipe and that means you need a bigger and more powerful peltier to extract the power due to the pipes basic thermal resistance AND the power that needs to be taken to cool the fluid.
Given that a Peltier cooler is probably around 15% efficient you have to consider that the heat power you can extract from an object is significantly less than 50 watts. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.