texts: How can the Nyquist theorem for the maximum bit-rate of a noiseless channel be derived?

texts:
I've been given the formula:
$$ I = 2* H * log_2(L)$$
where:

\$ I \$ = Maximum data rate in bits per second for a noiseless channel

\$H\$ = Bandwidth that the channel will carry (that is, the range of frequencies, not the bit rate)

\$L\$ = Number of discrete levels in the signal

Could you explain to me where this formula comes from? How does it model the noiseless channel, and how is the formula derived?

I understand how it takes \$log_2(x)\$ bits to distinguish between \$x\$ number of things.

(Edited to corrected formula)


texts: STM32 Input capture PWM frequency measurement problem using HAL

texts:
I'm trying to measure time passed between two external interrupts generated by rising edges of a PWM signal (generated using a IC 555 timer). Point is to determine the frequency of the signal. I'm using GPT (General purpouse timer) in input capture mode. The callback routine is mentioned in the code below.

void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim)
{
 if (htim->Instance==TIM2)
  {
  input_capture= __HAL_TIM_GET_COMPARE(&htim2, TIM_CHANNEL_1);    //read TIM2 channel 1 capture value
  frequency=input_capture-input_capture_prev;
  input_capture_prev=input_capture;
  FLAG++;
  }
}

Every time an external interrupt happens i take the timer time and subtract it with the time when a previous interrupt happened. Now i want to make a buffer and take 20 samples which i'll divide with the length of a buffer to get a precise reading. Basicly i want to make a function which starts the timer in interrupt mode takes 20 samples divides them by 20 and returns the precise value and after that disables the timer. Here is the function code.

uint32_t sampleCapacitance(void)
{
    uint32_t sum=0;
    HAL_TIM_IC_Start_IT(&htim2, TIM_CHANNEL_1);
    FLAG=0;
    while(FLAG<20)
    {
        buffer[FLAG]=frequency;
        sum+=buffer[FLAG];
    }
    HAL_TIM_IC_Stop_IT(&htim2, TIM_CHANNEL_1);
    return sum/20;
}

All the variables used that aren't locally defined are global volatile variables. I'm calling this function every 1000ms, the PWM signal period has variable length (few ms to 100 ms approximatly). System clock frequency is 48MHz, and the timer prescaler value is 47999+1 which gives a time base of 1000 Hz. For some reason this doesn't work properly.(buffer values are mostly 0, except on 20th and 0th index) I'd like to know if there is a smarter way to do this and make it work. I'm really a newbie in MCU programming, especialy with ARM Cortex architecture so any help would be appreciated. Thanks in advance.


texts:
I am working with ATmega32-A micro controller. I am trying to read ADC (AD7798) values. I am setting ADC registers as shown below. Images also attached.

char spi(char data)
{
    //Start transmision
    SPDR = data;
    //Wait for transmision complete
    while(!(SPSR & 0x80));
    return SPDR;
}

void setupAd(){
    ADC_CS=0;
    SPCR = 0x5D;
    spi(0x10);   //set up communication register for configuration reg (16bit).
    spi(0x07);    // sending 07 as MSB
    spi(0x10);    //sending 10 as LSB
    ADC_CS=1;
}

I am trying to read this configuration setup using this

void ReadAdConfReg(void)
{
    SPCR = 0x5D;
    ADC_CS=0;
    spi(0x50);
    adcConfig = spi(0xFF)<<8;
    adcConfig |= spi(0xFF);
    ADC_CS=1;
}

printing like this

ReadAdConfReg();
printf("configreg:%d",adcConfig);

But my problem setup of that configuration registor was not working. I have checked with oscilloscope any mistakes in clock polarity and chip select. I have attached images as shown below.

Please help me why i am not able to set configuration register. clock polarities and chip select every thing ok according to ATmega32-A data sheet and AD7798 datasheet. please help me what mistake i am doing. or If I want to check my configuration register setup on oscilloscope What i have to do.


texts: VHDL: Converting from an INTEGER type to a STD_LOGIC_VECTOR

texts:
I built a mod-16 counter, and the output result is a INTEGER (all the examples I saw used INTEGER).

I built a hex-to-7-segment-display decoder, and its input is a STD_LOGIC_VECTOR (wrote it that way because it was easy to map out the truth table).

I'd like to connect the output of the counter to the input of the decoder, but I get 'type mismatch' errors when trying to compile in QuartusII.

Is there a way to convert from a INTEGER type to a STD_LOGIC_VECTOR type in a VHDL listing?


texts: I have a Peavey LTD 400 steel guitar amp. I want to overdrive the tubes in it, but it is a very loud amp. To practice I would like an attenuator between the amp and the speaker. I've seen a lot of DIY attenuators on the net for 50 and 100 W amps, but not for anything like this amp. If there is a cheap solution to my problem, I would love to hear about it. I can solder, and have a degree in math, so I'm not useless, but I'm not up on electronics. Can you help?


texts: c18 assembly inside function problem. unidentified label (bit names)

texts:
Here is the data_write function I'm looking at.  I've been told that this method (from the textbook) is not good and I should be using the C method (that is currently commented out).  When the Cbits method is used, any arguments after the _asm/_endasm the compiler doesn't recognize the bit names (they don't turn green).

If I use only the assembly method, I get a string of errors [1111] about the undefined label (WR, GIE, EECON1, etc.) inside this function.  Do I have to somehow re-define the ADC.h inside the function?  Basically, all of the register names (EECON1, etc) and bit names (WR, WREN, etc.) are not recognized inside the function "data_write" if they are inside the assembly tags (_asm/_endasm).  If I use the Cbits.BIT method, I get a generic syntax error and the bits following _endasm are not identified (turn green).

#include <stdio.h>
#include <stdlib.h>
#include <p18f452.h>
#include <delays.h>
#include <adc.h>

int result;                         // used in ADC result handling
int write_point=0x64;               // used in data_write function. initial=d100

void data_write (int write_point, int result);   // declare prototype

void main(void)  // <==should this be 'int main (void)' b/c i'm passing result to another function ?
{
    while (1) {
    // sensor 1 configured to port AN0
        OpenADC(ADC_FOSC_8 & ADC_RIGHT_JUST & ADC_5ANA_0REF, ADC_CH0 & ADC_INT_OFF);
                            //configures ADC for port AN0 = sensor 1 input
            ConvertADC();               // initiate conversion of sensor1 @ AN0
            while(BusyADC());           // waiting to complete conversion
            result=ReadADC();           // read the result of sensor1 @ AN0
            data_write(result, write_point);
        CloseADC();
                    }
        }

void data_write (int write_point, int result) {

/*        EECON1bits.EEPGD = 0       // points to data memory
         EECON1bits.CFGS = 0        // access data eeprom
         EECON1bits.WREN = 1        // enable write to data eeprom
         INTCONbits.GIE=0           // disable interrupt
** if I substitute this method of bit control, this 2nd portion belongs after
 * the asm arguments, but the bits (WR, GIE, WREN) will not be identified
 * either an I get a syntax error. (of course commenting out the bcf/bsf statements)
        EECON1bits.WR = 1       // enable bit to start the write operation
        INTCONbits.GIE = 1      // re-enable interrupt
        EECON1bits.WREN = 0    // restores the write command to =disabled */

_asm
 movlw  write_point        // starting data memory address = data_adr
 movwf  EEADR,A
 movlw  result              // gets data stored in "result" variable
 movwf  EEDATA,A            // places data into data memory holder
 bcf    EECON1,EEPGD,A      // points to data memory
 bcf    EECON1,CFGS,A       // access data eeprom
 bsf    EECON1,WREN,A       // enable write to data EEPROM
 bcf    INTCON,GIE,A         // disable interrupt
 movlw  0x55                // start flash erase sequence
 movwf  EECON2,A
 movlw  0xAA
 movwf  EECON2,A            // end flash erase sequence
 bsf    EECONN1,WR,A        // enable bit to start the write operation
 bsf    INTCON,GIE,A        // re-enable interrupt
 bcf    EECON1,WREN         // restores the write command to =disabled
 _endasm

 write_point = write_point+2;  // increment address by 2
 if (write_point >= 0xC6)      // if address >= d'198
     write_point = 0x64;       // resets starting point to d'100

}


texts: To what extent can an FPGA be "configured for desired use"?

texts:
If the title is off putting, I will elaborate.

Some say that if you want a custom CPU you can "customize" it with a field programmable IC, AKA, field programmable gate array.

But to what extent? And is over and under clocking, address line modding, register-level-transfers, and other features able to customize?

For example, one would expect a FPGA to enable "changeable", but changeable in the sense that it can be optimized for a specific purpose, speed, and system?

Like, if I want an FPGA to be customized to replicate an old video game system I would expect it to have a slower clock, less bit width, and to access slower DRAM.

Can FPGAs really be customized for a wide variety of uses, either under clocking and lowering performance, to over clocking and extending to maximum processing power and I/O lines, etc.?


texts: Shift Register Programming with 8 and 16 bit drivers

texts:
I built up a test circuit using 2 74hc595n shift registers to control a total of 16 leds with success. In the interest of saving space, I designed my circuit board to use one STP16CP05MTR shift register to do the job of the two 595's. I was led to believe I could use these in place of 2 595's. Is this correct, or is there a better choice, or different programming needed for it to function properly??

STP16CP05MTR Datasheet
http://www.mouser.com/ds/2/389/CD00126634-470906.pdf

595 Data sheet
https://www.google.com/url?sa=t&source=web&rct=j&ei=pCe1VMyxIMmcgwTluILABg&url=http://www.nxp.com/documents/data_sheet/74HC_HCT595.pdf&ved=0CB0QFjAA&usg=AFQjCNEk769V7UmuntIvV4jbOQaDZtVGhw&sig2=VNa9dAtctfvJ6U8bgKY8mA


texts: How to integrate external library into KiCad

texts:
I am using KiCad (5.1.5). I got this self-made library from my lab mate he told me to make some changes to his schematic. Inside the folder that he gave consists the following folders and files:

footprints.pretty (folder) - A ton of .kicad_mod files
adafruit.dcm and adafruit.lib
xxlib.dcm and xxlib.bak and xxlib.bck

I am a noob to KiCad and have no idea what these files mean and how I should even integrate them into the software. Can anyone please help me by explaining the different file-types mentioned and how to integrate or upload.


texts: Pulse output only from switch toggle on OR switch toggle off (not both please)

texts:
I found this circuit here from a few years ago posted thanks to tcrosley.

Using the 74LS122 I found that it produces a short pulse both on latching the input high AND to low. The problem is I can't work out how to make the output pulse on just one of those input states and not the other.

I would like to connect a toggle switch to the input that produces a pulse output when toggled on, but, importantly, produces no output when toggled off (the circuit in its current form produces a pulse on both toggle states!). Any help with this would be gratefully received.

Also, from what I can gather from the IC spec sheet, it seems this chip doesn't need any switch debounce on the input, if I am correct...  many thanks


texts: P channel mosfet as a switch on logic level

