texts: Shouldn't LED blink 25 (30) times per second on AC?

texts:
I have told my friend that if is AC changing polarity 50 (60) times per second it means that LED (Diode) should blink only if the + nad - is on a right spot. We have tried that and oscillator showed as only the positive sine wave but the LED still blinks 50 times per second not 25. Why doesn't it blinks only 25 times.

It is just a transformer, resistor and LED powered by mains voltage (250V AC, 50Hz)


texts:
I want to detect an AC Line Voltage (230V RMS, 50 Hz) and interface it with a microcontroller.

I am aware about two solutions:

Using an optocoupler like PC817 (datasheet)
using MID400 (home page, datasheet)

Both are optocouplers, but the PC817 gives a pulse train (50 Hz pulses) at its output according to my testing.

The MID400 output, I have not tested yet but its datasheet indicates that it outputs a LOW when AC is detected and outputs a HIGH when AC is absent.

Now clearly there is a difference in PC817 and MID400 output.

So I would want to know whether really, practically, the MID400 gives a steady HIGH or LOW signal? Has anyone tried with MID400 ?


texts: Voltage regulator for Stepper and Microcontroller

texts:
I'm designing my first PCB for a personal project :

I'm planning to run a Stepper motor (3.8V 670mA/phase) with the DRV8834 driver and an Atmega328P from the same power source.

The power will come from a classic USB charger (rated at 5V, 2A) plugged in my PCB.

Do I need a voltage regulator on my PCB as the power coming should be already regulated to 5V by the USB charger ?

If so, would I need two voltage regulators one for the Stepper that will draw higher amounts of current at times, and another one for the stable microcontroller, or can I use one for both ?

I believe if needed I will go for an LDO 5V - 2A regulator like those found here.

Would it be a good choice ?


texts:
I'm currently making a power/current consumption budget. Is there a difference between the quiescent current and supply current? I know the quiescent current is the current that when there is no load and is at a steady state. In comparison, the supply current is the current that is drawn from the IC no matter what.
I ask this because from this datasheet: https://www.ti.com/lit/ds/symlink/opa196.pdf?HQS=TI-null-null-digikeymode-df-pf-null-wwe&ts=1593049757175, I couldn't find the supply current for this. Do I just take the quiescent current as I normally see one or the other in a datasheet?


texts:
I am doing a amplitude modulator simulation in ltspice, I am trying to find the minimum and maximum amplitude of the modulated signal using .meas, I found some snippet online which indicates .meas tran vmax max mag(V(n003)) works, but it fails in my case.
Is there any way to measure minimum and maximum magnitude of the waveform (green trace) ?
There is of course the pain stacking way of zooming in to waveform and using the cursor, but it would be too time consuming when i have to vary the modulating signal amplitude


texts: Resistor in parallel with a short circuit. Will current flow through it?

texts:
I'm trying to find the Isc of this circuit seen by the capacitor at t > 0 so I could find the Rth and get the circuit's time constant. If I make the capacitor a short circuit, it will be in parallel with the resistor. Is it right to assume that no current will flow through the 5ohm resistor?
Then I have the KCL equation:
V1 would be the voltage in the dependent source's node.
Isc = (Vsource - V1)/R1 + 0.5(Vsource - V1)
I already found V1 which is 2.25 V.
Am I doing this right?


texts:
My question has to do with a piece of equipment in my home, but I thought I would post my question here because I am interested in the behaviour of the electricity rather than anything else.

There is a submersible electric sump pump in my basement. It sits in a pit dug out of soft rock, where water accumulates. The water is fresh water, in the sense that it is rainwater and not seawater, though it is muddy. When the water reaches sufficient depth, a float switch causes the pump to switch on and pump the water out of the house.

Yesterday, I was cleaning sediment out of the pit with my hand. The pit had a substantial amount of water in it. I felt a tingle: Electricity.

I did a quick experiment with my multimeter. I put one probe in the soil and one probe in the water. With the pump plugged in, I measured a small voltage (about 0.5 V AC). When I unplugged the pump, I measured no voltage.

So yes, this is a dangerous situation. The pump is dangerously defective. I have unplugged the pump and am arranging for its replacement. This is not the point of my question here.

My question is what is actually happening with the electricity. I think it’s safe to assume that somewhere in the pump, the 240 VAC mains current is exposed to the water. So:

Why did I feel a small tingle and not the full force of 240 VAC?  In the same vein, why do I measure only 0.5 VAC in the water?

Why did I feel anything? Why wouldn’t the exposed wire short directly to the nearest ground point through the water?

Would I have felt a stronger shock if there had been less water in the pit?

What happens in situations like this, in which a whole swimming pool becomes electrified?

Thanks.


texts: Can I parallel multiple resettable fuses to achieve a higher current rating?

texts:
I have an application wherein I spec'd a fuse, rated for 80VDC 500A. The customer is concerned about what happens if they have to replace the fuse, it being rather difficult to access. They suggested resettable fuses as an option.

I'm not aware of any resettable fuses rated for those currents. However, since they have positive temperature coefficient, it occurs to me that I may be able to effectively parallel several smaller ones. Is this good practice?


texts:
I wounder what is the format of the serial data stream that usually is sent from computer to arduino through serial connection .
my project use serial connection with arduino to send data from python(pyserial) to arduino , and when I send a string  and I try to print it on LCD it appears but the first  character changes to a chinese or japanese character .

so can any body explane the steam format to understand what is the wrong or what happens .

this is the arduino code and python code I used :
arduino :

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

void setup() {
    lcd.begin(16, 2);
    lcd.print("hello, world!");
    Serial.begin(9600);
}

void loop() {
    lcd.setCursor(5, 1);
    char rd[5] ;
    Serial.readBytesUntil('.', rd, 5);
    Serial.flush();
    Serial.println();
    lcd.print(rd);
}

python

import serial
s = serial.Serial('/dev/ttyACM0',buadrate = 9600)
s.write('est.')

update
I found through serial monitor that the text is recived correctly but next loop it gives © as a value of rd .


texts: How to tell whether a line coding scheme has DC component or not

texts:
I'm new to EE, trying to understand things as a non technical audience.
My textbook says one of bipolar encoding schemes called alternate mark inversion (AMI) has no DC component and we can think about it intuitively. If we have a long sequence of 1s, the voltage level alternates between positive and negative; it is not constant. Therefore, there is no DC component. For a long sequence of 0s, the voltage remains constant, but its amplitude is zero, which is the same as having no DC component. In other words, a sequence that creates a constant zero voltage does not have a DC component.

But then the book says return-to-zero (RZ) scheme doesn't have DC component neither as picture below shows:

Here is something I don't get, clearly if we have a long sequence of 1 in RZ scheme, the voltage level will be + 0 + 0  + 0  ...., if add all those up, the sum is clearly a large positive value, given by the intuitive explanation, how come it doesn't have DC component? Is it an another way to tell whether a line coding scheme  has DC component or not?


texts: Designing power supply on two sides of the PCB

texts:
I am beginner in PCB design. I have a reverse voltage regulator LT8365 generating -50V from 24V input, only this design exist on the topside of the PCB(2 layer) and I wanted to add another one(same regulator) on the bottom side of the PCB so to generate another -50V independent rail and not increasing the dimension of the board. So, Can I create a 4 layer board to achieve this? meaning, add one regulator with all it's external components on top side and another identical design on the bottom side? or this is just not possible?
I hope to hear back about your thought on this.


