texts: How can I understand if two lithium ion battery types are exchangable or not?

texts:
I am kind of beginner about electronics and I want to understand how can I compare two different model of the same kind (lithium-ion) batteries?
I would like to understand this because I sent my robot vacuum to warranty and they exchanged the original battery (Hu Nan Giantsun power, 18650 4S1P (4INR19/66)) with another brand (in fact white label pack of 4x 18650BD) and I want to be sure they are compatible because of fire safety etc. and I would like to learn how to compare batteries.
Here is my original battery

And they changed it with NCR18650BD pack (white label but these codes can be seen under white plastic cover). It seems they manufactured by Panasonic but there is Panasonic label on them, is that possible or are they fake/non-Panasonic?) They look like this;

First difference is, new batteries are 3200 mAh batteries, what can it change? Duration of power? And the specs I've found on internet shows these data but I need help to correctly interpret and compare.

And it seems both of the battery packs has some small circuit under/top of them. What it does? Does it have any affect on charging/protection or just simple connection circuit?
And how can I be sure about the safety of using these new batteries?


texts: HC-SR04 ultrasonic sensor water proofing

texts:
I am using the above said HC-SR04 ultrasonic sensor with Arduino pro mini. Till now, able to get the range working properly.
My plan is to use this in the overhead tank to measure the quantity of the water present in the tank. My worry is that, the sensor will be facing the water vapour all the time as shown in the figure (Not actually my setup but close one).

How can i protect the sensor from the vapors?
I have conformal coating option but seriously i have no idea still about reaction of the sensor for the same. I could still protect rest of the circuitry.
Whether the water vapor affect the measurement and behavior of the sensor?


texts: Cat5 wire connector does not appear to be continuous

texts:
I'm trying to use a cat5 network cable and connection jack (what I'm calling the female version of cat5) as a way to quickly connect/disconnect 8 wires for an electrical project. I bought a few cat5 cables and checked them for continuity and all the wires are intact. Then I bought an old D-Link router and unsoldered a cat5 jack from the board.

My issue is when I plug my cat5 cable into the separated jack and check the continuity from the other end of the cat5 and the pins sticking out the bottom of the jack. I get no signal connection. I assumed I may have messed up my soldering so I tried plugging the cat5 cable into one of the other ports still attached to the board and I this time tested continuity from the cable to the still soldered pins showing on the back side of the board.

Is there some kind of gate or diode mechanism in the cat5 receiving jack that keeps it from having signal pass through until enabled?


texts: Reducing magnetic field span, effects on induced EMF/current?

texts:
A conductor of known volume (V) passes a uniform magnetic field(B)with a constant velocity (v) the conductor is a source of induced EMF, a power source to a circuit. The induced EMF can be calculated via formula:
ϵ=−vBL
A diagram of this:

The conductor has resitance(R) and induces current equal to:

I=VR
Excluding all other factors that would retard the motion, what would happen if the magnetic field span is reduced? Span; meaning It covers a smaller volume(i.e area) of the conductor at the same magnetic field strength as before, moving at the same velocity:

From the motional EMF formula, if all the vairbales are the same (v,B,L) it should induce the same ϵ. The only difference is the induced current correct? How would I go about calculating it?

EDIT: There is a connection to the conductor via an exterior circuit from the top and bottom, complete connections(not partial) but fully connects the top surface and bottom.


texts:
I am designing a 6-layer board, with stackup like this:

1-TOP slow North/South
2-GND
3-Signal high speed East/West
4-Signal high speed North/South
5-VDD
6-Bottom slow East/West

PCB plane spacing is:

Layer1
- 4 mil -
Layer2
- 20 mil -
Layer3
- 4 mil -
Layer4
- 20 mil -
Layer5
- 4 mil -
Layer6

I'd like to take advantage of interplane capacitance and pour alternating GND and VDD pours.  However, I am not sure how this will work in regards to maintaining a proper reference plane, as the reference plane will have to switch when moving from layer 3 to 4 for example, because the layer 3 pour will block the intial layer 2 reference.

Here is an example I threw together. Brown is GND, Blue is VDD, and Pink is the signal in question

Layer 1 VDD

Layer 2 GND

Layer 3 VDD

Layer 4 GND

Layer 5 VDD

Layer 6 GND

Non poured view

Is this a bad idea, or do I need to stitch vias everywhere to do this?  Or will interplane capacitance take care of plane switching?

The circuits on my board I am concerned about are ethernet RMII, and QSPI signals clocked at 50mhz.


texts: Why do computer graphic cards use 8 pin (4 positive and 4 negative wires) connector instead of connector with only single positive and negative wire?

texts: I've always wondered why computer graphic cards use an 8 pin (4 positive and 4 negative wires) connector instead of a connector with only a single positive and negative wire.


texts: Proteus 8.11 - Ground plane disappearing when I try to route or move a component

texts:
I have a two-layers thru-hole PCB in Proteus 8.11, and I am trying to put a ground plane on the bottom layer. But, every time I move a component or try to route, the ground plane just disappears. I have to click Regenerate in the plane options to make it appear, but then when I try and do another connection it just disappears again.
Here is a short video showing exactly what I mean:
https://drive.google.com/file/d/1hTuJ37vytirPB94QvFdjKVpGn122QMty/view?usp=sharing
To insert the ground plane, I just selected a zone with the Zone Mode tool. Here are some screenshots of the configuration and the design rules:

I don't know if this is relevant, but I'm running the program on a VM with WIN7.


texts: What is the physical meaning of the dispersion equation of an antenna?

texts:
I have a basic doubt about the role of the dispersion equation of an antenna. There are many situations (grounded dielectric slab, optical fibers etc) in which it is written, so I will put here an example (taken from my professors' lectures) to show better my doubts.
Let's consider this 2D planar RX antenna, which precisely is a cavity with a GND plane on the bottom, a substrate, a partially reflecting surface (which allows the radiation to partially go inside the substrate) and then air (in which the source, in this case the red arrow in figure, is placed).

So we may analyze the propagation of waves inside the air and the substrate. In order to do this analysis, we may associate at this structure an equivalent transmission line network, with:

A transmission line associated to the propagation in air

A parallel admittance (approximatively a susceptance) associated to the partially reflecting screen

A transmission line associated to the propagation in the substrate

A short circuit associated to the GND plane

Now we may do this kind of analysis (which is the same done for resonant circuits in orther to find the resonance frequency): we remove the source (and so we may consider the line in air to be matched and to offer an input admittance equal to its characteristic admittance) and we write the dispersion equation for this structure:

It is like putting to 0 the total parallel admittance of a RLC circuit. Here my questions are:

Which is the physical meaning of the solutions of this equation?

Which is the utility of this equation? It is determined in absence of excitation, so how can it be useful in our applications (in which we put an electromagnetic source)?


texts: What is wrong with this circuit simulated in Proteus?

texts: When simulating this circuit in Proteus, I expect the LED to light up when the switch is closed, but it does not light up. What am I doing wrong?


texts: RC filter - compute output as a function of input for generating waveform

texts:
I'm not so deeply into the theory about all this, I may use strange terminology...

If I put a square wave through a simple lowpass RC filter, the output will be a sort of "rounded sawtooth", well not so much a ramp but a capacitor charge curve followed by a discharge curve.
Like this:

So I tried to replicate this in a computer program, in a band-limited form.
First, I made a function to add harmonics, as weighted sum according to the typical falloff for a square wave. That alone looks indeed like a slightly lowpass filtered square on an oscilloscope.

Next I wrote a second function, which was supposed to impose the LPF frequency response curve over the harmonics envelope of the square wave, i.e. such that the weights of the summands would take into account the lowpass response.

Now, of course, the result is not the same, I get a rectangle with both corners rounded off, instead of a saw-toothy asymmetrical wave.
Intuitively I'd say that what's not taken into account here is the "lag" of such a low-pass filter.

How could I mathematically incorporate this information to produce the harmonics sum the correct way? (I.e. not using a sample-based 1-pole LPF implementation)

The actual goal of this is to obtain one precisely-cut, glitch-free, loopable period of the waveform.
I.e. if a harmonic falloff function is known for this type of waveform ("capacitor nonconst charge sawtooth"), like there are for other known waveforms, that would be sufficient as an answer.

P.S. feel free to add pointers to further waveforms and the way to generate them via harmonic sums - other than square, tri, saw, which are in wiki ;)


texts: Temperature sensor DS18B20 always reads 85

texts:
I'm using a temperature sensor DS18B20 with STM32F103 Bluepill, but this sensor always gives me 85°C which is the power-on reset value of the temperature register.
I'm so confused because it worked as well while I was doing my wiring on a breadboard. I don't know why it doesn't work on a PCB, I did the same wiring as I did on a breadboard.
Does it require any additional setting while using that sensor on a PCB with an external power supply like a Li-Po battery? I have put a 4.7K resistor too. I have read some posts regarding this problem but it doesn't give me solutions. For the data pin, I'm using PB5 on my STM32F103.
I don't think it caused by the code because it worked well on a breadboard, this is my whole code:
int DSPIN = PB5;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  double temp = TempRead();
  temp  = temp * 0.0625; // conversion accuracy is 0.0625 / LSB
  Serial.print("Temperature: ");
  Serial.print(temp);
  Serial.println(" °C");
  Serial.println("");
  delay(500);
}

boolean DS18B20_Init() {
  pinMode(DSPIN, OUTPUT);
  digitalWrite(DSPIN, HIGH);
  delayMicroseconds(5);
  digitalWrite(DSPIN, LOW);
  delayMicroseconds(750); //480-960
  digitalWrite(DSPIN, HIGH);
  pinMode(DSPIN, INPUT);
  int t = 0;
  while (digitalRead(DSPIN)) {
    t++;
    if (t > 60) return false;
    delayMicroseconds(1);
  }
  t = 480 - t;
  pinMode(DSPIN, OUTPUT);
  delayMicroseconds(t);
  digitalWrite(DSPIN, HIGH);
  return true;
}

void DS18B20_Write(byte data) {
  pinMode(DSPIN, OUTPUT);
  for (int i = 0; i < 8; i++) {
    digitalWrite(DSPIN, LOW);
    delayMicroseconds(10);
    if (data & 1)
      digitalWrite(DSPIN, HIGH);
    else
      digitalWrite(DSPIN, LOW);
    data >>= 1;
    delayMicroseconds(50);
    digitalWrite(DSPIN, HIGH);
  }
}

byte DS18B20_Read() {
  pinMode(DSPIN, OUTPUT);
  digitalWrite(DSPIN, HIGH);
  delayMicroseconds(2);
  byte data = 0;
  for (int i = 0; i < 8; i++) {
    digitalWrite(DSPIN, LOW);
    delayMicroseconds(1);
    digitalWrite(DSPIN, HIGH);
    pinMode(DSPIN, INPUT);
    delayMicroseconds(5);
    data >>= 1;
    if (digitalRead(DSPIN))
      data |= 0x80;
    delayMicroseconds(55);
    pinMode(DSPIN, OUTPUT);
    digitalWrite(DSPIN, HIGH);
  }
  return data;
}

