texts:
Hello there i am using dsPIC30F4013 and i have been trying to interface uart with pic. I want to send some data to PC via uart and display it on terminal, but what i get is far from what i expect, to be exact i get nonsense. I use FTD232RL USB Serial Converter module to connect MCU with PC. I thought at first it could be baud rate difference but i double checked and even tried different baud rates but result is the same. I posted my code below. What could be a problem and how to fix it? Thanks in advance.

#include <xc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <p30fxxxx.h>
#include "uart.h"

_FOSC(CSW_FSCM_OFF & XT_PLL4);
_FWDT(WDT_OFF);
_FBORPOR(MCLR_DIS);

#define period 7372

unsigned int counter;

void initTMR1(void)
{
 TMR1 = 0;
 PR1 = period;
 IFS0bits.T1IF = 0;
 IEC0bits.T1IE = 1;
 T1CONbits.TON = 1;
}

void delay_ms(unsigned int time)
{
 counter = 0;
 while (counter < time);
}

void initUART()
{
 U1BRG = 0x0040; //baud rate 9600
 U1MODEbits.ALTIO = 1;
 IEC0bits.U1RXIE = 1;
 U1STA &= 0xfffc;
 U1MODEbits.UARTEN = 1;
 U1STAbits.UTXEN = 1;
}

void writeUART(unsigned int data)
{
 while(U1STAbits.TRMT == 0);
 if(U1MODEbits.PDSEL == 3)
     U1TXREG = data;
 else
     U1TXREG = data & 0xFF;
}

void RS232_putst(register const char *str)
{
  while((*str)!=0)
  {
    WriteUART(*str);
    str++;
  }
 }

void __attribute__((interrupt, no_auto_psv)) _T1Interrupt(void)
{
 TMR1 = 0;
 counter++;
 IFS0bits.T1IF = 0;
}

int main(void)
{
 ADPCFGbits.PCFG9 = 1;
 TRISBbits.TRISB9 = 0;
 LATBbits.LATB9 = 0;

 initUART();
 initTMR1();

 RS232_putst("START");
 delay_ms(2000);

 while(1)
 {
     RS232_putst(00000);
     RS232_putst("This is test!!");
     LATBbits.LATB9 = ~LATBbits.LATB9;

     delay_ms(1000);
 }
 return 0;
}


texts: Problem when using MSP430G2553 without Launchpad

texts:
I am trying to build a capacitive touchless sensor with an MSP430G2553 to control a small DC motor. When the chip is on the Launchpad, everything goes well. The sensor works, it sends a signal to the MOSFET and it activates the motor (and deactivates it after 1 second as it supposed to). However, I don't want to use the chip on the Launchpad (I want to operate it on a breadboard first then a PCB later when things work).

I found a way to connect the chip on the breadboard. It seems to work well except the the motor won't turn off once it starts spinning for the first time(it spins non-stop until I remove the power). When I use a LED instead of the motor, it works fine. It detects proximity, activates the transistor and the LED for 1 second then it turns off.

On the breadboard, the chip is connected to the source (batteries) and the reset is linked to the positive supply rail with a resistor.

So, I don't know why this problem appears only when the chip is not on the Launchpad. Do you have any idea why this happens? Are there any components that are missing? I tried many different way to fix the problem. What bothers me is that it works perfectly fine when the chip is on the Launchpad. It also works on the breadboard if I use a LED instead of a motor.

Thanks a lot for your help


texts: Discrete negative voltage regulator oscillating under load

texts:
I'm trying to save a few volts voltage drop and use a discrete voltage regulator, having a feedback doesn't really matter because the current draw is very low.
In the diagram below,  if I remove C2 then under load the output starts to oscillate at ~50 Hz and to around 100 Hz at higher currents.

simulate this circuit – Schematic created using CircuitLab
It's not related to the gain of transistor. I tried a TIP127 which is a Darlington with minimum gain of 1000.
Why is the output oscillating under load without C2?


texts: where to solder antenna on 433 MHz remote control

texts:
I would like to install this remote into a carbon component, which apparently shields all rf signals.

So, I need to solder an external antenna to this remote control pcb, but I could not figure out where to. it is a standard cheap remote, you can find on aliexpress with the a022 name.


texts: Why 3v3 should be connected to the center point of Ethernet termination?

texts:
I am designing an 10/100 Ethernet on my board and I can't understand why 3.3V should be connected to the center point of the termination.

The schematic checklist recommends it actually and I checked several design and datasheets even gigabit ones and somewhere it is used somewhere it doesn't. As I see it is not necessary because the centerpoint of the transformer is on 3.3V which can be pulled down by the ethernet chip in case of signalling (transmission) and it would require less current without it.
I will do this in the recommended way but I don't understand why which I hate very much. :)

On the other hand the receiver side would not require 3.3V at all right? (if I wouldn't use Auto-MDIX I mean)

Schematic checklist

Datasheet

I have found an interesting article in the topic from 2004. Unfortunately it doesn't explain this directly but provides and overview about line drivers of gigabit ethernet. (I think it is similar in 10/100 and this is a current-mode driver)

There is an image at the end of the article which actually shows this connection with dashed line but as I read it doesn't explain this.

Voltage-mode line drivers save on power


texts: How are electronic musical greeting cards made?

texts:
I remember that long time ago, when I was a kid (in the 80s) there was some electronic greeting cards that when open up, start playing simple tunes through a small piezo-electric speaker.

A quick look at the board reveal a small black chip and some circuits under:

I'd like to know how is the small black chip implemented? (There is never any information or label written on it.)

Is the chip made using same technology as modern microprocessors (CMOS technology, but with a very large nm process since size here is not an issue?)

I'm also puzzled by the fact there is no crystal oscillator or capacitor on the board, which might have been useful for generating the square waves for the speaker.


texts: Why does Ohm's law not work for vacuum cleaners?

texts:
I have been learning about Ohm's law and testing the resistance across the plug of my household appliances and calculating the current.

For example, my kettle was 22 ohms (10.45 amperes) and is protected by a 13 A fuse.

This makes sense, and I'm okay with it, but then I tested the vacuum cleaner which had a resistance of 7.7 ohms which equates to 29.8 amperes which surely should blow the 13 A fuse, but it doesn't. I have now tested two different vacuum cleaners which have the same small resistance reading across the live and neutral.

Surely this would be a direct short, but it works fine so does the resistance change or what?


texts: Analog Multiplier with MOSFET - Implementation not working

texts:
simulate this circuit – Schematic created using CircuitLab

I am using the above circuit to multiply BAT1 and V2, the circuit analysis tells me the output voltage Vm1 should be BAT1xV2x2xKxR1 This works by keeping the transistors in the triode region thus the gate voltage controls the resistance between V2 and ground. My problem is that the circuit implementation doesn't seem to multiply correctly both inputs.

The LM741 are connected to +15 and -15 accordingly.

I would like to know what is wrong with the circuit, if you can, please help.


texts: Can a CD74HCT4094E shift register output 20mA?

texts:
I want to drive IV-9 numitron tubes with a shift register. These have 8 segments which each need about 4V/20mA DC to light up.

I’m considering to use the CD74HCT4094E shift register, but am unsure if I interpret the specifications correctly. In the data sheet, it says:

Does this mean all 10 outputs can output 20mA each, simultaneously? Or does it mean something completely different?
In all other tables in the data sheet, typical currents mentioned only go up to 4mA.


texts: Compare resistance to a setpoint and trigger a relay

texts:
I want to compare a PTC thermistor to a set point, and trigger a relay if the temperature  goes below a set temperature.

In particular, my temperature to turn on the relay should be 33 degrees F (845 ohms) and turn off at 36 degrees F (860 ohms).

I could easily do this with a microcontroller, but this seems like just too simple of a project to waste one on.

How can I accomplish this with basic electronic components?


texts:
My research group wants to investigate how powder delivery network (PDN) noise (such as ground bounce) can affect the retention time of DRAM cells. The idea is that the power noise increases the leakage from the bit capacitor and causes it to require a higher refresh rate (or suffer from bit errors).

The problem is that the only transistor models I can find are for bulk CMOS which are too leaky for DRAM. According to Jacob et al. [1] (Section 8.2.1) the leakage through a DRAM transistor should be on the order of 1 fA, but the bulk CMOS models have leakage on the order of 1 pA (three orders of magnitude too high). Can anyone point me to any reasonable DRAM transistor model for this work? I've been looking for days with no results.

[1] Jacob, Bruce, Spencer Ng, and David Wang. Memory systems: cache, DRAM, disk. p. 356, Morgan Kaufmann, 2010.


texts: Is it possible for the Kalman gain to become 1 or 0

texts: Is it possible for the Kalman gain to ever become exactly 0 or 1? Because as far as I understand, if that would happen (no matter if it were 0 or 1) the Kalman gain would stay 0 in all the following cycles?


texts: What are the practical differences between AC and DC transmission?

texts:
I have a long (2m) but thick wire between transformer-based power supply and low frequency power amplifier. Know your best advice ahead, but no, I cant get rid of it.

I can put it in two configurations:

What should I choose and why?

Looking at some transformer-based PSU's like for mixer equipement I can see a long wire with AC, plus a bridge right in a mixer, but not in the PSU. But looking at SMPS especially for notebooks - they are mostly shielded cables, but runs DC - shottky bridges are close to transformer.


texts: Magnetizing Inductance Vs. Mutual Inductance

texts:
1.) In the transformer equivalent circuit model, is the Magnetizing Reactance/Inductance the same as the transformers Mutual Reactance/Inductance?

2.) Does the secondary have a magnetizing reactance? and is this the same thing as the primary magnetizing reactance, or are they lumped into one quantity called Xm?


texts:
I have to send data using the usart2 in my nucleo64 stm32f446re board.
The type of data I have to send is float but until now I always send uint8_t using this code;
   char msg[1];

   for(int i = 0 ; i < Nbit*Sb ; i++)
   {
       sprintf(msg, "%d ", sigTX[i]);
       HAL_UART_Transmit(&huart2, (uint8_t *)msg, strlen(msg), HAL_MAX_DELAY);
   }

Because sigTX is a pointer to float data in an array, I try to change the code using msg[4], in order to have 32 bit, and in HAL_UART_transmit I put (int32 *)msg, in order to send data with sign.
This doesn't work, so can someone say to me where is the mistake?
Sorry, but I'm new in embedded world.


texts: Circuit with transistor - current in open state

texts: I am trying to understand how transistor works. Here is my example from electric circuit simulator (multisim). I cannot understand why PR4 (ampere meter) shows 113.42 nA current when circuit is open. Also I am confused about sign of current in PR5 (ampere meter). It shows -11.343 uA. Why is the sign negative. I am guessing the magnitude of current is so low because of transistor resistance., but why is negative is unclear.