texts:
Trying to control the speed of a DC Motor (MFA 918D100112/1 found on https://www.rapidonline.com/mfa-918d100112-1-gearbox-motor-100-1-4mm-shaft-12-24v-37-1224) using PWM pin on Arduino connected to the base of an npn BJT (2N3904 https://www.onsemi.com/pub/Collateral/2N3903-D.PDF). This is the proposed circuit:

I am not sure of the resistor values to choose. As I understood correctly R2 is used as a weak pull down resistor for when the base is floating, and R1 is used to ensure a Vbe is 0.7 V for saturation when the Arduino pin supplies 5 V. R3 is used as a current limiting resistor in order not to fry the transistor.

How do I choose the right values for the resistors? I hope I have understood the theory correctly.


texts: Can Petroleum Jelly be used as a PCB resist?

texts:
I've been experimenting with various setups for PCB etching, and thought I'd share one of the more useful things I'd found, as I don't see much information about the subject anywhere else.

I've been etching using a mixture of HCl and HOOH (see http://www.instructables.com/id/Stop-using-Ferric-Chloride-etchant!--A-better-etc/ for more details) and have no access to a laser printer, which rendered the traditional method of resist application impractical. While thinking of other easily-applied materials, I ended up testing white-out (very poor; dissolves in the acid, porous, not easily removed by acetone), scotch tape (very good, but very hard to apply correctly) and petroleum jelly.


texts: How do I use directional couplers on a differential signal?

texts:
I understand how a directional coupler can be used to measure signals travelling in one direction on a wire. What I don't understand is exactly how this would work on a differential signal, E.G. LVDS (which stands for Low Voltage Differential Signal).

My ultimate goal is to test the quality (impedance really) of hand made cables. Ideally, they need to be 100R impedance. One way to test the quality is to measure the amount of reflected signal from the terminator.

Measuring reflection using directional couplers is often done for single ended RF signals, but I have never seen it done on differential signals.

Do I do it like this, using two couplers (these ones), one for each wire? If so, which two output ports should I watch if I want to see reflections from the terminator? A&C, B&C, A&D or B&C? Should I add the signals from the ports, or subtract them?

Alternatively, is there such a thing as a differential directional coupler? I tried googling for it, but nothing much came up.


texts: Can I use the same file for a diferent FPGA speed grade?

texts:
I have a design that works correctly for an ALTERA FPGA speedgrade 6.

If I want to keep using same FPGA but in speedgrade 8 will the same synthesised file work in new FPGA, or do I need to re-compile (re-synthesise) for the new target ?


texts: Stereo line level to mono microphone level

texts:
I need to find a simple (preferably passive) way to take a stereo consumer line-level output, mix it to mono, and reduce it by 40dB to be used in a microphone level.

Following this answer:  https://electronics.stackexchange.com/a/14982/1554  I see it's easy to use a pair of resistors to get down the levels I need.  I've also stumbled across this schematic for mixing the two channels together:

(from http://jwsoundgroup.net/index.php?/topic/7015-passive-summing-stereo-to-mono/)

I can't help but notice how similar these two schematics are, and am wondering if I could combine them.  Minimizing parts and size is important to me, as I would like to build the whole thing inside an XLR plug.  What values of resistors do I need in this stereo-to-mono schematic to also bring the levels down by ~40dB?  And, how is that calculated?


texts: Design of a heat sink, combined with a pc cooling system

texts:
I currently have the task to cool a system of four small devices \$ \left(1 \times 5\; \mathrm{cm}^2 \; \text{each} \right)\$ with a total heat dissipation of \$150\$ W.

My idea was to use a heatsink to transport the heat away (they are also connected to an optical system which should be separated from the cooling system) and afterwards either connect the heatsink to a GPU-cooler designed for \$300\$ W dissipation, or use a fan-/fin-system for dissipating the heat.

The main problem is to keep the devices at \$30\;\$°C at max. Which of my approaches is more suited for that, or should I completely rethink the approach?

Edit: I forgot to mention that three devices dissipate \$10\$ W, and the fourth device dissipate up to \$120\$ W.


texts: PWM LED dimming via constant current source

texts:
I have this idea to dim LEDs and I'd like to get some opinions if it's feasible.

Q1 and M1 form a constant current source, Q1 ensures a 0.7V drop across R2 by pulling M1 gate to ground. Q2 gets a PWM signal on it's base turning M1 off completely during positive pulse.

I'm a bit worried about M1 slamming LED hard until Q1 turns on, my guess is that      a capacitor from gate to ground would slow it down, am I right?

Does anyone see any other problems in this design?


texts: How to interface a camera with a 4-pin aviation connector?

texts:
I'd like to use this kind camera on a development board.

I want to make an invention and I need to use this specific camera, but none of the development boards that exist (from Arduino to the more complex like STM32, ARM A53, FPGAs, etc) have this type of connector (4-pin aviation connector), and I have not found any expansion board either to provide a common board with connectivity with this type of camera.
Anyone know how I can connect this camera to a development board?
I was thinking in designing my own PCB, the problem is that it's not just placing the connector and wires and it's done: No, it is not like that, I beli that it would also be necessary to place its PHY and such.
In addition, I'm not sure how to decode the video signal from that camera either, although I suspect that it must use PAL or NTSC encoding.
Well, any help is more than welcome.
Thanks in advance.


texts: history of edge-triggered D flip-flop design using three S-R latches

texts:
I'm interested in the history of the logic design for the edge-triggered D flip-flop, as used in the SN7474. The design is composed of three set-reset latches (six NAND gates total) per flip-flop.

Does anyone know what year the SN7474 was introduced, or have an early datasheet for it (prior to the 1973 TTL Data Book For Design Engineers 1st Edition)? I've found it listed in distributor catalogs as far back as 1967 (year edited on 2017-07-21, previously I wrote 1971).

Another early datasheet I've found using this specific logic design for an edge-triggered D flip-flop is from a non-7400-series TTL chip, the Motorola MC3060/3160, which is a member of the MTTL III MC3000/MC3100 series.The MC3060 is covered in the Motorola 1968 IC databook, on page 4-138. The 1976 TI TTL Data Book For Design Engineers 2nd Ed. lists the SN74H74 as direct replacement for the MC3060.

I've searched US patents for edge-triggered flip-flop design, but have not found one specifically for the three S-R latch design.

The subject came up as a result of a discussion on a private mailing list regarding the fact that the conventional J-K master-slave flip-flop design is NOT edge-triggered; pulses on J and/or K while the clock is high but stable can affect the Q (and not-Q) outputs of the FF at the following falling edge of the clock. That behavior is known as "pulse catching", and such a flip-flop is properly called pulse-triggered or level-triggered, but not edge-triggered.  Early datasheets on J-K master-slave flip-flops actually had correct terminology and specifically stated that J and K should not change while the clock is high.

There are true edge-triggered J-K flip-flops which use a derivative of the three-S-R-latch D FF design, effectively generating an internal D input to the FF from J, K, and Q (and/or not-Q). The 74x109 is an example of that, using a not-K input rather than true K.

Master-slave D flip-flops effectively are edge triggered, unlike J-K master-slave. It is possible to build a true edge-triggered J-K master-slave flip-flop, by using a D master-slave with the internally generated D as described above.

CMOS edge-triggered flip-flop designs are almost always based on a master-slave design using transmission gates.


texts: Creating a momentary low pulse with a toggle switch

texts:
I want to create a circuit with a SPST toggle switch that when flipped in one position the output signal is high and when flipped in the other the output has a momentary low pulse and then rises back to a high output again.
It seems very simple but I cannot for the life of me figure it out.


texts: I am soldering a 5-12V 5-8amp max electronic to a pcb board, without a schematics. I just want to ask how far should each joint in PCB board? what I mean is for example a cathode and anode when soldering a led emitting diode how far should each pin be? I am worried that a arc electric may travel because of close contact to one another, that its impossible to extend for other electronic pin like mosfet and jb connector.


texts:
I have an unusual connector, I know this cause I can't seem to locate a connector that will connect to it.

I know what it does but can't find a source to build my wire cable I need.  I can find the board connector but not the mating connector.


texts:
I am trying to understand this formula to find the transconductance of a MOSFET transistor, but I am not getting the passage from the second to the third line. What happened there?

Thank you


texts: The battery loses its charge itself in an hour

texts:
I have two new li-ion 26650 4800mah unprotected batteries bought 2 days ago. I use a charger for li-ion and li-fe batteries with a balanced cable.
When I charge these two new batteries it charges them fast up to 4.19-4.2V each. But then when I disconnect the charger the batteries starts to lose their charge up to 3.4v themselves. I have another two batteries with the same characteristics from the same supplier and they work ok. Two old batteries charges like 10 times longer and work great. What can it be?


texts: Why do many DACs have differential output?

texts: Many DACs like PCM1794 (current output) and PCM1793 (voltage output) have a differential output. What are the benefits from this, other than an easy way to convert its output signal to ground-referenced AC via a differential amplifier.


texts: Lifepo4 current limiter with supercapacitor in parallell

texts:
I am making a LiFePo4/supercapacitor-hybrid.

Spike current draw can reach 300A for a few seconds. The LiFePo4 batteries I am using is rated for 100A max discharge rate. In order to make sure the supercapacitors do the heavy lifting, I need to limit the max current allowed to be drawn from the LiFePo4's.

In my circuit, the polyswitch will "switch off" in milliseconds at that kind of current draw. The power resistor will allow the supercapacitor to be recharged slowly while the polyswitch cools down. An obvious problem here is a waste of energy.

Is my idea completely senseless, or could it work?

simulate this circuit – Schematic created using CircuitLab


texts: Why is Common Collector amplifier is also known as Emitter Follower?


texts: If electrons move slowly in an electrical circuit then what signal or energy is it that travels at the speed of light?

texts: I am reading "Radio Theory Handbook" and am confused with the statement that says that electrons are moving through the wire at snails pace.But it goes on to say the "electrical effect" is instantaneous. I assume he means the speed of light.  Then what is this mysterious electrical signal in the wire that moves at the speed of light?  Is it the EMF? By definition electricity is the flow of electrons. But yet the electrons are said to travel slow? There cannot be a contradiction. I am asking for help in clarifying this. Thank you.    There is another question " Is voltage the speed of the electrons? This is not the same question. I am not asking about voltage. I am asking about the apparent contradiction given the fact that electricity which is the flow of electrons has an almost instantaneous effect while the electrons themselves more very slowly.  Although it is not the same question there was enough useful information there and along with all the excellent responses that my question has been well explained.


texts:
I have been looking all over the web and finally found and joined this site to get an answer to this question.

Ok, I am working on an old plastic injection machine. It has been badly abused in its 40+ years of life so trying to figure out how it came from the factory is not possible.

It has 3 old heating elements, each controlled by a new digital controller and relay. Each comes on and off independently as needed.

One of the heaters shorted out and tripped the breaker, so I took a look at the wiring. All 3 units were being powered by a 2 tiny wires coming from one phase of the 3 phase power. How it even worked was a surprise.  It did take a long time to heat up. (it is a 3 wire system)

I am replacing all 3 heating elements and want to power them efficiently.

Assume heaters are A - B and C

Heater A would be powered by phase 1-2
 Heater B would be powered by phase 1-3
 Heater C would be powered by phase 2-3

But I am afraid this will result in boosting voltage to 400+, because of the cross connection and ruin everything. Some posts and diagrams seem to indicate this would happen and fry the new heaters.

Option 2 would power heater A from power 1-2,  and then power heaters B and C from power 1-3.   This would leave one of the phases unused.   ( 2-3)

I think I have to use option 2.  I have a pro coming over, but I want to know what I am talking about when I try to explain it to him. Plus he is Russian and being able to explain things clearly is critical.

One other thing I found odd. With NO power, there is continuity between terminal 1-2 but not 1-3 or 2-3. With power turned on there is 220V between 1-2-3 in any combination.

Why is there continuity between 1-2 when power is off? Perhaps it has something to do with the rotary phase inverter?


texts:
I have in front of me a raw PCB. The surface mostly has three colors: dark green, orange-gold and white.

As I understand, the green is resist, the orange-gold is copper, and the white just the silk screen.

I find it surprising the color of the PCB's surface copper is quite different to the color of copper pipes. Please compare the orange-gold of PCBs, and the reddish-orange of copper pipes.

Why does PCB copper look more yellow than copper pipes?


texts: What are the units in which a radio signal's strength is measured?

texts:
I'm kind of confused about which is the most correct unit when it comes to the measure of wireless signal's strength. It seems that the correct unit is V/m (usually expessed in dBuV/m), however it seems that most of the time W are used (in the form of dBm).

From what I can tell dBm actually expresses the power that arrives at the receiving antenna, which is related to the actual signal strength and it will vary according to an inverse square law.

What has been puzzling me is that I found this article (which I'm unsure wether is correct or not) that states:

  The magnitude of the E component of a radio wave varies inversely with the distance from the transmitter in a free-space, line-of-sight link. If the distance is doubled, the E-field intensity is cut in half; if the distance increases by a factor of 10, the E-field intensity becomes 1/10 (0.1 times) as great. The E component of an EM field is measured in a single dimension, so the intensity-versus-distance relation is a straight inverse rule, not the inverse-square law.

Could someone please clarify this statement and shed some light on how dBm and dBuV/m are related?


texts: LM2596 and other DC-DC converters why oscillate if the output capacitor ESR value is too low?

texts:
I would like to use LM2596 converter. Datasheet says:
'If the selected capacitor's ESR is extremely low, there is a possibility of an
unstable feedback loop, resulting in an oscillation at the output.'

Why? Why not good a too low ESR value?


texts: freechargecontroller.org schematic diagram. Power Assembly

texts:
I'm attaching a link to the schematic diagram for the Free Charge Controller (http://freechargecontroller.org/images/a/ab/Charge_controller_4_04b.pdf). I have built a prototype power assembly and I have verified that the square wave is coming out of mosfets M1 and M2 as described in the documentation "Testing the Power Circuitry" (http://freechargecontroller.org/Documentation). I understand that the circuit is some variation of what is called a half bridge drive. Here is a link to the page where the test program I am starting with is (http://thesolarpowerexpert.com/free-charge-controller-kit-part-4-testing-the-power-circuitry/) the source code is available as well in the documentation "Testing the Power Circuitry".

The code to the program is telling me that sending the Arduino high signal to 8 turns on the high side and sending a high signal to 9 turns on the low side. This makes sense to me since pin 7 of IC2 (The half bridge driver) is connected to the gate of M2 and the gate of M1. I'm pretty sure I understand correctly that D1 prevents electrons from flowing from the direction of M1's gate back to M2. I don't yet understand the purpose of the resistor R1 which is soldered between source and the gate pins of Mosfet M1. Could someone explain this?

I think I understand that when mosfets M1 and M2 (which are chained) are turned on that electrons are allowed to travel onto the conduit which runs between pin 6 of IC2 and is called the VS line and the batteries positive power terminal. I don't yet understand the function of the VS line. I have tried to look at the data sheet for the IC. I am attaching a link to it (http://www.irf.com/product-info/datasheets/data/ir2104.pdf) but I'm finding I'm not really good enough at reading these data sheets to glean enough from it to understand why the VS line is there and how it is supposed to react.

So I see that the COM pin of the half bridge driver is connected to the VCC the VB and then back to the VS conduit? Why? I see the com is described as the low side return however I don't really understand where power is being returned from. Also the purpose of the capacitors C11 and C3?

Any help in understanding the schematic would be greatly appreciated.

Thank You


texts: Help understanding power amplifier circuit

texts:
Below is a single channel power amp circuit from the 1970s.

I was wondering if someone could help me understand this circuit from a modular point of view (I'm getting lost with what I presume is negative feedback circuitry)

I'm trying to understand the circuit better, so that I can diagnose a problem with the bias that is affecting both of these circtuits (left and right channels).  The emitter resistor voltage drop is 14mV in the specs, but adjusting VR201 will only give a max of 5mV on the device.  Also, the schematic shows -1.3V after the bias diodes, but it's only reading -0.6V in practice.  Because this is affecting both channels the same, I suspected the voltages, but these are now in spec and the problem remains.

Thank you!


texts:
I'm trying to drive an MPR121 capacitive touch sensor module. It works fine on Arduino. Here is my Arduino code:

Wire.beginTransmission(0x5A);
Wire.write(0x00);
Wire.endTransmission(false);
Wire.requestFrom(0x5A, 1);
if (Wire.available() < 1)
  return 0;
return (Wire.read());

However I can't read register 0x00 with STM32F103. I can read an EEPROM with the same read function and different address, using the STM32. The wires have been checked a thousand times. STM32F103 I2C Config:

I2C_DeInit(I2C1);
i2c.I2C_Mode = I2C_Mode_I2C;
i2c.I2C_DutyCycle = I2C_DutyCycle_2;
i2c.I2C_OwnAddress1 = 0xEE;
i2c.I2C_Ack = I2C_Ack_Enable;
i2c.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
i2c.I2C_ClockSpeed = 10000;
I2C_Cmd(I2C1, ENABLE);
I2C_Init(I2C1, &i2c);
I2C_AcknowledgeConfig(I2C1, ENABLE);

STM32F103 I2C read function:

uint8_t read_e(uint8_t addr){
uint8_t Data = 0;
I2C_GenerateSTART(I2C1, ENABLE);
while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT));
I2C_Send7bitAddress(I2C1, 0x5A, I2C_Direction_Transmitter);
while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED));
I2C_SendData(I2C1, addr);
while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED));
I2C_GenerateSTART(I2C1, ENABLE);
while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT));
I2C_Send7bitAddress(I2C1, 0x5A, I2C_Direction_Receiver);
while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED));
I2C_AcknowledgeConfig(I2C1, DISABLE);
while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_RECEIVED));
I2C_GenerateSTOP(I2C1, ENABLE);
Data = I2C_ReceiveData(I2C1);
return Data;
}