texts:
I'm quite confused about the p channel mosfet as a switch. I saw designs with zener diodes, other mosfets or BJTs but these seem overcomplicated. I have many P channel mosfets from broken chargers (mainly Alpha Omega 4407A, 4411, 4423 - which one should I choose?), that's the only reason I want to use the PMOS instead of NMOS.

I want to create a battery tester with charging and discharging capabilities. The only part that I don't know how to do is the power switching.

3V3 logic level with ESP8266 MCU, 5V charging voltage and 4.2-3V 18650 discharge voltage.

The prelimenary circuit:

Is the circuit correct, do I need pullups? What values should I use for the resistors?


texts: Testing serial communication programming

texts:
I have made a user interface program (with buttons, trackbars, etc.) for Windows (using .NET C#) where one talks to an embedded device (an ARM uC) through its RS232 port and I use a RS232-USB converter to use with my laptop.
When I test everything works fine. But if I send it to a customer I am afraid their ports, CPU speeds, etc. could be different. And I don't know would that affect the data transmission
Can we be sure about the physical layer with different computers would behave same way?
Does anybody have any experience with testing serial port for production SW?
Or what could be done to test the protocol for such scenario. I hesitated to ask this here because it involves electronic communication and programming topics.


texts:
can i know what, why and how this Rth is parallel / how its calculated?

answer by jonk: thevenin analysis

i mean my solution would be:

  I1 = I2+ I

.

  I1 = (9-V2)/10k
  I2 = V2/20k
  I = V2-0.7/20k

.

  I1 = I2+ I
  (9-V2)/10k = V2/20k + V2-0.7/20k
  (9-V2)/10k = (2*V2- 0.7)/20k
  2*(9-V2) = (2*V2- 0.7)
  edit:
  V2 = 6.23v // missed up here
  edit: V2 is actually 4.675v

V = V2 - 0.7V = 5.53
i = 5.53/20k = 0.276mA

this supposed to be example from a university lecture, what im missing here?

Edit:
how this nodal analysis is different than above thevenin analysis


texts:
I believe that the answer is no, but I wanted to check before I put effort into rectifying it (and no, no promises!)

Is there anything like Scratch that one can use to program an Arduino?

(Scratch is a graphical coding environment that makes learning to program fun, and is certainly suitable for elementary students.  It is put out by the Lifelong Kindergarten Group at MIT).


texts: What will happen if I feed this rangefinder 3.3v?

texts:
I have this rangefinder http://www.hobbyengineering.com/H2951.html and my MCU is running on 3.3v (MSP430G2231), will this thing work poorly if I feed it 3.3v instead of 5v? I really don't want to have TWO voltage regulators on this board. If not what else can I do to get it the voltage it needs? The power source is a 9.6v battery pack with a LD33V - 3.3V regulator.

Spec sheet:
http://www.parallax.com/dl/docs/prod/acc/PingDocs.pdf


texts: How do I test grounding/lightning protection?

texts:
I manage IT for several clients in Central Florida, where we have quite a lot of lightning (the most in the U.S.). I have one client that has trouble keeping electronic devices alive. We have replaced several network devices. I suspect there is a problem with the grounding or surge/lightning protection. I am not worried solely about that electrical system. The ethernet network seems to be a problem as we keep losing individual ethernet ports on devices. Some of the devices keep working, but individual ports are dead and we just move connections to previously unused ports. But it is not clear to me if the hardware is dodgy or the facility is more vulnerable than others.
I have previously asked this on networkengineering.stackexchange.com and the only advice I got was to hire an electrician. I can do that, but I am not sure I can trust someone to not just sell me a lot of remediation services that do not improve anything.
Is there a device I can buy or a process I can follow that can show me what, if any, wiring is bad? I have a simple wall plug AC outlet ground tester widget that I plug into outlets that tells me if the something is obviously bad, but that doesn't help me with surges or ethernet.
If I do hire an electrician, I would like some way to verify this personally without relying on someone else.


texts:
For a BLDC driver I`m using this Mosfet:
http://www.farnell.com/datasheets/526719.pdf?_ga=1.38505579.956125949.1445440291
on page 6 there are some diode data.
Is this diode enough for my application?

Some data:

pwm frequency 20Khz
Supply Voltage 50V
Max current 100A
Each bridge has 3 mosfets parallel
Gate driver ir2110

how do I choose the right freewheeling diode?


texts:
(Beginner here!): I am building a circuit where I am using an AND gate with some input voltages. If the gate output is high for a given (continuous) amount of time, I want to trigger another circuit. The delay length is 0.5s.
So if AND gate signal persists for 0.5s, then the next portion is triggered. I wanted to use something like the 555 timer, but I'm not sure if this is the right approach (I need the timer to reset if the signal ends before the 0.5s cutoff). Is using the 555 timer the right track? If it is, how should I pick the right combination of other components to get this desired time interval?
Again, I am a beginner so I do apologize if this isn't very technically sound/informative. Any help is appreciated.
EDIT 1: RC Circuit Based Attempt with Buffer:

EDIT2: RC Circuit Based Attempt with Buffer and Schmidt Input


texts: Detecting when the thermostat turns on the refrigerator

texts:
I'm wanting to monitor the power consumption of my Fridge (and Freezer) on a boat where the voltage runs from 12-15.6vDC

The Thermostat is an Inkbird(from Amazon) that closes a relay when the compressor needs to come on.  This alerts the Compressor controller to turn on the compressor.  This controller also activates a small computer type fan to blow air over the coils.  I'm wanting to capture the time period the unit is running so I can track the power consumption.  There are several factors that can cause the consumption to go up.

Door gets left slightly ajar
Frost builds up over time
Compressor leaks Freon
Exterior Temperature changes.

Rather than rely on a meat computer (me) to track these things I want to post them to a raspberry pi which will track them over time and alert me when things go off the rails.  To do that I need to know when the unit is running and I need to do it with very low power consumption (because I'm living on batteries and sunlight).
There is a single Voltage ADC on the Arduino that will measure the voltage between 0 and the supply voltage. I could do some type of voltage divider and look for something there using the fan connections which are only powered when the compressor is on, but that means I need 2 Arduinos.  Is there some simpler mechanism for detecting the thermostat has closed the relay?  Maybe something that does i2c so I can deal with everything in a single unit.  Would be even better if I could feed that back directly to the raspberry pi, relying on the fan voltage to activate the device so it is only consuming power while the compressor is running.
The things I want to do is have the rPI watch the runtimes and alert me if the consumption rises over several days, or if the unit is on continuously for longer than expected; I also want to be able to send alarms onto the navigation bus, and an audible alarm when there is something I need to look at.  But that is just software.  I need the sensing to drive that.  What is a super simple, low power way to deal with that?
The rPi is already being used for other things (navigation, wifi, media player, etc....)


texts:
Please forgive me if this question sounds stupid but I am still an amateur.

I was trying to power a DC motor a while ago and blew a transistor. Later I realized that it was rated for 200mA and I exceeded that with my batteries.
Anyway then I wondered how to solve this problem. Should I get a transistor that can handle more current or should I step up the voltage (and as I understand decrease the current) so that I don't blow the transistor but still get enough power to the motor (a rather small one).
I was also wandering if it is a good idea (in general) to step up the voltage and in doing so decease current (correct me if I'm wrong) to protect components that can only handle like 200mA or it it better to get components that can handle more current.

Again I'm a bit nooby so please correct me if I'm wrong.


texts: voltage spiking due to strong gate driver

texts:
If I make the PWM signal to gate very steep ( with rising time tr is very small like 200ps) then at rising time the gate charging current spike is too big, up to 6A and that current flows to the drain too and make output voltage spike.
Normally how would you solve this?
One possible way is to make gate driver weaker but what else can I do without slowing gate driver?


texts: safety margin in transistor base current

texts: In this answer poster calculates a safety factor of 10 for the minimum base current in a transistor used as a switch. Seems like a lot to me, and for higher collector currents this may mean that a microcontroller won't be able to drive it anymore. Is a factor 2-3 not enough?


texts: Is the paper "Field Wiring and Noise Considerations for Analog Signals" talking about AC or DC signal level?

texts:
The paper Field Wiring and Noise Considerations for Analog Signals mentions the following info:

  Single-ended input connections can be used when all input signals meet
  the following criteria:

  Input signals are high level (greater than 1 V)

What meant by "1V" is AC or DC here? Do they mean by 1V  a swing or offset?
In other words if the signal offset is 5V but the max swing is 100mV should I use differential ended?


texts: Is backfeeding BD9C601EFJ buck converter IC a problem?

texts:
So I've got a circuit like that [Values are completely random, I didn't set them yet, the question is only about topology]:

The circuit is intended to charge a 2S battery through F3, however when the power adapter connected to VIN is unplugged the battery pack will backfeed BD9C601EFJ and I am not sure whether it is safe for the IC, so I've added a D150 Schottky diode, but of course, I don't want it because it adds inefficiencies and internal structure of IC looks like it would be safe, but I am not sure.
So, the question is: can I get rid of D150, or should I leave it?


texts: DC-DC Boost converter IC with external MOSFET?

texts:
I've got a shitty (low pixie production capabilities) step-up LED driver (FAN5331) and I was wondering if I can make it more powerful by adding an external MOSFET to the switching pin of the thing.
Would this design work well enough? Ignore the coil and resistor divider values, they have been used in a previous design. I'm trying to get 12V ~700mA from a USB port and I don't have a better idea by now. I can also use an ATTINY25 to do the job, it can switch close to 250KHz but it's not quite the 1.6MHz this little chip promises, which can be more easily filtered.


texts: I am new to this, but I wanted to ask how it would be possible to convert a dB value into resistance. I've been looking at an isolated analog switch from http://www.ti.com/lit/ds/symlink/ts5a3359.pdf that has an OFF isolation value of -64dB at 2.5v (more on pg 10), and I need help converting this. I'd appreciate any help.


texts:
I'm really discouraged with MOSFET amplifier biasing.

The results of my experiements my be found here:
MOSFET amplifier mid-point bias

Voltage-divider schematic:

I found that for voltage divider biasing I can set Q-point with some approximation. I can't calculate divider to make V_drain to be half of the amplifier voltage source VDD0. It need to tune schematic with additional resistors.

Can anyone show any recipies of MOSFET amplifier biasing with equations or links to another posts for example?
I also may not fully understand what is Id_on? Some books say that it's a current at which MOSFET first move into saturaion region but another tell that at that value the MOSFET go into fully on mode (as switch). What is it in reality?
Also I found that for voltage divider bias there is overdrive voltage eixts Vovd = Vgs - Vth and Vds > Vovd, why it's so and how to view that on graph?
A'm also interested in how really bias point set in the next schematic. I think that in this schematic Rd resistor determines the limits of Id current. And the actual Id current can't be properly setup. Is it so?


texts: External power source to power different servos

texts:
We are building a robotic arm that requires the use of 6 servos. I'm planning to use one external power source to power all the servos. The problem is that each servo has a different current draw rating. Some servos draw up to 10A when stalled (which should not happen). In the same time, we are using small servos, which draw 2A of current if stalled. However, they all have the same voltage rating (~6V).

So, I was wondering how they can all be powered using only one power source?

Here are more details:

Total stall current: ~30A
Total required power: ~170W


texts: utilize a single channel to transmit data generated from 16 users (using mux)

texts:
I have found this question in a book and find it confusing. The question is,

For a communication system, it is required to utilize a single channel to transmit the data generated from 16 users. Design a feasible circuit to aggregate the 16 users to a single channel using 4:1 multiplexers. Design a user selection circuit to interface with the above designed aggregation circuit.
Please help me get an answer for this with explanation.


texts:
I am running an alternator with an electric motor (variable speed), but I do not know the shaft speed. I would like to calculate it from voltage frequency.

The rotor of the alternator has 12 poles (6 south + 6 north >> http://www.tb-training.co.uk/images/poles.gif). The stator winding is connected as Delta. If a connect a multimeter (Fluke 87V) across one of the three windings, I get 100Hz. Following formula:

Nshaft = 120*frequency/poles

I get rotation speed of 1000 rpm. Is my calculation correct?


texts: Circuit reliability, especially tin solder, under wide temperature range -40 degree to +85 degree

texts:
We are trying to have our Lab product work in industry environment. One key factor we are thinking about is the operating temperature, since we have never done any environment test before.

Our circuit consists of MCU, ADC, DAC, Opamps and resistors, diodes, capacitors.

My questions are:

If all the components are specified to work at -40 degree to +85 degree, can I say the circuit will surely working at that environment?
How would the tin solder behave at -40 degree? I read that Tin pest may happen under that environment.
Any other suggestions will be really appreciated.


texts: Calculating the reactive and active power

texts:
This is probably an easy one for you. In the following circuit

simulate this circuit – Schematic created using CircuitLab

I want to calculate the active and reactive power in load R2-C3. I've calculated the voltage over these elements to be

$$u=\hat{U} \sin(\omega t + \phi) = 0.0465 \sin(1000 t + 3.53 \text{ rad}) V$$

Now I calculate the active power, P, to be

$$P = \frac{U_e^2}{R2}$$

and the reactive power, Q, to be

$$Q = \frac{U_e^2}{\Im (Z_{C3})}$$

Where $$Z_{C3}$$ is the impedance corresponding to C3 and $$U_e = \frac{\hat{U}}{\sqrt{2}}$$ is the effective value, or root mean square, of voltage u.

Am I doing this correctly?


texts: Testing JK Flipflop using system verilog

texts:
I have a testbench written for a JK flip flop. Below I have the correct circuit that passes the testbench and another circuit which passes the testbench as well. Is there something wrong with my testbench.

a) Correct JK flip flop

module jk_ff (input j, input k, input clk, output logic q);
    always @ (posedge clk)
       case ({j,k})
          2'b00 :  q <= q;
          2'b01 :  q <= 0;
          2'b10 :  q <= 1;
          2'b11 :  q <= ~q;
       endcase
 endmodule

b) Wrong JK flip flop but passes all test cases in the testbench

module jk_ff (input j, input k, input clk, output logic q);
 always @(posedge clk)
 case ({j,k})
 2'b10 : q <= ~ q ;
 2'b01 : q <= 0 ;
 2'b11 : q <= 0 ;

 endcase
 endmodule

c) Testbench

include "jk.sv"

module tb_jk();

    // open fitness file
    int passedFile;

   reg j;
   reg k;
   reg clk;
   wire q;

   always #5 clk = ~clk;

   jk_ff    jk0 ( .j(j),
                  .k(k),
                  .clk(clk),
                  .q(q));

   initial begin
    // open file
    passedFile = $fopen("passed.txt", "w");

      clk = 0;
      j = 0;
      k = 1;

      #10 if(clk == 1 && j == 0 && k == 1 && q == 0) $fdisplay(passedFile, "%d", 1);
         else $fdisplay(passedFile, "%d", 0);
      #10 j = 0; k = 0;

      #10 if(clk == 1 && j == 0 && k == 0 && q == 0) $fdisplay(passedFile, "%d", 1);
            else $fdisplay(passedFile, "%d", 0);
      #10 j = 1; k = 0;

       #10 if(clk == 1 && j == 1 && k == 0 && q == 1) $fdisplay(passedFile, "%d", 1);
             else $fdisplay(passedFile, "%d", 0);
      #10 j = 1; k = 1;

      #10 if(clk == 1 && j == 1 && k == 1 && q == 0) $fdisplay(passedFile, "%d", 1);
            else $fdisplay(passedFile, "%d", 0);

      #10 $finish;

      // close file
      $fclose(passedFile);
   end
endmodule
```


texts: Identifying Correct Power Cable Extension

texts:
I have the following power cable for a projector:

I need either an extension for the part that goes in to the projector (with the yellow pin) or a whole new power cable and block with a longer cable on that side of the block.

Does the circled yellow pin input plug have a specific name? I've tried searching for extension cables (female of that pin, back to male again) but can't get the search terms correct for relevant results.

Are there any potential issues with that? I'd be looking for an extension of around 5 meters (or an alternative charge cable which comes with 5 meters as standard).

Edit: Also just to clarify, I realise using a power extension on the plug side would be easier, but I need the block to be further away from the projector, so that's not a viable option. The projector's being mounted on the ceiling and I don't want to place the power block above the ceiling tiles.

Thanks.


texts:
I'm trying to design and build a simple ac/dc smps that outputs 5v dc and capable of 2 amps. I currently have some of it designed but the problem I'm running into now is how to get a pwm signal with 18V when I go to build it as I have simulated? Do you have any suggestions? Maybe there are some ic's on the market that can do the pwm with feedback circuitry so the output voltage always stays ~5v dc? I desperately need help with this as I need to build it soon to stay on track for my project. Thanks for all your help.

The transformer is a 10:1 and the 18V Square wave is at ~40% duty cycle at the gate


texts:
I find that derivations of formulas are a lot more useful to me than just recitations of formulas.  I'm looking at a self-biased JFET circuit, and I'm interested in deriving the quiescent state of the circuit under DC conditions.  Neglecting all AC components of the circuit, I have a very large resistor, \$R_g\$, between gate and ground, and another resistor, \$R_s\$, from source to ground.  Drain is connected to \$V_p\$, my power supply.

simulate this circuit – Schematic created using CircuitLab

I believe this is a fairly standard JFET circuit.  I understand how to analyze the circuit.  What I'm interested in is the derivation of \$I_{d}\$.  This is given to me as \$I_{d}=I_{dss} \left(1 - \frac{V_{gs}}{|V_p|)} \right) ^2\$.  None of the textbooks I've got on my shelf go into the derivation, nor did my google searches.  The closest I got was from a textbook that said that the JFET is a square-law component, and this relationship is intrinsic to the component.  I don't buy it.  Transconductance is intrinsic to the component.  Current flow isn't.  Can anyone show me how \$I_{d}\$ is derived?

Edit:  Sorry, I was asking for the wrong parameter and gave the wrong formula, as well.  Question is updated.

Edit:  Some discussion from Alfred Centauri pointed me in a good direction.  I've done a bit more work that I'll bring up here.  It's mostly turned into a math problem, now.

Essentially, I want to derive \$I_d\$ based on intrinsic properties of components.  Transconductance is a property of JFETs, so I started from there.

Knowing that \$g_m = \frac{dI_d(V_{gs})}{dV_{gs}}=\frac{2I_{dss}}{|V_p|} \left(1-\frac{V_{gs}}{|V_p|} \right)\$, I can rearrange and work some calculus, as follows.

$$
g_m = \frac{dI_d(V_{gs})}{dV_{gs}} \\
dI_d(V_{gs}) = g_mdV_{gs} \\
dI_d(V_{gs}) = \frac{2I_{dss}}{|V_p|} \left(1-\frac{V_{gs}}{|V_p|} \right) dV_{gs} \\
\int dI_d(V_{gs}) = \frac{2I_{dss}}{|V_p|} \int dV_{gs} - \frac{2I_{dss}}{|V_p|^2}\int V_{gs}dV_{gs} \\
I_d(V_{gs}) = \frac{2I_{dss}V_{gs}}{|V_p|} - \frac{I_{dss}V_{gs}^2}{|V_p|^2} + C
$$

We can find \$C\$ as we know \$I_d = I_{dss}\$ at \$V_{gs} = 0\$

$$
I_d(0) = \frac{2I_{dss}(0)}{|V_p|} - \frac{I_{dss}(0)^2}{|V_p|^2} + C \\
I_{dss} = C
$$

Therefore:

$$
I_d(V_{gs}) = \frac{2I_{dss}V_{gs}}{|V_p|} - \frac{I_{dss}V_{gs}^2}{|V_p|^2} + I_{dss} \\
I_d(V_{gs}) = I_{dss}\left(1 + \frac{2V_{gs}}{|V_p|} - \frac{V_{gs}^2}{|V_p|^2} \right) \\
$$

This is really close.  My target is \$I_{d}=I_{dss} \left(1 - \frac{V_{gs}}{|V_p|)} \right) ^2\$.  Think I can switch the signs of the terms by rolling the negative factor into my absolute value denominators?