int TempRead() {
  if (!DS18B20_Init())
    return 0;
  DS18B20_Write (0xCC); // Send skip ROM command
  DS18B20_Write (0x44); // Send reading start conversion command
  if (!DS18B20_Init())
    return 0;
  DS18B20_Write (0xCC); // Send skip ROM command
  DS18B20_Write (0xBE); // Read the register, a total of nine bytes, the first two bytes are the conversion value
  int temp = DS18B20_Read (); // Low byte
  temp |= DS18B20_Read () << 8; // High byte
  return temp;
}

My PCB schematic:

Any suggestions or bits of help would be great.


texts:
I am trying to select a MOSFET that will work as a logical switch on a 24 V power rail, toggling on/off as signaled by a GPIO on an Arduino. The Arduino pin that will connect to the gate on the FET is 5 V, max current is 40 mA. The power rail current is ~1-2 A.

I'd like the On characteristic to be as close to saturation as possible with very low \$R_{DS}\$. Problem is the FETs I'm finding and I see recommended in similar applications either have:

A \$V_{GS}\$ that is low enough to work with the Arduino, but not a high enough \$V_{GSS}\$.
High enough \$V_{GSS}\$, but either too high a \$V_{GS}\$, or an \$R_{DS}\$ that is too high given the Arduino output.

As I understand it, although the min or max of the VGS spec may be around 5 V, in order to get the lowest \$R_{DS}\$ spec, you have to run it at much higher than max. One part for example specs min \$V_{GS}\$ as 2.0 V, max at 4.0 V, but the test conditions that result in a 50 mΩ \$R_{DS}\$ are 10 V at 8.4 A, which obviously the Arduino can't do.

Do they just not make FETs with the characteristics I need, or is my approach just wrong?

I am a novice in dealing with transistors, so please correct anything I've written that is incorrect.

Thanks


texts: What factors affect the brightness of electroluminescent wire?

texts:
I'm interested in experimenting with creating my own electroluminescent (EL) wire. I've seen some videos on creating your own by  Jeri Ellsworth. I have a few additional questions.
I understand that voltage and frequency of alternating current both effect the brightness of the EL wire.

What addition factors effect brightness?
Would more phosphor or a different phosphor be brighter?
Would additional turns of wire be brighter?
Why is the blue phosphor used (even in colored EL wire)?


texts:
Why is noise margin in logic gates a quantitative measure of noise immunity?
Can anyone provide an instantiation to demonstrate how noise margin is a measure of noise immunity


texts: Using a motor signal to power a op amp to power another motor

texts:
For a college project I'm trying to make a set of legs that move with the user. The idea is to use the voltage that is made from a small motor when the output shaft is moved, pass that through an op-amp, and then use that to power the motion of the legs. This means that when the user lifts there legs it will power as long as they are doing so and then when they lower it will do the same.

The problem I have is that I can't figure out a way to the voltage high enough to power a decent size motor so I have altered the resistor values as much as I can and figure I need VCC and VDD is there a way of creating VCC and VDD from a battery (In my op-amp practical I used power supply which was attached to the mains) I want to make it as portable as possible. Am I out of my league here or there something I am missing

Below are the screenshots of my System so far I measured just over 5mV coming from the small motor (3v) when I moved the shaft.


texts: How does a zener protect my microcontroller?

texts:
I'm connecting a 12V inductive limit switch for my 3d printer to a RAMPS controller (Arduino-based printer controller).

The RAMPS board operates at 5V, and connecting the 12V signal from the limit probe will surely fry the RAMPS board.  A friend suggested the following circuit:

As I understand it, the controlled reverse breakdown of the Zener will drop 5V from the 12V signal (and the R1 will see the other 7), and the resistor will keep the current nice and safe for the Zener (and the microcontroller?).

I don't doubt my friend, but I don't understand exactly why this is safe.  Couldn't the signal short through the microcontroller and ruin my day?

Not an EE, I'm much more of a software guy.  Thanks for taking a look.


texts: How to supply a very accurate ADC reference voltage to STM32?

texts: Every voltage regulator IC has atleast a variation of 2% or something. This can make the ADC reading way inaccurate if it fluctuates to those levels. What is a robust and common solution to this problem?


texts: how can i switch one light bulb with two power source with relay?

texts:
I am making and project in which i take two inverters and connect with light source with the help of relay. I'm Planning to switch between two power sources with a Arduino like below diagram.So if one inverter fails then other will light up the bulb.
So i have came out with this circuit connection
IN1 & IN2 are inverters

Will this work.


texts:
For a project, I am trying to find a way to power a small rotary solenoid.

The solenoid resistance is 27 Ohms and requires 5V to turn, so it will draw 185.2mA. I know that there are 5V across the USB VCC and Ground pins. What I have read online about USB 3.0 current limitations has confused me. I have read that a USB 3.0 port (on a computer) will support up to 900mA to be drawn from it safely, but I have also read a lot of other stuff saying that one port can only support up to 100mA.

Basically, I am confused by the wording of what I have read. My question is: can a computer's USB 3.0 port safely deliver enough power to turn my solenoid? Again, that's 185.2mA.

Thanks for the help.


texts: Using two mono amplifiers to make one stereo amplifier

texts:
On my PCB (connected to a Raspberry Pi, an Arduino, a C.H.I.P. or anything), I want to provide audio output for:

a small speaker
or, when a 3.5 mm minijack is inserted, to stereo headphones (that would disconnect the speaker)

Instead of using

board ==(I2S)==> DAC => amp => speaker or headphones

I was thinking about :

board ==(I2S)==> amplifier such as MAX98357A => speaker or headphones

Problem : this MAX98357A seems to be mono only. The datasheet suggests using two of them to make a stereo output, but I find it not very elegant solution.