and finally the while(1) code:

buffer = read_e(0x00)

and print buffer through uart.

STM32 EEprom I2C signals on logic analyzer:

Arduino MPR121 I2C signals on logic analyzer

and STM32 MPR121 I2C signals on logic analyzer:


texts: What is the name for PCB mount AC power connectors

texts:
What is the search keyword for PCB mount AC power connectors? I'm looking for just the metal connectors (plug and receptacle) for solder to the PCB.

I'm asking for the brass connectors shown above.

"nema pcb mount contacts" is close (found from question PCB mount AC input and output) but it return results from only one manufacturer that doesn't offer European connectors; which indicates probably there is more appopriate keyword that I can't find (yet)...


texts: Is there a reason why some ac/dc adapters don't have a grounding pin?

texts: I'm searching for an AC/DC adapter of 6v 300mA, but I can't find one with a grounding pin (E-type). Is there a specific reason for this?


texts: Microcontroller ADC and output impedance

texts:
I have seen the similar questions here: Required output impedance for ADC input? and Can someone help me understand output impedance to an ADC? but I couldn't apply the answers to my circuit - so I may be reiterating the question but I did search first.

Atmel ATmega328P datasheet, section 24.6.1 says that "The ADC is optimized for analog signals with an output impedance of approximately 10k ohms or less". I'd like to be able to approximate the output impedance of a circuit with a 10k pot and an RC network on the wiper, and change values if needed to fall in or near the recommended range. Some other postings have demonstrated the use of Thevenin's theorem with a pot or voltage divider (for 10k pots th=10k/4, or 2.5k), maybe it's entirely applicable here also.