texts: Output Voltage of Quarter Wave transmission line

texts:
Consider a 300 Ω lossless line operating at 1GHz which is connected to a source of 10V and impedance of 50 Ω.

What is the magnitude of voltage at the open circuit end?

My attempt:

At the input side the voltage (\$V_o\$) is 0V and the current at the sending end is given by:

$$I_o = \frac{10}{50} = 0.2A$$

and

$$V_o = 0V$$

Now the positive going voltage amplitude (\$V_+\$) is given by:

$$V_+ = 0.5 (V_o + I_o \cdot Z_o)$$

The negative going voltage amplitude (\$V_-\$) is given by:

$$V_- = 0.5 (V_o - I_o \cdot Z_o)$$

where \$Z_o\$ is the characteristic impedance.

Thus, \$V_+ = 30V\$ and \$V_- = -30V\$.

Now the voltage at any point on the line is given by:

$$V(z) = V_+^{-bz} + V_-^{+bz}$$

where \$bz\$ is the electrical length of the line.

Thus at Load end \$V(\lambda/4) = j60 \cdot sin(bz) = j60\$

Is it possible to get a voltage of 60V at the open end while you are applying only a source of 10V? Does reflection at open end has anything to do with this?


texts: How to interpret step-up output current with respect to input/output voltage

texts:
I have a Pololu 12V step-up converter (U3V12F12) that I'm powering with a 3.7V 6600mAh lipo battery.

The idea was to use it to power a dev board that requires a 12V input. The dev board draws about 250 - 300mA when hooked up to my powerbench @ 12V

Input / output current

The pololu description mentions input and output current.

Input current can typically be as high as 1.4 A.
Output current is a function of the input voltage, output voltage, and efficiency