Are there "all-in-one" (DAC+amp) solutions to provide stereo output? (I'm not looking for shopping advice, I just want to know if, as a general question, this exists or not).

Would using two such mono chips be considered as a normal practice?

The datasheet carries this example:

Moreover, this MAX chip looks hard to solder manually (SMD). Do you think this kind of SMD soldering is achievable manually?


texts:
I am using a LPC4300 board to interface with a graphical LCD, a S6B0741. I have been trying to get it initialized, but I am not sure if I am sending the commands the correct way.

The code I have right now:

  GPIO_ClearValue (LCD_PINS.GPIOPortNum, (1<<LCD_PINS.GPIOBits[10]));
  GPIO_ClearValue (LCD_PINS.GPIOPortNum, (1<<LCD_PINS.GPIOBits[9]));
  GPIO_SetValue (LCD_PINS.GPIOPortNum, (1<<LCD_PINS.GPIOBits[12]));
  GPIO_SetValue (LCD_PINS.GPIOPortNum, (1<<LCD_PINS.GPIOBits[8]));

  SetBits (data); // sets the I/O data bus

  GPIO_ClearValue (LCD_PINS.GPIOPortNum, (1<<LCD_PINS.GPIOBits[8]));
  GPIO_ClearValue (LCD_PINS.GPIOPortNum, (1<<LCD_PINS.GPIOBits[12]));

All ports are defined as input ports.

I have tried following the initialization routine, as described in the datasheet, but it hasn't been working.

Is this correct?

EDIT
Should have had this in the original post, since the code as it is doesn't make sense really.

The pins are:

0-7 data bus
8 E
9 RW
10 RS
11 RESETB
12 CSB

The board is configured to use the 6800 Parallel Interface Mode.

EIDT2: Erroneously put it as 8080 mode rather than 6800.


texts: How to turn on and off with certain frequency (for example 20 Hz) a simple circuit?

texts:
I'm trying to connect a battery of 9 V to the secondary coil in a transformer (220 V - 12 V), but I would like to turn on and of this connection with certain frequency in order to see in a oscilloscope what happens in the secondary coil (sorry if my English is bad). I attached an image to explain myself better.
I would really appreciate if someone could help me to do this.

Thank @Transistor for your answering. And also thanks to Jonk, Vladimir and Tobalt.
As Vladimir said, I want to power the transformer through the battery and when I disconnect the battery there would be some current induced in the primary coil. To see this signal in the oscilloscope I think the switching of the battery should be periodic (correct me if I'm wrong here), but I don't know what should the frequency be exactly. This is the reason why I want to turn on and off the battery with a certain frequency. Finally, I made another sketch that I hope is more readable.
If you could guide me and tell me if I'm doing the right thing to see the desired signal, I would really appreciate it.


texts:
I am trying to simulate a mips-like processor using verilog. Since I am new to verilog, so I do not know if the design is correct or not. Here is the sketch of my design.

Each storage element (Register file,datamemory,AlusourceA,AluSourceB..etc) is defined in a separate module alongwith the functionality to write on that storage element. The control signals and necessary data,address are provided by hierarchical reference to other modules.

Here is an example of a module which explains my design clearly.

     /* top is the main module in this example, all
       modules are instantiated in top module. One or more registers are
       instantiated in each module which are updated based on the contents
       of registers in other modules using hierarchical reference*/

     module dat1dat2(input clk,output alusrca,output alusrcb);
     reg [7:0] data1,data2; /*Registers which will be cross referenced in
                             Alu module*/
     always @(posedge clk)
     begin

     if (top.control_unit_uut.en_dat1dat2 and !alusrcb )
     /*hierarchical reference to a register in a module instantiated in top
     module*/
     begin
     data1<=top.regfile_uut.regfile[top.IR_uut.IR[12:10]];
     data2<=top.IR_uut.IR[6:0];
     end

     elseif (top.control_unit_uut.en_dat1dat2 and alusrcb)

     begin
     data1<=top.regfile_uut.regfile[top.IR_uut.IR[12:10]];
     data2<=top.regfile_uut.regfile[top.IR_uut.IR[9:7]];
     end
     else
     begin
     data1<=8'hzz;
     data2<=8'hzz;
     end
     end
     assign alusrca=data1;
     assign alusrcb=data2;
     endmodule

Is this design legal in verilog given that I don't have to synthesize it, I just need to simulate it? If the answer is no, what is the simplest design I can use which is not necessarily synthesizable?

PS: If something is still unclear about my question, I can explain it in comments or update my question.


texts:
Can I use the term "chipset supplier" to refer generically to companies that provide packaged semiconductor chips?

Or, should "chipset" only be used to describe companies that manufacture a set of chips for a specific application (e.g. motherboard, cell phone, etc.)?

For example, if a IC vendor designs and sells an FPGA, and nothing else related to the board it goes on, is that IC vendor a chipset vendor? Where is the dividing line?


texts: How can a remote-controlled (wall) light switch operate without a power source?

texts:
A few days ago, i bought this remote-conrolled light switch. When installing it, i wondered why i had only two lines to connect (the one going to AC power and the one to the lamp); i thought i needed a ground connection as well to provide power to the electronics.

However, the switch works after connecting only two lines (L to AC and L2 to the lamp); it has some electronics inside, and does not seem to contain a battery. Where does it get the power from it needs for the electronics?


texts: What is the direction of electric field inside a battery?

texts:
Outside the battery, in the conductor it is in the direction of conventional current. But what about inside?

Somehow linked: For p-n junction, at the depletion region which side is at higher potential?

But the answer of this question is broad enough to deserve a separate question I guess.


texts: Simple FFT with DSP on STM32F407VG: How to interpret results and clear noise

texts:
It's my first project with STM32 (board stm32f4-disc1). I'm trying to create a simple spectrum analyzer for analyzing a signal (400-7000Hz, 0-3000 mV). My goal is to catch an event when the signal is above 2000 mV in a certain range (for example 1000-2000Hz). So I tried to realize an FFT function with DSP library (using CubeIde).
https://github.com/arcticplural/simple_fft
Here is my project, where I have succeeded with some stuff but still have some issues.
Description

DAC is generating for me a sin wave by DMA on TIM2 (84 MHz on APB1, PSC=0, and CP=2183, sin pattern array size=100) => signal freq = 380Hz.
ADC on TIM1 (PSC=2, CP=3695) => sampling freq = 46875Hz (but I'm not sure)
Every 200 ms UART on TIM3 (PSC=256, CP=65535) send data to PC (still not sure about this timer)
DAC PA4 is connected to ADC PA1. UART is connected to the PC. Data collected fine.

Issues
I've got this result:

I've got a peak in the 7th range, where 4.5 kHz expected, not 380 Hz.
I've tried other freq for DAC (0/299 for 2.8kHz and 0/839 for 1kHz) it doesn't work at all.
I still don't understand how to use this offset value. There is still too much noise. Why there is a lot of noise on pure sine wave?

int offset = 30; //variable noisefloor offset
for (int i=0; i<ADC_BUF_LEN/2; i=i+2) {
    freqs[freqpoint] = (int)(20*log10f(complexABS(fft_out_buf[i], fft_out_buf[i+1])))-offset;
    if (freqs[freqpoint]<0) freqs[freqpoint]=0;
    freqpoint++;
}

I want to get max voltage of each range instead of the magic values. Should I do IFFT for each fragment?

I probably made a lot of mistakes here, but I can't found any and have stuck.
Edit:
result fft array:
    resultarray[0] = (uint8_t)freqs[1]; //31-5Hz
    resultarray[1] = (uint8_t)freqs[3]; //63 Hz
    resultarray[2] = (uint8_t)freqs[5]; //125 Hz
    resultarray[3] = (uint8_t)freqs[11]; //250 Hz
    resultarray[4] = (uint8_t)freqs[22]; //500 Hz
    resultarray[5] = (uint8_t)freqs[44]; //1 kHz
    resultarray[6] = (uint8_t)freqs[104]; //2.8 kHz
    resultarray[7] = (uint8_t)freqs[197]; //4.5 kHz
    resultarray[8] = (uint8_t)freqs[393]; //9 kHz
    resultarray[9] = (uint8_t)freqs[655]; //15 lHz


texts: Why does the die of a desktop CPU need to be so small?

texts: The amount of space on the PCB would allow for the die to be much larger and would make designing it much easier, what is the reason for this?


texts:
The question says:

Calculate the minority carrier life-time in Si having a donor concentration, NA = 1014 cm-3 if the diffusion length for minority carriers is 150 m.

Shouldnt it say "ND=1014"? because its a donor concentration and not an acceptor concentration?

Thanks


texts:
Is it possible to disconnect the 5v+ and the ground wires from a USB cable (leaving the D+ and D-) and connect them to an external 5v power source (ex a filtered regulated battery) and have the USB device and computer function properly?

I want to try to provide a cleaner power source to the USB device than what the PC would without trying to filter the PCs 5v power from its USB port.

If this would not function properly or cause damage, can someone explain why this would happen?

Thanks.


texts: USB type-B sockets vs USB Mini-B sockets

texts: Most Programmers hardware equipped with USB type-B connectors for connecting to PC. USB Mini-B connectors are much less used in device programmers. Have the USB type-B connectors any advantages or benefits over USB Mini-B connectors when use in device programmers?


texts:
I'm currently in the process of selecting a MOSFET transistor for an 8x8x8 LED cube I'm building. Each layer of 64 RGB LEDs will have a transistor connected to a common cathode for the layer, when I want to turn on the layer I'll turn on the MOSFET via a pin on my microcontroller running at 3.3V. This is my first time selecting a transistor for this type of application and I just want to confirm I've selected the proper part. I've used this fantastic post as a guide to help me.

I've selected the AO3400A for my application. As I'm running at 3.3V I wanted a Vgs(th) max that would be below my 3.3V level. I do have a question about the minimum value for Vgs(th) which is 650mV, I'm planning on using the Nordic NRF52832 as my microcontroller but I can't seem to find the minimum and maximum values for the logic levels in the document. Based on general reading 650mV appears to be high enough so that the gate of the transistor won't turn on when my microcontroller pin is pulled low, but I can't confirm this.

Secondly, I need to sink a lot of current through the transistor, I've assumed each LED will use a maximum of 30mA, given that I'm using RGB LEDs I have 3 x 64 LEDS in each layer. 3 x 64 x 30mA gives me 3.84 Amps of current when all the LEDS are on at once. The maximum continuous drain current is 5.7A for the transistor at 25C and 4.7A at 70C so I think I'm ok there.

I'm powering the cube with a 5V 12A supply, so the Max Vds would be 5V in my circuit and the transistor is rated for a max of 30V so again I think I'm alright.

Finally I calculated the power dissipation. P = I^2*R. I used the Rds(on) at 2.5V and 3A as a worst case scenario and that specifies a max resistance of 48mOhm. so P = 3.84A^2*48mOhm which gives me .7 Watts. The transistor is rated 1.4W at 25C and 0.9W at 70C so I figure I'm ok here as well.

Have I missed anything? Do I have enough of a safety buffer for all of my design parameters or should I select a different transistor? Thanks for taking a look!

EDIT
I made a mistake in the specification of the power supply, copied some details down incorrectly when writing this. It's a 5V 12A so 60W.
EDIT 2
I mistakenly put down common anode LED's instead of common cathode.


texts:
I am having a problem making a stepper motor run. The problem is that the voltages that I am reading from the motor never reach zero (they move from a high voltage to a smaller voltage) so they never are switching on and off (from a high voltage to 0) as I thought it would.

Right now I have the following setup:

The pulse source is an Arduino Uno and the inductance and resistance I got from the motor's datasheet.

What I was hoping for was if somebody could tell me if the direction I am going to is the right one. Should it work like a switch? And if it should what are some possibilities of why it isn't working?

EDIT: I accidentally wrote 47 Ohms on the motors resistance, it was supposed to be 4.7 ohms.


texts: Why capacitor 3 loses energy as it induces current in other capacitors

texts:
plate B of capacitor 1 and 2 are connected to capacitor 3 to provide potential difference. Part A includes capacitor plate and dielectric.
When part A and B are connected the positive charges will be repelled from capacitor 1 through load to capacitor 2 and negative charges will be attracted from 2 to 1.
When A and B are separated potential difference will be removed from parts A of capacitor 1 and 2 so parts A will both neutralize.
The reason I use three capacitors in this setup is I don’t want charge to flow from capacitor 3 through load but induce it through capacitors 1 and 2 when plates A and B are connected and separated. So I expect capacitor 3 not to lose energy fast.
After contacting plates A to B of capacitors 1 and 2 and separating them at intervals of 1 second. The energy in capacitor 3 reduces over time so current flowing into load reduces. One of the reason I think causes this is I do this not in a vacuum so charge escapes when dielectric is disconnected from plate B and exposed to air. Resistance as charge flows from plate B back to capacitor when plates are disconnected. Which other way so you think makes energy to be lost from capacitor 3 as it induces current through capacitors 1 and 2.


texts:
I am looking for C++ abstractions for hardware I/O points or pins. Things like in_pin, out_pin, inout_pin, maybe open_collector_pin, etc.

I surely can come up with such a set of abstractions myself, so I am not looking for 'hey, you might do it this way' type of answers, but rather the 'look at this library that has been used in this and this and this project'.

Google did not turn up anything, maybe because I don't know how others would call this.

My aim is to build I/O libraries that are based on such points, but also provide such points, so it would be easy to for instance connect an HD44780 LCd to either the IO pins of the chip, or an I2C (or SPI) I/O extender, or any other point that can somehow be controlled, without any change to the LCD class.

I know this is on the electronics/software edge, sorry if it does not belong here.

@leon: wiring
That is a big bag of software, I will need to look closer. But is seems they do not use a pin abstraction like I want. For instance in the keypad implementation I see

digitalWrite(columnPins[c], LOW);   // Activate the current column.

This implies that there is one function (digitalWrite) that knows how to write to an I/O pin. This makes it impossible to add a new type of I/O pin (for instance one that is on an MCP23017, so it has to be written via I2C) without rewriting the digitalWrite function.

@Oli: I googled an Arduino IO example, but the seem to use about the same approach as the Wiring library:

int ledPin = 13;                 // LED connected to digital pin 13
void setup(){
    pinMode(ledPin, OUTPUT);      // sets the digital pin as output
}


texts: What is the proper GPRS / GSM modem setup to work with 5 voltage sensors?

texts:
I've been looking at modems and most of them come in RS232/485 input only. I need to hook up 5 different power cables to the modem to monitor their voltage.

Some of the modem's I've found have 4 to 8 digital and analog input/output. I've also looked at maybe having an Arduino in between the modem and sensors.

What is the proper GPRS / GSM modem setup for 5 voltage sensors?


texts: How can I determine maximum load current limit of DC-DC step up switch regulator?

texts:
I have a trouble in designing power supply for my device.
I've shifted 3.3V up to 5v by using LMR 62421 manufactured by Texas Instruments. I'm planning to use the 5v rail to power my devices(module, sensor, etc...) Everything is fine except that I can't find out how much load(output) current LMR62421 allows in maximum. Datasheet only says it has minimum switch current limit of 2.1A. I don't think this is equal to Maximun load current. There are some equations on datasheet but they start from knowing VIN VOUT Ioutmax. My devices which are connected to 5V rail will consume approximately 1.6A in sum. I expect that LMR 62421 will be fried if I do not take careful consideration on its maximum allowable current value. Can anyone help me find it out?


texts: How do i get to study the impact of body bias on NMOS threshold voltage using LTSpice?

texts:
I am new to LTSpice.
I have tried a design in LTSpice for the above requirement. But I dont get the plot for different values of body bias Vsb.


texts: exactly why does a capacitor build up charge when hooked up to a battery?

texts:
I understand how the capacitor "holds" charge. If one plate is positive, and the other is negative, the particles are attracted to each other. Connect both sides by a wire and instant flow.

However, I am confused why the charge gets built up on the capacitor in the first place when connected to a battery? There's no complete circuit.

However, everything I find online says that plate that's connected to the positive side of the battery will give up electrons that will flow through the battery to the other side? How does this even make sense?

As far as I understand it, a chemical reaction in the battery pushes the negative ions to one side and the positive ones to the other. Thus when I hook up the battery via a wire, the electrons have a direct path from the negative side to the positive side.

That's totally different than taking electrons from one side of a capacitor? To sum up, why is it that just nothing happens when I hook up a capacitor?


texts: Regarding Oil Type Material inside PVC wire

texts:
Today, I was repairing my soldering iron. During the repair, when I cut the end of two core wire, I found some oil type liquid surrounding both the wire. To confirm, if this is present in whole cable, I cut the wire from other place, and found the same oil type liquid surrounding both the wire there also.
What exactly is that liquid and what it is purpose for it?


texts:
The acceptable power supply to several MCU's is quite wide. For example, TI CC2640R2F is 1.8V to 3.8V.
If powered directly from an LiSOCl2 battery, the input voltage would vary quite a bit depending on current draw.
If the supply voltage stays above the minimum limit, would the digital circuitry and firmware execute fine, or would there be potential for glitches when the input swings?
How would someone calculate the needed capacitance to remove glitches if there are any?


texts:
I just got an Atmega32A chip and I've been trying to program it with a usbasp for quite a few hours. I can change the fuses and write the program, but verification fails.

I'm getting this message after verification:

avrdude -c usbasp -p m32 -u -U flash:w:first.hex

  verification error first mismatch at byte 0x0000

  0x0c != 0x00

I'm connecting according to this diagram here:

The chip can be erased and fuses can be changed, my only problem is with the verification. The program seems to be written to memory but my LEDs aren't blinking.

Could this be a problem with my connections? Can anyone point me to a better programming schematic?


texts: I2C communication ATmega328P slave: answer to general call but not to own address

texts:
I have the following problem:

I want to make two AVR Atmega 328P-Pu  communicating together with I2C

No1 is Master (I2C address :0x01)
No2 is Slave (I2C address :0x02)

On slave answer to general call is enabled (address 0x00) and it works. Or, at least I can see that it enters the ISR(TWI_vect) on the slave with the code further below.

However when trying to call the salve with it's own address (0x02) it won't respond. Everything else remains the same (circuit, pull-up resistors etc.)

Moreover, trying to bomb the bus with calls to all possible address up to 128 does not yield response from slave.

I am sure it is a silly mistake somewhere but running out of idea as of why it is like that.
Any help welcome.

On Master

I2C communication is initiated like that

uint8_t i2c_start(uint8_t address)
{
    // reset TWI control register
    TWCR = 0;
    // transmit START condition
    TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
    // wait for end of transmission
    while( !(TWCR & (1<<TWINT)) );

    // check if the start condition was successfully transmitted
    if((TWSR & 0xF8) != TW_START){ return 1; }

    // load slave address into data register
    TWDR = address;
    // start transmission of address
    TWCR = (1<<TWINT) | (1<<TWEN);
    // wait for end of transmission
    while( !(TWCR & (1<<TWINT)) );

    // check if the device has acknowledged the READ / WRITE mode
    uint8_t twst = TW_STATUS & 0xF8;
    if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return 2;

    return 0;
}

In the Master's main call is made like that

uint8_t address=1;
addr=address<<1;
i2c_start(addr|I2C_WRITE);   // I2C_WRITE =0x00

On slave

void I2C_init(uint8_t address){
    // load address into TWI address register
    TWAR = (address << 1);
    TWAR = (1<<TWGCE);  //respond to general call ! WARNING
    // set the TWCR to enable address matching and enable TWI, clear TWINT, enable TWI interrupt
    TWCR=0x0;   //WARNING
    TWCR = (1<<TWIE) | (1<<TWEA) | (1<<TWINT) | (1<<TWEN);
}

The main on the slave looks like that

I2C_init(slaveaddress);
sei();
LED_PORT_DDR |= _BV(LED_BIT);
for(;;){
    wdt_reset();
    if(debug==1)    //Debug is set to 1 in the ISR(TWI_vect)
    {
        LED_PORT_OUTPUT |= _BV(LED_BIT);    //set to 1 e.g
    }
}


texts: When would you need a low bandwidth opamp?

texts:
This opamp has a unity gain bandwidth of 27kHz, which is by far the lowest I've ever seen. (I first misread the 7.7V/ms slew rate as 7.7V/\$\mu\$s, because that's the units most often used.)

27kHz looks very bad. Is there any reason why they would make opamps with these speciifications?


texts:
I own an inexpensive lab power supply. I do not know whether the supply is a single quadrant or dual quadrant.

What would be the best way (without reverse engineering or extensively disassembling) to test if the supply is one or two quadrant?

I have pulled the cover to look inside the supply and there are two transistors attached to the heat sink. I'm trying to figure out whether they are in parallel to give the supply more capacity (this would make it single quadrant). Or if one will source current and the other sinks current (this would make it dual quadrant).

The dual quadrant supply can both sink and source power.

simulate this circuit – Schematic created using CircuitLab


texts:
First, sorry if my english is not perfect. I have a question regarding AGNDL and AGNDR connectiof for PCM4202 . In the data sheet document ( figure 12, page 21) the decoupling caps are not connected to AGNDL nor the AGNDR, . But in the evaluation module (Figure 4 at page 14), these capacitors are tied to ground. Is the schematic from the data sheet( Figure 12) wrong?

I am not so good in electronics and I hope someone will give me the right answer.
Thanks in advance.


texts: Would it be possible to power an X-Ray tube using a Marx generator?

texts: To the best of my knowledge most X-Ray tubes are powered by a smaller voltage running through a large transformer to step it up into the magnitude of 10-100 KV. This larger voltage is then pulsed through the tube to be picked up by some sensor/film. Is it possible to use this same method, but power it using a system like a Marx generator? Would the current output of the Generator be too low, or the pulse too short?


texts:
Suppose we have two third order systems (a and b), with three poles and two zeroes,poles for both the systems are at the same positions in frequency domain but these systems differ in the placement of their zeroes as shown in the figure below:

The abovve figure is a plot of the loop gain of the systems. Here za1 and za2 are the zeroes for system a and zb1 and zb2 for system b. The exact shape of the magnitude plot of loop gain would differ for the two plots, I only intend to highlight the position of zeroes for the two systems.
In system a the zeroes lie before the unity loop gain frequency whereas in system b they lie after the unity loop gain frequency. Suppose unity gain frequency lies away from the zeroes of both the systems. Clearly the phase margin in case a is close to 90deg while that in case b is close to 270deg. Thus we would conclude that system b is unstable.
My question is, since the stability depends only on the system poles which are same in both the cases, how do these systems differ in their stability?


texts: How do I increase the voltage limit by connecting same capacitors?

texts:
Assume a capacitor's voltage limit be v, and the target voltage limit be V.

What is the way of connecting the capacitors to reach the V?


texts: Need pointer on designing low pass filter circuit

texts:
I am trying to design a low pass circuit for my project which can cutoff frequency of around 300 kHz. Input and output impedance is 50 ohm.
The values of R4, C3 which are part of the filter can be modified. But how do I size the component and still meet the cutoff frequency?
The circuit will be powered with an AC signal source.Purpose to is filter out all unwanted signal beyond 300kHz
Project requirement:
attenuation or gain in passband = 1.3 dB
ripple in passband for >=2nd order filters (>=0dB) = 0 ripple
stop band f-3dB = BW =300kHz
stop band f-60dB = RC filter
Source impedance= 50 ohm
Load impedance= 50 ohm
Limited to RC filter due to space constraint.


texts:
i am trying to transmit a Ethernet frame from fpga to pc.
my udp frame is:

constant udp_frameB :frame60:=
(x"FF",x"FF",x"FF",x"FF", -- mac dest
x"FF",x"FF",x"00",x"00",
x"00",x"04",x"14",x"13", -- mac src
x"08",x"00",x"45",x"00", -- IP header
x"00",x"2E",x"00",x"00",
x"00",x"00",x"40",x"11",
x"7A",x"C0",x"00",x"00", -- IP src
x"00",x"00",x"FF",x"FF", -- IP dest
x"FF",x"FF",x"00",x"00", -- port src
x"50",x"DA",x"00",x"12",-- port dest + len
x"00",x"00",x"42",x"42", -- checksum udp + data "B"
x"42",x"42",x"42",x"42",
x"42",x"42",x"42",x"42",
x"42",x"42",x"42",x"42",
x"42",x"42",x"42",x"42");

for the above frame i have calculated the FCS using the crc-32.

polynomial-X"04C11DB7".

FCS is-X"D96F0BBF"

I have adopted following method to calculate FCS:

IEEE 802.3 defines the polynomial M(x) as the destination address,
source address,length/type, and data of a frame, with the first 32-bits
complemented. The result of CRC is complemented, and the result is the
IEEE 802.3 32-bit CRC,referred to as the Frame Check Sequence (FCS)
field. The FCS is appended to the end of the Ethernet frame, and is
transmitted highest order bit first (x31, x30,…, x1, x0).

please tell me ,Is FCS correct or not?

and also tell me that if the FCS is not correct then will wireshark
capture it or not?

the CRC logic which i have used to calculate-

library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;

entity ethcrc32 is
port (clk: in STD_LOGIC;                    -- Input clock
     rst: in STD_LOGIC;                 -- Asynchronous reset
     en : in STD_LOGIC;             -- Assert to compute calculations
     is_msb: in STD_LOGIC;              -- Assert to indicate the sens of data_in
       data_in: in STD_LOGIC_VECTOR(7 downto 0);        -- Data to compute
     crc_out: out STD_LOGIC_VECTOR (31 downto 0)    -- CRC output
);

end ethcrc32;

architecture nano of ethcrc32 is

-- The Generator polynomial is
--  32   26   23   22   16   12   11   10   8   7   5   4   2
-- x  + x  + x  + x  + x  + x  + x  + x  + x + x + x + x + x + x + 1
constant GENERATOR : STD_LOGIC_VECTOR := X"04C11DB7";
begin
process (clk,rst) is
    variable crc_buf : STD_LOGIC_VECTOR (31 downto 0):=x"00000000";
begin
    if rst = '1' then   -- reset signals to values
        crc_buf := (others => '0');
    elsif rising_edge(clk) then  -- operate on positive edge
        if (en='1') then
            if is_msb='1' then
                    for I in data_in'reverse_range loop
                        crc_buf := (crc_buf(30 downto 0) & data_in(I)) XOR (GENERATOR AND (0 to 31=>crc_buf(31)));
                    end loop;
            else
                    for I in data_in'reverse_range loop
                        crc_buf := (crc_buf(30 downto 0) & data_in(I)) XOR (GENERATOR AND (0 to 31=>crc_buf(31)));
                    end loop;
            end if;
        end if;
    end if;
    crc_out<=crc_buf;
end process;

end nano;


texts: What are some things that can be done in VHDL but not in verilog and vice versa?

texts:
VHDL and Verilog are quite similar but do not have the same features, there is certainly a massive overlap though.

What are some things which are easier to do in VHDL but not so easy or even impossible to do in Verilog? I just want to understand how they compare.

I just wonder that if one is as good as the other then why not just use one of the two and simplify the job of the EDA vendors that create tools to simulate and synthesize these HDLs and also the job and life of many other people?


texts:
I'm using a magnetic latching dpdt relay from Teledyne company. The value of inductance for the coil in the relay is needed and not given in the data sheet. The part number of relay is 422d from Teledyne.

How can I know it?
Is it possible to know the value without actually buying the product and testing?


texts:
Below is a wall wart with ratings 5V 2A.  I'd like to buy a DC adapter of some kind for this wall wart, so I can easily wire things to a circuit or bread board.  What is the name of the DC side of this wall wart and what are possible adapters I can buy for it?  I'd like to either use alligator clips or just plain jumper cables (female or male is fine).  If I need to solder it, that's fine, but I'd prefer not to do that.
http://www.amazon.com/D-Link-SMP-T1178-power-adapter-equiv/dp/B01CYZSZKU?ie=UTF8&psc=1&redirect=true&ref_=oh_aui_detailpage_o04_s00

I'd like something similar to this:
https://www.pololu.com/product/2449
Or this:
https://www.pololu.com/product/1139


texts: Simple ADC alternative by using a capacitor and digital Arduino pin

texts:
I'd like to measure a dozen potentiometers with an Arduino UNO. Unfortunately, the UNO only has 6 analog pins, but it does have about a dozen digital pins.

Could I effectively measure an analog value with a digital pin by following this procedure?

Wire the potentiometer in parallel with a capacitor.
Connect one junction to an Arduino's digital pin.
Set this pin to write HIGH until the capacitor fully charges.
Set pin to read LOW and then use pulseIn() to measure the time it takes for the capacitor to discharge across the potentiometer, causing the voltage at the pin to go from 5V to 0. This time should be proportional to the resistance of the pot. e.g. a pot with a low resistance will cause the cap to discharge very fast, whereas a high resistance will cause the cap to discharge more slowly.


texts:
Soon I will receive some (2.4 GHz wireless) SE8R01's to be used in my new project (using Arduino).

The datasheet can be found here.

In my project I want to use several devices, that needs to send messages to a controller (master). Which based on that sends messages back (immediately or later). So it is really a bi-directional communication. But all (slave) devices have communication with only one single device. So the workflow is something like:

Slave 1 sends data to Master
Master sends data to slave 1
Slave 2 sends data to Master
Master sends data to slave 2
Slave 3 sends data to Master
Master sends data to slave 3

If the Master should be the initiator of everything, the possible workflow is also possible:

Master asks slave 1 for data
Master sends data to slave 1
Master asks slave 2 for data
Master sends data to slave 2
Master asks slave 3 for data
Master sends data to slave 3

Some data slaves sent to the master needs to be sent back fast (within around 10 ms), other data is less critical. This depends on the slave.

In the datasheet in paragraph 7.6 MultiSlave is handled. This is a 6-1 network (probably similar but not exactly like NRF24L01). I don't know why the SE8R01 and NRF24L01 are different (I thought they are compatible).

Anyway, in MultiSlave mode, it seems upto 6 devices are transmitters and 1 is receiver. But in my example, I want both: transmitter and receiver. The MultiSlave uses a protocol which changes the transmitter and receiver internally, but I am wondering if I can use this MultiSlave and protocol if I manually are going to change this.

Or should I make my own protocol?

Update: it seems that NRF24L01 is the same, the 'protocol' is ShockBurst in NRF24L01 and the MultiSlave mode is called MultiCeiver


texts:
I'm looking to design a soft-start precharge circuit for starting up circuits with substantial input capacitance (~1.5J @ 24V). The main requirements are:

24-60V compatible
Constant current pre-charge
Enable/disable via low-current switch
Protection against inrush if accidentally connected with switch enabled
No sharp current/voltage deltas during precharge or transition
LED indicator to show when capacitors are charged
Connection order doesn't matter

This is the circuit I've come up with (Falstad link):

Note that the switch would control the 12v regulator, but I can't find one in Falstad so I had to simulate one.

The theory of operation is that once the battery and downstream load is connected and the 12v regulator is enabled via the switch, the precharge power MOSFET gate begins to charge. Once it hits the threshold and maximizes in the non-linear region (limiting current, in this case to ~3.5A), current begins to flow through the downstream capacitors to a 2Ohm power resistor. As it charges, an op-amp measures the voltage on the negative side of the downstream circuit. Once the difference in voltage falls below the voltage on the non-inverting amp input, the op amp turns on, delivering 12v to the final stage. The transistor is switched on, causing the gate of the final power MOSFET to begin charging. Once the gate threshold is hit, it turns on, bypassing the power resistor and enabling full current to flow.

AFAICT it works, at least in simulation. The current slowly increases up to a constant level, and voltage across the capacitor begins charging linearly...

...the current slows down as the capacitor fills up...

...and the final transition to the power MOSFET is a smooth, small "bump" in current:

Charge times:

1mF@24V: 19ms
10mF@24V: 140ms
1mF@50V: 28ms
10mF@50V: 240ms

Does this seem reasonable? Any obvious mistakes/concerns? The only point I don't think I have solved is #7 above. If the switch is off, the battery/load connection order doesn't matter. If the switch is accidentally left on and the load is connected first, followed by the battery, everything works. However, if the switch is on and the battery is connected first, the op-amp thinks the voltage across the capacitor is the full voltage and happily charges the cap in the lower right. That's a problem, since when the load is eventually connected the cap keeps the power MOSFET's gate high and allows hundreds of amps to go through before the cap can drain and the remaining circuity catches up. I figure I can be careful to always connect the battery last, but if possible I'd love to protect against my own absent-mindedness!


texts: Why won't my 2-transistor oscillator work in the real world?

texts:
I am learning about transistors, and I've designed this oscillator circuit.

simulate this circuit – Schematic created using CircuitLab

In the simulator it works perfectly, and in my brain it makes sense, but when I try to implement the circuit in the real world it stabilizes with one side of the capacitor 0.7V above the other. I expect it to repeatedly charge and discharge the capacitor.

My reasoning:

Start w/ the capacitor discharged and all transistors are in their cutoff mode.

If the cap is discharged then it's like a short circuit, so R1/R2 just form a voltage divider, which has a lower voltage than D, so Q1 is not yet forward biased. This means Q2's base is starved for current (which it must get from Q1's collector).

As the cap charges, the voltage at A will eventually exceed the voltage at D, causing Q1 to become forward biased. This will in turn cause current to flow from Q1's collector to Q2's base, forward-biasing Q2 as well.

Now there is a 'connection' (via Q2's collector/emitter) between D and B. This pulls D down to the same voltage as B, keeping Q1 forward biased until the voltages at A and B are equal.

Now the voltages at A, B, and D are equal, reducing the current through the transistors to zero and returning to the original state.

Any information on what I may be missing or how to make my circuit work IRL would be greatly appreciated, thanks!


texts: How to detect completion of Lithium-Ion charging

texts:
Is there a simple way to detect when a lithium-ion battery charging process is complete?

I have a basic system as shown here:

The load represents my application (including its own voltage regulation), and the voltage regulator symbol represents a cheap off-the-shelf Lithium-ion battery management system that handles tapering off the voltage and current as the battery becomes charged. Unfortunately, the BMS doesn't have pinouts to detect charging status.

What would be the simplest way to alter this circuit so I could get a high signal when the battery is fully charged? My application includes a microprocessor with some ADC pins. Could I measure voltage before or after the BMS to tell when charging is complete? I know that Lipo recharging includes separate constant voltage and constant current stages, so this might not be 100% accurate, but I just need a rough estimate.


texts:
I'm experimenting with op-amps and ceramic filters at 455 kHz. I chose TL071 because it was readily available and the datasheet specified a slew rate of 13 V/μs and a GBW of 3 MHz. But in the datasheet  it shows that the large signal differential gain drops dramatically after 100 Hz.

My Ltspice simulation also shows similar effect.

My question is can I use this device for making a 455 kHz signal amplifier in practice as the simulation shows about 18 dB gain at 400 kHz?


texts: Direct interfacing of analog MEMS microphone to microcontroller ADC

texts:
I would like to sample the output of an analog MEMS microphone with an ADC embedded in a uC, sampling rate up to 1MHz.

I don't care too much about signal quality (as I'm more interested in ambient noise level than anything else). I want to absolutely minimize the footprint of the overall solution.

Application notes typically show a DC blocking capacitor at the output of the MEMS microphone, followed by a simple OpAmp stage that provides some gain and sets a suitable DC offset for subsequent ADC sampling.

I would like to do something even simpler and avoid the OpAmp. I would just pass the microphone output signal through a low-pass RC filter (so no DC blocking) and sample that. It seems to me that would exploit correctly the ADC dynamic range, given that:

My ADC would be set to have a 0-3V conversion range.
My MEMS microphone (Knowles SPW0430HR5HB - acceptable VDD range 1.5V-3.6V) is specified with a DC output = 0.72V when VDD=1.5V (so DC output=VDD/2); I would use it at VDD=3V so I assume the DC output would then be 1.5V. In which case I can directly sample the microphone output (unchanged DC level) with my ADC without clipping.

Do you see any flaw in that reasoning? One concern I have is whether the DC level at the output of the MEMS is really proportional to VDD.


texts: I have 12 of these LEDs and a 5v Arduino Pro Mini - like this one. This is going to be a very small project I need the smallest power source possible for this. Would I be able to run this with a few coin cell batteries?


texts:
My country has 230V mains.
Many imported SMPS have a 230/115 VAC switch that means that the SMPS cap filter input stage runs like a fullwave bridge here.  It means that it runs like a full wave voltage doubler in the USA.
This switchable input stage is common and accepted.  In fact there is a chip that senses mains voltage to automate the voltage selection switch.

On the face of it this dual volt scheme is cheap reliable and could be made idiot proof.  The only penalty is two electrolytic capacitors that will occupy more space and cost more money than one.  This penalty is not a showstopper.  When on 230VAC the two electrolytic capacitors are in series but I always see balancing resisters so the expected 350VDC will balance out nicely on say two 470 microfarad 250V caps.

Why are the caps much more likely to blow?
A coworker said that it is due to "uneven aging" is he correct?


texts: Can latching relay make the switch if the coil is powered by either of its switching circuits?

texts:
I am thinking of making a set up whereby the latching relay will switch between two 9V circuits from separate power sources. However the relay coils themselves must be powered by either of the 9v running through either of the switching circuits. Thus, this may prevent the latching relay from working, but I wanted to get an opinion if this might still work. This latching relay coils are operated with 9v. The schematic of this latching relay is shown here:

The first 9v circuit will run between pin 8 and 5, and the other independent 9v circuit will run between pins 9 and 12. My question is if the coil power is powered by either of the two switching circuits, can the latching relay still operate and make the switch? To explain further, what I mean is that assuming the relay starts off in a 'set' condition, I will use the 9v power supply running from pin 8 to 5 to power both set and reset coils. When I trigger a reset condition across pins 16 and 1, most certainly the 9v power supply from the circuit across pin 8 and 5 going to the set coil (pins 16 and 1) will momentarily falter, however, my question is whether will the reset coil still be able (to be fast enough) to make the relay switch to allow the circuit across pin 9 and 12 to work, or will if not work because the reset coil does not have enough power to make the switch?

simulate this circuit – Schematic created using CircuitLab

Circuitlab doesnt have the relay model I am seeking to use, however, shown here is the schematic of the cicruit I intend to use. Note that unlike the relay shown in the schematic, the configuration of my latching relay would be such that one of the 9v circuits would be connected at any time (set or reset). I have excluded the flyback diodes (which would otherwise connect from the GND to the 9v) to make the diagram less cluttered.


texts:
I am building an experimental percussion instrument. I have two circuits in it which are not connected to each other. One is a small linear fan speed regulator controlling a small motor, which requires between 1.5 and 4.5 volts.

The other is a small pre-amplifier connected to a contact microphone which runs on a 9v battery.

I would like to be able to power both of these circuits from a single 9v battery. What is the most efficient way of doing this? I have several 78L05 voltage regulators which to be honest I don't know very much about. Could I use one of those at the start of the motor circuit? It's my understanding that these take the voltage down to 5v from a higher amount (in this case 9v) but correct me if I'm wrong.


texts:
I can't understand how MOSFET LDO works and when it would be low drop.

Below, there is a simple schematic with N channel mosfet and TL431. Providing gate voltage, D-S will open, but minimum Gate-Source voltage for eg. IRF540 is 4V (for 1A drain current). Load is connected between source and GND, so minimum Gate-GND voltage is Vout+Vgs=Vout+4V, so whole Vin is minimum Vout+4V.

Do I understand it correctly?


texts:
TL;DR: Why do seemingly all treatments of MOSFET small-signal operation ignore the nonzero \$g_m\$ contribution in triode? Is the implicit assumption here that if the MOSFET is operated in triode then it will be as a switch and so with a relatively constant \$V_{GS}\$, and so \$g_{m,triode}\ > 0\$ doesn't matter? I see the reasoning for this but I think in practice MOSFETs acting as switches often have significant \$V_{GS}\$ variations, e.g. when used to connect/disconnect a varying input voltage to the input of a sampling circuit.

My thought process behind this question: for a MOSFET in triode, we have that $$I_D = K(V_{OV}V_{DS}-V_{DS}^2/2)$$ where \$K = (W/L) \mu C_{ox}\$. If we assume "deep triode" operation where \$V_{DS} << 2 V_{OV}\$, then we have $$I_D \approx K V_{OV} V_{DS}.$$
For small-signal modeling, we generally note that $$r_o \equiv \frac{1}{\frac{dI_D}{dV_{DS}}}=\frac{1}{KV_{OV}},$$
and so use this single resistor \$r_o\$ as the entire small-signal model. However, this incremental model ignores incremental changes in the gate-source voltage, which clearly have an effect on the current. I see no reason why our small-signal model for the triode region shouldn't then include a voltage-controlled current source as in the saturation region, with value $$ g_m \equiv \frac{dI_D}{dV_{GS}} = KV_{DS}.$$
So because of the generality of the definitions of the incremental resistance and incremental transconductance, it seems that the small-signal model of the MOSFET (or any three-terminal device that can be defined by the relationship \$I = f(V_1, V_2)\$ like the MOSFET) is really the same no matter the operating condition. The difference is that depending on the operating point, the expressions for \$g_m, r_o\$ will be different.


texts: Make a Latching double pole single throw relay, using electronic components

texts: I am latching a DPST relay. So I made a prototype using some transistors(ex. BC547) to enabling and disabling the latching. But I want to know whats the correct way of doing it. I have both 12V and 24V relays. And make a complete isolation to the micro controller.


texts: 2 DC Motors and 18 Micro Servo motors from shared battery (6 AA batteries?), active monitoring?

texts:
I'm trying to power 2 DC Motors and 18 Micro Servo Motors with a microcontroller as a kind of Arduino-like board. Any help would be very appreciated! I'm looking for opinions on my current plan and improvements on it, particularly how I can power the servos.

All motors may stall and I'm unsure how to avoid the microcontroller browning out or the motor overheating.

I am hoping to use 6 AA batteries giving 10v to 6v (depending on remaining power and the type of battery used). However this may not be possible.

The 2 DC motors are 2A max, 5v.

The 18 Servos are Tower 9g, 5V and are aprox 500mA max.

2 DC Motors

I am planning to use PWM on the motor driver to allow me to run 5v DC motors directly from the power source. The microcontroller can read the input power and adjust the PWM on the DC motors accordingly to prevent running them past the specification. I am under the impression that this should be OK provided the PWM ratio is the correct equivalent. This prevents the need for a buck converter.

By using current sense resistors a stall condition in a DC motor can be detected and if it continues the motor can be powered down or the PWM reduced. A diode and capacitor can be used to provide power to the microcontroller until it has time to power down the DC motor.

Does this sound like it will work for the DC motors?

18 Servos

For the servos I'm very unsure what to do. 18 current sense resistors and ADC pins seems excessive and servos take a long time to stop after PWM stops (at least 20ms, likely far longer), so the same plan won't work.

Is it possible to simply current limit each servo's power with a resistor? I worry that the servos would then no longer be able to start (as this is similar to a stall condition). Perhaps a capacitor could be included after the resistor and short pauses be added to the servo movements to allow the capacitor to recharge to allow a kick-start from stopped?

Am I approaching this problem entirely wrong?

All opinions appreciated! Thank you.


texts: Current sense amplifier + op-amp buffer + ADC: Measuring down to 0 with a single supply

texts:
I'm thinking about current sensing with a high dynamic range (10 mA - 20 A) and using LTC6102 as a high-side current sense amp (the voltage would be 54.6 V max, a 13S6P Li-ion battery).

The ADC I'm planning to use is LTC1407 (12-bit 1.5 MS/s).

I am planning to use OPA2365 as a unity-gain buffer between the current-sense amplifier and the ADC.

The current-sense amplifier provides an output current proportional to the sense voltage and given the high voltage and small package size, the output current has to be 1 mA full scale which requires a rather high value output resistor and thus a buffer is needed between the current-sense amplifier and the ADC.

The op-amp requires a small (-0.1 V) negative supply for the output to go down to 0 and it's important to go down to 0 in my case because of the high dynamic range I want.

I could try and do a negative supply e.g. a crude one with an additional battery between ground and the negative supply of the op-amp, but I would rather avoid it to simplify the circuit.

Is there a way that I can measure down to 0 without a negative supply voltage for the op-amp in this case?

I'm thinking of maybe putting a diode in series with the output resistor of the current-sense amp to offset the output voltage and then correct the scale of the ADC output accordingly, but I'm not sure if this will work. For low currents the diode would be in the region where small current changes would cause comparable voltage changes I suppose.


texts: What resistor (or indeed do I even need one)?

texts:
I have a device which charges a built-in AA battery. The factory AC/DC adapter outputs 200mA at 3v. This adapter has died one me.

I have another one lying around with the correct-size plug that can be set to output at 3v (measured 3.5v with my multimeter), but the current output is 1800mA. The device in question is not intelligent - it just sends all the current to the battery, and predictably, the battery gets insanely hot within a matter of minutes.

How can I reduce this current output to a max of ~200mA? I assume (likely wrongly) that I need to splice in a resistor on the positive wire. If so, what resistor do I need?


texts: Equivalent R for Bandwidth of non-ideal parallel RLC circuit

texts:
I'm tasked with calculating the bandwidth of a tank circuit shown below.  I can see that it is essentially a parallel RLC, for which I know BW=1/RC

However that pesky inductor resistor needs to be included.  Is there any way of deriving an equivalent R for both Rc and Rl?  Otherwise I will need to find Q via a transfer function, which is getting messy quickly!


texts: Methods for confirming on both sides that a signal was received in one direction

texts:
Say there are two devices (A & B) that talk to each other (full duplex). For the sake of this example, let's say the medium is RF (wireless).

If device A sends a message to device B, what methods/strategies are there for both devices to confirm that B received the message, and for both devices to be sure that the other device knows it?

This is perhaps best explained through a real-world example:

Say you have a full duplex RF key fob/remote for your car that controls the locks. The remote has an LCD screen.

If you command the locks to close, the remote will send a signal to the car. If the car receives the signal properly, it can lock the doors immediately and then send an acknowledgment (ACK) back to the remote to say "the doors are locked" and the remote can show this on its screen. However, the remote may or may not receive the car's ACK.

If the remote does not receive the car's ACK, the remote and user do not know if the doors are locked. At this point, the user can either attempt the process again, or give up and walk to the car, either of which are not desirable because it was unneeded. It may also cause further issues, such as the user expecting the car to be unlocked, and thus not bringing their keys to get an item out of the trunk. Thus there is desire for both remote and car to be "on the same page".

Now let's consider the same sequence, except that the remote received the ACK. The remote now knows that the car received the message. It can display to the user that the doors are locked... But the car doesn't know that the remote knows. From the car's point of view, it's possible that the ACK was not received, thus the doors should not be locked yet or else we run into the issues mentioned in the last paragraph. Thus the car can wait for the the remote to send an ACK of its own to the car. If that is received, the car knows that the remote knows that the car knows to lock the doors... But does the remote know that? No!

Seeing a pattern here? Both devices continue to pass ACKs back and forth. Neither can quit and say "I know 100% that the other device knows I'm going to perform my action".

Is there any way for both remote and car to be sure that the doors are locked and the remote shows it?

If that's not possible, what strategies other than simple brute force (car repeatedly sending ACKs) are there for being pretty sure that the doors are locked and the remote shows it as such?


texts: How to power up an LCD Controller Board with a power bank

texts: I am new to electronics so need help. Recently, I salvaged the screen of a broken VivoBook E402NA laptop, and bought this controller to turn it into an external monitor. Now, evidently this controller needs 12V DC and more than 3A as input power to work. My question is, how can I provide this power using a normal ordinary power bank? If I'm not mistaken, the voltage provided by the power bank's USB is 5 volts, right? Can I convert it into 12 using a DC to DC convertor? What will happen to its amperage then? Do you have any suggestions for me?


texts: Approrpiate Guage wire for 12v 1amp power supply?

texts: I am looking to power a Wineguard 12v Antenna Amplifier off a pc power supply. However I am wondering what gauge wire is right. The run will be about 4 feet total (2 ft each direction) at 12v with a draw less then 1 amp.(Unsure of exact draw but have powered with a 12v 500ma no problem). Should a 24 guage wire with a 3.5mmOD 1.3mm ID brrarel jack be sufficent? I'm worried it may be thin and the next largest size I have is 22 until I jump to 18 which seems a bit large. Thanks


texts:
I am designing a 18 layer, 2.5mm board using the material FR408HR and I am wondering about maximum via frequency, because I should use them for PCIe 2.0 (5 Gbps).

I have not found a specific information o formula to calculate via maximum frequency (as for example stub maximum frequency formula).
Using Saturn PCB, with our via parameters, I can find the impedance, and adjust the antipad to obtain 50 ohms and try to minimize via reflections. However, I don't know what means the resonant frequency of a via.
Using Polar Si9000e, the via check tool allow to me to find the maximum bit rate or frequency for a via. However, I do not understand why the maximum bit rate is the double of the maximum frequency (as in the image).


texts: What if you alter a differential amplifier by giving it a positive feedback rather than a negative feedback?

texts:
Figure 1

In the above Image 1, you see is a differential amplifier . It has a negative feedback as required.

Now take a look at figure 2 below.

Figure 2

Lets take a look at figure 2. Now that I have changed the opamp circuit to a positive feedback,

1) Could it still be called a differential amplifier?

2) What are the functions which could be performed by the circuit above?

3) How different are the output results achieved by it to a differential
amplifier?