The input signal is not high frequency, the pot is hand adjusted randomly from 0-5V (it's a paddle controller for a pong type game). To smooth the voltage changes, a series RC network will be connected to the pot wiper. I've tried two RC combinations with the same time constant (R1=10k, C1=100uF and R1=1k, c1=1000uF) and both are acceptable and respond similarly in real life.

Attempting to find Thevenin equivalent impedance here, I've removed the cap (the load) and shorted the pot's voltage supply. R1 and R2 will be the pot divided into two 5k resistors in parallel, with resistor R3 in series. If R3 is 10k, then the result is 12.5k. If the R3 is 1k, the result is 3.5k which appears to be the better selection - or have I missed something, like the effect of the capacitor?

Thanks for looking.


texts: Trouble understanding this 'simple' circuit

texts:
I've been having trouble understanding this circuit, which is used in a larger circuit but this is the section which I can't wrap my head around.

Valve7+ is always at +24V and when valve7 is high, Q10 becomes short circuit which pulls Valve7- down to 0V which means the valve has 24V across it. I think that part is ok.

Now the other case is where I get confused, Valve7 is low, Q10 is open, Valve7+ is still +24V but now Valve7- is also +24V which means the valve has 0V across it.

How does Valve7- become +24V? Does current flow through C27 and loop through D8 eventually making the two lines equipotential?

What exactly is the purpose of D8?

I'm confused by the mechanism of having 0V across Valve7+/-.

Thanks


texts: Power inductor maximum DC current rating

texts:
I am selecting a power inductor for my power supply. The only significant source of current draw is a servo motor that draws about 200mA - 1A for 500 ms for less than 10 times a day.

Consider the following power inductor: Bourns SRN4018. Suppose I use the 33 uH inductor that has an Irms rating of 700 mA, how long can I pass 900 mA rms (for example) through the power inductor before the power inductor dies? I don't see this information in the power inductor datasheets I have seen (e.g. Abracon).


texts: Which branches should I convert for this star-delta transformation?

texts:
For those who can't see the image:
SO there is an outer delta with two 1 ohms and a 2 ohm. Then an inner Y with three 2 ohms. Within the Y, there is a delta formed on it's two lower legs with three 1 ohms. The question is to find the resistance between the upper arm above the inner delta.

Now, my question is, which branches should I convert and also, what would it look like if I convert those branches?


texts: Power Circuit Problem - Output DC Voltage is dropping form its supposed value

texts:
I have constructed and tested a circuit that achieves MPPT of solar panels. The MPPT circuits involves current sensors that requires 3.3V and -3.3V and also the MOSFET and MOSFET drivers that require 8V. To obtain these voltages, I am using an auxiliary power circuit that involves low power COTS chip converters. It begins by feeding the primary input to a LMR14006 based Buck converter. The output 3.3V is then used to feed the current sensors, a TPS6040X inverter that provides the required -3.3V and the LMR62421 boost converter that provides the required 8V. Please see the attached image which shows the auxiliary circuit component of my MPPT schematic.

As a side note, the MPPT circuit is intended for handling higher powers than that of the aforementioned auxiliary circuits. Its details are not important here as the source of my problem is not from them.

The issue I am getting is that the LMR14006 and (especially) the LMR62421 are not providing me a consistent 3.3V and 8V. When I connect an input voltage of 6V (and short circuit the input kill-switch in my schematic) and don't run any power through my MPPT circuit (easily achieved by turning off the MOSFETs), the LMR14006 and LMR62421 generates the required 3.3V and 8V. The resulting idle current from the 6V input is measured at 0.035A. However, once I begin running power through the circuit which means the MOSFET drivers will become a heavier load, I noticed that the LMR14006 will now drop its output to 3V and the LMR62421 drops its output to only 5V!

To verify that this problem exists on the auxiliary circuit side, alternatively to running power through the MPPT circuit, I connected an external 120 ohm resistor to the supposed output 8V of the LMR62421. Once again, the LMR14006 outputs 3V only and the LMR62421 outputs 5V instead of the originally desired 3.3V and 8V. Why is this happening?

As an additional note, I also noticed that the feedback voltage of the LMR62421 drops from the datasheet specified value of 1.225V to around 790mV. By the way, the TPS6040X voltage inverter is working as intended and I have no issues with it.

_____________________________

Better, but not good enough:


texts: How to plot in % the difference b/w output and input signal in AC analysis [LTspice]

texts: I tried the plot mag(((re(V(vout))-re(V(vin)))/re(V(vout))))*100, but this leads to unexpected results.


texts: Correct wiring of MOSFET in e-ink display driver board

texts:
I'm trying to integrate an e-ink driver board schematic into my design that includes a AVR MCU and a handful of other components. Due to physical size, I'm trying to avoid additional boards so I'm using an existing driver board from Waveshare as a reference. I'll likely buy one of their raw panels anyway (2.9" e-ink). For my board, I'll be dropping the LDO Regulator as my whole board runs at 3.3v.

I'm brushing the dust off my electrical engineering knowledge from 18+ years ago and I'm trying to work out whether this schematic is correct. From what I can see, Q31 is wired incorrectly with the collector and emitter backwards:

PDF Schematic

Granted I'm a little rusty, but am I right? If not, can someone explain why this is correct?

This is my current take on the schematic for my purposes:

Thanks!


texts: Flip between motors each time circuit energized

texts:
I want what I hope is a simple circuit but I've googled and searched this forum, not found it.

When a SPST digital programmable timer completes a circuit, I want one motor to run. On the next circuit completion from the timer the other motor. Next time, the first motor, and so on.

I can do this with two timers, each set on different times. But I would like to know if there is a simple way to do it with one timer.

Do NOT want a circuit that must be energized all day long. Over time that increases greatly the battery and solar requirements. Something like a latching relay? A bi stable flip flop maybe?

The application: A chicken coop door. Two water reservoirs. To open, fill the bottle on the door pulley. To close, pump from the door pulley bottle to the bottom reservoir. I can use an up timer and down timer but I think this can be done with some kind of latching relay or something.

The goal is to be very low-cost and simple. If the alternative to two timers costs more than the second $5 timer, I'll go with two timers.


texts:
Ok this is a two part question, it's so that I can make the question as clear as possible.

Let's say I have 1 watt of input power into a circuit or device and 1 joule of energy sitting in a capacitor as output, for example 100V at 200uF.

Is a capacitor just sitting there and being continuously charged with a constant 1 joule of energy considered as an output?

Also I understand that a joule is equal to one watt second. So if I am observing a continuous 1 watt of input power of 1 watt but I only observe it for just one second, would it be correct or incorrect to say that the output of 1 joule charged in a capacitor is equal to the input power of 1 watt?

The circuit I am speaking of is a basic DC to DC inverter type or buck booster with flyback and the flyback is charging the capacitor.

I understand that during the charging of the capacitor let's say from a 0 voltage the input source will experience a loading and draw lots of current at first in order to begin charging the capacitor.

Afterwards when the the capacitor is fully charged and the input current has settled down into a stabilized power in which a meter can read is the point in which I am referring to.

So in a nutshell, the main question again is, is the one watt second in the input equal to the 1 joule in the capacitor, which is considered a one watt second, all within the same second? Thanks!


texts: ADC "internal" overvoltage with gain, ADC overvoltage above Vref

texts:
I want to ask about maximum input voltage for ADC in 2 cases

I'm using MCP3424, with internal differential amplifier (gain 2, 4 or 8). Reference is fixed 2048mV. What will happen, if I apply 2V to Vin+ and 0V to Vin- when gain 8 is used? It will just saturate or it will be damaged?
I'm PIC18F25F50 with ADC powered from 5V. I have positive Vref set to 1024mV, negative Vref to ground. Can it be damaged when I apply 4V to input?

In datasheets, in maximum ratings - maximum input voltage is usually Vdd + 0.3V. I know that at higher voltage ESD diodes current will flow. But what about internal circuits when internal amplifier is used, or when Vref is below input voltage?


texts: AD620 instrumentation amplifier with Wheatstone Bridge-based KMZ10B sensor

texts:
I would like to ask for help regarding a certain phenomenon related to amplification by the Analog Devices AD620 instrumentation amplifier (device home page, device datasheet).

Vcc is 5V.

The AD620 receives a differential voltage from the KMZ10B magnetoresistive sensor, which has a Wheatstone bridge construction.

MY GOAL:

I wanted to amplify voltage from KMZ10B (which is about several tens of millivolts). In my circuit this voltage depends on direction of the magnetic induction of the neodymium magnet. A direct voltage results gives such a characteristic:

On the above graph:

X-axis = Neodymium magnet angle (degrees)
Y-axis = voltage (V)

Then I decided to implement the voltage reading from AD620.

HOW I DID THAT:

I used 4.7 kOhm resistor between pin 1 and 8. Datasheet of AD620 says that this resistance (called Rg) must be calculated like this:

Rg = 49.4 kOhm/(G-1)

G - gain

I used 4.7 kOhm resistor, so gain is 11.51. Reference voltage is about 2.5 V (from second op-amp: MCP6022) and voltage divider (half of 5V from Vcc)

I created a chart of this circuit (voltage measured between output of AD620 and GND) and it looks like below:

Now I decided to compare signals before and after amplifying.

I took the results in Excel made before using AD620, I multiplied them with Gain  (11.51) and added a 2.5 volt reference (below).

y=((x*11.51)+2.5)

It was supposed to show if the amplifier really strengthens as the calculations show. And look, I compared both charts:

LEGEND FOR ABOVE GRAPH:

Blue chart is a real, amplified signal
Orange chart is a calculated signal.

PROBLEM:

It looks like something's going wrong and in my opinion it depends on in-amp AD620. The signal rise up quickly and falls slowly. What can it be caused by?


texts:
I made a power supply from a diy site, the schematics are above. The site showed the project as 2amps output but I'm not getting even close to that. I'm getting around .14A or less. Does anyone know what the problem might be. Also I didn't include the diode that is shown above the lm317, but I don't think that has anything to do with it. Lm 317 says its rated for 1.5 A. The Transformer I'm using is here
http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?search_type=jamecoall&catalogId=10001&freeText=112513&langId=-1&productId=112513&storeId=10001&ddkey=http:StoreCatalogDrillDownView
The Heat Sink I have is here
http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?search_type=jamecoall&catalogId=10001&freeText=326596&langId=-1&productId=326596&storeId=10001&ddkey=http:StoreCatalogDrillDownView
I have it connected to a usb charger for my phone, which should use max 5v and draw 1 amp. I'm using a multimeter to measure the current. It is dynascan 2807 digital multimeter.
Update: When the charger is connected the voltage drops to .4 volts?
Update 2: Never going to copy schematics from Makezine website again. Or do any projects from there. Secondly thanks for all the useful feedback Im learning a lot. What would be the best way to do a variable power supply then or is it just not feasible. Should I just make a power supply with 3.3 5 9 and 12 options or is my problem the transformer output is too high so after rectification its way to high? I really only wanted a variable power supply from 3.3 to 24 yet it is much higher than that because of rectification. I'm just gonna blame makezine again.(Although I could have done some research on how bridge's increase voltage


texts: Modeling passive elements at high frequencies

texts:
It is well-known that any electrical passive element (Resistor, Capacitor,Inductor) contains parasitics that usually manifest themselves at high frequency ranges of operation.

For example, a resistor at DC can be modeled, simply, by just a resistance that depends on the material and geometry of the element. At higher frequencies, parasitic capacitance and inductance start to show up, and this can be experimentally found (for example) by:

Voltage - Current phase difference.
Impedance dependency on frequency.

The same argument is also valid for capacitors and inductors, in which their ideal model is altered and parasitic effects are added at high frequencies.

The plot of Impedance vs. frequency can tell us about these parasitics and when do they start to show up. They will also inform us about the valid frequency range of operation, in which after it, the element no longer behaves normally (An inductor acting as a capacitor after its self resonance frequency (SRF) for example) as shown below:

So when we mention the term "high frequencies", we (probably?) mean beyond the SRF, as elements start behaving as unintended.

Up to my understanding, every passive element generally behaves in a way that I thought of explaining by the figure below:

My questions are somehow interconnected and they are:

Is the concept of figure (2) correct?
In addition to the parasitics that were mentioned above, there seem to be variations in the physical values of L, C, and R themselves (Blue region in figure 2), meaning they all become functions of frequency: R(w), C(w), L(w). Is this true?

I concluded this from:

a. Skin effect for R, making it a function of frequency.

b. Picture #1 above (blue graph). Does the inductance really become negative, or is it the tool we are using that is telling me my inductor value was lost due to the large parasitic capacitance value?

How does the geometrical feature size of the passive element (regardless of its shape) plays a role in determining the frequency separating the green and the blue regions in figure (2)? In other words, is there a way to determine if I have to consider AC effects or not using the knowledge of my feature size?
Can we say line separating the blue and red regions can be represented by the SRF?


texts: SMD electrolytic capacitor identification

texts:
Hi! Anyone happen to know what is the capacitance and voltage reading of this capacitor? The print reads 228
PC
330
4
Thanks!


texts:
This is my first post here. I am facing the problem with level shifting circuit which is later the input for the ADC of the microcontroller. As far as the sine and triangle waves concern circuit is doing well within 100KHz thats what the project requirement but the square wave is causing the actual problem with output like a pid curve. The same problem is occuring both on the hardware and the simulation side. I also tried different opamps like tl081, lm358, lm324 and CA3130 but all of them give some sort of distortion.

Attached is the circuit diagram and output of square waveform. Any help would be appreciated.

Thanks in advance :)


texts: Is soldering SMD capacitors directly to TO-220 regulator pins a good idea?

texts:
A while ago I read here that it's a good idea to have ceramic capacitors on the input and output pins of 78xx regulators and to put  \$10 \mbox{ } \mu F\$ on the input and \$1 \mbox{ } \mu F\$ on the output. I can easily obtain such capacitors only in SMD format and that gave me the idea of soldering them directly to the pins of the regulator. This would give me more or less self-contained units which could be easily used on the dreaded breadboards or anywhere else I may need to use a 78xx or 79xx regulator (Assuming I manage to solder them without losing the capacitors, but that's another topic).

So my question is: Is there any reason not to solder the capacitors directly to the pins of the regulators? I'll most likely be using 1206 components.


texts: How (or if?) to isolate inputs to op amp summer?

texts:
I am building a function generator as an exercise.  I have a 9V power supply that I split into +/-4.5V.  The +4.5V side powers an Arduino that outputs the waveform as a series of 8-bit values on digital pins 0-7.  This 8-bit bus feeds an R2R DAC that converts it into a voltage from 0 to 4.5V, thus producing the waveform.

I want to be able to vary the amplitude and offset of the generated waveform. Also I want it to be centered on 0V instead of 2.25V. I figured I could do this by feeding (a) the waveform (from 0 to 4.5V), (b) -2.25V, produced by dividing the voltage between ground and the -4.5V rail, to center the waveform on 0V, and (c) a voltage from a potentiometer across the +4.5V and -4.5V rail, to control the offset, into a op amp summer. Another potentiometer would control the gain of the op amp and thus the amplitude of the signal. I am using the op amp in the inverting configuration to enable a gain of less than 1.

My problem is the the summer isn't working the way I expect. The op amp itself is fine, but the input to the op amp isn't what I thought it would be.

In the diagram, "In" is the input from the DAC (only three bits shown here for simplicity, converting the binary value 100), "Center" is the -2.25V, and "Offset" is the output of the offset pot. "Avg" is the average of the three, which will go into the op amp. If the op amp gain is 3, I should get the sum of the inputs. The voltage "In" from the DAC is +2.25V, while "Offset" is -2.25V, and with the pot centered and producing 0V, "Avg" should be 0V... but it's not. CircuitLab says it's -190.7mV. Similarly "In" is +1.03V instead of the expected +2.25V, and "Center" is -1.564V instead of the expected -2.25V.