texts:
I'm trying to separately switch on the digits of a 2 digit common anode 7 segment display (specifically the Lumex LDD-E2802RD because it's small and cheap).  I think that the easiest way of getting my microcontroller (an MSP430G2335) to do this is by connecting A-G,DP through resistors \$R(4+i), 0\le i\le 7\$.  A shift register will switch on transistors \$Q(3+i)\$ (incorrectly labeled \$Q(4+i)\$) to turn on individual segments (assuming they're being powered "from above") (figures below).

In order to turn on the individual digits, it seems like a PNP is the way to go.  The problem is that I want to supply my LEDs with 6.3V, which is my circuit's \$V_{CC}\$, because my 3.3V line can't supply a lot of current.

Let's start with what (I think) I know: each segment of the display draws 25mA steady state, with a peak of 150mA for 10us, and has a forward voltage drop of about 2.2V.  This means my LED resistors should be
$$R_\text{LED} = \frac{V_\text{LED}}{I_\text{LED}} = \frac{V_{CC}-V_f}{I_\text{LED}} = \frac{6.3\text{V}-2.2\text{V}}{25\text{mA}} = 164\Omega \approx 180\Omega$$
and the transistors on the shift register output should be able to handle at least 25mA (ideally more just to be safe -- I'll probably end up using an 8 element Darlington array).

Now for the part where I'd like to make sure I'm not making a mistake.  I used http://www.rason.org/Projects/transwit/transwit.htm as a guide for how to use the PNP, as I've really only used NPN and N-channel devices in past designs.  The PNP, \$Q2\$, will need handle at least \$8\cdot25\text{mA}=200\text{mA}\$ of current flowing through it (plus a little extra just to be safe), so a BC807 seems like an appropriate choice.  To calculate \$R2\$,
$$I_B = \frac{I_C}{h_{FE}} = \frac{200\text{mA}}{60} = 3.3\text{mA}$$
so
$$R_2=\frac{V_{CC}-V_{BE}}{I_B} = \frac{6.3\text{V}-1.2\text{V}}{3.3\text{mA}} = 1242 \approx 1.2\text{k}$$
The aforementioned PNP guide suggested that \$R3 \approx 10\cdot R2\$, so \$R3=12\text{k}\$.

Because my microcontroller's logic high is 3.3V and it can sink/source a maximum of 6mA on each GPIO pin, it seems like a good idea to use an NPN (Darlington) transistor to turn on and off \$Q2\$.  (Maybe 3.3V would be enough to turn off \$Q2\$ and 3.3mA isn't all that much current, but transistors are incredibly cheap in terms of actual cost and PCB real estate.)  It appears that \$I_{C_{Q1}} = I_{B_{Q2}}\$, so to calculate \$I_{B_{Q1}}\$ (hereafter \$I_B\$), I perform similar calculations, this time using values from the BCV27 datasheet.
$$I_B = \frac{I_C}{h_{FE}} \approx \frac{4\text{mA}}{4000} = 1\mu\text{A}$$
and
$$R_1 = \frac{V_{CC}-V_{BE}}{I_B} = \frac{6.3\text{V}-1.5\text{V}}{1\mu\text{A}} = 3.8M \approx 3.9M$$
although I'm guessing that since \$I_B\$ is so low, \$R_1\$ isn't really necessary, although if I wanted to include it, something easier to find like a 1M resistor would do.

So that's about it, right?  It just seems a little weird to me that I need to switch on the PNP with the NPN, and I wanted to make sure I'm doing this the right way.

Lumex LDD-E2802RD

Imagined circuit setup


texts:
I've found this schematic of a LC sine wave producing circuit online, and I was trying to figure out how it works (particuarly the feedback cycle).

Can someone tell me if this is right? I think I've figured it out to a point, but I'm not completly sure. Alot of the details on these circuits are quite fuzzy and dont really explain much. (When describing points on the schematic, I will use terms like "the top of the C1" to describe the part of the capacitor that appears closest to the top of your screen).

1: L1 begins to build a field, and as the current through L1 and Q2's gate rise, Q2 begins to open up and produces the beginning of a sine wave with a positive slope. At the same time, C1 is charging as well.

2: L1 begins to become saturated and the current remains constant, Q2 is almost completely open. The sine wave has just about reached its crest. C1 is near the end of charging and therefore Q1 begins to open up.

This is where I can't figure anything else out. How does the capacitor and inductor actually oscillate to produce this sine wave? It somewhat makes sense, but I cannot grasp the full concept when I try to fully analize the circuitry. Any help is appreciated. Thanks.


texts: How do I calculate the current in this circuit using Laplace transforms, with a time shift?

texts: In this exercise I have to calculate i(t) and the switch occurs when t=0.01 s, I tried doing it using Laplace but I always get the wrong answer. I did an exercise that is exactly like this one except the switch occurs when t=0 s and I got the correct answer, but I can't seem to be able to solve with this time shift. I know that the initial condition for the voltage in the capacitor is V1(0.01). I solved the exercise exactly the same way but with a different initial condition and got the wrong answer.


texts: I have a very simple question regarding parallel RLC networks (or any similar circuit). When given a problem where the reference voltages and current directions are allocated 'strangely', is my intuition correct to make all voltage references positive on one side (top) and the current directions consistent (down)? No equations or dependencies are given.


texts: Is it OK to use resistors with lower Ohm ratings if I decrease the input voltage?

texts:
I have been looking at this tutorial from Digikey on a LDR-based night light using a PNP transistor. The schematic for this (based on Digikey's) is below:

simulate this circuit – Schematic created using CircuitLab

Some of thee things I've noticed are ...

The voltage source is at 9V
The LED used is a VAOL-5701WY4 (wich I don't have), not a C503D-WAN-CCBEB151 (which I do have)
The values of R2 and R3 are  220K Ohms and 5.6K Ohms, respectively. These seem quite high.

My questions are these:

If I replace the VAOL-5701WY4 with a C503D-WAN-CCBEB151, can I use a 3V source (not followed by a joule thief) and reduce the Ohm values of the resistors?
If 1 holds true, how do I work out the values for the resistors (other than using pots)?


texts: How to determine if a load cell is quarter-bridge, half-bridge or full-bridge?

texts:
Im looking to purchase 4 disk type load cells for weighing applications but it doesn't mention what configuration it is in (quarter bridge, half bridge etc.) Is it safe to assume 2 wire load cells = quarter bridge (1-resistive element), 3 wire load cells = half bridge (2 resistive elements) and 4 wire load cells = full-bridge (4 resistive elements)?
Datasheet:
Part1
Part2
Also if it is a full bridge can I just wire all 4 cell's Sig+ and Sig- in parallel into 1 HX711 module to average out the readings? Most of the discussions out there keep mentioning requiring 4 separate HX711's or a combinator board but I think thats to take individual readings of each sensor separately?
Id appreciate some guidance. Thank you.


texts: Logging measurements from an analog Gas Meter

texts:
I want to capture a gasmeter counter to log the gas consumption in my database.
Problem: till now I did not find a way to read the meter.
I tried a sensitive hall sensor that could react on the magnetic fiels of the counter without succes. There is no reflecting part on the counter that could be detected with a IR sensor.
Replacing the meter is too expensive.

So what are the options?
The meter makes some noise. There is a regular 'click' in it. Could it be possible to detect the noise with a little microphone and react on the click? How should I build a circuit for such issue?
Or is there a possibility to read the little stripes next to the number with one or another kind of sensor?
Or other options maybe?


texts: Compensating Reactive Power in MV using LV capacitors

texts:
We have a plant including high power medium voltage (6.3Kv) motors. Motors are fed from the 20Kv line using a 20/6.3Kv transformer.
We want to compensate reactive energy in MV side to reduce reactive penalties in our bill. Installing MV capacitor bank near the loads is a costly solution.
A company has suggested installing low voltage (400v) capacitors in our 20/0.4Kv transformer LV side to provide reactive power from LV side to HV and then feed it to MV loads.

It is somehow strange for us as it is not a common solution in the industry. What are the problems with this configuration? How does it affect protections in the system? The LV capacitors are Star-Connected, what are the problems with this configuration compared to Delta-Connected capacitors?


texts:
Each capacitor is \$24\text{nF}\$ and I need to find the voltage on \$C_\text2\$.

\$C_1+C_4=2*24=48nF\$

\$\frac{1}{C_\text{(1+4)||2}}=\frac{1}{C_\text{1+4}}+\frac{1}{C_2}=\frac{1}{16}\$

\$C_\text{(1+4)||2}=16nF\$

\$C_\text{(1+4)||2}+C_5=16+24nF=40nF\$

\$\frac{1}{C_{tot}}=\frac{1}{40}+\frac{1}{24}=\frac{1}{15}\$

So \$C_\text{tot}=15\text{nF}\$ \$Q_\text{tot}=C*V=15nF*48=720\text{nC}\$.

How should I continue to find the voltage on \$C_2\$?

Built the qeustion using CircuitLab how

simulate this circuit – Schematic created using CircuitLab


texts: How does this step up oscillator actually work?

texts:
I watched a Dave jones video on an energy harvester but I'm trying to figure out how the front end of this circuit actually resonates and how that steps up some small input voltage.

Is it a function of C2 and the inductance of the transformer?

Does the frequency that it resonates matter?

What powers the self resonating circuit?

Here is a screen shot of the circuit in question:

The Datasheet can be found here


texts:
I am seeking a very fast (10nsec rise time) transistor based fixed current source that I can use with my CPU. The CPU will use the GPIO to turn on or off the current source.

This will be used to drive an LED. I have looked at several options however I am not able to find something that is really driven by an external GPIO.

I appreciate any pointers..

Update
I currently use a single transistor system works ok, however with temperature and variation in LEDs the current varies from unit to unit which causes problem with distance (some units meet the spec, some don't). Now I like to move to a system where the current is constant and I can use a GPIO to turn the current on or off. 10nsec rise time is desired but I will take 50nsec as well.

Voltage drop on LED is 1.9V, but I have seen up to 2.2V drop. I only have 3.3V available on the system.


texts:
So Im about to set up my first AVR MC experiment (the typical LED Blink)
Im going to be ordering an ATmega328 and a Serial and Breadboard and such.

However i've heard it's a good idea to use some Capacitors to help smoothen out some specific lines.

I've "heard" it's a good idea to use smaller caps CLOSER to the Microcontroller, and then Larger caps near other components. is this true? And what kind (size) caps should I look for? Do I need these for every output pins, or just the VCC?

Thanks


texts:
simulate this circuit – Schematic created using CircuitLab

I am attempting to solve the above circuit for V0. Current and Voltage variables are from me. Thus far I've used KCL to say that $$i_3 = i_2 + i_1$$ and by ideal op amp function, $$ V_1 = 1V $$ $$V_3 = 2V $$

From there I say that $$ \frac{-1}{10k} +  i_2 = \frac{2-V_0}{40k}  $$

But that doesn't really get me any closer to finding V0, what am I missing?


texts:
First, I posted similar question on CPLD/FPGA users forum, however, they do not seem to be as active as StackExchange. So, I hope it will help me to get going with CPLDs and also will be useful information for other starters.

After little research I was convinced to focus on Xilinx CPLDs because, in opinion of some people, it seems to be more student friendly and the vendor provides free software. I do not have a development board or the chip - just trying to simulate first before buying. So, after downloading ISE WebPack software, I begun my first tutorial. I got stuck on the "Implementing a New Top-level Design" step 5. It fails to 'fit' the design:

The log gives me the answer to my error, but I truly do not know what to do next. Although I followed all the steps from the tutorial, there is probably something I am missing? I tried to Floor Plan IO and assign IO pins, but it did not help. Any ideas? Any other good tutorials for absolute starters?

Here's the script:


texts: Why are G and H used for feedback block diagrams?

texts:
The symbols \$G\$ and \$H\$ are typically used for the forward gain and feedback fraction in negative feedback block diagrams like this:

The choice of \$G\$ is, I suppose, an obvious one, meant to be mnemonic for gain.

But \$H\$ I don't get. Is it just because it's the next letter in the alphabet and maybe \$F\$ was already taken? Or is there perhaps a historical reason that might lead one to see it as a less arbitrary choice?

Note:
I understand these symbols are not universally used in these roles. I kind of grew up on \$A_o\$ and \$\beta\$ myself, but as I understand it, \$G\$ and \$H\$ are more common in the control systems world and do have some advantages over other choices. Certainly conforming to a convention has its own benefits, whatever that convention is.


texts: Four layer PCB with dual supply (12V and 5V) and signals

texts:
I'm designing a PCB which controls 4 motors (400mA peak) with H-bridges, a Bill-Validator (using UART to communication) and drives 4 LEDs using 12V dc.

On my 5V power I have a microcontroller, 4 current sensor analog signal (for the motors). I have 1 UART RS-232 (9600 baud), 1 UART TTL (9600 baud), 2 I2C (100 kHz), 8 I/O for free use (only with pull-ups), and 8 inputs with pull-ups and bypass for switches.

I've just decided to use a 4-layer PCB using the following stack-up:

Signal
GND
POWER
Signal

The components are located only on the Top Layer.

However I'm not sure about the POWER plane and how I can layout the signals, so I have some questions:

Shall I use the same POWER plane for 12V and 5V? How can I divide the power plane? 12V and 5V come from different power supplies but they have the same ground.
How can I separate the signals? Shall I use the top layer for communication signals and analog signals, and use the bottom layer for inputs, I/O signals and H-bridge signals? I don't know how I can separate the signals in 2 layers.


texts: Meter fuse availability/substitution conundrum

texts:
I own a Brymen BM235 multimeter, among other test instruments.  While it's a nice multimeter, I have one problem with it: the fuse for the mA jack is a Siba 7017240.0,4, and nobody even bothers with putting this part in their catalog, never mind stocking it.  (Octopart shows no results at all.  That's how bad this situation is.)

However, the adjacent values (315mA and 500mA) in the Siba 7017240 line are stocked.  Given that my BM235 (interestingly enough) says 600mA on the front for the maximum current it can measure using the mA jack, which fuse (315mA or 500mA) should I substitute for the unobtanium 400mA fuse, or should I try to poke Brymen or the distributor I got the meter through about this little conundrum?  Or should I try to find a way to get Siba to point me at where I can get these in the USA? (It's the one fuse I don't have spares on-hand for at the moment -- even though I generally don't blow meter fuses to begin with, and haven't blown the one in the Brymen, I'd rather be prepared in this case.)


texts: How can you change grid voltage in a vaccuum valve?

texts: I understand in a valve the level of amplification is determined by changes in the voltage of the grid or in the anode, but how can you change the voltage of the grid? And can this be done dynamically, so that you have different voltages over time?


texts: What material to use for a capacitive sensor?

texts:
I'm doing a DIY project that I want to use a capacitive sensor for. I'm having a little plastic box and I want to send a wireless message when someone touches the top of it.

I understand all the electronics involved, but I'm clueless towards what to put under the plastic and how to connect a wire to it.

What should I use?


texts: Why does the Zener diode's simulation model differ so much from datasheet specifications?

texts:
I was trying to design a circuit with a Zener diode by using its datasheet specifications and noticed there was a very big difference between the design and the simulated circuit. After inspecting the Zener diode model used by PSpice for the ZY91 diode shown in the figure below, I noticed it differed a lot from the datasheet specifications for the same diode. From the specs we can see that \$r_z = 40 \Omega\$ for the test current \$ I_z = 5 \mathrm{mA}\$, which is the value of \$r_z\$ I used to design the circuit. However, from the figures of the PSpice model for the same diode, we can see that in practice \$r_z \approx 12 \Omega\$ for \$ 0\mathrm{mA} < I_z < 10\mathrm{mA}\$ and that \$r_z \approx 2 \Omega\$ for \$ 10\mathrm{mA} < I_z < 20\mathrm{mA}\$.
I'd like to know if I'm reading the datasheet incorrectly or if there's actually a discrepancy in the model used by PSpice and the datasheet values.


texts: MIMO relationship with OFDM and why are the two that much linked to each other?

texts: Why is OFDM the most suitable waveform for MIMO. Does anyone know of a paper or text book that clearly answers this simple question? I looked into  a  book titled "MIMO-OFDM Wireless Communications with MATLAB" and it doesn't


texts: How can I track where this 471kHz noise is coming from?

texts:
I'm new to EE in general and I just received my first oscilloscope (Rigol DS1102E).

Anyway, I'm building an audio circuit using an Arduino Micro and the infamous SN76489 (info)

OK, so basically I have 8 digital pins from the Arduino tied to the D0-D7 pins of the IC, couple pins for the !CE and !WE and a 3.579 Mhz oscillator tied to pin 14 (clock) of the IC.

I'm able to play tones just fine.

But here is what puzzles me.  Look at the picture and notice that I have what appears to be noise in the 471 kHz range.  That noise is on pin 7 (AUDIO OUT) of the IC.

Since it's in the 471kHz range, I'm assuming that's why I don't physically hear it coming through my speakers.

Also, when I send a 440Hz tone through the speakers, the tone sounds great.  But, I obviously don't see 440Hz on the scope.  But I see it wildly fluctuate.  Like it's combining the 440Hz with the 471kHz.

I can provide more pictures and details if anyone needs it.  Any tips on helping me track this down would be greatly appreciated.

EDIT

Update:  To answer some questions/comments:

I have tried powering the Arduino (and the entire circuit) two different ways.  One with a crappy wall-wart PSU and the other from my USB port of my MacBook Pro.

I have my circuit on a Parallax Pro development board which has a voltage regulator built in.  Not sure of the quality.  However, I have put a 1Mhz crystal oscillator off to the side of the board and the scope reads 1.000Mhz consistently but there is some spiking on each edge.  But, it's consistent.

Also, the Rigol has a 1kHz probe port and when I put the probe on it, the reading shows a stable 1.000kHz frequency with a 50.0% duty cycle.  Image looks solid.  So, I believe the scope should be pretty accurate (at least as far as my limited knowledge can tell).

Plus, the development board has a built in pulse generator of 1, 10, 100, 1000Hz. At 1kHz it shows 1.000kHz with a 50.0% duty (+) and 52.0% duty (-).    Image has a some spikes and jitter but looks "OK" I guess.

Finally, I have done the following to no avail:

1) Removed the oscillator
2) Two different power sources (both do the same)
3) Unplugged and speakers
4) Unplugged the crappy PSU and made sure the cord was nowhere near the scope or probes.

