texts: Voltage multiplier - selection of values

texts:
I'm designing a circuit, which includes a voltage multiplier. The schematics of voltage multiplier is well known, but it usually appears without any specific values for capacitors and diodes:

My quesitions are:

How do I calulate necessary capacitance of C1-C4 with respect to output current and switching frequency?

I assume, the minimum capacitance should be high enough to store the energy which I plan to draw from the output over 1 period of time (1/f). But I'm not sure this is also the optimal value of capacitance.

What voltage should the capacitors and diodes be rated for?

My assumption here is, that the parts "see" a smaller voltage than the output, so they could be rated to this smaller voltage, plus some safety margin.

What type of capacitors and diodes are best suitable for this application?

So far, I considered using ceramic capacitors and fast diodes (e.g. UF4007).

As a guideline, you can assume following parameters of the multiplier:
Vi = 250 Vp, Vo <= 1000 Vdc, Iout = 20 mA, f = 50 kHz


texts: Sallen-Key filter with polarized capacitors

texts:
Maybe someone can help with this. I need an active filter with a very low cutoff frequency (~2 Hz). I think to make it with aluminium electrolitic capacitors. Is there any draw back? The signal to be filtered varies from 0 V to 3 V. Here is the circuit:

Is there any problem with this conection? The simulation runs OK, but I want to know if there is any problem in using electrolytic capacitors as shown in the diagram.


texts: How do the voltage of DC voltage sources and capacitors add up in series

texts:
I can't quite get my head around how the voltage adds up in a series circuit. Not the mathematics, I mean, but the reason down to the charge on plates and the actions inside the battery.
Also, if I were to charge two capacitors separately from a same 1.5 V battery (first charging the first, then removing it, then charging the other). And then combine them in series (like  ---| |-----| |---- ). Would the charge across them be 3.0 V (ideally speaking)? If so, what would happen on the plates before and after combining them?
Thanks.


texts: Calculate maximum Interface Speed 32 Bit 100 MHz

texts:
I have a HSMC Interface which has 32 Bit width data word changing at 100 MHz. How is the correct maximum data throughput calculated?

Is it just dataword_length / clock_period [bits/ns]. And then I will convert to MByte/s. This is a question on the raw data speed (signalrate). There are no protocol headers involved here.


texts: Remote's IR signal viewed in my phone's camera is flashing. Shouldn't it look steady with a 38kHz carrier frequency?

texts:
I know I'm missing something fundamental here, but you can imagine the Google results I get trying to find this out!
Shouldn't my phone cameras recorded fps/exposure be way way waayy much slower than 38000 flashes every second?


texts: Determining VA rating of the small transformers

texts:
I have a 1000VA toroid transformer which weighs 8 Kg. Based on this power-to-weight ratio, can I conclude that another transformer which is EI cored and weighs 7 Kg must be 875VA? Or such ratiometrics only applicable to the transformer of similar core types?

For information, the EI cored transformer is labelled only with its primary and secondary voltages, no current ratings are stated. Its primary voltage is similar as the toroid, 245V 50 Hertz but secondaries are not same voltage.

Toroid's secondary is 35V @ 29 amps
EI core's secondary is 110V, max current not stated.


texts:
I need to move a rod with a 50cm stroke.

Almost no force is needed(the rod is just for display purposes). Speed is also not essential.

I was thinking of creating a very long DC solenoid but I am worried because I've never heard of such a solenoid. Is this impossible?


texts: Is Capacitive/Clock Feedthrough signal-dependant?

texts:
I am wondering about the phenomenon of capacitive/clock feedthrough in a simple MOS device with a hold capacitor.

For example consider the following

If a parasitic Cgs appears, then surely Q = CV and the voltage V is the difference between the gate voltage and the output voltage which is signal dependant as the hold capacitor will store a value close to the input voltage.

So my conclusion is that clock/capacitive feedthrough will cause a signal dependant drop on the hold capacitor. Is that correct?


texts:
I've been tearing out my hair for a while on this.  I'm just trying to do a basic SPI transaction -- sending one byte -- on the ATtiny441 but I'm getting nothing on the SCK and MOSI lines.  First, here are my fuse settings and pinout (in red):

Probably the most useful information here is that I'm using the 8MHz internal oscillator, and not dividing by 8. Note that I'm remapping the SPI pins so that I can leave my logic analyzer on while programming with the default pins.

Here's my main.c file:

#define F_CPU 8000000UL

#include <avr/io.h>
#include <util/delay.h>

#define SCK         3
#define MOSI        1
#define CSN         2

uint8_t data = 0;
uint8_t reg = 0;

int main(void)
{
    PRR = 0; // turn off power reduction
    REMAP |= (1<<SPIMAP); // remap SPI pins
    // set SCK, MOSI, CSN as outputs:
    DDRA = (1<<SCK) | (1<<MOSI) | (1<<CSN);
    // enable SPI, set as master, use f_clkIO/16 (500kHz):
    SPCR = (1<<SPE) | (1<<MSTR) | (1<<SPR0);
    reg = SPSR;
    reg = SPDR;

    while(1)
    {
        PORTA &= ~(1 << CSN); // clear CSN
        SPDR = data++; // send byte
        while( !(SPSR & (1<<SPIF)) ); // wait for flag to set
        PORTA |= (1 << CSN); // set CSN
        _delay_ms(10);
    }

    return 0;
}

I'm reading the SPSR and SPDR registers before the while loop at the recommendation of Atmel's AVR151 app note (page 11).

When I run the code the CSN line stays low, along with SCK and MOSI, suggesting that it's getting stuck in the while( !(SPSR & (1<<SPIF)) ); section waiting for the SPIF to set.  When I comment out this line, the CSN line goes low for ~25us then back high, which is expected.  I tried manually setting the outputs high on SCK and MOSI, too, to make sure it's not a pin connection problem and they worked fine.

Question: Does anyone see the error in my ways?  I feel like there's one small, stupid error somewhere.

Edit: I also want to mention that I tried it with and without the clock divider (by 8) fuse bit set, and with and without remapping the SPI pins from the default location (i.e. programming, removing programming leads, attaching logic probe leads).


texts:
I would like to use 12v LED tape powered by an 8 x AA battery holder and switched with a motion sensor. This will be connected in my home 24/7, so I would like to know what precautions  (if any) I should take to protect from fires.

Perhaps I just need to fit an in-line blade fuse holder to the +ve wire from the battery holder? If so, what is the safest way to wire this in without introducing more risks? Or perhaps there is a simpler way, e.g. a battery holder with inbuilt fuse? But I cannot find any. Basically, I want to minimise complexity to fool-proof the solution (as I am very inexperienced!).