I think I know what's going on here. All of these things are connected to the others, so for example "Center" affects "In." What I'm wondering is, what's the right way to fix this?  More generally, how does one isolate the inputs to an op amp summer so they don't affect the others?  I guess that one solution would be to buffer each of the inputs, but is there a simpler way?

Also--descriptions of op amp summers always say that the inputs should feed through equal-value resistors, thus the 10K resistors R11, R12, and R13. But that seems like it can't be right if what's behind the equal-value resistors is more resistors. What am I missing here?


texts: How to calculate suitable dummy load for a power-supply?

texts:
A beginner question - feel free to shoot me down

I'm looking to modify a retired AT SMPS to drive my ham-radio. This is to be achieved by tying all the +12V wires together so the maximum amperage may be drawn from it.

The SMPS lay unused for nearly 10 years now. Reading on the internet indicates the SMPS may burn itself out if powered up without a load. To test whether the SMPS is alive, I plan to put a dummy 10ohm 10W load across one molex connector.

\$ 12V \times 8A = 96W\$ so I guess it should be good for about 80-85W

For \$ 10 \Omega\$
\$ 10W \$ load:

\$ 10W = I^2 \times 10 \Omega \$

\$ \dfrac{10W}{10\Omega}=I^2\$

\$ I^2 = 1 \frac{W}{\Omega}\$

\$ I = \sqrt{1 \frac{W}{\Omega}} = 1A\$

So the \$10 \Omega\$ resistor can handle \$ 1A \$ current.

In reality though

\$ V = I \times R \$

\$ 12V = I \times 10\Omega \$

\$ I = \dfrac{12V}{10\Omega} = 1.2A \$

\$ P = I^2 \times R = (1.2A)^2 \times 10\Omega = 14.4W\$, or about 44% overload

What I need to know here

Are my calculations above in order?
If yes, should I get a higher rated load, say 20W (if such a power-rating is available)?