4) How to derive the equations for this type of a circuit?


texts: Mesh Analysis with a ideal current source

texts:
I have been reading up on network analysis techniques for an upcoming competition, and I was wondering if anyone could be so kind as to derive and explain the system of mesh equations required to solve the following problem:

There is an ideal current source present. I want to solve for values that the answers are given for, but I have no idea what setup I should use for the two meshes with the ideal current source. Drawing three clockwise mesh currents i_a for the left loop, i_b for the top right loop, and i_c for the bottom right loop, I have come up (after applying KVL) with the equation

\$ 15=2I_a+5(I_a-I_c) \$

How do I formulate the other equations?

Thanks in advance!

Also, if this does not belong here, I apologize - and please tell me where I should post it!


texts:
My question is two fold.

Looking at the Wikipedia page for the List of 4000-series integrated circuits, it states that the 4030 has been superseded by the 4070.  Looking at various links1 it seems to be due to (from CMOS Cookbook, 1977, p.97):

  Early versions of this device have a very low input impedance and
  behave erratically in pulse circuits.

  Use the 4070 or equivalent 4507 instead.

Would that still be the case, for the few 4030 IC's that are still available on eBay2, or would those issues have been "ironed out" by now (or are they decades old stock)?

Also, the mention of the 4570, which is not listed on the wikipedia page. When I try to find it on ebay, I find only this: N°1 - CD4507CP - MC1407UB - MOT - DUAL COMPLEMENTARY PAIR PLUS INVERTER, which does not sound right at all3. Google seems to only turn up a Cisco switch.