I understand that the output current is what the board will ask for  (as on my powerbench I suppose it would be around 250 - 300mA). But what about this input current ? How much would my Lipo battery be able to deliver ? what exactly do I to take into account here ?

Output current

Looking at the datasheet I noticed on the 12V graph that that green line (representing 3.3V input) stops at round 280mA. Does that mean that this represents the absolute maximum ?

When hooked up that to the board I noticed a lot of current going through the step-up (up to 1,6A), and that there were lots of voltage drops, resulting in frequent reboots of  the board.

Alternatives ?

Do I need the 12V Step-Up Voltage Regulator U3V50F12 instead to power the board, or are there other alternatives ?

Voltage spikes

Also, is it safe to directly hookup a battery to the VIN/GND connectors or do I need some other protective circuitry to protect the battery from reverse voltage spikes or excessive current draws ? The description mentions "Please be wary of destructive LC spikes that might cause the input voltage to exceed VOUT" As Vout = 12V and my battery is only 3,7V, should I be worried ?


texts: How to use FreeRTOS with MPLAB X that runs on a MAC OS

texts:
I'm programming my PIC microcontroller on a MAC OS.
Can you use FreeRTOS with MPLAB X running on a MAC OS?

I've noticed directions that include downloading a .exe file, but does that mean it's only good on a windows version of MPLAB X?

In the direction for starting, it says to open a demo project and try compiling but I can't open it. Not sure if it's .gld or .mpc or .mcs or .mcw or .mcs, but none of them work.

"[file name] can't be opened because it is from an unidentified developer"

Also can't include file in project. I right clicked project>properties>general and added the FreeRTOS/Source and FreeRTOS-Plus/Source folders, yet i get the the following error

Main.c:16:20: fatal error: semphr.h: No such file or directory

Note: this issue has been resolved by just dragging all FreeRTOS sources and headers to the standard folder. Originally when attempting to include original folders under project>general, by adding the path, didn't do anything


texts: Verilog reset example within clock domain crossing example

texts:
I'm trying to understand CDC problem and study some example with reference site.
Currently, I'm referencing http://www.fpga4fun.com/CrossClockDomain2.html

Especially, I can't got any signals correctly working.

module Flag_CrossDomain(
    input clkA,
    input FlagIn_clkA,   // this is a one-clock pulse from the clkA domain
    input clkB,
    output FlagOut_clkB   // from which we generate a one-clock pulse in clkB domain
);

reg FlagToggle_clkA;
always @(posedge clkA) FlagToggle_clkA <= FlagToggle_clkA ^ FlagIn_clkA;  // when flag is asserted, this signal toggles (clkA domain)

reg [2:0] SyncA_clkB;
always @(posedge clkB) SyncA_clkB <= {SyncA_clkB[1:0], FlagToggle_clkA};  // now we cross the clock domains

assign FlagOut_clkB = (SyncA_clkB[2] ^ SyncA_clkB[1]);  // and create the clkB flag
endmodule

So, I just thought that that module missing reset. so I added it as the below.
but not sure whether i do correctly modify or not. I mean that really do I need to reset signal?

module Flag_CrossDomain(
   reset_n,
   clkA,
   FlagIn_clkA,
   clkB,
   FlagOut_clkB
);

input reset_n;
input clkA;
input FlagIn_clkA;
input clkB;
output   FlagOut_clkB ;

reg FlagToggle_clkA;
always @(posedge clkA or negedge reset_n)
if(!reset_n)
FlagToggle_clkA <= 0;
else
FlagToggle_clkA <= FlagToggle_clkA ^ FlagIn_clkA;

reg [2:0] SyncA_clkB;
always @(posedge clkB or negedge reset_n)
if(!reset_n)
 SyncA_clkB <=0;
else
 SyncA_clkB <= {SyncA_clkB[1:0], FlagToggle_clkA};

assign FlagOut_clkB = (SyncA_clkB[2] ^ SyncA_clkB[1]);
endmodule


texts: Are there standards for digital sensor links?

texts:
Following this question, @curious_cat had more questions in comments that deserve a proper Q here:

Is there any standard encoding that has evolved on the digital encoding side? Just as 4 to 20 mA is de facto standard on the analog side especially in process control?
So I wonder, in applications where rapid change is crucial, say airplane control, avionics etc. what sort of protocols have become the convention? Do they use 4 to 20 mA or PWM or dedicated buses?


texts: How can you test whether a ceramic T1A 250 VAC fuse is good or not? I'm not an electrician but  I do have a Gardner Bender Digital Multimeter Model GDT-3190.


texts:
I have multiple sensors that sends data via bluetooth to my laptop.  At present, I can only connect one bluetooth sensor with the bluetooth of my laptop. It needs pairing, and then connects. So if I want to get the data from the other sensor, I need to disconnect the first sensor, then connect the second sensor. and so on.

1- Right now I do this connection/disconnection manually. How do I automate it?
2- Can we not have concurrent connections in case of Bluetooth?

Similar questions have been asked such as Microcontroller Bluetooth Multiple Connection Support and Multiple connection of bluetooth to android
But as you there is no clear answer.

Thank you very much in advance for your answer.

Edit

The central device is the laptop since it is receiving data from many similar sensors and will display on the GUI.


texts: How to know if DMA on STM32 is being used or not

texts:
I am using the STM32F410CBT's DMA to output a square wave on the PWM peripheral with varying duty cycle. The duty cycle will vary at a button press (through GPIO interrupt). I managed to vary the PWM's duty cycle and verified that the duty cycle is different with each button press through an Oscilloscope. I am using TIM5 configured at 10kHz.
I used the function: HAL_TIM_PWM_Start_DMA(&htim5, TIM_CHANNEL_x, &dutycycle_array[x], 1);, where TIM_CHANNEL_x corresponds to the PWM Channel that I am scoping, dutycycle_array is an array with 101 32-bit elements representing 0% duty cycle up to 100% duty cycle based on its index x.
What is a good indication that the DMA is indeed being used to transfer data from memory to the PWM peripheral without CPU intervention, aside from the fact that I am using a HAL_DMA API, and the fact that there is no code in the while loop? Is there also way to monitor the DMA through Keil (or the processor load through Keil) aside from looking at its registers through the Register Viewer?
Thanks!


texts: Soil moisture sensor - Interdigital (FEF) vs Coplanar

texts:
I am working on the development of a low cost capacitive soil moisture sensor which uses dielectric permittivity changes to estimate moisture.

I found that interdigital capacitor based on FR-4 has more capacitance as opposed to coplanar one of the same size. However, I need some perspective as to the range of electric field each will emit since it determines my sensing range. Insights from practical experiences of users can help me asess this situation better.

A picture of the two probes

Edit 1 :

I am currently experimenting with the operating frequency to be used but it will be in 5-10 Mhz range.What I gather from research papers is that pcb on a capacitor can work as soil moisture probe due its fringing field.
The values that I got - two parallel capacitors around 14pf
, FEF (interdigital) - around 25pf

Soil thickness I am intend to measure moisture for is about 0.5m


texts:
How should I select an Electrolytic capacitor to  get an Offset for an Input.
I have a Sinusoidal input wave (around 0, at 10V amplitude above and below 0), and want to offset it by 20V above 0.


texts:
I'm VERY confused about saturation and calculating it.

As i increase the resistance of photo diode of opto-coupler (4N35) the resistance between collector and emitter increases too.

How the resistance between collector and emitter of opto-coupler affects the transistor in a opto isolator circuit which is gonna run a relay or MOSFET ?
What does current transfer ratio % means? for example 4N35 CTR is 100% while 4N28 is 10%. is lower better? [source]
How fast can an opto-coupler turn on/off, is it suitable for PWM?
What's the difference between this two schematics, why in first one the base pin of opto-coupler is also used?

if possible please explain somehow so a beginner like me can understand this subject.


texts: How to achieve low power consumption with ATTINY85

texts:
I am creating a project that uses an ATTINY85. Most of the time, the circuit should be off and consume as little power as possible. According to the data sheet, in power-down mode, the microcontroller consumes 0.1 μA at 1.8V.
I am powering the circuit using two AAA batteries in series, which gives around 3V, so I expect an higher power consumption, but still on the same order, but so far I am getting 300 μA in power-down mode.

I have removed everything from my code except for the power management code to try to isolate the problem:

#include "Arduino.h"
#include <avr/sleep.h>
#include <avr/power.h>

void setup()
{
  cli();  // Disable interrupts

  // Reduce the clock frequency to conserve power
  clock_prescale_set(clock_div_128);

  // Disable all modules
  power_all_disable();
  set_sleep_mode(SLEEP_MODE_PWR_DOWN);

  // Configure all ports as output
  // (does not seem to make any difference)
  DDRB = 0b0011111;
  PORTB = 0;
}

void loop()
{
  sleep_enable();
  sleep_bod_disable();
  sleep_cpu();
}

As can be inferred from the code, I am using the Arduino library to program because it was quicker to setup, but I do no think that this would make any difference. Am I wrong?

The fuses are E:FF, H:DF, L:62, so I am using the internal 8MHz oscillator, divided by 8. I further use the clock prescaler to divide it by 128, because it seems that it should reduce the power consumption.

My circuit is as follows:

This diagram does not show it, but the resistors are connected the anodes of four LEDS, whose cathodes are connected to ground (so the leds turn on when the pins are high).

I am measuring the current with a multimeter whose lowest scale setting is 200 μA, so I believe that I should be able to measure this current with reasonable accuracy.

What am I missing here? Why is my current consumption higher than expected?


texts: How to adjust or obtain different IR Transmitter's distances?

texts:
I would like to recreate a infrared concept used by in the vacuum cleaning robot's charging station.

I would like to use 3 infrared transmitters all in same wave length and transmit a synchronized bit pattern (on, off, gap duration).

All the led's will in sync and sending a fix and repetitive sequence e.g.:
Led A would send 11110001
Led B would send 11110010
Led C would send 11110100

The next step is to assign each Led a max Transmission distance e.g.:
Led A => max 4 ft
Led B => max 8 ft
Led C => 12 ft

Theoretically speaking a IR receiver would get:
11110100 from 8-12 ft range
11110110 from 5-8 ft range
11110111 from 0-4 ft range

The question is, how can i limit an IR distance ? It's not necessary to be exact intervals, instead we can use relative fractions 1, 1/2, 1/4 the idea is to know the distance from the base.

Do i need different transmitters, if yes what i need to take in consideration in the datasheet ?

Changing the frequency e.g. 38Khz does increase or decrease the distance ? But having different frequencies does not affect the receiver capture ?

Thanks

Regards,
Tiago.


texts: Use transistors instead of gate driver for gate drive transformer

texts:
I've been working on a solid state tesla cpil project.

I have a question about the driver circuit to drive pulse transformer.

If I input a modulated or interrupted waveform on the input of the transistor base pins, can this transistor arrangment drive the gate drive transformer properly?


texts: Do manufacturers lie about the specifications of their components?

texts:
These days misleading commercial practices are not uncommon despite the presence of laws and regulations designed to protect consumers.