EDIT:
Just a short note to convey I finally got around to verification using a halogen car bulb rated at 110W (+: Thanks a tonne, all!


texts:
This question is conceptual question. May it is easy for engineers to explain cut off current in DC Motor.

In our formula, we are finding motor torque,

$$T_{motor} = C_{motor} \times (I_{cut} - I_{ideal})$$
where,

$$T_{motor} [Nm] = motor \ torque $$
$$C_{motor} \ [Nm/A] = motor \ constant$$
$$I_{cut} \ [A] = Cut \ off \ current$$
$$I_{ideal} \ [A] = Ideal \ current$$

In this formula, We know motor constant, motor ideal current but, we don't know cutoff current.

$$\textbf{what is cut off current in dc motor?}$$


texts: Darlington transistors killing the output

texts:
I was trying to recreate a subwoofer following this website. And the first 2 stages function as expected. The low pass filter is working which i verified , and the the second stage amplifies the peak to peak voltage by around 10x with a phase shift. However the third stage absolutely fails to give any output as can be seen in the image below. The way I understand it the TIP41 seems to be working fine, but the darlington transistors is where the problem is happening. TIP147/142.

I also have serious doubts if the circuit mentioned in the website is correct because that top capacitor seems completely useless as no DC passes through it. So might as well remove that connection. And then the 2 resistors in the top branch can be made into one. Also why are 2 back to back diodes needed?

Any and all suggestions are appreciated


texts: How to debounce a low pulse switch for automotive lighting

texts:
Hoping you guys can give me a hand with some wiring that I can't quite figure out!

Background: I'm trying to rewire a set of automotive lights - these are normally controlled by a computer but I'm trying to bypass that. I'm using the original light switch which is low pulse, and all the original stuff past the fuse panel, including the relay to drive the lights themselves, so I'm just handling sending a control signal out to that.

Current Setup: Right now I've set up a latching relay that is triggered on the low pulse of the oem switch, and sends 12V to the lights to turn them on. It's working in general, pressing the button turns the lights on, pressing it again turns them off. It looks something like this:

The issue: The switch bounces, resulting in inconsistent behavior. Lights flipping on and off rapidly when you press the button once, etc.

I'm pretty sure what I need is some kind of RC debounce circuit, but I can't wrap my brain around how to do it without short circuiting something. I only have access to the one wire coming from the switch, which is grounded when pressed.

I feel like there's something I'm missing here to make it work, any help would be greatly appreciated. I'm hoping that this can be solved without adding too many more components (a capacitor and resistor or two?) but I keep thinking my way in circles.

EDIT: Realized my diagram may be confusing. The 'Latching Relay' is not just a basic relay, it's a small circuit that's functioning as a latching relay. It's a black box to me though, I just supply +12V, Ground, and the low pulse input, and it toggles my 12V output. The issue is it's bouncing when I pulse the switch


texts: How to analyze this voltage doubler circuitry?

texts: What does this circuitry used for? How should I analyze? (It is inserted in the capacitor voltage doubler circuitry between the two stages)


texts:
I'm looking at this ISP programmer for the Atmega chips. I don't understand how the programmer's program is loaded. Is this chip programmed by the computer, or does it need to be pre-programmed?

Is my guess correct? Can I buy the needed 'naked' chip anywhere?


texts:
I have a question regarding the behaviour of a MCU's GPIO pins when configured in a certain way in hardware and software. In this case I am using a dsPIC33EP, but I believe this question is generally applicable to MCUs with push/pull outputs. At certain points in the circuit I am developing I need a pull-up resistor on the line to ensure that the connected chip has a hardware default state (in this case HIGH) even when the PIC has been turned OFF. If I pull up this line to a voltage equal to or greater than the power supply of the PIC (3.3V) but the PIC outputs a HIGH at slightly-below whatever this voltage level is... what happens to the output of the PIC?

I am using a 5V-tolerant pin on the PIC, which in the electrical specifications guarantees that it will tolerate up to 3.6V when the PIC is off, so that is not an issue. What I am uncertain about is how the PIC handles a (small) over-voltage condition on an output through a pull-up resistor.

If Vp is greater than VOH, will there be damage done to the chip?

On a side note, I have considered some solutions to this problem and will likely set up these outputs in software to behave as open-drain types. My question is regarding the feasibility of doing it using PUSH-PULL outputs, but if anyone has any other simple solutions to offer for application's sake, please feel free!


texts:
Reading this article I'm trying to understand this fragment where they are using a 1000:1 CT, with 0.1 V/A for a 100 ohm load.

A simple 12bit ADC will give us 2^12, or 4096 possible values. Applied
to a 3300mV range, this gives us a resolution of about 0.8mV. The load
pictured above has a total peak-to-peak voltage span of 1219mV, and
should be about a 4.5-4.7A load. The 1219mV give us a possible 1523
values for the voltage displayed at our calculated resolution, which
translates to about 3mA per ADC value when using our 100 ohm load
resistor (remember: it’s RMS!).

I know that 0.8 mV comes from 3.3/4096. I think there's an error with 1523 value, since I get Adc = (1.219*4096)/3.3 = 1513.
My question is: how is the ratio 3 mA per ADC value derived?


texts: Why are PCIE's coupling capacitors so large

texts:
I was looking at the PCIE specification, and I don't understand the
requirement for coupling capacitors.  For 2.5GT/s, the standard requires
AC coupling capacitors of 75nF to 265nF.  I tried to analyze the number
like in this article in
High-Speed Digital Design Online Newsletter.  The line is terminated at
both ends, the capacitor faces 100Ω, the RC time constant is 7.5µs to
26.5µs, or 19000 to 66000 bit intervals.  Since we're using 8b/10b
encoding and there are at most 3 ones or zeros in a row, the RC time
constant only needs to be large compared with 3 bit intervals, so the
capacitance should only need to be large compared with 12pF.  The
requirement of at least 75nF seems unnecessarily large.  Why is that?
If the capacitance were allowed to be around 100pF, the capacitors can
even be made into the chip.
The requirement for coupling capacitors can be found
here,
page 357, section 4.3.13.


texts: How to add safety to line voltage connected to D-SUB?

texts:
Pins 13, 14, and 15 on the D-SUB connecter will be connected to 120AC line voltage when their respective relays are on. I can imagine a situation where line is shorted to neutral (dirty connector, bent pins, etc) and I'd like to get ahead of that issue. Can I simply add a fuse, maybe with a fuse holder between line and relay common?

Per the accepted answer. I decided to use 4 panel mounted NEMA 5-15 outlets and just plug the pump, fans, etc into the outlets.


texts:
PORTCbits.RC13 = 1;
        PORTDbits.RD0 = 1;
        PORTDbits.RD11 = 1;
        PORTDbits.RD9 = 1;

The lines above will turn off an LED.  One at a time, they all work, but if I use all 4, they will leave one on for some reason!

I can re-arrange them and it is a different LED.  It always seems to leave on the 2nd to last entry.  Why?


texts: Is there a tool which generates State Diagrams from VHDL code? Also is there an easy way to indent VHDL code like in Visual Studio if I press ctrl + i it indents.


texts: Why don't LG RS232 commands work when the TV is on (only responds when off)?

texts:
I'm writing a new question after stumbling across this question which appeared to have similar symptoms:
LG RS232 Commands partially working.
As the other question noted, the power on command ka 00 01 works, but power off ka 00 00 does not.  I've tried several other common commands, and I can't seem to find a single one that works.  Some useful information:

To minimize fault points, I'm using a Windows box, USB to Serial converter, null modem w/ straight through cable, and typing commands directly into PuTTY
I have two LG TVs and one of them works exactly as expected with the same hardware/software; I've confirmed I can turn it on and off and execute other common commands
The TV that does not work is a 42LH50; I've tried lots of troubleshooting including disconnecting everything from the TV except power, trying with SimpLink on/off, trying with KeyLock on/off, trying with password protection on/off, going into the Service Menu to ensure the serial port communicates at 9600 baud
The on command results in a reply as expected based on LG's RS-232 guide, but then the TV also returns undecipherable bytes that make no sense and do not follow the guide.  The bytes do not appear to be the same each time and get written out through the duration of while the TV is turning on.  After that, complete silence; no commands get a reply whatsoever (not even NG).  I have the session log that I can post, but I don't have access to it at the moment.  There are no problems repeating the experiment after turning off the TV by remote or power button.

Any help would be appreciated.
EDIT: Also putting this in the comments:

As far as I can tell, no command other than "power on" works.  I spent a whole day troubleshooting my cables trying to send "power off" commands (since I read that "power on" commands don't always work (at least for USB) and believed that "power off" was the most basic command.

EDIT: Changed my title to be a question.
EDIT2: Updated question title to better-reflect new information
EDIT3: I discovered that all commands I tried reply with NG when the TV is turned off.  The TV replies with OK with a command to turn on or off or get power status, so long as the TV is off.
Here is a sample 28 byte output in response to ka 00 01 ([] is space, ?? indicates a seemingly random byte:
Hex:   |61 20 30 30|20 4f 4b 30|31 78 eb df|ff 18 f4 78|
ASCII: | a []  0  0|[]  O  K  0| 1  x ?? ??|?? ?? ?? ??|
Hex:   |fa 32 14 8a|ca c9 ff f4|4f fb ff 00|
ASCII: |?? ?? ?? ??|?? ?? ?? ??|?? ?? ?? ??|
The random bytes seem to be different each time, and a different number of them (I've seen 26 and 27).


texts: Atmega328 fast PWM (mode 7) of timer 0 not working as expected

texts:
I am blinking an LED on PORTB5 using timer 0 in mode 7. The time between blinks is computed as $$ \frac{(\text{OCROA}+1) \times \text{prescaler} \times \text{timerCount}}{\text{FCPU}} $$ \$FCPU=16MHz\$. With \$OCROA=124\$, \$prescaler=1024\$, and \$timerCount=125\$, the time turns out to be \$1 \space second\$ and this works as expected. But with \$OCROA=16\$, \$prescaler=1\$, and \$timerCount=2956793\$, I would expect the time to be \$~3.14 \space seconds\$, but I am getting something around \$12 \space seconds\$.

Code that works as expected:

#include <avr/interrupt.h>
#include <stdint.h>

volatile uint32_t timerCount = 0;
ISR(TIMER0_COMPA_vect)
{
        ++timerCount;
}

int main(void)
{
        DDRB |= 1 << DDB5;
        TIMSK0 |= 1 << OCIE0A;
        TCCR0A |= 1 << WGM00 | 1 << WGM01;
        TCCR0B |= 1 << WGM02;
        OCR0A = 124;
        sei();
        TCCR0B |= 1 << CS02 | 1 << CS00;
        while(1)
        {
        if(timerCount >= 125)
                {
                        PORTB ^= 1 << PORTB5;
                        timerCount = 0;
                }
        }
        return 0;
}

Code that  does not work as expected:

#include <avr/interrupt.h>
#include <stdint.h>

volatile uint32_t timerCount = 0;
ISR(TIMER0_COMPA_vect)
{
        ++timerCount;
}

int main(void)
{
        DDRB |= 1 << DDB5;
        TIMSK0 |= 1 << OCIE0A;
        TCCR0A |= 1 << WGM00 | 1 << WGM01;
        TCCR0B |= 1 << WGM02;
        OCR0A = 16;
        sei();
        TCCR0B |= 1 << CS00;
        while(1)
        {
        if(timerCount >= 2956793)
                {
                        PORTB ^= 1 << PORTB5;
                        timerCount = 0;
                }
        }
        return 0;
}

What could be the issue with the latter?


texts: What's the difference between ATMega1284 and ATMega1284p?

texts:
I want to buy an Atmega1284p, doing a research on my local hardware seller (RS), I've found two models, the Atmega1284p-pu and the Atmega1284-pu. Reading the specs I don't see any difference (maybe I am missing something).

The only thing I saw is that Atmega1284-pu has the window to clear the memory using UV light. I really want to understand the difference, because one of them is cheaper and this will affect my criteria.


texts:
I need to send serial data ( approx. 60kbs continuous ) over a non contact interface (basically a rotating pulley).
I can transmit power to the device with a coil rotating inside another coil (inside diam 65mm) OK.

I have a PIC processing lots of maths to calculate the data I need to transmit.

I have researched lots of wireless charging and data transfer and have built circuits but have limited success in the back scatter data transfer. Not fast enough.

There are many RF modules to use but I will have many units in close vicinity so cross talk could be a problem.

In my design there will be 2 PCBs almost touching each other, but rotating. I keep coming back to a simple low power FM data transmission with a PCB circular aerial close to another with limited angle of same diameter.

No bi-directional data transmission is required. Any suggestions.


texts:
I've made an arduino based audio spectrum analyzer & it requires audio input from a music player/laptop/phone earphone out.

I've tested this with earphone out from my audio player (Yamaha MCR-B142) and it worked fine.

Sadly when I connect earphone out to the Arduino, sound stops coming from speakers.

I want to listen to audio from music player while the signal goes to the Arduino. I understand this is the nature of the earphone out. So I tried to get output from speaker out.

But the amplifier (YDA164 amplifier IC) has differential outs and I'm confused about getting a single ended output from that.

Amplifier maximum output is 15W @ 6 ohms.

What I want is to get an earphone out level signal from the music player.

Please assist me as I've spent so many hours to reach thus far.

Let me know if the information is unclear.

I learned lot of things through this project.


texts:
I have a primary inductor connected to a voltage source with frequencies varying from 100kHz to 15MHz. This primary inductor induces a voltage across a secondary inductor via coupling and I want to amplify that induced voltage and put it through an ADC.

I can do this voltage amplification easily enough with an ideal op amp in non-inverting configuration simulated in LTspice. The two figures below are the schematic and simulation results for the ideal op amp.

However as soon as I simulate it with a real world model op amp like the LT1818 I get some nasty oscillations on the input node of the op amp which also results in oscillations of the output node. These oscillations always appear even when I vary the frequency in the primary voltage source. I understand that it's probably related to the phase margin of the op amp and the inductive input, but I don't know how to fix it. The two figures below are the schematic and simulation results for LT1818.

How do I get rid of these oscillations? I have tried another op amp like the LM6172 and I also get similar results. I was also wondering if there is a better way to read the voltage out of a coupled inductor?

Thanks!


texts: Using LC oscillator to create square wave AC

texts:
A full wave bridge inverter lookslike this:

simulate this circuit – Schematic created using CircuitLab
However this isn't practical because we have turn on/off the pairs of switches every time and it is not guaranteed that the rate we do this remains costant.
In the place of transistors we have electrical switches not mechanical switches called transistors.
The diagram looks like this:

simulate this circuit
I have searched through the Internet and havent found a single project of a square wave inverter without a timer or a microproccessor turning the pairs of transistors on and off.
I was wondering if we could do it with an LC oscillator providing the frequency of turning on/off the transitors.
Let me show you what I mean.I will do it with 1 transistor to make it simplier to be understood.

simulate this circuit
In the tank circuit the electric field of the capacitor will become the magnetic field of the coil which will then again become the electric field of the capacitor.Every time this happens the direction of the electric field and the magnetic fields will change.
This can induce an alternating voltage to the loop with transistor turning it on and off every half cycle of oscillation.What do you think?


texts: One action per switch press with microcontroller

texts: I've been trying to find out a way for quite a while now on how to have a momentary switch only latch for a short time, and then unlatch. I can't seem to wrap my head around what to do. If this helps, I was going to work on a laser tag gun, so when the trigger is pressed, only a short burst happens once, not continually. Thanks in advance, sorry if this has been posted about, I simply can't find any resources about it.


texts: Sine wave distortion in simple op-amp circuit- bypass capacitor?

texts:
I've built a simple unity-gain buffer op-amp circuit from the UCSB lab here, with a 12V power supply and a 1V, 1 kHz input sine wave.

simulate this circuit – Schematic created using CircuitLab

Everything seems to be going well- except for that the output sine wave has a drop-off on the lower part of the signal, which will start if you leave the circuit alone for a couple seconds. Here's a gif I made of the problem (YouTube here):

The signal stays in the strange raised state indefinitely, but if I short the leads of the +V bypass capacitor, the signal returns to a normal sine wave. If I short the leads of the -V bypass capacitor, the signal turns into the raised state.

This seems to me like there is a problem with the values of the bypass capacitors (currently 104 or 0.01 uF). I know from playing around with the circuit earlier that two 0.0001 uF bypass capacitors just don't "fill" the sine waves out all of the way.

Is something wired wrong? (I connected all of the earth grounds together... is that good?) Is 0.1 uF just not large enough for the bypass caps? Or should I add a resistor somewhere? If so, why?

EDIT 11/16/15:

Here is my shot at a working circuit. Is this what is recommended?

simulate this circuit


texts: 24V to 5V DC conversion for Raspberry Pi

texts:
I'm trying to power several devices off of a breadboard. For simplicity I want to power these all from the same PSU. The highest voltage amongst the devices is 24V. I was looking to use a 24V 2A (maybe 3A) DC PSU to power all of these.

I'm wondering how I could do this? I've seen these and wondered if they would achieve what I want (I realize I might have to build in a regulation circuit for the Pi with this).


texts: connected d flip flop, propagation time = hold time?

texts:
When we connect two d flip flops,

the propagation time and hold time have to be the same?

or the propagation time have to be bigger than the hold time?

I'm really confused please help!!


texts:
I came across one circuit for making fuse using transistors. In the circuit my doubt is how the voltage is dropping across Q2 when I changes the load resistance value (hence current). Usually the pnp transistor is suppose to have constant 0.2V drop across EC.

Please help me to understand how the below circuit is working,
(This circuit is working fine as per simulation results)


texts:
I am trying to receive serial on a stm32f411.

I decided to monitor the the RXNE flag to check the serial buffer. I can get the flag to work, however, the issue is that I do not think it is working completely.

I set up a test to increment a counter based on how many times I need to read the DR register. The issue is I cannot get it to increment the counter more than once. To verify this, I simply made a loop to turn on an LED based on how many times I accessed the DR register.The max I can make the LED Blink is 2 times. Is my logic in my code wrong?

/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f4xx_hal.h"

/* USER CODE BEGIN Includes */

#include <stdbool.h>

/* USER CODE END Includes */

/* Private variables ---------------------------------------------------------*/
UART_HandleTypeDef huart1;

/* USER CODE BEGIN PV */
/* Private variables ---------------------------------------------------------*/
uint8_t pdiddy_increment = 0;

int pdiddy[15];
/* USER CODE END PV */

/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
void Error_Handler(void);
static void MX_GPIO_Init(void);
static void MX_USART1_UART_Init(void);

/* USER CODE BEGIN PFP */
/* Private function prototypes -----------------------------------------------*/

/* USER CODE END PFP */

/* USER CODE BEGIN 0 */

// detect if anything is in serial buffer
uint8_t Serial_Available(UART_HandleTypeDef *huart)
{
    uint32_t RX_State;

    RX_State = huart->Instance->SR & UART_FLAG_RXNE;

    //something is in the buffer
    if (RX_State > 0)
    {
        return 1;
    }
    //nothing is there
    return 0;
}
/* USER CODE END 0 */

int main(void)
{
  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_USART1_UART_Init();

  while (1)
  {
      while (Serial_Available(&huart1))
      {
        /*read DR and put value in array*/
        /*Reading DR, increment shift*/
        pdiddy[pdiddy_increment] = (uint8_t)(huart->Instance->DR & (uint8_t)0x00FF);
        pdiddy_increment++;
     }

     while (pdiddy_increment > 0)
     {
       HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_SET);
       HAL_Delay(400);
       HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET);
       HAL_Delay(400);
       pdiddy_increment--;
     }
  }
  /* USER CODE END 3 */
}


texts: Leaving a battery charge overnight using a bench power supply can cause damage?

texts:
I recently bought a 6V, 4.5Ah sealed lead acid battery. I want to charge it using my variable power supply. If the battery gets full and it is still connected to the power supply, it can get damaged? I think battery chargers have a "fully charged" indicator and stop charging when they are full but my power supply is just a power supply

Battery info:

Constant Voltage Charge (25 celsius)
Standby use 6.75-6.9V
Initial Current: 1.35A


texts: Can I make endless parallel li-ion connections?

texts:
I'm looking into building my own li-ion battery pack. I read about linking the cells in parallel and in series, and how to add a BMS. I would like to build a 12V pack with a very large  capacity (mAh). So I need to build a 3S pack and then link the 3-series connected cells in parallel.

What I don't understand is: does the BMS need to know about the number of parallel connected cells, or can I simply keep adding them up?

For example, one BMS I was looking at had this illustration:

It shows 2 parallel connected packs, but can I also make it 3P, or 10P, or 150P?


texts: I'm currently making a power supply with a 32 volt AC out, so the rectified voltage would be 32*1.414-diode drop. The value comes around 44 volts. My question is, is it okay to hook up a 50 V rated capacitor for filtering in this case? As the voltage would be 44 V and a very low headroom.


texts: How to use 350mA constant current driver with a 180mA LED

texts:
As part of a domestic down-lighting system I've got a 350mA Constant Current driver, but i'm advised the LEDs I want to use should be driven with a 180mA CC driver. Changing the driver or LED's is going to be tricky.

Can anyone see any problem with putting a resistor in parallel with the LED to drop the current from 350mA down to the recommended 180mA?
How would I go about calculating the appropriate resistance?

The forward bias of the LEDs is around 0.6V.


texts: Battery Capacity Tester - Schematic Review

texts:
I designed a circuit to test Lithium battery (3.7v) capacity.
My measurements do not need to precise but should be relatively accurate between each batteries so think this should do.
Schematics: Using Single LM358 OP-AMP (Edited)

Working: Voltage divider R1 and R2 create roughly 3.2v on inverting input of U1, Initially Q1 keeps non-inverting input of U1 low which keeps output of U1 low,
When PushButton is pushed, it turns off Q1, voltage on non-inverting input of U1 are now equal to battery voltage (lets say 4v). Output of U1 goes high which turns on Q2 and Q3.
Q2 keeps Q1 turned off until voltage on non-inverting input of U1 are above 3.2v, when battery voltage are below 3.2v output of U1 goes low which turns off Q2 (and Q3) and Q1 turns on again to prevent circuit from restarting when battery voltage rise back above 3.2v
Q3 turns on drain circuit where second op-amp U2 is configured as unity gain amplifier which drains battery by the voltage set by potentiometer P1 through a N-Channel Logic Level Mosfet and Load Resistor, Not sure about about C1 I just added there to possibly suppress some noise.
Analog Watch is just a wrist watch which gets powered by 1.5v from potentiometer to measure time.
Before I put the circuit together, It is my first circuit design and I lack basic knowledge of electronics, circuit works in stimulator (easyeda) but I need some clarification:

Resistor Values: Other than voltage dividers, I just randomly put resistors in there, I have no idea what the values should be.

Capacitors: I only have one capacitor which I doubt should be there. Do I need any capacitors and where?

Watch: Can I power my analog wrist watch through potentiometer like illustrated in schematics or should I use a proper buck converter?


texts: Constant current battery charger question

texts:
I am planning to make a simple constant current lead acid battery charger with LM317. I am little confused with how it remains 'constant current' supply over time with rising battery voltage. I mean, if I measure 12.5v on the battery and build the charger to supply 1 amp current, will the battery charge upto 13.8 volt utilizing the same rate of current? And 17.5 or 18.8 what would be the best input voltage to the circuit to achieve 1amp constant current rate throughout the charging process0? Can I even increase the input voltage above 18.8v without harming the battery?

Please note, I am kind of experimenting with the alternatives. So I would definitely keep measuring the battery voltage manually after certain interval and manually stop the charging process when 13.8 is reached.

The schematic


texts: How is it possible to drive VGA displays at such high pixel clock frequencies?

texts:
I'm working on a digital circuit using discrete components to drive a 640x480 VGA display in a 80x30 text mode.

For a 640x480 display, the pixel clock is 25.175MHz, which has a period around 40ns. I don't understand how I'm supposed to be able provide a new pixel to the display this often.

The basic architecture for my circuit is as follows:

Binary counter for horizontal pixels counts up at 25.175MHz to 800 (640 visible pixels + 160 for front porch, sync, back porch).
At 800, increment vertical line counter (and reset at 525 lines)
Using horizontal and vertical position, derive the x,y coordinate of current character.
Using x,y coordinate of character, index into video memory to retrieve ASCII character.
Use ASCII character to index in character ROM to obtain bit pattern for character
Use parallel to serial shift register to convert 8 pixel line of character to individual bits at pixel clock frequency

If you follow the chain, it goes:
Counter -> RAM -> ROM -> Parallel to Serial Shift Register

Using the fastest components I can find, the propagation delays and access time add up to around
15ns + 20ns + 70ns + 15ns = 120ns, much greater than the 40ns period for 25MHz.

At even higher resolutions and refresh rates, you can have pixel clocks well above 100MHz which will be a 10ns period.

How is it possible to provide new pixels to the display every 10ns when just the access time for RAM/ROM are already well above it, not even considering all the other signals in your system?


texts: How to control secondary circuit using TTL

texts:
I have a very newbie and possibly stupid question, but I have been searching many sites and just can't find an answer.

Imagine you have a circuit, some device (electro-motor) that is powered with for example 20V dc power supply. Then you have another TTL circuit.

I am able to programatically change the output on TTL circuit to 0 (0,8V) or 1 (5V), but what I need to do is control the second circuit, using this digital output, that means, for example if I send 1 to output, the 20V device is switched on, when I send 0, it's turned off.

What is a simplest way to achieve this?


texts: Minimal pulse width to actuate a solenoid

texts:
I'm powering a solenoid from a battery, so I want to spend the minimum amount of power to get the job done. In this case the solenoid doesn't even have a return spring, so as soon as the armature has moved a couple of millimeters, the job is done. Can I measure the current draw or another electrical property to see when the armature has moved? I haven't been able to find a plot of how the current draw behaves in response to a step voltage.

As I understand it, the inductance of a solenoid's coil changes significantly as the armature moves. If it doesn't result in a clear change in the current draw as I feed it DC (or a falling voltage from a charged capacitor), would it be feasible to measure the momentary inductance by modulating the supply current with some AC signal?

If all this fails, I can certainly fall back to driving it with just a timed pulse and experimenting to see what the required time is.


texts:
I've been trying to use spi.write() in a Ticker function, but the following error is thrown out onto the serial line:

Code: 324 Module: 255
Error Message: Assertion failed: _id
Location: 0xCE97
File: /extras/mbed-os.lib/rtos/Mutex.cpp+51
Error Value: 0x0
Current Thread: rtx_idle  Id: 0x1000037C Entry: 0xF117 StackSize: 0x200 StackMem: 0x10000408 SP: 0x10007F30
For more info, visit: https://armmbed.github.io/mbedos-error/?error=0x80FF0144
-- MbedOS Error Info --

I'm now starting to wonder whether mbed's SPI is non-reentrant.

If so, what are my options? Not using Ticker would involve a lot of code being re-written, which I really don't want to do. If I use the internal LPC1768 SPI registers instead of the mbed SPI class, would the problem go away?


texts: i2cdetect showing only one slave at a time

texts:
I want to use two MCP23017-E/SP chips to extends the ports of a Raspberry PI 3.
I'm using the i2c-tools on the Raspbian to confirm everything works. I've wired up both chips separately pinned them to two different addresses (0x20 and 0x24). With each connected separately I'm able to use them just fine, but when I use/power both at the same time I see very a strange behavior. It seems that only one of them is active at a time. Running i2cdetect shows varying results on every run:

# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- 24 -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Also i2cset/ i2cget would fail one time and succeed other times.

Colleges mentioned that the pull-up resistors might be required, but I assume that the RPi3 has 1k8 Ω resistors built in and I would not need additional ones.

The wiring is done like this, just with the Raspberry connections on SDA1 and SCL1 and Vdd on 3.3V.

How could I debug this further?


texts:
I'm trying to make a universal power circuit for STM32L0-based project. I want to use any type of batteries - alkaline or li-ion either (single cell). Can you help me choose the best converter?
It should work in both directions because input voltage will be from 0.9V to 4.2V.
I have a prototype on the breadboard using two converters - the first boosts Vin to 5V, the second drops it back to 3V3. It is not very effective and 5V is not needed all the time (I will make it by separate boost converter.)


texts: DFT: Given input signals, is there a way to compute the real part of DFT output without writing out the summation?

texts:
If I am given the inputs $$u = [2,1,0,1,2,1,0,1]$$ and asked to compute the real parts of the DFT outputs U(m) I would need to apply the formula $$U(m) = \sum_{k = 0}^{N-1} u(k) e^{\frac{-j2 \pi mk}{N}} $$

When m=0 I get U(m) =8.

I tried calculating m=1 by hand, wrote out the entire summation and got $$U(1) = 2 + (\frac{1}{\sqrt2} - \frac{1}{\sqrt2}j) + (-\frac{1}{\sqrt2} - \frac{1}{\sqrt2}j) + (-2) + (-\frac{1}{\sqrt2} + \frac{1}{\sqrt2}j) + (\frac{1}{\sqrt2} + \frac{1}{\sqrt2}j) = 0$$

First of all, is this computation correct?

Second of all, is there another way to think about this problem without writing the summation out?


texts: Very wide range high voltage measurement with optical isolation

texts: I have a voltage source I'd like to measure, it is from 0V to 1kV, any value in that range. The accuracy isn't that important, but measuring with an accuracy with 1-5% would be perfect. This has to be then optically isolated, so I could read the voltage on a microcontroller. The second part is not hard at all, when using regular optoisolators. The problem is scaling the voltage down so that I can light up the diode of the optoisolator, and keeping the results semi-linear or semi-logarithmic so I could calculate the output voltage. Is using voltage dividers with a diode the only available option? With such a wide input voltage range getting good results with that method is not possible, because the voltage defines what resistor types and values to use. Any advice?


texts: Pull-up or pull-down when building an LED ROM for 74HC logic levels?

texts:
I want to build a LED ROM (a diode-ROM, but using LEDs).

The LEDs will be driven from the outputs of a 74HC138 or similar. They will drop 1.6 - 1.7 V (red).

The ROM will have eight words of memory, each word being 12 bits wide (because that's what I need).

Each bit will be an LED socket. The presence of an LED indicates either a 0 or a 1 (depending on pull-up/down), and the absence indicates the opposite value.

When a word is accessed, the value's LEDs will light.

Is this feasible with 74HC levels and driving characteristics, without further components?

Should I pull-up or pull-down?

or

(If there is no difference, I will pull up, as that will light the accessed 1s, which seems more intuitive.)


texts: Cache miss types: capacity miss vs. conflict miss

texts:
Categorizing Cache Misses
I was wondering if somebody could provide an example illustrating a capacity miss in contrast to a conflict miss for a 2-way cache with arbitrarily small line size and cache data array size.  I was having trouble distinguishing them from each other.
My book tells me the following information on each miss type without providing a good example of each:

Capacity misses occur when the amount of data referenced by a program exceeds the capacity of the cache, requiring that some data be evicted to make room for new data. If the evicted data is referenced again by the program, a cache miss occurs, which is termed a capacity miss.
Conflict misses occur when a program references more lines of data that map to the same set in the cache than the associativity of the cache, forcing the cache to evict one of the lines to make room. If the evicted line is referenced again, the miss that results is a conflict miss.
Capacity and conflict misses both occur because data must be evicted from the cache to make room for new data, but the difference between them is that conflict misses can occur even when there is free space elsewhere in the cache. If a program references multiple lines that map to the same set in the cache, it may be necessary to evict some of them to make room for new data, even if every other set in the cache is empty.
Capacity misses can be reduced by increasing the size of the cache so that more of the data referenced by the program fits in the cache simultaneously.
Conflict misses can be reduced by either increasing associativity, so that more lines that map to the same set can be stored in the cache, or by increasing capacity, which can cause lines that mapped to the same set to map onto different sets.

Assuming you have a 2-way cache, and you receive 3 address read requests that all correspond to different address pages, but these address pages map to the same cache set, then it seem to me that you would exceed the capacity of your cache after the second read because you have already filled both of the lines for the given set for 2-way associativity...and therefore you need to evict one of them to load the 3rd address into the cache?  I don't get it... a capacity miss is the same thing as a conflict miss...
or is it, evicting the 2nd line to make way for 3rd line is capacity miss, then rereading first address again after evicting it to make way for third address is a conflict miss?
My Contrived example:
address1, address2, address3, address4 => all map to same "set" of cache
read sequence for 2-way cache.
address1
address2
address3 <- capacity miss (evicting address1 and replacing with address3)
address1 <- conflict miss
address3 <- conflict miss
address4 <- capacity miss (evicting address2 and replacing with address4)
address2 <- conflict miss
address3 <- conflict miss
Am I close or just plain wrong?  To me, it just doesn't seem worth keeping track of the difference...


texts: Input cap of power amp affecting power supply loop compensation?

texts:
I have a TPA3221 power amplifier powered by a TPS55340 30V Boost converter. The boost converter datasheet provides very a specific formula for calculating the loop compensation parameters, based on the "equivalent output capacitance" and the "equivalent load resistance".

The power amp specifies very large input capacitors in its datasheet (470uF or higher).

How can I reconcile these two concerns? Do I need to include the amplifier's input capacitor as part of the boost converter's "equivalent output capacitance"? And how do I calculate the "equivalent load resistance" of a highly complicated amplifier IC?

Is this a situation where one simply has to guess and check? Are there any rules of thumb to follow here?


texts: Is it possible to make current flow through a transistor from the emitter to the collector without supplying voltage to the base?

texts:
I've started studying bipolar junction transistors, and I'm trying to understand how they work.
When learning about how a transistor work, you always see it connecting 2 circuits, the smaller one involving only the emitter and the base, and the largest one with the collector too.
According to what I understood current flow in the largest, only if it flows in the smallest.

If I disconnect the base and the smaller cirucuit, or remove the voltage generator from that circuit, current stop flowing in the largest one too.
For this reason a transistor in a circuit if no voltage is supplied to the base (or the base not attached to anything) is said to be "off".
As my current understanding (it may be wrong), in this scenario, however you put the voltage generator the current can't flow due to the presence of an electric field inside the transistor ( depletion layer).
But what would happen if I increase the voltage?
Is there a trashold limit where the depletion layer is overcomed? Or is, more generally, possible to make electricity flow from the emitter to the collector without supplying voltage to the base?


texts: How do I create voltage ripple for the purpose of testing?

texts: I am aware of the solution to reduce ripple in circuits using smoothing capacitors.  But I want to create varying levels of ripple to stress test some scenarios where the power supply is not optimal.  Is there some way to create ripple into my test circuit?


texts:
I wanted to understand and derive an equation of simple low pass filter that shows the location of pole in frequency response graph (Bode plot).

So, here is the derivation:

$$V_{OUT}=\frac{V_{IN}*X_C}{X_C+R}$$
$$\frac{V_{OUT}}{V_{IN}}=\frac{X_C}{X_C+R}$$
$$\frac{V_{OUT}}{V_{IN}}=\frac{\frac{1}{j\omega C}}{\frac{1}{j\omega C}+R}$$
$$\frac{V_{OUT}}{V_{IN}}=\frac{1}{1+j\omega RC}$$
$$\frac{V_{OUT}}{V_{IN}}=\frac{1}{RC}*\biggl(\frac{1}{j\omega+\frac{1}{RC}}\biggl)$$

In the last equation, term \$\frac{1}{RC}\$ in the denominator should show pole location.

To verify this, I entered values of \$ R=10k\Omega\$ and \$ C=10\mu F \$ into LTSpice, whereas I should see pole at \$j\omega=10\$.

But for some reason, LTSpice shows me that pole is located at \$j\omega=1.6\$ or \$1.6Hz\$ (that is where -3dB point is located). Even cut-off frequency equation \$f_{cut-off}=\frac{1}{2\pi RC}\$ indicates this specific frequency. Did I messed up something, when deriving pole equation? Can anyone explain me a solution to solve this problem?


texts: Will two 14Ga. wires handle the same load as one 10Ga. wire in a 12V DC application?

texts:
I'm wiring up a trailer brake controller unit on my 79 Jeep Wagoneer and I want to run 10Ga. supply wire to the unit. I bought 20 feet of 10Ga. wire while in town today and ran said 10Ga. wire to the trailer hitch for my trailer brakes. Unfortunately, my Wagoneer is a little longer than I thought and I don't have enough 10Ga. to run to the battery for the control unit power supply.

My plan is to run 10Ga. from the battery to the supply side of a 30A DC breaker I'm installing on the firewall. Then, Off the load post I plan on running two 14Ga. wires and then joining them at the 10Ga. butt connector where they join the harness for the controller.

My big question is, will two slightly lighter wires carry the same load as one larger wire? And if so, what's the math on figuring what gauge of two wires is needed to compensate for the lack of a single heavier wire?


texts: simple way to measure wheel spinning speed with Adroid phone + magnet (and maybe Reed Switch)

texts:
I'm trying to create the simplest/easyest/cheapest possible way to measure the speed at which a wheel is turning (like a bicycle speedometer) with a smartphone. On the phone the information will be further processed and used as the display of an  open-rower-erg project.

This is an open-source project. Although I can program a bit, I need opinions/answers from electrical engineers on the following options I'm considering for this measurement:

1) The simplest I could think of was attaching a small magnet to the wheel and placing the phone close enough to the wheel that the phone's magnetometer could record the magnet passing. Then the phone would process the signal to extract angular velocity.
Is this idea feasible (the fact that no other tread mentions this makes me a little skeptical)?
Could that magnet, systematically moving on the same direction, damage the phone or drain the battery?
How precise can I be with the magnetometer? how fast could I sample it?

2) Another alternative would be to use Reed Switch, probably scraped from a cheap bicycle speedometer, and try to send the signal though the phone directly, either through the micro-usb or the headphone jack. Other treads(tread2, tread3, tread4) suggest using the headphone jack would be better then the micro-usb slot. Is this really an alternative? How could I do that?

3) Others at the open-erg-tread1 suggested an Arduino, with the USB output. What would be the cost of that? This other tread5 suggests a similar idea to my point 1, above, sending information from Arduino to Android via magnetic field and the phones magnetometer.