What is odd is that I can now actually play VGM songs and they actually sound really good.  When I play a 440Hz A, it actually sounds like an A.  Even though I can't prove it on the scope because of the noise.

Thanks everyone!


texts: Clock switch in PIC18F4550 doesn't seem to work

texts:
I'm trying to switch from an external 8MHz clock to the internal 31kHz clock on the PIC18F4550.

this is my code

#include <p18cxxx.h>
#include <delays.h>
#pragma config PLLDIV = 2, CPUDIV = OSC1_PLL2, USBDIV = 2,FOSC = HSPLL_HS, FCMEN =  OFF,
IESO = ON, PWRT = OFF, BOR = OFF, VREGEN = OFF, WDT = OFF, CCP2MX = ON, PBADEN = OFF,
LPT1OSC = OFF, MCLRE = ON, STVREN = OFF, LVP = OFF, ICPRT = OFF, XINST = ON, DEBUG = OFF,
CP0 = OFF, CP1 = OFF, CP2 = OFF, CP3 = OFF, CPB = OFF, CPD = OFF, WRT0 = OFF, WRT1 = OFF,
WRT2 = OFF, WRT3 = OFF, WRTC = OFF, WRTB = OFF, WRTD = OFF, EBTR0 = OFF, EBTR1 = OFF,
EBTR2 = OFF, EBTR3 = OFF, EBTRB = OFF

int main(void) {
    long int i = 0;
    PORTB = 0;
    TRISB = 0;
    PORTB = 0;
    OSCTUNE = 0;//use internal INTRC osciallator for 32kHz clock

while (1){

    while (i++ <100000){
        PORTBbits.RB1 = ~PORTBbits.RB1;//toggle RB1 in external clock mode
    }
    i=0;//reset counter i
    OSCCON = 2;//switch clock to 32khz clock
    PORTBbits.RB5 = 1;//set RB5 high while in 32kHz mode
    while (i++<500){
        PORTBbits.RB1 = ~PORTBbits.RB1;//toggle RB1
    }
    OSCCON = 0;//set clock back to exterl oscillator
    i = 0;//reset counter
    PORTBbits.RB5 = 0;//clear RB5 while in external oscillator mode
}
return 0;

}

i hooked up PORTB to a scope to see if the waveform would change but it didnt, which makes me believe that no clock switching took place.
I'm not sure where i'm getting it wrong.

I'm using MPLABX with C18 compiler.

EDITED:


texts:
Can someone explain me the differences between these two RF adapters. I know the one on the right is better (and much more expensive as well) but is there a difference in the functioning of these adapters ?

Thanks a lot.


texts: How to choose the correct fuse in a double paralled battery supply system?

texts:
Suppose I have the following system:

simulate this circuit – Schematic created using CircuitLab

As you can see we have:

Two 500V battery with an estimated 500mohm average internal resistance. Each battery is fused with a fuse having a (cold) 100mohm resistance. This fuse is given by the battery supplier.
The batteries are in parallel and are connected with a suitable cable to a distribution box (B) fused with a 200mohm fuse. Voltage is controlled as to avoid circulation currents in batteries. Protecting each load line with a fuse is better as far as availability is concerned, but a single fuse in the distribution box has been selected as a preferred solution.
The distribution box feeds 3 loads. The total load current is about 200A which means that, after derating, a 300-350 A main fuse is needed.
The wires have a section such that their resistance is negligible compared to fuses and internal battery resistances.

For a short circuit fault:

In A: minimum short circuit current (for each battery, worst case) is 500V/600mohm = 833 A and the battery fuse should cover that scenario, according to the battery supplier.
In B: minimum short circuit current is 500V/800mohm = 625 A which means that, ideally, each battery will supply 312.5 A.

Problem: I need to choose the main fuse

The problem I am facing here is that if I set the main fuse to be able to withstand the rated power and surges of power (read: current) from the batteries, in case of short circuit in B it will open only after several seconds (often in the order of 100s) which will probably damage the cables' insulation.

Assume that the battery fuse is fixed SPFJ 160 A: it can be seen from the datasheet that it opens (in case of a short circuit in poit A of 800 A) after 2 s. However, if a short happens in point B, the short circuit current per battery is 312 A therefore the battery fuses open in 1000s therefore the main fuse should intervene to avoid damages. Since the main fuse is higher rated than the battery fuses, it will be inevitabily slower to burn! This means that it will will not open sooner than the battery fuses in case of short circuit in B. For example, for a 350 A fuse, at 625A short circuit current in B it will blow in 300-400s which may be unacceptable for the cables' insulation.