So, what happened to the CD4507 and why is that even less common than the CD4030?

1 These links:

logic gate chips mentions the 4507
4030 vs 4070? has a number of reasons why the 4030 was discontinued
momentary electronic switching only states “CD4030 is generally rated for lower Vcc than CD4070.”

2 Such as 2 x CD4030BE CD4030 4030 IC Quad Exclusive OR Gate

3 Obviously eBay is not an authority on such matters and the item is possibly mis-advertised


texts: Altium Error: Multiple top level documents has been used

texts:
I made a project with two PCB boards. There are two top level sheets, and two corresponding PCB boards for each. The Power supply board is only providing power to board A.

I have been getting Multiple top level documents has been used error whenever I try to update the PCB boards from the schematics. Is it the wrong way? Is each project file meant for single PCB board?


texts:
A little background: I'm hoping to take the PWM from the Disney Parks Made with Magic Ears in order to drive a short 12V strip of LEDs (Here's a teardown.) After taking a pair apart and testing, I know the tri color LED is being driven by 1.6 V ( I was also able to wire another RGB LED in series). From what I've read, the LED Amplifier will boost 3-5V signals to 12 V.

My thought is something like a MOSFET or WLED driver would work? I'm also concerned about too much current through the existing ear circuit.

Any guidance would be appreciated!