It should not be impossible for electronic component manufacturers to provide misinformation about their products in order to create a competitive edge against their rivals.

In fact, it might be more likely for such illegitimate acts to take place undetected in technical fields than in the general consumer market, by relying on the fact that few people have the resources, expertise and equipment required to verify the esoteric technical specifications.

For example, it would be nearly impossible to find out the noise performance of a high-end auto-zero precision op amp without equipment that is more precise and noise-free; or to produce a statistically significant assessment of the endurance and data retention of a flash memory chip without a long test period and a large sample quantity.

How common is it for major component manufacturers to lie about their
components?
What regulations are there to prevent such acts from taking place?
Where and when should an electronic engineer be cautious about the
trustworthiness of the component specifications? e.g. which areas of electronic engineering, which characteristics in the specifications, etc.


texts: Multiplexing TTL serial lines with transistors

texts:
A master controller talks to multiple slave devices using TTL async serial. Instead of implementing software broadcast codes, slave select codes, etc, I want the slave select to be wired.

I use a shift register (instead of the pins in the circuit), and so I only need 5 lines from the microcontroller to control as many slaves I want.

The attached circuit is tested and works, but is it a valid design? How stable will this be? Am I wrong in assuming the current flows from TX to RX? In that case, what kind of switches could I use? Optocouplers?


texts:
I'm working on a circuit where a 12 VDC line is switched from a USB-powered microcontroller (U1, running at 3.3 V, specs below).  I want to ensure that the switch defaults to ON if the microcontroller is powered off (i.e. unplugged from USB).  The switch I'm using (U2, specs below) can be controlled directly from a GPIO pin.  I've come up with two possible methods of doing this; are there any issues with either approach?

Option 1: Simple pull-up
Use a 300k Ω pull-up (R1) to 12 V on the Enable line; this will ensure that the signal is ON if the microcontroller's pin is high-Z.  An additional 100k Ω resistor (R2) connects to ground; this ensures that the enable line is at 3 V when the microcontroller pin is high-Z (this protects the microcontroller from over-voltage).  The resistor values are high enough that I think there should be no issues with the microcontroller driving the line high or low.  There's no ESD diode to VDD on the microcontroller (only to ground) so I'm not concerned about back-powering it.  This is my preferred solution.

Option 2: Switched pull-down
The switch's enable pin is pulled high via a 100k Ω resistor (R3) connected to the 12 V rail.  An N-channel MOSFET (M1) connected between the enable line and ground can be switched on by the microcontroller to turn the power switch off.  An additional 100k Ω resistor (R4) to ground on the MOSFET's gate ensures that it's off when the microcontroller isn't powered.  For board-space reasons I'd rather not take this approach.

Do either of these approaches seem reasonable or is there a better way to do this?  Is there anything I've missed?

simulate this circuit – Schematic created using CircuitLab

U1: TPS22810 Power switch (datasheet)
Switch is turned on or off via the EN pin:
VEN 0 V .. 18 V, threshold = ~1.0 V (low=off, high=on)

U2: Teensy 3.1 (MK20DX256VLH7 microcontroller, datasheet, schematic)
GPIO pin specs:
VDIO -0.3 V .. 5.5 V (input voltage range)
ID -25 mA .. 25 mA (maximum sink/source current)
VOL maximum 0.5 V (Low output voltage)
VOH minimum 2.8 V (High output voltage)
GPIO pins default to input (high-Z)
From the datasheet (p. 11):

  All 5 V tolerant digital I/O pins are internally clamped to VSS through a ESD protection diode. There is no diode connection
  to VDD.

M1: 2B7002 N-channel MOSFET (datasheet)
VGSth 1.1 V .. 2.1 V (gate-source threshold
voltage)


texts:
For a hobby project I'm trying to power a PIC microcontroller and 4 RGB leds from two AA batteries. I have both the PIC and the circuit shown below being powered by the batteries and the PIC communicates with the PCA9635(for brightness control) through I2C. Since the blue and green leds have a forward voltage of 2.8V and I wanted to ensure that they could stay on as the battery discharges, I added a boost converter (as shown), which is capable of 300ma at 3.3V. The PCA9635 is capable of sinking 25 ma on each input pin and since there are 12 total leds (RGB for each), each rated at 20ma, the total current consumed should be less than the 300ma limit of the boost converter.

On fresh batteries the circuit works. However, with slightly used batteries, when I begin to turn on LEDs the voltage of the batteries drops sharply causing the PIC to brown out/reset. It seems to me that two AA batteries should be able to source the amount of current required for this. So my questions are:

Is it possible to power everything both without causing a brown out and without using an alternate/extra power source?

What is causing the sharp voltage drop?

Is there a better way to power the 4 RGB leds than using a boost converter?

EDIT:
The actual leds being used are these: http://www.dialight.com/Product/Details/445022/5988710307F.


texts: Do I need to use thermals on vias for reliability?

texts:
This question is further to Why thermal reliefs on vias?

I have recently been advised (by someone I consider an expert) that I should add thermal reliefs to vias which are connected to planes, even if they will not be soldered.

This is to alleviate thermal stress between the different types of copper in the plane and the via. The plane has rolled copper, whereas the via has deposited copper, and these behave differently across temperature.

Has anyone seen any reliability issues due vias being directly connected to planes?

Added: My personal project will be restricted to the commercial temperature range. However, I would still be interested to know if this is a problem in any other temperature range.


texts:
I am building a circuit that uses an op amp comparator stage to control the circuit shown.

The op amp circuit will switch on or off the transistor to drive the motor supplied with a set of AAA batteries in series. The motor ground is connected to the op amp ground and the circuit works fine - the motor turns on when the op amp drives high. However I cannot figure out why this is working as the battery ground is left floating.

How is it possible that the battery ground is floating yet it is still driving the motor? Where the motor is powered from?


texts:
I've heard that opamps are not good at driving capacitive loads. Let's say I want to add an RC antialiasing filter between the opamp output and the ADC. Is 0.1uF big enough to cause trouble? Where can I find/calculate the capacitance that I could add without getting the opamp into oscillation? Is this in the opamp's datasheet?
Opamp datasheet: OPA317


texts:
To narrow the focus a bit from an earlier question:

Is a Schottky diode appropriate for reverse polarity protection?

I'd like to prevent mishaps from a user connecting DC power in reverse, but I'd also like as low a voltage drop as possible. Can you explain what the reverse leakage current is and whether it would be a concern or not in this scenario?

The application is a small device that operates on 9-12 volts DC at less than 100 mA.

Edit:

Just as an example, I am expecting users to be able to use 6 AA cell batteries in series, either alkaline or NiMH. In the latter case, the batteries are 1.2V, so the total voltage is only 7.2V. I am using a 5V voltage regulator with a dropout voltage of 1.3V, so therefore my minimum operating voltage is 6.3V. A bias protection diode with 0.7V drop is going to raise that minimum to 7.0V. As the batteries are drained, I expect to dip below the 7.0V requirement very quickly, and therefore not use the full capacity of the batteries efficiently.

If a 0.3V diode is used, the minimum requirement is lowered to 6.6V, which I feel is a better fit for use with NiMH batteries.


texts: How do I use an antistatic wrist strap and mat

texts:
I will be building my very own PC soon and I brought both the Rosewill RTK 002 Anti Static Wrist Strap and Rosewill RTK-ASM Anti-Static Mat. As far as I know both the anti static mat and the wrist strap should be connected to earth. The problem is that both of those don't include a plug to wall socket. I am thinking that there must be a cable that connects the alligator clip to a wall socket like the one below:

What is this cable called (so that I can buy it online)?
I need to stand on white part of mat and connect it to a wall socket and I will be grounded?
Will I be grounded if I just connect the alligator clip from wrist strap to the alligator clip from the wrist band?

While doing my research on the internet I have found that we can connect the wrist strap to the unpainted part of case but I feel that connecting to a wall socket would be more safe.


texts: Certifications required for a circuit board/ product

texts: I am developing a product that uses a bluetooth module (rigardo bmd-350 based off of the nrf52832) has a daughter/breakout board for interfacing with eeprom chips, pumps powered by small dc motors, and an external pre-made 12v power supply and am currently researching certifications needed and costs associated with them and frankly am unsure of what is needed.  The product would initially be sold in the USA/North America but eventually overseas.  What certifications and testing would be needed and what is the average cost and timeline for these? and would they only need to be tested on the bare circuit board or in the full finished enclosure?  Any help would be appreciated


texts: Device to prevent popping the circuit breaker if device draws too much power?

texts:
I just moved into my own office space and the outlets are shared across multiple offices on the same electrical line. I have a 2000-3000w reflow machine that I turn on occasionally which is connected to an 110v to a 220v upconverter.

In my previous space which I had my own breaker, I used to pop my circuit breaker many times because I forgot to turn off the hot air station before using the reflow machine. At this new space, I don't want to be a nuisance and pop the circuit breaker affecting everyone else.

What device or solution is there to just pop my room only? I know a surge protector might work, but how do you buy one that limits a certain amount of surge?


texts: Battery Protection IC With NTC Thermistor

texts:
I have a battery design which is failing EN 62368-1 for thermal cut-off on charging conditions.  IE. at the maximum temperature, charging currents need to cut off at maximum temperature.

I am looking at a battery protection IC with an NTC thermistor:

https://www.batteryspace.com/prod-specs/5080%20spec.pdf