How should I select the correct main fuse?

All the fuse data I mentioned comes from here.


texts: Description of an op amp circuit with a capacitor.

texts: I have this circuit consisting of an op amp, a resistor, a capacitor and a voltage source. Based on my understanding, all I believe this circuit does is act as an active low pass filter because of the way the capacitor and resistor are set up. Is there a better way to explain what this circuit does?


texts: STM32 external voltage monitor / watchdog - worth it?

texts:
I'm building a device that will have STM32F750, and now thinking about stability in case if power or software will misbehave. As per topic - is it worth it to have an external voltage monitor and watchdog (Diodes Inc. APX823, for example)?

Obviously, STM32 has internal POR and watchdog (independent from main clock) - but will these two cover all the corner cases? Any suggestions?

Some technical details:

USB only powered
3.3V from LDO, Diodes Inc. AZ1117C
External clock is Microchip DSC6001


texts: Electronics power ratings and the IEC C13 (For varying international power sources)

texts:
I travel a fair bit for work and after a fair bit of searching I can't seem to find any decisive answers on a power issue I often run into.

With most computer parts taking the IEC C13 cable(kettle lead) attached to their local plug variant I am curious if a part actually even requires a step up/down converter if the power source in the country is within the tolerances for that particular device. I deal with a fair bit of high end electronics but often have to rely on these, often unreliable, converters for our displays.

An example would be a monitor we use for one of our displays which has the following power ratings on the label.

Just for reference I think this was purchased in the UK and for power source there is no external power brick, I would hazard a guess and say it has to be an internal converter due to the range on the power rating. The device is just a type G (3-pin plug) as is common for the UK to a IEC C13 (Kettle lead) end.

The question boils down to if in another Country would I be able to use the local kettle lead variant with their plug or is a convertor needed EG the US 3/2 pin or the the AUS 3/2 pin. Also if so would there any considerations that need to be made.

I have spoken with suppliers but they aren't willing to discuss to the topic to any major degree as I would likely be re-buying parts after a converter failure and plugging one in the find is possibly a very expensive way.


texts: Multichannel Design - Multiple Rooms not Generating

texts:
This is a follow-up to my previous question on multichannel design. I am now in the layout stage and need to figure out why my repeated schematic sheet (Sensors.SchDoc) is not generating multiple rooms.

After enabling Room Generation in the Project Options dialog for all my schematics, only one Sensors room generated when I expected eight with the appropriate _SX suffix to be appended to all designators and the appropriate net label applied to connect them to the multiplexer channels.

I suspect that this may be caused by the fact that my eight schematic sheets are no longer generating, despite having them appear back when I was still fixing the schematic. I'm not sure why they are no longer replicating since I've kept my top sheet port and bus naming the same.

Since the eight rooms did not generate, I copied & pasted the original Sensors room seven times. From the pictures below you can see that the components designators did update but no net labels were retained. I plan to route one room and copy & paste the rest but I'll need the net labels in order to connect the output channels to the different data & clock inputs of my MUX. Or am I just supposed to route the first one and manually adjust the output lines to connect to different input channels on the MUX, without net labels?

Here is the original Sensors room, the only one that generated, with the appropriate net labels shown.

Here is one of the copied rooms, with no net labels retained.


texts:
I have an output of an LM741 of +-2.5V, I have two more LM741's I wish to take this signal into an arduino due, once with a range of 0-3.3v to get a wide span and then chop the peak off the original signal (+2V to +2.5V) and convert this into 0-3.3V for accuracy.
I've tried rectifying it just to look at the 0-2.5V but I need more resolution at the peak voltage input, when I put the op-amp on the voltage on the original signal changes.


texts:
The VN7004CLH High-side driver with CurrentSense has a pin (CS) that allows one to measure the output current via a microcontroller ADC or similar.
The current can be calculated using the following formula

Notice the need for a k factor.  The k factor is defined in the datasheet as follows:

Does anyone know how I can calculate the k factor?
Does each driver need to be calibrated against a reference and the k factor calculated from that result, (that would not be good).


texts: 4 Wire Strain Gauge to 2 Wire Conversion/Connection

texts:
I have the WK-06-12BT-350 ohm WK125BT Strain gauge from Vishay the Gauge comes equipped with 4 wires ( High endurance lead wires). The following document describes a similar gauge:
Strain Gauge
is it possible to convert the following gauge to a 2 wire connection? are the additional wires negligible? or they might cause measurement errors if left open?

The acquisition machine can accept 2 or 3 wiring scheme but not 4 furthermore the strain gauge will be part of a quarter bridge connection for a fatigue test running at am excitation voltage of 5V

Thank you
Much appreciated


texts: Why do FM radio signals occupy greater bandwidth than AM?

texts:
If a 5kHz baseband signal is modulating an AM carrier wave, the sidebands will be centered around the carrier wave and the the signal will occupy 10kHz bandwidth. AM radio limits the upper modulating frequency to 5 kHz.

But FM signals require a bandwidth of about 200 kHz for the same baseband signal. Why is that so?

EDIT:


texts:
I want to use a rail-to-rail op-amp as a differential amplifier.

The op-amp is supplied by 3.3V and the input signals swings from 0 to 5V. I want the output to swing between 0 and 2.5V.

My question is if the schematic below safe, in the sense that the inputs of the op-amps will not see voltages higher than VCC+0.3V.

I assume it is as the positive side of the input signal goes through that voltage dividers but I am not sure.

simulate this circuit – Schematic created using CircuitLab


texts: Cap touch measurement using digital pin?

texts:
I have previously used dedicated touch pins and connected them across an electrode and been able to easily detect touch. Usually in such a case one wire directly from the pad to the dedicated touch pin would work.

I would like to do the same except the micro I am using is doing a few things and I've only got two digital pins available. Is there a way to do captouch sensing using digital pins?

I only need one pad detection. I can make it fairly big for better sensitivity etc.
Is this possible?

I ask as everything I could find online seems to need analog comparators and relaxation oscillators to make the measurement ( analogue pin on micro).


texts: IGBT half bridge inverter not giving correct output

texts:
I am making a half-bridge square wave inverter using IGBTs (GW20NC60VD) and gate driver HCPL 3120. The input signal for the gate driver IC is taken from an Arduino. The signal is of 60KHz frequency. A 0.1uF capacitor is connected between pin 5 and 8 of IC. The output gate signal is taken from pin 6/7 with a 5-ohm gate resistor attached in series.

15V isolated supply is given to both ICs. A load resistor is connected between the emitter of high side IGBT and the emitter of Low side IGBT. The output is taken across the load resistor which is shown below. A 31 V signal is given across the half-bridge which is to be inverted.

The output signal instead of having a square wave of 50% duty cycle is the signal as shown. The signal also has spikes. Kindly if anybody can tell what is wrong.


texts: Help understanding what RS232 vs TTL option means on ultrasound sensor...?

texts:
Looking at this MaxSonar Ultrasound Sensor, datasheet. Will use it with a Raspberry Pi, powered with 3.3V.

In page two, pin five description, is reads...

  Pin 5-Serial Output: By default, the serial output is RS232 format (0 to Vcc) with a 1-mm resolution. If TTL
  output is desired, solder the TTL jumper pads on the back side of the PCB as shown in the photo to the right.
  For volume orders, the TTL option is available as no-cost factory installed jumper. The output is an ASCII
  capital “R”, followed by four ASCII character digits representing the range in millimeters, followed by a
  carriage return (ASCII 13). The maximum distance reported is 5000. The serial output is the most accurate of the range
  outputs. Serial data sent is 9600 baud, with 8 data bits, no parity, and one stop bit.

I thought RS232 worked with +15/-15 voltage levels, but the datasheet says that the RS232 format is 0 to Vcc, what does this mean? And what makes it different from TTL?

When something is referred to as 'serial', is it implied to be I2C?


texts: Voltage at a point with OR-combination of diode

texts:
I am reading about implementing OR logic using diodes .

In the above circuit voltage drop at D1 and D2 both are 0.7V . So , V0 will be likely both 9.3V and 19.3V.But a single point can't have more than one different voltage. Am I missing something?


texts:
I'm new around here. Usually I read a lot of stuff and find all info I need, but this once I googled my fingers till blood, yet to no avail.

Recently got my hands on PIC16F877A. It wasn't MCU of my choice, I have another PIC, which I couldn't get to do what I want (blinking was not a problem at all), so I decided to get a chip which has a ton of examples. Decided to downgrade myself to copy-pasting examples and running them just to make sure stuff works. Guess what: it still doesn't :D

Platform: Windows 10

Software: MPLab with XC8

Hardware: PIC16F877A, Pickit 4 programmer

Available equipment: Multimeter, Oscilloscope

Experience: I feel comfortable reading datasheets and changing register values, I know what I'm doing usually, so things like "that register controls this and that, take a look at it" are totally clear to me. However, I lack general experience with PIC, so detailed answers are appreciated. After all, it's better to have too much info than lack it like I do right now.

Problem: 8Mhz Crystal with 20pf caps generates 60-63Hz 5Vp-p sine waveform worth the best geometry classes in its shape, thus the chip's not running. All power and all ground pins of the MCU are connected and delivering juice to my not-running puppy. I even bypassed the power supply with a 0.1uF cap, which I usually don't do during early stages of development.

Since you'll probably insist on seeing the code:

// PIC16F877A Configuration Bit Settings

// 'C' source line config statements

// CONFIG
#pragma config FOSC = HS        // Oscillator Selection bits (HS oscillator)
#pragma config WDTE = OFF       // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = OFF      // Power-up Timer Enable bit (PWRT disabled)
#pragma config BOREN = OFF      // Brown-out Reset Enable bit (BOR disabled)
#pragma config LVP = ON         // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
#pragma config CPD = OFF        // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
#pragma config WRT = OFF        // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF         // Flash Program Memory Code Protection bit (Code protection off)

// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.

#include <xc.h>

#include <htc.h>
#include <stdio.h>
#include <stdint.h>
#define _XTAL_FREQ 8000000

void main(void) {
    TRISC = 0xff;
    PORTC = 0xff; //do anything program, I just want to see 5V on pins first
    while(1){
        PORTCbits.RC6 = 1;
        __delay_ms(500);
        PORTCbits.RC6 = 0;
        __delay_ms(500);
    }
    return;
}