Any suggestions are welcome, I'm having a difficult time finding good references on google. Thanks in advance

I don't have enough rep to put more than two links. The others are:
tread3 https://stackoverflow.com/questions/20148791/android-app-monitor-reed-switch-usb-connected
tread4 https://stackoverflow.com/questions/7806596/android-usb-bit-counter
tread5 http://jdesbonnet.blogspot.com.br/2011/05/arduino-to-android-io-on-cheap-aka-poor.html

EDIT: adding estimates for the max rotation speed (very rough, coming from imagining an erg, not actually measuring, please correct my numbers if you know better):

x) dive lenght: 1.90m (~6"3')

y) cog circunference: 91mm (= 29mm cog diameter * PI)

z) turns per drive: x/y = 20.8

t) drive time: 0.6s - 0.9s (when rowing fast)

finally:

w) max RPS during drive: from 33.3rps (20.8/0.6) to 25rps (20.8/0.8)


texts:
My design requires a 16-bit DAC with 100kS/s plus and SPI communication.
Strangely to me, the cheapest 16-bit DACs that meet the requirement (parametric search) have a 24-bit SPI word, like the AD5662 (pdf) I'm trying to use. The least significant 16-bits are the output value to update and the upper 8-bits are configuration (only 2 of the 8 are actually used). This mode of operation is inconvenient for my 16-bit micro-controller, as the associated ADC in the design has a 16-bit SPI word, ADC161S626 (pdf). This means my micro-controller needs to write x3 8-bit packets instead of x1 16-bit.

Why do manufactures do this? What would be the best way of perform the communication?

If both DAC and ADC were 16-bit SPI word I could read and write at the same time without having to reconfigure the SPI module and data in the micro-controller.


texts: Help selecting component to detect red laser light

texts:
While I did find a little information in searching your site
I am still unsure what to use in my application.
I want to detect the (red) laser light hitting a screen or
target. My questing is what is a good device to use, I read
that photo diode is faster than a photo transistor. Can any
one give me any part numbers to try?

Application
Simple laser target, when the training pistol laser hits
the target I need a fast detection. I will experiment with
the final output later in this project, to start with I might
just turn on a light. I also have realized that other indoor
lighting may need to be filtered, I have knowledge of filters,
I will later research this.