Is the design intent that you run the thermistor output (it's a voltage divider with another resistor?) to an ADC on a microcontroller to determine the temperature and have some kind of shut-off FETs to the charging input?


texts: How to use UART interrupts for PIC24 with MCC?

texts:
I'm using UART6 to interrupt my program whenever it receives an incoming string. I'm using the MCC to generate functions that I can use but I'm not sure how to call my interrupt function. Here is my code:

int main(void)
{
    //Initialize the device
    SYSTEM_Initialize();
    LED4_SetLow();               //3V3 LED on during operation
    Power_LED1_SetHigh();        //Green LED on
    Power_LED2_SetLow();         //Red LED off
    UART6_SetRxInterruptHandler(*controls);

    while(1)
    {
        sensor_data();
    }
    return (0);
}

How do I enter my function controls once a string has been received?


texts: How good should the regulated AC/DC power supply filter be in tube headphone amp?

texts:
I am building a tube headphone amplifier. I built a AC/DC regulated power supply (220v AC to ~250v DC) but I am not sure about how good is the filter. The filter contains 120uF and 68UF capacitors, in between them there is a 0.4mH inductor. (170uF in total)

But it seems that most schematics use absurd filters - 10H inductors or really big capacitance caps.  (1000uF)

Would my filter be good enough for high-end tube headphone amp or do I need to improve it with bigger capacitors?

What results would you get by using 'bad' filters? (More hum, more noise, short tube life..)


texts: How would one make a MIDI to DB25 adapter?

texts:
I have a basic GamePort/MIDI cable like this:
GamePort/MIDI cable http://www.turtlebeach.com/support/images/midset01.gif

I was wondering if it is feasible to change this from working with a GamePort interface to working with a DB25 interface?


texts:
I use MCP73871 battery charger,

Battery and VDC (charge voltage) connected to MCP73871.
VFEED is the output voltage of MCP73871.
Circuit also have a MOSFET power switch.
VFEED enters the MOSFET and VCC is the output of MOSFET.

When i apply 5V to VFEED, the power switch works well. But when i apply voltage to VDC (with or without battery) power switch do not work.
Why this can be happen ?


texts: Reference signal choice for Lock-in Amplifier

texts:
How do you choose the reference frequency when using a Lock-in Amplifier?

I want to measure the amount of lateral deflection of a laser reflected off of a surface that will be oscillating very slightly.  I'm going to modulate the laser at a set frequency, and send the trigger signal and the signal from a position-sensitive detector to the lock-in amplifier.

At the moment, I'm not sure how quickly the surface will be oscillating, or how much, hence this measurement.  My first guess is to choose a reference frequency that is many times the rate that the surface will be oscillating (for instance, 100x), in order to ensure the lock-in detects the variation of the signal.  But I don't know how to optimize this for a clean measurement


texts: Connecting 2 different power supplies in series

texts:
I have an ac adapter that outputs 18 volts with a max current of 3 amps.

Is it possible that I can connect it with series with an atx power supply's 12 volt out in series to get 30 volts?

If so what will the current be limited to?


texts: Charging a device with higher amperage, can somebody please clear up the confusion and contradictory statements?

texts:
I have a PS Vita I wish to charge with my Samsung Galaxy charger, its output is 9.0V = 1.57A which is for fast charging (correct me if I'm wrong) and thus won't handshake with the Vita so won't supply this power (again, correct me if I'm wrong)  or 5.0V = 2.0A
The regular charger for the Fat PSVITA supplies 5V = 1000mA and the regular charger for the Slim PSVITA supplies 5V = 1500mA.
I posted a question on Amazon asking if I could charge the PSVita with a Samsung Galaxy charger because as far as I know it would only supply the amperage the system asks for and someone replied saying this:

  This is only partially accurate.  The PSV has the capacity to play while charging which normally just makes the device charge more
  slowly. Using a higher capacity would mitagate this a bit, but for
  standard charging it would charge the battery to quickly causing
  overheating and decreased life span for the battery. It would also
  lead to battery expansion (ballooning).

He had me worried a little bit, but as far as I know and according to other sources online as long as the amperage of the charger is higher than the amperage the device needs and not lower it should be perfectly fine, but maybe he is still right and charging it with a Galaxy charger would make the battery expand, overheat and have a decreased lifespan?


texts:
On the STM32F103C8T6 there is a 5V pin, see at the bottom left of the STM:

However, in the official description from ST.com (see Link), in the table on page 28 is shown:

C2 F2 - - - 10 - VSS_5 S - VSS_5 - -

Which means the VSS 5V pin is a Supply pin. However, does this mean I can power the STM with a (USB) power adapter and connect the 5V power to this pin, or is it only for powering components connected to the STM with 5V?

Note, there are also VSS_4, VSS_3, VSS_2 and VSS_1 pins, so I'm even wondering if the VSS_5 pin is 5V, and which pin maps with with +5V on the picture.


texts: Connecting pins of L293D to pins of inverter 7404

texts:
I would like to know the right configuration of pins using a 7404 inverter while the pins are connected to an L293d. When connected for driving DC motors why must an inverter be used? The pins through the inverter are used as pins with PWM. Can the three pins of from the L293d be connected to microprocessor along with the ENABLE pin on the L293d or must the inverter be used?

Here is a diagram:

I'm sorry, but I mean that your answers are very similar to shown diagram above. It seems normal that I understood just like you. But I want to know why is involvement of inverter important? Inverter is for appropriate to increase the voltage? Via this method of connection my robot arm uncontrollably moves after uploading the source code on the Arduino and via serial communication.   Here is another diagram shown below, where two inputs of each side L293 are connected to output pins of Arduino. It is done correctly ?

I´m sorry for my grammar mistakes.

Thank you in advance for your help and your time

Here below another diagram is, as far you want to see it.  Are these inverters recommended for controlling DC motor on the imaginary robot arm? What is the importance of using invertors 7404 on the breadboard? I have ceramic condensators 33pF which they´re lying around two output pins of DC motor. Are these things necessary and why are is used?

Thank you.


texts: How To Charge a Battery in Falstad Circuit?

texts:
I'd like to model the charging of a battery in Paul Falstad's Circuit simulator. But, i cannot find a battery component.

Is there any way to do this?

thx


texts: increase current of a microcontroller output

texts:
Edit: The motor consumes 130 mA, I have tried the ULN2803A and the L2930DNE, but there is no way to make this work..

I thought this question would be already asked, but I have used the search tool and I did not find it.

I am trying to control 2 motors of a robot-car(5V DC) with an infrared remote-control. To ensure that the program is written correctly, I used 2 leds simulating the motors, and it succeeded.
Once I know it works, I changed leds for the motors, and it did not work. It is obviously because of the lack of current, but I do not know how to deal with it.
I used the bc547c transistor, with some resistors between 500 ohm - 40k ohm, but it did not work. I used the Darlington configuration with the bc547 and bd139, same resistors, but it did not work either.
With this last configuration, the motor moves a bit, but in more or less 5 seconds the micro gets reset.

Do someone have an idea of how to deal with it?.

Thank you very much.

Kind regards.

PD1: I am using PIC18F2520.
PD2: I tried these 2 configurations.


texts:
The problem: I need to use TSSOP-14 ICs instead of SOIC-14. Have plenty of boards already manufactured and assembled. Deadbug wiring is not an option.
I have not found any available converters so I have decided to design one. On (at) the edge, I need to use "half" VIAs like ESP-xx boards:

What is the correct way of making them? At the moment I have just cut in the middle of the VIA (in real PCB it will be probably the VCUT only)

Is it the correct way of doing it?


texts:
I am working on a magnetic sensors design and noticed that my measured magnetic field bias shifts over time. I have studied the bare PCB and measured that it can be magnetized with a strong magnet.

I tested two blank (unpopulated PCBS). The first PCB I tested had an ENIG plating and could be slightly magnetized. I degaussed the PCB and confirmed that the magnetism was removed, and repeated the experiment to confirm. After a while I realized that the nickel in the ENIG may be playing a part in that.

So I tested a PCB with an immersion silver plating, but it also exhibited the same behavior. Once again, I degaussed it, confirmed the magnetism was removed, and re-magnetized it to confirm that the behavior I was seeing was real.

I don't think it should matter, but the ENIG and immersion silver PCBs were on Isola P95 substrate.

I then tested two PCBs with HASL finish, and they could not be magnetized. These PCBs were on FR-4 substrate.

Any ideas?


texts:
I need to build a 2 stage inverting charge pump in order to convert a 12v rail into -24V which is then regulated to -12V using a 7912 LDO. it is used for a audio amplifier design and I need about 100mA of output current.

The oscillator is built from a CD40106B using a 100pF cap and a 50K resistor to get the highest frequency as recommended by datasheet. only one pin creates the actual oscillator and the other pins are inverted to create the two clock signals (one is the inversion of the other) and since there are 6 gates available, I have 3 complementary clock signals and decided to create 3 pumps (each with 2 stage) and put them in parallel in order to maximize the output current. also one of the stages is 180 degrees out of phase with the others in order to reduce ripple/switching noise.

I used push pull transistors in order to boost the output current as well (the CD40106B is speced to supply a max of about 2 or 3mA!). 2N2222A and BC327-40 are the parts I chose.

I also initially did a prototype of the circuit on the breadboard and it seemed to work perfectly fine and even with a 10k load resistor, it held about -23V.

Then I put everything on a veroboard and soldered it up but it doesn't work.
Even the oscillator outputs seem to be weird, before I connect them to the transistor bases, the output voltage on DC setting of multimeter is 5.6 or there abouts for the original signal and 6.something volts for the inverted signal which is expected, but after connecting that to the transistor base, it's only about 1 or 1.4v! after disconnecting the base again, the output stays at about 1.4 so I'm assuming I destroyed the CD40106B as well?
I didn't use base resistors so I'm assuming that's the issue? but the transistors are rated for about 100mA base current and the CD40106B isn't supposed to supply more than a few mAs?

P.S: diodes are schottky (1N5819) and the caps are 470uF 50V electrolytic.

here is the full schematic, please help me fix this and get this charge pump to work(please ignore the 100mA current load on the output capacitor).

and here is a simulation of the oscillating waveform created by the CD40106B:


texts: Can someone briefly explain what's the point of separating circuit ground from chassis ground with a capacitor + resistor?


texts:
I understand that the current through a capacitor is given by the capacitance multiplied by the rate of change of voltage.

I also understand that this leads to infinite impedance for DC and virtually no impedance for higher frequencies.

What I haven't been able to find out is how this formula is derived from first principals.

Would someone be able to show me this?


texts: Passive reset circuit for multi-chip game design

texts:
I've been building a small handheld gaming device based around the ATTiny85 and an SSD1306 OLED screen. It's a very limited system and as such I needed to be creative about how I used the I/O pins. I asked a question for replacing the SSD1306 reset logic with passive? components.

This worked in my initial prototype and I was happy. Today I received new PCBs with a smaller, closer layout and a different power source and the reset circuit no-longer works properly.

This is the circuit in question:

simulate this circuit – Schematic created using CircuitLab

The schematic shows the original design when I was using a 3.7v lipo cell to power it. I'n my new design, I'm using a CR2032 lithium cell and I'm wondering if that has caused the issue.

When the system is powered on 'cold' everything works fine. If I power off and then on again within about 10 seconds, the OLED doesn't get the proper reset signal and displays garbage. Pressing the reset button resets the micro controller but not the screen properly - it'll display progressively less garbage until it just goes blank on successive resets, MC still resetting fine (it has a 'startup' tone that plays, and button presses beep as expected).

As mentioned - I got the reset circuit from another question I asked, but I'm not sure I completely understand how it works. I'd really appreciate a short description of what happens when it powers on / reset button pressed.

Is my issue likely the small change in voltage? I know that when I first put together my first prototype I accidentally used the wrong resistor, putting a 1k ohm in place of the 10k ohm one and this also caused the circuit to stop working properly - Am I naive in hoping that I can tweak the resistor value to make things work again?

Things I've tried based on comments below:

Added a delay to program start-up of 200ms. No Effect.
Replaced 3v CR2032 with original 3.7v LIPO. No Effect.
Holding a 10uF capacitor in parallel with the existing 0.1 (C1). No Effect.
Bypassed D2 with a bit of wire. No Effect.

On my old prototype, holding down the reset button caused the screen to blank and reset, holding down the reset button here doesn't affect the screen at all until it's released. All I did between revisions was move pads around, connections are all the same. My multimeter appears to confirm this too. #4 though makes me wonder if there's something mechanical wrong though.


texts: RS485 transceiver design: Bias, termination, filter and protection

texts:
For the realization of an RS485 transceiver, I came across the question: How can bias, termination, signal filter and protection be best implemented in one design?
In my case, one RS485 master (with bias and termination, bus cable length < 2m, < 10 slaves, half duplex) and one RS485 slave should be implemented with the SN65HVD75 or similar integrated circuits.
RS485 Master with Bias and Termination
For a RS485 master transceiver with termination and bus bias, i found on my research implementations with a series resistor in each bus line - in front of the transceiver. These resistors (Rs) are used for current limiting during a transient event.

For adding bias and termination to this solution, i would place the resistors for bias and termination in front of the series resistors:

In an application report from TI, i also found this way - shown in a) (series resistors between termination and bias):