Things I tried:
1. Re-seating the crystal and caps. Still get perfect 5Vp-p 60Hz sine wave.
2. Trying XT crystal setting in configuration bits (datasheet says XT setting is up to 4Mhz, so it didn't work with 8Mhz crystal, no wonder)
3. Crying in desperation (most helpful so far, but the chip still doesn't run)

I would be very grateful for any response. Tbh, I couldn't register on microchip forum, the email for my account just doesn't come there and my account is unverified for several days already, so I abandoned that idea. It feels like Microchip and PIC are just signalling me like "you're not wanted here", and after a few days of all kinds of fights with PICs, I was determined at first, but I'm getting a massive demoralization. Hope once I get PIC16F877A running, the examples I "copy-paste" will run.


texts: How do I get an Excellon Drill file with 2.4 precision and trailing zero suppression out of EAGLE?

texts:
I'm trying to output CAM data from EAGLE 6.2.0 to get some PCBs made at Advanced Circuits.  Their preferred NC drill format (particularly the one used by their online FreeDFM tool) is

  Excellon Format, ASCII Odd/ None, 2.4 Trailing Zero Suppression, English Units, No Step and Repeats.

Both their online tool and GC-Prevue are automatically recognizing my NC drill files as 2.3 format with leading zero suppression.  So, while the holes are the correct size, they are strewn about an area 10x larger than the PCB, causing the DFM tool to go nuts and I'm about ready to follow.

Can I get EAGLE to give me 2.4 trailing-suppressed files (or maybe at least no suppression)?  Or, is there a tool that can convert the mangled files EAGLE vomits out to something reasonable?

I've tried using the 'hack' described here in attempt to force no zero suppression, but then my files are detected as 3.3 precision.

My CAM job is defined as:

[Sec_8]
Name[en]="Drill File"
Prompt[en]=""
Device="EXCELLON"
Wheel=""
Rack=""
Scale=1
Output=".NC"
Flags="0 0 0 1 0 1 1"
Emulate="0"
Offset="0.0mil 0.0mil"
Sheet=1
Tolerance="0 0 0 0 0 0"
Pen="0.0mil 0"
Page="12000.0mil 8000.0mil"
Layers=" 44 45"
Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0"


texts:
I am trying to interface a suite of aviation audio headsets to my PC.  The headsets use an electret microphone requiring a voltage bias of 8V - 16V for power.  Each headset plugs into its own instance of the following circuit and USB soundcard and this seems to work well with a 9V supply.

I start having problems when I introduce the second headset and USB soundcard, in particular the application of the 9V to the second headset circuit.
When I apply 9V to the second headset both USB sound cards are dropped by Windows on my PC.  I was initialy connecting the soundcards through a USB hub with ESD protection.  When I connect them directly to the PC however the it causes a fatal error and the PC shutsdown to protect itself from damage.
I think the problem is due to the 9V GND of the PSU being shared with PC/USB GND.
Is there a way to power the electret with the requried voltage and be able to connect the resulting audio signal into a mic input without sharing grounds?
Thanks for your help.


texts: RS-485 module not transmitting LF and CR

texts:
I am working on a project that involves two ATMEGA328p MCUs communicating over long distance (between two floors of a building). One is master and the other one is slave. The master always initiates the communication by sending custom made AT commands which have a Carriage return '\r' and line feed '\n' as terminators at the end.
I am using UART (9600 bps with even parity). Here is what I noticed:
When direct UART is used, everything works as expected. But when I replace the communication path with a very long wire (approx 5-10m) the UART started causing issues.
So I had to use RS-485 modules for obvious reasons.
The problem I am seeing is that the whole AT command is transmitted over the RS-485 path but the two ASCII codes of '\r' and '\n' are not received at all.
I have checked using an FTDI clone that input to the RS-485 transmitter-side module is having CR and LF as expected but at the receiving end (after RS485 to UART conversion), whole command is received except CR and LF.
Please suggest me what to do as my whole software code depends on detection of CR and LF as a protocol. I have gone through many blogs/QAs but couldn't get my issue resolved. It seems like RS-485 module is not sending CR and LF.
These are the two UART functions that work at the lowest level. I have checked that my code always passes 1 as the trm argument
void UART_TxSTRING (char string[], int trm)     //This string function does not sends the NULL character '\0'
{
    int i = 0;
    while (string[i] != '\0')       //Detect end of string
    {
        UART_TxByte(string[i]);
        i++;
    }
    if (trm == 1)                   //if trm=1, terminators will be sent with string
    {
        UART_TxByte('\r');          //Terminator
        UART_TxByte('\n');          //Terminator
    }
}

void UART_TxByte(char tx_data)
{
    UCSR0B  &= ~RXIE;               //Disable Rx interrupts while sending data
    while (!(UCSR0A & TXC_FLAG));   //Check flag before transmitting
    UDR0 = (tx_data & 0xFF);        //Send the ASCII code
    UCSR0B  |= RXIE;                //Enable Rx interrupts again after transmission
}

Update:
I modified the code to replace the CR with @  and replaced LF with $
Still only the termination characters are lost, rest of the command (long or short) is transmitted normally. I am feeling like there is some issue related to timing as the if(trm == 1) statement is causing the RS-485 IC to drop subsequent characters.


texts: proximity sensor technology, range of 150mm

texts:
I am searching for a sensor for an embedded application that senses only presence of metal (steel) at distances of 150mm.  The sensor must be sampled at 500hz (minimum).
I have been searching for an appropriate proximity switch but it looks like the range requirement is outside the bounds of this technology.  I am trying to stay away from optical devices.

What could be an appropriate technology for a sensor detecting metal objects at that range?


texts:
Currently i am using RTL8211E Ethernet Phy in my application. I just wanted to know the importance of internal regulator of the Phy?

As i am using external regulator that is generating 1V0. can i connect that voltage to the DVDD and AVDD having isolation between them using ferrite bead while disable the internal regulator?


texts: Reduce DC power supply for battery charging

texts:
I have a DC power supply from either a WIFI router or printer (not sure) rated for 13.5V @ 1.2A output.
This is a replacement charger for an electric ride on car as it was originally 6V and I've upgraded to a 12Vbattery and system.
Without load, the charger puts out about 14.8V and roughly 14.6V when plugged into the original DC plug to charge the SLA battery.
I'd like to utilise this charger but require a voltage reduction to charge the battery. I'd also prefer 13.5V charging voltage so I don't need to watch the battery temperature all the time, but am concerned about heat dissipation for that kind of voltage drop.
So:

What method is best to reduce the voltage, and/or the most cost effective way? I'd like to stay away from a buck converter if possible. I've also looked into using resistors or a potentiometer as a voltage divider.
What specifically will a resistor affect my charging current, and how much will it drop?
In terms of heat, is it even viable to use a resistor to drop to 13.5V?

Further info can be provided if needed.


texts: Is back emf inductance in a ignition coil circuit symmetric for on/off cases?

texts:
I was trying to understand how an ignition coil circuit works practically, and came upon this website explaining the behavior of an ignition coil when subjected to changes in voltage:
http://www.learnabout-electronics.org/ac_theory/inductors.php

Especially the following paragraph:

  This voltage will however now be much larger than the original supply voltage; this is because the amplitude of a voltage induced into a conductor is proportional to (among other factors) the rate of change of the magnetic field. At switch on, because there were two opposing voltages changing, the supply increasing and the back e.m.f. decreasing, the rate of change was slowed down. However at switch off there is no supply voltage so the magnetic field collapses extremely quickly causing a very rapid rate of change and therefore producing a very large voltage pulse.

What bothers me is that according to my rusty EE knowledge, the equations governing inductance

should lead to symmetric behavior when a switch is closed and opened.
In fact, according to my understanding, the voltage spike shown in the following graph should be in the other direction, as it would oppose the decrease in current. Am I understanding inductors incorrectly, or is there in practice much more to the topic which simple EE theory does not cover?


texts: PIC10F206 MPLAB X IDE v5.40 - Light a LED

texts:
I am trying to light a LED with a PIC10F206, a PICkit4, the IDE MPLAB X IDE v5.40, and the pic-as Assembler.
This is what I tried:
#include <xc.inc>

    CONFIG CP=OFF
    CONFIG MCLRE=OFF

    ORG 0x0000

INIT:
  MOVLW 0010B    ;make GP1 an output pin
  MOVWF TRISGPIO ;move content of working reg to TRISGPIO (this is the first error)
  MOVLW 1101B    ;set GP1 output low so that the LED with pullup res. lights up
  MOVWF GPIO     ;move working reg to GPIO

LOOP:
  GOTO LOOP ;loop forever
END ;needed to end the program

The output is:
error: (800) undefined symbol "TRISGPIO"

I am trying to make GP1 an output pin and set the output of GP1 to 0 because I have the positive power supply on the other side of the LED.
According to the datasheet on page 21 TRISGPIO is a register.
And according to what I read online it is responsible for deciding if a pin is input or output.
So I put the bits 0010B in the working register. (so that GP0 is input, GP1 is output, GP2 is input, GP3 is input)
And then tried to put them into TRISGPIO.
I spent some hours digging through the microchip documentation but it's not really understandable for a beginner and tutorials are no longer valid.


texts: Verilog -- how to assign mux/selector output to module's output

texts:
Verilog beginner here.  Working with Lattice Diamond for a design using the MachXO2.

For context: I recently got this answer to a related question. See the second image in the answer.

I want to implement a dblbuffer module that internally has the two FIFOs as shown in that diagram (FIFO_DC module from their IPExpress; module name is fifo_dc), and externally just has input data / write clock, and output data /read clock (plus some additional auxiliary signals, not relevant to this post/question).

I can't seem to connect the output from the selector/multiplexer to the module's output:

module dblbuffer (data_in, wr_clk, out, rd_clk, save_current);

input wr_clk, rd_clk, save_current;
input [15:0] data_in;
output [15:0] out;

reg selected; // a buffered/synchronized/edge-detection version of save_current
              // (details related to it omitted here for simplicity)

always @(fifo0.Q, fifo1.Q, selected)
begin
    out[15:0] <= (selected ? fifo1.Q[15:0] : fifo0.Q[15:0]);
end

fifo_dc fifo0
(
    .Data(data_in),
    .WrClock(wr_clk),
    .RdClock(rd_clk),
    // ···
    .Q(), // Should I leave Q unassigned, to be used as above?
    // ···
);

fifo_dc fifo1 ....

The synthesizer gives me procedural assignment to a non-register out is not permitted. VERI-1100.

So, I try adding:

reg[15:0] out_wires;
assign out_wires[15:0] = out[15:0];

And now it tells me concurrent assignment to a non-net out_wires is not permitted. VERI-1195.  I thought it was related to the = vs. <=, but trying that with the <= gives me a plain syntax error (syntax error near <=. VERI-1137).

If I simply try reg[15:0] out_wires = out[15:0] it tells me that out is not a constant. VERI-1188.

I hope it's clear what I'm trying to do so that someone can point out the correct syntax (or the correct structure, if what I'm doing wrong goes beyond just syntax).

Thanks!


texts: Getting thevenin equivalent when there's a current source only

texts:
I am stuck in finding the V-thevenin in this circuit.

So what i did first is removed the current source and replaced it with an open circuit. After that i got the Resistance thevenin which is the equivalent resistance of the circuit. R-equivalent = 10 + 20 + 10 = 40. So now how do i get the V-thevenin(thevenin equivalent) ?


texts: Connecting the Block AIM 5.0/2.0 auto-transformer to UK three-wire plug

texts:
I am not electrically very knowledgeable person. At the moment I am trying to connect a Block AIM 5.0/2.5 Auto-transformer to a piece of very sensitive medical equipment. The auto-transformer was purchased to regulate  and supply a constant 220 V (to avoid any fluctuations in the voltage as the medical equipment is very sensitive and recommended to run only at 220 V) to the equipment here in the UK.

Now, very recently the company that checks our equipment for electrical safety has labelled this auto-transformer as FAILED due to "No Earth".

Please see the picture where there are only two input (L and N) wires and two output (L and N) wires connected. The ground (earth) wire of both input and output are left open. Now, what and how can I make this device electrically earthed (or have it pass the electrical safety test)?

Please let me know. I would really appreciate your help.

Thanks a lot.


texts: Non-inverting amplifier input voltages are different, related to limited output range?

texts:
I'm calibrating a pressure sensor and recording output voltage with an Arduino and the non-inverting circuit (recommended in the sensor manual) shown below. Without a load on the sensor (R_flexiforce), a multimeter reads V+ (V_ref) = 0.3 V, V_out = 1.9 V, and V- = 1.9 V. With maximum force on the sensor, the output rails around 4.39 V. We'd like to get a broader force range, since the Arduino goes from 0 to 5 V, and we are trying to figure out why the minimum value is 1.9 V instead of 0 V as we'd expect. The strangest part is that the input op-amp terminal voltages are different.

I tried measuring V- with different resistor combinations, without the capacitor, and with different pressures on the sensor. The only way I can change it is by increasing the reference voltage from about 0.3 V to 1 V, and even that only changes V- by about 0.2 V. Because this is a non-inverting circuit, shouldn't the input terminals have the same voltage? Why is V- equal to V_out? How can we get V- closer to 0 V when there's no load on the sensor? I only have a semester's experience with op-amps and have been puzzling over this for a while.

My values are R_1 = 5.2 kΩ, R_2 = 300 Ω, R_feedback = 60 kΩ, C_1 = 22 pF, op amp is LM741 (instead of MCP6004). R_flexiforce is > 5 MΩ without a load and about 5 kΩ with a full load.

I appreciate your help and time!


texts: Use diode to drop down voltage from ~3.7V for nRF24L01

texts:
I have a RF module (nRF24L01) and Li-ion battery with 3.7V nominal voltage, so when it is fully charged it can be a bit higher than 3.7V (I guess).

RF module can work from 1.9V to 3.6V and draws <13mA.  I know about LDO regulators, but I don't have such, rather don't want to buy it and I want to keep design simple.

So, becasue of 1.9-3.6V and low power consumption can I use simple, regular diode, like 1n4007, on Vcc line, to drop voltage?
Typical voltage drop is 0.7V. I know it varies with current etc. but I only need to lower it a bit and can do it up to 1.9V. So?


texts:
I am trying to simulate a circuit using .subckt directive in Ngspice-26 to define NAND GATE and NOT gate.

I have two separate subckt files for inv and nand as inv.txt and nand.txt which I include in my main file.
When I run the below mentioned code using source file_name.cir in Ngspice, I get the following promt in Ngspice terminal.

Warning: unknown device type: n
Error: too few nodes:  numparm__________00000013

I read about it and there was some bug in NgSpice but was fixed in updated version 26 of Ngspice. Also another point to be noted was that this error occurred only when nand subckt is used and doesn't give error when only inv is used. Also the warning is says about a device type n which I haven't used in my cir file anywhere. Please tell me if I am doing something wrong.

This part of code is the main .cir file.

** DUT Test for NAND **
.include nand.txt
.include inv.txt
.include models.txt

.PARAM Len = 0.4um
.param nWid = 0.60um
.PARAM pWid = 1.55826um
.PARAM vdd = 3.3
.global vdd

vdd vdd 0 vdd
vs  6 0 vdd

xinv1 1 2 inv
xinv2 2 3 inv

xnand1 3 6 4 nand

xinv3 4 5 inv
xinv4 4 5 inv
xinv5 4 5 inv
xinv6 4 5 inv

c1 5 0 0.1pF

vin 1 0 dc PULSE(0 3.3V 0 0.1ps 0.1ps 4ns 12ns)
.tran 0.05ps 8ns
.control
run

plot v(3) 'vdd - v(4)'
.endc
.end

Following is the code for subckt file for nand gate

* Subcircuit for Minimum sized NAND Gate

* CONNECTIONS:   IN1
*                | IN2
*                | | OUTPUT
*                | | |
.SUBCKT nand     1 2 3

*Specifying NMOS in this manner-
*name drain gate source body modelname as in model file

m1 node1 1 0 0 cmosn L=Len W=nWid AD='2*nWid*Len' AS='2*nWid*Len' PD='2*(nWid+2*Len)' PS='2*(nWid+2*Len)'
m2 3 2 node1 0 cmosn L=Len W=nWid AD='2*nWid*Len' AS='2*nWid*Len' PD='2*(nWid+2*Len)' PS='2*(nWid+2*Len)'

m3 3 1 vdd vdd cmosp L=Len W=pWid AD='2*pWid*Len' AS='2*pWid*Len' PD='2*(pWid+2*Len)' PS='2*(pWid+2*Len)
'
m4 3 2 vdd vdd cmosp L=Len W=pWid AD='2*pWid*Len' AS='2*pWid*Len' PD='2*(pWid+2*Len)' PS='2*(pWid+2*Len)
'
.ends nand

Following is the code for subckt file for inverter

* Subcircuit for Minimum sized inverter

* CONNECTIONS:   INPUT
*                | OUTPUT
*                | |
*                | |
.SUBCKT inv      1 3

*Specifying NMOS in this manner-
*name drain gate source body modelname as in model file

m1 3 1  0   0 cmosn L=Len W=nWid AD='2*nWid*Len' AS='2*nWid*Len' PD='2*(nWid+2*Len)' PS='2*(nWid+2*Len)'
m2 3 1  vdd vdd cmosp L=Len W=pWid AD='2*pWid*Len' AS='2*pWid*Len' PD='2*(pWid+2*Len)' PS='2*(pWid+2*Len)'
.ends inv

Link to models.txt file here
Link to inv.txt file here.

Link to nand.txt file, replace inv.txt in above with nand.txt


texts: Quadrature encoder - Most efficient software implementation

texts:
Simply put, I'm controlling a DC-motor with a dual-channel encoder with a microcontroller for a personal project, and I'm trying to find the "best" software-based implementation of the following state-machine given in this TI reference manual:

Before doing any actual research on the topic, I, being a hot-headed idiot, quickly tried to use a (software implementation of a) D-flip-flop to get the motor direction, and then increment or decrement a counter according to the direction. Half C, half pseudo-code here:

uint16_t counter = 0;
uint8_t direction = 0;

void interruptEncoderA(void){
    if(getInput(encoder_a) == 1){
        direction = getPinValue(encoder_b);
    }
    direction ? counter++ : counter--;
}

void interruptEncoderB(void){
    direction ? counter++ : counter--;
}

The interrupts happen on both edges of the corresponding channel. This naive implementation has some very clear problems. For instance, when the motor is going back and forth between the edges of encoder B, it will keep counting on the same direction.

I know that this question may actually be somewhat subjective, or maybe even dependent on hardware architecture. What I'm really looking for are your takes on efficient, elegant and simple solutions. If possible, provide a short description of the pros and cons of your answer, or any other insights which you think might prove useful.

Also, feel free to change how the interrupts work. If it is more suitable to only have one interrupt that fires at each clock edge of either encoder A or B, or maybe if you prefer 4 interrupts (one per edge, per channel), go for it. Just make sure it's obvious.

Also, just to make it clear, this question is about a microcontroller implementation, not HDLs.

This question actually has a really nice solution to this problem. My take on this implementation will be in the answers.


texts: How can I measure voltages using DrDAQ board without building external sensor?

texts:
I just wanted to understand the process of measuring battery...etc. voltages using the DrDAQ device. In their PDF broshure they say:

  Thanks to the power of your DrDAQ you can also use it as  an
  oscilloscope or spectrum analyzer. Just run the supplied  PicoScope
  software and your DrDAQ becomes a singlechannel scope with a 100 kHz
  bandwidth, 8-bit resolution  and the ability to measure voltages of up
  to ±10 volts.

Do I need to have the oscilloscope probe, or would I be able to measure voltages using the "screw" terminal connectors? How would I go about doing that?

Disclaimer: I have read their user manual more than once, but they do not have any instructions for measuring voltages. Their website is full of experiments, but none of them detail the process of measuring battery voltages using DrDAQ.


texts:
I have a question with the following information
"AC motor connected in series to 400v RMS, 40A RMS, pf = 0.707"
It wants me to draw a diagram, my question is:
Can I model the motor as a single phase motor and just draw a motor in series with an inductor and work out the inductance and eventually the capacitance to bring pf unity,
Or does a motor circuit symbol presume an inductance value and can I just label the motor with an inductance?

Cheers


texts: Problem with ground between two batteries and a battery level notificator

texts:
I'm trying to make an inverter (DC to AC), for a university class project.
The DC source is powered from  two DC batteries 12V each, then this provides energy to a SPWM generator which then goes to an H-bridge, then a transformer, and finally to a lowpass filter.
My problem begins with Proteus. When I try to make a battery level indicator, it has to be one for each battery. Besides that, ground must be connected between the (-) terminal of the first battery and the (+) terminal of the second one.
In picture 1 and 2 are the circuits working for each battery, but when I try to connect both with the two batteries connected and the ground, it goes all to 0V as seen in picture 3.
What do I need to do to solve this, but meeting the requirements -ground  between the two batteries and a battery level indicator system for each battery. The LEDs are supposed to turn on when the battery level is less than 11V.


texts: logic input that can handle a higher voltage but output a low voltage?

texts:
I think some logic IC input can handle a range of lower voltage levels but will output at supply voltage...

What is the best way to achieve an input that can handle higher levels but output at a lower level for the next stage?
Some logic ICs or circuits that can do this?

not dealing with high speeds, 5kHz max.

5v logic with 5-10V input range

What about a zener on the input?


texts: Partial response of 1.8inch TFT screen with arduino

texts:
I am trying my hands on LCD screens. So I chose this 1.8-inch TFT LCD screen and tested the same with the TM4c123gxl board using an ST7735 library (adapted from Adafruit) and the screen works perfectly as expected. (Tiva Series 1.8' LCD code).

So for some other project, I plan to use the same screen but with Arduino UNO. So I connected the same and tried to test the graphicstest example packaged with Adafruit library, but unfortunately, it's not working as expected as you can see in the video.

I am using resistor divider network to shift the voltage from 5V logic to 3V.

I have checked the SPI lines with a logic sniffer and they seem to work as expected. And this cannot be noise because it been repeatedly programmed and the behaviour is exactly the same as in the video.

What I am able to conclude is probably I am missing something with configuration
but I have compared the Tiva and Arduino library file and they both seem to configure the LCD with identical values.

So any direction would be of great help since I am out of ideas.


texts: Combined 5V Input/output for charging/discharging a 3.7V rated Lithium Battery

texts:
I am not an electrical engineer but I noticed that many Powerbanks are designed to fail because they allow deep discharging the battery below 3V and then do not charge anymore.

I came up with the idea to build a charging/discharging circuit with a relais and maybe an Arduino. Charging should be done by 5V over USB which seems easy as I just need to scale the voltage down to 4.2V. The deep discharging problem should be solved by measuring the voltage of the battery.

However, I am currently not sure how the manufacturers of such power banks implements simultaneous discharging over the same connector (which is used for charging the battery) e.g. if a smartphone is connected. Because over the same connector the voltage must be also up-regulated to 5V.

Does anyone have an idea how to solve this as a amateur in electronics.


texts: PIC 16F beginner.. difference in program-syntax when using different compilers

texts: As I mentioned, I have just beginned programming pic16f877a. I can now work with 7 segment displays. At present I am using ccs compiler. Nothing wrong with that. But i prefer to be a compiler independent programmer. So i simultaneously want to work in other compilers like IAR or Hitechc. I want to know whether the "program statement declaration in compilers" other than ccs will be different? Please guide me how to approach this thing. I would welcome all forms of suggestions. Thanks in advance.


texts: How is transmission line impedance selected?

texts:
I understand (roughly) why transmission line impedance has to be matched to the source and the load.  What I don't understand is how different technologies have chosen to use different impedance.  (USB is 90 ohms, Ethernet is 100 ohms, PCIe is 85 ohms, amateur radios and antennas are typically 50 ohms).

Was it related to natural impedances for the source or load?  Is there some way to determine the optimal impedance for a whole system if I can control the source, load, and transmission line?


texts: Does anybody know if SIM cards for phones all use the T0 ISO7816 protocol or do some also use T1?


texts:
Now I want to build stuff and I'm really interested in learning things (consider I'm starting from scratch).
So I'm reading all of this website and the following line in this article got me scratching my head for some time:

  [about the power rating of a circuit]
  Likewise, if we have a short-circuit condition, current flow is present but there is no voltage V = 0, therefore 0 x I = 0 so again the power dissipated within the circuit is 0.

I'm quite sure that you can melt stuff when connecting it to both ends of a battery. Not that I tried it myself but even touching both ends of an AAA battery with a metal wire produces sparkles and heat. Is it really correct that there is no power dissipated within the circuit in a short-circuit condition?

Also, I remember  that there couldn't be an electron flow in a circuit if there was no voltage drop between both ends of the circuit. Then, isn't the line I quoted kind of contradictory?


texts: What is the transfer function of a multiple feedback bandpass filter?

texts:
I'm a student in electrical engineering in Belgium and I use a multiple feedback bandpass filter in one of my projects.

I tried to find out the transfer function of this filter and this is what I found:

$$ \frac{V_o}{V_i}=-\left( j\omega C+ \frac{2}{R_2}+\frac{R_1+R_3}{R_1R_2R_3}\cdot\frac{1}{j\omega C} \right) ^{-1} $$

With this expression I made a Bode diagram:

Is that normal that the frequencies other than 1kHz are still amplified (not as much but still) ? Is my transfer function right ?

Thanks !


texts: Making block diagram of an op-amp configuration

texts:
Hi everyone,

I have to make the block diagram of the above configuration. Supposing the input capacitance of op-amp Cin, I've drawn this:

A is the open loop transfer function of the OPA.

B is the voltage divider between C1,C2//R and Cin. V(-)=Vout*B

C is the voltage divider between C1,Cin and C2//R. V(-)=Vin*C

Should it be good?


texts: why we must to follow 50ohm and 100ohm impedance in PCB boards? is it a standard value for all device input and output impedance?

texts: In PCB / PWB boards we are following 50ohm impedance for single ended lines and 100ohm impedance for Differential lines? is it a standard value for all device input and output impedance? Each and every IC internal architecture done by millions of transistors so this impedance values determined by the IC pins connected to which pin of the transistors (BJT/FET)? Could you please help me to clarify this? thanks in advance.


texts: Supply current of Ad5754R is not mentioned on the datasheet. How to calculate the supply if it is not mentioned on the datasheet ?


texts: Is it possible to convert USB 2.0 into USB 3.0?

texts: Are the connection pins the only thing that differs between the two? Or do other major compatibility issues lie within the lines, cables, and software as well?


texts: Holding signal true for x seconds in LabView

texts:
I'm trying to create an automatic startup override system whereby when an ESD override button is clicked, a signal will be held true for 10 seconds overriding my ESD interlocks.

This seems like there really ought to be a simple solution:

Restart Activated.
Set timer to 0 and start.
While Timer < x seconds output true.
Then revert to false and stop timer.

However, I have no idea of how to implement this in LabVIEW so would appreciate some help!

I've tried implementing this using a case with a wait command in it but I'm getting a "member of a cycle" error.


texts: I'm looking for a low-parts-count Arduino  phone & POTS line interface

texts:
[UPDATE - I found a partial solution here - http://www.joes.com/intercom/index.html - it's an intercom, not a full PBX.]

I'm looking for links to circuit design  for an Arduino-controlled mini-PBX that can use traditional analog phones.  I'm looking for something with features like the often-cited Elektor circuit from the early 1990s.

I see lots of schematics and circuit ideas, but Ideally I can find a "telephone shield" that I can plug phones and modems into, then eventually plug that into a phone line for connecting elsewhere, a phone line interface will be easier than trying to get any kind of VOIP stack running on the Arduino, obviously.

FCC registration number shouldn't be required here, as I'm expecting to  plug into a VOIP appliance port, not an real analog phone line.  I do have about 30 surplus Apple-Cat DAAs if I need to use those.

Background/Inspirations:

Sparkfun's ring voltage generator
Telephone Interface Project


texts: USB Mass Storage Device automatic backup system - How many USB Host Controllers are required?

texts:
I am planning a device that takes automatic backup of some instrumentation data from an SDHC card to a portable HDD (USB 3.0 / USB 2.0 removable hard-disk). The idea is to insert the SD card into the case, press a button and copy certain files on the FAT32 formatted SD card to the Hard-disk into a set of pre defined folders.

I am targeting a speed of 480 Mbps. I have only limited knowledge of the USB system. I know that I need a Host Controller (Something like a Vinculum) and a USB hub to create two USB ports.

My doubt is do I need one Host Controller or Two Host Controllers to make the transfer between the two connected USB Mass storage devices operate on High-Speed (i.e 480 Mbps) ?


texts: Capacitor in a circuit with uneven charges

texts:
Is it possible in a circuit that a capacitor has uneven charges on its plates?
I mean Q1 is not equal to -Q2 in a certain instant of time.


texts: How can we make a load that has configurable power factor for 230V AC?

texts:
We are hoping to create a lab for students at our university that requires them to measure the power factor and correct for it.
We are working with 230V AC and have a maximum power of 300W.
We were hoping to create a device that lets us adjust the power factor, but have run into quite a few problems. Our biggest issue is that we require extremely large inductors or resistors to make a significant effect on the power factor.

We were wondering if anyone had any good alternatives. We currently have a fan hooked up that results in a power factor of 0.6, but we were hoping to create something more compact.

Our current design is below, but does not have the correct inductors:

simulate this circuit – Schematic created using CircuitLab


texts: Switching Inductive load with SSR on 240AC

texts:
I am working on building a kiln (approx 7.5kW) and am using a PID to control an SSR that drives a heating element I made from Kanthal wire. The problem I am having is that the heating element is a coil and there is potential for large voltage spikes that could end up on the mains lines in my house from back emf.

I am aware that there are devices such as TVS Diodes and MOVS, as well as, power line filter devices. However, I have never used any of these before so I am unsure about which ratings of any of these I should use.

Can I use TVS Zener diodes to "clamp" the voltage across my inductive load? How do I know what value to use considering this is on mains power (240 VAC)? Or should I use something else?

Any help would be greatly appreciated! Thanks!


texts: How to calculate hysteresis when the OPAMP supply voltage is changing

texts:
I have designed a GSM/GPS based tracker which is installed at my bike. But it is draining battery too quickly.

So, I want to add a cutoff circuit when the bike is not running(battery not charging) for a long time and in addition, the cutoff circuit should reconnect power to load (my tracker) whenever the battery voltage rises to a preset leve (For say 12.6v).

I decided to use an op amp comparator based cutoff circuit. But the problem is I am unable to calculate hysteresis when the supply voltage of the op amp is changing (Because I will power the op amp from the battery itself).

Can I use a comparator hysteresis circuit if I have a variable voltage rail? If not what kind of changes to the circuit would I need to make this functional?


texts: I would like to solve for currents through inductors and the voltage across capacitances of the attached circuit. I am trying to figure out a correct method to solve such circuits which could have the circuit in the image as one of the elements. The voltage is a sinusoidal AC voltage of frequency w. If this problem is simple and there is a reference, please just guide me to that and I can look up and try it further. Thanks a lot in advance :-)


texts: Resistor values on a 12v 10a circuit with LT3045 LDO

texts:
I am currently working on a project that aims to provide 12v 10a in the final output.

I am quite new to EE and wasn't quite sure if I have choose the correct resistors value as highlighted in the diagram below in red.

Could some of the experts here advise and explain so that I could learn and elaborate in the future, thanks alot!

Image courtesy of www.circuitdiagram.org, and redrawn by me

I have redrawn the schematic, hope it helps!


texts: have a motor actuator md120-01-l2-416-091 Input DC18-35V 5A MAX want to increase speed, what do I need to use to accomplish this

texts: Motor actuator DC18-35v +-5A Max, what is best way to increase speed, is used in a chair


texts:
I am using my openbench logic analyser for the first time in a real project. I am not getting valid captures though.

I have the latest client off dangerous prototypes website they recommend for mac. It can see the device & i can get the firmware version in the client.

I hook line 0 & 1 up to the data & sclk lines of my SHT15 temp sensor. Using a test sketch running on my Arduino I get the temp sent back to my serial monitor on the mac.

I capture the data on sniffer and all I get is channel-0 HIGH & channel-1 low for the whole capture this is using triggers to start the capture. The sketch is getting sensor data every 500ms. I have tried changing the sample rate no help. Also connecting the GND off the logic sniffer to GND on my Arduino changes nothing.

I can see the data signal on my oscilloscope with no problems though. The serial monitor is printing the correct temp as well

Can anyone point me in the correct direction please. I want to use the datasheet to come up with my own code to get the information off the SHT15 using logic sniffer to debug as I go

Thanks,


texts:
I was looking at the spec sheet for the ATTiny2313A microcontroller and it specifies an absolute maximum rating for the DC current through each IO pin at 40mA, and the maximum DC current through the ground/Vcc pins at 200mA.

I'm planning on using this micro controller to drive some LED displays, so there could be potentially a significant amount of current being sourced/sinked. I know I absolutely should keep the currents below the absolute maximum rating, but preferably I'd like to keep this below a recommended level, which unfortunately there's none listed.

The same goes for a variety of other IC circuits (logic shift registers, analog switches, multiplexers, etc.) I looked into using for driving the LED displays, which only list absolute maximum current ratings.

So my question is what is generally a good safety margin for different IC circuits which only list absolute maximum current ratings? Can I bump right up to 40 mA* and be perfectly safe? Or do I want a comfortable safety factor of 2x, 3x, etc.?

*note: I'm assuming I never actually exceed 40 mA, for example a 35 mA nominal value with a 5 mA variance.

post-note: I know that there exist specially designed constant-current LED drivers, however I think this is still a relevant question for driving other components.


texts: Switch 12V and 24V low current load (LED button) with 3.3V and 5.0V arduino

texts:
I am trying to control a 12V and 24V LED inside a push button like the one below.

I have tried with transistors and today with mosfets.

Problem: I cant make the LED fully turn OFF and ON as it would when applying directly the 12V or 24V power source to the LED directly.

(I have two versions of the pushbutton LED, 12V and 24V and I would like to learn how to design the different circuit for each to control them)

I have measured the LED consumption when feeding:

12V directly and the current is 3mA
18v its 5mA

I have tried the following n channel mosfets:

IRLML2502 smd
13NM60N

These are the buttons:

I have tried this link schematic and various others, but the LED always stays dimmed on and will not make much diference on the gate voltage change.
I have also tried this schematic without the 27ohm resistor
I have also tried it without resistors
I have also tried it with only a pulldown 10k resistor

Driving LED strip from microcontroller

My only though is that the LED is not a plain LED as I can drive it with a 12V without additional resistor. I measured the resistance of the LED terminals and its Mohms, so I guess no current flows when joining LED + mosfet. Anyway, there must be a way of doing this right.

Additionally, I would like to control it via a 3.3V or 5.0V arduino output. All tests so far have been done with 5V


texts: Arduino Dimmer Shield Schematics Interpretation

texts:
I've read so much about Thyristors, Triacs and Rectifiers on the last days that I'm almost understanding my schematic, but I'm not there yet - I need some help.

Overview: I'm making a home automation project, with Android and Arduino. To make that happen I'm using this Dimmer shield. Everything is working fine, i.e., I'm being able to variate the intensity of the lamp of my room from a SeekBar on my cell.

Problem: I want to understand how the dimmer shield works by reading and interpreting its schematics, which you can see here.
Somewhat larger version here

Original here:

Dimmer Shield basic functionality: If you checked the photo of the dimmer shield on the link above you saw that there are four terminal block. Two are called "Vac" and two are called "LOAD". On the "Vac" terminals we simply connect the power source (127V - alternate current), and on the "LOAD" terminals we connect the load, i.e., the lamp. Once the four cables pluged and the dimmer Shield is connected to the Arduino, everything works well.

How far I'm in interpreting the schematics: Ok, I'll try to be clear here. My fundamental problem/question is to understand how charge/electricity flows on the shield.

My first question was: Where are the power source cables connected? And the LOAD cables?
After a lot of thinking, I assumed that:

a) The power source is connected to the terminals MKDSN1,5/2-5,08 X1-1 and MKDSN1,5/2-5,08 X1-2;

b) The load (lamp) is connected to the terminals MKDSN1,5/2-5,08 X2-1 and MKDSN1,5/2-5,08 X2-2

This first assumption is correct?

If it is correct, that's how I'm thinking to undertand the charge flow (please correct me and/or advises a better way to do it If you know): let's assume for a moment, as this will change as the frequency, that the voltage is negative on MKDSN1,5/2-5,08 X1-1 and positive at MKDSN1,5/2-5,08 X1-2. Then, eletric charge would start to flow from MKDSN1,5/2-5,08 X1-2.

On the first note (right above the rectifier on the schematics), the charge would divide  to the rectifier and to the next node (below the 1K resistor). Seeking the rectifier part, there is only one way where the charge can go - it will pass the two 100K resistors, then the 4N25M Semiconductor Transistor Output Optocouplers, enter again on the back of the rectifier, and there it is another node, and a big question: If the charge can go directly to the ground (resistance zero), why It will pass through the lamp (which I assume offers a minimum resistance)?

I'll stop here. I'm happy I've done some improvement on the last days but I will really be thankfull If someone can explain this to me.

Thanks,

If there is any help, here It is the Arduino Sketch:

int AC_LOAD = 3;
int dimming = 125;
char incomingByte;
String numberReceivedInStringFormat = "";
int numberReceivedInIntFormat = 10;
int lastValidNumber = 10;
boolean notUsed = false;

void setup(){

    Serial.begin(9600);
    Serial1.begin(9600);
    pinMode(AC_LOAD, OUTPUT);
    attachInterrupt(0, zero_crosss_int, RISING);

}

void zero_crosss_int(){

    int dimtime = (65*dimming); // 65 equivale a 1 de 128
    delayMicroseconds(dimtime); // Off cycle
    digitalWrite(AC_LOAD, HIGH); // disparando o Triac
    delayMicroseconds(8.33); // Aguarda o tempo de disparo
    digitalWrite(AC_LOAD, LOW); // finaliza o pulso do Triac

}

void loop(){

    while(Serial1.available() > 0){

        incomingByte = (char) Serial1.read();
        numberReceivedInStringFormat += incomingByte;

        if(Serial1.available() == 0){

            numberReceivedInIntFormat = numberReceivedInStringFormat.toInt();

        }

    }

    numberReceivedInStringFormat = "";

    if(numberReceivedInIntFormat < 10 || numberReceivedInIntFormat > 99){
        numberReceivedInIntFormat = lastValidNumber;
    } else{
        lastValidNumber = numberReceivedInIntFormat;
    }

    dimming = (int) (((-115 * numberReceivedInIntFormat) + 12275)/89);

    Serial.println(dimming);

    if (notUsed){
        delay(30);
    }

}


texts: Powering 5V external sensors from 3V Coin Cell Embedded System

texts:
I have a customized circuit using ATMEGA328p with Arduino Boot-loader to develop a Wireless Sensor Network which sends readings from a JSN-SR04 Ultrasonic Sensor to another node via nRF24L01+ wireless modules. Now, I am running the ATMEGA328p in low-power mode so that it can run on as low as 2.4V which is the voltage of coin cells when they run out. nRF24L01+ module is also capable of running of voltages as low as 2.4V so all is good till this part. I have tested and the circuit works without any flaws.

I am stuck on how to power the Ultrasonic sensor which requires a very stable 5V voltage supply and will not work below 4.7V. The only power source I have on the circuit is a CR2450 Coin Cell (640 mAh). Below are the few things that I tried:

1- Used a DC-DC converter to step up the voltage level to 5V but the DC-DC converter requires a huge starting current which the Coin Cell cannot provide and hence it does not work.

2- Used two Coin Cells in series but the voltage goes upto 6.6V since, the voltage of a new coin cell is 3.3V. This might destroy the ATMEGA328p which has a maximum input voltage of 6V.

So what I need is something to step up the voltage of Coin Cell to 5V without requiring a huge starting current and can be disabled so that its quiescent current (normally 1 to 10 mA) can be cut-off to maximize battery life. I can also use two Coin Cells and step down the voltage through something suggested, but efficiency and Battery life should be maintained.

Anyone working with low-power electronics, please suggest me what is the most efficient way of working with Coin Cells to power external Sensors. Thanks!


texts: Having trouble implementing a 1Hz blinking light on a Spartan 6 FPGA

texts:
I currently have a Spartan-6 FPGA in a Digilent Nexus 3 board.
I am using Xilinx 14.6 Project Navigator to write the code and program the FPGA.

My code for the top (and only) module is the following:

21 module blinker(
22 input clk,
23 output reg led_state
24 );
25
26 reg [31:0] count;
27 wire count_max = 32'd50000000;
28
29 assign count_next = (count_next > count_max) ? 32'd00000000 : count + 32'd00000001;
30 assign led_next = (count == count_max) ? ~led_state : led_state;
31
32 always @(posedge clk)
33 begin
34    count <= count_next;
35    led_state <= led_next;
36 end
37
38 endmodule

According to the Nexus 3 reference manual, the board has a 100MHz Oscillator at pin V10, and so in my User Constraints File, I mapped the V10 pin to the clk input signal of my module.

Since the oscillator is at 100MHz, I set count_max to be 50,000,000, so that the led_state should invert every 50 x 10^6 clk edges, or every half-second assuming 100MHz.

When I attempted Synthesis using XST in the Project Navigator, I get these warning messages:

WARNING:HDLCompiler:413 - "C:\Users\Public\Documents\Xilinx Projects\blinker\blinker.v" Line 29: Result of 32-bit expression is truncated to fit in 1-bit target.
WARNING:Xst:2404 -  FFs/Latches <count<31:1>> (without init value) have a constant value of 0 in block <blinker>.
WARNING:Xst:2170 - Unit blinker : the following signal(s) form a combinatorial loop: n0011<0>.

However, I am still able to go ahead and build the .bit file and program the Nexus 3.  The result, however, is that the LED, which I designated to by the output, simply stayed on the entire time (unless it is blinking so rapidly that I do not notice it blinking).

I thought that maybe it has to do with the Warning where the Synthesizer truncated the expression in Line 29, so I tried declaring count_next as a 32-bit vector [31:0], both as a reg and a wire, and also initializing its value.  Tried the Synthesizer and I get errors instead.

Declaring and initializing count, led_state, count_next, led_next didn't work either.

I was wondering if someone can look at this and tell me what's wrong with the code.  There's also a combinatorial loop for the signal "n0011<0>" which I don't recognize.


texts: Add LED Indictor lights to 3 or 4 way battery selector switch

texts:
Situation: Two battery banks in a solar setup (12VDC).  A main DC set of circuits (lights, pump etc) can be powered by either of the banks through a three way selector switch (Bar1, Bat2 or Off - high amp rating).  The battery banks share a common ground. I do not have access to the system for a couple of weeks so cannot experiment.
Problem:  I would like to add in LED indicator lights (for example I have a number of 12Vdc LEDs (with built in resistors)) to show which of the two battery banks is selected.  This would be easy if this only involved DPDT toggle switches or if the two ground circuits where isolated.  I have not been able to find any examples and am not sure if it is possible.  To further complicate the problem, there is another similar circuit with a 4-way switch (including a "both" option).  Thanks for any help


texts: Circuits newb needs someone to help with a diagram

texts:
I'm trying to build an OBDII circuit for a STN1110 chip from OBD Solutions. My problem is I don't understand some of the values needed. For instance, the datasheet has most of the information I need, but in the ISO transceiver I cannot understand what the Q's are or what their values need to be. Also how do I tell what the right LM339 chip is? There are like 6 different versions on mouser.

Also, if anyone can tell me the difference between DLC_RAW and just DLC I would appreciate it...


texts: Measuring very small changes in resistor network using current source

texts:
I am trying measure a very small change in resistance (approximately .400 Ohms), due to the the effects of connecting a large resistance in parallel with a network of smaller resistors essentially looking like this

The voltage drop across A and B however cannot exceed 0.5V, I consider using a AD8276 in the following configuration to create a constant current source. I got this design from http://www.analog.com/library/analogDialogue/archives/43-09/current_source.html figure 5 without the transitor.

My problem is that the difference in current through the load (in my case the first diagram) when the measured R is connected and not connected is 1.388mA and 1.3912mA respectively (approximately). To achieve these currents the range of Vref is extremely small, when R2 =1K the swing is 1.354926V and 1.35726V. The range grows as you increases R2 and R1 but Vref also increase.

I want to do this measurement in house and it will only ever be done in this configuration so I don't want to have to buy expensive equipment, I was hoping to be able to build a circuit to do this. do you think my original idea would work (AD8276 current source) I just need a method to control Vref, or do you think there is another method.

Thanks for the second pair of eyes.


texts:
For my assignment I got to run a transient analysis for the duration of 5 periods of sinusoidal input voltage and display the input voltage (ac + dc) and the output voltage on the RL component.
Used components are : (VSIN)-amplitude 5 V and frequency 60 Hz, DC voltage
(VDC) amplitude 20 V, resistor R = RL = 500 Ω,  Zener diode D1N750 and ground
(GND_EARTH) (First picture)
I do not know how to set number of periods of sinusoidal input to five and how to get
comparison of the input and output voltages like the one shown in the second picture.
Thank you in advance.