Here's the the circuit so far.


texts:
I want to design a noise source using a Zener diode, but I don't know which
a Zener diode i can use.
Which a Zener diode have а strong noise?


texts:
Let's assume we have a circuit like this: (Us should be monopolar but I didn't find something like that).

simulate this circuit – Schematic created using CircuitLab

Negative half wave: D2 is active -> output voltage = -0.7V
positive half wave: D1 is active -> output voltage = ?

Well.. I know that we have 5.7V output here but my problem is that I don't get why we need 5.7V at least here by Uin. I would assume that as we have a source here we don't need any other input. So our U in only controls which output gets active.


texts: 78L24 outputs high voltage >24v - Harman Kardon AVR 151

texts:
I'm trying to repair my broken Harman Kardon AVR151.
Looking at the SMPS schematic, to my very limited knowledge I do not understand,

The 78L24 is a high side 24V regulator.
Why does the schematic say tge output is 38V?
Is the circuitry show below designed such a way to output a higher voltage?
When measuring I get a reading about 35V at VKK.

78L24 (actual part No. CVIL78L24AB)
Harman Kardon AVR 151/230C Service Manual page 123


texts: How can I get a raw image from a consumer camera?

texts:
I have an SLT camera (Sony A7R2) and while it has a raw output interface for video (via microHDMI out), it doesn't seem to have any way of outputting RAW apart from writing it onto the SD card.