Questions:
What is the right way to implement bus termination with bias using series resistors for current limiting during transient event?
Is the usage of series resistors in general a useful solution?
For filtering high frequency signal noise, can capacitors (1nF..10nF) be placed from each bus line to ground?
In other designs i researched solutions with a cm-chocke or series ferrits instead of series resistors:

What are the advantages of a design using series ferrites?
What is a general good way to combine bias, termination, signal filtering and protection for a RS485 transceiver?


texts: "analog" /"mixed-signal" Terminology confusion about the definition of some components and systems

texts:
I sometimes encounter that ADCs, DACs, PLLs, DC-DC converters and oscillators are called mixed-signal but sometimes they are grouped under the category of analog.

Is there a consensus about that?


texts: Does it take long to implement RSA in hardware?

texts:
I just finished my first Digital Hardware course. We covered combinational circuits, sequential circuits and FSMs.

We now need to create a final design project. We have 2 weeks to do so and we work in teams of 2.

I want to implement RSA encryption in hardware. Essentially, the FPGA would take a audio signal as input, run RSA on it and output the encrypted audio signal. We will be using Verilog and a DE2 board. I'm worried that this might take too to do though.

Could someone tell me if implementing RSA in hardware is a reasonable goal for a 2 week project for someone who has only taken a single digital electronics course? This is my first engineering project so I'm not very good at scoping yet.

Thank you.


texts: What logic family is best for general-purpose hobbyist stuff?

texts: I need to buy a few logic ICs.  Which family should I get?  HC? HCT? Which kind is best to have lying around in a parts box, for maximum compatibility with unpredictable future projects?  Wide supply range, no extreme frequency requirements, etc.  Schmitt inputs?  Open outputs?


texts: What kind of transistor is the one similar to an integral sign

texts:
I was looking at this Texas Instruments datasheet and saw this scheme:

Could anybody tell me what kind of transistors are on the left side of the diagram? I have never seen that symbol before, nor can I find any information on it.


texts: Type of filter represented by circuit and cutoff frequency

texts: What type of filter does this circuit represent? I want to say it's a low-pass filter, but I'm not too sure. Also what would the cutoff frequency formula be in this case (of course that depends on what type of filter this is)? Thank you!


texts: Puzzled with parallel forward biased diodes with common anode and different cathode voltages

texts:
If two identical diodes are in parallel and forward biased such that their anodes are at the same potential but their cathodes are at different potential how can we find the anode potential?

As an example I found the following circuit where diodes are identical and their forward voltage drop is 0.6V:

I can simulate this and figure out what V6 is but I tried to find myself and puzzled.

First of all the diodes are identical and the diode on the left is reverse biased so it is out of the picture.

Now if only the diode with -6V cathode voltage existed V6 would be -5.4V. And if only the diode with -12V cathode voltage existed V6 would be -11.4V. My logic here is that the voltage drop must be 0.6V so one can find the anode terminal voltage by adding 0.6V to the cathode voltage. And both diodes are forward biased.

But when their anodes are tied together there must be only one voltage at that node V6. I have been thinking about it but probably missing a point. How should we approach this topology to figure out the voltage at V6?


texts:
I am trying to amplify a very high frequency square wave.  The waveform is 3.3Vpp (biased so it's going from 0 to 3.3v), around 145MHz.  I'd like to amplify it to around 10Vpp (doesn't matter if it's DC biased or not, but I'd prefer to stick with a single-ended power supply).

The simplest approach seems to be a simple FET switch, but I've had trouble finding the right one.  Most have rise times on the order 8-20ns, way too slow.

Ideally, it'd be capable of this sort of speed and be enhancement mode, with a threshold voltage below 3.3V.  The only things I've found this fast are some Cree Gan FETs which would be perfect, but they seem to all be depletion mode, with negative threshold voltages.

Doesn't need to be able to handle much power at all, 500mW at most, so something small and SMD would be perfect.

Does what I want exist?  Or am I barking up the wrong tree entirely?

ETA: The output of this FET would go into a impedance matching network to match a 50ohm transmission line.  I don't know the exact parameters of the network as, as far as I understand, it would depend on the FET.

The source is, as stated, a square wave betweeon 0 and 3.3v, coming into the FET on a 50ohm impedance transmission line.


texts: Finding what antenna is used on a breakout board

texts: I am using http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo board for wirelss communication. I am curious as to which antenna is being used on the board. Could someone please point me to the correct BOM? Also who makes these boards? I know who makes the chip but I see these boards on ebay and several other places? So who is the original designer of this breakout board?


texts: How to interface with ultra-low voltage microcontrollers?

texts: Cypress has PSoCs which can operate at 0.5V power supply. I was wondering how you interface these. 0.5V is too low for FETs and bipolar transistors, LEDs and even common diodes. So what ways are here to connect the PSoC to its peripherals? Low-power is also an issue here: it doesn't help that the PSoC is low-power at 0.5V if the interfacing needs 10 times more power.


texts:
Higher Voltage minimizes I^2*R losses in power lines - we have power lines up to 1 megavolt, and presumably going any higher in terms of voltage doesn't save you too much power.

But say we do something like build a ton of solar panels in the Sahara and need to deliver a TW of electrical power to Europe or China (ignore the engineering nightmare that this would impose on the current electrical grids, just consider the geographic distance). Doing this with a mere megavolt would require a mega-amp of current, and the losses would be hideous.

What's the highest we can go in terms of voltage? What factors limit you from going higher?


texts: What determines absolute value of resistors used in opamp circuits?

texts:
Output of opamp circuits often relies on ratio of resistors (or of impedances when using capacitors and inductors) used in them e.g inverting amplifier.

At the same time resistors may be used e.g to create a vref for single supply opamp inverting amplifier so the noninverting terminal is at vcc/2 rather than at gnd potential.

My question is, what constraint applies to absolute values of resistors (impedance in general to be more inclusive) used in opamp circuits? I guess it has something to do with something called noise gain but I do not understand what that really is and I could be wrong.


texts: Can I series windings of separate transformers to increase the voltage rating of the whole?

texts:
I need a 1:1 transformer, 25VA 600VAC. I'm not having much luck finding such a thing. It occurs to me that I could take five smaller 1:1 120VAC transformers (like this), series all the primary windings and all the secondary windings, and get the same effect.

It seems to me that this is little different than taking a single multi-winding transformer and connecting its windings in different arrangements. Is this valid? Recommended? Are there problems?


texts: Eagle create library remove "direction" in symbol

texts:
I am making a library in eagle, and I am currently working on the symbol. I made pins, but they all show a small "direction":

which shows up in little green lettering next to the pin, like this:

I cant figure out how to remove it. Does anybody know? Thanks.


texts:
I'm working on modeling a circuit implemented on an FPGA, and the fundamental question I keep running into is this: what is a logic element?  I need to be able to model the temporal response of the output when the input changes as accurately as possible.  Right now we are using a simple RC circuit driven by a binary voltage source (corresponding to the implemented logic function) with a time constant of ~400 ps, but clearly that's too simplistic and it's not accurate enough.

Looking at e.g. the Altera handbook, LEs are implemented essentially as a look up table with routing components around it.  Can someone point me in the direction of (a) a circuit diagram of one of these look up tables or (b) a more appropriate modeling framework?  I'm new to this, so please be gentle.


texts: Options for debugging MCU that is freezing/crashing (AVR32)

texts:
Im currently trying to figure out why it seems like a MCU is crashing/freezing.
I can recreate the crash/freezing almost everytime by doing the same procedure, and i have been looking through the code extensively, trying to find what could be the problem, but i can't seem to find the culprit.

A timer is running on the MCU with a interrupt every 10us. To try to debug it further, I added some code to toggle a diode(every 100ms) inside this interrupt, and suddenly this diode just stops blinking and the MCU is non-responsive. No USB/UART communication etc., everything seems dead.
I have measured the VDD voltage and it seems to be fine, no glitches/voltage drops.

I did not write the code, but i have narrowed it down to a part which takes care of decoding a serial signal which is coming in through a pin interrupt. But not any further.

The MCU is a AT32UC3 and I have a ATMEL-ICE debugger on it, but i have not much experience with debugging on a live MCU.

I suspect it could be some part of the memory that is getting written and corrupted, but im not sure.

Any advice on how to proceed with this sort of problem?


texts: What is this triangle symbol representing?

texts:
I am getting started with electronics and decided to learn about the inner workings of the L293D. However, I found a symbol I don't recognize, which is the triangle with 3 connections. There are four of them in the schematic.

At first I thought they were op amps, but those have 5 inputs.

Thanks


texts: Switch off device when battery is charging

texts:
I need to disconnect the rest of the circuit when battery is charging for safety reasons.
I use a LiPo battery which it's charged with an IC that is powered by 5V DC thought a micro USB connector.
This is the original circuit.

SW1 is a slider switch to power on/off the device.
My goal is disable U3 when USB voltage is present (VUSB).
After reading and searching I've chosen the load switch TPS22910A for my purpose. TPS22910A is active low.
I've thought these two options.
Option A. Controlling U3 Vin

Being SW1 in 3 position, if VUSB is 5V, then TPS22910A VOUT will be 0 V (active low), so VIN of U3 will be 0 V and my device will be powered off.
Being SW1 in 3 position, if VUSB is floating (cable disconnected), R1 will forced TPS22910A ON pin to be GND and then, VOUT will be VBAT and U3 will be powered on.
Option B. Controlling U3 EN

This option is basically the same as Option A by instead of controlling VIN, EN is controlled.

I think Option B is better. What do you think? If you think there are better options than using TPTPS22910A, please say them to me; I'm a bit lost in these matters.
Thank you so much!


texts:
I am a fencing coach, and the electronic scoring equipment is very expensive. As a project, I wanted to make a device that could check if a scoring touch happened that could interface with my laptop through USB. I wrote a basic scoreboard program in C# that could show the scores , but I have no experience writing software to interface with hardware.

With the electrical equipment, this is done simply by checking on whether or not the circuit was completed when the tip of the button was pressed. A closed circuit is a point, an open circuit is a miss.

What would I need to do to build a machine that could send the information about whether or not the circuit is closed to the program on my computer?

(Additional Information)
Two fencers each have a foil that has a button on their tip. A wire runs from each fencer's sword and connects to the machine. They both also have metallic vests that are connected to the machine. When the button is pressed on the vest, the circuit is completed. When pressed off the vest, it is off target.

I have the electronic foils and vests. I have the wiring. What I need is the machine that checks whether or not the circuit is completed, and then sends that information through USB to the laptop program.


texts: How to design a good common-collector amplifier?

texts:
I tried to simulate an example common collector amplifier given in the book Electronic Devices by Floyd.
The circuit depicted in the book is:

I used LTspice with transient analysis to implement and simulate the circuit:

Just after checking the input and output waveforms, I discovered the circuit has several problems. First, the output voltage signal gets clipped (or whatever the right term is) on the bottom part:

Green wave is the input (probed just after the sinusoidal input source). Blue wave is the output (probed just before  R4.)
Second, there is some kind of "weirdness" in the input current:

On the other hand, if I decrease the input voltage to 3VP, those problems disappear, namely, I get a good output voltage and no irregularities in the input current.
What is the problem with this circuit?

For the input signal of 4VP, should not 10 VCC be enough for the amplifier?
How can I design a CC amplifier circuit that has a better output swing?
What is the problem with the input current?
Should not the current, in any case, be sinusoidal?
How does it get this "weird" shape?

I believe these questions are interrelated, so decided to ask them in just one post.
I am also pretty new to electronics and analog circuit design, so maybe there is something important I missed in the analysis of transistor amplifier circuits.


texts: AVR bit manipulation compilation in GCC: can not get SEI instead of read-modify-write

texts:
I'm trying to set bit 2 in TIMSK register and using the following C code:

TIMSK |= (1<<2);

Compiler makes the following code:

TIMSK |= (1<<TOIE1);
108:    89 b7           in  r24, 0x39   ; 57
10a:    84 60           ori r24, 0x04   ; 4
10c:    89 bf           out 0x39, r24   ; 57

So it is Read-Modify-Write operation which is a) slow, b) not very consistent as sometimes it is better not to disturb any excess bits.

