text
stringlengths 83
79.5k
|
---|
H: Series Parallel batteries
I am trying to simulate a series parallel battery design.
When I try to simulate, I am getting this error:
Voltage source loop found: V9, V1, V2, V10.
AI: Please help me out.
It's quite simple; don't put voltage sources directly in parallel. If you want to do this less directly, use a small value series resistance for each battery. 1 μΩ would do (even though it's far below any battery series resistance that I'm aware of). This would probably suffice: -
|
H: Can I use 24V instead of 12V
I have RFID reader module. For this RFID module, they recommend 5V-9V LDO power supply and here is recommended schematic :
I read 7809's data sheet. It says I can use 7809's input value between 11-35 V . So my questions is ,
What happen if I use 24V DC instead of 12V DC for 9V ? Will RFID module's read range change?
I want to use 24 V DC because I have 24V DC adapter and it has 5A current. This RFID module needs max 120mA. Is this 5A cause something for 7809 (heat or something)?
Thank you.
AI: If you use 24 V instead of 12 V, you will dissipate 5X as much power in the 7809 regulator. Using your quoted current of 120 mA, with a 12 V supply you need to drop \$(12 - 9) = 3~\mathrm{V}\$ so the regulator is dissipating 360 mW (\$P=IR\$). If you change to 24 V you need to drop \$(24-9) = 15~\mathrm{V}\$, and then you need to dissipate 1.8 W. This is not a huge amount, but you will absolutely need a heatsink for it.
Your module will only draw as much current as it needs, so the 5 A rating of your supply isn't relevant. More information in the canonical answer to this question.
|
H: Can I use a single LED from a 220V LED light bulb to repair my 1.5V LED flashlight?
Update: I couldn't desolder any LEDs from the donor board without destroying them. They simply refuse to come off. This raises the question for me:
Are they even soldered there or manufactured as they are together, and cannot be desoldered?
My flashlight's LED is broken, the tip of the LED's housing is exposed and it does not light up.
As the title says, will it be feasible using a single LED from a 220V LED light bulb to repair my 1.5V flashlight?
How do I know the voltage rating (or more precisely I need the turn on voltage below 1.5V(?) (maybe not? --> see Edit2 below) ) of each LED inside my sub 1$ LED lamp (9W in my case)?
Since it is extremely cheap this bulb does not fully have a switching regulator. It is just a "regulator" that probably has huge ripples, which we don't see because it sneakily blanks at 60Hz.
Here is the picture of the schematic:
There are almost a dozen LEDs in there, even if I take one out and replace it with a short, the lamp will be overdriven a bit but surely work (with acceptable loss in its runtime, it was cheap anyway.)
Edit:
This method won't work on a 1.5V AA powered LED flashlight because the LED lamp has LEDs which only turn on barely at 4.5V. I tested with my 12V computer power supply rail and only 2 of the series LEDs turn on. I couldn't go up to 3. Threshold voltages are very high on these types of cheap lighting LEDs for some reason. Why?
Edit2: My flashlight has a simple circuit doing something to the raw 1.5V before feeding it to the LED. Does anyone have any idea what this does?
I wonder how many volts my LED had as threshold before it broke down.
AI: With demand for more TV backlight LEDs, production of < 3V white LEDs now offers 6V, 9V. These are chips with cascaded single diode multiples of 3V and look identical on 2835 SMD, unless you look closely.
https://lumileds.com/products/mid-power-leds/luxeon-2835-architectural/
Your Dad's flashlight will have an SMD inductor that has a darker colour than caps or resistors that with the cap, diode and a 2 transistor oscillator arranged as a voltage boost regulator.
I have hundreds of bags full of ultrabright white 5mm LEDs for someone with a good application.
|
H: PCB design, 30 5 V LEDs per board (probably 6)
It's my first time designing a PCB. I had the idea to make a pyramid out of (probably) 6 same PCBs. Each pyramid would have 30 WS2812B B LEDs. Online I read that on the one side you should be concerned about the heat dissipation of the LEDs and on the other that those LEDs might not get that hot. Would such GND-Baseplate as in Back2 even serve any benefit?
I am also a bit confused about the width of the traces and power cables connected to the boards. I probably will power the boards in parallel (only the data in series) so the each cable wouldn't need to be that big but I still would need a good power supply. I have currently no idea about that.
The GND and 5 V traces are currently 0.5 mm thick.
Can you give me some advice about the trace/cable sizes and the board design?
Top
Back1
Back2
AI: Third row from the bottom - adjust the spacing of the center two LEDs such that all 4 LEDs in that row are evenly spaced. The way you have them placed now, the gap in the middle will be huge when the board is lit.
Now, about the power --
0.5 mm is way to small for a power trace. You don't say what the maximum current per board is, but in this case there is another answer.
You are paying for all of the copper on all of the surfaces, so use it. On the component side, make the power and GND traces as fat as you can. Start at 2 mm and go up if you can. Remember, those traces also move heat. On the back side, split the board vertically into two poured planes. The blue signal trace can run right down the middle separating the two power planes, or be moved to the front side of the board, routed near an outside edge.
Connect the planes with the traces with many vias. Basically, the circumference of a via is the trace width of a very short connecting trace. Don't let this be a bottleneck for the current. If the thing at the bottom of the board is a connector with through-hole pins, make the via diameter the same as the pin holes. That is not a rule or requirement of any kind, just a way to reduce costs back when board houses charged extra for multiple hole sizes. Yes, I'm that old.
|
H: What is IOSTANDARD in ucf file
I am learning FPGA programming. Going through example code/project.
What is IOSTANDARD in constraints file. When to use LVCMOS33, LVCMOS25, LVDS_25.
Which one is best for high speed clock signals. Should SKEW for clock signal should be set as FAST or SLOW? How to decide property of an IOSignal? Could someone explain in simple terms.
AI: These are IO signalling standards. In fact, their names are pretty self-describing:
LVCMOS33: Low-Voltage CMOS (with a 3.3V amplitude) single-ended
LVCMOS25: Low-Voltage CMOS (with a 2.5V amplitude) single-ended
LVDS_25: Low-Voltage Differential Signalling (with 2.5V differential swing)
Which one is best for high speed clock signals.
This question makes no sense, because we don't know what you're going to do with the signals. If the device attached to that output expects single-ended 3.3V amplitude, then you need to use LVCMOS33. If it accepts LVDS with a 2.5V voltage swing, LVDS, and so on.
If the choice is free because you're still designing what you'd attach, it depends, on how long things are, what your needs in cleanliness and spurious emissions are, what your power constraints are and so on.
Should SKEW for clock signal should be set as FAST or SLOW?
Depends, see above.
How to decide property of an IOSignal?
Mostly, this is the whole analog part of digital design! Your clock signal is still an analog signal and has to travel somewhere and drive some kind of receiver load. Can't really take the burden of learning the basics of high-speed signalling and transmission line theory of your shoulders, I'm afraid.
|
H: How does an SR latch prevent switch bouncing?
I saw this debounce circuit here and they said that when the switche bounces from NC - NO - NC, the output 0 of the NAND gate g1 locks the output of g2 to 1 and the output still stays the same.
However, if we assume ideal NAND gates, shouldn't the output of g1 instantaneously change to 1 upon the switch closing to NO (giving an input of 0 to g1) ? This means that the output of g2 is no more locked to 1 and will be affected by the switch bouncing.
AI: For a simple SPDT switch, the NO/NC poles are physically distanced far enough from each other that the COM will bounce for a short time on one pole, then none as it move through the free space between them, then bounce for a short time on the other pole until it settles down.
This has the effect of toggling only the input of g2, then constant input to both gates for a short while, then toggles only on g1, then constant again as the switch settles down.
|
H: Can I increase the output capacitance of a DCDC beyond the specified maximum?
The MPM3822C is a synchronous, step-down, power module with an integrated inductor.
According to the datasheet, the maximum output capacitance is 100uF:
Questions:
Why do they specify a maximum?
Would it be bad if I used two 100uF capacitors?
AI: For a detailed discussion, see this excellent TI application report but gross simplification: the regulator relies on a feedback loop of which the output capacitor is a part. Values that are too high or too low can lead to instability or undesirable transient response. Is there a reason you need extra output capacitance? If the transient response of the converter with 100uF isn't suitable, you may need to pick a different part.
|
H: Isolated Switch
I have three question on designing Isolated switch (Protected Microcontroller and from accidentally inserting power)
Does it matter which side is the switch - on 15V(Isolated side) (image 1) side or Ground side(image2)
Do I need add cap to 1K to create low pass filter to protect from noise
Do I need diode for over voltage or the Optoisolator diode is enouph.
Image 1: Switch on 15V side (Customer have access to 15V supply)
Image 2: Switch on Ground side (Customer have access to Isolated GND )
Keep in mind 15V isolated will be shared with other circuits too
AI: No, it doesn't matter if you switch the low side or high side. Convention is to switch the high side.
Depends on how much noise you are talking about. The LED in the opto-isolator requires very little voltage to light up, so power would have to almost completely drop out. Likely you don't need a capacitor. TODO: check that 1K resistor doesn't allow too much current on LED at 15V.
|
H: How bad will leaving a USB 2.0 cable's shielding disconnected be?
I have a keyboard with a fixed cable that I'm looking to reconfigure into a detachable one. It's a hefty cable that contains two separate USB 2.0 cables and some shielding. The shielding connects to the large metal plate that the keys are mounted to, which is then connected to ground on the PCB underneath.
One of the cables is for the keyboard itself (the one with the extra shielding connection on it. The other goes to a type A port on the back of the keyboard to use with peripherals. Since it's just a simple extension it can be used for anything USB 2.0.
So this is really a two part question. First, will leaving that shielding disconnected cause any issues with interference with the two USB cables running right next to each other? And if it will, since I won't have a PCB in the modded cable, can I attach the shielding to the metal body of the male USB I will be using to connect it to the keyboard?
AI: For low speed signals like a keyboard shielding may not be strictly necessary. But consider static protection. If a static spark jumps from your finger to the metal plate in the keyboard, where will it go? Worst case it will jump to the keyboard's electronics and fry them, or jump to the USB data lines and fry the USB port on your computer. Provide a safe path for that static discharge. Generally that is case ground which eventually leads to earth ground. The shield on data cables can be used as an extension of case ground.
|
H: Is this an acceptable way to create +/-5V from +/-12V?
The TLV76750 is a 5 V fixed-voltage LDO. I plan to use it to create ±5 V from ±12 V. Is there any caveat in hooking two of them up as shown below? The setup at the top is the standard configuration.
No need to comment on the large voltage drop from 12 V to 5 V causing considerable power dissipation.
Edited to add that the above circuit won't work (thanks to everyone for your comments). I can make it work though with two independent, galvanically isolated AC supplies, used as follows:
Edited to add The LTSpice simulation showing the concept of galvanic isolation or floating power supplies:
Now including the transformers and just for the fun of it, with opposite polarity of them. The result on the outputs is the same as shown in the diagram above:
AI: No. What you're calling "-5 V" would actually be +5 volts with respect to the -12 volt rail, i.e. -7 volts. And it would only be able to source current into a load returned to a lower voltage; linear regulators can't generally sink current without either losing regulation or being damaged.
The proper way to do this is to use a negative voltage regulator, designed for this exact purpose. For instance, the common 7805 +5 V regulator has its complementary version, the 7905 -5 V regulator.
|
H: No Input to Open Drain Buffer, yet Output Drives Low?
I'm kind of stuck with understanding why the output of an open drain buffer is going low when there is nothing connected to the input. We're using the SN74LVC1G07. Truth table states that if the input is low, output will be low; if the input is high, output will be high impedance. How is it that when there is no electrical connection on the input of the buffer, the output will still be low? Shouldn't the output also be high impedance since the inverter doesn't have a valid input? Does an open connection actually constitute as a low?
simulate this circuit – Schematic created using CircuitLab
AI: The SN74LVC1G07 is a CMOS device.
With no connection to the input it could be taken as a high or a low. You need to put a high-value resistor between the input of the gate and ground. A value such as 10k would probably be suitable. This resistor is usually called a pull-down. A pull-up would be connected to the power-supply to give a logic 1.
With any logic you should always ensure that inputs are set to a known value at all times. The device may work as expected but even then it would be susceptible to interference and may change randomly.
|
H: 5V Device Open Collector with 3.3V Controller
I am new to electronics being a mechanical engineer.
My question is this: I am about to use an Allegro A314x Hall Sensor, powered by 5V. Datasheet (link) says, data pin is open collector.
I want to use the data signal with a micro controller operating at 3.3 V, max 3.6 V allowed.
Do I understand open collector correct in the sense, that I can pull-(up) (R 10k) the data pin to 3.3 V and will not have to fear damaging the micro controller?
If not, what do you suggest to prevent damage on the micro controller?
EDIT: added link to datasheet
AI: Source: https://www.electronics-tutorials.ws/transistor/open-collector-outputs.html
Open collectors are useful because the allow the user to decide what Vcc is.
If the transistor is on, then it pulls down Vout to Vce of the transistor (logic 0 for most inputs).
If the transistor is off then Vout goes to near Vcc (or V+) in the diagram.
This means you can set Vcc to 3.3V (or whatever value you want) and it won't damage the micro-controller because it won't be able to go beyond 3.3V
|
H: Generator to run a compact industrial VFD (Sinamics V20)
I have a Siemens Sinamics V20 (0.5HP) industrial VFD (as picture), powering a 3-phase 0.25 HP electric motor.
I work in the field and generator is the only way to have electric power.
I am looking for a 3.6 kVA generator with AVR technology. Do you guys think it will work ok?
Edit: OBS:
My equipment works like a Piling Machine. Sometimes he lifts the hammer sometimes releases it (10kg hammer)
The 3 phase motor have a mechanical reducer (1:60).
AI: Both the VFD and the generator will probably work properly. However the VFD will have some harmonic content in its input current. That will cause harmonic voltage in the generator output that could cause difficulty with other loads connected to the generator. However the 3.6 kVA generator is like enough larger than the 0.25 kVA VFD load to prevent that. Check to see what Siemens recommends about using input reactors to reduce harmonic currents drawn by the VFD.
Harmonic distortion of the load voltage caused by the VFD could adversely effect the generator AVR, but the low ratio of VFD kVA load to generator kVA rating should prevent that.
A generator with an inverter output could have a sufficiently distorted output waveform to adversely effect VFD operation. However that would be problematic for a many types of loads, so a reasonably decent quality generator of that type should not cause a problem.
|
H: Can't read power from this product description (10W + 10W notation)
Here is the product in question: https://www.ledbe.com/24v-cob-tunable-white-led-strip
My question is: what does it mean by Output Power: 5W+5W, 10W+10W, 15W+15W? does that mean the power is variable between 5-10/10-20/15-30W? Or is it referring to the warm white and cool white diodes that are on the strip because it's a tunable strip between cool and warm white colors?
I am planning on using these COB LEDs to line my living room ceiling. it's around 88 ft in total, and I'm wondering if instead of running 2 small power supplies if I can run 1 big power supply for the ceiling. But for that I need to know the power and I can't figure it out from this product description.
Thanks for your help in advance.
AI: 10W + 10W is implying the max power per channel. There are two channels, warm white and cold white, 10W each. So the real range is 0W to 20W, when both channels are fully on at the same time. And any power in-between when you dim either or both channels with a controller.
|
H: Dual Power Source for single output?
In the world of USB, there's a type of cable with dual male head for 1 single female head, like this in below picture, while 1 head is for data+power and the other for power only.
I have tested it could bring power to device with any 1 of the head (and without power loss when I unplug anyone of them)
However, I do not find anything similar in 110/220v AC supply and all it suggested is by using Automatic Transfer Switch.
Is it technically possible to have something similar in the AC world, making single-powered device having redundancy without ATS / UPS?
Thanks everyone!
AI: No, such a thing does not exist. No one would ever want to make or use such a cable because it will be dangerous for many reasons.
First of all plugging only one plug to wall would leave the live parts of the second plug exposed for touching.
If plugged to two different circuits, it will also be dangerous as it will connect the circuits together, which is something that should not be done.
Some countries have unpolarized plugs so there is a 50% chanse you will plug it the wrog way and blow up fuses.
If connected to outlets that are on a different mains phase (two phase or three phase household electricity) it will short out the two phases and blow the fuse.
If redundancy is required, a device such as a redundant power supply will have two separate mains inlets.
|
H: I got a shock from a metal switch powering mains
I've been working on an Arduino project which controls the temp of a crock pot and I wanted to incorporate this cool looking illuminated metal toggle switch. https://www.alibaba.com/product-detail/DaierTek-16mm-Round-Mounting-Waterproof-SPST_1600142436167.html.
The metal switch was used to turn on a small 12V 1.5A DC power supply from the 240V household mains, which powered an Arduino mega, which controlled a solid state relay to power the crock pot. (i.e. a positive 240V was running through the metal toggle switch).
I made sure to properly earth the metal housing of the switch, however, the actual metal lever of the switch wasn't physically touching the housing, so it could NOT be earthed. I was not using the RGB LED in the switch at the time.
The switch was also mounted onto an aluminum panel, which was earthed.
They do say the switch is rated for only 125VAC, not 240V, but they do briefly mention that the max voltage is 250VAC.
Anyway, I used the switch successfully around 50 times to turn on and off the circuit. Then yesterday when I went to turn off the circuit, I got a huge shock when I touched the lever of the switch, which tripped the RCD on my house! Caused a big muscle spasm, but I was fine. The shock only lasted a fraction of a second.
After it happened, I checked the wiring multiple times with a multimeter and everything was perfectly fine. There was no continuity between the lever and any of the switch contacts and everything (except for the lever) was properly earthed. And the live wires connected to the switch contacts weren't touching any of the metal housing.
So what may have happened? Could the distance between the metal lever and the live contact have been too small and the current jumped through the air? Would using only 125VAC really have prevented this? Is this a problem with other metal switches too? Either way, I'm sticking to plastic switches for now.
AI: Despite the 'Quick Details' mentioning 'Max. Voltage: 240 V AC' and the 'Product Description' mentioning 'Rating - 20A 12VDC;15A 125VAC', there is every indication that it's a low voltage switch.
The description 'Illuminated Metal Toggle Switch with Wire for Car Boat' shows that it's intended for low voltage DC application in a car or a boat.
In the same description, '12V RGB Illuminated' indicates an LED voltage of 12 V. The 'Wiring Diagram' picture, showing the LED positive connected to the switch positive, confirms that the switch is indeed intended for 12 V DC application.
The lesson learnt from your experience would be to always use all-insulated switches and to never use metal ones, in utility mains applications.
So what may have happened?
It could be insulation failure (tracking) caused by application of high voltage to a low voltage device.
'Tracking' is the formation of a conducting path across the surface of an insulation at high voltage.
A multimeter would not reveal insulation failure as it operates at a very low voltage. The instrument intended for that purpose is known as a 'megger'.
|
H: Estimation of Rth(ja) when not provided
I am looking at the datasheet of a SiC MOSFET, which has a junction to case thermal resistance Rth(j-c) max of 1.41°C / W.
The junction to ambient thermal resistance is not provided, as this type of power transistors are usually used with a heatsink.
Is there a way to estimate the Rth(j-a) ? I want to estimate the losses without a heatsink.
Thanks.
AI: Is there a way to estimate the Rth(j-a) ?
There are some hints on this wiki site about TO-220 packages and there is a useful paragraph that compares values including that of the TO-247-3 package (used in that rather feeble GeneSic MOSFET you are asking about): -
If more heat needs to be dissipated, devices in the also widely used
TO-247 (or TO-3P) package can be selected. TO-3P has a typical
junction-to-ambient (heatsink) thermal resistance of only about 40
°C/W
So, I think the answer you require is ~ 40°C/W
I want to estimate the losses without a heatsink
Well, the "losses" will be the same for a given current and voltage but, the temperature difference will be vastly changed.
Be aware that the G3R160MT12D device is rather poor on peak power dissipation (see figure 14 in its data sheet) compared to other 1,200 volt devices such as those from ON-SEMI. However, you may be considering this part not because it might appear to be attractive but, because it is available. Be very aware about its limitations
|
H: STM32F7: use more than 16 external interrupts
I'm currently designing a circuit based on a STM32F722ze (datasheet, reference manual).
As far as I understand from section 3.11 of datasheet and 10 from reference manual, for each "external interrupt channel" (EXTI0 to EXTI16), I can choose exactly on pin (for EXTIx, I can pick whatever the pin #x from any port).
So as far as I understand, I can only get 16 external interrupts in total.
Do you know if it is somehow possible to get more interrupt pins (even if it requires to read a few pins an check the differences manually to know which one generated the interruption)?
The ideas I have:
connection several pins to the same EXTIx (for example connection PA0, PB0 and PC0 to EXTIO) and when an interrupt occurs check which pin(s) changed since last interrupt. If I understand right, this is NOT possible on STM32F722
have an interrupt on any change on a given port (for example if any pin between PA0 and PA15 changes), and comparing to previous state to know which pin(s) changed. If I'm not mistaken, this exists in the ATmega microcontrollers: I haven't read about it for STM32 microcontrollers yet, but maybe I just missed it?
the "hardware" way: XOR all the pins I want to use as interrupts and put the XOR on a EXTIx pin, and use normal GPIO_inputs for all the individual pins: that way, I know each time a pin changed, and I can then check which one by reading all of them. (NB : it might be wiser to use several EXTIx pins, each XORing the pins of one port, as to speed up reading/comparison). One drawback is that if 2 pins change at the same time (i.e. faster than what the XOR + interrupt can react), there will be no interruption generated.
other ideas?
EDIT:
for context, why do I want so many interrupts?
I'm developping a robot for cave exploration, that will navigate within narrow cracks (to narrow for humans to pass through), pushing against both walls to avoid falling into the bottom of the crack. For this, I use 8 arms (4 on each side) with a wheel at the end. For each arm, I need one motor for the wheel and one motor to move the arm and press it against the wall.
For the 8 wheels motors, I will probably soon add quadrature encoders in order to 1) detect motor stall (in adition to current measurement) 2) insure same speed on all 8 motors 3) get an estimation of the distance the robot made in the crack (which is an important factor, as the main goal of the robot is to know for how long one would need to enlarge the crack in order for humans to pass). So 8 motors * 2 signals = 16 interrupts.
So just for with the wheel motors, I already use all the interrupts I have.
For now, I'm not sure if I will need more, but as the PCB will be quite expancive already, I would like add extra connectors for adding aditionnal features as the development of the prototype advances. For now, one use for additionnal interrupts would be to measure the position of the arms with encoders (for now, it's done with potentiometers, which are not very accurate). Other uses might come that I'm not thinking of yet.
So if it is too complicated, I will stay with the 16 interrupts, but if there is a simple enough solution, I'd rather plan some more now.
For the quadrature encoder interrupts, it's the edges I'm interrested in, that's why I was suggestion to XOR the interrupts. NB : if having 2 changes at the same time occure but seldomly, it's still OK (if I miss 1% of interrupts, it will only result in 1% of distance error, which is far bellow the error due to other reasons (wheels sliping, non parallel walls, ...).
For other type of interrupts (like faults or sensor data ready, I agree that ORing or ANDing might be more usefull).
EDIT 2 :
Maybe I'm thinking the problem the wrong way : maybe I can find some dedicated ICs to manage the encoders instead of getting all the interruptions directly on the STM32. That way I dont need all those interruptions pins, and I save a lot of CPU time on the STM32
AI: Cool project!
A quadrature encoder has 2 output signals. If you want to process it in an interrupt routine, you can use 2 interrupts, but you can also use just one.
If one signal is clock and the other is direction, then you only need an interrupt on clock, with code to check the value of the direction signal. So you don't need 16 interrupts, just 8.
Having interrupts on both pins would double the precision, but at 4000 pulses/turn, on a slow moving cave robot, it won't matter: you'll have more than enough precision already.
You can also do it on a timer interrupt, of course. Cortex interrupt overhead is pretty low.
Likewise, your timers can do quadrature decoding. Have you checked how many encoders each timer can handle? It could be a lot more than just one, so I doubt you need 8 timers.
|
H: STM32F103: Custom bootloader weird behaviour with stack pointer
So, I am trying to use this USB mass storage bootloader for the STM32F103C8 (64kB flash):
https://github.com/sfyip/STM32F103_MSD_BOOTLOADER
To compile .hex files for it, I've already set the flash origin to 0x8004000 and the vector table offset to the same value. I've verified that, indeed, the generated hex file starts at 0x8004000 and through debug I've verified that SCB->VTOR is the right value. However, I still could run a simple blink app only from the debug from STM32CubeIDE - when I uploaded the firmware to the 0x8004000 address either via ST-link or via the bootloader, the blink did not work.
However, I then took a look at the example hex file of a blink project the bootloader creator provides. Here I saw that the first value of the hex file is 0x20000408 - the initial stack pointer value (in RAM space), if I understand everything correctly. In the bootloader hex itself, the initial stack pointer value is 0x20001250 (compiled with keil uVision 5). However, in all applications I compile from Stm32CubeIDE that I use, the value is 0x20005000. That is when I started to edit my hex files and play with it.
What I discovered is that any values lower than 0x20005000 - I've tried 0x20000408, 0x20002000, 0x20003000, 0x20004000 and even 0x20004999 - do work, they successfully upload to the microcontroller both with ST-link and the bootloader. The bootloader flawlessly jumps to the main application and the blinking starts. But with the value 0x20005000, the application does not work (larger values obviously don't work since they are beneath the RAM space). During debug I discovered that with 0x20005000 value the microcontroller jumps into the hard fault handler, with 0x20004999 it does not.
The jump to main application in the bootloader is performed with this code, where APP_ADDR is 0x8004000:
uint32_t jump_addr = *((__IO uint32_t*)(APP_ADDR+4u));
HAL_DeInit();
/* Change the main stack pointer. */
__set_MSP(*(__IO uint32_t*)APP_ADDR);
SCB->VTOR = APP_ADDR;
((void (*) (void)) (jump_addr)) ();
Everything seems fine, the MSP is set according to the hex file (0x20005000), Vector offset is set to 0x8004000 (which is set again in my app in SystemInit()) and the jump is performed.
What is going on here, why can't I set initial stack pointer to 0x20005000?
Am I breaking something by changing it? Will apps more complex than blink() work?
Could the problem be related to the fact that the bootloader is compiled with Keil uVision, while I use Stm32CubeIDE? Perhaps, different linker settings? If so, what do I need to change in the keil uVision linker?
If I do need to set the initial stack pointer to another value, how do I do it in Stm32CubeIDE, not by modifying the .hex file?
Could this issue be common for all bootloaders?
Am I even on the right track, or the issue is deeper than I think?
AI: Normally in ARM systems, setting the stack pointer is done by hardware, but apparently not in this bootloader scenario(?).
So we have to treat it just like any old-fashioned microcontroller program where we set the SP manually. Generally speaking:
C programming is enabled at the point where you leave the function setting the stack pointer. You shouldn't normally write C code in that same function, or in case you do, don't declare any variables.
The C compiler doesn't understand what inline asm and similar code used for setting the SP does.
Therefore, in the function where you set the stack pointer, you cannot declare any local variables because those risk getting allocated by the stack. And if you allocate a variable on the stack before you have told the program where the stack is... well, that's obviously going to to end up badly.
In your code you have uint32_t jump_addr and this is a local variable with automatic storage. If you are lucky, the compiler places it in a CPU register but it is by no means required to do so. We have to ensure that it doesn't end up on the stack. Ideally we should be able to declare it as register but this is just a recommendation to the compiler, not a direct order.
A more reliable way might be to declare the variable as static const jump_addr = .... This makes the assumption that such a variable ends up in flash. Otherwise, if it ends up in .data, that might not improve the situation since .data is probably not initialized this early on in the CRT code. If you use this declaration you must verify in the .map file where the variable ended up.
The best solution ends up as not declaring the variable at all:
( (void(*)(void))(APP_ADDR+4u) ) ();
This should result in the function code getting baked into the machine code and not placed in a memory area which is unreliable at this point.
Alternatively, you could write this whole function in inline assembler and ensure to use a register for the address.
A brief guide for how to implement the whole CRT startup code yourself can be found here: https://stackoverflow.com/a/47940277/584518
|
H: Is there a better or efficient method to convert 36 V / 48V, 16,5 Ah battery supply to 12 V 10 A than a DC/DC buck converter chip?
Currently I’m in the progress of designing a PCB (hardware circuit) in order to control a parking brake and signal lights. I am using 36V, 16,5 Ah lithium iron phosphate battery pack to power the whole circuit as well as the driver unit. Since the whole circuit is powered by the battery pack itself I need to use as little current (power) as I can. In other words I need to design the circuit in more efficient way.
In order to power all the circuits I need regulated 12 V and 10 A of current in total. This 10 A will not be used completely at a time but based on each circuit functionality the required current will be used.
Since my battery pack is 36 V 16,5 A/H capacity, I planned to use a DC to DC buck converter to get 12V 10 A. When I calculate the current consumption of the DC / DC buck converter using below formula
R ℎ = () / Efficiency (%) = 120 Watts/ 80% = 150 W
Current consumption with losses = with losses () / Input Voltage = 150 W/36 V = 4.1 A
So the DC-DC converter consumes 4.1 A which is a lot for a 16.5 Ah battery pack.
Is there a better method or circuit or PCB device (semiconductor) to convert 36 V 16.5 A to 12 V 10 A in more efficient way by consuming less current?
AI: This appears to be the question: -
Is there a better method or circuit or PCB device (semiconductor) to
convert 36 V 16.5 amperes to 12V 10 amperes in more efficient way by
consuming less current?
This part (36 V 16.5 amperes) is wrong because the OP is confused about the meaning of ampere-hours (the OP also refers to them as A/h and that is wrong). So, if you meant this: -
36 V 4.1 amperes instead of this:
36 V 16.5 amperes then...
There are certainly better methods.
36 volts and 4.1 amps is a power in of 147.6 watts whereas,
12 volt out at 10 amps is 120 watts.
This is a power efficiency of 81.3% and certainly, with care (and using synchronous buck converters), I would expect a power efficiency of greater than 90%.
So, with 10% losses the input power is 132 watts or, 36 volts at 3.67 amps.
With 5% losses, the input power is 126 watts or, 36 volts at 3.5 amps.
And, to answer the question, 3.67 amps (or 3.5 amps) is less than 4.1 amps.
Maybe one of these devices (shown wired as a dual parallel synchronous regulator) might be a consideration: -
It can produce 12 volts at 30 amps at efficiencies greater than 90% by the looks of it. Or, maybe one of these: -
It should be good for about 90% efficiency according to the data sheet.
|
H: Fudan FM33LG048 microcontroller draws too much current in deep sleep mode
I am working with Fudan FM33LG048 low power microcontrollers. Despite turning off all clocks except low frequency external oscillator, disabling all peripherals, and entering to the deep sleep mode the MCU still draws 63uA. The datasheet (available only in Chineese unfortunately) says that in deep sleep mode it must draw only 2uA.
Has anyone worked with these microcontrollers and if yes anyone knows what can the reason be?
EDIT:
void DeepSleep(void)
{
FL_PMU_SleepInitTypeDef LPM_InitStruct;
FL_RMU_PDR_Enable(RMU); // ??PDR
FL_RMU_BOR_Disable(RMU); // ??BOR 2uA
FL_GPIO_ALLPIN_LPM_MODE();
FL_CMU_SetSystemClockSource(FL_CMU_SYSTEM_CLK_SOURCE_XTLF);
//FL_CMU_SetSystemClockSource(FL_CMU_SYSTEM_CLK_SOURCE_RCLF);
//FL_CMU_RCLF_Disable();
FL_CMU_RCHF_Disable();
FL_CMU_XTHF_Disable();
FL_VREF_Disable(VREF); // ??VREF1p2
LPM_InitStruct.deepSleep = FL_PMU_SLEEP_MODE_DEEP;
LPM_InitStruct.powerMode =
FL_PMU_POWER_MODE_SLEEP_OR_DEEPSLEEP;
LPM_InitStruct.wakeupFrequency = FL_PMU_RCHF_WAKEUP_FREQ_8MHZ;
LPM_InitStruct.wakeupDelay = FL_PMU_WAKEUP_DELAY_2US;
LPM_InitStruct.LDOLowPowerMode = FL_PMU_LDO_LPM_ENABLE;
LPM_InitStruct.coreVoltageScaling = FL_ENABLE;
FL_PMU_Sleep_Init(PMU, &LPM_InitStruct);
}
I have also removed 8Mhz external oscillator:
AI: Pull-up resistors connected to JTAG header were too small. After removing them the current consumption became 1-2uA.
|
H: How to trace and find the clock of a certain USART for this board?
I'm having trouble to trace and find which clocks clock USART2 and USART3 ect for a uC board. I looked at clock tree and block diagram of the board but cannot find a hint.
I checked both the reference manual and the datasheet but couldn't figure out.
(By clock I mean the clock which is clocking the USART)
AI: USART 2 and 3 are clocked from PCLK1
datasheet page 985
Only USART1 and USART6 are clocked with PCLK2. Other USARTs are
clocked with PCLK1. Refer to the device datasheets for the maximum
values for PCLK1 and PCLK2.
|
H: DIP switches and IC inputs
I am trying to connect a DIP switch (A6A-16R specifically) to some MCU IO pins. From looking at a reference schematic, they connected the Com line to GND. I was curious how that works? Shouldn't it be connected to VCC so that if the dip switch is 'ON,' the respective MCU input is high? If 'off' it'll be floating (When the PCB is on/active, the DIP switches wont be moved so floating shouldn't affect it)?
My thinking is that connecting 'Com' to gnd makes everything 0 or floating (floating from gnd so still gnd?) regardless since the IO pin is being used as an input? I don't see it as sinking the pin since then it would be 0 if 'on' and floating if 'off' but then the pin wouldn't be able to read since its being used as an output.
Was this maybe a typo on the reference schematic?
AI: You should never leave the input of an MCU floating. Then any noise will change it between high or low, you never know which.
But it is very common to have all types of switches connect to ground. Then you have a pull-up resistor connected to (or often om modern MCU's, built into the MCU pin and enabled via software) the input. Then the input reads high when the switch is not actuated, and low when it is, grounding the pull-up resistor.
It can of course be done the other way around. Having the switch connected to Vcc and then use a pull-down resistor to ground. But having the switch connected to ground is the most common setup.
|
H: Can I use my old Sony Camera's Night Shot to detect shorts?
I have an old Sony TRV-14 with a built-in night shot mode for shooting videos in the dark. It is my understanding it works by using sensing infrared radiation which is also how thermal imaging cameras work. Unlike thermal imaging cameras, the images produces by my camera are in gray scale instead of color.
Is it possible to use my camera in some capacity for detecting shorts or overheating components? I figure hot areas would appear lighter and the cooler areas would appear darker. Am I correct?
AI: Thermal radiation is still an electromagnetic radiation and the wavelength range of thermal radiation covers the IR area.
Your camera's sensor might be able to pick up IR signals just like an I² NV (Infrared-Illuminated Night Vision) so you would expect to detect (or distinguish) heat radiation. However, due to the limitations of your camera's sensor (sensitivity, contrast etc) it's unlikely possible.
Unlike thermal imaging cameras, the images produces by my camera are in gray scale instead of color.
That's because thermal cameras have special sensors and these cameras process the incoming signals from those sensors to generate the heat difference maps.
Here's a practical test: A human body generates and radiates its own heat and it's not really low. If your camera can visualize this then yes, you can use your camera for heat detection.
Maybe, your camera can be used to detect very high temperatures such as 200+ °C.
|
H: Magnetometers : on motor controler PCB or near motors?
For the cave robot I'm working on, it would be nice to have a magnetometer to get a (rough) orientation of the robot. By rough, I mean that 10° is more than enough, and even a +-45° error is still better than nothing.
The problem, is that there are a total of 16 motors on the robot (drawing usually a few hundreds milliamps, about 1A peak), which will generate some magnetic field.
So the question is whether a magnetometer will still give me a reasonable heading if I place it :
directly on the main PCB, which is easiest, but which is also the one with the motor controllers on it, so probably "quite" bad from an magnetic point of view. The distance to the nearest motor would be about 4cm, and the distance to the nearest cable going to a motor about 2cm
placing it as far as possible from the motors : less practical (requires separate PCB and wiring). About 12cm to the nearest motor and 3cm to the main PCB, and 5cm to motor wires.
What do you think, is it worse trying to put a magnetometer on the main PCB? (if it doesn't works, I can still add one farther away afterward).
Or is it even useless to plan one at all on my robot? (in which I will just place the IMU on the main PCB)
EDIT : the motors are small brushed DC gear-motors
AI: Lay the PCB out for both magnetometer and connector. (Use links or "do not fit" 0 ohm resistors where necessary to select either)
On board one will pick up HF switching from the motor controllers, but that's nothing compared to rotating fields from the motors themselves.
Magnetometer near a motor may even work better when the motor is running (if you filter out all the hash thoroughly enough) because when you stop a BLDC motor you can't be sure which pole of the rotor is closest : that adds an unknown stationary permanent magnet field to your readings. Maybe less of a problem with brushed PM motors (unless they are mounted on movable arms) but any remanent magnetism in an unpowered rotor will still add unknown terms.
You didn't say what type of motor, but I don't think it matters, there are so many unknowns here that I believe you'll have to answer your questions by experiment. To simplify which, allow alternative magnetometer mounting.
|
H: I'm designing a 4-bit GPU and I need some suggestion about the RAM for it
I'm working a 4-bit GPU, the GPU run on 1.023MHz (1023kHz) clock while CPU only run on 127kHz so I need a screen buffer for it when the CPU is working on some instruction. The display I use is a 24 x 16 pixels display so I need at least 4 x 24 x 16 bits or 1536 bits cause it's have 4 bits color. I'd like the 74ls189, this chip have separate input, output and a parallel address line so I don't need a switching circuit which reduce the controll line for the CPU, but the thing is that the 189 is only 16 x 4 bits so I would need like 24 of them for the screen. I found a few option but most of the are 8 bits ram and input-output on the same line So I want to ask if anyone know a chip that similar to the 74ls189 (a 4 bits static random access memory (SRAM); have separate input, output and a parallel address line; a chip select, input enable, output enable; able to working at 1.023MHz or higher) but have like 512 x 4 bits or 2048 bits. I'm fine with a chip like 256 x 4 or 128 x 4 bits. If could, I also want the chip is in the production stage and have a open datasheet cause there's not much information about the 74ls189 and I think that chip is obsolete.
AI: What you need to search for is a "dual port" RAM.
You can get 32K x 8 bit dual port RAMs on major distributors like Digikey and Mouser for under $1. They will all be SMD though.
|
H: What is this SOIC-8 part from ST?
Marked "393" and "(ST)GZ439" or "6Z439" under conformal coat.
Siemens DC/DC PSU section, near a UC3843B current-mode PWM controller, HF transformer, etc.
Checked the ST TS393ID datasheet, that is a micropower dual CMOS voltage comparator. Micropower doesn't make much sense in this application, and if it were that it should be marked "S393I". Checked TI's LM393D, nothing they make is marked with only "393" either.
But the other side of the two caps below it do connect to pin 4, so this seems fitting for a 393. Is this a custom marking, custom device, or?
AI: How about the ST LM393?
https://www.st.com/en/amplifiers-and-comparators/lm393.html
There are ordering codes that are in a SOIC package and just marked "393". The second row could be manufacturing info.
|
H: Isolating small backup battery when power is off
I'm building a circuit with an Arduino and a breakout board that has a small coin cell battery on it for maintaining a bit of state when power is off. The battery is exposed by a pin on the breakout board. I want to measure the battery's voltage with the Arduino.
In the schematic drawing, I have drawn only the battery for simplicity.
I have a voltage divider connected to the Arduino, but to avoid having a current flowing constantly from the small battery, I added a p-channel mosfet to keep the voltage divider disconnected from the battery most of the time, and I connect it occasionally in software to check the battery. That works well, but only if the system is powered.
Without power, I see a significant voltage at the mosfet's source, I guess because the gate is then floating. That's not what I want. Is there a way I can get the circuit to keep the battery disconnected when the Arduino is not powered (i.e. 5V and D0 are floating)?
(Sorry if this is a stupid question; I am trying to self-re-teach myself the terrible electrical engineering class that I semi-slept though 20 years ago in college.)
AI: A second FET can be used, and the pullup can be moved to the 3V, rather than 5V line:
simulate this circuit – Schematic created using CircuitLab
When D0 floats or outputs logic LOW, the gate of M2 is pulled down and M2's channel conducts no current. As a result, M1 gets pulled up to +3V (the battery voltage), but no significant current is drawn from the battery. When the microcontroller is powered and D0 is logic HIGH, M2 conducts, pulls M1's gate down, and connects the battery to the voltage divider.
You will need to make a software change to drive D0 HIGH for sensing, rather than driving it LOW.
Note that the naive approach (which I suggested before fixing this post) suggested using your original circuit but with the pullup going to the battery voltage. This was actually a poor idea on my part because it would lead to the battery powering the Arduino (and anything else on the 5V bus) in an inappropriate way through its protection diode:
simulate this circuit
|
H: Confusing scope reading from Op Amp (LM3900N) output
Electronics beginner here! I'm trying to understand some confusing output from this circuit on my scope.
I'm generating a 5V 100Hz square wave from an Arduino Mega digital pin (Vsig), which looks good on my scope. I'm then using a voltage divider to create Vin, which on the scope reads ~350mV peak-to-peak (lower than I expected, but not too perplexing).
I feed this signal into the non-inverting input of an LM3900N configured as a buffer, with a 10k resistor as a simulated load. The confusing thing though is that the output of the op amp isn't a square wave anymore - the scope reads steadily at ~800mV and doesn't fluctuate from 0V to the max voltage of Vsig, as I expected in the below configuration:
simulate this circuit – Schematic created using CircuitLab
Are there any traps I may be falling into? I thought maybe the issue is that the OpAmp isn't able to get close enough to the ground rail in order to fluctuate, but being such a noob I can't really discern from the datasheet if this is true.
How can I get this setup to work?
AI: The LM3900 is a Norton 'op-amp' and the inputs are not high impedance- they look more like diodes to the negative rail. Unless you have some strong reason to be using such an oddball part, I suggest getting a more conventional part such as an LM324.
The way you normally use this part is to have series resistors on each input and the current difference (times gain) is what drives the output. Unlike normal op-amps where the voltage difference is what drives the output. The other quirk is that the current difference is only approximate, within 10%, which is much less accurate than the effects of voltage offset on a conventional op-amp when dealing with voltages of a volt or two.
Here (from the original NS datasheet) is how you make a gain-of-one buffer amplifier:
But that won't do you much good since your input voltage is so low.
|
H: Are T568A/T568B Cables Compatible with USOC Cables?
Is it a good idea to use a USOC cable in the same network as a T568A/T568B cable?
I can't seem to find anything about this on the web.
AI: No, it is not a good idea, because as you can see, the pairs are arranged differently. As standard devices expect the pairs to be like they are on T568 wiring, don't expect them to work with USOC wiring as signals that are expected to be kept as a twisted pair is not kept as a twisted pair.
USOC uses RJ61 wiring. Ethernet needs T568 wiring. Both use same connector.
|
H: Methods for high current DC motor emergency cutoff
I need to add a secondary means of cutting off power to a motor for safety reasons if a state change is detected on a 3.3V logic level signal while it is operating. The requirement I have is that it must be external to the existing system, fitting inline with the motor connector.
Currently, the brushed DC motor is driven bidirectionally with 12V (SLA battery, so realistically 11.5-13.5V) PWM using an H-Bridge onboard like the image below. This protection cutoff would essentially need to fit between the bridge and the motor, in the area of the red box
Right now I've considered a few solutions, but have the following concerns:
High Motor Current: Nominally about 5A, but if stalled could reach ~50A
for a short period before FW detects the condition or our 20A slow
fuse goes. I'm seeking parts rated to ~75A to provide some margin.
Bidirectional Drive: Whereas a high-side PFET may have been an easy
solution if driven in one direction, bidirectional drive with the
H-bridge makes a discrete solutions with FETs more complicated.
Flyback voltage: Since it is driven bidirectionally with the
H-bridge, a simple flyback diode can't be placed across the
terminals. I'm unsure with how to mitigate flyback voltage from this cutoff without interfering with normal bidirectional operation. I'm also concerned that flyback will damage my cutoff circuitry, particularly if I use a semiconductor device
Here are some solutions I'm considering so far:
MOSFET Discrete "E-Fuse"
Integrated E-Fuse, or Load switch, possibly with external FET(s)
Relays, Electromechanical or solid state
Some sort of SPDT switch, which could be used to simultaneously cutoff power and short the battery terminals to circulate flyback current (though I haven't found any sort of high power component for this...)
Any feedback on my considered solutions or suggestions would be great. My main difficulty is that finding parts that work bidirectionally and handle adequate current has not been easy, so I'm wondering if I'm looking at the wrong types of solutions.
AI: I see 3 solutions :
If you are allowed to, simply cut the power supply of the H bridge : it is still independent from your main system, and it's far easier (a mosfet or a relay is enough, and you don't have to worry about voltage spikes or energy dissipation, as this should already be taken care of by the H bridge itself). EDIT : I have just seen the comment you added that you don't have access to anything except ground, the signal and the 2 wires going to the motor. If it's really so, then it won't work. But if for example you have access to the battery, then you can cut the current right at the output of the battery
If you are not allowed solution 1), then you might consider using a relay. To avoid voltage spikes, you might put 2 zener diodes (with nominal voltage above the normal voltage of the supply) in serie (one in each direction) between the 2 sides of the motor: they will clamp the over-voltage. You can find zener diodes with very high current ratings. Just be carefull about power : if you have a lot of inertia, then the zener diodes are likely to overheat. If that's the case, you might use a relay with 2 position, and when you disconnect the motor from the H-bridge, you connect a power resistor between the 2 sides of the motor : the zener diodes will then only conduct for the short time until the relay finished to change position
How unlikely is that emergency stopping. If it is only theoretical, then a simple relay on one of the motors wire is enough : you will get voltage spikes, it's not unlikely that you brake something, but the motor is no longer powered. If you expect the likelyhood of using this emergency higher than 1%, then forget about this solution
|
H: LT6105 formula datasheet
I got a formula brain wreck, it should be me, but to avoid tomorrow a doctor visit, I will ask here first. It goes about the LT6105...
It state that Rin1 = Rin2 = Rin, but how is this true? What about the 0.2 resistor?
The result in the formula is Vout, a voltage.... or not. What about the 1V/A?
The formula results.
Av = 4.99K/100 = 49,9Ω
Rin = 100Ω
Vout = ( 5V - 0V ) x 49,9Ω = 249,5(V??)
What wrong?
A big thank you to Big6
My new calc is now working correctly.
AI: \$V_s^+\$ and \$V_s^-\$ in the circuit shown actually refer to the voltage drop across the 0.02 Ohm resistor -- not the voltage rails.
So if there is a 1A current through the 0.02 Ohm resistor, then the voltage drop across it, using Ohm's law would be (0.02 Ohm)*(1A) = 0.02V -- this is the same information you should get if you found \$V_s^+ - V_s^-\$. If you multiply the 0.02V drop by the gain of 49.9, you'd see 0.998V at the output.
That is why the datasheet tells you that in that configuration, for every amp of current, you should see 1V increase (1V per Amp).
|
H: Capacitive coupling for common mode rejection?
I'm not finding any information on this method, so I'm thinking that I must be missing something.
I have a 5V single ended RRIO opamp that I need to measure BLDC motor current with. The motor is powered by 30Vdc, but the common mode range of the opamp is only to its supply rails (5V in this case). I don't really have an option to change the opamp, so I'm wondering if I can use capacitive coupling to to remove the 30V common mode. The motor PWM is about 40kHz and all resistors are 0.1%.
Simulation appears to work fine, but thought I'd appeal to the common collective brain power of the internet at large.
simulate this circuit – Schematic created using CircuitLab
AI: This will work, but there are a few caveats.
You can't measure the DC current component -- just the AC component.
Supply noise on the BLDC will only be rejected as well as the common-mode rejection of the opamp circuit -- and this depends on the matching of the resistors. With 0.1 % matching, you might have a CMRR of 60 dB.
|
H: What happens when you try to draw more amps than is available?
2 hypothetical situations:
Situation 1: A 5-20R wall outlet is extended using an extension cord. The extension cord has a 5-20P plug, but only has a 5-15R outlet.
Situation 2: A 5-15R wall outlet is extended using an extension cord. The extension cord has a 5-15P plug, but only has a 5-20R outlet.
In situation 1, we know that whatever plugs into the extension cord will be safe, because it can only take less than what is available from the wall. We have extra amperage that won't be used.
In situation 2, user could plug in a 5-15P device, and that would be ok, since they would fit and are compatible. But what happens if user plugs in a 5-20P device and that device thinks it can draw 20 amps?
In the 2nd situation, would the device pulling more amps than is available damage the extension cord? Would the device itself be damaged? Or both? Or would nothing happen and the device would not work since it is not getting what it is expecting?
AI: Any circuit with a NEMA 5-15R outlet will probably have a 15 amp breaker on it. As such, if you pull 20 amps through it, it'll work for a few moments until the breaker trips. The voltage may sag a bit.
If the circuit actually has a 20 amp breaker, and is properly wired for 20 amps (I'm pretty sure, but not certain, that this is allowed by the standards), then you'll just be pulling 20 amps from the 5-15R socket. It'll work just fine, because nothing in the socket is inherently limited to 15 amps, that's just the regulatory standards.
|
H: Battery management system
I am designing a battery management system for lithium ion batteries. I am referring a schematic that is already available.
I do not understand the function of the two MOSFETs marked in the schematic.
AI: They together work as a bidirectional relay.
It's a well known circuit in literature.
The states of this solid state relay are: ON or OFF.
When the relay is in the ON state, current can flow in both the directions.
|
H: Better battery system
I am currently designing a battery system to support some low level electronics. The system will have both 12v and 24v electronics. I am wondering which setup would be better to get the most use out of my batteries, time wise:
Two 12v batteries in parallel and use a step up converter for the single 24v electronic equipment in the system.
Two 12v batteries in series to make a 24v source and use step down converters for all the 12v electronics in the system.
I am not worried about current issues with the wires as the electronics will be located close to the batteries. I just don't want to have to charge the batteries after only an hour of use, so that's why I thought of 2 batteries in series to double the capacity. I was just told by someone I can get a longer energy draw by putting the batteries in series.
AI: As the others have stated, capacity is capacity, doesn't matter if the batteries are in series or parallel. There are a few other considerations though.
First off, let's look at your question, 12V batteries (or 24V for that matter) are not a constant 12V output, so you'll most likely need 2 DC-DCs for 2 stable voltage rails. Let's look at which configuration is better. Assuming 1Ah packs for simplicity.
In parallel, with perfect current sharing you'd have 12Vin, and either 12Vout or 24Vout. Power In = Power Out, so 12(Iin12) = 12(Iout12) + 24(Iout24). With a parallel configuration, each pack will see half of Iin drawn from it. If we then go to a series configuration, with the same setup the equation changes slightly: 24(Iin24) = 12(Iout12) + 24(Iout24). In this case, each battery sees the same current through it (Iin24). If the 12V and 24V output currents stay the same in each configuration, we have 12(Iin12) = 24(Iin24) so Iin12 = 2*Iin24. Since each pack sees half the current in the parallel configuration, the current drawn from the packs is the same regardless.
So does it matter? Not in the sense that one configuration will provide more capacity than the other. What you'll have to worry about with either configuration is how you balance the cells. Parallel and series connections each have their own pros and cons for balancing. In parallel you're guaranteed an equivalent voltage on each cell, but it can be tricky when they start to age and sink/source current at different rates. Similarly for series connections they will always sink/source the same current, but their voltages will increase at different rates. I personally find series connections to be easier to balance, and there are a lot of ICs available that do it that way as well.
|
H: Why application notes advise series resistance to be added on clock lines for high-speed interfaces, like SDIO, and not on data lines?
Many application notes (like this one) advise series resistance to be added on the clock line, close to the source. I do understand that this resistance is added there to match the source impedance to the characteristic impedance of the line (usually 50 Ohm). However, what bugs me is that when it comes to data lines (which can switch just as fast as the clock line for DDR cases) no one advises to place series resistance. I would expect engineers to put series impedance on the drivers of data lines to provide matched source impedance just as well. Any idea why is this the case?
AI: The receiving circuit only cares about voltage levels on data lines during a time interval centered on the clock edge, with setup/hold times on both sides.
So... even if the data lines are unterminated and suffer from poor signal integrity, if the clock is slow enough versus trace length to allow the levels to settle before the clock edge minus Tsetup, the receiver will sample correct data.
However, if you want higher throughput from your trace or twisted pair, then the clock has to be faster. Then, you don't want to wait for the mess on the data lines to settle, and receiver Tsetup+Thold becomes a significant portion of the clock period. In this case, you absolutely need to terminate the data lines. For an example, check some USB eye diagrams. Termination resistors can be internal to the chip (for example DDR RAM) so you won't always see them on the schematic.
Resistors on data lines can also reduce EMI: bandwidth is inversely proportional to rise time, thus slower edges emit less HF noise. Less ringing also means lower EMI amplitude. Ferrite beads also work.
Sometimes the chip will have internal terminations, or offer several drive strength or slew rate settings for the IO's. Some other chips like 74HC or AHC have rather weak drivers, this is done on purpose both to limit slew rate and source-terminate the trace with the output FET's resistance. Other chips like 74AC and some micros have fast and strong output drivers, which make a lot more noise. So maybe you'll get a clean signal without resistors, or maybe not, it really depends on what's driving the trace.
|
H: 555 Timer with 50% duty cycle
I've seen below 555 circuit which produces a square wave of 50% duty cycle. I am quite new to electronics and I saw Ben eater's 555 timer tutorial where he used discharge pin for capacitor discharging. One Resistor was very very low compared to Second resistor and created 50-ish% duty cycle.
I've seen below circuit from Tutorial and In below circuit Charging and discharging is being done on output pin, when it's low capacitor is sinking into it and vice versa. It's okay but can anybody explain the working of R1 in below image? Article says that
Resistor R1 is used to ensure that the capacitor charges up fully to the same value as the supply voltage
But when capacitor voltage becomes > 2/3VCC, it will trigger capacitor discharging so capacitor will never reach full VCC.
And also what if we do not use R1 at all? will is suppose to work?
Excuse my lack of knowledge on subject as I am new and also excuse my bad english.
AI: Firstly (and probably not that important) is that your hyper-link is not going to where you probably intended so, if there's something really important here that folk need to know then, fix that link.
But when capacitor voltage becomes > 2/3VCC, it will trigger capacitor
discharging so capacitor will never reach full VCC
Quite correct but, I think what the rather lazy statement is all about is that the capacitor charging voltage follows a trajectory that would eventually make the final charge voltage equal to the supply voltage: -
Image from here.
It's okay but can anybody explain the working of R1 in below image?
This is the main route by which charge enters the capacitor and this route is normal for most 555 circuits I've ever seen.
And also what if we do not use R1 at all?
It will still work according to this diagram (similar ones in many other places): -
Image taken from here.
|
H: Analog synthesizer- Add second VCO
I am working on reviving an old synth design (Transcendent 2000), but I would like to add a second oscillator. I was thinking of doubling the circuit highlighted below, and sharing the pitch control (non-highlighted sections) between the two oscillators. I was planning on using a second tuning circuit (circled section) to detune the second oscillator. I would also like to add hard sync between both oscillators. Would this idea work, and how would I go about syncing the oscillators together?
Hard sync as defined by wikipedia: The leader oscillator's pitch is generated by user input (typically the synthesizer's keyboard), and is arbitrary. The follower oscillator's pitch may be tuned to (or detuned from) this frequency, or may remain constant. Every time the leader oscillator's cycle repeats, the follower is retriggered, regardless of its position. If the follower is tuned to a lower frequency than the leader it will be forced to repeat before it completes an entire cycle, and if it is tuned to a higher frequency it will be forced to repeat partway through a second or third cycle. This technique ensures that the oscillators are technically playing at the same frequency, but the irregular cycle of the follower oscillator often causes complex timbres and the impression of harmony. If the tuning of the follower oscillator is swept, one may discern a harmonic sequence.
This effect may be achieved by measuring the zero axis crossings of the leader oscillator and retriggering the follower oscillator after every other crossing.
AI: In the circuit shown, the base of Q7 is a summing junction for all the various control voltages in the unshaded portion of your diagram, including the circled pitch control. Q7 itself produces a current at its collector that charges the timing capacitor C22; that current has an exponential relationship with the sum of the control voltages, so as to get a pitch that rises by an octave for some fixed increase in control voltage, typically 1V/octave after scaling.
For you to get two oscillators with any independence of pitch, you will need to sum the control voltages independently for each of them. This suggests introducing an op-amp or two to buffer those voltages that are fed to both oscillators: perhaps an op-amp to sum the voltages from the unshaded portion of the picture, with its output fed via two resistors to the bases of Q7 and Q7', together with a separate Tune potentiometer for each. Or (to copy the Minimoog) a separate summing op-amp for each oscillator.
The function of FET transistor Q8 is to discharge C22 rapidly when its voltage reaches a threshold measured by the comparator IC12. For oscillator sync, the aim is to reset oscillator 2 whenever oscillator 1 resets. For this purpose, some synth designs include a second FET across C22 in oscillator 2 that is controlled by the comparator in oscillator 1 (with a switch to connect or disconnect the signal); others link the comparators in the two oscillators in other ways.
I have found that studying the schematics for the Minimoog and other synths is very helpful, though my own adventure in analog synth building has only just got off the ground. The Minimoog does devote some resources to summing and routing control voltages to the oscillators. Many other synth schematics are easily found online, including the Moog Rogue and Prodigy, both of which are pared-down designs like the one you are looking at, but (IIRC) have oscillator sync of one kind or another.
|
H: UART: How to calculate bit time?
Reading this application note about timing for enable RS485 transeiver, I read that I need to ensure a time called "bit time", which depends on the baud rate, for example the document shows an example:
using 230400 baud rate the bit rate is 4.34 µs, but the document doesn't specify how to calculate this value
How can I calculate it?
The application note is here:
https://www.st.com/resource/en/application_note/cd00249778-managing-the-driver-enable-signal-for-rs485-and-iolink-communications-with-the-stm32s-usart-stmicroelectronics.pdf
AI: using 230400 baud rate the \$\color{red}{\text{bit rate}}\$ is 4.34 µs, but the document
doesn't specify how to calculate this value. How can I calculate it?
I'm assuming that you don't actually mean \$\color{red}{\text{bit rate}}\$ - you mean the time duration for each bit.
So, take the reciprocal of the baud rate to get the time for each bit.
In other words, if you are receiving or transmitting 230400 bits per second then each bit must last 4.34027778 μs.
|
H: How can I limit design rules check on some components and its connected tracks in Altium?
My design is using an isolator between low voltage and main supply.
I'm using a design rule to set clearance beetween planes and tracks with this kind of query:
(InNetClass('HV') or InNet('GND'))
Here's the result. As you can see, the isolator is itself too small to provide the spacing on pads between the two sides.
I would like to keep this isolation distance as a general rule but exclude this component from rules checking. I tried to change the query with the name of the component:
(InNetClass('HV') or InNet('GND')) and (Name like 'U1_Isolator2*') // the star character allows select the pads of the component
Here's the result:
It's better but I still have violations on tracks going to the isolator. I tried to check only on polygons with this expression:
(InNetClass('HV') or InNet('GND')) and IsPolygon
With this query, the "test queries" button returns a correct set of objects but if I click ok to close the design rule window, I get this message:
Based on these experiments, I have 2 questions:
Why is last query valid when I test it and not when closing the design rule window?
How can I achieve my goal?
AI: From Altium Documentation:
https://www.altium.com/documentation/altium-designer/query-lang-pcbfunctions-objecttypechecks-ispolygonispolygon-ad
When defining an Electrical Clearance rule for polygon pours, you must use the InPolygon (or InPoly) attribute check, rather than the IsPolygon (or IsPoly) object type check. This is because the clearance rules operate on the primitives (regions, tracks and arcs) that make up, or are in the polygon pour, rather than the polygon pour as a whole object. A valid clearance rule for polygon pours would be between InPolygon objects and All other objects.
|
H: How to simulate series capacitors in CircuitLab?
I am reading through the book Practical Electronics for Inventors, specifically the section on capacitors. I read that capacitors in series will an have equivalent capacitance C with formula
$$
C=(1/C_1 + 1/C_2 + ... + 1/C_n)^{-1}
$$
If we connect some capacitors in series to a voltage source Vs and let the capacitors charge up, the voltage drop across each capacitor will depend on the ratio of the individual capacitor to the equivalent series capacitance. The voltage drop across any of the capacitors is
\$V_i = \frac{C}{C_i}V_s\$
The author gives the following example problem:
Using the equations above, the equivalent capacitance is C=0.91 microfarads and V1 = 136 V, V2 = 14 V. However, when I try to simulate this circuit in CircuitLab, I don't get the same result. No matter what I do, CircuitLab says there will be a 75V drop across the first capacitor. How can I replicate the textbook result in CircuitLab?
AI: (CircuitLab developer here.) The problem is that you are evaluating at DC. You're unexpectedly seeing \$V(\text{B})=75 = \frac {1} {2} V(\text{A})\$. This happens because the simulator knows that \$V(\text{B})\$ is a floating node at DC (because capacitors look like open circuits at DC), and so in order to solve the circuit, it treats all capacitors as having some very high equivalent resistance. (In the SPICE world this would be called GMIN, a minimum conductance.) C1 and C2, while having different capacitances, have the same very large equivalent resistance at DC for this convergence approach, so without anything else affecting node B, they form a resistive voltage divider and you get 75 volts.
qrk's approach is correct: use a time-domain simulation (or frequency domain) to see the intended result.
In the time domain:
simulate this circuit – Schematic created using CircuitLab
You can open and run the simulation above and you'll get:
A frequency-domain simulation with V1 as the input source will give a similar result.
|
H: How to tweak my stereo bluetooth amplifier into mono
First of all I'd like to thank anyone who's going to spend time reading (and answering) this.
I'm a confirmed software developer and a fellow user of stackoverflow, who knows how boring it can be to come across a "stupid" question. I know how it feels to disagree with the accepted answer yet not taking the time to explain why it's wrong (nothing to be proud of).
My issue
I have a mono speakers setup at home, and bought a Bluetooh stereo amplifier. I couldn't find a mono Bluetooth amplifier.
I read here and there that merging left and right was wrong then bought a stereo to mono converter, I put it between my amplifier and my speakers (small 8 Ohm passive ceiling speakers) but that didn't work.
As a complete newbie in electrical engineering and hifi systems, I googled a lot and understood more or less why my setup wasn't working. To put it simply, the stereo merging implies much more impedance than my speakers, in order to make the left-to-right/right-to-left draw insignificant.
If I got it right, merging HAS to be done before amplifying.
Questions
1. Formula anyone ???
I've seen various wiring diagrams to merge stereo to mono. I TOTALLY GET why resistors are needed. However, from a diagram to another you'll se different resistor values... HOW do I find out what the value of my resistors has to be ?
2. Shut up and take my money
If I'd buy an additional (mono) amplifier and put it so that my system looks like :
BT amplifier -> stereo-to-mono mixer -> mono amplifier -> speakers.
Would it just... work ?
3. DIY
Here's two photos of my BT stereo amplifier PCB. Where should (could) I solder the resistors and merge left and right, if possible ?
AI: Can you wield a soldering iron? Do you have any test gear, e.g. a multimeter?
Anyhoo, you need to merge the signal where it gets out of the bluetooth module, which fortunately is a standard type- here it is on Banggood on a little motherboard
https://uk.banggood.com/QCC3003-bluetooth-Audio-Module-Stereo-bluetooth-5_0-Receiver-Analog-I2S-Output-DIY-Speaker-Amplifier-Board-p-1741875.html
We can see from the nice big pictures that the audio outs come out, if we arrange it so that the square IC is at the top and the rectangular one at the bottom, on the topmost four connections on the right hand set of outputs. I've ringed them in red.
It then appears that they go to what looks like a standard stereo op amp (5532) where the two channel outputs should be the two pins I've indicated with white arrows.
With this info the next step would be to break the tracks leading from those outputs and inserting a resistor network to merge them, but we really should confirm that there's audio coming out of those two pins before proceeding, because we're getting into the difficult to reverse changes state at that point. Or, thinking about it, the two inputs to the power amp section ought to have resistors setting an input impedance and we could take another pair of resistors of the same value, cross connected.
Anyway, first step would be to confirm that there's audio at those white arrows.
|
H: How can we determine if a system is time invariant or not?
I am trying to figure out if the system in the diagram (part a) is time knvariant or not. When the input is shifted the output is shifted as well, so I am thinking the system is time invariant, but I wanted to ask for help to get more concrete proof.
AI: For continuous time:
A system is time-invariant, if the coefficients of the differential equation describing the system are constants. That is, they don't depend on time.
$$\ddot{y}+2\dot{y}+8=0 \: \: \: \: \: \text{time-invariant}$$
$$\ddot{y}+2t\dot{y}+8t=0 \: \: \: \: \text{time-variant} $$
For discrete time:
A system is time-invariant, if the coefficients of the difference equation describing the system are constants.
$$y(n+2) = -2y(n+1)-8 \: \: \: \: \text{time-invariant}$$
$$y(n+2) = -2ny(n+1) -8n \: \: \: \: \text{time-variant} $$
In your exercise, the system is described through the system's impulse response \$h(n)\$ and is clearly time-invariant.
|
H: Does this circuit work to switch a load with a microcontroller?
I want to create a circuit to switch loads (e.g.: led lights).
Following requirements have to be met:
the load should keep it's state when the microcontroller goes to sleep/powers off
the load could have a different power source (e.g.: 12V)
the circuit should draw as less power as possible because it is powered by battery
I came up with following idea:
use a 555 timer in bistable mode to keep the state in deep sleep
use a irlz44n mosfet to switch the load
This is how my circuit looks right now:
Explanation of pins:
VCC will be 3.3V of my microcontroller (esp32)
GND is shared between 3.3V and GND of Load
TRG is connected to microcontroller GPIO to switch power on
RST is connected to microcontroller GPIO to switch power off
Load is connected to Power Source and load-components (e.g. LEDs)
Questions:
does this circuit work as expected
do i need a gate resistor?
do i need a gate source resistor? when i tired the mosfet standalone the output toggled when small voltages where applied (e.g. touching the pins) but i switched it with the timer this did not happen anymore
are the components chosen wisely?
how could i modify this to replace the LOAD pin with VIN and VOUT which is then connected to the load components?
AI: Your circuit isn't great. You need gate drive resistors, and mostly, the 555 is not the right chip if you want a latch, and it's painful when you need many.
So, instead, you could, if you have basic logic gates lying around, use a buffer¹ with its output fed back through a large resistor to its input, and the same input is connected to your microcontroller pin.
This assumes your microcontroller lets its outputs float when off. Pay attention to not accidentally back-feed the microcontroller this way!
You can, however, just buy Latches or Flipflops, depending on whether you want to have a clock input at which the output changes (ff) or not (latch).
For 0.40€ apiece for an octal latch, your 555 solution is way more complex and expensive - not only do you need the 555, you also need two MCU outputs per output; with an octal D-latch, you can work with 1 MCU GPIO per output, and one "latch enable" for all outputs combined. Other options involve a serial-in, parallel-out shift register (which means you can have as many outputs you want with 3 GPIOs), or, honestly:
Don't use an external latch at all. Your microcontroller has that integrated.
Simply never shut off your microcontroller, as if you're switching any significant load, then the current consumption of an idling or sleeping (fix your sleep mode, your MCU can do that, "I haven't found the way to use it properly" is not a good excuse!) MCU will not matter at all. E.g. your LED uses 50 mA. Your ESP32 in "light sleep mode" preserves its output states and uses 0.8 mA (datasheet, Table 6 on page 31), so 1.6% of the overall power. Forget about using external latching! You'll never notice the difference in battery lifetime!
You can even go to ESP32's deep sleep mode (espressif idf's gpio_hold_en(YOUR_GPIO); gpio_deep_sleep_hold_en(); allows you to do retain state, according to documentation), and then you're down in the microampere range – i.e. you could operate from a coin cell for years. So, seriously, you need none of this, but to figure out your software!
Overall recommendation
Add the ability to go into deep sleep mode to your firmware. The ESP framework by espressif does make that possible, and it allows the outputs to hold state while the microcontroller consumes < 100 µA.
Use logic-level MOSFETs. Your choice of MOSFET isn't great, you need something that fully turns on at 3.3 V.
Connect the gate of your MOSFET directly to your ESP32, through a gate resistor (quite possibly in the kΩ range)
Add a linear regulator to 3.3V (and Schottky diodes to avoid backfeeding, to both your battery and the regulators output) from your LED power source. So, as long as your LEDs have power, you don't need to worry about the MCU not having power to remain in a light or deep sleep mode.
Since you say this is battery-powered, review your overall power system design. Chances are you really only need one power source – for your LEDs, since they are the dominant consumer of power. If you've got a battery that powers these, chances are you have a switch-mode power supply already; make sure you're not doing something "interesting" like stepping up voltages (e.g. to 5V) to then linearly waste a lot of power again – the ESP32 needs no more than 3.3 V of VCC; every voltage above that just gets converted to heat internally.
Maybe you can even just completely shut down everything while that power source is not available – after all, nothing to light up without! In that case, store the output state you have in nonvolatile memory (the ESP32 comes with some) and restore on power-on; the user will never even know the ESP32 reset in between!
¹ alternatively: an AND where you tied one input to VCC, or an OR or XNOR where you tied one input to GND
|
H: Do transistors require heat sink if they are used only as a switch, and not as a dimmer?
Switching 12V2A, every 2 minutes, TIP122.
AI: The TIP122 is a Darlington transistor, which means its VCEsat is around 1 volt, not the fraction of a volt that you'd get with a single bipolar transistor or a MOSFET.
At 2 A and 1 V drop, it will be dissipating about 2 watts.
The TIP122 is available in a TO-220 package, which has a typical allowable dissipation of 2 watts at 25°C ambient. This is from the On-Semi datasheet
Without a heatsink therefore, you are right on the edge, running at 100% of what the data sheet estimates to be allowable. Most experienced engineers would regard 100% as too close to design a product around for reliability, but if you are a hobbyist doing a one-off, then maybe you could take the risk of having no margin. If your device has a higher VCEsat, or the ambient is above 25°C, then you are running at more than 100%.
It won't need much of a heatsink to bring its temperature down and give you some margin. Alternatively, a MOSFET would give you a very low voltage drop, and switch 2 A with no trouble, especially as you have 12 V available for the gate.
|
H: Where can I find the datasheet of LT706?
I found this Linear Technology chip with the marking "LT 706 4851". Does anyone know what kind of chip this is and/or where I can find the datasheet? I suspect it is in a SOIC-8 package and might be more than 15 years old.
Exclusions: LTC1706, LTC3706 and LTC7060 are sold in other packages. ADM706 would have VCC and GND tied together.
AI: Looks like an LTC485 RS-485 driver. The last character in 485I is the letter ‘I’ not a ‘1’, and tells you the temperature range (-40~85’C).
The 706 is likely the date code (maybe 7th month of 2006).
|
H: Does current flow from earth connected conductor in uniform electric field?
If we place a conductor inside of uniform external electric field then opposite charges will get induced on the both sides of conductor.
What if we connect two earth wire to each side, will continuous current will flow through the conductor?
As from the positive charge induced side will take electron from ground and negative charge induced side will eject electron so will a continuous flow of current be seen in this case?
AI: If we place a conductor inside of uniform external electric field then
opposite charges will get induced on the both sides of conductor.
At the point where the conductor begins on the left to where it ends on the right, the electric field inside the conductor is zero (a very good conductor). If the conductor isn't such a great conductor then there will be a small open circuit potential to be see but, if you try and short those sides out (via earth or just another conductor), that external short then causes the E-field insider to become close to zero.
You cannot transfer energy from a static electric field this way.
|
H: 2-to-4 demultiplexer/decoder active HIGH IC
I'm looking for an IC that takes a signal and sends it to one of four possible outputs. So I came across a 2-to-4 demultiplexer which does just that. 74139 series to be precise. However, they all seem to be active LOW and what I need is an active HIGH IC. It seems an IC should exist, however, I can't for the life of me find one. I understand that I can just invert the outputs using a 7404 IC, but I would like to use less chips if possible. It just seems to me that if an active LOW exists, then shouldn't an active HIGH option exist as well? I mean, anytime I come across an explanation of how a 2-to-4 demultiplexer works, they always show an active HIGH diagram rather than an active LOW. It's not the end of the world if it doesn't, but thought I'd ask here to see if anybody knows more about this. Thanks!
AI: It is certainly true that a decoder with active-high outputs could exist. I will assert that such a thing does exist, and defy anyone to prove me wrong.
You can't ask me to prove that I'm right by providing an example because that would make this a product recommendation, which is off-topic.
|
H: DC resistance on soldered PCB between power and ground
I have just finished soldering a PCB I made with a couple of components (Spartan 3e FPGA), and I was checking the DC resistance between my power rails and GND to make sure they were not shorted.
I measured 10kohms between 3v3 and GND, 5kohms between 2v5 and GND and 68ohms between 1v2 and GND.
68ohms is getting me worried but at the same time that's only 17mA of current.
The power rails are generated with LDOs.
Does anyone have any opinion on this ?
Note: I haven't plugged it in yet since I don't want everything to blow up...
AI: There are chips being powered by the power rails. They are not linear loads like resistors are so measuring resistance is quite useless. That only tells that there are no direct shorts between power rails.
Most likely the values mean that the circuit is fine.
|
H: How to assign 2 bits of 4 bit variable in Verilog HDL?
I have an 8-bit input variable "in" and a 4-bit input variable "f". How do I assign the first two bits of "f" to be the first two bits of "in", and the last two bits of "f" to be the last two bits of "in"?
For example if in = 10000011, f = 1011
something like
input [7:0] in;
input [3:0] f;
assign f = {in[1:2], in[7:8]};
The error is "value cannot be assigned to f"
Thanks!
(Verilog HDL, Quartus Prime Lite 20)
AI: I don't think you can assign to an input. Change f to an output or to some kind of local wire type.
|
H: Can there exist an arrangement of charge densities that creates a loop in the electric field lines of force?
Can there exist an arrangement of charge densities that creates a loop in the electric field lines of force?
In this answer, a poster writes:
Note 2 5/8: superconducting loop
A uniformly perfectly conducting loop poses some extra problems because inside the perfectly conducting material there cannot be any resultant electric field Etot. This means that the surface charge will redistribute in such a way as to produce a coulombian field Ecoul that completely obliterates Eind everywhere inside the ring.
If no net electric field could exist within a superconductor, then the London Equations, which reference the electric field within a superconductor would make no sense.
However, equally important is the fact that a fixed distribution of charge density cannot, no matter how arranged, bring about an electric field which contains a line of force which is a loop.
The electric field resulting from a distribution of charge density is conservative, and a conservative vector field cannot contain loops.
Since the electric field resulting from a distribution of charge density (what the poster refers to as the Coulombian field) cannot contain any loops, it cannot "completely obliterate" the electric field loops created by a time varying magnetic field.
Am I correct? Or incorrect?
Edit:
In a reply, @tobalt wrote:
The London equations posit that there is no current in the bulk of the superconducting body. Therefore, it has to be free of both E field (otherwise current would build up) and B field
I agree that an E field in a superconductor will cause a time varying current. However, I would like to see a reference for the claim that "there is no current in the bulk of the superconducting body[, t]herefore, it has to be free of [an] E field"
This paper, for example contradicts the notion that there cannot be an E field in the body of a superconductor.
We show that a London superconductor in a steady uniform external magnetic field must support an electric field in its interior. The existence of an electric field implies that a superconductor has a nonvanishing charge in its interior, a fact consistent with measurements of charge imbalance in steady-state superconductivity.
See also: this paper, and this paper
As a consequence the superconductor in its ground state is predicted to have a non-homogeneous charge distribution and an outward pointing electric field in its interior.
@tobalt responded that:
I just repeated what the London equations say. For magnetic field free interior, it would also be free of E field. It is also briefly mentioned in wiki below the introduction of the single London equation: A is zero in the bulk. Maybe that paper is referring to a nonideal situation, where there are non-SC volumes in the bulk, or where the magnetic field is present during the NC->SC transition and becomes eternally trapped.
I am not sufficiently knowledgeable at this point to determine whether the claimed E field within the body of a superconductors found in various papers violates or is consistent with the London Equations. So, I withdraw the claim that
If no net electric field could exist within a superconductor, then the London Equations, which reference the electric field within a superconductor would make no sense.
However, the main issue that I wish to resolve is the claim made in the referenced answer that
that the surface charge will redistribute in such a way as to produce a coulombian field Ecoul that completely obliterates Eind everywhere inside the ring.
I cannot see how a Coulomb field (an irrotational Electric field) could cancel a solenoidal/rotational Electric field, even if we restrict our attention to a single loop in the solenoid field.
AI: Can there exist an arrangement of charge densities that creates a loop in the electric field lines of force?
No.
This is easily seen as a direct consequence of Maxwell's laws, specifically Faraday's law of induction,
$$\nabla × \mathrm {\bf E} = -\frac{\partial \mathrm {\bf B}}{\partial t}$$
This states that the curl of the electric field must be zero in the absence of time-varying magnetic fields. If there is a loop in any field line, the curl must necessarily be nonzero near that loop.
As you are asking specifically about the case where there are only static charges, nothing can be time-varying, and so \$\nabla × \mathrm {\bf E} = \frac{\partial \mathrm {\bf B}}{\partial t} = 0\$ (not to mention the fact that only static charges implies that \$\mathrm{\bf B}\$ itself must also be zero).
|
H: Why do ultrasonic cleaner transducers usually have two piezoelectric discs (or rings)?
Most of the diagrams for them I've seen show that. Is it for the purpose of amplification, or some other reason?
AI: One reason is that piezoelectric elements must be polarized by a DC voltage after being fabricated. That voltage is proportional to the distance between the electrodes. Thus thinner elements can be polarized with lower voltages which is easier and safer. Also, when driving the elements, two of them stacked together and wired in parallel can be driven with a lower voltage then one element equal in thickness. This makes it easier to design the driving amplifier. Another reason is that the capacitance of the single element is much smaller than that of stacked elements in parallel. This lowers the impedance of the transducer again making it easier to drive and less effected by the capacitance of the connecting cable. In sonar transducers, the number of staked elements is much larger because of the higher power requirements.
|
H: How do you splice a micro USB cable to a USB cable?
I'm making a "heated vest" Christmas gift for my wife by adding heating elements to a "fashionable" vest. I've done this for others in the past:
Velcroed in this tiny power bank
Micro USB to USB adapter
Plugged into these heating pads which are sewn into the vest
The adapter (step 2) is bulky, so this time I:
verified it was working
severed the Micro USB cable and the USB cable
both cables have only two wires, so I soldered them together
it doesn't work :(
The USB has white and black wires. Micro USB has red and black. Initially I tried white-to-red, black-to-black. Didn't work. Switched them. Still didn't work. Bought a new battery & new cable, spliced them again - no luck. Both batteries were fully charged.
Is there some magic happening in the adapter that I could be missing? Any bright ideas?
AI: Figure 1. The solder has not wet the coated copper wire.
You haven't applied enough heat to melt the varnish coating on the copper coloured wire so you have no connection.
You need to either increase the temperature significantly or scrape the insulation off with some very find sand paper.
There may be other problems but I'd start here. Use a voltmeter to check for voltage at various points along the way.
|
H: What generates more heat: inverting to 0s or to 1s in Flash memory?
I was not able to find an answer via web search. The question came to my head after reading https://www.networkworld.com/article/3049428/humidity-not-heat-is-a-hard-drives-biggest-threat.html:
The report notes that large data center operators today can report
yearly Power Usage Effectiveness (PUE) of 1.1 to 1.2, meaning just 10%
to 20% of energy goes into non-compute efforts, like cooling.
I thought: "90% of energy is spent on computing, where energy spent on computing goes?" From my understanding of physics, some to heat, some to change in potential energy of computing devices. For SSD, which use Flash memory, it means using e.g. "Charge trap" to store data.
Which state of "charge trap" holds more potential energy?
Quantitatively, how change in that energy level compares to energy
dissipated as heat to change state of a trap?
P.S. I oversimplified I guess a bit, there are different technologies for flash, one cell can hold more than 2 states for some, still I hope to get a useful/interesting answer.
AI: There is a lot going on inside of an SSD aside from the actual NAND flash. So from an energy perspective, the amount that actually ends up inside of the floating gates during write operations is going to be absolutely miniscule. The transistors and their floating gates are optimized to be extremely small in order to increase the storage density, so small that adjacent cells actually interfere with each other, requiring the use of forward error correction, scrambling, and other pre-processing to "whiten" the data (in other words to make it look more like random data by ensuring an even mix of 1s and 0s and preventing long runs of 1s or 0s). I believe the parasitic capacitance of the bit lines is going to far exceed the capacitance of a single bit cell, so you're going to be expending far more energy charging up the bit line to the programming voltage during each write operation than you're going to store in the actual bit cell, by several orders of magnitude.
Edit: so far I have had no luck finding numbers for the capacitance of a single floating gate. However, I did find a paper with some numbers for the energy consumed while reading/writing a single page: https://cseweb.ucsd.edu/~swanson/papers/TransOnCAD2013.pdf (see table VII). Probably the most interesting number is the energy required to erase a page: 115.218 uJ for all 1, 115.229 for all 0. This is a difference of 11 nJ, for a page containing 2 KB or 16 Kb, which is around 670 fJ per bit. The main takeaway is that the energy required to program a page or read a page varies by many orders of magnitude more than the energy released during erase.
|
H: Desperate total beginner asking: How to wire tiny LEDs of different types for mini-sculpture "flame" effect?
I'm a bacteriologist-turned-info analyst-turned-retirement age craftsperson trying to figure out how to add a simple small LED part to my projects. I am doing very small wood sculptures (one is less than 2" tall) shaped a bit like layers of curled abstract leaf/petal shapes. I got the notion of doing a sort of flame effect inside of tiny (half inch or so) glass "bubble beads" to go into them.
I've searched through the StackExchange "similar questions", and I've tried to figure out "arduino", I am currently making my way through "Arduino for Dummies", trying to learn what I need if I used TinyCircuits and how to connect the parts - and have been trying to read up on "combined series and parallel CD circuits".
But I just can't "connect the dots" between what I've seen, and the admittedly absurdly simple thing I want to do.
So, I bought some really tiny -- maybe 1mm? -- "smd" type LEDs from Amazon. I tried to add a photo but was unsuccessful, so the description is that the "chip size" for all of them is given as "0805 (2012)"; I was thinking of simulating a flame by using "randomly"-fading of the following:
3 to maybe 5 Yellow___120-150mcd_____2V-2.2V_____20mA
1 or 2 Red______120-150mcd_____2V-2.2V_____20mA
and occasional flashes of
1 White____180-210mcd_____2V-3.2V_____20mA
I assume I'd have to do at least 3 strings of serial LEDs, with those strings connected in parallel.
I want to run them off of rechargable Lithium-Ion batteries; I do know that the TinyLily and the LilyPad use small "JS" connectors to run off of small-sized ones that I can also get on Amazon, which would be good because I can carve a small base to hold the electronics.
And that's as far as I can get. I had hoped to use something like the "lily"-type boards to connect a USB port, a Battery connection, a battery charger, all as a single unit, but I can't get from "one LED plus a battery connection", to what I want to do.
Meanwhile, if I actually need to get a mini-"perf"-board and do some soldering, I can do that if I know what components I need and how to plan the circuit, but again, there are simple examples, and then nothing in between those and examples far more complex than anything I'd even try to do.
I could probably just buy a bunch of "flameless candles" and gut them to use the working part, but I dislike unnecessarily adding junk to the landfill.
If anyone can give a link to any diagrams or references or instructions or something like "How to do DC LED effects" or some other intermediate DC-circuits book, that would also be great, because I am at such a complete loss, that any info would be a Holiday Miracle for me, Heh! ;)
Thank you!
Kris
AI: As long as you only need to simulate color-changing and flickering of the light source, and not actual motion, you only need a single RGB LED.
The greater challenge will be mounting the LED in your "bubble bead" and running wires (at least 3 to provide power, ground, and signal) to that from your microcontroller board.
Instead, think about using a ready-made microcontroller board that includes an RGB LED on it, and use a "light pipe" to carry the light into the center of your sculpture. You can make that with fiber optics, or just a rod of transparent acrylic plastic.
There are libraries for driving RGB LEDs from various microcontroller boards. Start at the Adafruit website, which has tutorials.
|
H: Impedence matching required for very short PCB trace?
I have a custom PCB using 50 ohm impedance antennas for GPS (1.575 GHz), GSM (2.4 GHz), and LoRa (868 MHz). Currently using an impedance matched board with matching track widths of 6 mil. One track goes through a capacitor (matching manufacturer's reference design). My U.fl connectors are VERY close to the pins on the RF chips, or in the case of the one with the capacitor, which is adjacent to the RF pin and U.fl connector on the other side. By "very close", I mean between 2 and 3 mm.
Since the RF pins are much wider than the impedance matched track anyway, and the capacitor pads are also wider, is there any actual benefit in using impedance matched tracks for these short lengths? Indeed, is it better to just match the width of the pins on the RF devices, all the way to the U.fl connector? I'm using a 4 layer design with layer 2 as the dedicated ground plane, 3 as power, and 1+4 as signals with no ground fills. All RF signals are on layer 1. I'm keeping all "noisy" signals well away from the RF side. I have tried to find some clarity on this but maybe missed something. My design seems to perform well for all 3 RF devices, but I'm always hoping to improve things if possible.
AI: That is a good question indeed, but the answer really depends on how much power you are willing to lose to the transmission line (TL) effects.
Different people use different rules of thumbs for the length of the line at which they start to worry about TL effects. I personally use 0.1\$\lambda\$ (10%) for signals and 0.01\$\lambda\$ (1%) for power. In a nutshell, for signals you can tolerate more voltage reflections as your receiver probably has a wide margin as to what it would interpret as a '0' or as a '1', thus the 10% benchmark -- think RS-485 for example . For power, however, as the TL exceeds the 1% benchmark, your 50 Ohm antenna doesn't look like 50 Ohms anymore and thus you have an impedance mismatch. See this question I posted some time ago and the answers for more background information on this.
In this situation, you care about power delivered to an antenna so I would still keep the impedance-controlled lines since at your worst case scenario (at 2.4GHz), the TL exceeds 0.01\$\lambda=1.2\text{mm}\$. By keeping your impedance at 50 Ohms, then the TL length becomes irrelevant, at least in theory.
Where did I get the 1% rule for power?
References: Fundamentals of Applied Electromagnetics 6/E, Ulaby|Michielssen|Ravaioli
|
H: Series or parallel LC in an AM radio?
All transistor radio circuits (not crystal) on the internet seem to use an antenna and parallel LC circuit. Why does no one use series LC circuits to select stations?
To my knowledge, series LC circuits at resonance let maximum current flow at resonant frequency. BJTs allow a current through their base control current from collector to emitter. Therefore, a higher base current could lead to greater amplification.
Experimentally, I have built the following schematic on a breadboard. I get much more audio output using antenna and series LC circuit over antenna and parallel LC.
Are other factors being considered for the choice to use parallel LC circuits in transistor radios?
My revised parallel LC circuit:
My initial series LC circuit:
AI: Why does no one use series LC circuits to select stations?
The selectivity of a series tuned circuit is inversely proportional to the series resistance, ie. the lower the resistance the higher the selectivity. This resistance includes the source (antenna) and load (amplifier input) resistances. That means to get good selectivity from a series tuned circuit the amplifier input impedance needs to be very low.
NOTE: the following refers to the schemetic you originally posted with series tuned input (1 mH inductor in series with 10-100 pF variable capacitor):-
Your inductor and capacitor values correspond to a resonant frequency of ~500 KHz (when the tuning capacitor is set to 100 pF). If the source impedance was 0 Ω and the load was 75 Ω then the -3 dB bandwidth would be ~14 kHz, which is reasonable selectivity for AM broadcast. But your amplifier input impedance is not 75 Ω, it is ~725 Ω, which greatly reduces the Q of the tuned circuit and increases its bandwidth to ~120 kHz. That's not good.
But it gets worse. A 1/4 wave 'whip' antenna with perfectly conducting ground plane has an impedance of ~37 Ω at resonance, but at AM broadcast frequencies the impedance of your 3 foot length of 'random wire' is much higher and almost totally capacitive, with a small value of ~6 pF. This causes the resonant frequency to increase to ~2 MHz. The tuning capacitor will have little effect because antenna capacitance dominates, making your series tuned 'station selector' practically useless.
The schematic you now present with parallel tuned circuit and higher Base bias resistor values is better, but still not great. The problem now is that the Q of a parallel tuned circuit is directly proprtional to parallel resistance, ie. the higher the resistance the higher the Q. With the higher value Base bias resistors your amplifier input impedance is ~7.2 kΩ, much better then 725 Ω but still quite low for this parallel tuned circuit. The bandwidth is still very wide at ~57 kHz. Amplifier input capacitance detunes it to a lower frequency of ~410 kHz, which may be OK on the low end of the band but could prevent you from tuning into stations at the higher end.
So what can you do? The short antenna works 'OK' coupled directly to the top of a parallel tuned circuit, but the amplifier input impedance is too low for good selectivity. To fix this you can either:-
Increase amplifier input impedance using a FET, or a BJT (Bipolar Junction Transistor) in Emitter Follower configuration. The ZN414 AM radio IC is an example of using BJTs this way.
Tap into the inductor winding or add another winding with fewer turns to make a transformer. With the correct turns ratio this can match the lower impedance of the amplifier to maximize power transfer without compromising the Q of the tuned circuit. If you use a longer antenna then this should also be coupled in the same way.
Here's an example of a 'crystal set' radio receiver using adjustable taps for both the antenna and detector:-
|
H: Capacitor between flyback diode and inductor
In my recent endevours in switching regulators I came to understand the need of a flyback diode in non-synchrounos regulators. From my experience with relays I know the flyback diode is placed in parallel with the coil.
What I don't understand is that in the regulators datasheets that I've looked so far, the flyback diode is placed in parallel with the inductor on the GND side, where there is a capacitor in parallel with the diode, instead of the diode being in parallel with the inductor 'directly', like shown below:
Doesn't the capacitor change the discharge behaviour?
Why does this work at all considering that the two plates of the capacitors don't physically touch, and so can't allow current to flow and thus dissipate?
Thanks.
AI: Diodes are used with inductors, but for different reasons in different circuits.
When suppressing a relay coil, the relay EMF generated when the current is switched off is unwanted, and all we want to do is channel it somewhere so that the energy won't do damage to the driving transistor.
When used in a buck converter, the coil EMF is wanted, and we want to route it to the output filter capacitor, where the energy can be usefully used to drive a load.
With the diode in your position, the energy is harmlessly dissipated in the diode and coil resistance. Safe, but useless as a power supply.
|
H: PGND and GND connection on voltage regulator
I am using TS30042-M033QFNR step-down voltage regulator.
The datasheet states to connect all the PGND pads together and then use vias to go to the 'general' GND plane on the back of the PCB.
In my design however, the 'general' GND plane is on the same side as the TS30042, so my question is, can I connect the PGND pads directly to the plane or do I have to separate them, and use a cluster of via to connect to a GND plane on the back (which I need anyway for thermal management) and then use stitching vias to re-connected to the main GND plane?
My understanding is that the two grounds have different purposes and thus must be connected only at one single point and thats the reason for the vias.
I am currently using the second alternative:
Edit: As requested my schematic and datasheet.
Is this a good design or not?
Thanks
AI: This is the current paths in the hot loop. I used red for toplayer and blue for bottom.
The output hot loop is similar:
There is no ground plane, so the paths for ground current are much longer than they need to be, which means high emissions, and possibly not working at all.
In addition, the thermal path from the thermal pad to copper on bottom layer is obstructed, so the chip will be hotter than necessary.
If you can put SMDs on both sides, the simplest is to keep a ground plane on top layer, and use the datasheet recommended layout on bottom layer.
If you have to put all SMDs on top, then a fat ground pour on the bottom to link the chip's ground thermal pad to the ground plane would be an option:
But this won't give proper cooling.
Normally when using SMDs, components and traces are on the same side, say top, otherwise you'd need vias everywhere. So there can be no ground plane on top because there are components and traces everywhere, it has to be on the other layer instead, usually bottom. So perhaps the root cause of this problem is that the "ground plane" is on the wrong side of the board, which means it's not a ground plane anymore, because there are traces and components in it, so it can't be reasonably unbroken.
If you have a mix of SMDs and thru hole, you can put the thru holes on one side and SMDs on the other side. That makes the board wave-solderable, and much easier to rework and prototype, because the large thru-hole parts don't get in the way when accessing SMDs.
You can also reduce capacitance on SW node by thinning some traces:
|
H: Powering PCB with USB and adapter
I have working systems and I want to make a PCB for it. My system needs 24V (for stepper and relay) and 9V for RFID and 5V (for ADC reads) and 3.3 V for ethernet. I am using 2 switch regulator 24->12, 12->5 and I am using 2 linear voltage regulator 12->9 and 5-> 3.3V. I have two question about it.
My system needs USB for code upload. So I need to use USB cable at least one time. Then, I will use these regulators for powering. I have schematic here:
What I want to ask is; when I try to upload code to microcontroller, I won't plugged 24V adepter. I will upload code through to USB cable so will V_USB cause something? When I use micro USB, V_USB will equal 5V. So 5V output power will cause something for R-78E5-0.5 (top of the right)?
I am asking because I made small experiment. I used ld1337. I connected 3.3V to OUTPUT and GND to GND. I measured 2.64V on INPUT.
AI: when I try to upload code to microcontroller, I won't plugged 24V adepter.
You will forget and it will happen. It always happens.
I will upload code through to USB cable so will V_USB cause something ?
You need a diode between V_USB and internal +5V to make sure that your board DOES NOT send +5V into the PC's USB port. Under some conditions that can blow the chip behind the PC's port. A schottky diode rated for 500mA is a good option.
This means, when your board is powered from USB only, your +5V will only be about +4.5V, but that's not a problem because from what I understand from the question, the board needs +24V to actually run.
When I use micro USB, V_USB will equal 5V. So 5V output power will cause something for R-78E5-0.5 (top of the right)?
It's a switching regulator, so the internal MOSFET has a diode between output and input. So, if the output is powered at 4.5V from the USB port through the diode, this will raise +12V to about 4V, and the same will happen with the other DC-DC, so the +24V line will get about 3.5V.
I have the exact same thing happening on a board, with the same Recom DC-DCs. It's not a problem at all, the DC-DCs don't care. However, if there is a load on your +12V or +24V that decides to draw a lot of current, that may exceed what the USB port can deliver and then it won't work. Or some of the chips may not work at all with such a low power supply voltage.
Your LDO is different from the DC-DCs, if it doesn't have a MOSFET with a body diode as a pass device, then it should not be powered from its output. NCP1117 datasheet, page 10 top left, says you shouldn't worry because it has an internal protection diode.
Another problem if you use USB to program your micro while the board is unpowered is that the micro will then boot and send some IO signals to the other chips that are unpowered. This could power them from their inputs through the protection diodes, and this can cause damage.
So you could, for example, add a reset chip to keep the micro in reset if +24V is not at the correct voltage. Or you could do it in software, check +24V with the ADC, and if it is not satisfactory, print something on the serial port and wait, instead of sending active IO to the unpowered chips. Hardware reset chip is more reliable, of course.
|
H: How to calculate the gain of a non-inverting opamp with a transistor?
I have a question about this circuit. How do i rearrange the formula to calculate the voltage gain of this opamp with a transistor:
I know the formula for the gain of a non-inverting opamp like in the next picture :
and it is, Av = 1 + (R1/R2) (the gain).
But in the first circuit the resistor connected to ground is not there anymore, it is switched to the other side of R2.
So is the formula for gain now, Av = 1+(R2/0), so that the gain is 1 ?
and does the opamp in the first example now act as a voltage follower, so that the voltage is the same on Vout of the opamp ?
So that the base of the transistor gets a current of : I = (5V/R1).
Like this circuit :
AI: But in the first circuit the resistor connected to ground is not there
anymore, it is switched to the other side of R2.
It isn't switched anywhere; it becomes \$\infty\text{ }\Omega\$
So is the formula for gain now, Av = 1+(R2/0), so that the gain is 1 ?
It is a gain of 1 but you made the resistor zero in your formula. It should be made \$\infty\text{ }\Omega\$ not zero.
and does the opamp in the first example now act as a voltage follower,
so that the voltage is the same on Vout of the opamp ?
Not quite; once R2 has extended to the emitter of the BJT, the emitter becomes the "new" output and, this means that the voltage across RL equals Ub: -
And, because the op-amp inputs are very high impedance, you can also short out R2 (doesn't affect the gain formula).
In other words, you have made a unity gain buffer amplifier that can supply a lot more load current into RL because of the transistor. Any BJT imperfections (such as volt drop from base the emitter) are "inside" (or within) the feedback loop and the op-amp tries its very best to make the voltage across RL equal to Ub.
|
H: Signals and systems - Find the inverse Fourier transform of a RLC circuit
I was analyzing the following RLC circuit:
And applying the Fourier transform on the circuit, I ended up with the following transfer function:
$$
H(\omega)=\frac{V_c(\omega)}{V_i(\omega)}=\frac{1}{1+CR(j\omega)+LC(j\omega)^2}
$$
Now I want to do the inverse Fourier transform in that function:
$$
h(t)=F^{-1}\{H(\omega)\}
\\
h(t)=f(R,L,C,t)
$$
but I can't find any table that has an equation similar to this one. I also know that I can find a similar equation by doing partial fractions, but I can't find a way to solve this function by partial fractions.
AI: I'm curious why didn't anybody mention partial fraction decomposition yet.
First of all, you have to keep in mind that \$\mathcal{F\{}\}\neq\mathcal{L\{}\}\$. The transfer function is defined as \$H(s):=\mathcal{L}\{h(t)\}=\mathcal{L}\{Y\{\delta(t)\}\}=\frac{\mathcal{L}\{y(t)\}}{\mathcal{L}\{u(t)\}}\$. What you have derived using the F-transform is another beast, I'm not sure about the correct English terminology of it, but it was called "transfer characteristic" in my (not English) course. You have \$H(j\omega)=\frac{\mathcal{F}\{y(t)\}}{\mathcal{F}\{u(t)\}}\$ In most well-behaved cases, the two are very similar, and could be used so, if you do a \$j\omega\Leftrightarrow s\$ substitution - but that only applies if the system is casual (so \$h(t<0)\equiv0\$), and the system is BIBO-stable (\$\int{h(t)dt}<\infty\$). Even then, you have to remember that \$\mathcal{F}\$ is used in periodic steady state analysis, and \$\mathcal{L}\$ is used with casual systems and if \$u(t<0)\equiv0\$ (again I can't find the correct English terminology, it was called "entering" signal on my course).
So all of that in mind, since your system can be considered as BIBO-stable and casual (BIBO-stable because it's only built from passives), you can swap \$H(j\omega)\$ for \$H(s)\$.
Your task is to find the impulse response. That can be done by inverse Laplace transforming \$H(s)\$. Your transfer function is not something you could inverse transform by hand (but tools like matlab, octave or mathematica can do it for you anyway), so in practical problems we usually do a partial fraction decomposition (waaay easier when we have numbers for \$R\$,\$L\$ or \$C\$, but still possible). For that, you could use the Heaviside cover-up method, but not necessary (and again, it works best when you have numbers).
From your transfer function, you'd get two fractional parts: \$\frac{A}{s-B}+\frac{A^*}{s-B^*}\$. From the table of \$\mathcal{L}\$, you can now inverse-transform them to be \$\varepsilon(t)(Ae^{(Bt)}+A^*e^{(B^* t)})\$. You can leave that in that form, but usually it's better to write \$A=|A|e^{j\phi}\$ and then separating the real and imaginary parts of \$B\$ to bring the result into a form of an entering damped sinusoid signal.
|
H: Variables in LT Spice Value
Is it possible to add a variable into the value of a component in LT spice? I'd like to simulate a resistor divider to look at current consumption but keep the ratio of the resistances the same.
I tried setting R1 to {X} and R2 to {X*1.5} but couldn't get it to work correctly. Haven't found the solution on Google and haven't been able to successfully run it. Maybe I need to define X somewhere.
AI: R1 won't accept 1.5*Rx directly but it can be assigned to a variable. Rx can be used in the .step param statement.
|
H: 1-5 MHz PWM signal generating but how?
I need to generate a PWM signal that I could change the frequency of it between 1 MHz and 5 MHz. I don't know how to do it. And I have to change the amplitude of PWM between 6-10 V.
So I thought that I could use a MOSFET and MOSFEET DRIVER. I could drive MOSFET DRIVER by using STM32 microcontroller. But what kind of MOSFET should I use and in terms of frequency which parameters should I care while choosing MOSFET that could switch in those frequency range.
Thank you so much! Please mind that I'm a student so kind of new for designing this circuits.
AI: As far as generating (your question) a logic-level signal with that resolution, there are some MCUs which combine analog and digital techniques to (say) generate a 2MHz PWM with 11 bits of resolution. That's a resolution of 180ps. Picoseconds.
Doing something useful with that logic-level output is another matter- there will be propagation delays and rise/fall times in whatever the logic-level output is connected to. Maybe a fast MOSFET driver with a lightly loaded output would work for you, you would have to compare your requirements (which you have not fully divulged) with what the chips can do. Typically tens of nanoseconds delay and rise/fall so you won't get the same waveform out of the driver as goes in.
You might want to add a bit more to your question as to what you are actually planning on doing with the PWM. PWM is a great solution for some problems, but if you get too high (or too low) in frequency it can become difficult, uneconomic, impractical or even impossible to use it.
|
H: Reduce current through a pull-down resistor when chip power is removed
For a battery-powered application, I'm trying to reduce the current draw of a chip when its voltage rail is removed.
What is the current through the enable pin's pull-down resistor when the 5V USB-supplied rail is removed? In particular, I'm using this TPS62A01 step-down converter as shown here with a 1MΩ pull-down.
Can I base the pull-down resistor value on the enable input leakage current from the datasheet as explained here? Chosing a pulldown resistor
Or should I base it off the max shutdown current as suggested here? Pull-Down / Pull-Up Resistor value for minimum current leakage
My thinking for the 1MΩ resistor value is based on the enable input leakage of 100 nA: Ven = 100nA * 1MΩ = 0.1V which is less than the enable voltage threshold.
AI: What is the current through the enable pin's pull-down resistor when
the 5V USB-supplied rail is removed?
Well, when you remove that power source, you also remove it from the chips power pin (pin 3) hence, the chip and pull down resistor are totally isolated from any power source and, there is no leakage current argument to make.
My thinking for the 1MΩ resistor value is based on the enable input
leakage of 100 nA: Ven = 100nA * 1MΩ = 0.1V which is less than the
enable voltage threshold.
When the chip is powered then, the current through the 1 MΩ resistor is 5 μA.
|
H: Externally triggered high impedance toggle for large number of parallel lines
First, I want to apologize for my terminology here -- I'm a software engineer rather than EE and I'm a bit rusty.
I have a parallel SRAM chip that is being shared by 2 CPUs that requires 19 address lines and 16 data lines. This setup is a producer-consumer model, where 1 CPU only writes, and the other CPU only reads, and they trigger interrupts on each other through an external pin to signal that the data is ready to be read/is done being read. I'm sending about 40KB of memory every 20ms, and the consumer device requires a 100ns response time for reads.
Both CPUs are therefore using the same bus. I am able to set the producer CPU's pins to high impedance through software during reads, but the "consumer" CPU doesn't support that (and in-fact I have little control over it -- it isn't even aware that there is a producer, it just thinks it is reading a standard ROM chip). So, I need the "producer" CPU to be able to set all of those lines from the "consumer" CPU to high impedance during writes (basically implementing the OE functionality on memory chips) otherwise, my understanding is that my writes will be lost since the other CPU will act as a short circuit even if all address and data lines are set to low during the write.
What type of component do I use to add tri-state support to existing bus lines while breadboarding this out? Are there options that don't require wiring up a component for each line (say, a large switchboard that I can turn all lines "off" with a single input)?
Thanks
AI: The classical way to do this is with Tri-state bus buffer ICs such as the 74xx244 or 74xx541 (where xx is LS, HC, HCT, LVC etc.), which have 8 buffers enabled by 1 or 2 control inputs. To do 19 address lines you would need 3 of them. Buffer ICs with more bits are also available (such as the 74ACT16244 which has 16 bits) but for various reasons it might be better to stick with 'standard' 8 bit ICs. If you only need a few more then adding an IC with fewer buffers (eg. 74xx125 which has 4 buffers) may be sufficient to get the total number you need.
If there are other devices on the 'consumer' data bus then you will probably also need Tri-state buffers on the data lines. For this you could use two 8 bit buffer ICs or a single 16 bit buffer IC.
|
H: Bringing an oscilloscope through the airport
My university loaned us some oscilloscopes (Picoscope 2206B) to use in our free time. In a couple days I have to travel to my hometown for the holidays by plane. To make the most of my free time, I want to take the oscilloscope with me, meaning that I will have to carry it on the flight.
Does it make more sense to put it in my bag, my carry-on baggage or my checked baggage?
Is there anything I have to look out for?
Will it create any problems when passing through security?
Are there any chances that its functionality may be affected by X-rays?
I am aware that the question is rather silly and possibly even off-topic, but the oscilloscope is not mine and the last thing I want is to damage it.
AI: Does it make more sense to put it in my bag, my carry-on baggage or my checked baggage?
It's quite small (13 cm x 10.5 cm), so you can put it anywhere you want. However...
Is there anything I have to look out for?
Will it create any problems when passing through security?
When your bag(s) pass through x-ray the officers may notice it (especially if it has probes with it) so they may want you to open the bag and show the product and even explain its purpose. If you have a laptop I personally recommend you to keep the scope and its related parts in your laptop bag so that the officers think that those are part of your laptop and may ignore it during x-ray checks. Some officers are quite sensitive to some tools such as screw drivers. So, a small chance but the officers may treat the scope's probes as screwdrivers because of their shape :)
Are there any chances that its functionality may be affected by X-rays?
Nope. At least, I don't think so. I took a Fluke battery-operated handheld scope and a Fluke battery-operated handheld power analyser with me to the airplane twice in the same day. Nothing happened.
|
H: Read MPU6050 over I2C with STM32 nucleo board
I am working with a NUCLEO-F401RE board and I want to connect the accelerometer sensor MPU6050 (on a GY-521 module). The device can be connected to the board over I2C.
I connected the 3.3V of the board to VCC, GND to GND, SDA to PB9 and SCL to PB8.
I also tried to connect pull up resistor (10k) between VCC and SDA and VCC & SCL.
With the code below, I am trying to see if the device is connected however, the code desperately returns HAL_ERROR status code 1.
More specifically, this line HAL_I2C_IsDeviceReady(&hi2c1, MPU6050_ADDR, 10, i2c_timeout) return the code 1 that corresponds to HAL_StatusTypeDef HAL_ERROR
I did try with 3 different devices and all behave the same way.
When I try to read WHO_AM_I_REG (register 0x75) I am getting 0.
What am I doing wrong ?
#include "stm32f4xx_hal.h"
#include "uart.h"
#include <stdio.h>
#define SMPLRT_DIV_REG 0x19
#define GYRO_CONFIG_REG 0x1B
#define ACCEL_CONFIG_REG 0x1C
#define ACCEL_XOUT_H_REG 0x3B
#define TEMP_OUT_H_REG 0x41
#define GYRO_XOUT_H_REG 0x43
#define PWR_MGMT_1_REG 0x6B
#define WHO_AM_I_REG 0x75
I2C_HandleTypeDef hi2c1;
void i2c1_init(void);
void MPU6050_Init(void);
// Setup MPU6050
#define MPU6050_ADDR (0x68 << 1) // 0xD0
const uint16_t i2c_timeout = 100;
int main() {
HAL_Init();
i2c1_init();
uart_init();
MPU6050_Init();
while (1) {
}
}
void i2c1_init(void) {
/*
* PB8 --> I2C1_SCL
* PB9 --> I2C1_SDA
*/
GPIO_InitTypeDef GPIO_InitStruct;
__HAL_RCC_GPIOB_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_8 | GPIO_PIN_9;
GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; // alternate function - open drain
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF4_I2C1;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
// Remap I2C1 pins
//__HAL_RCC_AFIO_CLK_ENABLE();
//__HAL_AFIO_REMAP_I2C1_ENABLE();
// Configure I2C
__HAL_RCC_I2C1_CLK_ENABLE();
__HAL_RCC_I2C1_FORCE_RESET();
HAL_Delay(2);
__HAL_RCC_I2C1_RELEASE_RESET();
hi2c1.Instance = I2C1;
hi2c1.Init.ClockSpeed = 100000;
hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2; // half-high, half low
hi2c1.Init.OwnAddress1 = 0;
hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
if (HAL_I2C_Init(&hi2c1) != HAL_OK) {
printf("Error setting up the I2C !\n");
}
}
void MPU6050_Init(void) {
uint8_t check, Data;
HAL_StatusTypeDef status = HAL_I2C_IsDeviceReady(&hi2c1, MPU6050_ADDR, 10,
i2c_timeout);
if (status != HAL_OK) {
printf("Is Ready: %d \n", status);
}
// check device ID WHO_AM_I
HAL_I2C_Mem_Read(&hi2c1, MPU6050_ADDR, WHO_AM_I_REG, 1, &check, 1, 1000);
if (check == 104) // 0x68 will be returned by the sensor if everything goes well
{
// power management register 0X6B we should write all 0's to wake the sensor up
Data = 0;
HAL_I2C_Mem_Write(&hi2c1, MPU6050_ADDR, PWR_MGMT_1_REG, 1, &Data, 1,
i2c_timeout);
// Set DATA RATE of 1KHz by writing SMPLRT_DIV register
Data = 0x07;
HAL_I2C_Mem_Write(&hi2c1, MPU6050_ADDR, SMPLRT_DIV_REG, 1, &Data, 1,
i2c_timeout);
// Set accelerometer configuration in ACCEL_CONFIG Register
// XA_ST=0; YA_ST=0; ZA_ST=0; FS_SEL=0 -> +: 2g
Data = 0x00;
HAL_I2C_Mem_Write(&hi2c1, MPU6050_ADDR, ACCEL_CONFIG_REG, 1, &Data, 1,
i2c_timeout);
// Set Guroscopic configuration in GYRO_CONFIG Register
// XG_ST=0; YG_ST=0; ZG_ST=0; FS_SEL=0 -> +/- 250 °/s
Data = 0x00;
HAL_I2C_Mem_Write(&hi2c1, MPU6050_ADDR, GYRO_CONFIG_REG, 1, &Data, 1,
i2c_timeout);
}
}
void SysTick_Handler(void) {
HAL_IncTick();
}
AI: You are using the wrong pins on the Nucleo.
You have connected to PC8 and PC6, not to PB8 and PB9.
|
H: Energy of capacitors in series
I have a big 500 F 2.7 V capacitor, and a module of six 120 F 2.7 V capacitors. If I calculated the capacitance correctly, the module has 20F total capacity.
If I calculate the energy stored in them by E = 0.5 * C * V^2, I get:
For the module: E = 0.5 * 20 * 16.2^2 = 2624 J
For the big cap: E = 0.5 * 500 * 2.7^2 = 1822 J
So far, so good.
I bought a battery tester device and charged the capacitors to 2.7 V and 15 V, respectively (my DC source only goes to 15 V), and I've connected them like a battery to the tester device. I set 0.5 V as the lower cutoff voltage. The results I got are:
The module yielded about 58 mAh.
The big cap yielded about 220 mAh.
These results are in the ballbark of what an "Ah equivalence" equation, Ah = Farads * DeltaVolts / 3600 gives, but both the measurements and this equation are in conflict with the capacitor energy equation, which shows the energy stored in the module should be greater than in the big cap. The battery tester puts the current through a (constant) resistor, so it should be fairly simple as far as calculations go.
So my question is: how to reconcile the two?
AI: Your calculations are consistent, though your measurements of capacity look a bit low.
The 20F, 16.2v capacitor stores 20*16.2 = 324 Coulombs, 324 Ampere seconds, or about 0.09 ampere hours. As you correctly calculate, 2624 Joules.
The 500F, 2.7v capacitor stores 500*2.7 = 1350 Coulombs, 1350 ampere seconds, 0.375 ampere hours. As you say, 1822 Joules.
You can also get the capacitor energy by multiplying the charge stored by the average voltage. So for the 20F cap, 324C * 8.1v = 2624 Joules, and the 500F cap, 1350C * 1.35v = 1822J. This is actually the same equation as \$0.5CV^2\$, but it's easier to see how energy depends on both voltage and charge stored.
As you can see, energy is related to ampere hours through voltage. They are different voltage caps, so you would expect the higher voltage cap to have a higher energy to charge stored ratio.
As an interesting thought experiment, let's connect the series capacitors in parallel. Now it should be easier to compare what's happening. You have a 720F cap and a 500F cap, both rated at 2.7v. You would hope they store the same energy as before with the series connection.
\$0.5CV^2\$ for each gives 0.5*2.7*2.7*720 = 2624J, and 0.5*2.7*2.7*500 = 1824J, as before. Yes, the energy sum comes out exactly as before.
However, now the charge in the 720F is 2.7v * 720F = 1944C. The energy is the same, but as the voltage is lower, the charge is higher.
When capacitors are in series, the same charge passes through each. The total charge in the whole series string is the same as for one capacitor. When capacitors are in parallel, the charges add, just like current does.
The same thing confuses people with batteries, especially Lithiums sold as series blocks!
|
H: Adding offset voltage to sensor signal
I have a pressure transducer outputting 0-5V which is sampled by an ADC with a 0.5V minimum input voltage. I need to offset the sensor output voltage by a fixed voltage of 0.5V. I've looked at an op amp circuit for doing this. But I struggle with finding a practical way of generating a reference offset voltage that is temperature stable (I'm not sure about using a resistor divider down from Vdd).
Any ideas would be appreciated.
Incidentally, the upper limit of the ADC is irrelevant, as we will never get an output signal in that range. Therefore, I want unity gain.
AI: My first reaction is to get a better A/D converter. There are many many out there that can directly convert from the 0 to 5 V range.
You didn't say what the upper end of the A/D range is, but if it's 5 V, then you don't want to add a offset, but rather scale the signal towards 5 V. Put another way, you want to map 0 to 5 V --> 500 mV to 5 V. That's not adding a offset.
Fortunately, scaling relative to 5 V is easier than adding a offset. All you need is two resistors:
|
H: Class AB amplifier conduction angle
This is a beginner's theoretical question. I was looking at the figures on this site: http://www.electronics-tutorials.ws/amplifier/amp_6.html and noticed that the so called "conducting angle" of a class AB amplifier is given this way:
It is said to conduct between 180° and 360°. What I don't understand is that the output signal is coming from two transistors, additive. I see that a single trasistor in the pair does not conduct in the full 360° range. But the amplifier as a whole does conduct at any angle right? The transfer function of the amplifier won't be a straight line (obviously), but I don't see where the signal is clipped. Please help me understand.
UPDATE: here is a graph showing two functions:
f(x) = min(-0.6, sin(x))
g(x) = max(0.6, sin(x))
I believe that the response of the whole amp to a sinusoidal input is something like f(x)+g(x)
AI: Judging from the single diagram you post, run away from those web pages.
It seems they've managed to make a simple concept difficult to understand, and got it wrong in the process. What it appears that diagram is trying to show is how one of the transistors operates. However, what they are showing is class B operation, not class AB.
In class B, each transistor only conducts for exactly half the cycle, as shown. In class AB, there is a little crossover between the two transistors. Exactly in the middle, they are both conducting some. In the diagram you show, point Q should really be moved to the left a little, and the "output signal" biased up a little.
Added
Yes, your new diagram now shows true class AB behavior.
|
H: 27 pin Arduino Microcontroller
I have to solder a microcontroller that belongs to an Arduino Uno to a PCB. The Arduino uno uses the Atmega328p which has 28 pins. On the pcb I have, i see only 27 pins for the microcontroller.
Could i still somehow be able to place the 28 pin microcontroller on this PCB? Or should i make a new PCB with the 28 pins for the microcontroller?
Doing some research i found this footprint package:
https://easyeda.com/component/ATMEGA328P_PDIP_EZ-BbicICwO6
I also never knew a 27 pin microcontroller existed or the footprint at least..
Thanks!
P.S I dont need all the 28 pins for the project.
AI: On the pcb I have, i see only 27 pins for the microcontroller
This is very hard to believe, unless some idiot designed the board. Even if only 27 pins are actually used in a circuit, any competent board designer will put down the pads for all 28 pins. Pads are not only for making electrical connections, but also to mechanically anchor the part. Granted, holding something like a 28 pin SOIC package by 27 pins should be good enough mechanically, but there is no downside to placing all 28 pads.
If the board really only has 27 pads for your 28 pin chip, then bend up the one pin that doesn't have a pad and solder down the rest normally.
Added
Wow, that really is a 27 pin footprint for a 28 pin part! And, it's thru hole, and gold-plated. Find out who designed this and stay away from anything else he's done. The term gold plated turd seems particularly relevant here.
In the mean time, just bend up pin 28 and solder the package normally using the other 27 pins. The reason to bend up the pin is to make sure it doesn't contact anything on the board. There seem to be vias there without soldermask, so the pin could short against them. Even if the area below the pin was covered with soldermask, I wouldn't want the pin touching it and possibly eventually cutting thru the insulation. Bend up the pin, or even break it off altogether.
|
H: RGB LED Light Strip - Arduino
I've purchased a small WS2811 5050 RGB LED strip. I want to light them up without any controller currently. But I'm struggling to do that.
The strip I'm using:
http://www.ebay.co.uk/itm/201709948864?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
I've got a 12V Switching Mode Power Supply (L06BR) connected to both positive, and ground of the strip (both sides). And I get nothing?
Not sure what I'm doing wrong here, do I need a controller to simply power it up? Maybe the Amps are too low? Running off 1.7A - but I gathered I don't really need that many amps to power a 48 LED strip.
I would like to eventually hook this up to my Arduino and get some colour changing on the go! :)
Thanks.
AI: Those LEDs need a controller to do anything, their default state is off.
You send them a serial data stream of 24 bits (8 bit Red, Green and Blue) per LED. The first LED in the chain takes the first 24 bits and uses them to set its color, it then outputs any further received data to its data output pin which is connected to the data input of the next LED. This way you can have a theoretically infinite length chain of LEDs, each set independently, driven from a single pin.
If the data line is idle for a 50us the data pass through mode resets and you are back to setting the first LED in the chain.
The timings required for reliable data transfer are fairly tight, on most micro controllers you generally you either need a library written in assembler or you can use an SPI bus interface and play some games with the data format to generate the correct timings on the output. There are libraries for the Arduino and other platforms that will handle the timing for you.
It would be possible to set them all to white and full brightness using a PWM output if you set the duty cycle and repeat period correctly. I have a 300 LED strip (with a little bit of coding they make good Christmas lights), all on full brightness pulls about 7.5 A so your power supply should be good for 48 of them.
The full data sheet is here: http://www.world-semi.com/details-106-4.html
|
H: What is the difference between frequency response and transfer function?
I would like to understand the difference between frequency response and transfer function. I know the former can be obtained by substituting \$s = j\omega\$.
But what is the difference in information I can get from both representations? What are the respective limitations and where do I apply which method?
I'd also be glad for some literature recommendations.
Could someone explain the calculations of the second answer (by Chu) a little more extensively? I don't quite get how he determines the values of \$ \phi \$ and X, and how he compares it with setting s equal to \$ j\omega \$ in the transfer function.
AI: A circuit's transfer function is a fully mathematical model that can be used to derive the frequency response and phase response (both together are called the bode plot).
However the same isn't true in reverse - you can't always derive the TF from the bode plot. Sometimes you can but not always.
So, the frequency response is a subset of the bode-plot and the bode-plot is a subset of the transfer function.
Hopefully this picture will help: -
Along the top are three bode plot views of a typical frequency response for a 2nd order low pass filter. Bottom left is a 3D view of what lies behind the frequency response - in this example there are two poles (only one shown to make it easier on the eye).
Bottom right is the standard pole zero diagram and this 2D diagram alone embodies the transfer function. So, if you look at the 3D picture and imagine viewing from above, you get the pole zero diagram at bottom right.
|
H: MG8Q6ES42 - N CHANNEL IGBT
I found this "MG8Q6ES42 - N CHANNEL IGBT" power switching control motor hybrid integrated circuit between some old motor application circuit boards. Although I found datasheet for it, I didn't found any test circuits or something alike (usually datasheets contain something like that).
Anyone knows how could I test it just to check if it is still operational for motor application circuits or other?
I haven't had any experience with motor control ICs until now, and I think it is wasteful to throw it away, especially since it price isn't so low either.
Here is the equivalent circuit diagram:
AI: This module is for driving a 3-phase motor coils from a single DC bus. You would need gate drivers and a bunch of other stuff to make it operational for the original purpose. The high side IGBTs need a gate drive above the positive rail so those need a supply on top of that rail or a bootstrapped drive and continuous switching.
IGBTs are driven similarly to n-channel enhancement mode MOSFETs- about 10-15V on the gate to turn them on, and 0 or perhaps a bit negative voltage to turn them off, but 0V will do for testing. You can test each IGBT individually (just leave other connections open) with a 12V supply and a small test load (such as an automotive tail lamp bulb).
|
H: Speaker noise from preamp circuit
I am testing a simple circuit in which an electret mic is hooked up to two transistor preamps, then to an 8ohm speaker. I am using a 9v battery, and the circuit looks like this. This circuit is meant to be simple enough to teach to kids at school.
I have followed it exactly, and it works... somewhat. As soon as I plug in power, a low noise comes from the speaker. When I try to speak into the mic, the sound changes, but you can't actually hear works. Just change in volumes/sound change. I really want a "megaphone" like circuit, without the excess noise and clear amplification.
please note I prefer this transistor amp over a lm386 chip for this particular project as it is for use in a school
What issues could be causing the excess noise?
Edit
Made purpose clearer.
AI: As others have mentioned, that is not a very good circuit. Alas, we can't expect that just because we found it on the internet it will be a decent design. I wold use a circuit more like this one.
Source: http://www.circuitstoday.com/transistor-intercom-circuit
This is billed as an "intercom circuit". But it is a good example of a circuit with sufficient stages of gain to take an electret microphone signal and boost it up to speaker level. The switch (S2) will create a tone to signal the other end of the intercom. You can omit S2 and C3 if you aren't using it for an intercom.
|
H: Raspberry Pi Micro Switch kw11 3z
I am trying to get a lever micro switch working with my raspberry pi GPIO. This is the lever switch in question.
On the switch it has the model number on one side KW11-3Z and then the other side it says 5a250vac.
I have wired it to COM to GND and NO to GPIO 18. I have tested with a simple push button and this work as expected again wiring to GND and GPIO 18. Therefore I know the python code is correct.
The part I dont know is correct is the switch itself and the wiring.
Here are some images that will help to show how I have things currently.
You can see I have a breadboard with a tactile switch here and this is working as expected. Each time the button is pressed the output on terminal is "Button pressed".
Running the same python code I have swapped for the micro switch with using the same pins on raspberry pi of GND and GPIO 18 however each time the lever is pressed it isn't showing anything in terminal, no echo of "Button pressed".
Can anyone please advise what I am doing wrong here. I suspect I have got the configuration of the wires wrong as the code is ok.
AI: Your lever switch is called a single-pole-double-throw switch, SPDT. As it sits, you will measure very little resistance between COM and NC. Between COM and NO you should measure very high resistance (like infinite, or off-scale resistance). And between NO and NC, you should measure very high resistance.
simulate this circuit – Schematic created using CircuitLab
For the schematic shown, your GPIO will read "low" (logic 0) when the lever of SW2 is not activated, and will go "high" (logic 1) when the lever is pushed. Be aware that any switch when it changes state, will bounce around between the two logic states, for an undetermined number of bounces, before settling to its next state. This bouncing may take many milliseconds before settling. So if you wish to count button-presses, you may count very many bounces for a single press.
The resistor R1 is required for reliability. It is called here a "pull-up" resistor, because it applies a 3.3v logic level to the GPIO pin when the button is pushed. Its value is not critical, but as shown, 33 microamps is pulled from the 3.3v supply until the button is pushed. So you don't want to make R1 too small in value.
You have wired it in an alternate way, with GPIO going to "NO" terminal, as in SW3. The pull-up resistor should be wired to this terminal. Now, a push will yield logic low, while un-pushed will yield a logic high. This works too, but use that pull-up resistor so that un-pushed, GPIO sees a "high". This may be a safer circuit. If you were to re-program a GPIO pin to be an output rather than an input, your output would see a 10K resistor until the button was pressed. Once the lever is pressed, the GPIO would see a short to ground, and could harm the driver inside the PI's CPU. GPIO's generally power-up as "inputs" rather than output. Ensure that your GPIO is set as "input" when reading switch state.
|
H: Variable time alarm using 555 timer
I have to make a circuit in which i have to produce three outputs(on speaker buzzer sounds)
First is for 20 seconds on 5 sec off
10 sec on 5 sec off
5 sec on and 5 off( this alarm sequence for 3 minutes)
Second one is 5 second on 5 second off (this alarm for two minutes)
Third is 10 seconds on 5 sec off, 5 seconds on 5 seconds off (this alarm for 3 minutes)
I have to use 3 push buttons/switched for this.can anyone guide me how to use 555 ic for this.. I have resistor and capacitor values for times but i am not sure about circuit.
AI: The complexity of the sequence and the relatively long times makes a 555 timer completely unsuitable for this task. Actually, you'd need quite a few of them for timing the various parts of these signals, and then some logic to gate and sequence things. That would turn into quite a ratsnest of stuff.
Use a microcontroller. What you ask is relatively simple to do in even a modest micro. All you need from one is 3 inputs and 3 outputs, which just about every micro with 8 or more pins can do.
In the firmware, divide the clock down to get 1 second events. Then write code that waits for N one second events between doing things. I'd set up a 1 ms periodic interrupt to debounce the input buttons, and use that to also count to 1000 to create the 1 second events.
This is really a rather simple task for a microcontroller.
|
H: How to solve this diode resistor circuit?
Here is the problem:
The assignment asks to calculate various voltages and currents in this circuit.
Here is the diode current-voltage characteristic:
Here is my thought process and what I tried:
The capacitor is per assignment fully charged, so I think no current should flow there.
Also the diode has an ideal current-voltage characteristic where it lets through any current if the voltage is above \$0.7 V\$
\$I_2\$ is per my best knowledge \$I_2=0A\$ since the capacitor is fully charged and no more current can flow into it.
\$I_1\$ is the current flowing through \$R_1\$ which should be easy to calculate: \$I_1 = 3.5 V :280 \Omega = 0.0125 A \$
\$ U_1 \$ should also be \$3.5 V\$ since there is nothing lowering the voltage, am I right in my assumption ?
Also I think the only part of this circuit where the voltage gets changed is after the diode at \$U_3\$ and/or \$U_4\$ because of Kirchhoffs circuit laws.
Here is my problem:
I don't know how to "resolve" the diode in parallel with the resistor, since our voltage across the whole circuit is \$3.5 V\$ I don't think any current is going to flow through \$R_4\$, because why would the current go the resistor when the diode is "faster", but per Kirchhoff's circuit laws
both voltages should be equal, right ?
I don't know how to calculate: \$I_5\$, since I don't know how to treat \$R_4\$.
Also, I don't even have an approach on how to calculate \$I_0\$ since I don't how to calculate the \$R_4+R_1\$ resistance, to clarify, I don't know if that is the correct way.
Update: here is the marked solution
AI: To solve these kinds of circuits you have to make an assumption about the state of each diode (whether it is on or off) and solve the circuit based on that assumption. If in solving the circuit you arrive at a contradiction (either the diode has a nonzero current through it but you assumed no voltage across it, or the diode has no current through it but you assumed 0.7V across it) then your assumption was wrong.
This circuit has only one diode so there are only two possible solutions: the diode is on, or it is off.
First assume that the diode is off (i.e. that the current \$I_3\$ through it is 0). By KCL that means \$I_1 = I_4\$ (you are correct that \$I_2 = 0\$ in steady state). Similarly, by KCL \$I_0 = I_1\$. \$I_0\$ is flowing through the two resistors in series so it equals
$$I_0 = \frac{U_0}{R_1 + R_4} = \frac{3.5}{280 + 350} = 5.5\text{ mA}$$
Since \$I_0 = I_4\$ the voltage across \$R_4\$ is \$U_4 = I_4 \times R_4 = 5.5\text{ mA} \times 350 = 1.94\text{ V}\$. However, \$U_4 = U_3 > 0.7\text{ V}\$ so the diode would be on. This is a contradiction so the diode must not be off as assumed.
Now assume the diode is on (the voltage \$U_3\$ across it is 0.7V). \$U_4 = U_3\$ so $$I_4 = U_4/R_4 = 0.7/350 = 2\text{ mA}$$ By KVL \$U_0 = U_1 + U_3\$, so rearranging we have $$U_1 = U_0 - U_3 = 3.5 - 0.7 = 2.8\text{ V}$$ That means $$I_1 = U_1/R_1 = 10\text{ mA}$$ By KCL \$I_1 = I_3 + I_4\$, and rearranging we have $$I_3 = I_1 - I_4 = 10\text{ mA} - 2\text{ mA} = 8\text{ mA}$$ We have a nonzero current through the diode so there is no contradiction -- the diode is on.
You should be able to figure out the other variables (like \$I_5\$) from here.
|
H: Voltage level translation between +3V and +3.3V
In a project of mine I have two ICs that work at different voltages.
IC_A at 3V and IC_B at 3.3V and they talk to each other through UART.
In my prototype I use a mosfet with two resistors for each signal in UART( TX, RX ) as a level converter.
My question is:
Could I omit the mosfet and connect them directly or with only a resistor in series? And if yes how to find the resistor's value? e.g.Ohms law?
edit: 3V and 3.3V are the theoretical voltages. When I measure them they are 2.85V and 3.3V...
AI: You actually don't care what the VCC or VDD voltage level is, but are more interested in the V(input lo) and V(input high) requirements for both devices.
For your 3 V and 3.3 V system elements the real questions are:
When driving the 3 V input from the 3.3 V element output can the output voltage be too high?
For many interface elements the input is advertised as 5 V safe, so for those elements the 3.3 V output can interface directly to the 3 V system.
I'd suggest there are no conditions where this would not work or cause damage.
Some logic has clamp structures in the input gates, so there is more to consider.
For these elements it may look a bit like this:
Under these conditions (high signal) where the input diode clamps are planar diodes with a Vf of typically 650 mV you unlikely to get current flowing from the 3.3 V output into the 3 V elements VDD structure/supply.
For safety your could add a small value resistor to limit current.
When driving a high from the 3 V element will V(output high) meet the requirements of the 3.3 V element V(input high).
Since the V(output high) of the 3 V element will approach 3 V, this will easily meet the requirements which are likely in the 1-1.8 V level. You can directly connect the 3 V element output to the 3.3 V element input.
|
H: LM334Z current source testing
So i have a constant current source , datasheet here: http://www.ti.com/lit/ds/symlink/lm134.pdf. My setup is this : 9 volt + side goes into V+ or the source , which in turn is connected to the R pin through a 34 ohm resistor. V- of the source is connected to the battery - through my multimeter using crocodile clamps. I would expect the reading to be 2mA for the current but i'm getting a flat 0. The resistor checks out to work ok. My multimeter may be crappy but the amp reading on the battery itself works good. The only thing i can think of is the source, which i have no idea how to check to see weather it's faulty or not. Any suggestions?
Edit: After switching the rin pin connection from V+ to V-, here is what the circuit looks like, with 0 amps still being what i read.
simulate this circuit – Schematic created using CircuitLab
What i'm trying to figure out is how to test the LM by itself. Even more confusing is the fact that i have 2 of these , so the possibility of both being defective seems low. I also triedusing a 10 ohm resistance in case my multimeter is crap, with the same results, and linking the multimeter black before the R1, which predictibly yielded no results. It seems that whatever i do, there's no current flowing through. The battery has the proper voltage and amp rating when checked by itself.
Please help me figure this out. Thank you guys in advance
AI: Voltage in R1 is kept at 64 mV/298K. (From datasheet)
Thus, at room temperature (~298 K), you'll get 64 mV at R1:
I = 64 mV / 33 Ohm = ~ 2 mA
So you should see 2mA drawn from your battery.
As a side note, using a bad multimeter in ampermeter mode is not a good idea. You have way too high series resistance. Instead of that, just measure the voltage on R1 and see if it's actually ~64mV.
If you really really need to use the multimeter in ampermeter mode,
- Take multimeter in ampermeter mode
- red wire to Vbat "+" terminal
- Black wire to "V+" of LM 334Z
- of course delete the current wiring between the to shown in the picture
edit: As pointed out in comments, the multimeter is in voltmeter mode (shown in picture).
|
H: How to check a discrete time system if the following is linear and time invariant?
I have the following system:
$$y(n) = x(n^2+n)$$
where x(n) = 1 if 0<=n<=3; 0 otherwise.
I tried doing the usual check if yd(n) = y(n+d), but that's not giving me the right answer.
Anyone know how to attempt this?
AI: Suppose you had another input
$$x[n] = \left\lbrace\begin{matrix}1 & 1\le n \le 4 \\0 & \rm{otherwise} \end{matrix}\right.$$
Does the output look the same as it did for your example input, but only shifted in time?
This is testing the property of an LTI system that when \$y[n]\$ is the output for input \$x[n]\$, then the output should be \$y[n-n_0]\$ for the input \$x[n-n_0]\$.
|
H: basic RF transission in noisy environment
I built a little quadcopter, and I need to transmit some data to it in a max. 4-5 meters range.
The transmitter needs to transmit in a quarter of a sphere (the quadcopter will newer be "behind" the transmitter, neither under it); the quadcopter will only receive signals in half of a sphere: under and all around it's body.
I built a working communication system based on the RF modules in the picture below. But when the 4 DC motors of the quadcopter start, the electromagnetic noise blocks the communication. The motors are about 6 cm away from the receiver, which is surrounded by them.
My questions:
1) each motor has a capacitor between its terminals, and I read that two additional capacitors, one from each terminal to the motor's case, would help; is that true? I also read "but only if the motor's case is well grounded" (I didn't rellay understand that, does it mean I have to connect the case direcly to ground?
2) I had a couple of cheap 433MHz transmitters/receivers around (I don't mean "transceivers": each module can do only one thing, TX or RX) and I decided to try using them. But many people says they're garbage: I don't mind if that's true in general, but is it possible to use them in my case whit a quite good reliability?
3) I had trouble understanding the antenna I should use. At this very moment I have two identical quarter wavelength straight 6mm copper wire antennas, one on the quadcopter and one on the ground. Are there best antenna types for this kind of transmission? I can have what I whant on ground, but the quadcopter needs a lightweight antenna.
Those are my actualRF modules
AI: Reduce Common Mode emissions by CM filter choke using either Ferrite torroid around each motor wire pair or all wire pairs or wired dual coil CM choke or ferrite clamp on ribbon wire etc with similar CM choke on radio signals to uC using twisted pair or coax and Ferrite CM clamp.
Differential chokes are useful with decoupling caps to isolate conducted motor noise interfering with radio but emission noises are also important to suppress with small RF caps (pF) across motors with CM chokes and twisted pair.
Ferrite beads for motor signals are often needed. http://www.digikey.com/products/en/filters/ferrite-beads-and-chips/841?k=ferrite&k=&pkeyword=ferrite&pv7=3&FV=fff40034%2Cfff802ab&mnonly=0&newproducts=0&ColumnSort=0&page=1&quantity=0&ptm=0&fid=0&pageSize=25
Look at a professional design for ideas.
Consider you will need power common mode, CM chokes and differential mode (DM) chokes (ferrite beads) for motors, data signals, twisted pair and shielded twisted pair as well as RF shunt caps on data inputs.
BTW these are not very powerful radios suited for long range copters.
|
H: Hall Effect Sensor Current Output
I have a quick noob question about current flow through a hall effect sensor.
Does the current flowing from one end of the sensor to the other purely depend on the load's draw from the power source? Or is it also affected by the voltage output?
In other words does the current draw stay static regardless of the output voltage changing? Tell me if I'm thinking about this the wrong way, I'm quite confused.
I'm specifically trying to figure out how to calculate what will happen to voltage and amperage when I put a resistor on the sensor output.
This is the diagram I have been looking at if it helps:
Thanks for your time!
AI: Your diagram shows a bare Hall element.
The current that flows along the element (excitation current) is dictated almost entirely by the resistance along the element, and its excitation voltage Vx.
The output or Hall voltage VH is the product of the B field, the excitation current, and the Hall sensitivity of the element. Any output current flowing is dictated by the magnitude of VH, the resistance of the element across the output terminals, and the load on them. It's good practice to have a load here that draws little or no current.
The Hall sensitivity tends to be so low that the excitation current varies little with output voltage.
However, you rarely see a bare element. What you buy as a 'Hall Sensor' has an amplifier following VH, to boost the mV output to a swing of volts that you can read sensibly on your Arduino. This further isolates any sensitivity of input current to changes in the output voltage.
If you load the sensor output amplifier output with a resistor, and the amplifier is capable of driving the current that resistor demands, then the amplifier will draw the extra supply current to drive the resistor load.
|
H: How do mains voltage LED filament bulbs work?
What are the filaments inside a bulbs such as:
https://www.amazon.co.uk/Bonlux-Dimmable-Filament-Incandescent-Replacement/dp/B01AL1WT4C/ref=sr_1_3?ie=UTF8&qid=1481966120&sr=8-3&keywords=led+filament+bulb+6w
What is the circuit?
Are there capacitors or resistors involved?
(LEDs normally drop 0.7V, not 230V. Typically, they are powered from DC, not AC. It would be very inefficient to drop the remaining 229.3V through a resistor, and a heat sink would be required, which I do not observe on these bulbs.)
How do LED light bulbs work? mentions the presence of a heat sink, which these bulbs do not have. These bulbs also seem to have no space for electronic components.
AI: What are the filaments inside a bulbs
See Wiki - LED filament for the idea behind these lightbulbs. Quotation: -
The LED filament is composed of a series of LEDs on a transparent
substrate, referred to as Chip-On-Glass (COG). These transparent
substrates are made of glass or sapphire materials. This transparency
allows the emitted light to disperse evenly and uniformly without any
interference. An even coating of phosphor in a silicone resin binder
material converts the blue light generated by the LEDs into a mixture
of red, blue, and green light to create a specified light temperature.
Degradation of silicone binder, and leakage of blue light are design
issues in LED filament lights. Positive benefits of the LED design are
potential higher efficiencies by the use of more LED emitters from
lower driving currents – major benefit of the design is the ease with
which near full 'global' illumination can be obtained from arrays of
filaments.
Picture taken from here
It's difficult to say how many LEDs are involved but if they are 3 volt LEDs and the mains is rectified and smoothed from 230 VAC to 324 V DC then 100 or so of these substrated LEDs might be used and also a current limiting resistor or transistor circuit.
What is the circuit?
It could be as simple as a bridge rectifier, smoothing capacitor and a linear current regulator with all the LEDs in series.
Are there capacitors or resistors involved?
Almost certainly.
|
H: Transfer function for Small signal model of inductor series peaking
I am having problem understanding the Transfer function for Small signal model of inductor series peaking as shown below.
However, how does this transfer function contribute to peaking since there are no "zeroes" at the nominator ?
Retrieved from A Wideband Low Power Low-Noise Amplifier in CMOS Technology
AI: Using current divider rule: \$\small I_R=\large\frac{1/sC}{R+1/sC+sL}\small I_{in}=\large \frac{I_{in}}{s^2LC+sRC+1}\$
Hence: \$\small V_o=RI_R=\large \frac{RI_{in}}{s^2LC+sRC+1}\$
and: \$ \large\frac{V_o}{I_{in}}=\large \frac{R}{s^2LC+sRC+1}\$
|
H: IB30-16.5 AC Motor Identification
I would be grateful for assistance in identifying an old motor from Matsushita Electric Industrial Co. Ltd. I have been unable to find a datasheet for the motor. An image of the partially disassembled motor is included below. I am able to take more specific pictures if requested and directed. The text reads:
IB30-16.5
4P 30W
220V 50Hz 3.5uF
240V 50Hz 2.8uF
The cylindrical case has an outer diameter of 90mm and height of 110mm.
I assume this is a single-phase four-pole motor. I would be grateful for guidance in determining whether the capacitances listed are for start capacitors or run capacitors, and which of the three wires - white, brown, black - is which.
I have measured resistances and inductances. The resistances were measured directly with a multimeter. The inductances were measured by driving a square wave through the windings in series with a known resistance of 270R, and measuring the RL time constant from the captured waveform. The results were as follows:
white to brown: 210R 127mH
white to black: 94R 87mH
brown to black: 120R 94mH
In calculating inductance via the resistance and time constant, I summed the 270R and winding resistance and multiplied by the time difference between the peak of the waveform and 0.37x that peak with respect to the waveform's minimum value.
I believe that the winding with the largest inductance is the main winding. I also believe that the winding with the highest resistance tends to be the auxiliary winding, but this makes the results contradictary. However, I could understand a lower resistance for the auxiliary if it is substantially shorter.
I hope my inexpert research can help an expert to answer my questions on capacitors and winding identification. I would also welcome any corrections, especially if I am way off base!
Thanks for considering my question.
AI: Based on the capacitor values, I would say that the motor is the permanent split capacitor type (PSC). The capacitor is a run capacitor that remains connected at all times. The highest resistance measurement bust be the sum of the main and auxiliary windings. Therefore the black lead must be the common connection between the two windings.
It is difficult to determine which is the main winding and which is the auxiliary winding, but is seems more likely that black and white would be the colors used for power. I found one reference that shows the connection this way:
Additional Thoughts:
It would be useful to carefully examine or measure the winding wire diameter. If there is a difference in diameter between the two windings, the winding with the smaller diameter would be the auxiliary winding.
Motors like this are sometimes constructed with two identical windings so that the direction of rotation can be reversed. One method of reversing a single-phase motor is to reverse the connection of one winding end-to-end. That requires a 4-wire motor. The other method of reversing is to connect the capacitor to the opposite winding.
Wire colors are not very consistently used to signify functions. Where they are used, their significance varies from one country to another and from one manufacturer to another. Manufacturers ship motors all over the world for use by other manufacturers. They may youse their own color codes or those requested by their customers.
For products that they encounter locally, repair professionals may become familiar with colors used by various end-product and motor manufacturers. Repair people seldom if ever work on items that have been dismantled to the point that internal wire connections need to be determined. They may decline to work on such items if they encounter them.
It is probably not possible to use motor theory to confidently determine the connections of a motor like this. Careful testing with good instruments and a load would reveal which connection results in the most efficient operation.
|
H: Measure EMF Radiation from High Altitude Balloon
I'm participating in a competition which involves building a probe that will be attached to a weather balloon. It will probably rise up to an altitude of 30 km.
I am thinking of measuring EMF radiation with a frequency of ~1GHz. The idea is to determine how much activity there is on the ground (how many cell phones, wifi transmitters etc.). I don't need to extract any information from the signal, I just want to determine the "quantity" of wireless communication.
Due to the nature of the competition I have to deal with the following constraints:
The sensor may not cost more than 100$
The weight may not exceed 300 g
The device must either be small enough to fit into the isolated casing of the probe or be able to withstand temperatures of -40°C
Is it plausible to measure EMF radiation from such a distance? What sort of sensor should I be looking for?
AI: Chip manufacturers address this kind of sensor with a good selection of devices. These provide a voltage output proportional to RF power over a broad range of frequencies - they are not radio receivers because they don't discriminate one signal source from another. Some respond to multiple sources, adding them in a root-mean-square (RMS) fashion, while others don't. Am unsure which is appropriate for your particular application (your specs are not well defined).
Some (many) of these chips are sensitive enough so that an antenna can be attached directly. Your antenna may be a significant challenge, and will influence greatly the frequency band over which signals will add to the output. Your antenna should be carefully designed to be non-directional, since it will likely be spinning and possibly swaying.
Be aware that cell transmitters carefully direct signals in desired directions. Not many users are above a cell site, so less signal is directed "up" than "out and around". But as you go higher, your antenna "sees" more sites.
Engineering is best done to provide a solution to a need. Your need is not mentioned - more like "this might be an interesting thing to measure". Start with a more concrete and useful goal.
|
H: PIC10F200 Breakout Board - Use ICSPDAT and ICSPCLK as GPIOs?
i am desinging a breakout board for the PIC10F200 at the moment and i am wondering if i am able to use ICSPDAT (GP0), ICSPCLK (GP1) and MCLR (GP3) as GPIOs if i use in-circuit debugging / programming with the PicKit3?
This is how my circuit looks like at the moment:
If i won't be able to use them i am left with only 1 GPIO, which isn't very much, 4 would be much better (or at least 3) :)
Best regards
AI: Yes, you can use them as GPIOs. There are a few caveats though:
What you connect to the CLK and DAT pins in the way of other devices could interfere with the programming. You should include some way to isolate those devices if needed.
If you disable the MCLR functionality you can only use HVP mode for programming (not sure off hand if that chip does LVP or not). The >10V pulse on MCLR to enter programming mode could fry whatever is connected to it. Again you should provide some method to isolate that pin or otherwise mitigate that pulse (without interfering with the programming).
|
H: Can we transmit FM signal using AM band and AM signal using FM band?
What I am asking is if it is possible to transmit a frequency modulated wave in AM range(550-1650 Khz) and similarly to transmit an Amplitude modulated wave in FM band (88-108 Mhz). I would like to know about the technical aspects of the problem like what problems we may face if try to do so.
AI: AM now supports Quadrature Stereo AM but still fits within 10Khz channel spacing with some guardband.
FM cannot fit into the AM band , wwhile AM is even used in the ISM band at 928MHz with 6kHz channel spacing, so there is no reason why AM cannot be used at any frequency.
FM has higher SNR and signal bandwidth that prevents application in the lower AM bands.
However one can use AM or FM for cable communication at any frequency.
Can you see how to fit the above baseband FM signal in the 10KHz channel spacing of the AM band? If you do it's worth a ton of money.
|
H: Could I switch a 1/4W resistor with a 1/2W resistor?
I have a Fender/Sunn SX4150 mixer and it has two resistors blown out and missing, I didn't remove them. I asked another question regarding the schematics that called for a 22 Ohm cc, which I got my answer for but the answeree also noted that instead of a 1/4W I should just make it a 1/2W. Could I do this with little to no consequences, and if so, could I just replace the 1/4's with 1/2's? What would happen if I did such a feat?
AI: If you have enough space you can easily replace them with 1/2W. 1/4W is less than 1/2W. The device will work properly. 1/2W or 1/4W means how much power the resistor can dissipate.
|
H: Can i connect Power source (like usb charger) parallel connection with power bank output for keep Uninterruptible power supply (UPS)
I have a question about uninterruptible power supply (do it yourself).
I have a simple power bank and relay (or light) i want that my relay will be always on even the power adapter are disconnected.
The answer to connect relay from power bank only is unsuitable for. i need to use both power supplies (battery charger and power bank).
AI: If you don't know the type of DC/DC converter in supply mode, it is always a good idea to add a diode as shown in the picture.
The benefit is that you will protect your DC supplies from drawing current from another supply.
The drawback is that because there is a voltage drop on your diode (~0.7 V typical), there will be power loss of:
W = 0.7 * I;
So say, your lamp draws 300 mA, then your USB power loses 210 mW on that USB diode (it will get hot - too hot if you don't use a heat sink!).
However, there is a bigger problem in this circuit. If you disconnect from USB, your power bank will be discharging because it is lighting the lamp, right? But, since it is discharging, battery voltage will drop and this will trigger the battery charger to start charging. So, your powerbank will be discharging to charge itself! A cheap powerbank usually has 75% efficiency with their supply/charger units so a "discharge to self charge" situation has:
1 - 0.75 * 0.75 = ~45% Power loss!!
Your powerbank will not be as productive as it is supposed to be. So, this is not a good idea.
However, you can try this circuit:
As you can see, this way, your USB port and powerbank output are protected. Your powerbank is only charged when there is power at USB port. Also it is charged without a series diode on the way, which helps with efficiency.
Also hint: try to pick USB diode with less on resistance a.k.a. ~0.6V while let the powerbank be higher at ~0.7V. This is because you want your USB to both charge the powerbank and light the lamp. If you don't do this, then it is possible that powerbank lights the lamp, and is charged from input by USB. This is inefficient!
|
H: Low Vgs MOSFET as switch
I'm trying to figure out how I can switch this device on. I tried p-mosfet but it has too high Vgs and the difference between gate and source is really low. Is there any other way?
AI: You see the problem with your connection ? Here:
So with this configuration, unfortunately, you can't turn that mostfet on or off. It will always conduct! When you place a mostfet, make sure you look at that diode and where it is pointing!
Try something like this:
simulate this circuit – Schematic created using CircuitLab
Make sure to always limit your GPIO with series resistors as shown. (Or you'll blow up that pin)
Use an npn-bjt as shown to drive a mosfet. You'll get better current capacity. Also, that schematic is just an example. Please pick the best values using the components' datasheets.
|
H: Stepper Motor wind turbine AC to DC - what diodes / or rectifier to use?
I'm building a small wind turbine from this tutorial. It uses Nema 17 stepper motor as the generator.
We need to convert the AC of the motor to DC. The setup is said to be able to produce up to 30V and 1 amp in high wind speeds.
I have 3 questions:
If we were to make our own rectifier from 4 diodes, what size/spec diodes would we use? It says in the comments they used schottky diodes here but I don't know what size they used or what would make sense in this application.
If we were to just use a rectifier, what should we use?
Is there any electrocution danger in this voltage / amps (30v/1 amp) that I need to be aware of? What level of amperage is dangerous?
Thank you!
AI: If we were to make our own rectifier from 4 diodes, what size/spec diodes would we use? It says in the comments they used schottky diodes here but I don't know what size they used or what would make sense in this application.
Your diodes V rating should be high enough to withstand your generators/any other stuff you added to the system. For you, they should be at least 30VDC rated. Of course, for practical purposes, never go that low. Pick something with 50VDC~100VDC. Also, diode amper rating must be selected using the same principles. If you will draw 1 amps, get diode rated for at least 1 amps. I'd get 3 amps.
So something like 100 VDC, 3 Amp rated Schottky Diodes are okay for you.
If we were to just use a rectifier, what should we use?
Something powerful enough as described earlier. Remember, you draw current. If you plan on drawing 100 mW from a 1000 W source, you can! So the rectifier power specifications demand on your load, not the source. (Of course it should withstand source's voltage, though)
Is there any electrocution danger in this voltage / amps (30v/1 amp) that I need to be aware of? What level of amperage is dangerous?
There is a graph, of how many amps can kill you per time. It is something like 10 mA ~a couple seconds to 100 mA ~a couple microseconds. So dangerous limit starts at 10 mA but thats not enough. Why? What causes electrons to penetrate human body? Voltage! Dangerous voltages (the ones that hurt you) start from 50V. Any source rated above 50V and has amp rating more than 10mA has a chance of killing you depending on point of contact. Example: Getting electrocuted from your left hand-feet is worse than right hand-feet because your heart (generally) is on the left side. Amperage ratings differ from people to people etc. so this is not a simple question to answer. But like I said, let's assume that any source rated above 50V and 10 mA has enough power to kill a grown man.
In your case, your source is 30V which is not enough to penetrate your body but I would be cautious. Use plastic gloves at least. You can also work on an insulated ground elevated above from real ground as used in labs.
|
H: Advice on laying out a PCB for a microcontroller
Small backstory: I'm bad at engineering, pretty new to it (only been a monthish). I have a few projects I'm working on with Arduino, I'm pretty good with breadboarding.
I want to make a couple permanent and since I have access to CNC machines, I figured why use perf board, I can just mill a PCB. I've milled them before, never really designed them. Wondering if this schematic would be correct?
The only warnings I receive are VCC & AVCC are connected to N$7 (not actually sure what this means, if someone can enlighten me), no errors though. I breadboarded it first, just wondering if I managed to turn it into a schematic correctly minus the really weird bends in my traces which I'll eventually fix.
AI: First of all I would advise you to look at what normal schematics look like (how many have diagonal lines!). While functionally it may not matter, it will make your life easier in the long run and it is good to learn proper practices. Remember that the schematic is topological, it doesn't have to be arranged and routed like the PCB would.
Secondly I would suggest naming your nets. N$* are the default names that Eagle gives to nets that you haven't named. When you are routing a board, it is much easier to tell where, say, the GND net goes if it is named GND rather than something like N$4. The same is true for signal nets and whatnot.
The warning regarding VCC and AVCC being connected to N$7 can be safely ignored when you have verified what it is saying. In this case you have two pins on the ATMega which are marked in the symbol is being power pins. These are connected to a net called N$7 - assuming N$7 is the output of your regulator (see second paragraph), then this is correct and so the warning can be ignored.
As to why there is a warning, it is because the name of the power pin does not match the name of the net it is connected to. Eagle spits out a warning so you can make sure it is correct. Imagine you had a power pin called +3V3 and it was connected to a net called +12V. You would at this point be thanking Eagle for pointing that out to you.
|
H: MATLAB PID Tuner producing the wrong output?
I'm trying to apply a PID controller to my transfer function in MATLAB to get the step response, bode, pole-zero, etc. This is the code I'm using to create the Transfer Function and open the PID Tuner app:
s = tf('s');
R = 10; % Load resistor
Rc = 130*10e-3; % Output cap ESR
C = 1410e-6; % Output capacitance
Rl = 100e-3; % Inductor resistance
L = 500e-6; % Inductor value
Vi = 30; % Input voltage
% Buck converter transfer function
G = Vi * ( (R + (s*R*Rc*C))/((s^2) * (L*C*(R+Rc)) + s*(R*Rc*C + Rl*C*(R+Rc) + L) + R + Rl) )
% PID Tuner
pidTuner(G, 'PID')
The response I get is this after some tunning (click to view it bigger):
The Kp value is really low compared to the Ki parameter which makes me thing there's something wrong? But the step response seems right so I go ahead. Now I use this program to simulate my PID controller and do some plots:
% PID Parameters from PID Tuner
Kp = 0.175
Ki = 371.22
Kd = 0
% PID Controller
H = pid(Kp,Ki,Kd)
% Close the loop
T_pid = feedback(G, H)
% Plot the step response
figure(1);
step(T_pid)
grid on
title('Respuesta transitoria en lazo cerrado (plano continuo)')
xlabel('Tiempo')
ylabel('Amplitud')
And this is the step response I'm getting:
Which is waaaaaaay different from what PID Tuner gave me before. According to the docs of the feedback() function I think I'm using it right:
But somewhere on the Internet I found it used like this:
T_pid = feedback(H*G, 1)
And this gives me the exact same step response as PID Tuner but I don't understand why! What's the proper way to use it?
AI: Let's consider a feedback loop as:
As you can see, your 'Control' and 'Process' blocks are cascaded. Assuming you are using unity feedback, your block 'Feedback' block is 1.
Now, the feedback function in matlab is defined as you have it in your post:
T=feedback(sys1,sys2)
Where sys1 and sys2 are set up in the following manner (as you also have it in your post):
In order to properly use the function, you have to define what 'sys1' and 'sys2' are based on your model. You are using a PID block and of course you have the plant model.
If your PID block is \$\text{C(s)}\$, your plant block is \$\text{P(s)}\$, and your feedback block is \$\text{H(s)}\$, how can you possibly match your system to the one matlab uses?
Everything now is the s-domain, so if you can simply multiply the cascaded blocks so that
$$ sys1 = \text{C(s)P(s)}$$
And just by looking at how matlab defines its control loop model,
$$ sys2 = \text{H(s)} $$
Since you are using unity gain feedback, \$\text{H(s)}=1\$ and keep in mind that the feedback function assumes negative feedback loop, so you don't need to use a -1 inside the function.
That's why the correct way to do it becomes:
T = feedback(C*P,1)
where C and P are your PID controller definition and Plant in the s-domain. And the 1 comes from using negative feedback which is the assumption when using this fucntion.
As summary, the forward path after the error signal in the first image in this post, represents what matlab defined as 'sys1' in its feedback function and the feedback path, which comes from the output back toward the summing block, is what matlab knows as 'sys2' in regards with the feedback function. And the forward path have two blocks, so you combine them together by multiplying.
Hope it helps!
|
H: Connecting AVR Microcontroller to USB
I am working with an ATmega328. What I want to do is finding a way to save any value in any GPR of the microcontroller using the PC.
I found this video where an already made interface is shown. Apparently, that is very user-friendly. But does it what I'm trying to achieve? For example, if I want to save the value 0x3B in register R16, could I use that software to do it via USB?
Also, I don't know how to connect the USB with the microcontroller pins. I've found this image
but I would have expected the pins TXD and RXD to be used. Is this connection alright?
Sorry if the question is a bit messy, I'm a beginner with this stuff. If you need any further information please let me know.
AI: TXD and RXD would be used if you were using the UART - that is, connecting the chip to a USB to UART (TTL) adaptor. You aren't, you're interfacing directly to USB and bit-banging the USB protocol (which is IMHO one of the nastiest things anyone could ever do on a USB bus), so you have to use the pins mandated by the software that is doing said bit-banging.
Can you get it to set registers? Sure - if you write the software (using the V-USB library) to do it.
|
H: Buck converter efficiency and output current vs. input current
When I am using a buck, is the imput current lower than the output curent? Also how would I aljust that on a buck
AI: A 10W output (2A @ 5V) converter with 80% efficiency will draw 1.04A at 12V input.
\$\eta = P_O/P_{IN} = 0.8\$ so \$P_{IN} = P_O/\eta = 10/0.8 = 12.5W\$
However as the battery voltage drops, the current must increase. At 10.8 volts (normally the lowest you'd want to discharge a lead-acid 12V battery), the current will be up to 1.16A. This is a negative resistance effect (increase the voltage and current drops).
Please make sure you are not misinterpreting the battery specification. It is not common to speak of a '1A battery'. Usually batteries are rated in ampere-hours (Ah). The actual Ah will be a bit different for different currents and for the battery condition and temperature.
|
H: Multiple inputs to IP core in verilog
I am trying to make communication system, with serialzing-deserialzing and 8b-10b encding, decoding. Currently I am using the readily available core for 8b/10b encoding, which has a 8 bit input requirement. I want to accept a 32 bit input from the user as a packet. And then feed the 8b/10b encoder with this 32 bits divided into 4, 8 bit patterns, serialize it and send it. How should I take the 32 bit pattern and divide it in 4, 8 bit patterns, when the IP core input demands only 8 bits?
AI: There are a lot of details that you will need to figure out, but the basic way to do this is to have a state machine with 5 states: idle, transmit 1st, transmit 2nd, transmit 3rd, and transmit 4th. When a 32 bit word comes in, you transition from Idle through the transmit states, writing one byte per clock cycle, then returning to idle or maybe begin transmitting the first byte of the next word if it is available.
The additional things you will have to figure out are whether you need flow control on the 32 bit input bus, how the receiver will determine the message start and end, whether a 32 bit message is a complete packet, or if you need to transmit longer packets generated 32 bits at a time.
8b10 makes most of these options fairly easy as it automatically figures out the byte framing and provides control code words that can be used for message framing, but you have to make sure it works for your application.
The code would look something like this:
reg [31:0] data_in;
reg [7:0] data_out;
always @(*) begin
case (state)
Idle: data_out = 8'b0;
Send1: data_out = data_in[31:24];
Send2: data_out = data_in[23:16];
Send3: data_out = data_in[15:8];
Send4: data_out = data_in[7:0];
endcase
end
You then have to make sure the state machine iterates through states Send1..Send4 at the appropriate time. You may also have to latch the data_in register so it doesn't change in the middle of sending, and implement a busy flag so to prevent the sender from trying to send a new message while the first one is in progress.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.