My question: is there any way, maybe inside the camera, to connect some sort of interface and take it out of the camera? Alternatively, maybe there's a way to coerce the camera to transmit the still image via microHDMI? In any case, my idea is to grab the image, then do some image processing externally and save the image somewhere.


texts: Beginner's second PCB circuit design: AC to DC

texts:
I am designing an AC to DC converter and I just want to make sure that I am so far doing the right thing — placement of components and wiring etc. — as I am a beginner.

Does this look good so far?

This is my updated schematic and PCB.

Do the rectifiers look correct? I tried to space out 8mm for the transformer. Do the connections look good?

How does this look like? For J4 I have a 230v appliance but no power and for J5 I have the AC 230V and a relay which acts as a switch. Relay is rated for 260v. Would this work?


texts: I want to design a little oscilloscope that is able to analyze signals up to 1 MHz using a Xilinx FPGA. I want use the VGA interface in order to display the signals. Is it possible obtain a good result using only FPGA and an external RAM for signal elaboration? Or is it necessary to use an external microprocessor? With the Xilinx ISE Webpack license I can't use the MicroBlaze softcore processor, but only the PicoBlaze. What is the better way to obtain a good result with a simple and cheap design?


texts:
I need to precisely control (the position of) a small 3 phase servo motor with a microcontroller without breaking the bank. My research and confidence in my own skills has led me to something like an Arduino driving a L6234, but getting 16 bits of PWM resolution (with say, ATmega32U4 or Teensy) gives me a PWM frequency of no more than a couple of kHz (I understand why this has to be so.)
On the other hand, from what I've been reading, I can use a 4 channel 16 bit DAC like the LTC2654 in conjunction with an analog PWM like the LTC6992 and a crystal oscillator to generate very high frequency, high resolution PWM. For the components listed I would probably need a precision voltage reference too. The PWM would then go to the H bridge, possibly get filtered and then passed to the motor.
I also see that there are DACs with internal voltage reference but they are single channel, which increases my component count.
Could anyone tell me where this will go wrong and what I can improve? Suggestions for other components welcome too.
Edit:
I see the L6234 has a maximum switching frequency of 50 kHz, which is fine for me, but I'm not sure if the PWM chip can perate below 62.5 kHz. Maybe coffee will fix that.


texts: buzzer doesn't work at testing with DC power

texts:
i have a motherboard buzzer HYCOM mod:HY-05 i am trying to make it sound by providing
3 to 8 vdc as it  says in the data-sheet but still no voice coming
and i have also a buzzer KC-1206: still got the same problem ,is it possible that the two of
them are damaged ?
if someone knows how to operate ( :

datasheet

HYCOM mod:HY-05

KC-1206


texts: Using a PNP transistor as a switch connected from a 74154 then out to stepper motors

texts:
I am currently working on a project that involves an arduino mega 2560, one 74154 demux and 16 stepper motors. I want to be able to control which stepper motor turns at a given time. For this, the 74154 "tells" which stepper motor to turn when I throw LOW or HIGH from the arduino to the demux.

The stepper motors I have are rated for 5V and are driven by ULN2003AN driver boards that came with the package. The steppers should turn for about 6-7 seconds (completing one revolution). I want to have a separate 5V supply for my steppers and for this purpose, I am planning to put transistors to act as switches that will only turn on when an output from the demux is given.

Since the 74154 has ACTIVE LOW outputs, I think using PNP transistors would be a good idea (if my understanding of PNP transistors is correct) given that PNPs "turn on" with a negative base voltage.

Regarding the 74154, when I feed 0000 to the demux's ABCD input pins and 00 to both G1 and G2, Y0 produces an ACTIVE LOW output (while all output pins are ACTIVE HIGH), correct? Does this mean that, that ouput pin is producing 0V to the base terminal of the first transistor, and not any voltage at all? I should need any voltage lower than my 5V supply in turning on the transistor and allowing current to flow from the emitter to collector to the VCC pin of the first ULN2003A driver board and turning the first stepper motor. Is my understanding correct, or perhaps not? If I am wrong, can anyone enlighten me on this? :)

Also, I still have a dilemma about using TIP125 (a PNP transistor), if it is the best PNP transistor to use, and the values of my base resistor and whether I should put a resistor before connecting to my load, or not.

Any opinions and answers are truly appreciated! Thank you. ^^

Edit:
 This is the schematic I drew, hehe.


texts: STM32F4xx input pin reads wrong state on first run but not subsequent

texts:
I am working on a program which reads the state of a pin at startup to determine an operational mode. When I run the code on first power up, it reads incorrectly, but subsequent resets without power cycle read correct. I can't seem to find an answer for why this might be and I'm a bit at a loss myself. I figure there is some sort of timing issue that is happening and that is why subsequent reads are fine, but I'm not sure how to modify my code to deal with it. The circuit is PI6 connected to either 3.3V or GND, depending on the desired configuration. Here is the relevant code:

#define DEVICE_HOST_MODE_PIN                GPIO_PIN_6
#define DEVICE_HOST_MODE_PORT               GPIOI
#define DEVICE_HOST_MODE_CLK_ENABLE()       __GPIOI_CLK_ENABLE()
#define DEVICE_HOST_MODE_CLK_DISABLE()      __GPIOI_CLK_DISABLE()

int main(void) {

    /* MCU Configuration----------------------------------------------------------*/

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

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

    /* System interrupt init*/
    /* Sets the priority grouping field */
    HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_2);
    HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);

    BSP_InitializeMode();
    /* Remaining application code */
}

void BSP_InitializeMode(void) {
    /*Configure MODE signal line */
    GPIO_InitTypeDef GPIO_InitStruct;
    DEVICE_HOST_MODE_CLK_ENABLE();
    GPIO_InitStruct.Pin = DEVICE_HOST_MODE_PIN;
    GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
    GPIO_InitStruct.Pull = GPIO_PULLDOWN;
    GPIO_InitStruct.Speed = GPIO_SPEED_FAST;
    HAL_GPIO_Init(DEVICE_HOST_MODE_PORT, &GPIO_InitStruct);
    GPIO_PinState state = HAL_GPIO_ReadPin(HOST_READY_PORT, DEVICE_HOST_MODE_PIN);
    isDevice = (state == GPIO_PIN_RESET);
}