However if I'd replace TIMSK with let's say PORTA I will get SEI as expected:

PORTA |= (1<<2);
108:    da 9a           sbi 0x1b, 2 ; 27

So how do I force the compiler to compile the instruction above as bit instruction instead of RMW?

Or this (TIMSK) register is not bit accessible?


texts: how to power up a subtractor using a window comparator?

texts:
I'm making a circuit that will detect whether a voltage(V1)is in between the range 1-2 V. If so I want to switch ON a subtractor and output V1 - 1 V.

I initially thought of connecting the output of the window comparator to power up the subtractor. What i thought was if V1 is in the correct range, the window comparator's output will be around +7V so I connected it to the supply of the subtractor(created using an opamp).

However what i noticed is that the output voltage drops significantly when powering up the subtractor. Is there any better recommended way which I can use?


texts: How easy to indentify memory like ROM or EEPROM Flash Memory Areas of a Chip

texts:
Can anyone tell me would the memory circuit areas (ROM, EEPROM, SDRAM, Flash Memory) of the layers of a die belonging to a MCU and SoC IC's be relatively easy to identify compared to identify circuit core sections of the IC ?

Where on the die would you find the above circuit areas (ROM, EEPROM, SDRAM, Flash Memory) ? Would they be generally be located on the top layer or could these areas be just about anywhere on the die ?


texts: How to calculate how much high ESR capacitance to smooth impedance spikes?

texts:
I am making a 3.7V to 5V voltage booster with 25x 100uF ceramic capacitors on the input and output (with room to add more if needed). I've been warned that having such high capacitance with such low ESR can cause impedance spikes/oscillations on the order of 10's of volts when I first connect it to power, which can ruin my parts.

How do I calculate how much capacitance, and at what ESR I need to smooth the spikes? Is it just a matter of trial and error with an oscilloscope? I'd like to add some low value resistors in series to the ends of a few of the caps' but I don't know what value resistors to get, or how many I will need.


texts: Trying to understand schematics of a microcontroller (TM4C123GXL)

texts:
I have a TM4C123GXL microcontroller with a hwllo-world app. that makes some LEDs to blink.

I have done this 'hello-world' by following a tutorial, but now I want to understand the schematics behind this (in other words, how I would found how to make the LEDs to blink if I hadn't a tutorial).

From the microcontroller user guide (schematics part), I have got this image:

From that image, I can deduce that it's PF1 (1 for red, 2 and 3 for blue and green respectively) the GPIO connected to the LED.

Now from this image:

I can deduce that I need to supply power to the VBUS pin, so when I write a 1 in the proper register's bit (in this case, LED_R), that will turn the BJT on, which will close the cirtuit from VBUS to ground, which will make the LED to shine.

My first question is if my reasoning above is correct.

Apart from that, I don't understand very well the Input/Output BUS symbol in this schema. I have googled it, and I have found the following:

According to that description, the first schema is correct, since the input buses at the end of the PF1,2,3 lines are input buses (they receive the info. from PF1, 2, 3).

As far as I understand, those buses should be drawn as output buses in the second schema, but they are input buses as well (according to the symbol reference above). I don't mind if the symbol is exactly as it should be, I just want to be sure that I have understood it correctly: The BJTs schema states that if you write a 1 in LED_R, you enable the BJT thus turning the LEDs on. Is this correct?


texts: Approximating a "Not Connected" pin on an IC with a high value resistor

texts:
I'm looking at using this[0] chip as a difference amp.  However, I would like to be able to change the gain electronically.

For this chip, the gain is set by either leaving unconnected, or grounding, or connecting to the input, some combination of the +/-REFA, +/-REFB, +/-REFC pins.  so, for example, for a gain of 10, the input is connected to +/-REFA, and all the others are left "not connected"

The way that I was thinking about simulating this is using a MOSFET to switch the pin onto a very high value (100M or so) resistor to ground.  If I consider an unconnected pin as basically having a very (very very) low current path to ground, through some unknown resistor (the air, the board itself, etc.), then a high value resistor should behave like leaving that pin disconnected.

Is this an appropriate way to do this?  Is there a standard way to approximate "non-connected" pins?

[0] http://cds.linear.com/docs/en/datasheet/6375fa.pdf


texts: How do I get 5V 10A output from a 3.7V li-ion battery for 64x16 led matrix display module?

texts:
Please I am new to electronics and new here. I'm doing a project which involves the use of a 18650 li-ion battery (or two as may be the case) to power a 64x16 led matrix display module which (according to seller info and datasheets) takes up a large 10A and 5V. I've read posts which exposed me to BMS modules. I have also researched on the bms modules but seem to find only those of 5A (considering the 18650 works with 3.7V).
Can I find a bms module that fits into this specification as a single module?
Does connecting two modules of 5A bms in parallel result in both working as one unit of 10A?
Will I still need a li-ion charger module to work with the BMS module(s)? (considering I'll have to recharge the batteries)


texts: Equation to calculate voltage divider resistor value for an input of op-amp

texts:
I found this guide for a temperature sensing circuit design with NTC thermistor by Texas Instruments.

According to my opinion, optimum R1 value is calculated so that the voltage divider can provide the widest voltage variation at its output for the given resistance range of the NTC thermistor.

In the Design Step 1 they have used this equation to calculate R1 of the voltage divider.

Here minimum and maximum values of the resistance range of the NTC thermistor are used.

Can this equation always be used as a general equation when designing voltage dividers for similar applications? Is this equation is a standard one and how is it derived, at what situations this equation should not be used?


texts:
I use Eagle to design my own home etched (typically through hole) PCBs.  On this particular board I use a ground fill and I've removed the thermals on the grounded pins because (funnily enough) I find the non-hatched holes easier to solder.

The problem I'm having is that Eagle then chooses to fill the drill hole with the ground pour making it impossible to see where to drill on the etched board.  Here's what I'm talking about:

I'm probably doing something wrong here, but what I think I need is a black spot where the drill hole is.  That way the copper is removed during etching and I can see where to place the drill.

The white rings are just me messing with drill aid ulp which won't help (I think) because it doesn't remove the copper.

Any ideas??


texts: I've recently torn down and old printer as a learning experience and to maybe build something kinda fun out of it. As many will know that have taken apart printers, most newer ones have ceased using stepper motors and have started using a system of regular dc motors mixed with photo interrupters and optical strips to tell distance. A particular one photo interrupter I've come across a lot now has six pins out of its small black package. 2 I have determined are for the infrared led and the other 4 are for the phototransistor. Sadly, I can't find this little photo transistor on the internet and have instead resorted to the wonderful people here for some help. I removed it from the housing, figured that'd help a lot.


texts: Communicating with the moon via capacitance

texts:
In the question Capacitance between Earth and Moon, several answers gave a value for the capacitance between the earth and the moon at tens or hundreds of µF.

Since capacitors are conductive to AC, would it be feasible to use this capacitance be used to provide power and data to moon habitats? What would the efficiency be?


texts: Help identifying a SOP-18 IC (labels removed) by reverse engineered circuit

texts:
I have a SOP-18 IC (0.65mm pin pitch) which I need to identify. It seems the vendor removed the labels on top of the IC, so I need your help.

The IC is usually connected to a bunch of LEDs and two pins are connected to an epoxy blob (I guess a MCU). I assume the IC is some kind of shift register or LED driver, but I would like to know which one exactly. Based on the number of pins and location of the GND and VCC pin I could also assume it's a PIC MCU, but just for controlling LEDs, that would be an overkill imho...

On the bottom side of the IC, there are some codes: "T6AL7CFF0074-2" and "VO8"

Attached I have pictures of the IC top and a schematic how to IC is connected on the PCB. Under the IC on the PCB there was the code "8A21" printed on the silkscreen.

I hope you can help me to identify this part.


texts: Opamp: Does the openloop Gain changes depending on the Input stage?

texts:
In case for bipolar Input stages on Opamps: does the actucal Openloop gain changes depending on which input stage, n or p channel is used? (which depends on the applied input signal)
Could not find something about that but not sure, as many parameters (like DC Offset, noise) depends on which input channel is used.


texts: How do ultrasonic sensors differentiate between transmitted and received signals?

texts:
I understand how these ultrasonic sensors work on the basic level: They send out ultrasound, which is then reflected by an object and is then sensed by the receiver.

But the receiver and the transmitter are placed side by side. Won't the receiver immediately pick up the signal as it is sent? How does ignore the signal as it is sent, and record it only as it returns after being reflected by the target?


texts:
So I have come across this code and when I synthesize it I was surprised that there is no latch.

library ieee;
use ieee.std_logic_1164.all;

entity practising is
port(
    a,b,c: in std_logic;
    z: out std_logic
);
end practising;

architecture behavioural of practising is
signal y: std_logic;
begin

test: process(a, b, c)
begin
    y <= a nand b;
    z <= c or y;

end process;

end architecture behavioural;

I thought it will create a latch as I defined y as a signal so its value will change at the end of the process, therefore, the output Z will keep its value until the process is instantiated again, so there must be a latch to store the value of Z. However, when I synthesized the code there was no latch present.