Please note: I have considered rechargeable 12v battery packs, but I can only find generic made-in-China types, which have bad reviews and don't sound particularly safe, so I think I should rule those out. However, a rechargeable solution would be ideal, if anyone has any suggestions! 10 x AA rechargeables would be difficult as I can't find a 10 bay charger (in the UK). (LED strip states 6 amps max, but I only expect 1 amp due to dimming, shortening, single colour, and other people's findings).


texts:
This AOSP/Develop/Audio page describes the following audio loopback dongle. Can someone explain it?

  To ensure that the output signal will not overload the microphone input, we cut it down by about 20dB. The resistor loads tell the microphone polarity switch that the audio loopback dongle is a US/CTIA pinout Tip Ring Ring Shield (TRRS) plug.

Tip is left channel output, ring is right channel output, ring 2 is ground, and mic is the microphone voltage. In other words, the left and right channels are combined and fed into the microphone circuit.

I assume the microphone polarity switch refers to the 1K, 1K, 100, 100 resistors. What is a microphone polarity switch and how does it relate to the resistors?
I assume the 2K resistor is to prevent shorting the microphone input? To get the referenced -20dBv this implies the phone's internal microphone circuit resistance is about 20K (seems a bit high...)?
What is the point of the 0.1uF capacitor? A coupling capacitor... between what?

And lastly, if I were to build this myself, any gotchas to avoid?

edit

The circuit clicked when I redrew it (below). But I still have some questions:

What is the point of R3 and R5?
R4 is - I assume - the virtual microphone load. Is this the resistor that interacts with the "microphone polarity switch"? A TRS plug would create a short between Mic and Ground but otherwise doesn't have anything to do with polarity.
R1 and R2 prevent overloading the microphone input. Does the -20dBv refer to these resistors in parallel?

1K||1K = 2K
20 * log(2K/x) = -20
x = 20K

That would imply headphone impedance averages 20K, but research shows most headphones average well below 1K. How can I explain the quoted -20dBv?

edit: That's a mistake, x = 5K. Still high though.

An answer below suggests R1 and R2 are also necessary for mixing the left/right signals. Are resistors required when mixing out-of-phase signals?
And C1 keeps the mic bias voltage out of the line outputs. (yeah I originally thought the microphone generated its own voltage; that there was no bias).

simulate this circuit – Schematic created using CircuitLab

Can someone redraw the diagram with signal and voltage sources? I'd probably botch it up. As well as an oscilloscope across R4? I'm curious if the capacitor would distort human speech at 50Hz - 1000Hz out-of-phase inputs on the right and left channels. I found this rule of thumb:

100Hz - 10uF
1000Hz - 1uF

So 0.1uF (in the source diagram) looks a little low.


texts: Are my equations correct for a simple lithium ion battery model in Python?

texts:
I am trying to create a simple battery model in Python based on the RC circuit from, http://firsttimeprogrammer.blogspot.com/2015/07/electric-circuits-101-rc-and-rl-circuits.html. I have attached figures of what I would ideally want the output to look like using my equations.

I know battery modeling is a large subject, but I want to make a simple lithium ion battery model based off a RC circuit where I can decide when the battery charges and discharges.

I am wondering if my equations are correct for what I am trying to do (the equations are in the code below). Right now all my equations are independent and only rely on time, but I am wondering if the current and voltage across the capacitor equations for charging/discharging should somehow be dependent. I am not taking into account factors like heat, cycling, etc. This is supposed to be a simple model with just charging and discharging.

Below are some examples of plots I found that I would like my code output to look like. When the battery is "used" it discharges and the voltage level in the battery decreases, when the battery charges, you see the corresponding current and the voltage reaching its full capacity.

You will see in the code I have 3 equations that correspond to the "battery", which are for charging (#Charge Equations), and 3 equations for the "battery" that correspond to discharging (#Discharge Equations). These are the equations I am curious about.

import numpy as np
import matplotlib.pyplot as plt

plt.style.use('ggplot')

#capacitor (battery)
c = 100 * 10**(-6) #farad
#voltage source
vs = 5 #volts
#resistor
r = 2000 #ohms

#time
t = np.linspace(0,1,1000)

#Charge Equations
q = c*vs*(1-np.exp((-1/(r*c))*t)) #charge
i = (vs/r)*np.exp((-1/(r*c))*t) #battery current
vc = vs*(1-np.exp((-1/(r*c))*t)) #battery voltage

#Discharge Equations
qd = c*vs*(np.exp((-1/(r*c))*t)) #discharge
id = (vs/r)*np.exp((-1/(r*c))*t) #battery current
vd = vs*(np.exp((-1/(r*c))*t)) #battery voltage

plt.plot([0,t[-1]],[c*vs,c*vs],label='Charge peak')
plt.plot(t,q,label='Charge of the capacitor (C)')
plt.plot(t,i,label='Current (A)')
plt.plot(t,vc,label='Voltage across capacitor')

print('Tau',1/(r*c))
print('Peak current (A)',vs/r)

plt.xlabel('Time (s)')
plt.title('Battery')
plt.legend()
plt.show()

The code is not finished, however, when done the basic idea is that when I run the code, I can specify when I want the battery to charge and when I want it to discharge during a simulated amount of time.

To summarize, here are my main questions and concerns:

Are my equations correct for what I am trying to do?
Should the equations somehow be dependent on each other?
Should I be using a different set of equations when trying to simulate my lithium ion
battery?

Any advice, or suggestions, would be greatly appreciated. If anything seems unclear, or needs further explaining, please let me know.

Sources for pictures

First picture:
https://www.dnkpower.com/why-18650-battery-explode/

Second Picture: https://www.researchgate.net/publication/284760976_Experimental_validation_of_a_battery_dynamic_model


texts:
What is the best way to store solar panels when not hooked to a charge controller in direct sun?

I was thinking about hooking each panels pos and neg mc4 connectors to itself so it will not be damaged by water. Will this damage the panel?


texts:
My inkjet is about to run out of ink and I'm thinking of buying a laser printer to print the transparencies.

General process:

2 prints of PCB cut aligned and glued to each other > Pr-Sensitised PCB exposure > development and etching.

In general with the Inkjet I print several times on the same sheet and any offcut can then be attached to a paper A4 sheet for printing later on, minimal waste.

My concern in buying a laser is the heat and the possible warping of the transparency especially running it through several times.

Am I better of sticking with the inkjet due to the warping of the transparency that the laser can/could cause?

I included a pic to show that all these three PCBs were done in multiple print runs with one A4 transparency sheet on an inkjet. I don't know but I don't think I can do the same with a Laser printer.

Thanks all, but it seems lasers are to finicky. Right laser, sourcing and using the right transparency, then in future if I try to use the transfer method on non pre-sensitised boards it has to be the right toner for transfer.

One mistake or fault and cost of repair could be a nightmare. For the cost of repair/parts of a laser I can buy a dozen cheap new multifunction ink-jets that will last me 5+ years.

I may stick with the ink-jets, 100% success rate so far.

It just occurred to me that with a laser and using the transfer method (translucent paper 'crowie') I could just use the laser to create a silk screen then iron it on the PCB. I may see if I can buy a cheap second hand laser. It would be nice to have a cct board with a silk screen of sorts.


texts: "Unresolved reference to 'countmode1'" , Verilog simulation error

texts:
When I want to simulate the following code, I get these errors:

"Unresolved reference to 'countmode1'"
"Unresolved reference to 'countmode2'"
"Unresolved reference to 'countmode3'"

module a8bitCounter(inp[7:0], ocrn, counter[7:0]);

  input [7:0] inp;
  input ocrn;
  output [7:0] counter;
  reg [1:0] countmode;
  reg [1:0] clksource;
  reg done, clk, reset, oc;
  reg round = 0;
  `include "countmode_1.v" // task functions included here
  initial
  begin
  countmode = {inp[3], inp[6]};
  clksource = inp[2:0];
  end
  parameter S0=3'b001 , S1=3'b010 , S2=3'b011 , S3=3'b100 , S4=3'b101, S5=3'b110 ,         S6=3'b111 , S7=3'b000 ;
   always @ (posedge clk, reset) begin
   if (inp[2:0] == 0) begin
end else if(clk)
begin
case (clksource)

    S0:begin

      if (countmode == 2'b00) begin
        countmode1(reset, counter, clksource, ocrn, oc, round, S0, S7);
      end

      else if (countmode == 2'b01) begin
        countmode2(reset, counter, clksource, ocrn, oc, round, S0, S7);
      end

      else if (countmode == 2'b10) begin
        countmode3(reset, counter, clksource, ocrn, oc, round, S0, S7);
      end
    end

    S1:begin

      if (countmode == 2'b00) begin
        countmode1(reset, counter, clksource, ocrn, oc, round, S1, S7);
      end

      else if (countmode == 2'b01) begin
        countmode2(reset, counter, clksource, ocrn, oc, round, S1, S7);
      end

      else if (countmode == 2'b10) begin
        countmode3(reset, counter, clksource, ocrn, oc, round, S1, S7);
      end
    end

    S2:begin

      if(countmode == 2'b00) begin
        countmode1(reset, counter, clksource, ocrn, oc, round, S2, S7);
      end

      else if(countmode == 2'b01) begin
        countmode2(reset, counter, clksource, ocrn, oc, round, S2, S7);
      end

      else if(countmode == 2'b10) begin
        countmode3(reset, counter, clksource, ocrn, oc, round, S2, S7);
        end
      end
      endcase
    end
    end
endmodule

This is part of an eight bit counter .
I used following task functions to write it :

module countmode();
  reg reset , oc , round=0;
  reg ocrn;
  reg [2:0] S0,S1,S2,S3,S4,S5,S6,S7;
  reg [7:0] counter;
  reg [1:0] clksource;

  task countmode1;
            if(reset) begin
              counter = 8'b0;
              clksource = S0;
            end
            else if(counter == ocrn) begin
              oc = 1;
              clksource = S7;
            end else if(round == 5) begin
              round = 0;
              clksource = S7;
            end else if(counter == 8'b1) begin
              counter = 8'b0;
              round = round + 1;
              clksource = S0;
            end else begin
              counter = counter + 1;
              clksource = S0;
            end
 endtask

   task countmode2;
            if(reset) begin
              counter = 8'b0;
              clksource = S0;
            end else if(counter == ocrn) begin
              oc = 1;
              clksource = S7;
            end else if(round == 5) begin
              round = 0;
              clksource = S7;
            end else if(counter == 8'b1) begin
              counter = counter - 1;
              round = round + 1;
              clksource = S0;
            end else begin
              counter = counter + 1;
              clksource = S0;
            end
 endtask

   task countmode3;
            if(reset) begin
              counter = 8'b0;
              clksource = S0;
            end else if(counter == ocrn) begin
              counter = 8'b0;
              oc = 1;
              clksource = S7;
            end else if(round == 5) begin
              round = 0;
              clksource = S7;
            end else begin
              counter = counter + 1;
              round = round + 1;
              clksource = S0;
            end
 endtask
 endmodule

Please tell me how to fix this simulation error. I can't remove "always" because of the "if-else" functions.

EDIT : edited and add first part of source code.


texts: (Protected) Batteries, MCP73833 and TP4056 Modules

texts:
I am getting into my first project and have a questions about LiIon batteries. So much information out there and confusing and I am not sure if I am overthinking or what the easiest/best value solution is.

-I want to run a 5v Arduino and 5v 300mA micro air pump from a 1S2P 18650 battery pack. I assume I will step up the Lion voltage to meet these loads.
-I want to be able to charge the battery pack via standard MicroUSB input
-I will use two new batteries, initially charged to same voltage, so won't need to balance
-I want to be able to charge and use the device at the same time

What I understand/Where I am confused:

There are two USB charging chips on boards out there: MCP73833 or TP4056
I don't really get what the difference is, or why I would choose one over the other.

MCP73833 boards like this are relatively expensive, but have easy JST ports to work with.
https://www.adafruit.com/product/259

TP4056 boards come in old and new flavours, apparently the new version can charge and load at the same time, the old kind cannot. How do I tell which is which from everything out there??? Can this one?:
http://www.ebay.com/itm/112057059077

There are battery packs out there pre-made that have PCB built into them. Can I charge those with one of those MCP or TP boards, Or does multiple protection circuitry confuse itself?

Same question for battery holders that have PCB's built in.

ie. Does the built in protection circuitry make an issue for the Charging modules?

TLDR; Just trying to find the easiest way to charge and use a 1S2P battery at the same time

Thanks for any insight!


texts:
I need to modify the schematic below to accommodate for the change from 6 5mm IR Leds to a single 5w LED star.

  Previous 5mm LEDs

  High output infrared LED 5mm 1.2VDC 100mA 940nm

  New 5w LED Star

  Emitted Color : Infrared IR 940nm
  Viewing Angle: 135 degrees DC
  Forward Voltage (VF): 1.4V DC
  Forward Current (IF): 1400mA Maximum
  Pulse Voltage: 1.7V
  Maximum Pulse Current: 2000mA

Since this is a strobe I want to be running it at ~Pulse Current. My power supply will be a cigarette lighter outlet in a vehicle, which I believe gives out around 13.5v.


texts: Choosing values for a low pass RC filter?

texts:
I have to design a low pass filter to put at the end of a thermocouple. The Thermocouple has a 30.8mohm impedance. I am going to have a signal with noise at high frequencies. This AC signal has an amplitude around 15V  (it is a really noisy signal) and I am interested in an output signal not more than 10Hz. Is one stage adequate ? Should I consider a multi stage RC filter? There are many combinations of R and C for setting a cut off frequency of 100Hz. What should I consider when choosing R and C?. I am going to measure the output of the combination thermocouple+RC filter with this passive probe: http://tmi.yokogawa.com/es/products/oscilloscopes/voltage-probes/701938-200-mhz-passive-probe/

I have been thinking about R=100ohm and C=15uF, R=1kohm and C=1.5uF... but I am not sure if I am not considering something important.


texts: STM32H745 dual-core debugging with IAR toolchain

texts:
I am working on STM32H745 dual-core controller and IAR Embedded Workbench for ARM toolchain V8.40.1 for development.

My intension is to perform/enable dual-core debug instances in IAR using ST-Link V2/V3 as a debugger and STM32H745ZI as the target. The only resource I was able to find online was  "AN5286", which elaborates on how to configure IDE for what I am looking for but the method doesn't seem to work. So what exactly I should do for debugging both the cores simultaneously!?

Thanks in advance folks!

Sorry if I haven't framed my question properly, as this is my first question on StackExchange!.


texts: Bubba Oscillator - Smooth sine curve generation

texts:
I am trying to simulate Bubba Oscillator using MATLAB, so far i have had success getting both sinusoidal and cosine curves from below circuit :

I have used finite gain op-amp with gain = 100000; and rest of the values are marked in the circuit.

The results that i got were :

My questions are :

1.) How can i make the graphs more smoothers, instead of that peaky shape that they follow?

2.) How can i make the graphs with reference y point as 0 i.e symmetry about x-axis?

3.) How can i make the amplitude to -1 <--> +1?

Any help would be appreciated. Thanks in advance...


texts: Best Approach Methods for Signal Processing

texts:
I'm looking for some advice, I am hoping one of the many forum experts could help me with some advice on the sampling and processing of signals. I am using an STM32F4 processor with 12 bit ADC and DSP core. Presently, I can use either CMSIS DSP or Siglib libraries. Here's a point description of the problem space:

I can sample at whatever rate is required: in front of the ADC is a 10th order analog amplifier and LPF, Fc = 55Hz. Amplifier can be set to provide ideal ADC range of 3Vpp

Sinusoidal incoming signals are in the range of 10Hz to 40Hz that can be set for any duration in time. Ideally, in the range of 200ms to 300ms (can be changed)

In between these tones, there is dead space of (ideally) 50ms to 100ms (can be changed)

There would be a series of these tones with a total time of about 4, or possibly 5 seconds (can be processed after last signal arrives, ideally real-time)

I need the best amplitude and frequency accuracy possible, ideally about 2dB and 0.5Hz. The environment is noisy, but incoming signals can be kept 20dB over noise.

I am not looking for a code handout. Just a best approach algorithm and ideally some specifics such as sampling rate (is decimation required), buffer size, to use overlap-add/sliding window, signal processing chain - FIR required (how many taps), FFT method/size?

It may not be complex to many of you, but I haven't finished all the theory I need to try an implementation without spending a long time,(I have all the books but there's a lot of reading yet!) and the problem requires me to try for a solution now.

Thank you for your help! Roger


texts: Strategies for measuring physical PCB dimensions

texts:
Are there any low-cost and accurate ways to measure small dimensions on a physical PCB? Physical is critical here, since it's easy to measure dimensions in a CAD tool. However, actual dimensions will diverge somewhat from the design dimensions due to manufacturer tolerances. In particular, I'm interested to know how closely the width of my \$50\,\Omega\$ traces are to the design specs.

Here's what I've tried: I've taken a picture of a PCB trace adjacent to a set of calipers measuring 1.01mm (idea taken from here). I can then measure the pixels in GIMP (though I'm sure other image editors can do this too). The ratio of the trace to caliper pixel widths times the caliper width gives me the trace width. However, the image is a bit blurry. I think the reason for this is that my iPhone camera cannot support a very short focal length and does not have an optical zoom. I did rest the camera on a stable surface so it wouldn't move. I'm not a photographer, so if there's a way to get better results please let me know. Moreover, the result is a bit far off what I'd expect. I designed these trace widths to be 0.38mm, but am getting about 0.43mm (bear in mind the blurriness makes it difficult to be accurate here). Here's the image. The PCB is manufactured by oshpark 4-layer.

Any thoughts on this process, or better processes available? I know there are dedicated tools that will do this (e.g. some dinolight microscopes will measure distances), but from what I've seen, those are all expensive solutions.


texts: Understanding Overpower protection specifics

texts:
I am trying to understand how a particular ac-dc converter behaves in an overpower situation. The converter is the SRP-25 series from Integrated Power.
From the datasheet (linked above), I see this:

The protection is described as 'Outputs cycle on/off, auto recovery.' I am looking to understand specifically what would happen with a potential failure mode where the load impedance develops a partial short, leading to too much power being drawn. I interpret this datasheet description to mean that the output shuts off in such an overpower situation. I am not exactly sure what 'auto recovery' means. Does this language have a standard interpretation, such as meaning that the output is shut off until the input power is cycled? Or does it mean that the converter would attempt a reset on its own after some time?
I looked for this info in the operating instructions, but found no reference to it there either.


texts: Differential equation into circuit and back - good book

texts:
I have had some electronics, but we only built our circuits and then measured the input / output signals with oscilloscopes...

Today I found an interesting question on physics stackexchange where user is trying to build an electric circuit based on the differential equation. Because I am a physicist and would like to connect my physics knowledge to electronics, am asking you:

  Which book do you recommend to teach myself to think this way or vice versa - if I knew the circuit how would I write down the differential equation?


texts: Pool alarm with wireless remote alarm, how to integrate with it?

texts: I have this pool alarm http://www.diycontrols.com/p-6711-sensor-espio-inground-pool-alarm-safety-item.aspx. I would like to log whenever the alarm goes off so I know if it is tripping while I am gone very often. How can I find out when a signal is sent? I don't want to hack into the remote alarm, but actually detect the radio signal.


texts: Increasing Locking range of ADPLL in VHDL on FPGA for FM Demodulation?

texts:
I am trying to implement an all digital PLL so as to demodulate an FM signal from the input. The centre frequency of the test signal is that of 140kHz. The system works fine upto a deviation of +-50kHz from the centre frequency, but I need to increase this to the standard deviation of +-75kHz in FM transmissions. Attached below please find my VHDL code used to incorporate the system.

DAC_Driver: entity work.DAC_Driver
  port map (
    input_signal => output,
    output_signal => output_port
  );

Loop_Filter: entity work.filter
  port map (
    Sample_CLK => clk_1Mhz,
    Data_in => mult_out(23 downto 12),
    Filtered => loop_filter_output
  );

Final_Filter: entity work.filter_final
  port map (
    Sample_CLK => clk_1Mhz,
    Data_in => loop_filter_output(22 downto 11),
    Filtered => final_filter_output
  );

NCO: entity work.COS_LUT_LARGE
  port map (
    address => LUT_in,
    clock => clk_1Mhz,
    q => LUT_out
  );

NCO_Accum: entity work.Accumulator
  port map (
    clk_in => clk_1Mhz,
    accum_out => LUT_in,
    freq_int_in => std_logic_vector(signed(freq_125k) + signed(loop_filter_out_small))
  );

mult_out <= std_logic_vector(ADC_input * LUT_out_final);

The NCO code is in the follwing snippets. It involves an accumulator and a look-up table.

library ieee;
  use ieee.std_logic_1164.all;
  use ieee.numeric_std.all;

entity accumulator is
port (
  clk_in: in std_logic;
  accum_out: out std_logic_vector(13 downto 0);
  freq_int_in: std_logic_vector(13 downto 0)
);
end accumulator;

architecture arch of accumulator is
begin
  process (clk_in)
    variable cnt: signed(13 downto 0);
    variable i: integer;
  begin
    i := to_integer(signed(freq_int_in));

    if rising_edge(clk_in) then
      if cnt > 16384 then
         cnt := (others => '0');
      else cnt:= cnt+i;
      end if;
    end if;

    accum_out <= std_logic_vector(cnt);
  end process;
end arch;

Finally this is the loop filter used in the system:

library ieee;
  use ieee.std_logic_1164.all;
  use ieee.numeric_std.all;
  use work.Support_Functions.all;

Entity filter is
  generic (
    Guard_bits: integer := 7; --Extra Length for guard bits
    Precision: Integer := 12 --Precision of Multiplier Coefficients
  );
  Port (
    Sample_CLK: in std_logic;
    Data_in: in std_logic_vector(11 downto 0);
    Filtered: out std_logic_vector((Guard_bits + Precision + 4) downto 0)
  );
End Entity filter;

Architecture RTL of filter is
  Type Slv_Array is Array (0 to  1) of std_logic_vector(Data_in'Length - 1 downto 0);
  Signal Data: Slv_Array;
  Constant Coeff: real := (1.00999);

  --Multiplication Results Signals
  Signal Mult_result: signed(Precision + Data_in'Length - 1 downto 0);

  --General Adder Signals
  Signal Accumulator: signed((Guard_bits + Precision + Data_in'Length - 1) downto 0) := (others => '0'); --Must be wide enough
begin
  process(Sample_CLK) is
    Variable summation: signed((Guard_bits + Precision + 4) downto 0) := (others => '0');
    Variable Mult_result: signed(Precision + Data_in'Length - 1 downto 0);
    Variable Data: Slv_Array;
  begin
    if rising_edge(Sample_CLK) then
      Data(1) := Data(0);
      Data(0) := Data_in;
      Mult_result := signed(Data(1)) * Real_to_signed(Coeff,Precision);
      summation := signed(Data(0)) + Mult_Result;
      Filtered <= std_logic_vector(summation);
    end if;
    summation := (others => '0');
  end process;
End Architecture RTL;

Can anyone please help me make the PLL lock in +-75kHz please ? Thanks.


texts: High side switching bizarre side effects

texts:
I'm not quite sure how to title this question. In essence, I have a high-side power switch circuit that is not switching off all the way under circumstances I cannot explain.

First, here's the entire circuit:

It is a battery powered GPS system. It is designed primarily to be a reverse geocache. When operating, it draws about 150 mA of battery power, and when it's sleeping it draws about 1 mA, both of which are perfect.

What is bizarre is that the power switch won't switch completely off unless I set the pinMode of the 6 logic pins connected to the LCD to INPUT.

I've spent an all-nighter trying other things, and that's the only one that causes the power to go completely out. It's a complete mystery to me.

A logic low on the MMBT3904 base resistor is only 0.06 volts. If I simulate the power circuit, it requires closer to 1 volt to even begin to switch on (with a 100k resistor).

The other weirdness is that with the LCD connected, AVR-ISP programming doesn't work. I've used that same pin configuration before and it's worked, so that's another mystery (but probably for a different question).


texts: PIC operating temperature... "industrial" vs. "extended"

texts:
I am shopping for a PIC micro-controller for use in an automotive application. I noticed that PICs are offered in both "industrial" and "extended" temperature ranges ([-40C to +85C] vs [-40 to +125]). I should use the extended version, but due to availability, I may be forced to use the industrial or do something else entirely.

In any case, I became confused when I looked at the datasheet and saw that there is no distinction made on the line where operating temperature is specified. Here is an excerpt from page 265 of the datasheet found here: http://ww1.microchip.com/downloads/en/DeviceDoc/39995d.pdf

The subsequent tables all make the distinction as seen here:

Can anyone decipher the meaning of this temperature range? Are the two versions fabricated using the same process and the extended versions are simply qualified to a higher level? Should I be concerned that the industrial version of the chip will fail at higher rates between 85C and 125C?


texts:
I am using a n-channel MOSFET (AO3400A) as a power switch. Circuit is below.
The issue I'm facing is when the EN pin is 0V, the LEDs are still dimly lit. The voltage across the load measures about 2.9V.
When EN pin is 3.3v, the LEDs are at full brightness and the voltage across the load measures 5V. This is the expected behaviour in this instance.
With EN at 0V, I would have expected the LEDS to be completely off. Any thoughts why this might be the case ?
Just a note, in my actual application I'm using Neopixels, but have simplified the diagram for the purpose of this question.


texts: Why does this PNP BJT use dual supply but the NPN not?

texts:
It's not immediately apparent to me as to why the following common-emitter configuration use two supply rails when used in conjunction with a PNP type BJT but the NPN version does not?

To bias a BJT transistor in the forward active mode we would like the emitter-base terminal to be forward biased and the collector-base terminal to be reverse biased. For an NPN transistor in this common emitter configuration the collector terminal is connected to the positive supply and is therefore reverse biased whilst the emitter sits at a negative potential and is therefore forward biased.

With the PNP transistor the emitter terminal is connected to a positive supply and therefore forward biased whilst the collector is connected to the negative supply rail and therefore reverse biased.

My question is why is it common to see dual positive/negative supplies used with the PNP transistor? Wouldn't it be sufficient just to tie the node which connects R2 and RC to ground?


texts: What would a Shark Shield circuit look like? (Not related to Arduino!)

texts:
From:  http://sharkshield.com/

Shark Shield is a unique shark deterrent system utilizing a technologically advanced three dimensional electrical wave form. Shark Shield technology is available for recreational users and water sports professionals to help all people enjoy the water with a new dimension – peace of mind; for themselves, their families and employees.

I'm referring to Shark Shield as an example.  What does a shark repellent circuit look like?  What would be the maximum range you get under water and does it depend on the power source?

Is this simply putting + and - nodes under water and pulsating them with DC power?


texts: Direction and Speed control using same throttle

texts:
I have a 24VDC permanent magnet motor such as those commonly found on a mobility scooter. I would like to be able to control both the speed and the direction of the motor with the same throttle control without the need to use a reverse switch. Current mobility scooters use whats known as a 'Wigwag' potentiometer or throttle potentiometer to achieve this.

My question is how can I control the speed and direction the of the motor using the same throttle control without a reverse switch?

I have found a simple circuit online which looks useful however this circuit doesn't allow for the modification of the acceleration/deceleration rate or other parameters which I would like to able to modify.

Can I use a micro controller with the throttle voltage as the input and then step up the output currents and voltages somehow?


texts: When a datasheet mentions the output impedance of a pin so and so ohms. What exactly does it mean? Can anybody explain through a diagram how does it look like?


texts: Does parallel resonance in an AC circuit always result in maximum impedance thus minimum current? If not ,why? I've read this only happens when the parallel branch 'conductances are constant' but have no idea what this means.


texts: Leaded wave soldering temperature on "lead free PCB"

texts:
I've a question regarding what temperature is recommended on a leaded wave soldering machine?

Background of question

The case is that I've the option to use a leaded (when customer allows) or a lead-free soldering machine. I've tested the lead-free with the problematic result that the solder won't float up, where the production was unable to improve the soldering afterwards. So I've tested the leaded wave soldering, with much better result. However my gut feeling says me that the temperature that was used in this leaded machine, is to high >400Celsius, because the lead-free use a temperature of <400Celsius. So that is the origin of my question.

The PCB is of 6 layers with a lot of copper and heatsinks, with lead-free plating.

I hope someone could help or come with some kind of recommendation.

Best regards


texts:
I have Code for Mod bus Library as below. I have Gone through lots of forum. How to assign device ID, slave address, length using below library function:

#include <SimpleModbusSlave.h>
#define  LED 9
enum
{

  ADC_VAL,
  PWM_VAL,
  HOLDING_REGS_SIZE // leave this one
};

unsigned int holdingRegs[HOLDING_REGS_SIZE];
void setup()
{
  modbus_configure(&Serial, 9600, SERIAL_8N2, 1, 2, HOLDING_REGS_SIZE, holdingRegs);
  pinMode(LED, OUTPUT);
}

void loop()
{
  modbus_update();
  holdingRegs[ADC_VAL] = analogRead(A0); // update data to be read by the master to adjust the PWM
  analogWrite(LED, holdingRegs[PWM_VAL]>>2); // constrain adc value from the arduino master to 255
}

I am getting Error has.

SimpleModbusSlaveArduino.cpp: In function 'void setup()':
SimpleModbusSlaveArduino:79: error: 'SERIAL_8N2' was not declared in this scope

Let me know how to resolve issue.


texts: What is the use for a microcontroller in a temperature sensor?

texts:
At work engineers are using a temperature sensor with a CPU instead of a thermistor. Here is the data sheet of the device: http://www.prelectronics.com/prefiles/2202/Datablad/2202uk.pdf

I couldn't understand how a CPU makes the measurements more accurate. Thanks!

I also didnt get what is MUX doing there?


texts: (Assumed passive) piezo buzzer makes sound upon shorting leads?

texts:
I found a piezo buzzer in an old circuit board. It's (literally) a black box, size of a big coin, maybe 0.8 cm thick, 3 cm across, and a red and a black wire coming out. When I short the red and black wire, the piezo makes a clicking sound. The longer I wait between shorts the louder the click.

It has been disconnected from any power supply for a long time. Does anyone know what's going on? I wouldn't think it has a battery inside. How does it generate the energy for the clicks?


texts: What is the purpose of using the transistor in the circuit?

texts:
Current sensor using an instrumentation amplifier:

Image source: Texas Instruments INA139, INA169 High-Side Measurement Current Shunt Monitor, Typical Application Circuit (datasheet page 1)

Could anyone explain how this circuit works and why they used the transistor in the circuit?


texts: STM32 standby mode power consumption is too high

texts:
I'm experimenting with standby mode on STM32F407VGT6. I know how to put MCU into standby mode(or I think to know that). I'm doing that with this init function:

void MX_RTC_Init(void) {

   RTC_TimeTypeDef sTime = {0};
   RTC_DateTypeDef sDate = {0};

   /** Initialize RTC Only  */   hrtc.Instance = RTC;
   hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
   hrtc.Init.AsynchPrediv =127;
   hrtc.Init.SynchPrediv = 255;
   hrtc.Init.OutPut = RTC_OUTPUT_WAKEUP;
   hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
   hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
   if (HAL_RTC_Init(&hrtc) != HAL_OK)   {
      Error_Handler();
   }

   /** Initialize RTC and set the Time and Date */
   sTime.Hours = 0x13;
   sTime.Minutes = 0x20;
   sTime.Seconds = 0x0;
   sTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE;
   sTime.StoreOperation = RTC_STOREOPERATION_RESET;
   if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK)
   {
      Error_Handler();
   }
   sDate.WeekDay = RTC_WEEKDAY_THURSDAY;
   sDate.Month = RTC_MONTH_JANUARY;
   sDate.Date = 0x30;
   sDate.Year = 0x20;

   if (HAL_RTC_SetDate(&hrtc, &sDate, RTC_FORMAT_BCD) != HAL_OK)
   {
      Error_Handler();
   }
   HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);

}

This init function allows to wake up MCU from standby mode with wakeup pin(PA0) and with timer(currently period is ~20sec). Next function is called when I want to put MCU into standby mode:

void Enter_StandbyMode(void)
{
    __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&hrtc, RTC_FLAG_WUTF);

    HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1);
    __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
    HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);

    HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 40960,RTC_WAKEUPCLOCK_RTCCLK_DIV16);

    HAL_PWR_EnterSTANDBYMode();

}

Again this works as I expect(I used diode to indicate when MCU wake-up from standby) but my question is next one:

Why I still have voltage on pins when MCU is in standby mode? And when I use multimeter to measure current I got ~30mA power consumption in normal mode(when MCU isn't in standby mode) and ~0.58mA(which is ~580uA) when MCU is in standby mode. I read in datasheet that MCU in standby mode can have power consumption less then 5uA. Every hint and idea are welcome


texts: Increasing current by introducing another voltage source in series?

texts:
I have a voltage source connected to a load, and after sometime, introduced another voltage source, would the overall current increase?

Intially circuit:

simulate this circuit – Schematic created using CircuitLab

The current in this circuit is 2A.

After sometime(t) I've introduced V2 to the circuit.

simulate this circuit

Will the current to the load now increase to 5A?
Since the net voltage is 50V/10ohms= 5A?


texts: How to reduce an ALU logic with the minimum logic possible? Its very challenging

texts:
Our professor wants us to reduce 8-function ALU (8 outputs) to a 4 out ALU that has the capability to implement all the 8 functions. We can use any gates(even AOI's), muxes, and can create our control signals.
I am so stuck, my logic design works but I ended up using 5 inverts and 5 two-to-one muxes, I was told its too big. I am stuck now, I don't know how to approach this problem.

The functionality of the ALU (but ADD and SUBTRACT are not here, I am good with those);

This is the given logic circuit to implement, manipulate it to give out all the 5 logical functions i.e states (3 to 7) whose outputs should only exit the 3 outputs given because I already used one output for (add/sub). we basically have to get OR, NOR, XOR, XNOR, AND. no NAnd. The 's' and 'r' shouldn't be connected to the inverter, that was my error, they are the inputs to be operated


texts: How does one practically test all solder connections on a circuit board?

texts:
I'm a hobbyist trying to diagnose a circuit board for a tape deck.  One piece of advice I was given was to "check for any bad solder connections".
On this circuit board there are around 200 connections.  All of these could be checked individually, but that seems practically infeasible.
Is there a practical way to comprehensively check all connections on a circuit board?  If not, what is a diagnostic alternative that will achieve a similar result?


texts: Is there a fake way to drive a matrix keyboard (to use a typewriter as line-printer)

texts:
I recently found a Brother AX-425 typewriter, I want to be able to control it via a computer.

Its internal electronic seems pretty simple, it's a 8*8 matrix keyboard that is connected to an unknown Panasonic IC (lc 1176 c : i didn't find any datasheet for it) that drive the different motors.
I'd like to know if i could use a electronic circuit to drive the keyboard and make him think that i'm typing ?
I've got like 2 idea but i'm new and not really sure :

The brute-force way : I buy 16 relays to simulate the 8*8 matrix that controls the typewriter instead of the keyboard, I use and Arduino to drive those.
I'm pretty sure it will work, but i'm not sure about making this circuit, even if it could make a cool-looking vintage style circuit.

The electrical engineer way : I noticed that there is a +0.2V difference between the rows and columns of the matrix and a sub mA current passing when a key make contact
(I only used a multimeter to mesure this, maybe i could try using a logic analyser made with an Arduino.
So I tough about connecting the 8 rows to an 8 bits multiplexer and the output to the collectors of 8 transistors, using that i'll be able to select a row and a colulmn via my Arduino and stimulate a key press.
But the voltage difference seems low that my circuit could just drop the 0.2V and thus making it not working.

Sort of related topic :

They told him to user multiplexers but the voltage differnce is 5V :
Typewriter keyboard matrix control with Arduino

I'm looking forward to your suggestions, thanks.


texts: What part of Ebers-Moll equation shows the decrease of the collector current in saturation region

texts:
By looking at the Ebers-Moll equation for a BJT transistor:

Is this formula explicitly showing why Ic starting to decrease towards zero in saturation region. Which part of the equation shows that?


texts: I want to process a PAL or NTSC video signal and pick up colors, like green, orange, blue and red. Is there any way to decode RGB from NTSC/PAL easily, and then detect these colours? I'm looking for a small and cheap solution. The end goal is to build up an array of pixels matching a colour, then filter this to decode shapes and locate targets on a camera.


texts:
I am new to embedded coding outside of Arduino, so I need a lot of hand holding. I made a custom board with just a STM32 chip (STM32L082) and a LED. I am trying to debug it using GDB (I hear that's the next thing after using printf's) and I know that I can flash code on it successfully (used JFlash-Lite and can have it toggle LED at different frequencies).(on MacOS Catalina)
However, I am trying to use the JLinkGDBServer (and I've also tried STM32CubeIDE) and I am able to get to a point where it says:

So then I go to my terminal window and enter the following commands:
$ arm-none-eabi-gdb
...
(gdb) target remote localhost:2331
localhost:2331: cannot resolve name: nodename nor servname provided, or not known
localhost:2331: No such file or directory.

And that's where I get stuck. I noticed that the LED stops blinking when JLink says it is connected, so I guess the program is pausing properly. I get the same issue with STM32CubeIDE as well.

Is there some configuration setting I'm missing and/or file I'm supposed to be putting somewhere? What should I try next to debug?


texts: Force USB device to run in Full Speed mode

texts:
I have to test how a High speed USB device behaves when it runs at Full speed.

As High speed runs at 480 MHz and Full speed at 12 MHz I thought this would be easy with a "low pass filter" that does not allow the high frequencies to pass and so the host would automatically negociate a slower speed with the device.

I opened a USB cable and soldered a capacitor between Data+ and Data- like that:

But although I tried several values for the capacitor it did not work.

When I connect 3.3pF, 6.8pF or 12pF the device will work with High speed.
How did I prove that? I connect a USB stick and transfer a big file. The transfer speed is 20 Megabyte/s which is too fast for Full speed.

When I increase the capacitor to 15pF or more I suddenly see the device working with Low speed (1.5MHz) or even failing completely (device enumeration failed)

I tried this on two different computers. The mainboard has USB2.0 hubs and  USB3.0 hubs. No difference in bahaviour. I tried on Windows XP and Windows 7.

There is no way get Full speed. Either High speed or Low speed or nothing.

Can anybody explain me that?
How do I force the device to run at Full speed?

UPDATE:
9 month after asking this question (and being more expert in USB stuff), I know today that USB does not have a fall-back mechanism. If a high speed device does not respond as expected the device enumeration will simply fail. The computer does not try to communicate with a high speed device in full speed after a high speed negociation has failed and neither does the device fall back to full speed mode. The only way to force full speed is to use a full speed hub (USB 1.1), which are very difficult to find nowadays.


texts: PIC (18 series) 12-bit Instruction Addressing?

texts:
I'm trying to find the 12-bit address in hex -- as well as the memory bank being used -- by the last instruction in the sequences listed below.

Before I list the sequences, it is my understanding that the 12-bit address used should be 00da ffff ffff, where d is either 1 (result stored back in register), or 0 (result stored in WREG), and a is either 1 (uses BSR), or 0 (ignores BSR). However, I've also read that the 12-bit address is comprised of the 4 BSR bits and 8 bits from the instruction..so which is it? Is the address being used 00da ffff ffff, or bbbb ffff ffff (where the b's indicate the bank)?

The first sequence is:

MOVLW  H'08'
MOVWF BSR
MOVF  H'10',W

Because I didn't include A (MOVF f,d,a), I believe this ignores the BSR, so I would say the address is 0000 0001 0000, or 0x010. This would be stored in Bank 0.

The next sequence is

MOVLW H'08'
MOVWF BSR
MOVF  H'10',W,A

Since I included A here, this should use the BSR bits to determine the bank, meaning the instruction should use Bank 8. That being said, does this mean the address is 00da ffff ffff = 0001 0001 0000 = 0x110, or that the address is 1000 0001 0000 = 0x810?


texts:
I have testing equipment for testing PCBs. It consist of a PSU, Digital IO (48), ADC(96), communication ports and programmers.

This question is about making the 48ch digital output module foolproof. This module breaks when the assembled PCB (device under test) has a short to the power rail.

I want to redesign the module to withstand 60V on the output. I'm looking for a way to make the module foolproof with a part count as low as possible.

I do not have control over the DUT.

More information:
A lab PSU is used to power the DUT. We supply up to 60V.

The IO module is a custom PCB for a IO-Warrior56. The IO-Warriot56 doesn't have output protection of its own. The outputs are buffered by 74LS367. The 74LS367 break often and the IO Warrior56 breaks rarely.

The testing circuit does not have redundancy, when one 74LS367 breaks the testing is stopped.

The PCB production and testing is done external. I do not want to replace modules anymore. I'm looking for a solution to make the modules more robust and virtually foolproof.

Edit: My colleague told me the maximum negative voltage rail is -17V in our product range. He's not concerned about the negative voltage rail.

Edit:
Added even more information.


texts: How to safely power on evaluation board?

texts:
I just got an Atmel XMEGA-A1 Xplained evaluation board and I'm trying to get started, but the documentation is a bit confusing to me.

Page 6 Section 4 has this warning.

  Do not power the board without having the jumper attached next to the USB connector or an ammeter mounted. Otherwise, the device may be
  damaged by power sourcing through I/O pins. The power measurement header is located next to the USB connector, as shown in Figure 3-1.

But I don't know what a jumper is. How do I safely turn this thing on?

To clarify, I see the part on the board labeled "Power Jumper" in the diagram, but I don't know what it means by "attached". It's soldered into the board, how could it not be attached? Alternatively, how would I mount an ammeter?

I spent a bit of cash on this thing and want to be sure I don't fry it before I've had a chance to write a single line of code for it.


texts: Is it more energy efficient to remove the ballast by using LED Tube?

texts:
I was research about this topic, I am not an electrical engineer student.

According to this website:

http://www.everled.com/led-tube-lights/frequently-asked-questions/#faq1428

  No, removing the ballast does not make your LED conversion consume
  less electricity. The ballast is an essential component which converts
  and regulates power delivered to a fluorescent tube. LEDs also require
  this power conversion and regulation; it can not be avoided. While it
  is true that the ballast is not 100% efficient  (nothing is), the LED
  Tube Lights which require removing the ballast have, simply put, a
  ballast inside the tube itself. As a result, those products suffer
  from the exact same inefficiencies as the existing ballast.

Do you all agree about this? How true is it? It is because I am thinking to switch from fluorescent tube to LED Tube. Want to get more information in this area.
Thanks!


texts: Avr-gcc using repeated addition instead of MULU instructions

texts:
I recently compiled some C++ code for the ATmega1284P in Atmel Studio and was analyzing the timings of some routines using my scope. To my surprise, a loop I thought I had optimized was taking longer than expected.
After taking a peek at the assembly code, I noticed that the compiler has compiled the following multiplication:
word *= 10;

into repeated addition:
add    r28, r28
adc    r29, r29
add    r18, r18
adc    r19, r19
add    r18, r18
adc    r19, r19
add    r18, r18
adc    r19, r19
add    r18, r28
adc    r19, r29

Now although I admire the optimizations in this repeated addition, there is no reason to do so when the chip has hardware multiplication instructions available, like mul.

Why is gcc behaving this way and how can I tell it to use hardware multiplication instructions? Note that I have set up the multiplication so overflow is not an issue. word is a uint16_t.


texts: Driving multiple LEDs from microcontroller pin

texts:
I have a 12 V supply and I want to connect 4 LEDs to each pin of the microcontroller.
Voltage and current of each LED is 2.5 V and 20 mA.
When the output of the microcontroller becomes high the LEDs should be OFF, and when it is low the LEDs should be ON.
Can you please solve this?


texts: Battery charging using low power density piezoelectric device

texts: I have a source of piezoelectric crystal which produce a sinusoidal output voltage of 2.5V and very low current of 1mA, I need to rectify that to store to battery as it is so small. I cannot rectify that. Any suggestions regarding how to enhance this and how to store this in a battery?


texts:
I'm looking for a FET device to use as ON/OFF switch.

I've found for example this device:
http://www.vishay.com/docs/62903/sis990dn.pdf

I need to find a device that can handle on Source-Drain up to 5V-5A and a gate where is enought 3.3v or 5v to enable it.

But I looked at this datasheet and I don't know which values I need to looking for. Can you indicate me which parameters I should look at?


texts: How to hook four strain gauges ( 5 wire) to esp32

texts:
I have four strain gauges (50kg) with 5 wires each (red, black, white, green, yellow) and want too measure weight of a platform. I assume those should be hooked to hx711 load cell amplifier and esp32 MCU if possible.

I see two problems there:

Strain gauge has recommended excitation voltage 10-15V which is not compatible to hx711 or esp32
I assume I need to hook them to Wheatstone bridge, but single strain gauge is already a Wheatstone bridge. Can't figure out what should be the wiring scheme.

I purchased strain gauges in Aliexpress


texts: Soldering problem with heavier components

texts:
I'm having difficulty soldering components with 1 mm thick or larger wires. The solder melts fine, but it does not 'stick' and just falls off. Components with smaller prongs like regular LED's are no problem. Right now I'm trying to solder some diodes to make a bridge rectifier and the solder is just not sticking.

What could be the problem? I'm using a battery-powered RadioShack soldering iron that works fine for the small stuff, and lead-free flux solder. Any tips on how to solder the heavier stuff that seems to reject solder? I've looked all over for this issue and don't seem to be able to find an answer.


texts:
I have a design with LTE CAT 4 and I wonder why two antennas are needed.  I searched around the web but am still kind of confused.  Below are my questions:

Is the second antenna used for Rx only?
Is LTE modem trying to select which antenna gives the best reception? Or the modem will combine LTE signals from two antenna?
If only main LTE antenna is used, what's the impact?

Thanks.


texts:
This is a pretty vague question so please bear with me. I can add further information if required; just let me know in the comments. So here is the problem that I want to solve.

There is a system which gives certain voltage output which is the error in a system. It is a sinusoidal wave the peak to peak value of which is my error voltage. I have to take that error voltage and then give a voltage signal to an electronically controlled attenuator which then attenuates my system and changes the error voltage. Obviously I have to minimize the attenuator voltage. But here are the problematic parts:

There is an error null point of voltage which, when given to the attenuator, will nullify the error that null point is not known. The circuit has to find out that null point and keep the attenuator voltage there.
The error null point may change change during the operation of the system due to different things. That may create some problems too.

Can someone help me design an electronic systems (maybe using op-amps?) to solve this problem?

Edit: We have a microcontroller-based system for this already. It uses the ADC of the controller and a DAC to give the voltage to the attenuator. But I just thought maybe there are simpler ways to do this.


texts: Feasibility of Design: Using a TLC555 to Oscillate Three IR LEDs at 37kHz (schematic, datasheet, and calculations included)

texts:
Thank you for reading this. This post has four sections: purpose; parts, values/models, quantities, and datasheets; schematic, calculations, and other relevant info; and questions.
Purpose

To create a circuit that can oscillate three IR LEDs at 37kHz.

Parts, Values/Models, Quantities and Datasheets

TLC555, N/A, 1, datasheet

Resistor, 1 Ohm, 4, datasheet

Resistor, 200 Ohms, 1, datasheet

Resistor, 470 Ohms, 3, datasheet

Monolithic multilayer ceramic chip capacitor, 0.1μF, 1 , datasheet (this one's off of amazon—with no explicit datasheet)

IR LEDs, N/A, 3, datasheet

NPN Transistor, 2N2222A, 1 datasheet

Schematic, Calculations, and other Relevant Info

Regarding the tolerance for the output frequency: it should be 37kHz ±2kHz
Regarding the value of C1: that was the smallest ceramic capacitor I already had in stock.
Regarding the value If I1: in a separate circuit—consisting only of a 5V supply, 1 IR LED, and 1 470-Ohm resistor—the current value was 8mA. Thus, for three parallel IR LEDs in a similar situation, total current draw should be 24mA.

Questions

Is this design expected to work (oscillating the IR LEDs at 37kHz)?
If it does work, how sensitive is this design to parasitic capacitance (I work around a lot of electronics in my office)?
Lastly, any other suggestions/ ideas?

Thank you. If anything's unclear, please let me know.
EDIT: edited 36kHz to 37kHz
EDIT: added tolerance for output frequency.


texts:
I have been trying to make a LPC4088 (user manual, datasheet) PCB for some time now and I have a dilemma concerning a JTAG. For connecting a 20-pin JTAG connector I followed the pinning table found on p. 358, 359 of technical reference manual by ARM itself:

After this I located the pins with same functionalities on LPC4088 and I planned JTAG interface like this:

And now the problem occurred. While pins JTAG_TDO, JTAG_TDI, JTAG_ TMS, JTAG_TRST, JTAG_TCK, RESET are not problematic because they are pins with a single functionality:

while pins:

P2[5] (has function TD0),
P2[4] (has function TD1),
P2[3] (has function TD2),
P2[2] (has function TD3),
P2[6] (has function TCLK)

are weird, because they have many functionalities and are by default set to be GPIO:

So how am I supposed to upload a program using JTAG if pins which have basic JTAG functionalities use different functionalities at reset? Are these pins even necessary for uploading or are they used only for debugging? In this case thing is fixable...


texts:
I have to do a instantation of several components

I suppose the code for this instantation would be something like this:

componentA: componentB port map(
output_ca => input_cb
);
componentA: componentC port map(
output_ca => input_cc
);

But I know that part of the code before is wrong, because 'ouput_ca' has 6 bits and input_cb, and input_cc has only 3 bits every one of them.
How would be written this code in a good way?
Thank you so much for your help.


texts:
So I am currently working on thevenin theorem and I come across this question.

So in the question there is a circuit consist of two batteries with same voltage but different internal resistance, a variable resistance R and a 10 ohm resister R0. And we have to find the value of resistance of R to adjust the voltage across R0 to specified values.
Sorry, but I am still trying to understand the theorem so I have little clues on solving this question. If I have to state one difficulty I noticed then I guess It would be finding the value of currents flowing through the internal resistance of the two batteries.
Any help would be greatly appreciated.


texts:
Hi I'm struggling a bit with obtaining the total resistance of this circuit, I know it's an easy one I'm just a bit confused on how  the resistors are merged using parallel and series operations, here's an image:

The overall goal is to obtain Thevenin's equivalent circuit so when obtaining \$R_{th}\$ the circuit is open between nodes A and B, and the voltage source is shorted out.

I've tried

First

Rp = R1//R3
Rs = Rp + R2
Rt = Rs//R4 = 2.29

Second

Rs1 = R1 + R2 = 9
Rs2 = R3 + R4 = 8
Rt = Rs1//Rs2 = 4.23

Any help is really appreciated.


texts: Arduino weight sensor value increasing/decreasing for no reason

texts:
I connected a weight sensor like this one to this load cell amplifier based on hx711 and I use an Arduino (Uno or nano) to get the readings. I have no other components to my circuit and it is built on a breadboard.

Everything works fine except that my readings are never perfectly stable, it's either increasing or decreasing over time. For example, over the course of 2-3 hours, the reading will go from 47.50 grams to 48.30 grams and continue increasing for at least a couple days where I end up with a 3-4 grams difference(I never actually waited enough to see where it ends). Of course, this happens even if there is absolutely no additional pressure applied to the weight sensor.

I tried connecting the sensor to a 5v voltage regulator but get the exact same result. It looks like either the resistance builds in the sensor or the voltage is increasing/decreasing in the Arduino but I can't point a finger to what generates this behavior and what to do about it.

Any ideas are welcomed as I've been struggling to find a solution to this for days now.

Precisions

I'm building an automated cat feeder which drops the required amount of food into a drawer. Once full, the drawer gets out of the feeder and the cat can eat. Once empty, the drawer gets back inside until the next feed. The problem is that it is pretty hard to predict when the cat will be finished eating if the sensor data keeps increasing by itself. Sometimes, the cat can take a few hours to eat everything. If I close the drawer and there is still food in, the tare process is underminded and after a couple of days, the amount of food being dropped is far from what it should be.


texts:
For a diode ring mixer, how should I choose the types of diodes? I've seen Schottky diodes as the primary choice. but why not PIN diodes?

What diode aspects should I consider when designing a mixer?

Thanks!


texts: Where is current sense on this 3S 40A BMS

texts:
I have recently purchased a BMS rated for 3S, 40A (still in transit). Following is pictures for this BMS:

Now, according to seller, this has over-current, over-voltage, under-voltage and short-circuit protection and 100mA balancer.
Now, After closely looking at the pictures, I couldn't find current-sense resistors on these pictures, so I am not sure how this module can provide over-current protection.
My question is:
Does the pictured BMS have a current-sensor of some kind, or does it have any kind of over-current protection?


texts:
I currently have a power supply that will be able to supply around -60 kV DC and 10 mA under the load that I will be hooking up to it. However, the internal resistance of the load will fluctuate and may not be pulling the full 10 mA at all times, thus, a means of monitoring the current flow will be needed. The tricky situation is that I will need to connect the negative power line from the power source directly to a multi meter that will measure the current. Please look to the graph below to reference the design:

simulate this circuit – Schematic created using CircuitLab

The negative side of the power source will provide the -60 kV DC, which must be manageable for the multi meter. Thus, I was curious what I could do to inexpensively allow a multi meter or ammeter to handle such high voltages and such a high power while still being able give an accurate measurement of the current.


texts: Why use JK flip flops when D flip flops are simpler?

texts:
To the best of my knowledge, We can do everything that a JK flip flip can with a D flip flop. So what is the need for the JK flip flop which has a more complex excitation table and more inputs?

I'm sure there must be some applications where D flip flops won't do, otherwise JK flip flop wouldn't have been invented. I would be grateful if you could let me know.


texts:
While learning about multiplexing 7 segments using interrupts in PIC, it was found that when this was used in real world timing applications, the frequent ISR causes a step by step cumulative delay in the main loop, which then increases further from the real world time, owing to the delay caused by the main program by ISR subroutine servicing.

I use 20 MHz crystal running PIC with timer0 for refreshing multiplexed displays but the delay caused by ISR is evident in the main loop of the program when a real-time measurement is done by a delay routine etc. Thus when 5 minutes are counted, it adds some seconds depending on the timer0 setting for ISR. Like 5 sec for 5 min and a minute or so for 1 hour etc.

Is there any way to solve this apart from using serial displays ??


texts: 3.3V TTL is dropping to 2v when connected to pin. can i use a current limiting resistor in series to maintain 3.3v. Need suggestions.


texts: Why can my oscilloscope measure all frequencies equally well?

texts:
I've got an oscilloscope that, according to the manual, looks like this (for AC):

---Cac--+-----+--------
        |     |
Uin     Cin   Rin      Udisp
        |     |
--------+-----+--------

Uin is the voltage input, Udisp is the voltage shown by the oscilloscope, Rin is the internal resistance and Cac and Cin are internal capacitances. I'm trying to find |Udisp/Uin| for different frequencies. So I rewrote this as follows with complex impedances:

Uin---1/(j*w*Cac)--+-------------- Udisp
                   |
             Rin+1/(i*w*Cac)
                   |
 0 ----------------+--------------

         <=>

Uin---1/(j*w*Cac)---Udisp-----Rin+1/(i*w*Cac)-----0

                             \_______Z1______/
     \______________Z2_______________________/

Using Ohm's law, since the currents over both impedances must be the same, I get:

Udisp / Uin = Z1 / Z2

However, this means that the measured amplitude (|Udisp/Uin|) does not depend on the frequency! I must have made a mistake somewhere, as the oscilloscope obviously can't handle all frequencies equally well. Where is the mistake?


texts: Digitally variable zener diode reference

texts:
I'm trying to use a digital signal (3.3V or 0V) to set a voltage reference for a comparator (4.7V and 6V.)
I've come up with the circuit below but it doesn't seem to be very precise and I can't seem to fine-tune the output for either 4.7V or 6V.
Is there any flaw in the design that wouldn't work in reality?
The comparator used is the MAX9038 if that helps.

Edit: I'm going to edit my question whenever I get some time, thanks for all the help so far already!
Edit2:
Below is my full circuit. This circuit is meant to measure the current, compare against ref and limit the current going through the load. It will be used for a flyback power supply I'm designing. The power supply can be upgraded by adding a module which expands its current from 3A to 6A. Without a module this circuit has to protect above 3A, with module it has to be 6A. Since im using the MAX4172 to measure the current aswell i need it to be as precise as possible. The measured current will go into an ADC to a microcontroller. I haven't exactly looked into this yet, but i think to make it as precise as possible i need to get the output of the MAX4172 as close to the supply voltage of the ADC as possible (3.3V). at the moment the R1 resistor sets the output voltage to 3.3V at 6A. So i was thinking that the only way to make this adjustable is to change the ref voltage, is my thinking here correct? If so, what would be the easiest way to make this happen (voltage divider with a MOSFET?)


texts: I have been trying to simulate a circuit on pspice. Simulation worked really well and pspice has given me the expected diagrams of gain and phase. I am having difficulty thought on how to use the measurement toolbar to find both gain margin and phase margin. Does anyone know how to fill the variables (1,2) of getting the needed values. My output is v(vout1). Thank you in advance!!!


texts:
I am looking at a magnetic pickup sensor datasheet.
This graph shows the output voltage against the surface speed.
However, there are 3 curves, that changes the output voltage range changes.
What could be the meaning of "8P", "10P" and "16P"? Are these the poles of the reluctor?
There are no other information in the datasheet except mechanical drawings.
Edit: I don't have the datasheet file right now, here is the best datasheet I found on google about this sensor... it's the same one except the graph.


texts:
Having played around with Verilog for some time now, I decided to graduate to implementing designs on Alltera CycloneIV FPGA using the Quartus suite.

Starting with a simple D flip flop, I face the first road block.

Problem Statement: The output(Q) of a D-FF is required follow the input signal (as it should be), and here goes the code:

//----------------------------------------
//module D flip flip
//-----------------------------------------

module d(q_w,q0_w,d,c);
output q_w,q0_w;
input c,d;

//wire c;
reg q,q0;
wire q_w,q0_w;
assign q_w=q;
assign q0_w=q0;

initial
   begin
       q=1'b0; q0=1'b1;
   end
always @ (posedge c)
   begin
     q<=d;
     q0<= ~d;
   end
endmodule

The input signal 'd' also transitions at the same positive edge of a common clock signal ('c' for module D-FF). This is causing the circuit to not behave properly as the transition and testing happens at same edge of clock. Also that I have read it is better to stick to one edge of clock in designs (as a good practice) and am hence abstained from using negative edge of the clock.

Having encountered the same issue when simulating I used a delay to do away with the problem

always @ (posedge c)
       begin
         #2 q=d;
         q0= ~d;
       end

Despite searching a lot I cant figure out a way to implement the functionality as required in the hardware. I tried adding buffer elements before the clock signal enters D-FF module but in vain.

PS: I haven't yet burnt any of this on the FPGA yet. My apprehensions are marked by the results of Quartus Simulation.

I have manually tweaked the input D at point to check the follow up of the circuit


texts:
I'm trying to develop a 4ma-20ma loop from an 0.97(4ma)-2.75(20ma) input.

This input comes from the output of a low pass filter of a PWM module.
I've searched the web quite thoroughly but all the circuits I come across are the typical 1V-5V with the 250 ohm resistance after the r2r op amp.

Is there any way I can implement this without using a gain stage before?

As I can't implement this with a fixed resistor as I need my resistor to somehow change from 242-137 ohm.

UPDATE1:So i figured out how to scale down the output to 0.5-2.3 this way I can use a gain stage to atleast get a 1V-4.6V Output but this way my max will be at 18ma instead of 20.Any suggestions?


texts: What are the advantages of full wave bridge rectifier with capacitors parallel to diodes?

texts:
I found a circuit where in the classical Graetz rectifier capacitors were added in parallel to each diode.

It looked something like this:

After the rectifier itself, there was the usual huge capacitor and regulator and so on.

So why the smaller capacitors near the diodes?


texts:
I was using the ISL21090 voltage reference from intersil. Intersil Link.
Now, there are quite a few DNC pins in this package which could be an issue during ESD .

Thats when I cam across a kind of similar chip and it was rad hard. Here the DNCs are connected via diodes Rad hard link. Pls check page 2 in here.

There are diode protection for the Vdd,pins and DNC -

How can this be explained ?
For eg - for the DNC pin, having these diodes, how will it help ?Its a bit confusing.


texts: Need some help designing a mains frequency converter (220v/50hz input, 220v/60hz output) for <$200USD

texts:
My main limitations here are with the amount of power needed, and of course the price.  What I'm trying to do is to run a clothing dryer from the USA in another country, without burning out the drum motor again. As I have to replace the motor already, I could either build/buy a frequency converter, or try to find a motor rated for 50hz instead (assuming the dryer doesn't use a transformer, otherwise I might be able to replace that instead...?) The odd thing is that both the manufacturer's website AND the label on the dryer itself list "220v 50/60hz," though the drum motor died prematurely. There's also no warranty since the dryer was exported.

Costs:
~$300USD (motor - required as current one died)
~$1,000USD (the "cheapest" new dryer, if buying locally)
~$3,000USD (cheapest frequency converter I could find >7kVa)

Specifics:
Power desired : 220v, 15a, 60hz.
Mains power: 220v, 15a, 50hz.

While I can readily find devices that convert both voltage AND frequency for a decent price, I'm not finding anything that converts JUST frequency for less than $3,000 USD; at least, none that are designed for ~7.5kVa and run on 220v.  Hence my interest in building one.

While I have had no formal schooling specifically in electronics or electrical engineering, I am quite experienced thanks to the vast amount of electrical repairs I do in my work. I can read diagrams, write my own while examining/tracing circuits, and I am comfortable with PCB's and related soldering.

I'm asking this here, because I honestly have no idea where a better place to ask would be. It's unfortunately not a super-specific question, though it IS an electrical/electronic engineering conundrum.

-UPDATE-
After removing the dead motor, I have additional information. The label on the dead motor states: 1/3hp 120v/60hz/6.1A. so even though the dryer sticker specifically shows 50/60, the actual motor isn't "both."   I'm now looking for a 50hz version of the OEM motor, though progress is slow.... Thankfully, the motor turns both the drum AND the blower, which means no other moving part will be impacted by the frequency change.   If anyone has a "trusted" and knowledgeable source (other than Grainger, whom I'm about to contact) for such things, I'll gladly listen (or read...?).


texts: Does an MSP430 (Specifically the LaunchPad F5529) retain its code which was transferred via the Spy-Bi-Wire (SBW) Port? Or do I need to use the BSL to program the chip? In layman's terms what is the difference between the two, and why would I need one over the other? Thanks!


texts: Hi, I'm using an emitter follower op-amp buffer with LM6132 and PN2222A. I'm expecting almost an exact follow?, as simulated with multisim. However, I'm getting an output offset of around 50mV at zero input. Reading LM6132 I should be able to swing to 0 with +/-5v supply. I'm wondering if it's an op amp input offset problem, I'll be testing this when I have access to an oscilloscope. Also, I'm using a DC-DC converter for my two rails, specifically 102-3333-1-ND, and I have yet to add input/output capacitors to the converter.


texts: how to detect race condition in a sequential circuit?

texts:
lets say we are given a sequential circuit ( e.g. a conventional D latch )
how should i go about detecting if it has a race condition or not ?


texts: How to find number of poles from the unit sample response?

texts: Below I'm attaching a snapshot of a problem and its solution. I do not get how they figured out system functional \$\dfrac{Y}{X}\$ from the given table. I'd really appreciate if you please help me understand this...


texts: Do DDR2 chips and controllers have on-die termination?

texts:
I am going to try to interface a low-speed 8-bit DDR2 chip with an FPGA, and I've got some questions crucial to make it work:

Is that correct that there is on-die termination on both DDR2 memory and controllers (an Altera Cyclone 3 FPGA in my case), so no additional termination resistors are required?


texts: Compact Voltage Controlled Current Source Array - PCB

texts:
This is a follow-up from a previous topic: Compact Voltage-Controlled Current Source Array.
What I asked originally was some proposal for a current source array controlled by a multiple channel DAC schematic. The main application is an optical phased-array antenna, constituted by resistor elements.
The requirement was to have at least a 16-channel board (but up to 64) with each current source channel should provide up to 50 mA. I ended up doing a modified version of the design in this Texas Instrument application note and now I'm drawing the PCB.
Each channel is a double stage amplifier in a current-mirror fashion scheme.
In this modified version I replaced the DAC with a 16-channel one and doubled the components count.
After some discussion with few colleagues, I decided, as a first prototype, to make an Arduino shield for the Arduino UNO board (to save some time in design) that can be stacked up to 4 boards (in order to have 4x16 channels). Since I do not have much experience in PCB design, I would kindly ask you few problems to address:

Power supply for the DAC and the op-amps: do you think that the +5 V from the USB port of the Arduino board is able to power up also the 4 nanoDACs and the 64 dual op-amps? According to specs, the +5V pin should not exceed 0.5 A, but I think we are very far from that. If not, could you suggest a different power scheme? Should I use a voltage regulator on each board?
Power supply for the current mirror: since each board might sink up to 0.8 A, I don't think I can use any Arduino board pin to deliver this power supply. What is the best way to power up all boards with one connector?
Voltage reference: at the moment, the DACs rely on the internal reference and it should be accurate enough. What if in the future I wish I could provide an external reference to minimize noise? It has to be directly on the board or could it be provided from a pin?

EDIT
Details on the PCB:
The schematic for 2 channels is shown below.

The board schematic has 8 replicas of this schematic.

The DAC is this IC.
The PCB layout closely resemble the one described in page 5 of the TI app note, with the differences being the double count of channels, the west connector and the Arduino-compatible pins.
The output west connector will be 2x8 ribbon connector lateral socket with 2.54mm pitch. This will be used for connection on another PCB having the chip to be tested (or for the multiprobe test equipment).
The main goal of the board is the generation of periodic current ramps (sawtooth waveform), with each ramp having a different slope. The load of each channel is constituted by a 100 ohm resistor, but some chip have 600 ohm load resistors.
Noise will limit the accuracy of the system, but for the time being, we don't know if noise on the Vref will be the limiting factor. The laser RIN, supplying the chip, might be a bigger source of noise. Nevertheless, the less noise the better.


texts: How to determine if the feedback is positive or negative in this circuit?

texts: Is the feedback in this circuit positive or negative? How can I know?


texts: What will be the effect of adding a 10k load resistor to this circuit?

texts:
Background

When ignoring the 10k Resistor:

When Vsupply = 28V, I have worked out that the current through ZD1 = 4.95mA.
When Vsupply = 14V, I have worked out that the current through ZD1 = 4.9mA.

Question

     When the 10k resistor is included:
     How will things change if the current in R4 which is a 10k resistor is included.

     I am trying to figure out the current variations in ZD1. Therefore, i want to know if:

     1 : There will be no current variations through ZD1.

     2 : The current variations through ZD1 will be bigger.

     3 : The current variations through ZD1 will be smaller.

My Answer

I think that the current variations will be smaller cause the 10k resistor will take away some of the stress that the diode ZD1 is taking. Please let me know if this is correct and if it isn't please help me understand why, Thank you.


texts:
I built a speed detector (of a rotating wheel) based on PIC32. For now I'm sending the speed to the PC through UART, but I'd like to be sending it through Bluetooth as a HID device because I'd like to use OS' drivers.

I've been googling for quite some time now and I've learnt a few things about Bluetooth and HID. So I will probably buy Microchip's RN42 (formerly Roving Networks) which supports HID profile. However I'd still need some advice, I do know it can be done (example), but I just don't know how to go about it.
For example how would I create my own descriptor to send to host? Or do I use an existing one? A descriptor has to be sent when connecting HID device to host, right?

I also read something about raw mode. Is HID in raw mode what I'm looking for?


texts:
I am a newbie to the hot air gun.
I need to shrink a tube using a hot air gun without have to worry things inside the tube melting.
What is the best distance between my shrink tube & the nozzle?
Can I have recommendation of a air gun where the temperature will remain stable regardless the position of the item to the nozzle?


texts:
I used the following circuit to dim power LEDs with Arduino:

I used TIP120 or IFR610 as Q1 instead of IRF510 and I found that if I use IRF610 the current is much more lower than expected. In case of TIP120 it is better. Still it is lower. So I have to decrease R1. To get 700 mA I have to use 1 ohm instead of 1.8 ohm. Why it is happen?  Moreover I get such current I have to apply about 20V to feed the series of LEDs with total voltage drop about 12V so LM317T become very hot. Can I improve the circuit? I would like to use actually LM317M to make Arduino shield which could dim about 10 power LEDs independently. Is it possible with such high heat leaking?


texts:
Is it possible to convert a 2 wires current loop to RS232, and from RS232 to current loop,
I am trying to put an RS232 sniffer in the middle so I can see what they are communicating to each other.

I measured the current, and it looks fluctuating between 44.0mA and 44.9mA

Thanks


texts: Why does this SEPIC buck-boost oscillate so much?

texts:
I've made this SEPIC regulator based on this design, using a MT3608 boost regulator, which has the same oscillation (ripple) as this question:

I've made these changes:

C1=100uF, C2=470uF
R2(bottom one which is 2K here) is changed to 1K
R2(top one which is 9.1K here) is changed to a 50K pot to give it a variable output
C5 is 2x10uF, 0805 caps in parallel
input is 5V from a USB wall charger

It oscillates too much. I tried to capture the waveform. I set the output to about 14 volts and used a 1K-3.3K resistor divider to bring it under 5V for my o'scope. The divider is considered a light load of 4.3KOhms then. Here is the waveform:

I marked one cycle which shows a frequency of about 15Hz ripple. The divider lines are 0.5V/div so the voltage shown is ~3.5V which ripples between 3V and 4V; multiplying the ripple by 4.3 (resistor divider) gives almost 4V ripple. (1V ignoring the brief spikes).
After connecting a 100 ohm resistor (the divider still exist for the sake of measuring,) the waveform changes as follows (notice the first half and the second half of waveform in the shown image):

Despite my PCB being worst case, in case of switching regulator designs, why is this ripple so high? Is there any theoretic problem with the regulator or design (e.g. the 0.6V Vref or 1.2MHz switching frequency)?
The PCB (red is top, blue is bottom and both planes are GND):

UPDATE:
I changed the parallel 2x10uF caps back to a single 4.7uF. it got a lot more stable and now my multimeter, can show a precise voltage without much ripple under both 4K ohm and 100 ohm load. here is the waveform:

the periodic noise seems to be from input. as I measured the input from my Wall charger it shows the periodic 100Hz noise. (also, my low-end USB oscilloscope has an 8 bit, ±10V ADC inside, so maybe this tiny ripple is lower than what it seems on the waveform):


texts: To connect Active GPS Antenna wires on PCBA should Solder or use Connector

texts:
Will it make a difference if I solder or use the supplied SMA type connector to connect the wires of Active GPS antenna on PCBA?

I am using gps antenna of this type.


texts:
I have STM32(F103VBT6) and trying to use RTC with battery to keep correct time, but after removing power from DC supply supercap ( Seiko ) loses power almost instantly.

How should going to battery be handled so I can keep correct time after getting power supply.

Diode: https://www.onsemi.com/pub/Collateral/MBR120VLSFT1-D.PDF

STM32: https://www.st.com/resource/en/datasheet/stm32f103vb.pdf

Tnx for helping!


texts: Low pass LC filter goes "wrong" with capacitive load

texts:
I have been experimenting with this circuit:

simulate this circuit – Schematic created using CircuitLab

Vin has a lower frequency ripple of 2V and a high frequency (switching?) noise of 6.5V. At V1, lower frequency ripple is about 200mVpp and the high frequency noise is 4.2Vpp. On Vout, the high frequency noise is the same, 4.2Vpp. But if I remove C4 then the high frequency noise at Vout decreases to 1.3Vpp.

I don't understand why? How it that possible?

Low frequency is ~100Hz

high frequency is 25Khz

this is when I remove C4:

and this is when I add it:

UPDATE: after replacing the power supply of the buck converter with a battery:


texts: How to simulate the CNY70 IR reflectometer with TINA or LTSpice

texts:
How can I model the CNY70 IR reflectometer from Vishay (click here for datasheet) using TINA or LTSpice.
In particular, I would like to simulate the circuit shown below:

The 4pins on the left side connect to the CNY70. The circuit amplifies the signal from the  CNY70 transistor. It is just a reference circuit that should work out of the box.
EDIT: I have simulated the circuit using TINA:

I have modeled the CNY70 as resistor with values between 0 and 100k and got the following voltage for the output signal:

Despite the resistance of the CNY70 changes, I get no chance in the amplification. More realistically, the transistor is modelled as current source (probably) but I thought a simple resistor could also do.


texts: Breakwire alarm (squib) utilising a transformer

texts:
Following my yesterday post which was a break wire alarm based on logic gates to drive a siren for the protection of a camp site, I have decided to work on a second concept that uses completely different circuit based on a simple transformer design. Considering that the main uninvited visitors of the camp site are stray dogs and wild boars, I've decided to use squib (firecracker) as the main load simply because I've found it extremely more effective than siren, which doesn't seem to scare them anymore.

In the following circuit the primary of T1 is energised upon closure of switch 1. The role of R2 is to limit the current coming from a 9v battery. When the wire is broken by animals, the sudden collapse of primary will induce a transient in secondary, which in turn, heats up the extremely thin nichrome wire (0.02mm) of the squib. The switch 2 is a safety measure which is closed at first to bypass any transient when the circuit is powered up first and then it's opened by the operator.
My question is regarding the transformer itself, what type of transformer would work best? My assumption is step down type with a very high number of thin wire turns at primary and a secondary with thicker and fewer turns to provide sufficient current for the squib. Please share your suggestions.


texts: can I use neutral in an AC circuit as the negative conductor on a separate DC circuit

texts:
I have a particular application, but I also generally want to know the answer.
I have an aluminium sail boat that has a extensive DC electrical system, as well as a 500watt inverter for a basic AC system.  The neutral is tied to the ground, and the ground is tied to the battery bank's negative pole. This is standard practice. FYI: The boat has a "floating ground" so the negative pole does not touch the hull.
I have a 4 core 2.5mm cable running from one side of the boat to the other, which sound simple but to keep it a clean run and hidden it is buried in, under and around all kinds of things and I never want to run another cable to that place on the boat again.
At the end of the 4 core cable I want to run a small AC bar fridge, but it is a small space so i also want to hook up one or more DC fans on a temperature controlled relay to help move hot air away from the back of the fridge.  I'm sure there are lots of ways to do this but it would be very clean to just use that 4 core cable to carry the line, neutral, earth, DC+ and share the earth or neutral for the DC negative.
thanks


texts: How to stop undefined behaviour on power loss in arduino

texts:
I am working on a simple Arduino project which counts rotation using rotary encoder. After some calculation, I store this data to EEPROM.
I have used Arduino nano.
rudimentary block circuit diagram of the project is as below.

entire system is working completely fine when power supply is on. But when power supply is disconnected, Arduino is detecting some random pulse on rotary encoder sensor pins and modifies count and stores into EEPROM.
I have very little knowledge on circuit design. But i am suspecting, this undefined behavior is because of the 1000uF capacitor.
Please suggest me a circuit design to eliminate this undefined behavior.
Thank you.


texts: How do you implement this when else statement in VHDL?

texts:
I have the following example from an answer on a previous post on Stackexchange Electrical Engineering:

show_out   <= show  when player = '0' else '0';
set_out    <= set   when player = '0' else '0';
input_out  <= input when player = '0' else "00000000";
-- etc.

show_out2  <= show  when player = '1' else '0';
set_out2   <= set   when player = '1' else '0';
input_out2 <= input when player = '1' else "00000000";
-- etc.

I want to insert it in a process like the one below:

architecture Behavioral of twoplayermux1 is
begin
    process (show,set,input,try,player)
    begin

-- INSERT THE LINES OF WHEN ELSE ASSIGNMENTS HERE...

    end process twoplayermux1;
end Behavioral;

How does the syntax looks like for that?


texts: How to handle Register output in state machine with verilog

texts:
Assuming I wan't to implement a state machine in verilog, where I have 1 output which is a register
So the output must be in sync with the input clock.
I know that the transitions between the machine states should be implemented via sequential block, for example:

always @ (posedge clock)
  if (state)
      state <= 1'b0;
  else
      state <= 1'b1;

If I want the output to be in sync with the clock, will implementing the output result via combinatorial will do? I mean:

always @ (state)
  if (state)
      Out_Reg = a;
  else
      Out_Reg = b;

Does this implementation still valid for Out_Reg to be a positive edge triggered register?

Or should I make assignment to Out_Reg in the sequential block for it to be a valid synced output register?


texts: Combine 2 circuits to get the best of both? Battery management system

texts:
I'm working on a battery management system for 2 12V batteries in series, totalling 24V, and I found this very good blog online with 2 circuits that got me very interested:

This one, that got me for it's simplicity and apparent ease of use by just including a relay.

And this one that got me for its use of an LED driver to indicate battery status.

The thing here is, I would like to maintain the simplicity of the first but include the LED driver, my doubt arises because I don't know if I can just get the LED driver part from the second and put it on the first, where to put it, and how to put it there. If you guys could give me a hand on this, it would be really great.

Also, I want your opinion on something. I can't get enough current from the batteries I'm using to supply the load (a 24V DC motor), it needs around 2A and the batteries are only supplying around 1A, making the motor terribly slow and way less effective. It doesn't need to run for more than say 15 seconds, ever, so what I though of was a Super capacitor bank that gets me 27,5V max charge and 1,6F capacitance, and with this, I know I could supply enough current for to motor to run, or at least start off (the 2A stabilize on around 1,3A after it's initial peak). The thing is, I don't know how to calculate for how long it can supply this current, since capacitor's voltage will drop when it is supplying the needed current, making the power vs time graph not linear, instead, a curve.

You might ask, why not just change the batteries? Well, I could do that, but I would need a bulkier battery, which doesn't interest me for this project. Also, I can easily get the batteries I'm using, while all other options, I would have to find a supplier...

What do you guys think of this? Is it stupid to try to use super capacitors is these conditions? Do you think it will not be cost effective? I got a nice deal off of ebay and they are already on it's way here, If not for this project, for something else, because I've been wanting to "play around" with super capacitors for a while now :p

EDIT: The batteries are 2 small sealed lead acid 12V 1.3Ah, i want to keep the system small, that's why i thought of supercaps.

Thank you in advance,


texts: Unable to use push button reset in IGLOO Nano FPGA

texts:
I have designed a FSM in verilog and I'm trying to realize it in IGLOO nano FPGA (shown in the Fig1. below).

The interface verilog code of the FSM is given below:
module FPGA_FSM (
input clk,
input clk_Tx,
input en_Tx,
output en_Tx_osc,
output data_o,
output SoT
);

"en_Tx" is the reset signal. I would like to assign it to one of the push button switches on the FPGA board, but I'm unable to do so.
According to the data sheet Pin number 20,21,22,23 corresponds to push button switches so I'm using following constraint file in LiberSoC V11.9 (shown in Fig.2).
Can anyone please let me know how to use these push button switches?


texts: Does an ALU always do add and sub, but only returns one of the results?

texts:
Pretty simple question. Does an ALU internally always do multiple operations like add, sub, div, mul, ... and you simply have to specify which result you want to return? I was told that it does that, but I wasn't able to find proof of that being correct. Though I found some graphics containing a multiplexer which from my understanding has basically one output and multiple inputs and by setting some special inputs you can pipe on input to the output. So that might be it, but I don't know enough about that to fully understand it.

I'm specifically wondering about the 8085 architecture's ALU in case it is special, but I'd also like to know about other ALUs if there are different ones.