The SystemClock_Config() method is as generated by STM cube. I am currently compiling with -O0 and -g3 flags.

EDIT 1

Some additional information I have discovered: It seems more specifically that I can't read that a pin is pulled high (3.3V). I tried adding another pin and configuring both as pull-up, then grounding the one I want, and both simply read grounded.

EDIT 2

As requested, the definition of isDevice is posted below. This is in a header file mode.h

#ifndef MODE_H_
#define MODE_H_

#include <stdbool.h>

extern bool isDevice;

#endif /* MODE_H_ */

And the actual implementation is in the same file as the original code, at the top:

bool isDevice = true;

Additionally, I discovered a typo. Fixing it does not seem to have fixed the root problem though. I was reading the wrong GPIO pin number. It has been corrected above. Again, changing this to the correct pin number has not resolved the issue, and it still presents with two pins. I have tried setting them for no pull, pull up and pull down, and in no circumstances does it seem to change the result. They always read as grounded, no matter what signal is applied to them.


texts: Peltier died. Burn out? Condensation leakage? What could cause this?

texts:
This is a 12706 module. Running in a 15 minute "on", 2 minute "off" cycle for about 3 days. I have used it another maybe 4 days max since I purchased it. So definitely nowhere near its rated life cycles.

Using 12V power supply. Clean. Pulling about 4A. Proper heat sinks on both sides. Good stable temperature differential for 3 days and then suddenly, temperature differential went away. Hot side sink was around 105°F. Cold side sink would form ice if I let it run straight without the 2 minute "off" cycles. I didn't want ice. Sorry, didn't measure temperature here, but air temperature on cold side was 45°F, when room temperature was around 75°F.

I do have to confess that I missed putting foam around it and it did have condensation and some ice around it.

My only thought is that somehow some water got in through the original RTV silicone coated heavily around the edges (as purchased, not applied by me), causing short circuit inside the module? I didn't see any cracks in the silicone before I opened this module up. It was super tight.

Any other thoughts? What else causes Peltier premature failures like this?

Thank you!


texts: Connect 2 items on the same 5v port on Arduino

texts:
im kind new to the arduino and im experiencing the following problem.
Me and my friend build a circuit with a distance sensor which gets the distance and visualize it. The sensor requires a 5V power and i've connected it directly to the arduino. Now i want to connect a 10K potensiometer to get the analog value but i dont know if i can connect it at the same line.

As you can see i've connected the VCC to the 5V the ground and the echo cable. I've placed the potentiometer and i want to connect the 5V wire next to the sensor's 5V wire. Can i do it or im risking damaging the arduino?
Thanks

simulate this circuit – Schematic created using CircuitLab


texts: Driving 3 LEDs at 1000mA. Is this circuit / driver ok?

texts:
I want to drive 3 LEDs in Series at constant current of approx 900mA - 1000mA.

Will this circuit work? The LEDs are Vf 3.55V @ 1000mA.

LED Diagram

R1 = 0.25W 100k Ohm Resistor
R2 = 2W 0.47 Ohm Resistor
Z1 = 4.7V 1.3W 5% Zener Diode
Q1 = Fairchild KSP13 Darlington NPN 30V 500mA 625mW transistor
    - Datasheet: https://www.fairchildsemi.com/ds/KS/KSP13.pdf
Q2 = Vishay IRF830PBF Power Mosfet 500V 4.5A 75W
    - Datasheet: http://www.vishay.com/docs/91063/91063.pdf


texts: How much voltage I need to light up this led

texts: I have a RL80-UR543 LED 8MM. How much voltage I need if I use a resistor of 100Ohm?


texts: Should I connect solar panels in series or parallel for my charger?

texts: I am making a solar charger for 3 AA batteries. I have two 6 volt 100mah solar panels. Will it be more beneficial to connect them in parallel to have more current or in series to increase the voltage? The voltage of the 3 AAs will be at least 3.6 so I am wondering if there will be enough potential difference to charge them. I am aware that this charger will be slow and I will make sure that the batteries do not overcharge. They will probably be 1300mah 1.2 volt rechargeables. This is the solar panel: http://www.ebay.com/itm/301018398863?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT


texts: What's the best approach to implementing a remote control lock?

texts:
I was thinking how I would go about building a remote control lock with an Arduino (or better yet a Raspberry Pi when I get one) and thought I'd check to see if any were available for sale.  Schlage has something at a ridiculously high price with a monthly fee of $9-$13 or so.  Insanity!

So I'm back to thinking about building one myself.  I'm thinking the Pi would have its own web server and wifi interface to connect to my router.  I'm pretty sure I can mange the software side of things but need some direction on the hardware.

How would you do it, if you were going to build one?  What other hardware would I need to lock and unlock the door?   A servo?  A general purpose lock that I modify?  How?


texts: Confusion regarding finding closed loop transfer function and damping constant from open-loop transfer function

texts:
I have second order transfer function $$ G(s) = \frac{1.247}{s^2+9.76s+23.8}$$ G(s) is in the forward path of a unity feedback system.
How do I find the closed loop transfer function and damping constant from this? Now I know that the equation to find the closed loop transfer function is $$TF = \frac{G}{1+G}$$
If I use that here, I get $$TF = \frac{1.247}{s^2+9.76s+25.047}$$ and It is not in the form of a standard second order system which is $$TF = \frac{\omega_n^2}{s^2+2\delta\omega_ns+\omega_n^2}$$
That is, the numerator in TF is not 25.047. So How do I calculate damping ratio in this situation? Can I still take 25.047 as the square of natural frequency and equate that with the coefficient of s to find damping ratio?


texts:
I had an old Arduino setup where I used this chip to interface with another circuit which had some LEDs. The goal of the project was to signal the Arduino if the external circuit turned an LED on.
In the old setup Pin 1,2 of the 4N35 was simply connected parallel with the device's LEDs and the other end to the Arduinos which did DigitalRead() on it.
Has anyone successfully used this chip with ESP32 to do the same or is there a better solution to interface with an external circuit board?


texts: LC oscillator versus Kirchhoff's law for meshes

texts:
Analyzing the behavior of an LRC-circuit I got stuck on a seeming contradiction between the vector diagram of the circuit and Kirchhoff's law for meshes.

Please consider the circuit shown below and follow the description:

In its initial state, at t=0, the capacitor is fully loaded, so its voltage is equal to that of the DC voltage source (for example 5V). No current is flowing, so there is no voltage drop at the resistor and no induction voltage at the inductance.

At t=1s, the DC voltage is switched to zero Volts. This results in a closed circuit of L1, R1 and C1 with no source, thus a passive circuit. However, the circuit contains electrical energy which is stored in the electric field in the capacitor. Therefore, a transient process will start at t=1s. During this process, the capacitor is discharged and the energy is dissipated in the form of heat into the environment by the resistor.  At the end of the process, the capacitor will be discharged and no current will flow anymore.

Now for the question: As the vector diagram below shows, the voltages at the inductance, capacitor and resistor cannot add up to zero, except each of these voltages is zero itself. (UR is perpendicular to both UL and UC). But according to Kirchhoff's law for meshes, the voltages have to add up to Zero during the transient process (closed mesh of L, R, C). So we have a seeming contradiction here. What's the resolution to that? (Or: Where is the error within my understanding?)

I know that the vector diagram is not exact, because what I consider here, is a transient process with decreasing amplitudes while the vector diagram represents stationary behavior with constant amplitudes. However, that shouldn't make a difference, because the phase angles of the voltages are correctly represented, aren't they?


texts: Sixty INDIVIDUALLY on/off switchable COB LEDs connected in parallel: how to drive?

texts:
For an atmospheric custom ambient lighting project, consisting of 60 individually on/off switchable COB LED's, each rated 2 Watts, 12~14V, max 200mA, all connected in PARALLEL, i'm looking to solve two questions.

First I'll sketch the situation. Often times only 1 (out of 60!) Led will be switched on. Other times between 3 to 6 leds will be switched on. Rarely will there be more than 18 led's switched on and never all 60 at once.

Q1. As a single LED driver, will a 35W, 3A driver suffice for my project?
Q2. Will that tiny resistor on the cob pcb protect each led from high currents of the driver? Or will I have to manually solder resistors in series with each LED cob? If so, what Ohms / Power value am I looking for?


texts: Make a wire thicker will work to avoid overheat?

texts:
I'm new to this community and it's a pleasure to start rolling in it! I have a simple question in regards to wire overheat that I hope you guys help me to solve, any help is deeply appreciated =)

I have a Forza FVR-1200va power regulator that I use to supply my PC along with some other small accesories, if I have many things working at the same time and I use, let's say, a very cheap and thin extension cord, this starts heating immediately, if I don't turn the regulator off or disconnect the cord from the main outlet the cable is pretty much condemned to melt, I understand that, but, I've been wondering... Given that thicker cords have zero cons against this type of situations, what would happen if I manage to make thicker the first cord somehow? for example, if I remove the insulating plastic and get to the copper of a large segment of the wires (not including the outers that go soldered/attached to the metal connectors) then use some extra copper wires from other cables to double the size, twist everything, and carefully reinsulate the cutted segments with heat shrinking tube or any other material, would that be enough to avoid the overheating? I'm not planning to do any of this by the way, I'm just curious =) would that work at all?


texts: If two identical transformers are connected in parallel, referring to LV(secondary) side, any change?

texts:
Assume transformers are 10/0.4 kV 500kVA transformers. Primary is high voltage side and secondary is the low voltage side.

Normally we do Z_secondary(LV) = Z_primary(HV) * (Vrated2(LV)/Vrated1(HV))^2 to refer impedances from primary to secondary in case of a single transformer. My question is, if instead, two identical transformers were connected in parallel, will the referring be the same? Or will there be any changes in the above formula?

Thanks.


texts:
I am designing a spot welder using a transformer from an old microwave and need to calculate the welding current that will be generated. I'm fairly certain that knowing the input voltage and power rating as well as the number of turns on the coils will allow me to do this, although I'm not entirely certain what's going on with my primary coil. It seems as though it has 16 'layers' and 8 turns on each layer. I'm not sure how this would effect my calculations, am I supposed to take the number of coils on my primary as 128?
https://imgur.com/a/nc3sm


texts:
I am attempting a project that is a basic usb keyboard logger.  I plan on using a PIC32 microcontroller that has built in USB host capabilities to interface to the keyboard.

My question is, can i hang off in parallel my MCU to read the data lines without affecting what is sent to the computer?  See the below picture.

Is this acceptable practice, or does the data need to be fed in series from the input->mcu->output connector?  Any issues with current draw?

Thanks!


texts: why do digital multimeter show voltage when we touch the probes

texts: Why does the digital volt meter show  readings when we touch the probes..  It usually happens when I touch the probes it shows somewhere around 7 to 700mv of values is that natural?  If yes..  Then what is the science behind it?